pub struct Client<A: App> { /* private fields */ }
Expand description
A runtime client meant for use within runtimes.
Implementations§
source§impl<A> Client<A>where
A: App,
impl<A> Client<A>where
A: App,
sourcepub async fn latest_round(&self) -> Result<u64>
pub async fn latest_round(&self) -> Result<u64>
Retrieve the latest known runtime round.
sourcepub async fn account_nonce(&self, round: u64, address: Address) -> Result<u64>
pub async fn account_nonce(&self, round: u64, address: Address) -> Result<u64>
Retrieve the nonce for the given account.
sourcepub async fn gas_price(&self, round: u64, denom: &Denomination) -> Result<u128>
pub async fn gas_price(&self, round: u64, denom: &Denomination) -> Result<u128>
Retrieve the gas price in the given denomination.
sourcepub async fn query<Rq, Rs>(
&self,
round: u64,
method: &str,
args: Rq,
) -> Result<Rs>where
Rq: Encode,
Rs: Decode + Send + 'static,
pub async fn query<Rq, Rs>(
&self,
round: u64,
method: &str,
args: Rq,
) -> Result<Rs>where
Rq: Encode,
Rs: Decode + Send + 'static,
Securely query the on-chain runtime component.
sourcepub async fn estimate_gas(&self, req: EstimateGasQuery) -> Result<u64>
pub async fn estimate_gas(&self, req: EstimateGasQuery) -> Result<u64>
Securely perform gas estimation.
sourcepub async fn multi_sign_and_submit_tx(
&self,
signers: &[Arc<dyn Signer>],
tx: Transaction,
) -> Result<CallResult>
pub async fn multi_sign_and_submit_tx( &self, signers: &[Arc<dyn Signer>], tx: Transaction, ) -> Result<CallResult>
Sign a given transaction, submit it and wait for block inclusion.
This method supports multiple transaction signers.
sourcepub async fn multi_sign_and_submit_tx_opts(
&self,
signers: &[Arc<dyn Signer>],
tx: Transaction,
opts: SubmitTxOpts,
) -> Result<CallResult>
pub async fn multi_sign_and_submit_tx_opts( &self, signers: &[Arc<dyn Signer>], tx: Transaction, opts: SubmitTxOpts, ) -> Result<CallResult>
Sign a given transaction, submit it and wait for block inclusion.
This method supports multiple transaction signers.
sourcepub async fn sign_and_submit_tx(
&self,
signer: Arc<dyn Signer>,
tx: Transaction,
) -> Result<CallResult>
pub async fn sign_and_submit_tx( &self, signer: Arc<dyn Signer>, tx: Transaction, ) -> Result<CallResult>
Sign a given transaction, submit it and wait for block inclusion.
sourcepub async fn with_store_for_round<F, R>(&self, round: u64, f: F) -> Result<R>
pub async fn with_store_for_round<F, R>(&self, round: u64, f: F) -> Result<R>
Run a closure inside a CurrentState
context with store for the given round.
sourcepub async fn store_for_round(&self, round: u64) -> Result<HostStore>
pub async fn store_for_round(&self, round: u64) -> Result<HostStore>
Return a store corresponding to the given round.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Client<A>
impl<A> !RefUnwindSafe for Client<A>
impl<A> Send for Client<A>
impl<A> Sync for Client<A>
impl<A> Unpin for Client<A>
impl<A> !UnwindSafe for Client<A>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)