🔗mint
Last updated
Last updated
The mint
function is an asynchronous function that mints a new token for a specific contract on a specified blockchain.
It supports different contract types and performs the minting operation accordingly. The function utilizes contract-specific minting functions to handle the minting
Parameter | Data Type | Description |
---|---|---|
Field | Data Type | Description |
---|---|---|
Before making requests with NEST® SDK, you must have it installed.
You can install NEST® SDK using either npm
or yarn
. Use the following commands to install NEST® SDK:
Here is an example of how to make a mint
request using the NEST® SDK:
Minting an ERC721 token: This function mints a new ERC721 token on the specified blockchain and contract. It requires the receiver address and the URI of the token.
Minting an ERC1155 token: For the ERC1155 contract type, this function mints a new ERC1155 token with the specified receiver, amount, URI, and other required parameters.
Minting a SoulBound token: If the contract type is SoulBound, this function mints a new SoulBound token with the specified receiver, URI, and other parameters.
Handling unsupported contract types: If the provided contract type is not supported, the function returns an error indicating that the contract type is not found.
contract
string
The type of contract for which the token will be minted.
blockchain
string
The target blockchain on which the contract is deployed.
contractAddress
string
The address of the contract on the specified blockchain.
privateKey
string
The private key associated with the account performing the minting.
params
mintParams
Additional parameters required for the minting operation.
env
string
The environment for the minting operation.
code
Number
A numeric value indicating the execution status (1 for success, 0 for error).
error
any
The error object containing details about the encountered error, if applicable.
receipt
any
The receipt object containing information about the minting transaction, such as transaction hash and addresses.
tokenId
any
The ID of the minted token.