pub trait Signer: Send + Sync {
// 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, BlockchainError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sign_typed_data<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
payload: &'life1 TypedData,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn sign_hash<'life0, 'async_trait>(
&'life0 self,
address: Address,
hash: B256,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn sign_transaction(
&self,
request: TypedTransactionRequest,
address: &Address,
) -> Result<Signature, BlockchainError>;
// Provided method
fn is_signer_for(&self, addr: Address) -> bool { ... }
}
Expand description
A transaction signer
Required Methods§
Sourcefn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns the signature
Sourcefn sign_typed_data<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
payload: &'life1 TypedData,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_typed_data<'life0, 'life1, 'async_trait>(
&'life0 self,
address: Address,
payload: &'life1 TypedData,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Encodes and signs the typed data according EIP-712. Payload must conform to the EIP-712 standard.
Sourcefn sign_hash<'life0, 'async_trait>(
&'life0 self,
address: Address,
hash: B256,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn sign_hash<'life0, 'async_trait>(
&'life0 self,
address: Address,
hash: B256,
) -> Pin<Box<dyn Future<Output = Result<Signature, BlockchainError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Signs the given hash.
Sourcefn sign_transaction(
&self,
request: TypedTransactionRequest,
address: &Address,
) -> Result<Signature, BlockchainError>
fn sign_transaction( &self, request: TypedTransactionRequest, address: &Address, ) -> Result<Signature, BlockchainError>
signs a transaction request using the given account in request
Provided Methods§
Sourcefn is_signer_for(&self, addr: Address) -> bool
fn is_signer_for(&self, addr: Address) -> bool
Returns true
whether this signer can sign for this address