Types

The following types are available from the eth_typing module.

i.e.

from eth_typing import TypeStr

ABI

TypeStr

String representation of a data type.

TypeStr = str

Decodable

Binary data to be decoded.

Decodable = Union[bytes, bytearray]

Enumerables

ForkName

Class that contains the different names used to represent hard forks on the Ethereum network.

class ForkName:
    Frontier = 'Frontier'
    Homestead = 'Homestead'
    EIP150 = 'EIP150'
    EIP158 = 'EIP158'
    Byzantium = 'Byzantium'
    Constantinople = 'Constantinople'
    Metropolis = 'Metropolis'

EthPM

ContractName

Any string conforming to the regular expression [a-zA-Z][a-zA-Z0-9_]{0,255}.

ContractName = NewType('ContractName', str)

URI

Any string that represents a URI.

URI = NewType('URI', str)

EVM

Address

Any bytestring representing a canonical address.

Address = NewType('Address', bytes)

HexAddress

Any string representing a hex encoded address.

HexAddress = NewType('HexAddress', str)

ChecksumAddress

Any HexAddress that is formatted according to ERC55.

ChecksumAddress = NewType('ChecksumAddress', HexAddress)

AnyAddress

Any of Address, HexAddress, ChecksumAddress.

AnyAddress = TypeVar('AnyAddress', Address, HexAddress, ChecksumAddress)

Hash32

Any 32 byte hash.

Hash32 = NewType('Hash32', bytes)

BlockNumber

Any integer that represents a valid block number on a chain.

BlockNumber = NewType('BlockNumber', int)

BlockIdentifier

Either a 32 byte hash or an integer block number

BlockIdentifier = Union[Hash32, BlockNumber]

Encodings

HexStr

Any string that is hex encoded.

HexStr = NewType('HexStr', str)

Primitives

Any of bytes, int, or bool used as the Primitive arg for conversion utils in ETH-Utils.

Primitives = Union[bytes, int, bool]