Skip to main content

RPC methods

eth namespace

All RPC methods listed here require our Bundler to be 100% compliant as an EIP-4337 Bundler.


Send User Operation

Clients can use this method to submit a UserOperation object to the pool of Bundler clients. The response payload will contain the calculated userOpHash if and only if the request passes all necessary checks; otherwise, the response payload will return an error code with a failure message.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendUserOperation",
"params": [
// UserOperation object
{
sender,
nonce,
initCode,
callData,
callGasLimit,
verificationGasLimit,
preVerificationGas,
maxFeePerGas,
maxPriorityFeePerGas,
paymasterAndData,
signature
},
// MUST be one of the entry points supportedEntryPoints the RPC call
entryPoint
]
}

Example Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234...5678"
}

Estimate User Operation Gas

Clients can calculate the gas requirements for a UserOperation by using this method. The method takes a UserOperation as input, including optional gas limits and prices, and returns the required gas limits for the operation.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_estimateUserOperationGas",
"params": [
// UserOperation object
{
sender,
nonce,
initCode,
callData,
callGasLimit,
verificationGasLimit,
preVerificationGas,
maxFeePerGas,
maxPriorityFeePerGas,
paymasterAndData,
signature
},
// MUST be one of the entry points supportedEntryPoints the RPC call
entryPoint
]
}

Example Response:

{
"jsonrpc": "2.0",
"id": 1,
// The return values are in units of wei.
"result": {
preVerificationGas: "0x05",
verificationGasLimit: "0x05",
callGasLimit: "0x05"
}
}

Get User Operation By Hash

This method allows users to retrieve a UserOperation based on a hash (userOpHash) generated by the eth_sendUserOperation method.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getUserOperationByHash",
"params": ["userOpHash"]
}

Example Response:

If a UserOperation still awaits inclusion in a block, this method will return null. However, if the UserOperation confirms inclusion in a block, the method will return the complete UserOperation along with entryPoint, blockNumber, blockHash, and transactionHash.

{
"jsonrpc": "2.0",
"id": 1,
"result": null
}

or

{
"jsonrpc": "2.0",
"id": 1,
"result": {
userOperation: {
{
sender,
nonce,
initCode,
callData,
callGasLimit,
verificationGasLimit,
preVerificationGas,
maxFeePerGas,
maxPriorityFeePerGas,
paymasterAndData,
signature
},
},
entryPoint,
blockNumber,
blockHash,
transactionHash
}
}

Get User Operation Receipt

This method allows users to retrieve a UserOperation receipt by providing a hash (userOpHash) generated by the eth_sendUserOperation method.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_getUserOperationReceipt",
"params": ["userOpHash"]
}

Example Response:

Returns null in case the UserOperation is still pending inclusion in a block.

{
"jsonrpc": "2.0",
"id": 1,
"result": null
}

or

{
"jsonrpc": "2.0",
"id": 1,
"result": {
userOpHash,
entryPoint,
sender,
nonce,
paymaster,
actualGasCost,
actualGasUsed,
success,
reason,
logs,
receipt,
}
}

Supported Entry Points

This method returns an array of entryPoint addresses supported by the client, with the client's preferred entryPoint address listed as the first element in the array.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_supportedEntryPoints",
"params": []
}

Example Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8",
"0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6"
]
}

ChainId

Returns EIP-155 Chain ID.

Example Request:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId",
"params": []
}

Example Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}

debug namespace

All RPC methods listed here require our Bundler to be 100% compliant as an EIP-4337 Bundler.


Error Response Codes

Below are error codes for eth_sendUserOperation , eth_estimateUserOperationGas operations.

CodeMessageData
32602Invalid UserOperation struct/fieldsNone
32500Transaction rejected by entryPoint’s simulateValidation, during wallet creation or validationNone
32501Transaction rejected by paymaster’s validatePaymasterUserOpContain a paymaster value
32502Transaction rejected because of opcode validationNone
32503UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon)Contain the validUntil and validAfter values or a paymaster value for errors triggered by the paymaster
32504Transaction rejected because paymaster (or signature aggregator) is throttled/bannedContain a paymaster or aggregator value, depending on the failed entity
32505transaction rejected because paymaster (or signature aggregator) stake or unstake-delay is too lowcontain a paymaster or aggregator value, depending on the failed entity or field SHOULD contain a minimumStake and minimumUnstakeDelay
32506Transaction rejected because wallet specified unsupported signature aggregatorContain an aggregator value
32507Transaction rejected because of wallet signature check failed (or paymaster signature if the paymaster uses its data as signature)None

Example failure responses:

{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "AA21 didn't pay prefund",
"code": -32500
}
}
{
"jsonrpc": "2.0",
"id": 1,
"error": {
"message": "paymaster stake too low",
"data": {
"paymaster": "0x123456789012345678901234567890123456790",
"minimumStake": "0xde0b6b3a7640000",
"minimumUnstakeDelay": "0x15180"
},
"code": -32504
}
}