AsyncSRC20EventWatcher
Asynchronous SRC20 event watcher class
Overview
Class Definition
class AsyncSRC20EventWatcher:
"""Polling-based SRC20 event watcher (async, runs as an asyncio.Task)."""
def __init__(
self,
w3: AsyncWeb3,
aes_key: Bytes32,
*,
token_address: ChecksumAddress | None = None,
on_transfer: AsyncTransferCallback | TransferCallback | None = None,
on_approval: AsyncApprovalCallback | ApprovalCallback | None = None,
on_error: AsyncErrorCallback | ErrorCallback | None = None,
poll_interval: float = 2.0,
from_block: int | str = "latest",
) -> NoneConstructor Parameters
Parameter
Type
Required
Description
Methods
start()
stop()
Properties
is_running
Context Manager Support
Examples
Manual Start/Stop
Async Context Manager
Check Running Status
Async Callback
Sync Callback (Also Works)
Filter by Token Address
Custom Poll Interval
Historical Events
Error Handling
Both Transfer and Approval
How It Works
Callback Signatures
Transfer Callback
Approval Callback
Error Callback
Notes
Warnings
See Also
Last updated

