Paymaster API RPC Methods: EntryPoint v0.6
This page documents the Paymaster API for accounts on EntryPoint v0.6. If you are starting a new integration, use the main Paymaster API reference, which covers EntryPoint v0.9 and v0.8. The reference for EntryPoint v0.7 is on its own page.
Endpoints at a Glance
| Method | Params | Returns | Spec |
|---|---|---|---|
| pm_getPaymasterStubData | [userOperation: object, entrypoint: string, chainId: string, context: object] | { paymasterAndData, sponsor?, isFinal } | ERC-7677 |
| pm_getPaymasterData | [userOperation: object, entrypoint: string, chainId: string, context: object] | { paymasterAndData, sponsor? } | ERC-7677 |
| pm_sponsorUserOperation | [userOperation: object, entrypoint: string, context: object] | { paymasterAndData, callGasLimit?, verificationGasLimit?, preVerificationGas?, maxFeePerGas?, maxPriorityFeePerGas?, sponsorMetadata? } | Candide |
| pm_supportedERC20Tokens | [entrypoint: string] | { paymasterMetadata, tokens[] } | Candide |
| pm_supportedEntryPoints | [] | string[] | Candide |
| pm_chainId | [] | string | Candide |
Entrypoint V0.6
pm_getPaymasterStubData
ERC-7677 compatible method. Equivalent to Candide's pm_sponsorUserOperation.
It always returns isFinal: false: call pm_getPaymasterData afterwards to get the final paymaster data.
Sends a UserOperation to a paymaster for off-chain verification. If approved, it will return the paymasterAndData. Unlike pm_sponsorUserOperation, it does not return gas overrides: the gas fields of the UserOperation are used as sent.
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_getPaymasterStubData", "params": [userOperation: object, entrypoint: string, chainId: string, context: object] }
Return
{
"result": {
paymasterAndData: string,
sponsor?: {
name: string,
icon: string,
},
isFinal: boolean
}
}
- Example Request
- Example Response
- Request Types
- Response Type
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_getPaymasterStubData",
"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",
"0x01",
{ "sponsorshipPolicyId" : "1234" } // sponsorshipPolicyId is required for a private gas policy and optional for public gas policies.
]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterAndData": "0x....",
"sponsor": {
"name": "Aave",
"icon": "https://aave.com/aave-2030-header.svg"
},
"isFinal": false
}
}
| Parameter | Type | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| userOperation | Object
| ||||||||||||||||||||||||||||||||||||
| entrypoint |
| ||||||||||||||||||||||||||||||||||||
| chainId |
| ||||||||||||||||||||||||||||||||||||
| context | Object: This argument contains information about the specific paymaster implementation you are using. If use paying gas in ERC-20 Tokens, pass the token address.
|
| key | type | description |
|---|---|---|
paymasterAndData | string | Paymaster address and data required to pass paymaster contract validation |
isFinal | boolean | Always false: call pm_getPaymasterData to get the final paymaster data |
sponsor | object | Information about the Gas Policy Sponsor |
sponsor.name | string | Name of Sponsor who is sponsoring the Gas Policy |
sponsor.icon | string | Logo of the Sponsor to promote their Gas Policy |
pm_getPaymasterData
ERC-7677 compatible method. Equivalent to Candide's pm_sponsorUserOperation.
Sends a UserOperation to a paymaster for off-chain verification. If approved, it will return the paymasterAndData. Unlike pm_sponsorUserOperation, it does not return gas overrides: the gas fields of the UserOperation are used as sent.
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_getPaymasterData", "params": [userOperation: object, entrypoint: string, chainId: string, context: object] }
Return
{
"result": {
paymasterAndData: string,
sponsor?: {
name: string,
icon: string,
}
}
}
- Example Request
- Example Response
- Request Types
- Response Type
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_getPaymasterData",
"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",
"0x01",
{ "sponsorshipPolicyId" : "1234" } // sponsorshipPolicyId is required for a private gas policy and optional for public gas policies.
]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterAndData": "0x....",
"sponsor": {
"name": "Aave",
"icon": "https://aave.com/aave-2030-header.svg"
}
}
}
| Parameter | Type | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| userOperation | Object
| ||||||||||||||||||||||||||||||||||||
| entrypoint |
| ||||||||||||||||||||||||||||||||||||
| chainId |
| ||||||||||||||||||||||||||||||||||||
| context | Object: This argument contains information about the specific paymaster implementation you are using. If use paying gas in ERC-20 Tokens, pass the token address.
|
| key | type | description |
|---|---|---|
paymasterAndData | string | Paymaster address and data required to pass paymaster contract validation |
sponsor | object | Information about the Gas Policy Sponsor |
sponsor.name | string | Name of Sponsor who is sponsoring the Gas Policy |
sponsor.icon | string | Logo of the Sponsor to promote their Gas Policy |
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-20 Gas Payments: No gas overrides are returned.
- Gas Policies: Mandatory
callGasLimit,verificationGasLimit,preVerificationGas,maxFeePerGas, andmaxPriorityFeePerGasfields 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[],
}
}
}
- Example Request
- Example Response
- Request Types
- Response Type
{
"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 is required for a private gas policy and optional for public gas policies.
]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterAndData": "0x....",
"callGasLimit": "0x...",
"verificationGasLimit": "0x...",
"preVerificationGas": "0x..",
"maxFeePerGas": "0x..",
"maxPriorityFeePerGas": "0x..",
"sponsorMetadata": {
"name": "Aave",
"description": "Open Source Liquidity Protocol",
"url": "https://app.aave.com/",
"icons": ["https://aave.com/aave-2030-header.svg"],
}
}
}
| Parameter | Type | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| userOperation | Object
| ||||||||||||||||||||||||||||||||||||
| entrypoint |
| ||||||||||||||||||||||||||||||||||||
| context | Object: This argument contains information about the specific paymaster implementation you are using. If use paying gas in ERC-20 Tokens, pass the token address.
|
| key | type | description |
|---|---|---|
paymasterAndData | string | Paymaster address and data required to pass paymaster contract validation |
callGasLimit | string? | The amount of gas to allocate the main execution call. Optional return. |
verificationGasLimit | string? | The amount of gas to allocate for the verification step. Optional return. |
preVerificationGas | string? | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata. Optional return. |
maxFeePerGas | string? | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas). Optional Return. |
maxPriorityFeePerGas | string? | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas). Optional Return |
sponsorMetadata | object | Information about the Gas Policy Sponsor |
sponsorMetadata.name | string | Name of Sponsor who is sponsoring the Gas Policy |
sponsorMetadata.description | string | A short description of the sponsor |
sponsorMetadata.url | string | Website of the Sponsor |
sponsorMetadata.icons | string[] | Logos or Icons that the Sponsor is using to promote their Gas Policy |
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: string, // hex-encoded, for example "0x12" for 18
exchangeRate: string,
}]
}
}
- Example Request
- Example Response
- Response Types
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedERC20Tokens",
"params": ["0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"]
}
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"paymasterMetadata": {
"name": "CANDIDE Paymaster",
"description": "CANDIDE Paymaster a fast, secure and feature-rich 4337 Paymaster",
"icons": [],
"address": "0x36F4Aa64673568782461bF03C75462f8ef0A1b76",
"sponsoredEventTopic": "0xa0..471",
"dummyPaymasterAndData": "0x69...135",
},
"tokens": [{
"name": "Maker DAI",
"symbol": "DAI",
"address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
"decimals": "0x12",
"exchangeRate": "0x0ddeb609310c89b1"
}]
}
}
| Parameter | Type | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| paymasterMetadata | Object
| |||||||||||||||||||||
| tokens | Object[]
|
pm_supportedEntryPoints
Returns the entryPoint addresses supported by the paymaster.
Invocation
{ "method": "pm_supportedEntryPoints", "params": [] }
Return
{ "result": string[] }
- Example Request
- Example Response
- Response Type
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_supportedEntryPoints",
"params": []
}
{
"jsonrpc": "2.0",
"id": 0,
"result": [
"0x5ff137d4b0fdcd49dca30c7cf57e578a026d2789",
"0x0000000071727de22e5e9d8baf0edac6f37da032",
"0x4337084d9e255ff0702461cf8895ce9e3b5ff108",
"0x433709009b8330fda32311df1c2afa402ed8d009"
] // Entrypoint addresses
}
| key | type | description |
|---|---|---|
entrypoints | string[] | The EntryPoint Addresses that the paymaster is supporting |
pm_chainId
Get Chain ID asks the paymaster service to return the chain_id it currently supports
Invocation
{ "method": "pm_chainId", "params": [] }
Return
{ "result": string }
- Example Request
- Example Response
- Response Type
{
"jsonrpc": "2.0",
"id": 0,
"method": "pm_chainId",
"params": []
}
{
"jsonrpc": "2.0",
"id": 0,
"result": "0x1"
}
| Parameter | Type | Description |
|---|---|---|
| chainId | string | Chain ID that the paymaster supports, hex-encoded |