accountAbstractionOperations - EVM Data Stream

The accountAbstractionOperations topic decodes the events of the canonical ERC-4337 EntryPoint contracts. It tells you when a smart account's UserOperation executed and whether it succeeded, when a new smart account was deployed, and why an operation reverted.

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

Parameters

ParameterTypeRequiredDescription
filters.entryPointstringNoEntryPoint contract address. Omit to receive every canonical EntryPoint version.
filters.senderstringNoSmart account (UserOperation sender).
filters.paymasterstringNoPaymaster that sponsored the operation.
filters.userOpHashstringNoOne UserOperation hash.
filters.eventTypestringNoOne of userOperation, accountDeployed, revertReason, or beforeExecution.
filters.successbooleanNoFilter userOperation events by execution result.

eventType values map to the EntryPoint events:

eventTypeEntryPoint eventWhen it fires
userOperationUserOperationEventOnce per UserOperation, after execution, with its result and gas cost.
accountDeployedAccountDeployedWhen a UserOperation deploys its smart account.
revertReasonUserOperationRevertReasonWhen a UserOperation's call reverted, with the revert data.
beforeExecutionBeforeExecutionOnce per bundle, before the operations in it execute.

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":"accountAbstractionOperations","filters":{"eventType":"userOperation","sender":"0xe21db522d0e27db4044486f656b6d26934c77645"}}]}
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: 'accountAbstractionOperations',
      filters: {
        eventType: 'userOperation',
        sender: '0xe21db522d0e27db4044486f656b6d26934c77645'
      }
    }]
  }));
});

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;
  if (data.eventType === 'userOperation') {
    console.log(removed ? 'REVERTED' : data.success ? 'userOp ok' : 'userOp FAILED', data.userOpHash, 'cost', BigInt(data.actualGasCost));
  }
});
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": "accountAbstractionOperations",
                "filters": {
                    "eventType": "userOperation",
                    "sender": "0xe21db522d0e27db4044486f656b6d26934c77645"
                }
            }]
        }))

        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"]
            if data['eventType'] == 'userOperation':
                print('REVERTED' if removed else 'userOp ok' if data['success'] else 'userOp FAILED', data['userOpHash'], 'cost', int(data['actualGasCost'], 16))

asyncio.run(main())

Response Example

The first reply is the subscription ID:

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

Every later message is an event notification (a userOperation event):

json{
  "jsonrpc": "2.0",
  "method": "getblock_subscribe",
  "params": {
    "subscription": "0xd83568be1b45519333164dbc949327bb",
    "result": {
      "eventId": "eth:mainnet:receipts:0x830b6a483c183023519b834acfac62e7392ab7918c8…",
      "removed": false,
      "revision": 116877272,
      "data": {
        "eventType": "userOperation",
        "entryPoint": "0x4337084d9e255ff0702461cf8895ce9e3b5ff108",
        "userOpHash": "0x8657eaa065d117c15340470360d2b6e62160d1c5dca8f11ba978dc66f6f7a6ab",
        "sender": "0xe21db522d0e27db4044486f656b6d26934c77645",
        "paymaster": "0x888888888888ec68a58ab8094cc1ad20ba3d2402",
        "nonce": "0x1a0c3a931210000000000000000",
        "success": true,
        "actualGasCost": "0x1080d4b3292d0",
        "actualGasUsed": "0x5ebc6",
        "address": "0x4337084d9e255ff0702461cf8895ce9e3b5ff108",
        "blockNumber": "0x18d1e1f",
        "transactionHash": "0x54ebb6d71346068b99441bb55ddf2e8884175cf364eecbccc0a57ed297d6d770",
        "transactionIndex": "0x1ad",
        "blockHash": "0x830b6a483c183023519b834acfac62e7392ab7918c8f31b8d4188293e364d38f",
        "blockTimestamp": "0x6ab110cf",
        "logIndex": "0x252",
        "removed": false
      }
    }
  }
}

A beforeExecution event carries only the EntryPoint and log context:

json{
  "data": {
    "eventType": "beforeExecution",
    "entryPoint": "0x4337084d9e255ff0702461cf8895ce9e3b5ff108",
    "address": "0x4337084d9e255ff0702461cf8895ce9e3b5ff108",
    "blockNumber": "0x18d1e1f",
    "transactionHash": "0x54ebb6d71346068b99441bb55ddf2e8884175cf364eecbccc0a57ed297d6d770",
    "transactionIndex": "0x1ad",
    "blockHash": "0x830b6a483c183023519b834acfac62e7392ab7918c8f31b8d4188293e364d38f",
    "blockTimestamp": "0x6ab110cf",
    "logIndex": "0x248",
    "removed": false
  }
}

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.
data.eventTypestringuserOperation, accountDeployed, revertReason, or beforeExecution. The other fields present depend on it.
data.entryPointstringEntryPoint contract that emitted the event.
data.userOpHashstringUserOperation hash. Not present on beforeExecution.
data.senderstringSmart account address.
data.paymasterstringPaymaster address, or the zero address when the account paid for itself.
data.noncestringUserOperation nonce, hex-encoded (userOperation).
data.successbooleanWhether the UserOperation's call succeeded (userOperation).
data.actualGasCoststringTotal cost charged for the operation in wei, hex-encoded (userOperation).
data.actualGasUsedstringGas used by the operation, hex-encoded (userOperation).
data.addressstringAddress of the contract that emitted the log.
data.blockNumberstringBlock number, hex-encoded.
data.blockHashstringHash of the block that contains the log.
data.blockTimestampstringBlock timestamp in Unix seconds, hex-encoded.
data.transactionHashstringHash of the transaction that emitted the log.
data.transactionIndexstringTransaction's position in the block, hex-encoded.
data.logIndexstringLog's position in the block, hex-encoded.
data.removedbooleanThe underlying log's removed flag. Use the envelope's removed for reorg handling.

accountDeployed and revertReason events carry the fields of their EntryPoint event (for example the account factory, or the revertReason bytes) alongside userOpHash and sender. Read fields by name and ignore any you don't use.

Use Cases

  • Confirming a UserOperation from your bundler or wallet executed, and whether it succeeded
  • Sponsorship accounting for paymasters (filter by paymaster)
  • Tracking smart-account onboarding (accountDeployed)
  • Surfacing revert reasons to users of a smart wallet

Error Handling

CodeMessageCause
-32602invalid eventType "…": must be userOperation, accountDeployed, revertReason, or beforeExecutioneventType has an unsupported value.
-32602invalid entryPoint: invalid EVM address "…"entryPoint is not a 20-byte hex address.
-32602invalid sender: invalid EVM address "…"sender is not a 20-byte hex address.
-32602invalid paymaster: invalid EVM address "…"paymaster is not a 20-byte hex address.
-32602invalid accountAbstractionOperations request: json: unknown field "…"The request has a field this topic does not accept.
-32001subscription limit exceededYou already have 15 active or pending subscriptions.