pub struct BitcoinCredentials { /* private fields */ }
Expand description
Bitcoin Credentials that can be used to sign transactions
Implementations§
Source§impl BitcoinCredentials
impl BitcoinCredentials
Sourcepub fn new(
network: BitcoinNetwork,
master_key: ExtendedPrivKey,
index: u32,
) -> StacksResult<Self>
pub fn new( network: BitcoinNetwork, master_key: ExtendedPrivKey, index: u32, ) -> StacksResult<Self>
Creates Bitcoin credentials from the Bitcoin network and private key
Sourcepub fn network(&self) -> BitcoinNetwork
pub fn network(&self) -> BitcoinNetwork
Returns the Bitcoin network
Sourcepub fn private_key_p2pkh(&self) -> PrivateKey
pub fn private_key_p2pkh(&self) -> PrivateKey
Returns the Bitcoin P2PKH private key
Sourcepub fn private_key_p2wpkh(&self) -> PrivateKey
pub fn private_key_p2wpkh(&self) -> PrivateKey
Returns the Bitcoin P22PKH private key
Sourcepub fn private_key_p2tr(&self) -> PrivateKey
pub fn private_key_p2tr(&self) -> PrivateKey
Returns the Bitcoin P2TR private key
Sourcepub fn public_key_p2pkh(&self) -> PublicKey
pub fn public_key_p2pkh(&self) -> PublicKey
Returns the Bitcoin P2PKH public key
Sourcepub fn public_key_p2wpkh(&self) -> PublicKey
pub fn public_key_p2wpkh(&self) -> PublicKey
Returns the Bitcoin P2WPKH public key
Sourcepub fn public_key_p2tr(&self) -> PublicKey
pub fn public_key_p2tr(&self) -> PublicKey
Returns the Bitcoin P2TR public key
Sourcepub fn address_p2pkh(&self) -> BitcoinAddress
pub fn address_p2pkh(&self) -> BitcoinAddress
Returns the Bitcoin P2PKH address
Sourcepub fn address_p2wpkh(&self) -> BitcoinAddress
pub fn address_p2wpkh(&self) -> BitcoinAddress
Returns the Bitcoin P2WPKH address
Sourcepub fn address_p2tr(&self) -> BitcoinAddress
pub fn address_p2tr(&self) -> BitcoinAddress
Returns the Bitcoin P2TR address
Sourcepub fn wif_p2wpkh(&self) -> WIF
pub fn wif_p2wpkh(&self) -> WIF
Returns the WIF for P2WPKH
Trait Implementations§
Source§impl Clone for BitcoinCredentials
impl Clone for BitcoinCredentials
Source§fn clone(&self) -> BitcoinCredentials
fn clone(&self) -> BitcoinCredentials
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BitcoinCredentials
impl Debug for BitcoinCredentials
Source§impl<'de> Deserialize<'de> for BitcoinCredentials
impl<'de> Deserialize<'de> for BitcoinCredentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BitcoinCredentials
impl RefUnwindSafe for BitcoinCredentials
impl Send for BitcoinCredentials
impl Sync for BitcoinCredentials
impl Unpin for BitcoinCredentials
impl UnwindSafe for BitcoinCredentials
Blanket Implementations§
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