{
  "x-generated-warning": "⚠️ This file is auto-generated. Do not edit manually",
  "openapi": "3.1.0",
  "info": {
    "title": "🪄 Gas Manager Admin API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://manage.g.alchemy.com"
    }
  ],
  "paths": {
    "/api/gasManager/policy": {
      "post": {
        "summary": "Create Policy",
        "description": "Creates a new gas manager policy with the specified rules. The newly created policy will be in the `inactive` status.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "create-policy",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "policyName",
                  "policyType",
                  "appId"
                ],
                "properties": {
                  "policyName": {
                    "type": "string",
                    "description": "Name of the policy",
                    "default": "My Policy"
                  },
                  "policyType": {
                    "description": "Type of the policy. Supported values are `sponsorship` and `bundler_sponsorship` for sponsoring gas on EVM networks, `erc20` for enabling users to pay gas with any ERC-20 token on EVM networks, and `solana` for sponsoring fees and rent on Solana.",
                    "type": "string",
                    "enum": [
                      "sponsorship",
                      "bundler_sponsorship",
                      "erc20",
                      "solana"
                    ],
                    "default": "sponsorship"
                  },
                  "appId": {
                    "type": "string",
                    "description": "ID for the app associated with the new policy.\n",
                    "default": "6d834x9k1yh4dx6z"
                  },
                  "networks": {
                    "description": "Networks to be enabled for the policy. Required for `sponsorship`, `bundler_sponsorship`, and `solana` policy types. Example: `ETH_MAINNET`. For Solana policies, valid values are `SOLANA_MAINNET` and `SOLANA_DEVNET`. For `erc20` policies, networks are specified in `erc20Rules.tokens` and this field is ignored.\n",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "rules": {
                    "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Omit for other policy types.",
                    "type": "object",
                    "properties": {
                      "maxSpendUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored",
                        "default": 5000
                      },
                      "maxSpendPerSenderUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                        "default": 100
                      },
                      "maxSpendPerUoUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                        "default": 20
                      },
                      "maxCount": {
                        "type": "integer",
                        "description": "Maximum number of userOperations that can be sponsored",
                        "default": 100
                      },
                      "maxCountPerSender": {
                        "type": "integer",
                        "description": "Maximum number of userOperations that can be sponsored for a single sender",
                        "default": 2
                      },
                      "senderAllowlist": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "List of addresses that are eligible for sponsorship",
                        "default": [
                          "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                          "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                        ]
                      },
                      "senderBlocklist": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "List of addresses that are banned from receiving sponsorship"
                      },
                      "startTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy starts",
                        "default": "1674228753"
                      },
                      "endTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy ends",
                        "default": "1679340742"
                      },
                      "sponsorshipExpiryMs": {
                        "type": "string",
                        "description": "Milliseconds after the sponsorship is issued that it expires",
                        "default": "600000"
                      },
                      "webhookRules": {
                        "type": "object",
                        "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                        "properties": {
                          "webhookUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "The URL to call to verify sponsorship eligibility.",
                            "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                          },
                          "approveOnFailure": {
                            "type": "boolean",
                            "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                            "default": false
                          }
                        },
                        "required": [
                          "webhookUrl",
                          "approveOnFailure"
                        ]
                      }
                    },
                    "required": [
                      "startTimeUnix"
                    ]
                  },
                  "solanaRules": {
                    "description": "Rules for `solana` policy type. Omit for other policy types.",
                    "type": "object",
                    "properties": {
                      "maxSpendUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored",
                        "default": 6500
                      },
                      "maxSpendPerTxnUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                        "default": 30
                      },
                      "maxCount": {
                        "type": "integer",
                        "description": "Maximum number of transactions that can be sponsored",
                        "default": 200
                      },
                      "startTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy starts",
                        "default": "1674228753"
                      },
                      "endTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy ends",
                        "default": "1679340742"
                      }
                    },
                    "required": [
                      "startTimeUnix"
                    ]
                  },
                  "erc20Rules": {
                    "description": "Rules for `erc20` policy type. Omit for other policy types.",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "maxSpendUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored",
                            "default": 5000
                          },
                          "maxSpendPerSenderUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                            "default": 100
                          },
                          "maxSpendPerUoUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                            "default": 20
                          },
                          "maxCount": {
                            "type": "integer",
                            "description": "Maximum number of userOperations that can be sponsored",
                            "default": 100
                          },
                          "maxCountPerSender": {
                            "type": "integer",
                            "description": "Maximum number of userOperations that can be sponsored for a single sender",
                            "default": 2
                          },
                          "senderAllowlist": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "List of addresses that are eligible for sponsorship",
                            "default": [
                              "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                              "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                            ]
                          },
                          "senderBlocklist": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "List of addresses that are banned from receiving sponsorship"
                          },
                          "startTimeUnix": {
                            "type": "string",
                            "description": "Unix timestamp of when the policy starts",
                            "default": "1674228753"
                          },
                          "endTimeUnix": {
                            "type": "string",
                            "description": "Unix timestamp of when the policy ends",
                            "default": "1679340742"
                          },
                          "sponsorshipExpiryMs": {
                            "type": "string",
                            "description": "Milliseconds after the sponsorship is issued that it expires",
                            "default": "600000"
                          },
                          "webhookRules": {
                            "type": "object",
                            "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                            "properties": {
                              "webhookUrl": {
                                "type": "string",
                                "format": "uri",
                                "description": "The URL to call to verify sponsorship eligibility.",
                                "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                              },
                              "approveOnFailure": {
                                "type": "boolean",
                                "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                "default": false
                              }
                            },
                            "required": [
                              "webhookUrl",
                              "approveOnFailure"
                            ]
                          }
                        },
                        "required": [
                          "startTimeUnix"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "tokens": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "network": {
                                  "type": "string",
                                  "description": "Network of the Erc20 token"
                                },
                                "tokenAddress": {
                                  "type": "string",
                                  "description": "Erc20 token contract address"
                                },
                                "priceReferenceNetwork": {
                                  "type": "string",
                                  "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                },
                                "priceReferenceTokenAddress": {
                                  "type": "string",
                                  "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                }
                              },
                              "required": [
                                "network",
                                "tokenAddress"
                              ]
                            },
                            "description": "Erc20 tokens allowed under this policy."
                          },
                          "recipientAddress": {
                            "type": "string",
                            "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                          },
                          "usePostOp": {
                            "type": "boolean",
                            "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                          },
                          "priceMultiplier": {
                            "type": "number",
                            "default": 1,
                            "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                          }
                        },
                        "required": [
                          "tokens",
                          "recipientAddress",
                          "usePostOp"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Policy created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policy": {
                          "type": "object",
                          "properties": {
                            "policyId": {
                              "type": "string",
                              "description": "String ID of the policy",
                              "default": "0x1234567890abcdef"
                            },
                            "appId": {
                              "type": "string",
                              "description": "String ID of the app",
                              "default": "0x1234567890abcdef"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "inactive",
                                "pending_approval",
                                "rejected"
                              ],
                              "description": "Status of the policy."
                            },
                            "rules": {
                              "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 5000
                                },
                                "maxSpendPerSenderUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                  "default": 100
                                },
                                "maxSpendPerUoUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                  "default": 20
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored",
                                  "default": 100
                                },
                                "maxCountPerSender": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                  "default": 2
                                },
                                "senderAllowlist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are eligible for sponsorship",
                                  "default": [
                                    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                  ]
                                },
                                "senderBlocklist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are banned from receiving sponsorship"
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                },
                                "sponsorshipExpiryMs": {
                                  "type": "string",
                                  "description": "Milliseconds after the sponsorship is issued that it expires",
                                  "default": "600000"
                                },
                                "webhookRules": {
                                  "type": "object",
                                  "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                  "properties": {
                                    "webhookUrl": {
                                      "type": "string",
                                      "format": "uri",
                                      "description": "The URL to call to verify sponsorship eligibility.",
                                      "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                    },
                                    "approveOnFailure": {
                                      "type": "boolean",
                                      "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                      "default": false
                                    }
                                  },
                                  "required": [
                                    "webhookUrl",
                                    "approveOnFailure"
                                  ]
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            },
                            "policyName": {
                              "type": "string",
                              "description": "Name of the policy",
                              "default": "Gas Manager Policy"
                            },
                            "lastUpdatedUnix": {
                              "type": "string",
                              "description": "Unix timestamp of when the policy was last updated",
                              "default": "1674228753"
                            },
                            "policyVersion": {
                              "type": "integer",
                              "description": "Version of the policy",
                              "default": 0
                            },
                            "policyType": {
                              "description": "Type of the policy.",
                              "type": "string",
                              "enum": [
                                "sponsorship",
                                "bundler_sponsorship",
                                "erc20",
                                "solana"
                              ],
                              "default": "sponsorship"
                            },
                            "policyState": {
                              "type": "string",
                              "description": "State of the policy",
                              "default": "ongoing"
                            },
                            "networks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of networks the policy is active on"
                            },
                            "gasPumpId": {
                              "type": "string",
                              "description": "Gas pump id"
                            },
                            "erc20Rules": {
                              "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
                              "allOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "maxSpendUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored",
                                      "default": 5000
                                    },
                                    "maxSpendPerSenderUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                      "default": 100
                                    },
                                    "maxSpendPerUoUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                      "default": 20
                                    },
                                    "maxCount": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored",
                                      "default": 100
                                    },
                                    "maxCountPerSender": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                      "default": 2
                                    },
                                    "senderAllowlist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are eligible for sponsorship",
                                      "default": [
                                        "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                        "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                      ]
                                    },
                                    "senderBlocklist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are banned from receiving sponsorship"
                                    },
                                    "startTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy starts",
                                      "default": "1674228753"
                                    },
                                    "endTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy ends",
                                      "default": "1679340742"
                                    },
                                    "sponsorshipExpiryMs": {
                                      "type": "string",
                                      "description": "Milliseconds after the sponsorship is issued that it expires",
                                      "default": "600000"
                                    },
                                    "webhookRules": {
                                      "type": "object",
                                      "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                      "properties": {
                                        "webhookUrl": {
                                          "type": "string",
                                          "format": "uri",
                                          "description": "The URL to call to verify sponsorship eligibility.",
                                          "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                        },
                                        "approveOnFailure": {
                                          "type": "boolean",
                                          "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                          "default": false
                                        }
                                      },
                                      "required": [
                                        "webhookUrl",
                                        "approveOnFailure"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "startTimeUnix"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "tokens": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "network": {
                                            "type": "string",
                                            "description": "Network of the Erc20 token"
                                          },
                                          "tokenAddress": {
                                            "type": "string",
                                            "description": "Erc20 token contract address"
                                          },
                                          "priceReferenceNetwork": {
                                            "type": "string",
                                            "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          },
                                          "priceReferenceTokenAddress": {
                                            "type": "string",
                                            "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          }
                                        },
                                        "required": [
                                          "network",
                                          "tokenAddress"
                                        ]
                                      },
                                      "description": "Erc20 tokens allowed under this policy."
                                    },
                                    "recipientAddress": {
                                      "type": "string",
                                      "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                                    },
                                    "usePostOp": {
                                      "type": "boolean",
                                      "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                                    },
                                    "priceMultiplier": {
                                      "type": "number",
                                      "default": 1,
                                      "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                                    }
                                  },
                                  "required": [
                                    "tokens",
                                    "recipientAddress",
                                    "usePostOp"
                                  ]
                                }
                              ]
                            },
                            "solanaRules": {
                              "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 6500
                                },
                                "maxSpendPerTxnUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                                  "default": 30
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of transactions that can be sponsored",
                                  "default": 200
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            }
                          },
                          "required": [
                            "policyId",
                            "appId",
                            "status"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}": {
      "get": {
        "summary": "Get Policy",
        "description": "Returns a policy by id.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "get-policy",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy to be fetched",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Policy fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policy": {
                          "type": "object",
                          "properties": {
                            "policyId": {
                              "type": "string",
                              "description": "String ID of the policy",
                              "default": "0x1234567890abcdef"
                            },
                            "appId": {
                              "type": "string",
                              "description": "String ID of the app",
                              "default": "0x1234567890abcdef"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "inactive",
                                "pending_approval",
                                "rejected"
                              ],
                              "description": "Status of the policy."
                            },
                            "rules": {
                              "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 5000
                                },
                                "maxSpendPerSenderUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                  "default": 100
                                },
                                "maxSpendPerUoUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                  "default": 20
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored",
                                  "default": 100
                                },
                                "maxCountPerSender": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                  "default": 2
                                },
                                "senderAllowlist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are eligible for sponsorship",
                                  "default": [
                                    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                  ]
                                },
                                "senderBlocklist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are banned from receiving sponsorship"
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                },
                                "sponsorshipExpiryMs": {
                                  "type": "string",
                                  "description": "Milliseconds after the sponsorship is issued that it expires",
                                  "default": "600000"
                                },
                                "webhookRules": {
                                  "type": "object",
                                  "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                  "properties": {
                                    "webhookUrl": {
                                      "type": "string",
                                      "format": "uri",
                                      "description": "The URL to call to verify sponsorship eligibility.",
                                      "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                    },
                                    "approveOnFailure": {
                                      "type": "boolean",
                                      "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                      "default": false
                                    }
                                  },
                                  "required": [
                                    "webhookUrl",
                                    "approveOnFailure"
                                  ]
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            },
                            "policyName": {
                              "type": "string",
                              "description": "Name of the policy",
                              "default": "Gas Manager Policy"
                            },
                            "lastUpdatedUnix": {
                              "type": "string",
                              "description": "Unix timestamp of when the policy was last updated",
                              "default": "1674228753"
                            },
                            "policyVersion": {
                              "type": "integer",
                              "description": "Version of the policy",
                              "default": 0
                            },
                            "policyType": {
                              "description": "Type of the policy.",
                              "type": "string",
                              "enum": [
                                "sponsorship",
                                "bundler_sponsorship",
                                "erc20",
                                "solana"
                              ],
                              "default": "sponsorship"
                            },
                            "policyState": {
                              "type": "string",
                              "description": "State of the policy",
                              "default": "ongoing"
                            },
                            "networks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of networks the policy is active on"
                            },
                            "gasPumpId": {
                              "type": "string",
                              "description": "Gas pump id"
                            },
                            "erc20Rules": {
                              "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
                              "allOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "maxSpendUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored",
                                      "default": 5000
                                    },
                                    "maxSpendPerSenderUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                      "default": 100
                                    },
                                    "maxSpendPerUoUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                      "default": 20
                                    },
                                    "maxCount": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored",
                                      "default": 100
                                    },
                                    "maxCountPerSender": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                      "default": 2
                                    },
                                    "senderAllowlist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are eligible for sponsorship",
                                      "default": [
                                        "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                        "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                      ]
                                    },
                                    "senderBlocklist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are banned from receiving sponsorship"
                                    },
                                    "startTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy starts",
                                      "default": "1674228753"
                                    },
                                    "endTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy ends",
                                      "default": "1679340742"
                                    },
                                    "sponsorshipExpiryMs": {
                                      "type": "string",
                                      "description": "Milliseconds after the sponsorship is issued that it expires",
                                      "default": "600000"
                                    },
                                    "webhookRules": {
                                      "type": "object",
                                      "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                      "properties": {
                                        "webhookUrl": {
                                          "type": "string",
                                          "format": "uri",
                                          "description": "The URL to call to verify sponsorship eligibility.",
                                          "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                        },
                                        "approveOnFailure": {
                                          "type": "boolean",
                                          "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                          "default": false
                                        }
                                      },
                                      "required": [
                                        "webhookUrl",
                                        "approveOnFailure"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "startTimeUnix"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "tokens": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "network": {
                                            "type": "string",
                                            "description": "Network of the Erc20 token"
                                          },
                                          "tokenAddress": {
                                            "type": "string",
                                            "description": "Erc20 token contract address"
                                          },
                                          "priceReferenceNetwork": {
                                            "type": "string",
                                            "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          },
                                          "priceReferenceTokenAddress": {
                                            "type": "string",
                                            "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          }
                                        },
                                        "required": [
                                          "network",
                                          "tokenAddress"
                                        ]
                                      },
                                      "description": "Erc20 tokens allowed under this policy."
                                    },
                                    "recipientAddress": {
                                      "type": "string",
                                      "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                                    },
                                    "usePostOp": {
                                      "type": "boolean",
                                      "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                                    },
                                    "priceMultiplier": {
                                      "type": "number",
                                      "default": 1,
                                      "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                                    }
                                  },
                                  "required": [
                                    "tokens",
                                    "recipientAddress",
                                    "usePostOp"
                                  ]
                                }
                              ]
                            },
                            "solanaRules": {
                              "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 6500
                                },
                                "maxSpendPerTxnUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                                  "default": 30
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of transactions that can be sponsored",
                                  "default": 200
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            }
                          },
                          "required": [
                            "policyId",
                            "appId",
                            "status"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Delete Policy",
        "description": "Deletes a policy by id.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "delete-policy",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy to be deleted",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "6d834x9k1yh4dx6z"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "`200` - Policy deleted successfully"
          }
        }
      },
      "put": {
        "summary": "Replace Policy",
        "description": "Replaces all rules in an existing policy by id.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "replace-policy",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy to be replaced",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "policyName": {
                    "type": "string",
                    "description": "Name of the policy",
                    "default": "My Policy"
                  },
                  "rules": {
                    "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Omit for other policy types.",
                    "type": "object",
                    "properties": {
                      "maxSpendUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored",
                        "default": 5000
                      },
                      "maxSpendPerSenderUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                        "default": 100
                      },
                      "maxSpendPerUoUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                        "default": 20
                      },
                      "maxCount": {
                        "type": "integer",
                        "description": "Maximum number of userOperations that can be sponsored",
                        "default": 100
                      },
                      "maxCountPerSender": {
                        "type": "integer",
                        "description": "Maximum number of userOperations that can be sponsored for a single sender",
                        "default": 2
                      },
                      "senderAllowlist": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "List of addresses that are eligible for sponsorship",
                        "default": [
                          "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                          "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                        ]
                      },
                      "senderBlocklist": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "description": "List of addresses that are banned from receiving sponsorship"
                      },
                      "startTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy starts",
                        "default": "1674228753"
                      },
                      "endTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy ends",
                        "default": "1679340742"
                      },
                      "sponsorshipExpiryMs": {
                        "type": "string",
                        "description": "Milliseconds after the sponsorship is issued that it expires",
                        "default": "600000"
                      },
                      "webhookRules": {
                        "type": "object",
                        "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                        "properties": {
                          "webhookUrl": {
                            "type": "string",
                            "format": "uri",
                            "description": "The URL to call to verify sponsorship eligibility.",
                            "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                          },
                          "approveOnFailure": {
                            "type": "boolean",
                            "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                            "default": false
                          }
                        },
                        "required": [
                          "webhookUrl",
                          "approveOnFailure"
                        ]
                      }
                    },
                    "required": [
                      "startTimeUnix"
                    ]
                  },
                  "networks": {
                    "description": "Networks for the policy. Example: `ETH_MAINNET`. For Solana policies, valid values are `SOLANA_MAINNET` and `SOLANA_DEVNET`. For `erc20` policies, networks are specified in `erc20Rules.tokens`.\n",
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "solanaRules": {
                    "description": "Rules for `solana` policy type. Omit for other policy types.",
                    "type": "object",
                    "properties": {
                      "maxSpendUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored",
                        "default": 6500
                      },
                      "maxSpendPerTxnUsd": {
                        "type": "number",
                        "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                        "default": 30
                      },
                      "maxCount": {
                        "type": "integer",
                        "description": "Maximum number of transactions that can be sponsored",
                        "default": 200
                      },
                      "startTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy starts",
                        "default": "1674228753"
                      },
                      "endTimeUnix": {
                        "type": "string",
                        "description": "Unix timestamp of when the policy ends",
                        "default": "1679340742"
                      }
                    },
                    "required": [
                      "startTimeUnix"
                    ]
                  },
                  "erc20Rules": {
                    "description": "Rules for `erc20` policy type. Omit for other policy types.",
                    "allOf": [
                      {
                        "type": "object",
                        "properties": {
                          "maxSpendUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored",
                            "default": 5000
                          },
                          "maxSpendPerSenderUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                            "default": 100
                          },
                          "maxSpendPerUoUsd": {
                            "type": "number",
                            "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                            "default": 20
                          },
                          "maxCount": {
                            "type": "integer",
                            "description": "Maximum number of userOperations that can be sponsored",
                            "default": 100
                          },
                          "maxCountPerSender": {
                            "type": "integer",
                            "description": "Maximum number of userOperations that can be sponsored for a single sender",
                            "default": 2
                          },
                          "senderAllowlist": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "List of addresses that are eligible for sponsorship",
                            "default": [
                              "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                              "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                            ]
                          },
                          "senderBlocklist": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "List of addresses that are banned from receiving sponsorship"
                          },
                          "startTimeUnix": {
                            "type": "string",
                            "description": "Unix timestamp of when the policy starts",
                            "default": "1674228753"
                          },
                          "endTimeUnix": {
                            "type": "string",
                            "description": "Unix timestamp of when the policy ends",
                            "default": "1679340742"
                          },
                          "sponsorshipExpiryMs": {
                            "type": "string",
                            "description": "Milliseconds after the sponsorship is issued that it expires",
                            "default": "600000"
                          },
                          "webhookRules": {
                            "type": "object",
                            "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                            "properties": {
                              "webhookUrl": {
                                "type": "string",
                                "format": "uri",
                                "description": "The URL to call to verify sponsorship eligibility.",
                                "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                              },
                              "approveOnFailure": {
                                "type": "boolean",
                                "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                "default": false
                              }
                            },
                            "required": [
                              "webhookUrl",
                              "approveOnFailure"
                            ]
                          }
                        },
                        "required": [
                          "startTimeUnix"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "tokens": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "network": {
                                  "type": "string",
                                  "description": "Network of the Erc20 token"
                                },
                                "tokenAddress": {
                                  "type": "string",
                                  "description": "Erc20 token contract address"
                                },
                                "priceReferenceNetwork": {
                                  "type": "string",
                                  "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                },
                                "priceReferenceTokenAddress": {
                                  "type": "string",
                                  "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                }
                              },
                              "required": [
                                "network",
                                "tokenAddress"
                              ]
                            },
                            "description": "Erc20 tokens allowed under this policy."
                          },
                          "recipientAddress": {
                            "type": "string",
                            "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                          },
                          "usePostOp": {
                            "type": "boolean",
                            "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                          },
                          "priceMultiplier": {
                            "type": "number",
                            "default": 1,
                            "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                          }
                        },
                        "required": [
                          "tokens",
                          "recipientAddress",
                          "usePostOp"
                        ]
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Policy rules replaced successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policy": {
                          "type": "object",
                          "properties": {
                            "policyId": {
                              "type": "string",
                              "description": "String ID of the policy",
                              "default": "0x1234567890abcdef"
                            },
                            "appId": {
                              "type": "string",
                              "description": "String ID of the app",
                              "default": "0x1234567890abcdef"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "inactive",
                                "pending_approval",
                                "rejected"
                              ],
                              "description": "Status of the policy."
                            },
                            "rules": {
                              "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 5000
                                },
                                "maxSpendPerSenderUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                  "default": 100
                                },
                                "maxSpendPerUoUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                  "default": 20
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored",
                                  "default": 100
                                },
                                "maxCountPerSender": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                  "default": 2
                                },
                                "senderAllowlist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are eligible for sponsorship",
                                  "default": [
                                    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                  ]
                                },
                                "senderBlocklist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are banned from receiving sponsorship"
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                },
                                "sponsorshipExpiryMs": {
                                  "type": "string",
                                  "description": "Milliseconds after the sponsorship is issued that it expires",
                                  "default": "600000"
                                },
                                "webhookRules": {
                                  "type": "object",
                                  "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                  "properties": {
                                    "webhookUrl": {
                                      "type": "string",
                                      "format": "uri",
                                      "description": "The URL to call to verify sponsorship eligibility.",
                                      "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                    },
                                    "approveOnFailure": {
                                      "type": "boolean",
                                      "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                      "default": false
                                    }
                                  },
                                  "required": [
                                    "webhookUrl",
                                    "approveOnFailure"
                                  ]
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            },
                            "policyName": {
                              "type": "string",
                              "description": "Name of the policy",
                              "default": "Gas Manager Policy"
                            },
                            "lastUpdatedUnix": {
                              "type": "string",
                              "description": "Unix timestamp of when the policy was last updated",
                              "default": "1674228753"
                            },
                            "policyVersion": {
                              "type": "integer",
                              "description": "Version of the policy",
                              "default": 0
                            },
                            "policyType": {
                              "description": "Type of the policy.",
                              "type": "string",
                              "enum": [
                                "sponsorship",
                                "bundler_sponsorship",
                                "erc20",
                                "solana"
                              ],
                              "default": "sponsorship"
                            },
                            "policyState": {
                              "type": "string",
                              "description": "State of the policy",
                              "default": "ongoing"
                            },
                            "networks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of networks the policy is active on"
                            },
                            "gasPumpId": {
                              "type": "string",
                              "description": "Gas pump id"
                            },
                            "erc20Rules": {
                              "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
                              "allOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "maxSpendUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored",
                                      "default": 5000
                                    },
                                    "maxSpendPerSenderUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                      "default": 100
                                    },
                                    "maxSpendPerUoUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                      "default": 20
                                    },
                                    "maxCount": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored",
                                      "default": 100
                                    },
                                    "maxCountPerSender": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                      "default": 2
                                    },
                                    "senderAllowlist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are eligible for sponsorship",
                                      "default": [
                                        "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                        "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                      ]
                                    },
                                    "senderBlocklist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are banned from receiving sponsorship"
                                    },
                                    "startTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy starts",
                                      "default": "1674228753"
                                    },
                                    "endTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy ends",
                                      "default": "1679340742"
                                    },
                                    "sponsorshipExpiryMs": {
                                      "type": "string",
                                      "description": "Milliseconds after the sponsorship is issued that it expires",
                                      "default": "600000"
                                    },
                                    "webhookRules": {
                                      "type": "object",
                                      "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                      "properties": {
                                        "webhookUrl": {
                                          "type": "string",
                                          "format": "uri",
                                          "description": "The URL to call to verify sponsorship eligibility.",
                                          "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                        },
                                        "approveOnFailure": {
                                          "type": "boolean",
                                          "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                          "default": false
                                        }
                                      },
                                      "required": [
                                        "webhookUrl",
                                        "approveOnFailure"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "startTimeUnix"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "tokens": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "network": {
                                            "type": "string",
                                            "description": "Network of the Erc20 token"
                                          },
                                          "tokenAddress": {
                                            "type": "string",
                                            "description": "Erc20 token contract address"
                                          },
                                          "priceReferenceNetwork": {
                                            "type": "string",
                                            "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          },
                                          "priceReferenceTokenAddress": {
                                            "type": "string",
                                            "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          }
                                        },
                                        "required": [
                                          "network",
                                          "tokenAddress"
                                        ]
                                      },
                                      "description": "Erc20 tokens allowed under this policy."
                                    },
                                    "recipientAddress": {
                                      "type": "string",
                                      "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                                    },
                                    "usePostOp": {
                                      "type": "boolean",
                                      "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                                    },
                                    "priceMultiplier": {
                                      "type": "number",
                                      "default": 1,
                                      "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                                    }
                                  },
                                  "required": [
                                    "tokens",
                                    "recipientAddress",
                                    "usePostOp"
                                  ]
                                }
                              ]
                            },
                            "solanaRules": {
                              "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 6500
                                },
                                "maxSpendPerTxnUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                                  "default": 30
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of transactions that can be sponsored",
                                  "default": 200
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            }
                          },
                          "required": [
                            "policyId",
                            "appId",
                            "status"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policies": {
      "get": {
        "summary": "Get All Policies",
        "description": "Returns all policies. The results are paginated.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "get-all-policies",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "appId",
            "in": "query",
            "description": "An optional app id to filter results by policies associated with that app.\n",
            "schema": {
              "type": "string",
              "default": "6d834x9k1yh4dx6z"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "An optional parameter to limit the number of results per page.",
            "schema": {
              "type": "integer",
              "default": 10,
              "maximum": 50
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "String - used for pagination. If there are previous results, `before` field is returned in the response and can be passed in the request to fetch the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "String - used for pagination. If more results are available `after` field is returned in the response and can be passed in the request to fetch the next page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "nameFilter",
            "in": "query",
            "description": "Optional case-insensitive policy name filter.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Policies fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policies": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "policyId": {
                                "type": "string",
                                "description": "String ID of the policy",
                                "default": "0x1234567890abcdef"
                              },
                              "appId": {
                                "type": "string",
                                "description": "String ID of the app",
                                "default": "0x1234567890abcdef"
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "active",
                                  "inactive",
                                  "pending_approval",
                                  "rejected"
                                ],
                                "description": "Status of the policy."
                              },
                              "rules": {
                                "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
                                "type": "object",
                                "properties": {
                                  "maxSpendUsd": {
                                    "type": "number",
                                    "description": "Maximum amount of USD that can be sponsored",
                                    "default": 5000
                                  },
                                  "maxSpendPerSenderUsd": {
                                    "type": "number",
                                    "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                    "default": 100
                                  },
                                  "maxSpendPerUoUsd": {
                                    "type": "number",
                                    "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                    "default": 20
                                  },
                                  "maxCount": {
                                    "type": "integer",
                                    "description": "Maximum number of userOperations that can be sponsored",
                                    "default": 100
                                  },
                                  "maxCountPerSender": {
                                    "type": "integer",
                                    "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                    "default": 2
                                  },
                                  "senderAllowlist": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "description": "List of addresses that are eligible for sponsorship",
                                    "default": [
                                      "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                      "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                    ]
                                  },
                                  "senderBlocklist": {
                                    "type": "array",
                                    "items": {
                                      "type": "string"
                                    },
                                    "description": "List of addresses that are banned from receiving sponsorship"
                                  },
                                  "startTimeUnix": {
                                    "type": "string",
                                    "description": "Unix timestamp of when the policy starts",
                                    "default": "1674228753"
                                  },
                                  "endTimeUnix": {
                                    "type": "string",
                                    "description": "Unix timestamp of when the policy ends",
                                    "default": "1679340742"
                                  },
                                  "sponsorshipExpiryMs": {
                                    "type": "string",
                                    "description": "Milliseconds after the sponsorship is issued that it expires",
                                    "default": "600000"
                                  },
                                  "webhookRules": {
                                    "type": "object",
                                    "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                    "properties": {
                                      "webhookUrl": {
                                        "type": "string",
                                        "format": "uri",
                                        "description": "The URL to call to verify sponsorship eligibility.",
                                        "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                      },
                                      "approveOnFailure": {
                                        "type": "boolean",
                                        "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                        "default": false
                                      }
                                    },
                                    "required": [
                                      "webhookUrl",
                                      "approveOnFailure"
                                    ]
                                  }
                                },
                                "required": [
                                  "startTimeUnix"
                                ]
                              },
                              "policyName": {
                                "type": "string",
                                "description": "Name of the policy",
                                "default": "Gas Manager Policy"
                              },
                              "lastUpdatedUnix": {
                                "type": "string",
                                "description": "Unix timestamp of when the policy was last updated",
                                "default": "1674228753"
                              },
                              "policyVersion": {
                                "type": "integer",
                                "description": "Version of the policy",
                                "default": 0
                              },
                              "policyType": {
                                "description": "Type of the policy.",
                                "type": "string",
                                "enum": [
                                  "sponsorship",
                                  "bundler_sponsorship",
                                  "erc20",
                                  "solana"
                                ],
                                "default": "sponsorship"
                              },
                              "policyState": {
                                "type": "string",
                                "description": "State of the policy",
                                "default": "ongoing"
                              },
                              "networks": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                },
                                "description": "List of networks the policy is active on"
                              },
                              "gasPumpId": {
                                "type": "string",
                                "description": "Gas pump id"
                              },
                              "erc20Rules": {
                                "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
                                "allOf": [
                                  {
                                    "type": "object",
                                    "properties": {
                                      "maxSpendUsd": {
                                        "type": "number",
                                        "description": "Maximum amount of USD that can be sponsored",
                                        "default": 5000
                                      },
                                      "maxSpendPerSenderUsd": {
                                        "type": "number",
                                        "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                        "default": 100
                                      },
                                      "maxSpendPerUoUsd": {
                                        "type": "number",
                                        "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                        "default": 20
                                      },
                                      "maxCount": {
                                        "type": "integer",
                                        "description": "Maximum number of userOperations that can be sponsored",
                                        "default": 100
                                      },
                                      "maxCountPerSender": {
                                        "type": "integer",
                                        "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                        "default": 2
                                      },
                                      "senderAllowlist": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        },
                                        "description": "List of addresses that are eligible for sponsorship",
                                        "default": [
                                          "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                          "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                        ]
                                      },
                                      "senderBlocklist": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        },
                                        "description": "List of addresses that are banned from receiving sponsorship"
                                      },
                                      "startTimeUnix": {
                                        "type": "string",
                                        "description": "Unix timestamp of when the policy starts",
                                        "default": "1674228753"
                                      },
                                      "endTimeUnix": {
                                        "type": "string",
                                        "description": "Unix timestamp of when the policy ends",
                                        "default": "1679340742"
                                      },
                                      "sponsorshipExpiryMs": {
                                        "type": "string",
                                        "description": "Milliseconds after the sponsorship is issued that it expires",
                                        "default": "600000"
                                      },
                                      "webhookRules": {
                                        "type": "object",
                                        "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                        "properties": {
                                          "webhookUrl": {
                                            "type": "string",
                                            "format": "uri",
                                            "description": "The URL to call to verify sponsorship eligibility.",
                                            "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                          },
                                          "approveOnFailure": {
                                            "type": "boolean",
                                            "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                            "default": false
                                          }
                                        },
                                        "required": [
                                          "webhookUrl",
                                          "approveOnFailure"
                                        ]
                                      }
                                    },
                                    "required": [
                                      "startTimeUnix"
                                    ]
                                  },
                                  {
                                    "type": "object",
                                    "properties": {
                                      "tokens": {
                                        "type": "array",
                                        "items": {
                                          "type": "object",
                                          "properties": {
                                            "network": {
                                              "type": "string",
                                              "description": "Network of the Erc20 token"
                                            },
                                            "tokenAddress": {
                                              "type": "string",
                                              "description": "Erc20 token contract address"
                                            },
                                            "priceReferenceNetwork": {
                                              "type": "string",
                                              "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                            },
                                            "priceReferenceTokenAddress": {
                                              "type": "string",
                                              "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                            }
                                          },
                                          "required": [
                                            "network",
                                            "tokenAddress"
                                          ]
                                        },
                                        "description": "Erc20 tokens allowed under this policy."
                                      },
                                      "recipientAddress": {
                                        "type": "string",
                                        "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                                      },
                                      "usePostOp": {
                                        "type": "boolean",
                                        "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                                      },
                                      "priceMultiplier": {
                                        "type": "number",
                                        "default": 1,
                                        "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                                      }
                                    },
                                    "required": [
                                      "tokens",
                                      "recipientAddress",
                                      "usePostOp"
                                    ]
                                  }
                                ]
                              },
                              "solanaRules": {
                                "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
                                "type": "object",
                                "properties": {
                                  "maxSpendUsd": {
                                    "type": "number",
                                    "description": "Maximum amount of USD that can be sponsored",
                                    "default": 6500
                                  },
                                  "maxSpendPerTxnUsd": {
                                    "type": "number",
                                    "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                                    "default": 30
                                  },
                                  "maxCount": {
                                    "type": "integer",
                                    "description": "Maximum number of transactions that can be sponsored",
                                    "default": 200
                                  },
                                  "startTimeUnix": {
                                    "type": "string",
                                    "description": "Unix timestamp of when the policy starts",
                                    "default": "1674228753"
                                  },
                                  "endTimeUnix": {
                                    "type": "string",
                                    "description": "Unix timestamp of when the policy ends",
                                    "default": "1679340742"
                                  }
                                },
                                "required": [
                                  "startTimeUnix"
                                ]
                              }
                            },
                            "required": [
                              "policyId",
                              "appId",
                              "status"
                            ]
                          }
                        },
                        "before": {
                          "type": "string",
                          "description": "String - used for pagination. If there are previous results, `before` field is returned in the response and can be passed in the request to fetch the previous page. Can be null if there are no previous results. Can be null if there are no previous results."
                        },
                        "after": {
                          "type": "string",
                          "description": "String - used for pagination. If more results are available `after` field is returned in the response and can be passed in the request to fetch the next page. Can be null if there are no more results."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}/status": {
      "put": {
        "summary": "Update Policy Status",
        "description": "Modifies the status of a policy to either \"active\" or \"inactive\".\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "update-policy-status",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy to be updated",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "description": "The new status of the policy",
                    "type": "string",
                    "enum": [
                      "active",
                      "inactive"
                    ],
                    "default": "active"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Policy status updated successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policy": {
                          "type": "object",
                          "properties": {
                            "policyId": {
                              "type": "string",
                              "description": "String ID of the policy",
                              "default": "0x1234567890abcdef"
                            },
                            "appId": {
                              "type": "string",
                              "description": "String ID of the app",
                              "default": "0x1234567890abcdef"
                            },
                            "status": {
                              "type": "string",
                              "enum": [
                                "active",
                                "inactive",
                                "pending_approval",
                                "rejected"
                              ],
                              "description": "Status of the policy."
                            },
                            "rules": {
                              "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 5000
                                },
                                "maxSpendPerSenderUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                  "default": 100
                                },
                                "maxSpendPerUoUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                  "default": 20
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored",
                                  "default": 100
                                },
                                "maxCountPerSender": {
                                  "type": "integer",
                                  "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                  "default": 2
                                },
                                "senderAllowlist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are eligible for sponsorship",
                                  "default": [
                                    "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                    "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                  ]
                                },
                                "senderBlocklist": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  },
                                  "description": "List of addresses that are banned from receiving sponsorship"
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                },
                                "sponsorshipExpiryMs": {
                                  "type": "string",
                                  "description": "Milliseconds after the sponsorship is issued that it expires",
                                  "default": "600000"
                                },
                                "webhookRules": {
                                  "type": "object",
                                  "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                  "properties": {
                                    "webhookUrl": {
                                      "type": "string",
                                      "format": "uri",
                                      "description": "The URL to call to verify sponsorship eligibility.",
                                      "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                    },
                                    "approveOnFailure": {
                                      "type": "boolean",
                                      "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                      "default": false
                                    }
                                  },
                                  "required": [
                                    "webhookUrl",
                                    "approveOnFailure"
                                  ]
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            },
                            "policyName": {
                              "type": "string",
                              "description": "Name of the policy",
                              "default": "Gas Manager Policy"
                            },
                            "lastUpdatedUnix": {
                              "type": "string",
                              "description": "Unix timestamp of when the policy was last updated",
                              "default": "1674228753"
                            },
                            "policyVersion": {
                              "type": "integer",
                              "description": "Version of the policy",
                              "default": 0
                            },
                            "policyType": {
                              "description": "Type of the policy.",
                              "type": "string",
                              "enum": [
                                "sponsorship",
                                "bundler_sponsorship",
                                "erc20",
                                "solana"
                              ],
                              "default": "sponsorship"
                            },
                            "policyState": {
                              "type": "string",
                              "description": "State of the policy",
                              "default": "ongoing"
                            },
                            "networks": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              },
                              "description": "List of networks the policy is active on"
                            },
                            "gasPumpId": {
                              "type": "string",
                              "description": "Gas pump id"
                            },
                            "erc20Rules": {
                              "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
                              "allOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "maxSpendUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored",
                                      "default": 5000
                                    },
                                    "maxSpendPerSenderUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                                      "default": 100
                                    },
                                    "maxSpendPerUoUsd": {
                                      "type": "number",
                                      "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                                      "default": 20
                                    },
                                    "maxCount": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored",
                                      "default": 100
                                    },
                                    "maxCountPerSender": {
                                      "type": "integer",
                                      "description": "Maximum number of userOperations that can be sponsored for a single sender",
                                      "default": 2
                                    },
                                    "senderAllowlist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are eligible for sponsorship",
                                      "default": [
                                        "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                                        "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                                      ]
                                    },
                                    "senderBlocklist": {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      },
                                      "description": "List of addresses that are banned from receiving sponsorship"
                                    },
                                    "startTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy starts",
                                      "default": "1674228753"
                                    },
                                    "endTimeUnix": {
                                      "type": "string",
                                      "description": "Unix timestamp of when the policy ends",
                                      "default": "1679340742"
                                    },
                                    "sponsorshipExpiryMs": {
                                      "type": "string",
                                      "description": "Milliseconds after the sponsorship is issued that it expires",
                                      "default": "600000"
                                    },
                                    "webhookRules": {
                                      "type": "object",
                                      "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                                      "properties": {
                                        "webhookUrl": {
                                          "type": "string",
                                          "format": "uri",
                                          "description": "The URL to call to verify sponsorship eligibility.",
                                          "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                                        },
                                        "approveOnFailure": {
                                          "type": "boolean",
                                          "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                                          "default": false
                                        }
                                      },
                                      "required": [
                                        "webhookUrl",
                                        "approveOnFailure"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "startTimeUnix"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "tokens": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "network": {
                                            "type": "string",
                                            "description": "Network of the Erc20 token"
                                          },
                                          "tokenAddress": {
                                            "type": "string",
                                            "description": "Erc20 token contract address"
                                          },
                                          "priceReferenceNetwork": {
                                            "type": "string",
                                            "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          },
                                          "priceReferenceTokenAddress": {
                                            "type": "string",
                                            "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                                          }
                                        },
                                        "required": [
                                          "network",
                                          "tokenAddress"
                                        ]
                                      },
                                      "description": "Erc20 tokens allowed under this policy."
                                    },
                                    "recipientAddress": {
                                      "type": "string",
                                      "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                                    },
                                    "usePostOp": {
                                      "type": "boolean",
                                      "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                                    },
                                    "priceMultiplier": {
                                      "type": "number",
                                      "default": 1,
                                      "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                                    }
                                  },
                                  "required": [
                                    "tokens",
                                    "recipientAddress",
                                    "usePostOp"
                                  ]
                                }
                              ]
                            },
                            "solanaRules": {
                              "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
                              "type": "object",
                              "properties": {
                                "maxSpendUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored",
                                  "default": 6500
                                },
                                "maxSpendPerTxnUsd": {
                                  "type": "number",
                                  "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                                  "default": 30
                                },
                                "maxCount": {
                                  "type": "integer",
                                  "description": "Maximum number of transactions that can be sponsored",
                                  "default": 200
                                },
                                "startTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy starts",
                                  "default": "1674228753"
                                },
                                "endTimeUnix": {
                                  "type": "string",
                                  "description": "Unix timestamp of when the policy ends",
                                  "default": "1679340742"
                                }
                              },
                              "required": [
                                "startTimeUnix"
                              ]
                            }
                          },
                          "required": [
                            "policyId",
                            "appId",
                            "status"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}/stats/detailed": {
      "get": {
        "summary": "Get Policy Stats",
        "description": "Returns stats about a policy specified by ID.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "get-policy-stats",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy to be fetched",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Policy stats fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "policyStats": {
                          "type": "object",
                          "properties": {
                            "signaturesMined": {
                              "type": "integer",
                              "default": 0
                            },
                            "signaturesExpired": {
                              "type": "integer",
                              "default": 0
                            },
                            "signaturesPending": {
                              "type": "integer",
                              "default": 0
                            },
                            "usdPending": {
                              "type": "number",
                              "default": 0
                            },
                            "usdMined": {
                              "type": "number",
                              "default": 0
                            }
                          }
                        },
                        "policyNetworkStats": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "network": {
                                "type": "string",
                                "default": "MATIC_MAINNET"
                              },
                              "signaturesMined": {
                                "type": "integer",
                                "default": 0
                              },
                              "signaturesExpired": {
                                "type": "integer",
                                "default": 0
                              },
                              "signaturesPending": {
                                "type": "integer",
                                "default": 0
                              },
                              "usdPending": {
                                "type": "number",
                                "default": 0
                              },
                              "usdMined": {
                                "type": "number",
                                "default": 0
                              },
                              "pendingNativeToken": {
                                "type": "integer",
                                "default": 0
                              },
                              "minedNativeToken": {
                                "type": "integer",
                                "default": 0
                              },
                              "currency": {
                                "type": "string",
                                "default": "ETH"
                              },
                              "erc20Stats": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "tokenAddress": {
                                      "type": "string",
                                      "description": "ERC-20 token contract address."
                                    },
                                    "tokenAmount": {
                                      "type": "string",
                                      "description": "ERC-20 token amount collected for this policy and network."
                                    }
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}/sponsorships": {
      "get": {
        "summary": "Get Sponsorships",
        "description": "Returns a list of sponsorships associated with the specified policy ID. The results are paginated.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. \n</Note>\n",
        "operationId": "get-sponsorships",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "ID of the policy.",
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Limits the number of sponsorships returned.",
            "schema": {
              "type": "integer",
              "default": 15,
              "maximum": 100
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "String - used for pagination. If there are previous results, `before` field is returned in the response and can be passed in the request to fetch the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "String - used for pagination. If more results are available, `after` field is returned in the response and can be passed in the request to fetch the next page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sponsorships fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "before": {
                          "type": "string",
                          "description": "String - used for pagination. If there are previous results, `before` field is returned in the response and can be passed in the request to fetch the previous page. Can be null if there are no previous results."
                        },
                        "after": {
                          "type": "string",
                          "description": "String - used for pagination. If more results are available `after` field is returned in the response and can be passed in the request to fetch the next page. Can be null if there are no more results."
                        },
                        "sponsorships": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "sender": {
                                "type": "string",
                                "description": "Address of the sender."
                              },
                              "grantedAt": {
                                "type": "string",
                                "description": "Unix timestamp of when the sponsorship was granted."
                              },
                              "confirmedTotalUsd": {
                                "type": "number",
                                "description": "Total amount of USD that was sponsored. Can be null if the userOp has not been mined."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "PENDING",
                                  "MINED",
                                  "EXPIRED"
                                ],
                                "description": "Status of the sponsorship. Can be PENDING, MINED or EXPIRED."
                              },
                              "uoHash": {
                                "type": "string",
                                "description": "Hash of the userOperation."
                              },
                              "uoExplorerUrl": {
                                "type": "string",
                                "description": "URL to view the userOperation in a block explorer."
                              },
                              "txnHash": {
                                "type": "string",
                                "description": "Hash of the bundle transaction containing the userOperation. Can be null if not yet mined."
                              },
                              "txnExplorerUrl": {
                                "type": "string",
                                "description": "URL to view the bundle transaction in an explorer. Can be null if not yet mined."
                              },
                              "network": {
                                "type": "string",
                                "description": "Network where the userOperation was submitted."
                              },
                              "tokenAddress": {
                                "type": "string",
                                "description": "ERC-20 token contract address. Present only for ERC-20 sponsorships."
                              },
                              "tokenAmount": {
                                "type": "string",
                                "description": "ERC-20 token amount paid. Present only for ERC-20 sponsorships."
                              }
                            },
                            "required": [
                              "sender",
                              "grantedAt",
                              "status",
                              "uoHash",
                              "uoExplorerUrl",
                              "network"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}/webhookSigningKey": {
      "get": {
        "summary": "Get Webhook Signing Key",
        "description": "Returns the key used to sign the policy's custom rules webhook requests. The key is created the first time you call this endpoint, and Gas Manager starts signing webhook requests for the policy from then on.\n\nEach signed request includes an `X-Alchemy-Signature` header. See [verify webhook requests](/docs/wallets/transactions/sponsor-gas/conditional-sponsorship-rules#verify-webhook-requests).\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. The access token needs Gas Manager read and write access.\n</Note>\n",
        "operationId": "get-webhook-signing-key",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook signing key fetched successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "signingKey": {
                          "type": "string",
                          "description": "Key used to sign the policy's custom rules webhook requests. Keep it secret.",
                          "example": "whsec_dGhpcy1pcy1hbi1leGFtcGxlLWtleS1vbmx5LTAwMDA"
                        }
                      },
                      "required": [
                        "signingKey"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/gasManager/policy/{id}/webhookSigningKey/reset": {
      "post": {
        "summary": "Reset Webhook Signing Key",
        "description": "Replaces the policy's webhook signing key with a new one. Gas Manager signs requests with the new key immediately, and the previous key stops working.\n\n<Note title=\"Header Access Token\">\n  To call this endpoint, you must use your [access token](/docs/how-to-create-access-keys) in the [authorization header](/docs/how-to-use-api-keys-in-http-headers) of the API request. The access token needs Gas Manager read and write access.\n</Note>\n",
        "operationId": "reset-webhook-signing-key",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "description": "ID of the policy.",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "a844e221-3c13-40c6-95db-d2db390e14b5"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook signing key reset successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "signingKey": {
                          "type": "string",
                          "description": "Key used to sign the policy's custom rules webhook requests. Keep it secret.",
                          "example": "whsec_dGhpcy1pcy1hbi1leGFtcGxlLWtleS1vbmx5LTAwMDA"
                        }
                      },
                      "required": [
                        "signingKey"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Erc20Rules": {
        "allOf": [
          {
            "type": "object",
            "properties": {
              "maxSpendUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored",
                "default": 5000
              },
              "maxSpendPerSenderUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                "default": 100
              },
              "maxSpendPerUoUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                "default": 20
              },
              "maxCount": {
                "type": "integer",
                "description": "Maximum number of userOperations that can be sponsored",
                "default": 100
              },
              "maxCountPerSender": {
                "type": "integer",
                "description": "Maximum number of userOperations that can be sponsored for a single sender",
                "default": 2
              },
              "senderAllowlist": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of addresses that are eligible for sponsorship",
                "default": [
                  "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                  "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                ]
              },
              "senderBlocklist": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of addresses that are banned from receiving sponsorship"
              },
              "startTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy starts",
                "default": "1674228753"
              },
              "endTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy ends",
                "default": "1679340742"
              },
              "sponsorshipExpiryMs": {
                "type": "string",
                "description": "Milliseconds after the sponsorship is issued that it expires",
                "default": "600000"
              },
              "webhookRules": {
                "type": "object",
                "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                "properties": {
                  "webhookUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The URL to call to verify sponsorship eligibility.",
                    "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                  },
                  "approveOnFailure": {
                    "type": "boolean",
                    "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                    "default": false
                  }
                },
                "required": [
                  "webhookUrl",
                  "approveOnFailure"
                ]
              }
            },
            "required": [
              "startTimeUnix"
            ]
          },
          {
            "type": "object",
            "properties": {
              "tokens": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "network": {
                      "type": "string",
                      "description": "Network of the Erc20 token"
                    },
                    "tokenAddress": {
                      "type": "string",
                      "description": "Erc20 token contract address"
                    },
                    "priceReferenceNetwork": {
                      "type": "string",
                      "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                    },
                    "priceReferenceTokenAddress": {
                      "type": "string",
                      "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                    }
                  },
                  "required": [
                    "network",
                    "tokenAddress"
                  ]
                },
                "description": "Erc20 tokens allowed under this policy."
              },
              "recipientAddress": {
                "type": "string",
                "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
              },
              "usePostOp": {
                "type": "boolean",
                "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
              },
              "priceMultiplier": {
                "type": "number",
                "default": 1,
                "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
              }
            },
            "required": [
              "tokens",
              "recipientAddress",
              "usePostOp"
            ]
          }
        ]
      },
      "Policy": {
        "type": "object",
        "properties": {
          "policyId": {
            "type": "string",
            "description": "String ID of the policy",
            "default": "0x1234567890abcdef"
          },
          "appId": {
            "type": "string",
            "description": "String ID of the app",
            "default": "0x1234567890abcdef"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "inactive",
              "pending_approval",
              "rejected"
            ],
            "description": "Status of the policy."
          },
          "rules": {
            "description": "Rules for `sponsorship` and `bundler_sponsorship` policy types. Empty if `policyType` is not `sponsorship` or `bundler_sponsorship`.",
            "type": "object",
            "properties": {
              "maxSpendUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored",
                "default": 5000
              },
              "maxSpendPerSenderUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                "default": 100
              },
              "maxSpendPerUoUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                "default": 20
              },
              "maxCount": {
                "type": "integer",
                "description": "Maximum number of userOperations that can be sponsored",
                "default": 100
              },
              "maxCountPerSender": {
                "type": "integer",
                "description": "Maximum number of userOperations that can be sponsored for a single sender",
                "default": 2
              },
              "senderAllowlist": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of addresses that are eligible for sponsorship",
                "default": [
                  "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                  "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                ]
              },
              "senderBlocklist": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "description": "List of addresses that are banned from receiving sponsorship"
              },
              "startTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy starts",
                "default": "1674228753"
              },
              "endTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy ends",
                "default": "1679340742"
              },
              "sponsorshipExpiryMs": {
                "type": "string",
                "description": "Milliseconds after the sponsorship is issued that it expires",
                "default": "600000"
              },
              "webhookRules": {
                "type": "object",
                "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                "properties": {
                  "webhookUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "The URL to call to verify sponsorship eligibility.",
                    "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                  },
                  "approveOnFailure": {
                    "type": "boolean",
                    "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                    "default": false
                  }
                },
                "required": [
                  "webhookUrl",
                  "approveOnFailure"
                ]
              }
            },
            "required": [
              "startTimeUnix"
            ]
          },
          "policyName": {
            "type": "string",
            "description": "Name of the policy",
            "default": "Gas Manager Policy"
          },
          "lastUpdatedUnix": {
            "type": "string",
            "description": "Unix timestamp of when the policy was last updated",
            "default": "1674228753"
          },
          "policyVersion": {
            "type": "integer",
            "description": "Version of the policy",
            "default": 0
          },
          "policyType": {
            "description": "Type of the policy.",
            "type": "string",
            "enum": [
              "sponsorship",
              "bundler_sponsorship",
              "erc20",
              "solana"
            ],
            "default": "sponsorship"
          },
          "policyState": {
            "type": "string",
            "description": "State of the policy",
            "default": "ongoing"
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of networks the policy is active on"
          },
          "gasPumpId": {
            "type": "string",
            "description": "Gas pump id"
          },
          "erc20Rules": {
            "description": "Erc20 rules for policy. Empty if `policyType` is not `erc20`.",
            "allOf": [
              {
                "type": "object",
                "properties": {
                  "maxSpendUsd": {
                    "type": "number",
                    "description": "Maximum amount of USD that can be sponsored",
                    "default": 5000
                  },
                  "maxSpendPerSenderUsd": {
                    "type": "number",
                    "description": "Maximum amount of USD that can be sponsored for a single sender (not enforced on testnets)",
                    "default": 100
                  },
                  "maxSpendPerUoUsd": {
                    "type": "number",
                    "description": "Maximum amount of USD that can be sponsored for a single userOperation (not enforced on testnets)",
                    "default": 20
                  },
                  "maxCount": {
                    "type": "integer",
                    "description": "Maximum number of userOperations that can be sponsored",
                    "default": 100
                  },
                  "maxCountPerSender": {
                    "type": "integer",
                    "description": "Maximum number of userOperations that can be sponsored for a single sender",
                    "default": 2
                  },
                  "senderAllowlist": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of addresses that are eligible for sponsorship",
                    "default": [
                      "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266",
                      "0x70997970c51812dc3a010c7d01b50e0d17dc79c8"
                    ]
                  },
                  "senderBlocklist": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "List of addresses that are banned from receiving sponsorship"
                  },
                  "startTimeUnix": {
                    "type": "string",
                    "description": "Unix timestamp of when the policy starts",
                    "default": "1674228753"
                  },
                  "endTimeUnix": {
                    "type": "string",
                    "description": "Unix timestamp of when the policy ends",
                    "default": "1679340742"
                  },
                  "sponsorshipExpiryMs": {
                    "type": "string",
                    "description": "Milliseconds after the sponsorship is issued that it expires",
                    "default": "600000"
                  },
                  "webhookRules": {
                    "type": "object",
                    "description": "Enable conditional gas sponsorship by making a request to your server to verify sponsorship eligibility",
                    "properties": {
                      "webhookUrl": {
                        "type": "string",
                        "format": "uri",
                        "description": "The URL to call to verify sponsorship eligibility.",
                        "example": "https://dashboard.alchemy.com/gas-manager/policy/create"
                      },
                      "approveOnFailure": {
                        "type": "boolean",
                        "description": "If true, the userOp will be sponsored in the event on an error or timeout.",
                        "default": false
                      }
                    },
                    "required": [
                      "webhookUrl",
                      "approveOnFailure"
                    ]
                  }
                },
                "required": [
                  "startTimeUnix"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "network": {
                          "type": "string",
                          "description": "Network of the Erc20 token"
                        },
                        "tokenAddress": {
                          "type": "string",
                          "description": "Erc20 token contract address"
                        },
                        "priceReferenceNetwork": {
                          "type": "string",
                          "description": "Network of the token used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceTokenAddress` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                        },
                        "priceReferenceTokenAddress": {
                          "type": "string",
                          "description": "Contract address of the token on `priceReferenceNetwork` used as a price reference to calculate an ERC-20 token's conversion rate. Required together with `priceReferenceNetwork` for testnet tokens. For mainnet tokens, omit both fields to use the payment token's supported price, or provide both fields to use a price reference instead. Choose a reference token with the same number of decimals as the payment token."
                        }
                      },
                      "required": [
                        "network",
                        "tokenAddress"
                      ]
                    },
                    "description": "Erc20 tokens allowed under this policy."
                  },
                  "recipientAddress": {
                    "type": "string",
                    "description": "Wallet address that will receive the tokens paid by users. Please ensure that you own this address across all networks enabled under this policy."
                  },
                  "usePostOp": {
                    "type": "boolean",
                    "description": "Erc20 transfer mode\n- [Recommended] True: The user pays for the gas after the userOp execution. Enables the user to allow the paymaster contract to spend the ERC-20 token on their behalf (`approve()`) without a separate tx, improving ux. If the transfer fails, the userOp will revert but you’ll remain liable for the gas costs.\n- False: The user pays for the gas before the userOp execution. Requires the paymaster contract to have allowance onchain before the userOp gets submitted. If the allowance doesn’t exist, the userOp will fail immediately.\n"
                  },
                  "priceMultiplier": {
                    "type": "number",
                    "default": 1,
                    "description": "Adjust the Erc20 amount the user pays. For example:\n- `1.1` means that the user pays 10% more (you monetize gas payments)\n- `0.95` means that the user pays 5% less (you partially sponsor gas)\n"
                  }
                },
                "required": [
                  "tokens",
                  "recipientAddress",
                  "usePostOp"
                ]
              }
            ]
          },
          "solanaRules": {
            "description": "Solana rules for policy. Empty if `policyType` is not `solana`.",
            "type": "object",
            "properties": {
              "maxSpendUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored",
                "default": 6500
              },
              "maxSpendPerTxnUsd": {
                "type": "number",
                "description": "Maximum amount of USD that can be sponsored per transaction (not enforced on testnet)",
                "default": 30
              },
              "maxCount": {
                "type": "integer",
                "description": "Maximum number of transactions that can be sponsored",
                "default": 200
              },
              "startTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy starts",
                "default": "1674228753"
              },
              "endTimeUnix": {
                "type": "string",
                "description": "Unix timestamp of when the policy ends",
                "default": "1679340742"
              }
            },
            "required": [
              "startTimeUnix"
            ]
          }
        },
        "required": [
          "policyId",
          "appId",
          "status"
        ]
      }
    }
  }
}
