Assets
The SDK provides simple methods to query balances and asset information across all chains.Get Wallet Balances
Get all balances for a wallet across all chains:Get Balances for Chain
Get balances for a specific chain:Get Address Balances
Get balances for a specific address:Get Token Info
Get detailed information about a token:Get Native Token Info
Get information about the native token (ETH, SOL, etc.):Watch Balance Changes
Listen for balance updates:Refresh Balances
Manually refresh balances:Balance Formatting
The SDK provides formatted balances for display:Error Handling
Best Practices
Performance
Performance
- SDK caches balances automatically
- Use event listeners for real-time updates
- Refresh balances only when needed
Precision
Precision
- Always use string for balance calculations
- Use formattedBalance for display only
- Use BigInt for arithmetic operations
UX
UX
- Show loading states while fetching balances
- Display USD values when available
- Update balances after transactions