From: github-actions Date: Fri, 16 Dec 2022 22:03:02 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/static/struct.UniformInt.html?a=commitdiff_plain;h=5f095b403a42fabe1fea1dc91bbb5da375892708;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/index.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/index.html index 4b6d33c4e1..9094d8b362 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/index.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/index.html @@ -1,5 +1,5 @@ bdk::descriptor::template - Rust

Module bdk::descriptor::template

source ·
Expand description

Descriptor templates

+ logo

Module template

Module bdk::descriptor::template

source ·
Expand description

Descriptor templates

This module contains the definition of various common script templates that are ready to be used. See the documentation of each template for an example.

Structs

BIP44 template. Expands to pkh(key/44'/{0,1}'/0'/{0,1}/*)
BIP44 public template. Expands to pkh(key/{0,1}/*)
BIP49 template. Expands to sh(wpkh(key/49'/{0,1}'/0'/{0,1}/*))
BIP49 public template. Expands to sh(wpkh(key/{0,1}/*))
BIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)
BIP84 public template. Expands to wpkh(key/{0,1}/*)
P2PKH template. Expands to a descriptor pkh(key)
P2WPKH template. Expands to a descriptor wpkh(key)
P2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))

Traits

Trait for descriptor templates that can be built into a full descriptor

Type Definitions

Type alias for the return type of DescriptorTemplate, descriptor! and others
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip44Public.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip44Public.html index 92b5ef6df0..ab747889bc 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip44Public.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip44Public.html @@ -17,8 +17,8 @@ for the key.

)?; assert_eq!(wallet.get_address(New)?.to_string(), "miNG7dJTzJqNbFS19svRdTCisC65dsubtR"); -assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)#xgaaevjx");
-

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/1'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)#cfhumdqz");
+

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49.html index 943a9f9dbe..f34bbe0bf8 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49.html @@ -1,5 +1,5 @@ Bip49 in bdk::descriptor::template - Rust

Struct bdk::descriptor::template::Bip49

source ·
pub struct Bip49<K: DerivableKey<Segwitv0>>(pub K, pub KeychainKind);
Expand description

BIP49 template. Expands to sh(wpkh(key/49'/{0,1}'/0'/{0,1}/*))

+ logo

Bip49

Struct bdk::descriptor::template::Bip49

source ·
pub struct Bip49<K: DerivableKey<Segwitv0>>(pub K, pub KeychainKind);
Expand description

BIP49 template. Expands to sh(wpkh(key/49'/{0,1}'/0'/{0,1}/*))

Since there are hardened derivation steps, this template requires a private derivable key (generally a xprv/tprv).

See Bip49Public for a template that can work with a xpub/tpub.

Example

@@ -15,7 +15,7 @@ assert_eq!(wallet.get_address(New)?.to_string(), "2N4zkWAoGdUv4NXhSsU8DvS5MB36T8nKHEB"); assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49'/1'/0']tpubDDYr4kdnZgjjShzYNjZUZXUUtpXaofdkMaipyS8ThEh45qFmhT4hKYways7UXmg6V7het1QiFo9kf4kYUXyDvV4rHEyvSpys9pjCB3pukxi/0/*))#s9vxlc8e");
-

Tuple Fields§

§0: K§1: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Tuple Fields§

§0: K§1: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49Public.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49Public.html index 8e60c774ee..8ef34fbc45 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49Public.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip49Public.html @@ -1,5 +1,5 @@ Bip49Public in bdk::descriptor::template - Rust
pub struct Bip49Public<K: DerivableKey<Segwitv0>>(pub K, pub Fingerprint, pub KeychainKind);
Expand description

BIP49 public template. Expands to sh(wpkh(key/{0,1}/*))

+ logo

Bip49Public

pub struct Bip49Public<K: DerivableKey<Segwitv0>>(pub K, pub Fingerprint, pub KeychainKind);
Expand description

BIP49 public template. Expands to sh(wpkh(key/{0,1}/*))

This assumes that the key used has already been derived with m/49'/0'/0'.

This template requires the parent fingerprint to populate correctly the metadata of PSBTs.

See Bip49 for a template that does the full derivation, but requires private data @@ -17,8 +17,8 @@ for the key.

)?; assert_eq!(wallet.get_address(New)?.to_string(), "2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt"); -assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49'/0'/0']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))#gsmdv4xr");
-

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49'/1'/0']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))#3tka9g0q");
+

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84.html index f19fb0ef2e..f1d69371d9 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84.html @@ -1,5 +1,5 @@ Bip84 in bdk::descriptor::template - Rust

Struct bdk::descriptor::template::Bip84

source ·
pub struct Bip84<K: DerivableKey<Segwitv0>>(pub K, pub KeychainKind);
Expand description

BIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)

+ logo

Bip84

Struct bdk::descriptor::template::Bip84

source ·
pub struct Bip84<K: DerivableKey<Segwitv0>>(pub K, pub KeychainKind);
Expand description

BIP84 template. Expands to wpkh(key/84'/{0,1}'/0'/{0,1}/*)

Since there are hardened derivation steps, this template requires a private derivable key (generally a xprv/tprv).

See Bip84Public for a template that can work with a xpub/tpub.

Example

@@ -15,7 +15,7 @@ assert_eq!(wallet.get_address(New)?.to_string(), "tb1qhl85z42h7r4su5u37rvvw0gk8j2t3n9y7zsg4n"); assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84'/1'/0']tpubDDc5mum24DekpNw92t6fHGp8Gr2JjF9J7i4TZBtN6Vp8xpAULG5CFaKsfugWa5imhrQQUZKXe261asP5koDHo5bs3qNTmf3U3o4v9SaB8gg/0/*)#6kfecsmr");
-

Tuple Fields§

§0: K§1: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+

Tuple Fields§

§0: K§1: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84Public.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84Public.html index 114ce642f7..bb35801fe7 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84Public.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/struct.Bip84Public.html @@ -1,5 +1,5 @@ Bip84Public in bdk::descriptor::template - Rust
pub struct Bip84Public<K: DerivableKey<Segwitv0>>(pub K, pub Fingerprint, pub KeychainKind);
Expand description

BIP84 public template. Expands to wpkh(key/{0,1}/*)

+ logo

Bip84Public

pub struct Bip84Public<K: DerivableKey<Segwitv0>>(pub K, pub Fingerprint, pub KeychainKind);
Expand description

BIP84 public template. Expands to wpkh(key/{0,1}/*)

This assumes that the key used has already been derived with m/84'/0'/0'.

This template requires the parent fingerprint to populate correctly the metadata of PSBTs.

See Bip84 for a template that does the full derivation, but requires private data @@ -17,8 +17,8 @@ for the key.

)?; assert_eq!(wallet.get_address(New)?.to_string(), "tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7"); -assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)#nkk5dtkg");
-

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

+assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84'/1'/0']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)#dhu402yv");
+

Tuple Fields§

§0: K§1: Fingerprint§2: KeychainKind

Trait Implementations§

Build the complete descriptor

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/trait.DescriptorTemplate.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/trait.DescriptorTemplate.html index 2d8134b0c2..70b22c9a4a 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/trait.DescriptorTemplate.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk/descriptor/template/trait.DescriptorTemplate.html @@ -19,4 +19,4 @@ passed directly to the Wallet

Required Methods§

Build the complete descriptor

-

Implementors§

\ No newline at end of file +

Implementors§

\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/descriptor/template.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/descriptor/template.rs.html index 0555c4adc1..efd38be009 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/descriptor/template.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk/descriptor/template.rs.html @@ -765,6 +765,19 @@ 764 765 766 +767 +768 +769 +770 +771 +772 +773 +774 +775 +776 +777 +778 +779
// Bitcoin Dev Kit
 // Written in 2020 by Alekos Filini <alekos.filini@gmail.com>
 //
@@ -1002,14 +1015,17 @@
 /// )?;
 ///
 /// assert_eq!(wallet.get_address(New)?.to_string(), "miNG7dJTzJqNbFS19svRdTCisC65dsubtR");
-/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/0'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)#xgaaevjx");
+/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "pkh([c55b303f/44'/1'/0']tpubDDDzQ31JkZB7VxUr9bjvBivDdqoFLrDPyLWtLapArAi51ftfmCb2DPxwLQzX65iNcXz1DGaVvyvo6JQ6rTU73r2gqdEo8uov9QKRb7nKCSU/0/*)#cfhumdqz");
 /// # Ok::<_, Box<dyn std::error::Error>>(())
 /// ```
 pub struct Bip44Public<K: DerivableKey<Legacy>>(pub K, pub bip32::Fingerprint, pub KeychainKind);
 
 impl<K: DerivableKey<Legacy>> DescriptorTemplate for Bip44Public<K> {
     fn build(self, network: Network) -> Result<DescriptorTemplateOut, DescriptorError> {
-        P2Pkh(legacy::make_bipxx_public(44, self.0, self.1, self.2)?).build(network)
+        P2Pkh(legacy::make_bipxx_public(
+            44, self.0, self.1, self.2, network,
+        )?)
+        .build(network)
     }
 }
 
@@ -1078,14 +1094,17 @@
 /// )?;
 ///
 /// assert_eq!(wallet.get_address(New)?.to_string(), "2N3K4xbVAHoiTQSwxkZjWDfKoNC27pLkYnt");
-/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49'/0'/0']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))#gsmdv4xr");
+/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "sh(wpkh([c55b303f/49'/1'/0']tpubDC49r947KGK52X5rBWS4BLs5m9SRY3pYHnvRrm7HcybZ3BfdEsGFyzCMzayi1u58eT82ZeyFZwH7DD6Q83E3fM9CpfMtmnTygnLfP59jL9L/0/*))#3tka9g0q");
 /// # Ok::<_, Box<dyn std::error::Error>>(())
 /// ```
 pub struct Bip49Public<K: DerivableKey<Segwitv0>>(pub K, pub bip32::Fingerprint, pub KeychainKind);
 
 impl<K: DerivableKey<Segwitv0>> DescriptorTemplate for Bip49Public<K> {
     fn build(self, network: Network) -> Result<DescriptorTemplateOut, DescriptorError> {
-        P2Wpkh_P2Sh(segwit_v0::make_bipxx_public(49, self.0, self.1, self.2)?).build(network)
+        P2Wpkh_P2Sh(segwit_v0::make_bipxx_public(
+            49, self.0, self.1, self.2, network,
+        )?)
+        .build(network)
     }
 }
 
@@ -1154,14 +1173,17 @@
 /// )?;
 ///
 /// assert_eq!(wallet.get_address(New)?.to_string(), "tb1qedg9fdlf8cnnqfd5mks6uz5w4kgpk2pr6y4qc7");
-/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84\'/0\'/0\']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)#nkk5dtkg");
+/// assert_eq!(wallet.public_descriptor(KeychainKind::External)?.unwrap().to_string(), "wpkh([c55b303f/84'/1'/0']tpubDC2Qwo2TFsaNC4ju8nrUJ9mqVT3eSgdmy1yPqhgkjwmke3PRXutNGRYAUo6RCHTcVQaDR3ohNU9we59brGHuEKPvH1ags2nevW5opEE9Z5Q/0/*)#dhu402yv");
 /// # Ok::<_, Box<dyn std::error::Error>>(())
 /// ```
 pub struct Bip84Public<K: DerivableKey<Segwitv0>>(pub K, pub bip32::Fingerprint, pub KeychainKind);
 
 impl<K: DerivableKey<Segwitv0>> DescriptorTemplate for Bip84Public<K> {
     fn build(self, network: Network) -> Result<DescriptorTemplateOut, DescriptorError> {
-        P2Wpkh(segwit_v0::make_bipxx_public(84, self.0, self.1, self.2)?).build(network)
+        P2Wpkh(segwit_v0::make_bipxx_public(
+            84, self.0, self.1, self.2, network,
+        )?)
+        .build(network)
     }
 }
 
@@ -1207,6 +1229,7 @@
                 key: K,
                 parent_fingerprint: bip32::Fingerprint,
                 keychain: KeychainKind,
+                network: Network,
             ) -> Result<impl IntoDescriptorKey<$ctx>, DescriptorError> {
                 let derivation_path: bip32::DerivationPath = match keychain {
                     KeychainKind::External => vec![bip32::ChildNumber::from_normal_idx(0)?].into(),
@@ -1215,7 +1238,10 @@
 
                 let source_path = bip32::DerivationPath::from(vec![
                     bip32::ChildNumber::from_hardened_idx(bip)?,
-                    bip32::ChildNumber::from_hardened_idx(0)?,
+                    match network {
+                        Network::Bitcoin => bip32::ChildNumber::from_hardened_idx(0)?,
+                        _ => bip32::ChildNumber::from_hardened_idx(1)?,
+                    },
                     bip32::ChildNumber::from_hardened_idx(0)?,
                 ]);