fix: add quickpay daily spend limit - #672
Open
ovitrif wants to merge 9 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.
5 tasks
Greptile SummaryThis PR adds a configurable QuickPay daily spend cap, persists and backs up its multiplier, and tracks reserved spend around payment execution.
Confidence Score: 4/5The timeout-to-terminal-failure lifecycle must release its retained QuickPay reservation before this PR is safe to merge. A payment that times out keeps its reservation as intended while pending, but a later terminal failure never releases it, so retries and subsequent payments are evaluated against spend that never occurred. Files Needing Attention: Bitkit/Views/Wallets/Send/SendQuickpay.swift and the pending-payment failure transition
|
| Filename | Overview |
|---|---|
| Bitkit/Views/Wallets/Send/SendQuickpay.swift | Adds atomic spend reservation and fee-inclusive success display, but does not release retained spend when a timed-out payment later fails. |
| Bitkit/Utilities/QuickPaySpendStore.swift | Adds locked, day-keyed aggregate reservation storage with reserve and release operations. |
| Bitkit/Utilities/PaymentNavigationHelper.swift | Extends QuickPay eligibility with fixed-payment extraction and daily-cap checks. |
| Bitkit/Utilities/QuickPayLimits.swift | Centralizes thresholds, multiplier validation, currency conversion, daily-cap calculation, and fee-inclusive amount arithmetic. |
| Bitkit/ViewModels/WalletViewModel.swift | Returns the settled payment hash and routing fee from Lightning sends. |
| Bitkit/ViewModels/SettingsViewModel.swift | Persists, resets, restores, sanitizes, and backs up the daily multiplier. |
| Bitkit/Views/Settings/Quickpay/QuickpaySettings.swift | Adds the daily-limit explanation and multiplier slider to QuickPay settings. |
Sequence Diagram
sequenceDiagram
participant User
participant Nav as PaymentNavigationHelper
participant QuickPay as SendQuickpay
participant Store as QuickPaySpendStore
participant Wallet as WalletViewModel
participant Pending as Pending/Failure flow
User->>Nav: Scan eligible fixed invoice
Nav->>Store: Read today's spend
Nav-->>QuickPay: Route to QuickPay
QuickPay->>Store: Reserve invoice amount
QuickPay->>Wallet: Send with timeout
Wallet-->>QuickPay: Timeout
QuickPay-->>Pending: Keep reservation and show pending
Wallet-->>Pending: Terminal failure
Pending-->>User: Show failure
User->>QuickPay: Retry
QuickPay->>Store: Reserve same amount again
Reviews (1): Last reviewed commit: "fix: port Android QuickPay follow-ups" | Re-trigger Greptile
ben-kaufman
reviewed
Aug 18, 2026
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 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)$capquickPayDailyLimitMultiplierCompanion Android PR: synonymdev/bitkit-android#1159
Linked Issues/Tasks
Screenshot / Video
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.