On this page

Account Balance (HD Wallet)

API-v2account_balance

The account_balance method fetches a paginated snapshot of addresses generated from a specific HD-wallet account (for a coin that was previously activated with HD-wallet derivation method) and the balance of each address. It is the low-level (non-task-managed) variant of the task::account_balance::* family.

ParameterTypeRequiredDefaultDescription
coinstringCoin ticker (e.g., BTC, ETH, KMD).
account_indexnumberBIP-44 account number to inspect (usually 0).
chainstringBIP-44 chain: External (receiving) or Internal (change).
limitnumber10Maximum number of addresses to return per page.
paging_optionsobjectEither { "from_id": <address_id> } or { "page_number": <n> }. If omitted, the first page (page_number = 1) is returned.

ParameterTypeDescription
account_indexnumberAccount number that was queried.
derivation_pathstringRoot derivation path of the account (e.g., m/44'/0'/0').
addresseslistA list of objects containing each derived address and its balance.
page_balanceobjectCombined balance of all addresses in the current page.
limitnumberPage size that was applied.
skippednumberNumber of addresses skipped before the first item in addresses.
totalnumberTotal number of known addresses for the account/chain.
total_pagesnumberTotal number of pages based on total and limit.
paging_optionsobjectEchoes the effective paging options that were used to generate this page.

Each element of the addresses list has the following structure:

ParameterTypeDescription
idnumberSequential index of the derived address
addressstringBech32 / base58 / hex address string
balancestringSpendable balance for the address

Account Balance

POST
account_balance
{
  "mmrpc": "2.0",
  "userpass": "RPC_UserP@SSW0RD",
  "method": "account_balance",
  "params": {
    "coin": "BTC",
    "account_index": 0,
    "chain": "External",
    "limit": 5,
    "paging_options": {
      "page_number": 1
    }
  },
  "id": 0
}

ParameterTypeDescription
NoSuchCoinstringCoin is not activated.
CoinIsActivatedNotWithHDWalletstringCoin was enabled without HD-wallet derivation method.
UnknownAccountstringaccount_index does not exist.
InvalidBip44ChainstringUnsupported chain value.
AddressLimitReached | GapLimit...stringAddress-generation limits reached (see error message for exact cause).
Transport | Internal | TimeoutstringOther runtime errors.