Files
Artstr-Studio/src
thePR0M3TH3ANandClaude Opus 4.7 4e7ec76817 Lightning tips: pay in-app via NWC when a wallet is connected
Adam pointed out the tip flow still showed the bolt11 / QR view even
when the user had a NIP-47 wallet set up. That re-introduces the
exact wallet-handoff friction the NWC integration is meant to solve.

Changes to the existing LNURL tip flow:

  - openTipModal sets the action button to "⚡ Send tip" when
    nwc.isConnected(), and to the original "Get invoice" otherwise.
  - getTipInvoiceFlow, after fetching the bolt11, tries
    nwc.payInvoice() FIRST when a wallet is connected. On success:
    toast "Sent N sats ⚡" + close modal. On failure (preimage
    missing, wallet error, budget exhausted, etc.): falls through
    to the existing showTipInvoiceView so the user can still pay
    the bolt11 externally with the visible error inline.
  - Button label restoration uses the same dynamic source so post-
    error retry shows the correct (state-appropriate) label.

Pre-flight gates (amount validation, LNURL meta fetch, zap path
construction) are unchanged — NIP-57 zap tagging still wraps the
LNURL request so the recipient still sees a tracked kind-9735
receipt; the only difference is who pays the bolt11.

Verified via CDP: button label flips between "Get invoice" and
"⚡ Send tip" with nwc.isConnected() state.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-28 15:06:06 -04:00
..
2026-05-26 16:13:06 -04:00
2026-05-20 22:06:50 -04:00
2026-05-26 16:13:06 -04:00