Skip to content

Conversation

@jvsena42
Copy link
Member

@jvsena42 jvsena42 commented Jan 16, 2026

Fixes #354

Description

This PR implement the balance validation of #354

Preview

zero-balance-scan-zero-amount-invoice.webm
zero-balance-sance-ln-amount-invoice.webm
invalid.webm
network-mismatch.webm
insufficient-savingsbalance-uniffied.webm

QA Notes

@jvsena42 jvsena42 self-assigned this Jan 16, 2026
@jvsena42 jvsena42 marked this pull request as ready for review January 16, 2026 16:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements balance validation for Bitcoin and Lightning invoice payments to address issue #354. The changes ensure users receive appropriate error messages when attempting to pay invoices with insufficient balance, invalid addresses, or network mismatches.

Changes:

  • Added network validation logic to detect and reject addresses from incompatible Bitcoin networks (mainnet/testnet/regtest)
  • Implemented balance validation for both on-chain and Lightning invoices with specific error messages showing the shortfall amount
  • Added debounced address validation with immediate user feedback via toast messages

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
NetworkValidationHelper.kt New utility class for detecting Bitcoin network from address prefixes and validating network compatibility
NetworkValidationHelperTest.kt Comprehensive unit tests covering address network detection and mismatch validation scenarios
AppViewModel.kt Integrated address validation with debouncing, balance checks, and user feedback for both input and scan flows
strings.xml Added new error message string for insufficient spending balance on Lightning invoices

jvsena42 and others added 2 commits January 16, 2026 13:39
@jvsena42
Copy link
Member Author

@piotr-iohk needs an update from E2E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Address/balance validation on 'Send Bitcoin'

2 participants