thombruce / candyfloss

🍬
http://thombruce.github.io/candyfloss/
MIT License
0 stars 0 forks source link

NFT Gallery #1

Open thombruce opened 2 years ago

thombruce commented 2 years ago

I had this thought to add an NFT gallery associated with any given address. But I think this is... not possible (read "not sensible") without an index store. See this StackOverflow question asking about roughly this problem: https://stackoverflow.com/questions/67460597/fetch-all-nfts-owned-by-wallet-address-with-web3-js

On the other hand, finding ERC721 tokens by originating contract... that might be easier? from transactions are indexed on chain, I think.

Given that right now I'm more eager to explore what can be done in lieu of a server, we might not look at the above for a while. Will see what we can do.

thombruce commented 2 years ago

If it really is easier to find NFTs by contract, then perhaps users could create custom galleries for themselves where...

  1. We know the from address and can easily find all ERC721 tokens
  2. We can lookup the given to address of the user in the collection of transactions
  3. We can omit any with a from the same user thereafter

This is still a whole process, but is leagues better than iterating through all blocks in search of relevant token transactions.

Alternatively:

...CandyFloss could just integrate a third-party API that has all of our indexing needs pre-handled.