nexus-sdk-balances-metadata-utils
Balances, Metadata, and Utilities
Fetch bridge balances
- Call
sdk.getBalancesForBridge()to list assets usable in bridge flows. - Typical fields on each asset:
symbol,decimals,balance,balanceInFiat,breakdown[]
- Use for:
- token selectors
- max amount validation
- per-chain balance breakdown
Fetch swap balances
- Call
sdk.getBalancesForSwap(onlyNativesAndStables?)to list assets usable in swap flows. - Use for:
- swap token selectors
- swap input validation
- source selection for exact-in swaps
Fetch supported chains/tokens
- Call
sdk.utils.getSupportedChains(env?)for supported chains + tokens. - Call
sdk.utils.getSwapSupportedChainsAndTokens()for swap-supported chains/tokens. - Call
sdk.getSwapSupportedChains()for chains where swaps are supported.
Fetch intent history
- Call
sdk.getMyIntents(page = 1)to retrieveRequestForFunds[]. - Use history to show status updates or allow retries.
Use constants for UI
- Use
SUPPORTED_CHAINSfor chain IDs. - Use
CHAIN_METADATAfor names, logos, explorers, native currency. - Use
TOKEN_CONTRACT_ADDRESSESfor token addresses by chain. - Use
NEXUS_EVENTSfor event name constants.
Use formatter utilities
- Call
sdk.utils.formatTokenBalance(value, { symbol, decimals }). - Call
sdk.utils.formatTokenBalanceParts(...). - Call
sdk.utils.formatUnits(value, decimals). - Call
sdk.utils.parseUnits(value, decimals). - Call
sdk.utils.truncateAddress(address, start?, end?). - Call
sdk.utils.isValidAddress(address). - Call
sdk.utils.getCoinbaseRates()for optional fiat rates. - Call
sdk.convertTokenReadableAmountToBigInt(value, tokenSymbol, chainId)when decimals vary by chain.
More from availproject/nexus-elements
nexus-elements-deposit
Integrate the Deposit element for swap-plus-execute deposit flows in React/TypeScript apps. Use when installing or debugging destination-fixed deposits, execute call builders, swap-intent confirmation UX, and `sdk.swapAndExecute` progress from quote to completion.
26nexus-elements-overview
End-to-end integration guide for Nexus Elements in any TypeScript/React codebase. Use when setting up Nexus Elements from scratch, choosing which widget to install, wiring NexusProvider + wallet initialization, or validating bridge/transfer/swap/deposit/history behavior in production-like flows.
24nexus-elements-common
Use shared Nexus Elements hooks, transaction-step helpers, and constants to build custom Nexus UX. Use when extending widgets or implementing custom bridge/transfer/swap/deposit flows that need debouncing, polling, step orchestration, or Nexus error normalization.
23nexus-elements-nexus-provider
Install and configure NexusProvider for Nexus Elements with full SDK lifecycle wiring. Use when setting up or debugging SDK initialization, wallet/provider connection, hook attachment (intent/allowance/swapIntent), balance preloads, exchange-rate support, and provider context consumption in React/TypeScript apps.
23nexus-elements-bridge-deposit
Integrate the Bridge Deposit element for bridge-plus-execute deposit flows in React/TypeScript apps. Use when installing or debugging source-chain constrained deposits, bridge+execute simulation, intent/allowance approvals, and `sdk.bridgeAndExecute` transaction execution.
22nexus-elements-fast-bridge
Integrate the FastBridge element for intent-based cross-chain bridge UX in React/TypeScript apps. Use when installing or debugging self-bridge flows, source-chain selection, allowance gating, step progress events, and `sdk.bridge` execution end-to-end.
21