Skip to main content

Tokens

GraphQL Endpoint

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

A Token is an individual asset (fungible or non-fungible) inside a collection. Tokens carry their supply, cap, attributes, metadata, behavior (currency / royalty), and any token-group memberships.

GetToken

Returns a single token by either its canonical id ("<collectionId>-<tokenId>") or by collectionId + tokenId.

query GetToken {
GetToken(
network: ENJIN
chain: MATRIX
collectionId: 7153
tokenId: 10
) {
id
tokenId
supply
isFrozen
isNonFungible
isListingForbidden
infusion
anyoneCanInfuse
cap {
type
supply
}
behavior {
__typename
beneficiaries {
accountId
percentage
}
}
attributes {
key
value
}
metadata {
name
description
}
collection {
id
}
tokenGroupTokens {
tokenGroupId
position
}
}
}

Token.behavior.__typename distinguishes currency tokens (IS_CURRENCY) from royalty-bearing tokens (HAS_ROYALTY); for plain tokens with no special behavior the whole field is null.

GetTokens

Returns a paginated list of tokens scoped to a single collectionId. Optionally filter to specific tokenIds. Pagination is offset-based — increment page until the returned list is empty.

query GetTokens {
GetTokens(
network: ENJIN
chain: MATRIX
collectionId: 7153
limit: 15
page: 1
) {
id
tokenId
supply
isNonFungible
cap {
type
supply
}
metadata {
name
}
}
}

Filtering to specific token ids

Pass tokenIds: [...] to restrict the result to a known set:

query GetTokens {
GetTokens(
network: ENJIN
chain: MATRIX
collectionId: 7153
tokenIds: [6, 10]
limit: 15
page: 1
) {
tokenId
supply
}
}