Flowty Developers
  • NFT Metadata Standard
    • Overview
    • Display
    • Traits
    • Royalties
    • Collection Metadata
      • Collection Display
      • Collection Data
  • Flow NFT Catalog
  • Hybrid Custody
    • Overview
    • Applications
    • Resources and Transactions
  • Contract Addresses
Powered by GitBook
On this page
  1. NFT Metadata Standard

Collection Metadata

Data about your collection

PreviousRoyaltiesNextCollection Display

Last updated 1 year ago

On Flow, metadata doesn't exclusively exist on NFTs. They can also exist on the contract itself by implementing the interface. Flowty expects the following metadata to exist on the contract level:

  • NFTCollectionData: How do I store, send, or withdraw from this collection?

  • NFTCollectionDisplay: How should a collection be shown?

  • ExternalURL (Optional): A backlink to a collection's native website/app

If you came here from an earlier section, you might recall that NFTs themselves can also specify NFTCollectionData and NFTCollectionDisplay. While it is valid to define each of them on the NFT, contract-level metadata takes precedence and is the recommended location to implement these views.

In order to ensure consistency and maximum capability with other products on Flow, we recommend that NFTs on your collection also use your contract-level resolver. You can find an example of this in our Avataaars contract, and below:

Sample
        pub fun resolveView(_ view: Type): AnyStruct? {
            switch view {
                ...
                case Type<MetadataViews.NFTCollectionData>():
                    return Avataaars.resolveView(view)
                case Type<MetadataViews.NFTCollectionDisplay>():
                    return Avataaars.resolveView(view)
                ...
            }
            return nil
        }
ViewResolver
here