Trait parity_rpc::dispatch::Accounts
source · [−]pub trait Accounts: Send + Sync {
fn sign_transaction(
&self,
filled: FilledTransactionRequest,
chain_id: Option<u64>,
nonce: U256,
password: SignWith
) -> Result<WithToken<SignedTransaction>>;
fn sign_message(
&self,
address: Address,
password: SignWith,
hash: SignMessage
) -> Result<WithToken<Signature>>;
fn decrypt(
&self,
address: Address,
password: SignWith,
data: Bytes
) -> Result<WithToken<Bytes>>;
fn supports_prospective_signing(
&self,
address: &Address,
password: &SignWith
) -> bool;
fn default_account(&self) -> Address;
fn is_unlocked(&self, address: &Address) -> bool;
}
Expand description
Abstract transaction signer.
NOTE This signer is semi-correct, it’s a temporary measure to avoid moving too much code. If accounts are ultimately removed all password-dealing endpoints will be wiped out.
Required methods
fn sign_transaction(
&self,
filled: FilledTransactionRequest,
chain_id: Option<u64>,
nonce: U256,
password: SignWith
) -> Result<WithToken<SignedTransaction>>
fn sign_transaction(
&self,
filled: FilledTransactionRequest,
chain_id: Option<u64>,
nonce: U256,
password: SignWith
) -> Result<WithToken<SignedTransaction>>
Sign given filled transaction request for the specified chain_id.
fn sign_message(
&self,
address: Address,
password: SignWith,
hash: SignMessage
) -> Result<WithToken<Signature>>
fn sign_message(
&self,
address: Address,
password: SignWith,
hash: SignMessage
) -> Result<WithToken<Signature>>
Sign given message.
Decrypt given message.
fn supports_prospective_signing(
&self,
address: &Address,
password: &SignWith
) -> bool
fn supports_prospective_signing(
&self,
address: &Address,
password: &SignWith
) -> bool
Returns true
if the accounts can sign multiple times.
fn default_account(&self) -> Address
fn default_account(&self) -> Address
Returns default account.
fn is_unlocked(&self, address: &Address) -> bool
fn is_unlocked(&self, address: &Address) -> bool
Returns true if account is unlocked (i.e. can sign without a password)