"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShowBalanceUITool = void 0;
const zod_1 = require("zod");
const ai_1 = require("ai");
const Address = zod_1.z.string().regex(/^0x[a-fA-F0-9]{40}$/);
const TokenEntry = zod_1.z.object({
    address: Address,
    name: zod_1.z.string().describe("Name of the token"),
    symbol: zod_1.z.string().describe("Symbol of the token"),
    decimals: zod_1.z.number().int().nonnegative(),
    price: zod_1.z.string(),
    logo: zod_1.z.array(zod_1.z.string().url().default("")).default([]).describe("Logo if available, else leave blank"),
    balanceInUsd: zod_1.z.string(),
    balance: zod_1.z.string(),
    type: zod_1.z.enum(["token", "position"]),
    chainId: zod_1.z.number().int().nonnegative(),
    provider: zod_1.z.string().default("DZap"),
});
const AskTokenEntry = zod_1.z.object({
    address: zod_1.z.array(Address).optional(),
    chainId: zod_1.z.number().int().nonnegative(),
    type: zod_1.z.enum(["token", "position"]),
    provider: zod_1.z.string().optional().describe("only needed if type is position")
});
const showBalanceUIToolInputSchema = zod_1.z.object({
    tokens: zod_1.z.array(TokenEntry).describe("List of tokens with metadata and balances"),
});
class ShowBalanceUITool {
    constructor() {
        this.tool = (0, ai_1.tool)({
            description: "Trigger the UI to show the user's balance. Use this tool when you want to display the balance information to the user. This tool does not fetch or calculate the balance; it simply triggers the UI to present the provided balance data.",
            inputSchema: showBalanceUIToolInputSchema,
            execute: async (_parameters) => {
                console.log(`Triggering UI to show balance`);
                return `UI triggered to show balance`;
            }
        });
    }
}
exports.ShowBalanceUITool = ShowBalanceUITool;
