pub trait EthSigner<T, TxReq = TransactionRequest>:
Send
+ Sync
+ DynClone {
// Required methods
fn accounts(&self) -> Vec<Address>;
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
request: TxReq,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<T, SignError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn sign_typed_data(
&self,
address: Address,
payload: &TypedData,
) -> Result<Signature, SignError>;
// Provided method
fn is_signer_for(&self, addr: &Address) -> bool { ... }
}Available on crate feature
rpc only.Expand description
An Ethereum Signer used via RPC.
Required Methods§
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the signature
Sourcefn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
request: TxReq,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<T, SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
request: TxReq,
address: &'life1 Address,
) -> Pin<Box<dyn Future<Output = Result<T, SignError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
signs a transaction request using the given account in request
Provided Methods§
Sourcefn is_signer_for(&self, addr: &Address) -> bool
fn is_signer_for(&self, addr: &Address) -> bool
Returns true whether this signer can sign for this address
Trait Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".