Particle's fully compatible ERC-4337 bundler RPC
Supported on BSC, opBNB, COMBO, and Polygon.
API Endpoint
The format of a Particle Bundler RPC endpoint is
https://open-platform.nodereal.io/{{apiKey}}/particle-bundler/{{chainId}}
Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/particle-bundler/{{chainId}}
Supported Chains
- BNB Chain Mainnet (56) & Testnet (97)
- opBNB Mainnet (204) & Testnet (5611)
- COMBO Testnet (91715)
- Polygon Mainnet (137) & Mumbai Testnet (80001)
- Ethereum Mainnet, Goerli & Sepolia
- Optimism Mainnet & Optimism Goerli Testnet
- Arbitrum One & Nova & Goerli Testnet
- Scroll Mainnet & Sepolia Testnet
- Linea Mainnet & Testnet
- Base Mainnet & Testnet
- Mantle Mainnet & Testnet
- Taiko Jolnir Testnet
- Avalanche Mainnet & Fuji Testnet
Attention
The Bundler API fully follows the ERC-4337 standard, But since we support multi-chain, you need to specify the chainId in the endpoint.
---Request
// specify the chainId in endpoint
curl https://open-platform.nodereal.io/{{apiKey}}/particle-bundler/{{chainId}} \
-X POST \
-H "Content-Type: application/json" \
--data '{
"jsonrpc": "2.0",
"id": "1",
"method": "eth_chainId",
"params": []
}'
---Response
{
"jsonrpc": "2.0",
"id": "1",
"result": "0xcc"
}
API List
eth_sendUserOperation
eth_sendUserOperation submits a User Operation object to the User Operation pool of the client. The client MUST validate the UserOperation, and return a result accordingly.
The result SHOULD
be set to the userOpHash if and only if the request passes simulation and is accepted in the client’s User Operation pool. If the validation, simulation or User Operation pool inclusion fails, result
SHOULD NOT
be returned. Rather, the client SHOULD
return the failure reason.
Parameters
- UserOperation - a full user-operation struct. All fields MUST be set as hex values. empty
bytes
block (e.g. emptyinitCode
) MUST be set to"0x"
- EntryPoint - the entrypoint address the request should be sent through. this MUST be one of the entry points returned by the
supportedEntryPoints
rpc call.
Returns
- If the UserOperation is valid, the client MUST return the calculated userOpHash for it
- in case of failure, MUST return an
error
result object, withcode
andmessage
. The error code and message SHOULD be set as follows:- code: -32602 - invalid UserOperation struct/fields
- code: -32500 - transaction rejected by entryPoint’s simulateValidation, during wallet creation or validation
- The
message
field MUST be set to the FailedOp’s “AAxx
” error message from the EntryPoint
- The
- code: -32501 - transaction rejected by paymaster’s validatePaymasterUserOp
- The
message
field SHOULD be set to the revert message from the paymaster - The
data
field MUST contain apaymaster
value
- The
- code: -32502 - transaction rejected because of opcode validation
- code: -32503 - UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon)
- The
data
field SHOULD contain thevalidUntil
andvalidAfter
values - The
data
field SHOULD contain apaymaster
value, if this error was triggered by the paymaster
- The
- code: -32504 - transaction rejected because paymaster (or signature aggregator) is throttled/banned
- The
data
field SHOULD contain apaymaster
oraggregator
value, depending on the failed entity
- The
- code: -32505 - transaction rejected because paymaster (or signature aggregator) stake or unstake-delay is too low
- The
data
field SHOULD contain apaymaster
oraggregator
value, depending on the failed entity - The
data
field SHOULD contain aminimumStake
andminimumUnstakeDelay
- The
- code: -32506 - transaction rejected because wallet specified unsupported signature aggregator
- The
data
field SHOULD contain anaggregator
value
- The
- code: -32507 - transaction rejected because of wallet signature check failed (or paymaster signature, if the paymaster uses its data as signature)
Example
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_sendUserOperation",
"params": [
{
sender, // address
nonce, // uint256
initCode, // bytes
callData, // bytes
callGasLimit, // uint256
verificationGasLimit, // uint256
preVerificationGas, // uint256
maxFeePerGas, // uint256
maxPriorityFeePerGas, // uint256
paymasterAndData, // bytes
signature // bytes
},
entryPoint // address
]
}
##success:
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1234...5678"
}
##fail:
{
"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_getUserOperationReceipt
Return a UserOperation receipt based on a hash (userOpHash) returned by eth_sendUserOperation
Parameters
- hash a userOpHash value returned by
eth_sendUserOperation
Returns
null
in case the UserOperation is not yet included in a block, or:
- userOpHash the request hash
- entryPoint
- sender
- nonce
- paymaster the paymaster used for this userOp (or empty)
- actualGasCost - actual amount paid (by account or paymaster) for this UserOperation
- actualGasUsed - total gas used by this UserOperation (including preVerification, creation, validation and execution)
- success boolean - did this execution completed without revert
- reason in case of revert, this is the revert reason
- logs the logs generated by this UserOperation (not including logs of other UserOperations in the same bundle)
- receipt the TransactionReceipt object. Note that the returned TransactionReceipt is for the entire bundle, not only for this UserOperation.
eth_getUserOperationByHash
Return a UserOperation based on a hash (userOpHash) returned by eth_sendUserOperation
Parameters
- hash a userOpHash value returned by
eth_sendUserOperation
Returns
null
in case the UserOperation is not yet included in a block, or a full UserOperation, with the addition of entryPoint
, blockNumber
, blockHash
and transactionHash
eth_supportedEntryPoints
Returns an array of the entryPoint addresses supported by the client. The first element of the array SHOULD be the entryPoint addressed preferred by the client.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_supportedEntryPoints",
"params": []
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8",
"0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6"
]
}
eth_estimateUserOperationGas
Estimate the gas values for a UserOperation. Given UserOperation optionally without gas limits and gas prices, return the needed gas limits. The signature field is ignored by the wallet, so that the operation will not require user’s approval. Still, it might require putting a “semi-valid” signature (e.g. a signature in the right length)
Parameters
- same as
eth_sendUserOperation
gas limits (and prices) parameters are optional, but are used if specified.maxFeePerGas
andmaxPriorityFeePerGas
default to zero, so no payment is required by neither account nor paymaster.
Returns
- preVerificationGas gas overhead of this UserOperation
- verificationGasLimit actual gas used by the validation of this UserOperation
- callGasLimit value used by inner account execution
Error Codes:
Same as eth_sendUserOperation
This operation may also return an error if the inner call to the account contract reverts.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_supportedEntryPoints",
"params": []
}
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0xcd01C8aa8995A59eB7B2627E69b40e0524B5ecf8",
"0x7A0A0d159218E6a2f407B99173A2b12A6DDfC2a6"
]
}
eth_chainId
Returns EIP-155 Chain ID.
{
"jsonrpc": "2.0",
"id": 1,
"method": "eth_chainId",
"params": []
}
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x1"
}