Skip to main content
Version: 3.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 { 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,
};

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

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

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