tensaikit
Version:
An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.
39 lines (38 loc) • 1.81 kB
TypeScript
import { z } from "zod";
import { EvmWalletProvider, ViemWalletProvider } from "../../walletProviders";
import { ActionProvider } from "../actionProvider";
import { Network } from "../../network";
import { GetExecuteSwapSchema } from "./schemas";
/**
* SushiSwapExecuteOnlyActionProvider is a minimal action provider for SushiSwap,
* exposing only swap execution functionality using Viem-compatible wallet providers.
*
* Registered under action provider key: `sushi_swap.execute_only`
*/
export declare class SushiSwapExecuteOnlyActionProvider extends ActionProvider<EvmWalletProvider> {
/**
* Constructs the minimal SushiSwap provider and registers only the execute actions.
*/
constructor();
/**
* Executes a token swap on SushiSwap using Viem, with automatic approval if necessary.
*
* @param walletProvider - An instance of Viem-compatible WalletProvider
* @param args - Object containing tokenIn, tokenOut, amount, and optional maxSlippage
* @returns A formatted string containing the transaction hash and simulation result
* @throws If approval, quote generation, simulation, or transaction sending fails
*/
executeSwap(walletProvider: ViemWalletProvider, args: z.infer<typeof GetExecuteSwapSchema>): Promise<any>;
/**
* Checks if the SushiSwap action provider supports the given network.
*
* @param network - The network to validate.
* @returns `true` if the network uses the EVM protocol family, else `false`.
*/
supportsNetwork: (network: Network) => boolean;
}
/**
* Creates a new instance of SushiSwapExecuteOnlyActionProvider.
* @returns A minimal action provider focused solely on swap execution.
*/
export declare const sushiSwapExecuteOnlyActionProvider: () => SushiSwapExecuteOnlyActionProvider;