Assets belonging to a collection (tokens that have been minted from a smart contract) can contain metadata that specify attributes about the asset. The aim of metadata is to allow applications to utilize this data.
Examples of how games or applications can use asset metadata:
An in-game asset has characteristics that allow its owner to wield certain advantages within the game, like being able to defeat opponents whose assets have lesser characteristics. The game needs to be able to read the attributes of the asset in order to execute the game mechanics accordingly.
An NFT marketplace will want to display attributes of an asset that is for sale, like the asset's name, rarity, image (using the URL specified in the asset's metadata), etc.
One of the most common uses of metadata is for NFT marketplaces to display characteristics of an asset. Many marketplaces have certain formats in which they read metadata from assets. There are also wallets and other NFT tooling that have their own formats. This is something that you must consider when setting your asset's metadata.
The XpansionChain Marketplace uses the following core properties:
Property
Description
Mandatory
name
The display name for this asset.
No
description
The description of this asset.
No
image_url
The URL of the display image for this asset. This will be used as a video thumbnail in the XpansionChain Marketplace.
No
image
Alternative field of image_url.
No
animation_url
A URL to a multi-media attachment for the item. We highly recommend the use of the HLS format for streaming video over HTTP. This is generally used for video NFTs.
Applications are required to host their own video assets and expose their location via this URL.
No
animation_url_mime_type
Mime type of the file that animation_url points to. XpansionChain currently only supports these 3 mime types: application/vnd.apple.mpegurl, video/mp4 and video/webm.
No, unless animation_url is specified.
youtube_url
A URL to a YouTube video. This playback method is currently not supported in the XpansionChain Marketplace, but third party support could be built.
The metadata schema outlines the names of the metadata object properties and the values that are acceptable for each property.
When registering the metadata schema for an XpansionChain collection, you can assign the following value types for each property:
Type
Description
Filterable?
enum
Property with a defined enumeration of possible values (e.g. god = "nature" or "death").
Yes
text
Property which contains arbitrary text. Should be searchable.
No
boolean
Property which can be either true or false.
Yes
discrete
Property which will usually be handled as a multi-select, e.g. values from 1-10
Yes
Additionally, a filterable attribute can be specified for each property in the metadata schema, which allows API consumers to filter assets that are returned by these values. Filterable cannot be true for text parameter types.
Example metadata schema for the metadata example above:
To add missing attributes to your collection's metadata schema that were not submitted in the original request, follow these instructions. Just add the missing attributes and they will be appended.
Submitting the same metadata schema attribute will result in the error:
You can update the type and filterable attributes of a metadata schema property
Updating the filterable attribute of a metadata schema property to true is an expensive API call as it triggers a re-scan of all the assets in the collection to get up-to-date filter values