These docs are for v2.0. Click to read the latest docs for v3.0.

Create token-type & directly mint NFTs

This guide describes how to create a token-type and simultaneously mint NFTs.

This guide provides detailed instructions on how to create a token-type and mint NFTs at the same time. It covers the process of defining the token-type's attribute and how to mint NFTs simultaneously.

Prerequisites

  • You need a deployed NFT contract and it's
    • Contract Address
    • Blockchain of the Contract

📘

Learn how to create an NFT contract.

Defining token-type & minting NFTs in a single transaction

When creating a token-type, you can also define the destinations array, which includes information on the wallet/email address and quantity of NFTs to mint. You can define multiple wallet/email addresses within the destinations array.

👍

  • This single request will create a token-type and also mint NFTs to the specified addresses.
  • You can also create multiple token-types with this endpoint.

Request Endpoint: reference

POST /api/v2/token-types/creations

❗️

Running the endpoint twice will create two token-types with the same metadata.

Request Body

ParameterDescriptionTypeRequired
secretTypeThe blockchain of the contractString
contractAddressThe contract address under which you want to create the token-typeString
creationsAn array of objects that can define one or multiple token-type detailsArray of objects
creations.nameThe name of the token-typeString
creations.descriptionThe description of the token-typeString
creations.imageThe image URL for the token-type that will be displayedString
creations.maxSupplyThe maximum number of NFTs to be minted from this token-typeInteger
creations.destinationsAn array that includes the wallet/email addresses and amount of NFTs to mint per addressArray of objects
creations.destinations.addressThe wallet address or email address where NFTs are to be mintedString
creations.destinations.amountThe amount of NFTs to mint per addressString
{
    "secretType": "MATIC",
    "contractAddress": "0x51e6f78370f44c828a31727ed3a9fbefc47f4071",
    "creations": [
        {
            "name": "Spaceship",
            "description": "Venly Spaceship NFT",
            "image": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
            "maxSupply": 100,
            "destinations": [
                {
                    "address": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9",
                    "amount": "2"
                },
                {
                    "address": "0xb811Fac088E8E80F56258a5f29D47d0FF1a37BD5",
                    "amount": "3"
                }
            ]
        }
    ]
}

Response Body

📘

  • creations.id: The id to check the status of the token-type creation request (creationId).
  • creations.mints.id: The id to check token mint request (mintId).
{
    "success": true,
    "result": {
        "creations": [
            {
                "id": "e2804828-98be-45f5-8bb4-cafa8c9914f4",
                "status": "PENDING",
                "tokenTypeId": 34,
                "mints": [
                    {
                        "id": "c6b2b9db-ba04-4603-a5fd-3efb39756260",
                        "createdOn": "2024-08-16T12:28:41.81155272",
                        "status": "PENDING",
                        "destination": {
                            "address": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9",
                            "amount": 1
                        }
                    },
                    {
                        "id": "9f68c871-f251-47e8-98dd-3f65719dc429",
                        "createdOn": "2024-08-16T12:28:41.813348244",
                        "status": "PENDING",
                        "destination": {
                            "address": "0x7312750DF4d2057b758a61C7017729c6Ec9bB3E9",
                            "amount": 1
                        }
                    },
                    {
                        "id": "77182b6f-7f79-4bc6-832d-0063f968b288",
                        "createdOn": "2024-08-16T12:28:41.81938192",
                        "status": "PENDING",
                        "destination": {
                            "address": "0xb811Fac088E8E80F56258a5f29D47d0FF1a37BD5",
                            "amount": 1
                        }
                    },
                    {
                        "id": "198ecf2c-cfd6-42ba-a11d-705a69efd019",
                        "createdOn": "2024-08-16T12:28:41.821438764",
                        "status": "PENDING",
                        "destination": {
                            "address": "0xb811Fac088E8E80F56258a5f29D47d0FF1a37BD5",
                            "amount": 1
                        }
                    },
                    {
                        "id": "42db1949-68d6-4ed3-a675-1af918ee0f1d",
                        "createdOn": "2024-08-16T12:28:41.822734771",
                        "status": "PENDING",
                        "destination": {
                            "address": "0xb811Fac088E8E80F56258a5f29D47d0FF1a37BD5",
                            "amount": 1
                        }
                    }
                ],
                "metadata": {
                    "name": "Spaceship",
                    "description": "Venly Spaceship NFT",
                    "image": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
                    "imagePreview": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
                    "imageThumbnail": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
                    "animationUrls": [],
                    "attributes": [
                        {
                            "type": "system",
                            "name": "tokenTypeId",
                            "value": "34",
                            "traitType": "Token Type ID",
                            "trait_type": "Token Type ID"
                        },
                        {
                            "type": "property",
                            "name": "maxSupply",
                            "value": "100",
                            "traitType": "Max Supply",
                            "trait_type": "Max Supply"
                        }
                    ],
                    "contract": {
                        "address": "0x51e6f78370f44c828a31727ed3a9fbefc47f4071",
                        "name": "Venly Test NFT Collection",
                        "symbol": "VETENFCO",
                        "image": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                        "imageUrl": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                        "image_url": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                        "description": "This is a testnet NFT collection",
                        "externalLink": "https://www.venly.io/",
                        "external_link": "https://www.venly.io/",
                        "externalUrl": "https://www.venly.io/",
                        "external_url": "https://www.venly.io/",
                        "media": [],
                        "type": "ERC_1155"
                    },
                    "fungible": false
                }
            }
        ]
    }
}

