Tokens
https://platform.beta.enjin.io/graphql
All token-level actions are submitted through CreateTransaction, with the action selected by the field set on the transaction input. The response shape is always a Transaction — the examples below all return the standard { uuid, action, state } selection. Once a transaction reaches FINALIZED, the on-chain event(s) it emitted (e.g. MultiTokens.Minted, MultiTokens.Transferred, MultiTokens.Burned) can be read via the flow described in Working with Events.
For collection-level actions (creating, mutating, freezing the whole collection, attributes), see Collections Mutations.
createToken
Creates a single new token in a collection, minting initialSupply units to recipient. Leave cap unset for an unlimited supply.
- GraphQL
- Response
mutation CreateToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
createToken: {
recipient: "efRecipientAddress"
collectionId: 12345
tokenId: 1
initialSupply: 100
listingForbidden: false
infusion: 0
anyoneCanInfuse: false
cap: { type: SUPPLY, supply: 1000 }
behavior: {
type: HAS_ROYALTY
royalties: [
{ address: "efRoyaltyBeneficiary", percentage: 5.0 }
]
}
attributes: [
{ key: "name", value: "Legendary Sword" }
{ key: "uri", value: "https://example.com/metadata/sword.json" }
]
groups: [60]
}
}
) {
uuid
action
state
}
}
{
"data": {
"CreateTransaction": {
"uuid": "a90ded41-4262-40a2-95c0-98255b660bf1",
"action": "MultiTokens.create_token",
"state": "PENDING"
}
}
}
createTokens
Creates multiple tokens in the same collection in a single transaction. Each entry has the same fields as createToken minus the collectionId (which is set once at the top level).
- GraphQL
mutation CreateTokens {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
createTokens: {
collectionId: 12345
tokens: [
{
recipient: "efRecipientAddress"
tokenId: 1
initialSupply: 1
listingForbidden: false
infusion: 0
anyoneCanInfuse: false
}
{
recipient: "efRecipientAddress"
tokenId: 2
initialSupply: 1
listingForbidden: false
infusion: 0
anyoneCanInfuse: false
}
]
}
}
) {
uuid
action
state
}
}
mintToken
Mints additional units of an existing token.
- GraphQL
mutation MintToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mintToken: {
recipient: "efRecipientAddress"
collectionId: 12345
tokenId: 1
amount: 10
}
}
) {
uuid
action
state
}
}
mintTokens
The batched form of mintToken. All entries must belong to the same collectionId.
- GraphQL
mutation MintTokens {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mintTokens: {
collectionId: 12345
tokens: [
{ recipient: "efAlice", tokenId: 1, amount: 5 }
{ recipient: "efBob", tokenId: 2, amount: 10 }
]
}
}
) {
uuid
action
state
}
}
transferToken
Transfers a token from the signer to a recipient. The signer (set via signerAddress / signerExternalId on CreateTransaction, or the Wallet Daemon by default) must hold the tokens being transferred.
- GraphQL
mutation TransferToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
transferToken: {
recipient: "efRecipientAddress"
collectionId: 12345
tokenId: 1
amount: 1
}
}
) {
uuid
action
state
}
}
batchTransfer
Transfers multiple tokens (potentially to multiple recipients) from a single collection in one transaction. Each entry uses the field name address for the recipient — not recipient.
- GraphQL
mutation BatchTransfer {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
batchTransfer: {
collectionId: 12345
recipients: [
{ address: "efAlice", tokenId: 1, amount: 5 }
{ address: "efBob", tokenId: 2, amount: 3 }
]
}
}
) {
uuid
action
state
}
}
transferEnj
Transfers ENJ from the signer to a recipient. There is no keepAlive flag in v3.
- GraphQL
mutation TransferEnj {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
transferEnj: {
recipient: "efRecipientAddress"
amount: 1000000000000000000 # 1 ENJ = 10^18 base units
}
}
) {
uuid
action
state
}
}
For batched ENJ transfers (or for mixing ENJ transfers with other actions in a single extrinsic) use CreateBatchTransaction.
burnToken
Burns a quantity of a token, removing it from the holder's balance. Set removeTokenStorage: true if you don't intend to re-mint and want the per-token storage deposit returned (only applicable when the burn empties the token's supply).
- GraphQL
mutation BurnToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
burnToken: {
collectionId: 12345
tokenId: 1
amount: 1
removeTokenStorage: false
}
}
) {
uuid
action
state
}
}
mutateToken
Updates a token's mutable fields — behavior, listing flag, infusion permission, on-chain name, attributes.
- GraphQL
mutation MutateToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
mutateToken: {
collectionId: 12345
tokenId: 1
listingForbidden: true
anyoneCanInfuse: true
attributes: [
{ key: "description", value: "Updated description" }
]
}
}
) {
uuid
action
state
}
}
freezeToken / thawToken
Freeze or thaw an individual token. The state argument controls the freeze duration — NEVER, TEMPORARY, or PERMANENT — see Freezing / Thawing Tokens for the semantics of each.
- freezeToken
- thawToken
mutation FreezeToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
freezeToken: {
collectionId: 12345
tokenId: 1
state: TEMPORARY
}
}
) {
uuid
action
state
}
}
mutation ThawToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
thawToken: {
collectionId: 12345
tokenId: 1
state: TEMPORARY
}
}
) {
uuid
action
state
}
}
To freeze/thaw an entire collection at once, use freezeCollection / thawCollection — see Collections Mutations.
infuseToken / infuseTokens
Add ENJ as backing into a token. The single form targets one token; the batched form takes a list of { tokenId, amount } entries inside a single collectionId.
- infuseToken
- infuseTokens
mutation InfuseToken {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
infuseToken: {
collectionId: 12345
tokenId: 1
amount: 500000000000000000 # 0.5 ENJ
}
}
) {
uuid
action
state
}
}
mutation InfuseTokens {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
infuseTokens: {
collectionId: 12345
tokens: [
{ tokenId: 1, amount: 500000000000000000 }
{ tokenId: 2, amount: 1000000000000000000 }
]
}
}
) {
uuid
action
state
}
}
The signer must hold ENJ; if anyoneCanInfuse is false on the token, only the collection owner can infuse.
setTokenAttribute
Set or update a single key/value attribute on a token.
- GraphQL
mutation SetTokenAttribute {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
setTokenAttribute: {
collectionId: 12345
tokenId: 1
key: "name"
value: "Legendary Sword"
}
}
) {
uuid
action
state
}
}
batchSetTokenAttribute
Set multiple attributes on a token in one transaction.
- GraphQL
mutation BatchSetTokenAttribute {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
batchSetTokenAttribute: {
collectionId: 12345
tokenId: 1
attributes: [
{ key: "name", value: "Legendary Sword" }
{ key: "description", value: "Forged in the Brotherhood" }
{ key: "uri", value: "https://example.com/metadata/sword.json" }
]
}
}
) {
uuid
action
state
}
}
removeTokenAttribute
Remove a single attribute from a token.
- GraphQL
mutation RemoveTokenAttribute {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
removeTokenAttribute: {
collectionId: 12345
tokenId: 1
key: "name"
}
}
) {
uuid
action
state
}
}
removeAllTokenAttributes
Remove every attribute from a token in one transaction.
- GraphQL
mutation RemoveAllTokenAttributes {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
removeAllTokenAttributes: {
collectionId: 12345
tokenId: 1
}
}
) {
uuid
action
state
}
}