Skip to main content

Paymaster API V3 RPC Methods

JSON-RPC API reference for Candide's Paymaster V3 service.

info

Visit the dashboard to get an API key for Candide's Paymaster. Looking for V2?

Entrypoint V0.7

pm_supportedERC20Tokens

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

Invocation

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

Return

{ 
"result": {
paymasterMetadata: {
name: string,
description: string,
icons: string[],
address: string,
sponsoredEventTopic: string,
dummyPaymasterAndData: {
paymaster: string,
paymasterData: string,
paymasterVerificationGasLimit: string,
paymasterPostOpGasLimit: string
},
},
tokens: [{
name: string,
symbol: string,
address: string,
decimals: number,
exchangeRate: string,
}]
}
}
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedERC20Tokens",
"params": ["0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"]
}

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 sponsorship uses a Gas Policy.

  • ERC-20s Gas Payments: No gas overrides are returned
  • Gas Policies: Mandatory callGasLimit, verificationGasLimit, preVerificationGas, maxFeePerGas, and maxPriorityFeePerGas fields are returned.

Supports two types of Gas Policies:

  • Public Gas Policies: These are gas policies provided by third parties, which do not require a sponsorship policy ID.
  • Private Gas Policies: These require a sponsorship policy ID and can be used if no public gas policy matches the user operation.

If the paymaster rejects the UserOperation, it returns a standard JSON-RPC error with the reason.

Invocation

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

Return

{
"result": {
paymaster: string,
paymasterData: string,
paymasterVerificationGasLimit: string,
paymasterPostOpGasLimit: string,
callGasLimit?: string,
verificationGasLimit?: string,
preVerificationGas?: string,
maxFeePerGas?: string,
maxPriorityFeePerGas?: string,
sponsorMetadata?: {
name: string,
description: string,
url: string,
icons: string[],
}
}
}
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_sponsorUserOperation",
"params": [
{
"sender": "0x2c298CcaFF..c236fCC66dB2",
"nonce": "0x17",
"factory": "0x..",
"factoryData": "0xf3....0000",
"callData": "0xf3....0000",
"callGasLimit": "0x12a87",
"verificationGasLimit": "0x1a332",
"preVerificationGas": "0xe95c",
"maxFeePerGas": "0x5f4ecdc0",
"maxPriorityFeePerGas": "0x59682f00",
"paymaster": "0x..",
"paymasterVerificationGasLimit": "0x..",
"paymasterPostOpGasLimit": "0x..",
"paymasterAndData": "0x",
"signature": "0x",
},
"0x0000000071727De22E5E9d8BAf0edAc6f37da032",
{ "sponsorshipPolicyId" : "1234" } // sponsorshipPolicyId key value field is optional if using a private gas policy.
]
}

pm_supportedEntryPoints

Returns the entryPoint addresses supported by the paymaster.

Invocation

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

Return

{ "result": string[] }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedEntryPoints",
"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": number }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_chainId",
"params": []
}

Entrypoint V0.6

pm_supportedERC20Tokens

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

Invocation

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

Return

{ 
"result": {
paymasterMetadata: {
name: string,
description: string,
icons: string[],
address: string,
sponsoredEventTopic: string,
dummyPaymasterAndData: string,
},
tokens: [{
name: string,
symbol: string,
address: string,
decimals: number,
exchangeRate: string,
}]
}
}
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedERC20Tokens",
"params": ["0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"]
}

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 sponsorship uses a Gas Policy.

  • ERC-20s Gas Payments: No gas overrides are returned
  • Gas Policies: Mandatory callGasLimit, verificationGasLimit, preVerificationGas, maxFeePerGas, and maxPriorityFeePerGas fields are returned.

Supports two types of Gas Policies:

  • Public Gas Policies: These are gas policies provided by third parties, which do not require a sponsorship policy ID.
  • Private Gas Policies: These require a sponsorship policy ID and can be used if no public gas policy matches the user operation.

If the paymaster rejects the UserOperation, it returns a standard JSON-RPC error with the reason.

Invocation

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

Return

{
"result": {
paymasterAndData: string,
callGasLimit?: string,
verificationGasLimit?: string,
preVerificationGas?: string,
maxFeePerGas?: string,
maxPriorityFeePerGas?: string,
sponsorMetadata?: {
name: string,
description: string,
url: string,
icons: string[],
}
}
}
{
"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",
{ "sponsorshipPolicyId" : "1234" } // sponsorshipPolicyId key value field is optional if using a private gas policy.
]
}

pm_supportedEntryPoints

Returns the entryPoint addresses supported by the paymaster.

Invocation

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

Return

{ "result": string[] }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedEntryPoints",
"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": number }
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_chainId",
"params": []
}