alloy_network

Trait TxSigner

source
pub trait TxSigner<Signature> {
    // Required methods
    fn address(&self) -> Address;
    fn sign_transaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tx: &'life1 mut dyn SignableTransaction<Signature>,
    ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Asynchronous transaction signer, capable of signing any SignableTransaction for the given Signature type.

A signer should hold an optional ChainId value, which is used for EIP-155 replay protection.

If chain_id is Some, EIP-155 should be applied to the input transaction in sign_transaction, and to the resulting signature in all the methods. If chain_id is None, EIP-155 should not be applied.

Synchronous signers should implement both this trait and TxSignerSync.

Required Methods§

source

fn address(&self) -> Address

Get the address of the signer.

source

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Asynchronously sign an unsigned transaction.

Implementations on Foreign Types§

source§

impl<'a, Signature, T: 'a + TxSigner<Signature> + ?Sized> TxSigner<Signature> for &'a T

source§

fn address(&self) -> Address

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<'a, Signature, T: 'a + TxSigner<Signature> + ?Sized> TxSigner<Signature> for &'a mut T

source§

fn address(&self) -> Address

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<Signature, T: TxSigner<Signature> + ?Sized> TxSigner<Signature> for Box<T>

source§

fn address(&self) -> Address

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<Signature, T: TxSigner<Signature> + ?Sized> TxSigner<Signature> for Rc<T>

source§

fn address(&self) -> Address

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<Signature, T: TxSigner<Signature> + ?Sized> TxSigner<Signature> for Arc<T>

source§

fn address(&self) -> Address

source§

fn sign_transaction<'life0, 'life1, 'async_trait>( &'life0 self, tx: &'life1 mut dyn SignableTransaction<Signature>, ) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§