Problem
The Receive screen (WalletScreen.kt → ReceiveAmountContent) currently accepts any user-entered amount with no client-side cap. If the user enters an amount that exceeds:
- Spark: per-channel inbound liquidity / JIT channel limit
- NWC: the backing wallet's max receive policy
…the invoice creation fails with a backend error string surfaced via _sendError, which is bad UX. The user only learns the cap exists by hitting it.
Investigation done
breez_sdk_spark 0.11.0 does not expose a queryable max-receive method. FetchConversionLimits only returns minFromAmount / minToAmount (for fiat onramps, not Lightning receive).
- NIP-47 / our
NwcRepository get_info response (alias, methods, pubkey, blockHeight) has no budget or max-amount fields. NIP-47 has no widely-implemented get_budget method.
Proposal
Pick a sensible static cap as a starting point (e.g. 1,000,000 sats / 0.01 BTC) applied to both Spark and NWC, with the field showing a supporting line like "Max 1,000,000 sats" and the Create invoice button disabled when exceeded.
This cap should match across Android and iOS — see companion issue on barrydeen/wisp-ios for iOS-side work.
Open questions
- What's the right number? 1M sats is ~$1000 at current price — generous for everyday Lightning use, well under typical channel limits.
- Should the cap differ per wallet backend? (Spark vs. NWC). Probably not for v1 — pick one number for simplicity.
- Should we tighten this dynamically once Spark SDK or a future NIP-47 extension exposes real limits? File-as-followup.
Related
Problem
The Receive screen (
WalletScreen.kt→ReceiveAmountContent) currently accepts any user-entered amount with no client-side cap. If the user enters an amount that exceeds:…the invoice creation fails with a backend error string surfaced via
_sendError, which is bad UX. The user only learns the cap exists by hitting it.Investigation done
breez_sdk_spark0.11.0 does not expose a queryable max-receive method.FetchConversionLimitsonly returnsminFromAmount/minToAmount(for fiat onramps, not Lightning receive).NwcRepositoryget_inforesponse (alias, methods, pubkey, blockHeight) has no budget or max-amount fields. NIP-47 has no widely-implementedget_budgetmethod.Proposal
Pick a sensible static cap as a starting point (e.g. 1,000,000 sats / 0.01 BTC) applied to both Spark and NWC, with the field showing a supporting line like "Max 1,000,000 sats" and the Create invoice button disabled when exceeded.
This cap should match across Android and iOS — see companion issue on
barrydeen/wisp-iosfor iOS-side work.Open questions
Related