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:
Name | Type | Description | Required |
---|---|---|---|
id | String | Token ID | Yes |
vsCurrency | String | Currency 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:
Name | Type | Description | Required |
---|---|---|---|
ids | [String] | Filter by token IDs | No |
query | String | Search term for token name or symbol | No |
vsCurrency | String | Currency to display prices in (e.g., USD) | No |
listType | TokenListType | Type 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:
Name | Type | Description | Required |
---|---|---|---|
symbol | String | Token symbol | Yes |
vsCurrency | String | Currency 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:
Name | Type | Description | Required |
---|---|---|---|
id | String | Token ID | Yes |
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:
Name | Type | Description | Required |
---|---|---|---|
id | String | Token ID | Yes |
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:
Name | Type | Description | Required |
---|---|---|---|
page | Int | Page number | No |
limit | Int | Items per page | No |
types | [String] | Activity types to include | No |
fromDate | Date | Start date for filtering | No |
toDate | Date | End date for filtering | No |
tokenIds | [String] | Token IDs to filter by | No |
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:
Name | Type | Description | Required |
---|---|---|---|
page | Int | Page number | No |
limit | Int | Items per page | No |
filter | BonusHistoryFilterInput | Filter criteria | No |
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:
Name | Type | Description | Required |
---|---|---|---|
tokenId | String | Token ID | Yes |
chain | String | Blockchain network | No |
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:
Name | Type | Description | Required |
---|---|---|---|
chain | String | Filter by blockchain chain | No |
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:
Field | Type | Description |
---|---|---|
id | String | The unique identifier of the withdrawal transaction |
tokenId | String | The ID of the token being withdrawn |
tokenName | String | The name of the token (e.g., "Bitcoin") |
tokenSymbol | String | The symbol of the token (e.g., "BTC") |
tokenLogoUri | String | URL to the token's logo image |
amount | Float | The amount of tokens being withdrawn |
chain | ChainName | The blockchain network for the withdrawal (e.g., "BITCOIN", "ETHEREUM") |
transactionCreatedAt | Date | The timestamp when the withdrawal request was created |
recipientAddress | String | The destination address for the withdrawal |
Notes:
- The results are cached for 20 seconds to improve performance.
- Only withdrawals with status
REQUESTED
and sourceWITHDRAWAL
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:
Name | Type | Description | Required |
---|---|---|---|
days | Int | Number of days (1-365) | Yes |
Example:
query {
token(id: "bitcoin") {
id
name
historicalDataByDays(days: 30) {
date
price
}
}
}