Struct ethcore::account_provider::AccountProvider
[−]
[src]
pub struct AccountProvider { /* fields omitted */ }
Account management. Responsible for unlocking accounts.
Methods
impl AccountProvider
[src]
impl AccountProvider
pub fn new(sstore: Box<SecretStore>, settings: AccountProviderSettings) -> Self
[src]
pub fn new(sstore: Box<SecretStore>, settings: AccountProviderSettings) -> Self
Creates new account provider.
pub fn transient_provider() -> Self
[src]
pub fn transient_provider() -> Self
Creates not disk backed provider.
pub fn new_account(&self, password: &str) -> Result<Address, Error>
[src]
pub fn new_account(&self, password: &str) -> Result<Address, Error>
Creates new random account.
pub fn new_account_and_public(
&self,
password: &str
) -> Result<(Address, Public), Error>
[src]
pub fn new_account_and_public(
&self,
password: &str
) -> Result<(Address, Public), Error>
Creates new random account and returns address and public key
pub fn insert_account(
&self,
secret: Secret,
password: &str
) -> Result<Address, Error>
[src]
pub fn insert_account(
&self,
secret: Secret,
password: &str
) -> Result<Address, Error>
Inserts new account into underlying store. Does not unlock account!
pub fn derive_account(
&self,
address: &Address,
password: Option<String>,
derivation: Derivation,
save: bool
) -> Result<Address, SignError>
[src]
pub fn derive_account(
&self,
address: &Address,
password: Option<String>,
derivation: Derivation,
save: bool
) -> Result<Address, SignError>
Generates new derived account based on the existing one If password is not provided, account must be unlocked New account will be created with the same password (if save: true)
pub fn import_presale(
&self,
presale_json: &[u8],
password: &str
) -> Result<Address, Error>
[src]
pub fn import_presale(
&self,
presale_json: &[u8],
password: &str
) -> Result<Address, Error>
Import a new presale wallet.
pub fn import_wallet(
&self,
json: &[u8],
password: &str,
gen_id: bool
) -> Result<Address, Error>
[src]
pub fn import_wallet(
&self,
json: &[u8],
password: &str,
gen_id: bool
) -> Result<Address, Error>
Import a new wallet.
pub fn has_account(&self, address: Address) -> bool
[src]
pub fn has_account(&self, address: Address) -> bool
Checks whether an account with a given address is present.
pub fn accounts(&self) -> Result<Vec<Address>, Error>
[src]
pub fn accounts(&self) -> Result<Vec<Address>, Error>
Returns addresses of all accounts.
pub fn hardware_accounts(&self) -> Result<Vec<Address>, Error>
[src]
pub fn hardware_accounts(&self) -> Result<Vec<Address>, Error>
Returns addresses of hardware accounts.
pub fn locked_hardware_accounts(&self) -> Result<Vec<String>, SignError>
[src]
pub fn locked_hardware_accounts(&self) -> Result<Vec<String>, SignError>
Get a list of paths to locked hardware wallets
pub fn hardware_pin_matrix_ack(
&self,
path: &str,
pin: &str
) -> Result<bool, SignError>
[src]
pub fn hardware_pin_matrix_ack(
&self,
path: &str,
pin: &str
) -> Result<bool, SignError>
Provide a pin to a locked hardware wallet on USB path to unlock it
pub fn set_new_dapps_addresses(
&self,
accounts: Option<Vec<Address>>
) -> Result<(), Error>
[src]
pub fn set_new_dapps_addresses(
&self,
accounts: Option<Vec<Address>>
) -> Result<(), Error>
Sets addresses of accounts exposed for unknown dapps.
None
means that all accounts will be visible.
If not None
or empty it will also override default account.
pub fn new_dapps_addresses(&self) -> Result<Option<Vec<Address>>, Error>
[src]
pub fn new_dapps_addresses(&self) -> Result<Option<Vec<Address>>, Error>
Gets addresses of accounts exposed for unknown dapps.
None
means that all accounts will be visible.
pub fn set_new_dapps_default_address(
&self,
address: Address
) -> Result<(), Error>
[src]
pub fn set_new_dapps_default_address(
&self,
address: Address
) -> Result<(), Error>
Sets a default account for unknown dapps. This account will always be returned as the first one.
pub fn new_dapps_default_address(&self) -> Result<Address, Error>
[src]
pub fn new_dapps_default_address(&self) -> Result<Address, Error>
Gets a default account for new dapps Will return zero address in case the default is not set and there are no accounts configured.
pub fn recent_dapps(&self) -> Result<HashMap<DappId, u64>, Error>
[src]
pub fn recent_dapps(&self) -> Result<HashMap<DappId, u64>, Error>
Gets a list of dapps recently requesting accounts.
pub fn note_dapp_used(&self, dapp: DappId) -> Result<(), Error>
[src]
pub fn note_dapp_used(&self, dapp: DappId) -> Result<(), Error>
Marks dapp as recently used.
pub fn dapp_addresses(&self, dapp: DappId) -> Result<Vec<Address>, Error>
[src]
pub fn dapp_addresses(&self, dapp: DappId) -> Result<Vec<Address>, Error>
Gets addresses visible for given dapp.
pub fn dapp_default_address(&self, dapp: DappId) -> Result<Address, Error>
[src]
pub fn dapp_default_address(&self, dapp: DappId) -> Result<Address, Error>
Returns default account for particular dapp falling back to other allowed accounts if necessary.
pub fn set_dapp_default_address(
&self,
dapp: DappId,
address: Address
) -> Result<(), Error>
[src]
pub fn set_dapp_default_address(
&self,
dapp: DappId,
address: Address
) -> Result<(), Error>
Sets default address for given dapp. Does not alter dapp addresses, but this account will always be returned as the first one.
pub fn set_dapp_addresses(
&self,
dapp: DappId,
addresses: Option<Vec<Address>>
) -> Result<(), Error>
[src]
pub fn set_dapp_addresses(
&self,
dapp: DappId,
addresses: Option<Vec<Address>>
) -> Result<(), Error>
Sets addresses visible for given dapp.
If None
- falls back to dapps addresses
If not None
and not empty it will also override default account.
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta>
[src]
pub fn addresses_info(&self) -> HashMap<Address, AccountMeta>
Returns each address along with metadata.
pub fn set_address_name(&self, account: Address, name: String)
[src]
pub fn set_address_name(&self, account: Address, name: String)
Returns each address along with metadata.
pub fn set_address_meta(&self, account: Address, meta: String)
[src]
pub fn set_address_meta(&self, account: Address, meta: String)
Returns each address along with metadata.
pub fn remove_address(&self, addr: Address)
[src]
pub fn remove_address(&self, addr: Address)
Removes and address from the address book
pub fn accounts_info(&self) -> Result<HashMap<Address, AccountMeta>, Error>
[src]
pub fn accounts_info(&self) -> Result<HashMap<Address, AccountMeta>, Error>
Returns each account along with name and meta.
pub fn hardware_accounts_info(
&self
) -> Result<HashMap<Address, AccountMeta>, Error>
[src]
pub fn hardware_accounts_info(
&self
) -> Result<HashMap<Address, AccountMeta>, Error>
Returns each hardware account along with name and meta.
pub fn is_hardware_address(&self, address: &Address) -> bool
[src]
pub fn is_hardware_address(&self, address: &Address) -> bool
Returns each hardware account along with name and meta.
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error>
[src]
pub fn account_meta(&self, address: Address) -> Result<AccountMeta, Error>
Returns each account along with name and meta.
pub fn account_public(
&self,
address: Address,
password: &str
) -> Result<Public, Error>
[src]
pub fn account_public(
&self,
address: Address,
password: &str
) -> Result<Public, Error>
Returns account public key.
pub fn set_account_name(
&self,
address: Address,
name: String
) -> Result<(), Error>
[src]
pub fn set_account_name(
&self,
address: Address,
name: String
) -> Result<(), Error>
Returns each account along with name and meta.
pub fn set_account_meta(
&self,
address: Address,
meta: String
) -> Result<(), Error>
[src]
pub fn set_account_meta(
&self,
address: Address,
meta: String
) -> Result<(), Error>
Returns each account along with name and meta.
pub fn test_password(
&self,
address: &Address,
password: &str
) -> Result<bool, Error>
[src]
pub fn test_password(
&self,
address: &Address,
password: &str
) -> Result<bool, Error>
Returns true
if the password for account
is password
. false
if not.
pub fn kill_account(
&self,
address: &Address,
password: &str
) -> Result<(), Error>
[src]
pub fn kill_account(
&self,
address: &Address,
password: &str
) -> Result<(), Error>
Permanently removes an account.
pub fn change_password(
&self,
address: &Address,
password: String,
new_password: String
) -> Result<(), Error>
[src]
pub fn change_password(
&self,
address: &Address,
password: String,
new_password: String
) -> Result<(), Error>
Changes the password of account
from password
to new_password
. Fails if incorrect password
given.
pub fn export_account(
&self,
address: &Address,
password: String
) -> Result<KeyFile, Error>
[src]
pub fn export_account(
&self,
address: &Address,
password: String
) -> Result<KeyFile, Error>
Exports an account for given address.
pub fn unlock_account_permanently(
&self,
account: Address,
password: String
) -> Result<(), Error>
[src]
pub fn unlock_account_permanently(
&self,
account: Address,
password: String
) -> Result<(), Error>
Unlocks account permanently.
pub fn unlock_account_temporarily(
&self,
account: Address,
password: String
) -> Result<(), Error>
[src]
pub fn unlock_account_temporarily(
&self,
account: Address,
password: String
) -> Result<(), Error>
Unlocks account temporarily (for one signing).
pub fn unlock_account_timed(
&self,
account: Address,
password: String,
duration: Duration
) -> Result<(), Error>
[src]
pub fn unlock_account_timed(
&self,
account: Address,
password: String,
duration: Duration
) -> Result<(), Error>
Unlocks account temporarily with a timeout.
pub fn is_unlocked(&self, address: &Address) -> bool
[src]
pub fn is_unlocked(&self, address: &Address) -> bool
Checks if given account is unlocked
pub fn is_unlocked_permanently(&self, address: &Address) -> bool
[src]
pub fn is_unlocked_permanently(&self, address: &Address) -> bool
Checks if given account is unlocked permanently
pub fn sign(
&self,
address: Address,
password: Option<String>,
message: Message
) -> Result<Signature, SignError>
[src]
pub fn sign(
&self,
address: Address,
password: Option<String>,
message: Message
) -> Result<Signature, SignError>
Signs the message. If password is not provided the account must be unlocked.
pub fn sign_derived(
&self,
address: &Address,
password: Option<String>,
derivation: Derivation,
message: Message
) -> Result<Signature, SignError>
[src]
pub fn sign_derived(
&self,
address: &Address,
password: Option<String>,
derivation: Derivation,
message: Message
) -> Result<Signature, SignError>
Signs message using the derived secret. If password is not provided the account must be unlocked.
pub fn sign_with_token(
&self,
address: Address,
token: String,
message: Message
) -> Result<(Signature, String), SignError>
[src]
pub fn sign_with_token(
&self,
address: Address,
token: String,
message: Message
) -> Result<(Signature, String), SignError>
Signs given message with supplied token. Returns a token to use in next signing within this session.
pub fn decrypt_with_token(
&self,
address: Address,
token: String,
shared_mac: &[u8],
message: &[u8]
) -> Result<(Vec<u8>, String), SignError>
[src]
pub fn decrypt_with_token(
&self,
address: Address,
token: String,
shared_mac: &[u8],
message: &[u8]
) -> Result<(Vec<u8>, String), SignError>
Decrypts a message with given token. Returns a token to use in next operation for this account.
pub fn decrypt(
&self,
address: Address,
password: Option<String>,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, SignError>
[src]
pub fn decrypt(
&self,
address: Address,
password: Option<String>,
shared_mac: &[u8],
message: &[u8]
) -> Result<Vec<u8>, SignError>
Decrypts a message. If password is not provided the account must be unlocked.
pub fn agree(
&self,
address: Address,
password: Option<String>,
other_public: &Public
) -> Result<Secret, SignError>
[src]
pub fn agree(
&self,
address: Address,
password: Option<String>,
other_public: &Public
) -> Result<Secret, SignError>
Agree on shared key.
pub fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>
[src]
pub fn list_geth_accounts(&self, testnet: bool) -> Vec<Address>
Returns the underlying SecretStore
reference if one exists.
pub fn import_geth_accounts(
&self,
desired: Vec<Address>,
testnet: bool
) -> Result<Vec<Address>, Error>
[src]
pub fn import_geth_accounts(
&self,
desired: Vec<Address>,
testnet: bool
) -> Result<Vec<Address>, Error>
Returns the underlying SecretStore
reference if one exists.
pub fn create_vault(&self, name: &str, password: &str) -> Result<(), Error>
[src]
pub fn create_vault(&self, name: &str, password: &str) -> Result<(), Error>
Create new vault.
pub fn open_vault(&self, name: &str, password: &str) -> Result<(), Error>
[src]
pub fn open_vault(&self, name: &str, password: &str) -> Result<(), Error>
Open existing vault.
pub fn close_vault(&self, name: &str) -> Result<(), Error>
[src]
pub fn close_vault(&self, name: &str) -> Result<(), Error>
Close previously opened vault.
pub fn list_vaults(&self) -> Result<Vec<String>, Error>
[src]
pub fn list_vaults(&self) -> Result<Vec<String>, Error>
List all vaults
pub fn list_opened_vaults(&self) -> Result<Vec<String>, Error>
[src]
pub fn list_opened_vaults(&self) -> Result<Vec<String>, Error>
List all currently opened vaults
pub fn change_vault_password(
&self,
name: &str,
new_password: &str
) -> Result<(), Error>
[src]
pub fn change_vault_password(
&self,
name: &str,
new_password: &str
) -> Result<(), Error>
Change vault password.
pub fn change_vault(
&self,
address: Address,
new_vault: &str
) -> Result<(), Error>
[src]
pub fn change_vault(
&self,
address: Address,
new_vault: &str
) -> Result<(), Error>
Change vault of the given address.
pub fn get_vault_meta(&self, name: &str) -> Result<String, Error>
[src]
pub fn get_vault_meta(&self, name: &str) -> Result<String, Error>
Get vault metadata string.
pub fn set_vault_meta(&self, name: &str, meta: &str) -> Result<(), Error>
[src]
pub fn set_vault_meta(&self, name: &str, meta: &str) -> Result<(), Error>
Set vault metadata string.
pub fn sign_message_with_hardware(
&self,
address: &Address,
message: &[u8]
) -> Result<Signature, SignError>
[src]
pub fn sign_message_with_hardware(
&self,
address: &Address,
message: &[u8]
) -> Result<Signature, SignError>
Sign message with hardware wallet.
pub fn sign_transaction_with_hardware(
&self,
address: &Address,
transaction: &Transaction,
chain_id: Option<u64>,
rlp_encoded_transaction: &[u8]
) -> Result<Signature, SignError>
[src]
pub fn sign_transaction_with_hardware(
&self,
address: &Address,
transaction: &Transaction,
chain_id: Option<u64>,
rlp_encoded_transaction: &[u8]
) -> Result<Signature, SignError>
Sign transaction with hardware wallet.
Trait Implementations
Auto Trait Implementations
impl Send for AccountProvider
impl Send for AccountProvider
impl Sync for AccountProvider
impl Sync for AccountProvider