Documentation for eth_defi.event_reader.reader.Web3EventReader Python class.

class Web3EventReader[source]

Pass the event reader callable around.

An interface over event reader iterator.

  • Helps to type decorate event reader callable in the function arguments

  • The event reader implementation may be single-threaded, multithreaded, async based, etc.

For concrete implementation see

Example by using a single-thread reader:

from eth_defi.event_reader.reader import extract_events, Web3EventReader
from eth_defi.enzyme.events import fetch_vault_balance_events

read_events: Web3EventReader = cast(Web3EventReader, partial(extract_events))
balance_events = list(fetch_vault_balance_events(vault, start_block, end_block, read_events))

Methods summary

__init__(*args, **kwargs)

__init__(*args, **kwargs)