"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefiPositionsTool = void 0;
exports.listAllProviders = listAllProviders;
const zod_1 = require("zod");
const ai_1 = require("ai");
const defipostion_1 = require("../defipostion");
function listAllProviders() {
    const defiPositionTool = new defipostion_1.DefiPositionTool();
    const positions = defiPositionTool.getAllProviders();
    if (positions) {
        return positions;
    }
    return ["uniswap"];
}
const defiPositionsToolInputSchema = zod_1.z.object({
    address: zod_1.z.string().describe("The wallet address to get the defi positions for"),
    chain: zod_1.z.number().describe("The chain to get the defi positions for"),
    provider: zod_1.z.enum(listAllProviders()).describe("The provider to use to get the defi positions"),
});
class DefiPositionsTool {
    constructor() {
        this.defiPositionTool = new defipostion_1.DefiPositionTool();
        this.tool = (0, ai_1.tool)({
            description: "Get the defi positions of an address given chain and provider",
            inputSchema: defiPositionsToolInputSchema,
            execute: async (parameters) => {
                const defiPositions = await this.defiPositionTool.getDefiPositions(parameters.address, parameters.provider, parameters.chain);
                return {
                    content: [{ type: "text", text: JSON.stringify(defiPositions) }],
                };
            },
        });
    }
}
exports.DefiPositionsTool = DefiPositionsTool;
