pub struct EthereumWallet { /* private fields */ }
Expand description
A wallet capable of signing any transaction for the Ethereum network.
Implementations§
Source§impl EthereumWallet
impl EthereumWallet
Sourcepub fn new<S>(signer: S) -> Self
pub fn new<S>(signer: S) -> Self
Create a new signer with the given signer as the default signer.
Sourcepub fn register_signer<S>(&mut self, signer: S)
pub fn register_signer<S>(&mut self, signer: S)
Register a new signer on this object. This signer will be used to sign
TransactionRequest
and TypedTransaction
object that specify the
signer’s address in the from
field.
Sourcepub fn register_default_signer<S>(&mut self, signer: S)
pub fn register_default_signer<S>(&mut self, signer: S)
Register a new signer on this object, and set it as the default signer.
This signer will be used to sign TransactionRequest
and
TypedTransaction
objects that do not specify a signer address in the
from
field.
Sourcepub fn set_default_signer(&mut self, address: Address) -> Result<()>
pub fn set_default_signer(&mut self, address: Address) -> Result<()>
Sets the default signer to the given address.
The default signer is used to sign TransactionRequest
and TypedTransaction
objects
that do not specify a signer address in the from
field.
The provided address must be a registered signer otherwise an error is returned.
If you’re looking to add a new signer and set it as default, use
EthereumWallet::register_default_signer
.
Trait Implementations§
Source§impl Clone for EthereumWallet
impl Clone for EthereumWallet
Source§fn clone(&self) -> EthereumWallet
fn clone(&self) -> EthereumWallet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EthereumWallet
impl Debug for EthereumWallet
Source§impl Default for EthereumWallet
impl Default for EthereumWallet
Source§fn default() -> EthereumWallet
fn default() -> EthereumWallet
Source§impl<S> From<S> for EthereumWallet
impl<S> From<S> for EthereumWallet
Source§impl NetworkWallet<AnyNetwork> for EthereumWallet
impl NetworkWallet<AnyNetwork> for EthereumWallet
Source§fn default_signer_address(&self) -> Address
fn default_signer_address(&self) -> Address
NetworkWallet::sign_transaction_from
when no specific signer is
specified.Source§fn has_signer_for(&self, address: &Address) -> bool
fn has_signer_for(&self, address: &Address) -> bool
Source§fn signer_addresses(&self) -> impl Iterator<Item = Address>
fn signer_addresses(&self) -> impl Iterator<Item = Address>
Source§async fn sign_transaction_from(
&self,
sender: Address,
tx: AnyTypedTransaction,
) -> Result<AnyTxEnvelope>
async fn sign_transaction_from( &self, sender: Address, tx: AnyTypedTransaction, ) -> Result<AnyTxEnvelope>
Source§fn sign_transaction(
&self,
tx: N::UnsignedTx,
) -> impl Send + Future<Output = Result<N::TxEnvelope>>
fn sign_transaction( &self, tx: N::UnsignedTx, ) -> impl Send + Future<Output = Result<N::TxEnvelope>>
Source§fn sign_request(
&self,
request: N::TransactionRequest,
) -> impl Send + Future<Output = Result<N::TxEnvelope>>
fn sign_request( &self, request: N::TransactionRequest, ) -> impl Send + Future<Output = Result<N::TxEnvelope>>
from
field.Source§impl<N> NetworkWallet<N> for EthereumWallet
impl<N> NetworkWallet<N> for EthereumWallet
Source§fn default_signer_address(&self) -> Address
fn default_signer_address(&self) -> Address
NetworkWallet::sign_transaction_from
when no specific signer is
specified.Source§fn has_signer_for(&self, address: &Address) -> bool
fn has_signer_for(&self, address: &Address) -> bool
Source§fn signer_addresses(&self) -> impl Iterator<Item = Address>
fn signer_addresses(&self) -> impl Iterator<Item = Address>
Source§async fn sign_transaction_from(
&self,
sender: Address,
tx: TypedTransaction,
) -> Result<TxEnvelope>
async fn sign_transaction_from( &self, sender: Address, tx: TypedTransaction, ) -> Result<TxEnvelope>
Source§fn sign_transaction(
&self,
tx: N::UnsignedTx,
) -> impl Send + Future<Output = Result<N::TxEnvelope>>
fn sign_transaction( &self, tx: N::UnsignedTx, ) -> impl Send + Future<Output = Result<N::TxEnvelope>>
Source§fn sign_request(
&self,
request: N::TransactionRequest,
) -> impl Send + Future<Output = Result<N::TxEnvelope>>
fn sign_request( &self, request: N::TransactionRequest, ) -> impl Send + Future<Output = Result<N::TxEnvelope>>
from
field.Auto Trait Implementations§
impl Freeze for EthereumWallet
impl !RefUnwindSafe for EthereumWallet
impl Send for EthereumWallet
impl Sync for EthereumWallet
impl Unpin for EthereumWallet
impl !UnwindSafe for EthereumWallet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more