Struct agsol_wasm_client::RpcClient
source · [−]pub struct RpcClient { /* private fields */ }
Expand description
An async client to make rpc requests to the Solana blockchain.
Implementations
sourceimpl RpcClient
impl RpcClient
pub fn new_with_config(net: Net, config: RpcConfig) -> Self
pub fn new(net: Net) -> Self
pub fn set_commitment(&mut self, commitment: Option<CommitmentLevel>)
sourcepub async fn get_account(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<Account>
pub async fn get_account(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<Account>
Returns the decoded contents of a Solana account.
sourcepub async fn get_and_deserialize_account_data<T: BorshDeserialize>(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<T>
pub async fn get_and_deserialize_account_data<T: BorshDeserialize>(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<T>
Attempts to deserialize the contents of an account’s data field into a given type using the Borsh deserialization framework.
sourcepub async fn get_and_deserialize_parsed_account_data<T: DeserializeOwned>(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<T>
pub async fn get_and_deserialize_parsed_account_data<T: DeserializeOwned>(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<T>
Attempts to deserialize the contents of an account’s data field into a given type using the Json deserialization framework.
sourcepub async fn get_owner(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<Pubkey>
pub async fn get_owner(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<Pubkey>
Returns the owner of the account.
sourcepub async fn get_balance(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<u64>
pub async fn get_balance(
&mut self,
account_pubkey: &Pubkey
) -> ClientResult<u64>
Returns the balance (in lamports) of the account.
sourcepub async fn get_minimum_balance_for_rent_exemption(
&mut self,
data_len: usize
) -> ClientResult<u64>
pub async fn get_minimum_balance_for_rent_exemption(
&mut self,
data_len: usize
) -> ClientResult<u64>
Returns the minimum balance (in Lamports) required for an account to be rent exempt.
sourcepub async fn request_airdrop(
&mut self,
pubkey: &Pubkey,
lamports: u64,
recent_blockhash: &Hash
) -> ClientResult<Signature>
pub async fn request_airdrop(
&mut self,
pubkey: &Pubkey,
lamports: u64,
recent_blockhash: &Hash
) -> ClientResult<Signature>
Requests an airdrop of lamports to a given account.
sourcepub async fn get_latest_blockhash(&mut self) -> ClientResult<Hash>
pub async fn get_latest_blockhash(&mut self) -> ClientResult<Hash>
Returns latest blockhash.
sourcepub async fn send_transaction_unchecked(
&mut self,
transaction: &Transaction
) -> ClientResult<Signature>
pub async fn send_transaction_unchecked(
&mut self,
transaction: &Transaction
) -> ClientResult<Signature>
Attempts to send a signed transaction to the ledger without simulating it first.
It is a bit faster, but no logs or confirmation is returned because the transaction is not simulated.
pub async fn send_transaction(
&mut self,
transaction: &Transaction
) -> ClientResult<Signature>
pub async fn send_transaction_with_config(
&mut self,
transaction: &Transaction,
config: &RpcTransactionConfig
) -> ClientResult<Signature>
pub async fn get_slot(&mut self) -> ClientResult<Slot>
pub async fn get_block_time(
&mut self,
slot: Slot
) -> ClientResult<UnixTimestamp>
Auto Trait Implementations
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
pub default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more