Search Apps Documentation Source Content File Folder Download Copy

igrc721_metadata.gno

2.12 Kb ยท 38 lines
 1package grc721
 2
 3// IGRC721CollectionMetadata describes basic information about an NFT collection.
 4type IGRC721CollectionMetadata interface {
 5	Name() string   // Name returns the name of the collection.
 6	Symbol() string // Symbol returns the symbol of the collection.
 7}
 8
 9// IGRC721Metadata follows the Ethereum standard
10type IGRC721Metadata interface {
11	IGRC721CollectionMetadata
12	TokenURI(tid TokenID) (string, error) // TokenURI returns the URI of a specific token.
13}
14
15// IGRC721Metadata follows the OpenSea metadata standard
16type IGRC721MetadataOnchain interface {
17	IGRC721CollectionMetadata
18	TokenMetadata(tid TokenID) (Metadata, error)
19}
20
21type Trait struct {
22	DisplayType string
23	TraitType   string
24	Value       string
25}
26
27// see: https://docs.opensea.io/docs/metadata-standards
28type Metadata struct {
29	Image           string  // URL to the image of the item. Can be any type of image (including SVGs, which will be cached into PNGs by OpenSea), IPFS or Arweave URLs or paths. We recommend using a minimum 3000 x 3000 image.
30	ImageData       string  // Raw SVG image data, if you want to generate images on the fly (not recommended). Only use this if you're not including the image parameter.
31	ExternalURL     string  // URL that will appear below the asset's image on OpenSea and will allow users to leave OpenSea and view the item on your site.
32	Description     string  // Human-readable description of the item. Markdown is supported.
33	Name            string  // Name of the item.
34	Attributes      []Trait // Attributes for the item, which will show up on the OpenSea page for the item.
35	BackgroundColor string  // Background color of the item on OpenSea. Must be a six-character hexadecimal without a pre-pended #
36	AnimationURL    string  // URL to a multimedia attachment for the item. Supported file extensions: GLTF, GLB, WEBM, MP4, M4V, OGV, OGG, MP3, WAV, OGA, HTML (for rich experiences and interactive NFTs using JavaScript canvas, WebGL, etc.). Scripts and relative paths within the HTML page are now supported. Access to browser extensions is not supported.
37	YoutubeURL      string  // URL to a YouTube video (only used if animation_url is not provided).
38}