fix: lnurl and quickpay msat amount conversion#514
Open
ovitrif wants to merge 3 commits intofix/msat-invoice-precisionfrom
Open
fix: lnurl and quickpay msat amount conversion#514ovitrif wants to merge 3 commits intofix/msat-invoice-precisionfrom
ovitrif wants to merge 3 commits intofix/msat-invoice-precisionfrom
Conversation
This comment has been minimized.
This comment has been minimized.
Port Android's LNURL amount helpers (isFixedAmount, callbackAmountMsats, minSendableSat, maxSendableSat, etc.) to iOS via extensions on LnurlPayData and LnurlWithdrawData. This fixes sub-sat edge cases where min/max msat values map to an inverted sat range after rounding (e.g. min=222222, max=222538 → minSat=223, maxSat=222). These are now correctly treated as fixed-amount requests and routed to the confirm screen instead of the amount picker. Also fixes LNURL quickpay guard that required scannedLightningInvoice (always nil for LNURL pay flows), and centralizes all msat→sat conversions for LNURL amounts in the new extension file. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The quickpay view only displayed the amount for bolt11 invoices (scannedLightningInvoice). For LNURL pay, the invoice doesn't exist yet at that point — the amount comes from lnurlPayData. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
aaa2240 to
e2d0056
Compare
Code reviewCLAUDE.md Compliance: Missing changelog entryThis is a
Please add an entry under ### Fixed
- Fix LNURL and quickpay msat amount conversion, handling sub-sat edge cases and quickpay guard for LNURL pay flows #514No other issues found. Checked for bugs and CLAUDE.md compliance. |
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
isFixedAmount,callbackAmountMsats,minSendableSat,maxSendableSat) to iOS as extensions onLnurlPayDataandLnurlWithdrawDatamin=222222, max=222538→minSat=223, maxSat=222) — these are now correctly treated as fixed-amount requestsscannedLightningInvoice(always nil for LNURL pay), and the amount wasn't displayed on the quickpay screenStacked on #512
Preview
minSendable=222222&maxSendable=222538QuickPay=OFFminSendable=222222&maxSendable=222538QuickPay=ONSimulator.2026-04-06.004948.mp4
Test plan
Use synonymdev/bitkit-docker#6:
🤖 Generated with Claude Code