1212//! Wallet
1313//!
1414//! This module defines the [`Wallet`].
15- use crate :: {
16- collections:: { BTreeMap , HashMap } ,
17- descriptor:: check_wallet_descriptor,
18- } ;
15+
1916use alloc:: {
2017 boxed:: Box ,
2118 string:: { String , ToString } ,
2219 sync:: Arc ,
2320 vec:: Vec ,
2421} ;
25- pub use bdk_chain:: Balance ;
22+ use core:: { cmp:: Ordering , fmt, mem, ops:: Deref } ;
23+
2624use bdk_chain:: {
2725 indexed_tx_graph,
2826 indexer:: keychain_txout:: KeychainTxOutIndex ,
@@ -33,63 +31,62 @@ use bdk_chain::{
3331 FullScanRequest , FullScanRequestBuilder , FullScanResult , SyncRequest , SyncRequestBuilder ,
3432 SyncResult ,
3533 } ,
36- tx_graph:: { CanonicalTx , TxGraph , TxNode , TxUpdate } ,
34+ tx_graph:: { CalculateFeeError , CanonicalTx , TxGraph , TxNode , TxUpdate } ,
3735 BlockId , ChainPosition , ConfirmationBlockTime , DescriptorExt , FullTxOut , Indexed ,
3836 IndexedTxGraph , Merge ,
3937} ;
40- use bitcoin:: sighash:: { EcdsaSighashType , TapSighashType } ;
4138use bitcoin:: {
42- absolute, psbt, Address , Block , FeeRate , Network , OutPoint , ScriptBuf , Sequence , Transaction ,
43- TxOut , Txid , Witness ,
39+ absolute,
40+ consensus:: encode:: serialize,
41+ constants:: genesis_block,
42+ psbt,
43+ secp256k1:: Secp256k1 ,
44+ sighash:: { EcdsaSighashType , TapSighashType } ,
45+ transaction, Address , Amount , Block , BlockHash , FeeRate , Network , OutPoint , Psbt , ScriptBuf ,
46+ Sequence , Transaction , TxOut , Txid , Weight , Witness ,
4447} ;
45- use bitcoin:: { consensus:: encode:: serialize, transaction, BlockHash , Psbt } ;
46- use bitcoin:: { constants:: genesis_block, Amount } ;
47- use bitcoin:: { secp256k1:: Secp256k1 , Weight } ;
48- use core:: cmp:: Ordering ;
49- use core:: fmt;
50- use core:: mem;
51- use core:: ops:: Deref ;
52- use rand_core:: RngCore ;
53-
54- use descriptor:: error:: Error as DescriptorError ;
5548use miniscript:: {
5649 descriptor:: KeyMap ,
5750 psbt:: { PsbtExt , PsbtInputExt , PsbtInputSatisfier } ,
5851} ;
59-
60- use bdk_chain:: tx_graph:: CalculateFeeError ;
52+ use rand_core:: RngCore ;
6153
6254mod changeset;
6355pub mod coin_selection;
56+ pub mod error;
6457pub mod export;
6558mod params;
59+ mod persisted;
6660pub mod signer;
6761pub mod tx_builder;
68- pub use changeset:: * ;
69- pub use params:: * ;
70- mod persisted;
71- pub use persisted:: * ;
7262pub ( crate ) mod utils;
7363
74- pub mod error;
75-
76- pub use utils:: IsDust ;
77-
78- use coin_selection:: { DefaultCoinSelectionAlgorithm , InsufficientFunds } ;
79- use signer:: { SignOptions , SignerOrdering , SignersContainer , TransactionSigner } ;
80- use tx_builder:: { FeePolicy , TxBuilder , TxParams } ;
81- use utils:: { check_nsequence_rbf, After , Older , SecpCtx } ;
82-
83- use crate :: descriptor:: policy:: BuildSatisfaction ;
64+ use crate :: collections:: { BTreeMap , HashMap } ;
8465use crate :: descriptor:: {
85- self , DerivedDescriptor , DescriptorMeta , ExtendedDescriptor , ExtractPolicy ,
86- IntoWalletDescriptor , Policy , XKeyUtils ,
66+ check_wallet_descriptor, error:: Error as DescriptorError , policy:: BuildSatisfaction ,
67+ DerivedDescriptor , DescriptorMeta , ExtendedDescriptor , ExtractPolicy , IntoWalletDescriptor ,
68+ Policy , XKeyUtils ,
8769} ;
8870use crate :: psbt:: PsbtUtils ;
89- use crate :: signer:: SignerError ;
9071use crate :: types:: * ;
91- use crate :: wallet:: coin_selection:: Excess :: { self , Change , NoChange } ;
92- use crate :: wallet:: error:: { BuildFeeBumpError , CreateTxError , MiniscriptPsbtError } ;
72+ use crate :: wallet:: {
73+ coin_selection:: {
74+ DefaultCoinSelectionAlgorithm ,
75+ Excess :: { self , Change , NoChange } ,
76+ InsufficientFunds ,
77+ } ,
78+ error:: { BuildFeeBumpError , CreateTxError , MiniscriptPsbtError } ,
79+ signer:: { SignOptions , SignerError , SignerOrdering , SignersContainer , TransactionSigner } ,
80+ tx_builder:: { FeePolicy , TxBuilder , TxParams } ,
81+ utils:: { check_nsequence_rbf, After , Older , SecpCtx } ,
82+ } ;
83+
84+ // re-exports
85+ pub use bdk_chain:: Balance ;
86+ pub use changeset:: ChangeSet ;
87+ pub use params:: * ;
88+ pub use persisted:: * ;
89+ pub use utils:: IsDust ;
9390
9491const COINBASE_MATURITY : u32 = 100 ;
9592
0 commit comments