pub trait SolanaSigner: Send + Sync {
// Required methods
fn pubkey(&self) -> Address;
fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn sign_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn sign_partial_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn is_available<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}Expand description
Trait for signing Solana transactions
All signer implementations must implement this trait to provide a unified interface for transaction signing.
Required Methods§
Sourcefn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn sign_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_message<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Signature, SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn sign_partial_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn sign_partial_transaction<'life0, 'life1, 'async_trait>(
&'life0 self,
tx: &'life1 mut Transaction,
) -> Pin<Box<dyn Future<Output = Result<(String, Signature), SignerError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Partially sign a transaction and return it as a base64-encoded string
This method signs the transaction and serializes it with requireAllSignatures: false,
making it suitable for multi-signature workflows where additional signatures will be
added later.
§Arguments
tx- The transaction to sign (will be modified in place)
§Returns
Base64-encoded partially-signed transaction