UNPKG

pharos-agent-kit

Version:
34 lines 1.13 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProtocolTvlTool = getProtocolTvlTool; const tools_1 = require("langchain/tools"); const zod_1 = require("zod"); const tools_2 = require("../../tools"); function getProtocolTvlTool(_agent) { return new tools_1.DynamicStructuredTool({ name: "get_protocol_tvl", description: "Get Total Value Locked (TVL) for a specific protocol", schema: zod_1.z.object({ slug: zod_1.z.string().describe("The protocol slug identifier"), }), func: async (input) => { try { const { slug } = input; const prices = await (0, tools_2.getProtocolTvl)(slug); return { prices, status: "success", }; } catch (error) { return { status: "error", summary: { error: error.message, }, }; } }, }); } //# sourceMappingURL=get_protocol_tvl.js.map