Skip to main content
Version: 0.2

Get Account Nonce

Returns the nonce of a given AvN account

//replace with the specific account
await api.query.getAccountNonce(<account>);

Example

const AvnApi = require("avn-api");
const GATEWAY = "<node_url>"; //Replace the node_url with the url received from Aventus.
const api = new AvnApi(GATEWAY);

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

// Return the nonce of a specific account:
let acctNonce = await api.query.getAccountNonce(<account>);
console.log(acctNonce)
//"3"
}

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

Expected Output

321