accountAbstractionOperations - EVM Data Stream
Stream decoded ERC-4337 EntryPoint events: UserOperation results, account deployments, and revert reasons. Complete guide on how to use the accountAbstractionOperations topic in GetBlock EVM Data Stre
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.
Parameters
filters.entryPoint
string
No
EntryPoint contract address. Omit to receive every canonical EntryPoint version.
filters.sender
string
No
Smart account (UserOperation sender).
filters.paymaster
string
No
Paymaster that sponsored the operation.
filters.userOpHash
string
No
One UserOperation hash.
filters.eventType
string
No
One of userOperation, accountDeployed, revertReason, or beforeExecution.
filters.success
boolean
No
Filter userOperation events by execution result.
eventType values map to the EntryPoint events:
eventType
EntryPoint event
When it fires
userOperation
UserOperationEvent
Once per UserOperation, after execution, with its result and gas cost.
accountDeployed
AccountDeployed
When a UserOperation deploys its smart account.
revertReason
UserOperationRevertReason
When a UserOperation's call reverted, with the revert data.
beforeExecution
BeforeExecution
Once per bundle, before the operations in it execute.
Request Example
# 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"}}]}// 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));
}
});Response Example
The first reply is the subscription ID:
Every later message is an event notification (a userOperation event):
A beforeExecution event carries only the EntryPoint and log context:
Response Parameters
The result object contains the event envelope and the payload in data.
eventId
string
Stable event identifier. A reorg correction reuses it.
removed
boolean
true when a reorg removed this previously delivered event.
revision
number
Event version. For one eventId, a greater revision is newer.
data.eventType
string
userOperation, accountDeployed, revertReason, or beforeExecution. The other fields present depend on it.
data.entryPoint
string
EntryPoint contract that emitted the event.
data.userOpHash
string
UserOperation hash. Not present on beforeExecution.
data.sender
string
Smart account address.
data.paymaster
string
Paymaster address, or the zero address when the account paid for itself.
data.nonce
string
UserOperation nonce, hex-encoded (userOperation).
data.success
boolean
Whether the UserOperation's call succeeded (userOperation).
data.actualGasCost
string
Total cost charged for the operation in wei, hex-encoded (userOperation).
data.actualGasUsed
string
Gas used by the operation, hex-encoded (userOperation).
data.address
string
Address of the contract that emitted the log.
data.blockNumber
string
Block number, hex-encoded.
data.blockHash
string
Hash of the block that contains the log.
data.blockTimestamp
string
Block timestamp in Unix seconds, hex-encoded.
data.transactionHash
string
Hash of the transaction that emitted the log.
data.transactionIndex
string
Transaction's position in the block, hex-encoded.
data.logIndex
string
Log's position in the block, hex-encoded.
data.removed
boolean
The underlying log's removed flag. Use the envelope's removed for reorg handling.
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
-32602
invalid eventType "…": must be userOperation, accountDeployed, revertReason, or beforeExecution
eventType has an unsupported value.
-32602
invalid entryPoint: invalid EVM address "…"
entryPoint is not a 20-byte hex address.
-32602
invalid sender: invalid EVM address "…"
sender is not a 20-byte hex address.
-32602
invalid paymaster: invalid EVM address "…"
paymaster is not a 20-byte hex address.
-32602
invalid accountAbstractionOperations request: json: unknown field "…"
The request has a field this topic does not accept.
-32001
subscription limit exceeded
You already have 15 active or pending subscriptions.
Last updated
Was this helpful?