Skip to main content

Paymaster RPC Methods

JSON-RPC API reference for Candide's Verifying Paymaster service

info

Visit dashboard to get an API key for Candide's Paymaster.

pm_supportedERC20Tokens

Gets supported ERC-20 Tokens for gas payments, along side the paymaster metadata

Invocation

{ "method": "pm_supportedERC20Tokens", "params": [] }

Return

{ "result": { paymasterMetadata, tokens } }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedERC20Tokens",
"params": []
}

pm_sponsorUserOperation

Sends a UserOperation to a paymaster for off-chain verification. If approved, it will return the paymasterData. It will also return gas overrides when the mode for gas sponsoriship is FREE for the user.

  • Pay Gas in ERC-20s: No gas overrides are returned
  • FREE Gas: it may or may not provide mandatory preVerificationGas, maxFeePerGas, and maxPriorityFeePerGas fields.

If the paymaster rejects the UserOperation, it should not return a result but a standard JSON-RPC error with the reason.

info

Any gas overrides provided in the paymaster result MUST be used in the userop otherwise the paymaster signature won't work.

Invocation

{ "method": "pm_sponsorUserOperation", "params": [userOperation, entrypoint, context] }

Return

{
"result": {
paymasterAndData,
preVerificationGas,
maxFeePerGas,
maxPriorityFeePerGas
}
}
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_sponsorUserOperation",
"params": [
{
sender: "0x2c298CcaFF..c236fCC66dB2"
nonce: "0x17",
initCode: "0x",
callData: "0xf3....0000",
callGasLimit: "0x12a87",
verificationGasLimit: "0x1a332",
preVerificationGas: "0xe95c",
maxFeePerGas: "0x5f4ecdc0",
maxPriorityFeePerGas: "0x59682f00",
paymasterAndData: "0x",
signature: "0x",
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
{ "token": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1" },
]
}

pm_supportedEntryPoint

Get supported EntryPoint returns the entryPoint address supported by the paymaster

Invocation

{ "method": "pm_supportedEntryPoint", "params": [] }

Return

{ "result": entrypoint }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedEntryPoint",
"params": []
}

pm_chainId

Get Chain ID asks the paymaster service to return the chain_id it currently supports

Invocation

{ "method": "pm_chainId", "params": [] }

Return

{ "result": chainId }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_chainId",
"params": []
}