# Lightning Terminal (LiT)

Welcome to the API reference documentation for Lightning Terminal (LiT).

Lightning Terminal (LiT) is a browser-based interface for managing channel liquidity.

## Features

- Visualize your channels and balances
- Perform submarine swaps via the [Lightning Loop](/content/loop/index.html) service
- Classify channels according to your node's operating mode
- Run a single binary that integrates [`loopd`](https://github.com/lightninglabs/loop), [`poold`](https://github.com/lightninglabs/pool) and [`faraday`](https://github.com/lightninglabs/faraday) daemons all in one
- Access a preview release of the Pool UI
- Use Pool to earn sats by opening channels to those needing inbound liquidity

## Usage

Learn how to install, configure, and use LiT by viewing the documentation in the [Builder's Guide](https://docs.lightning.engineering/lightning-network-tools/lightning-terminal/get-lit).

## Summary

This site features the documentation for `litcli` (CLI), and the API documentation for Python and JavaScript clients in order to communicate with a local `litd` instance through gRPC.

## gRPC

The code samples assume that the there is a local `litd` instance running and listening for gRPC connections on port `8443`. `LIT_DIR` will be used as a placeholder to denote the base directory of the `litd` instance. By default, this is `~/.lit` on Linux and `~/Library/Application Support/Lit` on macOS.

At the time of writing this documentation, two things are needed in order to make a gRPC request to an `litd` instance: a TLS/SSL connection and a macaroon used for RPC authentication. The code samples will show how these can be used in order to make a successful, secure, and authenticated gRPC request.

The original `*.proto` files from which the gRPC documentation was generated can be found here:

- [`firewall.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/firewall.proto)
- [`lit-accounts.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-accounts.proto)
- [`lit-autopilot.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-autopilot.proto)
- [`lit-sessions.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-sessions.proto)
- [`lit-status.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-status.proto)
- [`proxy.proto`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/proxy.proto)

## REST

View a listing of all REST URLs on the [REST Endpoints](/content/api-docs/api/lit/rest-endpoints/index.html) page.

The code samples assume that the there is a local `litd` instance running and listening for REST connections on port `8443`. `LIT_DIR` will be used as a placeholder to denote the base directory of the `litd` instance. By default, this is `~/.lit` on Linux and `~/Library/Application Support/Lit` on macOS.

At the time of writing this documentation, two things are needed in order to make an HTTP request to an `litd` instance: a TLS/SSL connection and a macaroon used for RPC authentication. The code samples will show how these can be used in order to make a successful, secure, and authenticated HTTP request.

The original `*.swagger.json` files from which the gRPC documentation was generated can be found here:

- [`firewall.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/firewall.swagger.json)
- [`lit-accounts.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-accounts.swagger.json)
- [`lit-autopilot.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-autopilot.swagger.json)
- [`lit-sessions.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-sessions.swagger.json)
- [`lit-status.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/lit-status.swagger.json)
- [`proxy.swagger.json`](https://github.com/lightninglabs/lightning-terminal/blob/1903010be566cbcf50defe6548e4526569989bd1/litrpc/proxy.swagger.json)

### REST Encoding

**NOTE**: The `byte` field type must be set as the base64 encoded string representation of a raw byte array. Also, any time this must be used in a URL path (ie. `/v1/abc/xyz/{payment_hash}`) the base64 string must be encoded using a [URL and Filename Safe Alphabet](https://tools.ietf.org/html/rfc4648#section-5). This means you must replace `+` with `-`, `/` with `_`, and keep the trailing `=` as is. Url encoding (ie. `%2F`) will not work.

This documentation was [generated automatically](https://github.com/lightninglabs/lightning-api-ng) against commit [`1903010be566cbcf50defe6548e4526569989bd1`](https://github.com/lightninglabs/lightning-terminal/tree/1903010be566cbcf50defe6548e4526569989bd1).
