tendermint_rpc/
lib.rs

1//! Tendermint RPC definitions and types.
2//!
3//! ## Client
4//!
5//! This crate optionally provides access to different types of RPC client
6//! functionality and different client transports based on which features you
7//! select when using it.
8//!
9//! Several client-related features are provided at present:
10//!
11//! * `http-client` - Provides [`HttpClient`], which is a basic RPC client that interacts with
12//!   remote Tendermint nodes via **JSON-RPC over HTTP or HTTPS**. This client does not provide
13//!   [`event::Event`] subscription functionality. See the [Tendermint RPC] for more details.
14//! * `websocket-client` - Provides [`WebSocketClient`], which provides full client functionality,
15//!   including general RPC functionality as well as [`event::Event`] subscription functionality.
16//!   Can be used over secure (`wss://`) and unsecure (`ws://`) connections.
17//!
18//! ### Mock Clients
19//!
20//! Mock clients are included when either of the `http-client` or
21//! `websocket-client` features are enabled to aid in testing. This includes
22//! [`MockClient`], which implements both [`Client`] and [`SubscriptionClient`]
23//! traits.
24//!
25//! [Tendermint RPC]: https://docs.tendermint.com/v0.34/rpc/
26//! [`/subscribe` endpoint]: https://docs.tendermint.com/v0.34/rpc/#/Websocket/subscribe
27
28#![no_std]
29
30extern crate alloc;
31extern crate std;
32
33mod prelude;
34
35pub mod client;
36
37#[cfg(any(
38    feature = "http-client",
39    feature = "websocket-client",
40    feature = "mock-client"
41))]
42pub use client::{Client, Subscription, SubscriptionClient};
43#[cfg(feature = "http-client")]
44pub use client::{HttpClient, HttpClientUrl};
45#[cfg(feature = "mock-client")]
46pub use client::{MockClient, MockRequestMatcher, MockRequestMethodMatcher};
47#[cfg(feature = "websocket-client")]
48pub use client::{WebSocketClient, WebSocketClientDriver, WebSocketClientUrl, WebSocketConfig};
49
50pub mod dialect;
51pub mod endpoint;
52pub mod error;
53pub mod event;
54mod id;
55mod method;
56mod order;
57mod paging;
58pub mod query;
59pub mod request;
60pub mod response;
61pub mod response_error;
62mod rpc_url;
63pub mod serializers;
64mod utils;
65mod version;
66
67pub use error::Error;
68pub use id::Id;
69pub use method::Method;
70pub use order::Order;
71pub use paging::{PageNumber, Paging, PerPage};
72pub use request::{Request, SimpleRequest};
73pub use response::Response;
74pub use response_error::{Code, ResponseError};
75pub use rpc_url::{Scheme, Url};
76pub use version::Version;