Fetch Bridge Balances
Fetch token balances available for bridge operations across all supported chains in one call.
Note
SET UP THE SDK BEFORE YOU START:Install and initialize the client first — see Installation and SDK Setup.
getBalancesForBridge() function to fetch token balances that can be used in bridge operations across all supported chains in one call.
Method signature
getBalancesForBridge(): Promise<TokenBalance[]>Note
If you need the tokens that can be used for swaps instead, use
getBalancesForSwap(), which returns the same TokenBalance[] shape.Parameters
- None
Example
getBalancesForBridge() function to fetch the balances accessible by the bridge operations of a user:
// Get all balances accessible by the bridge operations of a user
const bridgeBalances = await client.getBalancesForBridge();
console.log('Bridge balances:', bridgeBalances);Return Value
getBalancesForBridge() returns Promise<TokenBalance[]> — an array of TokenBalance objects. Each TokenBalance aggregates a token's holdings across every chain it lives on, with the per-chain split in chainBalances.
export type TokenBalance = {
balance: string; // Aggregate balance across all chains (human-readable)
value: string; // Aggregate fiat value (string for precision)
chainBalances: ChainBalance[];// Per-chain breakdown
currencyId?: number; // Bridge currency identifier (present on bridge balances)
decimals: number;
logo: string;
name: string; // Display label (e.g. "USDC/USDM")
symbol: string; // Majority symbol by chain count
};
export type ChainBalance = {
balance: string; // Balance on this chain (human-readable)
value: string; // Fiat value on this chain (string for precision)
symbol: string;
chain: {
id: number;
logo: string;
name: string;
};
contractAddress: `0x${string}`;
decimals: number;
universe: Universe; // VM family as a numeric enum (0 = Ethereum/EVM)
};Note
Field renames from v1:
balanceInFiat → value, icon → logo, and breakdown → chainBalances. See the full type definitions on GitHub.How is this guide?