Use NFT Express to Mint NFTs on Solana
NFT Express uses the same simple API endpoint that you would use to mint NFTs for your own smart contracts with Tatum.
However, with NFT Express you no longer need to enter the following:
- Private key
- Smart contract address
- Token ID
This guide explains how to use NFT Express to mint NFTs specifically on Solana. To learn how to use NFT express on other blockchains:
- Mint NFTs with Tatum's NFT Express (for BNB Smart Chain, Celo, Ethereum, Harmony, Klaytn, and Polygon)
When used on the mainnet, NFT Express works only with paid Tatum plans. Tatum covers the minting fee for you and then deducts the corresponding number of credits from your monthly credit allowance.
To use NFT Express, you need an API key with a paid Tatum plan. Visit the Tatum Dashboard to sign up for one.
You must enter the API key in the environment variables in your IDE or into the header of the direct API request.
When you mint an NFT on Solana with NFT Express, the pre-built smart contract based on the Metaplex Protocol is used.
Using the
MintNftExpressSolana
schema, enter the API key in the environment variables in your IDE or into the header of the direct API request.Request
JavaScript
cURL
const resp = await fetch(
`https://api.tatum.io/v3/nft/mint`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
chain: 'SOL',
to: 'FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ',
metadata: {
name: 'My NFT',
symbol: 'NFT_SYMBOL',
sellerFeeBasisPoints: 10,
uri: 'https://my_token_data.com',
creators: [
{
address: 'FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ',
verified: 1,
share: 10
}
]
}
})
}
);
curl -i -X POST \
https://api.tatum.io/v3/nft/mint \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"chain": "SOL",
"to": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
"metadata": {
"name": "My NFT",
"symbol": "NFT_SYMBOL",
"sellerFeeBasisPoints": 10,
"uri": "https://my_token_data.com",
"creators": [
{
"address": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
"verified": 1,
"share": 10
}
]
}
}'
Request parameters:
- chain
SOL
for Solana in this specific case. - to The recipient’s address to which the NFT will be sent.
- metadata
- name The name of the minted NFT.
- symbol The symbol of the minted NFT.
- sellerFeeBasisPoints The royalty that will be paid to the authors of the minted NFT every time the NFT is transferred. The royalty is calculated as a percentage of the NFT price. To set the royalty to 1%, set this parameter to
100
; to set 10%, set this parameter to1000
; to set 50%, set this parameter to5000
, and so on. To specify the NFT authors and their shares in the royalty, set thecreators
parameter. To disable the royalty for the NFT completely, setsellerFeeBasisPoints
to0
and do not setcreators
. - creators Royalty receivers for NFT transfers.
- address The address of the NFT creator.
- verified Status of the creator; verified = 1, non-verified = 0.A verified creator is the blockchain address whose private key was used to sign the transaction. When you use NFT Express, the only verified creator is the Tatum’s minting address; therefore, set this parameter to 0.⚠
- share Share to be sent to the creator in percent.
What happens on the background?
- The private key and contract address will be by default set to Tatum’s pre-deployed smart contract and our private key on Solana.
- The token ID will be generated automatically.
- The transaction fees will be deducted as credits from your monthly credit allowance from the paid Tatum plan you have selected.
Response
{
"txId": "4kiRkAWjjr5t3rBKmYQ5d2e3xjgnRRttB5GtUz2F4sz5wwC7NnV74qCZ1KN1b37qsnjkKknsJPGXdcPhzHpkiMAs",
"nftAddress": "4afZBmAneN2j6gDHH8zdrNWkCqfMC3XPH2cpFKtYMSVe",
"nftAccountAddress": "A8BSHPJcB5ZGCT6yo6pz2RYqnypTSpzTAFSBhtTQmsEE"
}
When you mint an NFT on Solana, a new blockchain address is created to receive the NFT under the recipient's account address (the one in the
to
parameter of the request body of the minting call).
You may think of it as of an "alias" address owned by the recipient’s address. The two addresses share the private key. You will find this new address in the nftAccountAddress
parameter in the response body of the minting call.The response body also returns the address of the minted NFT itself, which is held in the
nftAddress
parameter.You can mint as many NFTs as you want without devising the logic and setting up your own NFT solution.
If you want to transfer the minted NFT to another blockchain address, use the
transferNftSolana
or transferNftSolanaKMS
schema of the API for transferring an NFT.JavaScript
cURL
const resp = await fetch(
`https://api.tatum.io/v3/nft/transaction`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY_HERE'
},
body: JSON.stringify({
chain: 'SOL',
from: 'FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ',
to: '9pSkqSG71Sb25ia9WBFhoeBYjp8dhUf7fRux9xrDq89b',
contractAddress: '3tzudv5KaoqmieWiBUqzWokKEtTvx1wQMapVKeH7CHaq',
fromPrivateKey: '3abc79a31093e4cfa4a724e94a44906cbbc3a32e2f75f985a28616676a5dbaf1de8d82a7e1d0561bb0e1b729c7a9b9b1708cf2803ad0ca928a332587ace391ad'
})
}
);
const data = await resp.json();
console.log(data);
curl -i -X POST \
https://api.tatum.io/v3/nft/transaction \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"chain": "SOL",
"from": "FykfMwA9WNShzPJbbb9DNXsfgDgS3XZzWiFgrVXfWoPJ",
"to": "sfgDgS3XZzWiFgrVXfWoPJFykfMwA9WNShzPJbbb9DNX",
"contractAddress": "3tzudv5KaoqmieWiBUqzWokKEtTvx1wQMapVKeH7CHaq",
"fromPrivateKey": "3abc79a31093e4cfa4a724e94a44906cbbc3a32e2f75f985a28616676a5dbaf1de8d82a7e1d0561bb0e1b729c7a9b9b1708cf2803ad0ca928a332587ace391ad"
}'
In the request body:
- Set the
from
parameter to the address that you used in theto
parameter in the request body of the minting call. - Set the
to
parameter to the recipient's address. - Set the
contractAddress
parameter to the address from thenftAddress
parameter returned in the response body of the minting call. - Set the
fromPrivateKey
/signatureId
parameter to the private key/signature ID of the blockchain address that you specified in thefrom
parameter.