Skip to main content
Version: 1.0

Get Account Info

Returns a breakdown of the current AVT utilisation in a given AvN account including the Staking balance.

await api.query.getAccountInfo(avn_account)
important

You can get the AVN_GATEWAY_URL here.

Expected Results

  • totalBalance - string integer value representing the account's total AVT balance.
  • freeBalance - string integer value representing the portion of the total that is freely usable (not staked or locked).
  • stakedBalance - string integer value representing the portion that is staked and currently earning rewards.
  • unlockedBalance - string integer value representing the portion that is unstaked and unlocked and can be converted to free balance.
  • unstakedBalance - string integer value representing the portion that is unstaked but still currently locked.
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);

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

// Replace "acct" with the Aventus address or public key
const result = await api.query.getAccountInfo(acct)
console.log(result);
}

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