pub struct Wallet<'a> {
pub name: &'a str,
}
Expand description
Wallet operations based on Keyring API
stores key names in another ‘username/password’ to facilitate listing keys, and deletion of ALL keys in a wallet
Fields§
§name: &'a str
Implementations§
Source§impl<'a> Wallet<'a>
impl<'a> Wallet<'a>
Sourcepub fn new(wallet_name: &'a str) -> Result<Wallet<'a>, TerraRustWalletError>
pub fn new(wallet_name: &'a str) -> Result<Wallet<'a>, TerraRustWalletError>
create a new wallet to store keys into. This just creates the structure use #new to create a new wallet
Sourcepub fn get_private_key<C: Signing + Context>(
&self,
secp: &'a Secp256k1<C>,
key_name: &'a str,
seed: Option<&'a str>,
) -> Result<PrivateKey, TerraRustWalletError>
pub fn get_private_key<C: Signing + Context>( &self, secp: &'a Secp256k1<C>, key_name: &'a str, seed: Option<&'a str>, ) -> Result<PrivateKey, TerraRustWalletError>
retrieves the private key from the keyring
Sourcepub fn get_public_key<C: Signing + Context>(
&self,
secp: &Secp256k1<C>,
key_name: &str,
seed: Option<&str>,
) -> Result<PublicKey, TerraRustWalletError>
pub fn get_public_key<C: Signing + Context>( &self, secp: &Secp256k1<C>, key_name: &str, seed: Option<&str>, ) -> Result<PublicKey, TerraRustWalletError>
retrieves the public key associated with the stored private key
Sourcepub fn get_account<C: Signing + Context>(
&self,
secp: &Secp256k1<C>,
key_name: &str,
seed: Option<&str>,
) -> Result<String, TerraRustWalletError>
pub fn get_account<C: Signing + Context>( &self, secp: &Secp256k1<C>, key_name: &str, seed: Option<&str>, ) -> Result<String, TerraRustWalletError>
get account from key name
Sourcepub fn store_key(
&self,
key_name: &str,
pk: &PrivateKey,
) -> Result<bool, TerraRustWalletError>
pub fn store_key( &self, key_name: &str, pk: &PrivateKey, ) -> Result<bool, TerraRustWalletError>
stores the private key into the keyring
Sourcepub fn delete_key(&self, key_name: &str) -> Result<bool, TerraRustWalletError>
pub fn delete_key(&self, key_name: &str) -> Result<bool, TerraRustWalletError>
deletes the private key from the keyring
Sourcepub fn delete(&self) -> Result<(), TerraRustWalletError>
pub fn delete(&self) -> Result<(), TerraRustWalletError>
deletes the wallet and ALL the keys in the wallet
Sourcepub fn get_wallets() -> Result<Vec<String>, TerraRustWalletError>
pub fn get_wallets() -> Result<Vec<String>, TerraRustWalletError>
get list of wallets
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Wallet<'a>
impl<'a> RefUnwindSafe for Wallet<'a>
impl<'a> Send for Wallet<'a>
impl<'a> Sync for Wallet<'a>
impl<'a> Unpin for Wallet<'a>
impl<'a> UnwindSafe for Wallet<'a>
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