Constructing Requests

Option 1: You can use the JSON-RPC playground on the Paymaster page to easily create sample JSON-RPC requests.

Option 2: Alternatively, you can construct your own requests by following the below steps:

  1. Go to the JSON-RPC playground on the Paymaster page.
  2. Ensure the correct network in your RPC URL (either base or base-sepolia).
  3. Open a terminal and make your requests based on the supported methods in this API reference page.

Authentication

For information on how to authenticate requests to our JSON-RPC APIs, please visit the Client API Keys section of our Authentication page.

Bundler Namespace

eth_supportedEntryPoints

This endpoint retrieves an array of supported entry points. Currently, the only supported entrypoint is v0.6 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789.

The API credit value of this method is 30.

Request/Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_supportedEntryPoints"
}

eth_getUserOperationByHash

This endpoint returns a UserOperation based on the hash returned from eth_sendUserOperation.

The API credit value of this method is 30.

Parameters

NameTypeReqDescription
hasharrayYThe hash of the UserOperation to retrieve

Returns

TypeDescription
senderAccount initiating the UserOperation
nonceNonce
initCodeinitCode (needed if the account needs to be created)
preVerificationGasAmount of gas to pay for to compensate the bundler for pre-verification execution and calldata
maxFeePerGasMaximum fee per gas to pay for the execution of this operation
maxPriorityFeePerGasMaximum priority fee per gas
signatureSignature from the account
verificationGasLimitAmount of gas to allocate for the verification step
callGasLimitAmount of gas to allocate the main execution call
paymasterAndDataHex string signed by the paymaster for a sponsored transaction
blockNumberBlock number in which UserOperation is included
blockHashBlock hash in which UserOperation is included
transactionHashTransaction hash of the UserOperation

Request/Response

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getUserOperationByHash",
  "params": [
    "0x77c0b560eb0b042902abc5613f768d2a6b2d67481247e9663bf4d68dec0ca122"
  ]
}

eth_getUserOperationReceipt

This endpoint returns a receipt based on the hash returned from eth_sendUserOperation.

The API credit value of this method is 30.

Parameters

NameTypeReqDescription
hasharrayYThe hash of the UserOperation to retrieve

Returns

TypeDescription
userOpHashHash of the UserOperation
entryPointEntrypoint that the UserOperation was sent to
senderAccount initiating the UserOperation
nonceNonce
paymasterPaymaster used in the UserOperation
actualGasCostActual gas consumed by this UserOperation
actualGasUsedTotal gas used by this UserOperation
successWhether the execution completed successfully
reasonIf reverted, the reason the execution failed
logsLogs generated by this UserOperation (not including logs of other UserOperations in the same bundle)
receiptTransactionReceipt object for the entire bundle
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_getUserOperationReceipt",
  "params": [
    "0x77c0b560eb0b042902abc5613f768d2a6b2d67481247e9663bf4d68dec0ca122"
  ]
}

eth_sendUserOperation

This endpoint sends a UserOperation for inclusion in the Bundler’s private mempool. The signature must be a valid signature from the smart account.

The API credit value of this method is 500.

Parameters

NameTypeReqDescription
UserOperationUserOperationYThe UserOperation. You may add a paymasterAndData field if the transaction is sponsored.
entryPointstringYEntryPoint address that the UserOperation is intended for.
{
  "jsonrpc": "2.0",
   "id": 1,
  "method": "eth_sendUserOperation",
  "params": [
            {
            sender, // address
            nonce, // uint256
            initCode, // string
            callData, // string
            callGasLimit, // string
            verificationGasLimit, // string
            preVerificationGas, // string
            maxFeePerGas, // string
            maxPriorityFeePerGas, // string
       signature, // string
     paymasterAndData, // string
        }, "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
  ]
}

eth_estimateUserOperationGas

This endpoint will estimate the gas values for a UserOperation. The signature field is ignored and can be a dummy value, but is recommended to be of the same size as an actual signature for an accurate estimate.

The API credit value of this method is 500.

Parameters

NameTypeReqDescription
UserOperationUserOperationYThe UserOperation. You can use a dummy signature but the signature must be the correct size for an accurate gas estimate.
entryPointstringYEntryPoint address that the UserOperation is intended for.

Returns

TypeDescription
preVerificationGasAmount of gas to compensate the bundler for pre-verification execution and calldata
verificationGasLimitAmount of gas to allocate for the verification step
callGasLimitAmount of gas to allocate the main execution call
{
  "jsonrpc": "2.0",
   "id": 1,
  "method": "eth_estimateUserOperationGas",
  "params": [
            {
            sender, // address
            nonce, // uint256
            initCode, // string
            callData, // string
            callGasLimit, // string
            verificationGasLimit, // string
            preVerificationGas, // string
            maxFeePerGas, // string
            maxPriorityFeePerGas, // string
       signature, // string
     paymasterAndData, // string
        }, "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
  ]
}

Paymaster Namespace

pm_getPaymasterStubData

See the ERC-7677 docs for parameters and returns.

The API credit value of this method is 30.

EntryPoint v0.6

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "pm_getPaymasterStubData",
  "params": [
    {
      "sender": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "nonce": "0x2a",
      "initCode": "0x",
      "callData": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
      "callGasLimit": "0x0",
      "verificationGasLimit": "0x0",
      "preVerificationGas": "0x0",
      "maxFeePerGas": "0x0",
      "maxPriorityFeePerGas": "0x0"
    },
    "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
    "0x14A34",
    {
      "policyId": "631528b0-d444-4a9b-a575-40dd3aa4a13a"
    }
  ]
}

pm_getPaymasterData

See the ERC-7677 docs for parameters and returns.

The API credit value of this method is 30.

EntryPoint v0.6

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "pm_getPaymasterData",
  "params": [
    {
      "sender": "0xd46e8dd67c5d32be8058bb8eb970870f07244567",
      "nonce": "0x2a",
      "initCode": "0x",
      "callData": "0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675",
      "callGasLimit": "0x0",
      "verificationGasLimit": "0x0",
      "preVerificationGas": "0x0",
      "maxFeePerGas": "0x0",
      "maxPriorityFeePerGas": "0x0"
    },
    "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
    "0x14A34",
    {
      "policyId": "631528b0-d444-4a9b-a575-40dd3aa4a13a"
    }
  ]
}

pm_sponsorUserOperation

The API credit value of this method is 500.

pm_getAcceptedPaymentTokens

The API credit value of this method is 30.

pm_getAddressSponsorshipInfo

The API credit value of this method is 30.