Skip to main content

LightClientApi

Trait LightClientApi 

Source
pub trait LightClientApi {
    // Required methods
    fn get_leaf_proof<'life0, 'async_trait>(
        &'life0 self,
        query: LeafQuery,
        finalized: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<LeafProof>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_header_proof<'life0, 'async_trait>(
        &'life0 self,
        root: u64,
        requested: HeaderQuery,
    ) -> Pin<Box<dyn Future<Output = Result<HeaderProof>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_light_client_stake_table<'life0, 'async_trait>(
        &'life0 self,
        epoch: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<StakeTableEvent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_payload_proof<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
    ) -> Pin<Box<dyn Future<Output = Result<PayloadProof>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_payload_proof_range<'life0, 'async_trait>(
        &'life0 self,
        start: u64,
        end: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PayloadProof>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_payload_proof_ranges<'life0, 'async_trait>(
        &'life0 self,
        ranges: Vec<Range<u64>>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<PayloadProof>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_lc_namespace_proof<'life0, 'async_trait>(
        &'life0 self,
        height: u64,
        namespace: u64,
    ) -> Pin<Box<dyn Future<Output = Result<NamespaceProof>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_lc_namespace_proof_range<'life0, 'async_trait>(
        &'life0 self,
        start: u64,
        end: u64,
        namespace: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<NamespaceProof>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_lc_namespaces_proof_range<'life0, 'async_trait>(
        &'life0 self,
        start: u64,
        end: u64,
        namespaces: String,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<u64, NamespaceProof>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn get_leaf_proof<'life0, 'async_trait>( &'life0 self, query: LeafQuery, finalized: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<LeafProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_header_proof<'life0, 'async_trait>( &'life0 self, root: u64, requested: HeaderQuery, ) -> Pin<Box<dyn Future<Output = Result<HeaderProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_light_client_stake_table<'life0, 'async_trait>( &'life0 self, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<StakeTableEvent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_payload_proof<'life0, 'async_trait>( &'life0 self, height: u64, ) -> Pin<Box<dyn Future<Output = Result<PayloadProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_payload_proof_range<'life0, 'async_trait>( &'life0 self, start: u64, end: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<PayloadProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_payload_proof_ranges<'life0, 'async_trait>( &'life0 self, ranges: Vec<Range<u64>>, ) -> Pin<Box<dyn Future<Output = Result<Vec<PayloadProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Payload proofs for a set of (from, until) half-open height ranges, which need not be contiguous.

A node catching up over a fragmented set of heights would otherwise pay a round trip per run. The proofs are the same ones the range endpoint returns, in ascending height order.

Source

fn get_lc_namespace_proof<'life0, 'async_trait>( &'life0 self, height: u64, namespace: u64, ) -> Pin<Box<dyn Future<Output = Result<NamespaceProof>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_lc_namespace_proof_range<'life0, 'async_trait>( &'life0 self, start: u64, end: u64, namespace: u64, ) -> Pin<Box<dyn Future<Output = Result<Vec<NamespaceProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_lc_namespaces_proof_range<'life0, 'async_trait>( &'life0 self, start: u64, end: u64, namespaces: String, ) -> Pin<Box<dyn Future<Output = Result<Vec<HashMap<u64, NamespaceProof>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

namespaces is the raw TaggedBase64-encoded path segment produced by the light-client client (tag NS, wrapping a JSON Vec<u64>); decoding it is left to the implementation so this crate does not need a tagged-base64 dependency.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§