Paymaster RPC
sponsorUserOperation
APIs & SDKs
PARTICLE CONNECT
- Introduction to Particle Connect
- SDKs (Desktop)
- SDKs (Mobile)
- FAQ
PARTICLE AUTH
- Introduction to Particle Auth
- Server API
- SDKs (Desktop)
- SDKs (Mobile)
- SDKs (Multi-platform)
- FAQ
PARTICLE WALLET
- Introduction to Particle Wallet
- Introduction to On-Ramp
- SDKs (Desktop)
- SDKs (Mobile)
- FAQ
ACCOUNT ABSTRACTION
- Introduction to Smart Wallet-as-a-Service
- SDKs (Desktop)
- SDKs (Mobile)
- Account Abstraction RPC
- Bundler RPC
- Paymaster RPC
- FAQ
BTC CONNECT
- Introduction to BTC Connect
- SDKs (Desktop)
- BTC Connect RPC
- FAQ
EHNANCED
- Overview
- EVM Enhanced RPC
- Solana Enhanced RPC
- Swap RPC
DEBUGGING
Paymaster RPC
sponsorUserOperation
Learn how to use the sponsorUserOperation JSON-RPC method.
POST
/
#pm_sponsorUserOperation
curl --request POST \
--url 'https://paymaster.particle.network/#pm_sponsorUserOperation' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_sponsorUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"signature": "0xSignature",
"preVerificationGas": "0x5208",
"verificationGasLimit": "0x5208",
"callGasLimit": "0x5208"
}
]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterAndData": "0xPaymasterData"
}
}
Contextualizing sponsorUserOperation
sponsorUserOperation
returns a Paymaster signature to sponsor a given UserOperation, pulling from the USDT balance of the Paymaster. It takes:- UserOperation object.
entrypointAddress
- string.
Query example
JavaScript
import Axios from "axios";
const chainId = 11155111;
const projectUuid = "Your project uuid";
const projectKey = "Your project client key or server key";
const entryPoint = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
const userOp = {
sender: "0xfE71795B01d2c36FD5a001fe9D47EAec0da77e59",
nonce: "0x00",
initCode:
"0x9406cc6185a346906296840746125a0e449764545fbfb9cf0000000000000000000000009a8c05c7ac9acecc1185d5a624eb185e63dde9c20000000000000000000000000000000000000000000000000000000000000000",
callData:
"0xb61d27f6000000000000000000000000aae0de40f94469761b797920a46f223d0fffd013000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
maxFeePerGas: "0x5e18a0d2",
maxPriorityFeePerGas: "0x5de29812",
paymasterAndData: "0x",
signature: "0x",
preVerificationGas: "0xc954",
verificationGasLimit: "0x066c12",
callGasLimit: "0xf2a0",
};
const paymasterUrl = "https://paymaster.particle.network";
(async () => {
const response = await Axios.post(
paymasterUrl,
{
method: "pm_sponsorUserOperation",
params: [userOp, entryPoint],
},
{
params: {
chainId,
projectUuid,
projectKey,
},
}
);
console.log(response.data);
})();
Body
application/json
Request to sponsor a user operation.
The body is of type object
.
Response
200 - application/json
Successful response with sponsorship details.
The response is of type object
.
Was this page helpful?
curl --request POST \
--url 'https://paymaster.particle.network/#pm_sponsorUserOperation' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_sponsorUserOperation",
"params": [
{
"sender": "0xSenderAddress",
"nonce": "0x1",
"initCode": "0xInitCode",
"callData": "0xCallData",
"maxFeePerGas": "0x3B9ACA00",
"maxPriorityFeePerGas": "0x3B9ACA00",
"paymasterAndData": "0xPaymasterData",
"signature": "0xSignature",
"preVerificationGas": "0x5208",
"verificationGasLimit": "0x5208",
"callGasLimit": "0x5208"
}
]
}'
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterAndData": "0xPaymasterData"
}
}