{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "htlcs"
  ],
  "properties": {
    "htlcs": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "short_channel_id",
          "id",
          "expiry",
          "direction",
          "amount_msat",
          "payment_hash",
          "state"
        ],
        "properties": {
          "short_channel_id": {
            "type": "short_channel_id",
            "description": "the channel that contains/contained the HTLC"
          },
          "id": {
            "type": "u64",
            "description": "the unique, incrementing HTLC id the creator gave this"
          },
          "expiry": {
            "type": "u32",
            "description": "the block number where this HTLC expires/expired"
          },
          "amount_msat": {
            "type": "msat",
            "description": "the value of the HTLC"
          },
          "direction": {
            "type": "string",
            "enum": [
              "out",
              "in"
            ],
            "description": "out if we offered this to the peer, in if they offered it"
          },
          "payment_hash": {
            "type": "hash",
            "description": "payment hash sought by HTLC"
          },
          "state": {
            "type": "string",
            "enum": [
              "SENT_ADD_HTLC",
              "SENT_ADD_COMMIT",
              "RCVD_ADD_REVOCATION",
              "RCVD_ADD_ACK_COMMIT",
              "SENT_ADD_ACK_REVOCATION",
              "RCVD_REMOVE_HTLC",
              "RCVD_REMOVE_COMMIT",
              "SENT_REMOVE_REVOCATION",
              "SENT_REMOVE_ACK_COMMIT",
              "RCVD_REMOVE_ACK_REVOCATION",
              "RCVD_ADD_HTLC",
              "RCVD_ADD_COMMIT",
              "SENT_ADD_REVOCATION",
              "SENT_ADD_ACK_COMMIT",
              "RCVD_ADD_ACK_REVOCATION",
              "SENT_REMOVE_HTLC",
              "SENT_REMOVE_COMMIT",
              "RCVD_REMOVE_REVOCATION",
              "RCVD_REMOVE_ACK_COMMIT",
              "SENT_REMOVE_ACK_REVOCATION"
            ],
            "description": "The first 10 states are for `in`, the next 10 are for `out`."
          }
        }
      }
    }
  }
}
