skills/nexus-sdk-swap-flows/SKILL.md
Implement swapWithExactIn, swapWithExactOut, and swapAndExecute flows with Nexus SDK. Use when wiring swap operations, swap intent hooks, or swap event progress updates.
npx skillsauth add availproject/nexus-sdk nexus-sdk-swap-flowsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
sdk.swapWithExactIn(input, { onEvent? })ExactInSwapInput):
from: { chainId: number; amount: bigint; tokenAddress: Hex }[]toChainId: numbertoTokenAddress: Hexfrom amounts are in smallest units.TOKEN_CONTRACT_ADDRESSES).SwapResult):
{ success: true; result: SuccessfulSwapResult }sdk.swapWithExactOut(input, { onEvent? })ExactOutSwapInput):
toChainId: numbertoTokenAddress: HextoAmount: biginttoNativeAmount?: bigint (optional native token output)fromSources?: { chainId: number; tokenAddress: Hex }[] (optional)fromSources is omitted, SDK auto-selects sources.sdk.swapAndExecute(input, { onEvent? })SwapAndExecuteParams):
toChainId: numbertoTokenAddress: HextoAmount: bigintfromSources?: { chainId: number; tokenAddress: Hex }[]execute: SwapExecuteParamsSwapExecuteParams:
to: Hexdata?: Hexvalue?: bigintgas: bigintgasPrice?: 'low' | 'medium' | 'high'tokenApproval?: { token: Hex; amount: bigint; spender: Hex }SwapAndExecuteResult):
swapResult: SuccessfulSwapResult | null (null if swap skipped)SUPPORTED_CHAINSTOKEN_CONTRACT_ADDRESSESsdk.setOnSwapIntentHook(...) and call allow() to proceed.NEXUS_EVENTS.SWAP_STEP_COMPLETE.sdk.utils.parseUnits(value, decimals) orsdk.convertTokenReadableAmountToBigInt(value, tokenSymbol, chainId) when decimals vary by chain.development
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.
development
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.
development
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).
development
Implement bridge, bridgeAndTransfer, bridgeAndExecute, and execute flows with Nexus SDK. Use when wiring cross-chain bridge and execution operations, simulations, or max-amount checks.