flow-nft icon indicating copy to clipboard operation
flow-nft copied to clipboard

Provide a set of `displayType`'s for `Trait` struct

Open ph0ph0 opened this issue 3 years ago • 7 comments

Instructions

Restricting the displayType's for the Trait struct would help with standardisation as it would inform off-chain consumers about what to expect and leave it up to them for how they consume the value contained in the Trait. I feel as though it is currently too vague to be truly useful, and a set of types should be provided that the dev can choose from.

There are many different names for the same/similar types across programming languages so we should probably settle on some sort of standard. ISO/IEC 11404 might be a place to start:

https://en.wikipedia.org/wiki/ISO/IEC_11404#:~:text=ISO%2FIEC%2011404%2C%20General%20Purpose,such%20as%20Fortran%20or%20C). https://www.iso.org/standard/39479.html

ph0ph0 avatar Sep 21 '22 14:09 ph0ph0

Also relevant https://github.com/findonflow/find/blob/main/integratingMetadataViews.md

and https://docs.opensea.io/docs/metadata-standards

bjartek avatar Sep 21 '22 14:09 bjartek

I'm not really sure what you're suggesting here. Can you please elaborate?

joshuahannan avatar Oct 11 '22 21:10 joshuahannan

Ye sure!

So in the comment above displayType property in Trait, it says:

"displayType is used to show some context about what this name and value represent for instance, you could set value to a unix timestamp, and specify displayType as "Date" to tell platforms to consume this trait as a date and not a number"

Since currently there is not list of displayTypes to choose from, anyone can put anything they like here. I think for this to be truly useful, there would have to be some standardisation? If there was a set of displayTypes to choose from, then apps would know what to expect and could handle each appropriately.

ph0ph0 avatar Oct 12 '22 16:10 ph0ph0

That is a good suggestion! So these would just be listed in the comments above displayType and in the documentation, or would it be something that is actually defined in the contract? And what are your suggestions for which ones we should use?

joshuahannan avatar Oct 13 '22 14:10 joshuahannan

I think we should

  1. agree on a recommended way to display traits
  2. link to that documentation in the MetadataViews documentation

.find have already started that above in our github repo but I am not sure if that is where it should be/live.

Could we maybe setup a workshop to work on this with interested parties?

bjartek avatar Oct 17 '22 07:10 bjartek

@bjartek If you'd like to organize and lead a workshop about it, please feel free to plan it, and we can help organize, and promote it in the Flow community. :)

joshuahannan avatar Oct 17 '22 18:10 joshuahannan

I will see what I can cook together. I kind of like to have done some more internal thoughts about it first to present something that we at .find think is presentable before said meeting. Nothing that is set in stone I just like to have something coherent to send to participants in advance and present as a conversation-starter.

bjartek avatar Nov 02 '22 07:11 bjartek