cometbft-rpc 0.1.0-alpha.2

cometbft-rpc contains the core types returned by a CometBFT node's RPC endpoint. All networking related features are feature guarded to keep the dependencies small in cases where only the core types are needed.
Documentation
//! Helper types to generalize differences in serialization between
//! CometBFT RPC protocol versions.

pub mod v0_34;
pub mod v1;
pub use v1::Dialect as LatestDialect;

mod begin_block;
mod check_tx;
mod deliver_tx;
mod end_block;

pub use begin_block::BeginBlock;
pub use check_tx::CheckTx;
pub use deliver_tx::DeliverTx;
pub use end_block::EndBlock;

use serde::{de::DeserializeOwned, Serialize};

use cometbft::{abci, evidence};

pub trait Dialect: sealed::Sealed + Default + Clone + Send + Sync {
    type Event: Into<abci::Event> + Serialize + DeserializeOwned;
    type Evidence: From<evidence::Evidence> + Serialize + DeserializeOwned + Send;
}

mod sealed {
    pub trait Sealed {}

    impl Sealed for super::v0_34::Dialect {}
    impl Sealed for super::v1::Dialect {}
}