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; } }