Bundler API
getUserOperationByHash
Learn how to use the getUserOperationByHash JSON-RPC method.
POST
/
#eth_getUserOperationByHash
getUserOperationByHash
curl --request POST \
--url 'https://bundler.particle.network/#eth_getUserOperationByHash' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_getUserOperationByHash",
"params": [
"0xOperationHash"
]
}
'import requests
url = "https://bundler.particle.network/#eth_getUserOperationByHash"
payload = {
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_getUserOperationByHash",
"params": ["0xOperationHash"]
}
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_getUserOperationByHash',
params: ['0xOperationHash']
})
};
fetch('https://bundler.particle.network/#eth_getUserOperationByHash', 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_getUserOperationByHash",
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_getUserOperationByHash',
'params' => [
'0xOperationHash'
]
]),
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_getUserOperationByHash"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\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_getUserOperationByHash")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bundler.particle.network/#eth_getUserOperationByHash")
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_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"result": {
"userOperation": {},
"entryPoint": "0xEntryPoint",
"transactionHash": "0xTransactionHash",
"blockHash": "0xBlockHash",
"blockNumber": "0xBlockNumber"
}
}Understanding getUserOperationByHash
getUserOperationByHashreturns a UserOperation object corresponding with a specific hash. It takes:hash- string.
Query example
JSON
{
"method": "eth_getUserOperationByHash",
"params": [
// user operation hash
"0x1ee478a6e967c407e8dfb5e3f2eb1131a7418c36396147fce1f7e81a871102a3"
],
"id": 1695717473,
"jsonrpc": "2.0",
"chainId": 80001
}
Body
application/json
Request to retrieve a user operation by its hash.
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_getUserOperationByHash Hash of the user operation.
Response
200 - application/json
Successful response with the user operation details.
Was this page helpful?
⌘I
getUserOperationByHash
curl --request POST \
--url 'https://bundler.particle.network/#eth_getUserOperationByHash' \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_getUserOperationByHash",
"params": [
"0xOperationHash"
]
}
'import requests
url = "https://bundler.particle.network/#eth_getUserOperationByHash"
payload = {
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"method": "eth_getUserOperationByHash",
"params": ["0xOperationHash"]
}
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_getUserOperationByHash',
params: ['0xOperationHash']
})
};
fetch('https://bundler.particle.network/#eth_getUserOperationByHash', 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_getUserOperationByHash",
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_getUserOperationByHash',
'params' => [
'0xOperationHash'
]
]),
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_getUserOperationByHash"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\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_getUserOperationByHash")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"chainId\": 80001,\n \"method\": \"eth_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://bundler.particle.network/#eth_getUserOperationByHash")
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_getUserOperationByHash\",\n \"params\": [\n \"0xOperationHash\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"chainId": 80001,
"result": {
"userOperation": {},
"entryPoint": "0xEntryPoint",
"transactionHash": "0xTransactionHash",
"blockHash": "0xBlockHash",
"blockNumber": "0xBlockNumber"
}
}