Batch Mint NFTs

This guide will explain how you can mint and send NFTs to multiple wallets in a batch.

Scenario Explained

In this guide we will be working with the NFT-API, and cover a more advanced use case, where you want to distribute a certain type of NFT immediately to several different wallet addresses and perhaps even a different amount for each address.

End Result

Distributing different amount of an NFT to different addresses in one call.

Prerequisites

  1. You need an account on the Venly Developer Portal, if you don't have one, click here to register in our Developer Portal, or follow our step-by-step guide, Getting Started with Venly.
  2. You need an active trial or paid subscription of the NFT-API. You can start a 30-day free trial for the NFT-API as shown below.
  3. You need your Client ID and Client Secret which can be obtained from the Portal as shown below.
  4. You need a contract with a contractAddress and token-type with tokenTypeId. Learn how to create a contract and token-type.
Starting a trial subscription and obtaining a Client ID and Client Secret

Batch Minting NFTs

We will use the following endpoint along with the contractAddress, secretType, and tokenTypeId in the request body. We have specified three different wallet addresses in the request body.

Similarly, you can add up to 100 different wallet addresses by following the syntax in the request body. While specifying the wallet address, you can also specify the number of NFTs you wish to mint per wallet address.

In this example, we have specified one NFT for the first address, two NFTs for the second address, and three NFTs for the third address.

Request Endpoint: reference

 POST /api/v2/tokens/mints
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

Request Body:

{
  "contractAddress": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
  "secretType": "MATIC",
  "tokenTypeId": "3",
  "destinations": [
    {
      "address": "0x9282fc38931A3a613b8566b3E6a1027e49ABb712",
      "amount": 1
    },
    {
      "address": "0xe396E30554F97088FA6f9297339c3bDc575ba306",
      "amount": 2
    },
    {
      "address": "0x329CdCBBD82c934fe32322b423bD8fBd30b4EEB6",
      "amount": 3
    }
  ]
}

Response Body:

📘

  • Under the mints array, you can find individual id for each minted NFT listed with the wallet address. This unique id can be used to track the status of the mint request.
  • The status attribute indicates the on-chain token mint status.
{
    "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
        }
    }
}