1. Home
  2. bloXroute Documentation
  3. Transaction Streaming
  4. Cancelling a Subscription

Cancelling a Subscription

If you need to cancel a subscription, pass the subscription ID to the unsubscribe call:

from bloxroute_cli.provider.ws_provider import WsProvider
ws_uri = "ws://127.0.0.1:28333"
async with WsProvider(ws_uri) as ws:
   subscription_id = await ws.subscribe("pendingTxs", {"include": ["tx_hash"]})
   await ws.unsubscribe(subscription_id)