NFT Metadata Standard
Implementing Token URI
To facilitate a marketplace on BizNet to pull in off-chain metadata for ERC721 assets, the NFT contract will need to return a URI where the metadata can be found. To find this URI, the token URI method in ERC721 and the URI method in ERC1155 are used to track your NFT. You should implement the function in the Contract:
The token URI function in your Contract should return an HTTP or IPFS URL. When queried, this URL should in turn return a JSON blob of data with the metadata for your token.
Metadata Structure
Marketplaces on BizNet support metadata that is structured according to the official ERC721 metadata standard. Additionally, several properties for your items are supported, giving you all the sorting and filtering capabilities on BizNet Marketplaces. The below metadata structure, allows the BizNet Marketplace to read and display the details about the assets which your NFTs represent.
Here's how each of these properties works:
Attributes
To present NFT traits, include the following array in the metadata:
Here trait_type
is the name of the trait, value
is the value of the trait, and display_type
is a field indicating how you would like a numeric value should be displayed. For string traits, you don't have to worry about display_type
. All traits included in the attributes will be displayed in Attribute
. If you don't want to have a trait_type
for a particular trait, you can include just a value in the trait and it will be set as a generic attribute.
Numeric Traits
There are 3 supported options for display_type
: number
will show the value in pure number, boost_number
allows you to show the number with a Plus or Minus symbol, and boost_percentage
is similar to boost_number but will show a percent sign behind the number.
Date
The marketplace also supports date traits in date
display_type
. Pass in a UNIX timestamp as the value.
Last updated