Links

avm.getAllBalances

Get the balances of all assets controlled by a given address.

Reference: Here

Parameters:

address - string - Address you want to fetch balances for.

Returned Value:

  • balances[] - object
    • asset - string - The symbol of the asset
    • balance - int - The balance of the asset.
{
"jsonrpc": "2.0",
"result": {
"balances": [
{
"asset": "AVAX",
"balance": "102"
},
{
"asset": "2sdnziCz37Jov3QSNMXcFRGFJ1tgauaj6L7qfk7yUcRPfQMC79",
"balance": "10000"
}
]
},
"id": 1
}
mainnet
testnet
curl https://mainnet.avalanche.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ext/bc/X \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id" : 1,
"method" :"avm.getAllBalances",
"params" :{
"address":"X-avax1c79e0dd0susp7dc8udq34jgk2yvve7hapvdyht"
}
}'
curl https://fuji.avalanche.validationcloud.io/v1/<YOUR_API_KEY_HERE>/ext/bc/X \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc":"2.0",
"id" : 1,
"method" :"avm.getAllBalances",
"params" :{
"address":"X-avax1c79e0dd0susp7dc8udq34jgk2yvve7hapvdyht"
}
}'