Files
hash-wallet/cw_bitcoin_cash
d09391bf99 Upgrade Flutter version to 3.41.9 (#3213)
* commit generated files and remove codegen metadata

* remove hive_generator dependency

* update dependencies

* update intl

* update ios project files

* update native code

* update android deps

* update image name in ci

* revert impeller

* re-ignore min version error

* fix cw_decred dependency

* update hive in cw_core

* fix docker build cache for decred

* fix conflict

* prevent frozen coins being reset on coin info refresh

* fix for makeSecure

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2026-06-26 16:03:31 +03:00
..
2023-10-13 01:50:16 +03:00
2023-10-13 01:50:16 +03:00
2023-10-13 01:50:16 +03:00
2023-10-13 01:50:16 +03:00

cw_bitcoin_cash

Bitcoin Cash wallet module using the shared Electrum implementation configured for BCH mainnet. Includes CashAddr handling and BCH-specific fee/priority presets.

Features

  • Derive keys via BIP‑39; maintain receive/change address chains.
  • Load/save snapshots of addresses, indices, and balances.
  • Electrum connectivity and UTXO management.
  • Create/sign/broadcast BCH transactions; calculate size-based fees by priority.
  • CashAddr compatibility for addresses; migration of legacy snapshots.
  • Message signing and verification.

Getting started

Create/open via the app’s wallet service using WalletType.bitcoinCash. Ensure BCH Electrum nodes are configured.

final wallet = await BitcoinCashWallet.create(
  mnemonic: '...',
  password: 'secret',
  walletInfo: walletInfo,
  unspentCoinsInfo: unspentCoinsBox,
  encryptionFileUtils: encryption,
);

Usage

Fee calculation and send:

final feeRate = wallet.feeRate(BitcoinCashTransactionPriority.medium);
final pending = await wallet.createTransaction(
  outputs: [
    BitcoinTransactionOutput(
      address: 'bitcoincash:qq...',
      amount: 10000, // satoshis
    ),
  ],
  feeRate: feeRate,
);
final txHash = await pending.commit();

Additional information

  • See lib/src/ for: BitcoinCashWallet, BitcoinCashWalletAddresses, and helpers in bitcoin_cash_base.dart.
  • Snapshot migration and CashAddr normalization are handled during open.