fudgebucket27 / Lexplorer

Loopring explorer alternative
14 stars 10 forks source link

Show NFT metadata (JSON) #190

Closed modersohn closed 2 years ago

modersohn commented 2 years ago

Like official explorer does, but maybe a bit nicer?

fudgebucket27 commented 2 years ago

We already have the NftMetadata class which we could serialize into a string that could be displayed somewhere? Though some people have mentioned adding extra fields in their metadata which wouldn't be serialized at all I believe. Otherwise we could have a button that opens the ipfs metadata link in another tab like the official explorer.

fudgebucket27 commented 2 years ago

If we serialize the text ourselves we should use something like prism.js to make the json prettier with highlighting. Example here https://liamhunt.blog/2022/prism-js-syntax-highlighting-in-blazor/

modersohn commented 2 years ago

I don't think re-serialising the JSON is good idea - the user wants to see the on-chain JSON, not something we generated that might be equal but then also might not. Since we get the raw text already, I don't think it's a problem to keep all of the text with the deserialised object itself.

modersohn commented 2 years ago

I have a relatively simple version and explicitly did not go the full way via prism. The JSON is properly intended and shown in a readonly text editor in a MudDialog, which allows for proper scrolling and ease copy/paste.

PR coming up

fudgebucket27 commented 2 years ago

Fixed with #192