fix: add quickpay daily spend limit - #672
Open
ovitrif wants to merge 12 commits into
Open
Conversation
Track USD spend on the local calendar day so QuickPay can enforce a daily cap.
Expose the Android daily multiplier steps and resolved dollar cap in settings, and keep the value in backup.
Keep auto-pay PIN-free under the daily limit, record spend on success or pending, and send over-cap payments to Confirm.
9 tasks
Greptile SummaryThis PR adds a configurable QuickPay daily spend cap and tracks reserved spend through successful, failed, and pending Lightning payments.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| Bitkit/Views/Wallets/Send/SendQuickpay.swift | Reserves QuickPay spend before submission and binds the reservation to the payment hash after the event listener is active. |
| Bitkit/ViewModels/WalletViewModel.swift | Exposes listener-registration and timeout callbacks with the submitted payment hash while returning settled fee information. |
| Bitkit/ViewModels/AppViewModel.swift | Resolves pending QuickPay reservations on terminal payment events and propagates paid fees for the success screen. |
| Bitkit/Utilities/QuickPaySpendStore.swift | Implements synchronized daily spend accounting, reservation persistence, rollover handling, and release behavior. |
| Bitkit/Utilities/PaymentNavigationHelper.swift | Applies per-transaction and daily QuickPay eligibility checks and provides confirmation fallback routing. |
| Bitkit/ViewModels/SettingsViewModel.swift | Persists, restores, sanitizes, resets, and backs up the configurable daily-limit multiplier. |
Sequence Diagram
sequenceDiagram
participant Q as SendQuickpay
participant S as QuickPaySpendStore
participant W as WalletViewModel
participant A as AppViewModel
Q->>S: Reserve daily spend
Q->>W: sendWithTimeout
W->>W: Register payment event listener
W->>Q: afterListening(paymentHash)
Q->>S: Remember reservation by hash
alt Payment settles
W-->>Q: Success or failure
Q->>S: Keep or release reservation
else Payment times out
W->>A: Add pending payment hash
A-->>S: Later clear on success or release on failure
end
Reviews (2): Last reviewed commit: "fix: port QuickPay cents spend ledger" | Re-trigger Greptile
ben-kaufman
reviewed
Aug 19, 2026
ben-kaufman
left a comment
Contributor
There was a problem hiding this comment.
Three new findings from the re-audit.
This comment was marked as outdated.
This comment was marked as outdated.
ovitrif
marked this pull request as draft
August 19, 2026 13:59
ovitrif
marked this pull request as ready for review
August 19, 2026 22:21
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.
Closes #670
This PR ports QuickPay daily spend limits from Android (synonymdev/bitkit-android#1159) so auto-pay stays PIN-free under a configurable daily cap.
Description
QuickPay stays confirmation-free and PIN-free while a payment is under the per-tx threshold and the daily cap (
threshold × multiplierUSD). Once the cap would be exceeded, the payment opens Confirm, where PIN for payments still applies if that setting is on.1,3,5,10,50(default5)$capquickPayDailyLimitMultiplierPreview
happy-daily-cap.mp4
over-cap.mp4
QA Notes
Manual Tests
$copy updates (threshold × multiplier).regression:Settings → QuickPay → leave QuickPay off → scan a fixed-amount LN invoice: Confirm still opens.regression:Variable amount LN invoice / LNURL-pay: still lands on Amount, not QuickPay.Automated Checks
BitkitTests/QuickPaySpendStoreTests.swift.BitkitTests/PaymentNavigationHelperTests.swift.BitkitTests/QuickPayLimitsTests.swift.BitkitTests/AddressTypeSettingsTests.swift.node scripts/validate-translations.js: 0 errors.