Trait fuels_signers::Signer
source · pub trait Signer: Debug + Send + Sync {
type Error: Error + Send + Sync;
fn sign_message<'life0, 'async_trait, S>(
&'life0 self,
message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where
S: 'async_trait + Send + Sync + AsRef<[u8]>,
Self: 'async_trait,
'life0: 'async_trait;
fn sign_transaction<'life0, 'life1, 'async_trait, Tx>(
&'life0 self,
message: &'life1 mut Tx
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>
where
Tx: 'async_trait + Cacheable + UniqueIdentifier + Witnesses + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn address(&self) -> &Bech32Address;
}
Expand description
Trait for signing transactions and messages
Implement this trait to support different signing modes, e.g. Ledger, hosted etc.
Required Associated Types§
Required Methods§
sourcefn sign_message<'life0, 'async_trait, S>(
&'life0 self,
message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>where
S: 'async_trait + Send + Sync + AsRef<[u8]>,
Self: 'async_trait,
'life0: 'async_trait,
fn sign_message<'life0, 'async_trait, S>(
&'life0 self,
message: S
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>where
S: 'async_trait + Send + Sync + AsRef<[u8]>,
Self: 'async_trait,
'life0: 'async_trait,
Signs the hash of the provided message
sourcefn sign_transaction<'life0, 'life1, 'async_trait, Tx>(
&'life0 self,
message: &'life1 mut Tx
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>where
Tx: 'async_trait + Cacheable + UniqueIdentifier + Witnesses + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sign_transaction<'life0, 'life1, 'async_trait, Tx>(
&'life0 self,
message: &'life1 mut Tx
) -> Pin<Box<dyn Future<Output = Result<Signature, Self::Error>> + Send + 'async_trait>>where
Tx: 'async_trait + Cacheable + UniqueIdentifier + Witnesses + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Signs the transaction
sourcefn address(&self) -> &Bech32Address
fn address(&self) -> &Bech32Address
Returns the signer’s Fuel Address