Skip to main content

Overview

The Balance types define the structure for querying and representing account balances, including both aggregated assets across multiple chains and individual asset breakdowns.

BalancesResponse

The complete balance response structure containing aggregated balances and total portfolio value.

Properties

BalanceByAssetDto[]
required
Array of balance information for each aggregated asset held by the account. See BalanceByAssetDto below.
TotalBalance
required
Total portfolio balance information. See TotalBalance below.

Example


BalanceByAssetDto

Balance information for a single aggregated asset, including breakdown by chain.

Properties

string
required
The OneBalance aggregated asset identifierFormat: ob:{symbol} (e.g., ob:eth, ob:usdc, ob:dai)
string
required
Total balance of the aggregated asset across all chains, as a string (BigInt with token decimals)Example: "5000000000" represents 5000 USDC (6 decimals)
number
required
Total fiat value of the aggregated asset in USD
IndividualAssetBalance[]
required
Array of individual asset balances that compose this aggregated asset. See IndividualAssetBalance below.
string
Token symbol (e.g., "USDC", "ETH", "DAI")
number
Number of decimals for the token (e.g., 18 for ETH, 6 for USDC)

Example


IndividualAssetBalance

Balance information for a specific asset on a single blockchain.

Properties

string
required
CAIP-19 format identifier for the individual assetFormat: {namespace}:{chainId}/{assetNamespace}:{assetReference}Examples:
  • "eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" (USDC on Ethereum)
  • "eip155:137/slip44:60" (ETH on Polygon)
  • "eip155:8453/erc20:0x833589fcd6edb6e08f4c7c32d4f71b54bda02913" (USDC on Base)
string
required
The balance of the individual asset as a string (BigInt with token decimals)Example: "1500000000000000000" represents 1.5 ETH (18 decimals)
number
required
Fiat value of this specific asset balance in USD

Example


TotalBalance

Total portfolio balance information.

Properties

number
required
Total fiat value across all assets in the portfolio, denominated in USD

Example


Understanding CAIP-19 Asset Types

OneBalance uses the CAIP-19 standard for asset identification. This provides a chain-agnostic way to reference assets across different blockchains.

Format

Components

string
Blockchain ecosystem identifier (e.g., eip155 for Ethereum-compatible chains)
string
Specific chain identifier within the namespace (e.g., 1 for Ethereum Mainnet, 137 for Polygon)
string
Asset type identifier:
  • erc20: ERC-20 token
  • slip44: Native blockchain token
  • erc721: NFT (not currently used in balances)
string
Asset-specific identifier:
  • For ERC-20: Contract address (e.g., 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48)
  • For native tokens (slip44): Coin type (e.g., 60 for ETH)

Common Examples


Usage Example

Here’s a complete example of working with balance data: