[SOLVED] getNFTsForContract incorrect result

Hello,

The call to getNFTsForContract returns an incorrect result. For the following input data:

address: "0x42951195ff9f592a504814d1e9a73f52b34e689c"
chain: "0x89"
token_address: "0xFfc1dce5c9a12049f8E3e2f81eF5FcA4Fd1A2b17"

Returns 11 results:

If you look at polygonscan, you can see that that address does not have any tokens from those contracts.

It looks like the token_adress is being ignored and is returning all tokens for the account. Can you review it please?

Thank you very much and best regards.

try this endpoint:

and you can try with tokenAddresses in the javascript sdk

Great! Using tokenAddresses It works. thaks.

1 Like

Hello @cryptokid,

I have the same problem. I want to get all the NFTs of a single contract, and it seems when I call:

  const options = { chain: process.env.REACT_APP_CHAIN_ID, token_address: collectionAddress, limit: PAGE_SIZE};
  apiResponse = await Moralis.Web3API.account.getNFTsForContract(options);  

I am getting all the NFTs of the user, instead of getting the NFTS of the contract/collection.

Anyone has any idea how can I solve the problem?

Thanks,
Pedro

Hey @pedrosantos

This is a very old thread and I will be closing it, can you create a new thread/post and we will be helping you from there.

Thanks!

you may be looking for this endpoint:

1 Like