pub struct StandardWallet { /* private fields */ }Expand description
A standard Bitcoin wallet with a single private key.
This wallet type generates a random private key directly, without using a mnemonic or HD derivation.
Implementations§
Source§impl StandardWallet
impl StandardWallet
Sourcepub fn from_wif(wif: &str, address_type: AddressType) -> Result<Self, Error>
pub fn from_wif(wif: &str, address_type: AddressType) -> Result<Self, Error>
Import a wallet from a WIF (Wallet Import Format) private key.
§Errors
Returns an error if the WIF is invalid.
Sourcepub fn private_key_wif(&self) -> Zeroizing<String>
pub fn private_key_wif(&self) -> Zeroizing<String>
Get the private key in WIF format.
Sourcepub fn public_key_hex(&self) -> String
pub fn public_key_hex(&self) -> String
Get the public key in hex format.
Sourcepub fn address_string(&self) -> String
pub fn address_string(&self) -> String
Get the address as a string.
Sourcepub const fn address_type(&self) -> AddressType
pub const fn address_type(&self) -> AddressType
Get the address type.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StandardWallet
impl RefUnwindSafe for StandardWallet
impl Send for StandardWallet
impl Sync for StandardWallet
impl Unpin for StandardWallet
impl UnwindSafe for StandardWallet
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