Skip to main content
Version: 1.0

Get Total AVT on the AVN

Returns the total amount of a token currently on the AvN. The result is inclusive of both:

  • lifts which have occurred on Ethereum but are waiting to be processed by the AVN.
  • lowers which have occurred on the AvN but are waiting to be claimed on Ethereum.
await api.query.getTotalToken(<tokenContractAddress>);
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 TOKEN = "0x12a...32de"

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

let total_token = await api.query.getTotalToken(TOKEN);
console.log(total_token);
}

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


tip

You can query the state of your transaction here using the returned request id.