Skip to content

Instantly share code, notes, and snippets.

@laurengarcia
Last active July 24, 2020 00:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laurengarcia/fa1b817e3dcce3bcdcedbd6963dcd192 to your computer and use it in GitHub Desktop.
Save laurengarcia/fa1b817e3dcce3bcdcedbd6963dcd192 to your computer and use it in GitHub Desktop.
MSPT (Microsponsors Time Slot) Token URI Metadata
// MSPT tokens (Microsponsors Time Slot)
// Metadata Sketch for tokenURI()
// OpenSea Docs:
// docs.opensea.io/docs/2-adding-metadata
// docs.opensea.io/docs/metadata-standards
// Example:
// https://opensea-creatures-api.herokuapp.com/api/creature/3
{
"name": "MSPT #220: <propertyName>", // MSPT on-chain data
"description": "300 x 250 pixel time slot on foo.com available for sponsorship",
"image": "https://cdn.foo.com/thumbnail/50.png", // OpenSea reco's 350 x 350px, billboard format metadata
"external_url": "https://microsponsors.io/exchange.html?view=auctions&sort=token:51", // MSPT single token view
"attributes": [
{
"trait_type": "Category", // MSPT on-chain data
"value": "Website"
},
{
"display_type": "date", // MSPT on-chain data
"trait_type": "Start Time",
"value": 1546360800 // Unix timestamp
},
{
"display_type": "date", // MSPT on-chain data
"trait_type": "End Time",
"value": 1546360800 // Unix timestamp
},
{
"display_type": "date", // MSPT on-chain data
"trait_type": "Auction End Time", // Microsponsors dapp uses this for its auctions
"value": 1546360800 // Unix timestamp
},
{
"trait_type": "Secondary Trading", // MSPT on-chain data
"value": "True" // String (not boolean)
},
//
// Conditionally include the following fields
// IF time slot is tied to a Billboard that
// has them defined:
//
{
"trait_type": "Width (pixels)", // Optional, billboard format metadata
"value": 300
},
{
"trait_type": "Height (pixels)", // Optional, billboard format metadata
"value": 250
},
// These two are mutually exclusive:
{
"trait_type": "Image", // Optional, billboard format metadata
"value": "True" // String not boolean
},
{
"trait_type": "Text-Only", // Optional, billboard format metadata
"value": "True" // String not boolean
},
// end mutually exclusive fields
{
"trait_type": "Headline Length", // Optional, billboard format metadata
"value": 64 // Number
},
{
"trait_type": "Description Length", // Optional, billboard format metadata
"value": 64 // Number
},
{
"trait_type": "CTA Length", // Optional, billboard format metadata
"value": 20 // Number
},
// MSPT metadata added by Sponsor in Time Slot Manager after purchase
// WONT be visible on OpenSea bc these fields do not conform to their format:
{
"sponsor_defined_fields": {
"text": "foobar zipzap 123",
"image": "https://cdn.foo.com/my_sponsor_image.png",
"link": "https://foo.com/landing_page",
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment