UNPKG

tensaikit

Version:

An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.

51 lines (50 loc) 2.61 kB
import z from "zod"; import { ActionProvider } from "../../actionProvider"; import { EvmWalletProvider } from "../../../walletProviders"; import { Network } from "../../../network"; import { GetTokenDetailsSchema, QueryGetSushiAllTokens } from "../schemas"; /** * SushiSwapTokenActions provides utilities for retrieving token metadata and listings from SushiSwap. * * This action group focuses on token-related operations, including: * - Fetching metadata (name, symbol, decimals) for a specific token via SushiSwap’s pricing API * - Querying a paginated list of all tokens available on SushiSwap using The Graph’s subgraph * * Responsibilities: * - Use on-chain or indexed APIs to fetch metadata for ERC-20 tokens on supported EVM chains * - Support pagination and API key–secured access to the SushiSwap subgraph * * Registered under the action provider key: `sushiSwap.token` * * Note: * - Requires a valid `subGraphApiKey` for subgraph queries. * - Only EVM-compatible chains are supported. */ export declare class SushiSwapTokenActions extends ActionProvider<EvmWalletProvider> { private readonly subGraphApiKey; constructor(subGraphApiKey: string); /** * Fetches metadata for a token (e.g., decimals, symbol, name) from SushiSwap's public API. * * @param walletProvider - Instance of EVM-compatible WalletProvider * @param args - Includes `tokenAddress` of the token to fetch metadata for * @returns A JSON string containing token metadata * @throws If the API call fails or the token is unsupported */ getTokenDetails(walletProvider: EvmWalletProvider, args: z.infer<typeof GetTokenDetailsSchema>): Promise<string>; /** * Fetches a paginated list of all tokens available on SushiSwap from the subgraph for the connected EVM chain. * * @param walletProvider - Instance of EVM-compatible WalletProvider. * @param args - Object containing `skip` and `first` for pagination control. * @returns A JSON string representing the array of tokens including id, name, symbol, poolCount, and volume. * @throws If the connected network's chainId is missing or the subgraph query fails. * * Notes: * - Uses The Graph's SushiSwap subgraph endpoint. * - Requires a valid `subGraphApiKey` to authenticate the query request. * - Supports pagination using `skip` (default: 0) and `first` (default: 50). */ getAllSushiTokens(walletProvider: EvmWalletProvider, args: z.infer<typeof QueryGetSushiAllTokens>): Promise<string>; supportsNetwork: (network: Network) => boolean; }