agent0.chainsync.db.hyperdrive.event_getters
Event getters specific to database.
Attributes
Functions
|
Get event logs based on the event_class, making necessary conversions for the database. |
Module Contents
- agent0.chainsync.db.hyperdrive.event_getters.EVENT_QUERY_PAGE_SIZE = 80000
- agent0.chainsync.db.hyperdrive.event_getters.get_event_logs_for_db(hyperdrive_interface: agent0.ethpy.hyperdrive.HyperdriveReadInterface, event_class: web3.contract.contract.ContractEvent, trade_base_unit_conversion: bool, from_block: web3.types.BlockIdentifier | None = None, argument_filters: dict[str, Any] | None = None, numeric_args_as_str: bool = True) list[dict[str, Any]]
Get event logs based on the event_class, making necessary conversions for the database.
- Parameters:
hyperdrive_interface (HyperdriveReadInterface) – The hyperdrive interface to use.
event_class (type[ContractEvent]) – The event class to get logs for.
trade_base_unit_conversion (bool) – Whether to convert trade base units from steth “shares” to steth.
from_block (BlockIdentifier | None, optional) – The block to start getting events from. Defaults to “earliest”, with some exceptions for specific chains.
argument_filters (dict[str, Any] | None, optional) – A dictionary of filters to apply to the arguments of events. Defaults to None.
numeric_args_as_str (bool, optional) – Whether to convert numeric event arguments to strings for keeping precision. Defaults to True.
- Returns:
A list of emitted events.
- Return type:
list[dict[str, Any]]