UNPKG

@coinbase/agentkit

Version:

Coinbase AgentKit core primitives

45 lines (44 loc) 1.85 kB
import { ActionProvider } from "../actionProvider"; import { AlloraAPIClientConfig } from "@alloralabs/allora-sdk"; import { z } from "zod"; import { GetAllTopicsSchema, GetInferenceByTopicIdSchema, GetPriceInferenceSchema } from "./schemas"; /** * Action provider for interacting with Allora Network */ export declare class AlloraActionProvider extends ActionProvider { private client; /** * Creates an instance of AlloraActionProvider * * @param config - Configuration for the Allora API client including API key and optional chain slug */ constructor(config?: AlloraAPIClientConfig); /** * Gets all available topics from Allora Network * * @param _ - Empty object as no parameters are required * @returns A string containing the list of topics in JSON format */ getAllTopics(_: z.infer<typeof GetAllTopicsSchema>): Promise<string>; /** * Gets inference data for a specific topic from Allora Network * * @param args - Object containing the topic ID to get inference for * @returns A string containing the inference data in JSON format */ getInferenceByTopicId(args: z.infer<typeof GetInferenceByTopicIdSchema>): Promise<string>; /** * Gets price inference for a token/timeframe pair from Allora Network * * @param args - Object containing the asset symbol and timeframe * @returns A string containing the price inference data in JSON format */ getPriceInference(args: z.infer<typeof GetPriceInferenceSchema>): Promise<string>; /** * Checks if the provider supports a given network * * @returns Always returns true as Allora service is network-agnostic */ supportsNetwork(): boolean; } export declare const alloraActionProvider: (config?: AlloraAPIClientConfig) => AlloraActionProvider;