Trait SolanaClientTrait

Source
pub trait SolanaClientTrait {
    // Required methods
    fn get_transactions<'life0, 'async_trait>(
        &'life0 self,
        slot: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SolanaTransaction>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transaction<'life0, 'async_trait>(
        &'life0 self,
        signature: String,
    ) -> Pin<Box<dyn Future<Output = Result<Option<SolanaTransaction>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_signatures_for_address_with_info<'life0, 'async_trait>(
        &'life0 self,
        address: String,
        limit: Option<usize>,
        min_slot: Option<u64>,
        until_signature: Option<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SignatureInfo>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_signatures_for_address<'life0, 'async_trait>(
        &'life0 self,
        address: String,
        start_slot: u64,
        end_slot: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SignatureInfo>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_transactions_for_addresses<'life0, 'life1, 'async_trait>(
        &'life0 self,
        addresses: &'life1 [String],
        start_slot: u64,
        end_slot: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<SolanaTransaction>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_blocks_for_addresses<'life0, 'life1, 'async_trait>(
        &'life0 self,
        addresses: &'life1 [String],
        start_slot: u64,
        end_slot: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockType>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_account_info<'life0, 'async_trait>(
        &'life0 self,
        pubkey: String,
    ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_program_accounts<'life0, 'async_trait>(
        &'life0 self,
        program_id: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Extended functionality specific to the Solana blockchain

Required Methods§

Source

fn get_transactions<'life0, 'async_trait>( &'life0 self, slot: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<SolanaTransaction>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves transactions for a specific slot

Source

fn get_transaction<'life0, 'async_trait>( &'life0 self, signature: String, ) -> Pin<Box<dyn Future<Output = Result<Option<SolanaTransaction>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a single transaction by signature

Source

fn get_signatures_for_address_with_info<'life0, 'async_trait>( &'life0 self, address: String, limit: Option<usize>, min_slot: Option<u64>, until_signature: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SignatureInfo>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves signatures with full info (slot, err, block_time) for an address Optionally filter by slot range

Source

fn get_all_signatures_for_address<'life0, 'async_trait>( &'life0 self, address: String, start_slot: u64, end_slot: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<SignatureInfo>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all signatures for an address within a slot range with automatic pagination This method handles pagination internally and returns all signatures up to a safety limit

Source

fn get_transactions_for_addresses<'life0, 'life1, 'async_trait>( &'life0 self, addresses: &'life1 [String], start_slot: u64, end_slot: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<SolanaTransaction>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves transactions for multiple addresses within a slot range This is the optimized method that uses getSignaturesForAddress instead of getBlock

Source

fn get_blocks_for_addresses<'life0, 'life1, 'async_trait>( &'life0 self, addresses: &'life1 [String], start_slot: u64, end_slot: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<Vec<BlockType>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves blocks containing only transactions relevant to the specified addresses This is the main optimization: instead of fetching all blocks, we fetch only transactions that involve the monitored addresses and group them into virtual blocks

Returns BlockType::Solana blocks, compatible with the existing filter infrastructure

Source

fn get_account_info<'life0, 'async_trait>( &'life0 self, pubkey: String, ) -> Pin<Box<dyn Future<Output = Result<Value, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves account info for a given public key

Source

fn get_program_accounts<'life0, 'async_trait>( &'life0 self, program_id: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<Value>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves program accounts for a given program ID

Implementors§