Commit Graph
22 Commits
Author SHA1 Message Date
thePR0M3TH3ANandClaude Fable 5 5a7481e30e zaps: reliable coinos platform address + fix NWC double-pay on timeout
Two things:

1. Platform fee address → [email protected] (verified live:
   allowsNostr + nostrPubkey, 1-sat min, working callback). coinos is
   Nostr-native and PUBLISHES zap receipts, unlike strike.me whose flaky LNURL
   + never-published receipts caused the platform-share pay timeouts and the
   missing zap tallies. The 30% platform fee is unchanged — only the rail.

2. Double-pay guard (bug found while diagnosing): on a `pay_invoice` timeout,
   nwcClient's nip44->nip04 encryption-fallback resent the request — but a
   timeout is ambiguous (the wallet may already be paying), so the resend
   could DOUBLE-SPEND. shouldRetryWithFallback now refuses to auto-resend any
   spending method (pay_invoice/pay_keysend/multi_pay_*) on timeout; read-only
   methods and explicit unsupported-encryption rejections (wallet never paid)
   stay retryable. The manual "Send again" retry is the safe path for a real
   payment timeout.

Tests: tests/nwc-pay-timeout-no-double-spend.test.mjs (4). Lint + build green.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-04 23:54:16 -04:00
thePR0M3TH3ANandClaude Opus 4.8 c5589a1514 zap: fix NWC connection, dialog UX, and receipt reporting/discovery
- NWC connection was fully broken: parseNwcUri passed a hex secret to
  nostr-tools getPublicKey (needs Uint8Array) and threw. Convert hex->bytes.
- A successful zap was shown as a red error when the kind-9735 receipt
  couldn't be validated. The NWC preimage already proves payment, so a
  paid-but-unconfirmed share is now a success-with-note, not a failure.
- Receipt discovery: query by the reliably-indexed #e/#a/#p tags instead of
  #bolt11 (which most relays don't index), and poll a few times since the
  receipt is published shortly after payment.
- In-flight "Sending..." status no longer mis-toned as a warning; success
  path fully resets the form; an in-flight-open click no longer cancels the
  open (which made the popover need many clicks); fee fallback verified
  no-bypass.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-06-23 14:53:38 -04:00
google-labs-jules[bot]andPR0M3TH3AN a084bb59de refactor: deduplicate HEX64_REGEX to js/utils/hex.js
Moves the repeatedly defined HEX64_REGEX constant to a shared utility
module to improve maintainability and consistency. Updates all consumers
to import from the new location.

Signed-off-by: Jules <[email protected]>

Co-authored-by: PR0M3TH3AN <[email protected]>
2026-02-07 21:52:51 +00:00
google-labs-jules[bot] 4a0b81ad98 chore(ai): remove dead code (unused exports & deps) 2026-01-24 20:28:53 +00:00
google-labs-jules[bot] 270d55cc7c Fix "NostrTools is required" error during zap signing
This patch updates `js/payments/zapSplit.js` and `js/payments/nwcClient.js` to replace legacy manual event signing (which relied on `nostr-tools` v1 methods `getEventHash` and `signEvent` that are missing in v2) with the centralized `signEventWithPrivateKey` helper from `js/nostr/publishHelpers.js`. This ensures compatibility with the installed `nostr-tools` version and resolves the error preventing zaps.
2026-01-07 13:39:52 +00:00
thePR0M3TH3AN 98ea36bd93 Add wallet budget enforcement for NWC payments 2025-10-29 06:52:30 -04:00
thePR0M3TH3AN 37bec3c5e2 Retry NWC requests with nip04 after nip44 timeouts 2025-10-27 21:34:57 -04:00
thePR0M3TH3AN 011d69482a Prefer nip04 encryption fallback for implicit wallets 2025-10-27 20:35:14 -04:00
thePR0M3TH3AN 18ffde2147 Include LNURL hint in NWC zap payments 2025-10-27 20:14:28 -04:00
thePR0M3TH3AN 7ae07b1369 refactor: migrate console usage to shared loggers 2025-10-15 14:37:25 -04:00
thePR0M3TH3AN d705cf176b Revert "Refactor logging to centralized logger" 2025-10-15 11:14:10 -04:00
thePR0M3TH3AN 37ba57aa37 Refactor logging to centralized logger 2025-10-15 11:11:14 -04:00
thePR0M3TH3AN f80ebef5c3 Defer nostr-tools access until bootstrap 2025-10-06 10:17:11 -04:00
thePR0M3TH3AN aa4e86758a Fix NWC encryption fallback handling 2025-10-05 20:49:56 -04:00
thePR0M3TH3AN e76107c8b2 Handle multi-relay NWC URIs 2025-10-05 19:49:22 -04:00
thePR0M3TH3AN 1e42b2af56 Convert NWC payment amounts to msats 2025-10-05 19:33:58 -04:00
thePR0M3TH3AN 1f0fb6ac87 Support NIP-47 encryption negotiation 2025-10-05 19:22:24 -04:00
thePR0M3TH3AN f2c7520a40 Handle NWC responses without e-tag IDs 2025-10-05 19:08:43 -04:00
thePR0M3TH3AN ad4f56a1d4 Ensure NostrTools nip04 helper persists 2025-10-05 08:44:23 -04:00
thePR0M3TH3AN 80438555f5 Improve zap failure diagnostics 2025-10-05 02:34:52 -04:00
thePR0M3TH3AN d843a6aa51 Fix NostrTools detection for zaps 2025-10-04 23:48:23 -04:00
thePR0M3TH3AN bbad8f7d48 Add Lightning zap split utilities 2025-10-04 22:16:13 -04:00