{
  "swagger": "2.0",
  "info": {
    "title": "wtclientrpc/wtclient.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "WatchtowerClient"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/v2/watchtower/client": {
      "get": {
        "summary": "lncli: `wtclient towers`\nListTowers returns the list of watchtowers registered with the client.",
        "operationId": "WatchtowerClient_ListTowers",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcListTowersResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "include_sessions",
            "description": "Whether we should include sessions with the watchtower in the response.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "exclude_exhausted_sessions",
            "description": "Whether to exclude exhausted sessions in the response info. This option\nis only meaningful if include_sessions is true.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      },
      "post": {
        "summary": "lncli: `wtclient add`\nAddTower adds a new watchtower reachable at the given address and\nconsiders it for new sessions. If the watchtower already exists, then\nany new addresses included will be considered when dialing it for\nsession negotiations and backups.",
        "operationId": "WatchtowerClient_AddTower",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcAddTowerResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/wtclientrpcAddTowerRequest"
            }
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/info/{pubkey}": {
      "get": {
        "summary": "lncli: `wtclient tower`\nGetTowerInfo retrieves information for a registered watchtower.",
        "operationId": "WatchtowerClient_GetTowerInfo",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcTower"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pubkey",
            "description": "The identifying public key of the watchtower to retrieve information for.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "byte"
          },
          {
            "name": "include_sessions",
            "description": "Whether we should include sessions with the watchtower in the response.",
            "in": "query",
            "required": false,
            "type": "boolean"
          },
          {
            "name": "exclude_exhausted_sessions",
            "description": "Whether to exclude exhausted sessions in the response info. This option\nis only meaningful if include_sessions is true.",
            "in": "query",
            "required": false,
            "type": "boolean"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/policy": {
      "get": {
        "summary": "lncli: `wtclient policy`\nPolicy returns the active watchtower client policy configuration.",
        "operationId": "WatchtowerClient_Policy",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcPolicyResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "policy_type",
            "description": "The client type from which to retrieve the active offering policy.\n\n - LEGACY: Selects the policy from the legacy tower client.\n - ANCHOR: Selects the policy from the anchor tower client.\n - TAPROOT: Selects the policy from the taproot tower client.",
            "in": "query",
            "required": false,
            "type": "string",
            "enum": [
              "LEGACY",
              "ANCHOR",
              "TAPROOT"
            ],
            "default": "LEGACY"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/sessions/terminate/{session_id}": {
      "post": {
        "summary": "lncli: `wtclient session terminate`\nTerminate terminates the given session and marks it as terminal so that\nit is not used for backups anymore.",
        "operationId": "WatchtowerClient_TerminateSession",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcTerminateSessionResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "session_id",
            "description": "The ID of the session that should be terminated.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "byte"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/stats": {
      "get": {
        "summary": "lncli: `wtclient stats`\nStats returns the in-memory statistics of the client since startup.",
        "operationId": "WatchtowerClient_Stats",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcStatsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/tower/deactivate/{pubkey}": {
      "post": {
        "summary": "lncli: `wtclient deactivate`\nDeactivateTower sets the given tower's status to inactive so that it\nis not considered for session negotiation. Its sessions will also not\nbe used while the tower is inactive.",
        "operationId": "WatchtowerClient_DeactivateTower",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcDeactivateTowerResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pubkey",
            "description": "The identifying public key of the watchtower to deactivate.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "byte"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    },
    "/v2/watchtower/client/{pubkey}": {
      "delete": {
        "summary": "lncli: `wtclient remove`\nRemoveTower removes a watchtower from being considered for future session\nnegotiations and from being used for any subsequent backups until it's added\nagain. If an address is provided, then this RPC only serves as a way of\nremoving the address from the watchtower instead.",
        "operationId": "WatchtowerClient_RemoveTower",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/wtclientrpcRemoveTowerResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "pubkey",
            "description": "The identifying public key of the watchtower to remove.",
            "in": "path",
            "required": true,
            "type": "string",
            "format": "byte"
          },
          {
            "name": "address",
            "description": "If set, then the record for this address will be removed, indicating that is\nis stale. Otherwise, the watchtower will no longer be used for future\nsession negotiations and backups.",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "WatchtowerClient"
        ]
      }
    }
  },
  "definitions": {
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "wtclientrpcAddTowerRequest": {
      "type": "object",
      "properties": {
        "pubkey": {
          "type": "string",
          "format": "byte",
          "description": "The identifying public key of the watchtower to add."
        },
        "address": {
          "type": "string",
          "description": "A network address the watchtower is reachable over."
        }
      }
    },
    "wtclientrpcAddTowerResponse": {
      "type": "object"
    },
    "wtclientrpcDeactivateTowerResponse": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "A string describing the action that took place."
        }
      }
    },
    "wtclientrpcListTowersResponse": {
      "type": "object",
      "properties": {
        "towers": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/wtclientrpcTower"
          },
          "description": "The list of watchtowers available for new backups."
        }
      }
    },
    "wtclientrpcPolicyResponse": {
      "type": "object",
      "properties": {
        "max_updates": {
          "type": "integer",
          "format": "int64",
          "description": "The maximum number of updates each session we negotiate with watchtowers\nshould allow."
        },
        "sweep_sat_per_byte": {
          "type": "integer",
          "format": "int64",
          "description": "Deprecated, use sweep_sat_per_vbyte.\nThe fee rate, in satoshis per vbyte, that will be used by watchtowers for\njustice transactions in response to channel breaches."
        },
        "sweep_sat_per_vbyte": {
          "type": "integer",
          "format": "int64",
          "description": "The fee rate, in satoshis per vbyte, that will be used by watchtowers for\njustice transactions in response to channel breaches."
        }
      }
    },
    "wtclientrpcPolicyType": {
      "type": "string",
      "enum": [
        "LEGACY",
        "ANCHOR",
        "TAPROOT"
      ],
      "default": "LEGACY",
      "description": " - LEGACY: Selects the policy from the legacy tower client.\n - ANCHOR: Selects the policy from the anchor tower client.\n - TAPROOT: Selects the policy from the taproot tower client."
    },
    "wtclientrpcRemoveTowerResponse": {
      "type": "object"
    },
    "wtclientrpcStatsResponse": {
      "type": "object",
      "properties": {
        "num_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of backups made to all active and exhausted watchtower\nsessions."
        },
        "num_pending_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of backups that are pending to be acknowledged by all\nactive and exhausted watchtower sessions."
        },
        "num_failed_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of backups that all active and exhausted watchtower\nsessions have failed to acknowledge."
        },
        "num_sessions_acquired": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of new sessions made to watchtowers."
        },
        "num_sessions_exhausted": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of watchtower sessions that have been exhausted."
        }
      }
    },
    "wtclientrpcTerminateSessionResponse": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "A string describing the action that took place."
        }
      }
    },
    "wtclientrpcTower": {
      "type": "object",
      "properties": {
        "pubkey": {
          "type": "string",
          "format": "byte",
          "description": "The identifying public key of the watchtower."
        },
        "addresses": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The list of addresses the watchtower is reachable over."
        },
        "active_session_candidate": {
          "type": "boolean",
          "description": "Deprecated, use the active_session_candidate field under the\ncorrect identifier in the client_type map.\nWhether the watchtower is currently a candidate for new sessions."
        },
        "num_sessions": {
          "type": "integer",
          "format": "int64",
          "description": "Deprecated, use the num_sessions field under the correct identifier\nin the client_type map.\nThe number of sessions that have been negotiated with the watchtower."
        },
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/wtclientrpcTowerSession"
          },
          "description": "Deprecated, use the sessions field under the correct identifier in the\nclient_type map.\nThe list of sessions that have been negotiated with the watchtower."
        },
        "session_info": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/wtclientrpcTowerSessionInfo"
          },
          "description": "A list sessions held with the tower."
        }
      }
    },
    "wtclientrpcTowerSession": {
      "type": "object",
      "properties": {
        "num_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of successful backups that have been made to the\nwatchtower session."
        },
        "num_pending_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The total number of backups in the session that are currently pending to be\nacknowledged by the watchtower."
        },
        "max_backups": {
          "type": "integer",
          "format": "int64",
          "description": "The maximum number of backups allowed by the watchtower session."
        },
        "sweep_sat_per_byte": {
          "type": "integer",
          "format": "int64",
          "description": "Deprecated, use sweep_sat_per_vbyte.\nThe fee rate, in satoshis per vbyte, that will be used by the watchtower for\nthe justice transaction in the event of a channel breach."
        },
        "sweep_sat_per_vbyte": {
          "type": "integer",
          "format": "int64",
          "description": "The fee rate, in satoshis per vbyte, that will be used by the watchtower for\nthe justice transaction in the event of a channel breach."
        },
        "id": {
          "type": "string",
          "format": "byte",
          "description": "The ID of the session."
        }
      }
    },
    "wtclientrpcTowerSessionInfo": {
      "type": "object",
      "properties": {
        "active_session_candidate": {
          "type": "boolean",
          "description": "Whether the watchtower is currently a candidate for new sessions."
        },
        "num_sessions": {
          "type": "integer",
          "format": "int64",
          "description": "The number of sessions that have been negotiated with the watchtower."
        },
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/wtclientrpcTowerSession"
          },
          "description": "The list of sessions that have been negotiated with the watchtower."
        },
        "policy_type": {
          "$ref": "#/definitions/wtclientrpcPolicyType",
          "description": "The session's policy type."
        }
      }
    }
  }
}
