Minting Tokens
Now that you've got your tokens created, it's time to start minting them into player wallets as they are earned.
- Some Enjin Coin on Enjin Matrixchain to pay for Transaction Fees and a deposit of 0.01 ENJ is required for the Token Account Deposit, for each new token holder. If the token has ENJ Infusion, each new unit minted will require the same amount of ENJ to be infused. You can obtain cENJ (Canary ENJ) for testing from the built-in Canary faucet in the Platform UI.
- An Enjin Platform Account.
- A Collection and a Token to mint.
There are two ways to use the Create Asset functionalities:
Option A. Using the Enjin Dashboard
Locate the token in the dashboard, click the 3 vertical dots (⋮), then click "Mint". Set the recipient and the amount in the corresponding fields, and click on "Mint Token".

The Transaction Request will then appear in the "Transactions" menu. A Transaction Submitted modal appears with the new transaction's UUID and a View Transaction button that opens its row on the Transactions page.
Since this request requires a Transaction
, it must be signed before it broadcasts.- By default, transactions are signed automatically by the Wallet Daemon.
- To sign with a different account, expand Transaction Options → Signing Account on the form and provide a Managed Wallet address.
Option B. Using the Enjin API & SDKs
Minting is split into two discriminator actions on CreateTransaction:
mintToken— mints to a single recipient (recipient,collectionId,tokenId,amount, optionalunitPrice).mintTokens— mints to multiple recipients in one transaction (collectionId+ atokens: [MintTokenEntryInput!]list where each entry hasrecipient,tokenId,amount, optionalunitPrice).
The example below uses mintTokens so it scales naturally if you add more recipients to the array.
The C# and C++ SDK examples below are out of date and will not work against the current Enjin Platform API. This section will be updated once new SDKs are published. Until then, use the GraphQL, cURL, Javascript, Node.js, or Python examples.
- GraphQL
- cURL
- c# SDK
- C++ SDK
- Javascript
- Node.js
- Python
mutation MintTokens {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
mintTokens: {
collectionId: 7154
tokens: [
{
recipient: "0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921"
tokenId: 6533
amount: 1
}
]
}
}
) {
uuid
action
state
}
}
curl --location 'https://platform.beta.enjin.io/graphql' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-d '{"query":"mutation MintTokens($collectionId: BigInt!, $tokens: [MintTokenEntryInput!]!) {\r\n CreateTransaction(\r\n network: ENJIN\r\n chain: MATRIX\r\n transaction: {\r\n mintTokens: {\r\n collectionId: $collectionId\r\n tokens: $tokens\r\n }\r\n }\r\n ) {\r\n uuid\r\n action\r\n state\r\n }\r\n}","variables":{"collectionId":7154,"tokens":[{"recipient":"0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921","tokenId":6533,"amount":1}]}}'
using System.Text.Json;
using Enjin.Platform.Sdk;
// Define the list of recipients and their mint parameters
var recipients = new List<MintRecipient>
{
new MintRecipient()
.SetAccount("0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921")
.SetMintParams(new MintTokenParams()
.SetAmount(1)
.SetTokenId(new EncodableTokenIdInput().SetInteger(6533))
)
};
// Setup the mutation
var batchMint = new BatchMint()
.SetCollectionId(7154)
.SetRecipients(recipients.ToArray());
// Define and assign the return data fragment to the mutation
var batchMintFragment = new TransactionFragment()
.WithId()
.WithMethod()
.WithState();
batchMint.Fragment(batchMintFragment);
// Create and auth a client to send the request to the platform
var client = PlatformClient.Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client.Auth("Your_Platform_Token_Here");
// Send the request and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
var response = await client.SendBatchMint(batchMint);
Console.WriteLine(JsonSerializer.Serialize(response.Result.Data));
#include "EnjinPlatformSdk/CoreMutations.hpp"
#include <iostream>
using namespace enjin::platform::sdk;
using namespace std;
int main() {
// Define the list of recipients and their mint parameters
shared_ptr tokenId = make_shared<EncodableTokenIdInput>();
tokenId->SetInteger(make_shared<SerializableString>("0"));
MintTokenParams mintTokenParams = MintTokenParams()
.SetAmount(make_shared<SerializableString>("1"))
.SetTokenId(tokenId);
MintRecipient mintRecipient = MintRecipient()
.SetAccount(make_shared<SerializableString>("0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921"))
.SetMintParams(make_shared<MintTokenParams>(mintTokenParams));
vector<MintRecipient> recipients;
recipients.push_back(mintRecipient);
// Setup mutation
BatchMint batchMint = BatchMint()
.SetCollectionId(make_shared<SerializableString>("7154"))
.SetRecipients(make_shared<SerializableArray<MintRecipient>>(recipients));
// Define and assign the return data fragment to the mutation
shared_ptr<TransactionFragment> transactionFragment = make_shared<TransactionFragment>();
transactionFragment
->WithId()
.WithMethod()
.WithState();
batchMint.SetFragment(transactionFragment);
// Create and auth a client to send the request to the platform
unique_ptr<PlatformClient> client = PlatformClient::Builder()
.SetBaseAddress("https://platform.beta.enjin.io")
.Build();
client->Auth("Your_Platform_Token_Here");
// Send the request then get the response and write the output to the console.
// Only the fields that were requested in the fragment will be filled in,
// other fields which weren't requested in the fragment will be set to null.
future<shared_ptr<IPlatformResponse<GraphQlResponse<Transaction>>>> futureResponse = SendBatchMint(*client, batchMint);
// Get the platform response holding the HTTP data
PlatformResponsePtr<GraphQlResponse<Transaction>> response = futureResponse.get();
// Get the result, a GraphQL response, holding the GraphQL data
const optional<GraphQlResponse<Transaction>>& gqlResult = response->GetResult();
// Write the result data to the console
if (gqlResult.has_value() && gqlResult->IsSuccess())
{
const optional<Transaction>& transaction = gqlResult->GetData()->GetResult();
std::cout << to_string(transaction->GetId().value()) << std::endl;
std::cout << ToString(transaction->GetMethod().value()) << std::endl;
}
// Write any error messages to the console
if (gqlResult.has_value() && gqlResult->HasErrors())
{
const optional<vector<GraphQlError>>& errors = gqlResult->GetErrors();
for (const GraphQlError& error : errors.value()) {
std::cout << error.GetMessage().value() << std::endl;
}
}
client.reset();
return 0;
}
fetch('https://platform.beta.enjin.io/graphql', {
method: 'POST',
headers: {'Content-Type': 'application/json','Authorization': 'Bearer YOUR_API_TOKEN'},
body: JSON.stringify({
query: `
mutation MintTokens($collectionId: BigInt!, $tokens: [MintTokenEntryInput!]!) {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mintTokens: {
collectionId: $collectionId
tokens: $tokens
}
}
) {
uuid
action
state
}
}
`,
variables: {
collectionId: 7154,
tokens: [
{
recipient: "0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921",
tokenId: 6533,
amount: 1
}
]
}
}),
})
.then(response => response.json())
.then(data => console.log(data));
const axios = require('axios');
axios.post('https://platform.beta.enjin.io/graphql', {
query: `
mutation MintTokens($collectionId: BigInt!, $tokens: [MintTokenEntryInput!]!) {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mintTokens: {
collectionId: $collectionId
tokens: $tokens
}
}
) {
uuid
action
state
}
}
`,
variables: {
collectionId: 7154,
tokens: [
{
recipient: "0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921",
tokenId: 6533,
amount: 1
}
]
}
}, {
headers: {'Content-Type': 'application/json','Authorization': 'Bearer YOUR_API_TOKEN'}
})
.then(response => console.log(response.data))
.catch(error => console.error(error));
import requests
query = '''
mutation MintTokens($collectionId: BigInt!, $tokens: [MintTokenEntryInput!]!) {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mintTokens: {
collectionId: $collectionId
tokens: $tokens
}
}
) {
uuid
action
state
}
}
'''
variables = {
'collectionId': 7154,
'tokens': [
{
'recipient': '0xaa89f9099742a928051c41eadba188ad4e863539ff96f16722ae7850271c2921',
'tokenId': 6533,
'amount': 1,
},
],
}
response = requests.post('https://platform.beta.enjin.io/graphql',
json={'query': query, 'variables': variables},
headers={'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_API_TOKEN'}
)
print(response.json())
The response includes the transaction's uuid, action (e.g. MultiTokens.batch_mint), and state (PENDING → BROADCAST → FINALIZED). Use GetTransaction(network, chain, uuid: "<returned-uuid>") to poll the current state.
Once it reaches FINALIZED, a MultiTokens.Minted event is emitted for each recipient with the minted amount — useful when you need to confirm a mint reached a specific player (e.g. before unlocking the corresponding in-game item). See Working with Events for how to read it.
For a comprehensive view of all available arguments for queries and mutations, please refer to our API Reference. This resource will guide you on how to use the GraphiQL Playground to explore the full structure and functionality of our API.
If you want to create and mint new tokens together, use createTokens instead of mintTokens. To sign with a managed wallet instead of the Wallet Daemon, set signerAccount on CreateTransaction.
What if you need to transfer a token? proceed to Transferring Tokens.