Skip to main content

eth Namespace

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


eth_chainId

Returns EIP-155 Chain ID of the current network.

Example Request:

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

Example Response:

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

eth_supportedEntryPoints

Returns an array of the entryPoint addresses supported by the client.

Example Request:

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

Example Response:

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

eth_estimateUserOperationGas

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": [
{
"sender": "0x1234...5678",
"nonce": "0x01",
"initCode": "0x1234...5678",
"callData": "0x1234...5678",
"callGasLimit": "0x05",
"verificationGasLimit": "0x05",
"preVerificationGas": "0x05",
"maxFeePerGas": "0x05",
"maxPriorityFeePerGas": "0x05",
"signature": "0x1234...5678"
},
"0x_entryPoint"
]
}

Example Response:

{
"jsonrpc": "2.0",
"id": 1,
"result": {
"preVerificationGas": "0x05",
"verificationGasLimit": "0x05",
"callGasLimit": "0x05"
}
}

eth_sendUserOperation

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 with no paymaster:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0x1234...5678",
"nonce": "0x01",
"initCode": "0x1234...5678",
"callData": "0x1234...5678",
"callGasLimit": "0x05",
"verificationGasLimit": "0x05",
"preVerificationGas": "0x05",
"maxFeePerGas": "0x05",
"maxPriorityFeePerGas": "0x05",
"signature": "0x1234...5678"
},
"0x_entryPoint"
]
}

Example Request with paymaster:

{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0x1234...5678",
"nonce": "0x01",
"initCode": "0x1234...5678",
"callData": "0x1234...5678",
"callGasLimit": "0x05",
"verificationGasLimit": "0x05",
"preVerificationGas": "0x05",
"maxFeePerGas": "0x05",
"maxPriorityFeePerGas": "0x05",
"paymaster": "0x1234...5678",
"paymasterVerificationGasLimit": "0x05",
"paymasterPostOpGasLimit": "0x05",
"paymasterData": "0x1234...5678",
"signature": "0x1234...5678"
},
"0x_entryPoint"
]
}

Example Response:

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

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
}
}

eth_getUserOperationByHash

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": "0x1234...5678",
"nonce": "0x01",
"initCode": "0x1234...5678",
"callData": "0x1234...5678",
"callGasLimit": "0x05",
"verificationGasLimit": "0x05",
"preVerificationGas": "0x05",
"maxFeePerGas": "0x05",
"maxPriorityFeePerGas": "0x05",
"signature": "0x1234...5678"
},
},
"entryPoint": "0x_entryPoint",
"blockNumber": "1111",
"blockHash": "0x_blockHash",
"transactionHash": "0x_transactionHash"
}
}

eth_getUserOperationReceipt

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": ["0x_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": "0x_userOpHash",
"entryPoint": "0x_entryPoint",
"sender": "0x_sender",
"nonce": "0x01",
"paymaster": "0x_paymaster",
"actualGasCost": "0x05",
"actualGasUsed": "0x05",
"success": true,
"reason": "If reverted, user operation revert reason",
"logs": [],
"receipt": {}
}
}