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

pub async fn abci_proof( &self, kind: AbciProofKind, height: Option<u64>, ) -> Result<AbciProofResponse, Error>

§

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

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>
where S: Serialize + Debug,

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

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

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

pub async fn stream_block_events( self, sleep_duration: Option<Duration>, ) -> Result<impl Stream<Item = Result<BlockEvents, Error>>, Error>

§

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

pub async fn validator_set( &self, height: Option<u64>, proposer_address: Option<&[u8]>, ) -> Result<ValidatorSet, Error>

§

impl QueryClient

pub fn clone_grpc_channel(&self) -> Result<Channel, Error>

§

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

§

fn clone(&self) -> QueryClient

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for QueryClient

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl From<AnyClient> for QueryClient

§

fn from(client: AnyClient) -> QueryClient

Converts to this type from the input type.
§

impl From<QueryClient> for AnyClient

§

fn from(client: QueryClient) -> AnyClient

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<U> As for U

§

fn as_<T>(self) -> T
where 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 more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

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].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T