sei-agent-kit
Version:
A package for building AI agents on the SEI blockchain
24 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SeiCitrexCancelOrderTool = void 0;
const tools_1 = require("langchain/tools");
const zod_1 = require("zod");
const CitrexCancelOrderInputSchema = zod_1.z.object({
orderId: zod_1.z.string().startsWith("0x").describe("The unique order ID of the order to be cancelled"),
productId: zod_1.z.number().int().positive().describe("The product ID of the order to be cancelled"),
});
class SeiCitrexCancelOrderTool extends tools_1.StructuredTool {
constructor(seiKit) {
super();
this.seiKit = seiKit;
this.name = "citrex_cancel_order";
this.description = "Cancels a specific order on the Citrex Protocol. You need both the order ID and the product ID to cancel an order. Returns a success flag indicating whether the cancellation was successful.";
this.schema = CitrexCancelOrderInputSchema;
}
async _call(input) {
const { orderId, productId } = input;
return this.seiKit.citrexCancelOrder(orderId, productId);
}
}
exports.SeiCitrexCancelOrderTool = SeiCitrexCancelOrderTool;
//# sourceMappingURL=cancelOrder.js.map