Get Total AVT on the AVN
To get the total amount of AVT on the Aventus network:
await api.query.getTotalAvt();
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();
const totalAvt = await api.query.getTotalAvt();
console.log("The total amount of AVT on the AVN is: ", totalAvt);
// "5100000000000000000000"
}
(async () => {
await main();
})();
Example Output
5100000000000000000000
JSON-RPC
REQUEST
POST https://AVN-API-URL/query
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
EXAMPLE
## JSON-RPC over HTTPS POST
curl https://AVN-API-URL/query \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"getTotalAvt", "params":{}, "id":1}'
RESULT FIELDS TOTAL - string integer value of the current total amount of circulating AVT in its smallest denomination
BODY
{
"jsonrpc": "2.0",
"id": 1,
"result": "5100000000000000000000"
}