feat(clink): pay CLINK noffer offers from notes, profiles & wallet#588
Open
dmnyc wants to merge 3 commits into
Open
feat(clink): pay CLINK noffer offers from notes, profiles & wallet#588dmnyc wants to merge 3 commits into
dmnyc wants to merge 3 commits into
Conversation
Port of wisp-ios#360. Adds CLINK Offers (noffer1…) payment support: - Noffer: bech32 + TLV decoder, pricing types (fixed / variable / spontaneous), isNofferString / stripNostrPrefix helpers - NofferClient: kind-21001 NIP-44 RPC on the offer's relay with code-3 expired/moved latest-retry - NofferPaySheet + NofferCard: shared pay sheet that pays via the active wallet or falls back to a scannable bare-noffer QR - Notes: RichContent detects noffer tokens and renders a Pay-offer card - Profiles: clink_offer parsed tolerantly from kind-0, editor field, Pay-offer header button, offer QR inside the Lightning tab with a contextual address/offer switch - Wallet send: noffer detection routes through the native amount → confirm flow; fixed-price offers skip straight to confirm - Tests: decoder round-trip coverage mirroring the CLINK spec TLVs Spec: https://github.com/shocknet/CLINK/blob/main/specs/clink-offers.md
The NoteActions built for DM conversations, group DMs, group rooms, and search results never set onPayInvoice, so the noffer pay sheet (and lightning invoice cards) on those surfaces degraded to "Connect a wallet to pay" even with an active wallet.
- Map noffer payment hashes to the offer's service pubkey via ZapSender.persistRecipient in both pay paths, so wallet history resolves the payee's profile (name + avatar) like zaps do - Show the offer service's profile name on the wallet amount page and in the confirm-page description fallback - Make NofferPaySheet full viewport height (status-bar inset so the drag handle clears camera cutouts), matching the iOS pay modal - ProfileRepository schema migration: reset cached profile timestamps once so kind-0s re-parse with the new clinkOffer field — stale pre-upgrade cache entries otherwise never pick it up
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Android port of the iOS CLINK Offers feature (barrydeen/wisp-ios#360). Adds
noffer1…payment support so users can pay self-custodial Lightning offers advertised in notes, on profiles, and from the wallet.Noffer: bech32 + TLV decoder, pricing types (fixed / variable-range / spontaneous),isNofferString/stripNostrPrefix/decodeOrNull.NofferClient: kind-21001 NIP-44 request → encrypted invoice response on the offer's relay (one-shot ephemeral connection), with code-3 "expired/moved" latest-retry per spec.NofferPaySheet+NofferCard: full-height pay modal that pays via the active wallet, or falls back to a scannable bare-nofferQR for an external CLINK-aware wallet. The inline card resolves the recipient's name itself so it reads consistently across feed and thread.RichContentdetectsnoffertokens (incl.nostr:prefix) and renders the Pay-offer card.clink_offer/noffer/offerparsed tolerantly from kind-0; Pay-offer button on the profile header; CLINK offer field in the profile editor; offer QR inside the QR sheet's Lightning tab with a contextual address/offer switch.nofferroutes through the native amount → confirm flow; fixed-price offers skip straight to confirm. Payment hashes map to the offer's service pubkey so transaction history resolves the payee like zaps.Spec: https://github.com/shocknet/CLINK/blob/main/specs/clink-offers.md
A follow-up PR stacked on this branch aligns the profile/QR-sheet styling with iOS: #589.
Test plan
nofferopens the pay flowclink_offerthrough kind-0