├── .prettierignore ├── .gitignore ├── starttor.sh ├── src ├── views │ ├── index.handlebars │ └── layouts │ │ └── main.handlebars ├── routes │ ├── health │ │ └── index.ts │ └── well-known │ │ └── index.ts ├── shared │ ├── logger │ │ └── index.ts │ └── lnd │ │ ├── api.ts │ │ └── types.ts └── server.ts ├── entrypoint.sh ├── env.sample ├── .prettierrc ├── docker-compose.yaml ├── healthcheck.sh ├── .vscode └── settings.json ├── .editorconfig ├── render.yaml ├── tsconfig.json ├── Dockerfile ├── package.json └── README.md /.prettierignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | logs 3 | .DS_Store 4 | 5 | .env 6 | 7 | yarn-error.log -------------------------------------------------------------------------------- /starttor.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Starting Tor" 4 | 5 | # Run TOR 6 | exec su-exec tor tor 7 | -------------------------------------------------------------------------------- /src/views/index.handlebars: -------------------------------------------------------------------------------- 1 |

2 | sats@{{domain}} 3 |

4 | 5 |

My Lightning Address

-------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Run TOR 4 | exec ./starttor.sh & 5 | 6 | # Start Lightnging Address Server 7 | yarn dev -------------------------------------------------------------------------------- /env.sample: -------------------------------------------------------------------------------- 1 | LNADDR_LND_REST_BASE_URL=https://xxxx.onion:8080 2 | LNADDR_LND_REST_MACAROON_HEX=HEX_KEY 3 | 4 | LNADDR_DOMAIN=fatbear.me -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "singleQuote": true, 4 | "trailingComma": "none", 5 | "useTabs": false, 6 | "importOrder": [], 7 | "importOrderSeparation": true 8 | } 9 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | 2 | version: "3.7" 3 | 4 | services: 5 | lnaddr: 6 | build: ./ 7 | restart: always 8 | ports: 9 | - '3000:3000' 10 | env_file: 11 | - .env 12 | -------------------------------------------------------------------------------- /healthcheck.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # TOR 4 | curl -s --socks5 127.0.0.1:9050 'https://check.torproject.org/' | grep -qm1 Congratulations 5 | 6 | # Start Lightnging Address Server 7 | curl 'http://127.0.0.1:3000/healthz' -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "Fatbear", 4 | "healthz", 5 | "LNADDR", 6 | "LND", 7 | "Lnrpc", 8 | "lnurlp", 9 | "msat", 10 | "Sats", 11 | "Umbrel" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | indent_size = 2 6 | indent_style = space 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | ij_typescript_force_quote_style = true 10 | ij_typescript_use_double_quotes = false -------------------------------------------------------------------------------- /render.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | # A Docker web service 3 | - type: web 4 | name: lnaddr 5 | env: docker 6 | repo: https://github.com/mefatbear/lightning-address-nodejs.git 7 | plan: free 8 | healthCheckPath: /healthz 9 | envVars: 10 | - key: LNADDR_LND_REST_BASE_URL 11 | sync: false 12 | - key: LNADDR_LND_REST_MACAROON_HEX 13 | sync: false 14 | - key: LNADDR_DOMAIN 15 | sync: false -------------------------------------------------------------------------------- /src/routes/health/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | 3 | const router = Router(); 4 | 5 | router.get('/', (_request, res) => { 6 | res.setHeader('Surrogate-Control', 'no-store'); 7 | res.setHeader('Cache-Control', 'no-store, no-cache, must-revalidate, proxy-revalidate'); 8 | res.setHeader('Pragma', 'no-cache'); 9 | res.setHeader('Expires', '0'); 10 | 11 | return res.status(200).send('OK') 12 | }); 13 | 14 | export { router as health }; 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "exclude": ["node_modules", "**/*.spec.ts", "*.js", "dist"], 3 | "include": ["./src", "./types"], 4 | "compilerOptions": { 5 | "lib": ["es2020"], 6 | "paths": { 7 | "*": ["./types/*"], 8 | "@shared": ["./src/shared/*"] 9 | }, 10 | "module": "commonjs", 11 | "outDir": "dist", 12 | "strict": true, 13 | "target": "es2020", 14 | "baseUrl": ".", 15 | "noUnusedLocals": false, 16 | "esModuleInterop": true, 17 | "moduleResolution": "node", 18 | "strictNullChecks": true, 19 | "resolveJsonModule": true 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16.13.0-alpine3.13 2 | 3 | ARG NODE_ENV=development 4 | ENV NODE_ENV $NODE_ENV 5 | ENV PORT 3000 6 | 7 | RUN apk add --no-cache su-exec curl tor && \ 8 | sed "1s/^/SocksPort 127.0.0.1:9050\n/" /etc/tor/torrc.sample > /etc/tor/torrc 9 | 10 | WORKDIR /app 11 | 12 | COPY package.json yarn.lock entrypoint.sh healthcheck.sh ./ 13 | RUN ls -lah 14 | RUN yarn install 15 | 16 | COPY . . 17 | 18 | EXPOSE 9050 3000 19 | 20 | # Health Checks 21 | HEALTHCHECK --interval=60s --timeout=15s --start-period=20s \ 22 | CMD ./healthcheck.sh 23 | 24 | VOLUME ["/var/lib/tor"] 25 | 26 | CMD [ "yarn", "entrypoint" ] -------------------------------------------------------------------------------- /src/views/layouts/main.handlebars: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | My Lightning Address 5 | 11 | 12 | 13 |
14 |
15 | {{{body}}} 16 |
17 | 18 | 22 | 23 | -------------------------------------------------------------------------------- /src/shared/logger/index.ts: -------------------------------------------------------------------------------- 1 | import { createLogger, format, transports } from 'winston'; 2 | 3 | // Import Functions 4 | const { File, Console } = transports; 5 | 6 | // Init Logger 7 | const logger = createLogger({ 8 | level: 'info', 9 | format: format.json() 10 | }); 11 | 12 | const fileFormat = format.combine(format.timestamp(), format.json()); 13 | const errTransport = new File({ 14 | filename: './logs/error.log', 15 | format: fileFormat, 16 | level: 'error' 17 | }); 18 | const infoTransport = new File({ 19 | filename: './logs/combined.log', 20 | format: fileFormat 21 | }); 22 | const debugTransport = new File({ 23 | filename: './logs/debug.log', 24 | format: fileFormat, 25 | level: 'debug' 26 | }); 27 | 28 | logger.add(errTransport); 29 | logger.add(debugTransport); 30 | logger.add(infoTransport); 31 | 32 | if (process.env.NODE_ENV !== 'production') { 33 | const consoleTransport = new Console({ 34 | format: format.combine(format.colorize(), format.simple()), 35 | level: 'debug' 36 | }); 37 | logger.add(consoleTransport); 38 | } 39 | 40 | export default logger; 41 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lightning-address-nodejs", 3 | "version": "1.0.0", 4 | "description": "Lightning Address Server", 5 | "main": "src/server.ts", 6 | "repository": "https://github.com/mefatbear/lightning-address-nodejs", 7 | "author": "@MeFatBear", 8 | "license": "MIT", 9 | "private": false, 10 | "scripts": { 11 | "build": "tsc", 12 | "dev": "ts-node -r tsconfig-paths/register --files src/server.ts", 13 | "entrypoint": "./entrypoint.sh" 14 | }, 15 | "devDependencies": { 16 | "@types/express": "^4.17.13", 17 | "@types/morgan": "^1.9.3", 18 | "@types/node": "^16.11.10", 19 | "eslint": "^8.3.0", 20 | "eslint-config-next": "^12.0.4", 21 | "husky": "^4.3.0", 22 | "lint-staged": "^12.1.2", 23 | "postcss": "^8.4.1", 24 | "prettier": "^2.4.1", 25 | "prettier-plugin-sort-imports": "^1.0.1", 26 | "pretty-quick": "^3.1.2", 27 | "ts-node": "^10.4.0", 28 | "ts-node-dev": "^1.1.8", 29 | "typescript": "^4.5.2" 30 | }, 31 | "husky": { 32 | "hooks": { 33 | "pre-commit": "pretty-quick --staged" 34 | } 35 | }, 36 | "dependencies": { 37 | "axios": "^0.24.0", 38 | "express": "^4.17.1", 39 | "express-handlebars": "^6.0.2", 40 | "helmet": "^4.6.0", 41 | "morgan": "^1.10.0", 42 | "node-fetch": "^3.1.0", 43 | "socks-proxy-agent": "^6.1.1", 44 | "winston": "^3.3.3" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/server.ts: -------------------------------------------------------------------------------- 1 | import { engine } from 'express-handlebars'; 2 | import express from 'express'; 3 | import helmet from 'helmet'; 4 | import morgan from 'morgan'; 5 | 6 | import { wellknown } from './routes/well-known'; 7 | import { health } from './routes/health'; 8 | import logger from './shared/logger'; 9 | 10 | const PORT = process.env.PORT || 3000; 11 | const NODE_ENV = process.env.NODE_ENV || 'development'; 12 | 13 | const app = express(); 14 | 15 | // Security Middleware 16 | app.use(helmet()); 17 | 18 | // Remove Express X-Powered-By headers 19 | app.disable('x-powered-by'); 20 | 21 | app.engine('handlebars', engine()); 22 | app.set('view engine', 'handlebars'); 23 | app.set('views', __dirname + '/views'); 24 | 25 | // Logger 26 | app.use( 27 | morgan('common', { 28 | stream: { 29 | write: (message) => logger.info(message.trim()) 30 | } 31 | }) 32 | ); 33 | 34 | // Error 35 | app.on('error', (err) => { 36 | logger.error('server error', err); 37 | }); 38 | 39 | // Welcome Screen 40 | app.get('/', function (req, res) { 41 | res.render('index', { 42 | domain: process.env.LNADDR_DOMAIN 43 | }); 44 | }); 45 | 46 | // Health Route 47 | app.use('/healthz', health); 48 | 49 | // Lightning Address 50 | app.use('/.well-known', wellknown); 51 | 52 | // Start Server 53 | app.listen(PORT, () => { 54 | logger.info(`Lightning Address Server listening on port ${PORT} in ${NODE_ENV} mode`); 55 | }); 56 | -------------------------------------------------------------------------------- /src/routes/well-known/index.ts: -------------------------------------------------------------------------------- 1 | import { Router } from 'express'; 2 | import crypto from 'crypto'; 3 | 4 | import { lightningApi } from '../../shared/lnd/api'; 5 | import logger from '../../shared/logger'; 6 | 7 | const DOMAIN = process.env.LNADDR_DOMAIN; 8 | 9 | const router = Router(); 10 | 11 | if (!DOMAIN) { 12 | throw new Error('Missing LNADDR_DOMAIN env variable'); 13 | } 14 | 15 | router.get('/lnurlp/:username', async (req, res) => { 16 | const username = req.params.username; 17 | 18 | logger.info('Lightning Address Request', req.params); 19 | 20 | if (!username) { 21 | return res.status(404).send('Username not found'); 22 | } 23 | 24 | const identifier = `https://${DOMAIN}/.well-known/lnurlp/${username}`; 25 | const metadata = [ 26 | ['text/identifier', identifier], 27 | ['text/plain', `Sats for ${username}!`] 28 | ]; 29 | 30 | if (req.query.amount) { 31 | const msat = req.query.amount; 32 | 33 | try { 34 | logger.debug('Generating LND Invoice'); 35 | const invoice = await lightningApi.lightningAddInvoice({ 36 | value_msat: msat as string, 37 | description_hash: crypto 38 | .createHash('sha256') 39 | .update(JSON.stringify(metadata)) 40 | .digest('base64') 41 | }); 42 | logger.debug('LND Invoice', invoice); 43 | 44 | lightningApi.sendWebhookNotification(invoice); 45 | 46 | return res.status(200).json({ 47 | status: 'OK', 48 | successAction: { tag: 'message', message: 'Thank You!' }, 49 | routes: [], 50 | pr: invoice.payment_request, 51 | disposable: false 52 | }); 53 | } catch (error) { 54 | logger.error('Error creating Invoice', error); 55 | return res.status(500).json({ status: 'ERROR', reason: 'Error generating invoice' }); 56 | } 57 | } 58 | 59 | // No amount present, send callback identifier 60 | return res.status(200).json({ 61 | status: 'OK', 62 | callback: identifier, 63 | tag: 'payRequest', 64 | maxSendable: 250000000, 65 | minSendable: 1000, 66 | metadata: JSON.stringify(metadata), 67 | commentsAllowed: 0 68 | }); 69 | }); 70 | 71 | export { router as wellknown }; 72 | -------------------------------------------------------------------------------- /src/shared/lnd/api.ts: -------------------------------------------------------------------------------- 1 | import axios, { AxiosInstance } from 'axios'; 2 | 3 | import { SocksProxyAgent } from 'socks-proxy-agent'; 4 | import { URL } from 'url'; 5 | 6 | import { LnrpcAddInvoiceResponse, LnrpcInvoice } from './types'; 7 | import logger from '../logger'; 8 | 9 | const BASE_URL = process.env.LNADDR_LND_REST_BASE_URL; 10 | const MACAROON = process.env.LNADDR_LND_REST_MACAROON_HEX; 11 | const TOR_PROXY_URL = process.env.LNADDR_TOR_PROXY_URL || 'socks5h://localhost:9050'; 12 | const WEBHOOK_URL = process.env.LNADDR_NOTIFICATION_WEBHOOK; 13 | 14 | if (!BASE_URL || !MACAROON || !TOR_PROXY_URL) { 15 | throw new Error('Misconfigured Environment Variables'); 16 | } 17 | 18 | interface LightningAPIArgs { 19 | baseUrl: string; 20 | macaroon: string; 21 | proxy: string; 22 | } 23 | 24 | class LightningAPI { 25 | baseUrl: string; 26 | macaroon: string; 27 | axios: AxiosInstance; 28 | agent: SocksProxyAgent; 29 | proxy: string; 30 | 31 | constructor(args: LightningAPIArgs) { 32 | this.baseUrl = args.baseUrl; 33 | this.macaroon = args.macaroon; 34 | this.proxy = args.proxy; 35 | 36 | const socks = new URL(args.proxy); 37 | 38 | this.agent = new SocksProxyAgent({ 39 | hostname: socks.hostname, 40 | port: socks.port, 41 | protocol: socks.protocol, 42 | tls: { rejectUnauthorized: false } 43 | }); 44 | 45 | this.axios = axios.create({ 46 | baseURL: args.baseUrl.endsWith('/') ? args.baseUrl : `${args.baseUrl}/`, 47 | headers: { 48 | 'Grpc-Metadata-macaroon': args.macaroon 49 | }, 50 | httpAgent: this.agent, 51 | httpsAgent: this.agent 52 | }); 53 | } 54 | 55 | async lightningAddInvoice(createInvoiceArgs: LnrpcInvoice): Promise { 56 | const resp = await this.axios.post(`v1/invoices`, createInvoiceArgs); 57 | const invoice = resp.data; 58 | return invoice; 59 | } 60 | 61 | async sendWebhookNotification(data: any) { 62 | if (!WEBHOOK_URL) { 63 | logger.debug('Not sending Notification. LNADDR_NOTIFICATION_WEBHOOK not set'); 64 | } else { 65 | logger.debug('Sending Webhook Notification', { url: WEBHOOK_URL, data }); 66 | try { 67 | await axios.post(WEBHOOK_URL, data, { 68 | httpAgent: this.agent, 69 | httpsAgent: this.agent 70 | }); 71 | } catch (error) { 72 | logger.error('Error sending Webhook Notification', error); 73 | } 74 | } 75 | } 76 | } 77 | 78 | export const lightningApi = new LightningAPI({ 79 | baseUrl: BASE_URL, 80 | macaroon: MACAROON, 81 | proxy: TOR_PROXY_URL 82 | }); 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LND Lightning Address 2 | 3 | A dead simple [Lightning Address](https://www.lightningaddress.com) server for your personal Lightning Node! 4 | 5 | This will allow your to receive lightning address payments. It's like an email address but for sats! 6 | 7 | ## What you need 8 | 9 | - LND Server 10 | - Domain Name 11 | 12 | ## Usage 13 | 14 | ### Setup Environment Variables 15 | 16 | - Create a .env file 17 | - Find your LND REST Endpoint 18 | - Generate a Macaroon with Create Invoice permissions 19 | - Set your LND config. See `.env.sample` for example values 20 | - Set your domain name 21 | 22 | ### Start Server 23 | 24 | - `docker compose up` 25 | 26 | ## Config 27 | 28 | | Env Var | Required | Description | 29 | | ------------------------------ | -------- | -------------------------------------------------------------------------------------------- | 30 | | `LNADDR_LND_REST_BASE_URL` | true | Your LND REST URL e.g. `https://xxxx.onion:8080` address | 31 | | `LNADDR_LND_REST_MACAROON_HEX` | true | Create Invoice Macaroon | 32 | | `LNADDR_DOMAIN` | true | Your domain name e.g. `fatbear.me` | 33 | | `LNADDR_NOTIFICATION_WEBHOOK` | false | Webhook URL to receive notifications when invoices are created. e.g. `https://hookb.in/xxxx` | 34 | 35 | ## Endpoints 36 | 37 | | Endpoint | Description | 38 | | ------------------------------- | ------------------ | 39 | | `/` | Basic welcome page | 40 | | `/healthz` | Health Check | 41 | | `/.well-known/lnurlp/:username` | Lightning Address | 42 | 43 | ## Deploy 44 | 45 | ### Render 46 | 47 | [![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy) 48 | 49 | Deploy on [Render](https://render.com/) free tier. You will need to configure you [Custom Domain](https://render.com/docs/custom-domains) after it deploys. 50 | 51 | Services on [free plan](https://render.com/docs/free) are automatically spun down after 15 minutes of inactivity. When a new request for a free service comes in, Render spins it up again so it can process the request. This can cause a response delay of up to 30 seconds for the first request that comes in after a period of inactivity. 52 | 53 | **Fatbear Pro Tip:** You could setup a cron job on your umbrel to curl the `/healthz` endpoint every ~15 minutes. 54 | 55 | ## Umbrel 56 | 57 | There are a few additional setups required for this to work on your Umbrel node. That is until [Issue 1082](https://github.com/getumbrel/umbrel/issues/1082) has been resolved. 58 | 59 | STEPS: 60 | 61 | 1. SSH to your umbrel server `ssh umbrel@umbrel.local` you will need your umbrel password 62 | 2. Find your LND REST browser URL `cat umbrel/tor/data/lnd-rest/hostname`. It have a bunch of characters and end with `.onion`. Prepend `https://` and append `:8080` to this values to get `LNADDR_LND_REST_BASE_URL` env variable. 63 | 3. Open your LND Config File `vim umbrel/lnd/lnd.conf` 64 | 4. Under Application Options add an additional `tlsextradomain` line with your hostname from step 2. 65 | 5. Restart your Umbrel. Can be done from your Umbrel's settings UI. 66 | 67 | Your lnd.config should have two `tlsextradomain` lines. e.g. 68 | 69 | ``` 70 | tlsextradomain=umbrel.local 71 | tlsextradomain=xxxxxx.onion 72 | ``` 73 | 74 | ## Create Invoice Macaroon 75 | 76 | You will need a HEX encoded macaroon for the `LNADDR_LND_REST_MACAROON_HEX` env variable. 77 | I highly recommend generating a macaroon with only create invoice permissions. You can use Thunderhub to do this easily. 78 | 79 | 1. Open Thunderhub 80 | 2. Go to `Tools` in sidebar 81 | 3. Bakery -> Bake Macaroon 82 | 4. Give `Create Invoice` permissions 83 | 5. Hit `Bake new macaroon` button. 84 | 6. Copy the HEX encoded value 85 | -------------------------------------------------------------------------------- /src/shared/lnd/types.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | /* tslint:disable */ 3 | /* 4 | * --------------------------------------------------------------- 5 | * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ## 6 | * ## ## 7 | * ## AUTHOR: acacode ## 8 | * ## SOURCE: https://github.com/acacode/swagger-typescript-api ## 9 | * --------------------------------------------------------------- 10 | */ 11 | 12 | export enum ChannelCloseSummaryClosureType { 13 | COOPERATIVE_CLOSE = 'COOPERATIVE_CLOSE', 14 | LOCAL_FORCE_CLOSE = 'LOCAL_FORCE_CLOSE', 15 | REMOTE_FORCE_CLOSE = 'REMOTE_FORCE_CLOSE', 16 | BREACH_CLOSE = 'BREACH_CLOSE', 17 | FUNDING_CANCELED = 'FUNDING_CANCELED', 18 | ABANDONED = 'ABANDONED' 19 | } 20 | 21 | export enum ChannelEventUpdateUpdateType { 22 | OPEN_CHANNEL = 'OPEN_CHANNEL', 23 | CLOSED_CHANNEL = 'CLOSED_CHANNEL', 24 | ACTIVE_CHANNEL = 'ACTIVE_CHANNEL', 25 | INACTIVE_CHANNEL = 'INACTIVE_CHANNEL', 26 | PENDING_OPEN_CHANNEL = 'PENDING_OPEN_CHANNEL', 27 | FULLY_RESOLVED_CHANNEL = 'FULLY_RESOLVED_CHANNEL' 28 | } 29 | 30 | /** 31 | * - RESERVED: The numbers assigned in this enumeration match the failure codes as 32 | defined in BOLT #4. Because protobuf 3 requires enums to start with 0, 33 | a RESERVED value is added. 34 | - INTERNAL_FAILURE: An internal error occurred. 35 | - UNKNOWN_FAILURE: The error source is known, but the failure itself couldn't be decoded. 36 | - UNREADABLE_FAILURE: An unreadable failure result is returned if the received failure message 37 | cannot be decrypted. In that case the error source is unknown. 38 | */ 39 | export enum FailureFailureCode { 40 | RESERVED = 'RESERVED', 41 | INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 'INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS', 42 | INCORRECT_PAYMENT_AMOUNT = 'INCORRECT_PAYMENT_AMOUNT', 43 | FINAL_INCORRECT_CLTV_EXPIRY = 'FINAL_INCORRECT_CLTV_EXPIRY', 44 | FINAL_INCORRECT_HTLC_AMOUNT = 'FINAL_INCORRECT_HTLC_AMOUNT', 45 | FINAL_EXPIRY_TOO_SOON = 'FINAL_EXPIRY_TOO_SOON', 46 | INVALID_REALM = 'INVALID_REALM', 47 | EXPIRY_TOO_SOON = 'EXPIRY_TOO_SOON', 48 | INVALID_ONION_VERSION = 'INVALID_ONION_VERSION', 49 | INVALID_ONION_HMAC = 'INVALID_ONION_HMAC', 50 | INVALID_ONION_KEY = 'INVALID_ONION_KEY', 51 | AMOUNT_BELOW_MINIMUM = 'AMOUNT_BELOW_MINIMUM', 52 | FEE_INSUFFICIENT = 'FEE_INSUFFICIENT', 53 | INCORRECT_CLTV_EXPIRY = 'INCORRECT_CLTV_EXPIRY', 54 | CHANNEL_DISABLED = 'CHANNEL_DISABLED', 55 | TEMPORARY_CHANNEL_FAILURE = 'TEMPORARY_CHANNEL_FAILURE', 56 | REQUIRED_NODE_FEATURE_MISSING = 'REQUIRED_NODE_FEATURE_MISSING', 57 | REQUIRED_CHANNEL_FEATURE_MISSING = 'REQUIRED_CHANNEL_FEATURE_MISSING', 58 | UNKNOWN_NEXT_PEER = 'UNKNOWN_NEXT_PEER', 59 | TEMPORARY_NODE_FAILURE = 'TEMPORARY_NODE_FAILURE', 60 | PERMANENT_NODE_FAILURE = 'PERMANENT_NODE_FAILURE', 61 | PERMANENT_CHANNEL_FAILURE = 'PERMANENT_CHANNEL_FAILURE', 62 | EXPIRY_TOO_FAR = 'EXPIRY_TOO_FAR', 63 | MPP_TIMEOUT = 'MPP_TIMEOUT', 64 | INVALID_ONION_PAYLOAD = 'INVALID_ONION_PAYLOAD', 65 | INTERNAL_FAILURE = 'INTERNAL_FAILURE', 66 | UNKNOWN_FAILURE = 'UNKNOWN_FAILURE', 67 | UNREADABLE_FAILURE = 'UNREADABLE_FAILURE' 68 | } 69 | 70 | export enum ForceClosedChannelAnchorState { 71 | LIMBO = 'LIMBO', 72 | RECOVERED = 'RECOVERED', 73 | LOST = 'LOST' 74 | } 75 | 76 | export enum HTLCAttemptHTLCStatus { 77 | IN_FLIGHT = 'IN_FLIGHT', 78 | SUCCEEDED = 'SUCCEEDED', 79 | FAILED = 'FAILED' 80 | } 81 | 82 | export enum InvoiceInvoiceState { 83 | OPEN = 'OPEN', 84 | SETTLED = 'SETTLED', 85 | CANCELED = 'CANCELED', 86 | ACCEPTED = 'ACCEPTED' 87 | } 88 | 89 | export enum PaymentPaymentStatus { 90 | UNKNOWN = 'UNKNOWN', 91 | IN_FLIGHT = 'IN_FLIGHT', 92 | SUCCEEDED = 'SUCCEEDED', 93 | FAILED = 'FAILED' 94 | } 95 | 96 | export enum PeerEventEventType { 97 | PEER_ONLINE = 'PEER_ONLINE', 98 | PEER_OFFLINE = 'PEER_OFFLINE' 99 | } 100 | 101 | /** 102 | * - UNKNOWN_SYNC: Denotes that we cannot determine the peer's current sync type. 103 | - ACTIVE_SYNC: Denotes that we are actively receiving new graph updates from the peer. 104 | - PASSIVE_SYNC: Denotes that we are not receiving new graph updates from the peer. 105 | - PINNED_SYNC: Denotes that this peer is pinned into an active sync. 106 | */ 107 | export enum PeerSyncType { 108 | UNKNOWN_SYNC = 'UNKNOWN_SYNC', 109 | ACTIVE_SYNC = 'ACTIVE_SYNC', 110 | PASSIVE_SYNC = 'PASSIVE_SYNC', 111 | PINNED_SYNC = 'PINNED_SYNC' 112 | } 113 | 114 | export interface PendingChannelsResponseClosedChannel { 115 | channel?: PendingChannelsResponsePendingChannel; 116 | closing_txid?: string; 117 | } 118 | 119 | export interface PendingChannelsResponseCommitments { 120 | /** Hash of the local version of the commitment tx. */ 121 | local_txid?: string; 122 | 123 | /** Hash of the remote version of the commitment tx. */ 124 | remote_txid?: string; 125 | 126 | /** Hash of the remote pending version of the commitment tx. */ 127 | remote_pending_txid?: string; 128 | 129 | /** 130 | * The amount in satoshis calculated to be paid in fees for the local 131 | * commitment. 132 | * @format uint64 133 | */ 134 | local_commit_fee_sat?: string; 135 | 136 | /** 137 | * The amount in satoshis calculated to be paid in fees for the remote 138 | * commitment. 139 | * @format uint64 140 | */ 141 | remote_commit_fee_sat?: string; 142 | 143 | /** 144 | * The amount in satoshis calculated to be paid in fees for the remote 145 | * pending commitment. 146 | * @format uint64 147 | */ 148 | remote_pending_commit_fee_sat?: string; 149 | } 150 | 151 | export interface PendingChannelsResponseForceClosedChannel { 152 | channel?: PendingChannelsResponsePendingChannel; 153 | closing_txid?: string; 154 | 155 | /** @format int64 */ 156 | limbo_balance?: string; 157 | 158 | /** @format int64 */ 159 | maturity_height?: number; 160 | 161 | /** 162 | * Remaining # of blocks until the commitment output can be swept. 163 | * Negative values indicate how many blocks have passed since becoming 164 | * mature. 165 | * @format int32 166 | */ 167 | blocks_til_maturity?: number; 168 | 169 | /** @format int64 */ 170 | recovered_balance?: string; 171 | pending_htlcs?: LnrpcPendingHTLC[]; 172 | anchor?: ForceClosedChannelAnchorState; 173 | } 174 | 175 | export interface PendingChannelsResponsePendingChannel { 176 | remote_node_pub?: string; 177 | channel_point?: string; 178 | 179 | /** @format int64 */ 180 | capacity?: string; 181 | 182 | /** @format int64 */ 183 | local_balance?: string; 184 | 185 | /** @format int64 */ 186 | remote_balance?: string; 187 | 188 | /** 189 | * The minimum satoshis this node is required to reserve in its 190 | * balance. 191 | * @format int64 192 | */ 193 | local_chan_reserve_sat?: string; 194 | 195 | /** 196 | * The minimum satoshis the other node is required to reserve in its 197 | * balance. 198 | * @format int64 199 | */ 200 | remote_chan_reserve_sat?: string; 201 | 202 | /** The party that initiated opening the channel. */ 203 | initiator?: LnrpcInitiator; 204 | 205 | /** The commitment type used by this channel. */ 206 | commitment_type?: LnrpcCommitmentType; 207 | } 208 | 209 | export interface PendingChannelsResponsePendingOpenChannel { 210 | channel?: PendingChannelsResponsePendingChannel; 211 | 212 | /** @format int64 */ 213 | confirmation_height?: number; 214 | 215 | /** 216 | * The amount calculated to be paid in fees for the current set of 217 | * commitment transactions. The fee amount is persisted with the channel 218 | * in order to allow the fee amount to be removed and recalculated with 219 | * each channel state update, including updates that happen after a system 220 | * restart. 221 | * @format int64 222 | */ 223 | commit_fee?: string; 224 | 225 | /** @format int64 */ 226 | commit_weight?: string; 227 | 228 | /** 229 | * The required number of satoshis per kilo-weight that the requester will 230 | * pay at all times, for both the funding transaction and commitment 231 | * transaction. This value can later be updated once the channel is open. 232 | * @format int64 233 | */ 234 | fee_per_kw?: string; 235 | } 236 | 237 | export interface PendingChannelsResponseWaitingCloseChannel { 238 | channel?: PendingChannelsResponsePendingChannel; 239 | 240 | /** @format int64 */ 241 | limbo_balance?: string; 242 | 243 | /** 244 | * A list of valid commitment transactions. Any of these can confirm at 245 | * this point. 246 | */ 247 | commitments?: PendingChannelsResponseCommitments; 248 | } 249 | 250 | /** 251 | * Details specific to AMP HTLCs. 252 | */ 253 | export interface LnrpcAMP { 254 | /** 255 | * An n-of-n secret share of the root seed from which child payment hashes 256 | * and preimages are derived. 257 | * @format byte 258 | */ 259 | root_share?: string; 260 | 261 | /** 262 | * An identifier for the HTLC set that this HTLC belongs to. 263 | * @format byte 264 | */ 265 | set_id?: string; 266 | 267 | /** 268 | * A nonce used to randomize the child preimage and child hash from a given 269 | * root_share. 270 | * @format int64 271 | */ 272 | child_index?: number; 273 | 274 | /** 275 | * The payment hash of the AMP HTLC. 276 | * @format byte 277 | */ 278 | hash?: string; 279 | 280 | /** 281 | * The preimage used to settle this AMP htlc. This field will only be 282 | * populated if the invoice is in InvoiceState_ACCEPTED or 283 | * InvoiceState_SETTLED. 284 | * @format byte 285 | */ 286 | preimage?: string; 287 | } 288 | 289 | export interface LnrpcAMPRecord { 290 | /** @format byte */ 291 | root_share?: string; 292 | 293 | /** @format byte */ 294 | set_id?: string; 295 | 296 | /** @format int64 */ 297 | child_index?: number; 298 | } 299 | 300 | export type LnrpcAbandonChannelResponse = object; 301 | 302 | export interface LnrpcAddInvoiceResponse { 303 | /** @format byte */ 304 | r_hash?: string; 305 | 306 | /** 307 | * A bare-bones invoice for a payment within the Lightning Network. With the 308 | * details of the invoice, the sender has all the data necessary to send a 309 | * payment to the recipient. 310 | */ 311 | payment_request?: string; 312 | 313 | /** 314 | * The "add" index of this invoice. Each newly created invoice will increment 315 | * this index making it monotonically increasing. Callers to the 316 | * SubscribeInvoices call can use this to instantly get notified of all added 317 | * invoices with an add_index greater than this one. 318 | * @format uint64 319 | */ 320 | add_index?: string; 321 | 322 | /** 323 | * The payment address of the generated invoice. This value should be used 324 | * in all payments for this invoice as we require it for end to end 325 | * security. 326 | * @format byte 327 | */ 328 | payment_addr?: string; 329 | } 330 | 331 | /** 332 | * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) 333 | - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) 334 | */ 335 | export enum LnrpcAddressType { 336 | WITNESS_PUBKEY_HASH = 'WITNESS_PUBKEY_HASH', 337 | NESTED_PUBKEY_HASH = 'NESTED_PUBKEY_HASH', 338 | UNUSED_WITNESS_PUBKEY_HASH = 'UNUSED_WITNESS_PUBKEY_HASH', 339 | UNUSED_NESTED_PUBKEY_HASH = 'UNUSED_NESTED_PUBKEY_HASH' 340 | } 341 | 342 | export interface LnrpcAmount { 343 | /** 344 | * Value denominated in satoshis. 345 | * @format uint64 346 | */ 347 | sat?: string; 348 | 349 | /** 350 | * Value denominated in milli-satoshis. 351 | * @format uint64 352 | */ 353 | msat?: string; 354 | } 355 | 356 | export interface LnrpcBakeMacaroonRequest { 357 | /** The list of permissions the new macaroon should grant. */ 358 | permissions?: LnrpcMacaroonPermission[]; 359 | 360 | /** 361 | * The root key ID used to create the macaroon, must be a positive integer. 362 | * @format uint64 363 | */ 364 | root_key_id?: string; 365 | } 366 | 367 | export interface LnrpcBakeMacaroonResponse { 368 | /** The hex encoded macaroon, serialized in binary format. */ 369 | macaroon?: string; 370 | } 371 | 372 | export interface LnrpcChain { 373 | chain?: string; 374 | network?: string; 375 | } 376 | 377 | export interface LnrpcChanBackupSnapshot { 378 | /** 379 | * The set of new channels that have been added since the last channel backup 380 | * snapshot was requested. 381 | */ 382 | single_chan_backups?: LnrpcChannelBackups; 383 | 384 | /** 385 | * A multi-channel backup that covers all open channels currently known to 386 | * lnd. 387 | */ 388 | multi_chan_backup?: LnrpcMultiChanBackup; 389 | } 390 | 391 | export interface LnrpcChanPointShim { 392 | /** 393 | * The size of the pre-crafted output to be used as the channel point for this 394 | * channel funding. 395 | * @format int64 396 | */ 397 | amt?: string; 398 | 399 | /** The target channel point to refrence in created commitment transactions. */ 400 | chan_point?: LnrpcChannelPoint; 401 | 402 | /** Our local key to use when creating the multi-sig output. */ 403 | local_key?: LnrpcKeyDescriptor; 404 | 405 | /** 406 | * The key of the remote party to use when creating the multi-sig output. 407 | * @format byte 408 | */ 409 | remote_key?: string; 410 | 411 | /** 412 | * If non-zero, then this will be used as the pending channel ID on the wire 413 | * protocol to initate the funding request. This is an optional field, and 414 | * should only be set if the responder is already expecting a specific pending 415 | * channel ID. 416 | * @format byte 417 | */ 418 | pending_chan_id?: string; 419 | 420 | /** 421 | * This uint32 indicates if this channel is to be considered 'frozen'. A frozen 422 | * channel does not allow a cooperative channel close by the initiator. The 423 | * thaw_height is the height that this restriction stops applying to the 424 | * channel. The height can be interpreted in two ways: as a relative height if 425 | * the value is less than 500,000, or as an absolute height otherwise. 426 | * @format int64 427 | */ 428 | thaw_height?: number; 429 | } 430 | 431 | export interface LnrpcChannel { 432 | active?: boolean; 433 | remote_pubkey?: string; 434 | 435 | /** 436 | * The outpoint (txid:index) of the funding transaction. With this value, Bob 437 | * will be able to generate a signature for Alice's version of the commitment 438 | * transaction. 439 | */ 440 | channel_point?: string; 441 | 442 | /** 443 | * The unique channel ID for the channel. The first 3 bytes are the block 444 | * height, the next 3 the index within the block, and the last 2 bytes are the 445 | * output index for the channel. 446 | * @format uint64 447 | */ 448 | chan_id?: string; 449 | 450 | /** @format int64 */ 451 | capacity?: string; 452 | 453 | /** @format int64 */ 454 | local_balance?: string; 455 | 456 | /** @format int64 */ 457 | remote_balance?: string; 458 | 459 | /** 460 | * The amount calculated to be paid in fees for the current set of commitment 461 | * transactions. The fee amount is persisted with the channel in order to 462 | * allow the fee amount to be removed and recalculated with each channel state 463 | * update, including updates that happen after a system restart. 464 | * @format int64 465 | */ 466 | commit_fee?: string; 467 | 468 | /** @format int64 */ 469 | commit_weight?: string; 470 | 471 | /** 472 | * The required number of satoshis per kilo-weight that the requester will pay 473 | * at all times, for both the funding transaction and commitment transaction. 474 | * This value can later be updated once the channel is open. 475 | * @format int64 476 | */ 477 | fee_per_kw?: string; 478 | 479 | /** @format int64 */ 480 | unsettled_balance?: string; 481 | 482 | /** 483 | * The total number of satoshis we've sent within this channel. 484 | * @format int64 485 | */ 486 | total_satoshis_sent?: string; 487 | 488 | /** 489 | * The total number of satoshis we've received within this channel. 490 | * @format int64 491 | */ 492 | total_satoshis_received?: string; 493 | 494 | /** 495 | * The total number of updates conducted within this channel. 496 | * @format uint64 497 | */ 498 | num_updates?: string; 499 | 500 | /** The list of active, uncleared HTLCs currently pending within the channel. */ 501 | pending_htlcs?: LnrpcHTLC[]; 502 | 503 | /** 504 | * Deprecated. The CSV delay expressed in relative blocks. If the channel is 505 | * force closed, we will need to wait for this many blocks before we can regain 506 | * our funds. 507 | * @format int64 508 | */ 509 | csv_delay?: number; 510 | 511 | /** Whether this channel is advertised to the network or not. */ 512 | private?: boolean; 513 | 514 | /** True if we were the ones that created the channel. */ 515 | initiator?: boolean; 516 | 517 | /** A set of flags showing the current state of the channel. */ 518 | chan_status_flags?: string; 519 | 520 | /** 521 | * Deprecated. The minimum satoshis this node is required to reserve in its 522 | * balance. 523 | * @format int64 524 | */ 525 | local_chan_reserve_sat?: string; 526 | 527 | /** 528 | * Deprecated. The minimum satoshis the other node is required to reserve in 529 | * its balance. 530 | * @format int64 531 | */ 532 | remote_chan_reserve_sat?: string; 533 | 534 | /** Deprecated. Use commitment_type. */ 535 | static_remote_key?: boolean; 536 | 537 | /** The commitment type used by this channel. */ 538 | commitment_type?: LnrpcCommitmentType; 539 | 540 | /** 541 | * The number of seconds that the channel has been monitored by the channel 542 | * scoring system. Scores are currently not persisted, so this value may be 543 | * less than the lifetime of the channel [EXPERIMENTAL]. 544 | * @format int64 545 | */ 546 | lifetime?: string; 547 | 548 | /** 549 | * The number of seconds that the remote peer has been observed as being online 550 | * by the channel scoring system over the lifetime of the channel 551 | * [EXPERIMENTAL]. 552 | * @format int64 553 | */ 554 | uptime?: string; 555 | 556 | /** 557 | * Close address is the address that we will enforce payout to on cooperative 558 | * close if the channel was opened utilizing option upfront shutdown. This 559 | * value can be set on channel open by setting close_address in an open channel 560 | * request. If this value is not set, you can still choose a payout address by 561 | * cooperatively closing with the delivery_address field set. 562 | */ 563 | close_address?: string; 564 | 565 | /** 566 | * The amount that the initiator of the channel optionally pushed to the remote 567 | * party on channel open. This amount will be zero if the channel initiator did 568 | * not push any funds to the remote peer. If the initiator field is true, we 569 | * pushed this amount to our peer, if it is false, the remote peer pushed this 570 | * amount to us. 571 | * @format uint64 572 | */ 573 | push_amount_sat?: string; 574 | 575 | /** 576 | * This uint32 indicates if this channel is to be considered 'frozen'. A 577 | * frozen channel doest not allow a cooperative channel close by the 578 | * initiator. The thaw_height is the height that this restriction stops 579 | * applying to the channel. This field is optional, not setting it or using a 580 | * value of zero will mean the channel has no additional restrictions. The 581 | * height can be interpreted in two ways: as a relative height if the value is 582 | * less than 500,000, or as an absolute height otherwise. 583 | * @format int64 584 | */ 585 | thaw_height?: number; 586 | 587 | /** List constraints for the local node. */ 588 | local_constraints?: LnrpcChannelConstraints; 589 | 590 | /** List constraints for the remote node. */ 591 | remote_constraints?: LnrpcChannelConstraints; 592 | } 593 | 594 | export interface LnrpcChannelAcceptRequest { 595 | /** 596 | * The pubkey of the node that wishes to open an inbound channel. 597 | * @format byte 598 | */ 599 | node_pubkey?: string; 600 | 601 | /** 602 | * The hash of the genesis block that the proposed channel resides in. 603 | * @format byte 604 | */ 605 | chain_hash?: string; 606 | 607 | /** 608 | * The pending channel id. 609 | * @format byte 610 | */ 611 | pending_chan_id?: string; 612 | 613 | /** 614 | * The funding amount in satoshis that initiator wishes to use in the 615 | * channel. 616 | * @format uint64 617 | */ 618 | funding_amt?: string; 619 | 620 | /** 621 | * The push amount of the proposed channel in millisatoshis. 622 | * @format uint64 623 | */ 624 | push_amt?: string; 625 | 626 | /** 627 | * The dust limit of the initiator's commitment tx. 628 | * @format uint64 629 | */ 630 | dust_limit?: string; 631 | 632 | /** 633 | * The maximum amount of coins in millisatoshis that can be pending in this 634 | * channel. 635 | * @format uint64 636 | */ 637 | max_value_in_flight?: string; 638 | 639 | /** 640 | * The minimum amount of satoshis the initiator requires us to have at all 641 | * times. 642 | * @format uint64 643 | */ 644 | channel_reserve?: string; 645 | 646 | /** 647 | * The smallest HTLC in millisatoshis that the initiator will accept. 648 | * @format uint64 649 | */ 650 | min_htlc?: string; 651 | 652 | /** 653 | * The initial fee rate that the initiator suggests for both commitment 654 | * transactions. 655 | * @format uint64 656 | */ 657 | fee_per_kw?: string; 658 | 659 | /** 660 | * The number of blocks to use for the relative time lock in the pay-to-self 661 | * output of both commitment transactions. 662 | * @format int64 663 | */ 664 | csv_delay?: number; 665 | 666 | /** 667 | * The total number of incoming HTLC's that the initiator will accept. 668 | * @format int64 669 | */ 670 | max_accepted_htlcs?: number; 671 | 672 | /** 673 | * A bit-field which the initiator uses to specify proposed channel 674 | * behavior. 675 | * @format int64 676 | */ 677 | channel_flags?: number; 678 | } 679 | 680 | export interface LnrpcChannelAcceptResponse { 681 | /** Whether or not the client accepts the channel. */ 682 | accept?: boolean; 683 | 684 | /** 685 | * The pending channel id to which this response applies. 686 | * @format byte 687 | */ 688 | pending_chan_id?: string; 689 | 690 | /** 691 | * An optional error to send the initiating party to indicate why the channel 692 | * was rejected. This field *should not* contain sensitive information, it will 693 | * be sent to the initiating party. This field should only be set if accept is 694 | * false, the channel will be rejected if an error is set with accept=true 695 | * because the meaning of this response is ambiguous. Limited to 500 696 | * characters. 697 | */ 698 | error?: string; 699 | 700 | /** 701 | * The upfront shutdown address to use if the initiating peer supports option 702 | * upfront shutdown script (see ListPeers for the features supported). Note 703 | * that the channel open will fail if this value is set for a peer that does 704 | * not support this feature bit. 705 | */ 706 | upfront_shutdown?: string; 707 | 708 | /** 709 | * The csv delay (in blocks) that we require for the remote party. 710 | * @format int64 711 | */ 712 | csv_delay?: number; 713 | 714 | /** 715 | * The reserve amount in satoshis that we require the remote peer to adhere to. 716 | * We require that the remote peer always have some reserve amount allocated to 717 | * them so that there is always a disincentive to broadcast old state (if they 718 | * hold 0 sats on their side of the channel, there is nothing to lose). 719 | * @format uint64 720 | */ 721 | reserve_sat?: string; 722 | 723 | /** 724 | * The maximum amount of funds in millisatoshis that we allow the remote peer 725 | * to have in outstanding htlcs. 726 | * @format uint64 727 | */ 728 | in_flight_max_msat?: string; 729 | 730 | /** 731 | * The maximum number of htlcs that the remote peer can offer us. 732 | * @format int64 733 | */ 734 | max_htlc_count?: number; 735 | 736 | /** 737 | * The minimum value in millisatoshis for incoming htlcs on the channel. 738 | * @format uint64 739 | */ 740 | min_htlc_in?: string; 741 | 742 | /** 743 | * The number of confirmations we require before we consider the channel open. 744 | * @format int64 745 | */ 746 | min_accept_depth?: number; 747 | } 748 | 749 | export interface LnrpcChannelBackup { 750 | /** Identifies the channel that this backup belongs to. */ 751 | chan_point?: LnrpcChannelPoint; 752 | 753 | /** 754 | * Is an encrypted single-chan backup. this can be passed to 755 | * RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in 756 | * order to trigger the recovery protocol. When using REST, this field must be 757 | * encoded as base64. 758 | * @format byte 759 | */ 760 | chan_backup?: string; 761 | } 762 | 763 | export interface LnrpcChannelBackups { 764 | /** A set of single-chan static channel backups. */ 765 | chan_backups?: LnrpcChannelBackup[]; 766 | } 767 | 768 | export interface LnrpcChannelBalanceResponse { 769 | /** @format int64 */ 770 | balance?: string; 771 | 772 | /** @format int64 */ 773 | pending_open_balance?: string; 774 | 775 | /** Sum of channels local balances. */ 776 | local_balance?: LnrpcAmount; 777 | 778 | /** Sum of channels remote balances. */ 779 | remote_balance?: LnrpcAmount; 780 | 781 | /** Sum of channels local unsettled balances. */ 782 | unsettled_local_balance?: LnrpcAmount; 783 | 784 | /** Sum of channels remote unsettled balances. */ 785 | unsettled_remote_balance?: LnrpcAmount; 786 | 787 | /** Sum of channels pending local balances. */ 788 | pending_open_local_balance?: LnrpcAmount; 789 | 790 | /** Sum of channels pending remote balances. */ 791 | pending_open_remote_balance?: LnrpcAmount; 792 | } 793 | 794 | export interface LnrpcChannelCloseSummary { 795 | /** The outpoint (txid:index) of the funding transaction. */ 796 | channel_point?: string; 797 | 798 | /** 799 | * The unique channel ID for the channel. 800 | * @format uint64 801 | */ 802 | chan_id?: string; 803 | 804 | /** The hash of the genesis block that this channel resides within. */ 805 | chain_hash?: string; 806 | 807 | /** The txid of the transaction which ultimately closed this channel. */ 808 | closing_tx_hash?: string; 809 | 810 | /** Public key of the remote peer that we formerly had a channel with. */ 811 | remote_pubkey?: string; 812 | 813 | /** 814 | * Total capacity of the channel. 815 | * @format int64 816 | */ 817 | capacity?: string; 818 | 819 | /** 820 | * Height at which the funding transaction was spent. 821 | * @format int64 822 | */ 823 | close_height?: number; 824 | 825 | /** @format int64 */ 826 | settled_balance?: string; 827 | 828 | /** @format int64 */ 829 | time_locked_balance?: string; 830 | 831 | /** Details on how the channel was closed. */ 832 | close_type?: ChannelCloseSummaryClosureType; 833 | 834 | /** 835 | * Open initiator is the party that initiated opening the channel. Note that 836 | * this value may be unknown if the channel was closed before we migrated to 837 | * store open channel information after close. 838 | */ 839 | open_initiator?: LnrpcInitiator; 840 | 841 | /** 842 | * Close initiator indicates which party initiated the close. This value will 843 | * be unknown for channels that were cooperatively closed before we started 844 | * tracking cooperative close initiators. Note that this indicates which party 845 | * initiated a close, and it is possible for both to initiate cooperative or 846 | * force closes, although only one party's close will be confirmed on chain. 847 | */ 848 | close_initiator?: LnrpcInitiator; 849 | resolutions?: LnrpcResolution[]; 850 | } 851 | 852 | export interface LnrpcChannelCloseUpdate { 853 | /** @format byte */ 854 | closing_txid?: string; 855 | success?: boolean; 856 | } 857 | 858 | export interface LnrpcChannelConstraints { 859 | /** 860 | * The CSV delay expressed in relative blocks. If the channel is force closed, 861 | * we will need to wait for this many blocks before we can regain our funds. 862 | * @format int64 863 | */ 864 | csv_delay?: number; 865 | 866 | /** 867 | * The minimum satoshis this node is required to reserve in its balance. 868 | * @format uint64 869 | */ 870 | chan_reserve_sat?: string; 871 | 872 | /** 873 | * The dust limit (in satoshis) of the initiator's commitment tx. 874 | * @format uint64 875 | */ 876 | dust_limit_sat?: string; 877 | 878 | /** 879 | * The maximum amount of coins in millisatoshis that can be pending in this 880 | * channel. 881 | * @format uint64 882 | */ 883 | max_pending_amt_msat?: string; 884 | 885 | /** 886 | * The smallest HTLC in millisatoshis that the initiator will accept. 887 | * @format uint64 888 | */ 889 | min_htlc_msat?: string; 890 | 891 | /** 892 | * The total number of incoming HTLC's that the initiator will accept. 893 | * @format int64 894 | */ 895 | max_accepted_htlcs?: number; 896 | } 897 | 898 | /** 899 | * A fully authenticated channel along with all its unique attributes. 900 | Once an authenticated channel announcement has been processed on the network, 901 | then an instance of ChannelEdgeInfo encapsulating the channels attributes is 902 | stored. The other portions relevant to routing policy of a channel are stored 903 | within a ChannelEdgePolicy for each direction of the channel. 904 | */ 905 | export interface LnrpcChannelEdge { 906 | /** 907 | * The unique channel ID for the channel. The first 3 bytes are the block 908 | * height, the next 3 the index within the block, and the last 2 bytes are the 909 | * output index for the channel. 910 | * @format uint64 911 | */ 912 | channel_id?: string; 913 | chan_point?: string; 914 | 915 | /** @format int64 */ 916 | last_update?: number; 917 | node1_pub?: string; 918 | node2_pub?: string; 919 | 920 | /** @format int64 */ 921 | capacity?: string; 922 | node1_policy?: LnrpcRoutingPolicy; 923 | node2_policy?: LnrpcRoutingPolicy; 924 | } 925 | 926 | export interface LnrpcChannelEdgeUpdate { 927 | /** 928 | * The unique channel ID for the channel. The first 3 bytes are the block 929 | * height, the next 3 the index within the block, and the last 2 bytes are the 930 | * output index for the channel. 931 | * @format uint64 932 | */ 933 | chan_id?: string; 934 | chan_point?: LnrpcChannelPoint; 935 | 936 | /** @format int64 */ 937 | capacity?: string; 938 | routing_policy?: LnrpcRoutingPolicy; 939 | advertising_node?: string; 940 | connecting_node?: string; 941 | } 942 | 943 | export interface LnrpcChannelEventUpdate { 944 | open_channel?: LnrpcChannel; 945 | closed_channel?: LnrpcChannelCloseSummary; 946 | active_channel?: LnrpcChannelPoint; 947 | inactive_channel?: LnrpcChannelPoint; 948 | pending_open_channel?: LnrpcPendingUpdate; 949 | fully_resolved_channel?: LnrpcChannelPoint; 950 | type?: ChannelEventUpdateUpdateType; 951 | } 952 | 953 | export interface LnrpcChannelFeeReport { 954 | /** 955 | * The short channel id that this fee report belongs to. 956 | * @format uint64 957 | */ 958 | chan_id?: string; 959 | 960 | /** The channel that this fee report belongs to. */ 961 | channel_point?: string; 962 | 963 | /** 964 | * The base fee charged regardless of the number of milli-satoshis sent. 965 | * @format int64 966 | */ 967 | base_fee_msat?: string; 968 | 969 | /** 970 | * The amount charged per milli-satoshis transferred expressed in 971 | * millionths of a satoshi. 972 | * @format int64 973 | */ 974 | fee_per_mil?: string; 975 | 976 | /** 977 | * The effective fee rate in milli-satoshis. Computed by dividing the 978 | * fee_per_mil value by 1 million. 979 | * @format double 980 | */ 981 | fee_rate?: number; 982 | } 983 | 984 | /** 985 | * Returns a new instance of the directed channel graph. 986 | */ 987 | export interface LnrpcChannelGraph { 988 | nodes?: LnrpcLightningNode[]; 989 | edges?: LnrpcChannelEdge[]; 990 | } 991 | 992 | export interface LnrpcChannelOpenUpdate { 993 | channel_point?: LnrpcChannelPoint; 994 | } 995 | 996 | export interface LnrpcChannelPoint { 997 | /** 998 | * Txid of the funding transaction. When using REST, this field must be 999 | * encoded as base64. 1000 | * @format byte 1001 | */ 1002 | funding_txid_bytes?: string; 1003 | 1004 | /** 1005 | * Hex-encoded string representing the byte-reversed hash of the funding 1006 | * transaction. 1007 | */ 1008 | funding_txid_str?: string; 1009 | 1010 | /** @format int64 */ 1011 | output_index?: number; 1012 | } 1013 | 1014 | export interface LnrpcChannelUpdate { 1015 | /** 1016 | * The signature that validates the announced data and proves the ownership 1017 | * of node id. 1018 | * @format byte 1019 | */ 1020 | signature?: string; 1021 | 1022 | /** 1023 | * The target chain that this channel was opened within. This value 1024 | * should be the genesis hash of the target chain. Along with the short 1025 | * channel ID, this uniquely identifies the channel globally in a 1026 | * blockchain. 1027 | * @format byte 1028 | */ 1029 | chain_hash?: string; 1030 | 1031 | /** 1032 | * The unique description of the funding transaction. 1033 | * @format uint64 1034 | */ 1035 | chan_id?: string; 1036 | 1037 | /** 1038 | * A timestamp that allows ordering in the case of multiple announcements. 1039 | * We should ignore the message if timestamp is not greater than the 1040 | * last-received. 1041 | * @format int64 1042 | */ 1043 | timestamp?: number; 1044 | 1045 | /** 1046 | * The bitfield that describes whether optional fields are present in this 1047 | * update. Currently, the least-significant bit must be set to 1 if the 1048 | * optional field MaxHtlc is present. 1049 | * @format int64 1050 | */ 1051 | message_flags?: number; 1052 | 1053 | /** 1054 | * The bitfield that describes additional meta-data concerning how the 1055 | * update is to be interpreted. Currently, the least-significant bit must be 1056 | * set to 0 if the creating node corresponds to the first node in the 1057 | * previously sent channel announcement and 1 otherwise. If the second bit 1058 | * is set, then the channel is set to be disabled. 1059 | * @format int64 1060 | */ 1061 | channel_flags?: number; 1062 | 1063 | /** 1064 | * The minimum number of blocks this node requires to be added to the expiry 1065 | * of HTLCs. This is a security parameter determined by the node operator. 1066 | * This value represents the required gap between the time locks of the 1067 | * incoming and outgoing HTLC's set to this node. 1068 | * @format int64 1069 | */ 1070 | time_lock_delta?: number; 1071 | 1072 | /** 1073 | * The minimum HTLC value which will be accepted. 1074 | * @format uint64 1075 | */ 1076 | htlc_minimum_msat?: string; 1077 | 1078 | /** 1079 | * The base fee that must be used for incoming HTLC's to this particular 1080 | * channel. This value will be tacked onto the required for a payment 1081 | * independent of the size of the payment. 1082 | * @format int64 1083 | */ 1084 | base_fee?: number; 1085 | 1086 | /** 1087 | * The fee rate that will be charged per millionth of a satoshi. 1088 | * @format int64 1089 | */ 1090 | fee_rate?: number; 1091 | 1092 | /** 1093 | * The maximum HTLC value which will be accepted. 1094 | * @format uint64 1095 | */ 1096 | htlc_maximum_msat?: string; 1097 | 1098 | /** 1099 | * The set of data that was appended to this message, some of which we may 1100 | * not actually know how to iterate or parse. By holding onto this data, we 1101 | * ensure that we're able to properly validate the set of signatures that 1102 | * cover these new fields, and ensure we're able to make upgrades to the 1103 | * network in a forwards compatible manner. 1104 | * @format byte 1105 | */ 1106 | extra_opaque_data?: string; 1107 | } 1108 | 1109 | export interface LnrpcCloseStatusUpdate { 1110 | close_pending?: LnrpcPendingUpdate; 1111 | chan_close?: LnrpcChannelCloseUpdate; 1112 | } 1113 | 1114 | export interface LnrpcClosedChannelUpdate { 1115 | /** 1116 | * The unique channel ID for the channel. The first 3 bytes are the block 1117 | * height, the next 3 the index within the block, and the last 2 bytes are the 1118 | * output index for the channel. 1119 | * @format uint64 1120 | */ 1121 | chan_id?: string; 1122 | 1123 | /** @format int64 */ 1124 | capacity?: string; 1125 | 1126 | /** @format int64 */ 1127 | closed_height?: number; 1128 | chan_point?: LnrpcChannelPoint; 1129 | } 1130 | 1131 | export interface LnrpcClosedChannelsResponse { 1132 | channels?: LnrpcChannelCloseSummary[]; 1133 | } 1134 | 1135 | /** 1136 | * - UNKNOWN_COMMITMENT_TYPE: Returned when the commitment type isn't known or unavailable. 1137 | - LEGACY: A channel using the legacy commitment format having tweaked to_remote 1138 | keys. 1139 | - STATIC_REMOTE_KEY: A channel that uses the modern commitment format where the key in the 1140 | output of the remote party does not change each state. This makes back 1141 | up and recovery easier as when the channel is closed, the funds go 1142 | directly to that key. 1143 | - ANCHORS: A channel that uses a commitment format that has anchor outputs on the 1144 | commitments, allowing fee bumping after a force close transaction has 1145 | been broadcast. 1146 | */ 1147 | export enum LnrpcCommitmentType { 1148 | UNKNOWN_COMMITMENT_TYPE = 'UNKNOWN_COMMITMENT_TYPE', 1149 | LEGACY = 'LEGACY', 1150 | STATIC_REMOTE_KEY = 'STATIC_REMOTE_KEY', 1151 | ANCHORS = 'ANCHORS' 1152 | } 1153 | 1154 | export interface LnrpcConnectPeerRequest { 1155 | addr?: LnrpcLightningAddress; 1156 | 1157 | /** 1158 | * If set, the daemon will attempt to persistently connect to the target 1159 | * peer. Otherwise, the call will be synchronous. 1160 | */ 1161 | perm?: boolean; 1162 | 1163 | /** 1164 | * The connection timeout value (in seconds) for this request. It won't affect 1165 | * other requests. 1166 | * @format uint64 1167 | */ 1168 | timeout?: string; 1169 | } 1170 | 1171 | export type LnrpcConnectPeerResponse = object; 1172 | 1173 | export interface LnrpcDebugLevelRequest { 1174 | show?: boolean; 1175 | level_spec?: string; 1176 | } 1177 | 1178 | export interface LnrpcDebugLevelResponse { 1179 | sub_systems?: string; 1180 | } 1181 | 1182 | export type LnrpcDeleteAllPaymentsResponse = object; 1183 | 1184 | export interface LnrpcDeleteMacaroonIDResponse { 1185 | /** A boolean indicates that the deletion is successful. */ 1186 | deleted?: boolean; 1187 | } 1188 | 1189 | export type LnrpcDisconnectPeerResponse = object; 1190 | 1191 | export interface LnrpcEdgeLocator { 1192 | /** 1193 | * The short channel id of this edge. 1194 | * @format uint64 1195 | */ 1196 | channel_id?: string; 1197 | 1198 | /** 1199 | * The direction of this edge. If direction_reverse is false, the direction 1200 | * of this edge is from the channel endpoint with the lexicographically smaller 1201 | * pub key to the endpoint with the larger pub key. If direction_reverse is 1202 | * is true, the edge goes the other way. 1203 | */ 1204 | direction_reverse?: boolean; 1205 | } 1206 | 1207 | export interface LnrpcEstimateFeeResponse { 1208 | /** 1209 | * The total fee in satoshis. 1210 | * @format int64 1211 | */ 1212 | fee_sat?: string; 1213 | 1214 | /** 1215 | * Deprecated, use sat_per_vbyte. 1216 | * The fee rate in satoshi/vbyte. 1217 | * @format int64 1218 | */ 1219 | feerate_sat_per_byte?: string; 1220 | 1221 | /** 1222 | * The fee rate in satoshi/vbyte. 1223 | * @format uint64 1224 | */ 1225 | sat_per_vbyte?: string; 1226 | } 1227 | 1228 | export interface LnrpcFailure { 1229 | /** 1230 | * - RESERVED: The numbers assigned in this enumeration match the failure codes as 1231 | * defined in BOLT #4. Because protobuf 3 requires enums to start with 0, 1232 | * a RESERVED value is added. 1233 | * - INTERNAL_FAILURE: An internal error occurred. 1234 | * - UNKNOWN_FAILURE: The error source is known, but the failure itself couldn't be decoded. 1235 | * - UNREADABLE_FAILURE: An unreadable failure result is returned if the received failure message 1236 | * cannot be decrypted. In that case the error source is unknown. 1237 | */ 1238 | code?: FailureFailureCode; 1239 | 1240 | /** An optional channel update message. */ 1241 | channel_update?: LnrpcChannelUpdate; 1242 | 1243 | /** 1244 | * A failure type-dependent htlc value. 1245 | * @format uint64 1246 | */ 1247 | htlc_msat?: string; 1248 | 1249 | /** 1250 | * The sha256 sum of the onion payload. 1251 | * @format byte 1252 | */ 1253 | onion_sha_256?: string; 1254 | 1255 | /** 1256 | * A failure type-dependent cltv expiry value. 1257 | * @format int64 1258 | */ 1259 | cltv_expiry?: number; 1260 | 1261 | /** 1262 | * A failure type-dependent flags value. 1263 | * @format int64 1264 | */ 1265 | flags?: number; 1266 | 1267 | /** 1268 | * The position in the path of the intermediate or final node that generated 1269 | * the failure message. Position zero is the sender node. 1270 | * @format int64 1271 | */ 1272 | failure_source_index?: number; 1273 | 1274 | /** 1275 | * A failure type-dependent block height. 1276 | * @format int64 1277 | */ 1278 | height?: number; 1279 | } 1280 | 1281 | export interface LnrpcFeature { 1282 | name?: string; 1283 | is_required?: boolean; 1284 | is_known?: boolean; 1285 | } 1286 | 1287 | export enum LnrpcFeatureBit { 1288 | DATALOSS_PROTECT_REQ = 'DATALOSS_PROTECT_REQ', 1289 | DATALOSS_PROTECT_OPT = 'DATALOSS_PROTECT_OPT', 1290 | INITIAL_ROUING_SYNC = 'INITIAL_ROUING_SYNC', 1291 | UPFRONT_SHUTDOWN_SCRIPT_REQ = 'UPFRONT_SHUTDOWN_SCRIPT_REQ', 1292 | UPFRONT_SHUTDOWN_SCRIPT_OPT = 'UPFRONT_SHUTDOWN_SCRIPT_OPT', 1293 | GOSSIP_QUERIES_REQ = 'GOSSIP_QUERIES_REQ', 1294 | GOSSIP_QUERIES_OPT = 'GOSSIP_QUERIES_OPT', 1295 | TLV_ONION_REQ = 'TLV_ONION_REQ', 1296 | TLV_ONION_OPT = 'TLV_ONION_OPT', 1297 | EXT_GOSSIP_QUERIES_REQ = 'EXT_GOSSIP_QUERIES_REQ', 1298 | EXT_GOSSIP_QUERIES_OPT = 'EXT_GOSSIP_QUERIES_OPT', 1299 | STATIC_REMOTE_KEY_REQ = 'STATIC_REMOTE_KEY_REQ', 1300 | STATIC_REMOTE_KEY_OPT = 'STATIC_REMOTE_KEY_OPT', 1301 | PAYMENT_ADDR_REQ = 'PAYMENT_ADDR_REQ', 1302 | PAYMENT_ADDR_OPT = 'PAYMENT_ADDR_OPT', 1303 | MPP_REQ = 'MPP_REQ', 1304 | MPP_OPT = 'MPP_OPT', 1305 | WUMBO_CHANNELS_REQ = 'WUMBO_CHANNELS_REQ', 1306 | WUMBO_CHANNELS_OPT = 'WUMBO_CHANNELS_OPT', 1307 | ANCHORS_REQ = 'ANCHORS_REQ', 1308 | ANCHORS_OPT = 'ANCHORS_OPT', 1309 | ANCHORS_ZERO_FEE_HTLC_REQ = 'ANCHORS_ZERO_FEE_HTLC_REQ', 1310 | ANCHORS_ZERO_FEE_HTLC_OPT = 'ANCHORS_ZERO_FEE_HTLC_OPT', 1311 | AMP_REQ = 'AMP_REQ', 1312 | AMP_OPT = 'AMP_OPT' 1313 | } 1314 | 1315 | export interface LnrpcFeeLimit { 1316 | /** 1317 | * The fee limit expressed as a fixed amount of satoshis. 1318 | * 1319 | * The fields fixed and fixed_msat are mutually exclusive. 1320 | * @format int64 1321 | */ 1322 | fixed?: string; 1323 | 1324 | /** 1325 | * The fee limit expressed as a fixed amount of millisatoshis. 1326 | * 1327 | * The fields fixed and fixed_msat are mutually exclusive. 1328 | * @format int64 1329 | */ 1330 | fixed_msat?: string; 1331 | 1332 | /** 1333 | * The fee limit expressed as a percentage of the payment amount. 1334 | * @format int64 1335 | */ 1336 | percent?: string; 1337 | } 1338 | 1339 | export interface LnrpcFeeReportResponse { 1340 | /** 1341 | * An array of channel fee reports which describes the current fee schedule 1342 | * for each channel. 1343 | */ 1344 | channel_fees?: LnrpcChannelFeeReport[]; 1345 | 1346 | /** 1347 | * The total amount of fee revenue (in satoshis) the switch has collected 1348 | * over the past 24 hrs. 1349 | * @format uint64 1350 | */ 1351 | day_fee_sum?: string; 1352 | 1353 | /** 1354 | * The total amount of fee revenue (in satoshis) the switch has collected 1355 | * over the past 1 week. 1356 | * @format uint64 1357 | */ 1358 | week_fee_sum?: string; 1359 | 1360 | /** 1361 | * The total amount of fee revenue (in satoshis) the switch has collected 1362 | * over the past 1 month. 1363 | * @format uint64 1364 | */ 1365 | month_fee_sum?: string; 1366 | } 1367 | 1368 | export interface LnrpcFloatMetric { 1369 | /** 1370 | * Arbitrary float value. 1371 | * @format double 1372 | */ 1373 | value?: number; 1374 | 1375 | /** 1376 | * The value normalized to [0,1] or [-1,1]. 1377 | * @format double 1378 | */ 1379 | normalized_value?: number; 1380 | } 1381 | 1382 | export interface LnrpcForwardingEvent { 1383 | /** 1384 | * Timestamp is the time (unix epoch offset) that this circuit was 1385 | * completed. Deprecated by timestamp_ns. 1386 | * @format uint64 1387 | */ 1388 | timestamp?: string; 1389 | 1390 | /** 1391 | * The incoming channel ID that carried the HTLC that created the circuit. 1392 | * @format uint64 1393 | */ 1394 | chan_id_in?: string; 1395 | 1396 | /** 1397 | * The outgoing channel ID that carried the preimage that completed the 1398 | * circuit. 1399 | * @format uint64 1400 | */ 1401 | chan_id_out?: string; 1402 | 1403 | /** 1404 | * The total amount (in satoshis) of the incoming HTLC that created half 1405 | * the circuit. 1406 | * @format uint64 1407 | */ 1408 | amt_in?: string; 1409 | 1410 | /** 1411 | * The total amount (in satoshis) of the outgoing HTLC that created the 1412 | * second half of the circuit. 1413 | * @format uint64 1414 | */ 1415 | amt_out?: string; 1416 | 1417 | /** 1418 | * The total fee (in satoshis) that this payment circuit carried. 1419 | * @format uint64 1420 | */ 1421 | fee?: string; 1422 | 1423 | /** 1424 | * The total fee (in milli-satoshis) that this payment circuit carried. 1425 | * @format uint64 1426 | */ 1427 | fee_msat?: string; 1428 | 1429 | /** 1430 | * The total amount (in milli-satoshis) of the incoming HTLC that created 1431 | * half the circuit. 1432 | * @format uint64 1433 | */ 1434 | amt_in_msat?: string; 1435 | 1436 | /** 1437 | * The total amount (in milli-satoshis) of the outgoing HTLC that created 1438 | * the second half of the circuit. 1439 | * @format uint64 1440 | */ 1441 | amt_out_msat?: string; 1442 | 1443 | /** 1444 | * The number of nanoseconds elapsed since January 1, 1970 UTC when this 1445 | * circuit was completed. 1446 | * @format uint64 1447 | */ 1448 | timestamp_ns?: string; 1449 | } 1450 | 1451 | export interface LnrpcForwardingHistoryRequest { 1452 | /** 1453 | * Start time is the starting point of the forwarding history request. All 1454 | * records beyond this point will be included, respecting the end time, and 1455 | * the index offset. 1456 | * @format uint64 1457 | */ 1458 | start_time?: string; 1459 | 1460 | /** 1461 | * End time is the end point of the forwarding history request. The 1462 | * response will carry at most 50k records between the start time and the 1463 | * end time. The index offset can be used to implement pagination. 1464 | * @format uint64 1465 | */ 1466 | end_time?: string; 1467 | 1468 | /** 1469 | * Index offset is the offset in the time series to start at. As each 1470 | * response can only contain 50k records, callers can use this to skip 1471 | * around within a packed time series. 1472 | * @format int64 1473 | */ 1474 | index_offset?: number; 1475 | 1476 | /** 1477 | * The max number of events to return in the response to this query. 1478 | * @format int64 1479 | */ 1480 | num_max_events?: number; 1481 | } 1482 | 1483 | export interface LnrpcForwardingHistoryResponse { 1484 | /** 1485 | * A list of forwarding events from the time slice of the time series 1486 | * specified in the request. 1487 | */ 1488 | forwarding_events?: LnrpcForwardingEvent[]; 1489 | 1490 | /** 1491 | * The index of the last time in the set of returned forwarding events. Can 1492 | * be used to seek further, pagination style. 1493 | * @format int64 1494 | */ 1495 | last_offset_index?: number; 1496 | } 1497 | 1498 | export interface LnrpcFundingPsbtFinalize { 1499 | /** 1500 | * The funded PSBT that contains all witness data to send the exact channel 1501 | * capacity amount to the PK script returned in the open channel message in a 1502 | * previous step. Cannot be set at the same time as final_raw_tx. 1503 | * @format byte 1504 | */ 1505 | signed_psbt?: string; 1506 | 1507 | /** 1508 | * The pending channel ID of the channel to get the PSBT for. 1509 | * @format byte 1510 | */ 1511 | pending_chan_id?: string; 1512 | 1513 | /** 1514 | * As an alternative to the signed PSBT with all witness data, the final raw 1515 | * wire format transaction can also be specified directly. Cannot be set at the 1516 | * same time as signed_psbt. 1517 | * @format byte 1518 | */ 1519 | final_raw_tx?: string; 1520 | } 1521 | 1522 | export interface LnrpcFundingPsbtVerify { 1523 | /** 1524 | * The funded but not yet signed PSBT that sends the exact channel capacity 1525 | * amount to the PK script returned in the open channel message in a previous 1526 | * step. 1527 | * @format byte 1528 | */ 1529 | funded_psbt?: string; 1530 | 1531 | /** 1532 | * The pending channel ID of the channel to get the PSBT for. 1533 | * @format byte 1534 | */ 1535 | pending_chan_id?: string; 1536 | } 1537 | 1538 | export interface LnrpcFundingShim { 1539 | /** 1540 | * A channel shim where the channel point was fully constructed outside 1541 | * of lnd's wallet and the transaction might already be published. 1542 | */ 1543 | chan_point_shim?: LnrpcChanPointShim; 1544 | 1545 | /** 1546 | * A channel shim that uses a PSBT to fund and sign the channel funding 1547 | * transaction. 1548 | */ 1549 | psbt_shim?: LnrpcPsbtShim; 1550 | } 1551 | 1552 | export interface LnrpcFundingShimCancel { 1553 | /** 1554 | * The pending channel ID of the channel to cancel the funding shim for. 1555 | * @format byte 1556 | */ 1557 | pending_chan_id?: string; 1558 | } 1559 | 1560 | export type LnrpcFundingStateStepResp = object; 1561 | 1562 | export interface LnrpcFundingTransitionMsg { 1563 | /** 1564 | * The funding shim to register. This should be used before any 1565 | * channel funding has began by the remote party, as it is intended as a 1566 | * preparatory step for the full channel funding. 1567 | */ 1568 | shim_register?: LnrpcFundingShim; 1569 | 1570 | /** Used to cancel an existing registered funding shim. */ 1571 | shim_cancel?: LnrpcFundingShimCancel; 1572 | 1573 | /** 1574 | * Used to continue a funding flow that was initiated to be executed 1575 | * through a PSBT. This step verifies that the PSBT contains the correct 1576 | * outputs to fund the channel. 1577 | */ 1578 | psbt_verify?: LnrpcFundingPsbtVerify; 1579 | 1580 | /** 1581 | * Used to continue a funding flow that was initiated to be executed 1582 | * through a PSBT. This step finalizes the funded and signed PSBT, finishes 1583 | * negotiation with the peer and finally publishes the resulting funding 1584 | * transaction. 1585 | */ 1586 | psbt_finalize?: LnrpcFundingPsbtFinalize; 1587 | } 1588 | 1589 | export interface LnrpcGetInfoResponse { 1590 | /** The version of the LND software that the node is running. */ 1591 | version?: string; 1592 | 1593 | /** The SHA1 commit hash that the daemon is compiled with. */ 1594 | commit_hash?: string; 1595 | 1596 | /** The identity pubkey of the current node. */ 1597 | identity_pubkey?: string; 1598 | alias?: string; 1599 | color?: string; 1600 | 1601 | /** @format int64 */ 1602 | num_pending_channels?: number; 1603 | 1604 | /** @format int64 */ 1605 | num_active_channels?: number; 1606 | 1607 | /** @format int64 */ 1608 | num_inactive_channels?: number; 1609 | 1610 | /** @format int64 */ 1611 | num_peers?: number; 1612 | 1613 | /** @format int64 */ 1614 | block_height?: number; 1615 | block_hash?: string; 1616 | 1617 | /** @format int64 */ 1618 | best_header_timestamp?: string; 1619 | synced_to_chain?: boolean; 1620 | 1621 | /** Whether we consider ourselves synced with the public channel graph. */ 1622 | synced_to_graph?: boolean; 1623 | testnet?: boolean; 1624 | chains?: LnrpcChain[]; 1625 | 1626 | /** The URIs of the current node. */ 1627 | uris?: string[]; 1628 | 1629 | /** 1630 | * Features that our node has advertised in our init message, node 1631 | * announcements and invoices. 1632 | */ 1633 | features?: Record; 1634 | } 1635 | 1636 | export interface LnrpcGetRecoveryInfoResponse { 1637 | recovery_mode?: boolean; 1638 | recovery_finished?: boolean; 1639 | 1640 | /** 1641 | * The recovery progress, ranging from 0 to 1. 1642 | * @format double 1643 | */ 1644 | progress?: number; 1645 | } 1646 | 1647 | export interface LnrpcGraphTopologyUpdate { 1648 | node_updates?: LnrpcNodeUpdate[]; 1649 | channel_updates?: LnrpcChannelEdgeUpdate[]; 1650 | closed_chans?: LnrpcClosedChannelUpdate[]; 1651 | } 1652 | 1653 | export interface LnrpcHTLC { 1654 | incoming?: boolean; 1655 | 1656 | /** @format int64 */ 1657 | amount?: string; 1658 | 1659 | /** @format byte */ 1660 | hash_lock?: string; 1661 | 1662 | /** @format int64 */ 1663 | expiration_height?: number; 1664 | 1665 | /** 1666 | * Index identifying the htlc on the channel. 1667 | * @format uint64 1668 | */ 1669 | htlc_index?: string; 1670 | 1671 | /** 1672 | * If this HTLC is involved in a forwarding operation, this field indicates 1673 | * the forwarding channel. For an outgoing htlc, it is the incoming channel. 1674 | * For an incoming htlc, it is the outgoing channel. When the htlc 1675 | * originates from this node or this node is the final destination, 1676 | * forwarding_channel will be zero. The forwarding channel will also be zero 1677 | * for htlcs that need to be forwarded but don't have a forwarding decision 1678 | * persisted yet. 1679 | * @format uint64 1680 | */ 1681 | forwarding_channel?: string; 1682 | 1683 | /** 1684 | * Index identifying the htlc on the forwarding channel. 1685 | * @format uint64 1686 | */ 1687 | forwarding_htlc_index?: string; 1688 | } 1689 | 1690 | export interface LnrpcHTLCAttempt { 1691 | /** 1692 | * The unique ID that is used for this attempt. 1693 | * @format uint64 1694 | */ 1695 | attempt_id?: string; 1696 | 1697 | /** The status of the HTLC. */ 1698 | status?: HTLCAttemptHTLCStatus; 1699 | 1700 | /** The route taken by this HTLC. */ 1701 | route?: LnrpcRoute; 1702 | 1703 | /** 1704 | * The time in UNIX nanoseconds at which this HTLC was sent. 1705 | * @format int64 1706 | */ 1707 | attempt_time_ns?: string; 1708 | 1709 | /** 1710 | * The time in UNIX nanoseconds at which this HTLC was settled or failed. 1711 | * This value will not be set if the HTLC is still IN_FLIGHT. 1712 | * @format int64 1713 | */ 1714 | resolve_time_ns?: string; 1715 | 1716 | /** Detailed htlc failure info. */ 1717 | failure?: LnrpcFailure; 1718 | 1719 | /** 1720 | * The preimage that was used to settle the HTLC. 1721 | * @format byte 1722 | */ 1723 | preimage?: string; 1724 | } 1725 | 1726 | export interface LnrpcHop { 1727 | /** 1728 | * The unique channel ID for the channel. The first 3 bytes are the block 1729 | * height, the next 3 the index within the block, and the last 2 bytes are the 1730 | * output index for the channel. 1731 | * @format uint64 1732 | */ 1733 | chan_id?: string; 1734 | 1735 | /** @format int64 */ 1736 | chan_capacity?: string; 1737 | 1738 | /** @format int64 */ 1739 | amt_to_forward?: string; 1740 | 1741 | /** @format int64 */ 1742 | fee?: string; 1743 | 1744 | /** @format int64 */ 1745 | expiry?: number; 1746 | 1747 | /** @format int64 */ 1748 | amt_to_forward_msat?: string; 1749 | 1750 | /** @format int64 */ 1751 | fee_msat?: string; 1752 | 1753 | /** 1754 | * An optional public key of the hop. If the public key is given, the payment 1755 | * can be executed without relying on a copy of the channel graph. 1756 | */ 1757 | pub_key?: string; 1758 | 1759 | /** 1760 | * If set to true, then this hop will be encoded using the new variable length 1761 | * TLV format. Note that if any custom tlv_records below are specified, then 1762 | * this field MUST be set to true for them to be encoded properly. 1763 | */ 1764 | tlv_payload?: boolean; 1765 | 1766 | /** 1767 | * An optional TLV record that signals the use of an MPP payment. If present, 1768 | * the receiver will enforce that the same mpp_record is included in the final 1769 | * hop payload of all non-zero payments in the HTLC set. If empty, a regular 1770 | * single-shot payment is or was attempted. 1771 | */ 1772 | mpp_record?: LnrpcMPPRecord; 1773 | 1774 | /** 1775 | * An optional TLV record that signals the use of an AMP payment. If present, 1776 | * the receiver will treat all received payments including the same 1777 | * (payment_addr, set_id) pair as being part of one logical payment. The 1778 | * payment will be settled by XORing the root_share's together and deriving the 1779 | * child hashes and preimages according to BOLT XX. Must be used in conjunction 1780 | * with mpp_record. 1781 | */ 1782 | amp_record?: LnrpcAMPRecord; 1783 | 1784 | /** 1785 | * An optional set of key-value TLV records. This is useful within the context 1786 | * of the SendToRoute call as it allows callers to specify arbitrary K-V pairs 1787 | * to drop off at each hop within the onion. 1788 | */ 1789 | custom_records?: Record; 1790 | } 1791 | 1792 | export interface LnrpcHopHint { 1793 | /** The public key of the node at the start of the channel. */ 1794 | node_id?: string; 1795 | 1796 | /** 1797 | * The unique identifier of the channel. 1798 | * @format uint64 1799 | */ 1800 | chan_id?: string; 1801 | 1802 | /** 1803 | * The base fee of the channel denominated in millisatoshis. 1804 | * @format int64 1805 | */ 1806 | fee_base_msat?: number; 1807 | 1808 | /** 1809 | * The fee rate of the channel for sending one satoshi across it denominated in 1810 | * millionths of a satoshi. 1811 | * @format int64 1812 | */ 1813 | fee_proportional_millionths?: number; 1814 | 1815 | /** 1816 | * The time-lock delta of the channel. 1817 | * @format int64 1818 | */ 1819 | cltv_expiry_delta?: number; 1820 | } 1821 | 1822 | export enum LnrpcInitiator { 1823 | INITIATOR_UNKNOWN = 'INITIATOR_UNKNOWN', 1824 | INITIATOR_LOCAL = 'INITIATOR_LOCAL', 1825 | INITIATOR_REMOTE = 'INITIATOR_REMOTE', 1826 | INITIATOR_BOTH = 'INITIATOR_BOTH' 1827 | } 1828 | 1829 | export interface LnrpcInvoice { 1830 | /** 1831 | * An optional memo to attach along with the invoice. Used for record keeping 1832 | * purposes for the invoice's creator, and will also be set in the description 1833 | * field of the encoded payment request if the description_hash field is not 1834 | * being used. 1835 | */ 1836 | memo?: string; 1837 | 1838 | /** 1839 | * The hex-encoded preimage (32 byte) which will allow settling an incoming 1840 | * HTLC payable to this preimage. When using REST, this field must be encoded 1841 | * as base64. 1842 | * @format byte 1843 | */ 1844 | r_preimage?: string; 1845 | 1846 | /** 1847 | * The hash of the preimage. When using REST, this field must be encoded as 1848 | * base64. 1849 | * @format byte 1850 | */ 1851 | r_hash?: string; 1852 | 1853 | /** 1854 | * The fields value and value_msat are mutually exclusive. 1855 | * @format int64 1856 | */ 1857 | value?: string; 1858 | 1859 | /** 1860 | * The fields value and value_msat are mutually exclusive. 1861 | * @format int64 1862 | */ 1863 | value_msat?: string; 1864 | settled?: boolean; 1865 | 1866 | /** @format int64 */ 1867 | creation_date?: string; 1868 | 1869 | /** @format int64 */ 1870 | settle_date?: string; 1871 | 1872 | /** 1873 | * A bare-bones invoice for a payment within the Lightning Network. With the 1874 | * details of the invoice, the sender has all the data necessary to send a 1875 | * payment to the recipient. 1876 | */ 1877 | payment_request?: string; 1878 | 1879 | /** 1880 | * Hash (SHA-256) of a description of the payment. Used if the description of 1881 | * payment (memo) is too long to naturally fit within the description field 1882 | * of an encoded payment request. When using REST, this field must be encoded 1883 | * as base64. 1884 | * @format byte 1885 | */ 1886 | description_hash?: string; 1887 | 1888 | /** 1889 | * Payment request expiry time in seconds. Default is 3600 (1 hour). 1890 | * @format int64 1891 | */ 1892 | expiry?: string; 1893 | 1894 | /** Fallback on-chain address. */ 1895 | fallback_addr?: string; 1896 | 1897 | /** 1898 | * Delta to use for the time-lock of the CLTV extended to the final hop. 1899 | * @format uint64 1900 | */ 1901 | cltv_expiry?: string; 1902 | 1903 | /** 1904 | * Route hints that can each be individually used to assist in reaching the 1905 | * invoice's destination. 1906 | */ 1907 | route_hints?: LnrpcRouteHint[]; 1908 | 1909 | /** Whether this invoice should include routing hints for private channels. */ 1910 | private?: boolean; 1911 | 1912 | /** 1913 | * The "add" index of this invoice. Each newly created invoice will increment 1914 | * this index making it monotonically increasing. Callers to the 1915 | * SubscribeInvoices call can use this to instantly get notified of all added 1916 | * invoices with an add_index greater than this one. 1917 | * @format uint64 1918 | */ 1919 | add_index?: string; 1920 | 1921 | /** 1922 | * The "settle" index of this invoice. Each newly settled invoice will 1923 | * increment this index making it monotonically increasing. Callers to the 1924 | * SubscribeInvoices call can use this to instantly get notified of all 1925 | * settled invoices with an settle_index greater than this one. 1926 | * @format uint64 1927 | */ 1928 | settle_index?: string; 1929 | 1930 | /** 1931 | * Deprecated, use amt_paid_sat or amt_paid_msat. 1932 | * @format int64 1933 | */ 1934 | amt_paid?: string; 1935 | 1936 | /** 1937 | * The amount that was accepted for this invoice, in satoshis. This will ONLY 1938 | * be set if this invoice has been settled. We provide this field as if the 1939 | * invoice was created with a zero value, then we need to record what amount 1940 | * was ultimately accepted. Additionally, it's possible that the sender paid 1941 | * MORE that was specified in the original invoice. So we'll record that here 1942 | * as well. 1943 | * @format int64 1944 | */ 1945 | amt_paid_sat?: string; 1946 | 1947 | /** 1948 | * The amount that was accepted for this invoice, in millisatoshis. This will 1949 | * ONLY be set if this invoice has been settled. We provide this field as if 1950 | * the invoice was created with a zero value, then we need to record what 1951 | * amount was ultimately accepted. Additionally, it's possible that the sender 1952 | * paid MORE that was specified in the original invoice. So we'll record that 1953 | * here as well. 1954 | * @format int64 1955 | */ 1956 | amt_paid_msat?: string; 1957 | 1958 | /** The state the invoice is in. */ 1959 | state?: InvoiceInvoiceState; 1960 | 1961 | /** List of HTLCs paying to this invoice [EXPERIMENTAL]. */ 1962 | htlcs?: LnrpcInvoiceHTLC[]; 1963 | 1964 | /** List of features advertised on the invoice. */ 1965 | features?: Record; 1966 | 1967 | /** 1968 | * Indicates if this invoice was a spontaneous payment that arrived via keysend 1969 | * [EXPERIMENTAL]. 1970 | */ 1971 | is_keysend?: boolean; 1972 | 1973 | /** 1974 | * The payment address of this invoice. This value will be used in MPP 1975 | * payments, and also for newer invoies that always require the MPP paylaod 1976 | * for added end-to-end security. 1977 | * @format byte 1978 | */ 1979 | payment_addr?: string; 1980 | 1981 | /** Signals whether or not this is an AMP invoice. */ 1982 | is_amp?: boolean; 1983 | } 1984 | 1985 | export interface LnrpcInvoiceHTLC { 1986 | /** 1987 | * Short channel id over which the htlc was received. 1988 | * @format uint64 1989 | */ 1990 | chan_id?: string; 1991 | 1992 | /** 1993 | * Index identifying the htlc on the channel. 1994 | * @format uint64 1995 | */ 1996 | htlc_index?: string; 1997 | 1998 | /** 1999 | * The amount of the htlc in msat. 2000 | * @format uint64 2001 | */ 2002 | amt_msat?: string; 2003 | 2004 | /** 2005 | * Block height at which this htlc was accepted. 2006 | * @format int32 2007 | */ 2008 | accept_height?: number; 2009 | 2010 | /** 2011 | * Time at which this htlc was accepted. 2012 | * @format int64 2013 | */ 2014 | accept_time?: string; 2015 | 2016 | /** 2017 | * Time at which this htlc was settled or canceled. 2018 | * @format int64 2019 | */ 2020 | resolve_time?: string; 2021 | 2022 | /** 2023 | * Block height at which this htlc expires. 2024 | * @format int32 2025 | */ 2026 | expiry_height?: number; 2027 | 2028 | /** Current state the htlc is in. */ 2029 | state?: LnrpcInvoiceHTLCState; 2030 | 2031 | /** Custom tlv records. */ 2032 | custom_records?: Record; 2033 | 2034 | /** 2035 | * The total amount of the mpp payment in msat. 2036 | * @format uint64 2037 | */ 2038 | mpp_total_amt_msat?: string; 2039 | 2040 | /** Details relevant to AMP HTLCs, only populated if this is an AMP HTLC. */ 2041 | amp?: LnrpcAMP; 2042 | } 2043 | 2044 | export enum LnrpcInvoiceHTLCState { 2045 | ACCEPTED = 'ACCEPTED', 2046 | SETTLED = 'SETTLED', 2047 | CANCELED = 'CANCELED' 2048 | } 2049 | 2050 | export interface LnrpcKeyDescriptor { 2051 | /** 2052 | * The raw bytes of the key being identified. 2053 | * @format byte 2054 | */ 2055 | raw_key_bytes?: string; 2056 | 2057 | /** The key locator that identifies which key to use for signing. */ 2058 | key_loc?: LnrpcKeyLocator; 2059 | } 2060 | 2061 | export interface LnrpcKeyLocator { 2062 | /** 2063 | * The family of key being identified. 2064 | * @format int32 2065 | */ 2066 | key_family?: number; 2067 | 2068 | /** 2069 | * The precise index of the key being identified. 2070 | * @format int32 2071 | */ 2072 | key_index?: number; 2073 | } 2074 | 2075 | export interface LnrpcLightningAddress { 2076 | pubkey?: string; 2077 | host?: string; 2078 | } 2079 | 2080 | /** 2081 | * An individual vertex/node within the channel graph. A node is 2082 | connected to other nodes by one or more channel edges emanating from it. As the 2083 | graph is directed, a node will also have an incoming edge attached to it for 2084 | each outgoing edge. 2085 | */ 2086 | export interface LnrpcLightningNode { 2087 | /** @format int64 */ 2088 | last_update?: number; 2089 | pub_key?: string; 2090 | alias?: string; 2091 | addresses?: LnrpcNodeAddress[]; 2092 | color?: string; 2093 | features?: Record; 2094 | } 2095 | 2096 | export interface LnrpcListChannelsResponse { 2097 | channels?: LnrpcChannel[]; 2098 | } 2099 | 2100 | export interface LnrpcListInvoiceResponse { 2101 | /** 2102 | * A list of invoices from the time slice of the time series specified in the 2103 | * request. 2104 | */ 2105 | invoices?: LnrpcInvoice[]; 2106 | 2107 | /** 2108 | * The index of the last item in the set of returned invoices. This can be used 2109 | * to seek further, pagination style. 2110 | * @format uint64 2111 | */ 2112 | last_index_offset?: string; 2113 | 2114 | /** 2115 | * The index of the last item in the set of returned invoices. This can be used 2116 | * to seek backwards, pagination style. 2117 | * @format uint64 2118 | */ 2119 | first_index_offset?: string; 2120 | } 2121 | 2122 | export interface LnrpcListMacaroonIDsResponse { 2123 | /** The list of root key IDs that are in use. */ 2124 | root_key_ids?: string[]; 2125 | } 2126 | 2127 | export interface LnrpcListPaymentsResponse { 2128 | payments?: LnrpcPayment[]; 2129 | 2130 | /** 2131 | * The index of the first item in the set of returned payments. This can be 2132 | * used as the index_offset to continue seeking backwards in the next request. 2133 | * @format uint64 2134 | */ 2135 | first_index_offset?: string; 2136 | 2137 | /** 2138 | * The index of the last item in the set of returned payments. This can be used 2139 | * as the index_offset to continue seeking forwards in the next request. 2140 | * @format uint64 2141 | */ 2142 | last_index_offset?: string; 2143 | } 2144 | 2145 | export interface LnrpcListPeersResponse { 2146 | peers?: LnrpcPeer[]; 2147 | } 2148 | 2149 | export interface LnrpcListPermissionsResponse { 2150 | /** 2151 | * A map between all RPC method URIs and their required macaroon permissions to 2152 | * access them. 2153 | */ 2154 | method_permissions?: Record; 2155 | } 2156 | 2157 | export interface LnrpcListUnspentResponse { 2158 | utxos?: LnrpcUtxo[]; 2159 | } 2160 | 2161 | export interface LnrpcMPPRecord { 2162 | /** 2163 | * A unique, random identifier used to authenticate the sender as the intended 2164 | * payer of a multi-path payment. The payment_addr must be the same for all 2165 | * subpayments, and match the payment_addr provided in the receiver's invoice. 2166 | * The same payment_addr must be used on all subpayments. 2167 | * @format byte 2168 | */ 2169 | payment_addr?: string; 2170 | 2171 | /** 2172 | * The total amount in milli-satoshis being sent as part of a larger multi-path 2173 | * payment. The caller is responsible for ensuring subpayments to the same node 2174 | * and payment_hash sum exactly to total_amt_msat. The same 2175 | * total_amt_msat must be used on all subpayments. 2176 | * @format int64 2177 | */ 2178 | total_amt_msat?: string; 2179 | } 2180 | 2181 | export interface LnrpcMacaroonPermission { 2182 | /** The entity a permission grants access to. */ 2183 | entity?: string; 2184 | 2185 | /** The action that is granted. */ 2186 | action?: string; 2187 | } 2188 | 2189 | export interface LnrpcMacaroonPermissionList { 2190 | /** A list of macaroon permissions. */ 2191 | permissions?: LnrpcMacaroonPermission[]; 2192 | } 2193 | 2194 | export interface LnrpcMultiChanBackup { 2195 | /** Is the set of all channels that are included in this multi-channel backup. */ 2196 | chan_points?: LnrpcChannelPoint[]; 2197 | 2198 | /** 2199 | * A single encrypted blob containing all the static channel backups of the 2200 | * channel listed above. This can be stored as a single file or blob, and 2201 | * safely be replaced with any prior/future versions. When using REST, this 2202 | * field must be encoded as base64. 2203 | * @format byte 2204 | */ 2205 | multi_chan_backup?: string; 2206 | } 2207 | 2208 | export interface LnrpcNetworkInfo { 2209 | /** @format int64 */ 2210 | graph_diameter?: number; 2211 | 2212 | /** @format double */ 2213 | avg_out_degree?: number; 2214 | 2215 | /** @format int64 */ 2216 | max_out_degree?: number; 2217 | 2218 | /** @format int64 */ 2219 | num_nodes?: number; 2220 | 2221 | /** @format int64 */ 2222 | num_channels?: number; 2223 | 2224 | /** @format int64 */ 2225 | total_network_capacity?: string; 2226 | 2227 | /** @format double */ 2228 | avg_channel_size?: number; 2229 | 2230 | /** @format int64 */ 2231 | min_channel_size?: string; 2232 | 2233 | /** @format int64 */ 2234 | max_channel_size?: string; 2235 | 2236 | /** @format int64 */ 2237 | median_channel_size_sat?: string; 2238 | 2239 | /** 2240 | * The number of edges marked as zombies. 2241 | * @format uint64 2242 | */ 2243 | num_zombie_chans?: string; 2244 | } 2245 | 2246 | export interface LnrpcNewAddressResponse { 2247 | address?: string; 2248 | } 2249 | 2250 | export interface LnrpcNodeAddress { 2251 | network?: string; 2252 | addr?: string; 2253 | } 2254 | 2255 | export interface LnrpcNodeInfo { 2256 | /** 2257 | * An individual vertex/node within the channel graph. A node is 2258 | * connected to other nodes by one or more channel edges emanating from it. As 2259 | * the graph is directed, a node will also have an incoming edge attached to 2260 | * it for each outgoing edge. 2261 | */ 2262 | node?: LnrpcLightningNode; 2263 | 2264 | /** 2265 | * The total number of channels for the node. 2266 | * @format int64 2267 | */ 2268 | num_channels?: number; 2269 | 2270 | /** 2271 | * The sum of all channels capacity for the node, denominated in satoshis. 2272 | * @format int64 2273 | */ 2274 | total_capacity?: string; 2275 | 2276 | /** A list of all public channels for the node. */ 2277 | channels?: LnrpcChannelEdge[]; 2278 | } 2279 | 2280 | export enum LnrpcNodeMetricType { 2281 | UNKNOWN = 'UNKNOWN', 2282 | BETWEENNESS_CENTRALITY = 'BETWEENNESS_CENTRALITY' 2283 | } 2284 | 2285 | export interface LnrpcNodeMetricsResponse { 2286 | /** 2287 | * Betweenness centrality is the sum of the ratio of shortest paths that pass 2288 | * through the node for each pair of nodes in the graph (not counting paths 2289 | * starting or ending at this node). 2290 | * Map of node pubkey to betweenness centrality of the node. Normalized 2291 | * values are in the [0,1] closed interval. 2292 | */ 2293 | betweenness_centrality?: Record; 2294 | } 2295 | 2296 | export interface LnrpcNodePair { 2297 | /** 2298 | * The sending node of the pair. When using REST, this field must be encoded as 2299 | * base64. 2300 | * @format byte 2301 | */ 2302 | from?: string; 2303 | 2304 | /** 2305 | * The receiving node of the pair. When using REST, this field must be encoded 2306 | * as base64. 2307 | * @format byte 2308 | */ 2309 | to?: string; 2310 | } 2311 | 2312 | export interface LnrpcNodeUpdate { 2313 | /** Deprecated, use node_addresses. */ 2314 | addresses?: string[]; 2315 | identity_key?: string; 2316 | 2317 | /** 2318 | * Deprecated, use features. 2319 | * @format byte 2320 | */ 2321 | global_features?: string; 2322 | alias?: string; 2323 | color?: string; 2324 | node_addresses?: LnrpcNodeAddress[]; 2325 | 2326 | /** 2327 | * Features that the node has advertised in the init message, node 2328 | * announcements and invoices. 2329 | */ 2330 | features?: Record; 2331 | } 2332 | 2333 | export interface LnrpcOpenChannelRequest { 2334 | /** 2335 | * A manual fee rate set in sat/vbyte that should be used when crafting the 2336 | * funding transaction. 2337 | * @format uint64 2338 | */ 2339 | sat_per_vbyte?: string; 2340 | 2341 | /** 2342 | * The pubkey of the node to open a channel with. When using REST, this field 2343 | * must be encoded as base64. 2344 | * @format byte 2345 | */ 2346 | node_pubkey?: string; 2347 | 2348 | /** 2349 | * The hex encoded pubkey of the node to open a channel with. Deprecated now 2350 | * that the REST gateway supports base64 encoding of bytes fields. 2351 | */ 2352 | node_pubkey_string?: string; 2353 | 2354 | /** @format int64 */ 2355 | local_funding_amount?: string; 2356 | 2357 | /** @format int64 */ 2358 | push_sat?: string; 2359 | 2360 | /** 2361 | * The target number of blocks that the funding transaction should be 2362 | * confirmed by. 2363 | * @format int32 2364 | */ 2365 | target_conf?: number; 2366 | 2367 | /** 2368 | * Deprecated, use sat_per_vbyte. 2369 | * A manual fee rate set in sat/vbyte that should be used when crafting the 2370 | * funding transaction. 2371 | * @format int64 2372 | */ 2373 | sat_per_byte?: string; 2374 | 2375 | /** 2376 | * Whether this channel should be private, not announced to the greater 2377 | * network. 2378 | */ 2379 | private?: boolean; 2380 | 2381 | /** 2382 | * The minimum value in millisatoshi we will require for incoming HTLCs on 2383 | * the channel. 2384 | * @format int64 2385 | */ 2386 | min_htlc_msat?: string; 2387 | 2388 | /** 2389 | * The delay we require on the remote's commitment transaction. If this is 2390 | * not set, it will be scaled automatically with the channel size. 2391 | * @format int64 2392 | */ 2393 | remote_csv_delay?: number; 2394 | 2395 | /** 2396 | * The minimum number of confirmations each one of your outputs used for 2397 | * the funding transaction must satisfy. 2398 | * @format int32 2399 | */ 2400 | min_confs?: number; 2401 | 2402 | /** 2403 | * Whether unconfirmed outputs should be used as inputs for the funding 2404 | * transaction. 2405 | */ 2406 | spend_unconfirmed?: boolean; 2407 | 2408 | /** 2409 | * Close address is an optional address which specifies the address to which 2410 | * funds should be paid out to upon cooperative close. This field may only be 2411 | * set if the peer supports the option upfront feature bit (call listpeers 2412 | * to check). The remote peer will only accept cooperative closes to this 2413 | * address if it is set. 2414 | * 2415 | * Note: If this value is set on channel creation, you will *not* be able to 2416 | * cooperatively close out to a different address. 2417 | */ 2418 | close_address?: string; 2419 | 2420 | /** 2421 | * Funding shims are an optional argument that allow the caller to intercept 2422 | * certain funding functionality. For example, a shim can be provided to use a 2423 | * particular key for the commitment key (ideally cold) rather than use one 2424 | * that is generated by the wallet as normal, or signal that signing will be 2425 | * carried out in an interactive manner (PSBT based). 2426 | */ 2427 | funding_shim?: LnrpcFundingShim; 2428 | 2429 | /** 2430 | * The maximum amount of coins in millisatoshi that can be pending within 2431 | * the channel. It only applies to the remote party. 2432 | * @format uint64 2433 | */ 2434 | remote_max_value_in_flight_msat?: string; 2435 | 2436 | /** 2437 | * The maximum number of concurrent HTLCs we will allow the remote party to add 2438 | * to the commitment transaction. 2439 | * @format int64 2440 | */ 2441 | remote_max_htlcs?: number; 2442 | 2443 | /** 2444 | * Max local csv is the maximum csv delay we will allow for our own commitment 2445 | * transaction. 2446 | * @format int64 2447 | */ 2448 | max_local_csv?: number; 2449 | 2450 | /** 2451 | * The explicit commitment type to use. Note this field will only be used if 2452 | * the remote peer supports explicit channel negotiation. 2453 | */ 2454 | commitment_type?: LnrpcCommitmentType; 2455 | } 2456 | 2457 | export interface LnrpcOpenStatusUpdate { 2458 | /** 2459 | * Signals that the channel is now fully negotiated and the funding 2460 | * transaction published. 2461 | */ 2462 | chan_pending?: LnrpcPendingUpdate; 2463 | 2464 | /** 2465 | * Signals that the channel's funding transaction has now reached the 2466 | * required number of confirmations on chain and can be used. 2467 | */ 2468 | chan_open?: LnrpcChannelOpenUpdate; 2469 | 2470 | /** 2471 | * Signals that the funding process has been suspended and the construction 2472 | * of a PSBT that funds the channel PK script is now required. 2473 | */ 2474 | psbt_fund?: LnrpcReadyForPsbtFunding; 2475 | 2476 | /** 2477 | * The pending channel ID of the created channel. This value may be used to 2478 | * further the funding flow manually via the FundingStateStep method. 2479 | * @format byte 2480 | */ 2481 | pending_chan_id?: string; 2482 | } 2483 | 2484 | export interface LnrpcOutPoint { 2485 | /** 2486 | * Raw bytes representing the transaction id. 2487 | * @format byte 2488 | */ 2489 | txid_bytes?: string; 2490 | 2491 | /** Reversed, hex-encoded string representing the transaction id. */ 2492 | txid_str?: string; 2493 | 2494 | /** 2495 | * The index of the output on the transaction. 2496 | * @format int64 2497 | */ 2498 | output_index?: number; 2499 | } 2500 | 2501 | export interface LnrpcPayReq { 2502 | destination?: string; 2503 | payment_hash?: string; 2504 | 2505 | /** @format int64 */ 2506 | num_satoshis?: string; 2507 | 2508 | /** @format int64 */ 2509 | timestamp?: string; 2510 | 2511 | /** @format int64 */ 2512 | expiry?: string; 2513 | description?: string; 2514 | description_hash?: string; 2515 | fallback_addr?: string; 2516 | 2517 | /** @format int64 */ 2518 | cltv_expiry?: string; 2519 | route_hints?: LnrpcRouteHint[]; 2520 | 2521 | /** @format byte */ 2522 | payment_addr?: string; 2523 | 2524 | /** @format int64 */ 2525 | num_msat?: string; 2526 | features?: Record; 2527 | } 2528 | 2529 | export interface LnrpcPayment { 2530 | payment_hash?: string; 2531 | 2532 | /** 2533 | * Deprecated, use value_sat or value_msat. 2534 | * @format int64 2535 | */ 2536 | value?: string; 2537 | 2538 | /** @format int64 */ 2539 | creation_date?: string; 2540 | 2541 | /** 2542 | * Deprecated, use fee_sat or fee_msat. 2543 | * @format int64 2544 | */ 2545 | fee?: string; 2546 | payment_preimage?: string; 2547 | 2548 | /** @format int64 */ 2549 | value_sat?: string; 2550 | 2551 | /** @format int64 */ 2552 | value_msat?: string; 2553 | 2554 | /** The optional payment request being fulfilled. */ 2555 | payment_request?: string; 2556 | 2557 | /** The status of the payment. */ 2558 | status?: PaymentPaymentStatus; 2559 | 2560 | /** @format int64 */ 2561 | fee_sat?: string; 2562 | 2563 | /** @format int64 */ 2564 | fee_msat?: string; 2565 | 2566 | /** 2567 | * The time in UNIX nanoseconds at which the payment was created. 2568 | * @format int64 2569 | */ 2570 | creation_time_ns?: string; 2571 | 2572 | /** The HTLCs made in attempt to settle the payment. */ 2573 | htlcs?: LnrpcHTLCAttempt[]; 2574 | 2575 | /** 2576 | * The creation index of this payment. Each payment can be uniquely identified 2577 | * by this index, which may not strictly increment by 1 for payments made in 2578 | * older versions of lnd. 2579 | * @format uint64 2580 | */ 2581 | payment_index?: string; 2582 | 2583 | /** 2584 | * - FAILURE_REASON_NONE: Payment isn't failed (yet). 2585 | * - FAILURE_REASON_TIMEOUT: There are more routes to try, but the payment timeout was exceeded. 2586 | * - FAILURE_REASON_NO_ROUTE: All possible routes were tried and failed permanently. Or were no 2587 | * routes to the destination at all. 2588 | * - FAILURE_REASON_ERROR: A non-recoverable error has occured. 2589 | * - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS: Payment details incorrect (unknown hash, invalid amt or 2590 | * invalid final cltv delta) 2591 | * - FAILURE_REASON_INSUFFICIENT_BALANCE: Insufficient local balance. 2592 | */ 2593 | failure_reason?: LnrpcPaymentFailureReason; 2594 | } 2595 | 2596 | /** 2597 | * - FAILURE_REASON_NONE: Payment isn't failed (yet). 2598 | - FAILURE_REASON_TIMEOUT: There are more routes to try, but the payment timeout was exceeded. 2599 | - FAILURE_REASON_NO_ROUTE: All possible routes were tried and failed permanently. Or were no 2600 | routes to the destination at all. 2601 | - FAILURE_REASON_ERROR: A non-recoverable error has occured. 2602 | - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS: Payment details incorrect (unknown hash, invalid amt or 2603 | invalid final cltv delta) 2604 | - FAILURE_REASON_INSUFFICIENT_BALANCE: Insufficient local balance. 2605 | */ 2606 | export enum LnrpcPaymentFailureReason { 2607 | FAILURE_REASON_NONE = 'FAILURE_REASON_NONE', 2608 | FAILURE_REASON_TIMEOUT = 'FAILURE_REASON_TIMEOUT', 2609 | FAILURE_REASON_NO_ROUTE = 'FAILURE_REASON_NO_ROUTE', 2610 | FAILURE_REASON_ERROR = 'FAILURE_REASON_ERROR', 2611 | FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 'FAILURE_REASON_INCORRECT_PAYMENT_DETAILS', 2612 | FAILURE_REASON_INSUFFICIENT_BALANCE = 'FAILURE_REASON_INSUFFICIENT_BALANCE' 2613 | } 2614 | 2615 | export interface LnrpcPeer { 2616 | pub_key?: string; 2617 | address?: string; 2618 | 2619 | /** @format uint64 */ 2620 | bytes_sent?: string; 2621 | 2622 | /** @format uint64 */ 2623 | bytes_recv?: string; 2624 | 2625 | /** @format int64 */ 2626 | sat_sent?: string; 2627 | 2628 | /** @format int64 */ 2629 | sat_recv?: string; 2630 | inbound?: boolean; 2631 | 2632 | /** @format int64 */ 2633 | ping_time?: string; 2634 | 2635 | /** The type of sync we are currently performing with this peer. */ 2636 | sync_type?: PeerSyncType; 2637 | 2638 | /** Features advertised by the remote peer in their init message. */ 2639 | features?: Record; 2640 | 2641 | /** 2642 | * The latest errors received from our peer with timestamps, limited to the 10 2643 | * most recent errors. These errors are tracked across peer connections, but 2644 | * are not persisted across lnd restarts. Note that these errors are only 2645 | * stored for peers that we have channels open with, to prevent peers from 2646 | * spamming us with errors at no cost. 2647 | */ 2648 | errors?: LnrpcTimestampedError[]; 2649 | 2650 | /** 2651 | * The number of times we have recorded this peer going offline or coming 2652 | * online, recorded across restarts. Note that this value is decreased over 2653 | * time if the peer has not recently flapped, so that we can forgive peers 2654 | * with historically high flap counts. 2655 | * @format int32 2656 | */ 2657 | flap_count?: number; 2658 | 2659 | /** 2660 | * The timestamp of the last flap we observed for this peer. If this value is 2661 | * zero, we have not observed any flaps for this peer. 2662 | * @format int64 2663 | */ 2664 | last_flap_ns?: string; 2665 | 2666 | /** 2667 | * The last ping payload the peer has sent to us. 2668 | * @format byte 2669 | */ 2670 | last_ping_payload?: string; 2671 | } 2672 | 2673 | export interface LnrpcPeerEvent { 2674 | /** The identity pubkey of the peer. */ 2675 | pub_key?: string; 2676 | type?: PeerEventEventType; 2677 | } 2678 | 2679 | export interface LnrpcPendingChannelsResponse { 2680 | /** @format int64 */ 2681 | total_limbo_balance?: string; 2682 | pending_open_channels?: PendingChannelsResponsePendingOpenChannel[]; 2683 | 2684 | /** 2685 | * Deprecated: Channels pending closing previously contained cooperatively 2686 | * closed channels with a single confirmation. These channels are now 2687 | * considered closed from the time we see them on chain. 2688 | */ 2689 | pending_closing_channels?: PendingChannelsResponseClosedChannel[]; 2690 | pending_force_closing_channels?: PendingChannelsResponseForceClosedChannel[]; 2691 | waiting_close_channels?: PendingChannelsResponseWaitingCloseChannel[]; 2692 | } 2693 | 2694 | export interface LnrpcPendingHTLC { 2695 | incoming?: boolean; 2696 | 2697 | /** @format int64 */ 2698 | amount?: string; 2699 | outpoint?: string; 2700 | 2701 | /** @format int64 */ 2702 | maturity_height?: number; 2703 | 2704 | /** 2705 | * The number of blocks remaining until the current stage can be swept. 2706 | * Negative values indicate how many blocks have passed since becoming 2707 | * mature. 2708 | * @format int32 2709 | */ 2710 | blocks_til_maturity?: number; 2711 | 2712 | /** @format int64 */ 2713 | stage?: number; 2714 | } 2715 | 2716 | export interface LnrpcPendingUpdate { 2717 | /** @format byte */ 2718 | txid?: string; 2719 | 2720 | /** @format int64 */ 2721 | output_index?: number; 2722 | } 2723 | 2724 | export interface LnrpcPolicyUpdateRequest { 2725 | /** If set, then this update applies to all currently active channels. */ 2726 | global?: boolean; 2727 | 2728 | /** If set, this update will target a specific channel. */ 2729 | chan_point?: LnrpcChannelPoint; 2730 | 2731 | /** 2732 | * The base fee charged regardless of the number of milli-satoshis sent. 2733 | * @format int64 2734 | */ 2735 | base_fee_msat?: string; 2736 | 2737 | /** 2738 | * The effective fee rate in milli-satoshis. The precision of this value 2739 | * goes up to 6 decimal places, so 1e-6. 2740 | * @format double 2741 | */ 2742 | fee_rate?: number; 2743 | 2744 | /** 2745 | * The required timelock delta for HTLCs forwarded over the channel. 2746 | * @format int64 2747 | */ 2748 | time_lock_delta?: number; 2749 | 2750 | /** 2751 | * If set, the maximum HTLC size in milli-satoshis. If unset, the maximum 2752 | * HTLC will be unchanged. 2753 | * @format uint64 2754 | */ 2755 | max_htlc_msat?: string; 2756 | 2757 | /** 2758 | * The minimum HTLC size in milli-satoshis. Only applied if 2759 | * min_htlc_msat_specified is true. 2760 | * @format uint64 2761 | */ 2762 | min_htlc_msat?: string; 2763 | 2764 | /** If true, min_htlc_msat is applied. */ 2765 | min_htlc_msat_specified?: boolean; 2766 | } 2767 | 2768 | export type LnrpcPolicyUpdateResponse = object; 2769 | 2770 | export interface LnrpcPsbtShim { 2771 | /** 2772 | * A unique identifier of 32 random bytes that will be used as the pending 2773 | * channel ID to identify the PSBT state machine when interacting with it and 2774 | * on the wire protocol to initiate the funding request. 2775 | * @format byte 2776 | */ 2777 | pending_chan_id?: string; 2778 | 2779 | /** 2780 | * An optional base PSBT the new channel output will be added to. If this is 2781 | * non-empty, it must be a binary serialized PSBT. 2782 | * @format byte 2783 | */ 2784 | base_psbt?: string; 2785 | 2786 | /** 2787 | * If a channel should be part of a batch (multiple channel openings in one 2788 | * transaction), it can be dangerous if the whole batch transaction is 2789 | * published too early before all channel opening negotiations are completed. 2790 | * This flag prevents this particular channel from broadcasting the transaction 2791 | * after the negotiation with the remote peer. In a batch of channel openings 2792 | * this flag should be set to true for every channel but the very last. 2793 | */ 2794 | no_publish?: boolean; 2795 | } 2796 | 2797 | export interface LnrpcQueryRoutesResponse { 2798 | /** 2799 | * The route that results from the path finding operation. This is still a 2800 | * repeated field to retain backwards compatibility. 2801 | */ 2802 | routes?: LnrpcRoute[]; 2803 | 2804 | /** @format double */ 2805 | success_prob?: number; 2806 | } 2807 | 2808 | export interface LnrpcReadyForPsbtFunding { 2809 | /** 2810 | * The P2WSH address of the channel funding multisig address that the below 2811 | * specified amount in satoshis needs to be sent to. 2812 | */ 2813 | funding_address?: string; 2814 | 2815 | /** 2816 | * The exact amount in satoshis that needs to be sent to the above address to 2817 | * fund the pending channel. 2818 | * @format int64 2819 | */ 2820 | funding_amount?: string; 2821 | 2822 | /** 2823 | * A raw PSBT that contains the pending channel output. If a base PSBT was 2824 | * provided in the PsbtShim, this is the base PSBT with one additional output. 2825 | * If no base PSBT was specified, this is an otherwise empty PSBT with exactly 2826 | * one output. 2827 | * @format byte 2828 | */ 2829 | psbt?: string; 2830 | } 2831 | 2832 | export interface LnrpcResolution { 2833 | /** The type of output we are resolving. */ 2834 | resolution_type?: LnrpcResolutionType; 2835 | 2836 | /** The outcome of our on chain action that resolved the outpoint. */ 2837 | outcome?: LnrpcResolutionOutcome; 2838 | 2839 | /** The outpoint that was spent by the resolution. */ 2840 | outpoint?: LnrpcOutPoint; 2841 | 2842 | /** 2843 | * The amount that was claimed by the resolution. 2844 | * @format uint64 2845 | */ 2846 | amount_sat?: string; 2847 | 2848 | /** 2849 | * The hex-encoded transaction ID of the sweep transaction that spent the 2850 | * output. 2851 | */ 2852 | sweep_txid?: string; 2853 | } 2854 | 2855 | /** 2856 | * - OUTCOME_UNKNOWN: Outcome unknown. 2857 | - CLAIMED: An output was claimed on chain. 2858 | - UNCLAIMED: An output was left unclaimed on chain. 2859 | - ABANDONED: ResolverOutcomeAbandoned indicates that an output that we did not 2860 | claim on chain, for example an anchor that we did not sweep and a 2861 | third party claimed on chain, or a htlc that we could not decode 2862 | so left unclaimed. 2863 | - FIRST_STAGE: If we force closed our channel, our htlcs need to be claimed in two 2864 | stages. This outcome represents the broadcast of a timeout or success 2865 | transaction for this two stage htlc claim. 2866 | - TIMEOUT: A htlc was timed out on chain. 2867 | */ 2868 | export enum LnrpcResolutionOutcome { 2869 | OUTCOME_UNKNOWN = 'OUTCOME_UNKNOWN', 2870 | CLAIMED = 'CLAIMED', 2871 | UNCLAIMED = 'UNCLAIMED', 2872 | ABANDONED = 'ABANDONED', 2873 | FIRST_STAGE = 'FIRST_STAGE', 2874 | TIMEOUT = 'TIMEOUT' 2875 | } 2876 | 2877 | /** 2878 | * - ANCHOR: We resolved an anchor output. 2879 | - INCOMING_HTLC: We are resolving an incoming htlc on chain. This if this htlc is 2880 | claimed, we swept the incoming htlc with the preimage. If it is timed 2881 | out, our peer swept the timeout path. 2882 | - OUTGOING_HTLC: We are resolving an outgoing htlc on chain. If this htlc is claimed, 2883 | the remote party swept the htlc with the preimage. If it is timed out, 2884 | we swept it with the timeout path. 2885 | - COMMIT: We force closed and need to sweep our time locked commitment output. 2886 | */ 2887 | export enum LnrpcResolutionType { 2888 | TYPE_UNKNOWN = 'TYPE_UNKNOWN', 2889 | ANCHOR = 'ANCHOR', 2890 | INCOMING_HTLC = 'INCOMING_HTLC', 2891 | OUTGOING_HTLC = 'OUTGOING_HTLC', 2892 | COMMIT = 'COMMIT' 2893 | } 2894 | 2895 | export type LnrpcRestoreBackupResponse = object; 2896 | 2897 | export interface LnrpcRestoreChanBackupRequest { 2898 | /** The channels to restore as a list of channel/backup pairs. */ 2899 | chan_backups?: LnrpcChannelBackups; 2900 | 2901 | /** 2902 | * The channels to restore in the packed multi backup format. When using 2903 | * REST, this field must be encoded as base64. 2904 | * @format byte 2905 | */ 2906 | multi_chan_backup?: string; 2907 | } 2908 | 2909 | /** 2910 | * A path through the channel graph which runs over one or more channels in 2911 | succession. This struct carries all the information required to craft the 2912 | Sphinx onion packet, and send the payment along the first hop in the path. A 2913 | route is only selected as valid if all the channels have sufficient capacity to 2914 | carry the initial payment amount after fees are accounted for. 2915 | */ 2916 | export interface LnrpcRoute { 2917 | /** 2918 | * The cumulative (final) time lock across the entire route. This is the CLTV 2919 | * value that should be extended to the first hop in the route. All other hops 2920 | * will decrement the time-lock as advertised, leaving enough time for all 2921 | * hops to wait for or present the payment preimage to complete the payment. 2922 | * @format int64 2923 | */ 2924 | total_time_lock?: number; 2925 | 2926 | /** 2927 | * The sum of the fees paid at each hop within the final route. In the case 2928 | * of a one-hop payment, this value will be zero as we don't need to pay a fee 2929 | * to ourselves. 2930 | * @format int64 2931 | */ 2932 | total_fees?: string; 2933 | 2934 | /** 2935 | * The total amount of funds required to complete a payment over this route. 2936 | * This value includes the cumulative fees at each hop. As a result, the HTLC 2937 | * extended to the first-hop in the route will need to have at least this many 2938 | * satoshis, otherwise the route will fail at an intermediate node due to an 2939 | * insufficient amount of fees. 2940 | * @format int64 2941 | */ 2942 | total_amt?: string; 2943 | 2944 | /** Contains details concerning the specific forwarding details at each hop. */ 2945 | hops?: LnrpcHop[]; 2946 | 2947 | /** 2948 | * The total fees in millisatoshis. 2949 | * @format int64 2950 | */ 2951 | total_fees_msat?: string; 2952 | 2953 | /** 2954 | * The total amount in millisatoshis. 2955 | * @format int64 2956 | */ 2957 | total_amt_msat?: string; 2958 | } 2959 | 2960 | export interface LnrpcRouteHint { 2961 | /** 2962 | * A list of hop hints that when chained together can assist in reaching a 2963 | * specific destination. 2964 | */ 2965 | hop_hints?: LnrpcHopHint[]; 2966 | } 2967 | 2968 | export interface LnrpcRoutingPolicy { 2969 | /** @format int64 */ 2970 | time_lock_delta?: number; 2971 | 2972 | /** @format int64 */ 2973 | min_htlc?: string; 2974 | 2975 | /** @format int64 */ 2976 | fee_base_msat?: string; 2977 | 2978 | /** @format int64 */ 2979 | fee_rate_milli_msat?: string; 2980 | disabled?: boolean; 2981 | 2982 | /** @format uint64 */ 2983 | max_htlc_msat?: string; 2984 | 2985 | /** @format int64 */ 2986 | last_update?: number; 2987 | } 2988 | 2989 | export interface LnrpcSendCoinsRequest { 2990 | addr?: string; 2991 | 2992 | /** @format int64 */ 2993 | amount?: string; 2994 | 2995 | /** 2996 | * The target number of blocks that this transaction should be confirmed 2997 | * by. 2998 | * @format int32 2999 | */ 3000 | target_conf?: number; 3001 | 3002 | /** 3003 | * A manual fee rate set in sat/vbyte that should be used when crafting the 3004 | * transaction. 3005 | * @format uint64 3006 | */ 3007 | sat_per_vbyte?: string; 3008 | 3009 | /** 3010 | * Deprecated, use sat_per_vbyte. 3011 | * A manual fee rate set in sat/vbyte that should be used when crafting the 3012 | * transaction. 3013 | * @format int64 3014 | */ 3015 | sat_per_byte?: string; 3016 | 3017 | /** 3018 | * If set, then the amount field will be ignored, and lnd will attempt to 3019 | * send all the coins under control of the internal wallet to the specified 3020 | * address. 3021 | */ 3022 | send_all?: boolean; 3023 | 3024 | /** An optional label for the transaction, limited to 500 characters. */ 3025 | label?: string; 3026 | 3027 | /** 3028 | * The minimum number of confirmations each one of your outputs used for 3029 | * the transaction must satisfy. 3030 | * @format int32 3031 | */ 3032 | min_confs?: number; 3033 | 3034 | /** Whether unconfirmed outputs should be used as inputs for the transaction. */ 3035 | spend_unconfirmed?: boolean; 3036 | } 3037 | 3038 | export interface LnrpcSendCoinsResponse { 3039 | txid?: string; 3040 | } 3041 | 3042 | export interface LnrpcSendManyRequest { 3043 | AddrToAmount?: Record; 3044 | 3045 | /** 3046 | * The target number of blocks that this transaction should be confirmed 3047 | * by. 3048 | * @format int32 3049 | */ 3050 | target_conf?: number; 3051 | 3052 | /** 3053 | * A manual fee rate set in sat/vbyte that should be used when crafting the 3054 | * transaction. 3055 | * @format uint64 3056 | */ 3057 | sat_per_vbyte?: string; 3058 | 3059 | /** 3060 | * Deprecated, use sat_per_vbyte. 3061 | * A manual fee rate set in sat/vbyte that should be used when crafting the 3062 | * transaction. 3063 | * @format int64 3064 | */ 3065 | sat_per_byte?: string; 3066 | 3067 | /** An optional label for the transaction, limited to 500 characters. */ 3068 | label?: string; 3069 | 3070 | /** 3071 | * The minimum number of confirmations each one of your outputs used for 3072 | * the transaction must satisfy. 3073 | * @format int32 3074 | */ 3075 | min_confs?: number; 3076 | 3077 | /** Whether unconfirmed outputs should be used as inputs for the transaction. */ 3078 | spend_unconfirmed?: boolean; 3079 | } 3080 | 3081 | export interface LnrpcSendManyResponse { 3082 | txid?: string; 3083 | } 3084 | 3085 | export interface LnrpcSendRequest { 3086 | /** 3087 | * The identity pubkey of the payment recipient. When using REST, this field 3088 | * must be encoded as base64. 3089 | * @format byte 3090 | */ 3091 | dest?: string; 3092 | 3093 | /** 3094 | * The hex-encoded identity pubkey of the payment recipient. Deprecated now 3095 | * that the REST gateway supports base64 encoding of bytes fields. 3096 | */ 3097 | dest_string?: string; 3098 | 3099 | /** 3100 | * The amount to send expressed in satoshis. 3101 | * 3102 | * The fields amt and amt_msat are mutually exclusive. 3103 | * @format int64 3104 | */ 3105 | amt?: string; 3106 | 3107 | /** 3108 | * The amount to send expressed in millisatoshis. 3109 | * 3110 | * The fields amt and amt_msat are mutually exclusive. 3111 | * @format int64 3112 | */ 3113 | amt_msat?: string; 3114 | 3115 | /** 3116 | * The hash to use within the payment's HTLC. When using REST, this field 3117 | * must be encoded as base64. 3118 | * @format byte 3119 | */ 3120 | payment_hash?: string; 3121 | 3122 | /** 3123 | * The hex-encoded hash to use within the payment's HTLC. Deprecated now 3124 | * that the REST gateway supports base64 encoding of bytes fields. 3125 | */ 3126 | payment_hash_string?: string; 3127 | 3128 | /** 3129 | * A bare-bones invoice for a payment within the Lightning Network. With the 3130 | * details of the invoice, the sender has all the data necessary to send a 3131 | * payment to the recipient. 3132 | */ 3133 | payment_request?: string; 3134 | 3135 | /** 3136 | * The CLTV delta from the current height that should be used to set the 3137 | * timelock for the final hop. 3138 | * @format int32 3139 | */ 3140 | final_cltv_delta?: number; 3141 | 3142 | /** 3143 | * The maximum number of satoshis that will be paid as a fee of the payment. 3144 | * This value can be represented either as a percentage of the amount being 3145 | * sent, or as a fixed amount of the maximum fee the user is willing the pay to 3146 | * send the payment. 3147 | */ 3148 | fee_limit?: LnrpcFeeLimit; 3149 | 3150 | /** 3151 | * The channel id of the channel that must be taken to the first hop. If zero, 3152 | * any channel may be used. 3153 | * @format uint64 3154 | */ 3155 | outgoing_chan_id?: string; 3156 | 3157 | /** 3158 | * The pubkey of the last hop of the route. If empty, any hop may be used. 3159 | * @format byte 3160 | */ 3161 | last_hop_pubkey?: string; 3162 | 3163 | /** 3164 | * An optional maximum total time lock for the route. This should not exceed 3165 | * lnd's `--max-cltv-expiry` setting. If zero, then the value of 3166 | * `--max-cltv-expiry` is enforced. 3167 | * @format int64 3168 | */ 3169 | cltv_limit?: number; 3170 | 3171 | /** 3172 | * An optional field that can be used to pass an arbitrary set of TLV records 3173 | * to a peer which understands the new records. This can be used to pass 3174 | * application specific data during the payment attempt. Record types are 3175 | * required to be in the custom range >= 65536. When using REST, the values 3176 | * must be encoded as base64. 3177 | */ 3178 | dest_custom_records?: Record; 3179 | 3180 | /** If set, circular payments to self are permitted. */ 3181 | allow_self_payment?: boolean; 3182 | 3183 | /** 3184 | * Features assumed to be supported by the final node. All transitive feature 3185 | * dependencies must also be set properly. For a given feature bit pair, either 3186 | * optional or remote may be set, but not both. If this field is nil or empty, 3187 | * the router will try to load destination features from the graph as a 3188 | * fallback. 3189 | */ 3190 | dest_features?: LnrpcFeatureBit[]; 3191 | 3192 | /** 3193 | * The payment address of the generated invoice. 3194 | * @format byte 3195 | */ 3196 | payment_addr?: string; 3197 | } 3198 | 3199 | export interface LnrpcSendResponse { 3200 | payment_error?: string; 3201 | 3202 | /** @format byte */ 3203 | payment_preimage?: string; 3204 | 3205 | /** 3206 | * A path through the channel graph which runs over one or more channels in 3207 | * succession. This struct carries all the information required to craft the 3208 | * Sphinx onion packet, and send the payment along the first hop in the path. A 3209 | * route is only selected as valid if all the channels have sufficient capacity to 3210 | * carry the initial payment amount after fees are accounted for. 3211 | */ 3212 | payment_route?: LnrpcRoute; 3213 | 3214 | /** @format byte */ 3215 | payment_hash?: string; 3216 | } 3217 | 3218 | export interface LnrpcSendToRouteRequest { 3219 | /** 3220 | * The payment hash to use for the HTLC. When using REST, this field must be 3221 | * encoded as base64. 3222 | * @format byte 3223 | */ 3224 | payment_hash?: string; 3225 | 3226 | /** 3227 | * An optional hex-encoded payment hash to be used for the HTLC. Deprecated now 3228 | * that the REST gateway supports base64 encoding of bytes fields. 3229 | */ 3230 | payment_hash_string?: string; 3231 | 3232 | /** Route that should be used to attempt to complete the payment. */ 3233 | route?: LnrpcRoute; 3234 | } 3235 | 3236 | export interface LnrpcSignMessageRequest { 3237 | /** 3238 | * The message to be signed. When using REST, this field must be encoded as 3239 | * base64. 3240 | * @format byte 3241 | */ 3242 | msg?: string; 3243 | } 3244 | 3245 | export interface LnrpcSignMessageResponse { 3246 | signature?: string; 3247 | } 3248 | 3249 | export type LnrpcStopRequest = object; 3250 | 3251 | export type LnrpcStopResponse = object; 3252 | 3253 | export interface LnrpcTimestampedError { 3254 | /** 3255 | * The unix timestamp in seconds when the error occurred. 3256 | * @format uint64 3257 | */ 3258 | timestamp?: string; 3259 | 3260 | /** The string representation of the error sent by our peer. */ 3261 | error?: string; 3262 | } 3263 | 3264 | export interface LnrpcTransaction { 3265 | tx_hash?: string; 3266 | 3267 | /** @format int64 */ 3268 | amount?: string; 3269 | 3270 | /** @format int32 */ 3271 | num_confirmations?: number; 3272 | block_hash?: string; 3273 | 3274 | /** @format int32 */ 3275 | block_height?: number; 3276 | 3277 | /** @format int64 */ 3278 | time_stamp?: string; 3279 | 3280 | /** @format int64 */ 3281 | total_fees?: string; 3282 | dest_addresses?: string[]; 3283 | 3284 | /** The raw transaction hex. */ 3285 | raw_tx_hex?: string; 3286 | 3287 | /** A label that was optionally set on transaction broadcast. */ 3288 | label?: string; 3289 | } 3290 | 3291 | export interface LnrpcTransactionDetails { 3292 | /** The list of transactions relevant to the wallet. */ 3293 | transactions?: LnrpcTransaction[]; 3294 | } 3295 | 3296 | export interface LnrpcUtxo { 3297 | /** 3298 | * - `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) 3299 | * - `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) 3300 | */ 3301 | address_type?: LnrpcAddressType; 3302 | address?: string; 3303 | 3304 | /** @format int64 */ 3305 | amount_sat?: string; 3306 | pk_script?: string; 3307 | outpoint?: LnrpcOutPoint; 3308 | 3309 | /** @format int64 */ 3310 | confirmations?: string; 3311 | } 3312 | 3313 | export type LnrpcVerifyChanBackupResponse = object; 3314 | 3315 | export interface LnrpcVerifyMessageRequest { 3316 | /** 3317 | * The message over which the signature is to be verified. When using REST, 3318 | * this field must be encoded as base64. 3319 | * @format byte 3320 | */ 3321 | msg?: string; 3322 | signature?: string; 3323 | } 3324 | 3325 | export interface LnrpcVerifyMessageResponse { 3326 | valid?: boolean; 3327 | pubkey?: string; 3328 | } 3329 | 3330 | export interface LnrpcWalletAccountBalance { 3331 | /** 3332 | * The confirmed balance of the account (with >= 1 confirmations). 3333 | * @format int64 3334 | */ 3335 | confirmed_balance?: string; 3336 | 3337 | /** 3338 | * The unconfirmed balance of the account (with 0 confirmations). 3339 | * @format int64 3340 | */ 3341 | unconfirmed_balance?: string; 3342 | } 3343 | 3344 | export interface LnrpcWalletBalanceResponse { 3345 | /** @format int64 */ 3346 | total_balance?: string; 3347 | 3348 | /** @format int64 */ 3349 | confirmed_balance?: string; 3350 | 3351 | /** @format int64 */ 3352 | unconfirmed_balance?: string; 3353 | 3354 | /** A mapping of each wallet account's name to its balance. */ 3355 | account_balance?: Record; 3356 | } 3357 | --------------------------------------------------------------------------------