Skip to main content

Transferring Tokens

You will need to transfer tokens for:

  • Implementing various gameplay features such as gifting, trading, and rewards.
  • Supporting secure and efficient token transactions.
  • Providing a seamless user experience by allowing token transfers without leaving the game environment.
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. 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 transfer a token:

  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 "Transfer".

Need to perform multiple transfers?

The Transfer form has a + Add to Batch button — queue several transfers and submit them as a single batched transaction. See Batching transactions for the full flow.

Fill in the recipient and amount in the corresponding fields.

The Transfer Token form

Once you're satisfied with the options, click the "Transfer" button to submit the request. 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

Transfers are split into three discriminator actions on CreateTransaction:

  • transferToken — transfer a specific token between accounts.
  • transferEnj — transfer ENJ (or cENJ on Canary) between accounts.
  • batchTransfer — transfer multiple tokens from one collection to multiple recipients in a single transaction.
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.

Transferring an asset

Use the transferToken action to move a specific token from the signing account to another wallet.

mutation TransferToken {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
transferToken: {
recipient: "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"
collectionId: 36105
tokenId: 0
amount: 1
}
}
) {
uuid
action
state
}
}

Transferring ENJ token

To send ENJ (or cENJ on the Canary network) from one wallet to another, use the transferEnj action.

mutation TransferEnj {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
transferEnj: {
recipient: "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"
amount: 5000000000000000000 # 5 ENJ in base units (5 * 10^18)
}
}
) {
uuid
action
state
}
}
Key arguments
  • Calculating the amount
    • The Platform accepts ENJ values in the base unit (integers), not decimal ENJ amounts. To calculate the correct input, multiply your desired ENJ amount by 10^18 (1 quintillion).
    • Formula: Desired ENJ * 1,000,000,000,000,000,000
    • Example: To transfer 5 ENJ, input 5000000000000000000.
  • keepAlive flagtransferEnj does not expose a keepAlive flag. If you need to send your full balance, send slightly less than the full balance to avoid reaping the source account. Read more about account reaping.

Batch Transferring ENJ token

To send ENJ to multiple addresses in a single on-chain transaction, use CreateBatchTransaction with one transferEnj entry per recipient.

mutation BatchTransferEnj {
CreateBatchTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transactions: [
{ transferEnj: { recipient: "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f", amount: 5000000000000000000 } }
{ transferEnj: { recipient: "cxKy7aqhQTtoJYUjpebxFK2ooKhcvQ2FQj3FePrXhDhd9nLfu", amount: 15250000000000000000 } }
]
) {
uuid
action
state
}
}
Batched token transfers

To transfer multiple tokens from a single collection to multiple recipients in one transaction, use the batchTransfer discriminator action: { collectionId, recipients: [{ account, tokenId, amount }] }.

Need to send a transaction request to user's wallet?

This can be done using Enjin Platform API & WalletConnect! To learn more, check out the Using WalletConnect page.

Once a transfer transaction reaches FINALIZED, a MultiTokens.Transferred event (for token transfers) or Balances.Transfer event (for ENJ transfers) is emitted with the sender, recipient, and amount — useful for reacting to inbound transfers in real time (e.g. unlocking an in-game item the moment a player receives the corresponding NFT). 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.

To sign with a managed wallet instead of the Wallet Daemon, set signerAccount on CreateTransaction / CreateBatchTransaction.