Moralis Web 3 SDK getNFTs not working properly?

I’ve recently minted an NFT on my own contract on the Rinkeby testnet
But after 2-3 hours I still don’t see it in my React Moralis app
When I do
const testnetNFTs = await Moralis.Web3API.account.getNFTs({ chain: 'rinkeby', address: 'MYADDRESSS_ETC_HERE' });

it gives me 4 NFTs

But when I use a deprecated function from Moralis it gives me 7 NFTs as it should, which is weird
const userNFTs = await Moralis.Web3.getNFTs({ chain: 'rinkeby', address: 'MYADDRESSS_ETC_HERE' });

Background checks:

  • I’ve checked that my NFTs are visible on opensea
  • I’ve checked my Moralis server dashboard and can see 7 NFTs in the table
    What I see on my React app:

Any help will be much appreciated : )

1 Like

we will have to investigate, I don’t think that it is something that you can do now related to the number of nfts returned by Moralis.Web3API.account.getNFTs

The number of NFTs isn’t the main issue, I cannot see a recently minted NFT for some reason.
Yep thanks @cryptokid I would love to get notified about the reason/solution!

I found the issue
When I mint the NFT using javascript - I’m doing something wrong - this causes the metadata to be null
In my React app the NFTs that don’t load are the ones that have null metadata
I tried minting from my contract in remix.ethereum and the nft showed up in my moralis app in less than 1 minute!!

async function getNfts() {
const options = { token_address: ‘0x…’ };
const polygonNFTs = await Moralis.Web3API.account.getNFTsForContract(options);
It returns;
“total”: 0,
“page”: 0,
“page_size”: 500,
“cursor”: “”,
“result”: [],
“status”: “SYNCED”

when I check my address in snowtrace, i can see my nfts. Can you help me?

maybe something doesn’t work, but we would need some clear example that doesn’t work

hey, this is the getNFTsForContract method, it takes in an ERC721 or 1155 contract address in the address parameter so you typical normal address might return null