Trait reth::rpc::api::servers::eth::helpers::signer::EthSigner

source ·
pub trait EthSigner: 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(
        &self,
        request: TypedTransactionRequest,
        address: &Address,
    ) -> Result<TransactionSigned, SignError>;
    fn sign_typed_data(
        &self,
        address: Address,
        payload: &TypedData,
    ) -> Result<Signature, SignError>;

    // 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, SignError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Returns the signature

source

fn sign_transaction( &self, request: TypedTransactionRequest, address: &Address, ) -> Result<TransactionSigned, SignError>

signs a transaction request using the given account in request

source

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

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

Trait Implementations§

source§

impl<'clone> Clone for Box<dyn EthSigner + 'clone>

source§

fn clone(&self) -> Box<dyn EthSigner + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EthSigner + Send + 'clone>

source§

fn clone(&self) -> Box<dyn EthSigner + Send + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EthSigner + Send + Sync + 'clone>

source§

fn clone(&self) -> Box<dyn EthSigner + Send + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn EthSigner + Sync + 'clone>

source§

fn clone(&self) -> Box<dyn EthSigner + Sync + 'clone>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§