Skip to main content

sentrix_grpc_wasm/
lib.rs

1//! Rust + WASM gRPC-Web client for Sentrix Chain.
2//!
3//! Compiles to WASM via `wasm-pack build --target web` and is usable
4//! from any browser dApp that wants typed gRPC-Web access to the
5//! chain's `sentrix.v1.Sentrix` service. Extracted from
6//! `sentrix-explorer-v2` so other browser apps can reuse the wrapper
7//! instead of re-implementing the tonic-web-wasm-client glue.
8//!
9//! For non-WASM Rust services (validators, indexers, bridges) use
10//! `sentrix-chain` (https://github.com/Sentriscloud/sdk-rs) `grpc`
11//! feature instead — that one wraps `@grpc/grpc-js`-equivalent
12//! `tonic` over native HTTP/2.
13//!
14//! Endpoints:
15//!   - mainnet: `https://grpc.sentrixchain.com`
16//!   - testnet: `https://grpc-testnet.sentrixchain.com`
17//!
18//! Caddy at the edge transcodes between gRPC-Web and native gRPC via
19//! `tonic-web` so the same hostname serves both browser and server
20//! consumers.
21
22#![deny(unsafe_code)]
23#![allow(missing_docs)]
24#![allow(clippy::doc_lazy_continuation)]
25
26#[allow(clippy::all, clippy::pedantic, dead_code)]
27pub mod pb {
28    tonic::include_proto!("sentrix.v1");
29}
30
31pub mod client;
32
33pub use client::{hash_short, SentrixGrpcClient};