Create an item type

Before an item can be granted, you must define the item type. An item type is the blueprint from which individual items can be created. On-chain, item types are collections from which NFTs are minted.

Item types have the following characteristics:

collectionName

The name of the collection on-chain. This is an identifier which helps ensure you're looking at the right asset on the block explorer. It's not displayed in the Mythical Marketplace. This is immutable.

maxSupply

The maximum quantity of the item which can be granted.

mintMode

Determines how the tokenId of each item is selected when it is minted.

  • serial: Each consecutive tokenId is incremented from the previous.

  • random: Each consecutive tokenId is a random number between 1 and the maxSupply.

  • controlled: The tokenId is input when the item is minted.

defaultMetadata

Item metadata is linked to the item on-chain and displayed in the Mythical Marketplace. Default item metadata is set when no metadata is provided when the item is granted. See item metadata below.

The following image shows an item listed in the Mythical Marketplace. Note how metadata is displayed.

Item metadata has the following characteristics:

name

The title of the asset.

description

A long form description of the asset.

image

A thumbnail style image representing the asset.

attributes

A list of attributes which describe the asset. These should be used for attributes that convey asset value. Examples could be rarity, strength, level, etc.

Creating an item type means a collection will be created on-chain.

curl --location 'http://127.0.0.1:8080/v1/item-types' \
--header 'Content-Type: application/json' \
--data '{
    "collectionName":"itemtype test 1",
    "maxSupply":10,
    "mintMode":"mintmod"
}'

Once the item type is created, items can be granted.

Last updated