{
  "$comment": "SPDX-License-Identifier: MIT",
  "$id": "https://spec.vaultfire.local/v3-open/1.0.0/mutual-settlement.v1.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "authorizationDigest": {
      "pattern": "^0x[0-9a-f]{64}$",
      "type": "string"
    },
    "bond": {
      "pattern": "^0x[0-9a-f]{40}$",
      "type": "string"
    },
    "bondId": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "chainId": {
      "enum": [
        "8453",
        "84532"
      ]
    },
    "consentingParties": {
      "items": {
        "pattern": "^0x[0-9a-f]{40}$",
        "type": "string"
      },
      "maxItems": 2,
      "minItems": 2,
      "type": "array",
      "uniqueItems": true
    },
    "deadline": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "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"
    },
    "fundedPrincipal": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "nonce": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "nonceConsumed": {
      "const": false
    },
    "observedAt": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "partyAAmount": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "partyBAmount": {
      "pattern": "^(0|[1-9][0-9]*)$",
      "type": "string"
    },
    "protocolVersion": {
      "const": "3.0.0"
    },
    "schema": {
      "const": "vaultfire.v3.open.mutual-settlement.v1"
    },
    "schemaVersion": {
      "const": "1.0.0"
    },
    "termsHash": {
      "pattern": "^0x[0-9a-f]{64}$",
      "type": "string"
    }
  },
  "required": [
    "schema",
    "schemaVersion",
    "protocolVersion",
    "domain",
    "bond",
    "chainId",
    "bondId",
    "termsHash",
    "partyAAmount",
    "partyBAmount",
    "fundedPrincipal",
    "nonce",
    "nonceConsumed",
    "deadline",
    "observedAt",
    "consentingParties",
    "authorizationDigest"
  ],
  "type": "object"
}
