pub struct Wallet { /* private fields */ }
Expand description
Wallet of credentials
Implementations§
Source§impl Wallet
impl Wallet
Sourcepub fn new(mnemonic: impl AsRef<str>) -> StacksResult<Self>
pub fn new(mnemonic: impl AsRef<str>) -> StacksResult<Self>
Creates a wallet from the network, mnemonic, and optional passphrase
Sourcepub fn random() -> StacksResult<Self>
pub fn random() -> StacksResult<Self>
Creates a random wallet
Sourcepub fn master_key(&self) -> PrivateKey
pub fn master_key(&self) -> PrivateKey
Returns the master key of the wallet
Sourcepub fn credentials(
&self,
network: Network,
index: u32,
) -> StacksResult<Credentials>
pub fn credentials( &self, network: Network, index: u32, ) -> StacksResult<Credentials>
Returns the credentials at the given index
Sourcepub fn bitcoin_credentials(
&self,
network: BitcoinNetwork,
index: u32,
) -> StacksResult<BitcoinCredentials>
pub fn bitcoin_credentials( &self, network: BitcoinNetwork, index: u32, ) -> StacksResult<BitcoinCredentials>
Returns the Bitcoin credentials at the given index
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wallet
impl<'de> Deserialize<'de> for Wallet
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 Wallet
impl RefUnwindSafe for Wallet
impl Send for Wallet
impl Sync for Wallet
impl Unpin for Wallet
impl UnwindSafe for Wallet
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