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)

Read block timestamps using Hypersync API.

Instead of hammering eth_getBlockByNumber JSON-RPC endpoint, we can get block timestamps using Hypersync API 1000x faster.

Parameters
  • chain_id (int) –

    Verify HyperSync client is connected to the correct chain ID.

    (Not actually used in request because client is per-chain)

  • start_block (int) – Start block, inclusive

  • end_block (int) – End block, inclusive

  • client (hypersync.HypersyncClient) – Hypersync client to use

  • timeout (float) –

  • display_progress (bool) –

Return type

AsyncIterable[eth_defi.event_reader.block_header.BlockHeader]