Moralis Web 3 SDK getNFTs not working properly?

Hi
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

Hmm
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!

Ok
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!!

Hello,
async function getNfts() {
const options = { token_address: ā€˜0xā€¦ā€™ };
const polygonNFTs = await Moralis.Web3API.account.getNFTsForContract(options);
console.log(ā€œpolygonNFTsā€,polygonNFTs)
}
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