{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gulltoppr-dev/json-schema/gulltoppr-dev-simulate-body-schema.json",
  "title": "SimulateBody",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gulltoppr-dev-openapi.json#/components/schemas/SimulateBody",
  "oneOf": [
    {
      "type": "object",
      "required": [
        "from",
        "to",
        "data"
      ],
      "not": {
        "anyOf": [
          {
            "required": [
              "address"
            ]
          },
          {
            "required": [
              "function"
            ]
          },
          {
            "required": [
              "args"
            ]
          }
        ]
      },
      "properties": {
        "from": {
          "$ref": "#/$defs/Address"
        },
        "to": {
          "$ref": "#/$defs/Address"
        },
        "data": {
          "$ref": "#/$defs/Calldata"
        },
        "value": {
          "$ref": "#/$defs/DecimalWei"
        }
      }
    },
    {
      "type": "object",
      "required": [
        "from",
        "address",
        "function"
      ],
      "not": {
        "anyOf": [
          {
            "required": [
              "to"
            ]
          },
          {
            "required": [
              "data"
            ]
          }
        ]
      },
      "properties": {
        "from": {
          "$ref": "#/$defs/Address"
        },
        "address": {
          "$ref": "#/$defs/Address"
        },
        "function": {
          "$ref": "#/$defs/FunctionName"
        },
        "args": {
          "type": "array",
          "items": true,
          "default": []
        },
        "value": {
          "$ref": "#/$defs/DecimalWei"
        }
      }
    }
  ],
  "$defs": {
    "Address": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "Calldata": {
      "type": "string",
      "pattern": "^0x([0-9a-fA-F]{2})*$"
    },
    "DecimalWei": {
      "type": "string",
      "pattern": "^\\d+$",
      "description": "Native value in wei, decimal string."
    },
    "FunctionName": {
      "type": "string",
      "minLength": 1,
      "pattern": "\\S"
    }
  }
}