{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.hoodbuybutton.com/loop/recipient-label-registry-signature.schema.json",
  "title": "The Buy Button Recipient Label Registry Signature",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "schemaVersion",
    "registryUri",
    "registryHash",
    "signatureType",
    "signer",
    "signerRole",
    "signature",
    "typedData"
  ],
  "properties": {
    "$schema": { "const": "https://www.hoodbuybutton.com/loop/recipient-label-registry-signature.schema.json" },
    "schemaVersion": { "const": "1.0.0" },
    "registryUri": { "const": "https://www.hoodbuybutton.com/loop/recipient-label-registry-v1.json" },
    "registryHash": { "type": "string", "pattern": "^0x[0-9a-f]{64}$" },
    "signatureType": { "const": "EIP-712" },
    "signer": { "const": "0xCC37061a1e5B15485B425aeeb7A2bb36F93DA77e" },
    "signerRole": { "const": "public treasury wallet" },
    "signature": { "type": "string", "pattern": "^0x[0-9A-Fa-f]{130}$" },
    "typedData": {
      "type": "object",
      "additionalProperties": false,
      "required": ["types", "primaryType", "domain", "message"],
      "properties": {
        "types": {
          "type": "object",
          "additionalProperties": false,
          "required": ["EIP712Domain", "RecipientLabelRegistry"],
          "properties": {
            "EIP712Domain": {
              "type": "array",
              "minItems": 4,
              "maxItems": 4,
              "prefixItems": [
                { "const": { "name": "name", "type": "string" } },
                { "const": { "name": "version", "type": "string" } },
                { "const": { "name": "chainId", "type": "uint256" } },
                { "const": { "name": "verifyingContract", "type": "address" } }
              ],
              "items": false
            },
            "RecipientLabelRegistry": {
              "type": "array",
              "minItems": 8,
              "maxItems": 8,
              "prefixItems": [
                { "const": { "name": "registryHash", "type": "bytes32" } },
                { "const": { "name": "registryUri", "type": "string" } },
                { "const": { "name": "recordVersion", "type": "uint256" } },
                { "const": { "name": "subjectChainId", "type": "uint256" } },
                { "const": { "name": "subjectContract", "type": "address" } },
                { "const": { "name": "feeCollector", "type": "address" } },
                { "const": { "name": "evidenceTransaction", "type": "bytes32" } },
                { "const": { "name": "issuedAt", "type": "uint64" } }
              ],
              "items": false
            }
          }
        },
        "primaryType": { "const": "RecipientLabelRegistry" },
        "domain": {
          "type": "object",
          "additionalProperties": false,
          "required": ["name", "version", "chainId", "verifyingContract"],
          "properties": {
            "name": { "const": "The Buy Button Recipient Labels" },
            "version": { "const": "1" },
            "chainId": { "const": 4663 },
            "verifyingContract": { "const": "0x0e8720B8cD84F95b4b6696adbFA8063c4B8B94F2" }
          }
        },
        "message": {
          "type": "object",
          "additionalProperties": false,
          "required": ["registryHash", "registryUri", "recordVersion", "subjectChainId", "subjectContract", "feeCollector", "evidenceTransaction", "issuedAt"],
          "properties": {
            "registryHash": { "type": "string", "pattern": "^0x[0-9a-f]{64}$" },
            "registryUri": { "const": "https://www.hoodbuybutton.com/loop/recipient-label-registry-v1.json" },
            "recordVersion": { "const": 1 },
            "subjectChainId": { "const": 4663 },
            "subjectContract": { "const": "0x0e8720B8cD84F95b4b6696adbFA8063c4B8B94F2" },
            "feeCollector": { "const": "0x9eFdC1A8e6E94f16A228e44f3025E1f346EE0417" },
            "evidenceTransaction": { "const": "0xcb54f79efe7ff0696e4d570d701cd8de5376e32306a67ffb29f19908e70f35fd" },
            "issuedAt": { "const": 1787745600 }
          }
        }
      }
    }
  }
}
