get_block_timestamp#

API documentation for tradeexecutor.utils.blockchain.get_block_timestamp Python function.

get_block_timestamp(web3, block_identifier)[source]#

Get a block timestamp.

Slow method. Use only for individual queries.

Returns:

Timezone naive UTC datetime

Parameters:
  • web3 (Web3) –

  • block_identifier (Union[Literal['latest', 'earliest', 'pending', 'safe', 'finalized'], ~eth_typing.evm.BlockNumber, ~eth_typing.evm.Hash32, ~eth_typing.encoding.HexStr, ~hexbytes.main.HexBytes, int]) –

Return type:

datetime