fudgebucket27 / Lexplorer

Loopring explorer alternative
14 stars 10 forks source link

show nftData #228

Closed fudgebucket27 closed 1 year ago

fudgebucket27 commented 1 year ago

getting some requests to show the nftData property. i don't think nftData shows up in the subgraph at all? could calculate it ourselves similar to how I do it with LoopMintSharp: https://github.com/fudgebucket27/LoopMintSharp/blob/master/LoopMintSharp/Minter.cs#L52-L71

Will need the metadata ipfs CID, minter address, token address, and nft royalty percentage for this to work which is all there already. Will then need to convert from biginteger back to hex format

modersohn commented 1 year ago

It's certainly nice to see that you've got code that can calculate nftData - but I'm in doubt whether we should actually do that.

  1. Who needs nftData? As far as I'm aware only people who work with the Loopring SDK, right? Why can't they use the SDK to retrieve nftData?
  2. nftData is persisted nowhere, correct?
  3. In fact, the SDK could change the way, nftData is calculated, right? It would not break their API, but it would break 3rd party code like LoopMintSharp and then lexplorer would also provide incorrect info. This reminds me of the tokenID which is also a hash but will include a base URL in the future so one user can mint different NFT collections.
  4. Calculating nftData in lexplorer would only work once we've got the metadata and we would need to parse the URLs to find the ipfs CID. Not impossible, but there's certainly room for failure.
fudgebucket27 commented 1 year ago

alrighty all good points! ill put this on the back burner for now then