Skip to main content

Transfer / Accept collection ownership

What you'll need:

Collection ownership on the Enjin Blockchain grants specific permissions and control over a collection and its tokens. The collection owner is the only account authorized to make changes to the collection or any tokens within it. This includes the exclusive ability to mint new tokens or mint additional supply of existing tokens in the collection.

Transferring collection ownership is a two-step process: the current owner submits a transfer request, and the new owner accepts it.

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.

Step #1: Sending a transfer ownership request with the Enjin API

To send a transfer ownership request, use the mutateCollection discriminator action on CreateTransaction and set the owner field to the new owner's address:

mutation SendTransferOwnershipRequest {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
mutateCollection: {
collectionId: 36105
owner: "cxLU94nRz1en6gHnXnYPyTdtcZZ9dqBasexvexjArj4V1Qr8f"
}
}
) {
uuid
action
state
}
}

Once the transaction is confirmed, the new owner needs to approve the ownership transfer request for the collection ownership to actually move.

Cancelling a pending transfer

If you need to undo a pending transfer before the new owner has accepted it, submit a cancelCollectionTransfer action with the same collection id:

mutation CancelTransferOwnershipRequest {
CreateTransaction(
network: ENJIN
chain: MATRIX
transaction: {
cancelCollectionTransfer: { id: 36105 }
}
) {
uuid
action
state
}
}

Step #2: Accepting a transfer ownership request with the Enjin API

To accept a transfer ownership request, the new owner calls the acceptCollectionTransfer discriminator action with the collection's id:

mutation AcceptTransferOwnershipRequest {
CreateTransaction(
network: ENJIN # or CANARY for testnet
chain: MATRIX
transaction: {
acceptCollectionTransfer: { id: 36105 }
}
) {
uuid
action
state
}
}

Once the transaction is confirmed, the collection ownership will be transferred to the new owner. An event is emitted on FINALIZED confirming the change — see Working with Events for how to read it.