UNPKG

sei-agent-kit

Version:

A package for building AI agents on the SEI blockchain

26 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SeiCitrexCalculateMarginRequirementTool = void 0; const tools_1 = require("langchain/tools"); const zod_1 = require("zod"); const CitrexCalculateMarginRequirementInputSchema = zod_1.z.object({ isBuy: zod_1.z.boolean().describe("Whether to buy (true) or sell (false)"), price: zod_1.z.number().positive().describe("The price of the asset you intend to order"), productId: zod_1.z.number().int().positive().describe("The product ID of asset"), quantity: zod_1.z.number().positive().describe("The amount of the asset you intend to order"), }); class SeiCitrexCalculateMarginRequirementTool extends tools_1.StructuredTool { constructor(seiKit) { super(); this.seiKit = seiKit; this.name = "citrex_calculate_margin_requirement"; this.description = "Calculate the required margin for a new order on the Citrex Protocol. This helps determine how much collateral is needed for a trade. Returns the required margin amount as a bigint value."; this.schema = CitrexCalculateMarginRequirementInputSchema; } async _call(input) { const { isBuy, price, productId, quantity } = input; return this.seiKit.citrexCalculateMarginRequirement(isBuy, price, productId, quantity); } } exports.SeiCitrexCalculateMarginRequirementTool = SeiCitrexCalculateMarginRequirementTool; //# sourceMappingURL=calculateMarginRequirement.js.map