> ## Documentation Index
> Fetch the complete documentation index at: https://developers.particle.network/llms.txt
> Use this file to discover all available pages before exploring further.

# sponsorUserOperation

> Learn how to use the sponsorUserOperation JSON-RPC method.

## Contextualizing `sponsorUserOperation`

* `sponsorUserOperation` returns a Paymaster signature to sponsor a given UserOperation, pulling from the USDT balance of the Paymaster. It takes:
* UserOperation object.
* `entrypointAddress` - string.

***

## Query example

```javascript JavaScript theme={null}
import Axios from "axios";

const chainId = 11155111;
const projectUuid = "Your project uuid";
const projectKey = "Your project client key or server key";
const entryPoint = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789";
const userOp = {
    sender: "0xfE71795B01d2c36FD5a001fe9D47EAec0da77e59",
    nonce: "0x00",
    initCode:
        "0x9406cc6185a346906296840746125a0e449764545fbfb9cf0000000000000000000000009a8c05c7ac9acecc1185d5a624eb185e63dde9c20000000000000000000000000000000000000000000000000000000000000000",
    callData:
        "0xb61d27f6000000000000000000000000aae0de40f94469761b797920a46f223d0fffd013000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000",
    maxFeePerGas: "0x5e18a0d2",
    maxPriorityFeePerGas: "0x5de29812",
    paymasterAndData: "0x",
    signature: "0x",
    preVerificationGas: "0xc954",
    verificationGasLimit: "0x066c12",
    callGasLimit: "0xf2a0",
};

const paymasterUrl = "https://paymaster.particle.network";
(async () => {
    const response = await Axios.post(
        paymasterUrl,
        {
            method: "pm_sponsorUserOperation",
            params: [userOp, entryPoint],
        },
        {
            params: {
                chainId,
                projectUuid,
                projectKey,
            },
        }
    );

    console.log(response.data);
})();
```


## OpenAPI

````yaml openapi-paymaster POST /#pm_sponsorUserOperation
openapi: 3.0.0
info:
  title: Particle Network Paymaster
  version: 1.0.0
servers:
  - url: https://paymaster.particle.network
security: []
paths:
  /#pm_sponsorUserOperation:
    post:
      summary: sponsorUserOperation
      operationId: pm_sponsorUserOperation
      requestBody:
        description: Request to sponsor a user operation.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SponsorUserOperationRequest'
      responses:
        '200':
          description: Successful response with sponsorship details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SponsorUserOperationResponse'
components:
  schemas:
    SponsorUserOperationRequest:
      allOf:
        - $ref: '#/components/schemas/RPCRequest'
        - type: object
          properties:
            method:
              enum:
                - pm_sponsorUserOperation
            params:
              type: array
              description: Parameters for sponsoring a user operation.
              items:
                type: object
                anyOf:
                  - $ref: '#/components/schemas/UserOperation'
                  - type: string
    SponsorUserOperationResponse:
      allOf:
        - $ref: '#/components/schemas/RPCResponse'
        - type: object
          properties:
            result:
              type: object
              properties:
                paymasterAndData:
                  type: string
                  description: Paymaster and data details.
                  example: 0xPaymasterData
    RPCRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 0
          description: The request identifier.
          example: 0
        method:
          type: string
          description: API method being called.
        params:
          type: array
          description: Parameters for the API method call.
    UserOperation:
      type: object
      properties:
        sender:
          type: string
          description: Sender address.
          example: 0xSenderAddress
        nonce:
          type: string
          description: Nonce value.
          example: '0x1'
        initCode:
          type: string
          description: Initialization code.
          example: 0xInitCode
        callData:
          type: string
          description: Call data.
          example: 0xCallData
        maxFeePerGas:
          type: string
          description: Maximum fee per gas unit.
          example: '0x3B9ACA00'
        maxPriorityFeePerGas:
          type: string
          description: Maximum priority fee per gas unit.
          example: '0x3B9ACA00'
        paymasterAndData:
          type: string
          description: Paymaster and data.
          example: 0xPaymasterData
        signature:
          type: string
          description: Signature.
          example: 0xSignature
        preVerificationGas:
          type: string
          description: Gas cost for pre-verification.
          example: '0x5208'
        verificationGasLimit:
          type: string
          description: Gas limit for verification.
          example: '0x5208'
        callGasLimit:
          type: string
          description: Gas limit for the call.
          example: '0x5208'
    RPCResponse:
      type: object
      required:
        - jsonrpc
        - id
        - result
      properties:
        jsonrpc:
          type: string
          default: '2.0'
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 0
          description: The request identifier.
          example: 0
        result:
          anyOf:
            - $ref: '#/components/schemas/AnyValue'
    AnyValue:
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: object
        - type: array
          items: {}

````