Skip to main content
Version: 2.0

Get Account Nonce

Returns the nonce of a given AvN account for different nonce types.

await API.query.getNonce(<acct>);
important

You can get the AVN_GATEWAY_URL here.

Possible Nonce Types

  • token
  • payment
  • staking
  • confirmation
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 NONCE_TYPE = "payment"

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

//See other nonce type options below
let nonce = await API.query.getNonce(ACCOUNT, NONCE_TYPE);
console.log(nonce)
}

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