Skip to main content

Minting Tokens

Now that you've got your tokens created, it's time to start minting them into player wallets as they are earned.

What you'll need:
  • 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:

  1. Using the Enjin Dashboard
  2. Using the GraphQL API & SDKs

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 Mint Token form

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, optional unitPrice).
  • mintTokens — mints to multiple recipients in one transaction (collectionId + a tokens: [MintTokenEntryInput!] list where each entry has recipient, tokenId, amount, optional unitPrice).

The example below uses mintTokens so it scales naturally if you add more recipients to the array.

SDKs are not yet available

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.

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
}
}

The response includes the transaction's uuid, action (e.g. MultiTokens.batch_mint), and state (PENDINGBROADCASTFINALIZED). 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.

Explore More Arguments

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.

You've minted a token!

What if you need to transfer a token? proceed to Transferring Tokens.