Skip to main content

RPCClient

Trait RPCClient 

Source
pub trait RPCClient: Send + Sync {
Show 15 methods // Required methods fn compression(&self) -> bool; fn get_contract_state<'life0, 'async_trait>( &'life0 self, params: ContractStateParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<Account>>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_protocol_components<'life0, 'async_trait>( &'life0 self, params: ProtocolComponentsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<ProtocolComponent>>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_protocol_states<'life0, 'async_trait>( &'life0 self, params: ProtocolStatesParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<ProtocolComponentState>>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_tokens<'life0, 'async_trait>( &'life0 self, params: TokensParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<Token>>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_protocol_systems<'life0, 'async_trait>( &'life0 self, params: ProtocolSystemsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<ProtocolSystems>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_component_tvl<'life0, 'async_trait>( &'life0 self, params: ComponentTvlParams, ) -> Pin<Box<dyn Future<Output = Result<Page<HashMap<String, f64>>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_traced_entry_points<'life0, 'async_trait>( &'life0 self, params: TracedEntryPointsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<TracedEntryPoints>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_snapshots<'a, 'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 SnapshotParameters<'a>, chunk_size: Option<usize>, concurrency: usize, ) -> Pin<Box<dyn Future<Output = Result<Snapshot, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn get_contract_state_paginated<'life0, 'async_trait>( &'life0 self, params: ContractStatePaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_protocol_components_paginated<'life0, 'async_trait>( &'life0 self, params: ProtocolComponentsPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProtocolComponent>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_protocol_states_paginated<'life0, 'async_trait>( &'life0 self, params: ProtocolStatesPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProtocolComponentState>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_all_tokens<'life0, 'async_trait>( &'life0 self, params: AllTokensParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<Token>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_component_tvl_paginated<'life0, 'async_trait>( &'life0 self, params: ComponentTvlPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn get_traced_entry_points_paginated<'life0, 'async_trait>( &'life0 self, params: TracedEntryPointsPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<TracedEntryPoints, RPCError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}

Required Methods§

Source

fn compression(&self) -> bool

Returns whether compression is enabled for requests.

Source

fn get_contract_state<'life0, 'async_trait>( &'life0 self, params: ContractStateParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<Account>>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a snapshot of contract state for the given contract addresses.

block_number pins the query to a specific block; pass None to use the latest state.

Source

fn get_protocol_components<'life0, 'async_trait>( &'life0 self, params: ProtocolComponentsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<ProtocolComponent>>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves protocol components matching the given filters.

Pass component_ids to filter by specific IDs, or tvl_gt to filter by minimum TVL.

Source

fn get_protocol_states<'life0, 'async_trait>( &'life0 self, params: ProtocolStatesParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<ProtocolComponentState>>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a page of protocol component states.

block_number pins the query to a specific block; pass None to use the latest state.

Source

fn get_tokens<'life0, 'async_trait>( &'life0 self, params: TokensParams, ) -> Pin<Box<dyn Future<Output = Result<Page<Vec<Token>>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a page of tokens.

Use get_all_tokens to fetch all matching tokens automatically.

Source

fn get_protocol_systems<'life0, 'async_trait>( &'life0 self, params: ProtocolSystemsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<ProtocolSystems>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves the protocol systems known to the server.

Source

fn get_component_tvl<'life0, 'async_trait>( &'life0 self, params: ComponentTvlParams, ) -> Pin<Box<dyn Future<Output = Result<Page<HashMap<String, f64>>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves component TVL values.

Filter by component_ids or by protocol_system; both are optional.

Source

fn get_traced_entry_points<'life0, 'async_trait>( &'life0 self, params: TracedEntryPointsParams, ) -> Pin<Box<dyn Future<Output = Result<Page<TracedEntryPoints>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a page of traced entry points.

Use get_traced_entry_points_paginated to fetch all pages automatically.

Source

fn get_snapshots<'a, 'life0, 'life1, 'async_trait>( &'life0 self, request: &'life1 SnapshotParameters<'a>, chunk_size: Option<usize>, concurrency: usize, ) -> Pin<Box<dyn Future<Output = Result<Snapshot, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn get_contract_state_paginated<'life0, 'async_trait>( &'life0 self, params: ContractStatePaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<Account>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a snapshot of contract state for a set of contract IDs.

If chunk_size is None, it defaults to the maximum page size.

Source

fn get_protocol_components_paginated<'life0, 'async_trait>( &'life0 self, params: ProtocolComponentsPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProtocolComponent>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves protocol components, fetching all pages automatically.

If chunk_size is None, it defaults to the maximum page size.

Source

fn get_protocol_states_paginated<'life0, 'async_trait>( &'life0 self, params: ProtocolStatesPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<ProtocolComponentState>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves protocol states for a set of protocol IDs, fetching all pages automatically.

If chunk_size is None, it defaults to the maximum page size.

Source

fn get_all_tokens<'life0, 'async_trait>( &'life0 self, params: AllTokensParams, ) -> Pin<Box<dyn Future<Output = Result<Vec<Token>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all tokens matching the given criteria, fetching all pages automatically.

If chunk_size is None, it defaults to the maximum page size.

Source

fn get_component_tvl_paginated<'life0, 'async_trait>( &'life0 self, params: ComponentTvlPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<HashMap<String, f64>, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves component TVL values, fetching all pages automatically.

If chunk_size is None, it defaults to the maximum page size.

Source

fn get_traced_entry_points_paginated<'life0, 'async_trait>( &'life0 self, params: TracedEntryPointsPaginatedParams, ) -> Pin<Box<dyn Future<Output = Result<TracedEntryPoints, RPCError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves traced entry points for a set of component IDs, fetching all pages automatically.

If chunk_size is None, it defaults to the maximum page size.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§