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-sdk
nexus-sdk-setup
Set up and initialize Nexus SDK in any JS/TS frontend project. Use when configuring wallet provider, SDK instance lifecycle, network selection, or adding a minimal wallet connection path.
17nexus-sdk-bridge-flows
Implement bridge, bridgeAndTransfer, bridgeAndExecute, and execute flows with Nexus SDK. Use when wiring cross-chain bridge and execution operations, simulations, or max-amount checks.
17nexus-sdk-hooks-events
Configure Nexus SDK intent/allowance/swap intent hooks and event streaming. Use when integrating approval flows, intent previews, or real-time progress events (NEXUS_EVENTS).
17nexus-sdk-integration
End-to-end integration guidance for Avail Nexus SDK in any JS/TS frontend project (React/Next/Vite/etc). Use when asked to integrate, initialize, or wire Nexus SDK flows (bridge, transfer, execute, swap), hooks, events, balances, supported chains/tokens, or formatter utilities.
16nexus-sdk-swap-flows
Implement swapWithExactIn, swapWithExactOut, and swapAndExecute flows with Nexus SDK. Use when wiring swap operations, swap intent hooks, or swap event progress updates.
16