Balance Types
Types for representing and validating token balances.Balance
Basic token balance information.Properties
| Property | Type | Required | Description |
|---|---|---|---|
token | Token | Yes | Token metadata (address, symbol, decimals, etc.) |
balance | string | Yes | Raw balance in smallest unit (e.g., wei for ETH, 6 decimals for USDC) |
formatted | string | Yes | Human-readable balance with decimal formatting |
balanceUsd | number | No | USD value of the balance (if price data available) |
Example
BalanceParams
Parameters for fetching a single token balance.Properties
| Property | Type | Description |
|---|---|---|
address | string | Wallet address to query (must be valid Ethereum address) |
chainId | number | Chain ID to query (e.g., 1 for Ethereum, 999 for HyperEVM) |
tokenAddress | string | Token contract address. Use NATIVE_TOKEN_ADDRESS for native gas tokens. |
Example
MultiBalanceParams
Parameters for fetching balances across multiple chains.Properties
| Property | Type | Required | Description |
|---|---|---|---|
address | string | Yes | Wallet address to query |
chainIds | number[] | Yes | Array of chain IDs to query |
tokenAddresses | Record<number, string[]> | No | Map of chain ID to token addresses. If not provided, fetches all bridgeable tokens. |
Example
BalanceWithMetadata
Extended balance with additional utility properties.Properties
Inherits all properties fromBalance, plus:
| Property | Type | Description |
|---|---|---|
hasBalance | boolean | true if balance is greater than zero |
Example
BalancesResponse
Response for multi-chain balance queries.Properties
| Property | Type | Description |
|---|---|---|
balances | Record<number, BalanceWithMetadata[]> | Balances grouped by chain ID |
totalUsd | number | Total USD value of all balances |
isStale | boolean | true if any data came from stale cache |
cachedAt | number | null | Earliest cache timestamp, or null if all fresh |
Example
SingleBalanceResponse
Response for single balance queries with cache metadata.Example
BalanceValidation
Result of balance validation against a quote.Example
BalanceWarning
Warning details when balance validation fails.Warning Types
| Type | Description |
|---|---|
'INSUFFICIENT_BALANCE' | Not enough of the token being bridged |
'INSUFFICIENT_GAS' | Not enough native token for gas fees |
