pub struct P2Wpkh_P2Sh<K: IntoDescriptorKey<Segwitv0>>(pub K);
Expand description

P2WPKH-P2SH template. Expands to a descriptor sh(wpkh(key))

Example

use bdk::template::P2Wpkh_P2Sh;
use bdk::wallet::AddressIndex;

let key =
    bitcoin::PrivateKey::from_wif("cTc4vURSzdx6QE6KVynWGomDbLaA75dNALMNyfjh3p8DRRar84Um")?;
let mut wallet = Wallet::new_no_persist(P2Wpkh_P2Sh(key), None, Network::Testnet)?;

assert_eq!(
    wallet.get_address(AddressIndex::New).to_string(),
    "2NB4ox5VDRw1ecUv6SnT3VQHPXveYztRqk5"
);

Tuple Fields§

§0: K

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.

Convert to wallet descriptor
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.