pub struct Descriptor {
pub extended_descriptor: ExtendedDescriptor,
pub key_map: KeyMap,
}Expand description
An expression of how to derive output scripts: https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md
Fields§
§extended_descriptor: ExtendedDescriptor§key_map: KeyMapImplementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn new(
descriptor: String,
network: Network,
) -> Result<Self, DescriptorError>
pub fn new( descriptor: String, network: Network, ) -> Result<Self, DescriptorError>
Parse a string as a descriptor for the given network.
Sourcepub fn new_bip44(
secret_key: &DescriptorSecretKey,
keychain_kind: KeychainKind,
network: Network,
) -> Self
pub fn new_bip44( secret_key: &DescriptorSecretKey, keychain_kind: KeychainKind, network: Network, ) -> Self
Multi-account hierarchy descriptor: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
Sourcepub fn new_bip44_public(
public_key: &DescriptorPublicKey,
fingerprint: String,
keychain_kind: KeychainKind,
network: Network,
) -> Result<Self, DescriptorError>
pub fn new_bip44_public( public_key: &DescriptorPublicKey, fingerprint: String, keychain_kind: KeychainKind, network: Network, ) -> Result<Self, DescriptorError>
Multi-account hierarchy descriptor: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
Sourcepub fn new_bip49(
secret_key: &DescriptorSecretKey,
keychain_kind: KeychainKind,
network: Network,
) -> Self
pub fn new_bip49( secret_key: &DescriptorSecretKey, keychain_kind: KeychainKind, network: Network, ) -> Self
P2SH nested P2WSH descriptor: https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki
Sourcepub fn new_bip49_public(
public_key: &DescriptorPublicKey,
fingerprint: String,
keychain_kind: KeychainKind,
network: Network,
) -> Result<Self, DescriptorError>
pub fn new_bip49_public( public_key: &DescriptorPublicKey, fingerprint: String, keychain_kind: KeychainKind, network: Network, ) -> Result<Self, DescriptorError>
P2SH nested P2WSH descriptor: https://github.com/bitcoin/bips/blob/master/bip-0049.mediawiki
Sourcepub fn new_bip84(
secret_key: &DescriptorSecretKey,
keychain_kind: KeychainKind,
network: Network,
) -> Self
pub fn new_bip84( secret_key: &DescriptorSecretKey, keychain_kind: KeychainKind, network: Network, ) -> Self
Pay to witness PKH descriptor: https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
Sourcepub fn new_bip84_public(
public_key: &DescriptorPublicKey,
fingerprint: String,
keychain_kind: KeychainKind,
network: Network,
) -> Result<Self, DescriptorError>
pub fn new_bip84_public( public_key: &DescriptorPublicKey, fingerprint: String, keychain_kind: KeychainKind, network: Network, ) -> Result<Self, DescriptorError>
Pay to witness PKH descriptor: https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki
Sourcepub fn new_bip86(
secret_key: &DescriptorSecretKey,
keychain_kind: KeychainKind,
network: Network,
) -> Self
pub fn new_bip86( secret_key: &DescriptorSecretKey, keychain_kind: KeychainKind, network: Network, ) -> Self
Single key P2TR descriptor: https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki
Sourcepub fn new_bip86_public(
public_key: &DescriptorPublicKey,
fingerprint: String,
keychain_kind: KeychainKind,
network: Network,
) -> Result<Self, DescriptorError>
pub fn new_bip86_public( public_key: &DescriptorPublicKey, fingerprint: String, keychain_kind: KeychainKind, network: Network, ) -> Result<Self, DescriptorError>
Single key P2TR descriptor: https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki
Sourcepub fn to_string_with_secret(&self) -> String
pub fn to_string_with_secret(&self) -> String
Dangerously convert the descriptor to a string.
Sourcepub fn is_multipath(&self) -> bool
pub fn is_multipath(&self) -> bool
Does this descriptor contain paths: https://github.com/bitcoin/bips/blob/master/bip-0389.mediawiki
Sourcepub fn descriptor_id(&self) -> Arc<DescriptorId>
pub fn descriptor_id(&self) -> Arc<DescriptorId>
A unique identifier for the descriptor.
Sourcepub fn to_single_descriptors(
&self,
) -> Result<Vec<Arc<Descriptor>>, MiniscriptError>
pub fn to_single_descriptors( &self, ) -> Result<Vec<Arc<Descriptor>>, MiniscriptError>
Return descriptors for all valid paths.
Sourcepub fn max_weight_to_satisfy(&self) -> Result<u64, DescriptorError>
pub fn max_weight_to_satisfy(&self) -> Result<u64, DescriptorError>
Computes an upper bound on the difference between a non-satisfied TxIn’s
segwit_weight and a satisfied TxIn’s segwit_weight.
pub fn desc_type(&self) -> DescriptorType
pub fn derive_address( &self, index: u32, network: Network, ) -> Result<Arc<Address>, DescriptorError>
Trait Implementations§
Source§impl Debug for Descriptor
impl Debug for Descriptor
Source§impl Display for Descriptor
impl Display for Descriptor
Source§impl<UT> LiftRef<UT> for Descriptor
impl<UT> LiftRef<UT> for Descriptor
type LiftType = Arc<Descriptor>
Source§impl<UT> LowerError<UT> for Descriptor
impl<UT> LowerError<UT> for Descriptor
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for Descriptor
impl<UT> LowerReturn<UT> for Descriptor
Source§type ReturnType = <Arc<Descriptor> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<Descriptor> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for Descriptor
impl<UT> TypeId<UT> for Descriptor
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnwindSafe for Descriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more