pub struct AccountProvider {
    pub(crate) unlocked_secrets: RwLock<RawRwLock, HashMap<StoreAccountRef, OpaqueSecret, RandomState>>,
    pub(crate) unlocked: RwLock<RawRwLock, HashMap<StoreAccountRef, AccountData, RandomState>>,
    pub(crate) address_book: RwLock<RawRwLock, AddressBook>,
    pub(crate) sstore: Box<dyn SecretStore + 'static, Global>,
    pub(crate) transient_sstore: EthMultiStore,
    pub(crate) unlock_keep_secret: bool,
    pub(crate) blacklisted_accounts: Vec<H160, Global>,
}
Expand description

Account management. Responsible for unlocking accounts.

Fields

unlocked_secrets: RwLock<RawRwLock, HashMap<StoreAccountRef, OpaqueSecret, RandomState>>

For performance reasons some methods can re-use unlocked secrets.

unlocked: RwLock<RawRwLock, HashMap<StoreAccountRef, AccountData, RandomState>>

Unlocked account data.

address_book: RwLock<RawRwLock, AddressBook>

Address book.

sstore: Box<dyn SecretStore + 'static, Global>

Accounts on disk

transient_sstore: EthMultiStore

Accounts unlocked with rolling tokens

unlock_keep_secret: bool

When unlocking account permanently we additionally keep a raw secret in memory to increase the performance of transaction signing.

blacklisted_accounts: Vec<H160, Global>

Disallowed accounts.

Implementations

Creates new account provider.

Creates not disk backed provider.

Creates new random account.

Creates new random account and returns address and public key

Inserts new account into underlying store. Does not unlock account!

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)

Import a new presale wallet.

Import a new wallet.

Checks whether an account with a given address is present.

Returns addresses of all accounts.

Returns the address of default account.

Returns each address along with metadata.

Returns each address along with metadata.

Returns each address along with metadata.

Removes and address from the address book

Returns each account along with name and meta.

Returns each account along with name and meta.

Returns account public key.

Returns each account along with name and meta.

Returns each account along with name and meta.

Returns true if the password for account is password. false if not.

Permanently removes an account.

Changes the password of account from password to new_password. Fails if incorrect password given.

Exports an account for given address.

Unlocks account permanently.

Unlocks account temporarily (for one signing).

Unlocks account temporarily with a timeout.

Checks if given account is unlocked

Checks if given account is unlocked permanently

Signs the message. If password is not provided the account must be unlocked.

Signs message using the derived secret. If password is not provided the account must be unlocked.

Signs given message with supplied token. Returns a token to use in next signing within this session.

Decrypts a message with given token. Returns a token to use in next operation for this account.

Decrypts a message. If password is not provided the account must be unlocked.

Agree on shared key.

Create new vault.

Open existing vault.

Close previously opened vault.

List all vaults

List all currently opened vaults

Change vault password.

Change vault of the given address.

Get vault metadata string.

Set vault metadata string.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.