Mint an NFT

This page describes the entire flow in minting an NFT.

NFT Minting Flow

NFT Minting Flow

NFT creation Flow

1. Create the contract / NFT collection

The first step in creating your NFT is creating the smart contract on the blockchain that will hold all your NFTs.

You can compare the smart contract with a "Collection" of NFTs. This contract will accommodate all your created NFTs. On NFT marketplaces, the NFTs belonging to one contract are typically visualized as one collection. For example, our very own Metaring-smart contract is represented on different marketplaces as follows:

Therefore, decide carefully on how you want to "group" your NFTs. For each group or collection, you can create a new smart contract/collection.

Creating the contract is done by using the following endpoint:

Request Endpoint: reference

POST /api/v2/contracts/deployments

📘

Click here to read how to create a contract.

📘

NOTE:

  • Our contracts are created according to the ERC-1155 standard. This standard allows to mint fungible- as well as non-fungible tokens.
  • Each contract creation will result in a deployment on the blockchain (and therefore be visible on the blockchain). Your contract will receive a unique address.
  • The following address is for example the address of the Metaring collection: 0xba8c3db050dd99cbe7f980f3d8f48084c6dcc20b
  • The smart contract that we deploy is a Fully Audited Token Contract (by Least Authority and Nonce Audit) and is battle-tested in the field.

2. Create the token-type / template

The second step is defining the NFTs that you want to create in the collection. Here you define the images, media, attributes, etc. for the tokens that you want to create. This means that for each NFT with a distinct image and attributes, you need to create a separate token-type.

For each token-type, you can mint one or more NFTs.

A basic token-type configuration consists of:

  • Name
  • Description
  • Image
  • Indication of fungible or non-fungible
  • Additional attributes

See this list for the complete configuration possibilities.

Creating the token-type is done by using the endpoint:

Request Endpoint: reference

POST /api/v2/token-types/creations

📘

Click here to read how to create a token-type.

🚧

The token-type only defines the tokens. They are not yet created / minted on the blockchain. The last minting-step still needs to be done.

📘

NOTE:

In the token-type, you will need to define if you want to create fungible or non-fungible tokens.

When minting a non-fungible token, it will always be represented as one unique item on the blockchain. Each mint (of the same token-type) is distinguishable from the other mint. More specifically: each minted token will receive a unique token-id on the blockchain.

On the other hand, fungible token-mints are indistinguishable to one another. They all have the same token-id.

In summary:

  • A non-fungible token is a truly unique token. Use these if you really need to know the difference between two minted items.
  • e.g. our Meta-ring is a non-fungible token, each NFT has a different id: https://venly.market/collections/metaring
  • A fungible token is something you have a lot of, and do not need to distinguish from each-other. Use these, if the difference between two minted items does not matter.
  • e.g. minting 100.000 "fish"-tokens, used to heal your character in a game.

More information.

3. Minting tokens

The last step in NFT creation is the actual minting of the tokens. These create a token on the blockchain, using the template (token-type) defined in the previous step.

When minting an NFT, you can immediately provide a destination. The freshly created NFT will be immediately sent to the requested destination.

📘

Minting is done by using the endpoint:

Request Endpoint: reference

POST /api/v2/tokens/mints

Request Body Parameters

ParameterParam TypeDescriptionTypeRequired
contractAddressBodyThe contract addressString
secretTypeBodyThe blockchain of the contractString
tokenTypeIdBodyThis is the ID of the token-type. You can get it from the response body when you create a token-type.String
destinationsBodyThe array which includes all the wallet addresses and the number of NFTs to mint per wallet addressArray of objects
destinations.addressBodyThe wallet address to mint and send the NFTString
destinations.amountBodyThe number of NFTs you want to mint and sendInteger

📘

You can mint multiple tokens for one token-type. All will "look" the same (they have the same image and properties as defined in the token-type). However, if you are minting non-fungible tokens, each token will receive a unique token-id and mint number (on chain).

Example Request

POST /api/v2/tokens/mints
{
  "contractAddress": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
  "secretType": "MATIC",
  "tokenTypeId": "3",
  "destinations": [
    {
      "address": "0x9282fc38931A3a613b8566b3E6a1027e49ABb712",
      "amount": 1
    },
    {
      "address": "0xe396E30554F97088FA6f9297339c3bDc575ba306",
      "amount": 2
    },
    {
      "address": "0x329CdCBBD82c934fe32322b423bD8fBd30b4EEB6",
      "amount": 3
    }
  ]
}

Response Body

📘

The result.mint.id param can be used to track the token mint request.

