Create a new non-persisted wallet from given wallet configuration options.
(network: Network, wallet_opts: &WalletOpts)
| 303 | #[cfg(not(any(feature = "sqlite", feature = "redb")))] |
| 304 | /// Create a new non-persisted wallet from given wallet configuration options. |
| 305 | pub(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")] |
| 326 | pub async fn trace_logger( |