avm.getBalance

Get the balance of an asset controlled by a given address. Get information about an asset.

Parameters:

  • address - string - The owner of the asset

  • assetID - string - The id of the asset for which the balance is requested.

Returned Value:

  • balance - int - The balance given the address and assetID.

  • utxoIDs - array - An array of utxoIDs (if applicable).

Example Response:

{
    "jsonrpc": "2.0",
    "result": {
        "assetID": "FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z",
        "name": "Avalanche",
        "symbol": "AVAX",
        "denomination": "9"
    },
    "id": 1
}`
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.getBalance",
  "params" :{
      "address":"X-avax18jma8ppw3nhx5r4ap8clazz0dps7rv5ukulre5",
      "assetID": "2pYGetDWyKdHxpFxh2LHeoLNCH6H5vxxCxHQtFnnFaYxLsqtHC"
  }
}'

Last updated