Paymaster Endpoints
All paymaster endpoints follow the JSON-RPC 2.0 specification and are available at:
https://api.openfort.io/rpc/{chainId}Include your Openfort publishable key in the Authorization header:
Authorization: Bearer YOUR_OPENFORT_PUBLISHABLE_KEYpm_sponsorUserOperation
The main endpoint for gas sponsorship. It simulates the UserOperation, estimates gas limits, and returns the paymaster signature for sponsored execution.
You can optionally pass a sponsorshipPolicyId to use a specific sponsorship policy.
Request (EntryPoint v0.8 & v0.9)
{
"jsonrpc": "2.0",
"method": "pm_sponsorUserOperation",
"params": [
{
"sender": "0x5a6b47F4131bf1feAFA56A05573314BcF44C9149",
"nonce": "0x845adb2c711129d4f3966735ed98a9f09fc4ce5700000000000000000000",
"factory": "0xd703aaE79538628d27099B8c4f621bE4CCd142d5",
"factoryData": "0xc5265d5d...",
"callData": "0xe9ae5c53...",
"callGasLimit": "0x0",
"verificationGasLimit": "0x0",
"preVerificationGas": "0x0",
"maxFeePerGas": "0x7a5cf70d5",
"maxPriorityFeePerGas": "0x3b9aca00",
"paymaster": null,
"paymasterVerificationGasLimit": null,
"paymasterPostOpGasLimit": null,
"paymasterData": null,
"signature": "0xffff..."
},
"0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",
{ "sponsorshipPolicyId": "sp_your_policy_id" }
],
"id": 1
}Response (EntryPoint v0.8 & v0.9)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"preVerificationGas": "0xd3e3",
"verificationGasLimit": "0x60b01",
"callGasLimit": "0x13880",
"paymaster": "0xDFF7FA1077Bce740a6a212b3995990682c0Ba66d",
"paymasterVerificationGasLimit": "0x0",
"paymasterPostOpGasLimit": "0x0",
"paymasterData": "0xbcd12340a2109876543210987654301098765432..."
}
}Request (EntryPoint v0.6)
{
"jsonrpc": "2.0",
"method": "pm_sponsorUserOperation",
"params": [
{
"sender": "0xb341FEAFaF71b09089d03B7D114599f8F491EE45",
"nonce": "0x0",
"initCode": "0x5de4839a76cf55d0c90e2061ef4386d962E15ae3...",
"callData": "0x51945447...",
"callGasLimit": "0x0",
"verificationGasLimit": "0x0",
"preVerificationGas": "0x0",
"maxPriorityFeePerGas": "0x3b9aca00",
"maxFeePerGas": "0x7a5cf70d5",
"paymasterAndData": "0x",
"signature": "0x00000000ffff..."
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
{ "sponsorshipPolicyId": "sp_your_policy_id" }
],
"id": 1
}Response (EntryPoint v0.6)
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"paymasterAndData": "0xbcd12340a2109876543210987654301098765432...",
"preVerificationGas": "0xdf55",
"verificationGas": "0x52503",
"verificationGasLimit": "0x52503",
"callGasLimit": "0x13880"
}
}Parameters
| Parameter | Required | Description |
|---|---|---|
userOperation | Yes | The UserOperation to sponsor |
entryPoint | Yes | The EntryPoint contract address |
context | No | Object containing optional sponsorshipPolicyId |
pm_validateSponsorshipPolicies
Validates a UserOperation against an array of sponsorship policies and returns which policies are willing to sponsor the operation.
Request
{
"jsonrpc": "2.0",
"method": "pm_validateSponsorshipPolicies",
"params": [
{
"sender": "0x1234567890123456789012345678901234567890",
"nonce": "0x1",
"initCode": "0x",
"callData": "0x...",
"callGasLimit": "0x100000",
"verificationGasLimit": "0x20000",
"preVerificationGas": "0x10000",
"maxFeePerGas": "0x3b9aca00",
"maxPriorityFeePerGas": "0x3b9aca00",
"paymasterAndData": "0x",
"signature": "0x"
},
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
["policy_id_1", "policy_id_2"]
],
"id": 1
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
{
"sponsorshipPolicyId": "policy_id_1",
"data": {
"name": "Free Gas Week",
"author": "Your App",
"icon": "data:image/png;base64,...",
"description": "Sponsoring transactions for new users during launch week."
}
}
]
}Parameters
| Parameter | Required | Description |
|---|---|---|
userOperation | Yes | The UserOperation to validate |
entryPoint | Yes | The EntryPoint contract address |
policyIds | Yes | Array of policy IDs to check |
The response includes only the policies that would sponsor the operation, along with optional metadata about each policy.
pm_supportedEntryPoints
Returns the list of EntryPoint contracts supported by the paymaster on the current chain.
Request
{
"jsonrpc": "2.0",
"method": "pm_supportedEntryPoints",
"params": [],
"id": 1
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": [
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
"0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",
"0x433709009B8330FDa32311DF1C2AFA402eD8D009"
]
}Use this endpoint to verify which EntryPoint versions are supported before submitting UserOperations.