Bundler API
sendUserOperation
Learn how to use the sendUserOperation JSON-RPC method.
POST
/
#eth_sendUserOperation
sendUserOperation
curl --request POST \
--url 'https://bundler.particle.network/#eth_sendUserOperation' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"callGasLimit": "0x5208",
"verificationGasLimit": "0x5208",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"preVerificationGas": "0x5208",
"signature": "0xSignature"
}
]
}
'import requests
url = "https://bundler.particle.network/#eth_sendUserOperation"
payload = {
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"callGasLimit": "0x5208",
"verificationGasLimit": "0x5208",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"preVerificationGas": "0x5208",
"signature": "0xSignature"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
chainId: 80001,
method: 'eth_sendUserOperation',
params: [
{
sender: '0xSenderAddress',
nonce: '0x1',
initCode: '0xInitCode',
callData: '0xCallData',
callGasLimit: '0x5208',
verificationGasLimit: '0x5208',
maxFeePerGas: '0x3B9ACA00',
maxPriorityFeePerGas: '0x3B9ACA00',
paymasterAndData: '0xPaymasterData',
preVerificationGas: '0x5208',
signature: '0xSignature'
}
]
})
};
fetch('https://bundler.particle.network/#eth_sendUserOperation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bundler.particle.network/#eth_sendUserOperation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'chainId' => 80001,
'method' => 'eth_sendUserOperation',
'params' => [
[
'sender' => '0xSenderAddress',
'nonce' => '0x1',
'initCode' => '0xInitCode',
'callData' => '0xCallData',
'callGasLimit' => '0x5208',
'verificationGasLimit' => '0x5208',
'maxFeePerGas' => '0x3B9ACA00',
'maxPriorityFeePerGas' => '0x3B9ACA00',
'paymasterAndData' => '0xPaymasterData',
'preVerificationGas' => '0x5208',
'signature' => '0xSignature'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bundler.particle.network/#eth_sendUserOperation"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bundler.particle.network/#eth_sendUserOperation")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bundler.particle.network/#eth_sendUserOperation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"result": "0xTransactionHash"
}Contextualizing sendUserOperation
sendUserOperationpushes a signed UserOperation to the network, in this case through the Particle Bundler. It takes:- UserOperation object.
entrypointAddress- string.
Query example
JSON
{
"method": "eth_sendUserOperation",
"params": [
// user operation
{
"sender": "0x8Fb859E944561678be40Cdd2dB16551396c0b074",
"nonce": "0x0150",
"initCode": "0x",
"callData": "0x9e5d4c49000000000000000000000000329a7f8b91ce7479035cb1b5d62ab41845830ce8000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
"callGasLimit": "0xa13c",
"verificationGasLimit": "0xe2d8",
"maxFeePerGas": "0x7ca702cd",
"maxPriorityFeePerGas": "0x7ca702b0",
"paymasterAndData": "0x000031dd6d9d3a133e663660b959162870d755d4000000000000000000000000329a7f8b91ce7479035cb1b5d62ab41845830ce8000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000416665636080709b968ebec098bf71fb0e79b3b480cc9ff809f192afb478c84ec50ad2de74b93a67860542099b11a1b5dbfa9bc21a2790c58e10015ce992a02f411b00000000000000000000000000000000000000000000000000000000000000",
"preVerificationGas": "0x011120",
"signature": "0x7cc0a2ae350b79c5b189bd36d55ab6a2756097d6d37537e3ec2c26daaa82c6d909fed87ff9d79a6fa127bd798126259ee72fa9395ecbeb1f70ed22ca35983aea1c"
},
// entrypoint contract address
"0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789"
],
"id": 1695717470,
"jsonrpc": "2.0",
"chainId": 80001
}
Body
application/json
Request to send a user operation.
Version of the JSON-RPC protocol, should be 2.0.
Example:
"2.0"
The request identifier.
Example:
1
The chain ID.
Example:
80001
API method being called.
Available options:
eth_sendUserOperation Parameters for sending a user operation.
Show child attributes
Show child attributes
Response
200 - application/json
Successful response with the result of the user operation.
Was this page helpful?
⌘I
sendUserOperation
curl --request POST \
--url 'https://bundler.particle.network/#eth_sendUserOperation' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"callGasLimit": "0x5208",
"verificationGasLimit": "0x5208",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"preVerificationGas": "0x5208",
"signature": "0xSignature"
}
]
}
'import requests
url = "https://bundler.particle.network/#eth_sendUserOperation"
payload = {
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_sendUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"callGasLimit": "0x5208",
"verificationGasLimit": "0x5208",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"preVerificationGas": "0x5208",
"signature": "0xSignature"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 1,
chainId: 80001,
method: 'eth_sendUserOperation',
params: [
{
sender: '0xSenderAddress',
nonce: '0x1',
initCode: '0xInitCode',
callData: '0xCallData',
callGasLimit: '0x5208',
verificationGasLimit: '0x5208',
maxFeePerGas: '0x3B9ACA00',
maxPriorityFeePerGas: '0x3B9ACA00',
paymasterAndData: '0xPaymasterData',
preVerificationGas: '0x5208',
signature: '0xSignature'
}
]
})
};
fetch('https://bundler.particle.network/#eth_sendUserOperation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://bundler.particle.network/#eth_sendUserOperation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 1,
'chainId' => 80001,
'method' => 'eth_sendUserOperation',
'params' => [
[
'sender' => '0xSenderAddress',
'nonce' => '0x1',
'initCode' => '0xInitCode',
'callData' => '0xCallData',
'callGasLimit' => '0x5208',
'verificationGasLimit' => '0x5208',
'maxFeePerGas' => '0x3B9ACA00',
'maxPriorityFeePerGas' => '0x3B9ACA00',
'paymasterAndData' => '0xPaymasterData',
'preVerificationGas' => '0x5208',
'signature' => '0xSignature'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://bundler.particle.network/#eth_sendUserOperation"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://bundler.particle.network/#eth_sendUserOperation")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bundler.particle.network/#eth_sendUserOperation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_sendUserOperation\",\n \"params\": [\n {\n \"sender\": \"0xSenderAddress\",\n \"nonce\": \"0x1\",\n \"initCode\": \"0xInitCode\",\n \"callData\": \"0xCallData\",\n \"callGasLimit\": \"0x5208\",\n \"verificationGasLimit\": \"0x5208\",\n \"maxFeePerGas\": \"0x3B9ACA00\",\n \"maxPriorityFeePerGas\": \"0x3B9ACA00\",\n \"paymasterAndData\": \"0xPaymasterData\",\n \"preVerificationGas\": \"0x5208\",\n \"signature\": \"0xSignature\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"result": "0xTransactionHash"
}