import network from "@ledgerhq/live-network";
import { getEnv } from "@ledgerhq/live-env";
// expose a function to fetch data from the cdn (data from ledger-live-assets)
// https://cdn.live.ledger.com/
const baseAnnouncementsUrl = () => getEnv("ANNOUNCEMENTS_API_URL");
const announcementsVersion = () => getEnv("ANNOUNCEMENTS_API_VERSION");
async function fetchAnnouncements() {
    const url = `${baseAnnouncementsUrl()}/v${announcementsVersion()}/data.json?t=${Date.now()}`;
    const { data } = await network({
        method: "GET",
        headers: {
            Origin: "http://localhost:3000",
        },
        url,
    });
    return data;
}
const api = {
    fetchAnnouncements,
};
export default api;
//# sourceMappingURL=api.js.map