UNPKG

@coinbase/agentkit

Version:

Coinbase AgentKit core primitives

55 lines (54 loc) 2.34 kB
import { z } from "zod"; import { ActionProvider } from "../actionProvider"; import { GetTokenPricesSchema, GetProtocolSchema, SearchProtocolsSchema } from "./schemas"; /** * DefiLlamaActionProvider is an action provider for DefiLlama API interactions. * Provides functionality to fetch token prices, protocol information, and search protocols. */ export declare class DefiLlamaActionProvider extends ActionProvider { /** * Constructor for the DefiLlamaActionProvider class. */ constructor(); /** * Searches for protocols on DefiLlama. * Note: This performs a case-insensitive search on protocol names. * Returns all protocols whose names contain the search query. * * @param args - The protocol search parameters * @returns A JSON string containing matching protocols or error message */ searchProtocols(args: z.infer<typeof SearchProtocolsSchema>): Promise<string>; /** * Gets detailed information about a specific protocol. * Note: Returns null if the protocol is not found. * The response includes TVL, description, category, and other metadata. * Time-series data is pruned to keep response size manageable. * * @param args - The protocol request parameters * @returns A JSON string containing time-series pruned protocol information */ getProtocol(args: z.infer<typeof GetProtocolSchema>): Promise<string>; /** * Gets current token prices from DefiLlama. * Note: Token addresses must include chain prefix (e.g., 'ethereum:0x...') * The searchWidth parameter can be used to specify a time range in minutes. * * @param args - The token price request parameters * @returns A JSON string containing token prices or error message */ getTokenPrices(args: z.infer<typeof GetTokenPricesSchema>): Promise<string>; /** * Checks if the DefiLlama action provider supports the given network. * DefiLlama is network-agnostic, so this always returns true. * * @returns True, as DefiLlama actions are supported on all networks. */ supportsNetwork(): boolean; } /** * Creates a new instance of the DefiLlama action provider. * * @returns A new DefiLlamaActionProvider instance */ export declare const defillamaActionProvider: () => DefiLlamaActionProvider;