Enjin Documentation
Search…
⌃K

Project & Player Mutations

Unlink Wallet is used to unlink a wallet from a specific project.
Project & Player*
mutation{
UnlinkWallet(address: "<address here>")
}
Expected output:
{
"data": {
"UnlinkWallet": true
}
}

Create Asset

CreateAsset is used to create assets (your token blueprints) on the blockchain.
Project*
mutation {
CreateAsset(
name: "AssetName"
totalSupply: "1"
initialReserve: "1"
supplyModel: COLLAPSING
meltValue: "1000000000000000000"
meltFeeRatio: 0
transferable: PERMANENT
transferFeeSettings: {type:PER_TRANSFER, assetId: "0", value: "0" }
nonFungible: true
wallet: "<address here>"
) {
value
id
transactionId
title
state
project{name}
}
}
Expected Output:
{
"data": {
"CreateAsset": {
"value": "1",
"id": 31179,
"transactionId": null,
"title": "AssetNamegra",
"state": "PENDING",
"project": {
"name": "V2 Testing Project"
}
}
}
}

MintAsset

MintAsset is used to mint assets with the parameters from your previously created asset template.
Project*
mutation {
MintAsset(
assetId: "assetId"
mints: { to: "<address here>", value: 1 }
wallet: "<address here>"
send: true
) {
asset {
name
id
}
transactionId
id
value
wallet {
ethAddress
}
}
}
Expected Output:
{
"data": {
"MintAsset": {
"asset": {
"name": "AssetName",
"id": "TokenId"
},
"transactionId": null,
"id": 31237,
"value": "1",
"wallet": {
"ethAddress": "<address here>"
}
}
}
}

CreatePlayer

CreatePlayer mutation allows you to create your own players for your game.
Project*
mutation {
CreatePlayer(id: "BOB") {
accessToken
}
}
Expected Output:
{
"data": {
"CreatePlayer": {
"accessToken": "accessToken"
}
}
}

InvalidateAssetMetadata

InvalidateAssetMetadata mutation allows you to invalidate metadata on EnjinX/Wallet.
Project*
mutation {
InvalidateAssetMetadata(id: "<tokenId>")
}
Expected Output:
{
"data": {
"InvalidateAssetMetadata": true
}
}
UnlinkWallet mutation is used to unlink a wallet from a specific project.
mutation {
UnlinkWallet(address: "<walletaddress>")
}
Expected output:
{
"data": {
"UnlinkWallet": true
}
}

Create Asset

CreateAsset This mutation is used to create assets on the blockchain.
mutation {
CreateAsset(
name: "Test"
totalSupply: "1"
initialReserve: "1"
supplyModel: COLLAPSING
meltValue: "1000000000000000000"
meltFeeRatio: 0
transferable: PERMANENT
transferFeeSettings: {type:PER_TRANSFER, assetId: "0", value: "0" }
nonFungible: true
wallet: "WalletAddress"
) {
value
id
transactionId
title
state
project{name}
}
}
Expected Output:
{
"data": {
"CreateAsset": {
"value": "1",
"id": 31179,
"transactionId": null,
"title": "Test",
"state": "PENDING",
"project": {
"name": "Testing Project"
}
}
}
}

MintAsset

MintAsset Use this mutation to mint assets with the parameters from your previously created asset template.
mutation {
MintAsset(
assetId: "assetId"
mints: { to: "WalletAddress", value: 1 }
wallet: "WalletAddress"
send: true
) {
asset {
name
id
}
transactionId
id
value
wallet {
ethAddress
}
}
}
Expected Output:
{
"data": {
"MintAsset": {
"asset": {
"name": "Test 2",
"id": "708000000000088e"
},
"transactionId": null,
"id": 31237,
"value": "1",
"wallet": {
"ethAddress": "WalletAddress"
}
}
}
}

AdvancedSendAsset

