use std::cell::RefCell; use std::collections::BTreeMap; use std::convert::{Into, TryFrom}; use std::fmt; use std::str::FromStr; use bitcoin::blockdata::script::Script; use bitcoin::hashes::{hash160, Hash}; use bitcoin::secp256k1::{All, Secp256k1}; use bitcoin::util::bip32::{DerivationPath, ExtendedPrivKey, Fingerprint}; use bitcoin::{PrivateKey, PublicKey}; pub use miniscript::descriptor::Descriptor; use serde::{Deserialize, Serialize}; pub mod error; pub mod extended_key; pub use self::error::Error; pub use self::extended_key::{DerivationIndex, DescriptorExtendedKey}; #[derive(Debug, Clone, Hash, PartialEq, PartialOrd, Eq, Ord, Default)] struct DummyKey(); impl fmt::Display for DummyKey { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "DummyKey") } } impl std::str::FromStr for DummyKey { type Err = (); fn from_str(_: &str) -> Result { Ok(DummyKey::default()) } } impl miniscript::MiniscriptKey for DummyKey { type Hash = DummyKey; fn to_pubkeyhash(&self) -> DummyKey { DummyKey::default() } } pub type DerivedDescriptor = Descriptor; pub type StringDescriptor = Descriptor; pub trait DescriptorMeta { fn is_witness(&self) -> bool; fn psbt_redeem_script(&self) -> Option