Skip to main content

Constructor

ParameterDefaultDescription
api_keyRequiredAPI key.
networkRequiredNetwork.MAINNET or Network.TESTNET.
base_urlOptionalOverride the default URL.
sessionOptionalExternal aiohttp.ClientSession.
headersOptionalExtra HTTP headers.
reconnect_policyOptionalSee Connection.
on_state_changeOptionalSee Connection.
heartbeat_timeout30 secondsSeconds before considering the connection dead.

start

Builds the subscription from registered handlers and dispatches notifications. Blocks until stop() is called or a fatal error occurs.
try:
    await sse.start(
        addresses=["EQDtFpEwcFAEcRe5mLVh2N6C0x-_hJEM7W61_JLnSF74p4q2"],
        include_address_book=True,
        include_metadata=True,
    )
finally:
    await sse.stop()
ParameterDefaultDescription
addressesOptionalAddresses to watch (in any form).
trace_external_hash_normsOptionalTrace hashes (required when on_traces is used).
include_address_bookFalsePopulate address_book in notifications.
include_metadataFalsePopulate metadata in notifications.
supported_action_typesOptionalAdvertise supported action types.
Only one 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:
await sse.stop()