{
  "$comment": "SPDX-License-Identifier: MIT",
  "$id": "https://spec.vaultfire.local/v3-open/1.0.0/signed-terms.v1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "canonicalization": {
      "const": "RFC8785-repository-subset-v1"
    },
    "domain": {
      "additionalProperties": false,
      "properties": {
        "chainId": {
          "enum": [
            "8453",
            "84532"
          ]
        },
        "name": {
          "const": "Vaultfire"
        },
        "verifyingContract": {
          "pattern": "^0x[0-9a-f]{40}$",
          "type": "string"
        },
        "version": {
          "const": "3.0.0"
        }
      },
      "required": [
        "name",
        "version",
        "chainId",
        "verifyingContract"
      ],
      "type": "object"
    },
    "nonce": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "nonceConsumed": {
      "const": false
    },
    "observedAt": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "replayScope": {
      "const": "chain-contract-party-nonce"
    },
    "schema": {
      "const": "vaultfire.v3.open.signed-terms.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "signaturePolicy": {
      "const": "eip712-low-s-v27-28-recover-exact-consent-parties"
    },
    "signatures": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "signature": {
            "pattern": "^0x[0-9a-f]{130}$",
            "type": "string"
          },
          "signer": {
            "pattern": "^0x[0-9a-f]{40}$",
            "type": "string"
          }
        },
        "required": [
          "signer",
          "signature"
        ],
        "type": "object"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array",
      "uniqueItems": true
    },
    "termsDigest": {
      "pattern": "^0x[0-9a-f]{64}$",
      "type": "string"
    },
    "termsSchema": {
      "const": "vaultfire.v3.open.bond-definition.v1"
    },
    "validAfter": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "validBefore": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "termsSchema",
    "domain",
    "termsDigest",
    "nonce",
    "validAfter",
    "validBefore",
    "observedAt",
    "nonceConsumed",
    "replayScope",
    "signatures",
    "signaturePolicy",
    "canonicalization"
  ],
  "type": "object"
}
