Name: TxReceipts
Options
Key | Description | Values |
| Fields to include in the receipts stream |
|
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
Subscribing to Gateway Feed in Python (line 6 creates the subscription):
import asynciofrom bloxroute_cli.provider.ws_provider import WsProviderws_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 generallyawait ws.unsubscribe(subscription_id)if __name__ == '__main__':asyncio.get_event_loop().run_until_complete(main())
The Tx Receipts feed is not available via the Cloud-API.
<<< {"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"}}