get_block_timestamps_using_hypersync_async
Documentation for eth_defi.hypersync.hypersync_timestamp.get_block_timestamps_using_hypersync_async function.
- async get_block_timestamps_using_hypersync_async(client, chain_id, start_block, end_block, timeout=120.0, display_progress=True, progress_throttle=10000, validate_chain_id=True, reason=None)
Read block timestamps using Hypersync API.
Instead of hammering
eth_getBlockByNumberJSON-RPC endpoint, we can get block timestamps using Hypersync API 1000x faster.- Parameters
chain_id (int) – Expected chain ID. Validated against the client unless
validate_chain_idisFalse.start_block (int) – Start block, inclusive
end_block (int) – End block, inclusive
client (hypersync.HypersyncClient) – Hypersync client to use
validate_chain_id (bool) – When
True(default), verify the client is connected to the expected chain before streaming. Set toFalsewhen the caller has already validated (e.g. the cached path).reason (Optional[str]) – Human-readable label for this request, included in log and error messages to help track which caller is consuming API quota.
timeout (float) –
display_progress (bool) –
- Return type
AsyncIterable[eth_defi.event_reader.block_header.BlockHeader]