{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rsnc-network/json-schema/rsnc-network-relay-request-schema.json",
  "title": "RelayRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rsnc-network-openapi.yml#/components/schemas/RelayRequest",
  "type": "object",
  "required": [
    "to",
    "data",
    "userAddress"
  ],
  "properties": {
    "to": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$",
      "description": "Contract address to call"
    },
    "data": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]+$",
      "description": "Encoded function call data (hex string)"
    },
    "value": {
      "type": "string",
      "default": "0",
      "description": "ETH value to send (in wei)"
    },
    "gasLimit": {
      "type": "integer",
      "description": "Maximum gas limit"
    },
    "userAddress": {
      "type": "string",
      "pattern": "^0x[a-fA-F0-9]{40}$",
      "description": "User's wallet address"
    },
    "metadata": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string"
        },
        "perkId": {
          "type": "string"
        },
        "permit": {
          "$ref": "#/$defs/Permit"
        }
      }
    }
  },
  "$defs": {
    "Permit": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$"
        },
        "spender": {
          "type": "string",
          "pattern": "^0x[a-fA-F0-9]{40}$"
        },
        "value": {
          "type": "string"
        },
        "deadline": {
          "type": "integer"
        },
        "v": {
          "type": "integer"
        },
        "r": {
          "type": "string"
        },
        "s": {
          "type": "string"
        }
      }
    }
  }
}