pub struct SentrixGrpcClient { /* private fields */ }Implementations§
Source§impl SentrixGrpcClient
impl SentrixGrpcClient
Sourcepub fn new(endpoint: impl Into<String>) -> Self
pub fn new(endpoint: impl Into<String>) -> Self
Build a client targeting the given endpoint. Cheap; just constructs
a fetch() wrapper. No network IO until the first RPC.
Sourcepub async fn get_latest_block(&mut self) -> Result<Block, Status>
pub async fn get_latest_block(&mut self) -> Result<Block, Status>
latest selector — matches the GetBlock { latest: true } path on
the chain-side handler.
pub async fn get_block_by_height( &mut self, height: u64, ) -> Result<Block, Status>
pub async fn get_balance(&mut self, addr: [u8; 20]) -> Result<Account, Status>
Sourcepub async fn get_validator_set(&mut self) -> Result<ValidatorSet, Status>
pub async fn get_validator_set(&mut self) -> Result<ValidatorSet, Status>
v0.4 — full active set + jail/active flags + per-validator stake.
Sourcepub async fn get_supply(&mut self) -> Result<Supply, Status>
pub async fn get_supply(&mut self) -> Result<Supply, Status>
v0.4 — minted/burned/circulating supply snapshot.
Sourcepub async fn get_mempool(&mut self, limit: u32) -> Result<Mempool, Status>
pub async fn get_mempool(&mut self, limit: u32) -> Result<Mempool, Status>
v0.4 — pending-tx size + capped header window. limit = 0 ⇒
server default (100). Pass a smaller limit for the dashboard
header card (just need size); pass max 500 for the mempool
panel that lists actual entries.
Sourcepub async fn subscribe_events(
&mut self,
filters: Vec<EventFilter>,
) -> Result<Streaming<ChainEvent>, Status>
pub async fn subscribe_events( &mut self, filters: Vec<EventFilter>, ) -> Result<Streaming<ChainEvent>, Status>
Server-streaming events. Returns a Streaming<ChainEvent> that the
caller drains with .message().await. Filter list is sent verbatim;
empty = subscribe-all (server-side filter).
Trait Implementations§
Source§impl Clone for SentrixGrpcClient
impl Clone for SentrixGrpcClient
Source§fn clone(&self) -> SentrixGrpcClient
fn clone(&self) -> SentrixGrpcClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !Freeze for SentrixGrpcClient
impl RefUnwindSafe for SentrixGrpcClient
impl Send for SentrixGrpcClient
impl Sync for SentrixGrpcClient
impl Unpin for SentrixGrpcClient
impl UnsafeUnpin for SentrixGrpcClient
impl UnwindSafe for SentrixGrpcClient
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
Mutably borrows from an owned value. Read more
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>
Wrap the input message
T in a tonic::Request