Last updated on January 1, 1970

1 min read

Method eth_getAssetBalance undefined ()
connect with JSON-RPC protocol

eth_getAssetBalance

info-circle-fill

Method not allowed

info-circle-fill

In addition to the standard Ethereum APIs, Avalanche offerseth_getAssetBalance to retrieve the balance of first class AvalancheNative Tokens on the C-Chain (excluding AVAX, which must be fetched witheth_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": ["0x8723e5773847A4Eb5FeEDabD9320802c5c812F46", "latest", "3RvKBAmQnfYionFXMfW5P8TDZgZiogKbHjM8cjpu16LKAgF5T"],
"id": "getblock.io"}'

Response

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

Start Building with GetBlock RPCs for Free