pm_getPaymasterStubData | Pimlico Docs
Skip to content

pm_getPaymasterStubData

This method returns stub values to be used in paymaster-related fields of an unsigned user operation for gas estimation. The context parameter can be an object with either a token field (for ERC-20 mode) or a sponsorshipPolicyId field (for sponsorship mode), or null.

EntryPoint v0.7

Usage

{
    "jsonrpc": "2.0",
    "method": "pm_getPaymasterStubData",
    "params": [
        {
            "sender": "0x5a6b47F4131bf1feAFA56A05573314BcF44C9149",
            "nonce": "0x845ADB2C711129D4F3966735ED98A9F09FC4CE5700000000000000000000",
            "factory": "0xd703aaE79538628d27099B8c4f621bE4CCd142d5",
            "factoryData": "0xc5265d5d000000000000000000000000aac5d4240af87249b3f71bc8e4a2cae074a3e4190000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001243c3b752b01845ADb2C711129d4f3966735eD98a9F09fC4cE570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000014375d883Cb4afb913aC35c4B394468C4bC73d77C40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "callData": "0xe9ae5c53",
            "callGasLimit": "0x13880",
            "verificationGasLimit": "0x60B01",
            "preVerificationGas": "0xD3E3",
            "maxPriorityFeePerGas": "0x3B9ACA00",
            "maxFeePerGas": "0x7A5CF70D5",
            "paymaster": null,
            "paymasterVerificationGasLimit": null,
            "paymasterPostOpGasLimit": null,
            "paymasterData": null,
            "eip7702Auth": {
                "address": "0x1234567890123456789012345678901234567890",
                "chainId": "0x1",
                "nonce": "0x1",
                "r": "0x1234567890123456789012345678901234567890123456789012345678901234",
                "s": "0x1234567890123456789012345678901234567890123456789012345678901234",
                "v": "0x1b",
                "yParity": "0x1"
            }
        },
        "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
        "0x1",
        {
            "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
            // Or alternatively: "sponsorshipPolicyId": "policy-123456"
        }
    ],
    "id": 4337
}

Parameters

The method accepts an array with the following parameters:

  1. userOperation - Object: The user operation object containing the following fields:

    • sender - Address: The account making the operation.

    • nonce - HexString: Unique identifier for the request from this sender.

    • factory - Address (optional): The factory contract address.

    • factoryData - HexData (optional): The factory data for account creation.

    • callData - HexData: The data to pass to the sender during the main execution call.

    • callGasLimit - HexNumber: The amount of gas to allocate the main execution call.

    • verificationGasLimit - HexNumber: The amount of gas to allocate for the verification step.

    • preVerificationGas - HexNumber: The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata.

    • maxFeePerGas - HexNumber: Maximum fee per gas (similar to EIP-1559 max_fee_per_gas).

    • maxPriorityFeePerGas - HexNumber: Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).

    • paymaster - Address (optional): Address of paymaster sponsoring the transaction, or null if none.

    • paymasterVerificationGasLimit - HexNumber (optional): The amount of gas to allocate for the verification step of the paymaster, or null if no paymaster.

    • paymasterPostOpGasLimit - HexNumber (optional): The amount of gas to allocate for the post-operation step of the paymaster, or null if no paymaster.

    • paymasterData - HexData (optional): The data to pass to the paymaster during the verification step, or null if no paymaster.

    • eip7702Auth - Object (optional): EIP-7702 authorization data, can be null. This can be a dummy authorization. Contains the following fields:

      • address - Address: The contract address that signed the authorization.
      • chainId - HexNumber: The chain ID as a hex string.
      • nonce - HexNumber: The nonce as a hex string.
      • r - HexData32: The r component of the signature.
      • s - HexData32: The s component of the signature.
      • v - HexNumber: The v component of the signature.
      • yParity - HexNumber: The y-parity of the signature.
  2. entryPoint - Address: The entry point contract address.

  3. chainId - HexNumber: The chain ID in hexadecimal format.

  4. context - Object | null: Additional context information. Can be one of:

    • An object with token - Address: The ERC-20 token address to use for payment.
    • An object with sponsorshipPolicyId - String: The ID of the sponsorship policy to use.
    • null: No additional context.

Returns

{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "paymaster": "0x0000000000000039cd5e8aE05257CE51C473ddd1",
    "paymasterData": "0x01000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000c350000000000000000000000000000000000000000000000088ed21153e8f500000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c",
    "paymasterVerificationGasLimit": "0xc350",
    "paymasterPostOpGasLimit": "0x4e20"
  }
}

Return Fields

