getBalance

getBalance is a method on the ANT class that retrieves the token balance for a specific wallet address within the ANT process.

getBalance does not require authentication.

Parameters

ParameterTypeDescriptionOptional
addressstring - WalletAddressThe wallet address to retrieve the balance forfalse

Examples

getBalance

const { ANT } = require('@ar.io/sdk');

async function main() {
  const ant = ANT.init({ processId: "bh9l1cy0aksiL_x9M359faGzM_yjralacHIUo8_nQXM" });
  const balance = await ant.getBalance({
    address: "ccp3blG__gKUvG3hsGC2u06aDmqv4CuhuDJGOIg0jw4"
  });

  console.log(balance);
}

main();

Output

1