{
    "success": true,
    "result": {
        "mints": [
            {
                "id": "01d678f4-f8d7-4acf-b7d0-4fb801cd091c",
                "status": "PENDING",
                "destination": {
                    "address": "0x9282fc38931A3a613b8566b3E6a1027e49ABb712",
                    "amount": 1
                }
            },
            {
                "id": "2ef89e28-93cc-4afc-8a32-ad0f1db4a58c",
                "status": "PENDING",
                "destination": {
                    "address": "0xe396E30554F97088FA6f9297339c3bDc575ba306",
                    "amount": 1
                }
            },
            {
                "id": "9426c547-7a9b-4702-b154-a3f5bf105bc4",
                "status": "PENDING",
                "destination": {
                    "address": "0xe396E30554F97088FA6f9297339c3bDc575ba306",
                    "amount": 1
                }
            },
            {
                "id": "fb18c232-d181-4c2f-b2aa-3f8adeb0d362",
                "status": "PENDING",
                "destination": {
                    "address": "0x329CdCBBD82c934fe32322b423bD8fBd30b4EEB6",
                    "amount": 1
                }
            },
            {
                "id": "2e762c5c-e5bb-440d-a3f3-36c25915876a",
                "status": "PENDING",
                "destination": {
                    "address": "0x329CdCBBD82c934fe32322b423bD8fBd30b4EEB6",
                    "amount": 1
                }
            },
            {
                "id": "65595338-48d5-4544-8e5d-8e5e1a74bf7a",
                "status": "PENDING",
                "destination": {
                    "address": "0x329CdCBBD82c934fe32322b423bD8fBd30b4EEB6",
                    "amount": 1
                }
            }
        ],
        "metadata": {
            "name": "NFT with metadata on IPFS",
            "description": "This NFTs metadata is stored on IPFS",
            "image": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
            "imagePreview": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
            "imageThumbnail": "https://static.wikia.nocookie.net/parody/images/4/42/74915084_10162764640400387_6139958579186106368_o.jpg",
            "backgroundColor": "#eeeeee",
            "background_color": "#eeeeee",
            "animationUrl": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4",
            "animation_url": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4",
            "externalUrl": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
            "external_url": "https://en.wikipedia.org/wiki/Space_Chickens_in_Space",
            "animationUrls": [
                {
                    "type": "video",
                    "value": "https://img.arkane.network/marketing/SpaceChickens/space_chickens_trailer.mp4"
                },
                {
                    "type": "audio",
                    "value": "https://file-examples-com.github.io/uploads/2017/11/file_example_WAV_10MG.wav"
                }
            ],
            "attributes": [
                {
                    "type": "property",
                    "name": "Talent",
                    "value": "Leadership",
                    "traitType": "Talent",
                    "trait_type": "Talent"
                },
                {
                    "type": "property",
                    "name": "Allergic",
                    "value": "Monstonuts",
                    "traitType": "Allergic",
                    "trait_type": "Allergic"
                },
                {
                    "type": "property",
                    "name": "Hobby",
                    "value": "Scouts",
                    "traitType": "Hobby",
                    "trait_type": "Hobby"
                },
                {
                    "type": "stat",
                    "name": "Cool",
                    "value": "9",
                    "maxValue": "10",
                    "displayType": "number",
                    "display_type": "number",
                    "traitType": "Cool",
                    "trait_type": "Cool"
                },
                {
                    "type": "stat",
                    "name": "Daring",
                    "value": "8",
                    "maxValue": "10",
                    "displayType": "number",
                    "display_type": "number",
                    "traitType": "Daring",
                    "trait_type": "Daring"
                },
                {
                    "type": "stat",
                    "name": "Noise",
                    "value": "8",
                    "maxValue": "10",
                    "displayType": "number",
                    "display_type": "number",
                    "traitType": "Noise",
                    "trait_type": "Noise"
                },
                {
                    "type": "stat",
                    "name": "Age",
                    "value": "3",
                    "displayType": "number",
                    "display_type": "number",
                    "traitType": "Age",
                    "trait_type": "Age"
                },
                {
                    "type": "boost",
                    "name": "Crafting",
                    "value": "+5",
                    "displayType": "boost_number",
                    "display_type": "boost_number",
                    "traitType": "Crafting",
                    "trait_type": "Crafting"
                },
                {
                    "type": "boost",
                    "name": "Leadership",
                    "value": "+10",
                    "displayType": "boost_number",
                    "display_type": "boost_number",
                    "traitType": "Leadership",
                    "trait_type": "Leadership"
                },
                {
                    "type": "system",
                    "name": "tokenTypeId",
                    "value": "3",
                    "traitType": "Token Type ID",
                    "trait_type": "Token Type ID"
                },
                {
                    "type": "property",
                    "name": "maxSupply",
                    "value": "25",
                    "traitType": "Max Supply",
                    "trait_type": "Max Supply"
                }
            ],
            "contract": {
                "address": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
                "name": "My first collection",
                "symbol": "MYFICO",
                "image": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "imageUrl": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "image_url": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "description": "Sample description",
                "externalLink": "www.venly.io",
                "external_link": "www.venly.io",
                "externalUrl": "www.venly.io",
                "external_url": "www.venly.io",
                "media": [],
                "type": "ERC_1155"
            },
            "fungible": false
        }
    }
}