"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TokenAddressTool = void 0;
const zod_1 = require("zod");
const ai_1 = require("ai");
const tokenaddress_1 = require("../tokenaddress");
const tokenAddressToolInputSchema = zod_1.z.object({
    symbol: zod_1.z.string(),
    chainId: zod_1.z.number(),
});
class TokenAddressTool {
    constructor() {
        this.tokenAddress = new tokenaddress_1.TokenToAddress();
        this.tool = (0, ai_1.tool)({
            description: "Get the address and decimal of a token",
            inputSchema: tokenAddressToolInputSchema,
            execute: async (parameters) => {
                const address = this.tokenAddress.tokenToAddress(parameters.symbol, parameters.chainId);
                const decimals = this.tokenAddress.tokenToDecimals(parameters.symbol, parameters.chainId);
                const symbol = parameters.symbol;
                const chainId = parameters.chainId;
                return JSON.stringify({ symbol, chainId, address, decimals });
            },
        });
    }
}
exports.TokenAddressTool = TokenAddressTool;
