Mint a NFT With Image and Metadata In 1 Transaction
This section describes how to mint a NFT within a Collection.
To use this method, you need an idexo API key.
You also need to have the address of an XXX contract deployed, the address you are minting to, the path to the image, the name, description, and attributes for the NFT that will be minted. You will need to specify the blockchain network the NFT collection is on, i.e. one of the following supported networks:
avalanche
bnbchain
dogechain
ethereum
fantom
polygon
Assuming you have installed the SDK, you can use the following code in your file (instructions on modifying it follows):
Parameters
network
string
required
see above for valid networks
contractAddress
string
required
deployed contract address
addressToMintTo
string
required
valid EVM address
image
string
required
can be 1) image file path, 2) URL, or 3) base64 string
nftName
string
required
nftDescription
string
required
attributes
json
optional
must be an array. Example: [ { "trait_type": "color", "value": "blue" } ]
options
object
optional
set metadata storage option (default "arweave"). ex. { metadataStorage: "filecoin" }
Example
Last updated