[SOLVED] Got this message : { total: 0, page: 0, page_size: 500, cursor: '', result: [] }

My Code here:

const Moralis = require(‘moralis/node’);

const serverUrl = “https://eprfpy1pddiw.usemoralis.com:2053/server”;

const appId = “LnyEdW1E5FQ1U7bibkVRKL8xi4ohvfrKXdxEIDuk”;

Moralis.start({serverUrl, appId});

const collectionAddress = “0xeb5097365f96afe93b6a39e0cc2ac0cc5595180a”;

const collectionname = “Avalant”;

async function generateRarity(){

const NFTs = await Moralis.Web3API.token.getAllTokenIds({address:collectionAddress});

console.log(NFTs);

};

generateRarity();

Then when I use " node main.js " comment. I got this ;
PS C:\Users\merve\Dropbox\PC\Desktop\Moralis\AvaxNft> node main.js
{ total: 0, page: 0, page_size: 500, cursor: ‘’, result: [] }

Where is my mistake guys ?

it looks like you need to specify the chain, by default it will use eth as the chain

how can specify the chain? in main.js file ?

you have example in documentation:
https://docs.moralis.io/moralis-dapp/web3-sdk/token#getalltokenids

const Moralis = require(‘moralis/node’);

const serverUrl = “https://eprfpy1pddiw.usemoralis.com:2053/server”;

const appId = “LnyEdW1E5FQ1U7bibkVRKL8xi4ohvfrKXdxEIDuk”;

Moralis.start({serverUrl, appId});

const collectionAddress = “0xeb5097365f96afe93b6a39e0cc2ac0cc5595180a”;

const collectionname = “Avalant”;

const chainId = “avalanche”;

async function generateRarity(){

const NFTs = await Moralis.Web3API.token.getAllTokenIds({

    address:collectionAddress,

    chain:chainId

});

console.log(NFTs);

};

generateRarity();

After the changes I got this error : throw new Error(error.response.data.error);
^
Error: Invalid chain

Still I got Invalid chain error :frowning:

Try AVAX or the chain id as number

Btw, I went to check the address and it seems to be a user address, not a contract https://snowtrace.io/address/0xeb5097365f96afe93b6a39e0cc2ac0cc5595180a

The function you are trying to use takes in a contract address

this worked. Thank you mate.

const chainId = “0xa86a”;

Thank you for warning me for the contract adress.