Enum breez_sdk_core::bitcoin::util::address::Payload
pub enum Payload {
PubkeyHash(PubkeyHash),
ScriptHash(ScriptHash),
WitnessProgram {
version: WitnessVersion,
program: Vec<u8>,
},
}
Expand description
The method used to produce an address.
Variants§
PubkeyHash(PubkeyHash)
P2PKH address.
ScriptHash(ScriptHash)
P2SH address.
WitnessProgram
Segwit address.
Implementations§
§impl Payload
impl Payload
pub fn from_script(script: &Script) -> Result<Payload, Error>
pub fn from_script(script: &Script) -> Result<Payload, Error>
Constructs a Payload from an output script (scriptPubkey
).
pub fn script_pubkey(&self) -> Script
pub fn script_pubkey(&self) -> Script
Generates a script pubkey spending to this Payload.
pub fn p2pkh(pk: &PublicKey) -> Payload
pub fn p2pkh(pk: &PublicKey) -> Payload
Creates a pay to (compressed) public key hash payload from a public key
pub fn p2sh(script: &Script) -> Result<Payload, Error>
pub fn p2sh(script: &Script) -> Result<Payload, Error>
Creates a pay to script hash P2SH payload from a script
pub fn p2wpkh(pk: &PublicKey) -> Result<Payload, Error>
pub fn p2wpkh(pk: &PublicKey) -> Result<Payload, Error>
Create a witness pay to public key payload from a public key
pub fn p2shwpkh(pk: &PublicKey) -> Result<Payload, Error>
pub fn p2shwpkh(pk: &PublicKey) -> Result<Payload, Error>
Create a pay to script payload that embeds a witness pay to public key
pub fn p2shwsh(script: &Script) -> Payload
pub fn p2shwsh(script: &Script) -> Payload
Create a pay to script payload that embeds a witness pay to script hash address
pub fn p2tr<C>(
secp: &Secp256k1<C>,
internal_key: XOnlyPublicKey,
merkle_root: Option<TapBranchHash>,
) -> Payloadwhere
C: Verification,
pub fn p2tr<C>(
secp: &Secp256k1<C>,
internal_key: XOnlyPublicKey,
merkle_root: Option<TapBranchHash>,
) -> Payloadwhere
C: Verification,
Create a pay to taproot payload from untweaked key
pub fn p2tr_tweaked(output_key: TweakedPublicKey) -> Payload
pub fn p2tr_tweaked(output_key: TweakedPublicKey) -> Payload
Create a pay to taproot payload from a pre-tweaked output key.
This method is not recommended for use and Payload::p2tr() should be used where possible.
Trait Implementations§
§impl Ord for Payload
impl Ord for Payload
§impl PartialOrd for Payload
impl PartialOrd for Payload
impl Eq for Payload
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl Freeze for Payload
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: AsAny + ?Sized,
impl<T> Downcast for Twhere
T: AsAny + ?Sized,
§fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
fn downcast_ref<T>(&self) -> Option<&T>where
T: AsAny,
Forward to the method defined on the type
Any
.§fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: AsAny,
Forward to the method defined on the type
Any
.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request