event_reader.block_header
Documentation for eth_defi.event_reader.block_header Python module.
Block header data.
Structures and helpers to maintain block header data.
Classes
Describe block headers for a single block. |
- class BlockHeader
Bases:
objectDescribe block headers for a single block.
This data is used to check chain reorganisations
This data is used to store block number -> block timestamp map and resolve trades to their UTC time
- __init__(block_number, block_hash, timestamp)
- static from_pandas(df)
Decode saved Pandas input.
- Return type
- static generate_headers(count, start_block=1, start_time=0, blocks_per_second=12)
Generate random block header data.
Used for testing.
- property timestamp_as_datetime: datetime.datetime
Get the timestamp as float.
- static to_pandas(headers, partition_size=None)
Convert columnar header data to Pandas.
Note
Depends on Pandas, but because we have optional dependency do a lazy import.