mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-26 06:08:40 +01:00
* refactor address discovery and response handling * refactor input tx fetching and mweb tagging * add batch unspent fetching * add batch balance fetching * extend batch fetching to all Electrum wallets * minor fixes * [skip ci] Update cw_bitcoin/lib/electrum_wallet.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> * Revert "minor fixes" This reverts commit 631e6258d25cc8717178bbc2b39407443f030677. * used addresses anywhere in gap * refresh receive and change addresses on set * add isLegacyDerivation flag to address flows --------- Co-authored-by: Serhii <17529954+serhii-bor@users.noreply.github.com>
cw_bitcoin
Bitcoin-family Electrum wallet implementation used by Cake Wallet (BTC, LTC and derivatives).
Features
- Electrum client and wallet with address/UTXO management and snapshots.
- Derivation via BIP‑39; receive/change chains with per-coin configs.
- Create/sign/broadcast transactions; PSBT helpers and payjoin support.
- Transaction history, priorities, and size-based fee calculations.
- Hardware wallet support for BTC/LTC.
Getting started
Use the module via app services (see bitcoin_wallet_service.dart, litecoin_wallet_service.dart). Ensure Electrum nodes are configured for the target coin.
final wallet = await BitcoinWallet.create(
mnemonic: '...',
password: 'secret',
walletInfo: walletInfo,
unspentCoinsInfo: unspentCoinsBox,
encryptionFileUtils: encryption,
);
Usage
Send BTC with medium priority:
final feeRate = wallet.feeRate(BitcoinTransactionPriority.medium);
final pending = await wallet.createTransaction(
outputs: [BitcoinTransactionOutput(address: 'bc1...', amount: 50000)],
feeRate: feeRate,
);
final txHash = await pending.commit();
See lib/ for wallet/services, PSBT, and payjoin utilities.