txReceipts
Name: txReceipts
txReceipts is a stream of all transaction receipts in each newly mined block.
This is a Gateway-API only stream.
Options
Key
Description
Values
include
Fields to include in the receipts stream
receipt, receipt.block_hash, receipt.block_number, receipt.contract_address, receipt.cumulative_gas_used, receipt.from, receipt.gas_used, receipt.logs, receipt.logs_bloom, receipt.status, receipt.to, receipt.transaction_hash,receipt.transaction_index [Default: all]
Examples
Gateway
Cloud-API
Transaction Receipt Event
Subscribing to the txReceipts stream via the Gateway-API in Python (Line 6 creates the subscription):
1
import asyncio
2
from bloxroute_cli.provider.ws_provider import WsProvider
3
ws_uri = "ws://127.0.0.1:28333"
4
async def main():
5
async with WsProvider(ws_uri) as ws:
6
subscription_id = await ws.subscribe("txReceipts", {"include": ["receipt"]})
7
while True:
8
next_notification = await ws.get_next_subscription_notification_by_id(subscription_id)
9
print(next_notification) # or process it generally
10
await ws.unsubscribe(subscription_id)
11
if __name__ == '__main__':
12
asyncio.get_event_loop().run_until_complete(main())
Copied!
The txReceipts stream is not available via the Cloud-API.
1
<<< {"jsonrpc": "2.0", "id": null,
2
"result": {"blockHash":"0x1580cb....c950122b837",
3
"blockNumber":"0xb128cc",
4
"contractAddress":null,
5
"cumulativeGasUsed":"0x4e1fb7",
6
"from":"0x80bb1...7bf44058a48a",
7
"gasUsed":"0x1d918",
8
"logs":[{"address":"0x68caa...87846652822ae4b5",
9
"topics":["0x3ae9ad...c40b5a","0x000000000...058a48a"],
10
"data":"0x0000...f3784",
11
"blockNumber":"0xb128cc",
12
"transactionHash":"0x12316c...3080bc012",
13
"transactionIndex":"0x4b",
14
"blockHash":"0x1580cb8419...22b837",
15
"logIndex":"0x7a",
16
"removed":false}],
17
"logsBloom":"0x00000...0000",
18
"status":"0x1",
19
"to":"0x68ca...22ae4b5",
20
"transactionHash":"0x12316...0bc012",
21
"transactionIndex":"0x4b",
22
"type":"0x0"}}
Copied!
Last modified 1mo ago
Copy link