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.
This commit is contained in:
parent
2503a9a2a3
commit
6335965afc
5 changed files with 20 additions and 7 deletions
|
|
@ -21,7 +21,7 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
|
|||
import { useSasquatchPro } from '@/hooks/useSasquatchPro';
|
||||
import { usePurchasePro } from '@/hooks/usePurchasePro';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { PRO_TIERS, type ProTier } from '@/lib/sasquatchPro';
|
||||
import { PRO_TIERS, PRO_LIGHTNING_ADDRESS, type ProTier } from '@/lib/sasquatchPro';
|
||||
import {
|
||||
Zap,
|
||||
Check,
|
||||
|
|
@ -145,6 +145,10 @@ export function SasquatchProDialog({
|
|||
<Check className="h-4 w-4" /> I've paid
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-[11px] text-gray-400">
|
||||
Paying to{' '}
|
||||
<span className="font-mono text-gray-200">⚡ {PRO_LIGHTNING_ADDRESS}</span>
|
||||
</p>
|
||||
<p className="text-[11px] text-gray-500">
|
||||
Tap "I've paid" after your wallet confirms — this records your pass to your Nostr identity.
|
||||
</p>
|
||||
|
|
@ -178,7 +182,7 @@ export function SasquatchProDialog({
|
|||
<PayButton tier={selected} busy={busy} onPay={() => purchase.purchase(selected)} disabled={!user} />
|
||||
|
||||
<p className="text-center text-[11px] text-gray-500">
|
||||
Pays to skatespots@minibits.cash over Lightning. Bound to your npub.
|
||||
Pays to <span className="font-mono text-gray-300">⚡ {PRO_LIGHTNING_ADDRESS}</span> over Lightning. Bound to your npub.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@ import { useLocalStorage } from '@/hooks/useLocalStorage';
|
|||
import { MARKETPLACE_ITEM_KIND, SKATE_SPOT_KIND, SKATE_RELAY } from '@/lib/types';
|
||||
|
||||
|
||||
// Platform fee destination
|
||||
export const PLATFORM_LIGHTNING_ADDRESS = 'skatespots@minibits.cash';
|
||||
// Platform fee destination (single source of truth: src/lib/platform.ts)
|
||||
import { PLATFORM_LIGHTNING_ADDRESS } from '@/lib/platform';
|
||||
export { PLATFORM_LIGHTNING_ADDRESS };
|
||||
|
||||
// Platform owner pubkeys - always trusted, never pay fees
|
||||
export const PLATFORM_OWNER_PUBKEYS = [
|
||||
|
|
|
|||
|
|
@ -26,3 +26,10 @@ export function getPlatform(): string {
|
|||
return 'web';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SkateSpots platform Lightning address. Receives Sasquatch Pro passes AND
|
||||
* marketplace listing fees — the same address, deliberately. Single source of
|
||||
* truth: never re-type it elsewhere (a typo would send money nowhere).
|
||||
*/
|
||||
export const PLATFORM_LIGHTNING_ADDRESS = 'skatespots@minibits.cash';
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
* future verifier can validate it retroactively.
|
||||
*/
|
||||
|
||||
/** Platform Lightning address that receives Pro payments. */
|
||||
export const PRO_LIGHTNING_ADDRESS = 'skatespots@minibits.cash';
|
||||
/** 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;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import { useCurrentUser } from '@/hooks/useCurrentUser';
|
|||
import { useUploadFile } from '@/hooks/useUploadFile';
|
||||
import { useShops } from '@/hooks/useShops';
|
||||
import { sanitizeUrl } from '@/lib/sanitizeUrl';
|
||||
import { PLATFORM_LIGHTNING_ADDRESS } from '@/lib/platform';
|
||||
import { useToast } from '@/hooks/useToast';
|
||||
import { LoginArea } from '@/components/auth/LoginArea';
|
||||
import { Nip05Required } from '@/components/Nip05Required';
|
||||
|
|
@ -784,7 +785,7 @@ export default function CreateTourPage({ existing }: { existing?: SkateTour } =
|
|||
international: '5',
|
||||
destruction: '5',
|
||||
};
|
||||
tags.push(['zap-split', 'skatespots@minibits.cash', platformFees[tourCategory]]);
|
||||
tags.push(['zap-split', PLATFORM_LIGHTNING_ADDRESS, platformFees[tourCategory]]);
|
||||
|
||||
// NIP-31 alt tag
|
||||
const locationText = tourCategory === 'destruction' || tourCategory === 'international'
|
||||
|
|
|
|||
Loading…
Reference in a new issue