"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Balance = void 0;
const ApiHandler_1 = require("../helper/ApiHandler");
const logger_1 = require("../logger/logger");
class Balance {
    constructor() {
        this.apiHandler = new ApiHandler_1.ApiHandler('https://zap.dzap.io/v1/user/balances');
    }
    async getUserBalance(chainId, account) {
        const endpoint = `?chainId=${chainId}&account=${account}&formatted=true`;
        let response;
        logger_1.logger.info(`Getting user balance for chainId ${chainId}`);
        try {
            response = await this.apiHandler.get(endpoint);
            logger_1.logger.info(response);
        }
        catch (error) {
            logger_1.logger.error(error);
            return "Unable to retrieve price";
        }
        return (response === null || response === void 0 ? void 0 : response.data) || "Unable to retrieve price";
    }
}
exports.Balance = Balance;
