dev
md 48 lines 1.36 KB
Rendered Raw
1 ## cw_dogecoin
2
3 Dogecoin wallet module using the shared Bitcoin Electrum implementation (`cw_bitcoin`) configured for Dogecoin mainnet.
4
5 ### Features
6
7 - Derive keys via BIP‑39; Dogecoin HD paths using `bitcoin_base`.
8 - Connect to Electrum nodes; maintain address sets and UTXOs.
9 - Create/sign/broadcast DOGE transactions with configurable fee rate.
10 - Address book and index management (receive/change, auto-generate settings).
11 - Message signing and verification.
12
13 ### Getting started
14
15 Create/open via `DogecoinWalletService` in the app using `WalletType.dogecoin`. Ensure Electrum nodes are configured for Dogecoin.
16
17 ```dart
18 final wallet = await DogeCoinWallet.create(
19 mnemonic: '...',
20 password: 'secret',
21 walletInfo: walletInfo,
22 unspentCoinsInfo: unspentCoinsBox,
23 encryptionFileUtils: encryption,
24 );
25 ```
26
27 ### Usage
28
29 Estimate fee and send:
30
31 ```dart
32 final feeRate = wallet.feeRate(BitcoinCashTransactionPriority.medium); // example priority mapping
33 final pending = await wallet.createTransaction(
34 outputs: [
35 BitcoinTransactionOutput(
36 address: 'D...',
37 amount: 1 * 100000000, // 1 DOGE in koinu
38 ),
39 ],
40 feeRate: feeRate,
41 );
42 final txHash = await pending.commit();
43 ```
44
45 ### Additional information
46
47 - See `lib/src/` for classes: `DogeCoinWallet`, `DogeCoinWalletAddresses`.
48 - Relies on core Electrum features in `cw_bitcoin` for UTXO selection and persistence.