react icon indicating copy to clipboard operation
react copied to clipboard

[Bug]: useOwnedNFTs Hook returns undefined

Open jarrodwatts opened this issue 3 years ago • 4 comments

useOwnedNFTs returns undefined on Signature Drop prebuilt contract.

Steps to reproduce:

  const signatureDrop = useSignatureDrop("<contract-address>");
  const { data: ownedNfts } = useOwnedNFTs(signatureDrop, address);

Expected Behaviour:

  • Return an array of NFTs the user owns from the signature drop

jarrodwatts avatar Aug 26 '22 04:08 jarrodwatts

@jarrodwatts can you assign this issue to me I can work on it

sleepyqadir avatar Aug 26 '22 10:08 sleepyqadir

Sure @sleepyqadir! Thanks for checking it out - let us know if we can help

jarrodwatts avatar Aug 26 '22 11:08 jarrodwatts

@jarrodwatts sure, on it

sleepyqadir avatar Aug 27 '22 05:08 sleepyqadir

@jarrodwatts I found out that the signatureDrop contract is an instance of ERC721 and it does not contain the contract.query?.owned?.all, due to which it is returning undefined. Works fine if we are using the useNFTBalance hook to get the balance of NFTs.

Any possible solution you recommend to fix this up?

sleepyqadir avatar Aug 29 '22 14:08 sleepyqadir