Skip to main content

Token Queries

The Token API provides several queries for accessing token-related information.

Token Information​

token​

Get a specific token by ID.

token(id: String!, vsCurrency: String): TokenModel

Arguments:

NameTypeDescriptionRequired
idStringToken IDYes
vsCurrencyStringCurrency to display prices in (e.g., USD)No

Returns: TokenModel or null if not found

Authentication: Optional (USER role)

Example:

query {
token(id: "bitcoin") {
id
name
symbol
logoUri
chains {
chainName
address
}
price {
price
priceChange24h
}
}
}

tokens​

Get multiple tokens with optional filtering.

tokens(ids: [String], query: String, vsCurrency: String, listType: TokenListType): [TokenModel!]!

Arguments:

NameTypeDescriptionRequired
ids[String]Filter by token IDsNo
queryStringSearch term for token name or symbolNo
vsCurrencyStringCurrency to display prices in (e.g., USD)No
listTypeTokenListTypeType of token list (e.g., WITHDRAWAL_ENABLED, DEPOSIT_ENABLED)No

Returns: Array of TokenModel

Authentication: Optional (USER role)

Example:

query {
tokens(query: "bit", listType: DEPOSIT_ENABLED) {
id
name
symbol
logoUri
price {
price
priceChange24h
}
}
}

tokenBySymbol​

Get a token by its symbol.

tokenBySymbol(symbol: String!, vsCurrency: String): TokenModel

Arguments:

NameTypeDescriptionRequired
symbolStringToken symbolYes
vsCurrencyStringCurrency to display prices in (e.g., USD)No

Returns: TokenModel or null if not found

Authentication: Optional (USER role)

Example:

query {
tokenBySymbol(symbol: "BTC") {
id
name
symbol
logoUri
price {
price
priceChange24h
}
}
}

Balance Operations​

balance​

Get the user's balance for a specific token.

balance(id: String!): BalanceResponse!

Arguments:

NameTypeDescriptionRequired
idStringToken IDYes

Returns: BalanceResponse

Authentication: Required (USER role)

Example:

query {
balance(id: "bitcoin") {
amount
amountInFiat
}
}

bonusBalance​

Get the user's bonus balance for a specific token.

bonusBalance(id: String!): BalanceResponse!

Arguments:

NameTypeDescriptionRequired
idStringToken IDYes

Returns: BalanceResponse

Authentication: Required (USER role)

Example:

query {
bonusBalance(id: "bitcoin") {
amount
amountInFiat
}
}

totalBalance​

Get the user's total balance across all tokens.

totalBalance: TotalBalanceResponse!

Arguments: None

Returns: TotalBalanceResponse

Authentication: Required (USER role)

Example:

query {
totalBalance {
totalAmountInFiat
tokens {
id
amount
amountInFiat
}
}
}

Transaction History​

allTokensActivities​

Get the user's token transaction activities with pagination and filtering.

allTokensActivities(page: Int, limit: Int, types: [String], fromDate: Date, toDate: Date, tokenIds: [String]): ActivitiesPaginationResponse!

Arguments:

NameTypeDescriptionRequired
pageIntPage numberNo
limitIntItems per pageNo
types[String]Activity types to includeNo
fromDateDateStart date for filteringNo
toDateDateEnd date for filteringNo
tokenIds[String]Token IDs to filter byNo

Returns: ActivitiesPaginationResponse

Authentication: Required (USER role)

Example:

query {
allTokensActivities(page: 1, limit: 10, types: ["DEPOSIT", "WITHDRAWAL"]) {
items {
id
type
tokenId
amount
amountInFiat
status
createdAt
}
meta {
currentPage
itemCount
itemsPerPage
totalItems
totalPages
}
}
}

bonusHistory​

Get the user's bonus history with pagination and filtering.

bonusHistory(page: Int, limit: Int, filter: BonusHistoryFilterInput): BonusHistoryPaginationResponse!

Arguments:

NameTypeDescriptionRequired
pageIntPage numberNo
limitIntItems per pageNo
filterBonusHistoryFilterInputFilter criteriaNo

Returns: BonusHistoryPaginationResponse

Authentication: Required (USER role)

Example:

query {
bonusHistory(page: 1, limit: 10) {
items {
id
type
tokenId
amount
amountInFiat
wagerRequirement
wagerCompleted
createdAt
}
meta {
currentPage
itemCount
itemsPerPage
totalItems
totalPages
}
}
}

Deposit and Withdrawal Operations​

depositAddress​

Get a deposit address for a specific token.

depositAddress(tokenId: String!, chain: String): DepositAddressResponse!

Arguments:

NameTypeDescriptionRequired
tokenIdStringToken IDYes
chainStringBlockchain networkNo

Returns: DepositAddressResponse

Authentication: Required (USER role)

Example:

query {
depositAddress(tokenId: "bitcoin", chain: "BTC") {
address
memo
chain
}
}

savedAddresses​

Get all saved withdrawal addresses for the user.

savedAddresses(chain: String): [UserSavedAddressModel!]!

Arguments:

NameTypeDescriptionRequired
chainStringFilter by blockchain chainNo

Returns: Array of UserSavedAddressModel

Authentication: Required (USER role)

Example:

query {
savedAddresses(chain: "BTC") {
id
name
address
memo
chain
}
}

remainingWagerRequirement​

Get the remaining wager requirement for a user.

remainingWagerRequirement: String

Arguments: None

Returns: String representing the remaining wager requirement amount, or null if there is no requirement

Authentication: Required (USER role)

Example:

query {
remainingWagerRequirement
}

pendingWithdrawals​

Get all pending withdrawals for the authenticated user.

pendingWithdrawals: [PendingWithdrawalModel!]!

Returns: Array of PendingWithdrawalModel objects

Authentication: Required (USER role)

Example:

query {
pendingWithdrawals {
id
tokenId
tokenName
tokenSymbol
tokenLogoUri
amount
chain
transactionCreatedAt
recipientAddress
}
}

Response Fields:

FieldTypeDescription
idStringThe unique identifier of the withdrawal transaction
tokenIdStringThe ID of the token being withdrawn
tokenNameStringThe name of the token (e.g., "Bitcoin")
tokenSymbolStringThe symbol of the token (e.g., "BTC")
tokenLogoUriStringURL to the token's logo image
amountFloatThe amount of tokens being withdrawn
chainChainNameThe blockchain network for the withdrawal (e.g., "BITCOIN", "ETHEREUM")
transactionCreatedAtDateThe timestamp when the withdrawal request was created
recipientAddressStringThe destination address for the withdrawal

Notes:

  • The results are cached for 20 seconds to improve performance.
  • Only withdrawals with status REQUESTED and source WITHDRAWAL are returned.

Token Fields​

The TokenModel has the following field resolvers:

price​

Get the current price information for a token.

price: TokenPriceResponse!

Example:

query {
token(id: "bitcoin") {
id
name
price {
usd
eur
btc
change24h
change7d
change30d
}
}
}

historicalDataByDays​

Get historical price data for a token.

historicalDataByDays(days: Int!): [TokenHistoricalDaysResponse!]!

Arguments:

NameTypeDescriptionRequired
daysIntNumber of days (1-365)Yes

Example:

query {
token(id: "bitcoin") {
id
name
historicalDataByDays(days: 30) {
date
price
}
}
}