[SOLVED] Get NFTs by wallet (nodejs)

Hi All,

I am following this tutorial https://docs.moralis.io/docs/nft-gating-nextjs , which uses the NFT SDK to build a token gated website.

However, the api keeps returning ALL nfts in the wallet, instead of just those iโ€™ve specified in my tokenAddress params.

If I use axios, the the response is correct.

Do help.

Thanks!

what version of the SDK you are using?

you can try with token_addresses, tokenAddresses

thanks for replying!
iโ€™ve just updated to 2.7.4 but still facing the same issue.

  • token_address and token_address works but returns ALL nfts.

  • tokenAddresses does not work at all

what happens in this case?

the api doesnโ€™t get called at all. throws an error
image

Can you post your code? tokenAddresses needs to be an array of (address) strings, e.g.

tokenAddresses: ['0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'],
1 Like

oh! ok yea , changing it to an array worked.

thank you so much, appreciate it!