reth_rpc_eth_api/helpers/
signer.rsuse alloy_dyn_abi::TypedData;
use alloy_primitives::{Address, PrimitiveSignature as Signature};
use alloy_rpc_types_eth::TransactionRequest;
use dyn_clone::DynClone;
use reth_primitives::TransactionSigned;
use reth_rpc_eth_types::SignError;
use std::result;
pub type Result<T> = result::Result<T, SignError>;
#[async_trait::async_trait]
pub trait EthSigner: Send + Sync + DynClone {
fn accounts(&self) -> Vec<Address>;
fn is_signer_for(&self, addr: &Address) -> bool {
self.accounts().contains(addr)
}
async fn sign(&self, address: Address, message: &[u8]) -> Result<Signature>;
async fn sign_transaction(
&self,
request: TransactionRequest,
address: &Address,
) -> Result<TransactionSigned>;
fn sign_typed_data(&self, address: Address, payload: &TypedData) -> Result<Signature>;
}
dyn_clone::clone_trait_object!(EthSigner);
#[auto_impl::auto_impl(&)]
pub trait AddDevSigners {
fn with_dev_accounts(&self);
}