"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const live_network_1 = __importDefault(require("@ledgerhq/live-network"));
const live_env_1 = require("@ledgerhq/live-env");
// expose a function to fetch data from the cdn (data from ledger-live-assets)
// https://cdn.live.ledger.com/
const baseAnnouncementsUrl = () => (0, live_env_1.getEnv)("ANNOUNCEMENTS_API_URL");
const announcementsVersion = () => (0, live_env_1.getEnv)("ANNOUNCEMENTS_API_VERSION");
async function fetchAnnouncements() {
    const url = `${baseAnnouncementsUrl()}/v${announcementsVersion()}/data.json?t=${Date.now()}`;
    const { data } = await (0, live_network_1.default)({
        method: "GET",
        headers: {
            Origin: "http://localhost:3000",
        },
        url,
    });
    return data;
}
const api = {
    fetchAnnouncements,
};
exports.default = api;
//# sourceMappingURL=api.js.map