Skip to main content

View Account Balances

The Accounts contract provides the following views:

balance

Get the account balance of a specific account.

Parameters

  • ParamAgentID: account's AgentID.

Returns

A map of token ID -> amount (the base token is identified by an empty token ID).

Examples

balances := chain.L2Assets(agentID)

totalAssets

Get the total funds controlled by the chain.

Returns

  • A map of [token_color] -> [amount] .
balances := chain.L2TotalAssets()

accounts

Get a list of all accounts that exist on the chain.

Returns

A list of accounts (Agent IDs).

accounts := chain.L2Accounts()