Event Watching
Watch and decrypt SRC20 Transfer and Approval events
Factory Functions
Function
Description
Watcher Classes
Class
Description
Example
import os
from seismic_web3 import PrivateKey, SEISMIC_TESTNET
from seismic_web3.src20 import watch_src20_events
pk = PrivateKey.from_hex_str(os.environ["PRIVATE_KEY"])
w3 = SEISMIC_TESTNET.wallet_client(pk)
watcher = watch_src20_events(
w3,
encryption=w3.seismic.encryption,
private_key=pk,
on_transfer=lambda log: print(f"Transfer: {log.decrypted_amount}"),
on_approval=lambda log: print(f"Approval: {log.decrypted_amount}"),
)
# Later...
watcher.stop()How It Works
See Also
Last updated

