Tokens
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.
- GraphQL
- Response
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
}
}
}
{
"data": {
"GetToken": {
"id": "7153-10",
"tokenId": "10",
"supply": "1",
"isFrozen": false,
"isNonFungible": true,
"isListingForbidden": false,
"infusion": "0",
"anyoneCanInfuse": false,
"cap": {
"type": "SUPPLY",
"supply": "1"
},
"behavior": null,
"attributes": [
{ "key": "uri", "value": "https://example.com/metadata/10.json" }
],
"metadata": {
"name": "Legendary Sword #10",
"description": null
},
"collection": { "id": "7153" },
"tokenGroupTokens": [
{ "tokenGroupId": "60", "position": 0 }
]
}
}
}
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.
- GraphQL
- Response
query GetTokens {
GetTokens(
network: ENJIN
chain: MATRIX
collectionId: 7153
limit: 15
page: 1
) {
id
tokenId
supply
isNonFungible
cap {
type
supply
}
metadata {
name
}
}
}
{
"data": {
"GetTokens": [
{
"id": "7153-6",
"tokenId": "6",
"supply": "1",
"isNonFungible": true,
"cap": { "type": "SUPPLY", "supply": "1" },
"metadata": { "name": "Legendary Sword #6" }
},
{
"id": "7153-10",
"tokenId": "10",
"supply": "1",
"isNonFungible": true,
"cap": { "type": "SUPPLY", "supply": "1" },
"metadata": { "name": "Legendary Sword #10" }
}
]
}
}
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
}
}