bdkffi::descriptor

Struct Descriptor

Source
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: KeyMap

Implementations§

Source§

impl Descriptor

Source

pub fn new( descriptor: String, network: Network, ) -> Result<Self, DescriptorError>

Parse a string as a descriptor for the given network.

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn to_string_with_secret(&self) -> String

Dangerously convert the descriptor to a string.

Source

pub fn is_multipath(&self) -> bool

Does this descriptor contain paths: https://github.com/bitcoin/bips/blob/master/bip-0389.mediawiki

Source

pub fn descriptor_id(&self) -> Arc<DescriptorId>

A unique identifier for the descriptor.

Source

pub fn to_single_descriptors( &self, ) -> Result<Vec<Arc<Descriptor>>, MiniscriptError>

Return descriptors for all valid paths.

Source

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.

Source

pub fn desc_type(&self) -> DescriptorType

Source

pub fn derive_address( &self, index: u32, network: Network, ) -> Result<Arc<Address>, DescriptorError>

Trait Implementations§

Source§

impl Debug for Descriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Descriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<UT> LiftRef<UT> for Descriptor

Source§

impl<UT> LowerError<UT> for Descriptor

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for Descriptor

Source§

type ReturnType = <Arc<Descriptor> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for Descriptor

Source§

const TYPE_ID_META: MetadataBuffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V