estimate_block_number_for_timestamp_by_findblock

Documentation for eth_defi.timestamp.estimate_block_number_for_timestamp_by_findblock function.

estimate_block_number_for_timestamp_by_findblock(chain_id, timestamp, attempts=5, sleep=60)

Estimate block number for a given timestamp.

  • To convert timestamps to block numbers

  • Uses FindBlock API, using block/before API

  • Gets the block that was finaliesd at the timestamp or before it.

  • FindBlock API is free

Note

FindBlock API is too throttled to get the timestamp only but few blocks. I think we get 5 request per minute.

Parameters
Returns

Estimated block number

Return type

eth_defi.timestamp.FindBlockReply