Skip to main content

SolanaSigner

Trait SolanaSigner 

Source
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§

Source

fn pubkey(&self) -> Address

Get the public key of this signer

Source

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,

Sign a Solana transaction

§Arguments
  • tx - The transaction to sign (will be modified in place)
§Returns

The base64 encoded transaction and signature

Source

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,

Sign an arbitrary message

§Arguments
  • message - The message bytes to sign
§Returns

The signature produced by signing the message

Source

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

Source

fn is_available<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Check if the signer is available and healthy

§Returns

true if the signer can be used, false otherwise

Implementors§