Trait iota_keys::keystore::AccountKeystore
source · pub trait AccountKeystore: Send + Sync {
Show 19 methods
// Required methods
fn add_key(
&mut self,
alias: Option<String>,
keypair: IotaKeyPair,
) -> Result<(), Error>;
fn keys(&self) -> Vec<PublicKey>;
fn get_key(&self, address: &IotaAddress) -> Result<&IotaKeyPair, Error>;
fn sign_hashed(
&self,
address: &IotaAddress,
msg: &[u8],
) -> Result<Signature, Error>;
fn sign_secure<T>(
&self,
address: &IotaAddress,
msg: &T,
intent: Intent,
) -> Result<Signature, Error>
where T: Serialize;
fn addresses_with_alias(&self) -> Vec<(&IotaAddress, &Alias)>;
fn aliases(&self) -> Vec<&Alias>;
fn aliases_mut(&mut self) -> Vec<&mut Alias>;
fn get_alias_by_address(
&self,
address: &IotaAddress,
) -> Result<String, Error>;
fn get_address_by_alias(&self, alias: String) -> Result<&IotaAddress, Error>;
fn create_alias(&self, alias: Option<String>) -> Result<String, Error>;
fn update_alias(
&mut self,
old_alias: &str,
new_alias: Option<&str>,
) -> Result<String, Error>;
// Provided methods
fn addresses(&self) -> Vec<IotaAddress> { ... }
fn alias_names(&self) -> Vec<&str> { ... }
fn alias_exists(&self, alias: &str) -> bool { ... }
fn update_alias_value(
&mut self,
old_alias: &str,
new_alias: Option<&str>,
) -> Result<String, Error> { ... }
fn generate_and_add_new_key(
&mut self,
key_scheme: SignatureScheme,
alias: Option<String>,
derivation_path: Option<DerivationPath>,
word_length: Option<String>,
) -> Result<(IotaAddress, String, SignatureScheme), Error> { ... }
fn import_from_mnemonic(
&mut self,
phrase: &str,
key_scheme: SignatureScheme,
derivation_path: Option<DerivationPath>,
alias: Option<String>,
) -> Result<IotaAddress, Error> { ... }
fn import_from_seed(
&mut self,
seed: &[u8],
key_scheme: SignatureScheme,
derivation_path: Option<DerivationPath>,
alias: Option<String>,
) -> Result<IotaAddress, Error> { ... }
}
Required Methods§
fn add_key( &mut self, alias: Option<String>, keypair: IotaKeyPair, ) -> Result<(), Error>
fn keys(&self) -> Vec<PublicKey>
fn get_key(&self, address: &IotaAddress) -> Result<&IotaKeyPair, Error>
fn sign_hashed( &self, address: &IotaAddress, msg: &[u8], ) -> Result<Signature, Error>
fn sign_secure<T>(
&self,
address: &IotaAddress,
msg: &T,
intent: Intent,
) -> Result<Signature, Error>where
T: Serialize,
fn addresses_with_alias(&self) -> Vec<(&IotaAddress, &Alias)>
fn aliases(&self) -> Vec<&Alias>
fn aliases_mut(&mut self) -> Vec<&mut Alias>
sourcefn get_alias_by_address(&self, address: &IotaAddress) -> Result<String, Error>
fn get_alias_by_address(&self, address: &IotaAddress) -> Result<String, Error>
Get alias of address
fn get_address_by_alias(&self, alias: String) -> Result<&IotaAddress, Error>
fn create_alias(&self, alias: Option<String>) -> Result<String, Error>
fn update_alias( &mut self, old_alias: &str, new_alias: Option<&str>, ) -> Result<String, Error>
Provided Methods§
fn addresses(&self) -> Vec<IotaAddress>
fn alias_names(&self) -> Vec<&str>
sourcefn alias_exists(&self, alias: &str) -> bool
fn alias_exists(&self, alias: &str) -> bool
Check if an alias exists by its name
fn update_alias_value( &mut self, old_alias: &str, new_alias: Option<&str>, ) -> Result<String, Error>
fn generate_and_add_new_key( &mut self, key_scheme: SignatureScheme, alias: Option<String>, derivation_path: Option<DerivationPath>, word_length: Option<String>, ) -> Result<(IotaAddress, String, SignatureScheme), Error>
fn import_from_mnemonic( &mut self, phrase: &str, key_scheme: SignatureScheme, derivation_path: Option<DerivationPath>, alias: Option<String>, ) -> Result<IotaAddress, Error>
fn import_from_seed( &mut self, seed: &[u8], key_scheme: SignatureScheme, derivation_path: Option<DerivationPath>, alias: Option<String>, ) -> Result<IotaAddress, Error>
Object Safety§
This trait is not object safe.