{
  "$schema": "http://json-schema.org/draft-04/schema",
  "title": "SignedMessageTemplate",
  "description": "Object representing a signed message or message to be signed",
  "type": "object",
  "allOf": [
    {"oneOf": [
      { "$ref": "Ed25519SignedMessage.json" },
      { "$ref": "Sha256SignedMessage.json" }
    ]},
    { "properties": {
        "message": {
          "description": "Information about the transfer",
          "type": "object",
          "properties": {
            "id": {
              "description": "Transfer ID",
              "$ref": "Iri.json"
            },
            "state": {
              "description": "Transfer state",
              "oneOf": [{
                "$ref": "TransferState.json"
              }, {
                "enum": ["nonexistent"]
              }]
            },
            "token": {
              "description": "Ledger signature of transfer ID and state",
              "$ref": "Base64.json"
            }
          },
          "required": ["id", "state"],
          "additionalProperties": false
        }
      },
      "required": ["message"]
    }
  ]
}
