Listing balances

Read the current balance of every currency held on your account.

account.balance.getMany returns the current balance of every currency you hold a non-zero amount of.

Request

POST /account.balance.getMany

No request body — this endpoint takes no input.

Response

{
    "data": [
        {
            "id": "01a694ab-b2cb-43b4-b048-1ab9115ff052",
            "account_id": "7724b470-552f-4d57-bfbf-f461fb620e73",
            "balance": { "value": "1500000000", "code": "AUD", "decimals": 6, "metadata": "{}" }
        },
        {
            "id": "8f2c1e77-4a90-4b21-9a3d-2c7e5f0b1d64:ethereum:USDT",
            "account_id": "7724b470-552f-4d57-bfbf-f461fb620e73",
            "balance": {
                "value": "1490000000",
                "code": "USDT",
                "decimals": 6,
                "chain": "ethereum",
                "metadata": "{\"address\":\"0x3085…aB1A\",\"connector\":\"com.trustwallet.app\",\"external_account_id\":\"8f2c1e77-4a90-4b21-9a3d-2c7e5f0b1d64\"}"
            }
        },
        {
            "id": "8f2c1e77-4a90-4b21-9a3d-2c7e5f0b1d64:arbitrum:USDT",
            "account_id": "7724b470-552f-4d57-bfbf-f461fb620e73",
            "balance": {
                "value": "40054",
                "code": "USDT",
                "decimals": 6,
                "chain": "arbitrum",
                "metadata": "{\"address\":\"0x3085…aB1A\",\"connector\":\"com.trustwallet.app\",\"external_account_id\":\"8f2c1e77-4a90-4b21-9a3d-2c7e5f0b1d64\"}"
            }
        }
    ]
}
  • Only currencies you hold are returned — zero balances are filtered out, so an empty account returns an empty array.
  • balance.value is the smallest unit at the returned decimals precision, as a string. Use a BigInt or decimal library — never Number — to avoid precision loss. balance.code gives the currency.
  • balance.decimals gives the precision of that value — always use the decimals from the response to convert balance.value to a display amount (balances can be reported at a higher precision than the currency's display convention, e.g. fiat at 6 decimals).
  • id is opaque. It is unique within a response, but it is not a resource handle — there is no endpoint that takes it, its format differs between the two balance sources below, and it may change. Use it as a list key; never parse it.
  • balance.metadata is a JSON-encoded string, not an object. Call JSON.parse on it before reading fields. Custody balances return "{}".

Two sources of balance

The response mixes two kinds of row:

  • Custody — held by the platform on your behalf. id is a UUID, metadata is "{}", and fiat rows carry no chain. These are the balances a swap or payout spends.
  • Connected wallet — read live from chain for every Web3 account you have connected. There is no stored row, so id is derived rather than a UUID. metadata carries address, connector, and external_account_id.

The same code therefore appears more than once — once per chain, per connected wallet, plus the custody row. Key on the (code, chain, metadata.address) tuple, never on code alone:

const parsed = data.map((b) => ({ ...b, metadata: JSON.parse(b.balance.metadata) }));

const key = (b) => `${b.balance.code}:${b.balance.chain ?? "custody"}:${b.metadata.address ?? "custody"}`;

Refreshing

Balances change asynchronously when transactions settle. Two recommended patterns:

  • Webhook-driven — subscribe to webhooks and refetch balances when a transaction.updated event reports status: "COMPLETED".
  • On-view — refetch when the user opens the balance screen. Avoid polling on a tight loop; nothing changes between settlements.

Computing display amounts

function toDisplay(amount: string, decimals: number): string {
    const big = BigInt(amount);
    const negative = big < 0n;
    const abs = negative ? -big : big;
    const s = abs.toString().padStart(decimals + 1, "0");
    const whole = s.slice(0, s.length - decimals);
    const frac = s.slice(s.length - decimals);
    return `${negative ? "-" : ""}${whole}.${frac}`;
}

toDisplay("250000000", 6); // "250.000000"  (USD at 6-decimal ledger precision)
toDisplay("1500000000", 6); // "1500.000000"  (AUD)

// Or map over the response:
data.map((b) => toDisplay(b.balance.value, b.balance.decimals));

Decimals per currency are listed in the API reference.