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§
sourcefn 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,
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.