dxsp.utils.monitoring_utils.WalletMonitor#

class dxsp.utils.monitoring_utils.WalletMonitor(w3: Web3, address_to_monitor: str, polling_interval: int = 15)[source]#

Bases: object

Monitors a specified wallet address on a given blockchain for new transactions using polling and yields them.

Initializes the WalletMonitor.

Parameters:
  • w3 (Web3) – The initialized Web3 instance for the target blockchain.

  • address_to_monitor (str) – The wallet address to monitor.

  • polling_interval (int) – How often to check for new blocks (in seconds).

Methods

start_monitoring()

Starts monitoring process & yields transactions from the monitored address.

stop_monitoring()

Stops the monitoring process.

async start_monitoring() AsyncIterator[TxData][source]#

Starts monitoring process & yields transactions from the monitored address. This runs indefinitely until the consumer stops iterating.

async stop_monitoring()[source]#

Stops the monitoring process.