nexus-sdk-swap-flows
Swap Flows
Call swapWithExactIn(input, options?)
- Use when input amount is fixed and sources are known.
- Signature:
sdk.swapWithExactIn(input, { onEvent? })
- Params (
ExactInSwapInput):from: { chainId: number; amount: bigint; tokenAddress: Hex }[]toChainId: numbertoTokenAddress: Hex
- Notes:
- Ensure
fromamounts are in smallest units. - Use chain-specific token addresses (see
TOKEN_CONTRACT_ADDRESSES).
- Ensure
- Result (
SwapResult):{ success: true; result: SuccessfulSwapResult }
Call swapWithExactOut(input, options?)
- Use when desired output amount is fixed.
- Signature:
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.
18nexus-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.
18nexus-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).
18nexus-sdk-balances-metadata-utils
Fetch balances, supported chains/tokens, intent history, and use Nexus SDK formatter utilities. Use when building token/chain selectors, showing balances, or formatting UI values.
18nexus-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.
17