{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vetrade.vet/schemas/swap-plan-request.schema.json",
  "title": "Swap Plan Request",
  "type": "object",
  "additionalProperties": false,
  "required": ["mode", "inputToken", "outputToken", "amountIn"],
  "properties": {
    "mode": {
      "type": "string",
      "enum": ["quote_only", "wallet_bound"]
    },
    "inputToken": {
      "type": "string",
      "description": "VeChain token address or the zero address for native VET."
    },
    "outputToken": {
      "type": "string",
      "description": "VeChain token address or the zero address for native VET."
    },
    "amountIn": {
      "type": "string",
      "pattern": "^[0-9]+$",
      "description": "Base-unit integer string."
    },
    "slippageBps": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "recipient": {
      "type": "string",
      "description": "Required when mode is wallet_bound."
    },
    "routing": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "maxHops": {
          "type": "integer",
          "minimum": 1,
          "maximum": 5
        },
        "maxSplits": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        }
      }
    },
    "include": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "simulation": {
          "type": "boolean"
        }
      }
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "mode": {
            "const": "wallet_bound"
          }
        }
      },
      "then": {
        "required": ["recipient"]
      }
    }
  ]
}