The response includes the following fields:

  • paymaster - Address: The address of the paymaster contract.

  • paymasterData - HexData: The data to be used in the paymasterData field of the user operation.

  • paymasterVerificationGasLimit - HexNumber: The amount of gas to allocate for the verification step of the paymaster.

  • paymasterPostOpGasLimit - HexNumber: The amount of gas to allocate for the post-operation step of the paymaster.

EntryPoint v0.6

Usage

{
    "jsonrpc": "2.0",
    "method": "pm_getPaymasterStubData",
    "params": [
        {
            "sender":"0xb341FEAFaF71b09089d03B7D114599f8F491EE45",
            "nonce":"0x0",
            "initCode":"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3296601cd0000000000000000000000000da6a956b9488ed4dd761e59f52fdc6c8068e6b5000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000084d1f57894000000000000000000000000d9ab5096a832b9ce79914329daee236f8eea039000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000014375cd3E53E18f65672E9d0Eb6AD174511b0BF98100000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "callData":"0x5194544700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
            "callGasLimit":"0x115b5c0",
            "verificationGasLimit":"0x249f0",
            "preVerificationGas":"0xeb11",
            "maxPriorityFeePerGas":"0x12a05f200",
            "maxFeePerGas":"0x5b08082fa",
            "paymasterAndData":"0x",
            "signature":"0xa6cc6589c8bd561cfd68d7b6b0757ef6f208e7438782939938498eee7d703260137856c840c491b3d415956265e81bf5c2184a725be2abfc365f7536b6af525e1c",
            "eip7702Auth": {
                "address": "0x1234567890123456789012345678901234567890",
                "chainId": "0x1",
                "nonce": "0x1",
                "r": "0x1234567890123456789012345678901234567890123456789012345678901234",
                "s": "0x1234567890123456789012345678901234567890123456789012345678901234",
                "v": "0x1b",
                "yParity": "0x1"
            }
        },
        "0x0000000071727De22E5E9d8BAf0edAc6f37da032",
        "0x1",
        {
            "token": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
            // Or alternatively: "sponsorshipPolicyId": "policy-123456"
        }
    ],
    "id": 4337
}

Returns

The method returns an object containing paymaster-related fields for EntryPoint v0.6.

{
  "jsonrpc": "2.0",
  "id": 4337,
  "result": {
    "paymasterAndData": "0x0000000000000039cd5e8aE05257CE51C473ddd101000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000c350000000000000000000000000000000000000000000000088ed21153e8f500000cd91f19f0f19ce862d7bec7b7d9b95457145afc6f639c28fd0360f488937bfa41e6eedcd3a46054fd95fcd0e3ef6b0bc0a615c4d975eef55c8a3517257904d5b1c"
  }
}

Parameters

The method accepts an array with the following parameters:

  1. userOperation - Object: The user operation object containing the following fields:

    • sender - Address: The account making the operation.

    • nonce - HexString: Unique identifier for the request from this sender.

    • initCode - HexData: The initialization code for the smart account if it doesn't exist yet.

    • callData - HexData: The data to pass to the sender during the main execution call.

    • callGasLimit - HexNumber: The amount of gas to allocate the main execution call.

    • verificationGasLimit - HexNumber: The amount of gas to allocate for the verification step.

    • preVerificationGas - HexNumber: The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata.

    • maxFeePerGas - HexNumber: Maximum fee per gas (similar to EIP-1559 max_fee_per_gas).

    • maxPriorityFeePerGas - HexNumber: Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).

    • paymasterAndData - HexData: The combined paymaster address and data to be used in the user operation.

    • signature - HexData: The signature of the user operation.

    • eip7702Auth - Object (optional): EIP-7702 authorization data, can be null. This can be a dummy authorization. Contains the following fields:

      • address - Address: The contract address that signed the authorization.
      • chainId - HexNumber: The chain ID as a hex string.
      • nonce - HexNumber: The nonce as a hex string.
      • r - HexData32: The r component of the signature.
      • s - HexData32: The s component of the signature.
      • v - HexNumber: The v component of the signature.
      • yParity - HexNumber: The y-parity of the signature.
  2. entryPoint - Address: The entry point contract address.

  3. chainId - HexNumber: The chain ID in hexadecimal format.

  4. context - Object | null: Additional context information. Can be one of:

    • An object with token - Address: The ERC-20 token address to use for payment.
    • An object with sponsorshipPolicyId - String: The ID of the sponsorship policy to use.
    • null: No additional context.

Return Fields

The response includes the following fields:

  • paymasterAndData - HexData: The combined paymaster address and data to be used in the user operation.