Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions pds/contracts/PackNFT_TopShot.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ access(all) contract PackNFT: NonFungibleToken, IPackNFT {
)
let squareImage = MetadataViews.Media(
file: MetadataViews.HTTPFile(
url: "https://nbatopshot.com/static/img/og/og.png"
url: "https://nbatopshot.com/static/favicon/favicon.svg"
),
mediaType: "image/png"
mediaType: "image/svg+xml"
)
return MetadataViews.NFTCollectionDisplay(
name: "NBA-Top-Shot-Packs",
Expand Down Expand Up @@ -417,7 +417,8 @@ access(all) contract PackNFT: NonFungibleToken, IPackNFT {
///
access(all) view fun getContractViews(resourceType: Type?): [Type] {
return [
Type<MetadataViews.NFTCollectionData>()
Type<MetadataViews.NFTCollectionData>(),
Type<MetadataViews.NFTCollectionDisplay>()
]
}

Expand All @@ -439,6 +440,31 @@ access(all) contract PackNFT: NonFungibleToken, IPackNFT {
})
)
return collectionData
case Type<MetadataViews.NFTCollectionDisplay>():
let bannerImage = MetadataViews.Media(
file: MetadataViews.HTTPFile(
url: "https://nbatopshot.com/static/img/top-shot-logo-horizontal-white.svg"
),
mediaType: "image/svg+xml"
)
let squareImage = MetadataViews.Media(
file: MetadataViews.HTTPFile(
url: "https://nbatopshot.com/static/favicon/favicon.svg"
),
mediaType: "image/svg+xml"
)
return MetadataViews.NFTCollectionDisplay(
name: "NBA-Top-Shot-Packs",
description: "NBA Top Shot is your chance to own, sell, and trade official digital collectibles of the NBA and WNBA's greatest plays and players",
externalURL: MetadataViews.ExternalURL("https://nbatopshot.com/"),
squareImage: squareImage,
bannerImage: bannerImage,
socials: {
"twitter": MetadataViews.ExternalURL("https://twitter.com/nbatopshot"),
"discord": MetadataViews.ExternalURL("https://discord.com/invite/nbatopshot"),
"instagram": MetadataViews.ExternalURL("https://www.instagram.com/nbatopshot")
}
)
}
return nil
}
Expand Down