AdvancedSendAsset Use this mutation to send assets from one wallet to another wallet.
mutation {
AdvancedSendAsset(
transfers: {
from: "WalletAddress"
to: "WalletAddress"
assetId: "AssetId"
assetIndex: "AssetIndex"
value: "1"
}
) {
transactionId
id
state
value
asset{name id}
user{name}
}
}
Expected Output:
{
"data": {
"AdvancedSendAsset": {
"transactionId": null,
"id": 31369,
"state": "PENDING",
"value": "1",
"asset": {
"name": "New Test Asset",
"id": "788000000000089f"
},
"user": null
}
}
}

ApproveEnj

ApproveEnj use this mutation to approve a specific amount of ENJ to be spent.
mutation {
ApproveEnj(
value: "0"
wallet: "WalletAddress"
) {
type
value
state
}
}
Expected Output:
{
"data": {
"ApproveEnj": {
"type": "APPROVE",
"value": "0"
}
}
}

ApproveMaxEnj

ApproveMaxEnj use this mutation to set the spending allowance to the max value possible (infinite).
mutation {
ApproveMaxEnj(
wallet: "WalletAddress"
) {
type
value
state
}
}
Expected Output:
{
"data": {
"ApproveMaxEnj": {
"type": "APPROVE",
"value": "-1",
"state": "PENDING"
}
}
}

Message

Message Sign a message to prove wallet ownership.
mutation {
Message(
message:"This is a Test"
wallet: "0x7AEAB7C231c88611a2ad434d3A2715Ab3C91F406"
) {
type
value
state
}
}
Expected Output:
{
"data": {
"Message": {
"type": "MESSAGE",
"value": "0",
"state": "PENDING"
}
}
}

Create Trade

CreateTrade use this mutation to trade assets (FTs or NFTs) and trade assets for ENJ as well.
mutation {
CreateTrade(
askingAssets: [{ assetId: "assetId", value: 1 }],
offeringAssets: [{ assetId: "assetId", value: 1, assetIndex:"assetIndex"}],
secondParty: "walletAddress"
wallet: "walletAddress"
)
{
transactionId
id
state
value
asset{name id}
user{name}
}
}
Expected Output:
{
"data": {
"CreateTrade": {
"transactionId": null,
"id": 160502,
"state": "PENDING",
"value": "0",
"asset": null,
"user": null
}
}
}

Complete Trade

CompleteTrade use this mutation to complete the trade request initiated by the previous mutation, note that the tradeID is the transactionID from the previous request.
mutation {
CompleteTrade(
tradeId: "160502",
wallet: "walletaddressgrta"
)
{
transactionId
id
state
value
asset{name id}
user{name}
}
}
Expected Output:
{
"data": {
"CompleteTrade": {
"transactionId": null,
"id": 160503,
"state": "PENDING",
"value": "0",
"asset": null,
"user": null
}
}
}

Decrease Max Melt Fee

DecreaseMaxMeltFee use this mutation to decrease the Max Melt Fee of an asset, decreasing the MaxMeltFee with this mutation will result in not being able to increase it again.
mutation {
DecreaseMaxMeltFee(
assetId: "assetId"
maxMeltFee: "5000000000000000000",
wallet: "walletAddress")
{
transactionId
id
state
value
asset{name id}
user{name}
}
}
Expected Output:
{
"data": {
"DecreaseMaxMeltFee": {
"transactionId": null,
"id": 160508,
"state": "PENDING",
"value": "0",
"asset": {
"name": "Melt Fee Asset",
"id": "assetId"
},
"user": null
}
}
}

Decrease Max Transfer Fee

DecreaseMaxTransferFee use this mutation to decrease the Max Transfer Fee of an asset, decreasing the MaxTransferFee with this mutation will result in not being able to increase it again.
mutation {
DecreaseMaxTransferFee(
assetId: "assetId"
maxTransferFee: "5000000000000000000"
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"DecreaseMaxTransferFee": {
"transactionId": null,
"id": 160515,
"state": "PENDING",
"value": "0",
"asset": {
"name": "Transfer Fee Asset Test",
"id": "assetId"
},
"user": null
}
}
}

Melt Asset

MeltAsset use this mutation to melt an FT or NFT.
mutation {
MeltAsset(
melts:[{assetId:"assetId",value:"1"}]
wallet:"walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"MeltAsset": {
"transactionId": null,
"id": 160522,
"state": "PENDING",
"value": "1",
"asset": {
"name": "Transfer Fee Asset Test",
"id": "assetIdgra"
},
"user": null
}
}
}

