{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "TokenManagement",
  "description": "Manage an existing token.",
  "type": "object",
  "properties": {
    "token_id": {
      "description": "The id of the token to be managed",
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0,
        "maximum": 255
      },
      "minItems": 32,
      "maxItems": 32
    },
    "update_id": {
      "description": "The update id for this token (used for sequencing)\nEach update id must be one greater than the last",
      "$ref": "#/$defs/Nonce"
    },
    "new_admin": {
      "description": "The new admin address; preserve existing admin if None",
      "anyOf": [
        {
          "$ref": "#/$defs/PublicKeyBytes"
        },
        {
          "type": "null"
        }
      ]
    },
    "mints": {
      "description": "The minter addresses to be added/removed",
      "type": "array",
      "items": {
        "type": "array",
        "prefixItems": [
          {
            "$ref": "#/$defs/AddressChange"
          },
          {
            "$ref": "#/$defs/PublicKeyBytes"
          }
        ],
        "minItems": 2,
        "maxItems": 2
      }
    },
    "user_data": {
      "description": "Arbitrary userdata attached to this transaction",
      "$ref": "#/$defs/UserData"
    }
  },
  "required": [
    "token_id",
    "update_id",
    "mints",
    "user_data"
  ],
  "$defs": {
    "Nonce": {
      "type": "integer",
      "format": "uint64",
      "minimum": 0
    },
    "PublicKeyBytes": {
      "description": "A byte sequence that names an entity on or off the FastSet network,\ndepending on the name of type which stores this value;\ntypically encoded as an Ed25519 public key,\nbut may have other formats including but not limited to:\n(a) Burn Address - a 32-byte string composed of all 0x00 bytes.\nNote: any funds sent to the burn address will be permenantly lost!",
      "type": "array",
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0,
        "maximum": 255
      },
      "minItems": 32,
      "maxItems": 32
    },
    "AddressChange": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "Add": {
              "type": "array",
              "maxItems": 0
            }
          },
          "required": [
            "Add"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "Remove": {
              "type": "array",
              "maxItems": 0
            }
          },
          "required": [
            "Remove"
          ],
          "additionalProperties": false
        }
      ]
    },
    "UserData": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "integer",
        "format": "uint8",
        "minimum": 0,
        "maximum": 255
      },
      "minItems": 32,
      "maxItems": 32
    }
  }
}