Skip to content

feat: detect and pay BOLT11 invoices inline in posts#334

Merged
barrydeen merged 1 commit into
mainfrom
feat/lightning-invoice-inline-payment
Mar 27, 2026
Merged

feat: detect and pay BOLT11 invoices inline in posts#334
barrydeen merged 1 commit into
mainfrom
feat/lightning-invoice-inline-payment

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Detects lnbc/lntb/lnbcrt invoice strings in note content and renders an inline card showing the decoded amount, optional description, and expiry badge
  • Tapping Pay Now shows a confirmation dialog, then routes through the active wallet provider (Spark or NWC)
  • The card owns a 4-state machine — spinner while pending, ✓ Paid on success, ✗ Payment Failed on failure, each auto-resetting to the button after 3 seconds so the user can retry
  • Wired through NoteActions.onPayInvoice to all feed surfaces: main feed, thread view, user profile, notifications, hashtag feeds, article feeds, and set feeds
  • All UI strings localised to 10 languages (de, es, fr, it, pt, nl, zh, ja, ko, ru)
  • Uses MaterialTheme.colorScheme.primary throughout — no hardcoded colours, adapts to every theme

Test plan

  • Post a note containing a BOLT11 invoice (lnbc...) and confirm the inline card appears with the correct amount
  • Tap Pay Now with a connected wallet — verify spinner appears, then ✓ Paid, then button resets
  • Tap Pay Now with no wallet / on an already-paid invoice — verify ✗ Payment Failed appears in error colour, then resets
  • Confirm card renders correctly in thread view, profile tab, notifications, and hashtag feed
  • Confirm expired invoices show the Expired badge and the button is disabled
  • Verify colours match the active theme (Nord, Dracula, Custom, etc.)
  • Spot-check at least one non-English locale for the payment strings

🤖 Generated with Claude Code

- Detect lnbc/lntb/lnbcrt invoice strings in note content and render an
  inline card showing the decoded amount, description, and expiry state
- "Pay Now" button routes through the active wallet provider (Spark or NWC)
- Card owns a 3-state machine: spinner while paying, ✓ Paid on success,
  ✗ Payment Failed on failure — each auto-resets after 3 seconds
- Invoice detection wired through NoteActions to all surfaces: feed,
  thread, profile, notifications, hashtag, article, and set-feed views
- All UI strings localised to de, es, fr, it, pt, nl, zh, ja, ko, ru
- Uses MaterialTheme colorScheme.primary throughout — no hardcoded colours

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@barrydeen barrydeen merged commit fe19a92 into main Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant