Accounts API¶
Endpoints for querying account balances and block chains.
List All Accounts¶
Returns all accounts known to the node.
Response¶
[
{
"address": "a1b2c3d4...",
"balances": {
"XE": "1000000",
"XUSD": "500000"
},
"block_count": 42,
"frontier": "e5f6a7b8..."
}
]
| Field | Type | Description |
|---|---|---|
address |
string | Hex-encoded ed25519 public key |
balances |
object | Map of asset name to balance (string-encoded integer) |
block_count |
integer | Number of blocks in this account's chain |
frontier |
string | Hash of the most recent block (chain tip) |
Balance encoding
Balances are returned as strings to avoid JSON number precision issues with large values. Parse them as arbitrary-precision integers.
Example¶
Get Account Balance¶
Returns the per-asset balances for a single account.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
address |
string | Hex-encoded ed25519 public key |
Response¶
Returns a map of asset name to balance. Only assets with non-zero balances are included.
Errors¶
| Status | Description |
|---|---|
| 404 | Account not found |
Example¶
Get Account Chain¶
Returns the full block chain for an account, ordered oldest to newest.
Path Parameters¶
| Parameter | Type | Description |
|---|---|---|
address |
string | Hex-encoded ed25519 public key |
Response¶
[
{
"type": "claim",
"account": "a1b2c3d4...",
"previous": "0000000000000000000000000000000000000000000000000000000000000000",
"balance": "1000000",
"asset": "XE",
"representative": "d4e5f6a7...",
"timestamp": 1709500000000000000,
"signature": "b8c9d0e1...",
"hash": "f2a3b4c5...",
"pow_nonce": 12345
},
{
"type": "send",
"account": "a1b2c3d4...",
"previous": "f2a3b4c5...",
"balance": "900000",
"destination": "e5f6a7b8...",
"amount": "100000",
"asset": "XE",
"representative": "d4e5f6a7...",
"timestamp": 1709500060000000000,
"signature": "c1d2e3f4...",
"hash": "a5b6c7d8...",
"pow_nonce": 67890
}
]
Returns an array of Block objects. The first block in the array is the account's genesis block (a claim or receive), and the last is the frontier.
Errors¶
| Status | Description |
|---|---|
| 404 | Account not found |
Example¶
Related Pages¶
- Blocks API -- block submission and the Block object format
- Accounts and Keys -- how addresses are derived from ed25519 keys
- Block Types -- the eight block types and their fields