TxReceipts

Name: TxReceipts

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]

The TxReceipts stream returns the receipts of each transaction in a new block. This is only available with Gateways and not with Cloud-API connections.

Examples

Gateway
Cloud-API
Transaction Receipt Event
Gateway

Subscribing to Gateway Feed in Python (line 6 creates the subscription):

import asyncio
from bloxroute_cli.provider.ws_provider import WsProvider
ws_uri = "ws://127.0.0.1:28333"
async def main():
async with WsProvider(ws_uri) as ws:
subscription_id = await ws.subscribe("txReceipts", {"include": ["receipt.transaction_hash"]})
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())
​
Cloud-API

The Tx Receipts feed is not available via the Cloud-API.

Transaction Receipt Event
<<< {"jsonrpc": "2.0", "id": null,
"result": {"blockHash":"0x1580cb....c950122b837",
"blockNumber":"0xb128cc",
"contractAddress":null,
"cumulativeGasUsed":"0x4e1fb7",
"from":"0x80bb1...7bf44058a48a",
"gasUsed":"0x1d918",
"logs":[{"address":"0x68caa...87846652822ae4b5",
"topics":["0x3ae9ad...c40b5a","0x000000000...058a48a"],
"data":"0x0000...f3784",
"blockNumber":"0xb128cc",
"transactionHash":"0x12316c...3080bc012",
"transactionIndex":"0x4b",
"blockHash":"0x1580cb8419...22b837",
"logIndex":"0x7a",
"removed":false}],
"logsBloom":"0x00000...0000",
"status":"0x1",
"to":"0x68ca...22ae4b5",
"transactionHash":"0x12316...0bc012",
"transactionIndex":"0x4b"}}