Struct EthereumWallet
pub struct EthereumWallet {
default: Address,
signers: HashMap<Address, Arc<dyn TxSigner<Signature> + Send + Sync>, FbBuildHasher<20>>,
}
Expand description
A wallet capable of signing any transaction for the Ethereum network.
Fields§
§default: Address
§signers: HashMap<Address, Arc<dyn TxSigner<Signature> + Send + Sync>, FbBuildHasher<20>>
Implementations§
§impl EthereumWallet
impl EthereumWallet
pub fn new<S>(signer: S) -> EthereumWallet
pub fn new<S>(signer: S) -> EthereumWallet
Create a new signer with the given signer as the default signer.
pub 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.
pub 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.
pub fn default_signer(&self) -> Arc<dyn TxSigner<Signature> + Send + Sync>
pub fn default_signer(&self) -> Arc<dyn TxSigner<Signature> + Send + Sync>
Get the default signer.
Trait Implementations§
§impl Clone for EthereumWallet
impl Clone for EthereumWallet
§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 more§impl Debug for EthereumWallet
impl Debug for EthereumWallet
§impl Default for EthereumWallet
impl Default for EthereumWallet
§fn default() -> EthereumWallet
fn default() -> EthereumWallet
§impl<S> From<S> for EthereumWallet
impl<S> From<S> for EthereumWallet
§fn from(signer: S) -> EthereumWallet
fn from(signer: S) -> EthereumWallet
§impl<N> NetworkWallet<N> for EthereumWalletwhere
N: Network<UnsignedTx = TypedTransaction, TxEnvelope = TxEnvelope>,
impl<N> NetworkWallet<N> for EthereumWalletwhere
N: Network<UnsignedTx = TypedTransaction, TxEnvelope = TxEnvelope>,
§fn default_signer_address(&self) -> Address
fn default_signer_address(&self) -> Address
NetworkWallet::sign_transaction_from
when no specific signer is
specified.§fn has_signer_for(&self, address: &Address) -> bool
fn has_signer_for(&self, address: &Address) -> bool
§fn signer_addresses(&self) -> impl Iterator<Item = Address>
fn signer_addresses(&self) -> impl Iterator<Item = Address>
§async fn sign_transaction_from(
&self,
sender: Address,
tx: TypedTransaction,
) -> Result<TxEnvelope, Error>
async fn sign_transaction_from( &self, sender: Address, tx: TypedTransaction, ) -> Result<TxEnvelope, Error>
§fn sign_transaction(
&self,
tx: <N as Network>::UnsignedTx,
) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>
fn sign_transaction( &self, tx: <N as Network>::UnsignedTx, ) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>
§fn sign_request(
&self,
request: <N as Network>::TransactionRequest,
) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>
fn sign_request( &self, request: <N as Network>::TransactionRequest, ) -> impl Send + Future<Output = Result<<N as Network>::TxEnvelope, Error>>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 72 bytes