diff --git a/.github/workflows/cont_integration.yml b/.github/workflows/cont_integration.yml
index 1233d7e17..7507478ea 100644
--- a/.github/workflows/cont_integration.yml
+++ b/.github/workflows/cont_integration.yml
@@ -58,8 +58,8 @@ jobs:
working-directory: ./crates/chain
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,hashbrown
- - name: Check bdk
- working-directory: ./crates/bdk
+ - name: Check bdk wallet
+ working-directory: ./crates/wallet
# TODO "--target thumbv6m-none-eabi" should work but currently does not
run: cargo check --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown
- name: Check esplora
@@ -89,8 +89,8 @@ jobs:
target: "wasm32-unknown-unknown"
- name: Rust Cache
uses: Swatinem/rust-cache@v2.2.1
- - name: Check bdk
- working-directory: ./crates/bdk
+ - name: Check bdk wallet
+ working-directory: ./crates/wallet
run: cargo check --target wasm32-unknown-unknown --no-default-features --features bitcoin/no-std,miniscript/no-std,bdk_chain/hashbrown,dev-getrandom-wasm
- name: Check esplora
working-directory: ./crates/esplora
diff --git a/Cargo.toml b/Cargo.toml
index 87428029a..7ecc7094c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[workspace]
resolver = "2"
members = [
- "crates/bdk",
+ "crates/wallet",
"crates/chain",
"crates/file_store",
"crates/electrum",
diff --git a/README.md b/README.md
index 030ec2a4e..f2e0660f5 100644
--- a/README.md
+++ b/README.md
@@ -10,11 +10,11 @@
-
+
-
+
@@ -22,7 +22,7 @@
@@ -39,7 +39,7 @@ It is built upon the excellent [`rust-bitcoin`] and [`rust-miniscript`] crates.
The project is split up into several crates in the `/crates` directory:
-- [`bdk`](./crates/bdk): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components
+- [`wallet`](./crates/wallet): Contains the central high level `Wallet` type that is built from the low-level mechanisms provided by the other components
- [`chain`](./crates/chain): Tools for storing and indexing chain data
- [`persist`](./crates/persist): Types that define data persistence of a BDK wallet
- [`file_store`](./crates/file_store): A (experimental) persistence backend for storing chain data in a single file.
@@ -47,10 +47,10 @@ The project is split up into several crates in the `/crates` directory:
- [`electrum`](./crates/electrum): Extends the [`electrum-client`] crate with methods to fetch chain data from an electrum server in the form that [`bdk_chain`] and `Wallet` can consume.
Fully working examples of how to use these components are in `/example-crates`:
-- [`example_cli`](./example-crates/example_cli): Library used by the `example_*` crates. Provides utilities for syncing, showing the balance, generating addresses and creating transactions without using the bdk `Wallet`.
-- [`example_electrum`](./example-crates/example_electrum): A command line Bitcoin wallet application built on top of `example_cli` and the `electrum` crate. It shows the power of the bdk tools (`chain` + `file_store` + `electrum`), without depending on the main `bdk` library.
-- [`example_esplora`](./example-crates/example_esplora): A command line Bitcoin wallet application built on top of `example_cli` and the `esplora` crate. It shows the power of the bdk tools (`chain` + `file_store` + `esplora`), without depending on the main `bdk` library.
-- [`example_bitcoind_rpc_polling`](./example-crates/example_bitcoind_rpc_polling): A command line Bitcoin wallet application built on top of `example_cli` and the `bitcoind_rpc` crate. It shows the power of the bdk tools (`chain` + `file_store` + `bitcoind_rpc`), without depending on the main `bdk` library.
+- [`example_cli`](./example-crates/example_cli): Library used by the `example_*` crates. Provides utilities for syncing, showing the balance, generating addresses and creating transactions without using the bdk_wallet `Wallet`.
+- [`example_electrum`](./example-crates/example_electrum): A command line Bitcoin wallet application built on top of `example_cli` and the `electrum` crate. It shows the power of the bdk tools (`chain` + `file_store` + `electrum`), without depending on the main `bdk_wallet` library.
+- [`example_esplora`](./example-crates/example_esplora): A command line Bitcoin wallet application built on top of `example_cli` and the `esplora` crate. It shows the power of the bdk tools (`chain` + `file_store` + `esplora`), without depending on the main `bdk_wallet` library.
+- [`example_bitcoind_rpc_polling`](./example-crates/example_bitcoind_rpc_polling): A command line Bitcoin wallet application built on top of `example_cli` and the `bitcoind_rpc` crate. It shows the power of the bdk tools (`chain` + `file_store` + `bitcoind_rpc`), without depending on the main `bdk_wallet` library.
- [`wallet_esplora_blocking`](./example-crates/wallet_esplora_blocking): Uses the `Wallet` to sync and spend using the Esplora blocking interface.
- [`wallet_esplora_async`](./example-crates/wallet_esplora_async): Uses the `Wallet` to sync and spend using the Esplora asynchronous interface.
- [`wallet_electrum`](./example-crates/wallet_electrum): Uses the `Wallet` to sync and spend using Electrum.
diff --git a/crates/hwi/Cargo.toml b/crates/hwi/Cargo.toml
index 711a2f948..972569c7e 100644
--- a/crates/hwi/Cargo.toml
+++ b/crates/hwi/Cargo.toml
@@ -9,5 +9,5 @@ license = "MIT OR Apache-2.0"
readme = "README.md"
[dependencies]
-bdk = { path = "../bdk" }
+bdk_wallet = { path = "../wallet" }
hwi = { version = "0.8.0", features = [ "miniscript"] }
diff --git a/crates/hwi/src/lib.rs b/crates/hwi/src/lib.rs
index ab87e8a87..129ceac24 100644
--- a/crates/hwi/src/lib.rs
+++ b/crates/hwi/src/lib.rs
@@ -3,10 +3,10 @@
//! This crate contains HWISigner, an implementation of a [`TransactionSigner`] to be
//! used with hardware wallets.
//! ```no_run
-//! # use bdk::bitcoin::Network;
-//! # use bdk::signer::SignerOrdering;
+//! # use bdk_wallet::bitcoin::Network;
+//! # use bdk_wallet::signer::SignerOrdering;
//! # use bdk_hwi::HWISigner;
-//! # use bdk::{KeychainKind, SignOptions, Wallet};
+//! # use bdk_wallet::{KeychainKind, SignOptions, Wallet};
//! # use hwi::HWIClient;
//! # use std::sync::Arc;
//! #
@@ -35,7 +35,7 @@
//! # }
//! ```
//!
-//! [`TransactionSigner`]: bdk::wallet::signer::TransactionSigner
+//! [`TransactionSigner`]: bdk_wallet::wallet::signer::TransactionSigner
mod signer;
pub use signer::*;
diff --git a/crates/hwi/src/signer.rs b/crates/hwi/src/signer.rs
index a297291ce..bbb626619 100644
--- a/crates/hwi/src/signer.rs
+++ b/crates/hwi/src/signer.rs
@@ -1,12 +1,12 @@
-use bdk::bitcoin::bip32::Fingerprint;
-use bdk::bitcoin::secp256k1::{All, Secp256k1};
-use bdk::bitcoin::Psbt;
+use bdk_wallet::bitcoin::bip32::Fingerprint;
+use bdk_wallet::bitcoin::secp256k1::{All, Secp256k1};
+use bdk_wallet::bitcoin::Psbt;
use hwi::error::Error;
use hwi::types::{HWIChain, HWIDevice};
use hwi::HWIClient;
-use bdk::signer::{SignerCommon, SignerError, SignerId, TransactionSigner};
+use bdk_wallet::signer::{SignerCommon, SignerError, SignerId, TransactionSigner};
#[derive(Debug)]
/// Custom signer for Hardware Wallets
@@ -38,7 +38,7 @@ impl TransactionSigner for HWISigner {
fn sign_transaction(
&self,
psbt: &mut Psbt,
- _sign_options: &bdk::SignOptions,
+ _sign_options: &bdk_wallet::SignOptions,
_secp: &Secp256k1,
) -> Result<(), SignerError> {
psbt.combine(
@@ -61,9 +61,9 @@ impl TransactionSigner for HWISigner {
// fn test_hardware_signer() {
// use std::sync::Arc;
//
-// use bdk::tests::get_funded_wallet;
-// use bdk::signer::SignerOrdering;
-// use bdk::bitcoin::Network;
+// use bdk_wallet::tests::get_funded_wallet;
+// use bdk_wallet::signer::SignerOrdering;
+// use bdk_wallet::bitcoin::Network;
// use crate::HWISigner;
// use hwi::HWIClient;
//
@@ -78,12 +78,12 @@ impl TransactionSigner for HWISigner {
//
// let (mut wallet, _) = get_funded_wallet(&descriptors.internal[0]);
// wallet.add_signer(
-// bdk::KeychainKind::External,
+// bdk_wallet::KeychainKind::External,
// SignerOrdering(200),
// Arc::new(custom_signer),
// );
//
-// let addr = wallet.get_address(bdk::wallet::AddressIndex::LastUnused);
+// let addr = wallet.get_address(bdk_wallet::wallet::AddressIndex::LastUnused);
// let mut builder = wallet.build_tx();
// builder.drain_to(addr.script_pubkey()).drain_wallet();
// let (mut psbt, _) = builder.finish().unwrap();
diff --git a/crates/bdk/Cargo.toml b/crates/wallet/Cargo.toml
similarity index 99%
rename from crates/bdk/Cargo.toml
rename to crates/wallet/Cargo.toml
index 140ab26b7..10e428c5b 100644
--- a/crates/bdk/Cargo.toml
+++ b/crates/wallet/Cargo.toml
@@ -1,5 +1,5 @@
[package]
-name = "bdk"
+name = "bdk_wallet"
homepage = "https://bitcoindevkit.org"
version = "1.0.0-alpha.11"
repository = "https://github.com/bitcoindevkit/bdk"
diff --git a/crates/bdk/README.md b/crates/wallet/README.md
similarity index 82%
rename from crates/bdk/README.md
rename to crates/wallet/README.md
index 4722c5845..37e16186a 100644
--- a/crates/bdk/README.md
+++ b/crates/wallet/README.md
@@ -8,11 +8,11 @@
-
+
-
+
@@ -20,13 +20,13 @@
-## `bdk`
+# BDK Wallet
-The `bdk` crate provides the [`Wallet`] type which is a simple, high-level
+The `bdk_wallet` crate provides the [`Wallet`] type which is a simple, high-level
interface built from the low-level components of [`bdk_chain`]. `Wallet` is a good starting point
for many simple applications as well as a good demonstration of how to use the other mechanisms to
construct a wallet. It has two keychains (external and internal) which are defined by
@@ -36,7 +36,7 @@ can create and sign transactions.
For details about the API of `Wallet` see the [module-level documentation][`Wallet`].
-### Blockchain data
+## Blockchain data
In order to get blockchain data for `Wallet` to consume, you should configure a client from
an available chain source. Typically you make a request to the chain source and get a response
@@ -55,7 +55,7 @@ that the `Wallet` can use to update its view of the chain.
* [`example-crates/wallet_electrum`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_electrum)
* [`example-crates/wallet_rpc`](https://github.com/bitcoindevkit/bdk/tree/master/example-crates/wallet_rpc)
-### Persistence
+## Persistence
To persist the `Wallet` on disk, it must be constructed with a [`PersistBackend`] implementation.
@@ -67,7 +67,7 @@ To persist the `Wallet` on disk, it must be constructed with a [`PersistBackend`
```rust,compile_fail
-use bdk::{bitcoin::Network, wallet::{ChangeSet, Wallet}};
+use bdk_wallet::{bitcoin::Network, wallet::{ChangeSet, Wallet}};
fn main() {
// Create a new file `Store`.
@@ -85,13 +85,13 @@ fn main() {
-
-
-
-
-
+
+
+
+
+
-
+
@@ -109,11 +109,11 @@ fn main() {
-
-
-
+
+
+
-
+
@@ -131,17 +131,17 @@ fn main() {
-
-
+
+
-
-
+
+
-
-
+
+
-
+
@@ -172,13 +172,13 @@ fn main() {
-
+
-
-
+
+
-
+
@@ -202,7 +202,7 @@ fn main() {
cargo test
```
-## License
+# License
Licensed under either of
@@ -211,15 +211,15 @@ Licensed under either of
at your option.
-### Contribution
+# Contribution
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms or
conditions.
-[`Wallet`]: https://docs.rs/bdk/1.0.0-alpha.7/bdk/wallet/struct.Wallet.html
-[`PersistBackend`]: https://docs.rs/bdk_persist/latest/bdk_persist/trait.PersistBackend.html
+[`Wallet`]: https://docs.rs/bdk_wallet/latest/bdk_wallet/wallet/struct.Wallet.html
+[`PersistBackend`]: https://docs.rs/bdk_chain/latest/bdk_chain/trait.PersistBackend.html
[`bdk_chain`]: https://docs.rs/bdk_chain/latest
[`bdk_file_store`]: https://docs.rs/bdk_file_store/latest
[`bdk_electrum`]: https://docs.rs/bdk_electrum/latest
diff --git a/crates/bdk/examples/compiler.rs b/crates/wallet/examples/compiler.rs
similarity index 97%
rename from crates/bdk/examples/compiler.rs
rename to crates/wallet/examples/compiler.rs
index 0dbe1dd23..116df4733 100644
--- a/crates/bdk/examples/compiler.rs
+++ b/crates/wallet/examples/compiler.rs
@@ -9,7 +9,7 @@
// You may not use this file except in accordance with one or both of these
// licenses.
-extern crate bdk;
+extern crate bdk_wallet;
extern crate bitcoin;
extern crate miniscript;
extern crate serde_json;
@@ -21,7 +21,7 @@ use bitcoin::Network;
use miniscript::policy::Concrete;
use miniscript::Descriptor;
-use bdk::{KeychainKind, Wallet};
+use bdk_wallet::{KeychainKind, Wallet};
/// Miniscript policy is a high level abstraction of spending conditions. Defined in the
/// rust-miniscript library here https://docs.rs/miniscript/7.0.0/miniscript/policy/index.html
diff --git a/crates/bdk/examples/mnemonic_to_descriptors.rs b/crates/wallet/examples/mnemonic_to_descriptors.rs
similarity index 85%
rename from crates/bdk/examples/mnemonic_to_descriptors.rs
rename to crates/wallet/examples/mnemonic_to_descriptors.rs
index d2e59fe51..76c53cf29 100644
--- a/crates/bdk/examples/mnemonic_to_descriptors.rs
+++ b/crates/wallet/examples/mnemonic_to_descriptors.rs
@@ -7,14 +7,14 @@
// licenses.
use anyhow::anyhow;
-use bdk::bitcoin::bip32::DerivationPath;
-use bdk::bitcoin::secp256k1::Secp256k1;
-use bdk::bitcoin::Network;
-use bdk::descriptor;
-use bdk::descriptor::IntoWalletDescriptor;
-use bdk::keys::bip39::{Language, Mnemonic, WordCount};
-use bdk::keys::{GeneratableKey, GeneratedKey};
-use bdk::miniscript::Tap;
+use bdk_wallet::bitcoin::bip32::DerivationPath;
+use bdk_wallet::bitcoin::secp256k1::Secp256k1;
+use bdk_wallet::bitcoin::Network;
+use bdk_wallet::descriptor;
+use bdk_wallet::descriptor::IntoWalletDescriptor;
+use bdk_wallet::keys::bip39::{Language, Mnemonic, WordCount};
+use bdk_wallet::keys::{GeneratableKey, GeneratedKey};
+use bdk_wallet::miniscript::Tap;
use std::str::FromStr;
/// This example demonstrates how to generate a mnemonic phrase
diff --git a/crates/bdk/examples/policy.rs b/crates/wallet/examples/policy.rs
similarity index 84%
rename from crates/bdk/examples/policy.rs
rename to crates/wallet/examples/policy.rs
index 0f31cccde..e748c3fd4 100644
--- a/crates/bdk/examples/policy.rs
+++ b/crates/wallet/examples/policy.rs
@@ -9,14 +9,14 @@
// You may not use this file except in accordance with one or both of these
// licenses.
-extern crate bdk;
+extern crate bdk_wallet;
use std::error::Error;
-use bdk::bitcoin::Network;
-use bdk::descriptor::{policy::BuildSatisfaction, ExtractPolicy, IntoWalletDescriptor};
-use bdk::wallet::signer::SignersContainer;
+use bdk_wallet::bitcoin::Network;
+use bdk_wallet::descriptor::{policy::BuildSatisfaction, ExtractPolicy, IntoWalletDescriptor};
+use bdk_wallet::wallet::signer::SignersContainer;
-/// This example describes the use of the BDK's [`bdk::descriptor::policy`] module.
+/// This example describes the use of the BDK's [`bdk_wallet::descriptor::policy`] module.
///
/// Policy is higher abstraction representation of the wallet descriptor spending condition.
/// This is useful to express complex miniscript spending conditions into more human readable form.
@@ -34,11 +34,11 @@ fn main() -> Result<(), Box> {
let desc = "wsh(multi(2,tprv8ZgxMBicQKsPdpkqS7Eair4YxjcuuvDPNYmKX3sCniCf16tHEVrjjiSXEkFRnUH77yXc6ZcwHHcLNfjdi5qUvw3VDfgYiH5mNsj5izuiu2N/1/*,tpubD6NzVbkrYhZ4XHndKkuB8FifXm8r5FQHwrN6oZuWCz13qb93rtgKvD4PQsqC4HP4yhV3tA2fqr2RbY5mNXfM7RxXUoeABoDtsFUq2zJq6YK/1/*))";
// Use the descriptor string to derive the full descriptor and a keymap.
- // The wallet descriptor can be used to create a new bdk::wallet.
+ // The wallet descriptor can be used to create a new bdk_wallet::wallet.
// While the `keymap` can be used to create a `SignerContainer`.
//
// The `SignerContainer` can sign for `PSBT`s.
- // a bdk::wallet internally uses these to handle transaction signing.
+ // a bdk_wallet::wallet internally uses these to handle transaction signing.
// But they can be used as independent tools also.
let (wallet_desc, keymap) = desc.into_wallet_descriptor(&secp, Network::Testnet)?;
diff --git a/crates/bdk/src/descriptor/checksum.rs b/crates/wallet/src/descriptor/checksum.rs
similarity index 100%
rename from crates/bdk/src/descriptor/checksum.rs
rename to crates/wallet/src/descriptor/checksum.rs
diff --git a/crates/bdk/src/descriptor/dsl.rs b/crates/wallet/src/descriptor/dsl.rs
similarity index 98%
rename from crates/bdk/src/descriptor/dsl.rs
rename to crates/wallet/src/descriptor/dsl.rs
index aa52ff279..0d7e7c8e9 100644
--- a/crates/bdk/src/descriptor/dsl.rs
+++ b/crates/wallet/src/descriptor/dsl.rs
@@ -423,7 +423,7 @@ macro_rules! apply_modifier {
///
/// ```
/// # use std::str::FromStr;
-/// let (my_descriptor, my_keys_map, networks) = bdk::descriptor!(sh(wsh(and_v(v:pk("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy"),older(50)))))?;
+/// let (my_descriptor, my_keys_map, networks) = bdk_wallet::descriptor!(sh(wsh(and_v(v:pk("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy"),older(50)))))?;
/// # Ok::<(), Box>(())
/// ```
///
@@ -444,7 +444,7 @@ macro_rules! apply_modifier {
/// bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;
/// let my_timelock = 50;
///
-/// let (descriptor_a, key_map_a, networks) = bdk::descriptor! {
+/// let (descriptor_a, key_map_a, networks) = bdk_wallet::descriptor! {
/// wsh (
/// thresh(2, pk(my_key_1), s:pk(my_key_2), s:n:d:v:older(my_timelock))
/// )
@@ -452,11 +452,12 @@ macro_rules! apply_modifier {
///
/// #[rustfmt::skip]
/// let b_items = vec![
-/// bdk::fragment!(pk(my_key_1))?,
-/// bdk::fragment!(s:pk(my_key_2))?,
-/// bdk::fragment!(s:n:d:v:older(my_timelock))?,
+/// bdk_wallet::fragment!(pk(my_key_1))?,
+/// bdk_wallet::fragment!(s:pk(my_key_2))?,
+/// bdk_wallet::fragment!(s:n:d:v:older(my_timelock))?,
/// ];
-/// let (descriptor_b, mut key_map_b, networks) = bdk::descriptor!(wsh(thresh_vec(2, b_items)))?;
+/// let (descriptor_b, mut key_map_b, networks) =
+/// bdk_wallet::descriptor!(wsh(thresh_vec(2, b_items)))?;
///
/// assert_eq!(descriptor_a, descriptor_b);
/// assert_eq!(key_map_a.len(), key_map_b.len());
@@ -475,7 +476,7 @@ macro_rules! apply_modifier {
/// let my_key_2 =
/// bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;
///
-/// let (descriptor, key_map, networks) = bdk::descriptor! {
+/// let (descriptor, key_map, networks) = bdk_wallet::descriptor! {
/// wsh (
/// multi(2, my_key_1, my_key_2)
/// )
@@ -491,7 +492,7 @@ macro_rules! apply_modifier {
/// let my_key =
/// bitcoin::PrivateKey::from_wif("cVt4o7BGAig1UXywgGSmARhxMdzP5qvQsxKkSsc1XEkw3tDTQFpy")?;
///
-/// let (descriptor, key_map, networks) = bdk::descriptor!(wpkh(my_key))?;
+/// let (descriptor, key_map, networks) = bdk_wallet::descriptor!(wpkh(my_key))?;
/// # Ok::<(), Box>(())
/// ```
///
diff --git a/crates/bdk/src/descriptor/error.rs b/crates/wallet/src/descriptor/error.rs
similarity index 100%
rename from crates/bdk/src/descriptor/error.rs
rename to crates/wallet/src/descriptor/error.rs
diff --git a/crates/bdk/src/descriptor/mod.rs b/crates/wallet/src/descriptor/mod.rs
similarity index 100%
rename from crates/bdk/src/descriptor/mod.rs
rename to crates/wallet/src/descriptor/mod.rs
diff --git a/crates/bdk/src/descriptor/policy.rs b/crates/wallet/src/descriptor/policy.rs
similarity index 99%
rename from crates/bdk/src/descriptor/policy.rs
rename to crates/wallet/src/descriptor/policy.rs
index 820bf2d2d..bf8a661ea 100644
--- a/crates/bdk/src/descriptor/policy.rs
+++ b/crates/wallet/src/descriptor/policy.rs
@@ -20,10 +20,10 @@
//!
//! ```
//! # use std::sync::Arc;
-//! # use bdk::descriptor::*;
-//! # use bdk::wallet::signer::*;
-//! # use bdk::bitcoin::secp256k1::Secp256k1;
-//! use bdk::descriptor::policy::BuildSatisfaction;
+//! # use bdk_wallet::descriptor::*;
+//! # use bdk_wallet::wallet::signer::*;
+//! # use bdk_wallet::bitcoin::secp256k1::Secp256k1;
+//! use bdk_wallet::descriptor::policy::BuildSatisfaction;
//! let secp = Secp256k1::new();
//! let desc = "wsh(and_v(v:pk(cV3oCth6zxZ1UVsHLnGothsWNsaoxRhC6aeNi5VbSdFpwUkgkEci),or_d(pk(cVMTy7uebJgvFaSBwcgvwk8qn8xSLc97dKow4MBetjrrahZoimm2),older(12960))))";
//!
diff --git a/crates/bdk/src/descriptor/template.rs b/crates/wallet/src/descriptor/template.rs
similarity index 94%
rename from crates/bdk/src/descriptor/template.rs
rename to crates/wallet/src/descriptor/template.rs
index 61f9c4f21..528be1f3b 100644
--- a/crates/bdk/src/descriptor/template.rs
+++ b/crates/wallet/src/descriptor/template.rs
@@ -36,17 +36,17 @@ pub type DescriptorTemplateOut = (ExtendedDescriptor, KeyMap, ValidNetworks);
/// ## Example
///
/// ```
-/// use bdk::descriptor::error::Error as DescriptorError;
-/// use bdk::keys::{IntoDescriptorKey, KeyError};
-/// use bdk::miniscript::Legacy;
-/// use bdk::template::{DescriptorTemplate, DescriptorTemplateOut};
+/// use bdk_wallet::descriptor::error::Error as DescriptorError;
+/// use bdk_wallet::keys::{IntoDescriptorKey, KeyError};
+/// use bdk_wallet::miniscript::Legacy;
+/// use bdk_wallet::template::{DescriptorTemplate, DescriptorTemplateOut};
/// use bitcoin::Network;
///
/// struct MyP2PKH>(K);
///
/// impl> DescriptorTemplate for MyP2PKH {
/// fn build(self, network: Network) -> Result {
-/// Ok(bdk::descriptor!(pkh(self.0))?)
+/// Ok(bdk_wallet::descriptor!(pkh(self.0))?)
/// }
/// }
/// ```
@@ -72,10 +72,10 @@ impl IntoWalletDescriptor for T {
/// ## Example
///
/// ```
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::Wallet;
-/// # use bdk::KeychainKind;
-/// use bdk::template::P2Pkh;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::Wallet;
+/// # use bdk_wallet::KeychainKind;
+/// use bdk_wallet::template::P2Pkh;
///
/// let key =
/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;
@@ -102,10 +102,10 @@ impl> DescriptorTemplate for P2Pkh {
/// ## Example
///
/// ```
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::Wallet;
-/// # use bdk::KeychainKind;
-/// use bdk::template::P2Wpkh_P2Sh;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::Wallet;
+/// # use bdk_wallet::KeychainKind;
+/// use bdk_wallet::template::P2Wpkh_P2Sh;
///
/// let key =
/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;
@@ -133,10 +133,10 @@ impl> DescriptorTemplate for P2Wpkh_P2Sh {
/// ## Example
///
/// ```
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet};
-/// # use bdk::KeychainKind;
-/// use bdk::template::P2Wpkh;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet};
+/// # use bdk_wallet::KeychainKind;
+/// use bdk_wallet::template::P2Wpkh;
///
/// let key =
/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;
@@ -163,10 +163,10 @@ impl> DescriptorTemplate for P2Wpkh {
/// ## Example
///
/// ```
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::Wallet;
-/// # use bdk::KeychainKind;
-/// use bdk::template::P2TR;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::Wallet;
+/// # use bdk_wallet::KeychainKind;
+/// use bdk_wallet::template::P2TR;
///
/// let key =
/// bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;
@@ -198,9 +198,9 @@ impl> DescriptorTemplate for P2TR {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip44;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip44;
///
/// let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;
/// let mut wallet = Wallet::new_no_persist(
@@ -234,9 +234,9 @@ impl> DescriptorTemplate for Bip44 {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip44Public;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip44Public;
///
/// let key = bitcoin::bip32::Xpub::from_str("tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU")?;
/// let fingerprint = bitcoin::bip32::Fingerprint::from_str("c55b303f")?;
@@ -271,9 +271,9 @@ impl> DescriptorTemplate for Bip44Public {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip49;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip49;
///
/// let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;
/// let mut wallet = Wallet::new_no_persist(
@@ -307,9 +307,9 @@ impl> DescriptorTemplate for Bip49 {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip49Public;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip49Public;
///
/// let key = bitcoin::bip32::Xpub::from_str("tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L")?;
/// let fingerprint = bitcoin::bip32::Fingerprint::from_str("c55b303f")?;
@@ -344,9 +344,9 @@ impl> DescriptorTemplate for Bip49Public {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip84;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip84;
///
/// let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;
/// let mut wallet = Wallet::new_no_persist(
@@ -380,9 +380,9 @@ impl> DescriptorTemplate for Bip84 {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip84Public;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip84Public;
///
/// let key = bitcoin::bip32::Xpub::from_str("tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q")?;
/// let fingerprint = bitcoin::bip32::Fingerprint::from_str("c55b303f")?;
@@ -417,9 +417,9 @@ impl> DescriptorTemplate for Bip84Public {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip86;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip86;
///
/// let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPeZRHk4rTG6orPS2CRNFX3njhUXx5vj9qGog5ZMH4uGReDWN5kCkY3jmWEtWause41CDvBRXD1shKknAMKxT99o9qUTRVC6m")?;
/// let mut wallet = Wallet::new_no_persist(
@@ -453,9 +453,9 @@ impl> DescriptorTemplate for Bip86 {
///
/// ```
/// # use std::str::FromStr;
-/// # use bdk::bitcoin::{PrivateKey, Network};
-/// # use bdk::{Wallet, KeychainKind};
-/// use bdk::template::Bip86Public;
+/// # use bdk_wallet::bitcoin::{PrivateKey, Network};
+/// # use bdk_wallet::{Wallet, KeychainKind};
+/// use bdk_wallet::template::Bip86Public;
///
/// let key = bitcoin::bip32::Xpub::from_str("tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q")?;
/// let fingerprint = bitcoin::bip32::Fingerprint::from_str("c55b303f")?;
diff --git a/crates/bdk/src/keys/bip39.rs b/crates/wallet/src/keys/bip39.rs
similarity index 100%
rename from crates/bdk/src/keys/bip39.rs
rename to crates/wallet/src/keys/bip39.rs
diff --git a/crates/bdk/src/keys/mod.rs b/crates/wallet/src/keys/mod.rs
similarity index 95%
rename from crates/bdk/src/keys/mod.rs
rename to crates/wallet/src/keys/mod.rs
index 75abb3aa6..5f6b54cd1 100644
--- a/crates/bdk/src/keys/mod.rs
+++ b/crates/wallet/src/keys/mod.rs
@@ -97,7 +97,7 @@ impl DescriptorKey {
}
}
- // This method is used internally by `bdk::fragment!` and `bdk::descriptor!`. It has to be
+ // This method is used internally by `bdk_wallet::fragment!` and `bdk_wallet::descriptor!`. It has to be
// public because it is effectively called by external crates once the macros are expanded,
// but since it is not meant to be part of the public api we hide it from the docs.
#[doc(hidden)]
@@ -206,9 +206,9 @@ impl ExtScriptContext for Ctx {
/// Key type valid in any context:
///
/// ```
-/// use bdk::bitcoin::PublicKey;
+/// use bdk_wallet::bitcoin::PublicKey;
///
-/// use bdk::keys::{DescriptorKey, IntoDescriptorKey, KeyError, ScriptContext};
+/// use bdk_wallet::keys::{DescriptorKey, IntoDescriptorKey, KeyError, ScriptContext};
///
/// pub struct MyKeyType {
/// pubkey: PublicKey,
@@ -224,9 +224,9 @@ impl ExtScriptContext for Ctx {
/// Key type that is only valid on mainnet:
///
/// ```
-/// use bdk::bitcoin::PublicKey;
+/// use bdk_wallet::bitcoin::PublicKey;
///
-/// use bdk::keys::{
+/// use bdk_wallet::keys::{
/// mainnet_network, DescriptorKey, DescriptorPublicKey, IntoDescriptorKey, KeyError,
/// ScriptContext, SinglePub, SinglePubKey,
/// };
@@ -251,9 +251,11 @@ impl ExtScriptContext for Ctx {
/// Key type that internally encodes in which context it's valid. The context is checked at runtime:
///
/// ```
-/// use bdk::bitcoin::PublicKey;
+/// use bdk_wallet::bitcoin::PublicKey;
///
-/// use bdk::keys::{DescriptorKey, ExtScriptContext, IntoDescriptorKey, KeyError, ScriptContext};
+/// use bdk_wallet::keys::{
+/// DescriptorKey, ExtScriptContext, IntoDescriptorKey, KeyError, ScriptContext,
+/// };
///
/// pub struct MyKeyType {
/// is_legacy: bool,
@@ -279,17 +281,17 @@ impl ExtScriptContext for Ctx {
/// makes the compiler (correctly) fail.
///
/// ```compile_fail
-/// use bdk::bitcoin::PublicKey;
+/// use bdk_wallet::bitcoin::PublicKey;
/// use core::str::FromStr;
///
-/// use bdk::keys::{DescriptorKey, IntoDescriptorKey, KeyError};
+/// use bdk_wallet::keys::{DescriptorKey, IntoDescriptorKey, KeyError};
///
/// pub struct MySegwitOnlyKeyType {
/// pubkey: PublicKey,
/// }
///
-/// impl IntoDescriptorKey for MySegwitOnlyKeyType {
-/// fn into_descriptor_key(self) -> Result, KeyError> {
+/// impl IntoDescriptorKey for MySegwitOnlyKeyType {
+/// fn into_descriptor_key(self) -> Result, KeyError> {
/// self.pubkey.into_descriptor_key()
/// }
/// }
@@ -297,8 +299,8 @@ impl ExtScriptContext for Ctx {
/// let key = MySegwitOnlyKeyType {
/// pubkey: PublicKey::from_str("...")?,
/// };
-/// let (descriptor, _, _) = bdk::descriptor!(pkh(key))?;
-/// // ^^^^^ changing this to `wpkh` would make it compile
+/// let (descriptor, _, _) = bdk_wallet::descriptor!(pkh(key))?;
+/// // ^^^^^ changing this to `wpkh` would make it compile
///
/// # Ok::<_, Box>(())
/// ```
@@ -387,9 +389,9 @@ impl From for ExtendedKey {
/// an [`Xpub`] can implement only the required `into_extended_key()` method.
///
/// ```
-/// use bdk::bitcoin;
-/// use bdk::bitcoin::bip32;
-/// use bdk::keys::{DerivableKey, ExtendedKey, KeyError, ScriptContext};
+/// use bdk_wallet::bitcoin;
+/// use bdk_wallet::bitcoin::bip32;
+/// use bdk_wallet::keys::{DerivableKey, ExtendedKey, KeyError, ScriptContext};
///
/// struct MyCustomKeyType {
/// key_data: bitcoin::PrivateKey,
@@ -418,9 +420,9 @@ impl From for ExtendedKey {
/// [`Xpriv`] or [`Xpub`] will be considered valid.
///
/// ```
-/// use bdk::bitcoin;
-/// use bdk::bitcoin::bip32;
-/// use bdk::keys::{
+/// use bdk_wallet::bitcoin;
+/// use bdk_wallet::bitcoin::bip32;
+/// use bdk_wallet::keys::{
/// any_network, DerivableKey, DescriptorKey, ExtendedKey, KeyError, ScriptContext,
/// };
///
@@ -469,9 +471,9 @@ pub trait DerivableKey: Sized {
This can be used to get direct access to `xprv`s and `xpub`s for types that implement this trait,
like [`Mnemonic`](bip39::Mnemonic) when the `keys-bip39` feature is enabled.
```rust
-use bdk::bitcoin::Network;
-use bdk::keys::{DerivableKey, ExtendedKey};
-use bdk::keys::bip39::{Mnemonic, Language};
+use bdk_wallet::bitcoin::Network;
+use bdk_wallet::keys::{DerivableKey, ExtendedKey};
+use bdk_wallet::keys::bip39::{Mnemonic, Language};
# fn main() -> Result<(), Box> {
let xkey: ExtendedKey =
@@ -764,7 +766,7 @@ fn expand_multi_keys, Ctx: ScriptContext>(
Ok((pks, key_map, valid_networks))
}
-// Used internally by `bdk::fragment!` to build `pk_k()` fragments
+// Used internally by `bdk_wallet::fragment!` to build `pk_k()` fragments
#[doc(hidden)]
pub fn make_pk, Ctx: ScriptContext>(
descriptor_key: Pk,
@@ -778,7 +780,7 @@ pub fn make_pk, Ctx: ScriptContext>(
Ok((minisc, key_map, valid_networks))
}
-// Used internally by `bdk::fragment!` to build `pk_h()` fragments
+// Used internally by `bdk_wallet::fragment!` to build `pk_h()` fragments
#[doc(hidden)]
pub fn make_pkh, Ctx: ScriptContext>(
descriptor_key: Pk,
@@ -792,7 +794,7 @@ pub fn make_pkh, Ctx: ScriptContext>(
Ok((minisc, key_map, valid_networks))
}
-// Used internally by `bdk::fragment!` to build `multi()` fragments
+// Used internally by `bdk_wallet::fragment!` to build `multi()` fragments
#[doc(hidden)]
pub fn make_multi<
Pk: IntoDescriptorKey,
@@ -812,7 +814,7 @@ pub fn make_multi<
Ok((minisc, key_map, valid_networks))
}
-// Used internally by `bdk::descriptor!` to build `sortedmulti()` fragments
+// Used internally by `bdk_wallet::descriptor!` to build `sortedmulti()` fragments
#[doc(hidden)]
pub fn make_sortedmulti(
thresh: usize,
@@ -834,7 +836,7 @@ where
Ok((descriptor, key_map, valid_networks))
}
-/// The "identity" conversion is used internally by some `bdk::fragment`s
+/// The "identity" conversion is used internally by some `bdk_wallet::fragment`s
impl IntoDescriptorKey for DescriptorKey {
fn into_descriptor_key(self) -> Result, KeyError> {
Ok(self)
diff --git a/crates/bdk/src/lib.rs b/crates/wallet/src/lib.rs
similarity index 100%
rename from crates/bdk/src/lib.rs
rename to crates/wallet/src/lib.rs
diff --git a/crates/bdk/src/psbt/mod.rs b/crates/wallet/src/psbt/mod.rs
similarity index 100%
rename from crates/bdk/src/psbt/mod.rs
rename to crates/wallet/src/psbt/mod.rs
diff --git a/crates/bdk/src/types.rs b/crates/wallet/src/types.rs
similarity index 100%
rename from crates/bdk/src/types.rs
rename to crates/wallet/src/types.rs
diff --git a/crates/bdk/src/wallet/coin_selection.rs b/crates/wallet/src/wallet/coin_selection.rs
similarity index 99%
rename from crates/bdk/src/wallet/coin_selection.rs
rename to crates/wallet/src/wallet/coin_selection.rs
index 6be3cb971..5df64796a 100644
--- a/crates/bdk/src/wallet/coin_selection.rs
+++ b/crates/wallet/src/wallet/coin_selection.rs
@@ -26,11 +26,11 @@
//! ```
//! # use std::str::FromStr;
//! # use bitcoin::*;
-//! # use bdk::wallet::{self, ChangeSet, coin_selection::*, coin_selection};
-//! # use bdk::wallet::error::CreateTxError;
+//! # use bdk_wallet::wallet::{self, ChangeSet, coin_selection::*, coin_selection};
+//! # use bdk_wallet::wallet::error::CreateTxError;
//! # use bdk_persist::PersistBackend;
-//! # use bdk::*;
-//! # use bdk::wallet::coin_selection::decide_change;
+//! # use bdk_wallet::*;
+//! # use bdk_wallet::wallet::coin_selection::decide_change;
//! # use anyhow::Error;
//! #[derive(Debug)]
//! struct AlwaysSpendEverything;
diff --git a/crates/bdk/src/wallet/error.rs b/crates/wallet/src/wallet/error.rs
similarity index 100%
rename from crates/bdk/src/wallet/error.rs
rename to crates/wallet/src/wallet/error.rs
diff --git a/crates/bdk/src/wallet/export.rs b/crates/wallet/src/wallet/export.rs
similarity index 99%
rename from crates/bdk/src/wallet/export.rs
rename to crates/wallet/src/wallet/export.rs
index b6349309b..95d91193d 100644
--- a/crates/bdk/src/wallet/export.rs
+++ b/crates/wallet/src/wallet/export.rs
@@ -20,8 +20,8 @@
//! ```
//! # use std::str::FromStr;
//! # use bitcoin::*;
-//! # use bdk::wallet::export::*;
-//! # use bdk::*;
+//! # use bdk_wallet::wallet::export::*;
+//! # use bdk_wallet::*;
//! let import = r#"{
//! "descriptor": "wpkh([c258d2e4\/84h\/1h\/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe\/0\/*)",
//! "blockheight":1782088,
@@ -40,8 +40,8 @@
//! ### Export a `Wallet`
//! ```
//! # use bitcoin::*;
-//! # use bdk::wallet::export::*;
-//! # use bdk::*;
+//! # use bdk_wallet::wallet::export::*;
+//! # use bdk_wallet::*;
//! let wallet = Wallet::new_no_persist(
//! "wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/0/*)",
//! Some("wpkh([c258d2e4/84h/1h/0h]tpubDD3ynpHgJQW8VvWRzQ5WFDCrs4jqVFGHB3vLC3r49XHJSqP8bHKdK4AriuUKLccK68zfzowx7YhmDN8SiSkgCDENUFx9qVw65YyqM78vyVe/1/*)"),
diff --git a/crates/bdk/src/wallet/hardwaresigner.rs b/crates/wallet/src/wallet/hardwaresigner.rs
similarity index 91%
rename from crates/bdk/src/wallet/hardwaresigner.rs
rename to crates/wallet/src/wallet/hardwaresigner.rs
index 5a210f64c..b9bff5ad5 100644
--- a/crates/bdk/src/wallet/hardwaresigner.rs
+++ b/crates/wallet/src/wallet/hardwaresigner.rs
@@ -14,11 +14,11 @@
//! This module contains HWISigner, an implementation of a [TransactionSigner] to be
//! used with hardware wallets.
//! ```no_run
-//! # use bdk::bitcoin::Network;
-//! # use bdk::signer::SignerOrdering;
-//! # use bdk::wallet::hardwaresigner::HWISigner;
-//! # use bdk::wallet::AddressIndex::New;
-//! # use bdk::{KeychainKind, SignOptions, Wallet};
+//! # use bdk_wallet::bitcoin::Network;
+//! # use bdk_wallet::signer::SignerOrdering;
+//! # use bdk_wallet::wallet::hardwaresigner::HWISigner;
+//! # use bdk_wallet::wallet::AddressIndex::New;
+//! # use bdk_wallet::{KeychainKind, SignOptions, Wallet};
//! # use hwi::HWIClient;
//! # use std::sync::Arc;
//! #
diff --git a/crates/bdk/src/wallet/mod.rs b/crates/wallet/src/wallet/mod.rs
similarity index 99%
rename from crates/bdk/src/wallet/mod.rs
rename to crates/wallet/src/wallet/mod.rs
index 146d4677e..61ec5893b 100644
--- a/crates/bdk/src/wallet/mod.rs
+++ b/crates/wallet/src/wallet/mod.rs
@@ -526,17 +526,17 @@ impl Wallet {
/// manually to the [`Wallet`]:
///
/// ```rust,no_run
- /// # use bdk::Wallet;
- /// # use bdk::signer::{SignersContainer, SignerOrdering};
- /// # use bdk::descriptor::Descriptor;
+ /// # use bdk_wallet::Wallet;
+ /// # use bdk_wallet::signer::{SignersContainer, SignerOrdering};
+ /// # use bdk_wallet::descriptor::Descriptor;
/// # use bitcoin::key::Secp256k1;
- /// # use bdk::KeychainKind;
+ /// # use bdk_wallet::KeychainKind;
/// # use bdk_file_store::Store;
/// #
/// # fn main() -> Result<(), anyhow::Error> {
/// # let temp_dir = tempfile::tempdir().expect("must create tempdir");
/// # let file_path = temp_dir.path().join("store.db");
- /// # let db: Store = Store::create_new(&[], &file_path).expect("must create db");
+ /// # let db: Store = Store::create_new(&[], &file_path).expect("must create db");
/// let secp = Secp256k1::new();
///
/// let (external_descriptor, external_keymap) = Descriptor::parse_descriptor(&secp, "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)").unwrap();
@@ -1052,7 +1052,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Txid;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let txid:Txid = todo!();
/// let tx = wallet.get_tx(txid).expect("transaction").tx_node.tx;
@@ -1061,7 +1061,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Psbt;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let mut psbt: Psbt = todo!();
/// let tx = &psbt.clone().extract_tx().expect("tx");
@@ -1083,7 +1083,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Txid;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let txid:Txid = todo!();
/// let tx = wallet.get_tx(txid).expect("transaction").tx_node.tx;
@@ -1092,7 +1092,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Psbt;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let mut psbt: Psbt = todo!();
/// let tx = &psbt.clone().extract_tx().expect("tx");
@@ -1114,7 +1114,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Txid;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let txid:Txid = todo!();
/// let tx = wallet.get_tx(txid).expect("tx exists").tx_node.tx;
@@ -1123,7 +1123,7 @@ impl Wallet {
///
/// ```rust, no_run
/// # use bitcoin::Psbt;
- /// # use bdk::Wallet;
+ /// # use bdk_wallet::Wallet;
/// # let mut wallet: Wallet = todo!();
/// # let mut psbt: Psbt = todo!();
/// let tx = &psbt.clone().extract_tx().expect("tx");
@@ -1144,8 +1144,8 @@ impl Wallet {
/// the transaction was last seen in the mempool is provided.
///
/// ```rust, no_run
- /// use bdk::{chain::ChainPosition, Wallet};
/// use bdk_chain::Anchor;
+ /// use bdk_wallet::{chain::ChainPosition, Wallet};
/// # let wallet: Wallet = todo!();
/// # let my_txid: bitcoin::Txid = todo!();
///
@@ -1311,8 +1311,8 @@ impl Wallet {
/// ## Example
///
/// ```
- /// # use bdk::{Wallet, KeychainKind};
- /// # use bdk::bitcoin::Network;
+ /// # use bdk_wallet::{Wallet, KeychainKind};
+ /// # use bdk_wallet::bitcoin::Network;
/// let wallet = Wallet::new_no_persist("wpkh(tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/0'/0'/0/*)", None, Network::Testnet)?;
/// for secret_key in wallet.get_signers(KeychainKind::External).signers().iter().filter_map(|s| s.descriptor_secret_key()) {
/// // secret_key: tprv8ZgxMBicQKsPe73PBRSmNbTfbcsZnwWhz5eVmhHpi31HW29Z7mc9B4cWGRQzopNUzZUT391DeDJxL2PefNunWyLgqCKRMDkU1s2s8bAfoSk/84'/0'/0'/0/*
@@ -1337,9 +1337,9 @@ impl Wallet {
/// ```
/// # use std::str::FromStr;
/// # use bitcoin::*;
- /// # use bdk::*;
- /// # use bdk::wallet::ChangeSet;
- /// # use bdk::wallet::error::CreateTxError;
+ /// # use bdk_wallet::*;
+ /// # use bdk_wallet::wallet::ChangeSet;
+ /// # use bdk_wallet::wallet::error::CreateTxError;
/// # use bdk_persist::PersistBackend;
/// # use anyhow::Error;
/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";
@@ -1714,9 +1714,9 @@ impl Wallet {
/// # // TODO: remove norun -- bumping fee seems to need the tx in the wallet database first.
/// # use std::str::FromStr;
/// # use bitcoin::*;
- /// # use bdk::*;
- /// # use bdk::wallet::ChangeSet;
- /// # use bdk::wallet::error::CreateTxError;
+ /// # use bdk_wallet::*;
+ /// # use bdk_wallet::wallet::ChangeSet;
+ /// # use bdk_wallet::wallet::error::CreateTxError;
/// # use bdk_persist::PersistBackend;
/// # use anyhow::Error;
/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";
@@ -1889,9 +1889,9 @@ impl Wallet {
/// ```
/// # use std::str::FromStr;
/// # use bitcoin::*;
- /// # use bdk::*;
- /// # use bdk::wallet::ChangeSet;
- /// # use bdk::wallet::error::CreateTxError;
+ /// # use bdk_wallet::*;
+ /// # use bdk_wallet::wallet::ChangeSet;
+ /// # use bdk_wallet::wallet::error::CreateTxError;
/// # use bdk_persist::PersistBackend;
/// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";
/// # let mut wallet = doctest_wallet!();
diff --git a/crates/bdk/src/wallet/signer.rs b/crates/wallet/src/wallet/signer.rs
similarity index 99%
rename from crates/bdk/src/wallet/signer.rs
rename to crates/wallet/src/wallet/signer.rs
index 4610657e2..51420caa3 100644
--- a/crates/bdk/src/wallet/signer.rs
+++ b/crates/wallet/src/wallet/signer.rs
@@ -19,8 +19,8 @@
//! # use core::str::FromStr;
//! # use bitcoin::secp256k1::{Secp256k1, All};
//! # use bitcoin::*;
-//! # use bdk::signer::*;
-//! # use bdk::*;
+//! # use bdk_wallet::signer::*;
+//! # use bdk_wallet::*;
//! # #[derive(Debug)]
//! # struct CustomHSM;
//! # impl CustomHSM {
diff --git a/crates/bdk/src/wallet/tx_builder.rs b/crates/wallet/src/wallet/tx_builder.rs
similarity index 98%
rename from crates/bdk/src/wallet/tx_builder.rs
rename to crates/wallet/src/wallet/tx_builder.rs
index 5c3e70d54..28b70a8bc 100644
--- a/crates/bdk/src/wallet/tx_builder.rs
+++ b/crates/wallet/src/wallet/tx_builder.rs
@@ -16,10 +16,10 @@
//! ```
//! # use std::str::FromStr;
//! # use bitcoin::*;
-//! # use bdk::*;
-//! # use bdk::wallet::ChangeSet;
-//! # use bdk::wallet::error::CreateTxError;
-//! # use bdk::wallet::tx_builder::CreateTx;
+//! # use bdk_wallet::*;
+//! # use bdk_wallet::wallet::ChangeSet;
+//! # use bdk_wallet::wallet::error::CreateTxError;
+//! # use bdk_wallet::wallet::tx_builder::CreateTx;
//! # use bdk_persist::PersistBackend;
//! # use anyhow::Error;
//! # let to_address = Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt").unwrap().assume_checked();
@@ -78,12 +78,12 @@ impl TxBuilderContext for BumpFee {}
/// as in the following example:
///
/// ```
-/// # use bdk::*;
-/// # use bdk::wallet::tx_builder::*;
+/// # use bdk_wallet::*;
+/// # use bdk_wallet::wallet::tx_builder::*;
/// # use bitcoin::*;
/// # use core::str::FromStr;
-/// # use bdk::wallet::ChangeSet;
-/// # use bdk::wallet::error::CreateTxError;
+/// # use bdk_wallet::wallet::ChangeSet;
+/// # use bdk_wallet::wallet::error::CreateTxError;
/// # use bdk_persist::PersistBackend;
/// # use anyhow::Error;
/// # let mut wallet = doctest_wallet!();
@@ -263,7 +263,7 @@ impl<'a, Cs, Ctx> TxBuilder<'a, Cs, Ctx> {
/// # use std::str::FromStr;
/// # use std::collections::BTreeMap;
/// # use bitcoin::*;
- /// # use bdk::*;
+ /// # use bdk_wallet::*;
/// # let to_address =
/// Address::from_str("2N4eQYCbKUHCCTUjBJeHcJp9ok6J2GZsTDt")
/// .unwrap()
@@ -759,10 +759,10 @@ impl<'a, Cs: CoinSelectionAlgorithm> TxBuilder<'a, Cs, CreateTx> {
/// ```
/// # use std::str::FromStr;
/// # use bitcoin::*;
- /// # use bdk::*;
- /// # use bdk::wallet::ChangeSet;
- /// # use bdk::wallet::error::CreateTxError;
- /// # use bdk::wallet::tx_builder::CreateTx;
+ /// # use bdk_wallet::*;
+ /// # use bdk_wallet::wallet::ChangeSet;
+ /// # use bdk_wallet::wallet::error::CreateTxError;
+ /// # use bdk_wallet::wallet::tx_builder::CreateTx;
/// # use bdk_persist::PersistBackend;
/// # use anyhow::Error;
/// # let to_address =
diff --git a/crates/bdk/src/wallet/utils.rs b/crates/wallet/src/wallet/utils.rs
similarity index 100%
rename from crates/bdk/src/wallet/utils.rs
rename to crates/wallet/src/wallet/utils.rs
diff --git a/crates/bdk/tests/common.rs b/crates/wallet/tests/common.rs
similarity index 99%
rename from crates/bdk/tests/common.rs
rename to crates/wallet/tests/common.rs
index ec421551f..a51dcafb3 100644
--- a/crates/bdk/tests/common.rs
+++ b/crates/wallet/tests/common.rs
@@ -1,8 +1,8 @@
#![allow(unused)]
-use bdk::{KeychainKind, LocalOutput, Wallet};
use bdk_chain::indexed_tx_graph::Indexer;
use bdk_chain::{BlockId, ConfirmationTime};
+use bdk_wallet::{KeychainKind, LocalOutput, Wallet};
use bitcoin::hashes::Hash;
use bitcoin::{
transaction, Address, Amount, BlockHash, FeeRate, Network, OutPoint, Transaction, TxIn, TxOut,
diff --git a/crates/bdk/tests/psbt.rs b/crates/wallet/tests/psbt.rs
similarity index 97%
rename from crates/bdk/tests/psbt.rs
rename to crates/wallet/tests/psbt.rs
index 820d2d1d1..3652f109e 100644
--- a/crates/bdk/tests/psbt.rs
+++ b/crates/wallet/tests/psbt.rs
@@ -1,5 +1,5 @@
-use bdk::bitcoin::{Amount, FeeRate, Psbt, TxIn};
-use bdk::{psbt, KeychainKind, SignOptions};
+use bdk_wallet::bitcoin::{Amount, FeeRate, Psbt, TxIn};
+use bdk_wallet::{psbt, KeychainKind, SignOptions};
use core::str::FromStr;
mod common;
use common::*;
@@ -156,8 +156,8 @@ fn test_psbt_fee_rate_with_missing_txout() {
#[test]
fn test_psbt_multiple_internalkey_signers() {
- use bdk::signer::{SignerContext, SignerOrdering, SignerWrapper};
- use bdk::KeychainKind;
+ use bdk_wallet::signer::{SignerContext, SignerOrdering, SignerWrapper};
+ use bdk_wallet::KeychainKind;
use bitcoin::key::TapTweak;
use bitcoin::secp256k1::{schnorr, Keypair, Message, Secp256k1, XOnlyPublicKey};
use bitcoin::sighash::{Prevouts, SighashCache, TapSighashType};
diff --git a/crates/bdk/tests/wallet.rs b/crates/wallet/tests/wallet.rs
similarity index 99%
rename from crates/bdk/tests/wallet.rs
rename to crates/wallet/tests/wallet.rs
index 9da65d542..58b25061d 100644
--- a/crates/bdk/tests/wallet.rs
+++ b/crates/wallet/tests/wallet.rs
@@ -1,18 +1,18 @@
use std::str::FromStr;
use assert_matches::assert_matches;
-use bdk::descriptor::{calc_checksum, IntoWalletDescriptor};
-use bdk::psbt::PsbtUtils;
-use bdk::signer::{SignOptions, SignerError};
-use bdk::wallet::coin_selection::{self, LargestFirstCoinSelection};
-use bdk::wallet::error::CreateTxError;
-use bdk::wallet::tx_builder::AddForeignUtxoError;
-use bdk::wallet::NewError;
-use bdk::wallet::{AddressInfo, Balance, Wallet};
-use bdk::KeychainKind;
use bdk_chain::collections::BTreeMap;
use bdk_chain::COINBASE_MATURITY;
use bdk_chain::{BlockId, ConfirmationTime};
+use bdk_wallet::descriptor::{calc_checksum, IntoWalletDescriptor};
+use bdk_wallet::psbt::PsbtUtils;
+use bdk_wallet::signer::{SignOptions, SignerError};
+use bdk_wallet::wallet::coin_selection::{self, LargestFirstCoinSelection};
+use bdk_wallet::wallet::error::CreateTxError;
+use bdk_wallet::wallet::tx_builder::AddForeignUtxoError;
+use bdk_wallet::wallet::NewError;
+use bdk_wallet::wallet::{AddressInfo, Balance, Wallet};
+use bdk_wallet::KeychainKind;
use bitcoin::hashes::Hash;
use bitcoin::key::Secp256k1;
use bitcoin::psbt;
@@ -137,7 +137,7 @@ fn new_or_load() {
assert!(
matches!(
err,
- bdk::wallet::NewOrLoadError::LoadedNetworkDoesNotMatch {
+ bdk_wallet::wallet::NewOrLoadError::LoadedNetworkDoesNotMatch {
got: Some(Network::Testnet),
expected: Network::Bitcoin
}
@@ -166,7 +166,7 @@ fn new_or_load() {
assert!(
matches!(
err,
- bdk::wallet::NewOrLoadError::LoadedGenesisDoesNotMatch { got, expected }
+ bdk_wallet::wallet::NewOrLoadError::LoadedGenesisDoesNotMatch { got, expected }
if got == Some(got_blockhash) && expected == exp_blockhash
),
"err: {}",
@@ -189,7 +189,7 @@ fn new_or_load() {
assert!(
matches!(
err,
- bdk::wallet::NewOrLoadError::LoadedDescriptorDoesNotMatch { ref got, keychain }
+ bdk_wallet::wallet::NewOrLoadError::LoadedDescriptorDoesNotMatch { ref got, keychain }
if got == &Some(got_descriptor) && keychain == KeychainKind::External
),
"err: {}",
@@ -209,7 +209,7 @@ fn new_or_load() {
assert!(
matches!(
err,
- bdk::wallet::NewOrLoadError::LoadedDescriptorDoesNotMatch { ref got, keychain }
+ bdk_wallet::wallet::NewOrLoadError::LoadedDescriptorDoesNotMatch { ref got, keychain }
if got == &got_descriptor && keychain == KeychainKind::Internal
),
"err: {}",
@@ -791,7 +791,7 @@ fn test_create_tx_absolute_high_fee() {
#[test]
fn test_create_tx_add_change() {
- use bdk::wallet::tx_builder::TxOrdering;
+ use bdk_wallet::wallet::tx_builder::TxOrdering;
let (mut wallet, _) = get_funded_wallet(get_test_wpkh());
let addr = wallet.next_unused_address(KeychainKind::External).unwrap();
@@ -846,7 +846,7 @@ fn test_create_tx_ordering_respected() {
builder
.add_recipient(addr.script_pubkey(), Amount::from_sat(30_000))
.add_recipient(addr.script_pubkey(), Amount::from_sat(10_000))
- .ordering(bdk::wallet::tx_builder::TxOrdering::Bip69Lexicographic);
+ .ordering(bdk_wallet::wallet::tx_builder::TxOrdering::Bip69Lexicographic);
let psbt = builder.finish().unwrap();
let fee = check_fee!(wallet, psbt);
@@ -2951,7 +2951,7 @@ fn test_sending_to_bip350_bech32m_address() {
#[test]
fn test_get_address() {
- use bdk::descriptor::template::Bip84;
+ use bdk_wallet::descriptor::template::Bip84;
let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy").unwrap();
let wallet = Wallet::new_no_persist(
Bip84(key, KeychainKind::External),
@@ -3022,7 +3022,7 @@ fn test_reveal_addresses() {
#[test]
fn test_get_address_no_reuse_single_descriptor() {
- use bdk::descriptor::template::Bip84;
+ use bdk_wallet::descriptor::template::Bip84;
use std::collections::HashSet;
let key = bitcoin::bip32::Xpriv::from_str("tprv8ZgxMBicQKsPcx5nBGsR63Pe8KnRUqmbJNENAfGftF3yuXoMMoVJJcYeUw5eVkm9WBPjWYt6HMWYJNesB5HaNVBaFc1M6dRjWSYnmewUMYy").unwrap();
@@ -3384,7 +3384,7 @@ fn test_taproot_script_spend() {
#[test]
fn test_taproot_script_spend_sign_all_leaves() {
- use bdk::signer::TapLeavesOptions;
+ use bdk_wallet::signer::TapLeavesOptions;
let (mut wallet, _) = get_funded_wallet(get_test_tr_with_taptree_both_priv());
let addr = wallet.next_unused_address(KeychainKind::External).unwrap();
@@ -3413,7 +3413,7 @@ fn test_taproot_script_spend_sign_all_leaves() {
#[test]
fn test_taproot_script_spend_sign_include_some_leaves() {
- use bdk::signer::TapLeavesOptions;
+ use bdk_wallet::signer::TapLeavesOptions;
use bitcoin::taproot::TapLeafHash;
let (mut wallet, _) = get_funded_wallet(get_test_tr_with_taptree_both_priv());
@@ -3453,7 +3453,7 @@ fn test_taproot_script_spend_sign_include_some_leaves() {
#[test]
fn test_taproot_script_spend_sign_exclude_some_leaves() {
- use bdk::signer::TapLeavesOptions;
+ use bdk_wallet::signer::TapLeavesOptions;
use bitcoin::taproot::TapLeafHash;
let (mut wallet, _) = get_funded_wallet(get_test_tr_with_taptree_both_priv());
@@ -3493,7 +3493,7 @@ fn test_taproot_script_spend_sign_exclude_some_leaves() {
#[test]
fn test_taproot_script_spend_sign_no_leaves() {
- use bdk::signer::TapLeavesOptions;
+ use bdk_wallet::signer::TapLeavesOptions;
let (mut wallet, _) = get_funded_wallet(get_test_tr_with_taptree_both_priv());
let addr = wallet.next_unused_address(KeychainKind::External).unwrap();
diff --git a/example-crates/wallet_electrum/Cargo.toml b/example-crates/wallet_electrum/Cargo.toml
index 847cd90d6..2f562837f 100644
--- a/example-crates/wallet_electrum/Cargo.toml
+++ b/example-crates/wallet_electrum/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.2.0"
edition = "2021"
[dependencies]
-bdk = { path = "../../crates/bdk" }
+bdk_wallet = { path = "../../crates/wallet" }
bdk_electrum = { path = "../../crates/electrum" }
bdk_file_store = { path = "../../crates/file_store" }
anyhow = "1"
diff --git a/example-crates/wallet_electrum/src/main.rs b/example-crates/wallet_electrum/src/main.rs
index eca96f32a..c411713ff 100644
--- a/example-crates/wallet_electrum/src/main.rs
+++ b/example-crates/wallet_electrum/src/main.rs
@@ -6,19 +6,20 @@ const BATCH_SIZE: usize = 5;
use std::io::Write;
use std::str::FromStr;
-use bdk::bitcoin::{Address, Amount};
-use bdk::chain::collections::HashSet;
-use bdk::{bitcoin::Network, Wallet};
-use bdk::{KeychainKind, SignOptions};
use bdk_electrum::{
electrum_client::{self, ElectrumApi},
ElectrumExt,
};
use bdk_file_store::Store;
+use bdk_wallet::bitcoin::{Address, Amount};
+use bdk_wallet::chain::collections::HashSet;
+use bdk_wallet::{bitcoin::Network, Wallet};
+use bdk_wallet::{KeychainKind, SignOptions};
fn main() -> Result<(), anyhow::Error> {
let db_path = std::env::temp_dir().join("bdk-electrum-example");
- let db = Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
+ let db =
+ Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
let external_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)";
let internal_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)";
diff --git a/example-crates/wallet_esplora_async/Cargo.toml b/example-crates/wallet_esplora_async/Cargo.toml
index c588a87aa..803c0fd3f 100644
--- a/example-crates/wallet_esplora_async/Cargo.toml
+++ b/example-crates/wallet_esplora_async/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-bdk = { path = "../../crates/bdk" }
+bdk_wallet = { path = "../../crates/wallet" }
bdk_esplora = { path = "../../crates/esplora", features = ["async-https"] }
bdk_file_store = { path = "../../crates/file_store" }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
diff --git a/example-crates/wallet_esplora_async/src/main.rs b/example-crates/wallet_esplora_async/src/main.rs
index 7664ec32e..22fb8b2d3 100644
--- a/example-crates/wallet_esplora_async/src/main.rs
+++ b/example-crates/wallet_esplora_async/src/main.rs
@@ -1,11 +1,11 @@
use std::{collections::BTreeSet, io::Write, str::FromStr};
-use bdk::{
+use bdk_esplora::{esplora_client, EsploraAsyncExt};
+use bdk_file_store::Store;
+use bdk_wallet::{
bitcoin::{Address, Amount, Network, Script},
KeychainKind, SignOptions, Wallet,
};
-use bdk_esplora::{esplora_client, EsploraAsyncExt};
-use bdk_file_store::Store;
const DB_MAGIC: &str = "bdk_wallet_esplora_async_example";
const SEND_AMOUNT: Amount = Amount::from_sat(5000);
@@ -15,7 +15,8 @@ const PARALLEL_REQUESTS: usize = 5;
#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
let db_path = std::env::temp_dir().join("bdk-esplora-async-example");
- let db = Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
+ let db =
+ Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
let external_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)";
let internal_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)";
diff --git a/example-crates/wallet_esplora_blocking/Cargo.toml b/example-crates/wallet_esplora_blocking/Cargo.toml
index 0679bd8f3..857660acf 100644
--- a/example-crates/wallet_esplora_blocking/Cargo.toml
+++ b/example-crates/wallet_esplora_blocking/Cargo.toml
@@ -7,7 +7,7 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-bdk = { path = "../../crates/bdk" }
+bdk_wallet = { path = "../../crates/wallet" }
bdk_esplora = { path = "../../crates/esplora", features = ["blocking"] }
bdk_file_store = { path = "../../crates/file_store" }
anyhow = "1"
diff --git a/example-crates/wallet_esplora_blocking/src/main.rs b/example-crates/wallet_esplora_blocking/src/main.rs
index 4d713156a..f42cb9d82 100644
--- a/example-crates/wallet_esplora_blocking/src/main.rs
+++ b/example-crates/wallet_esplora_blocking/src/main.rs
@@ -5,16 +5,17 @@ const PARALLEL_REQUESTS: usize = 1;
use std::{collections::BTreeSet, io::Write, str::FromStr};
-use bdk::{
+use bdk_esplora::{esplora_client, EsploraExt};
+use bdk_file_store::Store;
+use bdk_wallet::{
bitcoin::{Address, Amount, Network},
KeychainKind, SignOptions, Wallet,
};
-use bdk_esplora::{esplora_client, EsploraExt};
-use bdk_file_store::Store;
fn main() -> Result<(), anyhow::Error> {
let db_path = std::env::temp_dir().join("bdk-esplora-example");
- let db = Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
+ let db =
+ Store::::open_or_create_new(DB_MAGIC.as_bytes(), db_path)?;
let external_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/0/*)";
let internal_descriptor = "wpkh(tprv8ZgxMBicQKsPdy6LMhUtFHAgpocR8GC6QmwMSFpZs7h6Eziw3SpThFfczTDh5rW2krkqffa11UpX3XkeTTB2FvzZKWXqPY54Y6Rq4AQ5R8L/84'/1'/0'/1/*)";
diff --git a/example-crates/wallet_rpc/Cargo.toml b/example-crates/wallet_rpc/Cargo.toml
index 174144e9b..b7a9a9e47 100644
--- a/example-crates/wallet_rpc/Cargo.toml
+++ b/example-crates/wallet_rpc/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-bdk = { path = "../../crates/bdk" }
+bdk_wallet = { path = "../../crates/wallet" }
bdk_file_store = { path = "../../crates/file_store" }
bdk_bitcoind_rpc = { path = "../../crates/bitcoind_rpc" }
diff --git a/example-crates/wallet_rpc/README.md b/example-crates/wallet_rpc/README.md
index 03c1b0f56..28eb07b1f 100644
--- a/example-crates/wallet_rpc/README.md
+++ b/example-crates/wallet_rpc/README.md
@@ -4,7 +4,7 @@
$ cargo run --bin wallet_rpc -- --help
wallet_rpc 0.1.0
-Bitcoind RPC example using `bdk::Wallet`
+Bitcoind RPC example using `bdk_wallet::Wallet`
USAGE:
wallet_rpc [OPTIONS] [CHANGE_DESCRIPTOR]
diff --git a/example-crates/wallet_rpc/src/main.rs b/example-crates/wallet_rpc/src/main.rs
index 264204a71..3bdd515c3 100644
--- a/example-crates/wallet_rpc/src/main.rs
+++ b/example-crates/wallet_rpc/src/main.rs
@@ -1,18 +1,18 @@
-use bdk::{
- bitcoin::{Block, Network, Transaction},
- wallet::Wallet,
-};
use bdk_bitcoind_rpc::{
bitcoincore_rpc::{Auth, Client, RpcApi},
Emitter,
};
use bdk_file_store::Store;
+use bdk_wallet::{
+ bitcoin::{Block, Network, Transaction},
+ wallet::Wallet,
+};
use clap::{self, Parser};
use std::{path::PathBuf, sync::mpsc::sync_channel, thread::spawn, time::Instant};
const DB_MAGIC: &str = "bdk-rpc-wallet-example";
-/// Bitcoind RPC example using `bdk::Wallet`.
+/// Bitcoind RPC example using `bdk_wallet::Wallet`.
///
/// This syncs the chain block-by-block and prints the current balance, transaction count and UTXO
/// count.
@@ -89,7 +89,10 @@ fn main() -> anyhow::Result<()> {
let mut wallet = Wallet::new_or_load(
&args.descriptor,
args.change_descriptor.as_ref(),
- Store::::open_or_create_new(DB_MAGIC.as_bytes(), args.db_path)?,
+ Store::::open_or_create_new(
+ DB_MAGIC.as_bytes(),
+ args.db_path,
+ )?,
args.network,
)?;
println!(