{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://capp.local/schemas/capp.solana-payment-request.v1.schema.json",
  "title": "capp.solana-payment-request.v1",
  "type": "object",
  "required": [
    "protocol",
    "requestId",
    "network",
    "genesisHash",
    "recipient",
    "asset",
    "amountAtomic",
    "reference",
    "createdAt",
    "expiresAt",
    "label",
    "message",
    "memo",
    "requestDigest",
    "uri"
  ],
  "properties": {
    "protocol": {
      "const": "capp.solana-payment-request.v1"
    },
    "requestId": {
      "type": "string",
      "pattern": "^[a-zA-Z0-9_.:-]{1,128}$"
    },
    "network": {
      "enum": [
        "devnet",
        "mainnet-beta"
      ]
    },
    "genesisHash": {
      "type": "string",
      "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    },
    "recipient": {
      "type": "string",
      "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    },
    "asset": {
      "$ref": "https://capp.local/schemas/capp.solana-asset.v1.schema.json"
    },
    "amountAtomic": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]{0,19})$",
      "description": "Exact unsigned u64 atomic units. Runtime also enforces <= 18446744073709551615."
    },
    "reference": {
      "type": "string",
      "pattern": "^[1-9A-HJ-NP-Za-km-z]{32,44}$"
    },
    "createdAt": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "expiresAt": {
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "label": {
      "type": "string",
      "maxLength": 80
    },
    "message": {
      "type": "string",
      "maxLength": 160
    },
    "memo": {
      "type": "string",
      "maxLength": 120
    },
    "requestDigest": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "uri": {
      "type": "string",
      "pattern": "^solana:",
      "maxLength": 2048
    }
  },
  "additionalProperties": false
}
