Skip to main content

Transactions

GraphQL Endpoint

https://platform.beta.enjin.io/graphql

The Enjin Platform exposes a small number of root-level mutations. Almost every on-chain action — creating a collection, minting, transferring, listing, burning, freezing, bonding to a nomination pool, managing token groups — is funnelled through the single CreateTransaction mutation, with the action selected by which field is set on the transaction input.

Every action emits one or more on-chain events when the transaction reaches FINALIZED — see Working with Events for how to read them.

CreateTransaction

Submits a single on-chain action. The transaction argument is a TransactionInput — set exactly one field on it to choose the action (createCollection, createToken, mintToken, transferToken, transferEnj, burnToken, freezeToken, createListing, and ~40 more). See Important Arguments for the per-field shapes.

The response is a Transaction whose uuid you can use to track or sign the transaction later.

mutation CreateTransaction {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
createToken: {
recipient: "efRecipientAddress"
collectionId: 12345
tokenId: 1
initialSupply: 10
listingForbidden: false
infusion: 0
anyoneCanInfuse: false
}
}
) {
uuid
action
state
extrinsicHash
}
}

Useful additional arguments:

  • idempotencyKey: String — pass the same key on a retried request to avoid creating a duplicate transaction.
  • signerAddress: String — sign with a specific account instead of the Wallet Daemon (e.g. a Managed Wallet's public key, or an external user address for client-side signing).
  • signerExternalId: String — same as signerAddress but resolved from a Managed Wallet's externalId.
  • proxyAddress: String — wrap the call in proxy.proxy so it executes on behalf of a proxied account.
  • fuelTank: String — dispatch through a fuel tank's address; the tank pays the transaction fees.

CreateBatchTransaction

The batched form of CreateTransaction. Pass a list of TransactionInput items in transactions: and the platform submits them as a single batched extrinsic.

mutation CreateBatchTransaction {
CreateBatchTransaction(
network: ENJIN
chain: MATRIX
transactions: [
{ transferToken: { recipient: "efAlice", collectionId: 12345, tokenId: 1, amount: 5 } }
{ transferToken: { recipient: "efBob", collectionId: 12345, tokenId: 1, amount: 3 } }
{ transferEnj: { recipient: "efCarol", amount: 1000000000000000000 } }
]
) {
uuid
action
state
}
}

CreateBatchTransaction accepts the same auxiliary arguments as CreateTransaction (signerAddress, signerExternalId, idempotencyKey, proxyAddress, fuelTank).

SignTransaction

Submits the signed extrinsic for a transaction that was created with an external signerAddress. Use this when you want a user's wallet (e.g. through WalletConnect) — rather than the Wallet Daemon — to sign on-chain actions.

The typical flow is:

  1. Call CreateTransaction(..., signerAddress: <user-address>). The platform returns a Transaction with uuid and encodedData (the unsigned extrinsic).
  2. The user's wallet signs encodedData, producing a signed extrinsic.
  3. Call SignTransaction(uuid:, signedExtrinsic:) to submit it. The platform broadcasts the extrinsic and returns the updated Transaction.
mutation SignTransaction {
SignTransaction(
uuid: "a90ded41-4262-40a2-95c0-98255b660bf1"
signedExtrinsic: "0x4502840016eda5..."
) {
uuid
state
extrinsicHash
}
}

RefreshMetadata

Forces the platform to re-fetch off-chain metadata for one or more tokens / collections. Useful after you update the JSON behind a token's metadata URI.

You can target either by canonical token id (ids: ["12345-1", "12345-2"]) or by collectionId plus a list of tokenIds, or by a list of metadata uris.

mutation RefreshMetadata {
RefreshMetadata(
network: ENJIN
chain: MATRIX
ids: ["12345-1", "12345-2"]
)
}

CreateManagedWallet

Creates a new platform-managed wallet, signed automatically by the Wallet Daemon. Covered in detail on the Wallets Mutations page.