Struct solana_client::rpc_client::RpcClient [−][src]
pub struct RpcClient { /* fields omitted */ }
Implementations
pub fn new_with_timeout_and_commitment(
url: String,
timeout: Duration,
commitment_config: CommitmentConfig
) -> Self
pub fn new_with_timeouts_and_commitment(
url: String,
timeout: Duration,
commitment_config: CommitmentConfig,
confirm_transaction_initial_timeout: Duration
) -> Self
pub fn new_socket_with_commitment(
addr: SocketAddr,
commitment_config: CommitmentConfig
) -> Self
pub fn confirm_transaction_with_commitment(
&self,
signature: &Signature,
commitment_config: CommitmentConfig
) -> RpcResult<bool>
pub fn send_transaction_with_config(
&self,
transaction: &Transaction,
config: RpcSendTransactionConfig
) -> ClientResult<Signature>
pub fn simulate_transaction(
&self,
transaction: &Transaction
) -> RpcResult<RpcSimulateTransactionResult>
pub fn simulate_transaction_with_config(
&self,
transaction: &Transaction,
config: RpcSimulateTransactionConfig
) -> RpcResult<RpcSimulateTransactionResult>
pub fn get_signature_statuses(
&self,
signatures: &[Signature]
) -> RpcResult<Vec<Option<TransactionStatus>>>
pub fn get_signature_statuses_with_history(
&self,
signatures: &[Signature]
) -> RpcResult<Vec<Option<TransactionStatus>>>
pub fn get_signature_status_with_commitment(
&self,
signature: &Signature,
commitment_config: CommitmentConfig
) -> ClientResult<Option<Result<()>>>
pub fn get_signature_status_with_commitment_and_history(
&self,
signature: &Signature,
commitment_config: CommitmentConfig,
search_transaction_history: bool
) -> ClientResult<Option<Result<()>>>
pub fn get_slot_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> ClientResult<Slot>
pub fn get_block_height_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> ClientResult<u64>
Get block production for the current epoch
pub fn get_block_production_with_config(
&self,
config: RpcBlockProductionConfig
) -> RpcResult<RpcBlockProduction>
pub fn get_stake_activation(
&self,
stake_account: Pubkey,
epoch: Option<Epoch>
) -> ClientResult<RpcStakeActivation>
pub fn supply_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> RpcResult<RpcSupply>
pub fn get_largest_accounts_with_config(
&self,
config: RpcLargestAccountsConfig
) -> RpcResult<Vec<RpcAccountBalance>>
pub fn get_vote_accounts_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> ClientResult<RpcVoteAccountStatus>
pub fn get_vote_accounts_with_config(
&self,
config: RpcGetVoteAccountsConfig
) -> ClientResult<RpcVoteAccountStatus>
pub fn wait_for_max_stake(
&self,
commitment: CommitmentConfig,
max_stake_percent: f32
) -> ClientResult<()>
pub fn get_block_with_encoding(
&self,
slot: Slot,
encoding: UiTransactionEncoding
) -> ClientResult<EncodedConfirmedBlock>
pub fn get_block_with_config(
&self,
slot: Slot,
config: RpcBlockConfig
) -> ClientResult<UiConfirmedBlock>
Please use RpcClient::get_block() instead
pub fn get_confirmed_block_with_encoding(
&self,
slot: Slot,
encoding: UiTransactionEncoding
) -> ClientResult<EncodedConfirmedBlock>
Please use RpcClient::get_block_with_encoding() instead
pub fn get_confirmed_block_with_config(
&self,
slot: Slot,
config: RpcConfirmedBlockConfig
) -> ClientResult<UiConfirmedBlock>
Please use RpcClient::get_block_with_config() instead
pub fn get_blocks_with_commitment(
&self,
start_slot: Slot,
end_slot: Option<Slot>,
commitment_config: CommitmentConfig
) -> ClientResult<Vec<Slot>>
pub fn get_blocks_with_limit(
&self,
start_slot: Slot,
limit: usize
) -> ClientResult<Vec<Slot>>
pub fn get_blocks_with_limit_and_commitment(
&self,
start_slot: Slot,
limit: usize,
commitment_config: CommitmentConfig
) -> ClientResult<Vec<Slot>>
pub fn get_confirmed_blocks(
&self,
start_slot: Slot,
end_slot: Option<Slot>
) -> ClientResult<Vec<Slot>>
Please use RpcClient::get_blocks() instead
pub fn get_confirmed_blocks_with_commitment(
&self,
start_slot: Slot,
end_slot: Option<Slot>,
commitment_config: CommitmentConfig
) -> ClientResult<Vec<Slot>>
Please use RpcClient::get_blocks_with_commitment() instead
pub fn get_confirmed_blocks_with_limit(
&self,
start_slot: Slot,
limit: usize
) -> ClientResult<Vec<Slot>>
Please use RpcClient::get_blocks_with_limit() instead
pub fn get_confirmed_blocks_with_limit_and_commitment(
&self,
start_slot: Slot,
limit: usize,
commitment_config: CommitmentConfig
) -> ClientResult<Vec<Slot>>
Please use RpcClient::get_blocks_with_limit_and_commitment() instead
pub fn get_signatures_for_address(
&self,
address: &Pubkey
) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>>
pub fn get_signatures_for_address_with_config(
&self,
address: &Pubkey,
config: GetConfirmedSignaturesForAddress2Config
) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>>
pub fn get_confirmed_signatures_for_address2(
&self,
address: &Pubkey
) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>>
Please use RpcClient::get_signatures_for_address() instead
pub fn get_confirmed_signatures_for_address2_with_config(
&self,
address: &Pubkey,
config: GetConfirmedSignaturesForAddress2Config
) -> ClientResult<Vec<RpcConfirmedTransactionStatusWithSignature>>
Please use RpcClient::get_signatures_for_address_with_config() instead
pub fn get_transaction(
&self,
signature: &Signature,
encoding: UiTransactionEncoding
) -> ClientResult<EncodedConfirmedTransaction>
pub fn get_transaction_with_config(
&self,
signature: &Signature,
config: RpcTransactionConfig
) -> ClientResult<EncodedConfirmedTransaction>
pub fn get_confirmed_transaction(
&self,
signature: &Signature,
encoding: UiTransactionEncoding
) -> ClientResult<EncodedConfirmedTransaction>
Please use RpcClient::get_transaction() instead
pub fn get_confirmed_transaction_with_config(
&self,
signature: &Signature,
config: RpcConfirmedTransactionConfig
) -> ClientResult<EncodedConfirmedTransaction>
Please use RpcClient::get_transaction_with_config() instead
pub fn get_epoch_info_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> ClientResult<EpochInfo>
pub fn get_leader_schedule(
&self,
slot: Option<Slot>
) -> ClientResult<Option<RpcLeaderSchedule>>
pub fn get_leader_schedule_with_commitment(
&self,
slot: Option<Slot>,
commitment_config: CommitmentConfig
) -> ClientResult<Option<RpcLeaderSchedule>>
pub fn get_leader_schedule_with_config(
&self,
slot: Option<Slot>,
config: RpcLeaderScheduleConfig
) -> ClientResult<Option<RpcLeaderSchedule>>
pub fn get_recent_performance_samples(
&self,
limit: Option<usize>
) -> ClientResult<Vec<RpcPerfSample>>
pub fn get_inflation_reward(
&self,
addresses: &[Pubkey],
epoch: Option<Epoch>
) -> ClientResult<Vec<Option<RpcInflationReward>>>
pub fn send_and_confirm_transaction(
&self,
transaction: &Transaction
) -> ClientResult<Signature>
Note that get_account
returns Err(..)
if the account does not exist whereas
get_account_with_commitment
returns Ok(None)
if the account does not exist.
pub fn get_account_with_commitment(
&self,
pubkey: &Pubkey,
commitment_config: CommitmentConfig
) -> RpcResult<Option<Account>>
pub fn get_multiple_accounts_with_commitment(
&self,
pubkeys: &[Pubkey],
commitment_config: CommitmentConfig
) -> RpcResult<Vec<Option<Account>>>
Request the balance of the account pubkey
.
pub fn get_balance_with_commitment(
&self,
pubkey: &Pubkey,
commitment_config: CommitmentConfig
) -> RpcResult<u64>
pub fn get_program_accounts_with_config(
&self,
pubkey: &Pubkey,
config: RpcProgramAccountsConfig
) -> ClientResult<Vec<(Pubkey, Account)>>
Request the transaction count.
pub fn get_transaction_count_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> ClientResult<u64>
pub fn get_fees_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> RpcResult<Fees>
pub fn get_recent_blockhash_with_commitment(
&self,
commitment_config: CommitmentConfig
) -> RpcResult<(Hash, FeeCalculator, Slot)>
pub fn get_fee_calculator_for_blockhash(
&self,
blockhash: &Hash
) -> ClientResult<Option<FeeCalculator>>
pub fn get_fee_calculator_for_blockhash_with_commitment(
&self,
blockhash: &Hash,
commitment_config: CommitmentConfig
) -> RpcResult<Option<FeeCalculator>>
pub fn get_token_account_with_commitment(
&self,
pubkey: &Pubkey,
commitment_config: CommitmentConfig
) -> RpcResult<Option<UiTokenAccount>>
pub fn get_token_account_balance_with_commitment(
&self,
pubkey: &Pubkey,
commitment_config: CommitmentConfig
) -> RpcResult<UiTokenAmount>
pub fn get_token_accounts_by_delegate(
&self,
delegate: &Pubkey,
token_account_filter: TokenAccountsFilter
) -> ClientResult<Vec<RpcKeyedAccount>>
pub fn get_token_accounts_by_delegate_with_commitment(
&self,
delegate: &Pubkey,
token_account_filter: TokenAccountsFilter,
commitment_config: CommitmentConfig
) -> RpcResult<Vec<RpcKeyedAccount>>
pub fn get_token_accounts_by_owner(
&self,
owner: &Pubkey,
token_account_filter: TokenAccountsFilter
) -> ClientResult<Vec<RpcKeyedAccount>>
pub fn get_token_accounts_by_owner_with_commitment(
&self,
owner: &Pubkey,
token_account_filter: TokenAccountsFilter,
commitment_config: CommitmentConfig
) -> RpcResult<Vec<RpcKeyedAccount>>
pub fn get_token_supply_with_commitment(
&self,
mint: &Pubkey,
commitment_config: CommitmentConfig
) -> RpcResult<UiTokenAmount>
pub fn request_airdrop_with_blockhash(
&self,
pubkey: &Pubkey,
lamports: u64,
recent_blockhash: &Hash
) -> ClientResult<Signature>
pub fn request_airdrop_with_config(
&self,
pubkey: &Pubkey,
lamports: u64,
config: RpcRequestAirdropConfig
) -> ClientResult<Signature>
pub fn poll_get_balance_with_commitment(
&self,
pubkey: &Pubkey,
commitment_config: CommitmentConfig
) -> ClientResult<u64>
pub fn wait_for_balance_with_commitment(
&self,
pubkey: &Pubkey,
expected_balance: Option<u64>,
commitment_config: CommitmentConfig
) -> Option<u64>
Poll the server to confirm a transaction.
pub fn poll_for_signature_with_commitment(
&self,
signature: &Signature,
commitment_config: CommitmentConfig
) -> ClientResult<()>
pub fn poll_for_signature_with_commitment(
&self,
signature: &Signature,
commitment_config: CommitmentConfig
) -> ClientResult<()>
Poll the server to confirm a transaction.
pub fn poll_for_signature_confirmation(
&self,
signature: &Signature,
min_confirmed_blocks: usize
) -> ClientResult<usize>
pub fn poll_for_signature_confirmation(
&self,
signature: &Signature,
min_confirmed_blocks: usize
) -> ClientResult<usize>
Poll the server to confirm a transaction.
pub fn get_num_blocks_since_signature_confirmation(
&self,
signature: &Signature
) -> ClientResult<usize>
pub fn send_and_confirm_transaction_with_spinner(
&self,
transaction: &Transaction
) -> ClientResult<Signature>
pub fn send_and_confirm_transaction_with_spinner_and_commitment(
&self,
transaction: &Transaction,
commitment: CommitmentConfig
) -> ClientResult<Signature>
pub fn send_and_confirm_transaction_with_spinner_and_config(
&self,
transaction: &Transaction,
commitment: CommitmentConfig,
config: RpcSendTransactionConfig
) -> ClientResult<Signature>
pub fn confirm_transaction_with_spinner(
&self,
signature: &Signature,
recent_blockhash: &Hash,
commitment: CommitmentConfig
) -> ClientResult<()>
pub fn send<T>(&self, request: RpcRequest, params: Value) -> ClientResult<T> where
T: DeserializeOwned,
Auto Trait Implementations
impl !RefUnwindSafe for RpcClient
impl !UnwindSafe for RpcClient
Blanket Implementations
pub default fn example() -> T
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self