(Deprecated) Mint API
The easiest way to mint compressed NFTs at scale.
Last updated
Was this helpful?
The easiest way to mint compressed NFTs at scale.
Last updated
Was this helpful?
This endpoint will not be maintained going forward.
The Mint API enables you to mint compressed NFTs without additional headaches. We achieve best-in-class performance by running the API at the edge alongside our geo-distributed RPC network.
Here's a quick overview of the benefits:
No Solana feesโwe cover the cost!
No need to create a Merkle treeโwe handle that for you, saving both time and money.
Transaction submission and confirmationโwe ensure the transaction is successfully submitted and confirmed by the network, so you don't have to poll for status.
Automatic asset ID parsingโwe extract the asset ID from the transaction, allowing you to use the DAS API immediately without any extra steps.
Off-chain metadata uploadโwe upload your traits, images, and other metadata to Arweave at no extra cost to you.
This method mints a compressed NFT. It will wait for the transaction to confirm before parsing the assetId
. This may take up to 60 seconds when the network is busy. You can set confirmTransaction
to false if you want to skip confirmation.
Helius will construct the off-chain metadata on your behalf and upload it to Arweave. You can also provide your own off-chain metadata via the uri
field.
100 credits per NFT mint. That's it!
const url = `https://mainnet.helius-rpc.com/?api-key=<api_key>`;
const mintCompressedNft = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'helius-test',
method: 'mintCompressedNft',
params: {
name: 'Exodia the Forbidden One',
symbol: 'ETFO',
owner: 'DCQnfUH6mHA333mzkU22b4hMvyqcejUBociodq8bB5HF',
description:
'Exodia the Forbidden One is a powerful, legendary creature composed of five parts: ' +
'the Right Leg, Left Leg, Right Arm, Left Arm, and the Head. When all five parts are assembled, Exodia becomes an unstoppable force.',
attributes: [
{
trait_type: 'Type',
value: 'Legendary',
},
{
trait_type: 'Power',
value: 'Infinite',
},
{
trait_type: 'Element',
value: 'Dark',
},
{
trait_type: 'Rarity',
value: 'Mythical',
},
],
imageUrl:
'https://cdna.artstation.com/p/assets/images/images/052/118/830/large/julie-almoneda-03.jpg?1658992401',
externalUrl: 'https://www.yugioh-card.com/en/',
sellerFeeBasisPoints: 6900,
},
}),
});
const { result } = await response.json();
console.log('Minted asset: ', result.assetId);
};
mintCompressedNft();
Compressed NFTs must be minted to a Merkle tree account. The Merkle tree is a regular Solana account that must be initialized with specific configuration values ahead of time. Developers need to keep track of their Merkle tree accounts and decide which NFTs they want to mint to which tree. At the end of the day, Merkle trees are nothing more than a storage layer and have zero impact on your consumer applications. Developers shouldn't have to worry about this!
Instead, Helius manages the Merkle trees on your behalf. We ensure there is always a tree available to store your NFT and cover the cost of creating them. By default, our trees have a tree depth and canopy of 20 and 12, respectively. This means that the minimum proof path length is 8 nodes.
Helius needs permission to mint the NFT into your collection via the collection authority. This process is called "delegation". The authority must be delegated to the Helius minting account:
Devnet: 2LbAtCJSaHqTnP9M5QSjvAMXk79RNLusFspFN5Ew67TC
Mainnet: HnT5KVAywGgQDhmh6Usk4bxRg4RwKxCK4jmECyaDth5R
With Helius as the delegated authority, anyone can mint NFTs to your collection before you revoke this authority. We advise creators to verify their collections for any unauthorized NFTs after revoking the collection authority.
Unfortunately, Metaplex does not support delegation for creator verification. This means that creators cannot be verified during the mint. However, since you own the NFT, you can verify the creator yourself afterwards.
The API does not currently support image uploading, and image uploads are handled differently than standard API requests.
The following fields can be updated:
Name
Symbol
Uri
Creators
SellerFeeBasisPoints
PrimarySaleHappened
immutable
The IsMutable field can only change from mutable to immutable.
Want to learn more about Merkle trees? Read our deep dive .
You can learn more about collection delegation .
The Helius SDK allows you to delegate/revoke the collection authority. Learn more .
You can choose to provide your own off-chain metadata via the uri
field. If no uri
is specified, we will build a JSON file and upload it to Arweave on your behalf. The file will adhere to the . We upload to Arweave via (formerly known as Bundlr).
The Helius SDK offers image support. Learn more .
Users can use the Update instruction to update a compressed NFT's metadata. This must be done by the user, and not via the Mint API. An example of how to update a compressed NFT's metadata can be found . Compressed NFTs with a verified collection can have the collection authority update metadata, whereas compressed NFTs without a collection cannot update the metadata. The latter is true because Helius has tree authority and manages the compressed NFT.
The API key.
<api_key>
The version of the JSON-RPC protocol.
An ID to identify the request.
The name of the RPC method to invoke.
POST / HTTP/1.1
Host: mainnet.helius-rpc.com
Content-Type: application/json
Accept: */*
Content-Length: 700
{
"jsonrpc": "2.0",
"id": "text",
"method": "mintCompressedNft",
"params": {
"name": "Exodia the Forbidden One",
"symbol": "ETFO",
"description": "Exodia the Forbidden One is a powerful, legendary creature.",
"owner": "DCQnfUH6mHA333mzkU22b4hMvyqcejUBociodq8bB5HF",
"delegate": "DCQnfUH6mHA333mzkU22b4hMvyqcejUBociodq8bB5HF",
"collection": "text",
"uri": "text",
"attributes": [
{
"trait_type": "Rarity",
"value": "Mythical"
}
],
"imageUrl": "https://cdna.artstation.com/p/assets/images/images/052/118/830/large/julie-almoneda-03.jpg?1658992401",
"externalUrl": "https://www.yugioh-card.com/en/",
"sellerFeeBasisPoints": 5000,
"creators": [
{
"address": "DCQnfUH6mHA333mzkU22b4hMvyqcejUBociodq8bB5HF",
"share": 100
}
],
"confirmTransaction": true
}
}
{
"jsonrpc": "2.0",
"id": "text",
"result": {
"signature": "4FRxjAvHLGCEUXJqkucG7SdKrrmAeqjfTQKmhMZWvqGvkPGvWeZXY8Vfj8oxXtGnf7q3n4n8XHVDsExkpCtAEdKj",
"minted": true,
"assetId": "6sx2ChPvudKVt4Gc6qr3X4FFwtM4vVa6uZMmQHn5udQE"
}
}