Skip to main content

Collections

Please note: This is an introductory reference

For the most up-to-date information, refer to the API Reference.
🚧 The information provided in this section cannot be programmatically updated and may be subject to inconsistencies over time.

Core Endpoints
  • Testnet: http://platform.canary.enjin.io/graphql
  • Mainnet: http://platform.enjin.io/graphql

This is a detailed reference guide that explains the most commonly used operations.

CreateCollection​

The CreateCollection mutation is used to create a new on-chain collection. A collection serves as a grouping of on-chain assets, typically non-fungible tokens (NFTs), that share common properties or belong to the same set.

mutation CreateCollection {
CreateCollection{
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
idempotencyKey
}
}

ApproveCollection​

The ApproveCollection mutation is used to authorize another account (referred to as the "operator") to transfer tokens from a specific collection account. This operation is common in scenarios involving Non-Fungible Tokens (NFTs) or tokenized assets, where token management may need to be delegated without transferring ownership of the tokens.

mutation ApproveCollection {
ApproveCollection(
collectionId: "7154"
operator: "0x965bcdbb46614cbd79869e2eb568825f6c038cbdf9085edb1b164607d3738fa6"
expiration: 445100
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

UnapproveCollection​

The UnapproveCollection mutation is used to revoke previously granted permissions for a specific account (referred to as the "operator") to transfer items from a collection owned by the sender's account. This operation is essential for enhancing the security and control of digital assets, ensuring that the owner of a collection can manage who has the authority to move or transfer items from their collection.

mutation UnapproveCollection{
UnapproveCollection(
collectionId: "6305"
operator: "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

MutateCollection​

The MutateCollection mutation is utilized to modify the default settings of an existing collection. This mutation allows you to make changes to various parameters of a collection, such as adjusting royalty settings. It is particularly valuable when you need to alter how royalties are distributed for the assets within a specific collection.

mutation MutateCollection {
MutateCollection(
collectionId: "10943"
mutation: {
royalty: {
beneficiary:"0x50a1ba0a184c9aca3a2ac7d427e96a676fe988454b4b56a62dd6622e843e890d"
percentage: 50
}
}
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

Burn​

The Burn mutation is used to permanently delete a specified amount of tokens from a collection. This operation is irreversible and results in the removal of tokens from circulation. When tokens are burned, the reserved value associated with them is often returned to the issuer's account.

mutation Burn {
Burn(
collectionId: "7154"
params: {
tokenId: {integer:6533}
amount:1
keepAlive:false
}
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

DestroyCollection​

The DestroyCollection mutation is used to permanently delete an existing collection. This operation is irreversible and removes the entire collection, including all associated tokens and their reserved values.

mutation DestroyCollection{
DestroyCollection(collectionId: 10942) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

Freeze​

The Freeze mutation is used to temporarily halt token transfers on a collection, token, collection account, or token account. Freezing temporarily prevents token transfers from taking place, which also results in marketplace listings being unpurchaseable.

mutation Freeze {
Freeze(
freezeType: COLLECTION
collectionId: "10943"
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

SetCollectionAttribute​

The SetCollectionAttribute mutation allows you to assign a new attribute or update an existing attribute's value within a collection.

mutation SetCollectionAttribute {
SetCollectionAttribute(
collectionId: "4741"
key: "test"
value: "Hello"
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}

RemoveCollectionAttribute​

The RemoveCollectionAttribute mutation is designed to remove a specific attribute from an entire collection of tokens. Attributes typically represent metadata associated with the tokens, such as name, color, size, or any other descriptive information.

mutation RemoveCollectionAttribute {
RemoveCollectionAttribute(
collectionId: "4741"
key: "name"
) {
id
transactionId
transactionHash
method
state
encodedData
wallet {
account {
publicKey
address
}
}
}
}