Skip to main content
Version: 2.4

Get the Account balance of any ERC20 or ERC777 Token on the Aventus Network

Returns the balance of a specific token for a given AvN account.

await api.query.getTokenBalance(account, TOKEN_ETHEREUM_ADDRESS);
important

You can get the AVN_GATEWAY_URL here.

const AVN_API = require("avn-api");
const AVN_GATEWAY_URL = "<node_url>";
const options = {
suri: "<account_suri>",
};
const API = new AVN_API(AVN_GATEWAY_URL, options);

const ACCOUNT = "5DAgx...";
const TOKEN_ETHEREUM_ADDRESS = "0x7e5bb...";

async function main() {
await api.init();

let token_balance = await api.query.getTokenBalance(ACCOUNT, TOKEN_ETHEREUM_ADDRESS);
console.log(token_balance);
}

(async () => {
await main();
})();