Harden onion boot flow and deepen site surfaces

Add persistent onion key backup and restore, improve startup resilience, and flesh out the major site verticals with richer navigation, search coverage, and operator documentation.

Made-with: Cursor
This commit is contained in:
drjones
2026-04-07 21:35:52 -07:00
parent 52432dccfa
commit 78a071ba02
162 changed files with 21692 additions and 39 deletions

26
lib/shopFx.ts Normal file
View File

@@ -0,0 +1,26 @@
import type { ShopCurrency } from "@/lib/shopCatalog";
/**
* Rough USD notional for cart/checkout when only BTC spot is loaded from API.
* ETH/XMR are pegged off BTC for display totals (sim storefront).
*/
export function estimateUsdForCryptoAmount(
amount: number,
currency: ShopCurrency,
btcUsd: number,
): number {
if (currency === "USD") return Math.round(amount * 100) / 100;
if (!(btcUsd > 0)) return 0;
const ethUsd = btcUsd / 28;
const xmrUsd = btcUsd / 520;
switch (currency) {
case "BTC":
return Math.round(amount * btcUsd * 100) / 100;
case "ETH":
return Math.round(amount * ethUsd * 100) / 100;
case "XMR":
return Math.round(amount * xmrUsd * 100) / 100;
default:
return 0;
}
}