oc · docs
docs / documentation

@orangecheck/design


@orangecheck/design / UseSpotPriceOptions

Interface: UseSpotPriceOptions

Defined in: format/use-spot-price.ts:44

@orangecheck/design/format — Bitcoin/money display + formatting utilities.

Presentational only. Lifted from the canonical implementations across the family (oc-me-web's utils, oc-vault-web's billing) and standardized so every site formats sats, prices, addresses, and times identically. NOTE: crypto (BIP-322 signing, bech32 validation) deliberately does NOT live here — that belongs in a bitcoin/crypto library, not the design system.

Includes the useSpotPrice React hook for live BTC/USD display. The hook fetches a consumer-hosted endpoint — see use-spot-price.ts for the one-route-per-consumer contract.

Properties

PropertyTypeDescriptionDefined in
<a id="property-endpoint"></a> endpoint?stringOverride the endpoint path. Defaults to /api/price/btc-usd — the family-canonical proxy route. Useful when consuming a sibling site's endpoint cross-origin, or when self-hosting the proxy at a non-default path.format/use-spot-price.ts:49
<a id="property-intervalms"></a> intervalMs?numberOverride the refresh cadence in milliseconds. Defaults to 60_000, matching the upstream mempool.space cache TTL. Lower than ~10s is wasted bandwidth — the underlying feed doesn't refresh faster.format/use-spot-price.ts:53