MCPcopy Create free account
hub / github.com/bitcoindevkit/bdk-cli / new_wallet

Function new_wallet

src/utils.rs:305–323  ·  view source on GitHub ↗

Create a new non-persisted wallet from given wallet configuration options.

(network: Network, wallet_opts: &WalletOpts)

Source from the content-addressed store, hash-verified

303#[cfg(not(any(feature = "sqlite", feature = "redb")))]
304/// Create a new non-persisted wallet from given wallet configuration options.
305pub(crate) fn new_wallet(network: Network, wallet_opts: &WalletOpts) -> Result<Wallet, Error> {
306 let ext_descriptor = wallet_opts.ext_descriptor.clone();
307 let int_descriptor = wallet_opts.int_descriptor.clone();
308
309 match int_descriptor {
310 Some(int_descriptor) => {
311 let wallet = Wallet::create(ext_descriptor, int_descriptor)
312 .network(network)
313 .create_wallet_no_persist()?;
314 Ok(wallet)
315 }
316 None => {
317 let wallet = Wallet::create_single(ext_descriptor)
318 .network(network)
319 .create_wallet_no_persist()?;
320 Ok(wallet)
321 }
322 }
323}
324
325#[cfg(feature = "cbf")]
326pub async fn trace_logger(

Callers 1

handle_commandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected