import { displayed } from "./displayed"; import { livedataSource } from "./livedata"; import type { MarketSnapshot, MarketSource } from "./types"; /** Swap this line to change where the figures come from. */ const source: MarketSource = livedataSource; /** * Never throws. Nothing selected, or an unreachable upstream, returns null and * the caller renders nothing — a build must not depend on a third party being * up, and a visitor should never see a broken widget. */ export async function getMarketSnapshot(): Promise { try { return await source.fetchSnapshot(displayed); } catch (error) { console.error("[market] snapshot unavailable:", (error as Error).message); return null; } } export { instruments, type InstrumentId } from "./instruments"; export * from "./types";