Marketplace has launched, further enabling blockchain developers! Learn more

Contents

avm.getBalance RPC method

The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.

Parameters:

  1. address - String - The owner of the asset
  2. assetID - String - The id of the asset for which the balance is requested.

Returns:

  1. balance - int - The balance given the address and assetID.
  2. utxoIDs - array - An array of utxoIDs (if applicable).

Code Examples:

const ethers = require("ethers");

(async () => {
  const provider = new ethers.providers.JsonRpcProvider(
    "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/bc/X"
  );
  const params = {
    "address": "X-avax16902ur8dhlyxpaa0rva5fx48fhptx6ryh3dv7q",
    "assetID": "AVAX",
  };
  const result = await provider.send("avm.getBalance", params);
  console.log(result);
})();
Ready to get started? Create a free account