"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getChatInfo = void 0;
const tslib_1 = require("tslib");
const helpers_1 = require("../helpers");
const constants_1 = require("../constants");
const axiosUtil_1 = require("../utils/axiosUtil");
/**
 * Fetches the chat status for a given chat ID and address.
 */
const getChatInfo = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
    const { chatId, address, env = constants_1.default.ENV.PROD } = options;
    try {
        if (!chatId || !address) {
            throw new Error('chatId and address cannot be null or empty');
        }
        const API_BASE_URL = (0, helpers_1.getAPIBaseUrls)(env);
        const requestUrl = `${API_BASE_URL}/v1/chat/${chatId}/address/${address}`;
        const response = yield (0, axiosUtil_1.axiosGet)(requestUrl);
        return response.data;
    }
    catch (err) {
        console.error(`[Push SDK] - API Error in ${exports.getChatInfo.name}: `, err);
        throw new Error(`[Push SDK] - API Error in ${exports.getChatInfo.name}: ${err}`);
    }
});
exports.getChatInfo = getChatInfo;
//# sourceMappingURL=getChatInfo.js.map