dojo.common

Common contains types for users to use in their own code.

class Chain(dojo.common.constants.StrEnum):

Tracked chains.

This is not meant to track any other chain nomenclatures like: chain id, networks, testnets, etc. It's only meant to be a high-level indicator of specific chain logic.

ARBITRUM = <Chain.ARBITRUM: 'arbitrum'>

Arbitrum mainnet chain.

ETHEREUM = $CHAIN

Ethereum mainnet chain.

GNOSIS = <Chain.GNOSIS: 'gnosis'>

Gnosis mainnet chain.

def time_to_block(datetime_string: str, chain: Chain) -> int:

Convert a datetime string to a block number.

Will return the number of the last completed block up to that timestamp.

Parameters
  • **datetime_string: String in the following format: 2020-01-01 20:42**: 02
  • chain: Enum of the chain for which this conversion should be done.