transactionStatus

Name: transactionStatus

transactionStatus is a stream that shows the real-time status of transactions as they propagate throughout the Ethereum network. For example, this allows users to know the exact moment their transaction is confirmed, i.e. has been included in enough blocks that it is considered confirmed.

To use the transactionStatus stream, you first need to subscribe to the stream. Then you need to request monitoring for transactions for which you would like to receive status updates. Transactions can be yours or someone else's. In order to monitor a transaction, you need to send the signed raw transaction to the Cloud-API (note: sending only the transaction hash is not sufficient because the Cloud-API might not have the transaction you want to monitor). The transactionStatus is a Cloud-API only stream. The stream will return an event every time a status is changed for one of the monitored transactions. Please review the list of possible statuses at the bottom of the page. The stream supports two methods as documented below.

Method: start_monitor_transaction

Description: Submits transactions for monitoring.

Parameters

Parameter

Description

transactions

[Mandatory] List of raw transaction bytes without 0x prefix.

monitor_speedup

[Optional, default: False] A boolean flag that enables automatic monitoring of transactions submitted with the same nonce.

Method: stop_monitor_transaction

Description: Stops monitoring a transaction

Parameters

Parameter

Description

transaction_hash

[Mandatory] Transaction hash without 0x prefix.

Requests Examples

Subscribing to the feed
Start Monitor
Stop Monitor
Subscribing to the feed

Subscribing to the Cloud-API Transaction Status Feed in Python (line 7 creates the subscription):

import asyncio
from bloxroute_cli.provider.cloud_wss_provider import CloudWssProvider
async def main():
async with CloudWssProvider(
ssl_dir="/usr/bloxroute/certificate/external_gateway/registration_only"
) as ws:
subscription_id = await ws.subscribe("transactionStatus", {"include": ["tx_hash", "status"]})
while True:
next_notification = await ws.get_next_subscription_notification_by_id(subscription_id)
print(next_notification) # or process it generally
await ws.unsubscribe(subscription_id)
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())
​
Start Monitor
import asyncio
from bloxroute_cli.provider.ws_provider import WsProvider
from bxcommon.rpc.rpc_request_type import RpcRequestType
​
async def main():
async with WsProvider(
uri="wss://api.blxrbdn.com/ws",
headers={"Authorization": <YOUR_AUTHORIZATION_HEADER>}
) as ws:
result = await ws.call_bx(RpcRequestType.START_MONITOR_TRANSACTION, {"transactions": ["f86b0184...e0b58219"], "monitor_speedup": "True"})
print(result) # or process it generally
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())
Stop Monitor
import asyncio
from bloxroute_cli.provider.ws_provider import WsProvider
from bxcommon.rpc.rpc_request_type import RpcRequestType
​
async def main():
async with WsProvider(
uri="wss://api.blxrbdn.com/ws",
headers={"Authorization": <YOUR_AUTHORIZATION_HEADER>}
) as ws:
result = await ws.call_bx(RpcRequestType.STOP_MONITOR_TRANSACTION, {"transaction_hash": "f86b0184...e0b58219"})
print(result) # or process it generally
if __name__ == '__main__':
asyncio.get_event_loop().run_until_complete(main())

Possible statuses are:

Status

Description

UNKNOWN

The transaction is not recognized.

PROPAGATING

The transaction is propagating within the BDN.

TX_POOL

The transaction was received by an ETH node and accepted to its tx pool.

MINED

The transaction was included in a block.

CONFIRMED

The transaction's block is confirmed.

REPROPAGATE

For a transaction summited with Nonce monitoring, this status indicates that the system is resubmitting the transaction.

SPEEDUP

Received a new transaction with the same address and nonce as the monitored transaction. This new transaction will be monitored if monitor_speedup is enabled.

CANCELED

The transaction is canceled.

Results Example

Transaction Status Event
Transaction Status Event
<<< {"jsonrpc": "2.0", "id": null, "method": "subscribe",
"params": {"subscription": "909e4bae-2c48-43f3-a007-f17d4c8a3ce8",
"result": {"txHash": "14f3d7a1553b252b89....3214f3de",
"status": PROPAGATING
}
​