Skip to main content

Collections

GraphQL Endpoint

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

Collection is the parent resource for a set of related tokens. A collection carries its mint, market, and transfer policies, its on-chain attributes, and any token groups defined within it. Individual tokens within a collection are read separately via GetTokens.

GetCollection

Returns a single collection by id.

query GetCollection {
GetCollection(network: ENJIN, chain: MATRIX, id: 2967) {
id
owner {
address
}
attributes {
key
value
}
metadata {
name
description
}
mintPolicy {
forceCollapsingSupply
maxTokenCount
maxTokenSupply
}
marketPolicy {
beneficiaries {
accountId
percentage
}
}
transferPolicy {
isFrozen
}
pendingTransfer {
address
}
tokenGroups {
id
metadata {
name
}
}
}
}

pendingTransfer is non-null while a transfer is in progress — see GetPendingCollectionTransfers.

GetCollections

Returns a flat list of collections. Pass ids to fetch specific collections, or address to fetch collections owned by an address (or both to intersect).

query GetCollections {
GetCollections(
network: ENJIN
chain: MATRIX
ids: [2967, 7153]
) {
id
owner {
address
}
metadata {
name
}
mintPolicy {
forceCollapsingSupply
maxTokenCount
}
}
}

GetPendingCollectionTransfers

Returns collections that have a pending ownership transfer — the owner field on mutateCollection was set to a new address, but the recipient hasn't called acceptCollectionTransfer yet (and the current owner hasn't called cancelCollectionTransfer).

You can filter by ids (specific collections) or address (collections being transferred to this address).

query GetPendingCollectionTransfers {
GetPendingCollectionTransfers(
network: ENJIN
chain: MATRIX
address: "efRecipientWalletAddress"
) {
id
owner {
address
}
pendingTransfer {
address
}
metadata {
name
}
}
}

See the Transfer a Collection guide for the full transfer / accept / cancel flow.