Get Total AVT on the AVN
Returns the total amount of a token currently on the AvN. The result is inclusive of both:
- lifts which have occurred on Ethereum but are waiting to be processed by the AVN.
- lowers which have occurred on the AvN but are waiting to be claimed on Ethereum.
await api.query.getTotalToken(<tokenContractAddress>);
important
You can get the AVN_GATEWAY_URL here.
- Example
- Example Result
- JSON-RPC
- JSON-RPC Output
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,
};
const TOKEN = "0x12a...32de"
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
let total_token = await api.query.getTotalToken(TOKEN);
console.log(total_token);
}
(async () => {
await main();
})();
1000000000000
REQUEST
POST https://AVN_GATEWAY_URL/query
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
JSON-RPC Example
curl https://AVN_GATEWAY_URL/query
-X POST
-H "Content-Type: application/json"
-H "Authorization: bearer <awtToken>"
-d '{"jsonrpc":"2.0", "method":"getTotalToken", "params":{"token":"0x2adce7ada36d86253aa63bcf4aad9f84ccb9480e"}, "id":1}'
note
result - string integer value of the current total amount of a token in its smallest denomination.
{
"jsonrpc": "2.0",
"id": 1,
"result": "1000000000000"
}