Skip to content

Accounts API

Endpoints for querying account balances and block chains.

List All Accounts

GET /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

curl http://localhost:8080/accounts

Get Account Balance

GET /accounts/{address}/balance

Returns the per-asset balances for a single account.

Path Parameters

Parameter Type Description
address string Hex-encoded ed25519 public key

Response

{
  "XE": "1000000",
  "XUSD": "500000"
}

Returns a map of asset name to balance. Only assets with non-zero balances are included.

Errors

Status Description
404 Account not found

Example

curl http://localhost:8080/accounts/a1b2c3d4.../balance

Get Account Chain

GET /accounts/{address}/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

curl http://localhost:8080/accounts/a1b2c3d4.../chain