Account

Get an Account's Balance

Get an array of all AccountBalances for an AccountIdentifier and the BlockIdentifier at which the balance lookup was performed. The BlockIdentifier must always be returned because some consumers of account balance data need to know specifically at which block the balance was calculated to compare balances they compute from operations with the balance returned by the node.

It is important to note that making a balance request for an account without populating the SubAccountIdentifier should not result in the balance of all possible SubAccountIdentifiers being returned. Rather, it should result in the balance pertaining to no SubAccountIdentifiers being returned (sometimes called the liquid balance). To get all balances associated with an account, it may be necessary to perform multiple balance requests with unique AccountIdentifiers.

It is also possible to perform a historical balance lookup (if the server supports it) by passing in an optional BlockIdentifier.

post/account/balance

Request body

network_identifierNetworkIdentifier required— unresolved $ref
account_identifierAccountIdentifier required— unresolved $ref
block_identifierPartialBlockIdentifier — unresolved $ref
currenciesCurrency[] — unresolved $ref

In some cases, the caller may not want to retrieve all available balances for an AccountIdentifier. If the currencies field is populated, only balances for the specified currencies will be returned. If not populated, all available balances will be returned.

Response

Expected response to a valid request

block_identifierBlockIdentifier required— unresolved $ref
balancesAmount[] required— unresolved $ref

A single account may have a balance in multiple currencies.

metadataobject

Account-based blockchains that utilize a nonce or sequence number should include that number in the metadata. This number could be unique to the identifier or global across the account address.

Changes