Struct bdk::descriptor::template::P2Pkh

source ·
pub struct P2Pkh<K: IntoDescriptorKey<Legacy>>(pub K);
Expand description

P2PKH template. Expands to a descriptor pkh(key)

Example

use bdk::template::P2Pkh;

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

assert_eq!(
    wallet
        .next_unused_address(KeychainKind::External)?
        .to_string(),
    "mwJ8hxFYW19JLuc65RCTaP4v1rzVU8cVMT"
);

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.