ape.types

Miscellaneous

ape.types.BlockID

An ID that can match a block, such as the literals "earliest", "latest", or "pending" as well as a block number or hash (HexBytes).

alias of Union[int, HexStr, hexbytes.main.HexBytes, Literal[‘earliest’, ‘latest’, ‘pending’]]

class ape.types.ContractLog(*, event_name: str, contract_address: ChecksumAddress, event_arguments: Dict[str, Any], transaction_hash: Any = None, block_number: int, block_hash: Any = None, log_index: int, transaction_index: Optional[int] = None)

An instance of a log from a contract.

block_hash: Any

The hash of the block containing the transaction that produced this log.

block_number: int

The number of the block containing the transaction that produced this log.

contract_address: ChecksumAddress

The contract responsible for emitting the log.

event_arguments: Dict[str, Any]

The arguments to the event, including both indexed and non-indexed data.

event_name: str

The name of the event.

log_index: int

The index of the log on the transaction.

transaction_hash: Any

The hash of the transaction containing this log.

transaction_index: Optional[int]

The index of the transaction’s position when the log was created. Is None when from the pending block.

Signatures

class ape.types.signatures.MessageSignature(v: int, r: bytes, s: bytes)

Bases: ape.types.signatures._Signature

A ECDSA signature (vrs) of a message.

class ape.types.signatures.SignableMessage(version: bytes, header: bytes, body: bytes)

Bases: tuple

A message compatible with EIP-191_ that is ready to be signed.

The properties are components of an EIP-191_ signable message. Other message formats can be encoded into this format for easy signing. This data structure doesn’t need to know about the original message format. For example, you can think of EIP-712 as compiling down to an EIP-191 message.

In typical usage, you should never need to create these by hand. Instead, use one of the available encode_* methods in this module, like:

  • encode_structured_data()

  • encode_intended_validator()

  • encode_defunct()

body: bytes

Alias for field number 2

header: bytes

Alias for field number 1

version: bytes

Alias for field number 0

class ape.types.signatures.TransactionSignature(v: int, r: bytes, s: bytes)

Bases: ape.types.signatures._Signature

A ECDSA signature (vrs) of a transaction.