pub struct SentrixClient<T> { /* private fields */ }Expand description
──────────────────────────────────────────────────────────── Service definition ────────────────────────────────────────────────────────────
Implementations§
Source§impl SentrixClient<Channel>
impl SentrixClient<Channel>
Source§impl<T> SentrixClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
impl<T> SentrixClient<T>where
T: GrpcService<Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
pub fn new(inner: T) -> Self
pub fn with_origin(inner: T, origin: Uri) -> Self
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> SentrixClient<InterceptedService<T, F>>where
F: Interceptor,
T::ResponseBody: Default,
T: Service<Request<Body>, Response = Response<<T as GrpcService<Body>>::ResponseBody>>,
<T as Service<Request<Body>>>::Error: Into<StdError> + Send + Sync,
Sourcepub fn send_compressed(self, encoding: CompressionEncoding) -> Self
pub fn send_compressed(self, encoding: CompressionEncoding) -> Self
Compress requests with the given encoding.
This requires the server to support it otherwise it might respond with an error.
Sourcepub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self
Enable decompressing responses.
Sourcepub fn max_decoding_message_size(self, limit: usize) -> Self
pub fn max_decoding_message_size(self, limit: usize) -> Self
Limits the maximum size of a decoded message.
Default: 4MB
Sourcepub fn max_encoding_message_size(self, limit: usize) -> Self
pub fn max_encoding_message_size(self, limit: usize) -> Self
Limits the maximum size of an encoded message.
Default: usize::MAX
Sourcepub async fn broadcast_tx(
&mut self,
request: impl IntoRequest<BroadcastTxRequest>,
) -> Result<Response<BroadcastTxResponse>, Status>
pub async fn broadcast_tx( &mut self, request: impl IntoRequest<BroadcastTxRequest>, ) -> Result<Response<BroadcastTxResponse>, Status>
Submit a signed transaction to the local mempool. Same semantics as JSON-RPC eth_sendRawTransaction for EVM txs, with native fields exposed for staking-ops and other native variants.
Sourcepub async fn get_block(
&mut self,
request: impl IntoRequest<GetBlockRequest>,
) -> Result<Response<Block>, Status>
pub async fn get_block( &mut self, request: impl IntoRequest<GetBlockRequest>, ) -> Result<Response<Block>, Status>
Fetch a block by height OR by hash. Returns NOT_FOUND if outside the local chain window (currently 1000 blocks; older blocks need indexer).
Sourcepub async fn get_balance(
&mut self,
request: impl IntoRequest<GetBalanceRequest>,
) -> Result<Response<Account>, Status>
pub async fn get_balance( &mut self, request: impl IntoRequest<GetBalanceRequest>, ) -> Result<Response<Account>, Status>
Fetch account balance + nonce. Mirrors eth_getBalance + eth_getTransactionCount in a single round-trip. Includes mempool-pending nonce so wallets build correct next-tx without an extra call (matches the pending-aware nonce behaviour from chain v2.1.57).
Sourcepub async fn get_validator_set(
&mut self,
request: impl IntoRequest<GetValidatorSetRequest>,
) -> Result<Response<ValidatorSet>, Status>
pub async fn get_validator_set( &mut self, request: impl IntoRequest<GetValidatorSetRequest>, ) -> Result<Response<ValidatorSet>, Status>
v0.4 read-only state queries — drop the REST /sentrix_status_extended
bridge from the explorer’s stats hot path. All three are pure reads
off state.read() snapshots; same lock contention profile as
GetBlock/GetBalance.
Active validator set + per-validator stake/active/jailed flags.
Sourcepub async fn get_supply(
&mut self,
request: impl IntoRequest<GetSupplyRequest>,
) -> Result<Response<Supply>, Status>
pub async fn get_supply( &mut self, request: impl IntoRequest<GetSupplyRequest>, ) -> Result<Response<Supply>, Status>
Native-token supply snapshot (minted, burned, circulating).
Sourcepub async fn get_mempool(
&mut self,
request: impl IntoRequest<GetMempoolRequest>,
) -> Result<Response<Mempool>, Status>
pub async fn get_mempool( &mut self, request: impl IntoRequest<GetMempoolRequest>, ) -> Result<Response<Mempool>, Status>
Pending-tx count + a capped header window for UI display.
Sourcepub async fn stream_events(
&mut self,
request: impl IntoRequest<StreamEventsRequest>,
) -> Result<Response<Streaming<ChainEvent>>, Status>
pub async fn stream_events( &mut self, request: impl IntoRequest<StreamEventsRequest>, ) -> Result<Response<Streaming<ChainEvent>>, Status>
Server-streaming chain events. Subscribe once, receive every event type until cancel or server restart. Replaces N separate eth_subscribe calls. Backpressure: server bounded channel per stream (capacity 4096 — same as event_tx in chain). On slow client, server drops OLDEST events and emits a StreamLagged sentinel. Client should resync state from RPC.
Trait Implementations§
Source§impl<T: Clone> Clone for SentrixClient<T>
impl<T: Clone> Clone for SentrixClient<T>
Source§fn clone(&self) -> SentrixClient<T>
fn clone(&self) -> SentrixClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<T> !Freeze for SentrixClient<T>
impl<T> RefUnwindSafe for SentrixClient<T>where
T: RefUnwindSafe,
impl<T> Send for SentrixClient<T>where
T: Send,
impl<T> Sync for SentrixClient<T>where
T: Sync,
impl<T> Unpin for SentrixClient<T>where
T: Unpin,
impl<T> UnsafeUnpin for SentrixClient<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SentrixClient<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request