transactionReceipts - EVM Data Stream

The transactionReceipts topic sends one notification per matching mined transaction, carrying its original receipt, exactly as eth_getTransactionReceipt returns it. Use it to learn whether transactions succeeded, what they cost, which contracts they created, and which logs they emitted.

WebSocket-only topic. Subscribe with getblock_subscribe on any network endpoint.

Parameters

ParameterTypeRequiredDescription
filters.statusstringNosuccess or failure.
filters.fromstringNoTransaction sender.
filters.tostringNoTransaction recipient.
filters.contractCreatedbooleanNotrue for contract-creation receipts only; false for ordinary transactions only.
filters.transactionTypestringNoEIP-2718 transaction type as a hex quantity: "0x0" legacy, "0x1" access list, "0x2" EIP-1559, "0x3" blob, "0x4" EIP-7702.

Request Example

bash# WebSocket-only. Connect first:
wscat -c 'wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream' -H 'Authorization: Bearer <API-KEY>'

# Then send:
{"jsonrpc":"2.0","id":1,"method":"getblock_subscribe","params":[{"topic":"transactionReceipts","filters":{"from":"0x965e7b3578110a781b86b1cca9b2d7824b62a678","status":"failure"}}]}
javascript// npm install ws
import WebSocket from 'ws';

const ws = new WebSocket('wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream', {
  headers: { Authorization: 'Bearer <API-KEY>' }
});

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'getblock_subscribe',
    params: [{
      topic: 'transactionReceipts',
      filters: {
        from: '0x965e7b3578110a781b86b1cca9b2d7824b62a678',
        status: 'failure'
      }
    }]
  }));
});

ws.on('message', (raw) => {
  const msg = JSON.parse(raw);

  // First reply is the subscription ID (or an error)
  if (msg.id !== undefined) {
    console.log(msg.error ?? `Subscribed: ${msg.result}`);
    return;
  }

  const { removed, data } = msg.params.result;
  const ok = data.status === '0x1';
  console.log(removed ? 'REVERTED' : ok ? 'success' : 'FAILED', data.transactionHash, 'gas', parseInt(data.gasUsed, 16));
});
python# pip install "websockets>=14"
import asyncio, json, websockets

URL = "wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream"
HEADERS = {"Authorization": "Bearer <API-KEY>"}

async def main():
    # ping_interval=None: the server sends its own keepalive pings (see Connection keepalive)
    async with websockets.connect(URL, additional_headers=HEADERS, ping_interval=None) as ws:
        await ws.send(json.dumps({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getblock_subscribe",
            "params": [{
                "topic": "transactionReceipts",
                "filters": {
                    "from": "0x965e7b3578110a781b86b1cca9b2d7824b62a678",
                    "status": "failure"
                }
            }]
        }))

        async for message in ws:
            msg = json.loads(message)

            # First reply is the subscription ID (or an error)
            if "id" in msg:
                print(msg.get("error") or f"Subscribed: {msg['result']}")
                continue

            event = msg["params"]["result"]
            removed, data = event["removed"], event["data"]
            ok = data['status'] == '0x1'
            print('REVERTED' if removed else 'success' if ok else 'FAILED', data['transactionHash'], 'gas', int(data['gasUsed'], 16))

asyncio.run(main())

Response Example

The first reply is the subscription ID:

json{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x9247e050d6cf2adba09143092ee169a9"
}

Every later message is an event notification (a failed transaction):

json{
  "jsonrpc": "2.0",
  "method": "getblock_subscribe",
  "params": {
    "subscription": "0x9247e050d6cf2adba09143092ee169a9",
    "result": {
      "eventId": "eth:mainnet:receipts:0x19ddc6864bd5ec1cdbd493e3d3653b529d79293a677…",
      "removed": false,
      "revision": 116876401,
      "data": {
        "blockHash": "0x19ddc6864bd5ec1cdbd493e3d3653b529d79293a6773517018153cdff6ac0be2",
        "blockNumber": "0x18d1e1e",
        "contractAddress": null,
        "cumulativeGasUsed": "0x52a2e2",
        "effectiveGasPrice": "0x19a412a0",
        "from": "0x965e7b3578110a781b86b1cca9b2d7824b62a678",
        "gasUsed": "0x7aa8",
        "logs": [],
        "logsBloom": "0x0000000000000000000000000000000000000000000000000000000000000000…",
        "status": "0x0",
        "to": "0xe84ed58fe56169acca155867ab186a30a4a2e731",
        "transactionHash": "0xa5e02c3cdc33428d01de9cf5acc0c43795b5f34ac34d918d07a363e8d45a6bdc",
        "transactionIndex": "0x5a",
        "type": "0x2"
      }
    }
  }
}

Response Parameters

The result object contains the event envelope and the payload in data.

FieldTypeDescription
eventIdstringStable event identifier. A reorg correction reuses it.
removedbooleantrue when a reorg removed this previously delivered event.
revisionnumberEvent version. For one eventId, a greater revision is newer.
dataobjectThe receipt, in the same shape as eth_getTransactionReceipt.
data.transactionHashstringTransaction hash.
data.transactionIndexstringTransaction's position in the block, hex-encoded.
data.blockHashstringBlock hash.
data.blockNumberstringBlock number, hex-encoded.
data.fromstringSender.
data.tostringRecipient. null for contract creation.
data.contractAddressstringAddress of the created contract, or null.
data.statusstring0x1 for success, 0x0 for failure (reverted).
data.typestringEIP-2718 transaction type, hex-encoded.
data.gasUsedstringGas used by this transaction, hex-encoded.
data.cumulativeGasUsedstringGas used in the block up to and including this transaction, hex-encoded.
data.effectiveGasPricestringPrice paid per gas in wei, hex-encoded. Fee = gasUsed × effectiveGasPrice.
data.logsarrayLogs emitted by the transaction, each in the logs shape.
data.logsBloomstringBloom filter for the receipt's logs.

Network-specific receipt fields, such as blobGasUsed on blob transactions or L1 fee fields on rollups, are passed through unchanged.

Use Cases

  • Confirming that a submitted transaction succeeded or failed, without polling
  • Alerting on failed transactions from your hot wallets
  • Detecting new contract deployments (contractCreated: true)
  • Gas-cost accounting per transaction

Error Handling

CodeMessageCause
-32602invalid status "…": must be success or failurestatus has an unsupported value. Note it is failure here, but failed on the trace topics.
-32602… cannot unmarshal hex string without 0x prefix into Go struct field .filters.transactionType …transactionType was sent as a decimal string. Use "0x2", not "2".
-32602invalid from: invalid EVM address "…"from is not a 20-byte hex address.
-32602invalid to: invalid EVM address "…"to is not a 20-byte hex address.
-32602invalid transactionReceipts request: json: unknown field "…"The request has a field this topic does not accept.
-32001subscription limit exceededYou already have 15 active or pending subscriptions.