Collection Display

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

The NFTCollectionDisplay view 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. Recommended Dimensions are 1200x630.

  • 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
    }
}

Last updated