reth_rpc_eth_api::helpers::signer

Trait EthSigner

Source
pub trait EthSigner<T>:
    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>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn sign_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        request: TransactionRequest,
        address: &'life1 Address,
    ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn sign_typed_data(
        &self,
        address: Address,
        payload: &TypedData,
    ) -> Result<Signature>;

    // Provided method
    fn is_signer_for(&self, addr: &Address) -> bool { ... }
}
Expand description

An Ethereum Signer used via RPC.

Required Methods§

Source

fn accounts(&self) -> Vec<Address>

Returns the available accounts for this signer.

Source

fn sign<'life0, 'life1, 'async_trait>( &'life0 self, address: Address, message: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns the signature

Source

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, request: TransactionRequest, address: &'life1 Address, ) -> Pin<Box<dyn Future<Output = Result<T>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

signs a transaction request using the given account in request

Source

fn sign_typed_data( &self, address: Address, payload: &TypedData, ) -> Result<Signature>

Encodes and signs the typed data according EIP-712. Payload must implement Eip712 trait.

Provided Methods§

Source

fn is_signer_for(&self, addr: &Address) -> bool

Returns true whether this signer can sign for this address

Implementors§