Fetch the list of NFTs owned by an account
I was able to use this library to pull a token using the contract address + the tokenId. What I want to know now is to only fetch the TokenIds that belong for a given user (by connecting his Metamask wallet) and fetching that information from it.
I tried to look for example but could not find any. Is this something possible using this library?
Thank you!
Hi, unfortunately this is not an easy thing to do by directly querying an Ethereum node.
But I think it’s something we could add as an optional method in the API, only supported by some fetchers (e.g. OpenSea and a future The Graph API), so I am going to leave this issue opened.
Hi Pierre. I was able to take the Opensea approach and use this instead of your library. I'll keep watching this issue as I might revert back to it if you offer such functionality. You basically need to query the asset end point of OS by passing a Eth address to return all the NFT that belong that that collection.
@cdric - why don't you build it and contribute a PR for it?
The solution I'm using is now very different that the architecture of your component so I would have to rewrite pretty much everything. That being said, if you want, I'm happy to share my reactJs code for you to look at the interaction I'm having between metamask and opensea if this can be helpful?