ibc_types/lib.rs
1//! This crate defines common data structures for Inter-Blockchain Communication
2//! (IBC) messages that can be reused by different IBC implementations or IBC
3//! ecosystem tooling.
4//!
5//! Unlike `ibc-rs`, which provides a specific and opinionated implementation of
6//! IBC, `ibc-types` just defines Rust types that allow working with IBC
7//! messages, allowing an IBC implementation or IBC ecosystem tooling to be
8//! built on top using a common language.
9//!
10//! In addition to defining Rust types for IBC messages, `ibc-types` also
11//! defines Rust types for IBC events, and provides code for parsing IBC events
12//! to and from ABCI messages. IBC events are de facto a critical part of IBC,
13//! in that they're needed to interoperate with relayers, but are not really
14//! specified anywhere. Providing event parsing code in `ibc-types` allows IBC
15//! implementations and relayer implementations to share common code for
16//! producing and consuming events.
17//!
18//! The `ibc-types` crate is a top-level wrapper crate re-exporting the contents
19//! of subcrates scoped by IBC module. This structure means that external users
20//! of the library can use one catch-all crate, but allows dependency
21//! relationships between different IBC modules. For example, the `ibc-types`
22//! crate re-exports the client types defined in the `ibc-types-core-client`
23//! crate, as well as the types for the Tendermint light client defined in the
24//! `ibc-types-lightclients-tendermint` crate. But because these are separate
25//! crates, the Tendermint light client types can depend on the core IBC client
26//! types, preventing cyclic dependency issues.
27#![no_std]
28// Requires nightly.
29#![cfg_attr(docsrs, feature(doc_auto_cfg))]
30
31extern crate alloc;
32
33#[cfg(any(test, feature = "std"))]
34extern crate std;
35
36#[doc(inline)]
37pub use ibc_types_domain_type::DomainType;
38
39// TODO: anywhere better to put this?
40// we don't need/want the whole crate since it should be encapsulated
41// in the identifier types themselves
42#[doc(inline)]
43pub use ibc_types_identifier::IdentifierError;
44
45/// Core IBC data modeling such as clients, connections, and channels.
46pub mod core {
47 #[doc(inline)]
48 pub use ibc_types_core_channel as channel;
49 #[doc(inline)]
50 pub use ibc_types_core_client as client;
51 #[doc(inline)]
52 pub use ibc_types_core_commitment as commitment;
53 #[doc(inline)]
54 pub use ibc_types_core_connection as connection;
55}
56
57#[doc(inline)]
58pub use ibc_types_timestamp as timestamp;
59
60/// Specific IBC light clients, such as the Tendermint light client.
61pub mod lightclients {
62 // TODO: add Tendermint light client crate
63 #[doc(inline)]
64 pub use ibc_types_lightclients_tendermint as tendermint;
65}
66
67#[doc(inline)]
68pub use ibc_types_path as path;
69
70#[doc(inline)]
71pub use ibc_types_transfer as transfer;