UNPKG

sei-agent-kit

Version:

A package for building AI agents on the SEI blockchain

41 lines 1.34 kB
import { z } from "zod"; import { StructuredTool } from "langchain/tools"; const SeiMintTakaraInputSchema = z.object({ ticker: z .string() .describe("The token ticker (e.g., 'USDC', 'SEI')"), mintAmount: z .string() .describe("The amount to mint in human-readable format (e.g., '100' for 100 USDC)"), }); /** * LangChain tool for minting Takara tokens */ export class SeiMintTakaraTool extends StructuredTool { seiKit; name = "mint_takara"; description = "Mints tTokens by depositing the underlying token into the Takara Protocol. For example, deposit USDC to mint tUSDC."; schema = SeiMintTakaraInputSchema; constructor(seiKit) { super(); this.seiKit = seiKit; } async _call({ ticker, mintAmount }) { try { const result = await this.seiKit.mintTakara(ticker, mintAmount); return JSON.stringify({ status: "success", message: `Successfully minted tTokens. Transaction hash: ${result}`, txHash: result, }); } catch (error) { return JSON.stringify({ status: "error", message: error.message, code: error.code || "UNKNOWN_ERROR", }); } } } //# sourceMappingURL=mint.js.map