Get Native Currency Token
Returns the native currency token address
await api.query.getNativeCurrencyToken();
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 avnSdk = new AvnApi(AVN_GATEWAY_URL, options);
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
let native_currency = await api.query.getNativeCurrencyToken();
console.log(native_currency);
}
(async () => {
await main();
})();
0x0d88eD6E74bbFD96B831231638b66C05571e824F
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":"getNativeCurrencyToken", "params":{}, "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": "0x0d88eD6E74bbFD96B831231638b66C05571e824F"
}