> For the complete documentation index, see [llms.txt](https://docs.seismic.systems/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.seismic.systems/clients/python/src20/event-watching/watch-src20-events.md).

# watch\_src20\_events

Watch SRC20 Transfer and Approval events for your wallet, automatically fetching your viewing key from the Directory contract via signed read.

## Signatures

```python
def watch_src20_events(
    w3: Web3,
    *,
    encryption: EncryptionState,
    private_key: PrivateKey,
    token_address: ChecksumAddress | None = None,
    on_transfer: TransferCallback | None = None,
    on_approval: ApprovalCallback | None = None,
    on_error: ErrorCallback | None = None,
    poll_interval: float = 2.0,
    from_block: int | str = "latest",
) -> SRC20EventWatcher

async def async_watch_src20_events(
    w3: AsyncWeb3,
    *,
    encryption: EncryptionState,
    private_key: PrivateKey,
    ...same keyword args...
) -> AsyncSRC20EventWatcher
```

## Parameters

| Parameter       | Type                                                               | Default    | Description                                    |
| --------------- | ------------------------------------------------------------------ | ---------- | ---------------------------------------------- |
| `w3`            | `Web3` / `AsyncWeb3`                                               |            | Web3 instance with Seismic support             |
| `encryption`    | [`EncryptionState`](/clients/python/client/encryption-state.md)    |            | Encryption state from wallet client            |
| `private_key`   | [`PrivateKey`](/clients/python/api-reference/types/private-key.md) |            | Signing key for Directory signed read          |
| `token_address` | `ChecksumAddress \| None`                                          | `None`     | SRC20 contract to filter (`None` = all tokens) |
| `on_transfer`   | Callback                                                           | `None`     | Invoked for Transfer events                    |
| `on_approval`   | Callback                                                           | `None`     | Invoked for Approval events                    |
| `on_error`      | Callback                                                           | `None`     | Invoked on errors (decryption, RPC)            |
| `poll_interval` | `float`                                                            | `2.0`      | Seconds between polls                          |
| `from_block`    | `int \| "latest"`                                                  | `"latest"` | Starting block                                 |

## Returns

[`SRC20EventWatcher`](/clients/python/src20/event-watching/src20-event-watcher.md) (sync) or [`AsyncSRC20EventWatcher`](/clients/python/src20/event-watching/async-src20-event-watcher.md) (async) — already started.

## Example

```python
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)

with watch_src20_events(
    w3,
    encryption=w3.seismic.encryption,
    private_key=pk,
    on_transfer=lambda log: print(f"Transfer: {log.decrypted_amount}"),
) as watcher:
    input("Press Enter to stop...\n")
```

## Notes

* Fetches your viewing key from Directory via `get_viewing_key()` on creation — raises `ValueError` if no key registered
* The watcher starts automatically; call `.stop()` or use context manager to clean up
* If you already have the viewing key, use [`watch_src20_events_with_key()`](/clients/python/src20/intelligence-providers/watch-src20-events-with-key.md) to skip the signed read

## See Also

* [watch\_src20\_events\_with\_key](/clients/python/src20/intelligence-providers/watch-src20-events-with-key.md) — Watch with explicit key (no wallet needed)
* [SRC20EventWatcher](/clients/python/src20/event-watching/src20-event-watcher.md) — Underlying sync watcher class
* [register\_viewing\_key](/clients/python/src20/intelligence-providers/register-viewing-key.md) — Register a key first


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.seismic.systems/clients/python/src20/event-watching/watch-src20-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
