Constructor
- SSE
- WebSocket
| Parameter | Default | Description |
|---|---|---|
api_key | Required | API key. |
network | Required | Network.MAINNET or Network.TESTNET. |
base_url | Optional | Override the default URL. |
session | Optional | External aiohttp.ClientSession. |
headers | Optional | Extra HTTP headers. |
reconnect_policy | Optional | See Connection. |
on_state_change | Optional | See Connection. |
heartbeat_timeout | 30 seconds | Seconds before considering the connection dead. |
start
Builds the subscription from registered handlers and dispatches notifications. Blocks untilstop() is called or a fatal error occurs.
- SSE
- WebSocket
| Parameter | Default | Description |
|---|---|---|
addresses | Optional | Addresses to watch (in any form). |
trace_external_hash_norms | Optional | Trace hashes (required when on_traces is used). |
include_address_book | False | Populate address_book in notifications. |
include_metadata | False | Populate metadata in notifications. |
supported_action_types | Optional | Advertise supported action types. |
start() per instance — a second call raises RuntimeError.
stop
Signals the dispatch loop to exit, closes the session, and resets state. Call from another coroutine:- SSE
- WebSocket