Struct QueryClient
pub struct QueryClient {
pub chain_config: ChainConfig,
pub cache: ClimbCache,
pub middleware_map_req: Arc<Vec<QueryMiddlewareMapReq>>,
pub middleware_map_resp: Arc<Vec<QueryMiddlewareMapResp>>,
pub middleware_run: Arc<Vec<QueryMiddlewareRun>>,
pub balances_pagination_limit: u64,
pub wait_blocks_poll_sleep_duration: Duration,
pub connection: Connection,
/* private fields */
}
Fields§
§chain_config: ChainConfig
§cache: ClimbCache
§middleware_map_req: Arc<Vec<QueryMiddlewareMapReq>>
§middleware_map_resp: Arc<Vec<QueryMiddlewareMapResp>>
§middleware_run: Arc<Vec<QueryMiddlewareRun>>
§balances_pagination_limit: u64
§wait_blocks_poll_sleep_duration: Duration
§connection: Connection
Implementations§
§impl QueryClient
impl QueryClient
pub async fn abci_proof( &self, kind: AbciProofKind, height: Option<u64>, ) -> Result<AbciProofResponse, Error>
§impl QueryClient
impl QueryClient
pub async fn balance( &self, addr: Address, denom: Option<String>, ) -> Result<Option<u128>, Error>
pub async fn all_balances( &self, addr: Address, limit_per_page: Option<u64>, ) -> Result<Vec<Coin>, Error>
pub async fn base_account(&self, addr: &Address) -> Result<BaseAccount, Error>
pub async fn staking_params(&self) -> Result<Params, Error>
pub async fn block(&self, height: Option<u64>) -> Result<BlockResp, Error>
pub async fn block_header( &self, height: Option<u64>, ) -> Result<BlockHeaderResp, Error>
pub async fn block_height(&self) -> Result<u64, Error>
pub async fn node_info(&self) -> Result<GetNodeInfoResponse, Error>
§impl QueryClient
impl QueryClient
pub async fn contract_smart<'a, D, S>( &self, address: &Address, msg: &S, ) -> Result<D, Error>
pub async fn contract_smart_raw<'a, S>( &self, address: &Address, msg: &S, ) -> Result<Vec<u8>, Error>
pub async fn contract_code_info( &self, code_id: u64, ) -> Result<CodeInfoResponse, Error>
pub async fn contract_info( &self, address: &Address, ) -> Result<QueryContractInfoResponse, Error>
§impl QueryClient
impl QueryClient
pub async fn fetch_signed_header( &self, height: Option<u64>, ) -> Result<SignedHeader, Error>
pub async fn fetch_block_events( &self, block_height: u64, ) -> Result<Vec<Event>, Error>
§impl QueryClient
impl QueryClient
pub async fn ibc_connection_proofs( &self, proof_height: Height, client_id: &IbcClientId, connection_id: &IbcConnectionId, ) -> Result<IbcConnectionProofs, Error>
pub async fn ibc_channel_proofs( &self, proof_height: Height, channel_id: &IbcChannelId, port_id: &IbcPortId, ) -> Result<IbcChannelProofs, Error>
pub async fn ibc_client_state( &self, ibc_client_id: &IbcClientId, height: Option<u64>, ) -> Result<ClientState, Error>
pub async fn ibc_connection( &self, connection_id: &IbcConnectionId, height: Option<u64>, ) -> Result<ConnectionEnd, Error>
pub async fn ibc_connection_consensus_state( &self, connection_id: &IbcConnectionId, consensus_height: Option<Height>, height: Option<u64>, ) -> Result<Any, Error>
pub async fn ibc_channel( &self, channel_id: &IbcChannelId, port_id: &IbcPortId, height: Option<u64>, ) -> Result<Channel, Error>
pub async fn ibc_create_client_consensus_state( &self, trusting_period_secs: Option<u64>, ) -> Result<(ClientState, ConsensusState), Error>
§impl QueryClient
impl QueryClient
pub async fn stream_block_events( self, sleep_duration: Option<Duration>, ) -> Result<impl Stream<Item = Result<BlockEvents, Error>>, Error>
§impl QueryClient
impl QueryClient
pub async fn simulate_tx( &self, tx_bytes: Vec<u8>, ) -> Result<SimulateResponse, Error>
pub async fn broadcast_tx_bytes( &self, tx_bytes: Vec<u8>, mode: BroadcastMode, ) -> Result<AnyTxResponse, Error>
pub async fn poll_until_tx_ready( &self, tx_hash: String, sleep_duration: Duration, timeout_duration: Duration, ) -> Result<PollTxResponse, Error>
§impl QueryClient
impl QueryClient
pub async fn validator_set( &self, height: Option<u64>, proposer_address: Option<&[u8]>, ) -> Result<ValidatorSet, Error>
§impl QueryClient
impl QueryClient
pub fn clone_grpc_channel(&self) -> Result<Channel, Error>
§impl QueryClient
impl QueryClient
pub async fn new( chain_config: ChainConfig, connection: Option<Connection>, ) -> Result<QueryClient, Error>
pub async fn set_connection_mode( &self, mode: Option<ConnectionMode>, ) -> Result<(), Error>
pub fn get_connection_mode(&self) -> ConnectionMode
pub fn rpc_client(&self) -> Result<&RpcClient, Error>
pub async fn new_with_cache( chain_config: ChainConfig, cache: ClimbCache, connection: Option<Connection>, ) -> Result<QueryClient, Error>
pub async fn run_with_middleware<REQ>(
&self,
req: REQ,
) -> Result<<REQ as QueryRequest>::QueryResponse, Error>where
REQ: QueryRequest,
pub async fn wait_until_block_height( &self, target_block_height: u64, sleep_duration: Option<Duration>, ) -> Result<(), Error>
pub async fn wait_blocks( &self, n_blocks: u64, sleep_duration: Option<Duration>, ) -> Result<(), Error>
Trait Implementations§
§impl Clone for QueryClient
impl Clone for QueryClient
§fn clone(&self) -> QueryClient
fn clone(&self) -> QueryClient
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for QueryClient
impl Debug for QueryClient
§impl From<AnyClient> for QueryClient
impl From<AnyClient> for QueryClient
§fn from(client: AnyClient) -> QueryClient
fn from(client: AnyClient) -> QueryClient
Converts to this type from the input type.
§impl From<QueryClient> for AnyClient
impl From<QueryClient> for AnyClient
§fn from(client: QueryClient) -> AnyClient
fn from(client: QueryClient) -> AnyClient
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for QueryClient
impl !RefUnwindSafe for QueryClient
impl Send for QueryClient
impl Sync for QueryClient
impl Unpin for QueryClient
impl !UnwindSafe for QueryClient
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moreSource§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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered
].