pub trait HoprIndexerRpcOperations {
// Required methods
fn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn try_stream_logs<'a>(
&'a self,
start_block_number: u64,
filter: LogFilter,
) -> Result<Pin<Box<dyn Stream<Item = BlockWithLogs> + Send + 'a>>>;
}
Expand description
Trait with RPC provider functionality required by the Indexer.
Required Methods§
Sourcefn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn block_number<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieves the latest block number.
Sourcefn try_stream_logs<'a>(
&'a self,
start_block_number: u64,
filter: LogFilter,
) -> Result<Pin<Box<dyn Stream<Item = BlockWithLogs> + Send + 'a>>>
fn try_stream_logs<'a>( &'a self, start_block_number: u64, filter: LogFilter, ) -> Result<Pin<Box<dyn Stream<Item = BlockWithLogs> + Send + 'a>>>
Starts streaming logs from the given start_block_number
.
If no start_block_number
is given, the stream starts from the latest block.
The given filter
are applied to retrieve the logs, the function fails if the filter is empty.
The streaming stops only when the corresponding channel is closed by the returned receiver.