fix: lnurl and quickpay msat amount conversion#514
Merged
ovitrif merged 4 commits intofix/msat-invoice-precisionfrom Apr 7, 2026
Merged
fix: lnurl and quickpay msat amount conversion#514ovitrif merged 4 commits intofix/msat-invoice-precisionfrom
ovitrif merged 4 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
This comment has been minimized.
This comment has been minimized.
This was referenced Apr 6, 2026
Collaborator
|
Found an issue, I suppose not related to that change, but I think easy fix that could be included, since it is a stacked PR already. lnurl-pay is missing the amount on SendSuccess screen: Screen.Recording.2026-04-07.at.12.53.46.mov |
Code review1 issue found. Missing
|
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
Stacked on:
This PR:
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 screenPreview
Script:
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