Get the Contract Address of the VOW Token
Returns the 20 byte Ethereum address of the VOW token contract for the network you're querying.
await api.query.getAvtContractAddress();
important
You can get the VL_GATEWAY_URL here.
- Example
- Example Result
- JSON-RPC
- JSON-RPC Output
const { AvnApi, SetupMode, SigningMode } = require("avn-api");
const VL_GATEWAY_URL = "https://gateway.testnet.voucherledger.com/";
const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(VL_GATEWAY_URL, singleUserOptions);
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
//Query the VL for data, in this case, information about your account.
let avtContractAddress = await api.query.getAvtContractAddress();
console.log(avtContractAddress);
}
(async () => {
await main();
})();
0x1BBf25e71EC48B84d773809B4bA55B6F4bE946Fb
REQUEST
POST https://VL_GATEWAY_URL/query
HEADERS
Content-Type: application/json Authorization': bearer <awtToken>
JSON-RPC Example
curl https://VL_GATEWAY_URL/query \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer <awtToken>" \
-d '{"jsonrpc":"2.0", "method":"getAvtContractAddress", "params":{}, "id":1}'
note
result - string value of VOW contract ethereum address.
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1BBf25e71EC48B84d773809B4bA55B6F4bE946Fb"
}