{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/overwing-ai/json-schema/overwing-ai-preflight-request-schema.json",
  "title": "PreflightRequest",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/overwing-ai-openapi.json#/components/schemas/PreflightRequest",
  "type": "object",
  "required": [
    "transaction",
    "policy"
  ],
  "properties": {
    "transaction": {
      "type": "string",
      "maxLength": 2000,
      "description": "The serialized Solana transaction in base64, legacy or v0, signed or not. Signatures are ignored"
    },
    "policy": {
      "type": "object",
      "required": [
        "wallet"
      ],
      "additionalProperties": false,
      "properties": {
        "wallet": {
          "type": "string",
          "description": "The address to protect. It must sign the transaction"
        },
        "max_sol_out": {
          "type": "number",
          "minimum": 0,
          "description": "Required unless max_sol_out_lamports is given. The most SOL the transaction may take from the wallet, fees included"
        },
        "max_sol_out_lamports": {
          "type": [
            "integer",
            "string"
          ],
          "description": "The same limit as a whole number of lamports"
        },
        "max_token_out": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "integer",
              "string"
            ]
          },
          "description": "Atomic units that may leave, by mint. A mint not listed may not leave at all"
        },
        "min_token_in": {
          "type": "object",
          "additionalProperties": {
            "type": [
              "integer",
              "string"
            ]
          },
          "description": "Atomic units that must arrive, by mint"
        },
        "allowed_programs": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "When given, every program the transaction runs, top-level or inner, must be listed"
        },
        "allow_delegation": {
          "type": "boolean",
          "default": false,
          "description": "Whether a spending approval on the wallet's token accounts is acceptable"
        }
      }
    }
  }
}