From 6713f8d4e55db8d5344684b08b062cc9129ef6b0 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 30 Jul 2026 08:43:47 -0700 Subject: Add NIP-57 Lightning zaps (npub / lightning address / lnurl) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Send a Lightning zap to a nostr npub, a lightning address (name@domain), or an lnurl. New src/lnurl.js does the resolution half — target → LNURL-pay params → signed kind-9734 zap request → callback → bolt11 — and the new zaps feature (src/features/zaps.js) drives the amount/comment UI, then hands the invoice to the existing Boltz submarine-swap flow via a new swaps.startLnPay hook, so there's one tested pay/review/confirm/success path. Routing: a bolt11 is still caught by swaps; an npub still prefers an instant free Ark zap when Ark can serve it, and only falls through to a Lightning zap otherwise — ark's "no Ark address" screen also offers an explicit "Zap over Lightning" fallback (gated on the zaps feature's canLnZap). A real zap receipt is attributed only when the server advertises allowsNostr and we know the recipient's pubkey; otherwise it degrades to a plain LNURL-pay. Nostr seam gains nostrSign (finalize without publishing), nostrProfile (kind-0 with lud16/lud06), and nostrRelays. Lightning addresses are debounced in matchSendText since their regex matches mid-typing. Verified: unit tests for parse/encode/zap-request; a live resolve→signed 9734→payable mainnet bolt11 against coinos; and an in-browser DOM smoke (zap form + LNURL params over CORS + allowsNostr hint + handoff). Co-Authored-By: Claude Opus 4.8 --- src/i18n.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/i18n.js') diff --git a/src/i18n.js b/src/i18n.js index e439936..04e7e06 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -457,6 +457,17 @@ const STR = { lnPayConfirm: 'Pay', lnPaySentTitle: 'Lightning payment sent', lnPaySentBody: 'The swap provider pays the invoice once the on-chain lockup confirms.', + lnZapTitle: 'Zap over Lightning', + lnZapReviewTitle: 'Zap over Lightning', + lnZapFallback: 'Zap over Lightning instead', + lnZapResolving: 'Finding their Lightning address…', + lnZapRequesting: 'Requesting a Lightning invoice…', + lnZapNoAddress: 'This nostr user hasn’t published a Lightning address.', + lnZapRange: 'Enter {min}–{max} sats', + lnZapHintNostr: 'Sent over Lightning, with a public zap receipt on nostr.', + lnZapHintPlain: 'Sent over Lightning (this address doesn’t support zap receipts).', + lnZapSentBody: 'Your zap is on its way — the swap provider pays it once the on-chain lockup confirms.', + lnZapFailed: 'Couldn’t complete the zap.', spScan: 'Scan for silent payments', spScanning: 'Scanning…', spWatching: 'Watching for payments', -- cgit v1.2.3