tensaikit
Version:
An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.
40 lines (39 loc) • 1.8 kB
TypeScript
import z from "zod";
import { ActionProvider } from "../../actionProvider";
import { EvmWalletProvider } from "../../../walletProviders";
import { Network } from "../../../network";
import { GetAllTokenPricesSchema, GetTokenPriceSchema } from "../schemas";
/**
* SushiSwapPriceActions provides methods to fetch token prices from SushiSwap.
*
* This action group offers price-related utilities using SushiSwap's pricing module,
* allowing access to both individual token prices and bulk price data for all tokens
* on a connected EVM-compatible network.
*
* Responsibilities:
* - Fetch USD prices for all tokens supported by SushiSwap on a given chain
* - Fetch USD price for a specific token using its contract address
*
*/
export declare class SushiSwapPriceActions extends ActionProvider<EvmWalletProvider> {
constructor();
/**
* Fetches USD prices for all tokens on the connected EVM chain.
*
* @param walletProvider - Instance of EVM-compatible WalletProvider
* @param _ - Unused (empty) arguments validated by schema
* @returns A JSON string of all token prices
* @throws If chainId is missing or API call fails
*/
getAllTokenPrices(walletProvider: EvmWalletProvider, _: z.infer<typeof GetAllTokenPricesSchema>): Promise<string>;
/**
* Fetches the USD price of a specific token from SushiSwap.
*
* @param walletProvider - Instance of EVM-compatible WalletProvider
* @param args - Includes `tokenAddress` of the token to fetch
* @returns A JSON string containing the token price
* @throws If chainId is missing or API call fails
*/
getTokenPrice(walletProvider: EvmWalletProvider, args: z.infer<typeof GetTokenPriceSchema>): Promise<string>;
supportsNetwork: (network: Network) => boolean;
}