Skip to main content
Version: 3.5.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 { AvnApi, SetupMode, SigningMode } = require("avn-api");
const AVN_GATEWAY_URL = "gateway url of your chosen network";
const options = {
suri: "suri of your account",
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};

const TOKEN = "0x12a...32de";

async function main() {
await avnSdk.init();
const api = await avnSdk.apis();

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

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