"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Price = void 0;
const dzapClient_1 = __importDefault(require("../config/dzapClient"));
class Price {
    async getCryptoPrices(tokenAddresses, chainId) {
        try {
            if (tokenAddresses.includes(",")) {
                const addresses = tokenAddresses.split(",").map(addr => addr.trim());
                const result = await dzapClient_1.default.getTokenPrices(addresses, chainId);
                console.log("result", result);
                return result;
            }
            const result = await dzapClient_1.default.getTokenPrices([tokenAddresses], chainId);
            console.log("result", result);
            return result;
        }
        catch (error) {
            return { error: "Unable to retrieve price" };
        }
    }
}
exports.Price = Price;
