You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Developers/API.md
+52-26Lines changed: 52 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ METHOD| PATH | DESCRIPTION
49
49
`GET` |`/chain/hashrate/:windows`| Show current hashrate based on latest `n` blocks
50
50
`GET` |`/chain/hashrate/chart/:from/:to/:window`|
51
51
`POST` |`/chain/append`| Append mined block
52
-
`GET` |`/account/:account/balance`| Show balance of specific account
52
+
`GET` |`/account/:account/balance/asset/:asset`| Show balance of specific account for an asset
53
53
`GET` |`/account/:account/history/:beforeTxIndex`| Show transaction history of specific account
54
54
`GET` |`/peers/ip_count`| Show peer IPs
55
55
`GET` |`/peers/banned`| Show banned peers
@@ -374,36 +374,62 @@ Example output of `/chain/hashrate/100`
374
374
Append mined block. Miners must POST mined block they received from `GET /chain/mine/:address`.
375
375
TODO: Detailed description
376
376
377
-
### `GET /account/:account/balance`
377
+
### `GET /account/:account/balance/asset/:asset`
378
378
379
-
Show balance of specific account. Example output:
379
+
Show balance of an account for a specific asset. The `:account` parameter is the account address, and `:asset` is the asset identifier (e.g., `asset:0e4825efffa294610d2ac376713e3bcc9b53d378e823834b64e5df01f75d3b0c`).
380
+
381
+
#### Balance Types
382
+
383
+
The API returns three balance types:
384
+
385
+
| Type | Description |
386
+
|------|-------------|
387
+
|`total`| The total balance of the account |
388
+
|`locked`| Balance locked in open orders |
389
+
|`mempool`| Balance currently used by pending transactions in the mempool |
390
+
391
+
Spendable amount is `total - locked` and can be reused for new transactions. If `total - locked` is sufficient but `total - locked - mempool` is not, the system may evict lower-fee transactions from the mempool to make room for a higher-fee transaction.
0 commit comments