[][src]Struct web3::api::Accounts

pub struct Accounts<T> { /* fields omitted */ }

Accounts namespace

Implementations

impl<T: Transport> Accounts<T>[src]

pub async fn sign_transaction<K: Key, '_>(
    &'_ self,
    tx: TransactionParameters,
    key: K
) -> Result<SignedTransaction>
[src]

Signs an Ethereum transaction with a given private key.

Transaction signing can perform RPC requests in order to fill missing parameters required for signing nonce, gas_price and chain_id. Note that if all transaction parameters were provided, this future will resolve immediately.

pub fn sign<S>(&self, message: S, key: impl Key) -> SignedData where
    S: AsRef<[u8]>, 
[src]

Sign arbitrary string data.

The data is UTF-8 encoded and enveloped the same way as with hash_message. The returned signed data's signature is in 'Electrum' notation, that is the recovery value v is either 27 or 28 (as opposed to the standard notation where v is either 0 or 1). This is important to consider when using this signature with other crates.

pub fn recover<R>(&self, recovery: R) -> Result<Address> where
    R: Into<Recovery>, 
[src]

Recovers the Ethereum address which was used to sign the given data.

Recovery signature data uses 'Electrum' notation, this means the v value is expected to be either 27 or 28.

impl<T: Transport> Accounts<T>[src]

pub fn hash_message<S>(&self, message: S) -> H256 where
    S: AsRef<[u8]>, 
[src]

Hash a message according to EIP-191.

The data is a UTF-8 encoded string and will enveloped as follows: "\x19Ethereum Signed Message:\n" + message.length + message and hashed using keccak256.

Trait Implementations

impl<T: Clone> Clone for Accounts<T>[src]

impl<T: Debug> Debug for Accounts<T>[src]

impl<T: Transport> Namespace<T> for Accounts<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Accounts<T> where
    T: RefUnwindSafe

impl<T> Send for Accounts<T> where
    T: Send

impl<T> Sync for Accounts<T> where
    T: Sync

impl<T> Unpin for Accounts<T> where
    T: Unpin

impl<T> UnwindSafe for Accounts<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,