[SOLVED] Unable to get NFTs for a contract I created

Hey Moralis Team,
Yesterday I created a contract following your course:

I wasn’t able to retrieve the info for the two NFTs I created with the contract, thought it might need time to propagate but they still don’t show up when I try to get them using the Web3API. Here’s the code:
const options = { chain: 'rinkeby', address: '0x1a1033526811fc1584b591e76c410bb191b22e08' };
const NFTs = await Moralis.Web3API.token.getAllTokenIds(options);
console.log(`Length: ${NFTs.result.length}`)

I should be getting a console output of “Length: 2”, but it still returns 0.
Here is a link to an NFT from the contract: https://testnets.opensea.io/assets/0x1a1033526811fc1584b591e76c410bb191b22e08/0
As you can see at “opensea”, there are 2 NFTs for the given contract.

I also tried getting the owners of the NFTs from the contract using the Web3 API, but still no result.

Any help is appreciated, thank you in advance :smiley:

1 Like

it looks like Moralis still has some problems in indexing new smart contracts, at least on Rinkeby.

You could try to look in NFTOwners table in your Moralis Server to see if you have that information synced for those NFTs.

Yep, it looks like they were synced in the table today:

If the “getAllTokenIds()” method queries this table, does it mean that it should’ve worked or is it something else ?

That method doesn’t query that table, but you could use the data from that table now.
You have to do a query in that table.

Alright, thank you for the help and quick replies :smiley:

I’m having the same issue, did you manage to make it work somehow?