Skip to main content

sentrix_proto/
lib.rs

1//! Generated tonic + prost types for the Sentrix Chain gRPC service.
2//!
3//! Single source of truth for the `sentrix.v1` schema. The chain itself
4//! consumes these types server-side (`crates/sentrix-grpc`); SDK clients
5//! (Rust, WASM, future polyglot) depend on this crate via crates.io to
6//! avoid drift between server and clients.
7//!
8//! ## Example
9//!
10//! ```no_run
11//! use sentrix_proto::sentrix_client::SentrixClient;
12//!
13//! # async fn run() -> Result<(), Box<dyn std::error::Error>> {
14//! let mut client = SentrixClient::connect("https://grpc.sentrixchain.com").await?;
15//! let block = client
16//!     .get_block(sentrix_proto::GetBlockRequest {
17//!         selector: Some(sentrix_proto::get_block_request::Selector::Latest(true)),
18//!     })
19//!     .await?
20//!     .into_inner();
21//! println!("latest block: index={} timestamp={}", block.index, block.timestamp);
22//! # Ok(())
23//! # }
24//! ```
25//!
26//! ## Schema versioning
27//!
28//! The schema is namespaced `package sentrix.v1;`. Breaking field renames /
29//! type changes will go to a `sentrix.v2` package, not a v1 in-place edit —
30//! that gives client crates a deterministic boundary for major-version bumps.
31
32#![forbid(unsafe_code)]
33
34tonic::include_proto!("sentrix.v1");