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
  2. Collection Metadata

Collection Display

How should the collection this NFT belongs to be shown on Flowty?

PreviousCollection MetadataNextCollection Data

Last updated 1 year ago

The tells platforms how to show a Collection. Flowty relies on the following fields from this view:

  • Name: What is this collection's name? In the absence of this view, we will use a collection's Contract name.

  • Description (Optional): A brief description of your collection.

  • External URL (Optional): A backlink to your collection's native website/app for users to discover more about your collection.

  • Square Image: The image to use for your collection's thumbnail.

  • Banner Image: The image to use as the background for your collection banner on Flowty's collection page. .

  • Socials: A set of social pages for your collection. Currently Flowty only supports Twitter links. Give us a shout if you want to see others added!

pub contract Avataaars: NonFungibleToken, ViewResolver {
    // ...
    
    pub resource NFT: NonFungibleToken.INFT, MetadataViews.ResolverCollection {
        pub fun resolveView(_ view: Type): AnyStruct? {
            switch view {
                // ...
                case Type<MetadataViews.NFTCollectionDisplay>():
                    return Avataaars.resolveView(view)
                // ...
            }
            return nil
        }
    }

    pub fun resolveView(_ view: Type): AnyStruct? {
        switch view {
            // ...
            case Type<MetadataViews.NFTCollectionDisplay>():
                return MetadataViews.NFTCollectionDisplay(
                        name: "Flowty Avataaars",
                        description: "This collection is used showcase the various things you can do with metadata standards on Flowty",
                        externalURL: MetadataViews.ExternalURL("https://flowty.io/"),
                        squareImage: MetadataViews.Media(
                            file: MetadataViews.HTTPFile(
                                url: self.imageBaseURL.concat("1")
                            ),
                            mediaType: "image/jpeg"
                        ),
                        bannerImage: MetadataViews.Media(
                            file: MetadataViews.HTTPFile(
                                url: "https://storage.googleapis.com/flowty-images/flowty-banner.jpeg"
                            ),
                            mediaType: "image/jpeg"
                        ),
                        socials: {
                            "twitter": MetadataViews.ExternalURL("https://twitter.com/flowty_io")
                        }
                    )
        }
        return nil
    }
}
/// View to expose the information needed to showcase this NFT's
/// collection. This can be used by applications to give an overview and
/// graphics of the NFT collection this NFT belongs to.
///
pub struct NFTCollectionDisplay {
    // Name that should be used when displaying this NFT collection.
    pub let name: String

    // Description that should be used to give an overview of this collection.
    pub let description: String

    // External link to a URL to view more information about this collection.
    pub let externalURL: ExternalURL

    // Square-sized image to represent this collection.
    pub let squareImage: Media

    // Banner-sized image for this collection, recommended to have a size near 1200x630.
    pub let bannerImage: Media

    // Social links to reach this collection's social homepages.
    // Possible keys may be "instagram", "twitter", "discord", etc.
    pub let socials: {String: ExternalURL}

    // init truncated...
}
NFTCollectionDisplay view
Recommended Dimensions are 1200x630
Collection display example ()
Avataaars collection page on Flowty