pub struct SolanaClient {
pub inner: Mutex<SolanaClientInner>,
}
Expand description
An asynchronous Solana client that can manage multiple RPC clients, each of them with its own limits and configuration.
Fields§
§inner: Mutex<SolanaClientInner>
Implementations§
Source§impl SolanaClient
impl SolanaClient
Sourcepub fn new_with_default(default_rpc: Arc<RpcClient>) -> Self
pub fn new_with_default(default_rpc: Arc<RpcClient>) -> Self
Creates a new SolanaClient
with a default RPC client.
Examples found in repository?
examples/genesysgo.rs (line 16)
11async fn main() {
12 let default_rpc = Arc::new(RpcClient::new(
13 "https://api.mainnet-beta.solana.com".to_string(),
14 ));
15 let genesysgo_rpc = Arc::new(RpcClient::new("<your-genesysgo-rpc-url>".to_string()));
16 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
17 SolanaClientRpc::new(genesysgo_rpc)
18 // Requests per second limit.
19 .add_limit(
20 SolanaClientRateLimit::new(
21 1000, /* 1 second */
22 1, /* 1 request per second */
23 1, /* all requests count the same */
24 )
25 // Ignore GetMultipleAccounts requests here to track them in the next limit.
26 .ignore_endpoint(RpcRequest::GetMultipleAccounts),
27 )
28 // Requests per second limit for GetMultipleAccounts.
29 .add_limit(
30 SolanaClientRateLimit::new(
31 60 * 1000, /* 1 minute */
32 6, /* 6 request per minute */
33 1, /* all requests count the same */
34 )
35 // Ignore all endpoints and include only GetMultipleAccounts requests here.
36 .ignores_all_endpoints()
37 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 1),
38 ),
39 );
40
41 let version = client.get_version().await.unwrap();
42
43 println!("Cluster version: {}", version.solana_core);
44}
More examples
examples/quicknode.rs (line 17)
12async fn main() {
13 let default_rpc = Arc::new(RpcClient::new(
14 "https://api.mainnet-beta.solana.com".to_string(),
15 ));
16 let quicknode_rpc = Arc::new(RpcClient::new("<your-quicknode-rpc-url>".to_string()));
17 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
18 SolanaClientRpc::new(quicknode_rpc)
19 // Credits / month limits.
20 .add_limit(
21 SolanaClientRateLimit::new(
22 30 * 24 * 60 * 60 * 1000, /* 30 days */
23 10_000_000, /* credits per month */
24 1, /* default cost in credits for endpoints */
25 )
26 // List of all endpoints whose credits are different than the default value.
27 .add_endpoint_amount(RpcRequest::GetAccountInfo, 2)
28 .add_endpoint_amount(RpcRequest::GetBlockTime, 2)
29 .add_endpoint_amount(RpcRequest::GetClusterNodes, 2)
30 .add_endpoint_amount(RpcRequest::GetBlock, 23)
31 .add_endpoint_amount(RpcRequest::GetEpochInfo, 2)
32 .add_endpoint_amount(RpcRequest::GetFirstAvailableBlock, 3)
33 .add_endpoint_amount(RpcRequest::GetHealth, 2)
34 .add_endpoint_amount(RpcRequest::GetHighestSnapshotSlot, 2)
35 .add_endpoint_amount(RpcRequest::GetInflationGovernor, 2)
36 .add_endpoint_amount(RpcRequest::GetLatestBlockhash, 2)
37 .add_endpoint_amount(RpcRequest::GetMinimumBalanceForRentExemption, 3)
38 .add_endpoint_amount(RpcRequest::GetProgramAccounts, 35)
39 .add_endpoint_amount(RpcRequest::GetRecentPerformanceSamples, 4)
40 .add_endpoint_amount(RpcRequest::GetSignaturesForAddress, 3)
41 .add_endpoint_amount(RpcRequest::GetTokenSupply, 2)
42 .add_endpoint_amount(RpcRequest::GetTransaction, 3)
43 .add_endpoint_amount(RpcRequest::GetVersion, 2)
44 .add_endpoint_amount(RpcRequest::SimulateTransaction, 4)
45 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 10)
46 .add_endpoint_amount(RpcRequest::GetLargestAccounts, 259),
47 )
48 // Requests / second limit.
49 .add_limit(SolanaClientRateLimit::new(
50 1000, /* 1 second */
51 25, /* 25 requests per second */
52 1, /* all requests count the same */
53 )),
54 );
55
56 let version = client.get_version().await.unwrap();
57
58 println!("Cluster version: {}", version.solana_core);
59}
Sourcepub fn add_rpc(self, rpc: SolanaClientRpc) -> Self
pub fn add_rpc(self, rpc: SolanaClientRpc) -> Self
Adds a new SolanaClientRpc
to the RPC list.
Examples found in repository?
examples/genesysgo.rs (lines 16-39)
11async fn main() {
12 let default_rpc = Arc::new(RpcClient::new(
13 "https://api.mainnet-beta.solana.com".to_string(),
14 ));
15 let genesysgo_rpc = Arc::new(RpcClient::new("<your-genesysgo-rpc-url>".to_string()));
16 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
17 SolanaClientRpc::new(genesysgo_rpc)
18 // Requests per second limit.
19 .add_limit(
20 SolanaClientRateLimit::new(
21 1000, /* 1 second */
22 1, /* 1 request per second */
23 1, /* all requests count the same */
24 )
25 // Ignore GetMultipleAccounts requests here to track them in the next limit.
26 .ignore_endpoint(RpcRequest::GetMultipleAccounts),
27 )
28 // Requests per second limit for GetMultipleAccounts.
29 .add_limit(
30 SolanaClientRateLimit::new(
31 60 * 1000, /* 1 minute */
32 6, /* 6 request per minute */
33 1, /* all requests count the same */
34 )
35 // Ignore all endpoints and include only GetMultipleAccounts requests here.
36 .ignores_all_endpoints()
37 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 1),
38 ),
39 );
40
41 let version = client.get_version().await.unwrap();
42
43 println!("Cluster version: {}", version.solana_core);
44}
More examples
examples/quicknode.rs (lines 17-54)
12async fn main() {
13 let default_rpc = Arc::new(RpcClient::new(
14 "https://api.mainnet-beta.solana.com".to_string(),
15 ));
16 let quicknode_rpc = Arc::new(RpcClient::new("<your-quicknode-rpc-url>".to_string()));
17 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
18 SolanaClientRpc::new(quicknode_rpc)
19 // Credits / month limits.
20 .add_limit(
21 SolanaClientRateLimit::new(
22 30 * 24 * 60 * 60 * 1000, /* 30 days */
23 10_000_000, /* credits per month */
24 1, /* default cost in credits for endpoints */
25 )
26 // List of all endpoints whose credits are different than the default value.
27 .add_endpoint_amount(RpcRequest::GetAccountInfo, 2)
28 .add_endpoint_amount(RpcRequest::GetBlockTime, 2)
29 .add_endpoint_amount(RpcRequest::GetClusterNodes, 2)
30 .add_endpoint_amount(RpcRequest::GetBlock, 23)
31 .add_endpoint_amount(RpcRequest::GetEpochInfo, 2)
32 .add_endpoint_amount(RpcRequest::GetFirstAvailableBlock, 3)
33 .add_endpoint_amount(RpcRequest::GetHealth, 2)
34 .add_endpoint_amount(RpcRequest::GetHighestSnapshotSlot, 2)
35 .add_endpoint_amount(RpcRequest::GetInflationGovernor, 2)
36 .add_endpoint_amount(RpcRequest::GetLatestBlockhash, 2)
37 .add_endpoint_amount(RpcRequest::GetMinimumBalanceForRentExemption, 3)
38 .add_endpoint_amount(RpcRequest::GetProgramAccounts, 35)
39 .add_endpoint_amount(RpcRequest::GetRecentPerformanceSamples, 4)
40 .add_endpoint_amount(RpcRequest::GetSignaturesForAddress, 3)
41 .add_endpoint_amount(RpcRequest::GetTokenSupply, 2)
42 .add_endpoint_amount(RpcRequest::GetTransaction, 3)
43 .add_endpoint_amount(RpcRequest::GetVersion, 2)
44 .add_endpoint_amount(RpcRequest::SimulateTransaction, 4)
45 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 10)
46 .add_endpoint_amount(RpcRequest::GetLargestAccounts, 259),
47 )
48 // Requests / second limit.
49 .add_limit(SolanaClientRateLimit::new(
50 1000, /* 1 second */
51 25, /* 25 requests per second */
52 1, /* all requests count the same */
53 )),
54 );
55
56 let version = client.get_version().await.unwrap();
57
58 println!("Cluster version: {}", version.solana_core);
59}
Sourcepub fn set_move_rpc_index(self, move_index: bool) -> Self
pub fn set_move_rpc_index(self, move_index: bool) -> Self
Whether the index must move forward when an RPC cannot be used.
pub async fn send_and_confirm_transaction( &self, transaction: &impl SerializableTransaction, ) -> Result<Signature>
pub async fn send_and_confirm_transaction_with_spinner( &self, transaction: &impl SerializableTransaction, ) -> Result<Signature>
pub async fn send_and_confirm_transaction_with_spinner_and_commitment( &self, transaction: &impl SerializableTransaction, commitment: CommitmentConfig, ) -> Result<Signature>
pub async fn send_and_confirm_transaction_with_spinner_and_config( &self, transaction: &impl SerializableTransaction, commitment: CommitmentConfig, config: RpcSendTransactionConfig, ) -> Result<Signature>
pub async fn send_transaction( &self, transaction: &impl SerializableTransaction, ) -> Result<Signature>
pub async fn send_transaction_with_config( &self, transaction: &impl SerializableTransaction, config: RpcSendTransactionConfig, ) -> Result<Signature>
pub async fn confirm_transaction(&self, signature: &Signature) -> Result<bool>
pub async fn confirm_transaction_with_commitment( &self, signature: &Signature, commitment_config: CommitmentConfig, ) -> RpcResult<bool>
pub async fn confirm_transaction_with_spinner( &self, signature: &Signature, recent_blockhash: &Hash, commitment: CommitmentConfig, ) -> Result<()>
pub async fn simulate_transaction( &self, transaction: &impl SerializableTransaction, ) -> RpcResult<RpcSimulateTransactionResult>
pub async fn simulate_transaction_with_config( &self, transaction: &impl SerializableTransaction, config: RpcSimulateTransactionConfig, ) -> RpcResult<RpcSimulateTransactionResult>
pub async fn get_highest_snapshot_slot(&self) -> Result<RpcSnapshotSlotInfo>
pub async fn get_signature_status( &self, signature: &Signature, ) -> Result<Option<Result<()>>>
pub async fn get_signature_statuses( &self, signatures: &[Signature], ) -> RpcResult<Vec<Option<TransactionStatus>>>
pub async fn get_signature_statuses_with_history( &self, signatures: &[Signature], ) -> RpcResult<Vec<Option<TransactionStatus>>>
pub async fn get_signature_status_with_commitment( &self, signature: &Signature, commitment_config: CommitmentConfig, ) -> Result<Option<Result<()>>>
pub async fn get_signature_status_with_commitment_and_history( &self, signature: &Signature, commitment_config: CommitmentConfig, search_transaction_history: bool, ) -> Result<Option<Result<()>>>
pub async fn get_slot(&self) -> Result<Slot>
pub async fn get_slot_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<Slot>
pub async fn get_block_height(&self) -> Result<u64>
pub async fn get_block_height_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<u64>
pub async fn get_slot_leaders( &self, start_slot: Slot, limit: u64, ) -> Result<Vec<Pubkey>>
pub async fn get_block_production(&self) -> RpcResult<RpcBlockProduction>
pub async fn get_block_production_with_config( &self, config: RpcBlockProductionConfig, ) -> RpcResult<RpcBlockProduction>
pub async fn get_stake_activation( &self, stake_account: Pubkey, epoch: Option<Epoch>, ) -> Result<RpcStakeActivation>
pub async fn supply(&self) -> RpcResult<RpcSupply>
pub async fn supply_with_commitment( &self, commitment_config: CommitmentConfig, ) -> RpcResult<RpcSupply>
pub async fn get_largest_accounts_with_config( &self, config: RpcLargestAccountsConfig, ) -> RpcResult<Vec<RpcAccountBalance>>
pub async fn get_vote_accounts(&self) -> Result<RpcVoteAccountStatus>
pub async fn get_vote_accounts_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<RpcVoteAccountStatus>
pub async fn get_vote_accounts_with_config( &self, config: RpcGetVoteAccountsConfig, ) -> Result<RpcVoteAccountStatus>
pub async fn wait_for_max_stake( &self, commitment: CommitmentConfig, max_stake_percent: f32, ) -> Result<()>
pub async fn get_cluster_nodes(&self) -> Result<Vec<RpcContactInfo>>
pub async fn get_block(&self, slot: Slot) -> Result<EncodedConfirmedBlock>
pub async fn get_block_with_encoding( &self, slot: Slot, encoding: UiTransactionEncoding, ) -> Result<EncodedConfirmedBlock>
pub async fn get_block_with_config( &self, slot: Slot, config: RpcBlockConfig, ) -> Result<UiConfirmedBlock>
pub async fn get_blocks( &self, start_slot: Slot, end_slot: Option<Slot>, ) -> Result<Vec<Slot>>
pub async fn get_blocks_with_commitment( &self, start_slot: Slot, end_slot: Option<Slot>, commitment_config: CommitmentConfig, ) -> Result<Vec<Slot>>
pub async fn get_blocks_with_limit( &self, start_slot: Slot, limit: usize, ) -> Result<Vec<Slot>>
pub async fn get_blocks_with_limit_and_commitment( &self, start_slot: Slot, limit: usize, commitment_config: CommitmentConfig, ) -> Result<Vec<Slot>>
pub async fn get_signatures_for_address( &self, address: &Pubkey, ) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>>
pub async fn get_signatures_for_address_with_config( &self, address: &Pubkey, config: GetConfirmedSignaturesForAddress2Config, ) -> Result<Vec<RpcConfirmedTransactionStatusWithSignature>>
pub async fn get_transaction( &self, signature: &Signature, encoding: UiTransactionEncoding, ) -> Result<EncodedConfirmedTransactionWithStatusMeta>
pub async fn get_transaction_with_config( &self, signature: &Signature, config: RpcTransactionConfig, ) -> Result<EncodedConfirmedTransactionWithStatusMeta>
pub async fn get_block_time(&self, slot: Slot) -> Result<UnixTimestamp>
pub async fn get_epoch_info(&self) -> Result<EpochInfo>
pub async fn get_epoch_info_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<EpochInfo>
pub async fn get_leader_schedule( &self, slot: Option<Slot>, ) -> Result<Option<RpcLeaderSchedule>>
pub async fn get_leader_schedule_with_commitment( &self, slot: Option<Slot>, commitment_config: CommitmentConfig, ) -> Result<Option<RpcLeaderSchedule>>
pub async fn get_leader_schedule_with_config( &self, slot: Option<Slot>, config: RpcLeaderScheduleConfig, ) -> Result<Option<RpcLeaderSchedule>>
pub async fn get_epoch_schedule(&self) -> Result<EpochSchedule>
pub async fn get_recent_performance_samples( &self, limit: Option<usize>, ) -> Result<Vec<RpcPerfSample>>
pub async fn get_identity(&self) -> Result<Pubkey>
pub async fn get_inflation_governor(&self) -> Result<RpcInflationGovernor>
pub async fn get_inflation_rate(&self) -> Result<RpcInflationRate>
pub async fn get_inflation_reward( &self, addresses: &[Pubkey], epoch: Option<Epoch>, ) -> Result<Vec<Option<RpcInflationReward>>>
Sourcepub async fn get_version(&self) -> Result<RpcVersionInfo>
pub async fn get_version(&self) -> Result<RpcVersionInfo>
Examples found in repository?
examples/genesysgo.rs (line 41)
11async fn main() {
12 let default_rpc = Arc::new(RpcClient::new(
13 "https://api.mainnet-beta.solana.com".to_string(),
14 ));
15 let genesysgo_rpc = Arc::new(RpcClient::new("<your-genesysgo-rpc-url>".to_string()));
16 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
17 SolanaClientRpc::new(genesysgo_rpc)
18 // Requests per second limit.
19 .add_limit(
20 SolanaClientRateLimit::new(
21 1000, /* 1 second */
22 1, /* 1 request per second */
23 1, /* all requests count the same */
24 )
25 // Ignore GetMultipleAccounts requests here to track them in the next limit.
26 .ignore_endpoint(RpcRequest::GetMultipleAccounts),
27 )
28 // Requests per second limit for GetMultipleAccounts.
29 .add_limit(
30 SolanaClientRateLimit::new(
31 60 * 1000, /* 1 minute */
32 6, /* 6 request per minute */
33 1, /* all requests count the same */
34 )
35 // Ignore all endpoints and include only GetMultipleAccounts requests here.
36 .ignores_all_endpoints()
37 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 1),
38 ),
39 );
40
41 let version = client.get_version().await.unwrap();
42
43 println!("Cluster version: {}", version.solana_core);
44}
More examples
examples/quicknode.rs (line 56)
12async fn main() {
13 let default_rpc = Arc::new(RpcClient::new(
14 "https://api.mainnet-beta.solana.com".to_string(),
15 ));
16 let quicknode_rpc = Arc::new(RpcClient::new("<your-quicknode-rpc-url>".to_string()));
17 let client = SolanaClient::new_with_default(default_rpc).add_rpc(
18 SolanaClientRpc::new(quicknode_rpc)
19 // Credits / month limits.
20 .add_limit(
21 SolanaClientRateLimit::new(
22 30 * 24 * 60 * 60 * 1000, /* 30 days */
23 10_000_000, /* credits per month */
24 1, /* default cost in credits for endpoints */
25 )
26 // List of all endpoints whose credits are different than the default value.
27 .add_endpoint_amount(RpcRequest::GetAccountInfo, 2)
28 .add_endpoint_amount(RpcRequest::GetBlockTime, 2)
29 .add_endpoint_amount(RpcRequest::GetClusterNodes, 2)
30 .add_endpoint_amount(RpcRequest::GetBlock, 23)
31 .add_endpoint_amount(RpcRequest::GetEpochInfo, 2)
32 .add_endpoint_amount(RpcRequest::GetFirstAvailableBlock, 3)
33 .add_endpoint_amount(RpcRequest::GetHealth, 2)
34 .add_endpoint_amount(RpcRequest::GetHighestSnapshotSlot, 2)
35 .add_endpoint_amount(RpcRequest::GetInflationGovernor, 2)
36 .add_endpoint_amount(RpcRequest::GetLatestBlockhash, 2)
37 .add_endpoint_amount(RpcRequest::GetMinimumBalanceForRentExemption, 3)
38 .add_endpoint_amount(RpcRequest::GetProgramAccounts, 35)
39 .add_endpoint_amount(RpcRequest::GetRecentPerformanceSamples, 4)
40 .add_endpoint_amount(RpcRequest::GetSignaturesForAddress, 3)
41 .add_endpoint_amount(RpcRequest::GetTokenSupply, 2)
42 .add_endpoint_amount(RpcRequest::GetTransaction, 3)
43 .add_endpoint_amount(RpcRequest::GetVersion, 2)
44 .add_endpoint_amount(RpcRequest::SimulateTransaction, 4)
45 .add_endpoint_amount(RpcRequest::GetMultipleAccounts, 10)
46 .add_endpoint_amount(RpcRequest::GetLargestAccounts, 259),
47 )
48 // Requests / second limit.
49 .add_limit(SolanaClientRateLimit::new(
50 1000, /* 1 second */
51 25, /* 25 requests per second */
52 1, /* all requests count the same */
53 )),
54 );
55
56 let version = client.get_version().await.unwrap();
57
58 println!("Cluster version: {}", version.solana_core);
59}
pub async fn minimum_ledger_slot(&self) -> Result<Slot>
pub async fn get_account(&self, pubkey: &Pubkey) -> Result<Account>
pub async fn get_account_with_commitment( &self, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> RpcResult<Option<Account>>
pub async fn get_account_with_config( &self, pubkey: &Pubkey, config: RpcAccountInfoConfig, ) -> RpcResult<Option<Account>>
pub async fn get_max_retransmit_slot(&self) -> Result<Slot>
pub async fn get_max_shred_insert_slot(&self) -> Result<Slot>
pub async fn get_multiple_accounts( &self, pubkeys: &[Pubkey], ) -> Result<Vec<Option<Account>>>
pub async fn get_multiple_accounts_with_commitment( &self, pubkeys: &[Pubkey], commitment_config: CommitmentConfig, ) -> RpcResult<Vec<Option<Account>>>
pub async fn get_multiple_accounts_with_config( &self, pubkeys: &[Pubkey], config: RpcAccountInfoConfig, ) -> RpcResult<Vec<Option<Account>>>
pub async fn get_account_data(&self, pubkey: &Pubkey) -> Result<Vec<u8>>
pub async fn get_minimum_balance_for_rent_exemption( &self, data_len: usize, ) -> Result<u64>
pub async fn get_balance(&self, pubkey: &Pubkey) -> Result<u64>
pub async fn get_balance_with_commitment( &self, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> RpcResult<u64>
pub async fn get_program_accounts( &self, pubkey: &Pubkey, ) -> Result<Vec<(Pubkey, Account)>>
pub async fn get_program_accounts_with_config( &self, pubkey: &Pubkey, config: RpcProgramAccountsConfig, ) -> Result<Vec<(Pubkey, Account)>>
pub async fn get_stake_minimum_delegation(&self) -> Result<u64>
pub async fn get_stake_minimum_delegation_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<u64>
Sourcepub async fn get_transaction_count(&self) -> Result<u64>
pub async fn get_transaction_count(&self) -> Result<u64>
Request the transaction count.
pub async fn get_transaction_count_with_commitment( &self, commitment_config: CommitmentConfig, ) -> Result<u64>
pub async fn get_first_available_block(&self) -> Result<Slot>
pub async fn get_genesis_hash(&self) -> Result<Hash>
pub async fn get_health(&self) -> Result<()>
pub async fn get_token_account( &self, pubkey: &Pubkey, ) -> Result<Option<UiTokenAccount>>
pub async fn get_token_account_with_commitment( &self, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> RpcResult<Option<UiTokenAccount>>
pub async fn get_token_account_balance( &self, pubkey: &Pubkey, ) -> Result<UiTokenAmount>
pub async fn get_token_account_balance_with_commitment( &self, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> RpcResult<UiTokenAmount>
pub async fn get_token_accounts_by_delegate( &self, delegate: &Pubkey, token_account_filter: TokenAccountsFilter, ) -> Result<Vec<RpcKeyedAccount>>
pub async fn get_token_accounts_by_delegate_with_commitment( &self, delegate: &Pubkey, token_account_filter: TokenAccountsFilter, commitment_config: CommitmentConfig, ) -> RpcResult<Vec<RpcKeyedAccount>>
pub async fn get_token_accounts_by_owner( &self, owner: &Pubkey, token_account_filter: TokenAccountsFilter, ) -> Result<Vec<RpcKeyedAccount>>
pub async fn get_token_accounts_by_owner_with_commitment( &self, owner: &Pubkey, token_account_filter: TokenAccountsFilter, commitment_config: CommitmentConfig, ) -> RpcResult<Vec<RpcKeyedAccount>>
pub async fn get_token_supply(&self, mint: &Pubkey) -> Result<UiTokenAmount>
pub async fn get_token_supply_with_commitment( &self, mint: &Pubkey, commitment_config: CommitmentConfig, ) -> RpcResult<UiTokenAmount>
pub async fn request_airdrop( &self, pubkey: &Pubkey, lamports: u64, ) -> Result<Signature>
pub async fn request_airdrop_with_blockhash( &self, pubkey: &Pubkey, lamports: u64, recent_blockhash: &Hash, ) -> Result<Signature>
pub async fn request_airdrop_with_config( &self, pubkey: &Pubkey, lamports: u64, config: RpcRequestAirdropConfig, ) -> Result<Signature>
pub async fn poll_get_balance_with_commitment( &self, pubkey: &Pubkey, commitment_config: CommitmentConfig, ) -> Result<u64>
pub async fn wait_for_balance_with_commitment( &self, pubkey: &Pubkey, expected_balance: Option<u64>, commitment_config: CommitmentConfig, ) -> Result<u64>
Sourcepub async fn poll_for_signature(&self, signature: &Signature) -> Result<()>
pub async fn poll_for_signature(&self, signature: &Signature) -> Result<()>
Poll the server to confirm a transaction.
Sourcepub async fn poll_for_signature_with_commitment(
&self,
signature: &Signature,
commitment_config: CommitmentConfig,
) -> Result<()>
pub async fn poll_for_signature_with_commitment( &self, signature: &Signature, commitment_config: CommitmentConfig, ) -> Result<()>
Poll the server to confirm a transaction.
Sourcepub async fn poll_for_signature_confirmation(
&self,
signature: &Signature,
min_confirmed_blocks: usize,
) -> Result<usize>
pub async fn poll_for_signature_confirmation( &self, signature: &Signature, min_confirmed_blocks: usize, ) -> Result<usize>
Poll the server to confirm a transaction.
pub async fn get_num_blocks_since_signature_confirmation( &self, signature: &Signature, ) -> Result<usize>
pub async fn get_latest_blockhash(&self) -> Result<Hash>
pub async fn get_latest_blockhash_with_commitment( &self, commitment: CommitmentConfig, ) -> Result<(Hash, u64)>
pub async fn is_blockhash_valid( &self, blockhash: &Hash, commitment: CommitmentConfig, ) -> Result<bool>
pub async fn get_fee_for_message( &self, message: &impl SerializableMessage, ) -> Result<u64>
pub async fn get_new_latest_blockhash(&self, blockhash: &Hash) -> Result<Hash>
pub async fn send<T>(&self, request: RpcRequest, params: Value) -> Result<T>where
T: DeserializeOwned,
Auto Trait Implementations§
impl !Freeze for SolanaClient
impl !RefUnwindSafe for SolanaClient
impl Send for SolanaClient
impl Sync for SolanaClient
impl Unpin for SolanaClient
impl !UnwindSafe for SolanaClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more