Repository navigation
Add Bitcoin Cash Ledger wallet support - #3847
konstantinullrich wants to merge 2 commits into
Conversation
changes in dependencies |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 18295dc. Configure here.
| Future<String> signMessage(String message, {String? address}) async { | ||
| final addressEntry = address != null | ||
| ? walletAddresses.allAddresses.firstWhere((element) => element.address == address) | ||
| : null; |
There was a problem hiding this comment.
BCH sign lookup now throws
Medium Severity
signMessage now calls firstWhere with no fallback, and the old try/catch is gone. The Sign page always passes the address field for Bitcoin Cash, so an empty or differently formatted address (for example cashaddr without the bitcoincash: prefix) throws Bad state: No element instead of signing. That also blocks the new hardware path from using its index-0 default.
Reviewed by Cursor Bugbot for commit 18295dc. Configure here.


Replaces: #1615
Description
Adds Bitcoin Cash support for Ledger hardware wallets.
Pull Request - Checklist
Note
High Risk
Introduces hardware-backed signing and derivation paths for a new asset class; mistakes could affect funds or signatures, though the design mirrors existing BTC/LTC Ledger integration.
Overview
Adds Ledger support for Bitcoin Cash, including restore-from-hardware, on-device transaction signing, and message signing, wired through the same Ledger flows used for Bitcoin and Litecoin.
Bitcoin Cash: New
BitcoinCashLedgerService(account discovery onm/44'/145'/…', BCH-specific signing viaLitecoinLedgerAppwithcashaddr/bip143). The BCH wallet accepts optionalxpubinstead of a mnemonic, implementsbuildHardwareWalletTransaction, and routessignMessageto the hardware service when applicable.BitcoinCashWalletService.restoreFromHardwareWalletis implemented (replacing the previous stub) using sharedBitcoinRestoreWalletFromHardwarecredentials.App wiring: Ledger is marked supported for
WalletType.bitcoinCash; ledger and hardware-restore view models initialize BCH wallets and returnBitcoinCashLedgerServicefor BCH.Related fixes:
ElectrumWallet._accountDerivationPathForRecorduses the stored hardware derivation path when present. Litecoin Ledger gainssignMessage, with matching hardware branching inLitecoinWallet.signMessage. Ledger Flutter plugin refs are bumped in overrides (including message-sign support).Reviewed by Cursor Bugbot for commit 18295dc. Bugbot is set up for automated code reviews on this repo. Configure here.