⚡ Test Our Private Nodes of 40+ Blockchains just for $50!

coins coins coins coins
avax
Avalanche (AVAX)

Method: POST eth_getAssetBalance

dropdown

# eth_getAssetBalance example for Avalanche (AVAX)

POST eth_getAssetBalance

Method not allowed

In addition to the standard Ethereum APIs, Avalanche offers eth_getAssetBalance to retrieve the balance of first class Avalanche Native Tokens on the C-Chain (excluding AVAX, which must be fetched with eth_getBalance).

Parameters

address - string

owner of the asset

blk - blkNrOrHash

blk is the block number or hash at which to retrieve the balance

assetID - string

id of the asset for which the balance is requested

Request

curl --location --request POST 'https://avax.getblock.io/mainnet/ext/bc/C/rpc' \
--header 'x-api-key: YOUR-API-KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"jsonrpc": "2.0",
"method": "eth_getAssetBalance",
"params": [null, null, null],
"id": "getblock.io"}'


Response

{
    "result": "null",
    "id": "getblock.io",
    "status_code": 405,
    "message": "Method not allowed"
}