thirdweb-dev / react

Ultimate collection of React hooks for your web3 apps
https://docs.thirdweb.com/react
Apache License 2.0
80 stars 29 forks source link

[Bug]: useOwnedNFTs Hook returns undefined #147

Open jarrodwatts opened 2 years ago

jarrodwatts commented 2 years ago

useOwnedNFTs returns undefined on Signature Drop prebuilt contract.

Steps to reproduce:

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

Expected Behaviour:

sleepyqadir commented 2 years ago

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

jarrodwatts commented 2 years ago

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

sleepyqadir commented 2 years ago

@jarrodwatts sure, on it

sleepyqadir commented 2 years ago

@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?