[−][src]Struct web3::api::Accounts
Accounts
namespace
Implementations
impl<T: Transport> Accounts<T>
[src]
pub async fn sign_transaction<K: Key, '_>(
&'_ self,
tx: TransactionParameters,
key: K
) -> Result<SignedTransaction>
[src]
&'_ self,
tx: TransactionParameters,
key: K
) -> Result<SignedTransaction>
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]
S: AsRef<[u8]>,
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]
R: Into<Recovery>,
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]
S: AsRef<[u8]>,
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,
T: RefUnwindSafe,
impl<T> Send for Accounts<T> where
T: Send,
T: Send,
impl<T> Sync for Accounts<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Accounts<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Accounts<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,