sei-agent-kit
Version:
A package for building AI agents on the SEI blockchain
44 lines • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SeiMintTakaraTool = void 0;
const zod_1 = require("zod");
const tools_1 = require("langchain/tools");
const SeiMintTakaraInputSchema = zod_1.z.object({
ticker: zod_1.z
.string()
.describe("The token ticker (e.g., 'USDC', 'SEI')"),
mintAmount: zod_1.z
.string()
.describe("The amount to mint in human-readable format (e.g., '100' for 100 USDC)"),
});
/**
* LangChain tool for minting Takara tokens
*/
class SeiMintTakaraTool extends tools_1.StructuredTool {
constructor(seiKit) {
super();
this.seiKit = seiKit;
this.name = "mint_takara";
this.description = "Mints tTokens by depositing the underlying token into the Takara Protocol. For example, deposit USDC to mint tUSDC.";
this.schema = SeiMintTakaraInputSchema;
}
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",
});
}
}
}
exports.SeiMintTakaraTool = SeiMintTakaraTool;
//# sourceMappingURL=mint.js.map