The series id.
The stored PriceHistoryEntry, or undefined when absent.
const series = await getPriceSeries("3f9c2a…");
const last = series?.points.at(-1)?.usd; // most recent USD price
export async function getPriceSeries(id: string): Promise<PriceHistoryEntry | undefined> {
try {
const db = await getDB();
return await db.get(IDB_STORE.PRICE_HISTORY, id);
} catch (error) {
logger.error('Failed to get price series from IndexedDB', { error });
return undefined;
}
}
Read a single price-history series by its id. The id is the product's identity key for the base row, or
${productKey}::${variantKey}for a variant row. Returnsundefinedwhen no series exists yet (the first time a product/variant is seen) or when the read fails.