messari.eventmonitor package

Submodules

messari.eventmonitor.eventmonitor module

This module is meant to contain the EventMonitor class

class messari.eventmonitor.eventmonitor.EventMonitor(contracts_in: Union[str, List], explorer: messari.blockexplorers.scanner.Scanner, rpc_url: str, event_names: Optional[Union[str, List]] = None)

Bases: object

Class to monitor contract events

Methods

event_handler()

Grab events from queue and pass to handler

get_contract_events()

Return size of event queue

get_event_handler_status()

Return status of event handler thread

get_events_df()

Return all events as a DataFrame

get_events_list()

Return all events as a List

get_monitor_status()

Return status of event monitor thread

get_queue_size()

Return size of event queue

get_sync_status()

Return status of sync thread

handle_event(event)

Process event when it happens

monitor()

Monitor for events & add to queue

start_event_handler()

Start handler thread, do nothing if already started

start_monitor()

Start monitor thread, do nothing if already started

start_sync([start, end])

Start sync thread, do nothing if already started

stop_event_handler()

Send flag to handler to end loop & thread

stop_monitor()

Send flag to monitor to end loop & thread

stop_sync()

Send flag to monitor to end loop & thread

watch_sync()

Live watching & printing of the sync status.

sync

sync_top

event_handler()

Grab events from queue and pass to handler

get_contract_events() pandas.core.frame.DataFrame

Return size of event queue

get_event_handler_status() str

Return status of event handler thread

get_events_df() pandas.core.frame.DataFrame

Return all events as a DataFrame

get_events_list() List

Return all events as a List

get_monitor_status() str

Return status of event monitor thread

get_queue_size() int

Return size of event queue

get_sync_status() str

Return status of sync thread

handle_event(event)

Process event when it happens

monitor()

Monitor for events & add to queue

start_event_handler()

Start handler thread, do nothing if already started

start_monitor()

Start monitor thread, do nothing if already started

start_sync(start: int = 0, end: Union[int, str] = 'latest')

Start sync thread, do nothing if already started

stop_event_handler()

Send flag to handler to end loop & thread

stop_monitor()

Send flag to monitor to end loop & thread

stop_sync()

Send flag to monitor to end loop & thread

sync(start_block: int, end_block: int, contract: str, topic: Optional[str] = None)
sync_top(start_block: int, end_block: int)
watch_sync()

Live watching & printing of the sync status. Be warned this is a blocking function

messari.eventmonitor.helpers module

This module is dedicated to helpers for the EventMonitor class

messari.eventmonitor.helpers.build_contract_events(contracts: List, explorer: messari.blockexplorers.scanner.Scanner) pandas.core.frame.DataFrame

Return df about info of contract events

messari.eventmonitor.helpers.validate_checksum(hex_in: Union[str, List]) List

Checks if input is list of checksum addresses.

Parameters

asset_input – str, list Single asset slug string or list of asset slugs (i.e. BTC).

:return List of asset slugs. :raises ValueError if input is neither a string or list

Module contents

Module to handle initialization, imports, for EventMonitor class