SkateSpots/src/lib/sasquatchPro.ts
SkateSpots 6335965afc fix(pro): single-source the platform Lightning address + show it to payers
The pay-to address was duplicated (PRO_LIGHTNING_ADDRESS and
PLATFORM_LIGHTNING_ADDRESS) and hardcoded in the tour zap-split; a typo in any
copy would send money nowhere. Now one source of truth in src/lib/platform.ts,
re-exported by the fee/Pro modules.

Also surface the address in the Sasquatch Pro dialog ('Pays to ⚡ <address>') so
users can see where their sats go, in both the auto-pay and manual-QR paths.
2026-09-27 14:13:37 +07:00

43 lines
1.9 KiB
TypeScript

/**
* Sasquatch Pro — pricing tiers + shared constants.
* ─────────────────────────────────────────────────────────────────────────────
* Pro is a Lightning "supporter pass" that unlocks Sasquatch's personal
* assistant, action-drafting, priority model, and perks. Payment goes to the
* platform Lightning address via a NIP-57 zap, and access is verified two ways:
*
* 1. STRONG (preferred): a kind-9735 zap receipt from the platform's Lightning
* provider, bound to the paying user's npub — unforgeable by the user.
* 2. FALLBACK: a self-signed kind-32671 membership receipt (used only if the
* provider doesn't publish zap receipts), which references the payment so a
* future verifier can validate it retroactively.
*/
/** Platform Lightning address that receives Pro payments (same as the fee address). */
export { PLATFORM_LIGHTNING_ADDRESS as PRO_LIGHTNING_ADDRESS } from '@/lib/platform';
export interface ProTier {
id: string;
label: string;
days: number;
sats: number;
/** Approx USD at ~$60k/BTC, for display only. */
usd: string;
/** Marketing flag. */
badge?: string;
popular?: boolean;
}
/** The four supporter tiers. Kept deliberately small to avoid choice paralysis. */
export const PRO_TIERS: ProTier[] = [
{ id: '7d', label: '7 days', days: 7, sats: 2000, usd: '~$1.20', badge: 'Try it' },
{ id: '1m', label: '1 month', days: 30, sats: 5000, usd: '~$3' },
{ id: '3m', label: '3 months', days: 90, sats: 12000, usd: '~$7', badge: '20% off', popular: true },
{ id: '1y', label: '1 year', days: 365, sats: 36000, usd: '~$21', badge: 'Best value · 40% off' },
];
export function tierById(id: string): ProTier | undefined {
return PRO_TIERS.find((t) => t.id === id);
}
/** Seconds in a day. */
export const DAY_SECONDS = 24 * 60 * 60;