UNPKG

sei-agent-kit

Version:

A package for building AI agents on the SEI blockchain

24 lines 1.46 kB
import { StructuredTool } from "langchain/tools"; import { z } from "zod"; const CitrexGetKlinesInputSchema = z.object({ productSymbol: z.string().min(1).describe("The product symbol to get data for (e.g., 'btcperp', 'ethperp')"), interval: z.string().optional().describe("The time interval for each K-line (e.g., '1m', '5m', '1h', '1d')"), limit: z.number().int().min(1).max(1000).optional().describe("The amount of K-lines to fetch (between 1 and 1000)"), startTime: z.number().optional().describe("The start time range to query in unix milliseconds"), endTime: z.number().optional().describe("The end time range to query in unix milliseconds"), }); export class SeiCitrexGetKlinesTool extends StructuredTool { seiKit; name = "citrex_get_klines"; description = "Get K-line (candlestick) chart data for a product on the Citrex Protocol. This provides historical price data for technical analysis. Returns an array of K-lines containing open, close, high, low prices, volume, timestamp, symbol, interval information, and whether the candle is closed."; schema = CitrexGetKlinesInputSchema; constructor(seiKit) { super(); this.seiKit = seiKit; } async _call(input) { const { productSymbol, ...optionalArgs } = input; return this.seiKit.citrexGetKlines(productSymbol, Object.keys(optionalArgs).length > 0 ? optionalArgs : undefined); } } //# sourceMappingURL=getKlines.js.map