"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getAliasInfo = void 0;
const tslib_1 = require("tslib");
const axios_1 = require("axios");
const helpers_1 = require("../helpers");
const constants_1 = require("../constants");
const config_1 = require("../config");
/**
 *  Returns the ethereum channel address of the provided alias address along with its verification status
 */
const getAliasInfo = (options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
    const { alias, aliasChain, env = constants_1.default.ENV.PROD } = options || {};
    const aliasChainId = config_1.ALIAS_CHAIN_ID[aliasChain][env];
    const _alias = (0, helpers_1.getCAIPWithChainId)(alias, aliasChainId, 'Alias');
    const API_BASE_URL = (0, helpers_1.getAPIBaseUrls)(env);
    const apiEndpoint = `${API_BASE_URL}/v1/alias`;
    const requestUrl = `${apiEndpoint}/${_alias}/channel`;
    return yield axios_1.default
        .get(requestUrl)
        .then((response) => response.data)
        .catch((err) => {
        console.error(`[EPNS-SDK] - API ${requestUrl}: `, err);
    });
});
exports.getAliasInfo = getAliasInfo;
//# sourceMappingURL=getAliasInfo.js.map