openzeppelin_relayer::services::provider

Trait SolanaProviderTrait

Source
pub trait SolanaProviderTrait: Send + Sync {
Show 14 methods // Required methods fn get_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_latest_blockhash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Hash, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_latest_blockhash_with_commitment<'life0, 'async_trait>( &'life0 self, commitment: CommitmentConfig, ) -> Pin<Box<dyn Future<Output = Result<(Hash, u64), SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_transaction<'life0, 'life1, 'async_trait>( &'life0 self, transaction: &'life1 Transaction, ) -> Pin<Box<dyn Future<Output = Result<Signature, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn confirm_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signature: &'life1 Signature, ) -> Pin<Box<dyn Future<Output = Result<bool, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_minimum_balance_for_rent_exemption<'life0, 'async_trait>( &'life0 self, data_size: usize, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn simulate_transaction<'life0, 'life1, 'async_trait>( &'life0 self, transaction: &'life1 Transaction, ) -> Pin<Box<dyn Future<Output = Result<RpcSimulateTransactionResult, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_account_from_str<'life0, 'life1, 'async_trait>( &'life0 self, account: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Account, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_account_from_pubkey<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<Account, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_token_metadata_from_pubkey<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TokenMetadata, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn is_blockhash_valid<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, commitment: CommitmentConfig, ) -> Pin<Box<dyn Future<Output = Result<bool, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_fee_for_message<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_recent_prioritization_fees<'life0, 'life1, 'async_trait>( &'life0 self, addresses: &'life1 [Pubkey], ) -> Pin<Box<dyn Future<Output = Result<Vec<RpcPrioritizationFee>, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn calculate_total_fee<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait;
}
Expand description

A trait that abstracts common Solana provider operations.

Required Methods§

Source

fn get_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves the balance (in lamports) for the given address.

Source

fn get_latest_blockhash<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Hash, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the latest blockhash as a 32-byte array.

Source

fn get_latest_blockhash_with_commitment<'life0, 'async_trait>( &'life0 self, commitment: CommitmentConfig, ) -> Pin<Box<dyn Future<Output = Result<(Hash, u64), SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn send_transaction<'life0, 'life1, 'async_trait>( &'life0 self, transaction: &'life1 Transaction, ) -> Pin<Box<dyn Future<Output = Result<Signature, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Sends a transaction to the Solana network.

Source

fn confirm_transaction<'life0, 'life1, 'async_trait>( &'life0 self, signature: &'life1 Signature, ) -> Pin<Box<dyn Future<Output = Result<bool, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Confirms a transaction given its signature.

Source

fn get_minimum_balance_for_rent_exemption<'life0, 'async_trait>( &'life0 self, data_size: usize, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the minimum balance required for rent exemption for the specified data size.

Source

fn simulate_transaction<'life0, 'life1, 'async_trait>( &'life0 self, transaction: &'life1 Transaction, ) -> Pin<Box<dyn Future<Output = Result<RpcSimulateTransactionResult, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Simulates a transaction and returns the simulation result.

Source

fn get_account_from_str<'life0, 'life1, 'async_trait>( &'life0 self, account: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Account, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve an account given its string representation.

Source

fn get_account_from_pubkey<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 Pubkey, ) -> Pin<Box<dyn Future<Output = Result<Account, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve an account given its Pubkey.

Source

fn get_token_metadata_from_pubkey<'life0, 'life1, 'async_trait>( &'life0 self, pubkey: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<TokenMetadata, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieve token metadata from the provided pubkey.

Source

fn is_blockhash_valid<'life0, 'life1, 'async_trait>( &'life0 self, hash: &'life1 Hash, commitment: CommitmentConfig, ) -> Pin<Box<dyn Future<Output = Result<bool, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a blockhash is valid.

Source

fn get_fee_for_message<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

get fee for message

Source

fn get_recent_prioritization_fees<'life0, 'life1, 'async_trait>( &'life0 self, addresses: &'life1 [Pubkey], ) -> Pin<Box<dyn Future<Output = Result<Vec<RpcPrioritizationFee>, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

get recent prioritization fees

Source

fn calculate_total_fee<'life0, 'life1, 'async_trait>( &'life0 self, message: &'life1 Message, ) -> Pin<Box<dyn Future<Output = Result<u64, SolanaProviderError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

calculate total fee

Implementors§