sei-agent-kit
Version:
A package for building AI agents on the SEI blockchain
27 lines • 1.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SeiCitrexGetKlinesTool = void 0;
const tools_1 = require("langchain/tools");
const zod_1 = require("zod");
const CitrexGetKlinesInputSchema = zod_1.z.object({
productSymbol: zod_1.z.string().min(1).describe("The product symbol to get data for (e.g., 'btcperp', 'ethperp')"),
interval: zod_1.z.string().optional().describe("The time interval for each K-line (e.g., '1m', '5m', '1h', '1d')"),
limit: zod_1.z.number().int().min(1).max(1000).optional().describe("The amount of K-lines to fetch (between 1 and 1000)"),
startTime: zod_1.z.number().optional().describe("The start time range to query in unix milliseconds"),
endTime: zod_1.z.number().optional().describe("The end time range to query in unix milliseconds"),
});
class SeiCitrexGetKlinesTool extends tools_1.StructuredTool {
constructor(seiKit) {
super();
this.seiKit = seiKit;
this.name = "citrex_get_klines";
this.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.";
this.schema = CitrexGetKlinesInputSchema;
}
async _call(input) {
const { productSymbol, ...optionalArgs } = input;
return this.seiKit.citrexGetKlines(productSymbol, Object.keys(optionalArgs).length > 0 ? optionalArgs : undefined);
}
}
exports.SeiCitrexGetKlinesTool = SeiCitrexGetKlinesTool;
//# sourceMappingURL=getKlines.js.map