Contract MetadataViews
_10pub contract MetadataViews {_10}
This contract implements the metadata standard proposed in FLIP-0636.
Ref: https://github.com/onflow/flips/blob/main/application/20210916-nft-metadata.md
Structs and resources can implement one or more metadata types, called views. Each view type represents a different kind of metadata, such as a creator biography or a JPEG image file.
Interfaces
Resolver
_10pub resource interface Resolver {_10}
Provides access to a set of metadata views. A struct or resource (e.g. an NFT) can implement this interface to provide access to the views that it supports.
ResolverCollection
_10pub resource interface ResolverCollection {_10}
A group of view resolvers indexed by ID.
File
_10pub struct interface File {_10}
Generic interface that represents a file stored on or off chain. Files can be used to references images, videos and other media.
Structs & Resources
NFTView
_18pub struct NFTView {_18_18 pub let id: UInt64_18_18 pub let uuid: UInt64_18_18 pub let display: Display?_18_18 pub let externalURL: ExternalURL?_18_18 pub let collectionData: NFTCollectionData?_18_18 pub let collectionDisplay: NFTCollectionDisplay?_18_18 pub let royalties: Royalties?_18_18 pub let traits: Traits?_18}
NFTView wraps all Core views along id
and uuid
fields, and is used
to give a complete picture of an NFT. Most NFTs should implement this
view.
Display
_10pub struct Display {_10_10 pub let name: String_10_10 pub let description: String_10_10 pub let thumbnail: AnyStruct{File}_10}
Display is a basic view that includes the name, description and thumbnail for an object. Most objects should implement this view.
HTTPFile
_10pub struct HTTPFile {_10_10 pub let url: String_10}
View to expose a file that is accessible at an HTTP (or HTTPS) URL.
IPFSFile
_10pub struct IPFSFile {_10_10 pub let cid: String_10_10 pub let path: String?_10}
View to expose a file stored on IPFS. IPFS images are referenced by their content identifier (CID) rather than a direct URI. A client application can use this CID to find and load the image via an IPFS gateway.