Get the NFT Contract Address
Returns a list of 20 byte Ethereum addresses of the NFT Listings contract registered in the AvN
await api.query.getNftContractAddress();
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 = "https://gateway.testnet.aventus.network";
const singleUserOptions = {
suri: "0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24", // this is from the generated example account
setupMode: SetupMode.SingleUser,
signingMode: SigningMode.SuriBased,
};
const avnSdk = new AvnApi(AVN_GATEWAY_URL, singleUserOptions);
async function main() {
await avnSdk.init();
const api = await avnSdk.apis();
let contractAddress = await api.query.getNftContractAddress();
console.log(contractAddress);
}
(async () => {
await main();
})();
[
'0x5b820bb5f07532bcac96ecba99076cde349a1a8a',
'0xe11ff49a68f1aacbdf335daa529124af7afc0ce0',
'0x00293716abc9e45751eb990cfe9838709eaefeed',
'0x2d6542228b2e331c310b3d4b24c29fb35674eb82',
'0xab9e7a6fe9fe645d687edabd8ab160636d603b5c',
'0x8b3a892671b6d91641965824072ad6a6c4b9b6be',
'0x0bb735e611e50dab99e5caaf133c3150c32fe879',
'0xb06933fcc7217832a2110994a31ba641e35abf94',
'0xabb165bb5e93cba4ebb843d3ca10b953f80803fd',
'0xd5fb900f067a7b779c4c72fb3436ec86fa0275e5'
]
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":"getNftContractAddress", "params":{}, "id":1}'
note
result - string value of NFT contract ethereum address.
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xb8608e90ae5bfbdf6156558a5231e0b291a74330",
"0xb7608e90ae5bfbdf6156558a5231e0b291a74331"
]
}