Blocks

Examples

Note

These examples are crafted as a Jupyter notebook. You can download the original notebook file here.

Also note that inside Jupyter notebooks, await can be used freely outside of asyncio.run().

blocks

Reference

async ctc.evm.async_get_block(block, *, include_full_transactions=False, provider=None, use_db=True)

get block from local database or from RPC node

async ctc.evm.async_get_block_of_timestamp(timestamp, *, nary=None, cache=None, block_timestamps=None, block_timestamp_array=None, block_number_array=None, verbose=False, provider=None, use_db=True, use_db_assist=True, mode='>=')

search for the block that corresponds to a given timestamp

async ctc.evm.async_get_blocks(blocks, *, include_full_transactions=False, chunk_size=500, provider=None, use_db=True, latest_block_number=None)

get blocks from local database or from RPC node

async ctc.evm.async_get_blocks_of_timestamps(timestamps, *, block_timestamps=None, block_number_array=None, block_timestamp_array=None, nary=None, cache=None, provider=None, use_db=True, mode='>=')

search for blocks corresponding to list of timestamps