igrc721_metadata.gno
1.38 Kb · 34 lines
1package grc721v2
2
3type IGRC721CollectionMetadata interface {
4 Name() string // Name returns the name of the collection.
5 Symbol() string // Symbol returns the symbol of the collection.
6}
7
8type IGRC721Metadata interface {
9 IGRC721CollectionMetadata
10 TokenURI(tid TokenID) (string, error) // TokenURI returns the URI of a specific token.
11}
12
13type IGRC721MetadataOnchain interface {
14 IGRC721CollectionMetadata
15 TokenMetadata(tid TokenID) (Metadata, error)
16}
17
18type Trait struct {
19 DisplayType string
20 TraitType string
21 Value string
22}
23
24type Metadata struct {
25 Image string // URL, IPFS/Arweave path, or (commonly here) a data: URI holding the image itself.
26 ImageData string // Raw SVG image data, if generating images on the fly. Only used if Image is empty.
27 ExternalURL string // URL shown alongside the asset on marketplaces, linking back to the collection's own site.
28 Description string // Human-readable description of the item. Markdown is supported.
29 Name string // Name of the item.
30 Attributes []Trait // Attributes for the item, shown on marketplace pages for the item.
31 BackgroundColor string // Background color of the item on marketplaces. Six-character hex, no leading #.
32 AnimationURL string // URL/data URI to a multimedia attachment for the item.
33 YoutubeURL string // URL to a YouTube video (only used if AnimationURL is not provided).
34}