Check token mint status

You can check the status of the token mints using the creations.mints.id from the response of the previous endpoint. Each id is unique for each token mint. We will take an example from the above response and check the token mint status.

Request Endpoint: reference

GET /api/v2/tokens/mints/42db1949-68d6-4ed3-a675-1af918ee0f1d

Response Body

📘

The result.status is SUCCEEDED, indicating the token mint was completed successfully.

{
    "success": true,
    "result": {
        "id": "42db1949-68d6-4ed3-a675-1af918ee0f1d",
        "tokenId": 39,
        "createdOn": "2024-08-16T12:28:41.822735",
        "status": "SUCCEEDED",
        "transactionHash": "0xc4e76bdbc48e2c0049f34bd6ee5fceeefd028ae2383b02d447832a1ca008121f",
        "destination": {
            "address": "0xb811Fac088E8E80F56258a5f29D47d0FF1a37BD5",
            "amount": 1
        },
        "metadata": {
            "name": "Spaceship",
            "description": "Venly Spaceship NFT",
            "image": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
            "imagePreview": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
            "imageThumbnail": "https://storage-staging.venly.io/applications/bff93371-db40-4363-9692-4fbe64a34b54/t7wrTeL6SiCuWdwXp9d1xw.png",
            "animationUrls": [],
            "attributes": [
                {
                    "type": "system",
                    "name": "tokenTypeId",
                    "value": "34",
                    "traitType": "Token Type ID",
                    "trait_type": "Token Type ID"
                },
                {
                    "type": "property",
                    "name": "maxSupply",
                    "value": "100",
                    "traitType": "Max Supply",
                    "trait_type": "Max Supply"
                },
                {
                    "type": "property",
                    "name": "mintNumber",
                    "value": "5",
                    "traitType": "Mint Number",
                    "trait_type": "Mint Number"
                }
            ],
            "contract": {
                "address": "0x51e6f78370f44c828a31727ed3a9fbefc47f4071",
                "name": "Venly Test NFT Collection",
                "symbol": "VETENFCO",
                "image": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                "imageUrl": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                "image_url": "https://techround.co.uk/wp-content/uploads/2022/01/Venly-logo.png",
                "description": "This is a testnet NFT collection",
                "externalLink": "https://www.venly.io/",
                "external_link": "https://www.venly.io/",
                "externalUrl": "https://www.venly.io/",
                "external_url": "https://www.venly.io/",
                "media": [],
                "type": "ERC_1155"
            },
            "fungible": false
        }
    }
}

Minted NFT Preview

Minted NFT Preview

Minted NFT Preview