Skip to main content

Balance and position tools

BalanceTool

Input:
  • chainId: number
  • account: string
  • for_user: boolean
await sdk.executeTool("BalanceTool", { chainId: 1, account: "0xabc...", for_user: true });

DefiPositionsTool

Input:
  • address: string
  • chain: number
  • provider: string
await sdk.executeTool("DefiPositionsTool", {
  address: "0xabc...",
  chain: 42161,
  provider: "aave",
});

PoolTool

Input:
  • chainId: number
  • provider: string
await sdk.executeTool("PoolTool", { chainId: 8453, provider: "uniswap" });

Route planning and execution tools

ZapCallDataGeneratorTool

Generates and caches route/calldata in session scope. Required fields include:
  • source and destination token/chain/decimals
  • account, recipient
  • amount, decimalAmount
  • sessionId
  • type: "swap" | "bridge" | "zap"
await sdk.executeTool("ZapCallDataGeneratorTool", {
  srcToken: "0xA0b86991c6218b36c1d19d4a2e9eb0ce3606eB48",
  srcChainId: 1,
  srcDecimals: 6,
  destToken: "0xC02aaa39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  destChainId: 1,
  destDecimals: 18,
  account: "0xabc...",
  recipient: "0xabc...",
  amount: "1000000",
  decimalAmount: "1",
  sessionId: "session-1",
  type: "swap",
});

PerformZapTool (interactive)

Input:
  • sessionId: string
Behavior:
  1. Loads cached route
  2. Requests confirmation (when enabled)
  3. Handles approvals and sends transaction
  4. Waits for receipt and clears cached route
await sdk.executeTool("PerformZapTool", { sessionId: "session-1" });

Chain-change helpers

RequestChainChangeTool

Queues chain-switch request context:
  • chainID: number
  • sessionId: string

ChangeChainTool (interactive)

Waits for user confirmation (up to 120 seconds), then resolves via confirmChainChange or POST /zap/chain/:sessionId.

ShowBalanceUITool

UI trigger tool that expects strict tokens: TokenEntry[] payload.
Last modified on May 26, 2026