use bdk::bitcoin::blockdata::script::Script as BdkScript; use bdk::bitcoin::hashes::hex::ToHex; use bdk::bitcoin::secp256k1::Secp256k1; use bdk::bitcoin::util::bip32::DerivationPath as BdkDerivationPath; use bdk::bitcoin::util::psbt::serialize::Serialize; use bdk::bitcoin::util::psbt::PartiallySignedTransaction; use bdk::bitcoin::Sequence; use bdk::bitcoin::{Address as BdkAddress, Network, OutPoint as BdkOutPoint, Txid}; use bdk::blockchain::any::{AnyBlockchain, AnyBlockchainConfig}; use bdk::blockchain::GetBlockHash; use bdk::blockchain::GetHeight; use bdk::blockchain::{ electrum::ElectrumBlockchainConfig, esplora::EsploraBlockchainConfig, ConfigurableBlockchain, }; use bdk::blockchain::{Blockchain as BdkBlockchain, Progress as BdkProgress}; use bdk::database::any::{AnyDatabase, SledDbConfiguration, SqliteDbConfiguration}; use bdk::database::{AnyDatabaseConfig, ConfigurableDatabase}; use bdk::descriptor::DescriptorXKey; use bdk::keys::bip39::{Language, Mnemonic as BdkMnemonic, WordCount}; use bdk::keys::{ DerivableKey, DescriptorPublicKey as BdkDescriptorPublicKey, DescriptorSecretKey as BdkDescriptorSecretKey, ExtendedKey, GeneratableKey, GeneratedKey, }; use bdk::miniscript::BareCtx; use bdk::wallet::tx_builder::ChangeSpendPolicy; use bdk::wallet::AddressIndex as BdkAddressIndex; use bdk::wallet::AddressInfo as BdkAddressInfo; use bdk::{ Balance as BdkBalance, BlockTime, Error as BdkError, FeeRate, KeychainKind, SignOptions, SyncOptions as BdkSyncOptions, Wallet as BdkWallet, }; use std::collections::HashSet; use std::convert::{From, TryFrom}; use std::fmt; use std::ops::Deref; use std::str::FromStr; use std::sync::{Arc, Mutex, MutexGuard}; uniffi_macros::include_scaffolding!("bdk"); /// A output script and an amount of satoshis. pub struct ScriptAmount { pub script: Arc