Release Reserve

ReleaseReserve use the mutation to release the reserve of assets that you didn't mint yet.
mutation {
ReleaseReserve(
assetId: "assetId"
value: "3"
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"ReleaseReserve": {
"transactionId": null,
"id": 160532,
"state": "PENDING",
"value": "3",
"asset": {
"name": "new corecore",
"id": "assetId"
},
"user": null
}
}
}

Cancel Transaction

CancelTransaction use this mutation to cancel a transaction that was not approved yet. It's important to know that once a transaction has been broadcast to the blockchain, it wouldn't be possible to cancel the request.a
mutation {
CancelTransaction(id:requestId)}
Expected Output:
{
"data": {
"CancelTransaction": true
}
}

Send Enjin or JEnjin

SendEnj - This mutation can be used to send ENJ from address A to address B, the user involved in the request should be the one approving the send mutation.
mutation {
SendEnj(
to: "walletAddress"
value: "100000000000000000"
wallet: "walletAddressgra"
) {
transactionId
id
state
value
}
}
Expected Output:
{
"data": {
"SendEnj": {
"transactionId": null,
"id": 164719,
"state": "PENDING",
"value": "0.1"
}
}
}

Send Asset

SendAsset use this mutation to send FTs or NFTs.
mutation {
SendAsset(
assetId: "assetId"
assetIndex: "assetIndex"
to: "walletAddress"
value: "1"
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"SendAsset": {
"transactionId": null,
"id": 164727,
"state": "PENDING",
"value": "1",
"asset": {
"name": "NFT Test",
"id": "78c00000000004b1"
},
"user": null
}
}
}

SetApprovalForAll

SetApprovalForAll use this mutation to allow an operator complete control on all assets owned by the caller.
mutation {
SetApprovalForAll(
operator: "walletAddress"
approved: true
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"SetApprovalForAll": {
"transactionId": null,
"id": 164731,
"state": "PENDING",
"value": "0",
"asset": null,
"user": null
}
}
}

SetWhitelisted

SetWhiteListed use this mutation to set whitelisting parameters to a specific asset.
mutation {
SetWhitelisted(
assetId:"assetId"
account:"walletAddres"
whitelisted:SEND_AND_RECEIVE
on:true
wallet: "walletAddresg"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected output:
{
"data": {
"SetWhitelisted": {
"transactionId": null,
"id": 164732,
"state": "PENDING",
"value": "0",
"asset": {
"name": "NFT Test",
"id": "78c00000000004b1"
},
"user": null
}
}
}

SetUri

SetUri use this mutation to set the metadata of an asset
mutation {
SetUri(
assetId: "assetId"
uri:"your uri url here"
wallet: "your wallet address"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"SetUri": {
"transactionId": null,
"id": 98422,
"state": "PENDING",
"value": "0",
"asset": {
"name": "NFT Test",
"id": "assetId"
},
"user": null
}
}
}

SetMeltFee

SetMeltFee use this mutation to set the Melt Fee of an asset.
mutation {
SetMeltFee(
assetId: "assetId"
meltFee: 500
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected output:
{
"data": {
"SetMeltFee": {
"transactionId": null,
"id": 181704,
"state": "PENDING",
"value": "0",
"asset": {
"name": "Melt Fee NFT",
"id": "38c0000000000516"
},
"user": null
}
}
}

SetTransferFee

SetTransferFee use this mutation to set a transfer fee with an asset.
mutation {
SetTransferFee(
assetId: "assetId"
transferFee: 1000000000000000
wallet: "walletAddress"
) {
transactionId
id
state
value
asset {
name
id
}
user {
name
}
}
}
Expected Output:
{
"data": {
"SetTransferFee": {
"transactionId": null,
"id": 181705,
"state": "PENDING",
"value": "0",
"asset": {
"name": "Transfer Fee NFT",
"id": "assetId"
},
"user": null
}
}
}

SetTransferable

SetTransferable Use this mutation to change the transferable status of an asset.
mutation {
SetTransferable(