pub struct Client {
pub config_path: String,
pub config: Config,
pub rpc_timeout: Duration,
pub commitment: CommitmentConfig,
pub confirm_transaction_initial_timeout: Duration,
pub signers: Vec<Box<dyn Signer>>,
}
Fields§
§config_path: String
§config: Config
§rpc_timeout: Duration
§commitment: CommitmentConfig
§confirm_transaction_initial_timeout: Duration
§signers: Vec<Box<dyn Signer>>
Implementations§
Source§impl Client
impl Client
pub fn new(config_path: String) -> Result<Self, Error>
pub fn rpc_client(&self) -> RpcClient
pub fn lamports(&self) -> u64
pub fn payer_key(&self) -> Pubkey
Sourcepub fn account<T: AccountDeserialize>(
&self,
address: Pubkey,
) -> Result<T, ClientError>
pub fn account<T: AccountDeserialize>( &self, address: Pubkey, ) -> Result<T, ClientError>
Returns the account at the given address.
Sourcepub fn accounts<T: AccountDeserialize + Discriminator>(
&self,
program_id: &Pubkey,
filters: Vec<RpcFilterType>,
) -> Result<Vec<(Pubkey, T)>, ClientError>
pub fn accounts<T: AccountDeserialize + Discriminator>( &self, program_id: &Pubkey, filters: Vec<RpcFilterType>, ) -> Result<Vec<(Pubkey, T)>, ClientError>
Returns all program accounts of the given type matching the given filters
Sourcepub fn accounts_lazy<T: AccountDeserialize + Discriminator>(
&self,
program_id: &Pubkey,
filters: Vec<RpcFilterType>,
) -> Result<ProgramAccountsIterator<T>, ClientError>
pub fn accounts_lazy<T: AccountDeserialize + Discriminator>( &self, program_id: &Pubkey, filters: Vec<RpcFilterType>, ) -> Result<ProgramAccountsIterator<T>, ClientError>
Returns all program accounts of the given type matching the given filters as an iterator Deserialization is executed lazily
pub fn send_and_confirm(&self, ixs: &[Instruction])
pub fn simulate( &self, ixs: &[Instruction], ) -> Result<SimulateResult, ClientError>
pub fn simulate_and_print<T: Event + AnchorDeserialize + Tabled + Copy>( &self, program_id: &Pubkey, ixs: &[Instruction], ) -> Option<T>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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