Skip to content

Instantly share code, notes, and snippets.

@nickjuntilla
Last active September 25, 2023 05:53
Show Gist options
  • Save nickjuntilla/4a77d2724f8aed3d273bd93a6a65c23f to your computer and use it in GitHub Desktop.
Save nickjuntilla/4a77d2724f8aed3d273bd93a6a65c23f to your computer and use it in GitHub Desktop.
Commonly used NFT metadata keys
{
// Line breaks look like they might work. They appear in Rarible description
description: 'Friendly OpenSea Creature that \n\nenjoys long swims in the ocean.',
external_url: 'https://openseacreatures.io/3',
image: 'https://storage.googleapis.com/opensea-prod.appspot.com/puffs/3.png',
// Only makers place seems to use imageUrl
imageUrl: 'https://ipfsgateway.makersplace.com/ipfs/QmZ15eQX8FPjfrtdX3QYbrhZxJpbLpvDpsgb2p3VEH8Bqq',
animation_url: 'ipfs://ipfs/QmcToBg7HX9cigCKoUcYdVWdKhmSBy2DnLRPMG342h2Deu/animation.mp4',
name: 'Dave Starbelly',
title: 'Token Metadata',
type: 'object',
// Zora
mimeType: 'video/mp4',
// These 3 seem to be used by OpenSea
creator: 'item.creator',
image_original_url: '_image_original_url',
image_thumbnail_url: '_image_thumbnail_url',
// If this is used than preview and raw should be used below
animation_original_url: '_animation_original_url',
// Localization
localization: {
uri: 'ipfs://QmWS1VAdMD353A6SDk9wNyvkT14kyCiZrNDYAad4w1tKqT/{locale}.json',
default: 'en',
locales: ['en', 'es', 'fr'],
},
// Properties are mainly on ERC1155 contracts and usually redundant to root level attributes
// NOTE: OpensSea uses only properties if you add them intead of attributes
properties: {
base: 'starfish',
rich_property: {
name: 'eyes',
value: 'big',
display_value: 'Big',
},
name: {
type: 'string',
description: 'Identifies the asset to which this token represents',
},
decimals: {
type: 'integer',
description:
'The number of decimal places that the token amount should display - e.g. 18, means to divide the token amount by 1000000000000000000 to get its user representation.',
},
description: {
type: 'string',
description: 'Describes the asset to which this token represents',
},
image: {
type: 'string',
description:
'A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive.',
},
properties: {
type: 'object',
description: 'Arbitrary properties. Values may be strings, numbers, object or arrays.',
},
preview_media_file: {
type: 'string',
description: 'https://ipfsgateway.makersplace.com/ipfs/QmZ15eQX8FPjfrtdX3QYbrhZxJpbLpvDpsgb2p3VEH8Bqq',
},
preview_media_file_type: { type: 'string', description: 'jpg' },
created_at: {
type: 'datetime',
description: '2021-02-16T00:07:31.674688+00:00',
},
total_supply: { type: 'int', description: 1 },
digital_media_signature_type: {
type: 'string',
description: 'SHA-256',
},
digital_media_signature: {
type: 'string',
description: '6314b55cc6ff34f67a18e1ccc977234b803f7a5497b94f1f994ac9d1b896a017',
},
raw_media_file: {
type: 'string',
description: 'https://ipfsgateway.makersplace.com/ipfs/QmXkxpwAHCtDXbbZHUwqtFucG1RMS6T87vi1CdvadfL7qA',
},
// Unclear how to use this, using root level localization is probably better if at all
localization: {
type: 'object',
required: ['uri', 'default', 'locales'],
properties: {
uri: {
type: 'string',
description:
'The URI pattern to fetch localized data from. This URI should contain the substring `{locale}` which will be replaced with the appropriate locale value before sending the request.',
},
default: {
type: 'string',
description: 'The locale of the default data within the base JSON',
},
locales: {
type: 'array',
description:
'The list of locales for which data is available. These locales should conform to those defined in the Unicode Common Locale Data Repository (http://cldr.unicode.org/).',
},
},
},
},
// Attributes are mainly for games -- OpenSea supports them. Other platforms don't
// OpenSea gets all attributes and makes maximum and minumum values
// NOTE: OpensSea uses only properties if you add them intead of attributes
attributes: [
{ trait_type: 'Creator', value: 'beeple' },
{
trait_type: 'Base',
value: 'Starfish',
},
{
trait_type: 'Eyes',
value: 'Big',
},
{
trait_type: 'Mouth',
value: 'Surprised',
},
{
trait_type: 'Level',
value: 5,
},
{
trait_type: 'Stamina',
value: 1.4,
},
{
trait_type: 'Personality',
value: 'Sad',
},
{
display_type: 'boost_number',
trait_type: 'Aqua Power',
value: 40,
},
{
display_type: 'boost_percentage',
trait_type: 'Stamina Increase',
value: 10,
},
{
display_type: 'number',
trait_type: 'Generation',
value: 2,
},
{
display_type: 'date',
trait_type: 'birthday',
value: 1546360800,
},
{
value: 'Happy',
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment