diff --git a/.dockerignore b/.dockerignore index 51cee13c..005f64cc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,10 @@ tests venv tools +lnbits/static/css/* +lnbits/static/bundle.js +lnbits/static/bundle.css + *.md *.log diff --git a/.env.example b/.env.example index 6ef60bc1..93b82325 100644 --- a/.env.example +++ b/.env.example @@ -9,8 +9,11 @@ LNBITS_ADMIN_USERS="" LNBITS_ADMIN_EXTENSIONS="ngrok" LNBITS_DEFAULT_WALLET_NAME="LNbits wallet" -LNBITS_AD_SPACE="" # csv ad image filepaths or urls, extensions can choose to honor -LNBITS_HIDE_API=false # Hides wallet api, extensions can choose to honor +# csv ad image filepaths or urls, extensions can choose to honor +LNBITS_AD_SPACE="" + +# Hides wallet api, extensions can choose to honor +LNBITS_HIDE_API=false # Disable extensions for all users, use "all" to disable all extensions LNBITS_DISABLED_EXTENSIONS="amilk" @@ -25,6 +28,10 @@ LNBITS_DATA_FOLDER="./data" LNBITS_FORCE_HTTPS=true LNBITS_SERVICE_FEE="0.0" +# value in millisats +LNBITS_RESERVE_FEE_MIN=2000 +# value in percent +LNBITS_RESERVE_FEE_PERCENT=1.0 # Change theme LNBITS_SITE_TITLE="LNbits" @@ -34,19 +41,23 @@ LNBITS_SITE_DESCRIPTION="Some description about your service, will display if ti LNBITS_THEME_OPTIONS="classic, bitcoin, freedom, mint, autumn, monochrome, salvador" # LNBITS_CUSTOM_LOGO="https://lnbits.com/assets/images/logo/logo.svg" -# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, -# LndRestWallet, CLightningWallet, LNbitsWallet, SparkWallet, FakeWallet, EclairWallet +# Choose from LNPayWallet, OpenNodeWallet, LntxbotWallet, ClicheWallet +# LndRestWallet, CoreLightningWallet, LNbitsWallet, SparkWallet, FakeWallet, EclairWallet LNBITS_BACKEND_WALLET_CLASS=VoidWallet # VoidWallet is just a fallback that works without any actual Lightning capabilities, # just so you can see the UI before dealing with this file. # Set one of these blocks depending on the wallet kind you chose above: + +# ClicheWallet +CLICHE_ENDPOINT=ws://127.0.0.1:12000 + # SparkWallet SPARK_URL=http://localhost:9737/rpc SPARK_TOKEN=myaccesstoken -# CLightningWallet -CLIGHTNING_RPC="/home/bob/.lightning/bitcoin/lightning-rpc" +# CoreLightningWallet +CORELIGHTNING_RPC="/home/bob/.lightning/bitcoin/lightning-rpc" # LnbitsWallet LNBITS_ENDPOINT=https://legend.lnbits.com diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 23d7ae3e..e106ace3 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -7,30 +7,19 @@ on: branches: [ main ] jobs: - black: + checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - run: sudo apt-get install python3-venv - - run: python3 -m venv venv - - run: ./venv/bin/pip install black - - run: make checkblack - isort: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + - uses: abatilo/actions-poetry@v2.1.3 + - name: Install packages + run: poetry install + - name: Check black + run: make checkblack + - name: Check isort + run: make checkisort - uses: actions/setup-node@v3 - - run: sudo apt-get install python3-venv - - run: python3 -m venv venv - - run: ./venv/bin/pip install isort - - run: make checkisort - - prettier: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - - run: sudo apt-get install python3-venv - - run: python3 -m venv venv - - run: npm install prettier - - run: ./node_modules/.bin/prettier --check lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js + - name: Check prettier + run: | + npm install prettier + make checkprettier diff --git a/.github/workflows/migrations.yml b/.github/workflows/migrations.yml index 08557bc1..90006d2a 100644 --- a/.github/workflows/migrations.yml +++ b/.github/workflows/migrations.yml @@ -9,9 +9,9 @@ jobs: postgres: image: postgres:latest env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres + POSTGRES_USER: lnbits + POSTGRES_PASSWORD: lnbits + POSTGRES_DB: migration ports: # maps tcp port 5432 on service container to the host - 5432:5432 @@ -22,30 +22,18 @@ jobs: --health-retries 5 strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock + poetry install sudo apt install unzip - name: Run migrations run: | - rm -rf ./data - mkdir -p ./data - export LNBITS_DATA_FOLDER="./data" - unzip tests/data/mock_data.zip -d ./data - timeout 5s ./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5001 || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi - export LNBITS_DATABASE_URL="postgres://postgres:postgres@0.0.0.0:5432/postgres" - timeout 5s ./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5001 || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi - ./venv/bin/python tools/conv.py + make test-migration diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 71713d88..61601731 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -5,9 +5,18 @@ on: [push, pull_request] jobs: check: runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] steps: - - uses: actions/checkout@v1 - - uses: jpetrucciani/mypy-check@master + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 with: - mypy_flags: '--install-types --non-interactive' - path: 'lnbits' + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 + - name: Install dependencies + run: | + poetry install + - name: Run tests + run: poetry run mypy diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index 0d9afdac..6572ccdb 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -7,30 +7,25 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | + docker build -t lnbitsdocker/lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests ./tests sudo chmod -R a+rwx . - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pylightning - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock + poetry install - name: Run tests env: PYTHONUNBUFFERED: 1 @@ -43,41 +38,84 @@ jobs: run: | sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data make test-real-wallet - CLightningWallet: + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + LndWallet: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | + docker build -t lnbitsdocker/lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests ./tests sudo chmod -R a+rwx . - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pylightning - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock + poetry install - name: Run tests env: PYTHONUNBUFFERED: 1 PORT: 5123 LNBITS_DATA_FOLDER: ./data - LNBITS_BACKEND_WALLET_CLASS: CLightningWallet - CLIGHTNING_RPC: ./docker/data/clightning-1/regtest/lightning-rpc + LNBITS_BACKEND_WALLET_CLASS: LndWallet + LND_GRPC_ENDPOINT: localhost + LND_GRPC_PORT: 10009 + LND_GRPC_CERT: docker/data/lnd-1/tls.cert + LND_GRPC_MACAROON: docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon run: | sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data make test-real-wallet + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml + CoreLightningWallet: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 + - name: Setup Regtest + run: | + docker build -t lnbitsdocker/lnbits-legend . + git clone https://github.com/lnbits/legend-regtest-enviroment.git docker + cd docker + chmod +x ./tests + ./tests + sudo chmod -R a+rwx . + - name: Install dependencies + run: | + poetry install + - name: Run tests + env: + PYTHONUNBUFFERED: 1 + PORT: 5123 + LNBITS_DATA_FOLDER: ./data + LNBITS_BACKEND_WALLET_CLASS: CoreLightningWallet + CORELIGHTNING_RPC: ./docker/data/clightning-1/regtest/lightning-rpc + run: | + sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data + make test-real-wallet + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 15a2388a..298d7ff0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} @@ -23,9 +23,29 @@ jobs: ./venv/bin/python -m pip install --upgrade pip ./venv/bin/pip install -r requirements.txt ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock + - name: Run tests + run: make test-venv + sqlite: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 + - name: Install dependencies + env: + VIRTUAL_ENV: ./venv + PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} + run: | + poetry install - name: Run tests run: make test - venv-postgres: + postgres: runs-on: ubuntu-latest services: postgres: @@ -44,22 +64,17 @@ jobs: --health-retries 5 strategy: matrix: - python-version: [3.8] + python-version: [3.9] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock + poetry install - name: Run tests env: LNBITS_DATABASE_URL: postgres://postgres:postgres@0.0.0.0:5432/postgres @@ -68,68 +83,3 @@ jobs: uses: codecov/codecov-action@v3 with: file: ./coverage.xml - poetry-sqlite: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.9] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} - run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock - - name: Run tests - run: make test - poetry-postgres: - runs-on: ubuntu-latest - services: - postgres: - image: postgres:latest - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: postgres - POSTGRES_DB: postgres - ports: - # maps tcp port 5432 on service container to the host - - 5432:5432 - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - strategy: - matrix: - python-version: [3.9] - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - env: - VIRTUAL_ENV: ./venv - PATH: ${{ env.VIRTUAL_ENV }}/bin:${{ env.PATH }} - run: | - python -m venv ${{ env.VIRTUAL_ENV }} - ./venv/bin/python -m pip install --upgrade pip - ./venv/bin/pip install -r requirements.txt - ./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock - - name: Run tests - env: - LNBITS_DATABASE_URL: postgres://postgres:postgres@0.0.0.0:5432/postgres - run: make test - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 - with: - file: ./coverage.xml \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f9eb1dd1..6259fe7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,45 +1,23 @@ -# Build image -FROM python:3.7-slim as builder +FROM python:3.9-slim -# Setup virtualenv -ENV VIRTUAL_ENV=/opt/venv -RUN python -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -# Install build deps +RUN apt-get clean RUN apt-get update -RUN apt-get install -y --no-install-recommends build-essential pkg-config libpq-dev -RUN python -m pip install --upgrade pip -RUN pip install wheel +RUN apt-get install -y curl pkg-config build-essential +RUN curl -sSL https://install.python-poetry.org | python3 - -# Install runtime deps -COPY requirements.txt /tmp/requirements.txt -RUN pip install -r /tmp/requirements.txt +ENV PATH="/root/.local/bin:$PATH" -# Install c-lightning specific deps -RUN pip install pylightning - -# Install LND specific deps -RUN pip install lndgrpc - -# Production image -FROM python:3.7-slim as lnbits - -# Run as non-root -USER 1000:1000 - -# Copy over virtualenv -ENV VIRTUAL_ENV="/opt/venv" -COPY --from=builder --chown=1000:1000 $VIRTUAL_ENV $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" - -# Copy in app source WORKDIR /app -COPY --chown=1000:1000 lnbits /app/lnbits + +COPY . . + +RUN poetry config virtualenvs.create false +RUN poetry install --no-dev --no-root +RUN poetry run python build.py ENV LNBITS_PORT="5000" ENV LNBITS_HOST="0.0.0.0" EXPOSE 5000 -CMD ["sh", "-c", "uvicorn lnbits.__main__:app --port $LNBITS_PORT --host $LNBITS_HOST"] +CMD ["sh", "-c", "poetry run lnbits --port $LNBITS_PORT --host $LNBITS_HOST"] diff --git a/Makefile b/Makefile index 2873ae77..4f99f1da 100644 --- a/Makefile +++ b/Makefile @@ -4,58 +4,81 @@ all: format check requirements.txt format: prettier isort black -check: mypy checkprettier checkblack +check: mypy checkprettier checkisort checkblack prettier: $(shell find lnbits -name "*.js" -name ".html") - ./node_modules/.bin/prettier --write lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js + ./node_modules/.bin/prettier --write lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js lnbits/extensions/*/static/components/*/*.js lnbits/extensions/*/static/components/*/*.html -black: $(shell find lnbits -name "*.py") - ./venv/bin/black lnbits +black: + poetry run black . -mypy: $(shell find lnbits -name "*.py") - ./venv/bin/mypy lnbits - ./venv/bin/mypy lnbits/core - ./venv/bin/mypy lnbits/extensions/* +mypy: + poetry run mypy -isort: $(shell find lnbits -name "*.py") - ./venv/bin/isort --profile black lnbits +isort: + poetry run isort . checkprettier: $(shell find lnbits -name "*.js" -name ".html") - ./node_modules/.bin/prettier --check lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js + ./node_modules/.bin/prettier --check lnbits/static/js/*.js lnbits/core/static/js/*.js lnbits/extensions/*/templates/*/*.html ./lnbits/core/templates/core/*.html lnbits/templates/*.html lnbits/extensions/*/static/js/*.js lnbits/extensions/*/static/components/*/*.js lnbits/extensions/*/static/components/*/*.html -checkblack: $(shell find lnbits -name "*.py") - ./venv/bin/black --check lnbits +checkblack: + poetry run black --check . -checkisort: $(shell find lnbits -name "*.py") - ./venv/bin/isort --profile black --check-only lnbits - -Pipfile.lock: Pipfile - ./venv/bin/pipenv lock - -requirements.txt: Pipfile.lock - cat Pipfile.lock | jq -r '.default | map_values(.version) | to_entries | map("\(.key)\(.value)") | join("\n")' > requirements.txt +checkisort: + poetry run isort --check-only . test: - mkdir -p ./tests/data + BOLTZ_NETWORK="regtest" \ + BOLTZ_URL="http://127.0.0.1:9001" \ + BOLTZ_MEMPOOL_SPACE_URL="http://127.0.0.1:8080" \ + BOLTZ_MEMPOOL_SPACE_URL_WS="ws://127.0.0.1:8080" \ LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \ FAKE_WALLET_SECRET="ToTheMoon1" \ LNBITS_DATA_FOLDER="./tests/data" \ PYTHONUNBUFFERED=1 \ - ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests + DEBUG=true \ + poetry run pytest test-real-wallet: - mkdir -p ./tests/data + BOLTZ_NETWORK="regtest" \ + BOLTZ_URL="http://127.0.0.1:9001" \ + BOLTZ_MEMPOOL_SPACE_URL="http://127.0.0.1:8080" \ + BOLTZ_MEMPOOL_SPACE_URL_WS="ws://127.0.0.1:8080" \ LNBITS_DATA_FOLDER="./tests/data" \ PYTHONUNBUFFERED=1 \ - ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests + DEBUG=true \ + poetry run pytest -test-pipenv: - mkdir -p ./tests/data +test-venv: + BOLTZ_NETWORK="regtest" \ + BOLTZ_URL="http://127.0.0.1:9001" \ + BOLTZ_MEMPOOL_SPACE_URL="http://127.0.0.1:8080" \ + BOLTZ_MEMPOOL_SPACE_URL_WS="ws://127.0.0.1:8080" \ LNBITS_BACKEND_WALLET_CLASS="FakeWallet" \ FAKE_WALLET_SECRET="ToTheMoon1" \ LNBITS_DATA_FOLDER="./tests/data" \ PYTHONUNBUFFERED=1 \ - pipenv run pytest --durations=1 -s --cov=lnbits --cov-report=xml tests + DEBUG=true \ + ./venv/bin/pytest --durations=1 -s --cov=lnbits --cov-report=xml tests + +test-migration: + rm -rf ./migration-data + mkdir -p ./migration-data + unzip tests/data/mock_data.zip -d ./migration-data + HOST=0.0.0.0 \ + PORT=5002 \ + LNBITS_DATA_FOLDER="./migration-data" \ + timeout 5s poetry run lnbits --host 0.0.0.0 --port 5002 || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi + HOST=0.0.0.0 \ + PORT=5002 \ + LNBITS_DATABASE_URL="postgres://lnbits:lnbits@localhost:5432/migration" \ + timeout 5s poetry run lnbits --host 0.0.0.0 --port 5002 || code=$?; if [[ $code -ne 124 && $code -ne 0 ]]; then exit $code; fi + LNBITS_DATA_FOLDER="./migration-data" \ + LNBITS_DATABASE_URL="postgres://lnbits:lnbits@localhost:5432/migration" \ + poetry run python tools/conv.py + +migration: + poetry run python tools/conv.py bak: # LNBITS_DATABASE_URL=postgres://postgres:postgres@0.0.0.0:5432/postgres diff --git a/README.md b/README.md index 5c6b702a..a22c857c 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ LNbits is a very simple Python server that sits on top of any funding source, an LNbits can run on top of any lightning-network funding source, currently there is support for LND, c-lightning, Spark, LNpay, OpenNode, lntxbot, with more being added regularly. -See [lnbits.org](https://lnbits.org) for more detailed documentation. +See [legend.lnbits.org](https://legend.lnbits.org) for more detailed documentation. Checkout the LNbits [YouTube](https://www.youtube.com/playlist?list=PLPj3KCksGbSYG0ciIQUWJru1dWstPHshe) video series. @@ -54,7 +54,7 @@ LNURL has a fallback scheme, so if scanned by a regular QR code reader it can de ![lnurl fallback](https://i.imgur.com/CPBKHIv.png) Using **lnbits.com/?lightning="LNURL-withdraw"** will trigger a withdraw that builds an LNbits wallet. -Example use would be an ATM, which utilises LNURL, if the user scans the QR with a regular QR code scanner app, they will stilll be able to access the funds. +Example use would be an ATM, which utilises LNURL, if the user scans the QR with a regular QR code scanner app, they will still be able to access the funds. ![lnurl ATM](https://i.imgur.com/Gi6bn3L.jpg) @@ -70,7 +70,7 @@ Wallets can be easily generated and given out to people at events (one click mul If you like this project and might even use or extend it, why not [send some tip love](https://legend.lnbits.com/paywall/GAqKguK5S8f6w5VNjS9DfK)! -[docs]: https://lnbits.org/ +[docs]: https://legend.lnbits.org/ [docs-badge]: https://img.shields.io/badge/docs-lnbits.org-673ab7.svg [github-mypy]: https://github.com/lnbits/lnbits/actions?query=workflow%3Amypy [github-mypy-badge]: https://github.com/lnbits/lnbits/workflows/mypy/badge.svg diff --git a/build.py b/build.py index 5cc8b7de..2bc3e50c 100644 --- a/build.py +++ b/build.py @@ -1,13 +1,14 @@ -import warnings -import subprocess import glob import os +import subprocess +import warnings from os import path -from typing import Any, List, NamedTuple, Optional from pathlib import Path +from typing import Any, List, NamedTuple, Optional LNBITS_PATH = path.dirname(path.realpath(__file__)) + "/lnbits" + def get_js_vendored(prefer_minified: bool = False) -> List[str]: paths = get_vendored(".js", prefer_minified) @@ -71,6 +72,7 @@ def get_vendored(ext: str, prefer_minified: bool = False) -> List[str]: def url_for_vendored(abspath: str) -> str: return "/" + os.path.relpath(abspath, LNBITS_PATH) + def transpile_scss(): with warnings.catch_warnings(): warnings.simplefilter("ignore") @@ -80,6 +82,7 @@ def transpile_scss(): with open(os.path.join(LNBITS_PATH, "static/css/base.css"), "w") as css: css.write(compile_string(scss.read())) + def bundle_vendored(): for getfiles, outputpath in [ (get_js_vendored, os.path.join(LNBITS_PATH, "static/bundle.js")), @@ -96,15 +99,7 @@ def bundle_vendored(): def build(): transpile_scss() bundle_vendored() -# root = Path("lnbits/static/foo") -# root.mkdir(parents=True) -# root.joinpath("example.css").write_text("") + if __name__ == "__main__": - build() - -#def build(setup_kwargs): -# """Build """ -# transpile_scss() -# bundle_vendored() -# subprocess.run(["ls", "-la", "./lnbits/static"]) + build() diff --git a/docs/CNAME b/docs/CNAME index 1b08f754..9981b110 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -lnbits.org \ No newline at end of file +legend.lnbits.org \ No newline at end of file diff --git a/docs/_config.yml b/docs/_config.yml index b4e4adbe..74e65187 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -3,7 +3,7 @@ title: "LNbits docs" remote_theme: pmarsceill/just-the-docs logo: "/logos/lnbits-full.png" search_enabled: true -url: https://lnbits.org +url: https://legend.lnbits.org aux_links: "LNbits on GitHub": - "//github.com/lnbits/lnbits" diff --git a/docs/devs/api.md b/docs/devs/api.md index a0938d62..a8217b9c 100644 --- a/docs/devs/api.md +++ b/docs/devs/api.md @@ -9,4 +9,4 @@ nav_order: 3 API reference ============= -Coming soon... +[Swagger Docs](https://legend.lnbits.org/devs/swagger.html) diff --git a/docs/devs/development.md b/docs/devs/development.md index f53b94bc..74a66405 100644 --- a/docs/devs/development.md +++ b/docs/devs/development.md @@ -17,10 +17,26 @@ Tests This project has unit tests that help prevent regressions. Before you can run the tests, you must install a few dependencies: ```bash -./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock +poetry install +npm i ``` Then to run the tests: ```bash make test ``` + +Run formatting: +```bash +make format +``` + +Run mypy checks: +```bash +poetry run mypy +``` + +Run everything: +```bash +make all +``` diff --git a/docs/devs/extensions.md b/docs/devs/extensions.md index 8c9a30a4..cd81a021 100644 --- a/docs/devs/extensions.md +++ b/docs/devs/extensions.md @@ -28,17 +28,45 @@ Going over the example extension's structure: Adding new dependencies ----------------------- -If for some reason your extensions needs a new python package to work, you can add a new package using Pipenv: +If for some reason your extensions needs a new python package to work, you can add a new package using `venv`, or `poerty`: ```sh -$ pipenv install new_package_name +$ poetry add +# or +$ ./venv/bin/pip install ``` -This will create a new entry in the `Pipenv` file. **But we need an extra step to make sure LNbits doesn't break in production.** -All tests and deployments should run against the `requirements.txt` file so every time a new package is added -it is necessary to run the Pipenv `lock` command and manually update the requirements file: +Dependencies need to be added to `pyproject.toml` and `requirements.txt`, then tested by running on `venv` and `poetry`. +`nix` compatability can be tested with `nix build .#checks.x86_64-linux.vmTest`. -```sh -$ pipenv lock -r + +SQLite to PostgreSQL migration +----------------------- + +LNbits currently supports SQLite and PostgreSQL databases. There is a migration script `tools/conv.py` that helps users migrate from SQLite to PostgreSQL. This script also copies all extension databases to the new backend. + +### Adding mock data to `mock_data.zip` + +`mock_data.zip` contains a few lines of sample SQLite data and is used in automated GitHub test to see whether your migration in `conv.py` works. Run your extension and save a few lines of data into a SQLite `your_extension.sqlite3` file. Unzip `tests/data/mock_data.zip`, add `your_extension.sqlite3`, updated `database.sqlite3` and zip it again. Add the updated `mock_data.zip` to your PR. + +### running migration locally +you will need a running postgres database + +#### create lnbits user for migration database +```console +sudo su - postgres -c "psql -c 'CREATE ROLE lnbits LOGIN PASSWORD 'lnbits';'" +``` +#### create migration database +```console +sudo su - postgres -c "psql -c 'CREATE DATABASE migration;'" +``` +#### run the migration +```console +make test-migration +``` +sudo su - postgres -c "psql -c 'CREATE ROLE lnbits LOGIN PASSWORD 'lnbits';'" +#### clean migration database afterwards, fails if you try again +```console +sudo su - postgres -c "psql -c 'DROP DATABASE IF EXISTS migration;'" ``` diff --git a/docs/devs/installation.md b/docs/devs/installation.md deleted file mode 100644 index b807ce34..00000000 --- a/docs/devs/installation.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -layout: default -parent: For developers -title: Installation -nav_order: 1 ---- - -# Installation - -This guide has been moved to the [installation guide](../guide/installation.md). -To install the developer packages for running tests etc before pr'ing, use `./venv/bin/pip install pytest pytest-asyncio pytest-cov requests mock black mypy isort`. - -## Notes: - -* We recommend using Caddy for a reverse-proxy if you want to serve your install through a domain, alternatively you can use [ngrok](https://ngrok.com/). -* Screen works well if you want LNbits to continue running when you close your terminal session. diff --git a/docs/devs/swagger.html b/docs/devs/swagger.html new file mode 100644 index 00000000..c787eb2b --- /dev/null +++ b/docs/devs/swagger.html @@ -0,0 +1,29 @@ + + + + + + My New API + + +
+ + + diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 0232346f..2b058754 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -4,30 +4,39 @@ title: Basic installation nav_order: 2 --- - - # Basic installation You can choose between four package managers, `poetry`, `nix` and `venv`. By default, LNbits will use SQLite as its database. You can also use PostgreSQL which is recommended for applications with a high load (see guide below). -## Option 1: poetry +## Option 1 (recommended): poetry + +If you have problems installing LNbits using these instructions, please have a look at the [Troubleshooting](#troubleshooting) section. ```sh git clone https://github.com/lnbits/lnbits-legend.git cd lnbits-legend/ +# for making sure python 3.9 is installed, skip if installed +sudo apt update +sudo apt install software-properties-common +sudo add-apt-repository ppa:deadsnakes/ppa +sudo apt install python3.9 python3.9-distutils + curl -sSL https://install.python-poetry.org | python3 - -poetry install +export PATH="/home/ubuntu/.local/bin:$PATH" # or whatever is suggested in the poetry install notes printed to terminal +poetry env use python3.9 +poetry install --no-dev +poetry run python build.py -# You may need to install python 3.9, update your python following this guide https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/ - - mkdir data && cp .env.example .env -``` +mkdir data +cp .env.example .env +nano .env # set funding source +``` #### Running the server - + ```sh poetry run lnbits # To change port/host pass 'poetry run lnbits --port 9000 --host 0.0.0.0' @@ -41,7 +50,7 @@ cd lnbits-legend/ # Modern debian distros usually include Nix, however you can install with: # 'sh <(curl -L https://nixos.org/nix/install) --daemon', or use setup here https://nixos.org/download.html#nix-verify-installation -nix build .#lnbits +nix build .#lnbits mkdir data ``` @@ -74,22 +83,109 @@ mkdir data && cp .env.example .env ./venv/bin/uvicorn lnbits.__main__:app --port 5000 ``` -If you want to host LNbits on the internet, run with the option `--host 0.0.0.0`. +If you want to host LNbits on the internet, run with the option `--host 0.0.0.0`. + +## Option 4: Docker + +```sh +git clone https://github.com/lnbits/lnbits-legend.git +cd lnbits-legend +docker build -t lnbits-legend . +cp .env.example .env +mkdir data +docker run --detach --publish 5000:5000 --name lnbits-legend --volume ${PWD}/.env:/app/.env --volume ${PWD}/data/:/app/data lnbits-legend +``` + +## Option 5: Fly.io + +Fly.io is a docker container hosting platform that has a generous free tier. You can host LNBits for free on Fly.io for personal use. + +First, sign up for an account at [Fly.io](https://fly.io) (no credit card required). + +Then, install the Fly.io CLI onto your device [here](https://fly.io/docs/getting-started/installing-flyctl/). + +After install is complete, the command will output a command you should copy/paste/run to get `fly` into your `$PATH`. Something like: + +``` +flyctl was installed successfully to /home/ubuntu/.fly/bin/flyctl +Manually add the directory to your $HOME/.bash_profile (or similar) + export FLYCTL_INSTALL="/home/ubuntu/.fly" + export PATH="$FLYCTL_INSTALL/bin:$PATH" +``` + +You can either run those commands, then `source ~/.bash_profile` or, if you don't, you'll have to call Fly from `~/.fly/bin/flyctl`. + +Once installed, run the following commands. + +``` +git clone https://github.com/lnbits/lnbits-legend.git +cd lnbits-legend +fly auth login +[complete login process] +fly launch +``` + +You'll be prompted to enter an app name, region, postgres (choose no), deploy now (choose no). + +You'll now find a file in the directory called `fly.toml`. Open that file and modify/add the following settings. + +Note: Be sure to replace `${PUT_YOUR_LNBITS_ENV_VARS_HERE}` with all relevant environment variables in `.env` or `.env.example`. Environment variable strings should be quoted here, so if in `.env` you have `LNBITS_ENDPOINT=https://legend.lnbits.com` in `fly.toml` you should have `LNBITS_ENDPOINT="https://legend.lnbits.com"`. + +Note: Don't enter secret environment variables here. Fly.io offers secrets (via the `fly secrets` command) that are exposed as environment variables in your runtime. So, for example, if using the LND_REST funding source, you can run `fly secrets set LND_REST_MACAROON=`. + +``` +... +kill_timeout = 30 +... + +... +[mounts] + source="lnbits_data" + destination="/data" +... + +... +[env] + HOST="127.0.0.1" + PORT=5000 + LNBITS_FORCE_HTTPS=true + LNBITS_DATA_FOLDER="/data" + + ${PUT_YOUR_LNBITS_ENV_VARS_HERE} +... + +... +[[services]] + internal_port = 5000 +... +``` + +Next, create a volume to store the sqlite database for LNBits. Be sure to choose the same region for the volume that you chose earlier. + +``` +fly volumes create lnbits_data --size 1 +``` + +You're ready to deploy! Run `fly deploy` and follow the steps to finish deployment. You'll select a `region` (up to you, choose the same as you did for the storage volume previously created), `postgres` (choose no), `deploy` (choose yes). + +You can use `fly logs` to view the application logs, or `fly ssh console` to get a ssh shell in the running container. ### Troubleshooting -Problems installing? These commands have helped us install LNbits. +Problems installing? These commands have helped us install LNbits. ```sh sudo apt install pkg-config libffi-dev libpq-dev -# if the secp256k1 build fails: -# if you used venv -./venv/bin/pip install setuptools wheel -# if you used poetry -poetry add setuptools wheel # build essentials for debian/ubuntu -sudo apt install python3-dev gcc build-essential +sudo apt install python3.9-dev gcc build-essential + +# if the secp256k1 build fails: +# if you used poetry +poetry add setuptools wheel + +# if you used venv +./venv/bin/pip install setuptools wheel ``` ### Optional: PostgreSQL database @@ -122,13 +218,13 @@ LNBITS_DATABASE_URL="postgres://postgres:postgres@localhost/lnbits" # Using LNbits -Now you can visit your LNbits at http://localhost:5000/. +Now you can visit your LNbits at http://localhost:5000/. -Now modify the `.env` file with any settings you prefer and add a proper [funding source](./wallets.md) by modifying the value of `LNBITS_BACKEND_WALLET_CLASS` and providing the extra information and credentials related to the chosen funding source. +Now modify the `.env` file with any settings you prefer and add a proper [funding source](./wallets.md) by modifying the value of `LNBITS_BACKEND_WALLET_CLASS` and providing the extra information and credentials related to the chosen funding source. Then you can restart it and it will be using the new settings. -You might also need to install additional packages or perform additional setup steps, depending on the chosen backend. See [the short guide](./wallets.md) on each different funding source. +You might also need to install additional packages or perform additional setup steps, depending on the chosen backend. See [the short guide](./wallets.md) on each different funding source. Take a look at [Polar](https://lightningpolar.com/) for an excellent way of spinning up a Lightning Network dev environment. @@ -151,8 +247,9 @@ LNBITS_DATABASE_URL="postgres://postgres:postgres@localhost/lnbits" # START LNbits # STOP LNbits -# on the LNBits folder, locate and edit 'tools/conv.py' with the relevant credentials -python3 tools/conv.py +poetry run python tools/conv.py +# or +make migration ``` Hopefully, everything works and get migrated... Launch LNbits again and check if everything is working properly. @@ -170,21 +267,20 @@ Systemd is great for taking care of your LNbits instance. It will start it on bo Description=LNbits # you can uncomment these lines if you know what you're doing # it will make sure that lnbits starts after lnd (replace with your own backend service) -#Wants=lnd.service -#After=lnd.service +#Wants=lnd.service +#After=lnd.service [Service] # replace with the absolute path of your lnbits installation -WorkingDirectory=/home/bitcoin/lnbits -# same here -ExecStart=/home/bitcoin/lnbits/venv/bin/uvicorn lnbits.__main__:app --port 5000 +WorkingDirectory=/home/lnbits/lnbits-legend +# same here. run `which poetry` if you can't find the poetry binary +ExecStart=/home/lnbits/.local/bin/poetry run lnbits # replace with the user that you're running lnbits on -User=bitcoin +User=lnbits Restart=always TimeoutSec=120 RestartSec=30 -# this makes sure that you receive logs in real time -Environment=PYTHONUNBUFFERED=1 +Environment=PYTHONUNBUFFERED=1 [Install] WantedBy=multi-user.target @@ -197,13 +293,54 @@ sudo systemctl enable lnbits.service sudo systemctl start lnbits.service ``` +## Running behind an apache2 reverse proxy over https +Install apache2 and enable apache2 mods +```sh +apt-get install apache2 certbot +a2enmod headers ssl proxy proxy-http +``` +create a ssl certificate with letsencrypt +```sh +certbot certonly --webroot --agree-tos --text --non-interactive --webroot-path /var/www/html -d lnbits.org +``` +create a apache2 vhost at: /etc/apache2/sites-enabled/lnbits.conf +```sh +cat < /etc/apache2/sites-enabled/lnbits.conf + + ServerName lnbits.org + SSLEngine On + SSLProxyEngine On + SSLCertificateFile /etc/letsencrypt/live/lnbits.org/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/lnbits.org/privkey.pem + Include /etc/letsencrypt/options-ssl-apache.conf + LogLevel info + ErrorLog /var/log/apache2/lnbits.log + CustomLog /var/log/apache2/lnbits-access.log combined + RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} + RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} + ProxyPreserveHost On + ProxyPass / http://localhost:5000/ + ProxyPassReverse / http://localhost:5000/ + + Order deny,allow + Allow from all + + +EOF +``` +restart apache2 +```sh +service restart apache2 +``` + + ## Using https without reverse proxy -The most common way of using LNbits via https is to use a reverse proxy such as Caddy, nginx, or ngriok. However, you can also run LNbits via https without additional software. This is useful for development purposes or if you want to use LNbits in your local network. +The most common way of using LNbits via https is to use a reverse proxy such as Caddy, nginx, or ngriok. However, you can also run LNbits via https without additional software. This is useful for development purposes or if you want to use LNbits in your local network. We have to create a self-signed certificate using `mkcert`. Note that this certiciate is not "trusted" by most browsers but that's fine (since you know that you have created it) and encryption is always better than clear text. #### Install mkcert -You can find the install instructions for `mkcert` [here](https://github.com/FiloSottile/mkcert). +You can find the install instructions for `mkcert` [here](https://github.com/FiloSottile/mkcert). Install mkcert on Ubuntu: ```sh @@ -213,16 +350,22 @@ chmod +x mkcert-v*-linux-amd64 sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert ``` #### Create certificate -To create a certificate, first `cd` into your lnbits folder and execute the following command ([more info](https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/)) +To create a certificate, first `cd` into your LNbits folder and execute the following command on Linux: +```sh +openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem +``` +This will create two new files (`key.pem` and `cert.pem `). + +Alternatively, you can use mkcert ([more info](https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/)): ```sh # add your local IP (192.x.x.x) as well if you want to use it in your local network -mkcert localhost 127.0.0.1 ::1 +mkcert localhost 127.0.0.1 ::1 ``` -This will create two new files (`localhost-key.pem` and `localhost.pem `) which you can then pass to uvicorn when you start LNbits: +You can then pass the certificate files to uvicorn when you start LNbits: ```sh -./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5000 --ssl-keyfile ./localhost-key.pem --ssl-certfile ./localhost.pem +./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5000 --ssl-keyfile ./key.pem --ssl-certfile ./cert.pem ``` @@ -235,9 +378,9 @@ If you want to run LNbits on your Umbrel but want it to be reached through clear To install using docker you first need to build the docker image as: ``` -git clone https://github.com/lnbits/lnbits.git -cd lnbits/ # ${PWD} referred as -docker build -t lnbits . +git clone https://github.com/lnbits/lnbits-legend.git +cd lnbits-legend +docker build -t lnbits-legend . ``` You can launch the docker in a different directory, but make sure to copy `.env.example` from lnbits there @@ -248,17 +391,15 @@ cp /.env.example .env and change the configuration in `.env` as required. -Then create the data directory for the user ID 1000, which is the user that runs the lnbits within the docker container. - +Then create the data directory ``` mkdir data -sudo chown 1000:1000 ./data/ ``` Then the image can be run as: ``` -docker run --detach --publish 5000:5000 --name lnbits --volume ${PWD}/.env:/app/.env --volume ${PWD}/data/:/app/data lnbits +docker run --detach --publish 5000:5000 --name lnbits-legend -e "LNBITS_BACKEND_WALLET_CLASS='FakeWallet'" --volume ${PWD}/.env:/app/.env --volume ${PWD}/data/:/app/data lnbits-legend ``` Finally you can access your lnbits on your machine at port 5000. diff --git a/docs/guide/wallets.md b/docs/guide/wallets.md index dfea66aa..80fb54c0 100644 --- a/docs/guide/wallets.md +++ b/docs/guide/wallets.md @@ -8,18 +8,15 @@ nav_order: 3 Backend wallets =============== -LNbits can run on top of many lightning-network funding sources. Currently there is support for -CLightning, LND, LNbits, LNPay, lntxbot and OpenNode, with more being added regularily. +LNbits can run on top of many lightning-network funding sources. Currently there is support for CoreLightning, LND, LNbits, LNPay, lntxbot and OpenNode, with more being added regularly. A backend wallet can be configured using the following LNbits environment variables: -### CLightning +### CoreLightning -Using this wallet requires the installation of the `pylightning` Python package. - -- `LNBITS_BACKEND_WALLET_CLASS`: **CLightningWallet** -- `CLIGHTNING_RPC`: /file/path/lightning-rpc +- `LNBITS_BACKEND_WALLET_CLASS`: **CoreLightningWallet** +- `CORELIGHTNING_RPC`: /file/path/lightning-rpc ### Spark (c-lightning) @@ -27,9 +24,18 @@ Using this wallet requires the installation of the `pylightning` Python package. - `SPARK_URL`: http://10.147.17.230:9737/rpc - `SPARK_TOKEN`: secret_access_key -### LND (gRPC) +### LND (REST) -Using this wallet requires the installation of the `grpcio` and `protobuf` Python packages. +- `LNBITS_BACKEND_WALLET_CLASS`: **LndRestWallet** +- `LND_REST_ENDPOINT`: http://10.147.17.230:8080/ +- `LND_REST_CERT`: /file/path/tls.cert +- `LND_REST_MACAROON`: /file/path/admin.macaroon or Bech64/Hex + +or + +- `LND_REST_MACAROON_ENCRYPTED`: eNcRyPtEdMaCaRoOn + +### LND (gRPC) - `LNBITS_BACKEND_WALLET_CLASS`: **LndWallet** - `LND_GRPC_ENDPOINT`: ip_address @@ -43,17 +49,6 @@ You can also use an AES-encrypted macaroon (more info) instead by using To encrypt your macaroon, run `./venv/bin/python lnbits/wallets/macaroon/macaroon.py`. -### LND (REST) - -- `LNBITS_BACKEND_WALLET_CLASS`: **LndRestWallet** -- `LND_REST_ENDPOINT`: http://10.147.17.230:8080/ -- `LND_REST_CERT`: /file/path/tls.cert -- `LND_REST_MACAROON`: /file/path/admin.macaroon or Bech64/Hex - -or - -- `LND_REST_MACAROON_ENCRYPTED`: eNcRyPtEdMaCaRoOn - ### LNbits - `LNBITS_BACKEND_WALLET_CLASS`: **LNbitsWallet** diff --git a/lnbits/app.py b/lnbits/app.py index e1594a7b..f612c32c 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -1,6 +1,7 @@ import asyncio import importlib import logging +import signal import sys import traceback import warnings @@ -75,7 +76,11 @@ def create_app(config_object="lnbits.settings") -> FastAPI: # Only the browser sends "text/html" request # not fail proof, but everything else get's a JSON response - if "text/html" in request.headers["accept"]: + if ( + request.headers + and "accept" in request.headers + and "text/html" in request.headers["accept"] + ): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": f"{exc.errors()} is not a valid UUID."}, @@ -101,16 +106,27 @@ def create_app(config_object="lnbits.settings") -> FastAPI: def check_funding_source(app: FastAPI) -> None: @app.on_event("startup") async def check_wallet_status(): + original_sigint_handler = signal.getsignal(signal.SIGINT) + + def signal_handler(signal, frame): + logger.debug(f"SIGINT received, terminating LNbits.") + sys.exit(1) + + signal.signal(signal.SIGINT, signal_handler) while True: - error_message, balance = await WALLET.status() - if not error_message: - break - logger.error( - f"The backend for {WALLET.__class__.__name__} isn't working properly: '{error_message}'", - RuntimeWarning, - ) + try: + error_message, balance = await WALLET.status() + if not error_message: + break + logger.error( + f"The backend for {WALLET.__class__.__name__} isn't working properly: '{error_message}'", + RuntimeWarning, + ) + except: + pass logger.info("Retrying connection to backend in 5 seconds...") await asyncio.sleep(5) + signal.signal(signal.SIGINT, original_sigint_handler) logger.info( f"✔️ Backend {WALLET.__class__.__name__} connected and with a balance of {balance} msat." ) @@ -185,7 +201,11 @@ def register_exception_handlers(app: FastAPI): traceback.print_exception(etype, err, tb) exc = traceback.format_exc() - if "text/html" in request.headers["accept"]: + if ( + request.headers + and "accept" in request.headers + and "text/html" in request.headers["accept"] + ): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": err} ) diff --git a/lnbits/bolt11.py b/lnbits/bolt11.py index 67039740..32b43feb 100644 --- a/lnbits/bolt11.py +++ b/lnbits/bolt11.py @@ -216,7 +216,7 @@ def lnencode(addr, privkey): expirybits = expirybits[5:] data += tagged("x", expirybits) elif k == "h": - data += tagged_bytes("h", hashlib.sha256(v.encode("utf-8")).digest()) + data += tagged_bytes("h", v) elif k == "n": data += tagged_bytes("n", v) else: diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index db802d7b..cbed6292 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -4,6 +4,8 @@ from typing import Any, Dict, List, Optional from urllib.parse import urlparse from uuid import uuid4 +from loguru import logger + from lnbits import bolt11 from lnbits.db import COCKROACH, POSTGRES, Connection from lnbits.settings import DEFAULT_WALLET_NAME, LNBITS_ADMIN_USERS @@ -175,6 +177,11 @@ async def get_wallet_for_key( return Wallet(**row) +async def get_total_balance(conn: Optional[Connection] = None): + row = await (conn or db).fetchone("SELECT SUM(balance) FROM balances") + return 0 if row[0] is None else row[0] + + # wallet payments # --------------- @@ -325,6 +332,7 @@ async def delete_expired_invoices( AND amount > 0 AND time < {db.timestamp_now} - {db.interval_seconds(86400)} """ ) + logger.debug(f"Checking expiry of {len(rows)} invoices") for (payment_request,) in rows: try: invoice = bolt11.decode(payment_request) @@ -334,7 +342,9 @@ async def delete_expired_invoices( expiration_date = datetime.datetime.fromtimestamp(invoice.date + invoice.expiry) if expiration_date > datetime.datetime.utcnow(): continue - + logger.debug( + f"Deleting expired invoice: {invoice.payment_hash} (expired: {expiration_date})" + ) await (conn or db).execute( """ DELETE FROM apipayments @@ -363,6 +373,11 @@ async def create_payment( webhook: Optional[str] = None, conn: Optional[Connection] = None, ) -> Payment: + + # todo: add this when tests are fixed + # previous_payment = await get_wallet_payment(wallet_id, payment_hash, conn=conn) + # assert previous_payment is None, "Payment already exists" + await (conn or db).execute( """ INSERT INTO apipayments @@ -402,12 +417,55 @@ async def update_payment_status( ) +async def update_payment_details( + checking_id: str, + pending: Optional[bool] = None, + fee: Optional[int] = None, + preimage: Optional[str] = None, + new_checking_id: Optional[str] = None, + conn: Optional[Connection] = None, +) -> None: + + set_clause: List[str] = [] + set_variables: List[Any] = [] + + if new_checking_id is not None: + set_clause.append("checking_id = ?") + set_variables.append(new_checking_id) + if pending is not None: + set_clause.append("pending = ?") + set_variables.append(pending) + if fee is not None: + set_clause.append("fee = ?") + set_variables.append(fee) + if preimage is not None: + set_clause.append("preimage = ?") + set_variables.append(preimage) + + set_variables.append(checking_id) + + await (conn or db).execute( + f"UPDATE apipayments SET {', '.join(set_clause)} WHERE checking_id = ?", + tuple(set_variables), + ) + return + + async def delete_payment(checking_id: str, conn: Optional[Connection] = None) -> None: await (conn or db).execute( "DELETE FROM apipayments WHERE checking_id = ?", (checking_id,) ) +async def delete_wallet_payment( + checking_id: str, wallet_id: str, conn: Optional[Connection] = None +) -> None: + await (conn or db).execute( + "DELETE FROM apipayments WHERE checking_id = ? AND wallet = ?", + (checking_id, wallet_id), + ) + + async def check_internal( payment_hash: str, conn: Optional[Connection] = None ) -> Optional[str]: diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 0f7eba73..216acafd 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -9,8 +9,10 @@ from lnurl import encode as lnurl_encode # type: ignore from loguru import logger from pydantic import BaseModel +from lnbits.db import Connection from lnbits.helpers import url_for from lnbits.settings import WALLET +from lnbits.wallets.base import PaymentStatus class Wallet(BaseModel): @@ -128,8 +130,21 @@ class Payment(BaseModel): @property def is_uncheckable(self) -> bool: - return self.checking_id.startswith("temp_") or self.checking_id.startswith( - "internal_" + return self.checking_id.startswith("internal_") + + async def update_status( + self, + status: PaymentStatus, + conn: Optional[Connection] = None, + ) -> None: + from .crud import update_payment_details + + await update_payment_details( + checking_id=self.checking_id, + pending=status.pending, + fee=status.fee_msat, + preimage=status.preimage, + conn=conn, ) async def set_pending(self, pending: bool) -> None: @@ -137,30 +152,40 @@ class Payment(BaseModel): await update_payment_status(self.checking_id, pending) - async def check_pending(self) -> None: + async def check_status( + self, + conn: Optional[Connection] = None, + ) -> PaymentStatus: if self.is_uncheckable: - return + return PaymentStatus(None) + + logger.debug( + f"Checking {'outgoing' if self.is_out else 'incoming'} pending payment {self.checking_id}" + ) if self.is_out: status = await WALLET.get_payment_status(self.checking_id) else: status = await WALLET.get_invoice_status(self.checking_id) + logger.debug(f"Status: {status}") + if self.is_out and status.failed: - logger.info( - f" - deleting outgoing failed payment {self.checking_id}: {status}" + logger.warning( + f"Deleting outgoing failed payment {self.checking_id}: {status}" ) - await self.delete() + await self.delete(conn) elif not status.pending: logger.info( - f" - marking '{'in' if self.is_in else 'out'}' {self.checking_id} as not pending anymore: {status}" + f"Marking '{'in' if self.is_in else 'out'}' {self.checking_id} as not pending anymore: {status}" ) - await self.set_pending(status.pending) + await self.update_status(status, conn=conn) + return status - async def delete(self) -> None: + async def delete(self, conn: Optional[Connection] = None) -> None: from .crud import delete_payment - await delete_payment(self.checking_id) + await delete_payment(self.checking_id, conn=conn) class BalanceCheck(BaseModel): diff --git a/lnbits/core/services.py b/lnbits/core/services.py index b9aec899..961eb7b2 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -21,18 +21,20 @@ from lnbits.decorators import ( ) from lnbits.helpers import url_for, urlsafe_short_hash from lnbits.requestvars import g -from lnbits.settings import FAKE_WALLET, WALLET +from lnbits.settings import FAKE_WALLET, RESERVE_FEE_MIN, RESERVE_FEE_PERCENT, WALLET from lnbits.wallets.base import PaymentResponse, PaymentStatus from . import db from .crud import ( check_internal, create_payment, - delete_payment, + delete_wallet_payment, get_wallet, get_wallet_payment, + update_payment_details, update_payment_status, ) +from .models import Payment try: from typing import TypedDict # type: ignore @@ -54,6 +56,7 @@ async def create_invoice( amount: int, # in satoshis memo: str, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, extra: Optional[Dict] = None, webhook: Optional[str] = None, internal: Optional[bool] = False, @@ -65,7 +68,10 @@ async def create_invoice( wallet = FAKE_WALLET if internal else WALLET ok, checking_id, payment_request, error_message = await wallet.create_invoice( - amount=amount, memo=invoice_memo, description_hash=description_hash + amount=amount, + memo=invoice_memo, + description_hash=description_hash, + unhashed_description=unhashed_description, ) if not ok: raise InvoiceFailure(error_message or "unexpected backend error.") @@ -97,11 +103,20 @@ async def pay_invoice( description: str = "", conn: Optional[Connection] = None, ) -> str: + """ + Pay a Lightning invoice. + First, we create a temporary payment in the database with fees set to the reserve fee. + We then check whether the balance of the payer would go negative. + We then attempt to pay the invoice through the backend. + If the payment is successful, we update the payment in the database with the payment details. + If the payment is unsuccessful, we delete the temporary payment. + If the payment is still in flight, we hope that some other process will regularly check for the payment. + """ invoice = bolt11.decode(payment_request) fee_reserve_msat = fee_reserve(invoice.amount_msat) async with (db.reuse_conn(conn) if conn else db.connect()) as conn: - temp_id = f"temp_{urlsafe_short_hash()}" - internal_id = f"internal_{urlsafe_short_hash()}" + temp_id = invoice.payment_hash + internal_id = f"internal_{invoice.payment_hash}" if invoice.amount_msat == 0: raise ValueError("Amountless invoices not supported.") @@ -156,7 +171,7 @@ async def pay_invoice( logger.debug("balance is too low, deleting temporary payment") if not internal_checking_id and wallet.balance_msat > -fee_reserve_msat: raise PaymentFailure( - f"You must reserve at least 1% ({round(fee_reserve_msat/1000)} sat) to cover potential routing fees." + f"You must reserve at least ({round(fee_reserve_msat/1000)} sat) to cover potential routing fees." ) raise PermissionError("Insufficient balance.") @@ -181,30 +196,41 @@ async def pay_invoice( payment: PaymentResponse = await WALLET.pay_invoice( payment_request, fee_reserve_msat ) + + if payment.checking_id and payment.checking_id != temp_id: + logger.warning( + f"backend sent unexpected checking_id (expected: {temp_id} got: {payment.checking_id})" + ) + logger.debug(f"backend: pay_invoice finished {temp_id}") - if payment.checking_id: - logger.debug(f"creating final payment {payment.checking_id}") + if payment.checking_id and payment.ok != False: + # payment.ok can be True (paid) or None (pending)! + logger.debug(f"updating payment {temp_id}") async with db.connect() as conn: - await create_payment( - checking_id=payment.checking_id, + await update_payment_details( + checking_id=temp_id, + pending=payment.ok != True, fee=payment.fee_msat, preimage=payment.preimage, - pending=payment.ok == None, + new_checking_id=payment.checking_id, conn=conn, - **payment_kwargs, ) - logger.debug(f"deleting temporary payment {temp_id}") - await delete_payment(temp_id, conn=conn) - else: - logger.debug(f"backend payment failed, no checking_id {temp_id}") + logger.debug(f"payment successful {payment.checking_id}") + elif payment.checking_id is None and payment.ok == False: + # payment failed + logger.warning(f"backend sent payment failure") async with db.connect() as conn: logger.debug(f"deleting temporary payment {temp_id}") - await delete_payment(temp_id, conn=conn) + await delete_wallet_payment(temp_id, wallet_id, conn=conn) raise PaymentFailure( - payment.error_message + f"Payment failed: {payment.error_message}" or "Payment failed, but backend didn't give us an error message." ) - logger.debug(f"payment successful {payment.checking_id}") + else: + logger.warning( + f"didn't receive checking_id from backend, payment may be stuck in database: {temp_id}" + ) + return invoice.payment_hash @@ -337,26 +363,22 @@ async def perform_lnurlauth( ) -async def check_invoice_status( +async def check_transaction_status( wallet_id: str, payment_hash: str, conn: Optional[Connection] = None ) -> PaymentStatus: - payment = await get_wallet_payment(wallet_id, payment_hash, conn=conn) + payment: Optional[Payment] = await get_wallet_payment( + wallet_id, payment_hash, conn=conn + ) if not payment: return PaymentStatus(None) - status = await WALLET.get_invoice_status(payment.checking_id) if not payment.pending: - return status - if payment.is_out and status.failed: - logger.info(f"deleting outgoing failed payment {payment.checking_id}: {status}") - await payment.delete() - elif not status.pending: - logger.info( - f"marking '{'in' if payment.is_in else 'out'}' {payment.checking_id} as not pending anymore: {status}" - ) - await payment.set_pending(status.pending) + # note: before, we still checked the status of the payment again + return PaymentStatus(True) + + status: PaymentStatus = await payment.check_status() return status # WARN: this same value must be used for balance check and passed to WALLET.pay_invoice(), it may cause a vulnerability if the values differ def fee_reserve(amount_msat: int) -> int: - return max(2000, int(amount_msat * 0.01)) + return max(int(RESERVE_FEE_MIN), int(amount_msat * RESERVE_FEE_PERCENT / 100.0)) diff --git a/lnbits/core/static/js/wallet.js b/lnbits/core/static/js/wallet.js index baa9f605..76d82ad4 100644 --- a/lnbits/core/static/js/wallet.js +++ b/lnbits/core/static/js/wallet.js @@ -232,6 +232,9 @@ new Vue({ generateChart(this.$refs.canvas, this.payments) }) }, + focusInput(el) { + this.$nextTick(() => this.$refs[el].focus()) + }, showReceiveDialog: function () { this.receive.show = true this.receive.status = 'pending' @@ -243,6 +246,7 @@ new Vue({ this.receive.paymentChecker = null this.receive.minMax = [0, 2100000000000000] this.receive.lnurl = null + this.focusInput('setAmount') }, showParseDialog: function () { this.parse.show = true @@ -365,9 +369,9 @@ new Vue({ decodeRequest: function () { this.parse.show = true let req = this.parse.data.request.toLowerCase() - if (this.parse.data.request.startsWith('lightning:')) { + if (this.parse.data.request.toLowerCase().startsWith('lightning:')) { this.parse.data.request = this.parse.data.request.slice(10) - } else if (this.parse.data.request.startsWith('lnurl:')) { + } else if (this.parse.data.request.toLowerCase().startsWith('lnurl:')) { this.parse.data.request = this.parse.data.request.slice(6) } else if (req.indexOf('lightning=lnurl1') !== -1) { this.parse.data.request = this.parse.data.request @@ -668,7 +672,17 @@ new Vue({ }) }, exportCSV: function () { - LNbits.utils.exportCSV(this.paymentsTable.columns, this.payments) + // status is important for export but it is not in paymentsTable + // because it is manually added with payment detail link and icons + // and would cause duplication in the list + let columns = structuredClone(this.paymentsTable.columns) + columns.unshift({ + name: 'pending', + align: 'left', + label: 'Pending', + field: 'pending' + }) + LNbits.utils.exportCSV(columns, this.payments) } }, watch: { diff --git a/lnbits/core/templates/core/index.html b/lnbits/core/templates/core/index.html index f363a841..f769b44f 100644 --- a/lnbits/core/templates/core/index.html +++ b/lnbits/core/templates/core/index.html @@ -66,7 +66,7 @@ outline color="grey" type="a" - href="https://github.com/lnbits/lnbits" + href="https://github.com/lnbits/lnbits-legend" target="_blank" rel="noopener" >View project in GitHubDonate @@ -710,7 +711,7 @@
Warning

- Login functionality to be released in v0.2, for now, + Login functionality to be released in a future update, for now, make sure you bookmark this page for future access to your walletTutorial + +**Disclaimer:** ***Use this only if you either know what you are doing or are a reckless lightning pioneer. Only you are responsible for all your sats, cards and other devices. Always backup all your card keys!*** + +***In order to use this extension you need to be able to setup your own card.*** That means writing a URL template pointing to your LNBits instance, configuring some SUN (SDM) settings and optionally changing the card's keys. There's a [guide](https://www.whitewolftech.com/articles/payment-card/) to set it up with a card reader connected to your computer. It can be done (without setting the keys) with [TagWriter app by NXP](https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter) Android app. Last but not least, an OSS android app by name [bolt-nfc-android-app](https://github.com/boltcard/bolt-nfc-android-app) is being developed for these purposes. It's available from Google Play [here](https://play.google.com/store/apps/details?id=com.lightningnfcapp). + +## About the keys + +Up to five 16-byte keys can be stored on the card, numbered from 00 to 04. In the empty state they all should be set to zeros (00000000000000000000000000000000). For this extension only two keys need to be set: + +One for encrypting the card UID and the counter (p parameter), let's called it meta key, key #01 or K1. + +One for calculating CMAC (c parameter), let's called it file key, key #02 or K2. + +The key #00, K0 (also know as auth key) is skipped to be use as authentification key. Is not needed by this extension, but can be filled in order to write the keys in cooperation with bolt-nfc-android-app. + +***Always backup all keys that you're trying to write on the card. Without them you may not be able to change them in the future!*** + +## Setting the card - bolt-nfc-android-app (easy way) +So far, regarding the keys, the app can only write a new key set on an empty card (with zero keys). **When you write non zero (and 'non debug') keys, they can't be rewrite with this app.** You have to do it on your computer. + +- Read the card with the app. Note UID so you can fill it in the extension later. +- Write the link on the card. It shoud be like `YOUR_LNBITS_DOMAIN/boltcards/api/v1/scan/{external_id}` + - `{external_id}` should be replaced with the External ID found in the LNBits dialog. + +- Add new card in the extension. + - Set a max sats per transaction. Any transaction greater than this amount will be rejected. + - Set a max sats per day. After the card spends this amount of sats in a day, additional transactions will be rejected. + - Set a card name. This is just for your reference inside LNBits. + - Set the card UID. This is the unique identifier on your NFC card and is 7 bytes. + - If on an Android device with a newish version of Chrome, you can click the icon next to the input and tap your card to autofill this field. + - Advanced Options + - Card Keys (k0, k1, k2) will be automatically generated if not explicitly set. + - Set to 16 bytes of 0s (00000000000000000000000000000000) to leave the keys in debug mode. + - GENERATE KEY button fill the keys randomly. If there is "debug" in the card name, a debug set of keys is filled instead. + - Click CREATE CARD button +- Click the QR code button next to a card to view its details. You can scan the QR code with the Android app to import the keys. +- Click the "KEYS / AUTH LINK" button to copy the auth URL to the clipboard. You can then paste this into the Android app to import the keys. +- Tap the NFC card to write the keys to the card. + +## Setting the card - computer (hard way) + +Follow the guide. + +The URI should be `lnurlw://YOUR-DOMAIN.COM/boltcards/api/v1/scan/{YOUR_card_external_id}?p=00000000000000000000000000000000&c=0000000000000000` + +Then fill up the card parameters in the extension. Card Auth key (K0) can be omitted. Initical counter can be 0. + +## Setting the card - android NXP app (hard way) +- If you don't know the card ID, use NXP TagInfo app to find it out. +- In the TagWriter app tap Write tags +- New Data Set > Link +- Set URI type to Custom URL +- URL should look like lnurlw://YOUR_LNBITS_DOMAIN/boltcards/api/v1/scan/{YOUR_card_external_id}?p=00000000000000000000000000000000&c=0000000000000000 +- click Configure mirroring options +- Select Card Type NTAG 424 DNA +- Check Enable SDM Mirroring +- Select SDM Meta Read Access Right to 01 +- Check Enable UID Mirroring +- Check Enable Counter Mirroring +- Set SDM Counter Retrieval Key to 0E +- Set PICC Data Offset to immediately after e= +- Set Derivation Key for CMAC Calculation to 00 +- Set SDM MAC Input Offset to immediately after c= +- Set SDM MAC Offset to immediately after c= +- Save & Write +- Scan with compatible Wallet + +This app afaik cannot change the keys. If you cannot change them any other way, leave them empty in the extension dialog and remember you're not secure. Card Auth key (K0) can be omitted anyway. Initical counter can be 0. diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py new file mode 100644 index 00000000..bfdc7492 --- /dev/null +++ b/lnbits/extensions/boltcards/__init__.py @@ -0,0 +1,37 @@ +import asyncio + +from fastapi import APIRouter +from starlette.staticfiles import StaticFiles + +from lnbits.db import Database +from lnbits.helpers import template_renderer +from lnbits.tasks import catch_everything_and_restart + +db = Database("ext_boltcards") + +boltcards_static_files = [ + { + "path": "/boltcards/static", + "app": StaticFiles(packages=[("lnbits", "extensions/boltcards/static")]), + "name": "boltcards_static", + } +] + +boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) + + +def boltcards_renderer(): + return template_renderer(["lnbits/extensions/boltcards/templates"]) + + +from .lnurl import * # noqa +from .tasks import * # noqa + + +def boltcards_start(): + loop = asyncio.get_event_loop() + loop.create_task(catch_everything_and_restart(wait_for_paid_invoices)) + + +from .views import * # noqa +from .views_api import * # noqa diff --git a/lnbits/extensions/boltcards/config.json b/lnbits/extensions/boltcards/config.json new file mode 100644 index 00000000..e46070d3 --- /dev/null +++ b/lnbits/extensions/boltcards/config.json @@ -0,0 +1,6 @@ +{ + "name": "Bolt Cards", + "short_description": "Self custody Bolt Cards with one time LNURLw", + "icon": "payment", + "contributors": ["iwarpbtc", "arcbtc", "leesalminen"] +} diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py new file mode 100644 index 00000000..c541346e --- /dev/null +++ b/lnbits/extensions/boltcards/crud.py @@ -0,0 +1,273 @@ +import secrets +from datetime import date, datetime +from typing import List, Optional, Union + +from lnbits.helpers import urlsafe_short_hash + +from . import db +from .models import Card, CreateCardData, Hit, Refund + + +async def create_card(data: CreateCardData, wallet_id: str) -> Card: + card_id = urlsafe_short_hash().upper() + extenal_id = urlsafe_short_hash().lower() + + await db.execute( + """ + INSERT INTO boltcards.cards ( + id, + uid, + external_id, + wallet, + card_name, + counter, + tx_limit, + daily_limit, + enable, + k0, + k1, + k2, + otp + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + card_id, + data.uid.upper(), + extenal_id, + wallet_id, + data.card_name, + data.counter, + data.tx_limit, + data.daily_limit, + True, + data.k0, + data.k1, + data.k2, + secrets.token_hex(16), + ), + ) + card = await get_card(card_id) + assert card, "Newly created card couldn't be retrieved" + return card + + +async def update_card(card_id: str, **kwargs) -> Optional[Card]: + if "is_unique" in kwargs: + kwargs["is_unique"] = int(kwargs["is_unique"]) + if "uid" in kwargs: + kwargs["uid"] = kwargs["uid"].upper() + q = ", ".join([f"{field[0]} = ?" for field in kwargs.items()]) + await db.execute( + f"UPDATE boltcards.cards SET {q} WHERE id = ?", + (*kwargs.values(), card_id), + ) + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE id = ?", (card_id,)) + return Card(**row) if row else None + + +async def get_cards(wallet_ids: Union[str, List[str]]) -> List[Card]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltcards.cards WHERE wallet IN ({q})", (*wallet_ids,) + ) + + return [Card(**row) for row in rows] + + +async def get_card(card_id: str) -> Optional[Card]: + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE id = ?", (card_id,)) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + + +async def get_card_by_uid(card_uid: str) -> Optional[Card]: + row = await db.fetchone( + "SELECT * FROM boltcards.cards WHERE uid = ?", (card_uid.upper(),) + ) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + + +async def get_card_by_external_id(external_id: str) -> Optional[Card]: + row = await db.fetchone( + "SELECT * FROM boltcards.cards WHERE external_id = ?", (external_id.lower(),) + ) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + + +async def get_card_by_otp(otp: str) -> Optional[Card]: + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE otp = ?", (otp,)) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + + +async def delete_card(card_id: str) -> None: + # Delete cards + card = await get_card(card_id) + await db.execute("DELETE FROM boltcards.cards WHERE id = ?", (card_id,)) + # Delete hits + hits = await get_hits([card_id]) + for hit in hits: + await db.execute("DELETE FROM boltcards.hits WHERE id = ?", (hit.id,)) + # Delete refunds + refunds = await get_refunds([hit]) + for refund in refunds: + await db.execute( + "DELETE FROM boltcards.refunds WHERE id = ?", (refund.hit_id,) + ) + + +async def update_card_counter(counter: int, id: str): + await db.execute( + "UPDATE boltcards.cards SET counter = ? WHERE id = ?", + (counter, id), + ) + + +async def enable_disable_card(enable: bool, id: str) -> Optional[Card]: + row = await db.execute( + "UPDATE boltcards.cards SET enable = ? WHERE id = ?", + (enable, id), + ) + return await get_card(id) + + +async def update_card_otp(otp: str, id: str): + await db.execute( + "UPDATE boltcards.cards SET otp = ? WHERE id = ?", + (otp, id), + ) + + +async def get_hit(hit_id: str) -> Optional[Hit]: + row = await db.fetchone(f"SELECT * FROM boltcards.hits WHERE id = ?", (hit_id)) + if not row: + return None + + hit = dict(**row) + + return Hit.parse_obj(hit) + + +async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: + q = ",".join(["?"] * len(cards_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltcards.hits WHERE card_id IN ({q})", (*cards_ids,) + ) + + return [Hit(**row) for row in rows] + + +async def get_hits_today(card_id: str) -> Optional[Hit]: + rows = await db.fetchall( + f"SELECT * FROM boltcards.hits WHERE card_id = ?", + (card_id,), + ) + updatedrow = [] + for row in rows: + if datetime.now().date() == datetime.fromtimestamp(row.time).date(): + updatedrow.append(row) + + return [Hit(**row) for row in updatedrow] + + +async def spend_hit(id: str, amount: int): + await db.execute( + "UPDATE boltcards.hits SET spent = ?, amount = ? WHERE id = ?", + (True, amount, id), + ) + return await get_hit(id) + + +async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: + hit_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO boltcards.hits ( + id, + card_id, + ip, + spent, + useragent, + old_ctr, + new_ctr, + amount + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + hit_id, + card_id, + ip, + False, + useragent, + old_ctr, + new_ctr, + 0, + ), + ) + hit = await get_hit(hit_id) + assert hit, "Newly recorded hit couldn't be retrieved" + return hit + + +async def create_refund(hit_id, refund_amount) -> Refund: + refund_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO boltcards.refunds ( + id, + hit_id, + refund_amount + ) + VALUES (?, ?, ?) + """, + ( + refund_id, + hit_id, + refund_amount, + ), + ) + refund = await get_refund(refund_id) + assert refund, "Newly recorded hit couldn't be retrieved" + return refund + + +async def get_refund(refund_id: str) -> Optional[Refund]: + row = await db.fetchone( + f"SELECT * FROM boltcards.refunds WHERE id = ?", (refund_id) + ) + if not row: + return None + refund = dict(**row) + return Refund.parse_obj(refund) + + +async def get_refunds(hits_ids: Union[str, List[str]]) -> List[Refund]: + q = ",".join(["?"] * len(hits_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltcards.refunds WHERE hit_id IN ({q})", (*hits_ids,) + ) + + return [Refund(**row) for row in rows] diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py new file mode 100644 index 00000000..6fb9ad8d --- /dev/null +++ b/lnbits/extensions/boltcards/lnurl.py @@ -0,0 +1,219 @@ +import base64 +import hashlib +import hmac +import json +import secrets +from http import HTTPStatus +from io import BytesIO +from typing import Optional +from urllib.parse import urlparse + +from embit import bech32, compact +from fastapi import Request +from fastapi.param_functions import Query +from fastapi.params import Depends, Query +from lnurl import Lnurl, LnurlWithdrawResponse +from lnurl import encode as lnurl_encode # type: ignore +from lnurl.types import LnurlPayMetadata # type: ignore +from loguru import logger +from starlette.exceptions import HTTPException +from starlette.requests import Request +from starlette.responses import HTMLResponse + +from lnbits import bolt11 +from lnbits.core.services import create_invoice +from lnbits.core.views.api import pay_invoice + +from . import boltcards_ext +from .crud import ( + create_hit, + get_card, + get_card_by_external_id, + get_card_by_otp, + get_hit, + get_hits_today, + spend_hit, + update_card, + update_card_counter, + update_card_otp, +) +from .models import CreateCardData +from .nxp424 import decryptSUN, getSunMAC + +###############LNURLWITHDRAW################# + +# /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 +@boltcards_ext.get("/api/v1/scan/{external_id}") +async def api_scan(p, c, request: Request, external_id: str = None): + # some wallets send everything as lower case, no bueno + p = p.upper() + c = c.upper() + card = None + counter = b"" + card = await get_card_by_external_id(external_id) + if not card: + return {"status": "ERROR", "reason": "No card."} + if not card.enable: + return {"status": "ERROR", "reason": "Card is disabled."} + try: + card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) + if card.uid.upper() != card_uid.hex().upper(): + return {"status": "ERROR", "reason": "Card UID mis-match."} + if c != getSunMAC(card_uid, counter, bytes.fromhex(card.k2)).hex().upper(): + return {"status": "ERROR", "reason": "CMAC does not check."} + except: + return {"status": "ERROR", "reason": "Error decrypting card."} + + ctr_int = int.from_bytes(counter, "little") + + if ctr_int <= card.counter: + return {"status": "ERROR", "reason": "This link is already used."} + + await update_card_counter(ctr_int, card.id) + + # gathering some info for hit record + ip = request.client.host + if "x-real-ip" in request.headers: + ip = request.headers["x-real-ip"] + elif "x-forwarded-for" in request.headers: + ip = request.headers["x-forwarded-for"] + + agent = request.headers["user-agent"] if "user-agent" in request.headers else "" + todays_hits = await get_hits_today(card.id) + + hits_amount = 0 + for hit in todays_hits: + hits_amount = hits_amount + hit.amount + if hits_amount > card.daily_limit: + return {"status": "ERROR", "reason": "Max daily limit spent."} + hit = await create_hit(card.id, ip, agent, card.counter, ctr_int) + lnurlpay = lnurl_encode(request.url_for("boltcards.lnurlp_response", hit_id=hit.id)) + return { + "tag": "withdrawRequest", + "callback": request.url_for("boltcards.lnurl_callback", hitid=hit.id), + "k1": hit.id, + "minWithdrawable": 1 * 1000, + "maxWithdrawable": card.tx_limit * 1000, + "defaultDescription": f"Boltcard (refund address lnurl://{lnurlpay})", + } + + +@boltcards_ext.get( + "/api/v1/lnurl/cb/{hitid}", + status_code=HTTPStatus.OK, + name="boltcards.lnurl_callback", +) +async def lnurl_callback( + request: Request, + pr: str = Query(None), + k1: str = Query(None), +): + hit = await get_hit(k1) + card = await get_card(hit.card_id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + if hit.id != k1: + return {"status": "ERROR", "reason": "Bad K1"} + if hit.spent: + return {"status": "ERROR", "reason": f"Payment already claimed"} + invoice = bolt11.decode(pr) + hit = await spend_hit(id=hit.id, amount=int(invoice.amount_msat / 1000)) + try: + await pay_invoice( + wallet_id=card.wallet, + payment_request=pr, + max_sat=card.tx_limit, + extra={"tag": "boltcard", "tag": hit.id}, + ) + return {"status": "OK"} + except: + return {"status": "ERROR", "reason": f"Payment failed"} + + +# /boltcards/api/v1/auth?a=00000000000000000000000000000000 +@boltcards_ext.get("/api/v1/auth") +async def api_auth(a, request: Request): + if a == "00000000000000000000000000000000": + response = {"k0": "0" * 32, "k1": "1" * 32, "k2": "2" * 32} + return response + + card = await get_card_by_otp(a) + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + + new_otp = secrets.token_hex(16) + await update_card_otp(new_otp, card.id) + + lnurlw_base = ( + f"{urlparse(str(request.url)).netloc}/boltcards/api/v1/scan/{card.external_id}" + ) + + response = { + "card_name": card.card_name, + "id": 1, + "k0": card.k0, + "k1": card.k1, + "k2": card.k2, + "k3": card.k1, + "k4": card.k2, + "lnurlw_base": "lnurlw://" + lnurlw_base, + "protocol_name": "new_bolt_card_response", + "protocol_version": 1, + } + + return response + + +###############LNURLPAY REFUNDS################# + + +@boltcards_ext.get( + "/api/v1/lnurlp/{hit_id}", + response_class=HTMLResponse, + name="boltcards.lnurlp_response", +) +async def lnurlp_response(req: Request, hit_id: str = Query(None)): + hit = await get_hit(hit_id) + card = await get_card(hit.card_id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + if not card.enable: + return {"status": "ERROR", "reason": "Card is disabled."} + payResponse = { + "tag": "payRequest", + "callback": req.url_for("boltcards.lnurlp_callback", hit_id=hit_id), + "metadata": LnurlPayMetadata(json.dumps([["text/plain", "Refund"]])), + "minSendable": 1 * 1000, + "maxSendable": card.tx_limit * 1000, + } + return json.dumps(payResponse) + + +@boltcards_ext.get( + "/api/v1/lnurlp/cb/{hit_id}", + response_class=HTMLResponse, + name="boltcards.lnurlp_callback", +) +async def lnurlp_callback( + req: Request, hit_id: str = Query(None), amount: str = Query(None) +): + hit = await get_hit(hit_id) + card = await get_card(hit.card_id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + + payment_hash, payment_request = await create_invoice( + wallet_id=card.wallet, + amount=int(amount) / 1000, + memo=f"Refund {hit_id}", + unhashed_description=LnurlPayMetadata( + json.dumps([["text/plain", "Refund"]]) + ).encode("utf-8"), + extra={"refund": hit_id}, + ) + + payResponse = {"pr": payment_request, "routes": []} + + return json.dumps(payResponse) diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py new file mode 100644 index 00000000..08126013 --- /dev/null +++ b/lnbits/extensions/boltcards/migrations.py @@ -0,0 +1,60 @@ +from lnbits.helpers import urlsafe_short_hash + + +async def m001_initial(db): + await db.execute( + """ + CREATE TABLE boltcards.cards ( + id TEXT PRIMARY KEY UNIQUE, + wallet TEXT NOT NULL, + card_name TEXT NOT NULL, + uid TEXT NOT NULL UNIQUE, + external_id TEXT NOT NULL UNIQUE, + counter INT NOT NULL DEFAULT 0, + tx_limit TEXT NOT NULL, + daily_limit TEXT NOT NULL, + enable BOOL NOT NULL, + k0 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + k1 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + k2 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k0 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k1 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k2 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + otp TEXT NOT NULL DEFAULT '', + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) + + await db.execute( + """ + CREATE TABLE boltcards.hits ( + id TEXT PRIMARY KEY UNIQUE, + card_id TEXT NOT NULL, + ip TEXT NOT NULL, + spent BOOL NOT NULL DEFAULT True, + useragent TEXT, + old_ctr INT NOT NULL DEFAULT 0, + new_ctr INT NOT NULL DEFAULT 0, + amount INT NOT NULL, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) + + await db.execute( + """ + CREATE TABLE boltcards.refunds ( + id TEXT PRIMARY KEY UNIQUE, + hit_id TEXT NOT NULL, + refund_amount INT NOT NULL, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py new file mode 100644 index 00000000..47ca1df0 --- /dev/null +++ b/lnbits/extensions/boltcards/models.py @@ -0,0 +1,83 @@ +from sqlite3 import Row +from typing import Optional + +from fastapi import Request +from fastapi.params import Query +from lnurl import Lnurl +from lnurl import encode as lnurl_encode # type: ignore +from lnurl.models import LnurlPaySuccessAction, UrlAction # type: ignore +from lnurl.types import LnurlPayMetadata # type: ignore +from pydantic import BaseModel +from pydantic.main import BaseModel + +ZERO_KEY = "00000000000000000000000000000000" + + +class Card(BaseModel): + id: str + wallet: str + card_name: str + uid: str + external_id: str + counter: int + tx_limit: int + daily_limit: int + enable: bool + k0: str + k1: str + k2: str + prev_k0: str + prev_k1: str + prev_k2: str + otp: str + time: int + + def from_row(cls, row: Row) -> "Card": + return cls(**dict(row)) + + def lnurl(self, req: Request) -> Lnurl: + url = req.url_for("boltcard.lnurl_response", device_id=self.id, _external=True) + return lnurl_encode(url) + + async def lnurlpay_metadata(self) -> LnurlPayMetadata: + return LnurlPayMetadata(json.dumps([["text/plain", self.title]])) + + +class CreateCardData(BaseModel): + card_name: str = Query(...) + uid: str = Query(...) + counter: int = Query(0) + tx_limit: int = Query(0) + daily_limit: int = Query(0) + enable: bool = Query(True) + k0: str = Query(ZERO_KEY) + k1: str = Query(ZERO_KEY) + k2: str = Query(ZERO_KEY) + prev_k0: str = Query(ZERO_KEY) + prev_k1: str = Query(ZERO_KEY) + prev_k2: str = Query(ZERO_KEY) + + +class Hit(BaseModel): + id: str + card_id: str + ip: str + spent: bool + useragent: str + old_ctr: int + new_ctr: int + amount: int + time: int + + def from_row(cls, row: Row) -> "Hit": + return cls(**dict(row)) + + +class Refund(BaseModel): + id: str + hit_id: str + refund_amount: int + time: int + + def from_row(cls, row: Row) -> "Refund": + return cls(**dict(row)) diff --git a/lnbits/extensions/boltcards/nxp424.py b/lnbits/extensions/boltcards/nxp424.py new file mode 100644 index 00000000..83f4e50d --- /dev/null +++ b/lnbits/extensions/boltcards/nxp424.py @@ -0,0 +1,36 @@ +# https://www.nxp.com/docs/en/application-note/AN12196.pdf +from typing import Tuple + +from Cryptodome.Cipher import AES +from Cryptodome.Hash import CMAC + +SV2 = "3CC300010080" + + +def myCMAC(key: bytes, msg: bytes = b"") -> bytes: + cobj = CMAC.new(key, ciphermod=AES) + if msg != b"": + cobj.update(msg) + return cobj.digest() + + +def decryptSUN(sun: bytes, key: bytes) -> Tuple[bytes, bytes]: + IVbytes = b"\x00" * 16 + + cipher = AES.new(key, AES.MODE_CBC, IVbytes) + sun_plain = cipher.decrypt(sun) + + UID = sun_plain[1:8] + counter = sun_plain[8:11] + + return UID, counter + + +def getSunMAC(UID: bytes, counter: bytes, key: bytes) -> bytes: + sv2prefix = bytes.fromhex(SV2) + sv2bytes = sv2prefix + UID + counter + + mac1 = myCMAC(key, sv2bytes) + mac2 = myCMAC(mac1) + + return mac2[1::2] diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js new file mode 100644 index 00000000..11df222a --- /dev/null +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -0,0 +1,435 @@ +Vue.component(VueQrcode.name, VueQrcode) + +const mapCards = obj => { + obj.date = Quasar.utils.date.formatDate( + new Date(obj.time * 1000), + 'YYYY-MM-DD HH:mm' + ) + + return obj +} + +new Vue({ + el: '#vue', + mixins: [windowMixin], + data: function () { + return { + toggleAdvanced: false, + nfcTagReading: false, + lnurlLink: `${window.location.host}/boltcards/api/v1/scan/`, + cards: [], + hits: [], + refunds: [], + cardDialog: { + show: false, + data: { + counter: 1, + k0: '', + k1: '', + k2: '', + uid: '', + card_name: '' + }, + temp: {} + }, + cardsTable: { + columns: [ + { + name: 'card_name', + align: 'left', + label: 'Card name', + field: 'card_name' + }, + { + name: 'counter', + align: 'left', + label: 'Counter', + field: 'counter' + }, + { + name: 'wallet', + align: 'left', + label: 'Wallet', + field: 'wallet' + }, + { + name: 'tx_limit', + align: 'left', + label: 'Max tx', + field: 'tx_limit' + }, + { + name: 'daily_limit', + align: 'left', + label: 'Daily tx limit', + field: 'daily_limit' + } + ], + pagination: { + rowsPerPage: 10 + } + }, + refundsTable: { + columns: [ + { + name: 'hit_id', + align: 'left', + label: 'Hit ID', + field: 'hit_id' + }, + { + name: 'refund_amount', + align: 'left', + label: 'Refund Amount', + field: 'refund_amount' + }, + { + name: 'date', + align: 'left', + label: 'Time', + field: 'date' + } + ], + pagination: { + rowsPerPage: 10, + sortBy: 'date', + descending: true + } + }, + hitsTable: { + columns: [ + { + name: 'card_name', + align: 'left', + label: 'Card name', + field: 'card_name' + }, + { + name: 'amount', + align: 'left', + label: 'Amount', + field: 'amount' + }, + { + name: 'old_ctr', + align: 'left', + label: 'Old counter', + field: 'old_ctr' + }, + { + name: 'new_ctr', + align: 'left', + label: 'New counter', + field: 'new_ctr' + }, + { + name: 'date', + align: 'left', + label: 'Time', + field: 'date' + }, + { + name: 'ip', + align: 'left', + label: 'IP', + field: 'ip' + }, + { + name: 'useragent', + align: 'left', + label: 'User agent', + field: 'useragent' + } + ], + pagination: { + rowsPerPage: 10, + sortBy: 'date', + descending: true + } + }, + qrCodeDialog: { + show: false, + data: null + } + } + }, + methods: { + readNfcTag: function () { + try { + const self = this + + if (typeof NDEFReader == 'undefined') { + throw { + toString: function () { + return 'NFC not supported on this device or browser.' + } + } + } + + const ndef = new NDEFReader() + + const readerAbortController = new AbortController() + readerAbortController.signal.onabort = event => { + console.log('All NFC Read operations have been aborted.') + } + + this.nfcTagReading = true + this.$q.notify({ + message: 'Tap your NFC tag to copy its UID here.' + }) + + return ndef.scan({signal: readerAbortController.signal}).then(() => { + ndef.onreadingerror = () => { + self.nfcTagReading = false + + this.$q.notify({ + type: 'negative', + message: 'There was an error reading this NFC tag.' + }) + + readerAbortController.abort() + } + + ndef.onreading = ({message, serialNumber}) => { + //Decode NDEF data from tag + var self = this + self.cardDialog.data.uid = serialNumber + .toUpperCase() + .replaceAll(':', '') + this.$q.notify({ + type: 'positive', + message: 'NFC tag read successfully.' + }) + } + }) + } catch (error) { + this.nfcTagReading = false + this.$q.notify({ + type: 'negative', + message: error + ? error.toString() + : 'An unexpected error has occurred.' + }) + } + }, + getCards: function () { + var self = this + + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/cards?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.cards = response.data.map(function (obj) { + return mapCards(obj) + }) + }) + .then(function () { + self.getHits() + }) + }, + getHits: function () { + var self = this + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/hits?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.hits = response.data.map(function (obj) { + obj.card_name = self.cards.find(d => d.id == obj.card_id).card_name + return mapCards(obj) + }) + }) + }, + getRefunds: function () { + var self = this + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/refunds?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.refunds = response.data.map(function (obj) { + return mapCards(obj) + }) + }) + }, + openQrCodeDialog(cardId) { + var card = _.findWhere(this.cards, {id: cardId}) + this.qrCodeDialog.data = { + link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, + name: card.card_name, + uid: card.uid, + external_id: card.external_id, + k0: card.k0, + k1: card.k1, + k2: card.k2, + k3: card.k1, + k4: card.k2 + } + this.qrCodeDialog.show = true + }, + addCardOpen: function () { + this.cardDialog.show = true + this.generateKeys() + }, + generateKeys: function () { + var self = this + const genRanHex = size => + [...Array(size)] + .map(() => Math.floor(Math.random() * 16).toString(16)) + .join('') + + debugcard = + typeof this.cardDialog.data.card_name === 'string' && + this.cardDialog.data.card_name.search('debug') > -1 + + self.cardDialog.data.k0 = debugcard + ? '11111111111111111111111111111111' + : genRanHex(32) + + self.cardDialog.data.k1 = debugcard + ? '22222222222222222222222222222222' + : genRanHex(32) + + self.cardDialog.data.k2 = debugcard + ? '33333333333333333333333333333333' + : genRanHex(32) + }, + closeFormDialog: function () { + this.cardDialog.data = {} + }, + sendFormData: function () { + let wallet = _.findWhere(this.g.user.wallets, { + id: this.cardDialog.data.wallet + }) + let data = this.cardDialog.data + if (data.id) { + this.updateCard(wallet, data) + } else { + this.createCard(wallet, data) + } + }, + createCard: function (wallet, data) { + var self = this + + LNbits.api + .request('POST', '/boltcards/api/v1/cards', wallet.adminkey, data) + .then(function (response) { + self.cards.push(mapCards(response.data)) + self.cardDialog.show = false + self.cardDialog.data = {} + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + updateCardDialog: function (formId) { + var card = _.findWhere(this.cards, {id: formId}) + this.cardDialog.data = _.clone(card) + + this.cardDialog.temp.k0 = this.cardDialog.data.k0 + this.cardDialog.temp.k1 = this.cardDialog.data.k1 + this.cardDialog.temp.k2 = this.cardDialog.data.k2 + + this.cardDialog.show = true + }, + updateCard: function (wallet, data) { + var self = this + + if ( + this.cardDialog.temp.k0 != data.k0 || + this.cardDialog.temp.k1 != data.k1 || + this.cardDialog.temp.k2 != data.k2 + ) { + data.prev_k0 = this.cardDialog.temp.k0 + data.prev_k1 = this.cardDialog.temp.k1 + data.prev_k2 = this.cardDialog.temp.k2 + } + + LNbits.api + .request( + 'PUT', + '/boltcards/api/v1/cards/' + data.id, + wallet.adminkey, + data + ) + .then(function (response) { + self.cards = _.reject(self.cards, function (obj) { + return obj.id == data.id + }) + self.cards.push(mapCards(response.data)) + self.cardDialog.show = false + self.cardDialog.data = {} + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + enableCard: function (wallet, card_id, enable) { + var self = this + let fullWallet = _.findWhere(self.g.user.wallets, { + id: wallet + }) + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/cards/enable/' + card_id + '/' + enable, + fullWallet.adminkey + ) + .then(function (response) { + console.log(response.data) + self.cards = _.reject(self.cards, function (obj) { + return obj.id == response.data.id + }) + self.cards.push(mapCards(response.data)) + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + deleteCard: function (cardId) { + let self = this + let cards = _.findWhere(this.cards, {id: cardId}) + + LNbits.utils + .confirmDialog('Are you sure you want to delete this card') + .onOk(function () { + LNbits.api + .request( + 'DELETE', + '/boltcards/api/v1/cards/' + cardId, + _.findWhere(self.g.user.wallets, {id: cards.wallet}).adminkey + ) + .then(function (response) { + self.cards = _.reject(self.cards, function (obj) { + return obj.id == cardId + }) + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }) + }, + exportCardsCSV: function () { + LNbits.utils.exportCSV(this.cardsTable.columns, this.cards) + }, + exportHitsCSV: function () { + LNbits.utils.exportCSV(this.hitsTable.columns, this.hits) + }, + exportRefundsCSV: function () { + LNbits.utils.exportCSV(this.refundsTable.columns, this.refunds) + } + }, + created: function () { + if (this.g.user.wallets.length) { + this.getCards() + this.getRefunds() + } + } +}) diff --git a/lnbits/extensions/boltcards/tasks.py b/lnbits/extensions/boltcards/tasks.py new file mode 100644 index 00000000..1b51c98b --- /dev/null +++ b/lnbits/extensions/boltcards/tasks.py @@ -0,0 +1,47 @@ +import asyncio +import json + +import httpx + +from lnbits.core import db as core_db +from lnbits.core.models import Payment +from lnbits.tasks import register_invoice_listener + +from .crud import create_refund, get_hit + + +async def wait_for_paid_invoices(): + invoice_queue = asyncio.Queue() + register_invoice_listener(invoice_queue) + + while True: + payment = await invoice_queue.get() + await on_invoice_paid(payment) + + +async def on_invoice_paid(payment: Payment) -> None: + if not payment.extra.get("refund"): + return + + if payment.extra.get("wh_status"): + # this webhook has already been sent + return + hit = await get_hit(payment.extra.get("refund")) + + if hit: + refund = await create_refund( + hit_id=hit.id, refund_amount=(payment.amount / 1000) + ) + await mark_webhook_sent(payment, 1) + + +async def mark_webhook_sent(payment: Payment, status: int) -> None: + payment.extra["wh_status"] = status + + await core_db.execute( + """ + UPDATE apipayments SET extra = ? + WHERE hash = ? + """, + (json.dumps(payment.extra), payment.payment_hash), + ) diff --git a/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html new file mode 100644 index 00000000..be4e2ae8 --- /dev/null +++ b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html @@ -0,0 +1,21 @@ + + + +

Be your own card association
+

+ Manage your Bolt Cards self custodian way
+ + More details +
+

+ +
+ diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html new file mode 100644 index 00000000..55cc1e5e --- /dev/null +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -0,0 +1,405 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} + +
+
+ + +
+
+
+
+
Cards
+
+
+ + Add card + +
+
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+ + +
+
+
Hits
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+ + +
+
+
Refunds
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+
+
+ + +
+ {{SITE_TITLE}} Bolt Cards extension +
+
+ + + {% include "boltcards/_api_docs.html" %} + +
+
+ + + + + +
+
+ +
+
+ +
+
+ + +
+
+ + Get from the card you'll use, using an NFC app + +
+
+ + Tap card to scan UID + +
+
+ + +
+ + + + + + + Zero if you don't know. + + Generate keys +
+
+ Update Card + Create Card + + Cancel +
+
+
+
+ + + + {% raw %} + + + +

+ (Keys for + bolt-nfc-android-app) +

+

+ Name: {{ qrCodeDialog.data.name }}
+ UID: {{ qrCodeDialog.data.uid }}
+ External ID: {{ qrCodeDialog.data.external_id }}
+ Lock key: {{ qrCodeDialog.data.k0 }}
+ Meta key: {{ qrCodeDialog.data.k1 }}
+ File key: {{ qrCodeDialog.data.k2 }}
+

+
+ + + Click to copy, then add to NFC card + + {% endraw %} +
+ Close +
+
+
+
+ +{% endblock %} {% block scripts %} {{ window_vars(user) }} + +{% endblock %} diff --git a/lnbits/extensions/boltcards/views.py b/lnbits/extensions/boltcards/views.py new file mode 100644 index 00000000..8fcbb7de --- /dev/null +++ b/lnbits/extensions/boltcards/views.py @@ -0,0 +1,18 @@ +from fastapi import FastAPI, Request +from fastapi.params import Depends +from fastapi.templating import Jinja2Templates +from starlette.responses import HTMLResponse + +from lnbits.core.models import User +from lnbits.decorators import check_user_exists + +from . import boltcards_ext, boltcards_renderer + +templates = Jinja2Templates(directory="templates") + + +@boltcards_ext.get("/", response_class=HTMLResponse) +async def index(request: Request, user: User = Depends(check_user_exists)): + return boltcards_renderer().TemplateResponse( + "boltcards/index.html", {"request": request, "user": user.dict()} + ) diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py new file mode 100644 index 00000000..7b8357cf --- /dev/null +++ b/lnbits/extensions/boltcards/views_api.py @@ -0,0 +1,170 @@ +import secrets +from http import HTTPStatus + +from fastapi.params import Depends, Query +from loguru import logger +from starlette.exceptions import HTTPException +from starlette.requests import Request + +from lnbits.core.crud import get_user +from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key + +from . import boltcards_ext +from .crud import ( + create_card, + create_hit, + delete_card, + enable_disable_card, + get_card, + get_card_by_otp, + get_card_by_uid, + get_cards, + get_hits, + get_refunds, + update_card, + update_card_counter, + update_card_otp, +) +from .models import CreateCardData +from .nxp424 import decryptSUN, getSunMAC + + +@boltcards_ext.get("/api/v1/cards") +async def api_cards( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + return [card.dict() for card in await get_cards(wallet_ids)] + + +@boltcards_ext.post("/api/v1/cards", status_code=HTTPStatus.CREATED) +@boltcards_ext.put("/api/v1/cards/{card_id}", status_code=HTTPStatus.OK) +async def api_card_create_or_update( + # req: Request, + data: CreateCardData, + card_id: str = None, + wallet: WalletTypeInfo = Depends(require_admin_key), +): + try: + if len(bytes.fromhex(data.uid)) != 7: + raise HTTPException( + detail="Invalid bytes for card uid.", status_code=HTTPStatus.BAD_REQUEST + ) + + if len(bytes.fromhex(data.k0)) != 16: + raise HTTPException( + detail="Invalid bytes for k0.", status_code=HTTPStatus.BAD_REQUEST + ) + + if len(bytes.fromhex(data.k1)) != 16: + raise HTTPException( + detail="Invalid bytes for k1.", status_code=HTTPStatus.BAD_REQUEST + ) + + if len(bytes.fromhex(data.k2)) != 16: + raise HTTPException( + detail="Invalid bytes for k2.", status_code=HTTPStatus.BAD_REQUEST + ) + except: + raise HTTPException( + detail="Invalid byte data provided.", status_code=HTTPStatus.BAD_REQUEST + ) + if card_id: + card = await get_card(card_id) + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + if card.wallet != wallet.wallet.id: + raise HTTPException( + detail="Not your card.", status_code=HTTPStatus.FORBIDDEN + ) + checkUid = await get_card_by_uid(data.uid) + if checkUid and checkUid.id != card_id: + raise HTTPException( + detail="UID already registered. Delete registered card and try again.", + status_code=HTTPStatus.BAD_REQUEST, + ) + card = await update_card(card_id, **data.dict()) + else: + checkUid = await get_card_by_uid(data.uid) + if checkUid: + raise HTTPException( + detail="UID already registered. Delete registered card and try again.", + status_code=HTTPStatus.BAD_REQUEST, + ) + card = await create_card(wallet_id=wallet.wallet.id, data=data) + return card.dict() + + +@boltcards_ext.get("/api/v1/cards/enable/{card_id}/{enable}", status_code=HTTPStatus.OK) +async def enable_card( + card_id, + enable, + wallet: WalletTypeInfo = Depends(require_admin_key), +): + card = await get_card(card_id) + if not card: + raise HTTPException(detail="No card found.", status_code=HTTPStatus.NOT_FOUND) + if card.wallet != wallet.wallet.id: + raise HTTPException(detail="Not your card.", status_code=HTTPStatus.FORBIDDEN) + card = await enable_disable_card(enable=enable, id=card_id) + return card.dict() + + +@boltcards_ext.delete("/api/v1/cards/{card_id}") +async def api_card_delete(card_id, wallet: WalletTypeInfo = Depends(require_admin_key)): + card = await get_card(card_id) + + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + + if card.wallet != wallet.wallet.id: + raise HTTPException(detail="Not your card.", status_code=HTTPStatus.FORBIDDEN) + + await delete_card(card_id) + raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + + +@boltcards_ext.get("/api/v1/hits") +async def api_hits( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + cards = await get_cards(wallet_ids) + cards_ids = [] + for card in cards: + cards_ids.append(card.id) + + return [hit.dict() for hit in await get_hits(cards_ids)] + + +@boltcards_ext.get("/api/v1/refunds") +async def api_hits( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + cards = await get_cards(wallet_ids) + cards_ids = [] + for card in cards: + cards_ids.append(card.id) + hits = await get_hits(cards_ids) + hits_ids = [] + for hit in hits: + hits_ids.append(hit.id) + + return [refund.dict() for refund in await get_refunds(hits_ids)] diff --git a/lnbits/extensions/boltz/README.md b/lnbits/extensions/boltz/README.md new file mode 100644 index 00000000..28289b73 --- /dev/null +++ b/lnbits/extensions/boltz/README.md @@ -0,0 +1,40 @@ +# Swap on [Boltz](https://boltz.exchange) +providing **trustless** and **account-free** swap services since **2018.** +move **IN** and **OUT** of the **lightning network** and remain in control of your bitcoin, at all times. +* [Lightning Node](https://amboss.space/node/026165850492521f4ac8abd9bd8088123446d126f648ca35e60f88177dc149ceb2) +* [Documentation](https://docs.boltz.exchange/en/latest/) +* [Discord](https://discord.gg/d6EK85KK) +* [Twitter](https://twitter.com/Boltzhq) + +# usage +This extension lets you create swaps, reverse swaps and in the case of failure refund your onchain funds. + +## create normal swap +1. click on "Swap (IN)" button to open following dialog, select a wallet, choose a proper amount in the min-max range and choose a onchain address to do your refund to if the swap fails after you already commited onchain funds. +--- +![create swap](https://imgur.com/OyOh3Nm.png) +--- +2. after you confirm your inputs, following dialog with the QR code for the onchain transaction, onchain- address and amount, will pop up. +--- +![pay onchain tx](https://imgur.com/r2UhwCY.png) +--- +3. after you pay this onchain address with the correct amount, boltz will see it and will pay your invoice and the sats will appear on your wallet. + +if anything goes wrong when boltz is trying to pay your invoice, the swap will fail and you will need to refund your onchain funds after the timeout block height hit. (if boltz can pay the invoice, it wont be able to redeem your onchain funds either). + +## create reverse swap +1. click on "Swap (OUT)" button to open following dialog, select a wallet, choose a proper amount in the min-max range and choose a onchain address to receive your funds to. Instant settlement: means that LNbits will create the onchain claim transaction if it sees the boltz lockup transaction in the mempool, but it is not confirmed yet. it is advised to leave this checked because it is faster and the longer is takes to settle, the higher the chances are that the lightning invoice expires and the swap fails. +--- +![reverse swap](https://imgur.com/UEAPpbs.png) +--- +if this swap fails, boltz is doing the onchain refunding, because they have to commit onchain funds. + +# refund locked onchain funds from a normal swap +if for some reason the normal swap fails and you already paid onchain, you can easily refund your btc. +this can happen if boltz is not able to pay your lightning invoice after you locked up your funds. +in case that happens, there is a info icon in the Swap (In) List which opens following dialog. +--- +![refund](https://imgur.com/pN81ltf.png) +---- +if the timeout block height is exceeded you can either press refund and lnbits will do the refunding to the address you specified when creating the swap. Or download the refundfile so you can manually refund your onchain directly on the boltz.exchange website. +if you think there is something wrong and/or you are unsure, you can ask for help either in LNbits telegram or in Boltz [Discord](https://discord.gg/d6EK85KK) diff --git a/lnbits/extensions/boltz/__init__.py b/lnbits/extensions/boltz/__init__.py new file mode 100644 index 00000000..7eb2e5a7 --- /dev/null +++ b/lnbits/extensions/boltz/__init__.py @@ -0,0 +1,26 @@ +import asyncio + +from fastapi import APIRouter + +from lnbits.db import Database +from lnbits.helpers import template_renderer +from lnbits.tasks import catch_everything_and_restart + +db = Database("ext_boltz") + +boltz_ext: APIRouter = APIRouter(prefix="/boltz", tags=["boltz"]) + + +def boltz_renderer(): + return template_renderer(["lnbits/extensions/boltz/templates"]) + + +from .tasks import check_for_pending_swaps, wait_for_paid_invoices +from .views import * # noqa +from .views_api import * # noqa + + +def boltz_start(): + loop = asyncio.get_event_loop() + loop.create_task(check_for_pending_swaps()) + loop.create_task(catch_everything_and_restart(wait_for_paid_invoices)) diff --git a/lnbits/extensions/boltz/boltz.py b/lnbits/extensions/boltz/boltz.py new file mode 100644 index 00000000..4e5fecd0 --- /dev/null +++ b/lnbits/extensions/boltz/boltz.py @@ -0,0 +1,424 @@ +import asyncio +import os +from binascii import hexlify, unhexlify +from hashlib import sha256 +from typing import Awaitable, Union + +import httpx +from embit import ec, script +from embit.networks import NETWORKS +from embit.transaction import SIGHASH, Transaction, TransactionInput, TransactionOutput +from loguru import logger + +from lnbits.core.services import create_invoice, pay_invoice +from lnbits.helpers import urlsafe_short_hash +from lnbits.settings import BOLTZ_NETWORK, BOLTZ_URL + +from .crud import update_swap_status +from .mempool import ( + get_fee_estimation, + get_mempool_blockheight, + get_mempool_fees, + get_mempool_tx, + get_mempool_tx_from_txs, + send_onchain_tx, + wait_for_websocket_message, +) +from .models import ( + CreateReverseSubmarineSwap, + CreateSubmarineSwap, + ReverseSubmarineSwap, + SubmarineSwap, + SwapStatus, +) +from .utils import check_balance, get_timestamp, req_wrap + +net = NETWORKS[BOLTZ_NETWORK] +logger.debug(f"BOLTZ_URL: {BOLTZ_URL}") +logger.debug(f"Bitcoin Network: {net['name']}") + + +async def create_swap(data: CreateSubmarineSwap) -> SubmarineSwap: + if not check_boltz_limits(data.amount): + msg = f"Boltz - swap not in boltz limits" + logger.warning(msg) + raise Exception(msg) + + swap_id = urlsafe_short_hash() + try: + payment_hash, payment_request = await create_invoice( + wallet_id=data.wallet, + amount=data.amount, + memo=f"swap of {data.amount} sats on boltz.exchange", + extra={"tag": "boltz", "swap_id": swap_id}, + ) + except Exception as exc: + msg = f"Boltz - create_invoice failed {str(exc)}" + logger.error(msg) + raise + + refund_privkey = ec.PrivateKey(os.urandom(32), True, net) + refund_pubkey_hex = hexlify(refund_privkey.sec()).decode("UTF-8") + + res = req_wrap( + "post", + f"{BOLTZ_URL}/createswap", + json={ + "type": "submarine", + "pairId": "BTC/BTC", + "orderSide": "sell", + "refundPublicKey": refund_pubkey_hex, + "invoice": payment_request, + "referralId": "lnbits", + }, + headers={"Content-Type": "application/json"}, + ) + res = res.json() + logger.info( + f"Boltz - created normal swap, boltz_id: {res['id']}. wallet: {data.wallet}" + ) + return SubmarineSwap( + id=swap_id, + time=get_timestamp(), + wallet=data.wallet, + amount=data.amount, + payment_hash=payment_hash, + refund_privkey=refund_privkey.wif(net), + refund_address=data.refund_address, + boltz_id=res["id"], + status="pending", + address=res["address"], + expected_amount=res["expectedAmount"], + timeout_block_height=res["timeoutBlockHeight"], + bip21=res["bip21"], + redeem_script=res["redeemScript"], + ) + + +""" +explanation taken from electrum +send on Lightning, receive on-chain +- User generates preimage, RHASH. Sends RHASH to server. +- Server creates an LN invoice for RHASH. +- User pays LN invoice - except server needs to hold the HTLC as preimage is unknown. +- Server creates on-chain output locked to RHASH. +- User spends on-chain output, revealing preimage. +- Server fulfills HTLC using preimage. +Note: expected_onchain_amount_sat is BEFORE deducting the on-chain claim tx fee. +""" + + +async def create_reverse_swap( + data: CreateReverseSubmarineSwap, +) -> [ReverseSubmarineSwap, asyncio.Task]: + if not check_boltz_limits(data.amount): + msg = f"Boltz - reverse swap not in boltz limits" + logger.warning(msg) + raise Exception(msg) + + swap_id = urlsafe_short_hash() + + if not await check_balance(data): + logger.error(f"Boltz - reverse swap, insufficient balance.") + return False + + claim_privkey = ec.PrivateKey(os.urandom(32), True, net) + claim_pubkey_hex = hexlify(claim_privkey.sec()).decode("UTF-8") + preimage = os.urandom(32) + preimage_hash = sha256(preimage).hexdigest() + + res = req_wrap( + "post", + f"{BOLTZ_URL}/createswap", + json={ + "type": "reversesubmarine", + "pairId": "BTC/BTC", + "orderSide": "buy", + "invoiceAmount": data.amount, + "preimageHash": preimage_hash, + "claimPublicKey": claim_pubkey_hex, + "referralId": "lnbits", + }, + headers={"Content-Type": "application/json"}, + ) + res = res.json() + + logger.info( + f"Boltz - created reverse swap, boltz_id: {res['id']}. wallet: {data.wallet}" + ) + + swap = ReverseSubmarineSwap( + id=swap_id, + amount=data.amount, + wallet=data.wallet, + onchain_address=data.onchain_address, + instant_settlement=data.instant_settlement, + claim_privkey=claim_privkey.wif(net), + preimage=preimage.hex(), + status="pending", + boltz_id=res["id"], + timeout_block_height=res["timeoutBlockHeight"], + lockup_address=res["lockupAddress"], + onchain_amount=res["onchainAmount"], + redeem_script=res["redeemScript"], + invoice=res["invoice"], + time=get_timestamp(), + ) + logger.debug(f"Boltz - waiting for onchain tx, reverse swap_id: {swap.id}") + task = create_task_log_exception( + swap.id, wait_for_onchain_tx(swap, swap_websocket_callback_initial) + ) + return swap, task + + +def start_onchain_listener(swap: ReverseSubmarineSwap) -> asyncio.Task: + return create_task_log_exception( + swap.id, wait_for_onchain_tx(swap, swap_websocket_callback_restart) + ) + + +async def start_confirmation_listener( + swap: ReverseSubmarineSwap, mempool_lockup_tx +) -> asyncio.Task: + logger.debug(f"Boltz - reverse swap, waiting for confirmation...") + + tx, txid, *_ = mempool_lockup_tx + + confirmed = await wait_for_websocket_message({"track-tx": txid}, "txConfirmed") + if confirmed: + logger.debug(f"Boltz - reverse swap lockup transaction confirmed! claiming...") + await create_claim_tx(swap, mempool_lockup_tx) + else: + logger.debug(f"Boltz - reverse swap lockup transaction still not confirmed.") + + +def create_task_log_exception(swap_id: str, awaitable: Awaitable) -> asyncio.Task: + async def _log_exception(awaitable): + try: + return await awaitable + except Exception as e: + logger.error(f"Boltz - reverse swap failed!: {swap_id} - {e}") + await update_swap_status(swap_id, "failed") + + return asyncio.create_task(_log_exception(awaitable)) + + +async def swap_websocket_callback_initial(swap): + wstask = asyncio.create_task( + wait_for_websocket_message( + {"track-address": swap.lockup_address}, "address-transactions" + ) + ) + logger.debug( + f"Boltz - created task, waiting on mempool websocket for address: {swap.lockup_address}" + ) + + # create_task is used because pay_invoice is stuck as long as boltz does not + # see the onchain claim tx and it ends up in deadlock + task: asyncio.Task = create_task_log_exception( + swap.id, + pay_invoice( + wallet_id=swap.wallet, + payment_request=swap.invoice, + description=f"reverse swap for {swap.amount} sats on boltz.exchange", + extra={"tag": "boltz", "swap_id": swap.id, "reverse": True}, + ), + ) + logger.debug(f"Boltz - task pay_invoice created, reverse swap_id: {swap.id}") + + done, pending = await asyncio.wait( + [task, wstask], return_when=asyncio.FIRST_COMPLETED + ) + message = done.pop().result() + + # pay_invoice already failed, do not wait for onchain tx anymore + if message is None: + logger.debug(f"Boltz - pay_invoice already failed cancel websocket task.") + wstask.cancel() + raise + + return task, message + + +async def swap_websocket_callback_restart(swap): + logger.debug(f"Boltz - swap_websocket_callback_restart called...") + message = await wait_for_websocket_message( + {"track-address": swap.lockup_address}, "address-transactions" + ) + return None, message + + +async def wait_for_onchain_tx(swap: ReverseSubmarineSwap, callback): + task, txs = await callback(swap) + mempool_lockup_tx = get_mempool_tx_from_txs(txs, swap.lockup_address) + if mempool_lockup_tx: + tx, txid, *_ = mempool_lockup_tx + if swap.instant_settlement or tx["status"]["confirmed"]: + logger.debug( + f"Boltz - reverse swap instant settlement, claiming immediatly..." + ) + await create_claim_tx(swap, mempool_lockup_tx) + else: + await start_confirmation_listener(swap, mempool_lockup_tx) + try: + if task: + await task + except: + logger.error( + f"Boltz - could not await pay_invoice task, but sent onchain. should never happen!" + ) + else: + logger.error(f"Boltz - mempool lockup tx not found.") + + +async def create_claim_tx(swap: ReverseSubmarineSwap, mempool_lockup_tx): + tx = await create_onchain_tx(swap, mempool_lockup_tx) + await send_onchain_tx(tx) + logger.debug(f"Boltz - onchain tx sent, reverse swap completed") + await update_swap_status(swap.id, "complete") + + +async def create_refund_tx(swap: SubmarineSwap): + mempool_lockup_tx = get_mempool_tx(swap.address) + tx = await create_onchain_tx(swap, mempool_lockup_tx) + await send_onchain_tx(tx) + + +def check_block_height(block_height: int): + current_block_height = get_mempool_blockheight() + if current_block_height <= block_height: + msg = f"refund not possible, timeout_block_height ({block_height}) is not yet exceeded ({current_block_height})" + logger.debug(msg) + raise Exception(msg) + + +""" +a submarine swap consists of 2 onchain tx's a lockup and a redeem tx. +we create a tx to redeem the funds locked by the onchain lockup tx. +claim tx for reverse swaps, refund tx for normal swaps they are the same +onchain redeem tx, the difference between them is the private key, onchain_address, +input sequence and input script_sig +""" + + +async def create_onchain_tx( + swap: Union[ReverseSubmarineSwap, SubmarineSwap], mempool_lockup_tx +) -> Transaction: + is_refund_tx = type(swap) == SubmarineSwap + if is_refund_tx: + check_block_height(swap.timeout_block_height) + privkey = ec.PrivateKey.from_wif(swap.refund_privkey) + onchain_address = swap.refund_address + preimage = b"" + sequence = 0xFFFFFFFE + else: + privkey = ec.PrivateKey.from_wif(swap.claim_privkey) + preimage = unhexlify(swap.preimage) + onchain_address = swap.onchain_address + sequence = 0xFFFFFFFF + + locktime = swap.timeout_block_height + redeem_script = unhexlify(swap.redeem_script) + + fees = get_fee_estimation() + + tx, txid, vout_cnt, vout_amount = mempool_lockup_tx + + script_pubkey = script.address_to_scriptpubkey(onchain_address) + + vin = [TransactionInput(unhexlify(txid), vout_cnt, sequence=sequence)] + vout = [TransactionOutput(vout_amount - fees, script_pubkey)] + tx = Transaction(vin=vin, vout=vout) + + if is_refund_tx: + tx.locktime = locktime + + # TODO: 2 rounds for fee calculation, look at vbytes after signing and do another TX + s = script.Script(data=redeem_script) + for i, inp in enumerate(vin): + if is_refund_tx: + rs = bytes([34]) + bytes([0]) + bytes([32]) + sha256(redeem_script).digest() + tx.vin[i].script_sig = script.Script(data=rs) + h = tx.sighash_segwit(i, s, vout_amount) + sig = privkey.sign(h).serialize() + bytes([SIGHASH.ALL]) + witness_items = [sig, preimage, redeem_script] + tx.vin[i].witness = script.Witness(items=witness_items) + + return tx + + +def get_swap_status(swap: Union[SubmarineSwap, ReverseSubmarineSwap]) -> SwapStatus: + swap_status = SwapStatus( + wallet=swap.wallet, + swap_id=swap.id, + ) + + try: + boltz_request = get_boltz_status(swap.boltz_id) + swap_status.boltz = boltz_request["status"] + except httpx.HTTPStatusError as exc: + json = exc.response.json() + swap_status.boltz = json["error"] + if "could not find" in swap_status.boltz: + swap_status.exists = False + + if type(swap) == SubmarineSwap: + swap_status.reverse = False + swap_status.address = swap.address + else: + swap_status.reverse = True + swap_status.address = swap.lockup_address + + swap_status.block_height = get_mempool_blockheight() + swap_status.timeout_block_height = ( + f"{str(swap.timeout_block_height)} -> current: {str(swap_status.block_height)}" + ) + + if swap_status.block_height >= swap.timeout_block_height: + swap_status.hit_timeout = True + + mempool_tx = get_mempool_tx(swap_status.address) + swap_status.lockup = mempool_tx + if mempool_tx == None: + swap_status.has_lockup = False + swap_status.confirmed = False + swap_status.mempool = "transaction.unknown" + swap_status.message = "lockup tx not in mempool" + else: + swap_status.has_lockup = True + tx, *_ = mempool_tx + if tx["status"]["confirmed"] == True: + swap_status.mempool = "transaction.confirmed" + swap_status.confirmed = True + else: + swap_status.confirmed = False + swap_status.mempool = "transaction.unconfirmed" + + return swap_status + + +def check_boltz_limits(amount): + try: + pairs = get_boltz_pairs() + limits = pairs["pairs"]["BTC/BTC"]["limits"] + return amount >= limits["minimal"] and amount <= limits["maximal"] + except: + return False + + +def get_boltz_pairs(): + res = req_wrap( + "get", + f"{BOLTZ_URL}/getpairs", + headers={"Content-Type": "application/json"}, + ) + return res.json() + + +def get_boltz_status(boltzid): + res = req_wrap( + "post", + f"{BOLTZ_URL}/swapstatus", + json={"id": boltzid}, + ) + return res.json() diff --git a/lnbits/extensions/boltz/config.json b/lnbits/extensions/boltz/config.json new file mode 100644 index 00000000..0f69d2a5 --- /dev/null +++ b/lnbits/extensions/boltz/config.json @@ -0,0 +1,6 @@ +{ + "name": "Boltz", + "short_description": "Perform onchain/offchain swaps", + "icon": "swap_horiz", + "contributors": ["dni"] +} diff --git a/lnbits/extensions/boltz/crud.py b/lnbits/extensions/boltz/crud.py new file mode 100644 index 00000000..1bb4286d --- /dev/null +++ b/lnbits/extensions/boltz/crud.py @@ -0,0 +1,225 @@ +from http import HTTPStatus +from typing import List, Optional, Union + +from loguru import logger +from starlette.exceptions import HTTPException + +from . import db +from .models import ( + CreateReverseSubmarineSwap, + CreateSubmarineSwap, + ReverseSubmarineSwap, + SubmarineSwap, +) + +""" +Submarine Swaps +""" + + +async def get_submarine_swaps(wallet_ids: Union[str, List[str]]) -> List[SubmarineSwap]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltz.submarineswap WHERE wallet IN ({q}) order by time DESC", + (*wallet_ids,), + ) + + return [SubmarineSwap(**row) for row in rows] + + +async def get_pending_submarine_swaps( + wallet_ids: Union[str, List[str]] +) -> List[SubmarineSwap]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltz.submarineswap WHERE wallet IN ({q}) and status='pending' order by time DESC", + (*wallet_ids,), + ) + return [SubmarineSwap(**row) for row in rows] + + +async def get_all_pending_submarine_swaps() -> List[SubmarineSwap]: + rows = await db.fetchall( + f"SELECT * FROM boltz.submarineswap WHERE status='pending' order by time DESC", + ) + return [SubmarineSwap(**row) for row in rows] + + +async def get_submarine_swap(swap_id) -> SubmarineSwap: + row = await db.fetchone( + "SELECT * FROM boltz.submarineswap WHERE id = ?", (swap_id,) + ) + return SubmarineSwap(**row) if row else None + + +async def create_submarine_swap(swap: SubmarineSwap) -> Optional[SubmarineSwap]: + + await db.execute( + """ + INSERT INTO boltz.submarineswap ( + id, + wallet, + payment_hash, + status, + boltz_id, + refund_privkey, + refund_address, + expected_amount, + timeout_block_height, + address, + bip21, + redeem_script, + amount + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + swap.id, + swap.wallet, + swap.payment_hash, + swap.status, + swap.boltz_id, + swap.refund_privkey, + swap.refund_address, + swap.expected_amount, + swap.timeout_block_height, + swap.address, + swap.bip21, + swap.redeem_script, + swap.amount, + ), + ) + return await get_submarine_swap(swap.id) + + +async def delete_submarine_swap(swap_id): + await db.execute("DELETE FROM boltz.submarineswap WHERE id = ?", (swap_id,)) + + +async def get_reverse_submarine_swaps( + wallet_ids: Union[str, List[str]] +) -> List[ReverseSubmarineSwap]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltz.reverse_submarineswap WHERE wallet IN ({q}) order by time DESC", + (*wallet_ids,), + ) + + return [ReverseSubmarineSwap(**row) for row in rows] + + +async def get_pending_reverse_submarine_swaps( + wallet_ids: Union[str, List[str]] +) -> List[ReverseSubmarineSwap]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltz.reverse_submarineswap WHERE wallet IN ({q}) and status='pending' order by time DESC", + (*wallet_ids,), + ) + + return [ReverseSubmarineSwap(**row) for row in rows] + + +async def get_all_pending_reverse_submarine_swaps() -> List[ReverseSubmarineSwap]: + rows = await db.fetchall( + f"SELECT * FROM boltz.reverse_submarineswap WHERE status='pending' order by time DESC" + ) + + return [ReverseSubmarineSwap(**row) for row in rows] + + +async def get_reverse_submarine_swap(swap_id) -> SubmarineSwap: + row = await db.fetchone( + "SELECT * FROM boltz.reverse_submarineswap WHERE id = ?", (swap_id,) + ) + return ReverseSubmarineSwap(**row) if row else None + + +async def create_reverse_submarine_swap( + swap: ReverseSubmarineSwap, +) -> Optional[ReverseSubmarineSwap]: + + await db.execute( + """ + INSERT INTO boltz.reverse_submarineswap ( + id, + wallet, + status, + boltz_id, + instant_settlement, + preimage, + claim_privkey, + lockup_address, + invoice, + onchain_amount, + onchain_address, + timeout_block_height, + redeem_script, + amount + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + swap.id, + swap.wallet, + swap.status, + swap.boltz_id, + swap.instant_settlement, + swap.preimage, + swap.claim_privkey, + swap.lockup_address, + swap.invoice, + swap.onchain_amount, + swap.onchain_address, + swap.timeout_block_height, + swap.redeem_script, + swap.amount, + ), + ) + return await get_reverse_submarine_swap(swap.id) + + +async def update_swap_status(swap_id: str, status: str): + + reverse = "" + swap = await get_submarine_swap(swap_id) + if swap is None: + swap = await get_reverse_submarine_swap(swap_id) + + if swap is None: + return None + + if type(swap) == SubmarineSwap: + await db.execute( + "UPDATE boltz.submarineswap SET status='" + + status + + "' WHERE id='" + + swap.id + + "'" + ) + if type(swap) == ReverseSubmarineSwap: + reverse = "reverse" + await db.execute( + "UPDATE boltz.reverse_submarineswap SET status='" + + status + + "' WHERE id='" + + swap.id + + "'" + ) + + message = f"Boltz - {reverse} swap status change: {status}. boltz_id: {swap.boltz_id}, wallet: {swap.wallet}" + logger.info(message) + + return swap diff --git a/lnbits/extensions/boltz/mempool.py b/lnbits/extensions/boltz/mempool.py new file mode 100644 index 00000000..ee305257 --- /dev/null +++ b/lnbits/extensions/boltz/mempool.py @@ -0,0 +1,97 @@ +import asyncio +import json +from binascii import hexlify + +import httpx +import websockets +from embit.transaction import Transaction +from loguru import logger + +from lnbits.settings import BOLTZ_MEMPOOL_SPACE_URL, BOLTZ_MEMPOOL_SPACE_URL_WS + +from .utils import req_wrap + +logger.debug(f"BOLTZ_MEMPOOL_SPACE_URL: {BOLTZ_MEMPOOL_SPACE_URL}") +logger.debug(f"BOLTZ_MEMPOOL_SPACE_URL_WS: {BOLTZ_MEMPOOL_SPACE_URL_WS}") + +websocket_url = f"{BOLTZ_MEMPOOL_SPACE_URL_WS}/api/v1/ws" + + +async def wait_for_websocket_message(send, message_string): + async for websocket in websockets.connect(websocket_url): + try: + await websocket.send(json.dumps({"action": "want", "data": ["blocks"]})) + await websocket.send(json.dumps(send)) + async for raw in websocket: + message = json.loads(raw) + if message_string in message: + return message.get(message_string) + except websockets.ConnectionClosed: + continue + + +def get_mempool_tx(address): + res = req_wrap( + "get", + f"{BOLTZ_MEMPOOL_SPACE_URL}/api/address/{address}/txs", + headers={"Content-Type": "text/plain"}, + ) + txs = res.json() + return get_mempool_tx_from_txs(txs, address) + + +def get_mempool_tx_from_txs(txs, address): + if len(txs) == 0: + return None + tx = txid = vout_cnt = vout_amount = None + for a_tx in txs: + for i, vout in enumerate(a_tx["vout"]): + if vout["scriptpubkey_address"] == address: + tx = a_tx + txid = a_tx["txid"] + vout_cnt = i + vout_amount = vout["value"] + # should never happen + if tx == None: + raise Exception("mempool tx not found") + if txid == None: + raise Exception("mempool txid not found") + return tx, txid, vout_cnt, vout_amount + + +def get_fee_estimation() -> int: + # TODO: hardcoded maximum tx size, in the future we try to get the size of the tx via embit + # we need a function like Transaction.vsize() + tx_size_vbyte = 200 + mempool_fees = get_mempool_fees() + return mempool_fees * tx_size_vbyte + + +def get_mempool_fees() -> int: + res = req_wrap( + "get", + f"{BOLTZ_MEMPOOL_SPACE_URL}/api/v1/fees/recommended", + headers={"Content-Type": "text/plain"}, + ) + fees = res.json() + return int(fees["economyFee"]) + + +def get_mempool_blockheight() -> int: + res = req_wrap( + "get", + f"{BOLTZ_MEMPOOL_SPACE_URL}/api/blocks/tip/height", + headers={"Content-Type": "text/plain"}, + ) + return int(res.text) + + +async def send_onchain_tx(tx: Transaction): + raw = hexlify(tx.serialize()) + logger.debug(f"Boltz - mempool sending onchain tx...") + req_wrap( + "post", + f"{BOLTZ_MEMPOOL_SPACE_URL}/api/tx", + headers={"Content-Type": "text/plain"}, + content=raw, + ) diff --git a/lnbits/extensions/boltz/migrations.py b/lnbits/extensions/boltz/migrations.py new file mode 100644 index 00000000..e4026dd0 --- /dev/null +++ b/lnbits/extensions/boltz/migrations.py @@ -0,0 +1,46 @@ +async def m001_initial(db): + await db.execute( + """ + CREATE TABLE boltz.submarineswap ( + id TEXT PRIMARY KEY, + wallet TEXT NOT NULL, + payment_hash TEXT NOT NULL, + amount INT NOT NULL, + status TEXT NOT NULL, + boltz_id TEXT NOT NULL, + refund_address TEXT NOT NULL, + refund_privkey TEXT NOT NULL, + expected_amount INT NOT NULL, + timeout_block_height INT NOT NULL, + address TEXT NOT NULL, + bip21 TEXT NOT NULL, + redeem_script TEXT NOT NULL, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) + await db.execute( + """ + CREATE TABLE boltz.reverse_submarineswap ( + id TEXT PRIMARY KEY, + wallet TEXT NOT NULL, + onchain_address TEXT NOT NULL, + amount INT NOT NULL, + instant_settlement BOOLEAN NOT NULL, + status TEXT NOT NULL, + boltz_id TEXT NOT NULL, + timeout_block_height INT NOT NULL, + redeem_script TEXT NOT NULL, + preimage TEXT NOT NULL, + claim_privkey TEXT NOT NULL, + lockup_address TEXT NOT NULL, + invoice TEXT NOT NULL, + onchain_amount INT NOT NULL, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) diff --git a/lnbits/extensions/boltz/models.py b/lnbits/extensions/boltz/models.py new file mode 100644 index 00000000..c8ec5646 --- /dev/null +++ b/lnbits/extensions/boltz/models.py @@ -0,0 +1,75 @@ +import json +from typing import Dict, List, Optional + +from fastapi.params import Query +from pydantic.main import BaseModel +from sqlalchemy.engine import base # type: ignore + + +class SubmarineSwap(BaseModel): + id: str + wallet: str + amount: int + payment_hash: str + time: int + status: str + refund_privkey: str + refund_address: str + boltz_id: str + expected_amount: int + timeout_block_height: int + address: str + bip21: str + redeem_script: str + + +class CreateSubmarineSwap(BaseModel): + wallet: str = Query(...) # type: ignore + refund_address: str = Query(...) # type: ignore + amount: int = Query(...) # type: ignore + + +class ReverseSubmarineSwap(BaseModel): + id: str + wallet: str + amount: int + onchain_address: str + instant_settlement: bool + time: int + status: str + boltz_id: str + preimage: str + claim_privkey: str + lockup_address: str + invoice: str + onchain_amount: int + timeout_block_height: int + redeem_script: str + + +class CreateReverseSubmarineSwap(BaseModel): + wallet: str = Query(...) # type: ignore + amount: int = Query(...) # type: ignore + instant_settlement: bool = Query(...) # type: ignore + # validate on-address, bcrt1 for regtest addresses + onchain_address: str = Query( + ..., regex="^(bcrt1|bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$" + ) # type: ignore + + +class SwapStatus(BaseModel): + swap_id: str + wallet: str + status: str = "" + message: str = "" + boltz: str = "" + mempool: str = "" + address: str = "" + block_height: int = 0 + timeout_block_height: str = "" + lockup: Optional[dict] = {} + has_lockup: bool = False + hit_timeout: bool = False + confirmed: bool = True + exists: bool = True + reverse: bool = False diff --git a/lnbits/extensions/boltz/tasks.py b/lnbits/extensions/boltz/tasks.py new file mode 100644 index 00000000..d6f72edf --- /dev/null +++ b/lnbits/extensions/boltz/tasks.py @@ -0,0 +1,153 @@ +import asyncio + +import httpx +from loguru import logger + +from lnbits.core.models import Payment +from lnbits.core.services import check_transaction_status +from lnbits.tasks import register_invoice_listener + +from .boltz import ( + create_claim_tx, + create_refund_tx, + get_swap_status, + start_confirmation_listener, + start_onchain_listener, +) +from .crud import ( + get_all_pending_reverse_submarine_swaps, + get_all_pending_submarine_swaps, + get_reverse_submarine_swap, + get_submarine_swap, + update_swap_status, +) + +""" +testcases for boltz startup +A. normal swaps + 1. test: create -> kill -> start -> startup invoice listeners -> pay onchain funds -> should complete + 2. test: create -> kill -> pay onchain funds -> start -> startup check -> should complete + 3. test: create -> kill -> mine blocks and hit timeout -> start -> should go timeout/failed + 4. test: create -> kill -> pay to less onchain funds -> mine blocks hit timeout -> start lnbits -> should be refunded + +B. reverse swaps + 1. test: create instant -> kill -> boltz does lockup -> not confirmed -> start lnbits -> should claim/complete + 2. test: create instant -> kill -> no lockup -> start lnbits -> should start onchain listener -> boltz does lockup -> should claim/complete (difficult to test) + 3. test: create -> kill -> boltz does lockup -> not confirmed -> start lnbits -> should start tx listener -> after confirmation -> should claim/complete + 4. test: create -> kill -> boltz does lockup -> confirmed -> start lnbits -> should claim/complete + 5. test: create -> kill -> boltz does lockup -> hit timeout -> boltz refunds -> start -> should timeout +""" + + +async def check_for_pending_swaps(): + try: + swaps = await get_all_pending_submarine_swaps() + reverse_swaps = await get_all_pending_reverse_submarine_swaps() + if len(swaps) > 0 or len(reverse_swaps) > 0: + logger.debug(f"Boltz - startup swap check") + except: + # database is not created yet, do nothing + return + + if len(swaps) > 0: + logger.debug(f"Boltz - {len(swaps)} pending swaps") + for swap in swaps: + try: + swap_status = get_swap_status(swap) + # should only happen while development when regtest is reset + if swap_status.exists is False: + logger.warning(f"Boltz - swap: {swap.boltz_id} does not exist.") + await update_swap_status(swap.id, "failed") + continue + + payment_status = await check_transaction_status( + swap.wallet, swap.payment_hash + ) + + if payment_status.paid: + logger.debug( + f"Boltz - swap: {swap.boltz_id} got paid while offline." + ) + await update_swap_status(swap.id, "complete") + else: + if swap_status.hit_timeout: + if not swap_status.has_lockup: + logger.warning( + f"Boltz - swap: {swap.id} hit timeout, but no lockup tx..." + ) + await update_swap_status(swap.id, "timeout") + else: + logger.debug(f"Boltz - refunding swap: {swap.id}...") + await create_refund_tx(swap) + await update_swap_status(swap.id, "refunded") + + except Exception as exc: + logger.error(f"Boltz - swap: {swap.id} - {str(exc)}") + + if len(reverse_swaps) > 0: + logger.debug(f"Boltz - {len(reverse_swaps)} pending reverse swaps") + for reverse_swap in reverse_swaps: + try: + swap_status = get_swap_status(reverse_swap) + + if swap_status.exists is False: + logger.debug( + f"Boltz - reverse_swap: {reverse_swap.boltz_id} does not exist." + ) + await update_swap_status(reverse_swap.id, "failed") + continue + + # if timeout hit, boltz would have already refunded + if swap_status.hit_timeout: + logger.debug( + f"Boltz - reverse_swap: {reverse_swap.boltz_id} timeout." + ) + await update_swap_status(reverse_swap.id, "timeout") + continue + + if not swap_status.has_lockup: + # start listener for onchain address + logger.debug( + f"Boltz - reverse_swap: {reverse_swap.boltz_id} restarted onchain address listener." + ) + await start_onchain_listener(reverse_swap) + continue + + if reverse_swap.instant_settlement or swap_status.confirmed: + await create_claim_tx(reverse_swap, swap_status.lockup) + else: + logger.debug( + f"Boltz - reverse_swap: {reverse_swap.boltz_id} restarted confirmation listener." + ) + await start_confirmation_listener(reverse_swap, swap_status.lockup) + + except Exception as exc: + logger.error(f"Boltz - reverse swap: {reverse_swap.id} - {str(exc)}") + + +async def wait_for_paid_invoices(): + invoice_queue = asyncio.Queue() + register_invoice_listener(invoice_queue) + + while True: + payment = await invoice_queue.get() + await on_invoice_paid(payment) + + +async def on_invoice_paid(payment: Payment) -> None: + if "boltz" != payment.extra.get("tag"): + # not a boltz invoice + return + + await payment.set_pending(False) + swap_id = payment.extra.get("swap_id") + swap = await get_submarine_swap(swap_id) + + if not swap: + logger.error(f"swap_id: {swap_id} not found.") + return + + logger.info( + f"Boltz - lightning invoice is paid, normal swap completed. swap_id: {swap_id}" + ) + await update_swap_status(swap_id, "complete") diff --git a/lnbits/extensions/boltz/templates/boltz/_api_docs.html b/lnbits/extensions/boltz/templates/boltz/_api_docs.html new file mode 100644 index 00000000..eea35ab6 --- /dev/null +++ b/lnbits/extensions/boltz/templates/boltz/_api_docs.html @@ -0,0 +1,236 @@ + + + + + +
+ Boltz.exchange: Do onchain to offchain and vice-versa swaps +
+

+ Submarine and Reverse Submarine Swaps on LNbits via boltz.exchange + API
+

+

+ Link : + https://boltz.exchange + +

+

+ More details +

+

+ Created by, + dni +

+
+
+
+ + + + + GET + /boltz/api/v1/swap/reverse +
+ Returns 200 OK (application/json) +
+ JSON list of reverse submarine swaps +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/reverse -H "X-Api-Key: + {{ user.wallets[0].adminkey }}" + +
+
+
+ + + + POST + /boltz/api/v1/swap/reverse +
Body (application/json)
+ {"wallet": <string>, "onchain_address": <string>, + "amount": <integer>, "instant_settlement": + <boolean>} +
+ Returns 200 OK (application/json) +
+ JSON create a reverse-submarine swaps +
Curl example
+ curl -X POST {{ root_url }}/boltz/api/v1/swap/reverse -H "X-Api-Key: + {{ user.wallets[0].adminkey }}" + +
+
+
+ + + + GET /boltz/api/v1/swap +
+ Returns 200 OK (application/json) +
+ JSON list of submarine swaps +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap -H "X-Api-Key: {{ + user.wallets[0].adminkey }}" + +
+
+
+ + + + POST /boltz/api/v1/swap +
Body (application/json)
+ {"wallet": <string>, "refund_address": <string>, + "amount": <integer>} +
+ Returns 200 OK (application/json) +
+ JSON create a submarine swaps +
Curl example
+ curl -X POST {{ root_url }}/boltz/api/v1/swap -H "X-Api-Key: {{ + user.wallets[0].adminkey }}" + +
+
+
+ + + + POST + /boltz/api/v1/swap/refund/{swap_id} +
+ Returns 200 OK (application/json) +
+ JSON submarine swap +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/refund/{swap_id} -H + "X-Api-Key: {{ user.wallets[0].adminkey }}" + +
+
+
+ + + + POST + /boltz/api/v1/swap/status/{swap_id} +
+ Returns 200 OK (text/plain) +
+ swap status +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/status/{swap_id} -H + "X-Api-Key: {{ user.wallets[0].adminkey }}" + +
+
+
+ + + + GET + /boltz/api/v1/swap/check +
+ Returns 200 OK (application/json) +
+ JSON pending swaps +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/check -H "X-Api-Key: {{ + user.wallets[0].adminkey }}" + +
+
+
+ + + + GET + /boltz/api/v1/swap/boltz +
+ Returns 200 OK (text/plain) +
+ JSON boltz config +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/boltz -H "X-Api-Key: {{ + user.wallets[0].inkey }}" + +
+
+
+ + + + GET + /boltz/api/v1/swap/mempool +
+ Returns 200 OK (text/plain) +
+ mempool url +
Curl example
+ curl -X GET {{ root_url }}/boltz/api/v1/swap/mempool -H "X-Api-Key: + {{ user.wallets[0].inkey }}" + +
+
+
+
diff --git a/lnbits/extensions/boltz/templates/boltz/index.html b/lnbits/extensions/boltz/templates/boltz/index.html new file mode 100644 index 00000000..b7312de7 --- /dev/null +++ b/lnbits/extensions/boltz/templates/boltz/index.html @@ -0,0 +1,1005 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} +
+
+ + + + + Send onchain funds offchain (BTC -> LN) + + + + + Send offchain funds to onchain address (LN -> BTC) + + + + + Check all pending swaps if they can be refunded. + + + + + + +
+
+
Swaps (In)
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+ + +
+
+
Reverse Swaps (Out)
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+
+
+ + +
{{SITE_TITLE}} Boltz extension
+
+ + + {% include "boltz/_api_docs.html" %} + +
+
+ + + + + + + + +
+ + + Cancel +
+
+
+
+ + + + + + + +
+
+ + + Create Onchain TX when transaction is in mempool, but not + confirmed yet. + + +
+
+ +
+ + + Cancel +
+
+
+
+ + + + + +
+ {% raw %} + Bitcoin On-Chain TX
+ Expected amount (sats): {{ qrCodeDialog.data.expected_amount }} +
+ Expected amount (btc): {{ qrCodeDialog.data.expected_amount_btc + }}
+ Onchain Address: {{ qrCodeDialog.data.address }}
+ {% endraw %} +
+
+ Copy On-Chain Address + Close +
+
+
+ + +
+ {% raw %} + Wallet: {{ statusDialog.data.wallet }}
+ Boltz Status: {{ statusDialog.data.boltz }}
+ Mempool Status: {{ statusDialog.data.mempool }}
+ Blockheight timeout: {{ statusDialog.data.timeout_block_height + }}
+ {% endraw %} +
+
+ Refund + + Download refundfile + Close +
+
+
+ + +
pending swaps
+ + {% raw %} + + + {% endraw %} + +
pending reverse swaps
+ + {% raw %} + + + {% endraw %} + +
+ Close +
+
+
+
+{% endblock %} {% block scripts %} {{ window_vars(user) }} + +{% endblock %} diff --git a/lnbits/extensions/boltz/utils.py b/lnbits/extensions/boltz/utils.py new file mode 100644 index 00000000..4fb2edda --- /dev/null +++ b/lnbits/extensions/boltz/utils.py @@ -0,0 +1,44 @@ +import calendar +import datetime + +import httpx +from loguru import logger + +from lnbits.core.services import fee_reserve, get_wallet + + +async def check_balance(data) -> bool: + # check if we can pay the invoice before we create the actual swap on boltz + amount_msat = data.amount * 1000 + fee_reserve_msat = fee_reserve(amount_msat) + wallet = await get_wallet(data.wallet) + assert wallet + if wallet.balance_msat - fee_reserve_msat < amount_msat: + return False + return True + + +def get_timestamp(): + date = datetime.datetime.utcnow() + return calendar.timegm(date.utctimetuple()) + + +def req_wrap(funcname, *args, **kwargs): + try: + try: + func = getattr(httpx, funcname) + except AttributeError: + logger.error('httpx function not found "%s"' % funcname) + else: + res = func(*args, timeout=30, **kwargs) + res.raise_for_status() + return res + except httpx.RequestError as exc: + msg = f"Unreachable: {exc.request.url!r}." + logger.error(msg) + raise + except httpx.HTTPStatusError as exc: + msg = f"HTTP Status Error: {exc.response.status_code} while requesting {exc.request.url!r}." + logger.error(msg) + logger.error(exc.response.json()["error"]) + raise diff --git a/lnbits/extensions/boltz/views.py b/lnbits/extensions/boltz/views.py new file mode 100644 index 00000000..b6864113 --- /dev/null +++ b/lnbits/extensions/boltz/views.py @@ -0,0 +1,23 @@ +from urllib.parse import urlparse + +from fastapi import Request +from fastapi.params import Depends +from fastapi.templating import Jinja2Templates +from starlette.responses import HTMLResponse + +from lnbits.core.models import Payment, User +from lnbits.decorators import check_user_exists + +from . import boltz_ext, boltz_renderer + +templates = Jinja2Templates(directory="templates") + + +@boltz_ext.get("/", response_class=HTMLResponse) +async def index(request: Request, user: User = Depends(check_user_exists)): + root_url = urlparse(str(request.url)).netloc + wallet_ids = [wallet.id for wallet in user.wallets] + return boltz_renderer().TemplateResponse( + "boltz/index.html", + {"request": request, "user": user.dict(), "root_url": root_url}, + ) diff --git a/lnbits/extensions/boltz/views_api.py b/lnbits/extensions/boltz/views_api.py new file mode 100644 index 00000000..a4b7d318 --- /dev/null +++ b/lnbits/extensions/boltz/views_api.py @@ -0,0 +1,338 @@ +from datetime import datetime +from http import HTTPStatus +from typing import List + +import httpx +from fastapi import status +from fastapi.encoders import jsonable_encoder +from fastapi.param_functions import Body +from fastapi.params import Depends, Query +from loguru import logger +from pydantic import BaseModel +from starlette.exceptions import HTTPException +from starlette.requests import Request + +from lnbits.core.crud import get_user +from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key +from lnbits.settings import BOLTZ_MEMPOOL_SPACE_URL + +from . import boltz_ext +from .boltz import ( + create_refund_tx, + create_reverse_swap, + create_swap, + get_boltz_pairs, + get_swap_status, +) +from .crud import ( + create_reverse_submarine_swap, + create_submarine_swap, + get_pending_reverse_submarine_swaps, + get_pending_submarine_swaps, + get_reverse_submarine_swap, + get_reverse_submarine_swaps, + get_submarine_swap, + get_submarine_swaps, + update_swap_status, +) +from .models import ( + CreateReverseSubmarineSwap, + CreateSubmarineSwap, + ReverseSubmarineSwap, + SubmarineSwap, +) +from .utils import check_balance + + +@boltz_ext.get( + "/api/v1/swap/mempool", + name=f"boltz.get /swap/mempool", + summary="get a the mempool url", + description=""" + This endpoint gets the URL from mempool.space + """, + response_description="mempool.space url", + response_model=str, +) +async def api_mempool_url(): + return BOLTZ_MEMPOOL_SPACE_URL + + +# NORMAL SWAP +@boltz_ext.get( + "/api/v1/swap", + name=f"boltz.get /swap", + summary="get a list of swaps a swap", + description=""" + This endpoint gets a list of normal swaps. + """, + response_description="list of normal swaps", + dependencies=[Depends(get_key_type)], + response_model=List[SubmarineSwap], +) +async def api_submarineswap( + g: WalletTypeInfo = Depends(get_key_type), + all_wallets: bool = Query(False), +): + wallet_ids = [g.wallet.id] + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + for swap in await get_pending_submarine_swaps(wallet_ids): + swap_status = get_swap_status(swap) + if swap_status.hit_timeout: + if not swap_status.has_lockup: + logger.warning( + f"Boltz - swap: {swap.id} hit timeout, but no lockup tx..." + ) + await update_swap_status(swap.id, "timeout") + + return [swap.dict() for swap in await get_submarine_swaps(wallet_ids)] + + +@boltz_ext.post( + "/api/v1/swap/refund", + name=f"boltz.swap_refund", + summary="refund of a swap", + description=""" + This endpoint attempts to refund a normal swaps, creates onchain tx and sets swap status ro refunded. + """, + response_description="refunded swap with status set to refunded", + dependencies=[Depends(require_admin_key)], + response_model=SubmarineSwap, + responses={ + 400: {"description": "when swap_id is missing"}, + 404: {"description": "when swap is not found"}, + 405: {"description": "when swap is not pending"}, + 500: { + "description": "when something goes wrong creating the refund onchain tx" + }, + }, +) +async def api_submarineswap_refund( + swap_id: str, + g: WalletTypeInfo = Depends(require_admin_key), # type: ignore +): + if swap_id == None: + raise HTTPException( + status_code=HTTPStatus.BAD_REQUEST, detail="swap_id missing" + ) + + swap = await get_submarine_swap(swap_id) + if swap == None: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="swap does not exist." + ) + + if swap.status != "pending": + raise HTTPException( + status_code=HTTPStatus.METHOD_NOT_ALLOWED, detail="swap is not pending." + ) + + try: + await create_refund_tx(swap) + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except Exception as exc: + raise HTTPException(status_code=HTTPStatus.METHOD_NOT_ALLOWED, detail=str(exc)) + + await update_swap_status(swap.id, "refunded") + return swap + + +@boltz_ext.post( + "/api/v1/swap", + status_code=status.HTTP_201_CREATED, + name=f"boltz.post /swap", + summary="create a submarine swap", + description=""" + This endpoint creates a submarine swap + """, + response_description="create swap", + response_model=SubmarineSwap, + responses={ + 405: {"description": "not allowed method, insufficient balance"}, + 500: {"description": "boltz error"}, + }, +) +async def api_submarineswap_create( + data: CreateSubmarineSwap, + wallet: WalletTypeInfo = Depends(require_admin_key), # type: ignore +): + try: + swap_data = await create_swap(data) + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except Exception as exc: + raise HTTPException(status_code=HTTPStatus.METHOD_NOT_ALLOWED, detail=str(exc)) + except httpx.HTTPStatusError as exc: + raise HTTPException( + status_code=exc.response.status_code, detail=exc.response.json()["error"] + ) + swap = await create_submarine_swap(swap_data) + return swap.dict() + + +# REVERSE SWAP +@boltz_ext.get( + "/api/v1/swap/reverse", + name=f"boltz.get /swap/reverse", + summary="get a list of reverse swaps a swap", + description=""" + This endpoint gets a list of reverse swaps. + """, + response_description="list of reverse swaps", + dependencies=[Depends(get_key_type)], + response_model=List[ReverseSubmarineSwap], +) +async def api_reverse_submarineswap( + g: WalletTypeInfo = Depends(get_key_type), # type:ignore + all_wallets: bool = Query(False), +): + wallet_ids = [g.wallet.id] + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + return [swap.dict() for swap in await get_reverse_submarine_swaps(wallet_ids)] + + +@boltz_ext.post( + "/api/v1/swap/reverse", + status_code=status.HTTP_201_CREATED, + name=f"boltz.post /swap/reverse", + summary="create a reverse submarine swap", + description=""" + This endpoint creates a reverse submarine swap + """, + response_description="create reverse swap", + response_model=ReverseSubmarineSwap, + responses={ + 405: {"description": "not allowed method, insufficient balance"}, + 500: {"description": "boltz error"}, + }, +) +async def api_reverse_submarineswap_create( + data: CreateReverseSubmarineSwap, + wallet: WalletTypeInfo = Depends(require_admin_key), +): + + if not await check_balance(data): + raise HTTPException( + status_code=HTTPStatus.METHOD_NOT_ALLOWED, detail="Insufficient balance." + ) + + try: + swap_data, task = await create_reverse_swap(data) + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except httpx.HTTPStatusError as exc: + raise HTTPException( + status_code=exc.response.status_code, detail=exc.response.json()["error"] + ) + except Exception as exc: + raise HTTPException(status_code=HTTPStatus.METHOD_NOT_ALLOWED, detail=str(exc)) + + swap = await create_reverse_submarine_swap(swap_data) + return swap.dict() + + +@boltz_ext.post( + "/api/v1/swap/status", + name=f"boltz.swap_status", + summary="shows the status of a swap", + description=""" + This endpoint attempts to get the status of the swap. + """, + response_description="status of swap json", + responses={ + 404: {"description": "when swap_id is not found"}, + }, +) +async def api_swap_status( + swap_id: str, wallet: WalletTypeInfo = Depends(require_admin_key) # type: ignore +): + swap = await get_submarine_swap(swap_id) or await get_reverse_submarine_swap( + swap_id + ) + if swap == None: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="swap does not exist." + ) + try: + status = get_swap_status(swap) + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except Exception as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(exc) + ) + return status + + +@boltz_ext.post( + "/api/v1/swap/check", + name=f"boltz.swap_check", + summary="list all pending swaps", + description=""" + This endpoint gives you 2 lists of pending swaps and reverse swaps. + """, + response_description="list of pending swaps", +) +async def api_check_swaps( + g: WalletTypeInfo = Depends(require_admin_key), # type: ignore + all_wallets: bool = Query(False), +): + wallet_ids = [g.wallet.id] + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + status = [] + try: + for swap in await get_pending_submarine_swaps(wallet_ids): + status.append(get_swap_status(swap)) + for reverseswap in await get_pending_reverse_submarine_swaps(wallet_ids): + status.append(get_swap_status(reverseswap)) + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except Exception as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(exc) + ) + return status + + +@boltz_ext.get( + "/api/v1/swap/boltz", + name=f"boltz.get /swap/boltz", + summary="get a boltz configuration", + description=""" + This endpoint gets configuration for boltz. (limits, fees...) + """, + response_description="dict of boltz config", + response_model=dict, +) +async def api_boltz_config(): + try: + res = get_boltz_pairs() + except httpx.RequestError as exc: + raise HTTPException( + status_code=HTTPStatus.INTERNAL_SERVER_ERROR, + detail=f"Unreachable: {exc.request.url!r}.", + ) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e)) + + return res["pairs"]["BTC/BTC"] diff --git a/lnbits/extensions/copilot/lnurl.py b/lnbits/extensions/copilot/lnurl.py index 69777c9f..fa199691 100644 --- a/lnbits/extensions/copilot/lnurl.py +++ b/lnbits/extensions/copilot/lnurl.py @@ -73,11 +73,9 @@ async def lnurl_callback( wallet_id=cp.wallet, amount=int(amount_received / 1000), memo=cp.lnurl_title, - description_hash=hashlib.sha256( - ( - LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]])) - ).encode("utf-8") - ).digest(), + unhashed_description=( + LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]])) + ).encode("utf-8"), extra={"tag": "copilot", "copilotid": cp.id, "comment": comment}, ) payResponse = {"pr": payment_request, "routes": []} diff --git a/lnbits/extensions/copilot/views.py b/lnbits/extensions/copilot/views.py index ff0a5a93..7ee7f590 100644 --- a/lnbits/extensions/copilot/views.py +++ b/lnbits/extensions/copilot/views.py @@ -63,7 +63,7 @@ class ConnectionManager: manager = ConnectionManager() -@copilot_ext.websocket("/copilot/ws/{copilot_id}", name="copilot.websocket_by_id") +@copilot_ext.websocket("/ws/{copilot_id}", name="copilot.websocket_by_id") async def websocket_endpoint(websocket: WebSocket, copilot_id: str): await manager.connect(websocket, copilot_id) try: diff --git a/lnbits/extensions/events/crud.py b/lnbits/extensions/events/crud.py index 4cc86ac4..12cc7327 100644 --- a/lnbits/extensions/events/crud.py +++ b/lnbits/extensions/events/crud.py @@ -19,42 +19,25 @@ async def create_ticket( (payment_hash, wallet, event, name, email, False, True), ) + # UPDATE EVENT DATA ON SOLD TICKET + eventdata = await get_event(event) + assert eventdata, "Couldn't get event from ticket being paid" + sold = eventdata.sold + 1 + amount_tickets = eventdata.amount_tickets - 1 + await db.execute( + """ + UPDATE events.events + SET sold = ?, amount_tickets = ? + WHERE id = ? + """, + (sold, amount_tickets, event), + ) + ticket = await get_ticket(payment_hash) assert ticket, "Newly created ticket couldn't be retrieved" return ticket -async def set_ticket_paid(payment_hash: str) -> Tickets: - row = await db.fetchone("SELECT * FROM events.ticket WHERE id = ?", (payment_hash,)) - if row[6] != True: - await db.execute( - """ - UPDATE events.ticket - SET paid = true - WHERE id = ? - """, - (payment_hash,), - ) - - eventdata = await get_event(row[2]) - assert eventdata, "Couldn't get event from ticket being paid" - - sold = eventdata.sold + 1 - amount_tickets = eventdata.amount_tickets - 1 - await db.execute( - """ - UPDATE events.events - SET sold = ?, amount_tickets = ? - WHERE id = ? - """, - (sold, amount_tickets, row[2]), - ) - - ticket = await get_ticket(payment_hash) - assert ticket, "Newly updated ticket couldn't be retrieved" - return ticket - - async def get_ticket(payment_hash: str) -> Optional[Tickets]: row = await db.fetchone("SELECT * FROM events.ticket WHERE id = ?", (payment_hash,)) return Tickets(**row) if row else None diff --git a/lnbits/extensions/events/views_api.py b/lnbits/extensions/events/views_api.py index 56e6b06c..9cb18f04 100644 --- a/lnbits/extensions/events/views_api.py +++ b/lnbits/extensions/events/views_api.py @@ -24,7 +24,6 @@ from .crud import ( get_ticket, get_tickets, reg_ticket, - set_ticket_paid, update_event, ) diff --git a/lnbits/extensions/invoices/README.md b/lnbits/extensions/invoices/README.md new file mode 100644 index 00000000..2b5bd538 --- /dev/null +++ b/lnbits/extensions/invoices/README.md @@ -0,0 +1,19 @@ +# Invoices + +## Create invoices that you can send to your client to pay online over Lightning. + +This extension allows users to create "traditional" invoices (not in the lightning sense) that contain one or more line items. Line items are denominated in a user-configurable fiat currency. Each invoice contains one or more payments up to the total of the invoice. Each invoice creates a public link that can be shared with a customer that they can use to (partially or in full) pay the invoice. + +## Usage + +1. Create an invoice by clicking "NEW INVOICE"\ + ![create new invoice](https://imgur.com/a/Dce3wrr.png) +2. Fill the options for your INVOICE + - select the wallet + - select the fiat currency the invoice will be denominated in + - select a status for the invoice (default is draft) + - enter a company name, first name, last name, email, phone & address (optional) + - add one or more line items + - enter a name & price for each line item +3. You can then use share your invoice link with your customer to receive payment\ + ![invoice link](https://imgur.com/a/L0JOj4T.png) \ No newline at end of file diff --git a/lnbits/extensions/invoices/__init__.py b/lnbits/extensions/invoices/__init__.py new file mode 100644 index 00000000..0b60837b --- /dev/null +++ b/lnbits/extensions/invoices/__init__.py @@ -0,0 +1,36 @@ +import asyncio + +from fastapi import APIRouter +from starlette.staticfiles import StaticFiles + +from lnbits.db import Database +from lnbits.helpers import template_renderer +from lnbits.tasks import catch_everything_and_restart + +db = Database("ext_invoices") + +invoices_static_files = [ + { + "path": "/invoices/static", + "app": StaticFiles(directory="lnbits/extensions/invoices/static"), + "name": "invoices_static", + } +] + +invoices_ext: APIRouter = APIRouter(prefix="/invoices", tags=["invoices"]) + + +def invoices_renderer(): + return template_renderer(["lnbits/extensions/invoices/templates"]) + + +from .tasks import wait_for_paid_invoices + + +def invoices_start(): + loop = asyncio.get_event_loop() + loop.create_task(catch_everything_and_restart(wait_for_paid_invoices)) + + +from .views import * # noqa +from .views_api import * # noqa diff --git a/lnbits/extensions/invoices/config.json b/lnbits/extensions/invoices/config.json new file mode 100644 index 00000000..0811e0ef --- /dev/null +++ b/lnbits/extensions/invoices/config.json @@ -0,0 +1,6 @@ +{ + "name": "Invoices", + "short_description": "Create invoices for your clients.", + "icon": "request_quote", + "contributors": ["leesalminen"] +} diff --git a/lnbits/extensions/invoices/crud.py b/lnbits/extensions/invoices/crud.py new file mode 100644 index 00000000..4fd055e9 --- /dev/null +++ b/lnbits/extensions/invoices/crud.py @@ -0,0 +1,206 @@ +from typing import List, Optional, Union + +from lnbits.helpers import urlsafe_short_hash + +from . import db +from .models import ( + CreateInvoiceData, + CreateInvoiceItemData, + CreatePaymentData, + Invoice, + InvoiceItem, + Payment, + UpdateInvoiceData, + UpdateInvoiceItemData, +) + + +async def get_invoice(invoice_id: str) -> Optional[Invoice]: + row = await db.fetchone( + "SELECT * FROM invoices.invoices WHERE id = ?", (invoice_id,) + ) + return Invoice.from_row(row) if row else None + + +async def get_invoice_items(invoice_id: str) -> List[InvoiceItem]: + rows = await db.fetchall( + f"SELECT * FROM invoices.invoice_items WHERE invoice_id = ?", (invoice_id,) + ) + + return [InvoiceItem.from_row(row) for row in rows] + + +async def get_invoice_item(item_id: str) -> InvoiceItem: + row = await db.fetchone( + "SELECT * FROM invoices.invoice_items WHERE id = ?", (item_id,) + ) + return InvoiceItem.from_row(row) if row else None + + +async def get_invoice_total(items: List[InvoiceItem]) -> int: + return sum(item.amount for item in items) + + +async def get_invoices(wallet_ids: Union[str, List[str]]) -> List[Invoice]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM invoices.invoices WHERE wallet IN ({q})", (*wallet_ids,) + ) + + return [Invoice.from_row(row) for row in rows] + + +async def get_invoice_payments(invoice_id: str) -> List[Payment]: + rows = await db.fetchall( + f"SELECT * FROM invoices.payments WHERE invoice_id = ?", (invoice_id,) + ) + + return [Payment.from_row(row) for row in rows] + + +async def get_invoice_payment(payment_id: str) -> Payment: + row = await db.fetchone( + "SELECT * FROM invoices.payments WHERE id = ?", (payment_id,) + ) + return Payment.from_row(row) if row else None + + +async def get_payments_total(payments: List[Payment]) -> int: + return sum(item.amount for item in payments) + + +async def create_invoice_internal(wallet_id: str, data: CreateInvoiceData) -> Invoice: + invoice_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.invoices (id, wallet, status, currency, company_name, first_name, last_name, email, phone, address) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + invoice_id, + wallet_id, + data.status, + data.currency, + data.company_name, + data.first_name, + data.last_name, + data.email, + data.phone, + data.address, + ), + ) + + invoice = await get_invoice(invoice_id) + assert invoice, "Newly created invoice couldn't be retrieved" + return invoice + + +async def create_invoice_items( + invoice_id: str, data: List[CreateInvoiceItemData] +) -> List[InvoiceItem]: + for item in data: + item_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.invoice_items (id, invoice_id, description, amount) + VALUES (?, ?, ?, ?) + """, + ( + item_id, + invoice_id, + item.description, + int(item.amount * 100), + ), + ) + + invoice_items = await get_invoice_items(invoice_id) + return invoice_items + + +async def update_invoice_internal(wallet_id: str, data: UpdateInvoiceData) -> Invoice: + await db.execute( + """ + UPDATE invoices.invoices + SET wallet = ?, currency = ?, status = ?, company_name = ?, first_name = ?, last_name = ?, email = ?, phone = ?, address = ? + WHERE id = ? + """, + ( + wallet_id, + data.currency, + data.status, + data.company_name, + data.first_name, + data.last_name, + data.email, + data.phone, + data.address, + data.id, + ), + ) + + invoice = await get_invoice(data.id) + assert invoice, "Newly updated invoice couldn't be retrieved" + return invoice + + +async def update_invoice_items( + invoice_id: str, data: List[UpdateInvoiceItemData] +) -> List[InvoiceItem]: + updated_items = [] + for item in data: + if item.id: + updated_items.append(item.id) + await db.execute( + """ + UPDATE invoices.invoice_items + SET description = ?, amount = ? + WHERE id = ? + """, + (item.description, int(item.amount * 100), item.id), + ) + + placeholders = ",".join("?" for i in range(len(updated_items))) + if not placeholders: + placeholders = "?" + updated_items = ("skip",) + + await db.execute( + f""" + DELETE FROM invoices.invoice_items + WHERE invoice_id = ? + AND id NOT IN ({placeholders}) + """, + ( + invoice_id, + *tuple(updated_items), + ), + ) + + for item in data: + if not item.id: + await create_invoice_items(invoice_id=invoice_id, data=[item]) + + invoice_items = await get_invoice_items(invoice_id) + return invoice_items + + +async def create_invoice_payment(invoice_id: str, amount: int) -> Payment: + payment_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.payments (id, invoice_id, amount) + VALUES (?, ?, ?) + """, + ( + payment_id, + invoice_id, + amount, + ), + ) + + payment = await get_invoice_payment(payment_id) + assert payment, "Newly created payment couldn't be retrieved" + return payment diff --git a/lnbits/extensions/invoices/migrations.py b/lnbits/extensions/invoices/migrations.py new file mode 100644 index 00000000..c47a954a --- /dev/null +++ b/lnbits/extensions/invoices/migrations.py @@ -0,0 +1,55 @@ +async def m001_initial_invoices(db): + + # STATUS COLUMN OPTIONS: 'draft', 'open', 'paid', 'canceled' + + await db.execute( + f""" + CREATE TABLE invoices.invoices ( + id TEXT PRIMARY KEY, + wallet TEXT NOT NULL, + + status TEXT NOT NULL DEFAULT 'draft', + + currency TEXT NOT NULL, + + company_name TEXT DEFAULT NULL, + first_name TEXT DEFAULT NULL, + last_name TEXT DEFAULT NULL, + email TEXT DEFAULT NULL, + phone TEXT DEFAULT NULL, + address TEXT DEFAULT NULL, + + + time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now} + ); + """ + ) + + await db.execute( + f""" + CREATE TABLE invoices.invoice_items ( + id TEXT PRIMARY KEY, + invoice_id TEXT NOT NULL, + + description TEXT NOT NULL, + amount INTEGER NOT NULL, + + FOREIGN KEY(invoice_id) REFERENCES {db.references_schema}invoices(id) + ); + """ + ) + + await db.execute( + f""" + CREATE TABLE invoices.payments ( + id TEXT PRIMARY KEY, + invoice_id TEXT NOT NULL, + + amount INT NOT NULL, + + time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}, + + FOREIGN KEY(invoice_id) REFERENCES {db.references_schema}invoices(id) + ); + """ + ) diff --git a/lnbits/extensions/invoices/models.py b/lnbits/extensions/invoices/models.py new file mode 100644 index 00000000..adf03e46 --- /dev/null +++ b/lnbits/extensions/invoices/models.py @@ -0,0 +1,104 @@ +from enum import Enum +from sqlite3 import Row +from typing import List, Optional + +from fastapi.param_functions import Query +from pydantic import BaseModel + + +class InvoiceStatusEnum(str, Enum): + draft = "draft" + open = "open" + paid = "paid" + canceled = "canceled" + + +class CreateInvoiceItemData(BaseModel): + description: str + amount: float = Query(..., ge=0.01) + + +class CreateInvoiceData(BaseModel): + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + items: List[CreateInvoiceItemData] + + class Config: + use_enum_values = True + + +class UpdateInvoiceItemData(BaseModel): + id: Optional[str] + description: str + amount: float = Query(..., ge=0.01) + + +class UpdateInvoiceData(BaseModel): + id: str + wallet: str + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + items: List[UpdateInvoiceItemData] + + +class Invoice(BaseModel): + id: str + wallet: str + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + time: int + + class Config: + use_enum_values = True + + @classmethod + def from_row(cls, row: Row) -> "Invoice": + return cls(**dict(row)) + + +class InvoiceItem(BaseModel): + id: str + invoice_id: str + description: str + amount: int + + class Config: + orm_mode = True + + @classmethod + def from_row(cls, row: Row) -> "InvoiceItem": + return cls(**dict(row)) + + +class Payment(BaseModel): + id: str + invoice_id: str + amount: int + time: int + + @classmethod + def from_row(cls, row: Row) -> "Payment": + return cls(**dict(row)) + + +class CreatePaymentData(BaseModel): + invoice_id: str + amount: int diff --git a/lnbits/extensions/invoices/static/css/pay.css b/lnbits/extensions/invoices/static/css/pay.css new file mode 100644 index 00000000..ad7ce914 --- /dev/null +++ b/lnbits/extensions/invoices/static/css/pay.css @@ -0,0 +1,65 @@ +#invoicePage>.row:first-child>.col-md-6 { + display: flex; +} + +#invoicePage>.row:first-child>.col-md-6>.q-card { + flex: 1; +} + +#invoicePage .clear { + margin-bottom: 25px; +} + +#printQrCode { + display: none; +} + +@media (min-width: 1024px) { + #invoicePage>.row:first-child>.col-md-6:first-child>div { + margin-right: 5px; + } + + #invoicePage>.row:first-child>.col-md-6:nth-child(2)>div { + margin-left: 5px; + } +} + + +@media print { + * { + color: black !important; + } + + header, button, #payButtonContainer { + display: none !important; + } + + main, .q-page-container { + padding-top: 0px !important; + } + + .q-card { + box-shadow: none !important; + border: 1px solid black; + } + + .q-item { + padding: 5px; + } + + .q-card__section { + padding: 5px; + } + + #printQrCode { + display: block; + } + + p { + margin-bottom: 0px !important; + } + + #invoicePage .clear { + margin-bottom: 10px !important; + } +} \ No newline at end of file diff --git a/lnbits/extensions/invoices/tasks.py b/lnbits/extensions/invoices/tasks.py new file mode 100644 index 00000000..61bcb7b4 --- /dev/null +++ b/lnbits/extensions/invoices/tasks.py @@ -0,0 +1,51 @@ +import asyncio +import json + +from lnbits.core.models import Payment +from lnbits.helpers import urlsafe_short_hash +from lnbits.tasks import internal_invoice_queue, register_invoice_listener + +from .crud import ( + create_invoice_payment, + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_payments_total, + update_invoice_internal, +) + + +async def wait_for_paid_invoices(): + invoice_queue = asyncio.Queue() + register_invoice_listener(invoice_queue) + + while True: + payment = await invoice_queue.get() + await on_invoice_paid(payment) + + +async def on_invoice_paid(payment: Payment) -> None: + if payment.extra.get("tag") != "invoices": + # not relevant + return + + invoice_id = payment.extra.get("invoice_id") + + payment = await create_invoice_payment( + invoice_id=invoice_id, amount=payment.extra.get("famount") + ) + + invoice = await get_invoice(invoice_id) + + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + if payments_total >= invoice_total: + invoice.status = "paid" + await update_invoice_internal(invoice.wallet, invoice) + + return diff --git a/lnbits/extensions/invoices/templates/invoices/_api_docs.html b/lnbits/extensions/invoices/templates/invoices/_api_docs.html new file mode 100644 index 00000000..6e2a6355 --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/_api_docs.html @@ -0,0 +1,153 @@ + + + + + GET /invoices/api/v1/invoices +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ [<invoice_object>, ...] +
Curl example
+ curl -X GET {{ request.base_url }}invoices/api/v1/invoices -H + "X-Api-Key: <invoice_key>" + +
+
+
+ + + + + GET + /invoices/api/v1/invoice/{invoice_id} +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X GET {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id} -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + POST /invoices/api/v1/invoice +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X POST {{ request.base_url }}invoices/api/v1/invoice -H + "X-Api-Key: <invoice_key>" + +
+
+
+ + + + + POST + /invoices/api/v1/invoice/{invoice_id} +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X POST {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id} -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + POST + /invoices/api/v1/invoice/{invoice_id}/payments +
Headers
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {payment_object} +
Curl example
+ curl -X POST {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id}/payments -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + GET + /invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash} +
Headers
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+
Curl example
+ curl -X GET {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash} -H + "X-Api-Key: <invoice_key>" + +
+
+
+
diff --git a/lnbits/extensions/invoices/templates/invoices/index.html b/lnbits/extensions/invoices/templates/invoices/index.html new file mode 100644 index 00000000..e3093e3c --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/index.html @@ -0,0 +1,571 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} +
+
+ + + New Invoice + + + + + +
+
+
Invoices
+
+
+ Export to CSV +
+
+ + {% raw %} + + + + {% endraw %} + +
+
+
+ +
+ + +
+ {{SITE_TITLE}} Invoices extension +
+
+ + + {% include "invoices/_api_docs.html" %} + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add Line Item + + + + +
+ Create Invoice + Save Invoice + Cancel +
+
+
+
+
+{% endblock %} {% block scripts %} {{ window_vars(user) }} + +{% endblock %} diff --git a/lnbits/extensions/invoices/templates/invoices/pay.html b/lnbits/extensions/invoices/templates/invoices/pay.html new file mode 100644 index 00000000..7b6452dc --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/pay.html @@ -0,0 +1,430 @@ +{% extends "public.html" %} {% block toolbar_title %} Invoice + + +{% endblock %} {% from "macros.jinja" import window_vars with context %} {% +block page %} + +
+
+
+ + +

+ Invoice +

+ + + + ID + {{ invoice_id }} + + + + Created At + {{ datetime.utcfromtimestamp(invoice.time).strftime('%Y-%m-%d + %H:%M') }} + + + + Status + + + {{ invoice.status }} + + + + + + Total + + {{ "{:0,.2f}".format(invoice_total / 100) }} {{ invoice.currency + }} + + + + + Paid + +
+
+ {{ "{:0,.2f}".format(payments_total / 100) }} {{ + invoice.currency }} +
+
+ {% if payments_total < invoice_total %} + + Pay Invoice + + {% endif %} +
+
+
+
+
+
+
+
+ +
+ + +

+ Bill To +

+ + + + Company Name + {{ invoice.company_name }} + + + + Name + {{ invoice.first_name }} {{ invoice.last_name + }} + + + + Address + {{ invoice.address }} + + + + Email + {{ invoice.email }} + + + + Phone + {{ invoice.phone }} + + +
+
+
+
+ +
+ +
+
+ + +

+ Items +

+ + + {% if invoice_items %} + + Item + Amount + + {% endif %} {% for item in invoice_items %} + + {{item.description}} + + {{ "{:0,.2f}".format(item.amount / 100) }} {{ invoice.currency + }} + + + {% endfor %} {% if not invoice_items %} No Invoice Items {% endif %} + +
+
+
+
+ +
+ +
+
+ + +

+ Payments +

+ + + {% if invoice_payments %} + + Date + Amount + + {% endif %} {% for item in invoice_payments %} + + {{ datetime.utcfromtimestamp(item.time).strftime('%Y-%m-%d + %H:%M') }} + + {{ "{:0,.2f}".format(item.amount / 100) }} {{ invoice.currency + }} + + + {% endfor %} {% if not invoice_payments %} No Invoice Payments {% + endif %} + +
+
+
+
+ +
+ +
+
+
+

Scan to View & Pay Online!

+ +
+
+
+ + + + + + + + +
+ Create Payment + Cancel +
+
+
+
+ + + + + + + + +
+ Copy Invoice +
+
+ + + + + + +
+

{{ request.url }}

+
+
+ Copy URL + Close +
+
+
+
+{% endblock %} {% block scripts %} + +{% endblock %} diff --git a/lnbits/extensions/invoices/views.py b/lnbits/extensions/invoices/views.py new file mode 100644 index 00000000..08223df8 --- /dev/null +++ b/lnbits/extensions/invoices/views.py @@ -0,0 +1,59 @@ +from datetime import datetime +from http import HTTPStatus + +from fastapi import FastAPI, Request +from fastapi.params import Depends +from fastapi.templating import Jinja2Templates +from starlette.exceptions import HTTPException +from starlette.responses import HTMLResponse + +from lnbits.core.models import User +from lnbits.decorators import check_user_exists + +from . import invoices_ext, invoices_renderer +from .crud import ( + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_payments_total, +) + +templates = Jinja2Templates(directory="templates") + + +@invoices_ext.get("/", response_class=HTMLResponse) +async def index(request: Request, user: User = Depends(check_user_exists)): + return invoices_renderer().TemplateResponse( + "invoices/index.html", {"request": request, "user": user.dict()} + ) + + +@invoices_ext.get("/pay/{invoice_id}", response_class=HTMLResponse) +async def index(request: Request, invoice_id: str): + invoice = await get_invoice(invoice_id) + + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + return invoices_renderer().TemplateResponse( + "invoices/pay.html", + { + "request": request, + "invoice_id": invoice_id, + "invoice": invoice.dict(), + "invoice_items": invoice_items, + "invoice_total": invoice_total, + "invoice_payments": invoice_payments, + "payments_total": payments_total, + "datetime": datetime, + }, + ) diff --git a/lnbits/extensions/invoices/views_api.py b/lnbits/extensions/invoices/views_api.py new file mode 100644 index 00000000..23a262e3 --- /dev/null +++ b/lnbits/extensions/invoices/views_api.py @@ -0,0 +1,136 @@ +from http import HTTPStatus + +from fastapi import Query +from fastapi.params import Depends +from loguru import logger +from starlette.exceptions import HTTPException + +from lnbits.core.crud import get_user +from lnbits.core.services import create_invoice +from lnbits.core.views.api import api_payment +from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key +from lnbits.utils.exchange_rates import fiat_amount_as_satoshis + +from . import invoices_ext +from .crud import ( + create_invoice_internal, + create_invoice_items, + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_invoices, + get_payments_total, + update_invoice_internal, + update_invoice_items, +) +from .models import CreateInvoiceData, UpdateInvoiceData + + +@invoices_ext.get("/api/v1/invoices", status_code=HTTPStatus.OK) +async def api_invoices( + all_wallets: bool = Query(None), wallet: WalletTypeInfo = Depends(get_key_type) +): + wallet_ids = [wallet.wallet.id] + if all_wallets: + wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids + + return [invoice.dict() for invoice in await get_invoices(wallet_ids)] + + +@invoices_ext.get("/api/v1/invoice/{invoice_id}", status_code=HTTPStatus.OK) +async def api_invoice(invoice_id: str): + invoice = await get_invoice(invoice_id) + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + invoice_items = await get_invoice_items(invoice_id) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + invoice_dict = invoice.dict() + invoice_dict["items"] = invoice_items + invoice_dict["payments"] = payments_total + return invoice_dict + + +@invoices_ext.post("/api/v1/invoice", status_code=HTTPStatus.CREATED) +async def api_invoice_create( + data: CreateInvoiceData, wallet: WalletTypeInfo = Depends(get_key_type) +): + invoice = await create_invoice_internal(wallet_id=wallet.wallet.id, data=data) + items = await create_invoice_items(invoice_id=invoice.id, data=data.items) + invoice_dict = invoice.dict() + invoice_dict["items"] = items + return invoice_dict + + +@invoices_ext.post("/api/v1/invoice/{invoice_id}", status_code=HTTPStatus.OK) +async def api_invoice_update( + data: UpdateInvoiceData, + invoice_id: str, + wallet: WalletTypeInfo = Depends(get_key_type), +): + invoice = await update_invoice_internal(wallet_id=wallet.wallet.id, data=data) + items = await update_invoice_items(invoice_id=invoice.id, data=data.items) + invoice_dict = invoice.dict() + invoice_dict["items"] = items + return invoice_dict + + +@invoices_ext.post( + "/api/v1/invoice/{invoice_id}/payments", status_code=HTTPStatus.CREATED +) +async def api_invoices_create_payment( + famount: int = Query(..., ge=1), invoice_id: str = None +): + invoice = await get_invoice(invoice_id) + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + if payments_total + famount > invoice_total: + raise HTTPException( + status_code=HTTPStatus.BAD_REQUEST, detail="Amount exceeds invoice due." + ) + + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + + price_in_sats = await fiat_amount_as_satoshis(famount / 100, invoice.currency) + + try: + payment_hash, payment_request = await create_invoice( + wallet_id=invoice.wallet, + amount=price_in_sats, + memo=f"Payment for invoice {invoice_id}", + extra={"tag": "invoices", "invoice_id": invoice_id, "famount": famount}, + ) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e)) + + return {"payment_hash": payment_hash, "payment_request": payment_request} + + +@invoices_ext.get( + "/api/v1/invoice/{invoice_id}/payments/{payment_hash}", status_code=HTTPStatus.OK +) +async def api_invoices_check_payment(invoice_id: str, payment_hash: str): + invoice = await get_invoice(invoice_id) + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + try: + status = await api_payment(payment_hash) + + except Exception as exc: + logger.error(exc) + return {"paid": False} + return status diff --git a/lnbits/extensions/livestream/lnurl.py b/lnbits/extensions/livestream/lnurl.py index 861955de..349bb280 100644 --- a/lnbits/extensions/livestream/lnurl.py +++ b/lnbits/extensions/livestream/lnurl.py @@ -90,9 +90,7 @@ async def lnurl_callback( wallet_id=ls.wallet, amount=int(amount_received / 1000), memo=await track.fullname(), - description_hash=hashlib.sha256( - (await track.lnurlpay_metadata()).encode("utf-8") - ).digest(), + unhashed_description=(await track.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "livestream", "track": track.id, "comment": comment}, ) diff --git a/lnbits/extensions/lnaddress/lnurl.py b/lnbits/extensions/lnaddress/lnurl.py index e6a1ff48..49fd30e0 100644 --- a/lnbits/extensions/lnaddress/lnurl.py +++ b/lnbits/extensions/lnaddress/lnurl.py @@ -70,11 +70,9 @@ async def lnurl_callback(address_id, amount: int = Query(...)): json={ "out": False, "amount": int(amount_received / 1000), - "description_hash": hashlib.sha256( - (await address.lnurlpay_metadata(domain=domain.domain)).encode( - "utf-8" - ) - ).hexdigest(), + "description_hash": ( + await address.lnurlpay_metadata(domain=domain.domain) + ).encode("utf-8"), "extra": {"tag": f"Payment to {address.username}@{domain.domain}"}, }, timeout=40, diff --git a/lnbits/extensions/lnaddress/templates/lnaddress/_api_docs.html b/lnbits/extensions/lnaddress/templates/lnaddress/_api_docs.html index 49155f27..12173c95 100644 --- a/lnbits/extensions/lnaddress/templates/lnaddress/_api_docs.html +++ b/lnbits/extensions/lnaddress/templates/lnaddress/_api_docs.html @@ -13,7 +13,7 @@ Charge people for using your domain name...
More details
diff --git a/lnbits/extensions/lnaddress/views_api.py b/lnbits/extensions/lnaddress/views_api.py index b1f1f004..8f403a38 100644 --- a/lnbits/extensions/lnaddress/views_api.py +++ b/lnbits/extensions/lnaddress/views_api.py @@ -6,7 +6,7 @@ from fastapi.params import Depends, Query from starlette.exceptions import HTTPException from lnbits.core.crud import get_user -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.extensions.lnaddress.models import CreateAddress, CreateDomain @@ -229,7 +229,7 @@ async def api_address_send_address(payment_hash): address = await get_address(payment_hash) domain = await get_domain(address.domain) try: - status = await check_invoice_status(domain.wallet, payment_hash) + status = await check_transaction_status(domain.wallet, payment_hash) is_paid = not status.pending except Exception as e: return {"paid": False, "error": str(e)} diff --git a/lnbits/extensions/lndhub/views_api.py b/lnbits/extensions/lndhub/views_api.py index a3160fa9..8cbe5a6b 100644 --- a/lnbits/extensions/lndhub/views_api.py +++ b/lnbits/extensions/lndhub/views_api.py @@ -130,10 +130,7 @@ async def lndhub_gettxs( offset=offset, exclude_uncheckable=True, ): - await payment.set_pending( - (await WALLET.get_payment_status(payment.checking_id)).pending - ) - await asyncio.sleep(0.1) + await payment.check_status() return [ { @@ -181,7 +178,6 @@ async def lndhub_getuserinvoices( await invoice.set_pending( (await WALLET.get_invoice_status(invoice.checking_id)).pending ) - await asyncio.sleep(0.1) return [ { diff --git a/lnbits/extensions/lnticket/templates/lnticket/index.html b/lnbits/extensions/lnticket/templates/lnticket/index.html index 6dafb4c2..9329be7b 100644 --- a/lnbits/extensions/lnticket/templates/lnticket/index.html +++ b/lnbits/extensions/lnticket/templates/lnticket/index.html @@ -281,7 +281,13 @@ {% endraw %} - + @@ -371,6 +377,9 @@ } }, methods: { + resetForm() { + this.formDialog.data = {flatrate: false} + }, getTickets: function () { var self = this @@ -463,7 +472,7 @@ .then(function (response) { self.forms.push(mapLNTicket(response.data)) self.formDialog.show = false - self.formDialog.data = {} + self.resetForm() }) .catch(function (error) { LNbits.utils.notifyApiError(error) @@ -497,7 +506,7 @@ }) self.forms.push(mapLNTicket(response.data)) self.formDialog.show = false - self.formDialog.data = {} + self.resetForm() }) .catch(function (error) { LNbits.utils.notifyApiError(error) diff --git a/lnbits/extensions/lnurldevice/lnurl.py b/lnbits/extensions/lnurldevice/lnurl.py index 5e25dadb..df0cd4b8 100644 --- a/lnbits/extensions/lnurldevice/lnurl.py +++ b/lnbits/extensions/lnurldevice/lnurl.py @@ -205,9 +205,7 @@ async def lnurl_callback( wallet_id=device.wallet, amount=lnurldevicepayment.sats / 1000, memo=device.title, - description_hash=hashlib.sha256( - (await device.lnurlpay_metadata()).encode("utf-8") - ).digest(), + unhashed_description=(await device.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "PoS"}, ) lnurldevicepayment = await update_lnurldevicepayment( diff --git a/lnbits/extensions/lnurlp/lnurl.py b/lnbits/extensions/lnurlp/lnurl.py index 2ba49e85..dea8037d 100644 --- a/lnbits/extensions/lnurlp/lnurl.py +++ b/lnbits/extensions/lnurlp/lnurl.py @@ -87,9 +87,7 @@ async def api_lnurl_callback(request: Request, link_id): wallet_id=link.wallet, amount=int(amount_received / 1000), memo=link.description, - description_hash=hashlib.sha256( - link.lnurlpay_metadata.encode("utf-8") - ).digest(), + unhashed_description=link.lnurlpay_metadata.encode("utf-8"), extra={ "tag": "lnurlp", "link": link.id, diff --git a/lnbits/extensions/lnurlp/templates/lnurlp/index.html b/lnbits/extensions/lnurlp/templates/lnurlp/index.html index 9677a027..de90f5af 100644 --- a/lnbits/extensions/lnurlp/templates/lnurlp/index.html +++ b/lnbits/extensions/lnurlp/templates/lnurlp/index.html @@ -296,16 +296,17 @@ Shareable link + >Copy sharable link + + >Write to NFC + >Print Close diff --git a/lnbits/extensions/lnurlp/views_api.py b/lnbits/extensions/lnurlp/views_api.py index 8d4569da..6a8a724b 100644 --- a/lnbits/extensions/lnurlp/views_api.py +++ b/lnbits/extensions/lnurlp/views_api.py @@ -96,7 +96,7 @@ async def api_link_create_or_update( data.min *= data.fiat_base_multiplier data.max *= data.fiat_base_multiplier - if "success_url" in data and data.success_url[:8] != "https://": + if data.success_url is not None and not data.success_url.startswith("https://"): raise HTTPException( detail="Success URL must be secure https://...", status_code=HTTPStatus.BAD_REQUEST, @@ -121,7 +121,7 @@ async def api_link_create_or_update( return {**link.dict(), "lnurl": link.lnurl(request)} -@lnurlp_ext.delete("/api/v1/links/{link_id}") +@lnurlp_ext.delete("/api/v1/links/{link_id}", status_code=HTTPStatus.OK) async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(get_key_type)): link = await get_pay_link(link_id) @@ -136,7 +136,7 @@ async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(get_key_type ) await delete_pay_link(link_id) - raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + return {"success": True} @lnurlp_ext.get("/api/v1/rate/{currency}", status_code=HTTPStatus.OK) diff --git a/lnbits/extensions/offlineshop/lnurl.py b/lnbits/extensions/offlineshop/lnurl.py index 0bf779e4..f50df99a 100644 --- a/lnbits/extensions/offlineshop/lnurl.py +++ b/lnbits/extensions/offlineshop/lnurl.py @@ -73,9 +73,7 @@ async def lnurl_callback(request: Request, item_id: int): wallet_id=shop.wallet, amount=int(amount_received / 1000), memo=item.name, - description_hash=hashlib.sha256( - (await item.lnurlpay_metadata()).encode("utf-8") - ).digest(), + unhashed_description=(await item.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "offlineshop", "item": item.id}, ) except Exception as exc: diff --git a/lnbits/extensions/offlineshop/wordlists.py b/lnbits/extensions/offlineshop/wordlists.py index ee3663e3..fa0e574d 100644 --- a/lnbits/extensions/offlineshop/wordlists.py +++ b/lnbits/extensions/offlineshop/wordlists.py @@ -5,13 +5,13 @@ animals = [ "duck", "eagle", "flamingo", - "gorila", + "gorilla", "hamster", "iguana", "jaguar", "koala", "llama", - "macaroni penguim", + "macaroni penguin", "numbat", "octopus", "platypus", diff --git a/lnbits/extensions/paywall/views_api.py b/lnbits/extensions/paywall/views_api.py index 8052c63b..d2d49853 100644 --- a/lnbits/extensions/paywall/views_api.py +++ b/lnbits/extensions/paywall/views_api.py @@ -4,7 +4,7 @@ from fastapi import Depends, Query from starlette.exceptions import HTTPException from lnbits.core.crud import get_user, get_wallet -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from . import paywall_ext @@ -87,7 +87,7 @@ async def api_paywal_check_invoice( status_code=HTTPStatus.NOT_FOUND, detail="Paywall does not exist." ) try: - status = await check_invoice_status(paywall.wallet, payment_hash) + status = await check_transaction_status(paywall.wallet, payment_hash) is_paid = not status.pending except Exception: return {"paid": False} diff --git a/lnbits/extensions/satsdice/lnurl.py b/lnbits/extensions/satsdice/lnurl.py index 03d20502..caafc3a4 100644 --- a/lnbits/extensions/satsdice/lnurl.py +++ b/lnbits/extensions/satsdice/lnurl.py @@ -77,9 +77,7 @@ async def api_lnurlp_callback( wallet_id=link.wallet, amount=int(amount_received / 1000), memo="Satsdice bet", - description_hash=hashlib.sha256( - link.lnurlpay_metadata.encode("utf-8") - ).digest(), + unhashed_description=link.lnurlpay_metadata.encode("utf-8"), extra={"tag": "satsdice", "link": link.id, "comment": "comment"}, ) diff --git a/lnbits/extensions/satsdice/templates/satsdice/index.html b/lnbits/extensions/satsdice/templates/satsdice/index.html index eb52b6b2..654069d8 100644 --- a/lnbits/extensions/satsdice/templates/satsdice/index.html +++ b/lnbits/extensions/satsdice/templates/satsdice/index.html @@ -232,7 +232,7 @@ Copy shareable link @@ -421,7 +421,13 @@ this.formDialog = { show: false, fixedAmount: true, - data: {} + data: { + haircut: 0, + min_bet: 10, + max_bet: 1000, + currency: 'satoshis', + comment_chars: 0 + } } }, updatePayLink(wallet, data) { diff --git a/lnbits/extensions/satspay/__init__.py b/lnbits/extensions/satspay/__init__.py index f33f3aa5..37245c21 100644 --- a/lnbits/extensions/satspay/__init__.py +++ b/lnbits/extensions/satspay/__init__.py @@ -1,6 +1,7 @@ import asyncio from fastapi import APIRouter +from fastapi.staticfiles import StaticFiles from lnbits.db import Database from lnbits.helpers import template_renderer @@ -11,6 +12,14 @@ db = Database("ext_satspay") satspay_ext: APIRouter = APIRouter(prefix="/satspay", tags=["satspay"]) +satspay_static_files = [ + { + "path": "/satspay/static", + "app": StaticFiles(directory="lnbits/extensions/satspay/static"), + "name": "satspay_static", + } +] + def satspay_renderer(): return template_renderer(["lnbits/extensions/satspay/templates"]) diff --git a/lnbits/extensions/satspay/crud.py b/lnbits/extensions/satspay/crud.py index 9deb3215..47d7a4a8 100644 --- a/lnbits/extensions/satspay/crud.py +++ b/lnbits/extensions/satspay/crud.py @@ -6,7 +6,7 @@ from lnbits.core.services import create_invoice from lnbits.core.views.api import api_payment from lnbits.helpers import urlsafe_short_hash -from ..watchonly.crud import get_fresh_address, get_mempool, get_watch_wallet +from ..watchonly.crud import get_config, get_fresh_address # from lnbits.db import open_ext_db from . import db @@ -18,7 +18,6 @@ from .models import Charges, CreateCharge async def create_charge(user: str, data: CreateCharge) -> Charges: charge_id = urlsafe_short_hash() if data.onchainwallet: - wallet = await get_watch_wallet(data.onchainwallet) onchain = await get_fresh_address(data.onchainwallet) onchainaddress = onchain.address else: @@ -89,7 +88,8 @@ async def get_charge(charge_id: str) -> Charges: async def get_charges(user: str) -> List[Charges]: rows = await db.fetchall( - """SELECT * FROM satspay.charges WHERE "user" = ?""", (user,) + """SELECT * FROM satspay.charges WHERE "user" = ? ORDER BY "timestamp" DESC """, + (user,), ) return [Charges.from_row(row) for row in rows] @@ -102,14 +102,16 @@ async def check_address_balance(charge_id: str) -> List[Charges]: charge = await get_charge(charge_id) if not charge.paid: if charge.onchainaddress: - mempool = await get_mempool(charge.user) + config = await get_config(charge.user) try: async with httpx.AsyncClient() as client: r = await client.get( - mempool.endpoint + "/api/address/" + charge.onchainaddress + config.mempool_endpoint + + "/api/address/" + + charge.onchainaddress ) respAmount = r.json()["chain_stats"]["funded_txo_sum"] - if respAmount >= charge.balance: + if respAmount > charge.balance: await update_charge(charge_id=charge_id, balance=respAmount) except Exception: pass diff --git a/lnbits/extensions/satspay/models.py b/lnbits/extensions/satspay/models.py index 7e8080dc..e8638d5e 100644 --- a/lnbits/extensions/satspay/models.py +++ b/lnbits/extensions/satspay/models.py @@ -1,4 +1,4 @@ -import time +from datetime import datetime, timedelta from sqlite3 import Row from typing import Optional @@ -38,12 +38,16 @@ class Charges(BaseModel): def from_row(cls, row: Row) -> "Charges": return cls(**dict(row)) + @property + def time_left(self): + now = datetime.utcnow().timestamp() + start = datetime.fromtimestamp(self.timestamp) + expiration = (start + timedelta(minutes=self.time)).timestamp() + return (expiration - now) / 60 + @property def time_elapsed(self): - if (self.timestamp + (self.time * 60)) >= time.time(): - return False - else: - return True + return self.time_left < 0 @property def paid(self): diff --git a/lnbits/extensions/satspay/static/js/utils.js b/lnbits/extensions/satspay/static/js/utils.js new file mode 100644 index 00000000..9b4abbfc --- /dev/null +++ b/lnbits/extensions/satspay/static/js/utils.js @@ -0,0 +1,31 @@ +const sleep = ms => new Promise(r => setTimeout(r, ms)) +const retryWithDelay = async function (fn, retryCount = 0) { + try { + await sleep(25) + // Do not return the call directly, use result. + // Otherwise the error will not be cought in this try-catch block. + const result = await fn() + return result + } catch (err) { + if (retryCount > 100) throw err + await sleep((retryCount + 1) * 1000) + return retryWithDelay(fn, retryCount + 1) + } +} + +const mapCharge = (obj, oldObj = {}) => { + const charge = _.clone(obj) + + charge.progress = obj.time_left < 0 ? 1 : 1 - obj.time_left / obj.time + charge.time = minutesToTime(obj.time) + charge.timeLeft = minutesToTime(obj.time_left) + + charge.expanded = false + charge.displayUrl = ['/satspay/', obj.id].join('') + charge.expanded = oldObj.expanded + charge.pendingBalance = oldObj.pendingBalance || 0 + return charge +} + +const minutesToTime = min => + min > 0 ? new Date(min * 1000).toISOString().substring(14, 19) : '' diff --git a/lnbits/extensions/satspay/templates/satspay/_api_docs.html b/lnbits/extensions/satspay/templates/satspay/_api_docs.html index 336ab899..ed658735 100644 --- a/lnbits/extensions/satspay/templates/satspay/_api_docs.html +++ b/lnbits/extensions/satspay/templates/satspay/_api_docs.html @@ -8,172 +8,10 @@ Created by, Ben Arc

+
+
+ Swagger REST API Documentation - - - - - - POST /satspay/api/v1/charge -
Headers
- {"X-Api-Key": <admin_key>}
-
- Body (application/json) -
-
- Returns 200 OK (application/json) -
- [<charge_object>, ...] -
Curl example
- curl -X POST {{ request.base_url }}satspay/api/v1/charge -d - '{"onchainwallet": <string, watchonly_wallet_id>, - "description": <string>, "webhook":<string>, "time": - <integer>, "amount": <integer>, "lnbitswallet": - <string, lnbits_wallet_id>}' -H "Content-type: - application/json" -H "X-Api-Key: {{user.wallets[0].adminkey }}" - -
-
-
- - - - PUT - /satspay/api/v1/charge/<charge_id> -
Headers
- {"X-Api-Key": <admin_key>}
-
- Body (application/json) -
-
- Returns 200 OK (application/json) -
- [<charge_object>, ...] -
Curl example
- curl -X POST {{ request.base_url - }}satspay/api/v1/charge/<charge_id> -d '{"onchainwallet": - <string, watchonly_wallet_id>, "description": <string>, - "webhook":<string>, "time": <integer>, "amount": - <integer>, "lnbitswallet": <string, lnbits_wallet_id>}' - -H "Content-type: application/json" -H "X-Api-Key: - {{user.wallets[0].adminkey }}" - -
-
-
- - - - - GET - /satspay/api/v1/charge/<charge_id> -
Headers
- {"X-Api-Key": <invoice_key>}
-
- Body (application/json) -
-
- Returns 200 OK (application/json) -
- [<charge_object>, ...] -
Curl example
- curl -X GET {{ request.base_url - }}satspay/api/v1/charge/<charge_id> -H "X-Api-Key: {{ - user.wallets[0].inkey }}" - -
-
-
- - - - GET /satspay/api/v1/charges -
Headers
- {"X-Api-Key": <invoice_key>}
-
- Body (application/json) -
-
- Returns 200 OK (application/json) -
- [<charge_object>, ...] -
Curl example
- curl -X GET {{ request.base_url }}satspay/api/v1/charges -H - "X-Api-Key: {{ user.wallets[0].inkey }}" - -
-
-
- - - - DELETE - /satspay/api/v1/charge/<charge_id> -
Headers
- {"X-Api-Key": <admin_key>}
-
Returns 204 NO CONTENT
- -
Curl example
- curl -X DELETE {{ request.base_url - }}satspay/api/v1/charge/<charge_id> -H "X-Api-Key: {{ - user.wallets[0].adminkey }}" - -
-
-
- - - - GET - /satspay/api/v1/charges/balance/<charge_id> -
- Body (application/json) -
-
- Returns 200 OK (application/json) -
- [<charge_object>, ...] -
Curl example
- curl -X GET {{ request.base_url - }}satspay/api/v1/charges/balance/<charge_id> -H "X-Api-Key: {{ - user.wallets[0].inkey }}" - -
-
-
-
diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index 8c577fbe..f34ac509 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -1,223 +1,299 @@ {% extends "public.html" %} {% block page %} -
- -
-
-
{{ charge.description }}
-
-
-
-
Time elapsed
-
-
-
Charge paid
-
-
- - - - Awaiting payment... - - {% raw %} {{ newTimeLeft }} {% endraw %} - - - +
+
+
+ +
+
+
-
-
- Charge ID: {{ charge.id }} +
+
-
- {% raw %} Total to pay: {{ charge_amount }}sats
- Amount paid: {{ charge_balance }}

- Amount due: {{ charge_amount - charge_balance }}sats {% endraw %} -
-
- -
-
-
- - - bitcoin lightning payment method not available - - - - pay with lightning - + Time elapsed
-
- - - bitcoin onchain payment method not available - - - - pay onchain - -
-
- -
-
- - -
-
- -
-
- - +
+ Charge paid
-
- Pay this
- lightning-network invoice
+ + + Awaiting payment... + + {% raw %} {{ charge.timeLeft }} {% endraw %} + + + +
+
+
+
+
+
+
Charge Id:
+
+ +
+
+
+
Total to pay:
+
+ + sat + +
+
+
+
Amount paid:
+
+ + + sat - - - - - - -
- Copy invoice +
+
+
Amount pending:
+
+ + sat + +
+
+
+
Amount due:
+
+ + + sat + + + none
+
+ +
+
+
+
+ + + bitcoin lightning payment method not available + + + + pay with lightning + +
+
+ + + bitcoin onchain payment method not available + + + + pay onchain + +
+
+ +
+
+ + + +
+
+
+
+ +
+
+ + +
+
+
+
+ Pay this lightning-network invoice: +
+
+ + + + + + +
+
+ Copy invoice +
+
+
+
+
+
-
-
- -
-
- - -
-
-
- Send {{ charge.amount }}sats
- to this onchain address
-
- - - - +
+
+ -
+
+
+
+
+
+
+ +
+
+ Copy address + v-if="charge.webhook" + type="a" + :href="charge.completelink" + :label="charge.completelinktext" + > +
+
+
+
+ Send + + + sats to this onchain address +
+
+ + + + + + +
+
+ Copy address +
+
+
- +
+
{% endblock %} {% block scripts %} - + + diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 551b81b8..396200cf 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -18,46 +18,54 @@
Charges
-
+
- Export to CSV +
+
+ + + + + Export to CSV + + + +
@@ -66,73 +74,179 @@ + + + + + expired + + + + paid + + + waiting + + + + {{props.row.description}} - Payment link - - - +
{{props.row.timeLeft}}
+ - Time elapsed -
- - - PAID! - - - - Processing - - - Delete charge - +
- -
-
{{ col.value }}
+ +
{{props.row.time}}
+
+ +
{{props.row.amount}}
+
+ +
{{props.row.balance}}
+
+ +
+ {{props.row.pendingBalance ? props.row.pendingBalance : ''}} +
+
+ + {{props.row.onchainaddress}} + +
+ + +
+
Onchain Wallet:
+
+ {{getOnchainWalletName(props.row.onchainwallet)}} +
+
+
+
LNbits Wallet:
+
+ {{getLNbitsWalletName(props.row.lnbitswallet)}} +
+
+ + + +
+
ID:
+
{{props.row.id}}
+
+
+
+
+ Details + Refresh Balance +
+
+ Delete +
+
+
+
@@ -155,11 +269,7 @@
- + @@ -284,49 +394,28 @@ + + + diff --git a/lnbits/extensions/satspay/views.py b/lnbits/extensions/satspay/views.py index d33d5c17..69d81dad 100644 --- a/lnbits/extensions/satspay/views.py +++ b/lnbits/extensions/satspay/views.py @@ -9,6 +9,7 @@ from starlette.responses import HTMLResponse from lnbits.core.crud import get_wallet from lnbits.core.models import User from lnbits.decorators import check_user_exists +from lnbits.extensions.watchonly.crud import get_config from . import satspay_ext, satspay_renderer from .crud import get_charge @@ -24,14 +25,24 @@ async def index(request: Request, user: User = Depends(check_user_exists)): @satspay_ext.get("/{charge_id}", response_class=HTMLResponse) -async def display(request: Request, charge_id): +async def display(request: Request, charge_id: str): charge = await get_charge(charge_id) if not charge: raise HTTPException( status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist." ) wallet = await get_wallet(charge.lnbitswallet) + onchainwallet_config = await get_config(charge.user) + inkey = wallet.inkey if wallet else None + mempool_endpoint = ( + onchainwallet_config.mempool_endpoint if onchainwallet_config else None + ) return satspay_renderer().TemplateResponse( "satspay/display.html", - {"request": request, "charge": charge, "wallet_key": wallet.inkey}, + { + "request": request, + "charge_data": charge.dict(), + "wallet_inkey": inkey, + "mempool_endpoint": mempool_endpoint, + }, ) diff --git a/lnbits/extensions/satspay/views_api.py b/lnbits/extensions/satspay/views_api.py index c3e38f0c..f94b970a 100644 --- a/lnbits/extensions/satspay/views_api.py +++ b/lnbits/extensions/satspay/views_api.py @@ -1,7 +1,6 @@ from http import HTTPStatus import httpx -from fastapi import Query from fastapi.params import Depends from starlette.exceptions import HTTPException @@ -31,7 +30,12 @@ async def api_charge_create( data: CreateCharge, wallet: WalletTypeInfo = Depends(require_invoice_key) ): charge = await create_charge(user=wallet.wallet.user, data=data) - return charge.dict() + return { + **charge.dict(), + **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, + **{"paid": charge.paid}, + } @satspay_ext.put("/api/v1/charge/{charge_id}") @@ -51,6 +55,7 @@ async def api_charges_retrieve(wallet: WalletTypeInfo = Depends(get_key_type)): { **charge.dict(), **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, **{"paid": charge.paid}, } for charge in await get_charges(wallet.wallet.user) @@ -73,6 +78,7 @@ async def api_charge_retrieve( return { **charge.dict(), **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, **{"paid": charge.paid}, } @@ -93,9 +99,18 @@ async def api_charge_delete(charge_id, wallet: WalletTypeInfo = Depends(get_key_ #############################BALANCE########################## -@satspay_ext.get("/api/v1/charges/balance/{charge_id}") -async def api_charges_balance(charge_id): +@satspay_ext.get("/api/v1/charges/balance/{charge_ids}") +async def api_charges_balance(charge_ids): + charge_id_list = charge_ids.split(",") + charges = [] + for charge_id in charge_id_list: + charge = await api_charge_balance(charge_id) + charges.append(charge) + return charges + +@satspay_ext.get("/api/v1/charge/balance/{charge_id}") +async def api_charge_balance(charge_id): charge = await check_address_balance(charge_id) if not charge: @@ -125,23 +140,9 @@ async def api_charges_balance(charge_id): ) except AssertionError: charge.webhook = None - return charge.dict() - - -#############################MEMPOOL########################## - - -@satspay_ext.put("/api/v1/mempool") -async def api_update_mempool( - endpoint: str = Query(...), wallet: WalletTypeInfo = Depends(get_key_type) -): - mempool = await update_mempool(endpoint, user=wallet.wallet.user) - return mempool.dict() - - -@satspay_ext.route("/api/v1/mempool") -async def api_get_mempool(wallet: WalletTypeInfo = Depends(get_key_type)): - mempool = await get_mempool(wallet.wallet.user) - if not mempool: - mempool = await create_mempool(user=wallet.wallet.user) - return mempool.dict() + return { + **charge.dict(), + **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, + **{"paid": charge.paid}, + } diff --git a/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html b/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html index db3b2477..8b3a4c4d 100644 --- a/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html +++ b/lnbits/extensions/subdomains/templates/subdomains/_api_docs.html @@ -13,7 +13,7 @@ Charge people for using your subdomain name...
More details
diff --git a/lnbits/extensions/subdomains/views_api.py b/lnbits/extensions/subdomains/views_api.py index ba87bc98..b01e6ffb 100644 --- a/lnbits/extensions/subdomains/views_api.py +++ b/lnbits/extensions/subdomains/views_api.py @@ -5,7 +5,7 @@ from fastapi.params import Depends from starlette.exceptions import HTTPException from lnbits.core.crud import get_user -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.extensions.subdomains.models import CreateDomain, CreateSubdomain @@ -161,7 +161,7 @@ async def api_subdomain_make_subdomain(domain_id, data: CreateSubdomain): async def api_subdomain_send_subdomain(payment_hash): subdomain = await get_subdomain(payment_hash) try: - status = await check_invoice_status(subdomain.wallet, payment_hash) + status = await check_transaction_status(subdomain.wallet, payment_hash) is_paid = not status.pending except Exception: return {"paid": False} diff --git a/lnbits/extensions/tipjar/crud.py b/lnbits/extensions/tipjar/crud.py index 29e1a469..046b9491 100644 --- a/lnbits/extensions/tipjar/crud.py +++ b/lnbits/extensions/tipjar/crud.py @@ -76,10 +76,10 @@ async def get_tipjars(wallet_id: str) -> Optional[list]: async def delete_tipjar(tipjar_id: int) -> None: """Delete a TipJar and all corresponding Tips""" - await db.execute("DELETE FROM tipjar.TipJars WHERE id = ?", (tipjar_id,)) rows = await db.fetchall("SELECT * FROM tipjar.Tips WHERE tipjar = ?", (tipjar_id,)) for row in rows: await delete_tip(row["id"]) + await db.execute("DELETE FROM tipjar.TipJars WHERE id = ?", (tipjar_id,)) async def get_tip(tip_id: str) -> Optional[Tip]: diff --git a/lnbits/extensions/tipjar/views_api.py b/lnbits/extensions/tipjar/views_api.py index 5a55a3ca..50c5138b 100644 --- a/lnbits/extensions/tipjar/views_api.py +++ b/lnbits/extensions/tipjar/views_api.py @@ -57,7 +57,7 @@ async def api_create_tip(data: createTips): name = name.replace('"', "''") if not name: name = "Anonymous" - description = f'"{name}": {message}' + description = f"{name}: {message}" charge = await create_charge( user=charge_details["user"], data=CreateCharge( diff --git a/lnbits/extensions/tpos/models.py b/lnbits/extensions/tpos/models.py index 36bca79b..f6522add 100644 --- a/lnbits/extensions/tpos/models.py +++ b/lnbits/extensions/tpos/models.py @@ -23,3 +23,7 @@ class TPoS(BaseModel): @classmethod def from_row(cls, row: Row) -> "TPoS": return cls(**dict(row)) + + +class PayLnurlWData(BaseModel): + lnurl: str diff --git a/lnbits/extensions/tpos/templates/tpos/index.html b/lnbits/extensions/tpos/templates/tpos/index.html index edbb2aa8..3c4fa24f 100644 --- a/lnbits/extensions/tpos/templates/tpos/index.html +++ b/lnbits/extensions/tpos/templates/tpos/index.html @@ -138,8 +138,9 @@ hide-dropdown-icon input-debounce="0" new-value-mode="add-unique" - label="Tip % Options" - > + label="Tip % Options (hit enter to add values)" + >Hit enter to add values

{% raw %}{{ famount }}{% endraw %}

-
+
{% raw %}{{ fsat }}{% endraw %} sat
@@ -174,8 +174,21 @@ > {% endraw %} +
+ Copy invoice Close
@@ -240,7 +253,7 @@ name="check" transition-show="fade" class="text-light-green" - style="font-size: 40em" + style="font-size: min(90vw, 40em)" >
@@ -281,6 +294,8 @@ exchangeRate: null, stack: [], tipAmount: 0.0, + hasNFC: false, + nfcTagReading: false, invoiceDialog: { show: false, data: null, @@ -356,7 +371,7 @@ this.showInvoice() }, submitForm: function () { - if (this.tip_options) { + if (this.tip_options && this.tip_options.length) { this.showTipModal() } else { this.showInvoice() @@ -399,9 +414,6 @@ dialog.show = false self.complete.show = true - setTimeout(function () { - self.complete.show = false - }, 5000) } }) }, 3000) @@ -410,6 +422,98 @@ LNbits.utils.notifyApiError(error) }) }, + readNfcTag: function () { + try { + const self = this + + if (typeof NDEFReader == 'undefined') { + throw { + toString: function () { + return 'NFC not supported on this device or browser.' + } + } + } + + const ndef = new NDEFReader() + + const readerAbortController = new AbortController() + readerAbortController.signal.onabort = event => { + console.log('All NFC Read operations have been aborted.') + } + + this.nfcTagReading = true + this.$q.notify({ + message: 'Tap your NFC tag to pay this invoice with LNURLw.' + }) + + return ndef.scan({signal: readerAbortController.signal}).then(() => { + ndef.onreadingerror = () => { + self.nfcTagReading = false + + this.$q.notify({ + type: 'negative', + message: 'There was an error reading this NFC tag.' + }) + + readerAbortController.abort() + } + + ndef.onreading = ({message}) => { + //Decode NDEF data from tag + const textDecoder = new TextDecoder('utf-8') + + const record = message.records.find(el => { + const payload = textDecoder.decode(el.data) + return payload.toUpperCase().indexOf('LNURL') !== -1 + }) + + const lnurl = textDecoder.decode(record.data) + + //User feedback, show loader icon + self.nfcTagReading = false + self.payInvoice(lnurl, readerAbortController) + + this.$q.notify({ + type: 'positive', + message: 'NFC tag read successfully.' + }) + } + }) + } catch (error) { + this.nfcTagReading = false + this.$q.notify({ + type: 'negative', + message: error + ? error.toString() + : 'An unexpected error has occurred.' + }) + } + }, + payInvoice: function (lnurl, readerAbortController) { + const self = this + + return axios + .post( + '/tpos/api/v1/tposs/' + + self.tposId + + '/invoices/' + + self.invoiceDialog.data.payment_request + + '/pay', + { + lnurl: lnurl + } + ) + .then(response => { + if (!response.data.success) { + this.$q.notify({ + type: 'negative', + message: response.data.detail + }) + } + + readerAbortController.abort() + }) + }, getRates: function () { var self = this axios.get('https://api.opennode.co/v1/rates').then(function (response) { diff --git a/lnbits/extensions/tpos/views_api.py b/lnbits/extensions/tpos/views_api.py index 9609956e..b7f14b98 100644 --- a/lnbits/extensions/tpos/views_api.py +++ b/lnbits/extensions/tpos/views_api.py @@ -1,7 +1,9 @@ from http import HTTPStatus +import httpx from fastapi import Query from fastapi.params import Depends +from lnurl import decode as decode_lnurl from loguru import logger from starlette.exceptions import HTTPException @@ -12,7 +14,7 @@ from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key from . import tpos_ext from .crud import create_tpos, delete_tpos, get_tpos, get_tposs -from .models import CreateTposData +from .models import CreateTposData, PayLnurlWData @tpos_ext.get("/api/v1/tposs", status_code=HTTPStatus.OK) @@ -79,6 +81,66 @@ async def api_tpos_create_invoice( return {"payment_hash": payment_hash, "payment_request": payment_request} +@tpos_ext.post( + "/api/v1/tposs/{tpos_id}/invoices/{payment_request}/pay", status_code=HTTPStatus.OK +) +async def api_tpos_pay_invoice( + lnurl_data: PayLnurlWData, payment_request: str = None, tpos_id: str = None +): + tpos = await get_tpos(tpos_id) + + if not tpos: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="TPoS does not exist." + ) + + lnurl = ( + lnurl_data.lnurl.replace("lnurlw://", "") + .replace("lightning://", "") + .replace("LIGHTNING://", "") + .replace("lightning:", "") + .replace("LIGHTNING:", "") + ) + + if lnurl.lower().startswith("lnurl"): + lnurl = decode_lnurl(lnurl) + else: + lnurl = "https://" + lnurl + + async with httpx.AsyncClient() as client: + try: + r = await client.get(lnurl, follow_redirects=True) + if r.is_error: + lnurl_response = {"success": False, "detail": "Error loading"} + else: + resp = r.json() + if resp["tag"] != "withdrawRequest": + lnurl_response = {"success": False, "detail": "Wrong tag type"} + else: + r2 = await client.get( + resp["callback"], + follow_redirects=True, + params={ + "k1": resp["k1"], + "pr": payment_request, + }, + ) + resp2 = r2.json() + if r2.is_error: + lnurl_response = { + "success": False, + "detail": "Error loading callback", + } + elif resp2["status"] == "ERROR": + lnurl_response = {"success": False, "detail": resp2["reason"]} + else: + lnurl_response = {"success": True, "detail": resp2} + except (httpx.ConnectError, httpx.RequestError): + lnurl_response = {"success": False, "detail": "Unexpected error occurred"} + + return lnurl_response + + @tpos_ext.get( "/api/v1/tposs/{tpos_id}/invoices/{payment_hash}", status_code=HTTPStatus.OK ) diff --git a/lnbits/extensions/watchonly/README.md b/lnbits/extensions/watchonly/README.md index be7bf351..45abdb93 100644 --- a/lnbits/extensions/watchonly/README.md +++ b/lnbits/extensions/watchonly/README.md @@ -6,17 +6,20 @@ Monitor an extended public key and generate deterministic fresh public keys with You can now use this wallet on the LNBits [SatsPayServer](https://github.com/lnbits/lnbits/blob/master/lnbits/extensions/satspay/README.md) extension +Video demo + ### Wallet Account - a user can add one or more `xPubs` or `descriptors` - - the `xPub` fingerprint must be unique per user + - the `xPub` must be unique per user - such and entry is called an `Wallet Account` - the addresses in a `Wallet Account` are split into `Receive Addresses` and `Change Address` - the user interacts directly only with the `Receive Addresses` (by sharing them) - see [BIP44](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account-discovery) for more details - same `xPub` will always generate the same addresses (deterministic) - when a `Wallet Account` is created, there are generated `20 Receive Addresses` and `5 Change Address` - - the limits can be change from the `Config` page (see `screenshot 1`) + - the limits can be change from the `Config` page (see `screenshot 1`) - regular wallets only scan up to `20` empty receive addresses. If the user generates addresses beyond this limit a warning is shown (see `screenshot 4`) + - an account can be added `From Hardware Device` ### Scan Blockchain - when the user clicks `Scan Blockchain`, the wallet will loop over the all addresses (for each account) @@ -48,33 +51,32 @@ You can now use this wallet on the LNBits [SatsPayServer](https://github.com/lnb - shows the UTXOs for all wallets - there can be multiple UTXOs for the same address -### Make Payment +### New Payment - create a new `Partially Signed Bitcoin Transaction` - multiple `Send Addresses` can be added - the `Max` button next to an address is for sending the remaining funds to this address (no change) - the user can select the inputs (UTXOs) manually, or it can use of the basic selection algorithms - amounts have to be provided for the `Send Addresses` beforehand (so the algorithm knows the amount to be selected) - - `Show Advanced` allows to (see `screenshot 2`): - - select from which account the change address will be selected (defaults to the first one) - - select the `Fee Rate` - - it defaults to the `Medium` value at the moment the `Make Payment` button was clicked - - it can be refreshed - - warnings are shown if the fee is too Low or to High + - `Show Change` allows to select from which account the change address will be selected (defaults to the first one) + - `Show Custom Fee` allows to manually select the fee + - it defaults to the `Medium` value at the moment the `New Payment` button was clicked + - it can be refreshed + - warnings are shown if the fee is too Low or to High -### Create PSBT - - based on the Inputs & Outputs selected by the user a PSBT will be generated - - this wallet is watch-only, therefore does not support signing - - it is not mandatory for the `Selected Amount` to be grater than `Payed Amount` - - the generated PSBT can be combined with other PSBTs that add more inputs. - - the generated PSBT can be imported for signing into different wallets like Electrum - - import the PSBT into Electrum and check the In/Outs/Fee (see `screenshot 3`) +### Check & Send + - creates the PSBT and sends it to the Hardware Wallet + - a confirmation will be shown for each Output and for the Fee + - after the user confirms the addresses and amounts, the transaction will be signed on the Hardware Device + +### Share PSBT + - Show the PSBT without sending it to the Hardware Wallet ## Screensots - screenshot 1: ![image](https://user-images.githubusercontent.com/2951406/177181611-eeeac70c-c245-4b45-b80b-8bbb511f6d1d.png) - screenshot 2: -![image](https://user-images.githubusercontent.com/2951406/177331468-f9b43626-548a-4608-b0d0-44007f402404.png) +![image](https://user-images.githubusercontent.com/2951406/183087898-b91f5243-8ed9-4a14-9e57-7bb4f1fd43ef.png) - screenshot 3: ![image](https://user-images.githubusercontent.com/2951406/177333755-4a9118fb-3eaf-43d6-bc7e-c3d8c80bc61e.png) diff --git a/lnbits/extensions/watchonly/crud.py b/lnbits/extensions/watchonly/crud.py index b88a7df7..de338b91 100644 --- a/lnbits/extensions/watchonly/crud.py +++ b/lnbits/extensions/watchonly/crud.py @@ -4,8 +4,8 @@ from typing import List, Optional from lnbits.helpers import urlsafe_short_hash from . import db -from .helpers import derive_address, parse_key -from .models import Address, Config, Mempool, WalletAccount +from .helpers import derive_address +from .models import Address, Config, WalletAccount ##########################WALLETS#################### @@ -22,9 +22,11 @@ async def create_watch_wallet(w: WalletAccount) -> WalletAccount: title, type, address_no, - balance + balance, + network, + meta ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, ( wallet_id, @@ -35,6 +37,8 @@ async def create_watch_wallet(w: WalletAccount) -> WalletAccount: w.type, w.address_no, w.balance, + w.network, + w.meta, ), ) @@ -48,9 +52,10 @@ async def get_watch_wallet(wallet_id: str) -> Optional[WalletAccount]: return WalletAccount.from_row(row) if row else None -async def get_watch_wallets(user: str) -> List[WalletAccount]: +async def get_watch_wallets(user: str, network: str) -> List[WalletAccount]: rows = await db.fetchall( - """SELECT * FROM watchonly.wallets WHERE "user" = ?""", (user,) + """SELECT * FROM watchonly.wallets WHERE "user" = ? AND network = ?""", + (user, network), ) return [WalletAccount(**row) for row in rows] @@ -238,41 +243,3 @@ async def get_config(user: str) -> Optional[Config]: """SELECT json_data FROM watchonly.config WHERE "user" = ?""", (user,) ) return json.loads(row[0], object_hook=lambda d: Config(**d)) if row else None - - -######################MEMPOOL####################### -### TODO: fix statspay dependcy and remove -async def create_mempool(user: str) -> Optional[Mempool]: - await db.execute( - """ - INSERT INTO watchonly.mempool ("user",endpoint) - VALUES (?, ?) - """, - (user, "https://mempool.space"), - ) - row = await db.fetchone( - """SELECT * FROM watchonly.mempool WHERE "user" = ?""", (user,) - ) - return Mempool.from_row(row) if row else None - - -### TODO: fix statspay dependcy and remove -async def update_mempool(user: str, **kwargs) -> Optional[Mempool]: - q = ", ".join([f"{field[0]} = ?" for field in kwargs.items()]) - - await db.execute( - f"""UPDATE watchonly.mempool SET {q} WHERE "user" = ?""", - (*kwargs.values(), user), - ) - row = await db.fetchone( - """SELECT * FROM watchonly.mempool WHERE "user" = ?""", (user,) - ) - return Mempool.from_row(row) if row else None - - -### TODO: fix statspay dependcy and remove -async def get_mempool(user: str) -> Mempool: - row = await db.fetchone( - """SELECT * FROM watchonly.mempool WHERE "user" = ?""", (user,) - ) - return Mempool.from_row(row) if row else None diff --git a/lnbits/extensions/watchonly/migrations.py b/lnbits/extensions/watchonly/migrations.py index 8e371a2a..76f7f951 100644 --- a/lnbits/extensions/watchonly/migrations.py +++ b/lnbits/extensions/watchonly/migrations.py @@ -77,7 +77,26 @@ async def m004_create_config_table(db): );""" ) - ### TODO: fix statspay dependcy first - # await db.execute( - # "DROP TABLE watchonly.wallets;" - # ) + +async def m005_add_network_column_to_wallets(db): + """ + Add network' column to the 'wallets' table + """ + + await db.execute( + "ALTER TABLE watchonly.wallets ADD COLUMN network TEXT DEFAULT 'Mainnet';" + ) + + +async def m006_drop_mempool_table(db): + """ + Mempool data is now part of `config` + """ + await db.execute("DROP TABLE watchonly.mempool;") + + +async def m007_add_wallet_meta_data(db): + """ + Add 'meta' for storing various metadata about the wallet + """ + await db.execute("ALTER TABLE watchonly.wallets ADD COLUMN meta TEXT DEFAULT '{}';") diff --git a/lnbits/extensions/watchonly/models.py b/lnbits/extensions/watchonly/models.py index bc10e421..cedaa210 100644 --- a/lnbits/extensions/watchonly/models.py +++ b/lnbits/extensions/watchonly/models.py @@ -1,5 +1,5 @@ from sqlite3 import Row -from typing import List +from typing import List, Optional from fastapi.param_functions import Query from pydantic import BaseModel @@ -8,6 +8,8 @@ from pydantic import BaseModel class CreateWallet(BaseModel): masterpub: str = Query("") title: str = Query("") + network: str = "Mainnet" + meta: str = "{}" class WalletAccount(BaseModel): @@ -18,23 +20,15 @@ class WalletAccount(BaseModel): title: str address_no: int balance: int - type: str = "" + type: Optional[str] = "" + network: str = "Mainnet" + meta: str = "{}" @classmethod def from_row(cls, row: Row) -> "WalletAccount": return cls(**dict(row)) -### TODO: fix statspay dependcy and remove -class Mempool(BaseModel): - user: str - endpoint: str - - @classmethod - def from_row(cls, row: Row) -> "Mempool": - return cls(**dict(row)) - - class Address(BaseModel): id: str address: str @@ -57,7 +51,7 @@ class TransactionInput(BaseModel): address: str branch_index: int address_index: int - masterpub_fingerprint: str + wallet: str tx_hex: str @@ -66,10 +60,11 @@ class TransactionOutput(BaseModel): address: str branch_index: int = None address_index: int = None - masterpub_fingerprint: str = None + wallet: str = None class MasterPublicKey(BaseModel): + id: str public_key: str fingerprint: str @@ -82,8 +77,23 @@ class CreatePsbt(BaseModel): tx_size: int +class ExtractPsbt(BaseModel): + psbtBase64 = "" # // todo snake case + inputs: List[TransactionInput] + + +class SignedTransaction(BaseModel): + tx_hex: Optional[str] + tx_json: Optional[str] + + +class BroadcastTransaction(BaseModel): + tx_hex: str + + class Config(BaseModel): mempool_endpoint = "https://mempool.space" receive_gap_limit = 20 change_gap_limit = 5 sats_denominated = True + network = "Mainnet" diff --git a/lnbits/extensions/watchonly/static/components/address-list/address-list.html b/lnbits/extensions/watchonly/static/components/address-list/address-list.html new file mode 100644 index 00000000..8db6e4d0 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/address-list/address-list.html @@ -0,0 +1,214 @@ +
+
+
+ +
+
+ +
+
+ + + +
+
+ + + +
diff --git a/lnbits/extensions/watchonly/static/components/address-list/address-list.js b/lnbits/extensions/watchonly/static/components/address-list/address-list.js new file mode 100644 index 00000000..61545df0 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/address-list/address-list.js @@ -0,0 +1,131 @@ +async function addressList(path) { + const template = await loadTemplateAsync(path) + Vue.component('address-list', { + name: 'address-list', + template, + + props: [ + 'addresses', + 'accounts', + 'mempool-endpoint', + 'inkey', + 'sats-denominated' + ], + data: function () { + return { + show: false, + history: [], + selectedWallet: null, + note: '', + filterOptions: [ + 'Show Change Addresses', + 'Show Gap Addresses', + 'Only With Amount' + ], + filterValues: [], + + addressesTable: { + columns: [ + { + name: 'expand', + align: 'left', + label: '' + }, + { + name: 'address', + align: 'left', + label: 'Address', + field: 'address', + sortable: true + }, + { + name: 'amount', + align: 'left', + label: 'Amount', + field: 'amount', + sortable: true + }, + { + name: 'note', + align: 'left', + label: 'Note', + field: 'note', + sortable: true + }, + { + name: 'wallet', + align: 'left', + label: 'Account', + field: 'wallet', + sortable: true + } + ], + pagination: { + rowsPerPage: 0, + sortBy: 'amount', + descending: true + }, + filter: '' + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + // todo: bad. base.js not present in custom components + copyText: function (text, message, position) { + var notify = this.$q.notify + Quasar.utils.copyToClipboard(text).then(function () { + notify({ + message: message || 'Copied to clipboard!', + position: position || 'bottom' + }) + }) + }, + getWalletName: function (walletId) { + const wallet = (this.accounts || []).find(wl => wl.id === walletId) + return wallet ? wallet.title : 'unknown' + }, + getFilteredAddresses: function () { + const selectedWalletId = this.selectedWallet?.id + const filter = this.filterValues || [] + const includeChangeAddrs = filter.includes('Show Change Addresses') + const includeGapAddrs = filter.includes('Show Gap Addresses') + const excludeNoAmount = filter.includes('Only With Amount') + + const walletsLimit = (this.accounts || []).reduce((r, w) => { + r[`_${w.id}`] = w.address_no + return r + }, {}) + + const fAddresses = this.addresses.filter( + a => + (includeChangeAddrs || !a.isChange) && + (includeGapAddrs || + a.isChange || + a.addressIndex <= walletsLimit[`_${a.wallet}`]) && + !(excludeNoAmount && a.amount === 0) && + (!selectedWalletId || a.wallet === selectedWalletId) + ) + return fAddresses + }, + + scanAddress: async function (addressData) { + this.$emit('scan:address', addressData) + }, + showAddressDetails: function (addressData) { + this.$emit('show-address-details', addressData) + }, + searchInTab: function (tab, value) { + this.$emit('search:tab', {tab, value}) + }, + updateNoteForAddress: async function (addressData, note) { + this.$emit('update:note', {addressId: addressData.id, note}) + } + }, + + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.html b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.html new file mode 100644 index 00000000..c65ad1c4 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.html @@ -0,0 +1,61 @@ +
+
+
Fee Rate:
+
+ +
+
+ +
+
+
+
+
+ + Warning! The fee is too low. The transaction might take a long time to + confirm. + + + Warning! The fee is too high. You might be overpaying for this + transaction. + +
+
+ +
+
Fee:
+
{{feeValue}} sats
+
+ Refresh Fee Rates +
+
+
diff --git a/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js new file mode 100644 index 00000000..7a920a9a --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/fee-rate/fee-rate.js @@ -0,0 +1,64 @@ +async function feeRate(path) { + const template = await loadTemplateAsync(path) + Vue.component('fee-rate', { + name: 'fee-rate', + template, + + props: ['rate', 'fee-value', 'sats-denominated', 'mempool-endpoint'], + + computed: { + feeRate: { + get: function () { + return this['rate'] + }, + set: function (value) { + this.$emit('update:rate', +value) + } + } + }, + + data: function () { + return { + recommededFees: { + fastestFee: 1, + halfHourFee: 1, + hourFee: 1, + economyFee: 1, + minimumFee: 1 + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + + refreshRecommendedFees: async function () { + const fn = async () => { + const { + bitcoin: {fees: feesAPI} + } = mempoolJS({ + hostname: this.mempoolEndpoint + }) + return feesAPI.getFeesRecommended() + } + this.recommededFees = await retryWithDelay(fn) + }, + getFeeRateLabel: function (feeRate) { + const fees = this.recommededFees + if (feeRate >= fees.fastestFee) + return `High Priority (${feeRate} sat/vB)` + if (feeRate >= fees.halfHourFee) + return `Medium Priority (${feeRate} sat/vB)` + if (feeRate >= fees.hourFee) return `Low Priority (${feeRate} sat/vB)` + return `No Priority (${feeRate} sat/vB)` + } + }, + + created: async function () { + await this.refreshRecommendedFees() + this.feeRate = this.recommededFees.halfHourFee + } + }) +} diff --git a/lnbits/extensions/watchonly/static/components/history/history.html b/lnbits/extensions/watchonly/static/components/history/history.html new file mode 100644 index 00000000..ac805dfa --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/history/history.html @@ -0,0 +1,144 @@ +
+
+
+
+ + + +
+
+ + + + + Export to CSV + + + + +
+
+ + + +
diff --git a/lnbits/extensions/watchonly/static/components/history/history.js b/lnbits/extensions/watchonly/static/components/history/history.js new file mode 100644 index 00000000..81cf44cc --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/history/history.js @@ -0,0 +1,98 @@ +async function history(path) { + const template = await loadTemplateAsync(path) + Vue.component('history', { + name: 'history', + template, + + props: ['history', 'mempool-endpoint', 'sats-denominated', 'filter'], + data: function () { + return { + historyTable: { + columns: [ + { + name: 'expand', + align: 'left', + label: '' + }, + { + name: 'status', + align: 'left', + label: 'Status' + }, + { + name: 'amount', + align: 'left', + label: 'Amount', + field: 'amount', + sortable: true + }, + { + name: 'address', + align: 'left', + label: 'Address', + field: 'address', + sortable: true + }, + { + name: 'date', + align: 'left', + label: 'Date', + field: 'date', + sortable: true + }, + { + name: 'txId', + field: 'txId' + } + ], + exportColums: [ + { + label: 'Action', + field: 'action' + }, + { + label: 'Date&Time', + field: 'date' + }, + { + label: 'Amount', + field: 'amount' + }, + { + label: 'Fee', + field: 'fee' + }, + { + label: 'Transaction Id', + field: 'txId' + } + ], + pagination: { + rowsPerPage: 0 + } + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + getFilteredAddressesHistory: function () { + return this.history.filter(a => (!a.isChange || a.sent) && !a.isSubItem) + }, + exportHistoryToCSV: function () { + const history = this.getFilteredAddressesHistory().map(a => ({ + ...a, + action: a.sent ? 'Sent' : 'Received' + })) + LNbits.utils.exportCSV( + this.historyTable.exportColums, + history, + 'address-history' + ) + } + }, + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.html b/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.html new file mode 100644 index 00000000..83af1248 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.html @@ -0,0 +1,5 @@ +
+
+
{{ title }}
+ XXX +
diff --git a/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.js b/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.js new file mode 100644 index 00000000..3d22c3a0 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/my-checkbox/my-checkbox.js @@ -0,0 +1,16 @@ +async function initMyCheckbox(path) { + const t = await loadTemplateAsync(path) + Vue.component('my-checkbox', { + name: 'my-checkbox', + template: t, + data() { + return {checked: false, title: 'Check me'} + }, + methods: { + check() { + this.checked = !this.checked + console.log('### checked', this.checked) + } + } + }) +} diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.html b/lnbits/extensions/watchonly/static/components/payment/payment.html new file mode 100644 index 00000000..cde65ca2 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/payment/payment.html @@ -0,0 +1,312 @@ +
+ + + + + + + + + +
+
+ +
+ +
+
+ Fee Rate: + + {{feeRate}} sats/vbyte + Fee: + {{satBtc(feeValue)}} +
+
+
+ +
+
+ + +
+
+
+
+ + + +
+
+ +
+ +
+
+ Balance: + {{satBtc(balance)}} + Selected: + + {{satBtc(selectedAmount)}} + +
+
+
+ +
+
+ + +
+
+
+
+ + + +
+
+ +
+ +
+ + Below dust limit. Will be used as fee. + +
+
+
+ Change: + + {{satBtc(0)}} + + + {{satBtc(changeAmount)}} + +
+
+
+ +
+
+ +
+
Change Account:
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+ + + + + Serial Port + + Sign using a Serial Port device + + + + + Share PSBT + Share the PSBT as text or Animated QR Code + + + + +
+ +
+ + + The payed amount is higher than the selected amount! + +
+
+
+ + + + +
+ Close +
+
+
+ + + +
+
+ Transaction Details +
+
+ +
+
+
+
Version
+
{{signedTx.version}}
+
+
+
Locktime
+
{{signedTx.locktime}}
+
+
+
Fee
+
+ {{satBtc(signedTx.fee)}} +
+
+ + Outputs + +
+
+ {{satBtc(out.amount)}} +
+ +
+ {{out.address}} +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+ Send + Close +
+
+
+
diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.js b/lnbits/extensions/watchonly/static/components/payment/payment.js new file mode 100644 index 00000000..f2cccbba --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/payment/payment.js @@ -0,0 +1,357 @@ +async function payment(path) { + const t = await loadTemplateAsync(path) + Vue.component('payment', { + name: 'payment', + template: t, + + props: [ + 'accounts', + 'addresses', + 'utxos', + 'mempool-endpoint', + 'sats-denominated', + 'serial-signer-ref', + 'adminkey' + ], + watch: { + immediate: true, + accounts() { + this.updateChangeAddress() + }, + addresses() { + this.updateChangeAddress() + } + }, + + data: function () { + return { + DUST_LIMIT: 546, + tx: null, + psbtBase64: null, + psbtBase64Signed: null, + signedTx: null, + signedTxHex: null, + sentTxId: null, + signedTxId: null, + sendToList: [{address: '', amount: undefined}], + changeWallet: null, + changeAddress: {}, + showCustomFee: false, + showCoinSelect: false, + showChecking: false, + showChange: false, + showPsbt: false, + showFinalTx: false, + feeRate: 1 + } + }, + + computed: { + txSize: function () { + const tx = this.createTx() + return Math.round(txSize(tx)) + }, + txSizeNoChange: function () { + const tx = this.createTx(true) + return Math.round(txSize(tx)) + }, + feeValue: function () { + return this.feeRate * this.txSize + }, + selectedAmount: function () { + return this.utxos + .filter(utxo => utxo.selected) + .reduce((t, a) => t + (a.amount || 0), 0) + }, + changeAmount: function () { + return ( + this.selectedAmount - + this.totalPayedAmount - + this.feeRate * this.txSize + ) + }, + balance: function () { + return this.utxos.reduce((t, a) => t + (a.amount || 0), 0) + }, + totalPayedAmount: function () { + return this.sendToList.reduce((t, a) => t + (a.amount || 0), 0) + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + clearState: function () { + this.psbtBase64 = null + this.psbtBase64Signed = null + this.signedTx = null + this.signedTxHex = null + this.signedTxId = null + this.sendToList = [{address: '', amount: undefined}] + this.showChecking = false + this.showPsbt = false + this.showFinalTx = false + }, + checkAndSend: async function () { + this.showChecking = true + try { + if (!this.serialSignerRef.isConnected()) { + this.$q.notify({ + type: 'warning', + message: 'Please connect to a Signing device first!', + timeout: 10000 + }) + return + } + const p2trUtxo = this.utxos.find( + u => u.selected && u.accountType === 'p2tr' + ) + if (p2trUtxo) { + this.$q.notify({ + type: 'warning', + message: 'Taproot Signing not supported yet!', + caption: 'Please manually deselect the Taproot UTXOs', + timeout: 10000 + }) + return + } + if (!this.serialSignerRef.isAuthenticated()) { + await this.serialSignerRef.hwwShowPasswordDialog() + const authenticated = await this.serialSignerRef.isAuthenticating() + if (!authenticated) return + } + + await this.createPsbt() + + if (this.psbtBase64) { + const txData = { + outputs: this.tx.outputs, + feeRate: this.tx.fee_rate, + feeValue: this.feeValue + } + await this.serialSignerRef.hwwSendPsbt(this.psbtBase64, txData) + await this.serialSignerRef.isSendingPsbt() + } + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot check and sign PSBT!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.showChecking = false + this.psbtBase64 = null + } + }, + showPsbtDialog: async function () { + try { + const valid = await this.$refs.paymentFormRef.validate() + if (!valid) return + + const data = await this.createPsbt() + if (data) { + this.showPsbt = true + } + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to create PSBT!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + createPsbt: async function () { + try { + this.tx = this.createTx() + for (const input of this.tx.inputs) { + input.tx_hex = await this.fetchTxHex(input.tx_id) + } + + const changeOutput = this.tx.outputs.find(o => o.branch_index === 1) + if (changeOutput) changeOutput.amount = this.changeAmount + + const {data} = await LNbits.api.request( + 'POST', + '/watchonly/api/v1/psbt', + this.adminkey, + this.tx + ) + + this.psbtBase64 = data + return data + } catch (err) { + LNbits.utils.notifyApiError(err) + } + }, + createTx: function (excludeChange = false) { + const tx = { + fee_rate: this.feeRate, + masterpubs: this.accounts.map(w => ({ + id: w.id, + public_key: w.masterpub, + fingerprint: w.fingerprint + })) + } + tx.inputs = this.utxos + .filter(utxo => utxo.selected) + .map(mapUtxoToPsbtInput) + .sort((a, b) => + a.tx_id < b.tx_id ? -1 : a.tx_id > b.tx_id ? 1 : a.vout - b.vout + ) + + tx.outputs = this.sendToList.map(out => ({ + address: out.address, + amount: out.amount + })) + + if (!excludeChange) { + const change = this.createChangeOutput() + const diffAmount = this.selectedAmount - this.totalPayedAmount + if (diffAmount >= this.DUST_LIMIT) { + tx.outputs.push(change) + } + } + tx.tx_size = Math.round(txSize(tx)) + tx.inputs = _.shuffle(tx.inputs) + tx.outputs = _.shuffle(tx.outputs) + + return tx + }, + createChangeOutput: function () { + const change = this.changeAddress + const walletAcount = + this.accounts.find(w => w.id === change.wallet) || {} + + return { + address: change.address, + address_index: change.addressIndex, + branch_index: change.isChange ? 1 : 0, + wallet: walletAcount.id + } + }, + selectChangeAddress: function (account) { + if (!account) this.changeAddress = '' + this.changeAddress = + this.addresses.find( + a => a.wallet === account.id && a.isChange && !a.hasActivity + ) || {} + }, + updateChangeAddress: function () { + if (this.changeWallet) { + const changeAccount = (this.accounts || []).find( + w => w.id === this.changeWallet.id + ) + // change account deleted + if (!changeAccount) { + this.changeWallet = this.accounts[0] + } + } else { + this.changeWallet = this.accounts[0] + } + this.selectChangeAddress(this.changeWallet) + }, + updateSignedPsbt: async function (psbtBase64) { + try { + this.showChecking = true + this.psbtBase64Signed = psbtBase64 + + const data = await this.extractTxFromPsbt(psbtBase64) + this.showFinalTx = true + if (data) { + this.signedTx = JSON.parse(data.tx_json) + this.signedTxHex = data.tx_hex + } else { + this.signedTx = null + this.signedTxHex = null + } + } finally { + this.showChecking = false + } + }, + extractTxFromPsbt: async function (psbtBase64) { + try { + const {data} = await LNbits.api.request( + 'PUT', + '/watchonly/api/v1/psbt/extract', + this.adminkey, + { + psbtBase64, + inputs: this.tx.inputs + } + ) + return data + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot finalize PSBT!', + caption: `${error}`, + timeout: 10000 + }) + LNbits.utils.notifyApiError(error) + } + }, + broadcastTransaction: async function () { + try { + const {data} = await LNbits.api.request( + 'POST', + '/watchonly/api/v1/tx', + this.adminkey, + {tx_hex: this.signedTxHex} + ) + this.sentTxId = data + + this.$q.notify({ + type: 'positive', + message: 'Transaction broadcasted!', + caption: `${data}`, + timeout: 10000 + }) + + this.clearState() + this.$emit('broadcast-done', this.sentTxId) + } catch (error) { + this.sentTxId = null + this.$q.notify({ + type: 'warning', + message: 'Failed to broadcast!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.showFinalTx = false + } + }, + fetchTxHex: async function (txId) { + const { + bitcoin: {transactions: transactionsAPI} + } = mempoolJS({ + hostname: this.mempoolEndpoint + }) + + try { + const response = await transactionsAPI.getTxHex({txid: txId}) + return response + } catch (error) { + this.$q.notify({ + type: 'warning', + message: `Failed to fetch transaction details for tx id: '${txId}'`, + timeout: 10000 + }) + LNbits.utils.notifyApiError(error) + throw error + } + }, + handleOutputsChange: function () { + this.$refs.utxoList.refreshUtxoSelection(this.totalPayedAmount) + }, + getTotalPaymentAmount: function () { + return this.sendToList.reduce((t, a) => t + (a.amount || 0), 0) + } + }, + + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/seed-input/seed-input.html b/lnbits/extensions/watchonly/static/components/seed-input/seed-input.html new file mode 100644 index 00000000..60cdaaa8 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/seed-input/seed-input.html @@ -0,0 +1,80 @@ +
+
+
+
Seed Input Done
+
+
+
+
+
Word Count
+
+ +
+
+
+
+
+
Enter word at position: {{actualPosition}}
+
+
+
+
+ Previous +
+
+ +
+ +
+ Next + Done +
+ +
+
+
diff --git a/lnbits/extensions/watchonly/static/components/seed-input/seed-input.js b/lnbits/extensions/watchonly/static/components/seed-input/seed-input.js new file mode 100644 index 00000000..5e415abb --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/seed-input/seed-input.js @@ -0,0 +1,102 @@ +async function seedInput(path) { + const template = await loadTemplateAsync(path) + Vue.component('seed-input', { + name: 'seed-input', + template, + + computed: { + actualPosition: function () { + return this.words[this.currentPosition].position + } + }, + + data: function () { + return { + wordCountOptions: ['12', '15', '18', '21', '24'], + wordCount: 24, + words: [], + currentPosition: 0, + stringOptions: [], + options: [], + currentWord: '', + done: false + } + }, + + methods: { + filterFn(val, update, abort) { + update(() => { + const needle = val.toLocaleLowerCase() + this.options = this.stringOptions + .filter(v => v.toLocaleLowerCase().indexOf(needle) != -1) + .sort((a, b) => { + if (a.startsWith(needle)) { + if (b.startsWith(needle)) { + return a - b + } + return -1 + } else { + if (b.startsWith(needle)) { + return 1 + } + return a - b + } + }) + }) + }, + initWords() { + const words = [] + for (let i = 1; i <= this.wordCount; i++) { + words.push({ + position: i, + value: '' + }) + } + this.currentPosition = 0 + this.words = _.shuffle(words) + }, + setModel(val) { + this.currentWord = val + this.words[this.currentPosition].value = this.currentWord + }, + nextPosition() { + if (this.currentPosition < this.wordCount - 1) { + this.currentPosition++ + } + this.currentWord = this.words[this.currentPosition].value + }, + previousPosition() { + if (this.currentPosition > 0) { + this.currentPosition-- + } + this.currentWord = this.words[this.currentPosition].value + }, + seedInputDone() { + const badWordPositions = this.words + .filter(w => !w.value || !this.stringOptions.includes(w.value)) + .map(w => w.position) + if (badWordPositions.length) { + this.$q.notify({ + timeout: 10000, + type: 'warning', + message: + 'The seed has incorrect words. Please check at these positions: ', + caption: 'Position: ' + badWordPositions.join(', ') + }) + return + } + const mnemonic = this.words + .sort((a, b) => a.position - b.position) + .map(w => w.value) + .join(' ') + this.$emit('on-seed-input-done', mnemonic) + this.done = true + } + }, + + created: async function () { + this.stringOptions = bip39WordList + this.initWords() + } + }) +} diff --git a/lnbits/extensions/watchonly/static/components/send-to/send-to.html b/lnbits/extensions/watchonly/static/components/send-to/send-to.html new file mode 100644 index 00000000..c16ebf95 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/send-to/send-to.html @@ -0,0 +1,77 @@ +
+
+ + + +
+
+ Add +
+
+
+ Payed Amount: + + {{satBtc(getTotalPaymentAmount())}} + +
+
+
+
+
diff --git a/lnbits/extensions/watchonly/static/components/send-to/send-to.js b/lnbits/extensions/watchonly/static/components/send-to/send-to.js new file mode 100644 index 00000000..2b93cea7 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/send-to/send-to.js @@ -0,0 +1,81 @@ +async function sendTo(path) { + const template = await loadTemplateAsync(path) + Vue.component('send-to', { + name: 'send-to', + template, + + props: [ + 'data', + 'tx-size', + 'selected-amount', + 'fee-rate', + 'sats-denominated' + ], + + computed: { + dataLocal: { + get: function () { + return this.data + }, + set: function (value) { + console.log('### computed update data', value) + this.$emit('update:data', value) + } + } + }, + + data: function () { + return { + DUST_LIMIT: 546, + paymentTable: { + columns: [ + { + name: 'data', + align: 'left' + } + ], + pagination: { + rowsPerPage: 10 + }, + filter: '' + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + addPaymentAddress: function () { + this.dataLocal.push({address: '', amount: undefined}) + this.handleOutputsChange() + }, + deletePaymentAddress: function (v) { + const index = this.dataLocal.indexOf(v) + if (index !== -1) { + this.dataLocal.splice(index, 1) + } + this.handleOutputsChange() + }, + + sendMaxToAddress: function (paymentAddress = {}) { + const feeValue = this.feeRate * this.txSize + const inputAmount = this.selectedAmount + const currentAmount = Math.max(0, paymentAddress.amount || 0) + const payedAmount = this.getTotalPaymentAmount() - currentAmount + paymentAddress.amount = Math.max( + 0, + inputAmount - payedAmount - feeValue + ) + }, + handleOutputsChange: function () { + this.$emit('update:outputs') + }, + getTotalPaymentAmount: function () { + return this.dataLocal.reduce((t, a) => t + (a.amount || 0), 0) + } + }, + + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.html b/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.html new file mode 100644 index 00000000..18e52058 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.html @@ -0,0 +1,100 @@ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+
+
+ +
+
+
diff --git a/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.js b/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.js new file mode 100644 index 00000000..87b54e38 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/serial-port-config/serial-port-config.js @@ -0,0 +1,12 @@ +async function serialPortConfig(path) { + const t = await loadTemplateAsync(path) + Vue.component('serial-port-config', { + name: 'serial-port-config', + props: ['config'], + template: t, + data() { + return {} + }, + methods: {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html new file mode 100644 index 00000000..2ed2d49c --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.html @@ -0,0 +1,544 @@ +
+ + + + + Login + Enter password for Hardware Wallet. + + + + + + Logout + Clear password for HWW. + + + + + Config & Connect + Set the Serial Port communication parameters. + + + + + Paired Device ({{device.config.name || 'no-name'}}) + + {{device.id}} + + + Forget + + + + + + Disconnect + Disconnect from Serial Port. + + + + + + Restore + Restore wallet from existing word list. + + + + + Show Seed + Show seed on the Hardware Wallet display. + + + + + Wipe + Clean-up the wallet. New random seed. + + + + + Help + View available comands. + + + + + Console + Show the serial port communication messages + + + + + + + + + Enter Config + + +
+ Connect + Cancel +
+
+
+
+ + + + + Enter password for Hardware Wallet (8 numbers/letters) + + + + + + + +
+ +
+ Login + Cancel +
+
+
+
+ + + + +
+
+
+ Output {{hww.confirm.outputIndex}} + + change + +
+
+
+
+ Address: +
+
+ {{tx.outputs[hww.confirm.outputIndex].address}} +
+
+
+
+ Amount: +
+
+ {{satBtc(tx.outputs[hww.confirm.outputIndex].amount)}} +
+
+
+
+ Fee: +
+
+ {{satBtc(tx.feeValue)}} +
+
+
+
+ Fee Rate: +
+
+ {{tx.feeRate}} sats/vbyte +
+
+
+
+
+ + Confirm then check the Hardware Device. + +
+
+
+
+ + + +
+
+ + +
+
+ Cancel +
+
+
+
+
+ + + + + + This action will remove all data from the Hardware Wallet. Please + create a back-up for the seed! + + Enter new password for Hardware Wallet (8 numbers/letters) + + + + + This action cannot be reversed! + + +
+ Wipe + Cancel +
+
+
+
+ + + + + +
+ Close +
+
+
+ + + +
+
+ + Open the browser Developer Console for more Details! + +
+
+ + +
+ Close +
+
+
+ + + + Check word at position {{hww.seedWordPosition}} on device +
+
+ +
+
+
+
+ +
+
+ +
+
+ Prev +
+
+ Next +
+
+ Close +
+
+
+
+ + + + + + For test purposes only. Do not enter word list with real funds!!! + +
+ +
+ +
+ + + +
+ + +
+ +
+ Enter new password (8 numbers/letters) + + + + + +
+ + + ALL existing data on the Hardware Device will be lost. + + +
+ Restore + Cancel +
+
+
+
+
diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js new file mode 100644 index 00000000..33d07d94 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -0,0 +1,974 @@ +async function serialSigner(path) { + const t = await loadTemplateAsync(path) + Vue.component('serial-signer', { + name: 'serial-signer', + template: t, + + props: ['sats-denominated', 'network'], + data: function () { + return { + selectedPort: null, + writableStreamClosed: null, + writer: null, + readableStreamClosed: null, + reader: null, + receivedData: '', + config: {}, + decryptionKey: null, + sharedSecret: null, // todo: store in secure local storage + + hww: { + password: null, + showPassword: false, + mnemonic: null, + showMnemonic: false, + quickMnemonicInput: false, + passphrase: null, + showPassphrase: false, + hasPassphrase: false, + authenticated: false, + showPasswordDialog: false, + showConfigDialog: false, + showWipeDialog: false, + showRestoreDialog: false, + showConfirmationDialog: false, + showSignedPsbt: false, + sendingPsbt: false, + signingPsbt: false, + loginResolve: null, + psbtSentResolve: null, + xpubResolve: null, + seedWordPosition: 1, + seedWord: null, + showSeedWord: false, + showSeedDialog: false, + // config: null, + + confirm: { + outputIndex: 0, + showFee: false + } + }, + tx: null, // todo: move to hww + + showConsole: false + } + }, + + computed: { + pairedDevices: { + get: function () { + return ( + JSON.parse(window.localStorage.getItem('lnbits-paired-devices')) || + [] + ) + }, + set: function (devices) { + window.localStorage.setItem( + 'lnbits-paired-devices', + JSON.stringify(devices) + ) + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + openSerialPortDialog: async function () { + this.config = {...HWW_DEFAULT_CONFIG} + await this.openSerialPort(this.config) + }, + openSerialPort: async function (config = {baudRate: 9600}) { + if (!this.checkSerialPortSupported()) return false + if (this.selectedPort) { + this.$q.notify({ + type: 'warning', + message: 'Already connected. Disconnect first!', + timeout: 10000 + }) + return true + } + + try { + this.selectedPort = await navigator.serial.requestPort() + this.selectedPort.addEventListener('connect', event => { + // do nothing + }) + + this.selectedPort.addEventListener('disconnect', () => { + this.selectedPort = null + this.hww.authenticated = false + this.$q.notify({ + type: 'warning', + message: 'Disconnected from Serial Port!', + timeout: 10000 + }) + }) + + // Wait for the serial port to open. + await this.selectedPort.open(config) + this.startSerialPortReading() + + const textEncoder = new TextEncoderStream() + this.writableStreamClosed = textEncoder.readable.pipeTo( + this.selectedPort.writable + ) + + this.writer = textEncoder.writable.getWriter() + + await this.hwwPing() + + return true + } catch (error) { + this.selectedPort = null + this.$q.notify({ + type: 'warning', + message: 'Cannot open serial port!', + caption: `${error}`, + timeout: 10000 + }) + return false + } + }, + openSerialPortConfig: async function (deviceId) { + const device = this.getPairedDevice(deviceId) + if (device) { + this.config = device.config + } else { + this.config = {...HWW_DEFAULT_CONFIG} + } + this.hww.showConfigDialog = true + }, + closeSerialPort: async function () { + try { + if (this.writer) this.writer.close() + if (this.writableStreamClosed) await this.writableStreamClosed + if (this.reader) this.reader.cancel() + if (this.readableStreamClosed) + await this.readableStreamClosed.catch(() => { + /* Ignore the error */ + }) + if (this.selectedPort) await this.selectedPort.close() + this.$q.notify({ + type: 'positive', + message: 'Serial port disconnected!', + timeout: 5000 + }) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot close serial port!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.selectedPort = null + this.hww.authenticated = false + } + }, + + isConnected: function () { + return !!this.selectedPort + }, + isAuthenticated: function () { + return this.hww.authenticated + }, + + seedInputDone: function (mnemonic) { + this.hww.mnemonic = mnemonic + }, + isAuthenticating: function () { + if (this.isAuthenticated()) return false + return new Promise(resolve => { + this.loginResolve = resolve + }) + }, + + isSendingPsbt: async function () { + if (!this.hww.sendingPsbt) return false + return new Promise(resolve => { + this.psbtSentResolve = resolve + }) + }, + + isFetchingXpub: async function () { + return new Promise(resolve => { + this.xpubResolve = resolve + }) + }, + + checkSerialPortSupported: function () { + if (!navigator.serial) { + this.$q.notify({ + type: 'warning', + message: 'Serial port communication not supported!', + caption: + 'Make sure your browser supports Serial Port and that you are using HTTPS.', + timeout: 10000 + }) + return false + } + return true + }, + startSerialPortReading: async function () { + const port = this.selectedPort + + while (port && port.readable) { + const textDecoder = new TextDecoderStream() + this.readableStreamClosed = port.readable.pipeTo(textDecoder.writable) + this.reader = textDecoder.readable.getReader() + const readStringUntil = readFromSerialPort(this.reader) + + try { + while (true) { + const {value, done} = await readStringUntil('\n') + if (value) { + this.handleSerialPortResponse(value) + this.updateSerialPortConsole(value) + } + if (done) return + } + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Serial port communication error!', + caption: `${error}`, + timeout: 10000 + }) + } + } + }, + handleSerialPortResponse: async function (value) { + const {command, commandData} = await this.extractCommand(value) + this.logPublicCommandsResponse(command, commandData) + + switch (command) { + case COMMAND_PING: + this.handlePingResponse(commandData) + break + case COMMAND_CHECK_PAIRING: + this.handleCheckPairingResponse(commandData) + break + case COMMAND_SIGN_PSBT: + this.handleSignResponse(commandData) + break + case COMMAND_PASSWORD: + this.handleLoginResponse(commandData) + break + case COMMAND_PASSWORD_CLEAR: + this.handleLogoutResponse(commandData) + break + case COMMAND_SEND_PSBT: + this.handleSendPsbtResponse(commandData) + break + case COMMAND_WIPE: + this.handleWipeResponse(commandData) + break + case COMMAND_XPUB: + this.handleXpubResponse(commandData) + break + case COMMAND_SEED: + this.handleShowSeedResponse(commandData) + break + case COMMAND_PAIR: + this.handlePairResponse(commandData) + break + case COMMAND_LOG: + console.log( + ` %c${commandData}`, + 'background: #222; color: #bada55' + ) + break + default: + console.log(` %c${value}`, 'background: #222; color: red') + } + }, + logPublicCommandsResponse: function (command, commandData) { + switch (command) { + case COMMAND_SIGN_PSBT: + case COMMAND_PASSWORD: + case COMMAND_PASSWORD_CLEAR: + case COMMAND_SEND_PSBT: + case COMMAND_WIPE: + case COMMAND_XPUB: + case COMMAND_PAIR: + console.log( + ` %c${command} ${commandData}`, + 'background: #222; color: yellow' + ) + } + }, + updateSerialPortConsole: function (value) { + this.receivedData += value + '\n' + const textArea = document.getElementById('serial-port-console') + if (textArea) textArea.scrollTop = textArea.scrollHeight + }, + hwwPing: async function () { + try { + await this.sendCommandClearText(COMMAND_PING, [window.location.host]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to ping Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handlePingResponse: function (res = '') { + const [status, deviceId] = res.split(' ') + this.deviceId = deviceId + + if (!this.deviceId) { + this.$q.notify({ + type: 'warning', + message: 'Missing device ID for Hardware Wallet', + timeout: 10000 + }) + return + } + + const device = this.getPairedDevice(deviceId) + + if (device) { + this.sharedSecret = nobleSecp256k1.utils.hexToBytes( + device.sharedSecretHex + ) + this.hwwCheckPairing() + } else { + this.hwwPair() + } + }, + hwwShowPasswordDialog: async function () { + try { + this.hww.showPasswordDialog = true + await this.sendCommandSecure(COMMAND_PASSWORD) + } catch (error) { + console.log(error) + this.$q.notify({ + type: 'warning', + message: 'Failed to connect to Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwShowWipeDialog: async function () { + try { + this.hww.showWipeDialog = true + await this.sendCommandSecure(COMMAND_WIPE) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to connect to Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwShowRestoreDialog: async function () { + try { + this.hww.showRestoreDialog = true + await this.sendCommandSecure(COMMAND_RESTORE) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to connect to Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + closeSeedDialog: function () { + this.hww.seedWord = null + this.hww.showSeedWord = false + }, + hwwConfirmNext: async function () { + this.hww.confirm.outputIndex += 1 + if (this.hww.confirm.outputIndex >= this.tx.outputs.length) { + this.hww.confirm.showFee = true + } + await this.sendCommandSecure(COMMAND_CONFIRM_NEXT) + }, + cancelOperation: async function () { + try { + await this.sendCommandSecure(COMMAND_CANCEL) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send cancel!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwConfigAndConnect: async function () { + this.hww.showConfigDialog = false + if (this.config.deviceId) { + this.updatePairedDeviceConfig(this.config.deviceId, this.config) + } + await this.openSerialPort(this.config) + return true + }, + hwwLogin: async function () { + try { + await this.sendCommandSecure(COMMAND_PASSWORD, [ + this.hww.password, + this.hww.passphrase + ]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send password to Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.hww.showPasswordDialog = false + this.hww.password = null + this.hww.passphrase = null + this.hww.showPassword = false + this.hww.showPassphrase = false + } + }, + handleLoginResponse: function (res = '') { + this.hww.authenticated = res.trim() === '1' + if (this.loginResolve) { + this.loginResolve(this.hww.authenticated) + } + + if (this.hww.authenticated) { + this.$q.notify({ + type: 'positive', + message: 'Login successfull!', + timeout: 10000 + }) + } else { + this.$q.notify({ + type: 'warning', + message: 'Wrong password, try again!', + timeout: 10000 + }) + } + }, + hwwLogout: async function () { + try { + await this.sendCommandSecure(COMMAND_PASSWORD_CLEAR) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to logout from Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwShowAddress: async function (path, address) { + try { + await this.sendCommandSecure(COMMAND_ADDRESS, [ + this.network, + path, + address + ]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to logout from Hardware Wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleLogoutResponse: function (res = '') { + const authenticated = !(res.trim() === '1') + if (this.hww.authenticated && !authenticated) { + this.$q.notify({ + type: 'positive', + message: 'Logged Out', + timeout: 10000 + }) + } + this.hww.authenticated = authenticated + }, + hwwSendPsbt: async function (psbtBase64, tx) { + try { + this.tx = tx + this.hww.sendingPsbt = true + await this.sendCommandSecure(COMMAND_SEND_PSBT, [ + this.network, + psbtBase64 + ]) + this.$q.notify({ + type: 'positive', + message: 'Data sent to serial port device!', + timeout: 5000 + }) + } catch (error) { + this.hww.sendingPsbt = false + this.$q.notify({ + type: 'warning', + message: 'Failed to send data to serial port!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleSendPsbtResponse: function (res = '') { + try { + const psbtOK = res.trim() === '1' + if (!psbtOK) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send PSBT!', + caption: `${res}`, + timeout: 10000 + }) + return + } + this.hww.confirm.outputIndex = 0 + this.hww.showConfirmationDialog = true + this.hww.confirm = { + outputIndex: 0, + showFee: false + } + this.hww.sendingPsbt = false + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send PSBT!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.psbtSentResolve() + } + }, + hwwSignPsbt: async function () { + try { + this.hww.showConfirmationDialog = false + this.hww.signingPsbt = true + await this.sendCommandSecure(COMMAND_SIGN_PSBT) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to sign PSBT!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleSignResponse: function (res = '') { + this.hww.signingPsbt = false + const [count, psbt] = res.trim().split(' ') + if (!psbt || !count || count.trim() === '0') { + this.$q.notify({ + type: 'warning', + message: 'No input signed!', + caption: 'Are you using the right seed?', + timeout: 10000 + }) + return + } + this.updateSignedPsbt(psbt) + this.$q.notify({ + type: 'positive', + message: 'Transaction Signed', + message: `Inputs signed: ${count}`, + timeout: 10000 + }) + }, + hwwCheckPairing: async function () { + const iv = window.crypto.getRandomValues(new Uint8Array(16)) + const encrypted = await this.encryptMessage( + this.sharedSecret, + iv, + PAIRING_CONTROL_TEXT.length + ' ' + PAIRING_CONTROL_TEXT + ) + + const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) + const encryptedIvHex = nobleSecp256k1.utils.bytesToHex(iv) + try { + await this.sendCommandClearText(COMMAND_CHECK_PAIRING, [ + encryptedHex + encryptedIvHex + ]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to check secure connection!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleCheckPairingResponse: async function (res = '') { + const [statusCode, encryptedMessage] = res.split(' ') + switch (statusCode) { + case '0': + const controlText = await this.decryptData(encryptedMessage) + if (controlText == PAIRING_CONTROL_TEXT) { + this.$q.notify({ + type: 'positive', + message: 'Re-paired with success!', + timeout: 10000 + }) + } else { + this.$q.notify({ + type: 'warning', + message: 'Re-pairing failed!', + caption: 'Remove (forget) device and try again!', + timeout: 10000 + }) + } + break + default: + // noting to do here yet + break + } + }, + hwwPair: async function () { + try { + this.decryptionKey = nobleSecp256k1.utils.randomPrivateKey() + const publicKey = nobleSecp256k1.Point.fromPrivateKey( + this.decryptionKey + ) + const publicKeyHex = publicKey.toHex().slice(2) + + const args = [publicKeyHex] + if (Number.isInteger(+this.config.buttonOnePin)) { + args.push(this.config.buttonOnePin) + } + if (Number.isInteger(+this.config.buttonTwoPin)) { + args.push(this.config.buttonTwoPin) + } + await this.sendCommandClearText(COMMAND_PAIR, args) + this.$q.notify({ + type: 'positive', + message: 'Pairing started!', + timeout: 5000 + }) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to pair with device!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handlePairResponse: async function (res = '') { + const [statusCode, data] = res.trim().split(' ') + let pubKeyHex, errorMessage, captionMessage + switch (statusCode) { + case '0': + pubKeyHex = data + if (!data) errorMessage = 'Failed to exchange DH secret!' + break + case '1': + errorMessage = + 'Device pairing only possible in the first 10 seconds after start-up!' + captionMessage = 'Restart and try again' + break + + default: + errorMessage = 'Unexpected error code' + break + } + + if (errorMessage) { + this.$q.notify({ + type: 'warning', + message: errorMessage, + caption: captionMessage || '', + timeout: 10000 + }) + this.closeSerialPort() + return + } + const hwwPublicKey = nobleSecp256k1.Point.fromHex('04' + pubKeyHex) + + this.sharedSecret = nobleSecp256k1 + .getSharedSecret(this.decryptionKey, hwwPublicKey) + .slice(1, 33) + + const sharedSecretHex = nobleSecp256k1.utils.bytesToHex( + this.sharedSecret + ) + const sharedSecredHash = await nobleSecp256k1.utils.sha256( + asciiToUint8Array(sharedSecretHex) + ) + const fingerprint = nobleSecp256k1.utils + .bytesToHex(sharedSecredHash) + .substring(0, 5) + .toUpperCase() + + LNbits.utils + .confirmDialog('Confirm code from display: ' + fingerprint) + .onOk(() => { + this.addPairedDevice( + this.deviceId, + nobleSecp256k1.utils.bytesToHex(this.sharedSecret), + this.config + ) + + this.$q.notify({ + type: 'positive', + message: 'Paired with device!', + timeout: 5000 + }) + }) + .onCancel(() => { + this.closeSerialPort() + }) + }, + hwwHelp: async function () { + try { + await this.sendCommandSecure(COMMAND_HELP) + this.$q.notify({ + type: 'positive', + message: 'Check display or console for details!', + timeout: 5000 + }) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to ask for help!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwWipe: async function () { + try { + this.hww.showWipeDialog = false + await this.sendCommandSecure(COMMAND_WIPE, [this.hww.password]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to ask for help!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.hww.password = null + this.hww.confirmedPassword = null + this.hww.showPassword = false + } + }, + handleWipeResponse: function (res = '') { + const wiped = res.trim() === '1' + if (wiped) { + this.$q.notify({ + type: 'positive', + message: 'Wallet wiped!', + timeout: 10000 + }) + } else { + this.$q.notify({ + type: 'warning', + message: 'Failed to wipe wallet!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwXpub: async function (path) { + try { + await this.sendCommandSecure(COMMAND_XPUB, [this.network, path]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to fetch XPub!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleXpubResponse: function (res = '') { + const args = res.trim().split(' ') + if (args.length < 3 || args[0].trim() !== '1') { + this.$q.notify({ + type: 'warning', + message: 'Failed to fetch XPub!', + caption: `${res}`, + timeout: 10000 + }) + this.xpubResolve({}) + return + } + const xpub = args[1].trim() + const fingerprint = args[2].trim() + this.xpubResolve({xpub, fingerprint}) + }, + + hwwShowSeed: async function () { + try { + this.hww.showSeedDialog = true + this.hww.seedWordPosition = 1 + + await this.sendCommandSecure(COMMAND_SEED, [ + this.hww.seedWordPosition + ]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to show seed!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + showNextSeedWord: async function () { + this.hww.seedWordPosition++ + await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) + }, + showPrevSeedWord: async function () { + this.hww.seedWordPosition = Math.max(1, this.hww.seedWordPosition - 1) + await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) + }, + handleShowSeedResponse: function (res = '') { + const [pos, word] = res.trim().split(' ') + this.hww.seedWord = `${pos}. ${word}` + this.hww.seedWordPosition = pos + }, + hwwRestore: async function () { + try { + await this.sendCommandSecure(COMMAND_RESTORE, [ + this.hww.password, + this.hww.mnemonic + ]) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to restore from seed!', + caption: `${error}`, + timeout: 10000 + }) + } finally { + this.hww.showRestoreDialog = false + this.hww.mnemonic = null + this.hww.showMnemonic = false + this.hww.password = null + this.hww.confirmedPassword = null + this.hww.showPassword = false + } + }, + + updateSignedPsbt: async function (value) { + this.$emit('signed:psbt', value) + }, + + sendCommandSecure: async function (command, attrs = []) { + const message = [command].concat(attrs).join(' ') + const iv = window.crypto.getRandomValues(new Uint8Array(16)) + const encrypted = await this.encryptMessage( + this.sharedSecret, + iv, + message.length + ' ' + message + ) + + const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) + const encryptedIvHex = nobleSecp256k1.utils.bytesToHex(iv) + await this.writer.write(encryptedHex + encryptedIvHex + '\n') + }, + sendCommandClearText: async function (command, attrs = []) { + const message = [command].concat(attrs).join(' ') + await this.writer.write(message + '\n') + }, + extractCommand: async function (value) { + const command = value.split(' ')[0] + const commandData = value.substring(command.length).trim() + + if ( + command === COMMAND_PAIR || + command === COMMAND_LOG || + command === COMMAND_PASSWORD_CLEAR || + command === COMMAND_PING || + command === COMMAND_CHECK_PAIRING + ) + return {command, commandData} + + const decryptedValue = await this.decryptData(value) + const decryptedCommand = decryptedValue.split(' ')[0] + const decryptedCommandData = decryptedValue + .substring(decryptedCommand.length) + .trim() + return { + command: decryptedCommand, + commandData: decryptedCommandData + } + }, + decryptData: async function (value) { + if (!this.sharedSecret) { + return '/error Secure session not established!' + } + try { + const ivSize = 32 + const messageHex = value.substring(0, value.length - ivSize) + const ivHex = value.substring(value.length - ivSize) + const messageBytes = nobleSecp256k1.utils.hexToBytes(messageHex) + const iv = nobleSecp256k1.utils.hexToBytes(ivHex) + const decrypted1 = await this.decryptMessage( + this.sharedSecret, + iv, + messageBytes + ) + const data = new TextDecoder().decode(decrypted1) + const [len] = data.split(' ') + const command = data + .substring(len.length + 1, +len + len.length + 1) + .trim() + return command + } catch (error) { + return '/error Failed to decrypt message from device!' + } + }, + encryptMessage: async function (key, iv, message) { + while (message.length % 16 !== 0) message += ' ' + const encodedMessage = asciiToUint8Array(message) + + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const encryptedBytes = aesCbc.encrypt(encodedMessage) + + return encryptedBytes + }, + decryptMessage: async function (key, iv, encryptedBytes) { + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const decryptedBytes = aesCbc.decrypt(encryptedBytes) + return decryptedBytes + }, + + getPairedDevice: function (deviceId) { + return this.pairedDevices.find(d => d.id === deviceId) + }, + removePairedDevice: function (deviceId) { + const devices = this.pairedDevices + const deviceIndex = devices.findIndex(d => d.id === deviceId) + if (deviceIndex !== -1) { + devices.splice(deviceIndex, 1) + } + this.pairedDevices = devices + }, + addPairedDevice: function (deviceId, sharedSecretHex, config) { + const devices = this.pairedDevices + config.deviceId = deviceId + devices.unshift({ + id: deviceId, + sharedSecretHex: sharedSecretHex, + pairingDate: new Date().toISOString(), + config + }) + this.pairedDevices = devices + }, + updatePairedDeviceConfig(deviceId, config) { + const device = this.getPairedDevice(deviceId) + if (device) { + this.removePairedDevice(deviceId) + this.addPairedDevice(deviceId, device.sharedSecretHex, config) + } + } + }, + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.html b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.html new file mode 100644 index 00000000..fd1d591c --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.html @@ -0,0 +1,142 @@ + + +
+
+ +
+
+ +
+
+
+
+ + + +
+
+ + + + +
diff --git a/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js new file mode 100644 index 00000000..6741ed94 --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/utxo-list/utxo-list.js @@ -0,0 +1,148 @@ +async function utxoList(path) { + const template = await loadTemplateAsync(path) + Vue.component('utxo-list', { + name: 'utxo-list', + template, + + props: [ + 'utxos', + 'accounts', + 'selectable', + 'payed-amount', + 'sats-denominated', + 'mempool-endpoint', + 'filter' + ], + + data: function () { + return { + utxosTable: { + columns: [ + { + name: 'expand', + align: 'left', + label: '' + }, + { + name: 'selected', + align: 'left', + label: '', + selectable: true + }, + { + name: 'status', + align: 'center', + label: 'Status', + sortable: true + }, + { + name: 'address', + align: 'left', + label: 'Address', + field: 'address', + sortable: true + }, + { + name: 'amount', + align: 'left', + label: 'Amount', + field: 'amount', + sortable: true + }, + { + name: 'date', + align: 'left', + label: 'Date', + field: 'date', + sortable: true + }, + { + name: 'wallet', + align: 'left', + label: 'Account', + field: 'wallet', + sortable: true + } + ], + pagination: { + rowsPerPage: 10 + } + }, + utxoSelectionModes: [ + 'Manual', + 'Random', + 'Select All', + 'Smaller Inputs First', + 'Larger Inputs First' + ], + utxoSelectionMode: 'Random', + utxoSelectAmount: 0 + } + }, + + computed: { + columns: function () { + return this.utxosTable.columns.filter(c => + c.selectable ? this.selectable : true + ) + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + getWalletName: function (walletId) { + const wallet = (this.accounts || []).find(wl => wl.id === walletId) + return wallet ? wallet.title : 'unknown' + }, + getTotalSelectedUtxoAmount: function () { + const total = (this.utxos || []) + .filter(u => u.selected) + .reduce((t, a) => t + (a.amount || 0), 0) + return total + }, + refreshUtxoSelection: function (totalPayedAmount) { + this.utxoSelectAmount = totalPayedAmount + this.applyUtxoSelectionMode() + }, + updateUtxoSelection: function () { + this.utxoSelectAmount = this.payedAmount + this.applyUtxoSelectionMode() + }, + applyUtxoSelectionMode: function () { + const mode = this.utxoSelectionMode + const isSelectAll = mode === 'Select All' + if (isSelectAll) { + this.utxos.forEach(u => (u.selected = true)) + return + } + + const isManual = mode === 'Manual' + if (isManual || !this.utxoSelectAmount) return + + this.utxos.forEach(u => (u.selected = false)) + + const isSmallerFirst = mode === 'Smaller Inputs First' + const isLargerFirst = mode === 'Larger Inputs First' + let selectedUtxos = this.utxos.slice() + if (isSmallerFirst || isLargerFirst) { + const sortFn = isSmallerFirst + ? (a, b) => a.amount - b.amount + : (a, b) => b.amount - a.amount + selectedUtxos.sort(sortFn) + } else { + // default to random order + selectedUtxos = _.shuffle(selectedUtxos) + } + selectedUtxos.reduce((total, utxo) => { + utxo.selected = total < this.utxoSelectAmount + total += utxo.amount + return total + }, 0) + } + }, + + created: async function () {} + }) +} diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html new file mode 100644 index 00000000..748d650d --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html @@ -0,0 +1,80 @@ +
+ +
+
+ + +
+
+
+
{{satBtc(total)}}
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + +
+ Update + Cancel +
+
+
+
+
diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js new file mode 100644 index 00000000..447dc65c --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js @@ -0,0 +1,67 @@ +async function walletConfig(path) { + const t = await loadTemplateAsync(path) + Vue.component('wallet-config', { + name: 'wallet-config', + template: t, + + props: ['total', 'config-data', 'adminkey'], + data: function () { + return { + networOptions: ['Mainnet', 'Testnet'], + internalConfig: {}, + show: false + } + }, + + computed: { + config: { + get() { + return this.internalConfig + }, + set(value) { + value.isLoaded = true + this.internalConfig = JSON.parse(JSON.stringify(value)) + this.$emit( + 'update:config-data', + JSON.parse(JSON.stringify(this.internalConfig)) + ) + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.config.sats_denominated) + }, + updateConfig: async function () { + try { + const {data} = await LNbits.api.request( + 'PUT', + '/watchonly/api/v1/config', + this.adminkey, + this.config + ) + this.show = false + this.config = data + } catch (error) { + LNbits.utils.notifyApiError(error) + } + }, + getConfig: async function () { + try { + const {data} = await LNbits.api.request( + 'GET', + '/watchonly/api/v1/config', + this.adminkey + ) + this.config = data + } catch (error) { + LNbits.utils.notifyApiError(error) + } + } + }, + created: async function () { + await this.getConfig() + } + }) +} diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html new file mode 100644 index 00000000..b656bdca --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html @@ -0,0 +1,285 @@ +
+ + +
+
+ + + + + New Account + Enter account Xpub or Descriptor + + + + + From Hardware Device + + Get Xpub from a Hardware Device + + + + +
+
+
+ + + +
+
+ + + + +
+
+ + + + + + + + + + +
+ + + + Cancel +
+
+
+
+ + + + + + + +
diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js new file mode 100644 index 00000000..004f092b --- /dev/null +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js @@ -0,0 +1,314 @@ +async function walletList(path) { + const template = await loadTemplateAsync(path) + Vue.component('wallet-list', { + name: 'wallet-list', + template, + + props: [ + 'adminkey', + 'inkey', + 'sats-denominated', + 'addresses', + 'network', + 'serial-signer-ref' + ], + data: function () { + return { + walletAccounts: [], + address: {}, + showQrCodeDialog: false, + qrCodeValue: null, + formDialog: { + show: false, + + addressType: { + label: 'Segwit (P2WPKH)', + id: 'wpkh', + pathMainnet: "m/84'/0'/0'", + pathTestnet: "m/84'/1'/0'" + }, + useSerialPort: false, + data: { + title: '', + masterpub: '' + } + }, + accountPath: '', + filter: '', + showCreating: false, + addressTypeOptions: [ + { + label: 'Legacy (P2PKH)', + id: 'pkh', + pathMainnet: "m/44'/0'/0'", + pathTestnet: "m/44'/1'/0'" + }, + { + label: 'Segwit (P2WPKH)', + id: 'wpkh', + pathMainnet: "m/84'/0'/0'", + pathTestnet: "m/84'/1'/0'" + }, + { + label: 'Wrapped Segwit (P2SH-P2WPKH)', + id: 'sh', + pathMainnet: "m/49'/0'/0'", + pathTestnet: "m/49'/1'/0'" + }, + { + label: 'Taproot (P2TR)', + id: 'tr', + pathMainnet: "m/86'/0'/0'", + pathTestnet: "m/86'/1'/0'" + } + ], + + walletsTable: { + columns: [ + { + name: 'new', + align: 'left', + label: '' + }, + { + name: 'title', + align: 'left', + label: 'Title', + field: 'title' + }, + { + name: 'amount', + align: 'left', + label: 'Amount' + }, + { + name: 'type', + align: 'left', + label: 'Type', + field: 'type' + }, + {name: 'id', align: 'left', label: 'ID', field: 'id'} + ], + pagination: { + rowsPerPage: 10 + }, + filter: '' + } + } + }, + watch: { + immediate: true, + async network(newNet, oldNet) { + if (newNet !== oldNet) { + await this.refreshWalletAccounts() + this.handleAddressTypeChanged(this.addressTypeOptions[1]) + } + } + }, + + methods: { + satBtc(val, showUnit = true) { + return satOrBtc(val, showUnit, this.satsDenominated) + }, + + addWalletAccount: async function () { + this.showCreating = true + const data = _.omit(this.formDialog.data, 'wallet') + data.network = this.network + await this.createWalletAccount(data) + this.showCreating = false + }, + createWalletAccount: async function (data) { + try { + const meta = {accountPath: this.accountPath} + if (this.formDialog.useSerialPort) { + const {xpub, fingerprint} = await this.fetchXpubFromHww() + if (!xpub) return + meta.xpub = xpub + const path = this.accountPath.substring(2) + const outputType = this.formDialog.addressType.id + if (outputType === 'sh') { + data.masterpub = `${outputType}(wpkh([${fingerprint}/${path}]${xpub}/{0,1}/*))` + } else { + data.masterpub = `${outputType}([${fingerprint}/${path}]${xpub}/{0,1}/*)` + } + } + data.meta = JSON.stringify(meta) + const response = await LNbits.api.request( + 'POST', + '/watchonly/api/v1/wallet', + this.adminkey, + data + ) + this.walletAccounts.push(mapWalletAccount(response.data)) + this.formDialog.show = false + + await this.refreshWalletAccounts() + } catch (error) { + LNbits.utils.notifyApiError(error) + } + }, + fetchXpubFromHww: async function () { + const error = findAccountPathIssues(this.accountPath) + if (error) { + this.$q.notify({ + type: 'warning', + message: 'Invalid derivation path.', + caption: error, + timeout: 10000 + }) + return + } + await this.serialSignerRef.hwwXpub(this.accountPath) + return await this.serialSignerRef.isFetchingXpub() + }, + deleteWalletAccount: function (walletAccountId) { + LNbits.utils + .confirmDialog( + 'Are you sure you want to delete this watch only wallet?' + ) + .onOk(async () => { + try { + await LNbits.api.request( + 'DELETE', + '/watchonly/api/v1/wallet/' + walletAccountId, + this.adminkey + ) + this.walletAccounts = _.reject(this.walletAccounts, function ( + obj + ) { + return obj.id === walletAccountId + }) + await this.refreshWalletAccounts() + } catch (error) { + this.$q.notify({ + type: 'warning', + message: + 'Error while deleting wallet account. Please try again.', + timeout: 10000 + }) + } + }) + }, + + getWatchOnlyWallets: async function () { + try { + const {data} = await LNbits.api.request( + 'GET', + `/watchonly/api/v1/wallet?network=${this.network}`, + this.inkey + ) + return data + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to fetch wallets.', + timeout: 10000 + }) + LNbits.utils.notifyApiError(error) + } + return [] + }, + refreshWalletAccounts: async function () { + this.walletAccounts = [] + const wallets = await this.getWatchOnlyWallets() + this.walletAccounts = wallets.map(w => mapWalletAccount(w)) + this.$emit('accounts-update', this.walletAccounts) + }, + getAmmountForWallet: function (walletId) { + const amount = this.addresses + .filter(a => a.wallet === walletId) + .reduce((t, a) => t + a.amount || 0, 0) + return this.satBtc(amount) + }, + closeFormDialog: function () { + this.formDialog.data = { + is_unique: false + } + }, + getAccountDescription: function (accountType) { + return getAccountDescription(accountType) + }, + openGetFreshAddressDialog: async function (walletId) { + const {data} = await LNbits.api.request( + 'GET', + `/watchonly/api/v1/address/${walletId}`, + this.inkey + ) + const addressData = mapAddressesData(data) + + addressData.note = `Shared on ${currentDateTime()}` + const lastActiveAddress = + this.addresses + .filter( + a => + a.wallet === addressData.wallet && !a.isChange && a.hasActivity + ) + .pop() || {} + addressData.gapLimitExceeded = + !addressData.isChange && + addressData.addressIndex > + lastActiveAddress.addressIndex + DEFAULT_RECEIVE_GAP_LIMIT + + const wallet = this.walletAccounts.find(w => w.id === walletId) || {} + wallet.address_no = addressData.addressIndex + this.$emit('new-receive-address', {addressData, wallet}) + }, + showAddAccountDialog: function () { + this.formDialog.show = true + this.formDialog.useSerialPort = false + }, + getXpubFromDevice: async function () { + try { + if (!this.serialSignerRef.isConnected()) { + this.$q.notify({ + type: 'warning', + message: 'Please connect to a hardware Device first!', + timeout: 10000 + }) + return + } + if (!this.serialSignerRef.isAuthenticated()) { + await this.serialSignerRef.hwwShowPasswordDialog() + const authenticated = await this.serialSignerRef.isAuthenticating() + if (!authenticated) return + } + this.formDialog.show = true + this.formDialog.useSerialPort = true + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot fetch Xpub!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + handleAddressTypeChanged: function (value = {}) { + const addressType = + this.addressTypeOptions.find(t => t.id === value.id) || {} + this.accountPath = addressType[`path${this.network}`] + }, + // todo: bad. base.js not present in custom components + copyText: function (text, message, position) { + var notify = this.$q.notify + Quasar.utils.copyToClipboard(text).then(function () { + notify({ + message: message || 'Copied to clipboard!', + position: position || 'bottom' + }) + }) + }, + openQrCodeDialog: function (qrCodeValue) { + this.qrCodeValue = qrCodeValue + this.showQrCodeDialog = true + } + }, + created: async function () { + if (this.inkey) { + await this.refreshWalletAccounts() + this.handleAddressTypeChanged(this.addressTypeOptions[1]) + } + } + }) +} diff --git a/lnbits/extensions/watchonly/static/js/bip39-word-list.js b/lnbits/extensions/watchonly/static/js/bip39-word-list.js new file mode 100644 index 00000000..c0a5eac3 --- /dev/null +++ b/lnbits/extensions/watchonly/static/js/bip39-word-list.js @@ -0,0 +1,2050 @@ +const bip39WordList = Object.freeze([ + 'abandon', + 'ability', + 'able', + 'about', + 'above', + 'absent', + 'absorb', + 'abstract', + 'absurd', + 'abuse', + 'access', + 'accident', + 'account', + 'accuse', + 'achieve', + 'acid', + 'acoustic', + 'acquire', + 'across', + 'act', + 'action', + 'actor', + 'actress', + 'actual', + 'adapt', + 'add', + 'addict', + 'address', + 'adjust', + 'admit', + 'adult', + 'advance', + 'advice', + 'aerobic', + 'affair', + 'afford', + 'afraid', + 'again', + 'age', + 'agent', + 'agree', + 'ahead', + 'aim', + 'air', + 'airport', + 'aisle', + 'alarm', + 'album', + 'alcohol', + 'alert', + 'alien', + 'all', + 'alley', + 'allow', + 'almost', + 'alone', + 'alpha', + 'already', + 'also', + 'alter', + 'always', + 'amateur', + 'amazing', + 'among', + 'amount', + 'amused', + 'analyst', + 'anchor', + 'ancient', + 'anger', + 'angle', + 'angry', + 'animal', + 'ankle', + 'announce', + 'annual', + 'another', + 'answer', + 'antenna', + 'antique', + 'anxiety', + 'any', + 'apart', + 'apology', + 'appear', + 'apple', + 'approve', + 'april', + 'arch', + 'arctic', + 'area', + 'arena', + 'argue', + 'arm', + 'armed', + 'armor', + 'army', + 'around', + 'arrange', + 'arrest', + 'arrive', + 'arrow', + 'art', + 'artefact', + 'artist', + 'artwork', + 'ask', + 'aspect', + 'assault', + 'asset', + 'assist', + 'assume', + 'asthma', + 'athlete', + 'atom', + 'attack', + 'attend', + 'attitude', + 'attract', + 'auction', + 'audit', + 'august', + 'aunt', + 'author', + 'auto', + 'autumn', + 'average', + 'avocado', + 'avoid', + 'awake', + 'aware', + 'away', + 'awesome', + 'awful', + 'awkward', + 'axis', + 'baby', + 'bachelor', + 'bacon', + 'badge', + 'bag', + 'balance', + 'balcony', + 'ball', + 'bamboo', + 'banana', + 'banner', + 'bar', + 'barely', + 'bargain', + 'barrel', + 'base', + 'basic', + 'basket', + 'battle', + 'beach', + 'bean', + 'beauty', + 'because', + 'become', + 'beef', + 'before', + 'begin', + 'behave', + 'behind', + 'believe', + 'below', + 'belt', + 'bench', + 'benefit', + 'best', + 'betray', + 'better', + 'between', + 'beyond', + 'bicycle', + 'bid', + 'bike', + 'bind', + 'biology', + 'bird', + 'birth', + 'bitter', + 'black', + 'blade', + 'blame', + 'blanket', + 'blast', + 'bleak', + 'bless', + 'blind', + 'blood', + 'blossom', + 'blouse', + 'blue', + 'blur', + 'blush', + 'board', + 'boat', + 'body', + 'boil', + 'bomb', + 'bone', + 'bonus', + 'book', + 'boost', + 'border', + 'boring', + 'borrow', + 'boss', + 'bottom', + 'bounce', + 'box', + 'boy', + 'bracket', + 'brain', + 'brand', + 'brass', + 'brave', + 'bread', + 'breeze', + 'brick', + 'bridge', + 'brief', + 'bright', + 'bring', + 'brisk', + 'broccoli', + 'broken', + 'bronze', + 'broom', + 'brother', + 'brown', + 'brush', + 'bubble', + 'buddy', + 'budget', + 'buffalo', + 'build', + 'bulb', + 'bulk', + 'bullet', + 'bundle', + 'bunker', + 'burden', + 'burger', + 'burst', + 'bus', + 'business', + 'busy', + 'butter', + 'buyer', + 'buzz', + 'cabbage', + 'cabin', + 'cable', + 'cactus', + 'cage', + 'cake', + 'call', + 'calm', + 'camera', + 'camp', + 'can', + 'canal', + 'cancel', + 'candy', + 'cannon', + 'canoe', + 'canvas', + 'canyon', + 'capable', + 'capital', + 'captain', + 'car', + 'carbon', + 'card', + 'cargo', + 'carpet', + 'carry', + 'cart', + 'case', + 'cash', + 'casino', + 'castle', + 'casual', + 'cat', + 'catalog', + 'catch', + 'category', + 'cattle', + 'caught', + 'cause', + 'caution', + 'cave', + 'ceiling', + 'celery', + 'cement', + 'census', + 'century', + 'cereal', + 'certain', + 'chair', + 'chalk', + 'champion', + 'change', + 'chaos', + 'chapter', + 'charge', + 'chase', + 'chat', + 'cheap', + 'check', + 'cheese', + 'chef', + 'cherry', + 'chest', + 'chicken', + 'chief', + 'child', + 'chimney', + 'choice', + 'choose', + 'chronic', + 'chuckle', + 'chunk', + 'churn', + 'cigar', + 'cinnamon', + 'circle', + 'citizen', + 'city', + 'civil', + 'claim', + 'clap', + 'clarify', + 'claw', + 'clay', + 'clean', + 'clerk', + 'clever', + 'click', + 'client', + 'cliff', + 'climb', + 'clinic', + 'clip', + 'clock', + 'clog', + 'close', + 'cloth', + 'cloud', + 'clown', + 'club', + 'clump', + 'cluster', + 'clutch', + 'coach', + 'coast', + 'coconut', + 'code', + 'coffee', + 'coil', + 'coin', + 'collect', + 'color', + 'column', + 'combine', + 'come', + 'comfort', + 'comic', + 'common', + 'company', + 'concert', + 'conduct', + 'confirm', + 'congress', + 'connect', + 'consider', + 'control', + 'convince', + 'cook', + 'cool', + 'copper', + 'copy', + 'coral', + 'core', + 'corn', + 'correct', + 'cost', + 'cotton', + 'couch', + 'country', + 'couple', + 'course', + 'cousin', + 'cover', + 'coyote', + 'crack', + 'cradle', + 'craft', + 'cram', + 'crane', + 'crash', + 'crater', + 'crawl', + 'crazy', + 'cream', + 'credit', + 'creek', + 'crew', + 'cricket', + 'crime', + 'crisp', + 'critic', + 'crop', + 'cross', + 'crouch', + 'crowd', + 'crucial', + 'cruel', + 'cruise', + 'crumble', + 'crunch', + 'crush', + 'cry', + 'crystal', + 'cube', + 'culture', + 'cup', + 'cupboard', + 'curious', + 'current', + 'curtain', + 'curve', + 'cushion', + 'custom', + 'cute', + 'cycle', + 'dad', + 'damage', + 'damp', + 'dance', + 'danger', + 'daring', + 'dash', + 'daughter', + 'dawn', + 'day', + 'deal', + 'debate', + 'debris', + 'decade', + 'december', + 'decide', + 'decline', + 'decorate', + 'decrease', + 'deer', + 'defense', + 'define', + 'defy', + 'degree', + 'delay', + 'deliver', + 'demand', + 'demise', + 'denial', + 'dentist', + 'deny', + 'depart', + 'depend', + 'deposit', + 'depth', + 'deputy', + 'derive', + 'describe', + 'desert', + 'design', + 'desk', + 'despair', + 'destroy', + 'detail', + 'detect', + 'develop', + 'device', + 'devote', + 'diagram', + 'dial', + 'diamond', + 'diary', + 'dice', + 'diesel', + 'diet', + 'differ', + 'digital', + 'dignity', + 'dilemma', + 'dinner', + 'dinosaur', + 'direct', + 'dirt', + 'disagree', + 'discover', + 'disease', + 'dish', + 'dismiss', + 'disorder', + 'display', + 'distance', + 'divert', + 'divide', + 'divorce', + 'dizzy', + 'doctor', + 'document', + 'dog', + 'doll', + 'dolphin', + 'domain', + 'donate', + 'donkey', + 'donor', + 'door', + 'dose', + 'double', + 'dove', + 'draft', + 'dragon', + 'drama', + 'drastic', + 'draw', + 'dream', + 'dress', + 'drift', + 'drill', + 'drink', + 'drip', + 'drive', + 'drop', + 'drum', + 'dry', + 'duck', + 'dumb', + 'dune', + 'during', + 'dust', + 'dutch', + 'duty', + 'dwarf', + 'dynamic', + 'eager', + 'eagle', + 'early', + 'earn', + 'earth', + 'easily', + 'east', + 'easy', + 'echo', + 'ecology', + 'economy', + 'edge', + 'edit', + 'educate', + 'effort', + 'egg', + 'eight', + 'either', + 'elbow', + 'elder', + 'electric', + 'elegant', + 'element', + 'elephant', + 'elevator', + 'elite', + 'else', + 'embark', + 'embody', + 'embrace', + 'emerge', + 'emotion', + 'employ', + 'empower', + 'empty', + 'enable', + 'enact', + 'end', + 'endless', + 'endorse', + 'enemy', + 'energy', + 'enforce', + 'engage', + 'engine', + 'enhance', + 'enjoy', + 'enlist', + 'enough', + 'enrich', + 'enroll', + 'ensure', + 'enter', + 'entire', + 'entry', + 'envelope', + 'episode', + 'equal', + 'equip', + 'era', + 'erase', + 'erode', + 'erosion', + 'error', + 'erupt', + 'escape', + 'essay', + 'essence', + 'estate', + 'eternal', + 'ethics', + 'evidence', + 'evil', + 'evoke', + 'evolve', + 'exact', + 'example', + 'excess', + 'exchange', + 'excite', + 'exclude', + 'excuse', + 'execute', + 'exercise', + 'exhaust', + 'exhibit', + 'exile', + 'exist', + 'exit', + 'exotic', + 'expand', + 'expect', + 'expire', + 'explain', + 'expose', + 'express', + 'extend', + 'extra', + 'eye', + 'eyebrow', + 'fabric', + 'face', + 'faculty', + 'fade', + 'faint', + 'faith', + 'fall', + 'false', + 'fame', + 'family', + 'famous', + 'fan', + 'fancy', + 'fantasy', + 'farm', + 'fashion', + 'fat', + 'fatal', + 'father', + 'fatigue', + 'fault', + 'favorite', + 'feature', + 'february', + 'federal', + 'fee', + 'feed', + 'feel', + 'female', + 'fence', + 'festival', + 'fetch', + 'fever', + 'few', + 'fiber', + 'fiction', + 'field', + 'figure', + 'file', + 'film', + 'filter', + 'final', + 'find', + 'fine', + 'finger', + 'finish', + 'fire', + 'firm', + 'first', + 'fiscal', + 'fish', + 'fit', + 'fitness', + 'fix', + 'flag', + 'flame', + 'flash', + 'flat', + 'flavor', + 'flee', + 'flight', + 'flip', + 'float', + 'flock', + 'floor', + 'flower', + 'fluid', + 'flush', + 'fly', + 'foam', + 'focus', + 'fog', + 'foil', + 'fold', + 'follow', + 'food', + 'foot', + 'force', + 'forest', + 'forget', + 'fork', + 'fortune', + 'forum', + 'forward', + 'fossil', + 'foster', + 'found', + 'fox', + 'fragile', + 'frame', + 'frequent', + 'fresh', + 'friend', + 'fringe', + 'frog', + 'front', + 'frost', + 'frown', + 'frozen', + 'fruit', + 'fuel', + 'fun', + 'funny', + 'furnace', + 'fury', + 'future', + 'gadget', + 'gain', + 'galaxy', + 'gallery', + 'game', + 'gap', + 'garage', + 'garbage', + 'garden', + 'garlic', + 'garment', + 'gas', + 'gasp', + 'gate', + 'gather', + 'gauge', + 'gaze', + 'general', + 'genius', + 'genre', + 'gentle', + 'genuine', + 'gesture', + 'ghost', + 'giant', + 'gift', + 'giggle', + 'ginger', + 'giraffe', + 'girl', + 'give', + 'glad', + 'glance', + 'glare', + 'glass', + 'glide', + 'glimpse', + 'globe', + 'gloom', + 'glory', + 'glove', + 'glow', + 'glue', + 'goat', + 'goddess', + 'gold', + 'good', + 'goose', + 'gorilla', + 'gospel', + 'gossip', + 'govern', + 'gown', + 'grab', + 'grace', + 'grain', + 'grant', + 'grape', + 'grass', + 'gravity', + 'great', + 'green', + 'grid', + 'grief', + 'grit', + 'grocery', + 'group', + 'grow', + 'grunt', + 'guard', + 'guess', + 'guide', + 'guilt', + 'guitar', + 'gun', + 'gym', + 'habit', + 'hair', + 'half', + 'hammer', + 'hamster', + 'hand', + 'happy', + 'harbor', + 'hard', + 'harsh', + 'harvest', + 'hat', + 'have', + 'hawk', + 'hazard', + 'head', + 'health', + 'heart', + 'heavy', + 'hedgehog', + 'height', + 'hello', + 'helmet', + 'help', + 'hen', + 'hero', + 'hidden', + 'high', + 'hill', + 'hint', + 'hip', + 'hire', + 'history', + 'hobby', + 'hockey', + 'hold', + 'hole', + 'holiday', + 'hollow', + 'home', + 'honey', + 'hood', + 'hope', + 'horn', + 'horror', + 'horse', + 'hospital', + 'host', + 'hotel', + 'hour', + 'hover', + 'hub', + 'huge', + 'human', + 'humble', + 'humor', + 'hundred', + 'hungry', + 'hunt', + 'hurdle', + 'hurry', + 'hurt', + 'husband', + 'hybrid', + 'ice', + 'icon', + 'idea', + 'identify', + 'idle', + 'ignore', + 'ill', + 'illegal', + 'illness', + 'image', + 'imitate', + 'immense', + 'immune', + 'impact', + 'impose', + 'improve', + 'impulse', + 'inch', + 'include', + 'income', + 'increase', + 'index', + 'indicate', + 'indoor', + 'industry', + 'infant', + 'inflict', + 'inform', + 'inhale', + 'inherit', + 'initial', + 'inject', + 'injury', + 'inmate', + 'inner', + 'innocent', + 'input', + 'inquiry', + 'insane', + 'insect', + 'inside', + 'inspire', + 'install', + 'intact', + 'interest', + 'into', + 'invest', + 'invite', + 'involve', + 'iron', + 'island', + 'isolate', + 'issue', + 'item', + 'ivory', + 'jacket', + 'jaguar', + 'jar', + 'jazz', + 'jealous', + 'jeans', + 'jelly', + 'jewel', + 'job', + 'join', + 'joke', + 'journey', + 'joy', + 'judge', + 'juice', + 'jump', + 'jungle', + 'junior', + 'junk', + 'just', + 'kangaroo', + 'keen', + 'keep', + 'ketchup', + 'key', + 'kick', + 'kid', + 'kidney', + 'kind', + 'kingdom', + 'kiss', + 'kit', + 'kitchen', + 'kite', + 'kitten', + 'kiwi', + 'knee', + 'knife', + 'knock', + 'know', + 'lab', + 'label', + 'labor', + 'ladder', + 'lady', + 'lake', + 'lamp', + 'language', + 'laptop', + 'large', + 'later', + 'latin', + 'laugh', + 'laundry', + 'lava', + 'law', + 'lawn', + 'lawsuit', + 'layer', + 'lazy', + 'leader', + 'leaf', + 'learn', + 'leave', + 'lecture', + 'left', + 'leg', + 'legal', + 'legend', + 'leisure', + 'lemon', + 'lend', + 'length', + 'lens', + 'leopard', + 'lesson', + 'letter', + 'level', + 'liar', + 'liberty', + 'library', + 'license', + 'life', + 'lift', + 'light', + 'like', + 'limb', + 'limit', + 'link', + 'lion', + 'liquid', + 'list', + 'little', + 'live', + 'lizard', + 'load', + 'loan', + 'lobster', + 'local', + 'lock', + 'logic', + 'lonely', + 'long', + 'loop', + 'lottery', + 'loud', + 'lounge', + 'love', + 'loyal', + 'lucky', + 'luggage', + 'lumber', + 'lunar', + 'lunch', + 'luxury', + 'lyrics', + 'machine', + 'mad', + 'magic', + 'magnet', + 'maid', + 'mail', + 'main', + 'major', + 'make', + 'mammal', + 'man', + 'manage', + 'mandate', + 'mango', + 'mansion', + 'manual', + 'maple', + 'marble', + 'march', + 'margin', + 'marine', + 'market', + 'marriage', + 'mask', + 'mass', + 'master', + 'match', + 'material', + 'math', + 'matrix', + 'matter', + 'maximum', + 'maze', + 'meadow', + 'mean', + 'measure', + 'meat', + 'mechanic', + 'medal', + 'media', + 'melody', + 'melt', + 'member', + 'memory', + 'mention', + 'menu', + 'mercy', + 'merge', + 'merit', + 'merry', + 'mesh', + 'message', + 'metal', + 'method', + 'middle', + 'midnight', + 'milk', + 'million', + 'mimic', + 'mind', + 'minimum', + 'minor', + 'minute', + 'miracle', + 'mirror', + 'misery', + 'miss', + 'mistake', + 'mix', + 'mixed', + 'mixture', + 'mobile', + 'model', + 'modify', + 'mom', + 'moment', + 'monitor', + 'monkey', + 'monster', + 'month', + 'moon', + 'moral', + 'more', + 'morning', + 'mosquito', + 'mother', + 'motion', + 'motor', + 'mountain', + 'mouse', + 'move', + 'movie', + 'much', + 'muffin', + 'mule', + 'multiply', + 'muscle', + 'museum', + 'mushroom', + 'music', + 'must', + 'mutual', + 'myself', + 'mystery', + 'myth', + 'naive', + 'name', + 'napkin', + 'narrow', + 'nasty', + 'nation', + 'nature', + 'near', + 'neck', + 'need', + 'negative', + 'neglect', + 'neither', + 'nephew', + 'nerve', + 'nest', + 'net', + 'network', + 'neutral', + 'never', + 'news', + 'next', + 'nice', + 'night', + 'noble', + 'noise', + 'nominee', + 'noodle', + 'normal', + 'north', + 'nose', + 'notable', + 'note', + 'nothing', + 'notice', + 'novel', + 'now', + 'nuclear', + 'number', + 'nurse', + 'nut', + 'oak', + 'obey', + 'object', + 'oblige', + 'obscure', + 'observe', + 'obtain', + 'obvious', + 'occur', + 'ocean', + 'october', + 'odor', + 'off', + 'offer', + 'office', + 'often', + 'oil', + 'okay', + 'old', + 'olive', + 'olympic', + 'omit', + 'once', + 'one', + 'onion', + 'online', + 'only', + 'open', + 'opera', + 'opinion', + 'oppose', + 'option', + 'orange', + 'orbit', + 'orchard', + 'order', + 'ordinary', + 'organ', + 'orient', + 'original', + 'orphan', + 'ostrich', + 'other', + 'outdoor', + 'outer', + 'output', + 'outside', + 'oval', + 'oven', + 'over', + 'own', + 'owner', + 'oxygen', + 'oyster', + 'ozone', + 'pact', + 'paddle', + 'page', + 'pair', + 'palace', + 'palm', + 'panda', + 'panel', + 'panic', + 'panther', + 'paper', + 'parade', + 'parent', + 'park', + 'parrot', + 'party', + 'pass', + 'patch', + 'path', + 'patient', + 'patrol', + 'pattern', + 'pause', + 'pave', + 'payment', + 'peace', + 'peanut', + 'pear', + 'peasant', + 'pelican', + 'pen', + 'penalty', + 'pencil', + 'people', + 'pepper', + 'perfect', + 'permit', + 'person', + 'pet', + 'phone', + 'photo', + 'phrase', + 'physical', + 'piano', + 'picnic', + 'picture', + 'piece', + 'pig', + 'pigeon', + 'pill', + 'pilot', + 'pink', + 'pioneer', + 'pipe', + 'pistol', + 'pitch', + 'pizza', + 'place', + 'planet', + 'plastic', + 'plate', + 'play', + 'please', + 'pledge', + 'pluck', + 'plug', + 'plunge', + 'poem', + 'poet', + 'point', + 'polar', + 'pole', + 'police', + 'pond', + 'pony', + 'pool', + 'popular', + 'portion', + 'position', + 'possible', + 'post', + 'potato', + 'pottery', + 'poverty', + 'powder', + 'power', + 'practice', + 'praise', + 'predict', + 'prefer', + 'prepare', + 'present', + 'pretty', + 'prevent', + 'price', + 'pride', + 'primary', + 'print', + 'priority', + 'prison', + 'private', + 'prize', + 'problem', + 'process', + 'produce', + 'profit', + 'program', + 'project', + 'promote', + 'proof', + 'property', + 'prosper', + 'protect', + 'proud', + 'provide', + 'public', + 'pudding', + 'pull', + 'pulp', + 'pulse', + 'pumpkin', + 'punch', + 'pupil', + 'puppy', + 'purchase', + 'purity', + 'purpose', + 'purse', + 'push', + 'put', + 'puzzle', + 'pyramid', + 'quality', + 'quantum', + 'quarter', + 'question', + 'quick', + 'quit', + 'quiz', + 'quote', + 'rabbit', + 'raccoon', + 'race', + 'rack', + 'radar', + 'radio', + 'rail', + 'rain', + 'raise', + 'rally', + 'ramp', + 'ranch', + 'random', + 'range', + 'rapid', + 'rare', + 'rate', + 'rather', + 'raven', + 'raw', + 'razor', + 'ready', + 'real', + 'reason', + 'rebel', + 'rebuild', + 'recall', + 'receive', + 'recipe', + 'record', + 'recycle', + 'reduce', + 'reflect', + 'reform', + 'refuse', + 'region', + 'regret', + 'regular', + 'reject', + 'relax', + 'release', + 'relief', + 'rely', + 'remain', + 'remember', + 'remind', + 'remove', + 'render', + 'renew', + 'rent', + 'reopen', + 'repair', + 'repeat', + 'replace', + 'report', + 'require', + 'rescue', + 'resemble', + 'resist', + 'resource', + 'response', + 'result', + 'retire', + 'retreat', + 'return', + 'reunion', + 'reveal', + 'review', + 'reward', + 'rhythm', + 'rib', + 'ribbon', + 'rice', + 'rich', + 'ride', + 'ridge', + 'rifle', + 'right', + 'rigid', + 'ring', + 'riot', + 'ripple', + 'risk', + 'ritual', + 'rival', + 'river', + 'road', + 'roast', + 'robot', + 'robust', + 'rocket', + 'romance', + 'roof', + 'rookie', + 'room', + 'rose', + 'rotate', + 'rough', + 'round', + 'route', + 'royal', + 'rubber', + 'rude', + 'rug', + 'rule', + 'run', + 'runway', + 'rural', + 'sad', + 'saddle', + 'sadness', + 'safe', + 'sail', + 'salad', + 'salmon', + 'salon', + 'salt', + 'salute', + 'same', + 'sample', + 'sand', + 'satisfy', + 'satoshi', + 'sauce', + 'sausage', + 'save', + 'say', + 'scale', + 'scan', + 'scare', + 'scatter', + 'scene', + 'scheme', + 'school', + 'science', + 'scissors', + 'scorpion', + 'scout', + 'scrap', + 'screen', + 'script', + 'scrub', + 'sea', + 'search', + 'season', + 'seat', + 'second', + 'secret', + 'section', + 'security', + 'seed', + 'seek', + 'segment', + 'select', + 'sell', + 'seminar', + 'senior', + 'sense', + 'sentence', + 'series', + 'service', + 'session', + 'settle', + 'setup', + 'seven', + 'shadow', + 'shaft', + 'shallow', + 'share', + 'shed', + 'shell', + 'sheriff', + 'shield', + 'shift', + 'shine', + 'ship', + 'shiver', + 'shock', + 'shoe', + 'shoot', + 'shop', + 'short', + 'shoulder', + 'shove', + 'shrimp', + 'shrug', + 'shuffle', + 'shy', + 'sibling', + 'sick', + 'side', + 'siege', + 'sight', + 'sign', + 'silent', + 'silk', + 'silly', + 'silver', + 'similar', + 'simple', + 'since', + 'sing', + 'siren', + 'sister', + 'situate', + 'six', + 'size', + 'skate', + 'sketch', + 'ski', + 'skill', + 'skin', + 'skirt', + 'skull', + 'slab', + 'slam', + 'sleep', + 'slender', + 'slice', + 'slide', + 'slight', + 'slim', + 'slogan', + 'slot', + 'slow', + 'slush', + 'small', + 'smart', + 'smile', + 'smoke', + 'smooth', + 'snack', + 'snake', + 'snap', + 'sniff', + 'snow', + 'soap', + 'soccer', + 'social', + 'sock', + 'soda', + 'soft', + 'solar', + 'soldier', + 'solid', + 'solution', + 'solve', + 'someone', + 'song', + 'soon', + 'sorry', + 'sort', + 'soul', + 'sound', + 'soup', + 'source', + 'south', + 'space', + 'spare', + 'spatial', + 'spawn', + 'speak', + 'special', + 'speed', + 'spell', + 'spend', + 'sphere', + 'spice', + 'spider', + 'spike', + 'spin', + 'spirit', + 'split', + 'spoil', + 'sponsor', + 'spoon', + 'sport', + 'spot', + 'spray', + 'spread', + 'spring', + 'spy', + 'square', + 'squeeze', + 'squirrel', + 'stable', + 'stadium', + 'staff', + 'stage', + 'stairs', + 'stamp', + 'stand', + 'start', + 'state', + 'stay', + 'steak', + 'steel', + 'stem', + 'step', + 'stereo', + 'stick', + 'still', + 'sting', + 'stock', + 'stomach', + 'stone', + 'stool', + 'story', + 'stove', + 'strategy', + 'street', + 'strike', + 'strong', + 'struggle', + 'student', + 'stuff', + 'stumble', + 'style', + 'subject', + 'submit', + 'subway', + 'success', + 'such', + 'sudden', + 'suffer', + 'sugar', + 'suggest', + 'suit', + 'summer', + 'sun', + 'sunny', + 'sunset', + 'super', + 'supply', + 'supreme', + 'sure', + 'surface', + 'surge', + 'surprise', + 'surround', + 'survey', + 'suspect', + 'sustain', + 'swallow', + 'swamp', + 'swap', + 'swarm', + 'swear', + 'sweet', + 'swift', + 'swim', + 'swing', + 'switch', + 'sword', + 'symbol', + 'symptom', + 'syrup', + 'system', + 'table', + 'tackle', + 'tag', + 'tail', + 'talent', + 'talk', + 'tank', + 'tape', + 'target', + 'task', + 'taste', + 'tattoo', + 'taxi', + 'teach', + 'team', + 'tell', + 'ten', + 'tenant', + 'tennis', + 'tent', + 'term', + 'test', + 'text', + 'thank', + 'that', + 'theme', + 'then', + 'theory', + 'there', + 'they', + 'thing', + 'this', + 'thought', + 'three', + 'thrive', + 'throw', + 'thumb', + 'thunder', + 'ticket', + 'tide', + 'tiger', + 'tilt', + 'timber', + 'time', + 'tiny', + 'tip', + 'tired', + 'tissue', + 'title', + 'toast', + 'tobacco', + 'today', + 'toddler', + 'toe', + 'together', + 'toilet', + 'token', + 'tomato', + 'tomorrow', + 'tone', + 'tongue', + 'tonight', + 'tool', + 'tooth', + 'top', + 'topic', + 'topple', + 'torch', + 'tornado', + 'tortoise', + 'toss', + 'total', + 'tourist', + 'toward', + 'tower', + 'town', + 'toy', + 'track', + 'trade', + 'traffic', + 'tragic', + 'train', + 'transfer', + 'trap', + 'trash', + 'travel', + 'tray', + 'treat', + 'tree', + 'trend', + 'trial', + 'tribe', + 'trick', + 'trigger', + 'trim', + 'trip', + 'trophy', + 'trouble', + 'truck', + 'true', + 'truly', + 'trumpet', + 'trust', + 'truth', + 'try', + 'tube', + 'tuition', + 'tumble', + 'tuna', + 'tunnel', + 'turkey', + 'turn', + 'turtle', + 'twelve', + 'twenty', + 'twice', + 'twin', + 'twist', + 'two', + 'type', + 'typical', + 'ugly', + 'umbrella', + 'unable', + 'unaware', + 'uncle', + 'uncover', + 'under', + 'undo', + 'unfair', + 'unfold', + 'unhappy', + 'uniform', + 'unique', + 'unit', + 'universe', + 'unknown', + 'unlock', + 'until', + 'unusual', + 'unveil', + 'update', + 'upgrade', + 'uphold', + 'upon', + 'upper', + 'upset', + 'urban', + 'urge', + 'usage', + 'use', + 'used', + 'useful', + 'useless', + 'usual', + 'utility', + 'vacant', + 'vacuum', + 'vague', + 'valid', + 'valley', + 'valve', + 'van', + 'vanish', + 'vapor', + 'various', + 'vast', + 'vault', + 'vehicle', + 'velvet', + 'vendor', + 'venture', + 'venue', + 'verb', + 'verify', + 'version', + 'very', + 'vessel', + 'veteran', + 'viable', + 'vibrant', + 'vicious', + 'victory', + 'video', + 'view', + 'village', + 'vintage', + 'violin', + 'virtual', + 'virus', + 'visa', + 'visit', + 'visual', + 'vital', + 'vivid', + 'vocal', + 'voice', + 'void', + 'volcano', + 'volume', + 'vote', + 'voyage', + 'wage', + 'wagon', + 'wait', + 'walk', + 'wall', + 'walnut', + 'want', + 'warfare', + 'warm', + 'warrior', + 'wash', + 'wasp', + 'waste', + 'water', + 'wave', + 'way', + 'wealth', + 'weapon', + 'wear', + 'weasel', + 'weather', + 'web', + 'wedding', + 'weekend', + 'weird', + 'welcome', + 'west', + 'wet', + 'whale', + 'what', + 'wheat', + 'wheel', + 'when', + 'where', + 'whip', + 'whisper', + 'wide', + 'width', + 'wife', + 'wild', + 'will', + 'win', + 'window', + 'wine', + 'wing', + 'wink', + 'winner', + 'winter', + 'wire', + 'wisdom', + 'wise', + 'wish', + 'witness', + 'wolf', + 'woman', + 'wonder', + 'wood', + 'wool', + 'word', + 'work', + 'world', + 'worry', + 'worth', + 'wrap', + 'wreck', + 'wrestle', + 'wrist', + 'write', + 'wrong', + 'yard', + 'year', + 'yellow', + 'you', + 'young', + 'youth', + 'zebra', + 'zero', + 'zone', + 'zoo' +]) diff --git a/lnbits/extensions/watchonly/static/js/crypto/aes.js b/lnbits/extensions/watchonly/static/js/crypto/aes.js new file mode 100644 index 00000000..92a17ca2 --- /dev/null +++ b/lnbits/extensions/watchonly/static/js/crypto/aes.js @@ -0,0 +1,802 @@ +/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ +(function(root) { + "use strict"; + + function checkInt(value) { + return (parseInt(value) === value); + } + + function checkInts(arrayish) { + if (!checkInt(arrayish.length)) { return false; } + + for (var i = 0; i < arrayish.length; i++) { + if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { + return false; + } + } + + return true; + } + + function coerceArray(arg, copy) { + + // ArrayBuffer view + if (arg.buffer && arg.name === 'Uint8Array') { + + if (copy) { + if (arg.slice) { + arg = arg.slice(); + } else { + arg = Array.prototype.slice.call(arg); + } + } + + return arg; + } + + // It's an array; check it is a valid representation of a byte + if (Array.isArray(arg)) { + if (!checkInts(arg)) { + throw new Error('Array contains invalid value: ' + arg); + } + + return new Uint8Array(arg); + } + + // Something else, but behaves like an array (maybe a Buffer? Arguments?) + if (checkInt(arg.length) && checkInts(arg)) { + return new Uint8Array(arg); + } + throw new Error('unsupported array-like object'); + } + + function createArray(length) { + return new Uint8Array(length); + } + + function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { + if (sourceStart != null || sourceEnd != null) { + if (sourceArray.slice) { + sourceArray = sourceArray.slice(sourceStart, sourceEnd); + } else { + sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); + } + } + targetArray.set(sourceArray, targetStart); + } + + + + var convertUtf8 = (function() { + function toBytes(text) { + var result = [], i = 0; + text = encodeURI(text); + while (i < text.length) { + var c = text.charCodeAt(i++); + + // if it is a % sign, encode the following 2 bytes as a hex value + if (c === 37) { + result.push(parseInt(text.substr(i, 2), 16)) + i += 2; + + // otherwise, just the actual byte + } else { + result.push(c) + } + } + + return coerceArray(result); + } + + function fromBytes(bytes) { + var result = [], i = 0; + + while (i < bytes.length) { + var c = bytes[i]; + + if (c < 128) { + result.push(String.fromCharCode(c)); + i++; + } else if (c > 191 && c < 224) { + result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); + i += 2; + } else { + result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); + i += 3; + } + } + + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + var convertHex = (function() { + function toBytes(text) { + var result = []; + for (var i = 0; i < text.length; i += 2) { + result.push(parseInt(text.substr(i, 2), 16)); + } + + return result; + } + + // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html + var Hex = '0123456789abcdef'; + + function fromBytes(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i++) { + var v = bytes[i]; + result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); + } + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + + // Number of rounds by keysize + var numberOfRounds = {16: 10, 24: 12, 32: 14} + + // Round constant words + var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; + + // S-box and Inverse S-box (S is for Substitution) + var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]; + var Si =[0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; + + // Transformations for encryption + var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; + var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; + var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; + var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; + + // Transformations for decryption + var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; + var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; + var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; + var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; + + // Transformations for decryption key expansion + var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; + var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; + var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; + var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; + + function convertToInt32(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i += 4) { + result.push( + (bytes[i ] << 24) | + (bytes[i + 1] << 16) | + (bytes[i + 2] << 8) | + bytes[i + 3] + ); + } + return result; + } + + var AES = function(key) { + if (!(this instanceof AES)) { + throw Error('AES must be instanitated with `new`'); + } + + Object.defineProperty(this, 'key', { + value: coerceArray(key, true) + }); + + this._prepare(); + } + + + AES.prototype._prepare = function() { + + var rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); + } + + // encryption round keys + this._Ke = []; + + // decryption round keys + this._Kd = []; + + for (var i = 0; i <= rounds; i++) { + this._Ke.push([0, 0, 0, 0]); + this._Kd.push([0, 0, 0, 0]); + } + + var roundKeyCount = (rounds + 1) * 4; + var KC = this.key.length / 4; + + // convert the key into ints + var tk = convertToInt32(this.key); + + // copy values into round key arrays + var index; + for (var i = 0; i < KC; i++) { + index = i >> 2; + this._Ke[index][i % 4] = tk[i]; + this._Kd[rounds - index][i % 4] = tk[i]; + } + + // key expansion (fips-197 section 5.2) + var rconpointer = 0; + var t = KC, tt; + while (t < roundKeyCount) { + tt = tk[KC - 1]; + tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ + (S[(tt >> 8) & 0xFF] << 16) ^ + (S[ tt & 0xFF] << 8) ^ + S[(tt >> 24) & 0xFF] ^ + (rcon[rconpointer] << 24)); + rconpointer += 1; + + // key expansion (for non-256 bit) + if (KC != 8) { + for (var i = 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + + // key expansion for 256-bit keys is "slightly different" (fips-197) + } else { + for (var i = 1; i < (KC / 2); i++) { + tk[i] ^= tk[i - 1]; + } + tt = tk[(KC / 2) - 1]; + + tk[KC / 2] ^= (S[ tt & 0xFF] ^ + (S[(tt >> 8) & 0xFF] << 8) ^ + (S[(tt >> 16) & 0xFF] << 16) ^ + (S[(tt >> 24) & 0xFF] << 24)); + + for (var i = (KC / 2) + 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + } + + // copy values into round key arrays + var i = 0, r, c; + while (i < KC && t < roundKeyCount) { + r = t >> 2; + c = t % 4; + this._Ke[r][c] = tk[i]; + this._Kd[rounds - r][c] = tk[i++]; + t++; + } + } + + // inverse-cipher-ify the decryption round key (fips-197 section 5.3) + for (var r = 1; r < rounds; r++) { + for (var c = 0; c < 4; c++) { + tt = this._Kd[r][c]; + this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ + U2[(tt >> 16) & 0xFF] ^ + U3[(tt >> 8) & 0xFF] ^ + U4[ tt & 0xFF]); + } + } + } + + AES.prototype.encrypt = function(plaintext) { + if (plaintext.length != 16) { + throw new Error('invalid plaintext size (must be 16 bytes)'); + } + + var rounds = this._Ke.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(plaintext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Ke[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ + T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ + T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T4[ t[(i + 3) % 4] & 0xff] ^ + this._Ke[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Ke[rounds][i]; + result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + } + + AES.prototype.decrypt = function(ciphertext) { + if (ciphertext.length != 16) { + throw new Error('invalid ciphertext size (must be 16 bytes)'); + } + + var rounds = this._Kd.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(ciphertext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Kd[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ + T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ + T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T8[ t[(i + 1) % 4] & 0xff] ^ + this._Kd[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Kd[rounds][i]; + result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + } + + + /** + * Mode Of Operation - Electonic Codebook (ECB) + */ + var ModeOfOperationECB = function(key) { + if (!(this instanceof ModeOfOperationECB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Electronic Code Block"; + this.name = "ecb"; + + this._aes = new AES(key); + } + + ModeOfOperationECB.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + block = this._aes.encrypt(block); + copyArray(block, ciphertext, i); + } + + return ciphertext; + } + + ModeOfOperationECB.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + copyArray(block, plaintext, i); + } + + return plaintext; + } + + + /** + * Mode Of Operation - Cipher Block Chaining (CBC) + */ + var ModeOfOperationCBC = function(key, iv) { + if (!(this instanceof ModeOfOperationCBC)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Block Chaining"; + this.name = "cbc"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastCipherblock = coerceArray(iv, true); + + this._aes = new AES(key); + } + + ModeOfOperationCBC.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + + for (var j = 0; j < 16; j++) { + block[j] ^= this._lastCipherblock[j]; + } + + this._lastCipherblock = this._aes.encrypt(block); + copyArray(this._lastCipherblock, ciphertext, i); + } + + return ciphertext; + } + + ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + + for (var j = 0; j < 16; j++) { + plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; + } + + copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); + } + + return plaintext; + } + + + /** + * Mode Of Operation - Cipher Feedback (CFB) + */ + var ModeOfOperationCFB = function(key, iv, segmentSize) { + if (!(this instanceof ModeOfOperationCFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Feedback"; + this.name = "cfb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 size)'); + } + + if (!segmentSize) { segmentSize = 1; } + + this.segmentSize = segmentSize; + + this._shiftRegister = coerceArray(iv, true); + + this._aes = new AES(key); + } + + ModeOfOperationCFB.prototype.encrypt = function(plaintext) { + if ((plaintext.length % this.segmentSize) != 0) { + throw new Error('invalid plaintext size (must be segmentSize bytes)'); + } + + var encrypted = coerceArray(plaintext, true); + + var xorSegment; + for (var i = 0; i < encrypted.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + encrypted[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return encrypted; + } + + ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { + if ((ciphertext.length % this.segmentSize) != 0) { + throw new Error('invalid ciphertext size (must be segmentSize bytes)'); + } + + var plaintext = coerceArray(ciphertext, true); + + var xorSegment; + for (var i = 0; i < plaintext.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + + for (var j = 0; j < this.segmentSize; j++) { + plaintext[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return plaintext; + } + + /** + * Mode Of Operation - Output Feedback (OFB) + */ + var ModeOfOperationOFB = function(key, iv) { + if (!(this instanceof ModeOfOperationOFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Output Feedback"; + this.name = "ofb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastPrecipher = coerceArray(iv, true); + this._lastPrecipherIndex = 16; + + this._aes = new AES(key); + } + + ModeOfOperationOFB.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._lastPrecipherIndex === 16) { + this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); + this._lastPrecipherIndex = 0; + } + encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; + } + + return encrypted; + } + + // Decryption is symetric + ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; + + + /** + * Counter object for CTR common mode of operation + */ + var Counter = function(initialValue) { + if (!(this instanceof Counter)) { + throw Error('Counter must be instanitated with `new`'); + } + + // We allow 0, but anything false-ish uses the default 1 + if (initialValue !== 0 && !initialValue) { initialValue = 1; } + + if (typeof(initialValue) === 'number') { + this._counter = createArray(16); + this.setValue(initialValue); + + } else { + this.setBytes(initialValue); + } + } + + Counter.prototype.setValue = function(value) { + if (typeof(value) !== 'number' || parseInt(value) != value) { + throw new Error('invalid counter value (must be an integer)'); + } + + // We cannot safely handle numbers beyond the safe range for integers + if (value > Number.MAX_SAFE_INTEGER) { + throw new Error('integer value out of safe range'); + } + + for (var index = 15; index >= 0; --index) { + this._counter[index] = value % 256; + value = parseInt(value / 256); + } + } + + Counter.prototype.setBytes = function(bytes) { + bytes = coerceArray(bytes, true); + + if (bytes.length != 16) { + throw new Error('invalid counter bytes size (must be 16 bytes)'); + } + + this._counter = bytes; + }; + + Counter.prototype.increment = function() { + for (var i = 15; i >= 0; i--) { + if (this._counter[i] === 255) { + this._counter[i] = 0; + } else { + this._counter[i]++; + break; + } + } + } + + + /** + * Mode Of Operation - Counter (CTR) + */ + var ModeOfOperationCTR = function(key, counter) { + if (!(this instanceof ModeOfOperationCTR)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Counter"; + this.name = "ctr"; + + if (!(counter instanceof Counter)) { + counter = new Counter(counter) + } + + this._counter = counter; + + this._remainingCounter = null; + this._remainingCounterIndex = 16; + + this._aes = new AES(key); + } + + ModeOfOperationCTR.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._remainingCounterIndex === 16) { + this._remainingCounter = this._aes.encrypt(this._counter._counter); + this._remainingCounterIndex = 0; + this._counter.increment(); + } + encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; + } + + return encrypted; + } + + // Decryption is symetric + ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; + + + /////////////////////// + // Padding + + // See:https://tools.ietf.org/html/rfc2315 + function pkcs7pad(data) { + data = coerceArray(data, true); + var padder = 16 - (data.length % 16); + var result = createArray(data.length + padder); + copyArray(data, result); + for (var i = data.length; i < result.length; i++) { + result[i] = padder; + } + return result; + } + + function pkcs7strip(data) { + data = coerceArray(data, true); + if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } + + var padder = data[data.length - 1]; + if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } + + var length = data.length - padder; + for (var i = 0; i < padder; i++) { + if (data[length + i] !== padder) { + throw new Error('PKCS#7 invalid padding byte'); + } + } + + var result = createArray(length); + copyArray(data, result, 0, 0, length); + return result; + } + + /////////////////////// + // Exporting + + + // The block cipher + var aesjs = { + AES: AES, + Counter: Counter, + + ModeOfOperation: { + ecb: ModeOfOperationECB, + cbc: ModeOfOperationCBC, + cfb: ModeOfOperationCFB, + ofb: ModeOfOperationOFB, + ctr: ModeOfOperationCTR + }, + + utils: { + hex: convertHex, + utf8: convertUtf8 + }, + + padding: { + pkcs7: { + pad: pkcs7pad, + strip: pkcs7strip + } + }, + + _arrayTest: { + coerceArray: coerceArray, + createArray: createArray, + copyArray: copyArray, + } + }; + + + // node.js + if (typeof exports !== 'undefined') { + module.exports = aesjs + + // RequireJS/AMD + // http://www.requirejs.org/docs/api.html + // https://github.com/amdjs/amdjs-api/wiki/AMD + } else if (typeof(define) === 'function' && define.amd) { + define([], function() { return aesjs; }); + + // Web Browsers + } else { + + // If there was an existing library at "aesjs" make sure it's still available + if (root.aesjs) { + aesjs._aesjs = root.aesjs; + } + + root.aesjs = aesjs; + } + + +})(this); \ No newline at end of file diff --git a/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js b/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js new file mode 100644 index 00000000..8be86729 --- /dev/null +++ b/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js @@ -0,0 +1,1177 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.nobleSecp256k1 = {})); +})(this, (function (exports) { 'use strict'; + + const _nodeResolve_empty = {}; + + const nodeCrypto = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _nodeResolve_empty + }); + + /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ + const _0n = BigInt(0); + const _1n = BigInt(1); + const _2n = BigInt(2); + const _3n = BigInt(3); + const _8n = BigInt(8); + const POW_2_256 = _2n ** BigInt(256); + const CURVE = { + a: _0n, + b: BigInt(7), + P: POW_2_256 - _2n ** BigInt(32) - BigInt(977), + n: POW_2_256 - BigInt('432420386565659656852420866394968145599'), + h: _1n, + Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), + Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), + beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), + }; + function weistrass(x) { + const { a, b } = CURVE; + const x2 = mod(x * x); + const x3 = mod(x2 * x); + return mod(x3 + a * x + b); + } + const USE_ENDOMORPHISM = CURVE.a === _0n; + class JacobianPoint { + constructor(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + static fromAffine(p) { + if (!(p instanceof Point)) { + throw new TypeError('JacobianPoint#fromAffine: expected Point'); + } + return new JacobianPoint(p.x, p.y, _1n); + } + static toAffineBatch(points) { + const toInv = invertBatch(points.map((p) => p.z)); + return points.map((p, i) => p.toAffine(toInv[i])); + } + static normalizeZ(points) { + return JacobianPoint.toAffineBatch(points).map(JacobianPoint.fromAffine); + } + equals(other) { + if (!(other instanceof JacobianPoint)) + throw new TypeError('JacobianPoint expected'); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + const Z1Z1 = mod(Z1 ** _2n); + const Z2Z2 = mod(Z2 ** _2n); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + return U1 === U2 && S1 === S2; + } + negate() { + return new JacobianPoint(this.x, mod(-this.y), this.z); + } + double() { + const { x: X1, y: Y1, z: Z1 } = this; + const A = mod(X1 ** _2n); + const B = mod(Y1 ** _2n); + const C = mod(B ** _2n); + const D = mod(_2n * (mod((X1 + B) ** _2n) - A - C)); + const E = mod(_3n * A); + const F = mod(E ** _2n); + const X3 = mod(F - _2n * D); + const Y3 = mod(E * (D - X3) - _8n * C); + const Z3 = mod(_2n * Y1 * Z1); + return new JacobianPoint(X3, Y3, Z3); + } + add(other) { + if (!(other instanceof JacobianPoint)) + throw new TypeError('JacobianPoint expected'); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + if (X2 === _0n || Y2 === _0n) + return this; + if (X1 === _0n || Y1 === _0n) + return other; + const Z1Z1 = mod(Z1 ** _2n); + const Z2Z2 = mod(Z2 ** _2n); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + const H = mod(U2 - U1); + const r = mod(S2 - S1); + if (H === _0n) { + if (r === _0n) { + return this.double(); + } + else { + return JacobianPoint.ZERO; + } + } + const HH = mod(H ** _2n); + const HHH = mod(H * HH); + const V = mod(U1 * HH); + const X3 = mod(r ** _2n - HHH - _2n * V); + const Y3 = mod(r * (V - X3) - S1 * HHH); + const Z3 = mod(Z1 * Z2 * H); + return new JacobianPoint(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + multiplyUnsafe(scalar) { + const P0 = JacobianPoint.ZERO; + if (typeof scalar === 'bigint' && scalar === _0n) + return P0; + let n = normalizeScalar(scalar); + if (n === _1n) + return this; + if (!USE_ENDOMORPHISM) { + let p = P0; + let d = this; + while (n > _0n) { + if (n & _1n) + p = p.add(d); + d = d.double(); + n >>= _1n; + } + return p; + } + let { k1neg, k1, k2neg, k2 } = splitScalarEndo(n); + let k1p = P0; + let k2p = P0; + let d = this; + while (k1 > _0n || k2 > _0n) { + if (k1 & _1n) + k1p = k1p.add(d); + if (k2 & _1n) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n; + k2 >>= _1n; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new JacobianPoint(mod(k2p.x * CURVE.beta), k2p.y, k2p.z); + return k1p.add(k2p); + } + precomputeWindow(W) { + const windows = USE_ENDOMORPHISM ? 128 / W + 1 : 256 / W + 1; + const points = []; + let p = this; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < 2 ** (W - 1); i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + } + wNAF(n, affinePoint) { + if (!affinePoint && this.equals(JacobianPoint.BASE)) + affinePoint = Point.BASE; + const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; + if (256 % W) { + throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); + } + let precomputes = affinePoint && pointPrecomputes.get(affinePoint); + if (!precomputes) { + precomputes = this.precomputeWindow(W); + if (affinePoint && W !== 1) { + precomputes = JacobianPoint.normalizeZ(precomputes); + pointPrecomputes.set(affinePoint, precomputes); + } + } + let p = JacobianPoint.ZERO; + let f = JacobianPoint.ZERO; + const windows = 1 + (USE_ENDOMORPHISM ? 128 / W : 256 / W); + const windowSize = 2 ** (W - 1); + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n; + } + if (wbits === 0) { + let pr = precomputes[offset]; + if (window % 2) + pr = pr.negate(); + f = f.add(pr); + } + else { + let cached = precomputes[offset + Math.abs(wbits) - 1]; + if (wbits < 0) + cached = cached.negate(); + p = p.add(cached); + } + } + return { p, f }; + } + multiply(scalar, affinePoint) { + let n = normalizeScalar(scalar); + let point; + let fake; + if (USE_ENDOMORPHISM) { + const { k1neg, k1, k2neg, k2 } = splitScalarEndo(n); + let { p: k1p, f: f1p } = this.wNAF(k1, affinePoint); + let { p: k2p, f: f2p } = this.wNAF(k2, affinePoint); + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new JacobianPoint(mod(k2p.x * CURVE.beta), k2p.y, k2p.z); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } + else { + const { p, f } = this.wNAF(n, affinePoint); + point = p; + fake = f; + } + return JacobianPoint.normalizeZ([point, fake])[0]; + } + toAffine(invZ = invert(this.z)) { + const { x, y, z } = this; + const iz1 = invZ; + const iz2 = mod(iz1 * iz1); + const iz3 = mod(iz2 * iz1); + const ax = mod(x * iz2); + const ay = mod(y * iz3); + const zz = mod(z * iz1); + if (zz !== _1n) + throw new Error('invZ was invalid'); + return new Point(ax, ay); + } + } + JacobianPoint.BASE = new JacobianPoint(CURVE.Gx, CURVE.Gy, _1n); + JacobianPoint.ZERO = new JacobianPoint(_0n, _1n, _0n); + const pointPrecomputes = new WeakMap(); + class Point { + constructor(x, y) { + this.x = x; + this.y = y; + } + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + static fromCompressedHex(bytes) { + const isShort = bytes.length === 32; + const x = bytesToNumber(isShort ? bytes : bytes.subarray(1)); + if (!isValidFieldElement(x)) + throw new Error('Point is not on curve'); + const y2 = weistrass(x); + let y = sqrtMod(y2); + const isYOdd = (y & _1n) === _1n; + if (isShort) { + if (isYOdd) + y = mod(-y); + } + else { + const isFirstByteOdd = (bytes[0] & 1) === 1; + if (isFirstByteOdd !== isYOdd) + y = mod(-y); + } + const point = new Point(x, y); + point.assertValidity(); + return point; + } + static fromUncompressedHex(bytes) { + const x = bytesToNumber(bytes.subarray(1, 33)); + const y = bytesToNumber(bytes.subarray(33, 65)); + const point = new Point(x, y); + point.assertValidity(); + return point; + } + static fromHex(hex) { + const bytes = ensureBytes(hex); + const len = bytes.length; + const header = bytes[0]; + if (len === 32 || (len === 33 && (header === 0x02 || header === 0x03))) { + return this.fromCompressedHex(bytes); + } + if (len === 65 && header === 0x04) + return this.fromUncompressedHex(bytes); + throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${len}`); + } + static fromPrivateKey(privateKey) { + return Point.BASE.multiply(normalizePrivateKey(privateKey)); + } + static fromSignature(msgHash, signature, recovery) { + msgHash = ensureBytes(msgHash); + const h = truncateHash(msgHash); + const { r, s } = normalizeSignature(signature); + if (recovery !== 0 && recovery !== 1) { + throw new Error('Cannot recover signature: invalid recovery bit'); + } + const prefix = recovery & 1 ? '03' : '02'; + const R = Point.fromHex(prefix + numTo32bStr(r)); + const { n } = CURVE; + const rinv = invert(r, n); + const u1 = mod(-h * rinv, n); + const u2 = mod(s * rinv, n); + const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error('Cannot recover signature: point at infinify'); + Q.assertValidity(); + return Q; + } + toRawBytes(isCompressed = false) { + return hexToBytes(this.toHex(isCompressed)); + } + toHex(isCompressed = false) { + const x = numTo32bStr(this.x); + if (isCompressed) { + const prefix = this.y & _1n ? '03' : '02'; + return `${prefix}${x}`; + } + else { + return `04${x}${numTo32bStr(this.y)}`; + } + } + toHexX() { + return this.toHex(true).slice(2); + } + toRawX() { + return this.toRawBytes(true).slice(1); + } + assertValidity() { + const msg = 'Point is not on elliptic curve'; + const { x, y } = this; + if (!isValidFieldElement(x) || !isValidFieldElement(y)) + throw new Error(msg); + const left = mod(y * y); + const right = weistrass(x); + if (mod(left - right) !== _0n) + throw new Error(msg); + } + equals(other) { + return this.x === other.x && this.y === other.y; + } + negate() { + return new Point(this.x, mod(-this.y)); + } + double() { + return JacobianPoint.fromAffine(this).double().toAffine(); + } + add(other) { + return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(other)).toAffine(); + } + subtract(other) { + return this.add(other.negate()); + } + multiply(scalar) { + return JacobianPoint.fromAffine(this).multiply(scalar, this).toAffine(); + } + multiplyAndAddUnsafe(Q, a, b) { + const P = JacobianPoint.fromAffine(this); + const aP = a === _0n || a === _1n || this !== Point.BASE ? P.multiplyUnsafe(a) : P.multiply(a); + const bQ = JacobianPoint.fromAffine(Q).multiplyUnsafe(b); + const sum = aP.add(bQ); + return sum.equals(JacobianPoint.ZERO) ? undefined : sum.toAffine(); + } + } + Point.BASE = new Point(CURVE.Gx, CURVE.Gy); + Point.ZERO = new Point(_0n, _0n); + function sliceDER(s) { + return Number.parseInt(s[0], 16) >= 8 ? '00' + s : s; + } + function parseDERInt(data) { + if (data.length < 2 || data[0] !== 0x02) { + throw new Error(`Invalid signature integer tag: ${bytesToHex(data)}`); + } + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) { + throw new Error(`Invalid signature integer: wrong length`); + } + if (res[0] === 0x00 && res[1] <= 0x7f) { + throw new Error('Invalid signature integer: trailing length'); + } + return { data: bytesToNumber(res), left: data.subarray(len + 2) }; + } + function parseDERSignature(data) { + if (data.length < 2 || data[0] != 0x30) { + throw new Error(`Invalid signature tag: ${bytesToHex(data)}`); + } + if (data[1] !== data.length - 2) { + throw new Error('Invalid signature: incorrect length'); + } + const { data: r, left: sBytes } = parseDERInt(data.subarray(2)); + const { data: s, left: rBytesLeft } = parseDERInt(sBytes); + if (rBytesLeft.length) { + throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(rBytesLeft)}`); + } + return { r, s }; + } + class Signature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromCompact(hex) { + const arr = isUint8a(hex); + const name = 'Signature.fromCompact'; + if (typeof hex !== 'string' && !arr) + throw new TypeError(`${name}: Expected string or Uint8Array`); + const str = arr ? bytesToHex(hex) : hex; + if (str.length !== 128) + throw new Error(`${name}: Expected 64-byte hex`); + return new Signature(hexToNumber(str.slice(0, 64)), hexToNumber(str.slice(64, 128))); + } + static fromDER(hex) { + const arr = isUint8a(hex); + if (typeof hex !== 'string' && !arr) + throw new TypeError(`Signature.fromDER: Expected string or Uint8Array`); + const { r, s } = parseDERSignature(arr ? hex : hexToBytes(hex)); + return new Signature(r, s); + } + static fromHex(hex) { + return this.fromDER(hex); + } + assertValidity() { + const { r, s } = this; + if (!isWithinCurveOrder(r)) + throw new Error('Invalid Signature: r must be 0 < r < n'); + if (!isWithinCurveOrder(s)) + throw new Error('Invalid Signature: s must be 0 < s < n'); + } + hasHighS() { + const HALF = CURVE.n >> _1n; + return this.s > HALF; + } + normalizeS() { + return this.hasHighS() ? new Signature(this.r, CURVE.n - this.s) : this; + } + toDERRawBytes(isCompressed = false) { + return hexToBytes(this.toDERHex(isCompressed)); + } + toDERHex(isCompressed = false) { + const sHex = sliceDER(numberToHexUnpadded(this.s)); + if (isCompressed) + return sHex; + const rHex = sliceDER(numberToHexUnpadded(this.r)); + const rLen = numberToHexUnpadded(rHex.length / 2); + const sLen = numberToHexUnpadded(sHex.length / 2); + const length = numberToHexUnpadded(rHex.length / 2 + sHex.length / 2 + 4); + return `30${length}02${rLen}${rHex}02${sLen}${sHex}`; + } + toRawBytes() { + return this.toDERRawBytes(); + } + toHex() { + return this.toDERHex(); + } + toCompactRawBytes() { + return hexToBytes(this.toCompactHex()); + } + toCompactHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } + } + function concatBytes(...arrays) { + if (!arrays.every(isUint8a)) + throw new Error('Uint8Array list expected'); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + function isUint8a(bytes) { + return bytes instanceof Uint8Array; + } + const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); + function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); + let hex = ''; + for (let i = 0; i < uint8a.length; i++) { + hex += hexes[uint8a[i]]; + } + return hex; + } + function numTo32bStr(num) { + if (num > POW_2_256) + throw new Error('Expected number < 2^256'); + return num.toString(16).padStart(64, '0'); + } + function numTo32b(num) { + return hexToBytes(numTo32bStr(num)); + } + function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + } + function hexToNumber(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToNumber: expected string, got ' + typeof hex); + } + return BigInt(`0x${hex}`); + } + function hexToBytes(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToBytes: expected string, got ' + typeof hex); + } + if (hex.length % 2) + throw new Error('hexToBytes: received invalid unpadded hex' + hex.length); + const array = new Uint8Array(hex.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; + } + function bytesToNumber(bytes) { + return hexToNumber(bytesToHex(bytes)); + } + function ensureBytes(hex) { + return hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); + } + function normalizeScalar(num) { + if (typeof num === 'number' && Number.isSafeInteger(num) && num > 0) + return BigInt(num); + if (typeof num === 'bigint' && isWithinCurveOrder(num)) + return num; + throw new TypeError('Expected valid private scalar: 0 < scalar < curve.n'); + } + function mod(a, b = CURVE.P) { + const result = a % b; + return result >= _0n ? result : b + result; + } + function pow2(x, power) { + const { P } = CURVE; + let res = x; + while (power-- > _0n) { + res *= res; + res %= P; + } + return res; + } + function sqrtMod(x) { + const { P } = CURVE; + const _6n = BigInt(6); + const _11n = BigInt(11); + const _22n = BigInt(22); + const _23n = BigInt(23); + const _44n = BigInt(44); + const _88n = BigInt(88); + const b2 = (x * x * x) % P; + const b3 = (b2 * b2 * x) % P; + const b6 = (pow2(b3, _3n) * b3) % P; + const b9 = (pow2(b6, _3n) * b3) % P; + const b11 = (pow2(b9, _2n) * b2) % P; + const b22 = (pow2(b11, _11n) * b11) % P; + const b44 = (pow2(b22, _22n) * b22) % P; + const b88 = (pow2(b44, _44n) * b44) % P; + const b176 = (pow2(b88, _88n) * b88) % P; + const b220 = (pow2(b176, _44n) * b44) % P; + const b223 = (pow2(b220, _3n) * b3) % P; + const t1 = (pow2(b223, _23n) * b22) % P; + const t2 = (pow2(t1, _6n) * b2) % P; + return pow2(t2, _2n); + } + function invert(number, modulo = CURVE.P) { + if (number === _0n || modulo <= _0n) { + throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); + } + let a = mod(number, modulo); + let b = modulo; + let x = _0n, u = _1n; + while (a !== _0n) { + const q = b / a; + const r = b % a; + const m = x - u * q; + b = a, a = r, x = u, u = m; + } + const gcd = b; + if (gcd !== _1n) + throw new Error('invert: does not exist'); + return mod(x, modulo); + } + function invertBatch(nums, p = CURVE.P) { + const scratch = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = acc; + return mod(acc * num, p); + }, _1n); + const inverted = invert(lastMultiplied, p); + nums.reduceRight((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = mod(acc * scratch[i], p); + return mod(acc * num, p); + }, inverted); + return scratch; + } + const divNearest = (a, b) => (a + b / _2n) / b; + const POW_2_128 = _2n ** BigInt(128); + function splitScalarEndo(k) { + const { n } = CURVE; + const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); + const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); + const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); + const b2 = a1; + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = mod(k - c1 * a1 - c2 * a2, n); + let k2 = mod(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error('splitScalarEndo: Endomorphism failed, k=' + k); + } + return { k1neg, k1, k2neg, k2 }; + } + function truncateHash(hash) { + const { n } = CURVE; + const byteLength = hash.length; + const delta = byteLength * 8 - 256; + let h = bytesToNumber(hash); + if (delta > 0) + h = h >> BigInt(delta); + if (h >= n) + h -= n; + return h; + } + class HmacDrbg { + constructor() { + this.v = new Uint8Array(32).fill(1); + this.k = new Uint8Array(32).fill(0); + this.counter = 0; + } + hmac(...values) { + return utils.hmacSha256(this.k, ...values); + } + hmacSync(...values) { + if (typeof utils.hmacSha256Sync !== 'function') + throw new Error('utils.hmacSha256Sync is undefined, you need to set it'); + const res = utils.hmacSha256Sync(this.k, ...values); + if (res instanceof Promise) + throw new Error('To use sync sign(), ensure utils.hmacSha256 is sync'); + return res; + } + incr() { + if (this.counter >= 1000) { + throw new Error('Tried 1,000 k values for sign(), all were invalid'); + } + this.counter += 1; + } + async reseed(seed = new Uint8Array()) { + this.k = await this.hmac(this.v, Uint8Array.from([0x00]), seed); + this.v = await this.hmac(this.v); + if (seed.length === 0) + return; + this.k = await this.hmac(this.v, Uint8Array.from([0x01]), seed); + this.v = await this.hmac(this.v); + } + reseedSync(seed = new Uint8Array()) { + this.k = this.hmacSync(this.v, Uint8Array.from([0x00]), seed); + this.v = this.hmacSync(this.v); + if (seed.length === 0) + return; + this.k = this.hmacSync(this.v, Uint8Array.from([0x01]), seed); + this.v = this.hmacSync(this.v); + } + async generate() { + this.incr(); + this.v = await this.hmac(this.v); + return this.v; + } + generateSync() { + this.incr(); + this.v = this.hmacSync(this.v); + return this.v; + } + } + function isWithinCurveOrder(num) { + return _0n < num && num < CURVE.n; + } + function isValidFieldElement(num) { + return _0n < num && num < CURVE.P; + } + function kmdToSig(kBytes, m, d) { + const k = bytesToNumber(kBytes); + if (!isWithinCurveOrder(k)) + return; + const { n } = CURVE; + const q = Point.BASE.multiply(k); + const r = mod(q.x, n); + if (r === _0n) + return; + const s = mod(invert(k, n) * mod(m + d * r, n), n); + if (s === _0n) + return; + const sig = new Signature(r, s); + const recovery = (q.x === sig.r ? 0 : 2) | Number(q.y & _1n); + return { sig, recovery }; + } + function normalizePrivateKey(key) { + let num; + if (typeof key === 'bigint') { + num = key; + } + else if (typeof key === 'number' && Number.isSafeInteger(key) && key > 0) { + num = BigInt(key); + } + else if (typeof key === 'string') { + if (key.length !== 64) + throw new Error('Expected 32 bytes of private key'); + num = hexToNumber(key); + } + else if (isUint8a(key)) { + if (key.length !== 32) + throw new Error('Expected 32 bytes of private key'); + num = bytesToNumber(key); + } + else { + throw new TypeError('Expected valid private key'); + } + if (!isWithinCurveOrder(num)) + throw new Error('Expected private key: 0 < key < n'); + return num; + } + function normalizePublicKey(publicKey) { + if (publicKey instanceof Point) { + publicKey.assertValidity(); + return publicKey; + } + else { + return Point.fromHex(publicKey); + } + } + function normalizeSignature(signature) { + if (signature instanceof Signature) { + signature.assertValidity(); + return signature; + } + try { + return Signature.fromDER(signature); + } + catch (error) { + return Signature.fromCompact(signature); + } + } + function getPublicKey(privateKey, isCompressed = false) { + return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function recoverPublicKey(msgHash, signature, recovery, isCompressed = false) { + return Point.fromSignature(msgHash, signature, recovery).toRawBytes(isCompressed); + } + function isPub(item) { + const arr = isUint8a(item); + const str = typeof item === 'string'; + const len = (arr || str) && item.length; + if (arr) + return len === 33 || len === 65; + if (str) + return len === 66 || len === 130; + if (item instanceof Point) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = false) { + if (isPub(privateA)) + throw new TypeError('getSharedSecret: first arg must be private key'); + if (!isPub(publicB)) + throw new TypeError('getSharedSecret: second arg must be public key'); + const b = normalizePublicKey(publicB); + b.assertValidity(); + return b.multiply(normalizePrivateKey(privateA)).toRawBytes(isCompressed); + } + function bits2int(bytes) { + const slice = bytes.length > 32 ? bytes.slice(0, 32) : bytes; + return bytesToNumber(slice); + } + function bits2octets(bytes) { + const z1 = bits2int(bytes); + const z2 = mod(z1, CURVE.n); + return int2octets(z2 < _0n ? z1 : z2); + } + function int2octets(num) { + if (typeof num !== 'bigint') + throw new Error('Expected bigint'); + const hex = numTo32bStr(num); + return hexToBytes(hex); + } + function initSigArgs(msgHash, privateKey, extraEntropy) { + if (msgHash == null) + throw new Error(`sign: expected valid message hash, not "${msgHash}"`); + const h1 = ensureBytes(msgHash); + const d = normalizePrivateKey(privateKey); + const seedArgs = [int2octets(d), bits2octets(h1)]; + if (extraEntropy != null) { + if (extraEntropy === true) + extraEntropy = utils.randomBytes(32); + const e = ensureBytes(extraEntropy); + if (e.length !== 32) + throw new Error('sign: Expected 32 bytes of extra data'); + seedArgs.push(e); + } + const seed = concatBytes(...seedArgs); + const m = bits2int(h1); + return { seed, m, d }; + } + function finalizeSig(recSig, opts) { + let { sig, recovery } = recSig; + const { canonical, der, recovered } = Object.assign({ canonical: true, der: true }, opts); + if (canonical && sig.hasHighS()) { + sig = sig.normalizeS(); + recovery ^= 1; + } + const hashed = der ? sig.toDERRawBytes() : sig.toCompactRawBytes(); + return recovered ? [hashed, recovery] : hashed; + } + async function sign(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + let sig; + const drbg = new HmacDrbg(); + await drbg.reseed(seed); + while (!(sig = kmdToSig(await drbg.generate(), m, d))) + await drbg.reseed(); + return finalizeSig(sig, opts); + } + function signSync(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + let sig; + const drbg = new HmacDrbg(); + drbg.reseedSync(seed); + while (!(sig = kmdToSig(drbg.generateSync(), m, d))) + drbg.reseedSync(); + return finalizeSig(sig, opts); + } + const vopts = { strict: true }; + function verify(signature, msgHash, publicKey, opts = vopts) { + let sig; + try { + sig = normalizeSignature(signature); + msgHash = ensureBytes(msgHash); + } + catch (error) { + return false; + } + const { r, s } = sig; + if (opts.strict && sig.hasHighS()) + return false; + const h = truncateHash(msgHash); + let P; + try { + P = normalizePublicKey(publicKey); + } + catch (error) { + return false; + } + const { n } = CURVE; + const sinv = invert(s, n); + const u1 = mod(h * sinv, n); + const u2 = mod(r * sinv, n); + const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2); + if (!R) + return false; + const v = mod(R.x, n); + return v === r; + } + function finalizeSchnorrChallenge(ch) { + return mod(bytesToNumber(ch), CURVE.n); + } + function hasEvenY(point) { + return (point.y & _1n) === _0n; + } + class SchnorrSignature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromHex(hex) { + const bytes = ensureBytes(hex); + if (bytes.length !== 64) + throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${bytes.length}`); + const r = bytesToNumber(bytes.subarray(0, 32)); + const s = bytesToNumber(bytes.subarray(32, 64)); + return new SchnorrSignature(r, s); + } + assertValidity() { + const { r, s } = this; + if (!isValidFieldElement(r) || !isWithinCurveOrder(s)) + throw new Error('Invalid signature'); + } + toHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } + toRawBytes() { + return hexToBytes(this.toHex()); + } + } + function schnorrGetPublicKey(privateKey) { + return Point.fromPrivateKey(privateKey).toRawX(); + } + function initSchnorrSigArgs(message, privateKey, auxRand) { + if (message == null) + throw new TypeError(`sign: Expected valid message, not "${message}"`); + const m = ensureBytes(message); + const d0 = normalizePrivateKey(privateKey); + const rand = ensureBytes(auxRand); + if (rand.length !== 32) + throw new TypeError('sign: Expected 32 bytes of aux randomness'); + const P = Point.fromPrivateKey(d0); + const px = P.toRawX(); + const d = hasEvenY(P) ? d0 : CURVE.n - d0; + return { m, P, px, d, rand }; + } + function initSchnorrNonce(d, t0h) { + return numTo32b(d ^ bytesToNumber(t0h)); + } + function finalizeSchnorrNonce(k0h) { + const k0 = mod(bytesToNumber(k0h), CURVE.n); + if (k0 === _0n) + throw new Error('sign: Creation of signature failed. k is zero'); + const R = Point.fromPrivateKey(k0); + const rx = R.toRawX(); + const k = hasEvenY(R) ? k0 : CURVE.n - k0; + return { R, rx, k }; + } + function finalizeSchnorrSig(R, k, e, d) { + return new SchnorrSignature(R.x, mod(k + e * d, CURVE.n)).toRawBytes(); + } + async function schnorrSign(message, privateKey, auxRand = utils.randomBytes()) { + const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand); + const t = initSchnorrNonce(d, await utils.taggedHash(TAGS.aux, rand)); + const { R, rx, k } = finalizeSchnorrNonce(await utils.taggedHash(TAGS.nonce, t, px, m)); + const e = finalizeSchnorrChallenge(await utils.taggedHash(TAGS.challenge, rx, px, m)); + const sig = finalizeSchnorrSig(R, k, e, d); + const isValid = await schnorrVerify(sig, m, px); + if (!isValid) + throw new Error('sign: Invalid signature produced'); + return sig; + } + function schnorrSignSync(message, privateKey, auxRand = utils.randomBytes()) { + const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand); + const t = initSchnorrNonce(d, utils.taggedHashSync(TAGS.aux, rand)); + const { R, rx, k } = finalizeSchnorrNonce(utils.taggedHashSync(TAGS.nonce, t, px, m)); + const e = finalizeSchnorrChallenge(utils.taggedHashSync(TAGS.challenge, rx, px, m)); + const sig = finalizeSchnorrSig(R, k, e, d); + const isValid = schnorrVerifySync(sig, m, px); + if (!isValid) + throw new Error('sign: Invalid signature produced'); + return sig; + } + function initSchnorrVerify(signature, message, publicKey) { + const raw = signature instanceof SchnorrSignature; + const sig = raw ? signature : SchnorrSignature.fromHex(signature); + if (raw) + sig.assertValidity(); + return { + ...sig, + m: ensureBytes(message), + P: normalizePublicKey(publicKey), + }; + } + function finalizeSchnorrVerify(r, P, s, e) { + const R = Point.BASE.multiplyAndAddUnsafe(P, normalizePrivateKey(s), mod(-e, CURVE.n)); + if (!R || !hasEvenY(R) || R.x !== r) + return false; + return true; + } + async function schnorrVerify(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = finalizeSchnorrChallenge(await utils.taggedHash(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + return false; + } + } + function schnorrVerifySync(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = finalizeSchnorrChallenge(utils.taggedHashSync(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + return false; + } + } + const schnorr = { + Signature: SchnorrSignature, + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + signSync: schnorrSignSync, + verifySync: schnorrVerifySync, + }; + Point.BASE._setWindowSize(8); + const crypto = { + node: nodeCrypto, + web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, + }; + const TAGS = { + challenge: 'BIP0340/challenge', + aux: 'BIP0340/aux', + nonce: 'BIP0340/nonce', + }; + const TAGGED_HASH_PREFIXES = {}; + const utils = { + isValidPrivateKey(privateKey) { + try { + normalizePrivateKey(privateKey); + return true; + } + catch (error) { + return false; + } + }, + privateAdd: (privateKey, tweak) => { + const p = normalizePrivateKey(privateKey); + const t = normalizePrivateKey(tweak); + return numTo32b(mod(p + t, CURVE.n)); + }, + privateNegate: (privateKey) => { + const p = normalizePrivateKey(privateKey); + return numTo32b(CURVE.n - p); + }, + pointAddScalar: (p, tweak, isCompressed) => { + const P = Point.fromHex(p); + const t = normalizePrivateKey(tweak); + const Q = Point.BASE.multiplyAndAddUnsafe(P, t, _1n); + if (!Q) + throw new Error('Tweaked point at infinity'); + return Q.toRawBytes(isCompressed); + }, + pointMultiply: (p, tweak, isCompressed) => { + const P = Point.fromHex(p); + const t = bytesToNumber(ensureBytes(tweak)); + return P.multiply(t).toRawBytes(isCompressed); + }, + hashToPrivateKey: (hash) => { + hash = ensureBytes(hash); + if (hash.length < 40 || hash.length > 1024) + throw new Error('Expected 40-1024 bytes of private key as per FIPS 186'); + const num = mod(bytesToNumber(hash), CURVE.n - _1n) + _1n; + return numTo32b(num); + }, + randomBytes: (bytesLength = 32) => { + if (crypto.web) { + return crypto.web.getRandomValues(new Uint8Array(bytesLength)); + } + else if (crypto.node) { + const { randomBytes } = crypto.node; + return Uint8Array.from(randomBytes(bytesLength)); + } + else { + throw new Error("The environment doesn't have randomBytes function"); + } + }, + randomPrivateKey: () => { + return utils.hashToPrivateKey(utils.randomBytes(40)); + }, + bytesToHex, + hexToBytes, + concatBytes, + mod, + invert, + sha256: async (...messages) => { + if (crypto.web) { + const buffer = await crypto.web.subtle.digest('SHA-256', concatBytes(...messages)); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHash } = crypto.node; + const hash = createHash('sha256'); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have sha256 function"); + } + }, + hmacSha256: async (key, ...messages) => { + if (crypto.web) { + const ckey = await crypto.web.subtle.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']); + const message = concatBytes(...messages); + const buffer = await crypto.web.subtle.sign('HMAC', ckey, message); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHmac } = crypto.node; + const hash = createHmac('sha256', key); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have hmac-sha256 function"); + } + }, + sha256Sync: undefined, + hmacSha256Sync: undefined, + taggedHash: async (tag, ...messages) => { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = await utils.sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return utils.sha256(tagP, ...messages); + }, + taggedHashSync: (tag, ...messages) => { + if (typeof utils.sha256Sync !== 'function') + throw new Error('utils.sha256Sync is undefined, you need to set it'); + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = utils.sha256Sync(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return utils.sha256Sync(tagP, ...messages); + }, + precompute(windowSize = 8, point = Point.BASE) { + const cached = point === Point.BASE ? point : new Point(point.x, point.y); + cached._setWindowSize(windowSize); + cached.multiply(_3n); + return cached; + }, + }; + + exports.CURVE = CURVE; + exports.Point = Point; + exports.Signature = Signature; + exports.getPublicKey = getPublicKey; + exports.getSharedSecret = getSharedSecret; + exports.recoverPublicKey = recoverPublicKey; + exports.schnorr = schnorr; + exports.sign = sign; + exports.signSync = signSync; + exports.utils = utils; + exports.verify = verify; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 5eee2176..7e410104 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -1,735 +1,423 @@ -Vue.component(VueQrcode.name, VueQrcode) +const watchOnly = async () => { + Vue.component(VueQrcode.name, VueQrcode) -Vue.filter('reverse', function (value) { - // slice to make a copy of array, then reverse the copy - return value.slice().reverse() -}) + await walletConfig('static/components/wallet-config/wallet-config.html') + await walletList('static/components/wallet-list/wallet-list.html') + await addressList('static/components/address-list/address-list.html') + await history('static/components/history/history.html') + await utxoList('static/components/utxo-list/utxo-list.html') + await feeRate('static/components/fee-rate/fee-rate.html') + await seedInput('static/components/seed-input/seed-input.html') + await sendTo('static/components/send-to/send-to.html') + await payment('static/components/payment/payment.html') + await serialSigner('static/components/serial-signer/serial-signer.html') + await serialPortConfig( + 'static/components/serial-port-config/serial-port-config.html' + ) -new Vue({ - el: '#vue', - mixins: [windowMixin], - data: function () { - return { - DUST_LIMIT: 546, - filter: '', + Vue.filter('reverse', function (value) { + // slice to make a copy of array, then reverse the copy + return value.slice().reverse() + }) - scan: { - scanning: false, - scanCount: 0, - scanIndex: 0 - }, - - currentAddress: null, - - tab: 'addresses', - - config: { - data: { - mempool_endpoint: 'https://mempool.space', - receive_gap_limit: 20, - change_gap_limit: 5 + new Vue({ + el: '#vue', + mixins: [windowMixin], + data: function () { + return { + scan: { + scanning: false, + scanCount: 0, + scanIndex: 0 }, - DEFAULT_RECEIVE_GAP_LIMIT: 20, - show: false - }, - formDialog: { - show: false, - data: {} - }, + currentAddress: null, - qrCodeDialog: { - show: false, - data: null - }, - ...tables, - ...tableData - } - }, + tab: 'addresses', - methods: { - //################### CONFIG ################### - getConfig: async function () { - try { - const {data} = await LNbits.api.request( - 'GET', - '/watchonly/api/v1/config', - this.g.user.wallets[0].adminkey - ) - this.config.data = data - } catch (error) { - LNbits.utils.notifyApiError(error) + config: {sats_denominated: true}, + + qrCodeDialog: { + show: false, + data: null + }, + ...tables, + ...tableData, + + walletAccounts: [], + addresses: [], + history: [], + historyFilter: '', + + showAddress: false, + addressNote: '', + showPayment: false, + fetchedUtxos: false, + utxosFilter: '', + network: null } }, - updateConfig: async function () { - const wallet = this.g.user.wallets[0] - try { - await LNbits.api.request( - 'PUT', - '/watchonly/api/v1/config', - wallet.adminkey, - this.config.data - ) - this.config.show = false - } catch (error) { - LNbits.utils.notifyApiError(error) - } - }, - - //################### WALLETS ################### - getWalletName: function (walletId) { - const wallet = this.walletAccounts.find(wl => wl.id === walletId) - return wallet ? wallet.title : 'unknown' - }, - addWalletAccount: async function () { - const wallet = this.g.user.wallets[0] - const data = _.omit(this.formDialog.data, 'wallet') - await this.createWalletAccount(wallet, data) - }, - createWalletAccount: async function (wallet, data) { - try { - const response = await LNbits.api.request( - 'POST', - '/watchonly/api/v1/wallet', - wallet.adminkey, - data - ) - this.walletAccounts.push(mapWalletAccount(response.data)) - this.formDialog.show = false - - await this.refreshWalletAccounts() - await this.refreshAddresses() - - if (!this.payment.changeWallett) { - this.payment.changeWallet = this.walletAccounts[0] - this.selectChangeAddress(this.payment.changeWallet) + computed: { + mempoolHostname: function () { + if (!this.config.isLoaded) return + let hostname = new URL(this.config.mempool_endpoint).hostname + if (this.config.network === 'Testnet') { + hostname += '/testnet' } - } catch (error) { - LNbits.utils.notifyApiError(error) + return hostname } }, - deleteWalletAccount: function (walletAccountId) { - LNbits.utils - .confirmDialog( - 'Are you sure you want to delete this watch only wallet?' - ) - .onOk(async () => { - try { - await LNbits.api.request( - 'DELETE', - '/watchonly/api/v1/wallet/' + walletAccountId, - this.g.user.wallets[0].adminkey + + methods: { + updateAmountForAddress: async function (addressData, amount = 0) { + try { + const wallet = this.g.user.wallets[0] + addressData.amount = amount + if (!addressData.isChange) { + const addressWallet = this.walletAccounts.find( + w => w.id === addressData.wallet ) - this.walletAccounts = _.reject(this.walletAccounts, function (obj) { - return obj.id === walletAccountId - }) - await this.refreshWalletAccounts() - await this.refreshAddresses() if ( - this.payment.changeWallet && - this.payment.changeWallet.id === walletAccountId + addressWallet && + addressWallet.address_no < addressData.addressIndex ) { - this.payment.changeWallet = this.walletAccounts[0] - this.selectChangeAddress(this.payment.changeWallet) + addressWallet.address_no = addressData.addressIndex } - await this.scanAddressWithAmount() - } catch (error) { + } + + // todo: account deleted + await LNbits.api.request( + 'PUT', + `/watchonly/api/v1/address/${addressData.id}`, + wallet.adminkey, + {amount} + ) + } catch (err) { + addressData.error = 'Failed to refresh amount for address' + this.$q.notify({ + type: 'warning', + message: `Failed to refresh amount for address ${addressData.address}`, + timeout: 10000 + }) + LNbits.utils.notifyApiError(err) + } + }, + updateNoteForAddress: async function ({addressId, note}) { + try { + const wallet = this.g.user.wallets[0] + await LNbits.api.request( + 'PUT', + `/watchonly/api/v1/address/${addressId}`, + wallet.adminkey, + {note} + ) + const updatedAddress = + this.addresses.find(a => a.id === addressId) || {} + updatedAddress.note = note + } catch (err) { + LNbits.utils.notifyApiError(err) + } + }, + + //################### ADDRESS HISTORY ################### + addressHistoryFromTxs: function (addressData, txs) { + const addressHistory = [] + txs.forEach(tx => { + const sent = tx.vin + .filter( + vin => vin.prevout.scriptpubkey_address === addressData.address + ) + .map(vin => mapInputToSentHistory(tx, addressData, vin)) + + const received = tx.vout + .filter(vout => vout.scriptpubkey_address === addressData.address) + .map(vout => mapOutputToReceiveHistory(tx, addressData, vout)) + addressHistory.push(...sent, ...received) + }) + return addressHistory + }, + + markSameTxAddressHistory: function () { + this.history + .filter(s => s.sent) + .forEach((el, i, arr) => { + if (el.isSubItem) return + + const sameTxItems = arr.slice(i + 1).filter(e => e.txId === el.txId) + if (!sameTxItems.length) return + sameTxItems.forEach(e => { + e.isSubItem = true + }) + + el.totalAmount = + el.amount + sameTxItems.reduce((t, e) => (t += e.amount || 0), 0) + el.sameTxItems = sameTxItems + }) + }, + + //################### PAYMENT ################### + + initPaymentData: async function () { + if (!this.payment.show) return + await this.refreshAddresses() + }, + + goToPaymentView: async function () { + this.showPayment = true + await this.initPaymentData() + }, + + //################### PSBT ################### + + updateSignedPsbt: async function (psbtBase64) { + this.$refs.paymentRef.updateSignedPsbt(psbtBase64) + }, + + //################### UTXOs ################### + scanAllAddresses: async function () { + await this.refreshAddresses() + this.history = [] + let addresses = this.addresses + this.utxos.data = [] + this.utxos.total = 0 + // Loop while new funds are found on the gap adresses. + // Use 1000 limit as a safety check (scan 20 000 addresses max) + for (let i = 0; i < 1000 && addresses.length; i++) { + await this.updateUtxosForAddresses(addresses) + const oldAddresses = this.addresses.slice() + await this.refreshAddresses() + const newAddresses = this.addresses.slice() + // check if gap addresses have been extended + addresses = newAddresses.filter( + newAddr => !oldAddresses.find(oldAddr => oldAddr.id === newAddr.id) + ) + if (addresses.length) { this.$q.notify({ - type: 'warning', - message: 'Error while deleting wallet account. Please try again.', + type: 'positive', + message: 'Funds found! Scanning for more...', timeout: 10000 }) } - }) - }, - getAddressesForWallet: async function (walletId) { - try { - const {data} = await LNbits.api.request( - 'GET', - '/watchonly/api/v1/addresses/' + walletId, - this.g.user.wallets[0].inkey - ) - return data.map(mapAddressesData) - } catch (err) { - this.$q.notify({ - type: 'warning', - message: `Failed to fetch addresses for wallet with id ${walletId}.`, - timeout: 10000 - }) - LNbits.utils.notifyApiError(err) - } - return [] - }, - getWatchOnlyWallets: async function () { - try { - const {data} = await LNbits.api.request( - 'GET', - '/watchonly/api/v1/wallet', - this.g.user.wallets[0].inkey - ) - return data - } catch (error) { - this.$q.notify({ - type: 'warning', - message: 'Failed to fetch wallets.', - timeout: 10000 - }) - LNbits.utils.notifyApiError(error) - } - return [] - }, - refreshWalletAccounts: async function () { - const wallets = await this.getWatchOnlyWallets() - this.walletAccounts = wallets.map(w => mapWalletAccount(w)) - }, - getAmmountForWallet: function (walletId) { - const amount = this.addresses.data - .filter(a => a.wallet === walletId) - .reduce((t, a) => t + a.amount || 0, 0) - return this.satBtc(amount) - }, - - //################### ADDRESSES ################### - - refreshAddresses: async function () { - const wallets = await this.getWatchOnlyWallets() - this.addresses.data = [] - for (const {id, type} of wallets) { - const newAddresses = await this.getAddressesForWallet(id) - const uniqueAddresses = newAddresses.filter( - newAddr => - !this.addresses.data.find(a => a.address === newAddr.address) - ) - - const lastAcctiveAddress = - uniqueAddresses.filter(a => !a.isChange && a.hasActivity).pop() || {} - - uniqueAddresses.forEach(a => { - a.expanded = false - a.accountType = type - a.gapLimitExceeded = - !a.isChange && - a.addressIndex > - lastAcctiveAddress.addressIndex + - this.config.DEFAULT_RECEIVE_GAP_LIMIT - }) - this.addresses.data.push(...uniqueAddresses) - } - }, - updateAmountForAddress: async function (addressData, amount = 0) { - try { - const wallet = this.g.user.wallets[0] - addressData.amount = amount - if (!addressData.isChange) { - const addressWallet = this.walletAccounts.find( - w => w.id === addressData.wallet - ) - if ( - addressWallet && - addressWallet.address_no < addressData.addressIndex - ) { - addressWallet.address_no = addressData.addressIndex - } } - - await LNbits.api.request( - 'PUT', - `/watchonly/api/v1/address/${addressData.id}`, - wallet.adminkey, - {amount} - ) - } catch (err) { - addressData.error = 'Failed to refresh amount for address' - this.$q.notify({ - type: 'warning', - message: `Failed to refresh amount for address ${addressData.address}`, - timeout: 10000 - }) - LNbits.utils.notifyApiError(err) - } - }, - updateNoteForAddress: async function (addressData, note) { - try { - const wallet = this.g.user.wallets[0] - await LNbits.api.request( - 'PUT', - `/watchonly/api/v1/address/${addressData.id}`, - wallet.adminkey, - {note: addressData.note} - ) - const updatedAddress = - this.addresses.data.find(a => a.id === addressData.id) || {} - updatedAddress.note = note - } catch (err) { - LNbits.utils.notifyApiError(err) - } - }, - getFilteredAddresses: function () { - const selectedWalletId = this.addresses.selectedWallet?.id - const filter = this.addresses.filterValues || [] - const includeChangeAddrs = filter.includes('Show Change Addresses') - const includeGapAddrs = filter.includes('Show Gap Addresses') - const excludeNoAmount = filter.includes('Only With Amount') - - const walletsLimit = this.walletAccounts.reduce((r, w) => { - r[`_${w.id}`] = w.address_no - return r - }, {}) - - const addresses = this.addresses.data.filter( - a => - (includeChangeAddrs || !a.isChange) && - (includeGapAddrs || - a.isChange || - a.addressIndex <= walletsLimit[`_${a.wallet}`]) && - !(excludeNoAmount && a.amount === 0) && - (!selectedWalletId || a.wallet === selectedWalletId) - ) - return addresses - }, - openGetFreshAddressDialog: async function (walletId) { - const {data} = await LNbits.api.request( - 'GET', - `/watchonly/api/v1/address/${walletId}`, - this.g.user.wallets[0].inkey - ) - const addressData = mapAddressesData(data) - - addressData.note = `Shared on ${currentDateTime()}` - const lastAcctiveAddress = - this.addresses.data - .filter( - a => a.wallet === addressData.wallet && !a.isChange && a.hasActivity - ) - .pop() || {} - addressData.gapLimitExceeded = - !addressData.isChange && - addressData.addressIndex > - lastAcctiveAddress.addressIndex + - this.config.DEFAULT_RECEIVE_GAP_LIMIT - - this.openQrCodeDialog(addressData) - const wallet = this.walletAccounts.find(w => w.id === walletId) || {} - wallet.address_no = addressData.addressIndex - await this.refreshAddresses() - }, - - //################### ADDRESS HISTORY ################### - addressHistoryFromTxs: function (addressData, txs) { - const addressHistory = [] - txs.forEach(tx => { - const sent = tx.vin - .filter( - vin => vin.prevout.scriptpubkey_address === addressData.address - ) - .map(vin => mapInputToSentHistory(tx, addressData, vin)) - - const received = tx.vout - .filter(vout => vout.scriptpubkey_address === addressData.address) - .map(vout => mapOutputToReceiveHistory(tx, addressData, vout)) - addressHistory.push(...sent, ...received) - }) - return addressHistory - }, - getFilteredAddressesHistory: function () { - return this.addresses.history.filter( - a => (!a.isChange || a.sent) && !a.isSubItem - ) - }, - exportHistoryToCSV: function () { - const history = this.getFilteredAddressesHistory().map(a => ({ - ...a, - action: a.sent ? 'Sent' : 'Received' - })) - LNbits.utils.exportCSV( - this.historyTable.exportColums, - history, - 'address-history' - ) - }, - markSameTxAddressHistory: function () { - this.addresses.history - .filter(s => s.sent) - .forEach((el, i, arr) => { - if (el.isSubItem) return - - const sameTxItems = arr.slice(i + 1).filter(e => e.txId === el.txId) - if (!sameTxItems.length) return - sameTxItems.forEach(e => { - e.isSubItem = true - }) - - el.totalAmount = - el.amount + sameTxItems.reduce((t, e) => (t += e.amount || 0), 0) - el.sameTxItems = sameTxItems - }) - }, - showAddressHistoryDetails: function (addressHistory) { - addressHistory.expanded = true - }, - - //################### PAYMENT ################### - createTx: function (excludeChange = false) { - const tx = { - fee_rate: this.payment.feeRate, - tx_size: this.payment.txSize, - masterpubs: this.walletAccounts.map(w => ({ - public_key: w.masterpub, - fingerprint: w.fingerprint - })) - } - tx.inputs = this.utxos.data - .filter(utxo => utxo.selected) - .map(mapUtxoToPsbtInput) - .sort((a, b) => - a.tx_id < b.tx_id ? -1 : a.tx_id > b.tx_id ? 1 : a.vout - b.vout - ) - - tx.outputs = this.payment.data.map(out => ({ - address: out.address, - amount: out.amount - })) - - if (excludeChange) { - this.payment.changeAmount = 0 - } else { - const change = this.createChangeOutput() - this.payment.changeAmount = change.amount - if (change.amount >= this.DUST_LIMIT) { - tx.outputs.push(change) - } - } - // Only sort by amount on UI level (no lib for address decode) - // Should sort by scriptPubKey (as byte array) on the backend - tx.outputs.sort((a, b) => a.amount - b.amount) - - return tx - }, - createChangeOutput: function () { - const change = this.payment.changeAddress - const fee = this.payment.feeRate * this.payment.txSize - const inputAmount = this.getTotalSelectedUtxoAmount() - const payedAmount = this.getTotalPaymentAmount() - const walletAcount = - this.walletAccounts.find(w => w.id === change.wallet) || {} - - return { - address: change.address, - amount: inputAmount - payedAmount - fee, - addressIndex: change.addressIndex, - addressIndex: change.addressIndex, - masterpub_fingerprint: walletAcount.fingerprint - } - }, - computeFee: function () { - const tx = this.createTx() - this.payment.txSize = Math.round(txSize(tx)) - return this.payment.feeRate * this.payment.txSize - }, - createPsbt: async function () { - const wallet = this.g.user.wallets[0] - try { - this.computeFee() - const tx = this.createTx() - txSize(tx) - for (const input of tx.inputs) { - input.tx_hex = await this.fetchTxHex(input.tx_id) - } - - const {data} = await LNbits.api.request( - 'POST', - '/watchonly/api/v1/psbt', - wallet.adminkey, - tx - ) - - this.payment.psbtBase64 = data - } catch (err) { - LNbits.utils.notifyApiError(err) - } - }, - deletePaymentAddress: function (v) { - const index = this.payment.data.indexOf(v) - if (index !== -1) { - this.payment.data.splice(index, 1) - } - }, - initPaymentData: async function () { - if (!this.payment.show) return - await this.refreshAddresses() - - this.payment.showAdvanced = false - this.payment.changeWallet = this.walletAccounts[0] - this.selectChangeAddress(this.payment.changeWallet) - - await this.refreshRecommendedFees() - this.payment.feeRate = this.payment.recommededFees.halfHourFee - }, - getFeeRateLabel: function (feeRate) { - const fees = this.payment.recommededFees - if (feeRate >= fees.fastestFee) return `High Priority (${feeRate} sat/vB)` - if (feeRate >= fees.halfHourFee) - return `Medium Priority (${feeRate} sat/vB)` - if (feeRate >= fees.hourFee) return `Low Priority (${feeRate} sat/vB)` - return `No Priority (${feeRate} sat/vB)` - }, - addPaymentAddress: function () { - this.payment.data.push({address: '', amount: undefined}) - }, - getTotalPaymentAmount: function () { - return this.payment.data.reduce((t, a) => t + (a.amount || 0), 0) - }, - selectChangeAddress: function (wallet = {}) { - this.payment.changeAddress = - this.addresses.data.find( - a => a.wallet === wallet.id && a.isChange && !a.hasActivity - ) || {} - }, - goToPaymentView: async function () { - this.payment.show = true - this.tab = 'utxos' - await this.initPaymentData() - }, - sendMaxToAddress: function (paymentAddress = {}) { - paymentAddress.amount = 0 - const tx = this.createTx(true) - this.payment.txSize = Math.round(txSize(tx)) - const fee = this.payment.feeRate * this.payment.txSize - const inputAmount = this.getTotalSelectedUtxoAmount() - const payedAmount = this.getTotalPaymentAmount() - paymentAddress.amount = Math.max(0, inputAmount - payedAmount - fee) - }, - - //################### UTXOs ################### - scanAllAddresses: async function () { - await this.refreshAddresses() - this.addresses.history = [] - let addresses = this.addresses.data - this.utxos.data = [] - this.utxos.total = 0 - // Loop while new funds are found on the gap adresses. - // Use 1000 limit as a safety check (scan 20 000 addresses max) - for (let i = 0; i < 1000 && addresses.length; i++) { + }, + scanAddressWithAmount: async function () { + this.utxos.data = [] + this.utxos.total = 0 + this.history = [] + const addresses = this.addresses.filter(a => a.hasActivity) await this.updateUtxosForAddresses(addresses) - const oldAddresses = this.addresses.data.slice() - await this.refreshAddresses() - const newAddresses = this.addresses.data.slice() - // check if gap addresses have been extended - addresses = newAddresses.filter( - newAddr => !oldAddresses.find(oldAddr => oldAddr.id === newAddr.id) - ) - if (addresses.length) { + }, + scanAddress: async function (addressData) { + this.updateUtxosForAddresses([addressData]) + this.$q.notify({ + type: 'positive', + message: 'Address Rescanned', + timeout: 10000 + }) + }, + refreshAddresses: async function () { + if (!this.walletAccounts) return + this.addresses = [] + for (const {id, type} of this.walletAccounts) { + const newAddresses = await this.getAddressesForWallet(id) + const uniqueAddresses = newAddresses.filter( + newAddr => !this.addresses.find(a => a.address === newAddr.address) + ) + + const lastActiveAddress = + uniqueAddresses.filter(a => !a.isChange && a.hasActivity).pop() || + {} + + uniqueAddresses.forEach(a => { + a.expanded = false + a.accountType = type + a.gapLimitExceeded = + !a.isChange && + a.addressIndex > + lastActiveAddress.addressIndex + DEFAULT_RECEIVE_GAP_LIMIT + }) + this.addresses.push(...uniqueAddresses) + } + this.$emit('update:addresses', this.addresses) + }, + getAddressesForWallet: async function (walletId) { + try { + const {data} = await LNbits.api.request( + 'GET', + '/watchonly/api/v1/addresses/' + walletId, + this.g.user.wallets[0].inkey + ) + return data.map(mapAddressesData) + } catch (error) { this.$q.notify({ - type: 'positive', - message: 'Funds found! Scanning for more...', + type: 'warning', + message: `Failed to fetch addresses for wallet with id ${walletId}.`, timeout: 10000 }) + LNbits.utils.notifyApiError(error) } - } - }, - scanAddressWithAmount: async function () { - this.utxos.data = [] - this.utxos.total = 0 - this.addresses.history = [] - const addresses = this.addresses.data.filter(a => a.hasActivity) - await this.updateUtxosForAddresses(addresses) - }, - scanAddress: async function (addressData) { - this.updateUtxosForAddresses([addressData]) - this.$q.notify({ - type: 'positive', - message: 'Address Rescanned', - timeout: 10000 - }) - }, - updateUtxosForAddresses: async function (addresses = []) { - this.scan = {scanning: true, scanCount: addresses.length, scanIndex: 0} + return [] + }, + updateUtxosForAddresses: async function (addresses = []) { + this.scan = {scanning: true, scanCount: addresses.length, scanIndex: 0} - try { - for (addrData of addresses) { - const addressHistory = await this.getAddressTxsDelayed(addrData) - // remove old entries - this.addresses.history = this.addresses.history.filter( - h => h.address !== addrData.address - ) + try { + for (addrData of addresses) { + const addressHistory = await this.getAddressTxsDelayed(addrData) + // remove old entries + this.history = this.history.filter( + h => h.address !== addrData.address + ) - // add new entrie - this.addresses.history.push(...addressHistory) - this.addresses.history.sort((a, b) => - !a.height ? -1 : b.height - a.height - ) - this.markSameTxAddressHistory() + // add new entries + this.history.push(...addressHistory) + this.history.sort((a, b) => (!a.height ? -1 : b.height - a.height)) + this.markSameTxAddressHistory() - if (addressHistory.length) { - // search only if it ever had any activity - const utxos = await this.getAddressTxsUtxoDelayed(addrData.address) - this.updateUtxosForAddress(addrData, utxos) + if (addressHistory.length) { + // search only if it ever had any activity + const utxos = await this.getAddressTxsUtxoDelayed( + addrData.address + ) + this.updateUtxosForAddress(addrData, utxos) + } + + this.scan.scanIndex++ } - - this.scan.scanIndex++ + } catch (error) { + console.error(error) + this.$q.notify({ + type: 'warning', + message: 'Failed to scan addresses', + timeout: 10000 + }) + } finally { + this.scan.scanning = false } - } catch (error) { - console.error(error) - this.$q.notify({ - type: 'warning', - message: 'Failed to scan addresses', - timeout: 10000 - }) - } finally { - this.scan.scanning = false - } - }, - updateUtxosForAddress: function (addressData, utxos = []) { - const wallet = - this.walletAccounts.find(w => w.id === addressData.wallet) || {} + }, + updateUtxosForAddress: function (addressData, utxos = []) { + const wallet = + this.walletAccounts.find(w => w.id === addressData.wallet) || {} - const newUtxos = utxos.map(utxo => - mapAddressDataToUtxo(wallet, addressData, utxo) - ) - // remove old utxos - this.utxos.data = this.utxos.data.filter( - u => u.address !== addressData.address - ) - // add new utxos - this.utxos.data.push(...newUtxos) - if (utxos.length) { - this.utxos.data.sort((a, b) => b.sort - a.sort) - this.utxos.total = this.utxos.data.reduce( - (total, y) => (total += y?.amount || 0), + const newUtxos = utxos.map(utxo => + mapAddressDataToUtxo(wallet, addressData, utxo) + ) + // remove old utxos + this.utxos.data = this.utxos.data.filter( + u => u.address !== addressData.address + ) + // add new utxos + this.utxos.data.push(...newUtxos) + if (utxos.length) { + this.utxos.data.sort((a, b) => b.sort - a.sort) + this.utxos.total = this.utxos.data.reduce( + (total, y) => (total += y?.amount || 0), + 0 + ) + } + const addressTotal = utxos.reduce( + (total, y) => (total += y?.value || 0), 0 ) - } - const addressTotal = utxos.reduce( - (total, y) => (total += y?.value || 0), - 0 - ) - this.updateAmountForAddress(addressData, addressTotal) - }, - getTotalSelectedUtxoAmount: function () { - const total = this.utxos.data - .filter(u => u.selected) - .reduce((t, a) => t + (a.amount || 0), 0) - return total - }, - applyUtxoSelectionMode: function () { - const payedAmount = this.getTotalPaymentAmount() - const mode = this.payment.utxoSelectionMode - this.utxos.data.forEach(u => (u.selected = false)) - const isManual = mode === 'Manual' - if (isManual || !payedAmount) return + this.updateAmountForAddress(addressData, addressTotal) + }, - const isSelectAll = mode === 'Select All' - if (isSelectAll || payedAmount >= this.utxos.total) { - this.utxos.data.forEach(u => (u.selected = true)) - return - } - const isSmallerFirst = mode === 'Smaller Inputs First' - const isLargerFirst = mode === 'Larger Inputs First' - - let selectedUtxos = this.utxos.data.slice() - if (isSmallerFirst || isLargerFirst) { - const sortFn = isSmallerFirst - ? (a, b) => a.amount - b.amount - : (a, b) => b.amount - a.amount - selectedUtxos.sort(sortFn) - } else { - // default to random order - selectedUtxos = _.shuffle(selectedUtxos) - } - selectedUtxos.reduce((total, utxo) => { - utxo.selected = total < payedAmount - total += utxo.amount - return total - }, 0) - }, - - //################### MEMPOOL API ################### - getAddressTxsDelayed: async function (addrData) { - const { - bitcoin: {addresses: addressesAPI} - } = mempoolJS() - - const fn = async () => - addressesAPI.getAddressTxs({ - address: addrData.address + //################### MEMPOOL API ################### + getAddressTxsDelayed: async function (addrData) { + const accounts = this.walletAccounts + const { + bitcoin: {addresses: addressesAPI} + } = mempoolJS({ + hostname: this.mempoolHostname }) - const addressTxs = await retryWithDelay(fn) - return this.addressHistoryFromTxs(addrData, addressTxs) - }, + const fn = async () => { + if (!accounts.find(w => w.id === addrData.wallet)) return [] + return addressesAPI.getAddressTxs({ + address: addrData.address + }) + } + const addressTxs = await retryWithDelay(fn) + return this.addressHistoryFromTxs(addrData, addressTxs) + }, - refreshRecommendedFees: async function () { - const { - bitcoin: {fees: feesAPI} - } = mempoolJS() - - const fn = async () => feesAPI.getFeesRecommended() - this.payment.recommededFees = await retryWithDelay(fn) - }, - getAddressTxsUtxoDelayed: async function (address) { - const { - bitcoin: {addresses: addressesAPI} - } = mempoolJS() - - const fn = async () => - addressesAPI.getAddressTxsUtxo({ - address + getAddressTxsUtxoDelayed: async function (address) { + const endpoint = this.mempoolHostname + const { + bitcoin: {addresses: addressesAPI} + } = mempoolJS({ + hostname: endpoint }) - return retryWithDelay(fn) - }, - fetchTxHex: async function (txId) { - const { - bitcoin: {transactions: transactionsAPI} - } = mempoolJS() - try { - const response = await transactionsAPI.getTxHex({txid: txId}) - return response - } catch (error) { - this.$q.notify({ - type: 'warning', - message: `Failed to fetch transaction details for tx id: '${txId}'`, - timeout: 10000 - }) - LNbits.utils.notifyApiError(error) - throw error + const fn = async () => { + if (endpoint !== this.mempoolHostname) return [] + return addressesAPI.getAddressTxsUtxo({ + address + }) + } + return retryWithDelay(fn) + }, + + //################### OTHER ################### + + openQrCodeDialog: function (addressData) { + this.currentAddress = addressData + this.addressNote = addressData.note || '' + this.showAddress = true + }, + searchInTab: function ({tab, value}) { + this.tab = tab + this[`${tab}Filter`] = value + }, + + updateAccounts: async function (accounts) { + this.walletAccounts = accounts + await this.refreshAddresses() + await this.scanAddressWithAmount() + }, + showAddressDetails: function (addressData) { + this.openQrCodeDialog(addressData) + }, + showAddressDetailsWithConfirmation: function ({addressData, wallet}) { + this.showAddressDetails(addressData) + if (this.$refs.serialSigner.isConnected()) { + if (this.$refs.serialSigner.isAuthenticated()) { + if (wallet.meta?.accountPath) { + const branchIndex = addressData.isChange ? 1 : 0 + const path = + wallet.meta.accountPath + + `/${branchIndex}/${addressData.addressIndex}` + this.$refs.serialSigner.hwwShowAddress(path, addressData.address) + } + } else { + this.$q.notify({ + type: 'warning', + message: 'Please login in order to confirm address on device', + timeout: 10000 + }) + } + } + }, + initUtxos: function (addresses) { + if (!this.fetchedUtxos && addresses.length) { + this.fetchedUtxos = true + this.addresses = addresses + this.scanAddressWithAmount() + } + }, + handleBroadcastSuccess: async function (txId) { + this.tab = 'history' + this.searchInTab({tab: 'history', value: txId}) + this.showPayment = false + await this.refreshAddresses() + await this.scanAddressWithAmount() } }, - - //################### OTHER ################### - closeFormDialog: function () { - this.formDialog.data = { - is_unique: false + created: async function () { + if (this.g.user.wallets.length) { + await this.refreshAddresses() + await this.scanAddressWithAmount() } - }, - openQrCodeDialog: function (addressData) { - this.currentAddress = addressData - this.addresses.note = addressData.note || '' - this.addresses.show = true - }, - searchInTab: function (tab, value) { - this.tab = tab - this[`${tab}Table`].filter = value - }, - - satBtc(val, showUnit = true) { - const value = this.config.data.sats_denominated - ? LNbits.utils.formatSat(val) - : val == 0 - ? 0.0 - : (val / 100000000).toFixed(8) - if (!showUnit) return value - return this.config.data.sats_denominated ? value + ' sat' : value + ' BTC' - }, - getAccountDescription: function (accountType) { - return getAccountDescription(accountType) } - }, - created: async function () { - if (this.g.user.wallets.length) { - await this.getConfig() - await this.refreshWalletAccounts() - await this.refreshAddresses() - await this.scanAddressWithAmount() - } - } -}) + }) +} +watchOnly() diff --git a/lnbits/extensions/watchonly/static/js/map.js b/lnbits/extensions/watchonly/static/js/map.js index d1bc8038..81093936 100644 --- a/lnbits/extensions/watchonly/static/js/map.js +++ b/lnbits/extensions/watchonly/static/js/map.js @@ -43,7 +43,7 @@ const mapUtxoToPsbtInput = utxo => ({ address: utxo.address, branch_index: utxo.isChange ? 1 : 0, address_index: utxo.addressIndex, - masterpub_fingerprint: utxo.masterpubFingerprint, + wallet: utxo.wallet, accountType: utxo.accountType, txHex: '' }) @@ -66,15 +66,16 @@ const mapAddressDataToUtxo = (wallet, addressData, utxo) => ({ selected: false }) -const mapWalletAccount = function (obj) { - obj._data = _.clone(obj) - obj.date = obj.time - ? Quasar.utils.date.formatDate( - new Date(obj.time * 1000), - 'YYYY-MM-DD HH:mm' - ) - : '' - obj.label = obj.title // for drop-downs - obj.expanded = false - return obj +const mapWalletAccount = function (o) { + return Object.assign({}, o, { + date: o.time + ? Quasar.utils.date.formatDate( + new Date(o.time * 1000), + 'YYYY-MM-DD HH:mm' + ) + : '', + meta: o.meta ? JSON.parse(o.meta) : null, + label: o.title, + expanded: false + }) } diff --git a/lnbits/extensions/watchonly/static/js/tables.js b/lnbits/extensions/watchonly/static/js/tables.js index fdd558bd..f437bcd5 100644 --- a/lnbits/extensions/watchonly/static/js/tables.js +++ b/lnbits/extensions/watchonly/static/js/tables.js @@ -1,99 +1,4 @@ const tables = { - walletsTable: { - columns: [ - { - name: 'new', - align: 'left', - label: '' - }, - { - name: 'title', - align: 'left', - label: 'Title', - field: 'title' - }, - { - name: 'amount', - align: 'left', - label: 'Amount' - }, - { - name: 'type', - align: 'left', - label: 'Type', - field: 'type' - }, - {name: 'id', align: 'left', label: 'ID', field: 'id'} - ], - pagination: { - rowsPerPage: 10 - }, - filter: '' - }, - utxosTable: { - columns: [ - { - name: 'expand', - align: 'left', - label: '' - }, - { - name: 'selected', - align: 'left', - label: '' - }, - { - name: 'status', - align: 'center', - label: 'Status', - sortable: true - }, - { - name: 'address', - align: 'left', - label: 'Address', - field: 'address', - sortable: true - }, - { - name: 'amount', - align: 'left', - label: 'Amount', - field: 'amount', - sortable: true - }, - { - name: 'date', - align: 'left', - label: 'Date', - field: 'date', - sortable: true - }, - { - name: 'wallet', - align: 'left', - label: 'Account', - field: 'wallet', - sortable: true - } - ], - pagination: { - rowsPerPage: 10 - }, - filter: '' - }, - paymentTable: { - columns: [ - { - name: 'data', - align: 'left' - } - ], - pagination: { - rowsPerPage: 10 - }, - filter: '' - }, summaryTable: { columns: [ { @@ -117,157 +22,36 @@ const tables = { label: 'Change' } ] - }, - addressesTable: { - columns: [ - { - name: 'expand', - align: 'left', - label: '' - }, - { - name: 'address', - align: 'left', - label: 'Address', - field: 'address', - sortable: true - }, - { - name: 'amount', - align: 'left', - label: 'Amount', - field: 'amount', - sortable: true - }, - { - name: 'note', - align: 'left', - label: 'Note', - field: 'note', - sortable: true - }, - { - name: 'wallet', - align: 'left', - label: 'Account', - field: 'wallet', - sortable: true - } - ], - pagination: { - rowsPerPage: 0, - sortBy: 'amount', - descending: true - }, - filter: '' - }, - historyTable: { - columns: [ - { - name: 'expand', - align: 'left', - label: '' - }, - { - name: 'status', - align: 'left', - label: 'Status' - }, - { - name: 'amount', - align: 'left', - label: 'Amount', - field: 'amount', - sortable: true - }, - { - name: 'address', - align: 'left', - label: 'Address', - field: 'address', - sortable: true - }, - { - name: 'date', - align: 'left', - label: 'Date', - field: 'date', - sortable: true - } - ], - exportColums: [ - { - label: 'Action', - field: 'action' - }, - { - label: 'Date&Time', - field: 'date' - }, - { - label: 'Amount', - field: 'amount' - }, - { - label: 'Fee', - field: 'fee' - }, - { - label: 'Transaction Id', - field: 'txId' - } - ], - pagination: { - rowsPerPage: 0 - }, - filter: '' } } const tableData = { - walletAccounts: [], - addresses: { - show: false, - data: [], - history: [], - selectedWallet: null, - note: '', - filterOptions: [ - 'Show Change Addresses', - 'Show Gap Addresses', - 'Only With Amount' - ], - filterValues: [] - }, utxos: { data: [], total: 0 }, payment: { - data: [{address: '', amount: undefined}], - changeWallet: null, - changeAddress: {}, - changeAmount: 0, - - feeRate: 1, - recommededFees: { - fastestFee: 1, - halfHourFee: 1, - hourFee: 1, - economyFee: 1, - minimumFee: 1 - }, fee: 0, txSize: 0, + tx: null, psbtBase64: '', - utxoSelectionModes: [ - 'Manual', - 'Random', - 'Select All', - 'Smaller Inputs First', - 'Larger Inputs First' + psbtBase64Signed: '', + signedTx: null, + signedTxHex: null, + sentTxId: null, + + signModes: [ + { + label: 'Serial Port Device', + value: 'serial-port' + }, + { + label: 'Animated QR', + value: 'animated-qr', + disable: true + } ], - utxoSelectionMode: 'Manual', + signMode: '', show: false, showAdvanced: false }, diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 26bebac6..c73dd9c0 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -1,3 +1,37 @@ +const PSBT_BASE64_PREFIX = 'cHNidP8' + +const COMMAND_PING = '/ping' +const COMMAND_PASSWORD = '/password' +const COMMAND_PASSWORD_CLEAR = '/password-clear' +const COMMAND_ADDRESS = '/address' +const COMMAND_SEND_PSBT = '/psbt' +const COMMAND_SIGN_PSBT = '/sign' +const COMMAND_HELP = '/help' +const COMMAND_WIPE = '/wipe' +const COMMAND_SEED = '/seed' +const COMMAND_RESTORE = '/restore' +const COMMAND_CONFIRM_NEXT = '/confirm-next' +const COMMAND_CANCEL = '/cancel' +const COMMAND_XPUB = '/xpub' +const COMMAND_PAIR = '/pair' +const COMMAND_LOG = '/log' +const COMMAND_CHECK_PAIRING = '/check-pairing' + +const DEFAULT_RECEIVE_GAP_LIMIT = 20 +const PAIRING_CONTROL_TEXT = 'lnbits' + +const HWW_DEFAULT_CONFIG = Object.freeze({ + name: '', + buttonOnePin: '', + buttonTwoPin: '', + baudRate: 9600, + bufferSize: 255, + dataBits: 8, + flowControl: 'none', + parity: 'none', + stopBits: 1 +}) + const blockTimeToDate = blockTime => blockTime ? moment(blockTime * 1000).format('LLL') : '' @@ -97,3 +131,80 @@ const ACCOUNT_TYPES = { } const getAccountDescription = type => ACCOUNT_TYPES[type] || 'nonstandard' + +const readFromSerialPort = reader => { + let partialChunk + let fulliness = [] + + const readStringUntil = async (separator = '\n') => { + if (fulliness.length) return fulliness.shift().trim() + const chunks = [] + if (partialChunk) { + // leftovers from previous read + chunks.push(partialChunk) + partialChunk = undefined + } + while (true) { + const {value, done} = await reader.read() + if (value) { + const values = value.split(separator) + // found one or more separators + if (values.length > 1) { + chunks.push(values.shift()) // first element + partialChunk = values.pop() // last element + fulliness = values // full lines + return {value: chunks.join('').trim(), done: false} + } + chunks.push(value) + } + if (done) return {value: chunks.join('').trim(), done: true} + } + } + return readStringUntil +} + +function satOrBtc(val, showUnit = true, showSats = false) { + const value = showSats + ? LNbits.utils.formatSat(val) + : val == 0 + ? 0.0 + : (val / 100000000).toFixed(8) + if (!showUnit) return value + return showSats ? value + ' sat' : value + ' BTC' +} + +function loadTemplateAsync(path) { + const result = new Promise(resolve => { + const xhttp = new XMLHttpRequest() + + xhttp.onreadystatechange = function () { + if (this.readyState == 4) { + if (this.status == 200) resolve(this.responseText) + + if (this.status == 404) resolve(`
Page not found: ${path}
`) + } + } + + xhttp.open('GET', path, true) + xhttp.send() + }) + + return result +} + +function findAccountPathIssues(path = '') { + const p = path.split('/') + if (p[0] !== 'm') return "Path must start with 'm/'" + for (let i = 1; i < p.length; i++) { + if (p[i].endsWith('')) p[i] = p[i].substring(0, p[i].length - 1) + if (isNaN(p[i])) return `${p[i]} is not a valid value` + } +} + +function asciiToUint8Array(str) { + var chars = [] + for (var i = 0; i < str.length; ++i) { + chars.push(str.charCodeAt(i)) + } + return new Uint8Array(chars) +} diff --git a/lnbits/extensions/watchonly/templates/watchonly/_api_docs.html b/lnbits/extensions/watchonly/templates/watchonly/_api_docs.html index db0811f5..ba52c4fa 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/_api_docs.html +++ b/lnbits/extensions/watchonly/templates/watchonly/_api_docs.html @@ -3,23 +3,36 @@

Onchain Wallet (watch-only) extension uses mempool.space
For use with "account Extended Public Key" - https://iancoleman.io/bip39/ + https://iancoleman.io/bip39/ +
+ Flash binaries + directly from browser
Created by, - Ben Arc (using, Embit
)

- Swagger REST API Documentation

diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 0ab2a67b..263f6d92 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -2,198 +2,71 @@ %} {% block page %}
- - {% raw %} -
-
-
-
{{satBtc(utxos.total)}}
-
-
-
- - -
-
-
+ + + - - -
-
- Add Wallet Account - -
- -
-
- - - -
-
- - - - -
-
+ + + {% raw %}
-
+
Scan Blockchain +
+
-
+
Make PaymentNew Payment + Back
@@ -208,828 +81,65 @@
- - + + - + -
-
- -
-
- -
-
- - - -
-
- - - +
-
-
-
- - - -
-
- - - - - Export to CSV - - - - -
-
- - - +
-
-
- -
-
-
- - - - -
-
- - - - -
-
-
- - -
-
- -
-
- -
-
-
-
- - - -
-
- - - - - -
-
-
- -
-
- -
-
Change Account:
-
- -
-
- -
-
-
-
Fee Rate:
-
- -
-
- -
-
-
-
-
- - Warning! The fee is too low. The transaction might take - a long time to confirm. - - - Warning! The fee is too high. You might be overpaying - for this transaction. - -
-
- -
-
Fee:
-
{{computeFee()}} sats
-
- Refresh Fee Rates -
-
-
- -
-
- - - -
-
-
-
- Create PSBT -
-
- - The payed amount is higher than the selected amount! - -
-
-
-
- -
-
-
-
-
+
+
+ + +
{% endraw %} @@ -1039,6 +149,7 @@
{{SITE_TITLE}} Onchain Wallet (watch-only) Extension + (v0.2)
@@ -1047,100 +158,9 @@
- - - - - - - - -
- Add Watch-Only Account - Cancel -
-
-
-
- - - - - - - - - - - -
- Update - Cancel -
-
-
-
- - - - {% raw %} - + {% raw %} + +
Address Details

@@ -1153,14 +173,24 @@ >

+ + {{ currentAddress.address }} +

@@ -1168,7 +198,7 @@ @@ -1185,7 +215,7 @@ outline v-close-popup color="grey" - @click="updateNoteForAddress(currentAddress, addresses.note)" + @click="updateNoteForAddress({addressId: currentAddress.id, note: addressNote})" class="q-ml-sm" >Save Note @@ -1194,14 +224,38 @@
+ {% endraw %}
{% endblock %} {% block scripts %} {{ window_vars(user) }} + + + + + + + + + + + + + + + + + + + {% endblock %} diff --git a/lnbits/extensions/watchonly/views_api.py b/lnbits/extensions/watchonly/views_api.py index f9055a20..77d28fee 100644 --- a/lnbits/extensions/watchonly/views_api.py +++ b/lnbits/extensions/watchonly/views_api.py @@ -1,7 +1,8 @@ +import json from http import HTTPStatus -from embit import script -from embit.descriptor import Descriptor, Key +import httpx +from embit import finalizer, script from embit.ec import PublicKey from embit.psbt import PSBT, DerivationPath from embit.transaction import Transaction, TransactionInput, TransactionOutput @@ -15,34 +16,44 @@ from lnbits.extensions.watchonly import watchonly_ext from .crud import ( create_config, create_fresh_addresses, - create_mempool, create_watch_wallet, delete_addresses_for_wallet, delete_watch_wallet, get_addresses, get_config, get_fresh_address, - get_mempool, get_watch_wallet, get_watch_wallets, update_address, update_config, - update_mempool, update_watch_wallet, ) from .helpers import parse_key -from .models import Config, CreatePsbt, CreateWallet, WalletAccount +from .models import ( + BroadcastTransaction, + Config, + CreatePsbt, + CreateWallet, + ExtractPsbt, + SignedTransaction, + WalletAccount, +) ###################WALLETS############################# @watchonly_ext.get("/api/v1/wallet") -async def api_wallets_retrieve(wallet: WalletTypeInfo = Depends(get_key_type)): +async def api_wallets_retrieve( + network: str = Query("Mainnet"), wallet: WalletTypeInfo = Depends(get_key_type) +): try: - return [wallet.dict() for wallet in await get_watch_wallets(wallet.wallet.user)] + return [ + wallet.dict() + for wallet in await get_watch_wallets(wallet.wallet.user, network) + ] except: - return "" + return [] @watchonly_ext.get("/api/v1/wallet/{wallet_id}") @@ -64,7 +75,13 @@ async def api_wallet_create_or_update( data: CreateWallet, w: WalletTypeInfo = Depends(require_admin_key) ): try: - (descriptor, _) = parse_key(data.masterpub) + (descriptor, network) = parse_key(data.masterpub) + if data.network != network["name"]: + raise ValueError( + "Account network error. This account is for '{}'".format( + network["name"] + ) + ) new_wallet = WalletAccount( id="none", @@ -75,11 +92,20 @@ async def api_wallet_create_or_update( title=data.title, address_no=-1, # so fresh address on empty wallet can get address with index 0 balance=0, + network=network["name"], + meta=data.meta, ) - wallets = await get_watch_wallets(w.wallet.user) + wallets = await get_watch_wallets(w.wallet.user, network["name"]) existing_wallet = next( - (ew for ew in wallets if ew.fingerprint == new_wallet.fingerprint), None + ( + ew + for ew in wallets + if ew.fingerprint == new_wallet.fingerprint + and ew.network == new_wallet.network + and ew.masterpub == new_wallet.masterpub + ), + None, ) if existing_wallet: raise ValueError( @@ -112,7 +138,7 @@ async def api_wallet_delete(wallet_id, w: WalletTypeInfo = Depends(require_admin await delete_watch_wallet(wallet_id) await delete_addresses_for_wallet(wallet_id) - raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + return "", HTTPStatus.NO_CONTENT #############################ADDRESSES########################## @@ -218,12 +244,13 @@ async def api_psbt_create( descriptors = {} for _, masterpub in enumerate(data.masterpubs): - descriptors[masterpub.fingerprint] = parse_key(masterpub.public_key) + descriptors[masterpub.id] = parse_key(masterpub.public_key) inputs_extra = [] - bip32_derivations = {} + for i, inp in enumerate(data.inputs): - descriptor = descriptors[inp.masterpub_fingerprint][0] + bip32_derivations = {} + descriptor = descriptors[inp.wallet][0] d = descriptor.derive(inp.address_index, inp.branch_index) for k in d.keys: bip32_derivations[PublicKey.parse(k.sec())] = DerivationPath( @@ -247,7 +274,7 @@ async def api_psbt_create( bip32_derivations = {} for i, out in enumerate(data.outputs): if out.branch_index == 1: - descriptor = descriptors[out.masterpub_fingerprint][0] + descriptor = descriptors[out.wallet][0] d = descriptor.derive(out.address_index, out.branch_index) for k in d.keys: bip32_derivations[PublicKey.parse(k.sec())] = DerivationPath( @@ -264,6 +291,63 @@ async def api_psbt_create( raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) +@watchonly_ext.put("/api/v1/psbt/extract") +async def api_psbt_extract_tx( + data: ExtractPsbt, w: WalletTypeInfo = Depends(require_admin_key) +): + res = SignedTransaction() + try: + psbt = PSBT.from_base64(data.psbtBase64) + for i, inp in enumerate(data.inputs): + psbt.inputs[i].non_witness_utxo = Transaction.from_string(inp.tx_hex) + + final_psbt = finalizer.finalize_psbt(psbt) + if not final_psbt: + raise ValueError("PSBT cannot be finalized!") + res.tx_hex = final_psbt.to_string() + + transaction = Transaction.from_string(res.tx_hex) + tx = { + "locktime": transaction.locktime, + "version": transaction.version, + "outputs": [], + "fee": psbt.fee(), + } + + for out in transaction.vout: + tx["outputs"].append( + {"amount": out.value, "address": out.script_pubkey.address()} + ) + res.tx_json = json.dumps(tx) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) + return res.dict() + + +@watchonly_ext.post("/api/v1/tx") +async def api_tx_broadcast( + data: BroadcastTransaction, w: WalletTypeInfo = Depends(require_admin_key) +): + try: + config = await get_config(w.wallet.user) + if not config: + raise ValueError( + "Cannot broadcast transaction. Mempool endpoint not defined!" + ) + + endpoint = ( + config.mempool_endpoint + if config.network == "Mainnet" + else config.mempool_endpoint + "/testnet" + ) + async with httpx.AsyncClient() as client: + r = await client.post(endpoint + "/api/tx", data=data.tx_hex) + tx_id = r.text + return tx_id + except Exception as e: + raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) + + #############################CONFIG########################## @@ -281,23 +365,3 @@ async def api_get_config(w: WalletTypeInfo = Depends(get_key_type)): if not config: config = await create_config(user=w.wallet.user) return config.dict() - - -#############################MEMPOOL########################## - -### TODO: fix statspay dependcy and remove -@watchonly_ext.put("/api/v1/mempool") -async def api_update_mempool( - endpoint: str = Query(...), w: WalletTypeInfo = Depends(require_admin_key) -): - mempool = await update_mempool(**{"endpoint": endpoint}, user=w.wallet.user) - return mempool.dict() - - -### TODO: fix statspay dependcy and remove -@watchonly_ext.get("/api/v1/mempool") -async def api_get_mempool(w: WalletTypeInfo = Depends(require_admin_key)): - mempool = await get_mempool(w.wallet.user) - if not mempool: - mempool = await create_mempool(user=w.wallet.user) - return mempool.dict() diff --git a/lnbits/extensions/withdraw/static/js/index.js b/lnbits/extensions/withdraw/static/js/index.js index 1982d684..943e9024 100644 --- a/lnbits/extensions/withdraw/static/js/index.js +++ b/lnbits/extensions/withdraw/static/js/index.js @@ -70,7 +70,7 @@ new Vue({ show: false, data: { is_unique: true, - use_custom: true, + use_custom: false, title: 'Vouchers', min_withdrawable: 0, wait_time: 1 @@ -125,7 +125,6 @@ new Vue({ var link = _.findWhere(this.withdrawLinks, {id: linkId}) this.qrCodeDialog.data = _.clone(link) - console.log(this.qrCodeDialog.data) this.qrCodeDialog.data.url = window.location.protocol + '//' + window.location.host this.qrCodeDialog.show = true @@ -140,6 +139,11 @@ new Vue({ id: this.formDialog.data.wallet }) var data = _.omit(this.formDialog.data, 'wallet') + + if (!data.use_custom) { + data.custom_url = null + } + if (data.use_custom && !data?.custom_url) { data.custom_url = CUSTOM_URL } @@ -168,6 +172,10 @@ new Vue({ data.title = 'vouchers' data.is_unique = true + if (!data.use_custom) { + data.custom_url = null + } + if (data.use_custom && !data?.custom_url) { data.custom_url = '/static/images/default_voucher.png' } diff --git a/lnbits/extensions/withdraw/templates/withdraw/index.html b/lnbits/extensions/withdraw/templates/withdraw/index.html index 9ff428a1..27684f6b 100644 --- a/lnbits/extensions/withdraw/templates/withdraw/index.html +++ b/lnbits/extensions/withdraw/templates/withdraw/index.html @@ -241,7 +241,7 @@ v-model="formDialog.data.custom_url" type="text" label="Custom design .png (optional)" - hint="Enter a URL if you want to use a custom design or leave blank for showing only the QR" + hint="Enter a URL if you want to use a custom design or leave blank for LNbits designed vouchers!" > @@ -353,7 +353,7 @@ v-model="simpleformDialog.data.custom_url" type="text" label="Custom design .png (optional)" - hint="Enter a URL if you want to use a custom design or leave blank for showing only the QR" + hint="Enter a URL if you want to use a custom design or leave blank for LNbits designed vouchers!" >
@@ -418,16 +418,18 @@ Shareable link + >Copy sharable link + + >Write to NFC + >Print Close
diff --git a/lnbits/extensions/withdraw/templates/withdraw/print_qr_custom.html b/lnbits/extensions/withdraw/templates/withdraw/print_qr_custom.html index c95ba5a6..ca47cec4 100644 --- a/lnbits/extensions/withdraw/templates/withdraw/print_qr_custom.html +++ b/lnbits/extensions/withdraw/templates/withdraw/print_qr_custom.html @@ -9,7 +9,10 @@ ... {{ amt }} sats
- +
{% endfor %} diff --git a/lnbits/extensions/withdraw/views_api.py b/lnbits/extensions/withdraw/views_api.py index 800fecce..e0d3e56f 100644 --- a/lnbits/extensions/withdraw/views_api.py +++ b/lnbits/extensions/withdraw/views_api.py @@ -113,7 +113,7 @@ async def api_link_create_or_update( return {**link.dict(), **{"lnurl": link.lnurl(req)}} -@withdraw_ext.delete("/api/v1/links/{link_id}") +@withdraw_ext.delete("/api/v1/links/{link_id}", status_code=HTTPStatus.OK) async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(require_admin_key)): link = await get_withdraw_link(link_id) @@ -128,7 +128,7 @@ async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(require_admi ) await delete_withdraw_link(link_id) - raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + return {"success": True} @withdraw_ext.get("/api/v1/links/{the_hash}/{lnurl_id}", status_code=HTTPStatus.OK) diff --git a/lnbits/server.py b/lnbits/server.py index 4a63b3b7..e9849851 100644 --- a/lnbits/server.py +++ b/lnbits/server.py @@ -1,18 +1,49 @@ +import time + import click import uvicorn +from lnbits.settings import HOST, PORT -@click.command() -@click.option("--port", default="5000", help="Port to run LNBits on") -@click.option("--host", default="127.0.0.1", help="Host to run LNBits on") -def main(port, host): + +@click.command( + context_settings=dict( + ignore_unknown_options=True, + allow_extra_args=True, + ) +) +@click.option("--port", default=PORT, help="Port to listen on") +@click.option("--host", default=HOST, help="Host to run LNBits on") +@click.option("--ssl-keyfile", default=None, help="Path to SSL keyfile") +@click.option("--ssl-certfile", default=None, help="Path to SSL certificate") +@click.pass_context +def main(ctx, port: int, host: str, ssl_keyfile: str, ssl_certfile: str): """Launched with `poetry run lnbits` at root level""" - uvicorn.run("lnbits.__main__:app", port=port, host=host) + # this beautiful beast parses all command line arguments and passes them to the uvicorn server + d = dict() + for a in ctx.args: + item = a.split("=") + if len(item) > 1: # argument like --key=value + print(a, item) + d[item[0].strip("--").replace("-", "_")] = ( + int(item[1]) # need to convert to int if it's a number + if item[1].isdigit() + else item[1] + ) + else: + d[a.strip("--")] = True # argument like --key + + config = uvicorn.Config( + "lnbits.__main__:app", + port=port, + host=host, + ssl_keyfile=ssl_keyfile, + ssl_certfile=ssl_certfile, + **d + ) + server = uvicorn.Server(config) + server.run() if __name__ == "__main__": main() - -# def main(): -# """Launched with `poetry run start` at root level""" -# uvicorn.run("lnbits.__main__:app") diff --git a/lnbits/settings.py b/lnbits/settings.py index 5778b9e2..3f4e31cc 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -24,18 +24,21 @@ LNBITS_DATA_FOLDER = env.str( ) LNBITS_DATABASE_URL = env.str("LNBITS_DATABASE_URL", default=None) -LNBITS_ALLOWED_USERS: List[str] = env.list( - "LNBITS_ALLOWED_USERS", default=[], subcast=str -) -LNBITS_ADMIN_USERS: List[str] = env.list("LNBITS_ADMIN_USERS", default=[], subcast=str) -LNBITS_ADMIN_EXTENSIONS: List[str] = env.list( - "LNBITS_ADMIN_EXTENSIONS", default=[], subcast=str -) -LNBITS_DISABLED_EXTENSIONS: List[str] = env.list( - "LNBITS_DISABLED_EXTENSIONS", default=[], subcast=str -) +LNBITS_ALLOWED_USERS: List[str] = [ + x.strip(" ") for x in env.list("LNBITS_ALLOWED_USERS", default=[], subcast=str) +] +LNBITS_ADMIN_USERS: List[str] = [ + x.strip(" ") for x in env.list("LNBITS_ADMIN_USERS", default=[], subcast=str) +] +LNBITS_ADMIN_EXTENSIONS: List[str] = [ + x.strip(" ") for x in env.list("LNBITS_ADMIN_EXTENSIONS", default=[], subcast=str) +] +LNBITS_DISABLED_EXTENSIONS: List[str] = [ + x.strip(" ") + for x in env.list("LNBITS_DISABLED_EXTENSIONS", default=[], subcast=str) +] -LNBITS_AD_SPACE = env.list("LNBITS_AD_SPACE", default=[]) +LNBITS_AD_SPACE = [x.strip(" ") for x in env.list("LNBITS_AD_SPACE", default=[])] LNBITS_HIDE_API = env.bool("LNBITS_HIDE_API", default=False) LNBITS_SITE_TITLE = env.str("LNBITS_SITE_TITLE", default="LNbits") LNBITS_DENOMINATION = env.str("LNBITS_DENOMINATION", default="sats") @@ -43,11 +46,14 @@ LNBITS_SITE_TAGLINE = env.str( "LNBITS_SITE_TAGLINE", default="free and open-source lightning wallet" ) LNBITS_SITE_DESCRIPTION = env.str("LNBITS_SITE_DESCRIPTION", default="") -LNBITS_THEME_OPTIONS: List[str] = env.list( - "LNBITS_THEME_OPTIONS", - default="classic, flamingo, mint, salvador, monochrome, autumn", - subcast=str, -) +LNBITS_THEME_OPTIONS: List[str] = [ + x.strip(" ") + for x in env.list( + "LNBITS_THEME_OPTIONS", + default="classic, flamingo, mint, salvador, monochrome, autumn", + subcast=str, + ) +] LNBITS_CUSTOM_LOGO = env.str("LNBITS_CUSTOM_LOGO", default="") WALLET = wallet_class() @@ -55,6 +61,8 @@ FAKE_WALLET = getattr(wallets_module, "FakeWallet")() DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet") PREFER_SECURE_URLS = env.bool("LNBITS_FORCE_HTTPS", default=True) +RESERVE_FEE_MIN = env.int("LNBITS_RESERVE_FEE_MIN", default=2000) +RESERVE_FEE_PERCENT = env.float("LNBITS_RESERVE_FEE_PERCENT", default=1.0) SERVICE_FEE = env.float("LNBITS_SERVICE_FEE", default=0.0) try: @@ -67,3 +75,13 @@ try: ) except: LNBITS_COMMIT = "unknown" + + +BOLTZ_NETWORK = env.str("BOLTZ_NETWORK", default="main") +BOLTZ_URL = env.str("BOLTZ_URL", default="https://boltz.exchange/api") +BOLTZ_MEMPOOL_SPACE_URL = env.str( + "BOLTZ_MEMPOOL_SPACE_URL", default="https://mempool.space" +) +BOLTZ_MEMPOOL_SPACE_URL_WS = env.str( + "BOLTZ_MEMPOOL_SPACE_URL_WS", default="wss://mempool.space" +) diff --git a/lnbits/static/js/components.js b/lnbits/static/js/components.js index b8c9f4d0..ab3f7f08 100644 --- a/lnbits/static/js/components.js +++ b/lnbits/static/js/components.js @@ -179,6 +179,11 @@ Vue.component('lnbits-extension-list', { Vue.component('lnbits-payment-details', { props: ['payment'], + data: function () { + return { + LNBITS_DENOMINATION: LNBITS_DENOMINATION + } + }, template: `
diff --git a/lnbits/tasks.py b/lnbits/tasks.py index f4d0a928..41287ff2 100644 --- a/lnbits/tasks.py +++ b/lnbits/tasks.py @@ -16,6 +16,8 @@ from lnbits.core.crud import ( from lnbits.core.services import redeem_lnurl_withdraw from lnbits.settings import WALLET +from .core import db + deferred_async: List[Callable] = [] @@ -86,19 +88,35 @@ async def check_pending_payments(): incoming = True while True: - for payment in await get_payments( - since=(int(time.time()) - 60 * 60 * 24 * 15), # 15 days ago - complete=False, - pending=True, - outgoing=outgoing, - incoming=incoming, - exclude_uncheckable=True, - ): - await payment.check_pending() + async with db.connect() as conn: + logger.debug( + f"Task: checking all pending payments (incoming={incoming}, outgoing={outgoing}) of last 15 days" + ) + start_time: float = time.time() + pending_payments = await get_payments( + since=(int(time.time()) - 60 * 60 * 24 * 15), # 15 days ago + complete=False, + pending=True, + outgoing=outgoing, + incoming=incoming, + exclude_uncheckable=True, + conn=conn, + ) + for payment in pending_payments: + await payment.check_status(conn=conn) + + logger.debug( + f"Task: pending check finished for {len(pending_payments)} payments (took {time.time() - start_time:0.3f} s)" + ) + # we delete expired invoices once upon the first pending check + if incoming: + logger.debug("Task: deleting all expired invoices") + start_time: float = time.time() + await delete_expired_invoices(conn=conn) + logger.debug( + f"Task: expired invoice deletion finished (took {time.time() - start_time:0.3f} s)" + ) - # we delete expired invoices once upon the first pending check - if incoming: - await delete_expired_invoices() # after the first check we will only check outgoing, not incoming # that will be handled by the global invoice listeners, hopefully incoming = False diff --git a/lnbits/templates/base.html b/lnbits/templates/base.html index acca92e7..67241bb5 100644 --- a/lnbits/templates/base.html +++ b/lnbits/templates/base.html @@ -12,7 +12,7 @@ diff --git a/lnbits/wallets/__init__.py b/lnbits/wallets/__init__.py index 8a2ca1a5..41949652 100644 --- a/lnbits/wallets/__init__.py +++ b/lnbits/wallets/__init__.py @@ -1,9 +1,12 @@ # flake8: noqa -from .clightning import CLightningWallet +from .cliche import ClicheWallet +from .cln import CoreLightningWallet # legacy .env support +from .cln import CoreLightningWallet as CLightningWallet from .eclair import EclairWallet from .fake import FakeWallet from .lnbits import LNbitsWallet +from .lndgrpc import LndWallet from .lndrest import LndRestWallet from .lnpay import LNPayWallet from .lntxbot import LntxbotWallet diff --git a/lnbits/wallets/base.py b/lnbits/wallets/base.py index f35eb370..e38b6d8f 100644 --- a/lnbits/wallets/base.py +++ b/lnbits/wallets/base.py @@ -18,13 +18,15 @@ class PaymentResponse(NamedTuple): # when ok is None it means we don't know if this succeeded ok: Optional[bool] = None checking_id: Optional[str] = None # payment_hash, rcp_id - fee_msat: int = 0 + fee_msat: Optional[int] = None preimage: Optional[str] = None error_message: Optional[str] = None class PaymentStatus(NamedTuple): paid: Optional[bool] = None + fee_msat: Optional[int] = None + preimage: Optional[str] = None @property def pending(self) -> bool: diff --git a/lnbits/wallets/cliche.py b/lnbits/wallets/cliche.py new file mode 100644 index 00000000..9b862794 --- /dev/null +++ b/lnbits/wallets/cliche.py @@ -0,0 +1,168 @@ +import asyncio +import hashlib +import json +from os import getenv +from typing import AsyncGenerator, Dict, Optional + +import httpx +from loguru import logger +from websocket import create_connection + +from .base import ( + InvoiceResponse, + PaymentResponse, + PaymentStatus, + StatusResponse, + Wallet, +) + + +class ClicheWallet(Wallet): + """https://github.com/fiatjaf/cliche""" + + def __init__(self): + self.endpoint = getenv("CLICHE_ENDPOINT") + + async def status(self) -> StatusResponse: + try: + ws = create_connection(self.endpoint) + ws.send("get-info") + r = ws.recv() + except Exception as exc: + return StatusResponse( + f"Failed to connect to {self.endpoint} due to: {exc}", 0 + ) + try: + data = json.loads(r) + except: + return StatusResponse( + f"Failed to connect to {self.endpoint}, got: '{r.text[:200]}...'", 0 + ) + + return StatusResponse(None, data["result"]["wallets"][0]["balance"]) + + async def create_invoice( + self, + amount: int, + memo: Optional[str] = None, + description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + ) -> InvoiceResponse: + if unhashed_description or description_hash: + description_hash_str = ( + description_hash.hex() + if description_hash + else hashlib.sha256(unhashed_description).hexdigest() + if unhashed_description + else None + ) + ws = create_connection(self.endpoint) + ws.send( + f"create-invoice --msatoshi {amount*1000} --description_hash {description_hash_str}" + ) + r = ws.recv() + else: + ws = create_connection(self.endpoint) + ws.send(f"create-invoice --msatoshi {amount*1000} --description {memo}") + r = ws.recv() + data = json.loads(r) + checking_id = None + payment_request = None + error_message = None + + if data.get("error") is not None and data["error"].get("message"): + logger.error(data["error"]["message"]) + error_message = data["error"]["message"] + return InvoiceResponse(False, checking_id, payment_request, error_message) + + if data.get("result") is not None: + checking_id, payment_request = ( + data["result"]["payment_hash"], + data["result"]["invoice"], + ) + else: + return InvoiceResponse(False, None, None, "Could not get payment hash") + + return InvoiceResponse(True, checking_id, payment_request, error_message) + + async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: + ws = create_connection(self.endpoint) + ws.send(f"pay-invoice --invoice {bolt11}") + for _ in range(2): + r = ws.recv() + data = json.loads(r) + checking_id, fee_msat, preimage, error_message, payment_ok = ( + None, + None, + None, + None, + None, + ) + + if data.get("error") is not None: + error_message = data["error"].get("message") + return PaymentResponse(False, None, None, None, error_message) + + if data.get("method") == "payment_succeeded": + payment_ok = True + checking_id = data["params"]["payment_hash"] + fee_msat = data["params"]["fee_msatoshi"] + preimage = data["params"]["preimage"] + continue + + if data.get("result") is None: + return PaymentResponse(None) + + return PaymentResponse( + payment_ok, checking_id, fee_msat, preimage, error_message + ) + + async def get_invoice_status(self, checking_id: str) -> PaymentStatus: + ws = create_connection(self.endpoint) + ws.send(f"check-payment --hash {checking_id}") + r = ws.recv() + data = json.loads(r) + + if data.get("error") is not None and data["error"].get("message"): + logger.error(data["error"]["message"]) + return PaymentStatus(None) + + statuses = {"pending": None, "complete": True, "failed": False} + return PaymentStatus(statuses[data["result"]["status"]]) + + async def get_payment_status(self, checking_id: str) -> PaymentStatus: + ws = create_connection(self.endpoint) + ws.send(f"check-payment --hash {checking_id}") + r = ws.recv() + data = json.loads(r) + + if data.get("error") is not None and data["error"].get("message"): + logger.error(data["error"]["message"]) + return PaymentStatus(None) + payment = data["result"] + statuses = {"pending": None, "complete": True, "failed": False} + return PaymentStatus( + statuses[payment["status"]], + payment.get("fee_msatoshi"), + payment.get("preimage"), + ) + + async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: + while True: + try: + ws = await create_connection(self.endpoint) + while True: + r = await ws.recv() + data = json.loads(r) + print(data) + try: + if data["result"]["status"]: + yield data["result"]["payment_hash"] + except: + continue + except Exception as exc: + logger.error( + f"lost connection to cliche's invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) + continue diff --git a/lnbits/wallets/clightning.py b/lnbits/wallets/clightning.py deleted file mode 100644 index fc79b3e3..00000000 --- a/lnbits/wallets/clightning.py +++ /dev/null @@ -1,152 +0,0 @@ -try: - from lightning import LightningRpc, RpcError # type: ignore -except ImportError: # pragma: nocover - LightningRpc = None - -import asyncio -import random -import time -from functools import partial, wraps -from os import getenv -from typing import AsyncGenerator, Optional - -from lnbits import bolt11 as lnbits_bolt11 - -from .base import ( - InvoiceResponse, - PaymentResponse, - PaymentStatus, - StatusResponse, - Unsupported, - Wallet, -) - - -def async_wrap(func): - @wraps(func) - async def run(*args, loop=None, executor=None, **kwargs): - if loop is None: - loop = asyncio.get_event_loop() - partial_func = partial(func, *args, **kwargs) - return await loop.run_in_executor(executor, partial_func) - - return run - - -def _pay_invoice(ln, payload): - return ln.call("pay", payload) - - -def _paid_invoices_stream(ln, last_pay_index): - return ln.waitanyinvoice(last_pay_index) - - -class CLightningWallet(Wallet): - def __init__(self): - if LightningRpc is None: # pragma: nocover - raise ImportError( - "The `pylightning` library must be installed to use `CLightningWallet`." - ) - - self.rpc = getenv("CLIGHTNING_RPC") - self.ln = LightningRpc(self.rpc) - - # check description_hash support (could be provided by a plugin) - self.supports_description_hash = False - try: - answer = self.ln.help("invoicewithdescriptionhash") - if answer["help"][0]["command"].startswith( - "invoicewithdescriptionhash msatoshi label description_hash" - ): - self.supports_description_hash = True - except: - pass - - # check last payindex so we can listen from that point on - self.last_pay_index = 0 - invoices = self.ln.listinvoices() - for inv in invoices["invoices"][::-1]: - if "pay_index" in inv: - self.last_pay_index = inv["pay_index"] - break - - async def status(self) -> StatusResponse: - try: - funds = self.ln.listfunds() - return StatusResponse( - None, sum([ch["channel_sat"] * 1000 for ch in funds["channels"]]) - ) - except RpcError as exc: - error_message = f"lightningd '{exc.method}' failed with '{exc.error}'." - return StatusResponse(error_message, 0) - - async def create_invoice( - self, - amount: int, - memo: Optional[str] = None, - description_hash: Optional[bytes] = None, - ) -> InvoiceResponse: - label = "lbl{}".format(random.random()) - msat = amount * 1000 - - try: - if description_hash: - if not self.supports_description_hash: - raise Unsupported("description_hash") - - params = [msat, label, description_hash.hex()] - r = self.ln.call("invoicewithdescriptionhash", params) - return InvoiceResponse(True, label, r["bolt11"], "") - else: - r = self.ln.invoice(msat, label, memo, exposeprivatechannels=True) - return InvoiceResponse(True, label, r["bolt11"], "") - except RpcError as exc: - error_message = f"lightningd '{exc.method}' failed with '{exc.error}'." - return InvoiceResponse(False, label, None, error_message) - - async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: - invoice = lnbits_bolt11.decode(bolt11) - fee_limit_percent = fee_limit_msat / invoice.amount_msat * 100 - - payload = { - "bolt11": bolt11, - "maxfeepercent": "{:.11}".format(fee_limit_percent), - "exemptfee": 0, # so fee_limit_percent is applied even on payments with fee under 5000 millisatoshi (which is default value of exemptfee) - } - try: - wrapped = async_wrap(_pay_invoice) - r = await wrapped(self.ln, payload) - except RpcError as exc: - return PaymentResponse(False, None, 0, None, str(exc)) - - fee_msat = r["msatoshi_sent"] - r["msatoshi"] - preimage = r["payment_preimage"] - return PaymentResponse(True, r["payment_hash"], fee_msat, preimage, None) - - async def get_invoice_status(self, checking_id: str) -> PaymentStatus: - r = self.ln.listinvoices(checking_id) - if not r["invoices"]: - return PaymentStatus(False) - if r["invoices"][0]["label"] == checking_id: - return PaymentStatus(r["invoices"][0]["status"] == "paid") - raise KeyError("supplied an invalid checking_id") - - async def get_payment_status(self, checking_id: str) -> PaymentStatus: - r = self.ln.call("listpays", {"payment_hash": checking_id}) - if not r["pays"]: - return PaymentStatus(False) - if r["pays"][0]["payment_hash"] == checking_id: - status = r["pays"][0]["status"] - if status == "complete": - return PaymentStatus(True) - elif status == "failed": - return PaymentStatus(False) - return PaymentStatus(None) - raise KeyError("supplied an invalid checking_id") - - async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: - while True: - wrapped = async_wrap(_paid_invoices_stream) - paid = await wrapped(self.ln, self.last_pay_index) - self.last_pay_index = paid["pay_index"] - yield paid["label"] diff --git a/lnbits/wallets/cln.py b/lnbits/wallets/cln.py new file mode 100644 index 00000000..48b96128 --- /dev/null +++ b/lnbits/wallets/cln.py @@ -0,0 +1,201 @@ +try: + from pyln.client import LightningRpc, RpcError # type: ignore +except ImportError: # pragma: nocover + LightningRpc = None + +import asyncio +import hashlib +import random +import time +from functools import partial, wraps +from os import getenv +from typing import AsyncGenerator, Optional + +from loguru import logger + +from lnbits import bolt11 as lnbits_bolt11 + +from .base import ( + InvoiceResponse, + PaymentResponse, + PaymentStatus, + StatusResponse, + Unsupported, + Wallet, +) + + +def async_wrap(func): + @wraps(func) + async def run(*args, loop=None, executor=None, **kwargs): + if loop is None: + loop = asyncio.get_event_loop() + partial_func = partial(func, *args, **kwargs) + return await loop.run_in_executor(executor, partial_func) + + return run + + +def _pay_invoice(ln, payload): + return ln.call("pay", payload) + + +def _paid_invoices_stream(ln, last_pay_index): + return ln.waitanyinvoice(last_pay_index) + + +class CoreLightningWallet(Wallet): + def __init__(self): + if LightningRpc is None: # pragma: nocover + raise ImportError( + "The `pyln-client` library must be installed to use `CoreLightningWallet`." + ) + + self.rpc = getenv("CORELIGHTNING_RPC") or getenv("CLIGHTNING_RPC") + self.ln = LightningRpc(self.rpc) + + # check if description_hash is supported (from CLN>=v0.11.0) + self.supports_description_hash = ( + "deschashonly" in self.ln.help("invoice")["help"][0]["command"] + ) + + # check last payindex so we can listen from that point on + self.last_pay_index = 0 + invoices = self.ln.listinvoices() + for inv in invoices["invoices"][::-1]: + if "pay_index" in inv: + self.last_pay_index = inv["pay_index"] + break + + async def status(self) -> StatusResponse: + try: + funds = self.ln.listfunds() + return StatusResponse( + None, sum([ch["channel_sat"] * 1000 for ch in funds["channels"]]) + ) + except RpcError as exc: + error_message = f"lightningd '{exc.method}' failed with '{exc.error}'." + return StatusResponse(error_message, 0) + + async def create_invoice( + self, + amount: int, + memo: Optional[str] = None, + description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + ) -> InvoiceResponse: + label = "lbl{}".format(random.random()) + msat: int = int(amount * 1000) + try: + if description_hash and not unhashed_description: + raise Unsupported( + "'description_hash' unsupported by CLN, provide 'unhashed_description'" + ) + if unhashed_description and not self.supports_description_hash: + raise Unsupported("unhashed_description") + r = self.ln.invoice( + msatoshi=msat, + label=label, + description=unhashed_description.decode("utf-8") + if unhashed_description + else memo, + exposeprivatechannels=True, + deschashonly=True + if unhashed_description + else False, # we can't pass None here + ) + + if r.get("code") and r.get("code") < 0: + raise Exception(r.get("message")) + + return InvoiceResponse(True, r["payment_hash"], r["bolt11"], "") + except RpcError as exc: + error_message = f"CLN method '{exc.method}' failed with '{exc.error.get('message') or exc.error}'." + return InvoiceResponse(False, None, None, error_message) + except Exception as e: + return InvoiceResponse(False, None, None, str(e)) + + async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: + invoice = lnbits_bolt11.decode(bolt11) + + previous_payment = await self.get_payment_status(invoice.payment_hash) + if previous_payment.paid: + return PaymentResponse(False, None, None, None, "invoice already paid") + + fee_limit_percent = fee_limit_msat / invoice.amount_msat * 100 + + payload = { + "bolt11": bolt11, + "maxfeepercent": "{:.11}".format(fee_limit_percent), + "exemptfee": 0, # so fee_limit_percent is applied even on payments with fee < 5000 millisatoshi (which is default value of exemptfee) + } + try: + wrapped = async_wrap(_pay_invoice) + r = await wrapped(self.ln, payload) + except RpcError as exc: + try: + error_message = exc.error["attempts"][-1]["fail_reason"] + except: + error_message = f"CLN method '{exc.method}' failed with '{exc.error.get('message') or exc.error}'." + return PaymentResponse(False, None, None, None, error_message) + except Exception as exc: + return PaymentResponse(False, None, None, None, str(exc)) + + fee_msat = -int(r["msatoshi_sent"] - r["msatoshi"]) + return PaymentResponse( + True, r["payment_hash"], fee_msat, r["payment_preimage"], None + ) + + async def get_invoice_status(self, checking_id: str) -> PaymentStatus: + try: + r = self.ln.listinvoices(payment_hash=checking_id) + except: + return PaymentStatus(None) + if not r["invoices"]: + return PaymentStatus(None) + + invoice_resp = r["invoices"][-1] + + if invoice_resp["payment_hash"] == checking_id: + if invoice_resp["status"] == "paid": + return PaymentStatus(True) + elif invoice_resp["status"] == "unpaid": + return PaymentStatus(None) + logger.warning(f"supplied an invalid checking_id: {checking_id}") + return PaymentStatus(None) + + async def get_payment_status(self, checking_id: str) -> PaymentStatus: + try: + r = self.ln.call("listpays", {"payment_hash": checking_id}) + except: + return PaymentStatus(None) + if not r["pays"]: + return PaymentStatus(None) + payment_resp = r["pays"][-1] + + if payment_resp["payment_hash"] == checking_id: + status = payment_resp["status"] + if status == "complete": + fee_msat = -int( + payment_resp["amount_sent_msat"] - payment_resp["amount_msat"] + ) + + return PaymentStatus(True, fee_msat, payment_resp["preimage"]) + elif status == "failed": + return PaymentStatus(False) + return PaymentStatus(None) + logger.warning(f"supplied an invalid checking_id: {checking_id}") + return PaymentStatus(None) + + async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: + while True: + try: + wrapped = async_wrap(_paid_invoices_stream) + paid = await wrapped(self.ln, self.last_pay_index) + self.last_pay_index = paid["pay_index"] + yield paid["payment_hash"] + except Exception as exc: + logger.error( + f"lost connection to cln invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) diff --git a/lnbits/wallets/eclair.py b/lnbits/wallets/eclair.py index ab99c699..c03e3f53 100644 --- a/lnbits/wallets/eclair.py +++ b/lnbits/wallets/eclair.py @@ -1,5 +1,6 @@ import asyncio import base64 +import hashlib import json import urllib.parse from os import getenv @@ -49,7 +50,7 @@ class EclairWallet(Wallet): async def status(self) -> StatusResponse: async with httpx.AsyncClient() as client: r = await client.post( - f"{self.url}/usablebalances", headers=self.auth, timeout=40 + f"{self.url}/globalbalance", headers=self.auth, timeout=5 ) try: data = r.json() @@ -59,20 +60,25 @@ class EclairWallet(Wallet): ) if r.is_error: - return StatusResponse(data["error"], 0) + return StatusResponse(data.get("error") or "undefined error", 0) + if len(data) == 0: + return StatusResponse("no data", 0) - return StatusResponse(None, data[0]["canSend"] * 1000) + return StatusResponse(None, int(data.get("total") * 100_000_000_000)) async def create_invoice( self, amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: data: Dict = {"amountMsat": amount * 1000} if description_hash: data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["description"] = memo or "" @@ -110,13 +116,18 @@ class EclairWallet(Wallet): except: error_message = r.text pass - return PaymentResponse(False, None, 0, None, error_message) + return PaymentResponse(False, None, None, None, error_message) data = r.json() + if data["type"] == "payment-failed": + return PaymentResponse(False, None, None, None, "payment failed") + checking_id = data["paymentHash"] preimage = data["paymentPreimage"] + # We do all this again to get the fee: + async with httpx.AsyncClient() as client: r = await client.post( f"{self.url}/getsentinfo", @@ -132,15 +143,22 @@ class EclairWallet(Wallet): except: error_message = r.text pass - return PaymentResponse( - True, checking_id, 0, preimage, error_message - ) ## ?? is this ok ?? + return PaymentResponse(None, checking_id, None, preimage, error_message) - data = r.json() - fees = [i["status"] for i in data] - fee_msat = sum([i["feesPaid"] for i in fees]) + statuses = { + "sent": True, + "failed": False, + "pending": None, + } - return PaymentResponse(True, checking_id, fee_msat, preimage, None) + data = r.json()[-1] + if data["status"]["type"] == "sent": + fee_msat = -data["status"]["feesPaid"] + preimage = data["status"]["paymentPreimage"] + + return PaymentResponse( + statuses[data["status"]["type"]], checking_id, fee_msat, preimage, None + ) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: async with httpx.AsyncClient() as client: @@ -151,54 +169,61 @@ class EclairWallet(Wallet): ) data = r.json() - if r.is_error or "error" in data: + if r.is_error or "error" in data or data.get("status") is None: return PaymentStatus(None) - if data["status"]["type"] != "received": - return PaymentStatus(False) - - return PaymentStatus(True) + statuses = { + "received": True, + "expired": False, + "pending": None, + } + return PaymentStatus(statuses.get(data["status"]["type"])) async def get_payment_status(self, checking_id: str) -> PaymentStatus: async with httpx.AsyncClient() as client: r = await client.post( - url=f"{self.url}/getsentinfo", + f"{self.url}/getsentinfo", headers=self.auth, data={"paymentHash": checking_id}, + timeout=40, ) - data = r.json()[0] - if r.is_error: return PaymentStatus(None) - if data["status"]["type"] != "sent": - return PaymentStatus(False) + data = r.json()[-1] - return PaymentStatus(True) + if r.is_error or "error" in data or data.get("status") is None: + return PaymentStatus(None) + + fee_msat, preimage = None, None + if data["status"]["type"] == "sent": + fee_msat = -data["status"]["feesPaid"] + preimage = data["status"]["paymentPreimage"] + + statuses = { + "sent": True, + "failed": False, + "pending": None, + } + return PaymentStatus(statuses.get(data["status"]["type"]), fee_msat, preimage) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: + while True: + try: + async with connect( + self.ws_url, + extra_headers=[("Authorization", self.auth["Authorization"])], + ) as ws: + while True: + message = await ws.recv() + message = json.loads(message) - try: - async with connect( - self.ws_url, - extra_headers=[("Authorization", self.auth["Authorization"])], - ) as ws: - while True: - message = await ws.recv() - message = json.loads(message) + if message and message["type"] == "payment-received": + yield message["paymentHash"] - if message and message["type"] == "payment-received": - yield message["paymentHash"] - - except ( - OSError, - ConnectionClosedOK, - ConnectionClosedError, - ConnectionClosed, - ) as ose: - logger.error("OSE", ose) - pass - - logger.error("lost connection to eclair's websocket, retrying in 5 seconds") - await asyncio.sleep(5) + except Exception as exc: + logger.error( + f"lost connection to eclair invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) diff --git a/lnbits/wallets/fake.py b/lnbits/wallets/fake.py index 3126ee46..8424001b 100644 --- a/lnbits/wallets/fake.py +++ b/lnbits/wallets/fake.py @@ -35,6 +35,7 @@ class FakeWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: # we set a default secret since FakeWallet is used for internal=True invoices # and the user might not have configured a secret yet @@ -61,7 +62,10 @@ class FakeWallet(Wallet): data["timestamp"] = datetime.now().timestamp() if description_hash: data["tags_set"] = ["h"] - data["description_hash"] = description_hash.hex() + data["description_hash"] = description_hash + elif unhashed_description: + data["tags_set"] = ["d"] + data["description_hash"] = hashlib.sha256(unhashed_description).digest() else: data["tags_set"] = ["d"] data["memo"] = memo diff --git a/lnbits/wallets/lnbits.py b/lnbits/wallets/lnbits.py index d2ddb7ff..ddd80e77 100644 --- a/lnbits/wallets/lnbits.py +++ b/lnbits/wallets/lnbits.py @@ -1,4 +1,5 @@ import asyncio +import hashlib import json from os import getenv from typing import AsyncGenerator, Dict, Optional @@ -56,12 +57,15 @@ class LNbitsWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: data: Dict = {"out": False, "amount": amount} if description_hash: data["description_hash"] = description_hash.hex() - else: - data["memo"] = memo or "" + if unhashed_description: + data["unhashed_description"] = unhashed_description.hex() + + data["memo"] = memo or "" async with httpx.AsyncClient() as client: r = await client.post( @@ -90,15 +94,25 @@ class LNbitsWallet(Wallet): json={"out": True, "bolt11": bolt11}, timeout=None, ) - ok, checking_id, fee_msat, error_message = not r.is_error, None, 0, None + ok, checking_id, fee_msat, preimage, error_message = ( + not r.is_error, + None, + None, + None, + None, + ) if r.is_error: error_message = r.json()["detail"] + return PaymentResponse(None, None, None, None, error_message) else: data = r.json() - checking_id = data["checking_id"] + checking_id = data["payment_hash"] - return PaymentResponse(ok, checking_id, fee_msat, error_message) + # we do this to get the fee and preimage + payment: PaymentStatus = await self.get_payment_status(checking_id) + + return PaymentResponse(ok, checking_id, payment.fee_msat, payment.preimage) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: try: @@ -121,8 +135,11 @@ class LNbitsWallet(Wallet): if r.is_error: return PaymentStatus(None) + data = r.json() + if "paid" not in data and "details" not in data: + return PaymentStatus(None) - return PaymentStatus(r.json()["paid"]) + return PaymentStatus(data["paid"], data["details"]["fee"], data["preimage"]) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: url = f"{self.endpoint}/api/v1/payments/sse" diff --git a/lnbits/wallets/lnd_grpc_files/lightning_pb2.py b/lnbits/wallets/lnd_grpc_files/lightning_pb2.py index 9065e3f6..bac57e5b 100644 --- a/lnbits/wallets/lnd_grpc_files/lightning_pb2.py +++ b/lnbits/wallets/lnd_grpc_files/lightning_pb2.py @@ -3,6 +3,7 @@ # source: lightning.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -13,699 +14,47 @@ from google.protobuf.internal import enum_type_wrapper _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor.FileDescriptor( - name="lightning.proto", - package="lnrpc", - syntax="proto3", - serialized_options=b"Z%github.com/lightningnetwork/lnd/lnrpc", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0flightning.proto\x12\x05lnrpc" \n\x1eSubscribeCustomMessagesRequest"9\n\rCustomMessage\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"D\n\x18SendCustomMessageRequest\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"\x1b\n\x19SendCustomMessageResponse"\xa2\x01\n\x04Utxo\x12(\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x12\n\namount_sat\x18\x03 \x01(\x03\x12\x11\n\tpk_script\x18\x04 \x01(\t\x12!\n\x08outpoint\x18\x05 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x15\n\rconfirmations\x18\x06 \x01(\x03"\xd6\x01\n\x0bTransaction\x12\x0f\n\x07tx_hash\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x19\n\x11num_confirmations\x18\x03 \x01(\x05\x12\x12\n\nblock_hash\x18\x04 \x01(\t\x12\x14\n\x0c\x62lock_height\x18\x05 \x01(\x05\x12\x12\n\ntime_stamp\x18\x06 \x01(\x03\x12\x12\n\ntotal_fees\x18\x07 \x01(\x03\x12\x16\n\x0e\x64\x65st_addresses\x18\x08 \x03(\t\x12\x12\n\nraw_tx_hex\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t"S\n\x16GetTransactionsRequest\x12\x14\n\x0cstart_height\x18\x01 \x01(\x05\x12\x12\n\nend_height\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t">\n\x12TransactionDetails\x12(\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x12.lnrpc.Transaction"M\n\x08\x46\x65\x65Limit\x12\x0f\n\x05\x66ixed\x18\x01 \x01(\x03H\x00\x12\x14\n\nfixed_msat\x18\x03 \x01(\x03H\x00\x12\x11\n\x07percent\x18\x02 \x01(\x03H\x00\x42\x07\n\x05limit"\x8a\x04\n\x0bSendRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x17\n\x0b\x64\x65st_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x0b\n\x03\x61mt\x18\x03 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x05 \x01(\tB\x02\x18\x01\x12\x17\n\x0fpayment_request\x18\x06 \x01(\t\x12\x18\n\x10\x66inal_cltv_delta\x18\x07 \x01(\x05\x12"\n\tfee_limit\x18\x08 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x1c\n\x10outgoing_chan_id\x18\t \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\r \x01(\x0c\x12\x12\n\ncltv_limit\x18\n \x01(\r\x12\x46\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32).lnrpc.SendRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0e \x01(\x08\x12(\n\rdest_features\x18\x0f \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x14\n\x0cpayment_addr\x18\x10 \x01(\x0c\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"z\n\x0cSendResponse\x12\x15\n\rpayment_error\x18\x01 \x01(\t\x12\x18\n\x10payment_preimage\x18\x02 \x01(\x0c\x12#\n\rpayment_route\x18\x03 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c"n\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x05route\x18\x04 \x01(\x0b\x32\x0c.lnrpc.RouteJ\x04\x08\x03\x10\x04"\xe5\x02\n\x14\x43hannelAcceptRequest\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x03 \x01(\x0c\x12\x13\n\x0b\x66unding_amt\x18\x04 \x01(\x04\x12\x10\n\x08push_amt\x18\x05 \x01(\x04\x12\x12\n\ndust_limit\x18\x06 \x01(\x04\x12\x1b\n\x13max_value_in_flight\x18\x07 \x01(\x04\x12\x17\n\x0f\x63hannel_reserve\x18\x08 \x01(\x04\x12\x10\n\x08min_htlc\x18\t \x01(\x04\x12\x12\n\nfee_per_kw\x18\n \x01(\x04\x12\x11\n\tcsv_delay\x18\x0b \x01(\r\x12\x1a\n\x12max_accepted_htlcs\x18\x0c \x01(\r\x12\x15\n\rchannel_flags\x18\r \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x0e \x01(\x0e\x32\x15.lnrpc.CommitmentType"\xf4\x01\n\x15\x43hannelAcceptResponse\x12\x0e\n\x06\x61\x63\x63\x65pt\x18\x01 \x01(\x08\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x18\n\x10upfront_shutdown\x18\x04 \x01(\t\x12\x11\n\tcsv_delay\x18\x05 \x01(\r\x12\x13\n\x0breserve_sat\x18\x06 \x01(\x04\x12\x1a\n\x12in_flight_max_msat\x18\x07 \x01(\x04\x12\x16\n\x0emax_htlc_count\x18\x08 \x01(\r\x12\x13\n\x0bmin_htlc_in\x18\t \x01(\x04\x12\x18\n\x10min_accept_depth\x18\n \x01(\r"n\n\x0c\x43hannelPoint\x12\x1c\n\x12\x66unding_txid_bytes\x18\x01 \x01(\x0cH\x00\x12\x1a\n\x10\x66unding_txid_str\x18\x02 \x01(\tH\x00\x12\x14\n\x0coutput_index\x18\x03 \x01(\rB\x0e\n\x0c\x66unding_txid"F\n\x08OutPoint\x12\x12\n\ntxid_bytes\x18\x01 \x01(\x0c\x12\x10\n\x08txid_str\x18\x02 \x01(\t\x12\x14\n\x0coutput_index\x18\x03 \x01(\r"0\n\x10LightningAddress\x12\x0e\n\x06pubkey\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t"\xcf\x01\n\x12\x45stimateFeeRequest\x12\x41\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32+.lnrpc.EstimateFeeRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x11\n\tmin_confs\x18\x03 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x04 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"_\n\x13\x45stimateFeeResponse\x12\x0f\n\x07\x66\x65\x65_sat\x18\x01 \x01(\x03\x12 \n\x14\x66\x65\x65rate_sat_per_byte\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x04"\x89\x02\n\x0fSendManyRequest\x12>\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32(.lnrpc.SendManyRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\r\n\x05label\x18\x06 \x01(\t\x12\x11\n\tmin_confs\x18\x07 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x08 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01" \n\x10SendManyResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"\xc5\x01\n\x10SendCoinsRequest\x12\x0c\n\x04\x61\x64\x64r\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x10\n\x08send_all\x18\x06 \x01(\x08\x12\r\n\x05label\x18\x07 \x01(\t\x12\x11\n\tmin_confs\x18\x08 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\t \x01(\x08"!\n\x11SendCoinsResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"K\n\x12ListUnspentRequest\x12\x11\n\tmin_confs\x18\x01 \x01(\x05\x12\x11\n\tmax_confs\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t"1\n\x13ListUnspentResponse\x12\x1a\n\x05utxos\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Utxo"F\n\x11NewAddressRequest\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x63\x63ount\x18\x02 \x01(\t"%\n\x12NewAddressResponse\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t"6\n\x12SignMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x13\n\x0bsingle_hash\x18\x02 \x01(\x08"(\n\x13SignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\t"6\n\x14VerifyMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\t"6\n\x15VerifyMessageResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\t"Z\n\x12\x43onnectPeerRequest\x12%\n\x04\x61\x64\x64r\x18\x01 \x01(\x0b\x32\x17.lnrpc.LightningAddress\x12\x0c\n\x04perm\x18\x02 \x01(\x08\x12\x0f\n\x07timeout\x18\x03 \x01(\x04"\x15\n\x13\x43onnectPeerResponse"(\n\x15\x44isconnectPeerRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t"\x18\n\x16\x44isconnectPeerResponse"\xa5\x01\n\x04HTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x11\n\thash_lock\x18\x03 \x01(\x0c\x12\x19\n\x11\x65xpiration_height\x18\x04 \x01(\r\x12\x12\n\nhtlc_index\x18\x05 \x01(\x04\x12\x1a\n\x12\x66orwarding_channel\x18\x06 \x01(\x04\x12\x1d\n\x15\x66orwarding_htlc_index\x18\x07 \x01(\x04"\xaa\x01\n\x12\x43hannelConstraints\x12\x11\n\tcsv_delay\x18\x01 \x01(\r\x12\x18\n\x10\x63han_reserve_sat\x18\x02 \x01(\x04\x12\x16\n\x0e\x64ust_limit_sat\x18\x03 \x01(\x04\x12\x1c\n\x14max_pending_amt_msat\x18\x04 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x04\x12\x1a\n\x12max_accepted_htlcs\x18\x06 \x01(\r"\xb0\x06\n\x07\x43hannel\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x15\n\rremote_pubkey\x18\x02 \x01(\t\x12\x15\n\rchannel_point\x18\x03 \x01(\t\x12\x13\n\x07\x63han_id\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x05 \x01(\x03\x12\x15\n\rlocal_balance\x18\x06 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x07 \x01(\x03\x12\x12\n\ncommit_fee\x18\x08 \x01(\x03\x12\x15\n\rcommit_weight\x18\t \x01(\x03\x12\x12\n\nfee_per_kw\x18\n \x01(\x03\x12\x19\n\x11unsettled_balance\x18\x0b \x01(\x03\x12\x1b\n\x13total_satoshis_sent\x18\x0c \x01(\x03\x12\x1f\n\x17total_satoshis_received\x18\r \x01(\x03\x12\x13\n\x0bnum_updates\x18\x0e \x01(\x04\x12"\n\rpending_htlcs\x18\x0f \x03(\x0b\x32\x0b.lnrpc.HTLC\x12\x15\n\tcsv_delay\x18\x10 \x01(\rB\x02\x18\x01\x12\x0f\n\x07private\x18\x11 \x01(\x08\x12\x11\n\tinitiator\x18\x12 \x01(\x08\x12\x19\n\x11\x63han_status_flags\x18\x13 \x01(\t\x12"\n\x16local_chan_reserve_sat\x18\x14 \x01(\x03\x42\x02\x18\x01\x12#\n\x17remote_chan_reserve_sat\x18\x15 \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x11static_remote_key\x18\x16 \x01(\x08\x42\x02\x18\x01\x12.\n\x0f\x63ommitment_type\x18\x1a \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x10\n\x08lifetime\x18\x17 \x01(\x03\x12\x0e\n\x06uptime\x18\x18 \x01(\x03\x12\x15\n\rclose_address\x18\x19 \x01(\t\x12\x17\n\x0fpush_amount_sat\x18\x1b \x01(\x04\x12\x13\n\x0bthaw_height\x18\x1c \x01(\r\x12\x34\n\x11local_constraints\x18\x1d \x01(\x0b\x32\x19.lnrpc.ChannelConstraints\x12\x35\n\x12remote_constraints\x18\x1e \x01(\x0b\x32\x19.lnrpc.ChannelConstraints"z\n\x13ListChannelsRequest\x12\x13\n\x0b\x61\x63tive_only\x18\x01 \x01(\x08\x12\x15\n\rinactive_only\x18\x02 \x01(\x08\x12\x13\n\x0bpublic_only\x18\x03 \x01(\x08\x12\x14\n\x0cprivate_only\x18\x04 \x01(\x08\x12\x0c\n\x04peer\x18\x05 \x01(\x0c"8\n\x14ListChannelsResponse\x12 \n\x08\x63hannels\x18\x0b \x03(\x0b\x32\x0e.lnrpc.Channel"\xa9\x04\n\x13\x43hannelCloseSummary\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchain_hash\x18\x03 \x01(\t\x12\x17\n\x0f\x63losing_tx_hash\x18\x04 \x01(\t\x12\x15\n\rremote_pubkey\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12\x14\n\x0c\x63lose_height\x18\x07 \x01(\r\x12\x17\n\x0fsettled_balance\x18\x08 \x01(\x03\x12\x1b\n\x13time_locked_balance\x18\t \x01(\x03\x12:\n\nclose_type\x18\n \x01(\x0e\x32&.lnrpc.ChannelCloseSummary.ClosureType\x12(\n\x0eopen_initiator\x18\x0b \x01(\x0e\x32\x10.lnrpc.Initiator\x12)\n\x0f\x63lose_initiator\x18\x0c \x01(\x0e\x32\x10.lnrpc.Initiator\x12&\n\x0bresolutions\x18\r \x03(\x0b\x32\x11.lnrpc.Resolution"\x8a\x01\n\x0b\x43losureType\x12\x15\n\x11\x43OOPERATIVE_CLOSE\x10\x00\x12\x15\n\x11LOCAL_FORCE_CLOSE\x10\x01\x12\x16\n\x12REMOTE_FORCE_CLOSE\x10\x02\x12\x10\n\x0c\x42REACH_CLOSE\x10\x03\x12\x14\n\x10\x46UNDING_CANCELED\x10\x04\x12\r\n\tABANDONED\x10\x05"\xb2\x01\n\nResolution\x12.\n\x0fresolution_type\x18\x01 \x01(\x0e\x32\x15.lnrpc.ResolutionType\x12)\n\x07outcome\x18\x02 \x01(\x0e\x32\x18.lnrpc.ResolutionOutcome\x12!\n\x08outpoint\x18\x03 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x12\n\namount_sat\x18\x04 \x01(\x04\x12\x12\n\nsweep_txid\x18\x05 \x01(\t"\x94\x01\n\x15\x43losedChannelsRequest\x12\x13\n\x0b\x63ooperative\x18\x01 \x01(\x08\x12\x13\n\x0blocal_force\x18\x02 \x01(\x08\x12\x14\n\x0cremote_force\x18\x03 \x01(\x08\x12\x0e\n\x06\x62reach\x18\x04 \x01(\x08\x12\x18\n\x10\x66unding_canceled\x18\x05 \x01(\x08\x12\x11\n\tabandoned\x18\x06 \x01(\x08"F\n\x16\x43losedChannelsResponse\x12,\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1a.lnrpc.ChannelCloseSummary"\xef\x03\n\x04Peer\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x01(\t\x12\x12\n\nbytes_sent\x18\x04 \x01(\x04\x12\x12\n\nbytes_recv\x18\x05 \x01(\x04\x12\x10\n\x08sat_sent\x18\x06 \x01(\x03\x12\x10\n\x08sat_recv\x18\x07 \x01(\x03\x12\x0f\n\x07inbound\x18\x08 \x01(\x08\x12\x11\n\tping_time\x18\t \x01(\x03\x12\'\n\tsync_type\x18\n \x01(\x0e\x32\x14.lnrpc.Peer.SyncType\x12+\n\x08\x66\x65\x61tures\x18\x0b \x03(\x0b\x32\x19.lnrpc.Peer.FeaturesEntry\x12\'\n\x06\x65rrors\x18\x0c \x03(\x0b\x32\x17.lnrpc.TimestampedError\x12\x12\n\nflap_count\x18\r \x01(\x05\x12\x14\n\x0clast_flap_ns\x18\x0e \x01(\x03\x12\x19\n\x11last_ping_payload\x18\x0f \x01(\x0c\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"P\n\x08SyncType\x12\x10\n\x0cUNKNOWN_SYNC\x10\x00\x12\x0f\n\x0b\x41\x43TIVE_SYNC\x10\x01\x12\x10\n\x0cPASSIVE_SYNC\x10\x02\x12\x0f\n\x0bPINNED_SYNC\x10\x03"4\n\x10TimestampedError\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t"(\n\x10ListPeersRequest\x12\x14\n\x0clatest_error\x18\x01 \x01(\x08"/\n\x11ListPeersResponse\x12\x1a\n\x05peers\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Peer"\x17\n\x15PeerEventSubscription"v\n\tPeerEvent\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x1a.lnrpc.PeerEvent.EventType".\n\tEventType\x12\x0f\n\x0bPEER_ONLINE\x10\x00\x12\x10\n\x0cPEER_OFFLINE\x10\x01"\x10\n\x0eGetInfoRequest"\x96\x04\n\x0fGetInfoResponse\x12\x0f\n\x07version\x18\x0e \x01(\t\x12\x13\n\x0b\x63ommit_hash\x18\x14 \x01(\t\x12\x17\n\x0fidentity_pubkey\x18\x01 \x01(\t\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x11 \x01(\t\x12\x1c\n\x14num_pending_channels\x18\x03 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x04 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x0f \x01(\r\x12\x11\n\tnum_peers\x18\x05 \x01(\r\x12\x14\n\x0c\x62lock_height\x18\x06 \x01(\r\x12\x12\n\nblock_hash\x18\x08 \x01(\t\x12\x1d\n\x15\x62\x65st_header_timestamp\x18\r \x01(\x03\x12\x17\n\x0fsynced_to_chain\x18\t \x01(\x08\x12\x17\n\x0fsynced_to_graph\x18\x12 \x01(\x08\x12\x13\n\x07testnet\x18\n \x01(\x08\x42\x02\x18\x01\x12\x1c\n\x06\x63hains\x18\x10 \x03(\x0b\x32\x0c.lnrpc.Chain\x12\x0c\n\x04uris\x18\x0c \x03(\t\x12\x36\n\x08\x66\x65\x61tures\x18\x13 \x03(\x0b\x32$.lnrpc.GetInfoResponse.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01J\x04\x08\x0b\x10\x0c"\x18\n\x16GetRecoveryInfoRequest"]\n\x17GetRecoveryInfoResponse\x12\x15\n\rrecovery_mode\x18\x01 \x01(\x08\x12\x19\n\x11recovery_finished\x18\x02 \x01(\x08\x12\x10\n\x08progress\x18\x03 \x01(\x01"\'\n\x05\x43hain\x12\r\n\x05\x63hain\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t"U\n\x12\x43onfirmationUpdate\x12\x11\n\tblock_sha\x18\x01 \x01(\x0c\x12\x14\n\x0c\x62lock_height\x18\x02 \x01(\x05\x12\x16\n\x0enum_confs_left\x18\x03 \x01(\r"?\n\x11\x43hannelOpenUpdate\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint";\n\x12\x43hannelCloseUpdate\x12\x14\n\x0c\x63losing_txid\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08"\xb0\x01\n\x13\x43loseChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10\x64\x65livery_address\x18\x05 \x01(\t\x12\x15\n\rsat_per_vbyte\x18\x06 \x01(\x04"}\n\x11\x43loseStatusUpdate\x12-\n\rclose_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12/\n\nchan_close\x18\x03 \x01(\x0b\x32\x19.lnrpc.ChannelCloseUpdateH\x00\x42\x08\n\x06update"3\n\rPendingUpdate\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x14\n\x0coutput_index\x18\x02 \x01(\r"T\n\x13ReadyForPsbtFunding\x12\x17\n\x0f\x66unding_address\x18\x01 \x01(\t\x12\x16\n\x0e\x66unding_amount\x18\x02 \x01(\x03\x12\x0c\n\x04psbt\x18\x03 \x01(\x0c"\xad\x01\n\x17\x42\x61tchOpenChannelRequest\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.lnrpc.BatchOpenChannel\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x03\x12\x11\n\tmin_confs\x18\x04 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t"\xf9\x01\n\x10\x42\x61tchOpenChannel\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x1c\n\x14local_funding_amount\x18\x02 \x01(\x03\x12\x10\n\x08push_sat\x18\x03 \x01(\x03\x12\x0f\n\x07private\x18\x04 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\x06 \x01(\r\x12\x15\n\rclose_address\x18\x07 \x01(\t\x12\x17\n\x0fpending_chan_id\x18\x08 \x01(\x0c\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType"J\n\x18\x42\x61tchOpenChannelResponse\x12.\n\x10pending_channels\x18\x01 \x03(\x0b\x32\x14.lnrpc.PendingUpdate"\xfa\x03\n\x12OpenChannelRequest\x12\x15\n\rsat_per_vbyte\x18\x01 \x01(\x04\x12\x13\n\x0bnode_pubkey\x18\x02 \x01(\x0c\x12\x1e\n\x12node_pubkey_string\x18\x03 \x01(\tB\x02\x18\x01\x12\x1c\n\x14local_funding_amount\x18\x04 \x01(\x03\x12\x10\n\x08push_sat\x18\x05 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x06 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x07 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x07private\x18\x08 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\t \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\n \x01(\r\x12\x11\n\tmin_confs\x18\x0b \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x0c \x01(\x08\x12\x15\n\rclose_address\x18\r \x01(\t\x12(\n\x0c\x66unding_shim\x18\x0e \x01(\x0b\x32\x12.lnrpc.FundingShim\x12\'\n\x1fremote_max_value_in_flight_msat\x18\x0f \x01(\x04\x12\x18\n\x10remote_max_htlcs\x18\x10 \x01(\r\x12\x15\n\rmax_local_csv\x18\x11 \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x12 \x01(\x0e\x32\x15.lnrpc.CommitmentType"\xc3\x01\n\x10OpenStatusUpdate\x12,\n\x0c\x63han_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12-\n\tchan_open\x18\x03 \x01(\x0b\x32\x18.lnrpc.ChannelOpenUpdateH\x00\x12/\n\tpsbt_fund\x18\x05 \x01(\x0b\x32\x1a.lnrpc.ReadyForPsbtFundingH\x00\x12\x17\n\x0fpending_chan_id\x18\x04 \x01(\x0c\x42\x08\n\x06update"3\n\nKeyLocator\x12\x12\n\nkey_family\x18\x01 \x01(\x05\x12\x11\n\tkey_index\x18\x02 \x01(\x05"J\n\rKeyDescriptor\x12\x15\n\rraw_key_bytes\x18\x01 \x01(\x0c\x12"\n\x07key_loc\x18\x02 \x01(\x0b\x32\x11.lnrpc.KeyLocator"\xb0\x01\n\rChanPointShim\x12\x0b\n\x03\x61mt\x18\x01 \x01(\x03\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\'\n\tlocal_key\x18\x03 \x01(\x0b\x32\x14.lnrpc.KeyDescriptor\x12\x12\n\nremote_key\x18\x04 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x05 \x01(\x0c\x12\x13\n\x0bthaw_height\x18\x06 \x01(\r"J\n\x08PsbtShim\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c\x12\x11\n\tbase_psbt\x18\x02 \x01(\x0c\x12\x12\n\nno_publish\x18\x03 \x01(\x08"l\n\x0b\x46undingShim\x12/\n\x0f\x63han_point_shim\x18\x01 \x01(\x0b\x32\x14.lnrpc.ChanPointShimH\x00\x12$\n\tpsbt_shim\x18\x02 \x01(\x0b\x32\x0f.lnrpc.PsbtShimH\x00\x42\x06\n\x04shim",\n\x11\x46undingShimCancel\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c"X\n\x11\x46undingPsbtVerify\x12\x13\n\x0b\x66unded_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x15\n\rskip_finalize\x18\x03 \x01(\x08"Y\n\x13\x46undingPsbtFinalize\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x14\n\x0c\x66inal_raw_tx\x18\x03 \x01(\x0c"\xe5\x01\n\x14\x46undingTransitionMsg\x12+\n\rshim_register\x18\x01 \x01(\x0b\x32\x12.lnrpc.FundingShimH\x00\x12/\n\x0bshim_cancel\x18\x02 \x01(\x0b\x32\x18.lnrpc.FundingShimCancelH\x00\x12/\n\x0bpsbt_verify\x18\x03 \x01(\x0b\x32\x18.lnrpc.FundingPsbtVerifyH\x00\x12\x33\n\rpsbt_finalize\x18\x04 \x01(\x0b\x32\x1a.lnrpc.FundingPsbtFinalizeH\x00\x42\t\n\x07trigger"\x16\n\x14\x46undingStateStepResp"\x86\x01\n\x0bPendingHTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x10\n\x08outpoint\x18\x03 \x01(\t\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\r\n\x05stage\x18\x06 \x01(\r"\x18\n\x16PendingChannelsRequest"\xcc\r\n\x17PendingChannelsResponse\x12\x1b\n\x13total_limbo_balance\x18\x01 \x01(\x03\x12P\n\x15pending_open_channels\x18\x02 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.PendingOpenChannel\x12R\n\x18pending_closing_channels\x18\x03 \x03(\x0b\x32,.lnrpc.PendingChannelsResponse.ClosedChannelB\x02\x18\x01\x12Y\n\x1epending_force_closing_channels\x18\x04 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.ForceClosedChannel\x12R\n\x16waiting_close_channels\x18\x05 \x03(\x0b\x32\x32.lnrpc.PendingChannelsResponse.WaitingCloseChannel\x1a\xb8\x02\n\x0ePendingChannel\x12\x17\n\x0fremote_node_pub\x18\x01 \x01(\t\x12\x15\n\rchannel_point\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12\x15\n\rlocal_balance\x18\x04 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x05 \x01(\x03\x12\x1e\n\x16local_chan_reserve_sat\x18\x06 \x01(\x03\x12\x1f\n\x17remote_chan_reserve_sat\x18\x07 \x01(\x03\x12#\n\tinitiator\x18\x08 \x01(\x0e\x32\x10.lnrpc.Initiator\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x1f\n\x17num_forwarding_packages\x18\n \x01(\x03\x1a\xb0\x01\n\x12PendingOpenChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x1b\n\x13\x63onfirmation_height\x18\x02 \x01(\r\x12\x12\n\ncommit_fee\x18\x04 \x01(\x03\x12\x15\n\rcommit_weight\x18\x05 \x01(\x03\x12\x12\n\nfee_per_kw\x18\x06 \x01(\x03\x1a\xad\x01\n\x13WaitingCloseChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x15\n\rlimbo_balance\x18\x02 \x01(\x03\x12?\n\x0b\x63ommitments\x18\x03 \x01(\x0b\x32*.lnrpc.PendingChannelsResponse.Commitments\x1a\xb7\x01\n\x0b\x43ommitments\x12\x12\n\nlocal_txid\x18\x01 \x01(\t\x12\x13\n\x0bremote_txid\x18\x02 \x01(\t\x12\x1b\n\x13remote_pending_txid\x18\x03 \x01(\t\x12\x1c\n\x14local_commit_fee_sat\x18\x04 \x01(\x04\x12\x1d\n\x15remote_commit_fee_sat\x18\x05 \x01(\x04\x12%\n\x1dremote_pending_commit_fee_sat\x18\x06 \x01(\x04\x1a\x65\n\rClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x1a\xff\x02\n\x12\x46orceClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x12\x15\n\rlimbo_balance\x18\x03 \x01(\x03\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\x19\n\x11recovered_balance\x18\x06 \x01(\x03\x12)\n\rpending_htlcs\x18\x08 \x03(\x0b\x32\x12.lnrpc.PendingHTLC\x12M\n\x06\x61nchor\x18\t \x01(\x0e\x32=.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState"1\n\x0b\x41nchorState\x12\t\n\x05LIMBO\x10\x00\x12\r\n\tRECOVERED\x10\x01\x12\x08\n\x04LOST\x10\x02"\x1a\n\x18\x43hannelEventSubscription"\x93\x04\n\x12\x43hannelEventUpdate\x12&\n\x0copen_channel\x18\x01 \x01(\x0b\x32\x0e.lnrpc.ChannelH\x00\x12\x34\n\x0e\x63losed_channel\x18\x02 \x01(\x0b\x32\x1a.lnrpc.ChannelCloseSummaryH\x00\x12-\n\x0e\x61\x63tive_channel\x18\x03 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12/\n\x10inactive_channel\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x34\n\x14pending_open_channel\x18\x06 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12\x35\n\x16\x66ully_resolved_channel\x18\x07 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x32\n\x04type\x18\x05 \x01(\x0e\x32$.lnrpc.ChannelEventUpdate.UpdateType"\x92\x01\n\nUpdateType\x12\x10\n\x0cOPEN_CHANNEL\x10\x00\x12\x12\n\x0e\x43LOSED_CHANNEL\x10\x01\x12\x12\n\x0e\x41\x43TIVE_CHANNEL\x10\x02\x12\x14\n\x10INACTIVE_CHANNEL\x10\x03\x12\x18\n\x14PENDING_OPEN_CHANNEL\x10\x04\x12\x1a\n\x16\x46ULLY_RESOLVED_CHANNEL\x10\x05\x42\t\n\x07\x63hannel"N\n\x14WalletAccountBalance\x12\x19\n\x11\x63onfirmed_balance\x18\x01 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x02 \x01(\x03"\x16\n\x14WalletBalanceRequest"\x85\x02\n\x15WalletBalanceResponse\x12\x15\n\rtotal_balance\x18\x01 \x01(\x03\x12\x19\n\x11\x63onfirmed_balance\x18\x02 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x03 \x01(\x03\x12I\n\x0f\x61\x63\x63ount_balance\x18\x04 \x03(\x0b\x32\x30.lnrpc.WalletBalanceResponse.AccountBalanceEntry\x1aR\n\x13\x41\x63\x63ountBalanceEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.lnrpc.WalletAccountBalance:\x02\x38\x01"#\n\x06\x41mount\x12\x0b\n\x03sat\x18\x01 \x01(\x04\x12\x0c\n\x04msat\x18\x02 \x01(\x04"\x17\n\x15\x43hannelBalanceRequest"\xe4\x02\n\x16\x43hannelBalanceResponse\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x03\x42\x02\x18\x01\x12 \n\x14pending_open_balance\x18\x02 \x01(\x03\x42\x02\x18\x01\x12$\n\rlocal_balance\x18\x03 \x01(\x0b\x32\r.lnrpc.Amount\x12%\n\x0eremote_balance\x18\x04 \x01(\x0b\x32\r.lnrpc.Amount\x12.\n\x17unsettled_local_balance\x18\x05 \x01(\x0b\x32\r.lnrpc.Amount\x12/\n\x18unsettled_remote_balance\x18\x06 \x01(\x0b\x32\r.lnrpc.Amount\x12\x31\n\x1apending_open_local_balance\x18\x07 \x01(\x0b\x32\r.lnrpc.Amount\x12\x32\n\x1bpending_open_remote_balance\x18\x08 \x01(\x0b\x32\r.lnrpc.Amount"\xd0\x04\n\x12QueryRoutesRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12"\n\tfee_limit\x18\x05 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x15\n\rignored_nodes\x18\x06 \x03(\x0c\x12-\n\rignored_edges\x18\x07 \x03(\x0b\x32\x12.lnrpc.EdgeLocatorB\x02\x18\x01\x12\x16\n\x0esource_pub_key\x18\x08 \x01(\t\x12\x1b\n\x13use_mission_control\x18\t \x01(\x08\x12&\n\rignored_pairs\x18\n \x03(\x0b\x32\x0f.lnrpc.NodePair\x12\x12\n\ncltv_limit\x18\x0b \x01(\r\x12M\n\x13\x64\x65st_custom_records\x18\r \x03(\x0b\x32\x30.lnrpc.QueryRoutesRequest.DestCustomRecordsEntry\x12\x1c\n\x10outgoing_chan_id\x18\x0e \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\x0f \x01(\x0c\x12%\n\x0broute_hints\x18\x10 \x03(\x0b\x32\x10.lnrpc.RouteHint\x12(\n\rdest_features\x18\x11 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01J\x04\x08\x03\x10\x04"$\n\x08NodePair\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\n\n\x02to\x18\x02 \x01(\x0c"@\n\x0b\x45\x64geLocator\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x64irection_reverse\x18\x02 \x01(\x08"I\n\x13QueryRoutesResponse\x12\x1c\n\x06routes\x18\x01 \x03(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0csuccess_prob\x18\x02 \x01(\x01"\x80\x03\n\x03Hop\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\rchan_capacity\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x1a\n\x0e\x61mt_to_forward\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\r\x12\x1b\n\x13\x61mt_to_forward_msat\x18\x06 \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x03\x12\x0f\n\x07pub_key\x18\x08 \x01(\t\x12\x13\n\x0btlv_payload\x18\t \x01(\x08\x12$\n\nmpp_record\x18\n \x01(\x0b\x32\x10.lnrpc.MPPRecord\x12$\n\namp_record\x18\x0c \x01(\x0b\x32\x10.lnrpc.AMPRecord\x12\x35\n\x0e\x63ustom_records\x18\x0b \x03(\x0b\x32\x1d.lnrpc.Hop.CustomRecordsEntry\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"9\n\tMPPRecord\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x16\n\x0etotal_amt_msat\x18\n \x01(\x03"D\n\tAMPRecord\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r"\x9a\x01\n\x05Route\x12\x17\n\x0ftotal_time_lock\x18\x01 \x01(\r\x12\x16\n\ntotal_fees\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\ttotal_amt\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x04hops\x18\x04 \x03(\x0b\x32\n.lnrpc.Hop\x12\x17\n\x0ftotal_fees_msat\x18\x05 \x01(\x03\x12\x16\n\x0etotal_amt_msat\x18\x06 \x01(\x03"<\n\x0fNodeInfoRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x18\n\x10include_channels\x18\x02 \x01(\x08"\x82\x01\n\x08NodeInfo\x12"\n\x04node\x18\x01 \x01(\x0b\x32\x14.lnrpc.LightningNode\x12\x14\n\x0cnum_channels\x18\x02 \x01(\r\x12\x16\n\x0etotal_capacity\x18\x03 \x01(\x03\x12$\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x12.lnrpc.ChannelEdge"\xf1\x01\n\rLightningNode\x12\x13\n\x0blast_update\x18\x01 \x01(\r\x12\x0f\n\x07pub_key\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12%\n\taddresses\x18\x04 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12\x34\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32".lnrpc.LightningNode.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01",\n\x0bNodeAddress\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t"\xac\x01\n\rRoutingPolicy\x12\x17\n\x0ftime_lock_delta\x18\x01 \x01(\r\x12\x10\n\x08min_htlc\x18\x02 \x01(\x03\x12\x15\n\rfee_base_msat\x18\x03 \x01(\x03\x12\x1b\n\x13\x66\x65\x65_rate_milli_msat\x18\x04 \x01(\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x13\n\x0blast_update\x18\x07 \x01(\r"\xe2\x01\n\x0b\x43hannelEdge\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchan_point\x18\x02 \x01(\t\x12\x17\n\x0blast_update\x18\x03 \x01(\rB\x02\x18\x01\x12\x11\n\tnode1_pub\x18\x04 \x01(\t\x12\x11\n\tnode2_pub\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12*\n\x0cnode1_policy\x18\x07 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12*\n\x0cnode2_policy\x18\x08 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy"2\n\x13\x43hannelGraphRequest\x12\x1b\n\x13include_unannounced\x18\x01 \x01(\x08"V\n\x0c\x43hannelGraph\x12#\n\x05nodes\x18\x01 \x03(\x0b\x32\x14.lnrpc.LightningNode\x12!\n\x05\x65\x64ges\x18\x02 \x03(\x0b\x32\x12.lnrpc.ChannelEdge":\n\x12NodeMetricsRequest\x12$\n\x05types\x18\x01 \x03(\x0e\x32\x15.lnrpc.NodeMetricType"\xbe\x01\n\x13NodeMetricsResponse\x12U\n\x16\x62\x65tweenness_centrality\x18\x01 \x03(\x0b\x32\x35.lnrpc.NodeMetricsResponse.BetweennessCentralityEntry\x1aP\n\x1a\x42\x65tweennessCentralityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.lnrpc.FloatMetric:\x02\x38\x01"6\n\x0b\x46loatMetric\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x18\n\x10normalized_value\x18\x02 \x01(\x01"&\n\x0f\x43hanInfoRequest\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01"\x14\n\x12NetworkInfoRequest"\xa7\x02\n\x0bNetworkInfo\x12\x16\n\x0egraph_diameter\x18\x01 \x01(\r\x12\x16\n\x0e\x61vg_out_degree\x18\x02 \x01(\x01\x12\x16\n\x0emax_out_degree\x18\x03 \x01(\r\x12\x11\n\tnum_nodes\x18\x04 \x01(\r\x12\x14\n\x0cnum_channels\x18\x05 \x01(\r\x12\x1e\n\x16total_network_capacity\x18\x06 \x01(\x03\x12\x18\n\x10\x61vg_channel_size\x18\x07 \x01(\x01\x12\x18\n\x10min_channel_size\x18\x08 \x01(\x03\x12\x18\n\x10max_channel_size\x18\t \x01(\x03\x12\x1f\n\x17median_channel_size_sat\x18\n \x01(\x03\x12\x18\n\x10num_zombie_chans\x18\x0b \x01(\x04"\r\n\x0bStopRequest"\x0e\n\x0cStopResponse"\x1b\n\x19GraphTopologySubscription"\xa3\x01\n\x13GraphTopologyUpdate\x12\'\n\x0cnode_updates\x18\x01 \x03(\x0b\x32\x11.lnrpc.NodeUpdate\x12\x31\n\x0f\x63hannel_updates\x18\x02 \x03(\x0b\x32\x18.lnrpc.ChannelEdgeUpdate\x12\x30\n\x0c\x63losed_chans\x18\x03 \x03(\x0b\x32\x1a.lnrpc.ClosedChannelUpdate"\x94\x02\n\nNodeUpdate\x12\x15\n\taddresses\x18\x01 \x03(\tB\x02\x18\x01\x12\x14\n\x0cidentity_key\x18\x02 \x01(\t\x12\x1b\n\x0fglobal_features\x18\x03 \x01(\x0c\x42\x02\x18\x01\x12\r\n\x05\x61lias\x18\x04 \x01(\t\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12*\n\x0enode_addresses\x18\x07 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\x31\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32\x1f.lnrpc.NodeUpdate.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"\xc4\x01\n\x11\x43hannelEdgeUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12,\n\x0erouting_policy\x18\x04 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12\x18\n\x10\x61\x64vertising_node\x18\x05 \x01(\t\x12\x17\n\x0f\x63onnecting_node\x18\x06 \x01(\t"|\n\x13\x43losedChannelUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x02 \x01(\x03\x12\x15\n\rclosed_height\x18\x03 \x01(\r\x12\'\n\nchan_point\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"\x86\x01\n\x07HopHint\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rfee_base_msat\x18\x03 \x01(\r\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x04 \x01(\r\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\r"\x17\n\x05SetID\x12\x0e\n\x06set_id\x18\x01 \x01(\x0c".\n\tRouteHint\x12!\n\thop_hints\x18\x01 \x03(\x0b\x32\x0e.lnrpc.HopHint"{\n\x0f\x41MPInvoiceState\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04\x12\x13\n\x0bsettle_time\x18\x03 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x05 \x01(\x03"\x85\x07\n\x07Invoice\x12\x0c\n\x04memo\x18\x01 \x01(\t\x12\x12\n\nr_preimage\x18\x03 \x01(\x0c\x12\x0e\n\x06r_hash\x18\x04 \x01(\x0c\x12\r\n\x05value\x18\x05 \x01(\x03\x12\x12\n\nvalue_msat\x18\x17 \x01(\x03\x12\x13\n\x07settled\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x15\n\rcreation_date\x18\x07 \x01(\x03\x12\x13\n\x0bsettle_date\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\n \x01(\x0c\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\x12\x15\n\rfallback_addr\x18\x0c \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\r \x01(\x04\x12%\n\x0broute_hints\x18\x0e \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x0f\n\x07private\x18\x0f \x01(\x08\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0csettle_index\x18\x11 \x01(\x04\x12\x14\n\x08\x61mt_paid\x18\x12 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x61mt_paid_sat\x18\x13 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x14 \x01(\x03\x12*\n\x05state\x18\x15 \x01(\x0e\x32\x1b.lnrpc.Invoice.InvoiceState\x12!\n\x05htlcs\x18\x16 \x03(\x0b\x32\x12.lnrpc.InvoiceHTLC\x12.\n\x08\x66\x65\x61tures\x18\x18 \x03(\x0b\x32\x1c.lnrpc.Invoice.FeaturesEntry\x12\x12\n\nis_keysend\x18\x19 \x01(\x08\x12\x14\n\x0cpayment_addr\x18\x1a \x01(\x0c\x12\x0e\n\x06is_amp\x18\x1b \x01(\x08\x12>\n\x11\x61mp_invoice_state\x18\x1c \x03(\x0b\x32#.lnrpc.Invoice.AmpInvoiceStateEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01\x1aN\n\x14\x41mpInvoiceStateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.lnrpc.AMPInvoiceState:\x02\x38\x01"A\n\x0cInvoiceState\x12\x08\n\x04OPEN\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x03J\x04\x08\x02\x10\x03"\xf3\x02\n\x0bInvoiceHTLC\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nhtlc_index\x18\x02 \x01(\x04\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x04\x12\x15\n\raccept_height\x18\x04 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x03\x12\x14\n\x0cresolve_time\x18\x06 \x01(\x03\x12\x15\n\rexpiry_height\x18\x07 \x01(\x05\x12&\n\x05state\x18\x08 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12=\n\x0e\x63ustom_records\x18\t \x03(\x0b\x32%.lnrpc.InvoiceHTLC.CustomRecordsEntry\x12\x1a\n\x12mpp_total_amt_msat\x18\n \x01(\x04\x12\x17\n\x03\x61mp\x18\x0b \x01(\x0b\x32\n.lnrpc.AMP\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"^\n\x03\x41MP\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r\x12\x0c\n\x04hash\x18\x04 \x01(\x0c\x12\x10\n\x08preimage\x18\x05 \x01(\x0c"f\n\x12\x41\x64\x64InvoiceResponse\x12\x0e\n\x06r_hash\x18\x01 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x02 \x01(\t\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0cpayment_addr\x18\x11 \x01(\x0c"5\n\x0bPaymentHash\x12\x16\n\nr_hash_str\x18\x01 \x01(\tB\x02\x18\x01\x12\x0e\n\x06r_hash\x18\x02 \x01(\x0c"l\n\x12ListInvoiceRequest\x12\x14\n\x0cpending_only\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x04 \x01(\x04\x12\x18\n\x10num_max_invoices\x18\x05 \x01(\x04\x12\x10\n\x08reversed\x18\x06 \x01(\x08"n\n\x13ListInvoiceResponse\x12 \n\x08invoices\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Invoice\x12\x19\n\x11last_index_offset\x18\x02 \x01(\x04\x12\x1a\n\x12\x66irst_index_offset\x18\x03 \x01(\x04">\n\x13InvoiceSubscription\x12\x11\n\tadd_index\x18\x01 \x01(\x04\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04"\xe0\x03\n\x07Payment\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x11\n\x05value\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x19\n\rcreation_date\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10payment_preimage\x18\x06 \x01(\t\x12\x11\n\tvalue_sat\x18\x07 \x01(\x03\x12\x12\n\nvalue_msat\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12,\n\x06status\x18\n \x01(\x0e\x32\x1c.lnrpc.Payment.PaymentStatus\x12\x0f\n\x07\x66\x65\x65_sat\x18\x0b \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x63reation_time_ns\x18\r \x01(\x03\x12!\n\x05htlcs\x18\x0e \x03(\x0b\x32\x12.lnrpc.HTLCAttempt\x12\x15\n\rpayment_index\x18\x0f \x01(\x04\x12\x33\n\x0e\x66\x61ilure_reason\x18\x10 \x01(\x0e\x32\x1b.lnrpc.PaymentFailureReason"F\n\rPaymentStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tIN_FLIGHT\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03J\x04\x08\x04\x10\x05"\x8a\x02\n\x0bHTLCAttempt\x12\x12\n\nattempt_id\x18\x07 \x01(\x04\x12-\n\x06status\x18\x01 \x01(\x0e\x32\x1d.lnrpc.HTLCAttempt.HTLCStatus\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x17\n\x0f\x61ttempt_time_ns\x18\x03 \x01(\x03\x12\x17\n\x0fresolve_time_ns\x18\x04 \x01(\x03\x12\x1f\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32\x0e.lnrpc.Failure\x12\x10\n\x08preimage\x18\x06 \x01(\x0c"6\n\nHTLCStatus\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02"o\n\x13ListPaymentsRequest\x12\x1a\n\x12include_incomplete\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x02 \x01(\x04\x12\x14\n\x0cmax_payments\x18\x03 \x01(\x04\x12\x10\n\x08reversed\x18\x04 \x01(\x08"o\n\x14ListPaymentsResponse\x12 \n\x08payments\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Payment\x12\x1a\n\x12\x66irst_index_offset\x18\x02 \x01(\x04\x12\x19\n\x11last_index_offset\x18\x03 \x01(\x04"G\n\x14\x44\x65letePaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"S\n\x18\x44\x65leteAllPaymentsRequest\x12\x1c\n\x14\x66\x61iled_payments_only\x18\x01 \x01(\x08\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"\x17\n\x15\x44\x65letePaymentResponse"\x1b\n\x19\x44\x65leteAllPaymentsResponse"\x86\x01\n\x15\x41\x62\x61ndonChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12!\n\x19pending_funding_shim_only\x18\x02 \x01(\x08\x12\x1e\n\x16i_know_what_i_am_doing\x18\x03 \x01(\x08"\x18\n\x16\x41\x62\x61ndonChannelResponse"5\n\x11\x44\x65\x62ugLevelRequest\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x12\n\nlevel_spec\x18\x02 \x01(\t")\n\x12\x44\x65\x62ugLevelResponse\x12\x13\n\x0bsub_systems\x18\x01 \x01(\t"\x1f\n\x0cPayReqString\x12\x0f\n\x07pay_req\x18\x01 \x01(\t"\x86\x03\n\x06PayReq\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\t\x12\x14\n\x0cnum_satoshis\x18\x03 \x01(\x03\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\x07 \x01(\t\x12\x15\n\rfallback_addr\x18\x08 \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\t \x01(\x03\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x10\n\x08num_msat\x18\x0c \x01(\x03\x12-\n\x08\x66\x65\x61tures\x18\r \x03(\x0b\x32\x1b.lnrpc.PayReq.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01">\n\x07\x46\x65\x61ture\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0bis_required\x18\x03 \x01(\x08\x12\x10\n\x08is_known\x18\x04 \x01(\x08"\x12\n\x10\x46\x65\x65ReportRequest"|\n\x10\x43hannelFeeReport\x12\x13\n\x07\x63han_id\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x15\n\rbase_fee_msat\x18\x02 \x01(\x03\x12\x13\n\x0b\x66\x65\x65_per_mil\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01"\x84\x01\n\x11\x46\x65\x65ReportResponse\x12-\n\x0c\x63hannel_fees\x18\x01 \x03(\x0b\x32\x17.lnrpc.ChannelFeeReport\x12\x13\n\x0b\x64\x61y_fee_sum\x18\x02 \x01(\x04\x12\x14\n\x0cweek_fee_sum\x18\x03 \x01(\x04\x12\x15\n\rmonth_fee_sum\x18\x04 \x01(\x04"\xec\x01\n\x13PolicyUpdateRequest\x12\x10\n\x06global\x18\x01 \x01(\x08H\x00\x12)\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x15\n\rbase_fee_msat\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01\x12\x17\n\x0ftime_lock_delta\x18\x05 \x01(\r\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x07 \x01(\x04\x12\x1f\n\x17min_htlc_msat_specified\x18\x08 \x01(\x08\x42\x07\n\x05scope"m\n\x0c\x46\x61iledUpdate\x12!\n\x08outpoint\x18\x01 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12$\n\x06reason\x18\x02 \x01(\x0e\x32\x14.lnrpc.UpdateFailure\x12\x14\n\x0cupdate_error\x18\x03 \x01(\t"C\n\x14PolicyUpdateResponse\x12+\n\x0e\x66\x61iled_updates\x18\x01 \x03(\x0b\x32\x13.lnrpc.FailedUpdate"n\n\x18\x46orwardingHistoryRequest\x12\x12\n\nstart_time\x18\x01 \x01(\x04\x12\x10\n\x08\x65nd_time\x18\x02 \x01(\x04\x12\x14\n\x0cindex_offset\x18\x03 \x01(\r\x12\x16\n\x0enum_max_events\x18\x04 \x01(\r"\xda\x01\n\x0f\x46orwardingEvent\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x18\x01\x12\x16\n\nchan_id_in\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x63han_id_out\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06\x61mt_in\x18\x05 \x01(\x04\x12\x0f\n\x07\x61mt_out\x18\x06 \x01(\x04\x12\x0b\n\x03\x66\x65\x65\x18\x07 \x01(\x04\x12\x10\n\x08\x66\x65\x65_msat\x18\x08 \x01(\x04\x12\x13\n\x0b\x61mt_in_msat\x18\t \x01(\x04\x12\x14\n\x0c\x61mt_out_msat\x18\n \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x0b \x01(\x04"i\n\x19\x46orwardingHistoryResponse\x12\x31\n\x11\x66orwarding_events\x18\x01 \x03(\x0b\x32\x16.lnrpc.ForwardingEvent\x12\x19\n\x11last_offset_index\x18\x02 \x01(\r"E\n\x1a\x45xportChannelBackupRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"M\n\rChannelBackup\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x13\n\x0b\x63han_backup\x18\x02 \x01(\x0c"V\n\x0fMultiChanBackup\x12(\n\x0b\x63han_points\x18\x01 \x03(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x19\n\x11multi_chan_backup\x18\x02 \x01(\x0c"\x19\n\x17\x43hanBackupExportRequest"{\n\x12\x43hanBackupSnapshot\x12\x32\n\x13single_chan_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackups\x12\x31\n\x11multi_chan_backup\x18\x02 \x01(\x0b\x32\x16.lnrpc.MultiChanBackup"<\n\x0e\x43hannelBackups\x12*\n\x0c\x63han_backups\x18\x01 \x03(\x0b\x32\x14.lnrpc.ChannelBackup"p\n\x18RestoreChanBackupRequest\x12-\n\x0c\x63han_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackupsH\x00\x12\x1b\n\x11multi_chan_backup\x18\x02 \x01(\x0cH\x00\x42\x08\n\x06\x62\x61\x63kup"\x17\n\x15RestoreBackupResponse"\x1b\n\x19\x43hannelBackupSubscription"\x1a\n\x18VerifyChanBackupResponse"4\n\x12MacaroonPermission\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t"~\n\x13\x42\x61keMacaroonRequest\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x13\n\x0broot_key_id\x18\x02 \x01(\x04\x12"\n\x1a\x61llow_external_permissions\x18\x03 \x01(\x08"(\n\x14\x42\x61keMacaroonResponse\x12\x10\n\x08macaroon\x18\x01 \x01(\t"\x18\n\x16ListMacaroonIDsRequest"/\n\x17ListMacaroonIDsResponse\x12\x14\n\x0croot_key_ids\x18\x01 \x03(\x04".\n\x17\x44\x65leteMacaroonIDRequest\x12\x13\n\x0broot_key_id\x18\x01 \x01(\x04"+\n\x18\x44\x65leteMacaroonIDResponse\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08"H\n\x16MacaroonPermissionList\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission"\x18\n\x16ListPermissionsRequest"\xc5\x01\n\x17ListPermissionsResponse\x12Q\n\x12method_permissions\x18\x01 \x03(\x0b\x32\x35.lnrpc.ListPermissionsResponse.MethodPermissionsEntry\x1aW\n\x16MethodPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MacaroonPermissionList:\x02\x38\x01"\xd5\x07\n\x07\x46\x61ilure\x12(\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12,\n\x0e\x63hannel_update\x18\x03 \x01(\x0b\x32\x14.lnrpc.ChannelUpdate\x12\x11\n\thtlc_msat\x18\x04 \x01(\x04\x12\x15\n\ronion_sha_256\x18\x05 \x01(\x0c\x12\x13\n\x0b\x63ltv_expiry\x18\x06 \x01(\r\x12\r\n\x05\x66lags\x18\x07 \x01(\r\x12\x1c\n\x14\x66\x61ilure_source_index\x18\x08 \x01(\r\x12\x0e\n\x06height\x18\t \x01(\r"\xef\x05\n\x0b\x46\x61ilureCode\x12\x0c\n\x08RESERVED\x10\x00\x12(\n$INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS\x10\x01\x12\x1c\n\x18INCORRECT_PAYMENT_AMOUNT\x10\x02\x12\x1f\n\x1b\x46INAL_INCORRECT_CLTV_EXPIRY\x10\x03\x12\x1f\n\x1b\x46INAL_INCORRECT_HTLC_AMOUNT\x10\x04\x12\x19\n\x15\x46INAL_EXPIRY_TOO_SOON\x10\x05\x12\x11\n\rINVALID_REALM\x10\x06\x12\x13\n\x0f\x45XPIRY_TOO_SOON\x10\x07\x12\x19\n\x15INVALID_ONION_VERSION\x10\x08\x12\x16\n\x12INVALID_ONION_HMAC\x10\t\x12\x15\n\x11INVALID_ONION_KEY\x10\n\x12\x18\n\x14\x41MOUNT_BELOW_MINIMUM\x10\x0b\x12\x14\n\x10\x46\x45\x45_INSUFFICIENT\x10\x0c\x12\x19\n\x15INCORRECT_CLTV_EXPIRY\x10\r\x12\x14\n\x10\x43HANNEL_DISABLED\x10\x0e\x12\x1d\n\x19TEMPORARY_CHANNEL_FAILURE\x10\x0f\x12!\n\x1dREQUIRED_NODE_FEATURE_MISSING\x10\x10\x12$\n REQUIRED_CHANNEL_FEATURE_MISSING\x10\x11\x12\x15\n\x11UNKNOWN_NEXT_PEER\x10\x12\x12\x1a\n\x16TEMPORARY_NODE_FAILURE\x10\x13\x12\x1a\n\x16PERMANENT_NODE_FAILURE\x10\x14\x12\x1d\n\x19PERMANENT_CHANNEL_FAILURE\x10\x15\x12\x12\n\x0e\x45XPIRY_TOO_FAR\x10\x16\x12\x0f\n\x0bMPP_TIMEOUT\x10\x17\x12\x19\n\x15INVALID_ONION_PAYLOAD\x10\x18\x12\x15\n\x10INTERNAL_FAILURE\x10\xe5\x07\x12\x14\n\x0fUNKNOWN_FAILURE\x10\xe6\x07\x12\x17\n\x12UNREADABLE_FAILURE\x10\xe7\x07J\x04\x08\x02\x10\x03"\x9a\x02\n\rChannelUpdate\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x13\n\x07\x63han_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x11\n\ttimestamp\x18\x04 \x01(\r\x12\x15\n\rmessage_flags\x18\n \x01(\r\x12\x15\n\rchannel_flags\x18\x05 \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x06 \x01(\r\x12\x19\n\x11htlc_minimum_msat\x18\x07 \x01(\x04\x12\x10\n\x08\x62\x61se_fee\x18\x08 \x01(\r\x12\x10\n\x08\x66\x65\x65_rate\x18\t \x01(\r\x12\x19\n\x11htlc_maximum_msat\x18\x0b \x01(\x04\x12\x19\n\x11\x65xtra_opaque_data\x18\x0c \x01(\x0c"F\n\nMacaroonId\x12\r\n\x05nonce\x18\x01 \x01(\x0c\x12\x11\n\tstorageId\x18\x02 \x01(\x0c\x12\x16\n\x03ops\x18\x03 \x03(\x0b\x32\t.lnrpc.Op"%\n\x02Op\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t"k\n\x13\x43heckMacPermRequest\x12\x10\n\x08macaroon\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x12\n\nfullMethod\x18\x03 \x01(\t"%\n\x14\x43heckMacPermResponse\x12\r\n\x05valid\x18\x01 \x01(\x08"\xea\x01\n\x14RPCMiddlewareRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x14\n\x0craw_macaroon\x18\x02 \x01(\x0c\x12\x1f\n\x17\x63ustom_caveat_condition\x18\x03 \x01(\t\x12(\n\x0bstream_auth\x18\x04 \x01(\x0b\x32\x11.lnrpc.StreamAuthH\x00\x12$\n\x07request\x18\x05 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12%\n\x08response\x18\x06 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x42\x10\n\x0eintercept_type"%\n\nStreamAuth\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t"`\n\nRPCMessage\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t\x12\x12\n\nstream_rpc\x18\x02 \x01(\x08\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x12\n\nserialized\x18\x04 \x01(\x0c"\xa2\x01\n\x15RPCMiddlewareResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x31\n\x08register\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MiddlewareRegistrationH\x00\x12,\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x03 \x01(\x0b\x32\x18.lnrpc.InterceptFeedbackH\x00\x42\x14\n\x12middleware_message"n\n\x16MiddlewareRegistration\x12\x17\n\x0fmiddleware_name\x18\x01 \x01(\t\x12#\n\x1b\x63ustom_macaroon_caveat_name\x18\x02 \x01(\t\x12\x16\n\x0eread_only_mode\x18\x03 \x01(\x08"\\\n\x11InterceptFeedback\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x18\n\x10replace_response\x18\x02 \x01(\x08\x12\x1e\n\x16replacement_serialized\x18\x03 \x01(\x0c*}\n\x0b\x41\x64\x64ressType\x12\x17\n\x13WITNESS_PUBKEY_HASH\x10\x00\x12\x16\n\x12NESTED_PUBKEY_HASH\x10\x01\x12\x1e\n\x1aUNUSED_WITNESS_PUBKEY_HASH\x10\x02\x12\x1d\n\x19UNUSED_NESTED_PUBKEY_HASH\x10\x03*x\n\x0e\x43ommitmentType\x12\x1b\n\x17UNKNOWN_COMMITMENT_TYPE\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x15\n\x11STATIC_REMOTE_KEY\x10\x02\x12\x0b\n\x07\x41NCHORS\x10\x03\x12\x19\n\x15SCRIPT_ENFORCED_LEASE\x10\x04*a\n\tInitiator\x12\x15\n\x11INITIATOR_UNKNOWN\x10\x00\x12\x13\n\x0fINITIATOR_LOCAL\x10\x01\x12\x14\n\x10INITIATOR_REMOTE\x10\x02\x12\x12\n\x0eINITIATOR_BOTH\x10\x03*`\n\x0eResolutionType\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06\x41NCHOR\x10\x01\x12\x11\n\rINCOMING_HTLC\x10\x02\x12\x11\n\rOUTGOING_HTLC\x10\x03\x12\n\n\x06\x43OMMIT\x10\x04*q\n\x11ResolutionOutcome\x12\x13\n\x0fOUTCOME_UNKNOWN\x10\x00\x12\x0b\n\x07\x43LAIMED\x10\x01\x12\r\n\tUNCLAIMED\x10\x02\x12\r\n\tABANDONED\x10\x03\x12\x0f\n\x0b\x46IRST_STAGE\x10\x04\x12\x0b\n\x07TIMEOUT\x10\x05*9\n\x0eNodeMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x1a\n\x16\x42\x45TWEENNESS_CENTRALITY\x10\x01*;\n\x10InvoiceHTLCState\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02*\xd9\x01\n\x14PaymentFailureReason\x12\x17\n\x13\x46\x41ILURE_REASON_NONE\x10\x00\x12\x1a\n\x16\x46\x41ILURE_REASON_TIMEOUT\x10\x01\x12\x1b\n\x17\x46\x41ILURE_REASON_NO_ROUTE\x10\x02\x12\x18\n\x14\x46\x41ILURE_REASON_ERROR\x10\x03\x12,\n(FAILURE_REASON_INCORRECT_PAYMENT_DETAILS\x10\x04\x12\'\n#FAILURE_REASON_INSUFFICIENT_BALANCE\x10\x05*\xcf\x04\n\nFeatureBit\x12\x18\n\x14\x44\x41TALOSS_PROTECT_REQ\x10\x00\x12\x18\n\x14\x44\x41TALOSS_PROTECT_OPT\x10\x01\x12\x17\n\x13INITIAL_ROUING_SYNC\x10\x03\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_REQ\x10\x04\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_OPT\x10\x05\x12\x16\n\x12GOSSIP_QUERIES_REQ\x10\x06\x12\x16\n\x12GOSSIP_QUERIES_OPT\x10\x07\x12\x11\n\rTLV_ONION_REQ\x10\x08\x12\x11\n\rTLV_ONION_OPT\x10\t\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_REQ\x10\n\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_OPT\x10\x0b\x12\x19\n\x15STATIC_REMOTE_KEY_REQ\x10\x0c\x12\x19\n\x15STATIC_REMOTE_KEY_OPT\x10\r\x12\x14\n\x10PAYMENT_ADDR_REQ\x10\x0e\x12\x14\n\x10PAYMENT_ADDR_OPT\x10\x0f\x12\x0b\n\x07MPP_REQ\x10\x10\x12\x0b\n\x07MPP_OPT\x10\x11\x12\x16\n\x12WUMBO_CHANNELS_REQ\x10\x12\x12\x16\n\x12WUMBO_CHANNELS_OPT\x10\x13\x12\x0f\n\x0b\x41NCHORS_REQ\x10\x14\x12\x0f\n\x0b\x41NCHORS_OPT\x10\x15\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_REQ\x10\x16\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_OPT\x10\x17\x12\x0b\n\x07\x41MP_REQ\x10\x1e\x12\x0b\n\x07\x41MP_OPT\x10\x1f*\xac\x01\n\rUpdateFailure\x12\x1a\n\x16UPDATE_FAILURE_UNKNOWN\x10\x00\x12\x1a\n\x16UPDATE_FAILURE_PENDING\x10\x01\x12\x1c\n\x18UPDATE_FAILURE_NOT_FOUND\x10\x02\x12\x1f\n\x1bUPDATE_FAILURE_INTERNAL_ERR\x10\x03\x12$\n UPDATE_FAILURE_INVALID_PARAMETER\x10\x04\x32\xc9%\n\tLightning\x12J\n\rWalletBalance\x12\x1b.lnrpc.WalletBalanceRequest\x1a\x1c.lnrpc.WalletBalanceResponse\x12M\n\x0e\x43hannelBalance\x12\x1c.lnrpc.ChannelBalanceRequest\x1a\x1d.lnrpc.ChannelBalanceResponse\x12K\n\x0fGetTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x19.lnrpc.TransactionDetails\x12\x44\n\x0b\x45stimateFee\x12\x19.lnrpc.EstimateFeeRequest\x1a\x1a.lnrpc.EstimateFeeResponse\x12>\n\tSendCoins\x12\x17.lnrpc.SendCoinsRequest\x1a\x18.lnrpc.SendCoinsResponse\x12\x44\n\x0bListUnspent\x12\x19.lnrpc.ListUnspentRequest\x1a\x1a.lnrpc.ListUnspentResponse\x12L\n\x15SubscribeTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x12.lnrpc.Transaction0\x01\x12;\n\x08SendMany\x12\x16.lnrpc.SendManyRequest\x1a\x17.lnrpc.SendManyResponse\x12\x41\n\nNewAddress\x12\x18.lnrpc.NewAddressRequest\x1a\x19.lnrpc.NewAddressResponse\x12\x44\n\x0bSignMessage\x12\x19.lnrpc.SignMessageRequest\x1a\x1a.lnrpc.SignMessageResponse\x12J\n\rVerifyMessage\x12\x1b.lnrpc.VerifyMessageRequest\x1a\x1c.lnrpc.VerifyMessageResponse\x12\x44\n\x0b\x43onnectPeer\x12\x19.lnrpc.ConnectPeerRequest\x1a\x1a.lnrpc.ConnectPeerResponse\x12M\n\x0e\x44isconnectPeer\x12\x1c.lnrpc.DisconnectPeerRequest\x1a\x1d.lnrpc.DisconnectPeerResponse\x12>\n\tListPeers\x12\x17.lnrpc.ListPeersRequest\x1a\x18.lnrpc.ListPeersResponse\x12G\n\x13SubscribePeerEvents\x12\x1c.lnrpc.PeerEventSubscription\x1a\x10.lnrpc.PeerEvent0\x01\x12\x38\n\x07GetInfo\x12\x15.lnrpc.GetInfoRequest\x1a\x16.lnrpc.GetInfoResponse\x12P\n\x0fGetRecoveryInfo\x12\x1d.lnrpc.GetRecoveryInfoRequest\x1a\x1e.lnrpc.GetRecoveryInfoResponse\x12P\n\x0fPendingChannels\x12\x1d.lnrpc.PendingChannelsRequest\x1a\x1e.lnrpc.PendingChannelsResponse\x12G\n\x0cListChannels\x12\x1a.lnrpc.ListChannelsRequest\x1a\x1b.lnrpc.ListChannelsResponse\x12V\n\x16SubscribeChannelEvents\x12\x1f.lnrpc.ChannelEventSubscription\x1a\x19.lnrpc.ChannelEventUpdate0\x01\x12M\n\x0e\x43losedChannels\x12\x1c.lnrpc.ClosedChannelsRequest\x1a\x1d.lnrpc.ClosedChannelsResponse\x12\x41\n\x0fOpenChannelSync\x12\x19.lnrpc.OpenChannelRequest\x1a\x13.lnrpc.ChannelPoint\x12\x43\n\x0bOpenChannel\x12\x19.lnrpc.OpenChannelRequest\x1a\x17.lnrpc.OpenStatusUpdate0\x01\x12S\n\x10\x42\x61tchOpenChannel\x12\x1e.lnrpc.BatchOpenChannelRequest\x1a\x1f.lnrpc.BatchOpenChannelResponse\x12L\n\x10\x46undingStateStep\x12\x1b.lnrpc.FundingTransitionMsg\x1a\x1b.lnrpc.FundingStateStepResp\x12P\n\x0f\x43hannelAcceptor\x12\x1c.lnrpc.ChannelAcceptResponse\x1a\x1b.lnrpc.ChannelAcceptRequest(\x01\x30\x01\x12\x46\n\x0c\x43loseChannel\x12\x1a.lnrpc.CloseChannelRequest\x1a\x18.lnrpc.CloseStatusUpdate0\x01\x12M\n\x0e\x41\x62\x61ndonChannel\x12\x1c.lnrpc.AbandonChannelRequest\x1a\x1d.lnrpc.AbandonChannelResponse\x12?\n\x0bSendPayment\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12:\n\x0fSendPaymentSync\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse\x12\x46\n\x0bSendToRoute\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12\x41\n\x0fSendToRouteSync\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse\x12\x37\n\nAddInvoice\x12\x0e.lnrpc.Invoice\x1a\x19.lnrpc.AddInvoiceResponse\x12\x45\n\x0cListInvoices\x12\x19.lnrpc.ListInvoiceRequest\x1a\x1a.lnrpc.ListInvoiceResponse\x12\x33\n\rLookupInvoice\x12\x12.lnrpc.PaymentHash\x1a\x0e.lnrpc.Invoice\x12\x41\n\x11SubscribeInvoices\x12\x1a.lnrpc.InvoiceSubscription\x1a\x0e.lnrpc.Invoice0\x01\x12\x32\n\x0c\x44\x65\x63odePayReq\x12\x13.lnrpc.PayReqString\x1a\r.lnrpc.PayReq\x12G\n\x0cListPayments\x12\x1a.lnrpc.ListPaymentsRequest\x1a\x1b.lnrpc.ListPaymentsResponse\x12J\n\rDeletePayment\x12\x1b.lnrpc.DeletePaymentRequest\x1a\x1c.lnrpc.DeletePaymentResponse\x12V\n\x11\x44\x65leteAllPayments\x12\x1f.lnrpc.DeleteAllPaymentsRequest\x1a .lnrpc.DeleteAllPaymentsResponse\x12@\n\rDescribeGraph\x12\x1a.lnrpc.ChannelGraphRequest\x1a\x13.lnrpc.ChannelGraph\x12G\n\x0eGetNodeMetrics\x12\x19.lnrpc.NodeMetricsRequest\x1a\x1a.lnrpc.NodeMetricsResponse\x12\x39\n\x0bGetChanInfo\x12\x16.lnrpc.ChanInfoRequest\x1a\x12.lnrpc.ChannelEdge\x12\x36\n\x0bGetNodeInfo\x12\x16.lnrpc.NodeInfoRequest\x1a\x0f.lnrpc.NodeInfo\x12\x44\n\x0bQueryRoutes\x12\x19.lnrpc.QueryRoutesRequest\x1a\x1a.lnrpc.QueryRoutesResponse\x12?\n\x0eGetNetworkInfo\x12\x19.lnrpc.NetworkInfoRequest\x1a\x12.lnrpc.NetworkInfo\x12\x35\n\nStopDaemon\x12\x12.lnrpc.StopRequest\x1a\x13.lnrpc.StopResponse\x12W\n\x15SubscribeChannelGraph\x12 .lnrpc.GraphTopologySubscription\x1a\x1a.lnrpc.GraphTopologyUpdate0\x01\x12\x41\n\nDebugLevel\x12\x18.lnrpc.DebugLevelRequest\x1a\x19.lnrpc.DebugLevelResponse\x12>\n\tFeeReport\x12\x17.lnrpc.FeeReportRequest\x1a\x18.lnrpc.FeeReportResponse\x12N\n\x13UpdateChannelPolicy\x12\x1a.lnrpc.PolicyUpdateRequest\x1a\x1b.lnrpc.PolicyUpdateResponse\x12V\n\x11\x46orwardingHistory\x12\x1f.lnrpc.ForwardingHistoryRequest\x1a .lnrpc.ForwardingHistoryResponse\x12N\n\x13\x45xportChannelBackup\x12!.lnrpc.ExportChannelBackupRequest\x1a\x14.lnrpc.ChannelBackup\x12T\n\x17\x45xportAllChannelBackups\x12\x1e.lnrpc.ChanBackupExportRequest\x1a\x19.lnrpc.ChanBackupSnapshot\x12N\n\x10VerifyChanBackup\x12\x19.lnrpc.ChanBackupSnapshot\x1a\x1f.lnrpc.VerifyChanBackupResponse\x12V\n\x15RestoreChannelBackups\x12\x1f.lnrpc.RestoreChanBackupRequest\x1a\x1c.lnrpc.RestoreBackupResponse\x12X\n\x17SubscribeChannelBackups\x12 .lnrpc.ChannelBackupSubscription\x1a\x19.lnrpc.ChanBackupSnapshot0\x01\x12G\n\x0c\x42\x61keMacaroon\x12\x1a.lnrpc.BakeMacaroonRequest\x1a\x1b.lnrpc.BakeMacaroonResponse\x12P\n\x0fListMacaroonIDs\x12\x1d.lnrpc.ListMacaroonIDsRequest\x1a\x1e.lnrpc.ListMacaroonIDsResponse\x12S\n\x10\x44\x65leteMacaroonID\x12\x1e.lnrpc.DeleteMacaroonIDRequest\x1a\x1f.lnrpc.DeleteMacaroonIDResponse\x12P\n\x0fListPermissions\x12\x1d.lnrpc.ListPermissionsRequest\x1a\x1e.lnrpc.ListPermissionsResponse\x12S\n\x18\x43heckMacaroonPermissions\x12\x1a.lnrpc.CheckMacPermRequest\x1a\x1b.lnrpc.CheckMacPermResponse\x12V\n\x15RegisterRPCMiddleware\x12\x1c.lnrpc.RPCMiddlewareResponse\x1a\x1b.lnrpc.RPCMiddlewareRequest(\x01\x30\x01\x12V\n\x11SendCustomMessage\x12\x1f.lnrpc.SendCustomMessageRequest\x1a .lnrpc.SendCustomMessageResponse\x12X\n\x17SubscribeCustomMessages\x12%.lnrpc.SubscribeCustomMessagesRequest\x1a\x14.lnrpc.CustomMessage0\x01\x42\'Z%github.com/lightningnetwork/lnd/lnrpcb\x06proto3', +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x0flightning.proto\x12\x05lnrpc" \n\x1eSubscribeCustomMessagesRequest"9\n\rCustomMessage\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"D\n\x18SendCustomMessageRequest\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"\x1b\n\x19SendCustomMessageResponse"\xa2\x01\n\x04Utxo\x12(\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x12\n\namount_sat\x18\x03 \x01(\x03\x12\x11\n\tpk_script\x18\x04 \x01(\t\x12!\n\x08outpoint\x18\x05 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x15\n\rconfirmations\x18\x06 \x01(\x03"\x9e\x01\n\x0cOutputDetail\x12,\n\x0boutput_type\x18\x01 \x01(\x0e\x32\x17.lnrpc.OutputScriptType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x11\n\tpk_script\x18\x03 \x01(\t\x12\x14\n\x0coutput_index\x18\x04 \x01(\x03\x12\x0e\n\x06\x61mount\x18\x05 \x01(\x03\x12\x16\n\x0eis_our_address\x18\x06 \x01(\x08"\xbc\x02\n\x0bTransaction\x12\x0f\n\x07tx_hash\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x19\n\x11num_confirmations\x18\x03 \x01(\x05\x12\x12\n\nblock_hash\x18\x04 \x01(\t\x12\x14\n\x0c\x62lock_height\x18\x05 \x01(\x05\x12\x12\n\ntime_stamp\x18\x06 \x01(\x03\x12\x12\n\ntotal_fees\x18\x07 \x01(\x03\x12\x1a\n\x0e\x64\x65st_addresses\x18\x08 \x03(\tB\x02\x18\x01\x12+\n\x0eoutput_details\x18\x0b \x03(\x0b\x32\x13.lnrpc.OutputDetail\x12\x12\n\nraw_tx_hex\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t\x12\x33\n\x12previous_outpoints\x18\x0c \x03(\x0b\x32\x17.lnrpc.PreviousOutPoint"S\n\x16GetTransactionsRequest\x12\x14\n\x0cstart_height\x18\x01 \x01(\x05\x12\x12\n\nend_height\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t">\n\x12TransactionDetails\x12(\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x12.lnrpc.Transaction"M\n\x08\x46\x65\x65Limit\x12\x0f\n\x05\x66ixed\x18\x01 \x01(\x03H\x00\x12\x14\n\nfixed_msat\x18\x03 \x01(\x03H\x00\x12\x11\n\x07percent\x18\x02 \x01(\x03H\x00\x42\x07\n\x05limit"\x8a\x04\n\x0bSendRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x17\n\x0b\x64\x65st_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x0b\n\x03\x61mt\x18\x03 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x05 \x01(\tB\x02\x18\x01\x12\x17\n\x0fpayment_request\x18\x06 \x01(\t\x12\x18\n\x10\x66inal_cltv_delta\x18\x07 \x01(\x05\x12"\n\tfee_limit\x18\x08 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x1c\n\x10outgoing_chan_id\x18\t \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\r \x01(\x0c\x12\x12\n\ncltv_limit\x18\n \x01(\r\x12\x46\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32).lnrpc.SendRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0e \x01(\x08\x12(\n\rdest_features\x18\x0f \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x14\n\x0cpayment_addr\x18\x10 \x01(\x0c\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"z\n\x0cSendResponse\x12\x15\n\rpayment_error\x18\x01 \x01(\t\x12\x18\n\x10payment_preimage\x18\x02 \x01(\x0c\x12#\n\rpayment_route\x18\x03 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c"n\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x05route\x18\x04 \x01(\x0b\x32\x0c.lnrpc.RouteJ\x04\x08\x03\x10\x04"\xe5\x02\n\x14\x43hannelAcceptRequest\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x03 \x01(\x0c\x12\x13\n\x0b\x66unding_amt\x18\x04 \x01(\x04\x12\x10\n\x08push_amt\x18\x05 \x01(\x04\x12\x12\n\ndust_limit\x18\x06 \x01(\x04\x12\x1b\n\x13max_value_in_flight\x18\x07 \x01(\x04\x12\x17\n\x0f\x63hannel_reserve\x18\x08 \x01(\x04\x12\x10\n\x08min_htlc\x18\t \x01(\x04\x12\x12\n\nfee_per_kw\x18\n \x01(\x04\x12\x11\n\tcsv_delay\x18\x0b \x01(\r\x12\x1a\n\x12max_accepted_htlcs\x18\x0c \x01(\r\x12\x15\n\rchannel_flags\x18\r \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x0e \x01(\x0e\x32\x15.lnrpc.CommitmentType"\x87\x02\n\x15\x43hannelAcceptResponse\x12\x0e\n\x06\x61\x63\x63\x65pt\x18\x01 \x01(\x08\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x18\n\x10upfront_shutdown\x18\x04 \x01(\t\x12\x11\n\tcsv_delay\x18\x05 \x01(\r\x12\x13\n\x0breserve_sat\x18\x06 \x01(\x04\x12\x1a\n\x12in_flight_max_msat\x18\x07 \x01(\x04\x12\x16\n\x0emax_htlc_count\x18\x08 \x01(\r\x12\x13\n\x0bmin_htlc_in\x18\t \x01(\x04\x12\x18\n\x10min_accept_depth\x18\n \x01(\r\x12\x11\n\tzero_conf\x18\x0b \x01(\x08"n\n\x0c\x43hannelPoint\x12\x1c\n\x12\x66unding_txid_bytes\x18\x01 \x01(\x0cH\x00\x12\x1a\n\x10\x66unding_txid_str\x18\x02 \x01(\tH\x00\x12\x14\n\x0coutput_index\x18\x03 \x01(\rB\x0e\n\x0c\x66unding_txid"F\n\x08OutPoint\x12\x12\n\ntxid_bytes\x18\x01 \x01(\x0c\x12\x10\n\x08txid_str\x18\x02 \x01(\t\x12\x14\n\x0coutput_index\x18\x03 \x01(\r";\n\x10PreviousOutPoint\x12\x10\n\x08outpoint\x18\x01 \x01(\t\x12\x15\n\ris_our_output\x18\x02 \x01(\x08"0\n\x10LightningAddress\x12\x0e\n\x06pubkey\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t"\xcf\x01\n\x12\x45stimateFeeRequest\x12\x41\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32+.lnrpc.EstimateFeeRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x11\n\tmin_confs\x18\x03 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x04 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"_\n\x13\x45stimateFeeResponse\x12\x0f\n\x07\x66\x65\x65_sat\x18\x01 \x01(\x03\x12 \n\x14\x66\x65\x65rate_sat_per_byte\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x04"\x89\x02\n\x0fSendManyRequest\x12>\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32(.lnrpc.SendManyRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\r\n\x05label\x18\x06 \x01(\t\x12\x11\n\tmin_confs\x18\x07 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x08 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01" \n\x10SendManyResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"\xc5\x01\n\x10SendCoinsRequest\x12\x0c\n\x04\x61\x64\x64r\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x10\n\x08send_all\x18\x06 \x01(\x08\x12\r\n\x05label\x18\x07 \x01(\t\x12\x11\n\tmin_confs\x18\x08 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\t \x01(\x08"!\n\x11SendCoinsResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"K\n\x12ListUnspentRequest\x12\x11\n\tmin_confs\x18\x01 \x01(\x05\x12\x11\n\tmax_confs\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t"1\n\x13ListUnspentResponse\x12\x1a\n\x05utxos\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Utxo"F\n\x11NewAddressRequest\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x63\x63ount\x18\x02 \x01(\t"%\n\x12NewAddressResponse\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t"6\n\x12SignMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x13\n\x0bsingle_hash\x18\x02 \x01(\x08"(\n\x13SignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\t"6\n\x14VerifyMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\t"6\n\x15VerifyMessageResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\t"Z\n\x12\x43onnectPeerRequest\x12%\n\x04\x61\x64\x64r\x18\x01 \x01(\x0b\x32\x17.lnrpc.LightningAddress\x12\x0c\n\x04perm\x18\x02 \x01(\x08\x12\x0f\n\x07timeout\x18\x03 \x01(\x04"\x15\n\x13\x43onnectPeerResponse"(\n\x15\x44isconnectPeerRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t"\x18\n\x16\x44isconnectPeerResponse"\xa5\x01\n\x04HTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x11\n\thash_lock\x18\x03 \x01(\x0c\x12\x19\n\x11\x65xpiration_height\x18\x04 \x01(\r\x12\x12\n\nhtlc_index\x18\x05 \x01(\x04\x12\x1a\n\x12\x66orwarding_channel\x18\x06 \x01(\x04\x12\x1d\n\x15\x66orwarding_htlc_index\x18\x07 \x01(\x04"\xaa\x01\n\x12\x43hannelConstraints\x12\x11\n\tcsv_delay\x18\x01 \x01(\r\x12\x18\n\x10\x63han_reserve_sat\x18\x02 \x01(\x04\x12\x16\n\x0e\x64ust_limit_sat\x18\x03 \x01(\x04\x12\x1c\n\x14max_pending_amt_msat\x18\x04 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x04\x12\x1a\n\x12max_accepted_htlcs\x18\x06 \x01(\r"\xb0\x06\n\x07\x43hannel\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x15\n\rremote_pubkey\x18\x02 \x01(\t\x12\x15\n\rchannel_point\x18\x03 \x01(\t\x12\x13\n\x07\x63han_id\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x05 \x01(\x03\x12\x15\n\rlocal_balance\x18\x06 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x07 \x01(\x03\x12\x12\n\ncommit_fee\x18\x08 \x01(\x03\x12\x15\n\rcommit_weight\x18\t \x01(\x03\x12\x12\n\nfee_per_kw\x18\n \x01(\x03\x12\x19\n\x11unsettled_balance\x18\x0b \x01(\x03\x12\x1b\n\x13total_satoshis_sent\x18\x0c \x01(\x03\x12\x1f\n\x17total_satoshis_received\x18\r \x01(\x03\x12\x13\n\x0bnum_updates\x18\x0e \x01(\x04\x12"\n\rpending_htlcs\x18\x0f \x03(\x0b\x32\x0b.lnrpc.HTLC\x12\x15\n\tcsv_delay\x18\x10 \x01(\rB\x02\x18\x01\x12\x0f\n\x07private\x18\x11 \x01(\x08\x12\x11\n\tinitiator\x18\x12 \x01(\x08\x12\x19\n\x11\x63han_status_flags\x18\x13 \x01(\t\x12"\n\x16local_chan_reserve_sat\x18\x14 \x01(\x03\x42\x02\x18\x01\x12#\n\x17remote_chan_reserve_sat\x18\x15 \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x11static_remote_key\x18\x16 \x01(\x08\x42\x02\x18\x01\x12.\n\x0f\x63ommitment_type\x18\x1a \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x10\n\x08lifetime\x18\x17 \x01(\x03\x12\x0e\n\x06uptime\x18\x18 \x01(\x03\x12\x15\n\rclose_address\x18\x19 \x01(\t\x12\x17\n\x0fpush_amount_sat\x18\x1b \x01(\x04\x12\x13\n\x0bthaw_height\x18\x1c \x01(\r\x12\x34\n\x11local_constraints\x18\x1d \x01(\x0b\x32\x19.lnrpc.ChannelConstraints\x12\x35\n\x12remote_constraints\x18\x1e \x01(\x0b\x32\x19.lnrpc.ChannelConstraints"z\n\x13ListChannelsRequest\x12\x13\n\x0b\x61\x63tive_only\x18\x01 \x01(\x08\x12\x15\n\rinactive_only\x18\x02 \x01(\x08\x12\x13\n\x0bpublic_only\x18\x03 \x01(\x08\x12\x14\n\x0cprivate_only\x18\x04 \x01(\x08\x12\x0c\n\x04peer\x18\x05 \x01(\x0c"8\n\x14ListChannelsResponse\x12 \n\x08\x63hannels\x18\x0b \x03(\x0b\x32\x0e.lnrpc.Channel"\xa9\x04\n\x13\x43hannelCloseSummary\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchain_hash\x18\x03 \x01(\t\x12\x17\n\x0f\x63losing_tx_hash\x18\x04 \x01(\t\x12\x15\n\rremote_pubkey\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12\x14\n\x0c\x63lose_height\x18\x07 \x01(\r\x12\x17\n\x0fsettled_balance\x18\x08 \x01(\x03\x12\x1b\n\x13time_locked_balance\x18\t \x01(\x03\x12:\n\nclose_type\x18\n \x01(\x0e\x32&.lnrpc.ChannelCloseSummary.ClosureType\x12(\n\x0eopen_initiator\x18\x0b \x01(\x0e\x32\x10.lnrpc.Initiator\x12)\n\x0f\x63lose_initiator\x18\x0c \x01(\x0e\x32\x10.lnrpc.Initiator\x12&\n\x0bresolutions\x18\r \x03(\x0b\x32\x11.lnrpc.Resolution"\x8a\x01\n\x0b\x43losureType\x12\x15\n\x11\x43OOPERATIVE_CLOSE\x10\x00\x12\x15\n\x11LOCAL_FORCE_CLOSE\x10\x01\x12\x16\n\x12REMOTE_FORCE_CLOSE\x10\x02\x12\x10\n\x0c\x42REACH_CLOSE\x10\x03\x12\x14\n\x10\x46UNDING_CANCELED\x10\x04\x12\r\n\tABANDONED\x10\x05"\xb2\x01\n\nResolution\x12.\n\x0fresolution_type\x18\x01 \x01(\x0e\x32\x15.lnrpc.ResolutionType\x12)\n\x07outcome\x18\x02 \x01(\x0e\x32\x18.lnrpc.ResolutionOutcome\x12!\n\x08outpoint\x18\x03 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x12\n\namount_sat\x18\x04 \x01(\x04\x12\x12\n\nsweep_txid\x18\x05 \x01(\t"\x94\x01\n\x15\x43losedChannelsRequest\x12\x13\n\x0b\x63ooperative\x18\x01 \x01(\x08\x12\x13\n\x0blocal_force\x18\x02 \x01(\x08\x12\x14\n\x0cremote_force\x18\x03 \x01(\x08\x12\x0e\n\x06\x62reach\x18\x04 \x01(\x08\x12\x18\n\x10\x66unding_canceled\x18\x05 \x01(\x08\x12\x11\n\tabandoned\x18\x06 \x01(\x08"F\n\x16\x43losedChannelsResponse\x12,\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1a.lnrpc.ChannelCloseSummary"\xef\x03\n\x04Peer\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x01(\t\x12\x12\n\nbytes_sent\x18\x04 \x01(\x04\x12\x12\n\nbytes_recv\x18\x05 \x01(\x04\x12\x10\n\x08sat_sent\x18\x06 \x01(\x03\x12\x10\n\x08sat_recv\x18\x07 \x01(\x03\x12\x0f\n\x07inbound\x18\x08 \x01(\x08\x12\x11\n\tping_time\x18\t \x01(\x03\x12\'\n\tsync_type\x18\n \x01(\x0e\x32\x14.lnrpc.Peer.SyncType\x12+\n\x08\x66\x65\x61tures\x18\x0b \x03(\x0b\x32\x19.lnrpc.Peer.FeaturesEntry\x12\'\n\x06\x65rrors\x18\x0c \x03(\x0b\x32\x17.lnrpc.TimestampedError\x12\x12\n\nflap_count\x18\r \x01(\x05\x12\x14\n\x0clast_flap_ns\x18\x0e \x01(\x03\x12\x19\n\x11last_ping_payload\x18\x0f \x01(\x0c\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"P\n\x08SyncType\x12\x10\n\x0cUNKNOWN_SYNC\x10\x00\x12\x0f\n\x0b\x41\x43TIVE_SYNC\x10\x01\x12\x10\n\x0cPASSIVE_SYNC\x10\x02\x12\x0f\n\x0bPINNED_SYNC\x10\x03"4\n\x10TimestampedError\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t"(\n\x10ListPeersRequest\x12\x14\n\x0clatest_error\x18\x01 \x01(\x08"/\n\x11ListPeersResponse\x12\x1a\n\x05peers\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Peer"\x17\n\x15PeerEventSubscription"v\n\tPeerEvent\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x1a.lnrpc.PeerEvent.EventType".\n\tEventType\x12\x0f\n\x0bPEER_ONLINE\x10\x00\x12\x10\n\x0cPEER_OFFLINE\x10\x01"\x10\n\x0eGetInfoRequest"\xb8\x04\n\x0fGetInfoResponse\x12\x0f\n\x07version\x18\x0e \x01(\t\x12\x13\n\x0b\x63ommit_hash\x18\x14 \x01(\t\x12\x17\n\x0fidentity_pubkey\x18\x01 \x01(\t\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x11 \x01(\t\x12\x1c\n\x14num_pending_channels\x18\x03 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x04 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x0f \x01(\r\x12\x11\n\tnum_peers\x18\x05 \x01(\r\x12\x14\n\x0c\x62lock_height\x18\x06 \x01(\r\x12\x12\n\nblock_hash\x18\x08 \x01(\t\x12\x1d\n\x15\x62\x65st_header_timestamp\x18\r \x01(\x03\x12\x17\n\x0fsynced_to_chain\x18\t \x01(\x08\x12\x17\n\x0fsynced_to_graph\x18\x12 \x01(\x08\x12\x13\n\x07testnet\x18\n \x01(\x08\x42\x02\x18\x01\x12\x1c\n\x06\x63hains\x18\x10 \x03(\x0b\x32\x0c.lnrpc.Chain\x12\x0c\n\x04uris\x18\x0c \x03(\t\x12\x36\n\x08\x66\x65\x61tures\x18\x13 \x03(\x0b\x32$.lnrpc.GetInfoResponse.FeaturesEntry\x12 \n\x18require_htlc_interceptor\x18\x15 \x01(\x08\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01J\x04\x08\x0b\x10\x0c"\x18\n\x16GetRecoveryInfoRequest"]\n\x17GetRecoveryInfoResponse\x12\x15\n\rrecovery_mode\x18\x01 \x01(\x08\x12\x19\n\x11recovery_finished\x18\x02 \x01(\x08\x12\x10\n\x08progress\x18\x03 \x01(\x01"\'\n\x05\x43hain\x12\r\n\x05\x63hain\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t"U\n\x12\x43onfirmationUpdate\x12\x11\n\tblock_sha\x18\x01 \x01(\x0c\x12\x14\n\x0c\x62lock_height\x18\x02 \x01(\x05\x12\x16\n\x0enum_confs_left\x18\x03 \x01(\r"?\n\x11\x43hannelOpenUpdate\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint";\n\x12\x43hannelCloseUpdate\x12\x14\n\x0c\x63losing_txid\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08"\xb0\x01\n\x13\x43loseChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10\x64\x65livery_address\x18\x05 \x01(\t\x12\x15\n\rsat_per_vbyte\x18\x06 \x01(\x04"}\n\x11\x43loseStatusUpdate\x12-\n\rclose_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12/\n\nchan_close\x18\x03 \x01(\x0b\x32\x19.lnrpc.ChannelCloseUpdateH\x00\x42\x08\n\x06update"3\n\rPendingUpdate\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x14\n\x0coutput_index\x18\x02 \x01(\r"T\n\x13ReadyForPsbtFunding\x12\x17\n\x0f\x66unding_address\x18\x01 \x01(\t\x12\x16\n\x0e\x66unding_amount\x18\x02 \x01(\x03\x12\x0c\n\x04psbt\x18\x03 \x01(\x0c"\xad\x01\n\x17\x42\x61tchOpenChannelRequest\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.lnrpc.BatchOpenChannel\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x03\x12\x11\n\tmin_confs\x18\x04 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t"\xf9\x01\n\x10\x42\x61tchOpenChannel\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x1c\n\x14local_funding_amount\x18\x02 \x01(\x03\x12\x10\n\x08push_sat\x18\x03 \x01(\x03\x12\x0f\n\x07private\x18\x04 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\x06 \x01(\r\x12\x15\n\rclose_address\x18\x07 \x01(\t\x12\x17\n\x0fpending_chan_id\x18\x08 \x01(\x0c\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType"J\n\x18\x42\x61tchOpenChannelResponse\x12.\n\x10pending_channels\x18\x01 \x03(\x0b\x32\x14.lnrpc.PendingUpdate"\xa1\x04\n\x12OpenChannelRequest\x12\x15\n\rsat_per_vbyte\x18\x01 \x01(\x04\x12\x13\n\x0bnode_pubkey\x18\x02 \x01(\x0c\x12\x1e\n\x12node_pubkey_string\x18\x03 \x01(\tB\x02\x18\x01\x12\x1c\n\x14local_funding_amount\x18\x04 \x01(\x03\x12\x10\n\x08push_sat\x18\x05 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x06 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x07 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x07private\x18\x08 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\t \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\n \x01(\r\x12\x11\n\tmin_confs\x18\x0b \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x0c \x01(\x08\x12\x15\n\rclose_address\x18\r \x01(\t\x12(\n\x0c\x66unding_shim\x18\x0e \x01(\x0b\x32\x12.lnrpc.FundingShim\x12\'\n\x1fremote_max_value_in_flight_msat\x18\x0f \x01(\x04\x12\x18\n\x10remote_max_htlcs\x18\x10 \x01(\r\x12\x15\n\rmax_local_csv\x18\x11 \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x12 \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x11\n\tzero_conf\x18\x13 \x01(\x08\x12\x12\n\nscid_alias\x18\x14 \x01(\x08"\xc3\x01\n\x10OpenStatusUpdate\x12,\n\x0c\x63han_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12-\n\tchan_open\x18\x03 \x01(\x0b\x32\x18.lnrpc.ChannelOpenUpdateH\x00\x12/\n\tpsbt_fund\x18\x05 \x01(\x0b\x32\x1a.lnrpc.ReadyForPsbtFundingH\x00\x12\x17\n\x0fpending_chan_id\x18\x04 \x01(\x0c\x42\x08\n\x06update"3\n\nKeyLocator\x12\x12\n\nkey_family\x18\x01 \x01(\x05\x12\x11\n\tkey_index\x18\x02 \x01(\x05"J\n\rKeyDescriptor\x12\x15\n\rraw_key_bytes\x18\x01 \x01(\x0c\x12"\n\x07key_loc\x18\x02 \x01(\x0b\x32\x11.lnrpc.KeyLocator"\xb0\x01\n\rChanPointShim\x12\x0b\n\x03\x61mt\x18\x01 \x01(\x03\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\'\n\tlocal_key\x18\x03 \x01(\x0b\x32\x14.lnrpc.KeyDescriptor\x12\x12\n\nremote_key\x18\x04 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x05 \x01(\x0c\x12\x13\n\x0bthaw_height\x18\x06 \x01(\r"J\n\x08PsbtShim\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c\x12\x11\n\tbase_psbt\x18\x02 \x01(\x0c\x12\x12\n\nno_publish\x18\x03 \x01(\x08"l\n\x0b\x46undingShim\x12/\n\x0f\x63han_point_shim\x18\x01 \x01(\x0b\x32\x14.lnrpc.ChanPointShimH\x00\x12$\n\tpsbt_shim\x18\x02 \x01(\x0b\x32\x0f.lnrpc.PsbtShimH\x00\x42\x06\n\x04shim",\n\x11\x46undingShimCancel\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c"X\n\x11\x46undingPsbtVerify\x12\x13\n\x0b\x66unded_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x15\n\rskip_finalize\x18\x03 \x01(\x08"Y\n\x13\x46undingPsbtFinalize\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x14\n\x0c\x66inal_raw_tx\x18\x03 \x01(\x0c"\xe5\x01\n\x14\x46undingTransitionMsg\x12+\n\rshim_register\x18\x01 \x01(\x0b\x32\x12.lnrpc.FundingShimH\x00\x12/\n\x0bshim_cancel\x18\x02 \x01(\x0b\x32\x18.lnrpc.FundingShimCancelH\x00\x12/\n\x0bpsbt_verify\x18\x03 \x01(\x0b\x32\x18.lnrpc.FundingPsbtVerifyH\x00\x12\x33\n\rpsbt_finalize\x18\x04 \x01(\x0b\x32\x1a.lnrpc.FundingPsbtFinalizeH\x00\x42\t\n\x07trigger"\x16\n\x14\x46undingStateStepResp"\x86\x01\n\x0bPendingHTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x10\n\x08outpoint\x18\x03 \x01(\t\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\r\n\x05stage\x18\x06 \x01(\r"\x18\n\x16PendingChannelsRequest"\xf7\r\n\x17PendingChannelsResponse\x12\x1b\n\x13total_limbo_balance\x18\x01 \x01(\x03\x12P\n\x15pending_open_channels\x18\x02 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.PendingOpenChannel\x12R\n\x18pending_closing_channels\x18\x03 \x03(\x0b\x32,.lnrpc.PendingChannelsResponse.ClosedChannelB\x02\x18\x01\x12Y\n\x1epending_force_closing_channels\x18\x04 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.ForceClosedChannel\x12R\n\x16waiting_close_channels\x18\x05 \x03(\x0b\x32\x32.lnrpc.PendingChannelsResponse.WaitingCloseChannel\x1a\xe4\x02\n\x0ePendingChannel\x12\x17\n\x0fremote_node_pub\x18\x01 \x01(\t\x12\x15\n\rchannel_point\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12\x15\n\rlocal_balance\x18\x04 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x05 \x01(\x03\x12\x1e\n\x16local_chan_reserve_sat\x18\x06 \x01(\x03\x12\x1f\n\x17remote_chan_reserve_sat\x18\x07 \x01(\x03\x12#\n\tinitiator\x18\x08 \x01(\x0e\x32\x10.lnrpc.Initiator\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x1f\n\x17num_forwarding_packages\x18\n \x01(\x03\x12\x19\n\x11\x63han_status_flags\x18\x0b \x01(\t\x12\x0f\n\x07private\x18\x0c \x01(\x08\x1a\x99\x01\n\x12PendingOpenChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x12\n\ncommit_fee\x18\x04 \x01(\x03\x12\x15\n\rcommit_weight\x18\x05 \x01(\x03\x12\x12\n\nfee_per_kw\x18\x06 \x01(\x03J\x04\x08\x02\x10\x03\x1a\xc3\x01\n\x13WaitingCloseChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x15\n\rlimbo_balance\x18\x02 \x01(\x03\x12?\n\x0b\x63ommitments\x18\x03 \x01(\x0b\x32*.lnrpc.PendingChannelsResponse.Commitments\x12\x14\n\x0c\x63losing_txid\x18\x04 \x01(\t\x1a\xb7\x01\n\x0b\x43ommitments\x12\x12\n\nlocal_txid\x18\x01 \x01(\t\x12\x13\n\x0bremote_txid\x18\x02 \x01(\t\x12\x1b\n\x13remote_pending_txid\x18\x03 \x01(\t\x12\x1c\n\x14local_commit_fee_sat\x18\x04 \x01(\x04\x12\x1d\n\x15remote_commit_fee_sat\x18\x05 \x01(\x04\x12%\n\x1dremote_pending_commit_fee_sat\x18\x06 \x01(\x04\x1a\x65\n\rClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x1a\xff\x02\n\x12\x46orceClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x12\x15\n\rlimbo_balance\x18\x03 \x01(\x03\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\x19\n\x11recovered_balance\x18\x06 \x01(\x03\x12)\n\rpending_htlcs\x18\x08 \x03(\x0b\x32\x12.lnrpc.PendingHTLC\x12M\n\x06\x61nchor\x18\t \x01(\x0e\x32=.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState"1\n\x0b\x41nchorState\x12\t\n\x05LIMBO\x10\x00\x12\r\n\tRECOVERED\x10\x01\x12\x08\n\x04LOST\x10\x02"\x1a\n\x18\x43hannelEventSubscription"\x93\x04\n\x12\x43hannelEventUpdate\x12&\n\x0copen_channel\x18\x01 \x01(\x0b\x32\x0e.lnrpc.ChannelH\x00\x12\x34\n\x0e\x63losed_channel\x18\x02 \x01(\x0b\x32\x1a.lnrpc.ChannelCloseSummaryH\x00\x12-\n\x0e\x61\x63tive_channel\x18\x03 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12/\n\x10inactive_channel\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x34\n\x14pending_open_channel\x18\x06 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12\x35\n\x16\x66ully_resolved_channel\x18\x07 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x32\n\x04type\x18\x05 \x01(\x0e\x32$.lnrpc.ChannelEventUpdate.UpdateType"\x92\x01\n\nUpdateType\x12\x10\n\x0cOPEN_CHANNEL\x10\x00\x12\x12\n\x0e\x43LOSED_CHANNEL\x10\x01\x12\x12\n\x0e\x41\x43TIVE_CHANNEL\x10\x02\x12\x14\n\x10INACTIVE_CHANNEL\x10\x03\x12\x18\n\x14PENDING_OPEN_CHANNEL\x10\x04\x12\x1a\n\x16\x46ULLY_RESOLVED_CHANNEL\x10\x05\x42\t\n\x07\x63hannel"N\n\x14WalletAccountBalance\x12\x19\n\x11\x63onfirmed_balance\x18\x01 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x02 \x01(\x03"\x16\n\x14WalletBalanceRequest"\xc3\x02\n\x15WalletBalanceResponse\x12\x15\n\rtotal_balance\x18\x01 \x01(\x03\x12\x19\n\x11\x63onfirmed_balance\x18\x02 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x03 \x01(\x03\x12\x16\n\x0elocked_balance\x18\x05 \x01(\x03\x12$\n\x1creserved_balance_anchor_chan\x18\x06 \x01(\x03\x12I\n\x0f\x61\x63\x63ount_balance\x18\x04 \x03(\x0b\x32\x30.lnrpc.WalletBalanceResponse.AccountBalanceEntry\x1aR\n\x13\x41\x63\x63ountBalanceEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.lnrpc.WalletAccountBalance:\x02\x38\x01"#\n\x06\x41mount\x12\x0b\n\x03sat\x18\x01 \x01(\x04\x12\x0c\n\x04msat\x18\x02 \x01(\x04"\x17\n\x15\x43hannelBalanceRequest"\xe4\x02\n\x16\x43hannelBalanceResponse\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x03\x42\x02\x18\x01\x12 \n\x14pending_open_balance\x18\x02 \x01(\x03\x42\x02\x18\x01\x12$\n\rlocal_balance\x18\x03 \x01(\x0b\x32\r.lnrpc.Amount\x12%\n\x0eremote_balance\x18\x04 \x01(\x0b\x32\r.lnrpc.Amount\x12.\n\x17unsettled_local_balance\x18\x05 \x01(\x0b\x32\r.lnrpc.Amount\x12/\n\x18unsettled_remote_balance\x18\x06 \x01(\x0b\x32\r.lnrpc.Amount\x12\x31\n\x1apending_open_local_balance\x18\x07 \x01(\x0b\x32\r.lnrpc.Amount\x12\x32\n\x1bpending_open_remote_balance\x18\x08 \x01(\x0b\x32\r.lnrpc.Amount"\xe3\x04\n\x12QueryRoutesRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12"\n\tfee_limit\x18\x05 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x15\n\rignored_nodes\x18\x06 \x03(\x0c\x12-\n\rignored_edges\x18\x07 \x03(\x0b\x32\x12.lnrpc.EdgeLocatorB\x02\x18\x01\x12\x16\n\x0esource_pub_key\x18\x08 \x01(\t\x12\x1b\n\x13use_mission_control\x18\t \x01(\x08\x12&\n\rignored_pairs\x18\n \x03(\x0b\x32\x0f.lnrpc.NodePair\x12\x12\n\ncltv_limit\x18\x0b \x01(\r\x12M\n\x13\x64\x65st_custom_records\x18\r \x03(\x0b\x32\x30.lnrpc.QueryRoutesRequest.DestCustomRecordsEntry\x12\x1c\n\x10outgoing_chan_id\x18\x0e \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\x0f \x01(\x0c\x12%\n\x0broute_hints\x18\x10 \x03(\x0b\x32\x10.lnrpc.RouteHint\x12(\n\rdest_features\x18\x11 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x11\n\ttime_pref\x18\x12 \x01(\x01\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01J\x04\x08\x03\x10\x04"$\n\x08NodePair\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\n\n\x02to\x18\x02 \x01(\x0c"@\n\x0b\x45\x64geLocator\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x64irection_reverse\x18\x02 \x01(\x08"I\n\x13QueryRoutesResponse\x12\x1c\n\x06routes\x18\x01 \x03(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0csuccess_prob\x18\x02 \x01(\x01"\x96\x03\n\x03Hop\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\rchan_capacity\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x1a\n\x0e\x61mt_to_forward\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\r\x12\x1b\n\x13\x61mt_to_forward_msat\x18\x06 \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x03\x12\x0f\n\x07pub_key\x18\x08 \x01(\t\x12\x17\n\x0btlv_payload\x18\t \x01(\x08\x42\x02\x18\x01\x12$\n\nmpp_record\x18\n \x01(\x0b\x32\x10.lnrpc.MPPRecord\x12$\n\namp_record\x18\x0c \x01(\x0b\x32\x10.lnrpc.AMPRecord\x12\x35\n\x0e\x63ustom_records\x18\x0b \x03(\x0b\x32\x1d.lnrpc.Hop.CustomRecordsEntry\x12\x10\n\x08metadata\x18\r \x01(\x0c\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"9\n\tMPPRecord\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x16\n\x0etotal_amt_msat\x18\n \x01(\x03"D\n\tAMPRecord\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r"\x9a\x01\n\x05Route\x12\x17\n\x0ftotal_time_lock\x18\x01 \x01(\r\x12\x16\n\ntotal_fees\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\ttotal_amt\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x04hops\x18\x04 \x03(\x0b\x32\n.lnrpc.Hop\x12\x17\n\x0ftotal_fees_msat\x18\x05 \x01(\x03\x12\x16\n\x0etotal_amt_msat\x18\x06 \x01(\x03"<\n\x0fNodeInfoRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x18\n\x10include_channels\x18\x02 \x01(\x08"\x82\x01\n\x08NodeInfo\x12"\n\x04node\x18\x01 \x01(\x0b\x32\x14.lnrpc.LightningNode\x12\x14\n\x0cnum_channels\x18\x02 \x01(\r\x12\x16\n\x0etotal_capacity\x18\x03 \x01(\x03\x12$\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x12.lnrpc.ChannelEdge"\xf1\x01\n\rLightningNode\x12\x13\n\x0blast_update\x18\x01 \x01(\r\x12\x0f\n\x07pub_key\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12%\n\taddresses\x18\x04 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12\x34\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32".lnrpc.LightningNode.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01",\n\x0bNodeAddress\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t"\xac\x01\n\rRoutingPolicy\x12\x17\n\x0ftime_lock_delta\x18\x01 \x01(\r\x12\x10\n\x08min_htlc\x18\x02 \x01(\x03\x12\x15\n\rfee_base_msat\x18\x03 \x01(\x03\x12\x1b\n\x13\x66\x65\x65_rate_milli_msat\x18\x04 \x01(\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x13\n\x0blast_update\x18\x07 \x01(\r"\xe2\x01\n\x0b\x43hannelEdge\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchan_point\x18\x02 \x01(\t\x12\x17\n\x0blast_update\x18\x03 \x01(\rB\x02\x18\x01\x12\x11\n\tnode1_pub\x18\x04 \x01(\t\x12\x11\n\tnode2_pub\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12*\n\x0cnode1_policy\x18\x07 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12*\n\x0cnode2_policy\x18\x08 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy"2\n\x13\x43hannelGraphRequest\x12\x1b\n\x13include_unannounced\x18\x01 \x01(\x08"V\n\x0c\x43hannelGraph\x12#\n\x05nodes\x18\x01 \x03(\x0b\x32\x14.lnrpc.LightningNode\x12!\n\x05\x65\x64ges\x18\x02 \x03(\x0b\x32\x12.lnrpc.ChannelEdge":\n\x12NodeMetricsRequest\x12$\n\x05types\x18\x01 \x03(\x0e\x32\x15.lnrpc.NodeMetricType"\xbe\x01\n\x13NodeMetricsResponse\x12U\n\x16\x62\x65tweenness_centrality\x18\x01 \x03(\x0b\x32\x35.lnrpc.NodeMetricsResponse.BetweennessCentralityEntry\x1aP\n\x1a\x42\x65tweennessCentralityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.lnrpc.FloatMetric:\x02\x38\x01"6\n\x0b\x46loatMetric\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x18\n\x10normalized_value\x18\x02 \x01(\x01"&\n\x0f\x43hanInfoRequest\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01"\x14\n\x12NetworkInfoRequest"\xa7\x02\n\x0bNetworkInfo\x12\x16\n\x0egraph_diameter\x18\x01 \x01(\r\x12\x16\n\x0e\x61vg_out_degree\x18\x02 \x01(\x01\x12\x16\n\x0emax_out_degree\x18\x03 \x01(\r\x12\x11\n\tnum_nodes\x18\x04 \x01(\r\x12\x14\n\x0cnum_channels\x18\x05 \x01(\r\x12\x1e\n\x16total_network_capacity\x18\x06 \x01(\x03\x12\x18\n\x10\x61vg_channel_size\x18\x07 \x01(\x01\x12\x18\n\x10min_channel_size\x18\x08 \x01(\x03\x12\x18\n\x10max_channel_size\x18\t \x01(\x03\x12\x1f\n\x17median_channel_size_sat\x18\n \x01(\x03\x12\x18\n\x10num_zombie_chans\x18\x0b \x01(\x04"\r\n\x0bStopRequest"\x0e\n\x0cStopResponse"\x1b\n\x19GraphTopologySubscription"\xa3\x01\n\x13GraphTopologyUpdate\x12\'\n\x0cnode_updates\x18\x01 \x03(\x0b\x32\x11.lnrpc.NodeUpdate\x12\x31\n\x0f\x63hannel_updates\x18\x02 \x03(\x0b\x32\x18.lnrpc.ChannelEdgeUpdate\x12\x30\n\x0c\x63losed_chans\x18\x03 \x03(\x0b\x32\x1a.lnrpc.ClosedChannelUpdate"\x94\x02\n\nNodeUpdate\x12\x15\n\taddresses\x18\x01 \x03(\tB\x02\x18\x01\x12\x14\n\x0cidentity_key\x18\x02 \x01(\t\x12\x1b\n\x0fglobal_features\x18\x03 \x01(\x0c\x42\x02\x18\x01\x12\r\n\x05\x61lias\x18\x04 \x01(\t\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12*\n\x0enode_addresses\x18\x07 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\x31\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32\x1f.lnrpc.NodeUpdate.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"\xc4\x01\n\x11\x43hannelEdgeUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12,\n\x0erouting_policy\x18\x04 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12\x18\n\x10\x61\x64vertising_node\x18\x05 \x01(\t\x12\x17\n\x0f\x63onnecting_node\x18\x06 \x01(\t"|\n\x13\x43losedChannelUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x02 \x01(\x03\x12\x15\n\rclosed_height\x18\x03 \x01(\r\x12\'\n\nchan_point\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"\x86\x01\n\x07HopHint\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rfee_base_msat\x18\x03 \x01(\r\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x04 \x01(\r\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\r"\x17\n\x05SetID\x12\x0e\n\x06set_id\x18\x01 \x01(\x0c".\n\tRouteHint\x12!\n\thop_hints\x18\x01 \x03(\x0b\x32\x0e.lnrpc.HopHint"{\n\x0f\x41MPInvoiceState\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04\x12\x13\n\x0bsettle_time\x18\x03 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x05 \x01(\x03"\x85\x07\n\x07Invoice\x12\x0c\n\x04memo\x18\x01 \x01(\t\x12\x12\n\nr_preimage\x18\x03 \x01(\x0c\x12\x0e\n\x06r_hash\x18\x04 \x01(\x0c\x12\r\n\x05value\x18\x05 \x01(\x03\x12\x12\n\nvalue_msat\x18\x17 \x01(\x03\x12\x13\n\x07settled\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x15\n\rcreation_date\x18\x07 \x01(\x03\x12\x13\n\x0bsettle_date\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\n \x01(\x0c\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\x12\x15\n\rfallback_addr\x18\x0c \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\r \x01(\x04\x12%\n\x0broute_hints\x18\x0e \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x0f\n\x07private\x18\x0f \x01(\x08\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0csettle_index\x18\x11 \x01(\x04\x12\x14\n\x08\x61mt_paid\x18\x12 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x61mt_paid_sat\x18\x13 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x14 \x01(\x03\x12*\n\x05state\x18\x15 \x01(\x0e\x32\x1b.lnrpc.Invoice.InvoiceState\x12!\n\x05htlcs\x18\x16 \x03(\x0b\x32\x12.lnrpc.InvoiceHTLC\x12.\n\x08\x66\x65\x61tures\x18\x18 \x03(\x0b\x32\x1c.lnrpc.Invoice.FeaturesEntry\x12\x12\n\nis_keysend\x18\x19 \x01(\x08\x12\x14\n\x0cpayment_addr\x18\x1a \x01(\x0c\x12\x0e\n\x06is_amp\x18\x1b \x01(\x08\x12>\n\x11\x61mp_invoice_state\x18\x1c \x03(\x0b\x32#.lnrpc.Invoice.AmpInvoiceStateEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01\x1aN\n\x14\x41mpInvoiceStateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.lnrpc.AMPInvoiceState:\x02\x38\x01"A\n\x0cInvoiceState\x12\x08\n\x04OPEN\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x03J\x04\x08\x02\x10\x03"\xf3\x02\n\x0bInvoiceHTLC\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nhtlc_index\x18\x02 \x01(\x04\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x04\x12\x15\n\raccept_height\x18\x04 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x03\x12\x14\n\x0cresolve_time\x18\x06 \x01(\x03\x12\x15\n\rexpiry_height\x18\x07 \x01(\x05\x12&\n\x05state\x18\x08 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12=\n\x0e\x63ustom_records\x18\t \x03(\x0b\x32%.lnrpc.InvoiceHTLC.CustomRecordsEntry\x12\x1a\n\x12mpp_total_amt_msat\x18\n \x01(\x04\x12\x17\n\x03\x61mp\x18\x0b \x01(\x0b\x32\n.lnrpc.AMP\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"^\n\x03\x41MP\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r\x12\x0c\n\x04hash\x18\x04 \x01(\x0c\x12\x10\n\x08preimage\x18\x05 \x01(\x0c"f\n\x12\x41\x64\x64InvoiceResponse\x12\x0e\n\x06r_hash\x18\x01 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x02 \x01(\t\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0cpayment_addr\x18\x11 \x01(\x0c"5\n\x0bPaymentHash\x12\x16\n\nr_hash_str\x18\x01 \x01(\tB\x02\x18\x01\x12\x0e\n\x06r_hash\x18\x02 \x01(\x0c"l\n\x12ListInvoiceRequest\x12\x14\n\x0cpending_only\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x04 \x01(\x04\x12\x18\n\x10num_max_invoices\x18\x05 \x01(\x04\x12\x10\n\x08reversed\x18\x06 \x01(\x08"n\n\x13ListInvoiceResponse\x12 \n\x08invoices\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Invoice\x12\x19\n\x11last_index_offset\x18\x02 \x01(\x04\x12\x1a\n\x12\x66irst_index_offset\x18\x03 \x01(\x04">\n\x13InvoiceSubscription\x12\x11\n\tadd_index\x18\x01 \x01(\x04\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04"\xe0\x03\n\x07Payment\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x11\n\x05value\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x19\n\rcreation_date\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10payment_preimage\x18\x06 \x01(\t\x12\x11\n\tvalue_sat\x18\x07 \x01(\x03\x12\x12\n\nvalue_msat\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12,\n\x06status\x18\n \x01(\x0e\x32\x1c.lnrpc.Payment.PaymentStatus\x12\x0f\n\x07\x66\x65\x65_sat\x18\x0b \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x63reation_time_ns\x18\r \x01(\x03\x12!\n\x05htlcs\x18\x0e \x03(\x0b\x32\x12.lnrpc.HTLCAttempt\x12\x15\n\rpayment_index\x18\x0f \x01(\x04\x12\x33\n\x0e\x66\x61ilure_reason\x18\x10 \x01(\x0e\x32\x1b.lnrpc.PaymentFailureReason"F\n\rPaymentStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tIN_FLIGHT\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03J\x04\x08\x04\x10\x05"\x8a\x02\n\x0bHTLCAttempt\x12\x12\n\nattempt_id\x18\x07 \x01(\x04\x12-\n\x06status\x18\x01 \x01(\x0e\x32\x1d.lnrpc.HTLCAttempt.HTLCStatus\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x17\n\x0f\x61ttempt_time_ns\x18\x03 \x01(\x03\x12\x17\n\x0fresolve_time_ns\x18\x04 \x01(\x03\x12\x1f\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32\x0e.lnrpc.Failure\x12\x10\n\x08preimage\x18\x06 \x01(\x0c"6\n\nHTLCStatus\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02"\x8d\x01\n\x13ListPaymentsRequest\x12\x1a\n\x12include_incomplete\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x02 \x01(\x04\x12\x14\n\x0cmax_payments\x18\x03 \x01(\x04\x12\x10\n\x08reversed\x18\x04 \x01(\x08\x12\x1c\n\x14\x63ount_total_payments\x18\x05 \x01(\x08"\x8b\x01\n\x14ListPaymentsResponse\x12 \n\x08payments\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Payment\x12\x1a\n\x12\x66irst_index_offset\x18\x02 \x01(\x04\x12\x19\n\x11last_index_offset\x18\x03 \x01(\x04\x12\x1a\n\x12total_num_payments\x18\x04 \x01(\x04"G\n\x14\x44\x65letePaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"S\n\x18\x44\x65leteAllPaymentsRequest\x12\x1c\n\x14\x66\x61iled_payments_only\x18\x01 \x01(\x08\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"\x17\n\x15\x44\x65letePaymentResponse"\x1b\n\x19\x44\x65leteAllPaymentsResponse"\x86\x01\n\x15\x41\x62\x61ndonChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12!\n\x19pending_funding_shim_only\x18\x02 \x01(\x08\x12\x1e\n\x16i_know_what_i_am_doing\x18\x03 \x01(\x08"\x18\n\x16\x41\x62\x61ndonChannelResponse"5\n\x11\x44\x65\x62ugLevelRequest\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x12\n\nlevel_spec\x18\x02 \x01(\t")\n\x12\x44\x65\x62ugLevelResponse\x12\x13\n\x0bsub_systems\x18\x01 \x01(\t"\x1f\n\x0cPayReqString\x12\x0f\n\x07pay_req\x18\x01 \x01(\t"\x86\x03\n\x06PayReq\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\t\x12\x14\n\x0cnum_satoshis\x18\x03 \x01(\x03\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\x07 \x01(\t\x12\x15\n\rfallback_addr\x18\x08 \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\t \x01(\x03\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x10\n\x08num_msat\x18\x0c \x01(\x03\x12-\n\x08\x66\x65\x61tures\x18\r \x03(\x0b\x32\x1b.lnrpc.PayReq.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01">\n\x07\x46\x65\x61ture\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0bis_required\x18\x03 \x01(\x08\x12\x10\n\x08is_known\x18\x04 \x01(\x08"\x12\n\x10\x46\x65\x65ReportRequest"|\n\x10\x43hannelFeeReport\x12\x13\n\x07\x63han_id\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x15\n\rbase_fee_msat\x18\x02 \x01(\x03\x12\x13\n\x0b\x66\x65\x65_per_mil\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01"\x84\x01\n\x11\x46\x65\x65ReportResponse\x12-\n\x0c\x63hannel_fees\x18\x01 \x03(\x0b\x32\x17.lnrpc.ChannelFeeReport\x12\x13\n\x0b\x64\x61y_fee_sum\x18\x02 \x01(\x04\x12\x14\n\x0cweek_fee_sum\x18\x03 \x01(\x04\x12\x15\n\rmonth_fee_sum\x18\x04 \x01(\x04"\x82\x02\n\x13PolicyUpdateRequest\x12\x10\n\x06global\x18\x01 \x01(\x08H\x00\x12)\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x15\n\rbase_fee_msat\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01\x12\x14\n\x0c\x66\x65\x65_rate_ppm\x18\t \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x05 \x01(\r\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x07 \x01(\x04\x12\x1f\n\x17min_htlc_msat_specified\x18\x08 \x01(\x08\x42\x07\n\x05scope"m\n\x0c\x46\x61iledUpdate\x12!\n\x08outpoint\x18\x01 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12$\n\x06reason\x18\x02 \x01(\x0e\x32\x14.lnrpc.UpdateFailure\x12\x14\n\x0cupdate_error\x18\x03 \x01(\t"C\n\x14PolicyUpdateResponse\x12+\n\x0e\x66\x61iled_updates\x18\x01 \x03(\x0b\x32\x13.lnrpc.FailedUpdate"n\n\x18\x46orwardingHistoryRequest\x12\x12\n\nstart_time\x18\x01 \x01(\x04\x12\x10\n\x08\x65nd_time\x18\x02 \x01(\x04\x12\x14\n\x0cindex_offset\x18\x03 \x01(\r\x12\x16\n\x0enum_max_events\x18\x04 \x01(\r"\xda\x01\n\x0f\x46orwardingEvent\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x18\x01\x12\x16\n\nchan_id_in\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x63han_id_out\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06\x61mt_in\x18\x05 \x01(\x04\x12\x0f\n\x07\x61mt_out\x18\x06 \x01(\x04\x12\x0b\n\x03\x66\x65\x65\x18\x07 \x01(\x04\x12\x10\n\x08\x66\x65\x65_msat\x18\x08 \x01(\x04\x12\x13\n\x0b\x61mt_in_msat\x18\t \x01(\x04\x12\x14\n\x0c\x61mt_out_msat\x18\n \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x0b \x01(\x04"i\n\x19\x46orwardingHistoryResponse\x12\x31\n\x11\x66orwarding_events\x18\x01 \x03(\x0b\x32\x16.lnrpc.ForwardingEvent\x12\x19\n\x11last_offset_index\x18\x02 \x01(\r"E\n\x1a\x45xportChannelBackupRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"M\n\rChannelBackup\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x13\n\x0b\x63han_backup\x18\x02 \x01(\x0c"V\n\x0fMultiChanBackup\x12(\n\x0b\x63han_points\x18\x01 \x03(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x19\n\x11multi_chan_backup\x18\x02 \x01(\x0c"\x19\n\x17\x43hanBackupExportRequest"{\n\x12\x43hanBackupSnapshot\x12\x32\n\x13single_chan_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackups\x12\x31\n\x11multi_chan_backup\x18\x02 \x01(\x0b\x32\x16.lnrpc.MultiChanBackup"<\n\x0e\x43hannelBackups\x12*\n\x0c\x63han_backups\x18\x01 \x03(\x0b\x32\x14.lnrpc.ChannelBackup"p\n\x18RestoreChanBackupRequest\x12-\n\x0c\x63han_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackupsH\x00\x12\x1b\n\x11multi_chan_backup\x18\x02 \x01(\x0cH\x00\x42\x08\n\x06\x62\x61\x63kup"\x17\n\x15RestoreBackupResponse"\x1b\n\x19\x43hannelBackupSubscription"\x1a\n\x18VerifyChanBackupResponse"4\n\x12MacaroonPermission\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t"~\n\x13\x42\x61keMacaroonRequest\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x13\n\x0broot_key_id\x18\x02 \x01(\x04\x12"\n\x1a\x61llow_external_permissions\x18\x03 \x01(\x08"(\n\x14\x42\x61keMacaroonResponse\x12\x10\n\x08macaroon\x18\x01 \x01(\t"\x18\n\x16ListMacaroonIDsRequest"/\n\x17ListMacaroonIDsResponse\x12\x14\n\x0croot_key_ids\x18\x01 \x03(\x04".\n\x17\x44\x65leteMacaroonIDRequest\x12\x13\n\x0broot_key_id\x18\x01 \x01(\x04"+\n\x18\x44\x65leteMacaroonIDResponse\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08"H\n\x16MacaroonPermissionList\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission"\x18\n\x16ListPermissionsRequest"\xc5\x01\n\x17ListPermissionsResponse\x12Q\n\x12method_permissions\x18\x01 \x03(\x0b\x32\x35.lnrpc.ListPermissionsResponse.MethodPermissionsEntry\x1aW\n\x16MethodPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MacaroonPermissionList:\x02\x38\x01"\xd5\x07\n\x07\x46\x61ilure\x12(\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12,\n\x0e\x63hannel_update\x18\x03 \x01(\x0b\x32\x14.lnrpc.ChannelUpdate\x12\x11\n\thtlc_msat\x18\x04 \x01(\x04\x12\x15\n\ronion_sha_256\x18\x05 \x01(\x0c\x12\x13\n\x0b\x63ltv_expiry\x18\x06 \x01(\r\x12\r\n\x05\x66lags\x18\x07 \x01(\r\x12\x1c\n\x14\x66\x61ilure_source_index\x18\x08 \x01(\r\x12\x0e\n\x06height\x18\t \x01(\r"\xef\x05\n\x0b\x46\x61ilureCode\x12\x0c\n\x08RESERVED\x10\x00\x12(\n$INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS\x10\x01\x12\x1c\n\x18INCORRECT_PAYMENT_AMOUNT\x10\x02\x12\x1f\n\x1b\x46INAL_INCORRECT_CLTV_EXPIRY\x10\x03\x12\x1f\n\x1b\x46INAL_INCORRECT_HTLC_AMOUNT\x10\x04\x12\x19\n\x15\x46INAL_EXPIRY_TOO_SOON\x10\x05\x12\x11\n\rINVALID_REALM\x10\x06\x12\x13\n\x0f\x45XPIRY_TOO_SOON\x10\x07\x12\x19\n\x15INVALID_ONION_VERSION\x10\x08\x12\x16\n\x12INVALID_ONION_HMAC\x10\t\x12\x15\n\x11INVALID_ONION_KEY\x10\n\x12\x18\n\x14\x41MOUNT_BELOW_MINIMUM\x10\x0b\x12\x14\n\x10\x46\x45\x45_INSUFFICIENT\x10\x0c\x12\x19\n\x15INCORRECT_CLTV_EXPIRY\x10\r\x12\x14\n\x10\x43HANNEL_DISABLED\x10\x0e\x12\x1d\n\x19TEMPORARY_CHANNEL_FAILURE\x10\x0f\x12!\n\x1dREQUIRED_NODE_FEATURE_MISSING\x10\x10\x12$\n REQUIRED_CHANNEL_FEATURE_MISSING\x10\x11\x12\x15\n\x11UNKNOWN_NEXT_PEER\x10\x12\x12\x1a\n\x16TEMPORARY_NODE_FAILURE\x10\x13\x12\x1a\n\x16PERMANENT_NODE_FAILURE\x10\x14\x12\x1d\n\x19PERMANENT_CHANNEL_FAILURE\x10\x15\x12\x12\n\x0e\x45XPIRY_TOO_FAR\x10\x16\x12\x0f\n\x0bMPP_TIMEOUT\x10\x17\x12\x19\n\x15INVALID_ONION_PAYLOAD\x10\x18\x12\x15\n\x10INTERNAL_FAILURE\x10\xe5\x07\x12\x14\n\x0fUNKNOWN_FAILURE\x10\xe6\x07\x12\x17\n\x12UNREADABLE_FAILURE\x10\xe7\x07J\x04\x08\x02\x10\x03"\x9a\x02\n\rChannelUpdate\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x13\n\x07\x63han_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x11\n\ttimestamp\x18\x04 \x01(\r\x12\x15\n\rmessage_flags\x18\n \x01(\r\x12\x15\n\rchannel_flags\x18\x05 \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x06 \x01(\r\x12\x19\n\x11htlc_minimum_msat\x18\x07 \x01(\x04\x12\x10\n\x08\x62\x61se_fee\x18\x08 \x01(\r\x12\x10\n\x08\x66\x65\x65_rate\x18\t \x01(\r\x12\x19\n\x11htlc_maximum_msat\x18\x0b \x01(\x04\x12\x19\n\x11\x65xtra_opaque_data\x18\x0c \x01(\x0c"F\n\nMacaroonId\x12\r\n\x05nonce\x18\x01 \x01(\x0c\x12\x11\n\tstorageId\x18\x02 \x01(\x0c\x12\x16\n\x03ops\x18\x03 \x03(\x0b\x32\t.lnrpc.Op"%\n\x02Op\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t"k\n\x13\x43heckMacPermRequest\x12\x10\n\x08macaroon\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x12\n\nfullMethod\x18\x03 \x01(\t"%\n\x14\x43heckMacPermResponse\x12\r\n\x05valid\x18\x01 \x01(\x08"\xfa\x01\n\x14RPCMiddlewareRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x14\n\x0craw_macaroon\x18\x02 \x01(\x0c\x12\x1f\n\x17\x63ustom_caveat_condition\x18\x03 \x01(\t\x12(\n\x0bstream_auth\x18\x04 \x01(\x0b\x32\x11.lnrpc.StreamAuthH\x00\x12$\n\x07request\x18\x05 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12%\n\x08response\x18\x06 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12\x0e\n\x06msg_id\x18\x07 \x01(\x04\x42\x10\n\x0eintercept_type"%\n\nStreamAuth\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t"r\n\nRPCMessage\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t\x12\x12\n\nstream_rpc\x18\x02 \x01(\x08\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x12\n\nserialized\x18\x04 \x01(\x0c\x12\x10\n\x08is_error\x18\x05 \x01(\x08"\xa2\x01\n\x15RPCMiddlewareResponse\x12\x12\n\nref_msg_id\x18\x01 \x01(\x04\x12\x31\n\x08register\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MiddlewareRegistrationH\x00\x12,\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x03 \x01(\x0b\x32\x18.lnrpc.InterceptFeedbackH\x00\x42\x14\n\x12middleware_message"n\n\x16MiddlewareRegistration\x12\x17\n\x0fmiddleware_name\x18\x01 \x01(\t\x12#\n\x1b\x63ustom_macaroon_caveat_name\x18\x02 \x01(\t\x12\x16\n\x0eread_only_mode\x18\x03 \x01(\x08"\\\n\x11InterceptFeedback\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x18\n\x10replace_response\x18\x02 \x01(\x08\x12\x1e\n\x16replacement_serialized\x18\x03 \x01(\x0c*\xa7\x02\n\x10OutputScriptType\x12\x1b\n\x17SCRIPT_TYPE_PUBKEY_HASH\x10\x00\x12\x1b\n\x17SCRIPT_TYPE_SCRIPT_HASH\x10\x01\x12&\n"SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH\x10\x02\x12&\n"SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH\x10\x03\x12\x16\n\x12SCRIPT_TYPE_PUBKEY\x10\x04\x12\x18\n\x14SCRIPT_TYPE_MULTISIG\x10\x05\x12\x18\n\x14SCRIPT_TYPE_NULLDATA\x10\x06\x12\x1c\n\x18SCRIPT_TYPE_NON_STANDARD\x10\x07\x12\x1f\n\x1bSCRIPT_TYPE_WITNESS_UNKNOWN\x10\x08*\xac\x01\n\x0b\x41\x64\x64ressType\x12\x17\n\x13WITNESS_PUBKEY_HASH\x10\x00\x12\x16\n\x12NESTED_PUBKEY_HASH\x10\x01\x12\x1e\n\x1aUNUSED_WITNESS_PUBKEY_HASH\x10\x02\x12\x1d\n\x19UNUSED_NESTED_PUBKEY_HASH\x10\x03\x12\x12\n\x0eTAPROOT_PUBKEY\x10\x04\x12\x19\n\x15UNUSED_TAPROOT_PUBKEY\x10\x05*x\n\x0e\x43ommitmentType\x12\x1b\n\x17UNKNOWN_COMMITMENT_TYPE\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x15\n\x11STATIC_REMOTE_KEY\x10\x02\x12\x0b\n\x07\x41NCHORS\x10\x03\x12\x19\n\x15SCRIPT_ENFORCED_LEASE\x10\x04*a\n\tInitiator\x12\x15\n\x11INITIATOR_UNKNOWN\x10\x00\x12\x13\n\x0fINITIATOR_LOCAL\x10\x01\x12\x14\n\x10INITIATOR_REMOTE\x10\x02\x12\x12\n\x0eINITIATOR_BOTH\x10\x03*`\n\x0eResolutionType\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06\x41NCHOR\x10\x01\x12\x11\n\rINCOMING_HTLC\x10\x02\x12\x11\n\rOUTGOING_HTLC\x10\x03\x12\n\n\x06\x43OMMIT\x10\x04*q\n\x11ResolutionOutcome\x12\x13\n\x0fOUTCOME_UNKNOWN\x10\x00\x12\x0b\n\x07\x43LAIMED\x10\x01\x12\r\n\tUNCLAIMED\x10\x02\x12\r\n\tABANDONED\x10\x03\x12\x0f\n\x0b\x46IRST_STAGE\x10\x04\x12\x0b\n\x07TIMEOUT\x10\x05*9\n\x0eNodeMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x1a\n\x16\x42\x45TWEENNESS_CENTRALITY\x10\x01*;\n\x10InvoiceHTLCState\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02*\xd9\x01\n\x14PaymentFailureReason\x12\x17\n\x13\x46\x41ILURE_REASON_NONE\x10\x00\x12\x1a\n\x16\x46\x41ILURE_REASON_TIMEOUT\x10\x01\x12\x1b\n\x17\x46\x41ILURE_REASON_NO_ROUTE\x10\x02\x12\x18\n\x14\x46\x41ILURE_REASON_ERROR\x10\x03\x12,\n(FAILURE_REASON_INCORRECT_PAYMENT_DETAILS\x10\x04\x12\'\n#FAILURE_REASON_INSUFFICIENT_BALANCE\x10\x05*\xcf\x04\n\nFeatureBit\x12\x18\n\x14\x44\x41TALOSS_PROTECT_REQ\x10\x00\x12\x18\n\x14\x44\x41TALOSS_PROTECT_OPT\x10\x01\x12\x17\n\x13INITIAL_ROUING_SYNC\x10\x03\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_REQ\x10\x04\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_OPT\x10\x05\x12\x16\n\x12GOSSIP_QUERIES_REQ\x10\x06\x12\x16\n\x12GOSSIP_QUERIES_OPT\x10\x07\x12\x11\n\rTLV_ONION_REQ\x10\x08\x12\x11\n\rTLV_ONION_OPT\x10\t\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_REQ\x10\n\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_OPT\x10\x0b\x12\x19\n\x15STATIC_REMOTE_KEY_REQ\x10\x0c\x12\x19\n\x15STATIC_REMOTE_KEY_OPT\x10\r\x12\x14\n\x10PAYMENT_ADDR_REQ\x10\x0e\x12\x14\n\x10PAYMENT_ADDR_OPT\x10\x0f\x12\x0b\n\x07MPP_REQ\x10\x10\x12\x0b\n\x07MPP_OPT\x10\x11\x12\x16\n\x12WUMBO_CHANNELS_REQ\x10\x12\x12\x16\n\x12WUMBO_CHANNELS_OPT\x10\x13\x12\x0f\n\x0b\x41NCHORS_REQ\x10\x14\x12\x0f\n\x0b\x41NCHORS_OPT\x10\x15\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_REQ\x10\x16\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_OPT\x10\x17\x12\x0b\n\x07\x41MP_REQ\x10\x1e\x12\x0b\n\x07\x41MP_OPT\x10\x1f*\xac\x01\n\rUpdateFailure\x12\x1a\n\x16UPDATE_FAILURE_UNKNOWN\x10\x00\x12\x1a\n\x16UPDATE_FAILURE_PENDING\x10\x01\x12\x1c\n\x18UPDATE_FAILURE_NOT_FOUND\x10\x02\x12\x1f\n\x1bUPDATE_FAILURE_INTERNAL_ERR\x10\x03\x12$\n UPDATE_FAILURE_INVALID_PARAMETER\x10\x04\x32\xc9%\n\tLightning\x12J\n\rWalletBalance\x12\x1b.lnrpc.WalletBalanceRequest\x1a\x1c.lnrpc.WalletBalanceResponse\x12M\n\x0e\x43hannelBalance\x12\x1c.lnrpc.ChannelBalanceRequest\x1a\x1d.lnrpc.ChannelBalanceResponse\x12K\n\x0fGetTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x19.lnrpc.TransactionDetails\x12\x44\n\x0b\x45stimateFee\x12\x19.lnrpc.EstimateFeeRequest\x1a\x1a.lnrpc.EstimateFeeResponse\x12>\n\tSendCoins\x12\x17.lnrpc.SendCoinsRequest\x1a\x18.lnrpc.SendCoinsResponse\x12\x44\n\x0bListUnspent\x12\x19.lnrpc.ListUnspentRequest\x1a\x1a.lnrpc.ListUnspentResponse\x12L\n\x15SubscribeTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x12.lnrpc.Transaction0\x01\x12;\n\x08SendMany\x12\x16.lnrpc.SendManyRequest\x1a\x17.lnrpc.SendManyResponse\x12\x41\n\nNewAddress\x12\x18.lnrpc.NewAddressRequest\x1a\x19.lnrpc.NewAddressResponse\x12\x44\n\x0bSignMessage\x12\x19.lnrpc.SignMessageRequest\x1a\x1a.lnrpc.SignMessageResponse\x12J\n\rVerifyMessage\x12\x1b.lnrpc.VerifyMessageRequest\x1a\x1c.lnrpc.VerifyMessageResponse\x12\x44\n\x0b\x43onnectPeer\x12\x19.lnrpc.ConnectPeerRequest\x1a\x1a.lnrpc.ConnectPeerResponse\x12M\n\x0e\x44isconnectPeer\x12\x1c.lnrpc.DisconnectPeerRequest\x1a\x1d.lnrpc.DisconnectPeerResponse\x12>\n\tListPeers\x12\x17.lnrpc.ListPeersRequest\x1a\x18.lnrpc.ListPeersResponse\x12G\n\x13SubscribePeerEvents\x12\x1c.lnrpc.PeerEventSubscription\x1a\x10.lnrpc.PeerEvent0\x01\x12\x38\n\x07GetInfo\x12\x15.lnrpc.GetInfoRequest\x1a\x16.lnrpc.GetInfoResponse\x12P\n\x0fGetRecoveryInfo\x12\x1d.lnrpc.GetRecoveryInfoRequest\x1a\x1e.lnrpc.GetRecoveryInfoResponse\x12P\n\x0fPendingChannels\x12\x1d.lnrpc.PendingChannelsRequest\x1a\x1e.lnrpc.PendingChannelsResponse\x12G\n\x0cListChannels\x12\x1a.lnrpc.ListChannelsRequest\x1a\x1b.lnrpc.ListChannelsResponse\x12V\n\x16SubscribeChannelEvents\x12\x1f.lnrpc.ChannelEventSubscription\x1a\x19.lnrpc.ChannelEventUpdate0\x01\x12M\n\x0e\x43losedChannels\x12\x1c.lnrpc.ClosedChannelsRequest\x1a\x1d.lnrpc.ClosedChannelsResponse\x12\x41\n\x0fOpenChannelSync\x12\x19.lnrpc.OpenChannelRequest\x1a\x13.lnrpc.ChannelPoint\x12\x43\n\x0bOpenChannel\x12\x19.lnrpc.OpenChannelRequest\x1a\x17.lnrpc.OpenStatusUpdate0\x01\x12S\n\x10\x42\x61tchOpenChannel\x12\x1e.lnrpc.BatchOpenChannelRequest\x1a\x1f.lnrpc.BatchOpenChannelResponse\x12L\n\x10\x46undingStateStep\x12\x1b.lnrpc.FundingTransitionMsg\x1a\x1b.lnrpc.FundingStateStepResp\x12P\n\x0f\x43hannelAcceptor\x12\x1c.lnrpc.ChannelAcceptResponse\x1a\x1b.lnrpc.ChannelAcceptRequest(\x01\x30\x01\x12\x46\n\x0c\x43loseChannel\x12\x1a.lnrpc.CloseChannelRequest\x1a\x18.lnrpc.CloseStatusUpdate0\x01\x12M\n\x0e\x41\x62\x61ndonChannel\x12\x1c.lnrpc.AbandonChannelRequest\x1a\x1d.lnrpc.AbandonChannelResponse\x12?\n\x0bSendPayment\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12:\n\x0fSendPaymentSync\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse\x12\x46\n\x0bSendToRoute\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12\x41\n\x0fSendToRouteSync\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse\x12\x37\n\nAddInvoice\x12\x0e.lnrpc.Invoice\x1a\x19.lnrpc.AddInvoiceResponse\x12\x45\n\x0cListInvoices\x12\x19.lnrpc.ListInvoiceRequest\x1a\x1a.lnrpc.ListInvoiceResponse\x12\x33\n\rLookupInvoice\x12\x12.lnrpc.PaymentHash\x1a\x0e.lnrpc.Invoice\x12\x41\n\x11SubscribeInvoices\x12\x1a.lnrpc.InvoiceSubscription\x1a\x0e.lnrpc.Invoice0\x01\x12\x32\n\x0c\x44\x65\x63odePayReq\x12\x13.lnrpc.PayReqString\x1a\r.lnrpc.PayReq\x12G\n\x0cListPayments\x12\x1a.lnrpc.ListPaymentsRequest\x1a\x1b.lnrpc.ListPaymentsResponse\x12J\n\rDeletePayment\x12\x1b.lnrpc.DeletePaymentRequest\x1a\x1c.lnrpc.DeletePaymentResponse\x12V\n\x11\x44\x65leteAllPayments\x12\x1f.lnrpc.DeleteAllPaymentsRequest\x1a .lnrpc.DeleteAllPaymentsResponse\x12@\n\rDescribeGraph\x12\x1a.lnrpc.ChannelGraphRequest\x1a\x13.lnrpc.ChannelGraph\x12G\n\x0eGetNodeMetrics\x12\x19.lnrpc.NodeMetricsRequest\x1a\x1a.lnrpc.NodeMetricsResponse\x12\x39\n\x0bGetChanInfo\x12\x16.lnrpc.ChanInfoRequest\x1a\x12.lnrpc.ChannelEdge\x12\x36\n\x0bGetNodeInfo\x12\x16.lnrpc.NodeInfoRequest\x1a\x0f.lnrpc.NodeInfo\x12\x44\n\x0bQueryRoutes\x12\x19.lnrpc.QueryRoutesRequest\x1a\x1a.lnrpc.QueryRoutesResponse\x12?\n\x0eGetNetworkInfo\x12\x19.lnrpc.NetworkInfoRequest\x1a\x12.lnrpc.NetworkInfo\x12\x35\n\nStopDaemon\x12\x12.lnrpc.StopRequest\x1a\x13.lnrpc.StopResponse\x12W\n\x15SubscribeChannelGraph\x12 .lnrpc.GraphTopologySubscription\x1a\x1a.lnrpc.GraphTopologyUpdate0\x01\x12\x41\n\nDebugLevel\x12\x18.lnrpc.DebugLevelRequest\x1a\x19.lnrpc.DebugLevelResponse\x12>\n\tFeeReport\x12\x17.lnrpc.FeeReportRequest\x1a\x18.lnrpc.FeeReportResponse\x12N\n\x13UpdateChannelPolicy\x12\x1a.lnrpc.PolicyUpdateRequest\x1a\x1b.lnrpc.PolicyUpdateResponse\x12V\n\x11\x46orwardingHistory\x12\x1f.lnrpc.ForwardingHistoryRequest\x1a .lnrpc.ForwardingHistoryResponse\x12N\n\x13\x45xportChannelBackup\x12!.lnrpc.ExportChannelBackupRequest\x1a\x14.lnrpc.ChannelBackup\x12T\n\x17\x45xportAllChannelBackups\x12\x1e.lnrpc.ChanBackupExportRequest\x1a\x19.lnrpc.ChanBackupSnapshot\x12N\n\x10VerifyChanBackup\x12\x19.lnrpc.ChanBackupSnapshot\x1a\x1f.lnrpc.VerifyChanBackupResponse\x12V\n\x15RestoreChannelBackups\x12\x1f.lnrpc.RestoreChanBackupRequest\x1a\x1c.lnrpc.RestoreBackupResponse\x12X\n\x17SubscribeChannelBackups\x12 .lnrpc.ChannelBackupSubscription\x1a\x19.lnrpc.ChanBackupSnapshot0\x01\x12G\n\x0c\x42\x61keMacaroon\x12\x1a.lnrpc.BakeMacaroonRequest\x1a\x1b.lnrpc.BakeMacaroonResponse\x12P\n\x0fListMacaroonIDs\x12\x1d.lnrpc.ListMacaroonIDsRequest\x1a\x1e.lnrpc.ListMacaroonIDsResponse\x12S\n\x10\x44\x65leteMacaroonID\x12\x1e.lnrpc.DeleteMacaroonIDRequest\x1a\x1f.lnrpc.DeleteMacaroonIDResponse\x12P\n\x0fListPermissions\x12\x1d.lnrpc.ListPermissionsRequest\x1a\x1e.lnrpc.ListPermissionsResponse\x12S\n\x18\x43heckMacaroonPermissions\x12\x1a.lnrpc.CheckMacPermRequest\x1a\x1b.lnrpc.CheckMacPermResponse\x12V\n\x15RegisterRPCMiddleware\x12\x1c.lnrpc.RPCMiddlewareResponse\x1a\x1b.lnrpc.RPCMiddlewareRequest(\x01\x30\x01\x12V\n\x11SendCustomMessage\x12\x1f.lnrpc.SendCustomMessageRequest\x1a .lnrpc.SendCustomMessageResponse\x12X\n\x17SubscribeCustomMessages\x12%.lnrpc.SubscribeCustomMessagesRequest\x1a\x14.lnrpc.CustomMessage0\x01\x42\'Z%github.com/lightningnetwork/lnd/lnrpcb\x06proto3' ) -_ADDRESSTYPE = _descriptor.EnumDescriptor( - name="AddressType", - full_name="lnrpc.AddressType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="WITNESS_PUBKEY_HASH", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="NESTED_PUBKEY_HASH", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNUSED_WITNESS_PUBKEY_HASH", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNUSED_NESTED_PUBKEY_HASH", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26639, - serialized_end=26764, -) -_sym_db.RegisterEnumDescriptor(_ADDRESSTYPE) - +_OUTPUTSCRIPTTYPE = DESCRIPTOR.enum_types_by_name["OutputScriptType"] +OutputScriptType = enum_type_wrapper.EnumTypeWrapper(_OUTPUTSCRIPTTYPE) +_ADDRESSTYPE = DESCRIPTOR.enum_types_by_name["AddressType"] AddressType = enum_type_wrapper.EnumTypeWrapper(_ADDRESSTYPE) -_COMMITMENTTYPE = _descriptor.EnumDescriptor( - name="CommitmentType", - full_name="lnrpc.CommitmentType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_COMMITMENT_TYPE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LEGACY", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SCRIPT_ENFORCED_LEASE", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26766, - serialized_end=26886, -) -_sym_db.RegisterEnumDescriptor(_COMMITMENTTYPE) - +_COMMITMENTTYPE = DESCRIPTOR.enum_types_by_name["CommitmentType"] CommitmentType = enum_type_wrapper.EnumTypeWrapper(_COMMITMENTTYPE) -_INITIATOR = _descriptor.EnumDescriptor( - name="Initiator", - full_name="lnrpc.Initiator", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="INITIATOR_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_LOCAL", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_REMOTE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_BOTH", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26888, - serialized_end=26985, -) -_sym_db.RegisterEnumDescriptor(_INITIATOR) - +_INITIATOR = DESCRIPTOR.enum_types_by_name["Initiator"] Initiator = enum_type_wrapper.EnumTypeWrapper(_INITIATOR) -_RESOLUTIONTYPE = _descriptor.EnumDescriptor( - name="ResolutionType", - full_name="lnrpc.ResolutionType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHOR", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCOMING_HTLC", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="OUTGOING_HTLC", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="COMMIT", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26987, - serialized_end=27083, -) -_sym_db.RegisterEnumDescriptor(_RESOLUTIONTYPE) - +_RESOLUTIONTYPE = DESCRIPTOR.enum_types_by_name["ResolutionType"] ResolutionType = enum_type_wrapper.EnumTypeWrapper(_RESOLUTIONTYPE) -_RESOLUTIONOUTCOME = _descriptor.EnumDescriptor( - name="ResolutionOutcome", - full_name="lnrpc.ResolutionOutcome", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OUTCOME_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CLAIMED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNCLAIMED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ABANDONED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FIRST_STAGE", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TIMEOUT", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27085, - serialized_end=27198, -) -_sym_db.RegisterEnumDescriptor(_RESOLUTIONOUTCOME) - +_RESOLUTIONOUTCOME = DESCRIPTOR.enum_types_by_name["ResolutionOutcome"] ResolutionOutcome = enum_type_wrapper.EnumTypeWrapper(_RESOLUTIONOUTCOME) -_NODEMETRICTYPE = _descriptor.EnumDescriptor( - name="NodeMetricType", - full_name="lnrpc.NodeMetricType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="BETWEENNESS_CENTRALITY", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27200, - serialized_end=27257, -) -_sym_db.RegisterEnumDescriptor(_NODEMETRICTYPE) - +_NODEMETRICTYPE = DESCRIPTOR.enum_types_by_name["NodeMetricType"] NodeMetricType = enum_type_wrapper.EnumTypeWrapper(_NODEMETRICTYPE) -_INVOICEHTLCSTATE = _descriptor.EnumDescriptor( - name="InvoiceHTLCState", - full_name="lnrpc.InvoiceHTLCState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="ACCEPTED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SETTLED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27259, - serialized_end=27318, -) -_sym_db.RegisterEnumDescriptor(_INVOICEHTLCSTATE) - +_INVOICEHTLCSTATE = DESCRIPTOR.enum_types_by_name["InvoiceHTLCState"] InvoiceHTLCState = enum_type_wrapper.EnumTypeWrapper(_INVOICEHTLCSTATE) -_PAYMENTFAILUREREASON = _descriptor.EnumDescriptor( - name="PaymentFailureReason", - full_name="lnrpc.PaymentFailureReason", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_NONE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_TIMEOUT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_NO_ROUTE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_ERROR", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_INCORRECT_PAYMENT_DETAILS", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_INSUFFICIENT_BALANCE", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27321, - serialized_end=27538, -) -_sym_db.RegisterEnumDescriptor(_PAYMENTFAILUREREASON) - +_PAYMENTFAILUREREASON = DESCRIPTOR.enum_types_by_name["PaymentFailureReason"] PaymentFailureReason = enum_type_wrapper.EnumTypeWrapper(_PAYMENTFAILUREREASON) -_FEATUREBIT = _descriptor.EnumDescriptor( - name="FeatureBit", - full_name="lnrpc.FeatureBit", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="DATALOSS_PROTECT_REQ", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="DATALOSS_PROTECT_OPT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIAL_ROUING_SYNC", - index=2, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPFRONT_SHUTDOWN_SCRIPT_REQ", - index=3, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPFRONT_SHUTDOWN_SCRIPT_OPT", - index=4, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="GOSSIP_QUERIES_REQ", - index=5, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="GOSSIP_QUERIES_OPT", - index=6, - number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TLV_ONION_REQ", - index=7, - number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TLV_ONION_OPT", - index=8, - number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXT_GOSSIP_QUERIES_REQ", - index=9, - number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXT_GOSSIP_QUERIES_OPT", - index=10, - number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY_REQ", - index=11, - number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY_OPT", - index=12, - number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAYMENT_ADDR_REQ", - index=13, - number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAYMENT_ADDR_OPT", - index=14, - number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_REQ", - index=15, - number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_OPT", - index=16, - number=17, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WUMBO_CHANNELS_REQ", - index=17, - number=18, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WUMBO_CHANNELS_OPT", - index=18, - number=19, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_REQ", - index=19, - number=20, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_OPT", - index=20, - number=21, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_ZERO_FEE_HTLC_REQ", - index=21, - number=22, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_ZERO_FEE_HTLC_OPT", - index=22, - number=23, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMP_REQ", - index=23, - number=30, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMP_OPT", - index=24, - number=31, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27541, - serialized_end=28132, -) -_sym_db.RegisterEnumDescriptor(_FEATUREBIT) - +_FEATUREBIT = DESCRIPTOR.enum_types_by_name["FeatureBit"] FeatureBit = enum_type_wrapper.EnumTypeWrapper(_FEATUREBIT) -_UPDATEFAILURE = _descriptor.EnumDescriptor( - name="UpdateFailure", - full_name="lnrpc.UpdateFailure", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_PENDING", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_NOT_FOUND", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_INTERNAL_ERR", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_INVALID_PARAMETER", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=28135, - serialized_end=28307, -) -_sym_db.RegisterEnumDescriptor(_UPDATEFAILURE) - +_UPDATEFAILURE = DESCRIPTOR.enum_types_by_name["UpdateFailure"] UpdateFailure = enum_type_wrapper.EnumTypeWrapper(_UPDATEFAILURE) +SCRIPT_TYPE_PUBKEY_HASH = 0 +SCRIPT_TYPE_SCRIPT_HASH = 1 +SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2 +SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3 +SCRIPT_TYPE_PUBKEY = 4 +SCRIPT_TYPE_MULTISIG = 5 +SCRIPT_TYPE_NULLDATA = 6 +SCRIPT_TYPE_NON_STANDARD = 7 +SCRIPT_TYPE_WITNESS_UNKNOWN = 8 WITNESS_PUBKEY_HASH = 0 NESTED_PUBKEY_HASH = 1 UNUSED_WITNESS_PUBKEY_HASH = 2 UNUSED_NESTED_PUBKEY_HASH = 3 +TAPROOT_PUBKEY = 4 +UNUSED_TAPROOT_PUBKEY = 5 UNKNOWN_COMMITMENT_TYPE = 0 LEGACY = 1 STATIC_REMOTE_KEY = 2 @@ -769,20558 +118,270 @@ UPDATE_FAILURE_INTERNAL_ERR = 3 UPDATE_FAILURE_INVALID_PARAMETER = 4 -_CHANNELCLOSESUMMARY_CLOSURETYPE = _descriptor.EnumDescriptor( - name="ClosureType", - full_name="lnrpc.ChannelCloseSummary.ClosureType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="COOPERATIVE_CLOSE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LOCAL_FORCE_CLOSE", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REMOTE_FORCE_CLOSE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="BREACH_CLOSE", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FUNDING_CANCELED", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ABANDONED", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5664, - serialized_end=5802, -) -_sym_db.RegisterEnumDescriptor(_CHANNELCLOSESUMMARY_CLOSURETYPE) - -_PEER_SYNCTYPE = _descriptor.EnumDescriptor( - name="SyncType", - full_name="lnrpc.Peer.SyncType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_SYNC", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACTIVE_SYNC", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PASSIVE_SYNC", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PINNED_SYNC", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6624, - serialized_end=6704, -) -_sym_db.RegisterEnumDescriptor(_PEER_SYNCTYPE) - -_PEEREVENT_EVENTTYPE = _descriptor.EnumDescriptor( - name="EventType", - full_name="lnrpc.PeerEvent.EventType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="PEER_ONLINE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PEER_OFFLINE", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6948, - serialized_end=6994, -) -_sym_db.RegisterEnumDescriptor(_PEEREVENT_EVENTTYPE) - -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE = _descriptor.EnumDescriptor( - name="AnchorState", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="LIMBO", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="RECOVERED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LOST", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=12414, - serialized_end=12463, -) -_sym_db.RegisterEnumDescriptor(_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE) - -_CHANNELEVENTUPDATE_UPDATETYPE = _descriptor.EnumDescriptor( - name="UpdateType", - full_name="lnrpc.ChannelEventUpdate.UpdateType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OPEN_CHANNEL", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CLOSED_CHANNEL", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACTIVE_CHANNEL", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INACTIVE_CHANNEL", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PENDING_OPEN_CHANNEL", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FULLY_RESOLVED_CHANNEL", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=12868, - serialized_end=13014, -) -_sym_db.RegisterEnumDescriptor(_CHANNELEVENTUPDATE_UPDATETYPE) - -_INVOICE_INVOICESTATE = _descriptor.EnumDescriptor( - name="InvoiceState", - full_name="lnrpc.Invoice.InvoiceState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OPEN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SETTLED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACCEPTED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=18957, - serialized_end=19022, -) -_sym_db.RegisterEnumDescriptor(_INVOICE_INVOICESTATE) - -_PAYMENT_PAYMENTSTATUS = _descriptor.EnumDescriptor( - name="PaymentStatus", - full_name="lnrpc.Payment.PaymentStatus", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="IN_FLIGHT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=20350, - serialized_end=20420, -) -_sym_db.RegisterEnumDescriptor(_PAYMENT_PAYMENTSTATUS) - -_HTLCATTEMPT_HTLCSTATUS = _descriptor.EnumDescriptor( - name="HTLCStatus", - full_name="lnrpc.HTLCAttempt.HTLCStatus", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="IN_FLIGHT", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=20641, - serialized_end=20695, -) -_sym_db.RegisterEnumDescriptor(_HTLCATTEMPT_HTLCSTATUS) - -_FAILURE_FAILURECODE = _descriptor.EnumDescriptor( - name="FailureCode", - full_name="lnrpc.Failure.FailureCode", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="RESERVED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_PAYMENT_AMOUNT", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_INCORRECT_CLTV_EXPIRY", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_INCORRECT_HTLC_AMOUNT", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_EXPIRY_TOO_SOON", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_REALM", - index=6, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXPIRY_TOO_SOON", - index=7, - number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_VERSION", - index=8, - number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_HMAC", - index=9, - number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_KEY", - index=10, - number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMOUNT_BELOW_MINIMUM", - index=11, - number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FEE_INSUFFICIENT", - index=12, - number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_CLTV_EXPIRY", - index=13, - number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CHANNEL_DISABLED", - index=14, - number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TEMPORARY_CHANNEL_FAILURE", - index=15, - number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REQUIRED_NODE_FEATURE_MISSING", - index=16, - number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REQUIRED_CHANNEL_FEATURE_MISSING", - index=17, - number=17, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNKNOWN_NEXT_PEER", - index=18, - number=18, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TEMPORARY_NODE_FAILURE", - index=19, - number=19, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PERMANENT_NODE_FAILURE", - index=20, - number=20, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PERMANENT_CHANNEL_FAILURE", - index=21, - number=21, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXPIRY_TOO_FAR", - index=22, - number=22, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_TIMEOUT", - index=23, - number=23, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_PAYLOAD", - index=24, - number=24, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INTERNAL_FAILURE", - index=25, - number=997, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNKNOWN_FAILURE", - index=26, - number=998, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNREADABLE_FAILURE", - index=27, - number=999, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=24591, - serialized_end=25342, -) -_sym_db.RegisterEnumDescriptor(_FAILURE_FAILURECODE) - - -_SUBSCRIBECUSTOMMESSAGESREQUEST = _descriptor.Descriptor( - name="SubscribeCustomMessagesRequest", - full_name="lnrpc.SubscribeCustomMessagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26, - serialized_end=58, -) - - -_CUSTOMMESSAGE = _descriptor.Descriptor( - name="CustomMessage", - full_name="lnrpc.CustomMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.CustomMessage.peer", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.CustomMessage.type", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="data", - full_name="lnrpc.CustomMessage.data", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=60, - serialized_end=117, -) - - -_SENDCUSTOMMESSAGEREQUEST = _descriptor.Descriptor( - name="SendCustomMessageRequest", - full_name="lnrpc.SendCustomMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.SendCustomMessageRequest.peer", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.SendCustomMessageRequest.type", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="data", - full_name="lnrpc.SendCustomMessageRequest.data", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=119, - serialized_end=187, -) - - -_SENDCUSTOMMESSAGERESPONSE = _descriptor.Descriptor( - name="SendCustomMessageResponse", - full_name="lnrpc.SendCustomMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=189, - serialized_end=216, -) - - -_UTXO = _descriptor.Descriptor( - name="Utxo", - full_name="lnrpc.Utxo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="address_type", - full_name="lnrpc.Utxo.address_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.Utxo.address", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount_sat", - full_name="lnrpc.Utxo.amount_sat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pk_script", - full_name="lnrpc.Utxo.pk_script", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.Utxo.outpoint", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmations", - full_name="lnrpc.Utxo.confirmations", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=219, - serialized_end=381, -) - - -_TRANSACTION = _descriptor.Descriptor( - name="Transaction", - full_name="lnrpc.Transaction", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="tx_hash", - full_name="lnrpc.Transaction.tx_hash", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.Transaction.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_confirmations", - full_name="lnrpc.Transaction.num_confirmations", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_hash", - full_name="lnrpc.Transaction.block_hash", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.Transaction.block_height", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_stamp", - full_name="lnrpc.Transaction.time_stamp", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees", - full_name="lnrpc.Transaction.total_fees", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_addresses", - full_name="lnrpc.Transaction.dest_addresses", - index=7, - number=8, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="raw_tx_hex", - full_name="lnrpc.Transaction.raw_tx_hex", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.Transaction.label", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=384, - serialized_end=598, -) - - -_GETTRANSACTIONSREQUEST = _descriptor.Descriptor( - name="GetTransactionsRequest", - full_name="lnrpc.GetTransactionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="start_height", - full_name="lnrpc.GetTransactionsRequest.start_height", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="end_height", - full_name="lnrpc.GetTransactionsRequest.end_height", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.GetTransactionsRequest.account", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=600, - serialized_end=683, -) - - -_TRANSACTIONDETAILS = _descriptor.Descriptor( - name="TransactionDetails", - full_name="lnrpc.TransactionDetails", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="transactions", - full_name="lnrpc.TransactionDetails.transactions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=685, - serialized_end=747, -) - - -_FEELIMIT = _descriptor.Descriptor( - name="FeeLimit", - full_name="lnrpc.FeeLimit", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="fixed", - full_name="lnrpc.FeeLimit.fixed", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fixed_msat", - full_name="lnrpc.FeeLimit.fixed_msat", - index=1, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="percent", - full_name="lnrpc.FeeLimit.percent", - index=2, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="limit", - full_name="lnrpc.FeeLimit.limit", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=749, - serialized_end=826, -) - - -_SENDREQUEST_DESTCUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="DestCustomRecordsEntry", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1295, - serialized_end=1351, -) - -_SENDREQUEST = _descriptor.Descriptor( - name="SendRequest", - full_name="lnrpc.SendRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="dest", - full_name="lnrpc.SendRequest.dest", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_string", - full_name="lnrpc.SendRequest.dest_string", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.SendRequest.amt", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.SendRequest.amt_msat", - index=3, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendRequest.payment_hash", - index=4, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash_string", - full_name="lnrpc.SendRequest.payment_hash_string", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.SendRequest.payment_request", - index=6, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_cltv_delta", - full_name="lnrpc.SendRequest.final_cltv_delta", - index=7, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_limit", - full_name="lnrpc.SendRequest.fee_limit", - index=8, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outgoing_chan_id", - full_name="lnrpc.SendRequest.outgoing_chan_id", - index=9, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_hop_pubkey", - full_name="lnrpc.SendRequest.last_hop_pubkey", - index=10, - number=13, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_limit", - full_name="lnrpc.SendRequest.cltv_limit", - index=11, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_custom_records", - full_name="lnrpc.SendRequest.dest_custom_records", - index=12, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="allow_self_payment", - full_name="lnrpc.SendRequest.allow_self_payment", - index=13, - number=14, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_features", - full_name="lnrpc.SendRequest.dest_features", - index=14, - number=15, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.SendRequest.payment_addr", - index=15, - number=16, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_SENDREQUEST_DESTCUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=829, - serialized_end=1351, -) - - -_SENDRESPONSE = _descriptor.Descriptor( - name="SendResponse", - full_name="lnrpc.SendResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_error", - full_name="lnrpc.SendResponse.payment_error", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_preimage", - full_name="lnrpc.SendResponse.payment_preimage", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_route", - full_name="lnrpc.SendResponse.payment_route", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendResponse.payment_hash", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1353, - serialized_end=1475, -) - - -_SENDTOROUTEREQUEST = _descriptor.Descriptor( - name="SendToRouteRequest", - full_name="lnrpc.SendToRouteRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendToRouteRequest.payment_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash_string", - full_name="lnrpc.SendToRouteRequest.payment_hash_string", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route", - full_name="lnrpc.SendToRouteRequest.route", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1477, - serialized_end=1587, -) - - -_CHANNELACCEPTREQUEST = _descriptor.Descriptor( - name="ChannelAcceptRequest", - full_name="lnrpc.ChannelAcceptRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.ChannelAcceptRequest.node_pubkey", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelAcceptRequest.chain_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChannelAcceptRequest.pending_chan_id", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_amt", - full_name="lnrpc.ChannelAcceptRequest.funding_amt", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_amt", - full_name="lnrpc.ChannelAcceptRequest.push_amt", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dust_limit", - full_name="lnrpc.ChannelAcceptRequest.dust_limit", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_value_in_flight", - full_name="lnrpc.ChannelAcceptRequest.max_value_in_flight", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_reserve", - full_name="lnrpc.ChannelAcceptRequest.channel_reserve", - index=7, - number=8, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc", - full_name="lnrpc.ChannelAcceptRequest.min_htlc", - index=8, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.ChannelAcceptRequest.fee_per_kw", - index=9, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelAcceptRequest.csv_delay", - index=10, - number=11, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_accepted_htlcs", - full_name="lnrpc.ChannelAcceptRequest.max_accepted_htlcs", - index=11, - number=12, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_flags", - full_name="lnrpc.ChannelAcceptRequest.channel_flags", - index=12, - number=13, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.ChannelAcceptRequest.commitment_type", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1590, - serialized_end=1947, -) - - -_CHANNELACCEPTRESPONSE = _descriptor.Descriptor( - name="ChannelAcceptResponse", - full_name="lnrpc.ChannelAcceptResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="accept", - full_name="lnrpc.ChannelAcceptResponse.accept", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChannelAcceptResponse.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.ChannelAcceptResponse.error", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="upfront_shutdown", - full_name="lnrpc.ChannelAcceptResponse.upfront_shutdown", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelAcceptResponse.csv_delay", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reserve_sat", - full_name="lnrpc.ChannelAcceptResponse.reserve_sat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="in_flight_max_msat", - full_name="lnrpc.ChannelAcceptResponse.in_flight_max_msat", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_count", - full_name="lnrpc.ChannelAcceptResponse.max_htlc_count", - index=7, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_in", - full_name="lnrpc.ChannelAcceptResponse.min_htlc_in", - index=8, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_accept_depth", - full_name="lnrpc.ChannelAcceptResponse.min_accept_depth", - index=9, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1950, - serialized_end=2194, -) - - -_CHANNELPOINT = _descriptor.Descriptor( - name="ChannelPoint", - full_name="lnrpc.ChannelPoint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funding_txid_bytes", - full_name="lnrpc.ChannelPoint.funding_txid_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_txid_str", - full_name="lnrpc.ChannelPoint.funding_txid_str", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.ChannelPoint.output_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="funding_txid", - full_name="lnrpc.ChannelPoint.funding_txid", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=2196, - serialized_end=2306, -) - - -_OUTPOINT = _descriptor.Descriptor( - name="OutPoint", - full_name="lnrpc.OutPoint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid_bytes", - full_name="lnrpc.OutPoint.txid_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="txid_str", - full_name="lnrpc.OutPoint.txid_str", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.OutPoint.output_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2308, - serialized_end=2378, -) - - -_LIGHTNINGADDRESS = _descriptor.Descriptor( - name="LightningAddress", - full_name="lnrpc.LightningAddress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pubkey", - full_name="lnrpc.LightningAddress.pubkey", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="host", - full_name="lnrpc.LightningAddress.host", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2380, - serialized_end=2428, -) - - -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY = _descriptor.Descriptor( - name="AddrToAmountEntry", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2587, - serialized_end=2638, -) - -_ESTIMATEFEEREQUEST = _descriptor.Descriptor( - name="EstimateFeeRequest", - full_name="lnrpc.EstimateFeeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="AddrToAmount", - full_name="lnrpc.EstimateFeeRequest.AddrToAmount", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.EstimateFeeRequest.target_conf", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.EstimateFeeRequest.min_confs", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.EstimateFeeRequest.spend_unconfirmed", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2431, - serialized_end=2638, -) - - -_ESTIMATEFEERESPONSE = _descriptor.Descriptor( - name="EstimateFeeResponse", - full_name="lnrpc.EstimateFeeResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="fee_sat", - full_name="lnrpc.EstimateFeeResponse.fee_sat", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="feerate_sat_per_byte", - full_name="lnrpc.EstimateFeeResponse.feerate_sat_per_byte", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.EstimateFeeResponse.sat_per_vbyte", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2640, - serialized_end=2735, -) - - -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY = _descriptor.Descriptor( - name="AddrToAmountEntry", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2587, - serialized_end=2638, -) - -_SENDMANYREQUEST = _descriptor.Descriptor( - name="SendManyRequest", - full_name="lnrpc.SendManyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="AddrToAmount", - full_name="lnrpc.SendManyRequest.AddrToAmount", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.SendManyRequest.target_conf", - index=1, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.SendManyRequest.sat_per_vbyte", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.SendManyRequest.sat_per_byte", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.SendManyRequest.label", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.SendManyRequest.min_confs", - index=5, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.SendManyRequest.spend_unconfirmed", - index=6, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_SENDMANYREQUEST_ADDRTOAMOUNTENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2738, - serialized_end=3003, -) - - -_SENDMANYRESPONSE = _descriptor.Descriptor( - name="SendManyResponse", - full_name="lnrpc.SendManyResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.SendManyResponse.txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3005, - serialized_end=3037, -) - - -_SENDCOINSREQUEST = _descriptor.Descriptor( - name="SendCoinsRequest", - full_name="lnrpc.SendCoinsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.SendCoinsRequest.addr", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.SendCoinsRequest.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.SendCoinsRequest.target_conf", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.SendCoinsRequest.sat_per_vbyte", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.SendCoinsRequest.sat_per_byte", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="send_all", - full_name="lnrpc.SendCoinsRequest.send_all", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.SendCoinsRequest.label", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.SendCoinsRequest.min_confs", - index=7, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.SendCoinsRequest.spend_unconfirmed", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3040, - serialized_end=3237, -) - - -_SENDCOINSRESPONSE = _descriptor.Descriptor( - name="SendCoinsResponse", - full_name="lnrpc.SendCoinsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.SendCoinsResponse.txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3239, - serialized_end=3272, -) - - -_LISTUNSPENTREQUEST = _descriptor.Descriptor( - name="ListUnspentRequest", - full_name="lnrpc.ListUnspentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.ListUnspentRequest.min_confs", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_confs", - full_name="lnrpc.ListUnspentRequest.max_confs", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.ListUnspentRequest.account", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3274, - serialized_end=3349, -) - - -_LISTUNSPENTRESPONSE = _descriptor.Descriptor( - name="ListUnspentResponse", - full_name="lnrpc.ListUnspentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="utxos", - full_name="lnrpc.ListUnspentResponse.utxos", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3351, - serialized_end=3400, -) - - -_NEWADDRESSREQUEST = _descriptor.Descriptor( - name="NewAddressRequest", - full_name="lnrpc.NewAddressRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.NewAddressRequest.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.NewAddressRequest.account", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3402, - serialized_end=3472, -) - - -_NEWADDRESSRESPONSE = _descriptor.Descriptor( - name="NewAddressResponse", - full_name="lnrpc.NewAddressResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.NewAddressResponse.address", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3474, - serialized_end=3511, -) - - -_SIGNMESSAGEREQUEST = _descriptor.Descriptor( - name="SignMessageRequest", - full_name="lnrpc.SignMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="msg", - full_name="lnrpc.SignMessageRequest.msg", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="single_hash", - full_name="lnrpc.SignMessageRequest.single_hash", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3513, - serialized_end=3567, -) - - -_SIGNMESSAGERESPONSE = _descriptor.Descriptor( - name="SignMessageResponse", - full_name="lnrpc.SignMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.SignMessageResponse.signature", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3569, - serialized_end=3609, -) - - -_VERIFYMESSAGEREQUEST = _descriptor.Descriptor( - name="VerifyMessageRequest", - full_name="lnrpc.VerifyMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="msg", - full_name="lnrpc.VerifyMessageRequest.msg", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.VerifyMessageRequest.signature", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3611, - serialized_end=3665, -) - - -_VERIFYMESSAGERESPONSE = _descriptor.Descriptor( - name="VerifyMessageResponse", - full_name="lnrpc.VerifyMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="valid", - full_name="lnrpc.VerifyMessageResponse.valid", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pubkey", - full_name="lnrpc.VerifyMessageResponse.pubkey", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3667, - serialized_end=3721, -) - - -_CONNECTPEERREQUEST = _descriptor.Descriptor( - name="ConnectPeerRequest", - full_name="lnrpc.ConnectPeerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.ConnectPeerRequest.addr", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="perm", - full_name="lnrpc.ConnectPeerRequest.perm", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timeout", - full_name="lnrpc.ConnectPeerRequest.timeout", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3723, - serialized_end=3813, -) - - -_CONNECTPEERRESPONSE = _descriptor.Descriptor( - name="ConnectPeerResponse", - full_name="lnrpc.ConnectPeerResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3815, - serialized_end=3836, -) - - -_DISCONNECTPEERREQUEST = _descriptor.Descriptor( - name="DisconnectPeerRequest", - full_name="lnrpc.DisconnectPeerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.DisconnectPeerRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3838, - serialized_end=3878, -) - - -_DISCONNECTPEERRESPONSE = _descriptor.Descriptor( - name="DisconnectPeerResponse", - full_name="lnrpc.DisconnectPeerResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3880, - serialized_end=3904, -) - - -_HTLC = _descriptor.Descriptor( - name="HTLC", - full_name="lnrpc.HTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="incoming", - full_name="lnrpc.HTLC.incoming", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.HTLC.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hash_lock", - full_name="lnrpc.HTLC.hash_lock", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiration_height", - full_name="lnrpc.HTLC.expiration_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_index", - full_name="lnrpc.HTLC.htlc_index", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="forwarding_channel", - full_name="lnrpc.HTLC.forwarding_channel", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="forwarding_htlc_index", - full_name="lnrpc.HTLC.forwarding_htlc_index", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3907, - serialized_end=4072, -) - - -_CHANNELCONSTRAINTS = _descriptor.Descriptor( - name="ChannelConstraints", - full_name="lnrpc.ChannelConstraints", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelConstraints.csv_delay", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_reserve_sat", - full_name="lnrpc.ChannelConstraints.chan_reserve_sat", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dust_limit_sat", - full_name="lnrpc.ChannelConstraints.dust_limit_sat", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_pending_amt_msat", - full_name="lnrpc.ChannelConstraints.max_pending_amt_msat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.ChannelConstraints.min_htlc_msat", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_accepted_htlcs", - full_name="lnrpc.ChannelConstraints.max_accepted_htlcs", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4075, - serialized_end=4245, -) - - -_CHANNEL = _descriptor.Descriptor( - name="Channel", - full_name="lnrpc.Channel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="active", - full_name="lnrpc.Channel.active", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pubkey", - full_name="lnrpc.Channel.remote_pubkey", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.Channel.channel_point", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.Channel.chan_id", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.Channel.capacity", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.Channel.local_balance", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.Channel.remote_balance", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_fee", - full_name="lnrpc.Channel.commit_fee", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_weight", - full_name="lnrpc.Channel.commit_weight", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.Channel.fee_per_kw", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_balance", - full_name="lnrpc.Channel.unsettled_balance", - index=10, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_satoshis_sent", - full_name="lnrpc.Channel.total_satoshis_sent", - index=11, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_satoshis_received", - full_name="lnrpc.Channel.total_satoshis_received", - index=12, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_updates", - full_name="lnrpc.Channel.num_updates", - index=13, - number=14, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_htlcs", - full_name="lnrpc.Channel.pending_htlcs", - index=14, - number=15, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.Channel.csv_delay", - index=15, - number=16, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.Channel.private", - index=16, - number=17, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="initiator", - full_name="lnrpc.Channel.initiator", - index=17, - number=18, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_status_flags", - full_name="lnrpc.Channel.chan_status_flags", - index=18, - number=19, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_chan_reserve_sat", - full_name="lnrpc.Channel.local_chan_reserve_sat", - index=19, - number=20, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_chan_reserve_sat", - full_name="lnrpc.Channel.remote_chan_reserve_sat", - index=20, - number=21, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="static_remote_key", - full_name="lnrpc.Channel.static_remote_key", - index=21, - number=22, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.Channel.commitment_type", - index=22, - number=26, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="lifetime", - full_name="lnrpc.Channel.lifetime", - index=23, - number=23, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="uptime", - full_name="lnrpc.Channel.uptime", - index=24, - number=24, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.Channel.close_address", - index=25, - number=25, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_amount_sat", - full_name="lnrpc.Channel.push_amount_sat", - index=26, - number=27, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="thaw_height", - full_name="lnrpc.Channel.thaw_height", - index=27, - number=28, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_constraints", - full_name="lnrpc.Channel.local_constraints", - index=28, - number=29, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_constraints", - full_name="lnrpc.Channel.remote_constraints", - index=29, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4248, - serialized_end=5064, -) - - -_LISTCHANNELSREQUEST = _descriptor.Descriptor( - name="ListChannelsRequest", - full_name="lnrpc.ListChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="active_only", - full_name="lnrpc.ListChannelsRequest.active_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inactive_only", - full_name="lnrpc.ListChannelsRequest.inactive_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="public_only", - full_name="lnrpc.ListChannelsRequest.public_only", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private_only", - full_name="lnrpc.ListChannelsRequest.private_only", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.ListChannelsRequest.peer", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5066, - serialized_end=5188, -) - - -_LISTCHANNELSRESPONSE = _descriptor.Descriptor( - name="ListChannelsResponse", - full_name="lnrpc.ListChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.ListChannelsResponse.channels", - index=0, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5190, - serialized_end=5246, -) - - -_CHANNELCLOSESUMMARY = _descriptor.Descriptor( - name="ChannelCloseSummary", - full_name="lnrpc.ChannelCloseSummary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelCloseSummary.channel_point", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelCloseSummary.chan_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelCloseSummary.chain_hash", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_tx_hash", - full_name="lnrpc.ChannelCloseSummary.closing_tx_hash", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pubkey", - full_name="lnrpc.ChannelCloseSummary.remote_pubkey", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelCloseSummary.capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_height", - full_name="lnrpc.ChannelCloseSummary.close_height", - index=6, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settled_balance", - full_name="lnrpc.ChannelCloseSummary.settled_balance", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_locked_balance", - full_name="lnrpc.ChannelCloseSummary.time_locked_balance", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_type", - full_name="lnrpc.ChannelCloseSummary.close_type", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="open_initiator", - full_name="lnrpc.ChannelCloseSummary.open_initiator", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_initiator", - full_name="lnrpc.ChannelCloseSummary.close_initiator", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolutions", - full_name="lnrpc.ChannelCloseSummary.resolutions", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CHANNELCLOSESUMMARY_CLOSURETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5249, - serialized_end=5802, -) - - -_RESOLUTION = _descriptor.Descriptor( - name="Resolution", - full_name="lnrpc.Resolution", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="resolution_type", - full_name="lnrpc.Resolution.resolution_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outcome", - full_name="lnrpc.Resolution.outcome", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.Resolution.outpoint", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount_sat", - full_name="lnrpc.Resolution.amount_sat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sweep_txid", - full_name="lnrpc.Resolution.sweep_txid", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5805, - serialized_end=5983, -) - - -_CLOSEDCHANNELSREQUEST = _descriptor.Descriptor( - name="ClosedChannelsRequest", - full_name="lnrpc.ClosedChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="cooperative", - full_name="lnrpc.ClosedChannelsRequest.cooperative", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_force", - full_name="lnrpc.ClosedChannelsRequest.local_force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_force", - full_name="lnrpc.ClosedChannelsRequest.remote_force", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="breach", - full_name="lnrpc.ClosedChannelsRequest.breach", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_canceled", - full_name="lnrpc.ClosedChannelsRequest.funding_canceled", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="abandoned", - full_name="lnrpc.ClosedChannelsRequest.abandoned", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5986, - serialized_end=6134, -) - - -_CLOSEDCHANNELSRESPONSE = _descriptor.Descriptor( - name="ClosedChannelsResponse", - full_name="lnrpc.ClosedChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.ClosedChannelsResponse.channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6136, - serialized_end=6206, -) - - -_PEER_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.Peer.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Peer.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Peer.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_PEER = _descriptor.Descriptor( - name="Peer", - full_name="lnrpc.Peer", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.Peer.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.Peer.address", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bytes_sent", - full_name="lnrpc.Peer.bytes_sent", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bytes_recv", - full_name="lnrpc.Peer.bytes_recv", - index=3, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_sent", - full_name="lnrpc.Peer.sat_sent", - index=4, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_recv", - full_name="lnrpc.Peer.sat_recv", - index=5, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inbound", - full_name="lnrpc.Peer.inbound", - index=6, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ping_time", - full_name="lnrpc.Peer.ping_time", - index=7, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sync_type", - full_name="lnrpc.Peer.sync_type", - index=8, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.Peer.features", - index=9, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="errors", - full_name="lnrpc.Peer.errors", - index=10, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="flap_count", - full_name="lnrpc.Peer.flap_count", - index=11, - number=13, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_flap_ns", - full_name="lnrpc.Peer.last_flap_ns", - index=12, - number=14, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_ping_payload", - full_name="lnrpc.Peer.last_ping_payload", - index=13, - number=15, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_PEER_FEATURESENTRY], - enum_types=[_PEER_SYNCTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6209, - serialized_end=6704, -) - - -_TIMESTAMPEDERROR = _descriptor.Descriptor( - name="TimestampedError", - full_name="lnrpc.TimestampedError", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.TimestampedError.timestamp", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.TimestampedError.error", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6706, - serialized_end=6758, -) - - -_LISTPEERSREQUEST = _descriptor.Descriptor( - name="ListPeersRequest", - full_name="lnrpc.ListPeersRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="latest_error", - full_name="lnrpc.ListPeersRequest.latest_error", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6760, - serialized_end=6800, -) - - -_LISTPEERSRESPONSE = _descriptor.Descriptor( - name="ListPeersResponse", - full_name="lnrpc.ListPeersResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peers", - full_name="lnrpc.ListPeersResponse.peers", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6802, - serialized_end=6849, -) - - -_PEEREVENTSUBSCRIPTION = _descriptor.Descriptor( - name="PeerEventSubscription", - full_name="lnrpc.PeerEventSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6851, - serialized_end=6874, -) - - -_PEEREVENT = _descriptor.Descriptor( - name="PeerEvent", - full_name="lnrpc.PeerEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.PeerEvent.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.PeerEvent.type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PEEREVENT_EVENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6876, - serialized_end=6994, -) - - -_GETINFOREQUEST = _descriptor.Descriptor( - name="GetInfoRequest", - full_name="lnrpc.GetInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6996, - serialized_end=7012, -) - - -_GETINFORESPONSE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.GetInfoResponse.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.GetInfoResponse.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.GetInfoResponse.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_GETINFORESPONSE = _descriptor.Descriptor( - name="GetInfoResponse", - full_name="lnrpc.GetInfoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="version", - full_name="lnrpc.GetInfoResponse.version", - index=0, - number=14, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_hash", - full_name="lnrpc.GetInfoResponse.commit_hash", - index=1, - number=20, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="identity_pubkey", - full_name="lnrpc.GetInfoResponse.identity_pubkey", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.GetInfoResponse.alias", - index=3, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.GetInfoResponse.color", - index=4, - number=17, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_pending_channels", - full_name="lnrpc.GetInfoResponse.num_pending_channels", - index=5, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_active_channels", - full_name="lnrpc.GetInfoResponse.num_active_channels", - index=6, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_inactive_channels", - full_name="lnrpc.GetInfoResponse.num_inactive_channels", - index=7, - number=15, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_peers", - full_name="lnrpc.GetInfoResponse.num_peers", - index=8, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.GetInfoResponse.block_height", - index=9, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_hash", - full_name="lnrpc.GetInfoResponse.block_hash", - index=10, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="best_header_timestamp", - full_name="lnrpc.GetInfoResponse.best_header_timestamp", - index=11, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="synced_to_chain", - full_name="lnrpc.GetInfoResponse.synced_to_chain", - index=12, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="synced_to_graph", - full_name="lnrpc.GetInfoResponse.synced_to_graph", - index=13, - number=18, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="testnet", - full_name="lnrpc.GetInfoResponse.testnet", - index=14, - number=10, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chains", - full_name="lnrpc.GetInfoResponse.chains", - index=15, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="uris", - full_name="lnrpc.GetInfoResponse.uris", - index=16, - number=12, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.GetInfoResponse.features", - index=17, - number=19, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_GETINFORESPONSE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7015, - serialized_end=7549, -) - - -_GETRECOVERYINFOREQUEST = _descriptor.Descriptor( - name="GetRecoveryInfoRequest", - full_name="lnrpc.GetRecoveryInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7551, - serialized_end=7575, -) - - -_GETRECOVERYINFORESPONSE = _descriptor.Descriptor( - name="GetRecoveryInfoResponse", - full_name="lnrpc.GetRecoveryInfoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="recovery_mode", - full_name="lnrpc.GetRecoveryInfoResponse.recovery_mode", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="recovery_finished", - full_name="lnrpc.GetRecoveryInfoResponse.recovery_finished", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="progress", - full_name="lnrpc.GetRecoveryInfoResponse.progress", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7577, - serialized_end=7670, -) - - -_CHAIN = _descriptor.Descriptor( - name="Chain", - full_name="lnrpc.Chain", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chain", - full_name="lnrpc.Chain.chain", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="lnrpc.Chain.network", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7672, - serialized_end=7711, -) - - -_CONFIRMATIONUPDATE = _descriptor.Descriptor( - name="ConfirmationUpdate", - full_name="lnrpc.ConfirmationUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="block_sha", - full_name="lnrpc.ConfirmationUpdate.block_sha", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.ConfirmationUpdate.block_height", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_confs_left", - full_name="lnrpc.ConfirmationUpdate.num_confs_left", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7713, - serialized_end=7798, -) - - -_CHANNELOPENUPDATE = _descriptor.Descriptor( - name="ChannelOpenUpdate", - full_name="lnrpc.ChannelOpenUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelOpenUpdate.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7800, - serialized_end=7863, -) - - -_CHANNELCLOSEUPDATE = _descriptor.Descriptor( - name="ChannelCloseUpdate", - full_name="lnrpc.ChannelCloseUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.ChannelCloseUpdate.closing_txid", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="success", - full_name="lnrpc.ChannelCloseUpdate.success", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7865, - serialized_end=7924, -) - - -_CLOSECHANNELREQUEST = _descriptor.Descriptor( - name="CloseChannelRequest", - full_name="lnrpc.CloseChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.CloseChannelRequest.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="force", - full_name="lnrpc.CloseChannelRequest.force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.CloseChannelRequest.target_conf", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.CloseChannelRequest.sat_per_byte", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="delivery_address", - full_name="lnrpc.CloseChannelRequest.delivery_address", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.CloseChannelRequest.sat_per_vbyte", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7927, - serialized_end=8103, -) - - -_CLOSESTATUSUPDATE = _descriptor.Descriptor( - name="CloseStatusUpdate", - full_name="lnrpc.CloseStatusUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="close_pending", - full_name="lnrpc.CloseStatusUpdate.close_pending", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_close", - full_name="lnrpc.CloseStatusUpdate.chan_close", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="update", - full_name="lnrpc.CloseStatusUpdate.update", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=8105, - serialized_end=8230, -) - - -_PENDINGUPDATE = _descriptor.Descriptor( - name="PendingUpdate", - full_name="lnrpc.PendingUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.PendingUpdate.txid", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.PendingUpdate.output_index", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8232, - serialized_end=8283, -) - - -_READYFORPSBTFUNDING = _descriptor.Descriptor( - name="ReadyForPsbtFunding", - full_name="lnrpc.ReadyForPsbtFunding", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funding_address", - full_name="lnrpc.ReadyForPsbtFunding.funding_address", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_amount", - full_name="lnrpc.ReadyForPsbtFunding.funding_amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt", - full_name="lnrpc.ReadyForPsbtFunding.psbt", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8285, - serialized_end=8369, -) - - -_BATCHOPENCHANNELREQUEST = _descriptor.Descriptor( - name="BatchOpenChannelRequest", - full_name="lnrpc.BatchOpenChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.BatchOpenChannelRequest.channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.BatchOpenChannelRequest.target_conf", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.BatchOpenChannelRequest.sat_per_vbyte", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.BatchOpenChannelRequest.min_confs", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.BatchOpenChannelRequest.spend_unconfirmed", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.BatchOpenChannelRequest.label", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8372, - serialized_end=8545, -) - - -_BATCHOPENCHANNEL = _descriptor.Descriptor( - name="BatchOpenChannel", - full_name="lnrpc.BatchOpenChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.BatchOpenChannel.node_pubkey", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_funding_amount", - full_name="lnrpc.BatchOpenChannel.local_funding_amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_sat", - full_name="lnrpc.BatchOpenChannel.push_sat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.BatchOpenChannel.private", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.BatchOpenChannel.min_htlc_msat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_csv_delay", - full_name="lnrpc.BatchOpenChannel.remote_csv_delay", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.BatchOpenChannel.close_address", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.BatchOpenChannel.pending_chan_id", - index=7, - number=8, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.BatchOpenChannel.commitment_type", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8548, - serialized_end=8797, -) - - -_BATCHOPENCHANNELRESPONSE = _descriptor.Descriptor( - name="BatchOpenChannelResponse", - full_name="lnrpc.BatchOpenChannelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_channels", - full_name="lnrpc.BatchOpenChannelResponse.pending_channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8799, - serialized_end=8873, -) - - -_OPENCHANNELREQUEST = _descriptor.Descriptor( - name="OpenChannelRequest", - full_name="lnrpc.OpenChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.OpenChannelRequest.sat_per_vbyte", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.OpenChannelRequest.node_pubkey", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_pubkey_string", - full_name="lnrpc.OpenChannelRequest.node_pubkey_string", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_funding_amount", - full_name="lnrpc.OpenChannelRequest.local_funding_amount", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_sat", - full_name="lnrpc.OpenChannelRequest.push_sat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.OpenChannelRequest.target_conf", - index=5, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.OpenChannelRequest.sat_per_byte", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.OpenChannelRequest.private", - index=7, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.OpenChannelRequest.min_htlc_msat", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_csv_delay", - full_name="lnrpc.OpenChannelRequest.remote_csv_delay", - index=9, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.OpenChannelRequest.min_confs", - index=10, - number=11, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.OpenChannelRequest.spend_unconfirmed", - index=11, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.OpenChannelRequest.close_address", - index=12, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_shim", - full_name="lnrpc.OpenChannelRequest.funding_shim", - index=13, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_max_value_in_flight_msat", - full_name="lnrpc.OpenChannelRequest.remote_max_value_in_flight_msat", - index=14, - number=15, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_max_htlcs", - full_name="lnrpc.OpenChannelRequest.remote_max_htlcs", - index=15, - number=16, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_local_csv", - full_name="lnrpc.OpenChannelRequest.max_local_csv", - index=16, - number=17, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.OpenChannelRequest.commitment_type", - index=17, - number=18, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8876, - serialized_end=9382, -) - - -_OPENSTATUSUPDATE = _descriptor.Descriptor( - name="OpenStatusUpdate", - full_name="lnrpc.OpenStatusUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_pending", - full_name="lnrpc.OpenStatusUpdate.chan_pending", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_open", - full_name="lnrpc.OpenStatusUpdate.chan_open", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_fund", - full_name="lnrpc.OpenStatusUpdate.psbt_fund", - index=2, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.OpenStatusUpdate.pending_chan_id", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="update", - full_name="lnrpc.OpenStatusUpdate.update", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=9385, - serialized_end=9580, -) - - -_KEYLOCATOR = _descriptor.Descriptor( - name="KeyLocator", - full_name="lnrpc.KeyLocator", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key_family", - full_name="lnrpc.KeyLocator.key_family", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="key_index", - full_name="lnrpc.KeyLocator.key_index", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9582, - serialized_end=9633, -) - - -_KEYDESCRIPTOR = _descriptor.Descriptor( - name="KeyDescriptor", - full_name="lnrpc.KeyDescriptor", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="raw_key_bytes", - full_name="lnrpc.KeyDescriptor.raw_key_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="key_loc", - full_name="lnrpc.KeyDescriptor.key_loc", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9635, - serialized_end=9709, -) - - -_CHANPOINTSHIM = _descriptor.Descriptor( - name="ChanPointShim", - full_name="lnrpc.ChanPointShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.ChanPointShim.amt", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChanPointShim.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_key", - full_name="lnrpc.ChanPointShim.local_key", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_key", - full_name="lnrpc.ChanPointShim.remote_key", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChanPointShim.pending_chan_id", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="thaw_height", - full_name="lnrpc.ChanPointShim.thaw_height", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9712, - serialized_end=9888, -) - - -_PSBTSHIM = _descriptor.Descriptor( - name="PsbtShim", - full_name="lnrpc.PsbtShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.PsbtShim.pending_chan_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_psbt", - full_name="lnrpc.PsbtShim.base_psbt", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="no_publish", - full_name="lnrpc.PsbtShim.no_publish", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9890, - serialized_end=9964, -) - - -_FUNDINGSHIM = _descriptor.Descriptor( - name="FundingShim", - full_name="lnrpc.FundingShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point_shim", - full_name="lnrpc.FundingShim.chan_point_shim", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_shim", - full_name="lnrpc.FundingShim.psbt_shim", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="shim", - full_name="lnrpc.FundingShim.shim", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=9966, - serialized_end=10074, -) - - -_FUNDINGSHIMCANCEL = _descriptor.Descriptor( - name="FundingShimCancel", - full_name="lnrpc.FundingShimCancel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingShimCancel.pending_chan_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10076, - serialized_end=10120, -) - - -_FUNDINGPSBTVERIFY = _descriptor.Descriptor( - name="FundingPsbtVerify", - full_name="lnrpc.FundingPsbtVerify", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funded_psbt", - full_name="lnrpc.FundingPsbtVerify.funded_psbt", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingPsbtVerify.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="skip_finalize", - full_name="lnrpc.FundingPsbtVerify.skip_finalize", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10122, - serialized_end=10210, -) - - -_FUNDINGPSBTFINALIZE = _descriptor.Descriptor( - name="FundingPsbtFinalize", - full_name="lnrpc.FundingPsbtFinalize", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signed_psbt", - full_name="lnrpc.FundingPsbtFinalize.signed_psbt", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingPsbtFinalize.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_raw_tx", - full_name="lnrpc.FundingPsbtFinalize.final_raw_tx", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10212, - serialized_end=10301, -) - - -_FUNDINGTRANSITIONMSG = _descriptor.Descriptor( - name="FundingTransitionMsg", - full_name="lnrpc.FundingTransitionMsg", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="shim_register", - full_name="lnrpc.FundingTransitionMsg.shim_register", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="shim_cancel", - full_name="lnrpc.FundingTransitionMsg.shim_cancel", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_verify", - full_name="lnrpc.FundingTransitionMsg.psbt_verify", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_finalize", - full_name="lnrpc.FundingTransitionMsg.psbt_finalize", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="trigger", - full_name="lnrpc.FundingTransitionMsg.trigger", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=10304, - serialized_end=10533, -) - - -_FUNDINGSTATESTEPRESP = _descriptor.Descriptor( - name="FundingStateStepResp", - full_name="lnrpc.FundingStateStepResp", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10535, - serialized_end=10557, -) - - -_PENDINGHTLC = _descriptor.Descriptor( - name="PendingHTLC", - full_name="lnrpc.PendingHTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="incoming", - full_name="lnrpc.PendingHTLC.incoming", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.PendingHTLC.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.PendingHTLC.outpoint", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="maturity_height", - full_name="lnrpc.PendingHTLC.maturity_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="blocks_til_maturity", - full_name="lnrpc.PendingHTLC.blocks_til_maturity", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stage", - full_name="lnrpc.PendingHTLC.stage", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10560, - serialized_end=10694, -) - - -_PENDINGCHANNELSREQUEST = _descriptor.Descriptor( - name="PendingChannelsRequest", - full_name="lnrpc.PendingChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10696, - serialized_end=10720, -) - - -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL = _descriptor.Descriptor( - name="PendingChannel", - full_name="lnrpc.PendingChannelsResponse.PendingChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="remote_node_pub", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_node_pub", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.channel_point", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.local_balance", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_balance", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_chan_reserve_sat", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.local_chan_reserve_sat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_chan_reserve_sat", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_chan_reserve_sat", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="initiator", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.initiator", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.commitment_type", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_forwarding_packages", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.num_forwarding_packages", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11121, - serialized_end=11433, -) - -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL = _descriptor.Descriptor( - name="PendingOpenChannel", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmation_height", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.confirmation_height", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_fee", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.commit_fee", - index=2, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_weight", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.commit_weight", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.fee_per_kw", - index=4, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11436, - serialized_end=11612, -) - -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL = _descriptor.Descriptor( - name="WaitingCloseChannel", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="limbo_balance", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.limbo_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitments", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.commitments", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11615, - serialized_end=11788, -) - -_PENDINGCHANNELSRESPONSE_COMMITMENTS = _descriptor.Descriptor( - name="Commitments", - full_name="lnrpc.PendingChannelsResponse.Commitments", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="local_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.local_txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pending_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_pending_txid", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.local_commit_fee_sat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_commit_fee_sat", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pending_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_pending_commit_fee_sat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11791, - serialized_end=11974, -) - -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL = _descriptor.Descriptor( - name="ClosedChannel", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel.closing_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11976, - serialized_end=12077, -) - -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL = _descriptor.Descriptor( - name="ForceClosedChannel", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.closing_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="limbo_balance", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.limbo_balance", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="maturity_height", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.maturity_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="blocks_til_maturity", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.blocks_til_maturity", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="recovered_balance", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.recovered_balance", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_htlcs", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.pending_htlcs", - index=6, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="anchor", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.anchor", - index=7, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12080, - serialized_end=12463, -) - -_PENDINGCHANNELSRESPONSE = _descriptor.Descriptor( - name="PendingChannelsResponse", - full_name="lnrpc.PendingChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_limbo_balance", - full_name="lnrpc.PendingChannelsResponse.total_limbo_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_channels", - full_name="lnrpc.PendingChannelsResponse.pending_open_channels", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_closing_channels", - full_name="lnrpc.PendingChannelsResponse.pending_closing_channels", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_force_closing_channels", - full_name="lnrpc.PendingChannelsResponse.pending_force_closing_channels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="waiting_close_channels", - full_name="lnrpc.PendingChannelsResponse.waiting_close_channels", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL, - _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL, - _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL, - _PENDINGCHANNELSRESPONSE_COMMITMENTS, - _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL, - _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10723, - serialized_end=12463, -) - - -_CHANNELEVENTSUBSCRIPTION = _descriptor.Descriptor( - name="ChannelEventSubscription", - full_name="lnrpc.ChannelEventSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12465, - serialized_end=12491, -) - - -_CHANNELEVENTUPDATE = _descriptor.Descriptor( - name="ChannelEventUpdate", - full_name="lnrpc.ChannelEventUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="open_channel", - full_name="lnrpc.ChannelEventUpdate.open_channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_channel", - full_name="lnrpc.ChannelEventUpdate.closed_channel", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="active_channel", - full_name="lnrpc.ChannelEventUpdate.active_channel", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inactive_channel", - full_name="lnrpc.ChannelEventUpdate.inactive_channel", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_channel", - full_name="lnrpc.ChannelEventUpdate.pending_open_channel", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fully_resolved_channel", - full_name="lnrpc.ChannelEventUpdate.fully_resolved_channel", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.ChannelEventUpdate.type", - index=6, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CHANNELEVENTUPDATE_UPDATETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="channel", - full_name="lnrpc.ChannelEventUpdate.channel", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=12494, - serialized_end=13025, -) - - -_WALLETACCOUNTBALANCE = _descriptor.Descriptor( - name="WalletAccountBalance", - full_name="lnrpc.WalletAccountBalance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="confirmed_balance", - full_name="lnrpc.WalletAccountBalance.confirmed_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unconfirmed_balance", - full_name="lnrpc.WalletAccountBalance.unconfirmed_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13027, - serialized_end=13105, -) - - -_WALLETBALANCEREQUEST = _descriptor.Descriptor( - name="WalletBalanceRequest", - full_name="lnrpc.WalletBalanceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13107, - serialized_end=13129, -) - - -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY = _descriptor.Descriptor( - name="AccountBalanceEntry", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13311, - serialized_end=13393, -) - -_WALLETBALANCERESPONSE = _descriptor.Descriptor( - name="WalletBalanceResponse", - full_name="lnrpc.WalletBalanceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_balance", - full_name="lnrpc.WalletBalanceResponse.total_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmed_balance", - full_name="lnrpc.WalletBalanceResponse.confirmed_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unconfirmed_balance", - full_name="lnrpc.WalletBalanceResponse.unconfirmed_balance", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account_balance", - full_name="lnrpc.WalletBalanceResponse.account_balance", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13132, - serialized_end=13393, -) - - -_AMOUNT = _descriptor.Descriptor( - name="Amount", - full_name="lnrpc.Amount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sat", - full_name="lnrpc.Amount.sat", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="msat", - full_name="lnrpc.Amount.msat", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13395, - serialized_end=13430, -) - - -_CHANNELBALANCEREQUEST = _descriptor.Descriptor( - name="ChannelBalanceRequest", - full_name="lnrpc.ChannelBalanceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13432, - serialized_end=13455, -) - - -_CHANNELBALANCERESPONSE = _descriptor.Descriptor( - name="ChannelBalanceResponse", - full_name="lnrpc.ChannelBalanceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="balance", - full_name="lnrpc.ChannelBalanceResponse.balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.ChannelBalanceResponse.local_balance", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.ChannelBalanceResponse.remote_balance", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_local_balance", - full_name="lnrpc.ChannelBalanceResponse.unsettled_local_balance", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_remote_balance", - full_name="lnrpc.ChannelBalanceResponse.unsettled_remote_balance", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_local_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_local_balance", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_remote_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_remote_balance", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13458, - serialized_end=13814, -) - - -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="DestCustomRecordsEntry", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1295, - serialized_end=1351, -) - -_QUERYROUTESREQUEST = _descriptor.Descriptor( - name="QueryRoutesRequest", - full_name="lnrpc.QueryRoutesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.QueryRoutesRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.QueryRoutesRequest.amt", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.QueryRoutesRequest.amt_msat", - index=2, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_cltv_delta", - full_name="lnrpc.QueryRoutesRequest.final_cltv_delta", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_limit", - full_name="lnrpc.QueryRoutesRequest.fee_limit", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_nodes", - full_name="lnrpc.QueryRoutesRequest.ignored_nodes", - index=5, - number=6, - type=12, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_edges", - full_name="lnrpc.QueryRoutesRequest.ignored_edges", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="source_pub_key", - full_name="lnrpc.QueryRoutesRequest.source_pub_key", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="use_mission_control", - full_name="lnrpc.QueryRoutesRequest.use_mission_control", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_pairs", - full_name="lnrpc.QueryRoutesRequest.ignored_pairs", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_limit", - full_name="lnrpc.QueryRoutesRequest.cltv_limit", - index=10, - number=11, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_custom_records", - full_name="lnrpc.QueryRoutesRequest.dest_custom_records", - index=11, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outgoing_chan_id", - full_name="lnrpc.QueryRoutesRequest.outgoing_chan_id", - index=12, - number=14, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_hop_pubkey", - full_name="lnrpc.QueryRoutesRequest.last_hop_pubkey", - index=13, - number=15, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.QueryRoutesRequest.route_hints", - index=14, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_features", - full_name="lnrpc.QueryRoutesRequest.dest_features", - index=15, - number=17, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13817, - serialized_end=14409, -) - - -_NODEPAIR = _descriptor.Descriptor( - name="NodePair", - full_name="lnrpc.NodePair", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="from", - full_name="lnrpc.NodePair.from", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="to", - full_name="lnrpc.NodePair.to", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14411, - serialized_end=14447, -) - - -_EDGELOCATOR = _descriptor.Descriptor( - name="EdgeLocator", - full_name="lnrpc.EdgeLocator", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_id", - full_name="lnrpc.EdgeLocator.channel_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="direction_reverse", - full_name="lnrpc.EdgeLocator.direction_reverse", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14449, - serialized_end=14513, -) - - -_QUERYROUTESRESPONSE = _descriptor.Descriptor( - name="QueryRoutesResponse", - full_name="lnrpc.QueryRoutesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="routes", - full_name="lnrpc.QueryRoutesResponse.routes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="success_prob", - full_name="lnrpc.QueryRoutesResponse.success_prob", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14515, - serialized_end=14588, -) - - -_HOP_CUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="CustomRecordsEntry", - full_name="lnrpc.Hop.CustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Hop.CustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Hop.CustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14923, - serialized_end=14975, -) - -_HOP = _descriptor.Descriptor( - name="Hop", - full_name="lnrpc.Hop", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.Hop.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_capacity", - full_name="lnrpc.Hop.chan_capacity", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_to_forward", - full_name="lnrpc.Hop.amt_to_forward", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.Hop.fee", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.Hop.expiry", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_to_forward_msat", - full_name="lnrpc.Hop.amt_to_forward_msat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.Hop.fee_msat", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.Hop.pub_key", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="tlv_payload", - full_name="lnrpc.Hop.tlv_payload", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mpp_record", - full_name="lnrpc.Hop.mpp_record", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp_record", - full_name="lnrpc.Hop.amp_record", - index=10, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_records", - full_name="lnrpc.Hop.custom_records", - index=11, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_HOP_CUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14591, - serialized_end=14975, -) - - -_MPPRECORD = _descriptor.Descriptor( - name="MPPRecord", - full_name="lnrpc.MPPRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.MPPRecord.payment_addr", - index=0, - number=11, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt_msat", - full_name="lnrpc.MPPRecord.total_amt_msat", - index=1, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14977, - serialized_end=15034, -) - - -_AMPRECORD = _descriptor.Descriptor( - name="AMPRecord", - full_name="lnrpc.AMPRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_share", - full_name="lnrpc.AMPRecord.root_share", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.AMPRecord.set_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="child_index", - full_name="lnrpc.AMPRecord.child_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15036, - serialized_end=15104, -) - - -_ROUTE = _descriptor.Descriptor( - name="Route", - full_name="lnrpc.Route", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_time_lock", - full_name="lnrpc.Route.total_time_lock", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees", - full_name="lnrpc.Route.total_fees", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt", - full_name="lnrpc.Route.total_amt", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hops", - full_name="lnrpc.Route.hops", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees_msat", - full_name="lnrpc.Route.total_fees_msat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt_msat", - full_name="lnrpc.Route.total_amt_msat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15107, - serialized_end=15261, -) - - -_NODEINFOREQUEST = _descriptor.Descriptor( - name="NodeInfoRequest", - full_name="lnrpc.NodeInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.NodeInfoRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="include_channels", - full_name="lnrpc.NodeInfoRequest.include_channels", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15263, - serialized_end=15323, -) - - -_NODEINFO = _descriptor.Descriptor( - name="NodeInfo", - full_name="lnrpc.NodeInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node", - full_name="lnrpc.NodeInfo.node", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_channels", - full_name="lnrpc.NodeInfo.num_channels", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_capacity", - full_name="lnrpc.NodeInfo.total_capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.NodeInfo.channels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15326, - serialized_end=15456, -) - - -_LIGHTNINGNODE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.LightningNode.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.LightningNode.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.LightningNode.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_LIGHTNINGNODE = _descriptor.Descriptor( - name="LightningNode", - full_name="lnrpc.LightningNode", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.LightningNode.last_update", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.LightningNode.pub_key", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.LightningNode.alias", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="addresses", - full_name="lnrpc.LightningNode.addresses", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.LightningNode.color", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.LightningNode.features", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_LIGHTNINGNODE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15459, - serialized_end=15700, -) - - -_NODEADDRESS = _descriptor.Descriptor( - name="NodeAddress", - full_name="lnrpc.NodeAddress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="network", - full_name="lnrpc.NodeAddress.network", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.NodeAddress.addr", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15702, - serialized_end=15746, -) - - -_ROUTINGPOLICY = _descriptor.Descriptor( - name="RoutingPolicy", - full_name="lnrpc.RoutingPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.RoutingPolicy.time_lock_delta", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc", - full_name="lnrpc.RoutingPolicy.min_htlc", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_base_msat", - full_name="lnrpc.RoutingPolicy.fee_base_msat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate_milli_msat", - full_name="lnrpc.RoutingPolicy.fee_rate_milli_msat", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="disabled", - full_name="lnrpc.RoutingPolicy.disabled", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_msat", - full_name="lnrpc.RoutingPolicy.max_htlc_msat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.RoutingPolicy.last_update", - index=6, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15749, - serialized_end=15921, -) - - -_CHANNELEDGE = _descriptor.Descriptor( - name="ChannelEdge", - full_name="lnrpc.ChannelEdge", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_id", - full_name="lnrpc.ChannelEdge.channel_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelEdge.chan_point", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.ChannelEdge.last_update", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node1_pub", - full_name="lnrpc.ChannelEdge.node1_pub", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node2_pub", - full_name="lnrpc.ChannelEdge.node2_pub", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelEdge.capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node1_policy", - full_name="lnrpc.ChannelEdge.node1_policy", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node2_policy", - full_name="lnrpc.ChannelEdge.node2_policy", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15924, - serialized_end=16150, -) - - -_CHANNELGRAPHREQUEST = _descriptor.Descriptor( - name="ChannelGraphRequest", - full_name="lnrpc.ChannelGraphRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="include_unannounced", - full_name="lnrpc.ChannelGraphRequest.include_unannounced", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16152, - serialized_end=16202, -) - - -_CHANNELGRAPH = _descriptor.Descriptor( - name="ChannelGraph", - full_name="lnrpc.ChannelGraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="nodes", - full_name="lnrpc.ChannelGraph.nodes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="edges", - full_name="lnrpc.ChannelGraph.edges", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16204, - serialized_end=16290, -) - - -_NODEMETRICSREQUEST = _descriptor.Descriptor( - name="NodeMetricsRequest", - full_name="lnrpc.NodeMetricsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="types", - full_name="lnrpc.NodeMetricsRequest.types", - index=0, - number=1, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16292, - serialized_end=16350, -) - - -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY = _descriptor.Descriptor( - name="BetweennessCentralityEntry", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16463, - serialized_end=16543, -) - -_NODEMETRICSRESPONSE = _descriptor.Descriptor( - name="NodeMetricsResponse", - full_name="lnrpc.NodeMetricsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="betweenness_centrality", - full_name="lnrpc.NodeMetricsResponse.betweenness_centrality", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16353, - serialized_end=16543, -) - - -_FLOATMETRIC = _descriptor.Descriptor( - name="FloatMetric", - full_name="lnrpc.FloatMetric", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.FloatMetric.value", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="normalized_value", - full_name="lnrpc.FloatMetric.normalized_value", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16545, - serialized_end=16599, -) - - -_CHANINFOREQUEST = _descriptor.Descriptor( - name="ChanInfoRequest", - full_name="lnrpc.ChanInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChanInfoRequest.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16601, - serialized_end=16639, -) - - -_NETWORKINFOREQUEST = _descriptor.Descriptor( - name="NetworkInfoRequest", - full_name="lnrpc.NetworkInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16641, - serialized_end=16661, -) - - -_NETWORKINFO = _descriptor.Descriptor( - name="NetworkInfo", - full_name="lnrpc.NetworkInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="graph_diameter", - full_name="lnrpc.NetworkInfo.graph_diameter", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="avg_out_degree", - full_name="lnrpc.NetworkInfo.avg_out_degree", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_out_degree", - full_name="lnrpc.NetworkInfo.max_out_degree", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_nodes", - full_name="lnrpc.NetworkInfo.num_nodes", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_channels", - full_name="lnrpc.NetworkInfo.num_channels", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_network_capacity", - full_name="lnrpc.NetworkInfo.total_network_capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="avg_channel_size", - full_name="lnrpc.NetworkInfo.avg_channel_size", - index=6, - number=7, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_channel_size", - full_name="lnrpc.NetworkInfo.min_channel_size", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_channel_size", - full_name="lnrpc.NetworkInfo.max_channel_size", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="median_channel_size_sat", - full_name="lnrpc.NetworkInfo.median_channel_size_sat", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_zombie_chans", - full_name="lnrpc.NetworkInfo.num_zombie_chans", - index=10, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16664, - serialized_end=16959, -) - - -_STOPREQUEST = _descriptor.Descriptor( - name="StopRequest", - full_name="lnrpc.StopRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16961, - serialized_end=16974, -) - - -_STOPRESPONSE = _descriptor.Descriptor( - name="StopResponse", - full_name="lnrpc.StopResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16976, - serialized_end=16990, -) - - -_GRAPHTOPOLOGYSUBSCRIPTION = _descriptor.Descriptor( - name="GraphTopologySubscription", - full_name="lnrpc.GraphTopologySubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16992, - serialized_end=17019, -) - - -_GRAPHTOPOLOGYUPDATE = _descriptor.Descriptor( - name="GraphTopologyUpdate", - full_name="lnrpc.GraphTopologyUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_updates", - full_name="lnrpc.GraphTopologyUpdate.node_updates", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_updates", - full_name="lnrpc.GraphTopologyUpdate.channel_updates", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_chans", - full_name="lnrpc.GraphTopologyUpdate.closed_chans", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17022, - serialized_end=17185, -) - - -_NODEUPDATE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.NodeUpdate.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.NodeUpdate.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.NodeUpdate.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_NODEUPDATE = _descriptor.Descriptor( - name="NodeUpdate", - full_name="lnrpc.NodeUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addresses", - full_name="lnrpc.NodeUpdate.addresses", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="identity_key", - full_name="lnrpc.NodeUpdate.identity_key", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="global_features", - full_name="lnrpc.NodeUpdate.global_features", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.NodeUpdate.alias", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.NodeUpdate.color", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_addresses", - full_name="lnrpc.NodeUpdate.node_addresses", - index=5, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.NodeUpdate.features", - index=6, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_NODEUPDATE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17188, - serialized_end=17464, -) - - -_CHANNELEDGEUPDATE = _descriptor.Descriptor( - name="ChannelEdgeUpdate", - full_name="lnrpc.ChannelEdgeUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelEdgeUpdate.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelEdgeUpdate.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelEdgeUpdate.capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="routing_policy", - full_name="lnrpc.ChannelEdgeUpdate.routing_policy", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="advertising_node", - full_name="lnrpc.ChannelEdgeUpdate.advertising_node", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="connecting_node", - full_name="lnrpc.ChannelEdgeUpdate.connecting_node", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17467, - serialized_end=17663, -) - - -_CLOSEDCHANNELUPDATE = _descriptor.Descriptor( - name="ClosedChannelUpdate", - full_name="lnrpc.ClosedChannelUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ClosedChannelUpdate.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ClosedChannelUpdate.capacity", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_height", - full_name="lnrpc.ClosedChannelUpdate.closed_height", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ClosedChannelUpdate.chan_point", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17665, - serialized_end=17789, -) - - -_HOPHINT = _descriptor.Descriptor( - name="HopHint", - full_name="lnrpc.HopHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_id", - full_name="lnrpc.HopHint.node_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.HopHint.chan_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_base_msat", - full_name="lnrpc.HopHint.fee_base_msat", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_proportional_millionths", - full_name="lnrpc.HopHint.fee_proportional_millionths", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry_delta", - full_name="lnrpc.HopHint.cltv_expiry_delta", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17792, - serialized_end=17926, -) - - -_SETID = _descriptor.Descriptor( - name="SetID", - full_name="lnrpc.SetID", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.SetID.set_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17928, - serialized_end=17951, -) - - -_ROUTEHINT = _descriptor.Descriptor( - name="RouteHint", - full_name="lnrpc.RouteHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="hop_hints", - full_name="lnrpc.RouteHint.hop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17953, - serialized_end=17999, -) - - -_AMPINVOICESTATE = _descriptor.Descriptor( - name="AMPInvoiceState", - full_name="lnrpc.AMPInvoiceState", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.AMPInvoiceState.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.AMPInvoiceState.settle_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_time", - full_name="lnrpc.AMPInvoiceState.settle_time", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_msat", - full_name="lnrpc.AMPInvoiceState.amt_paid_msat", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18001, - serialized_end=18124, -) - - -_INVOICE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.Invoice.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Invoice.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_INVOICE_AMPINVOICESTATEENTRY = _descriptor.Descriptor( - name="AmpInvoiceStateEntry", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18877, - serialized_end=18955, -) - -_INVOICE = _descriptor.Descriptor( - name="Invoice", - full_name="lnrpc.Invoice", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="memo", - full_name="lnrpc.Invoice.memo", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_preimage", - full_name="lnrpc.Invoice.r_preimage", - index=1, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.Invoice.r_hash", - index=2, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.value", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_msat", - full_name="lnrpc.Invoice.value_msat", - index=4, - number=23, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settled", - full_name="lnrpc.Invoice.settled", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_date", - full_name="lnrpc.Invoice.creation_date", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_date", - full_name="lnrpc.Invoice.settle_date", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.Invoice.payment_request", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description_hash", - full_name="lnrpc.Invoice.description_hash", - index=9, - number=10, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.Invoice.expiry", - index=10, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fallback_addr", - full_name="lnrpc.Invoice.fallback_addr", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.Invoice.cltv_expiry", - index=12, - number=13, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.Invoice.route_hints", - index=13, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.Invoice.private", - index=14, - number=15, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.Invoice.add_index", - index=15, - number=16, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.Invoice.settle_index", - index=16, - number=17, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid", - full_name="lnrpc.Invoice.amt_paid", - index=17, - number=18, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_sat", - full_name="lnrpc.Invoice.amt_paid_sat", - index=18, - number=19, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_msat", - full_name="lnrpc.Invoice.amt_paid_msat", - index=19, - number=20, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.Invoice.state", - index=20, - number=21, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlcs", - full_name="lnrpc.Invoice.htlcs", - index=21, - number=22, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.Invoice.features", - index=22, - number=24, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_keysend", - full_name="lnrpc.Invoice.is_keysend", - index=23, - number=25, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.Invoice.payment_addr", - index=24, - number=26, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_amp", - full_name="lnrpc.Invoice.is_amp", - index=25, - number=27, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp_invoice_state", - full_name="lnrpc.Invoice.amp_invoice_state", - index=26, - number=28, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_INVOICE_FEATURESENTRY, _INVOICE_AMPINVOICESTATEENTRY], - enum_types=[_INVOICE_INVOICESTATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18127, - serialized_end=19028, -) - - -_INVOICEHTLC_CUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="CustomRecordsEntry", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14923, - serialized_end=14975, -) - -_INVOICEHTLC = _descriptor.Descriptor( - name="InvoiceHTLC", - full_name="lnrpc.InvoiceHTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.InvoiceHTLC.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_index", - full_name="lnrpc.InvoiceHTLC.htlc_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.InvoiceHTLC.amt_msat", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="accept_height", - full_name="lnrpc.InvoiceHTLC.accept_height", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="accept_time", - full_name="lnrpc.InvoiceHTLC.accept_time", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolve_time", - full_name="lnrpc.InvoiceHTLC.resolve_time", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry_height", - full_name="lnrpc.InvoiceHTLC.expiry_height", - index=6, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.InvoiceHTLC.state", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_records", - full_name="lnrpc.InvoiceHTLC.custom_records", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mpp_total_amt_msat", - full_name="lnrpc.InvoiceHTLC.mpp_total_amt_msat", - index=9, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp", - full_name="lnrpc.InvoiceHTLC.amp", - index=10, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_INVOICEHTLC_CUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19031, - serialized_end=19402, -) - - -_AMP = _descriptor.Descriptor( - name="AMP", - full_name="lnrpc.AMP", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_share", - full_name="lnrpc.AMP.root_share", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.AMP.set_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="child_index", - full_name="lnrpc.AMP.child_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hash", - full_name="lnrpc.AMP.hash", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="preimage", - full_name="lnrpc.AMP.preimage", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19404, - serialized_end=19498, -) - - -_ADDINVOICERESPONSE = _descriptor.Descriptor( - name="AddInvoiceResponse", - full_name="lnrpc.AddInvoiceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.AddInvoiceResponse.r_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.AddInvoiceResponse.payment_request", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.AddInvoiceResponse.add_index", - index=2, - number=16, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.AddInvoiceResponse.payment_addr", - index=3, - number=17, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19500, - serialized_end=19602, -) - - -_PAYMENTHASH = _descriptor.Descriptor( - name="PaymentHash", - full_name="lnrpc.PaymentHash", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="r_hash_str", - full_name="lnrpc.PaymentHash.r_hash_str", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.PaymentHash.r_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19604, - serialized_end=19657, -) - - -_LISTINVOICEREQUEST = _descriptor.Descriptor( - name="ListInvoiceRequest", - full_name="lnrpc.ListInvoiceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_only", - full_name="lnrpc.ListInvoiceRequest.pending_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ListInvoiceRequest.index_offset", - index=1, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_max_invoices", - full_name="lnrpc.ListInvoiceRequest.num_max_invoices", - index=2, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reversed", - full_name="lnrpc.ListInvoiceRequest.reversed", - index=3, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19659, - serialized_end=19767, -) - - -_LISTINVOICERESPONSE = _descriptor.Descriptor( - name="ListInvoiceResponse", - full_name="lnrpc.ListInvoiceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="invoices", - full_name="lnrpc.ListInvoiceResponse.invoices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_index_offset", - full_name="lnrpc.ListInvoiceResponse.last_index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="first_index_offset", - full_name="lnrpc.ListInvoiceResponse.first_index_offset", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19769, - serialized_end=19879, -) - - -_INVOICESUBSCRIPTION = _descriptor.Descriptor( - name="InvoiceSubscription", - full_name="lnrpc.InvoiceSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.InvoiceSubscription.add_index", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.InvoiceSubscription.settle_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19881, - serialized_end=19943, -) - - -_PAYMENT = _descriptor.Descriptor( - name="Payment", - full_name="lnrpc.Payment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.Payment.payment_hash", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Payment.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_date", - full_name="lnrpc.Payment.creation_date", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.Payment.fee", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_preimage", - full_name="lnrpc.Payment.payment_preimage", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_sat", - full_name="lnrpc.Payment.value_sat", - index=5, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_msat", - full_name="lnrpc.Payment.value_msat", - index=6, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.Payment.payment_request", - index=7, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="lnrpc.Payment.status", - index=8, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_sat", - full_name="lnrpc.Payment.fee_sat", - index=9, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.Payment.fee_msat", - index=10, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_time_ns", - full_name="lnrpc.Payment.creation_time_ns", - index=11, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlcs", - full_name="lnrpc.Payment.htlcs", - index=12, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_index", - full_name="lnrpc.Payment.payment_index", - index=13, - number=15, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure_reason", - full_name="lnrpc.Payment.failure_reason", - index=14, - number=16, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PAYMENT_PAYMENTSTATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19946, - serialized_end=20426, -) - - -_HTLCATTEMPT = _descriptor.Descriptor( - name="HTLCAttempt", - full_name="lnrpc.HTLCAttempt", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="attempt_id", - full_name="lnrpc.HTLCAttempt.attempt_id", - index=0, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="lnrpc.HTLCAttempt.status", - index=1, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route", - full_name="lnrpc.HTLCAttempt.route", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="attempt_time_ns", - full_name="lnrpc.HTLCAttempt.attempt_time_ns", - index=3, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolve_time_ns", - full_name="lnrpc.HTLCAttempt.resolve_time_ns", - index=4, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure", - full_name="lnrpc.HTLCAttempt.failure", - index=5, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="preimage", - full_name="lnrpc.HTLCAttempt.preimage", - index=6, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_HTLCATTEMPT_HTLCSTATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20429, - serialized_end=20695, -) - - -_LISTPAYMENTSREQUEST = _descriptor.Descriptor( - name="ListPaymentsRequest", - full_name="lnrpc.ListPaymentsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="include_incomplete", - full_name="lnrpc.ListPaymentsRequest.include_incomplete", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ListPaymentsRequest.index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_payments", - full_name="lnrpc.ListPaymentsRequest.max_payments", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reversed", - full_name="lnrpc.ListPaymentsRequest.reversed", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20697, - serialized_end=20808, -) - - -_LISTPAYMENTSRESPONSE = _descriptor.Descriptor( - name="ListPaymentsResponse", - full_name="lnrpc.ListPaymentsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payments", - full_name="lnrpc.ListPaymentsResponse.payments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="first_index_offset", - full_name="lnrpc.ListPaymentsResponse.first_index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_index_offset", - full_name="lnrpc.ListPaymentsResponse.last_index_offset", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20810, - serialized_end=20921, -) - - -_DELETEPAYMENTREQUEST = _descriptor.Descriptor( - name="DeletePaymentRequest", - full_name="lnrpc.DeletePaymentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.DeletePaymentRequest.payment_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failed_htlcs_only", - full_name="lnrpc.DeletePaymentRequest.failed_htlcs_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20923, - serialized_end=20994, -) - - -_DELETEALLPAYMENTSREQUEST = _descriptor.Descriptor( - name="DeleteAllPaymentsRequest", - full_name="lnrpc.DeleteAllPaymentsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="failed_payments_only", - full_name="lnrpc.DeleteAllPaymentsRequest.failed_payments_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failed_htlcs_only", - full_name="lnrpc.DeleteAllPaymentsRequest.failed_htlcs_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20996, - serialized_end=21079, -) - - -_DELETEPAYMENTRESPONSE = _descriptor.Descriptor( - name="DeletePaymentResponse", - full_name="lnrpc.DeletePaymentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21081, - serialized_end=21104, -) - - -_DELETEALLPAYMENTSRESPONSE = _descriptor.Descriptor( - name="DeleteAllPaymentsResponse", - full_name="lnrpc.DeleteAllPaymentsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21106, - serialized_end=21133, -) - - -_ABANDONCHANNELREQUEST = _descriptor.Descriptor( - name="AbandonChannelRequest", - full_name="lnrpc.AbandonChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.AbandonChannelRequest.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_funding_shim_only", - full_name="lnrpc.AbandonChannelRequest.pending_funding_shim_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="i_know_what_i_am_doing", - full_name="lnrpc.AbandonChannelRequest.i_know_what_i_am_doing", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21136, - serialized_end=21270, -) - - -_ABANDONCHANNELRESPONSE = _descriptor.Descriptor( - name="AbandonChannelResponse", - full_name="lnrpc.AbandonChannelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21272, - serialized_end=21296, -) - - -_DEBUGLEVELREQUEST = _descriptor.Descriptor( - name="DebugLevelRequest", - full_name="lnrpc.DebugLevelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="show", - full_name="lnrpc.DebugLevelRequest.show", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="level_spec", - full_name="lnrpc.DebugLevelRequest.level_spec", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21298, - serialized_end=21351, -) - - -_DEBUGLEVELRESPONSE = _descriptor.Descriptor( - name="DebugLevelResponse", - full_name="lnrpc.DebugLevelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sub_systems", - full_name="lnrpc.DebugLevelResponse.sub_systems", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21353, - serialized_end=21394, -) - - -_PAYREQSTRING = _descriptor.Descriptor( - name="PayReqString", - full_name="lnrpc.PayReqString", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pay_req", - full_name="lnrpc.PayReqString.pay_req", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21396, - serialized_end=21427, -) - - -_PAYREQ_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.PayReq.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.PayReq.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.PayReq.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_PAYREQ = _descriptor.Descriptor( - name="PayReq", - full_name="lnrpc.PayReq", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="destination", - full_name="lnrpc.PayReq.destination", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.PayReq.payment_hash", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_satoshis", - full_name="lnrpc.PayReq.num_satoshis", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.PayReq.timestamp", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.PayReq.expiry", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="lnrpc.PayReq.description", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description_hash", - full_name="lnrpc.PayReq.description_hash", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fallback_addr", - full_name="lnrpc.PayReq.fallback_addr", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.PayReq.cltv_expiry", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.PayReq.route_hints", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.PayReq.payment_addr", - index=10, - number=11, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_msat", - full_name="lnrpc.PayReq.num_msat", - index=11, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.PayReq.features", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_PAYREQ_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21430, - serialized_end=21820, -) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="lnrpc.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="lnrpc.Feature.name", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_required", - full_name="lnrpc.Feature.is_required", - index=1, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_known", - full_name="lnrpc.Feature.is_known", - index=2, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21822, - serialized_end=21884, -) - - -_FEEREPORTREQUEST = _descriptor.Descriptor( - name="FeeReportRequest", - full_name="lnrpc.FeeReportRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21886, - serialized_end=21904, -) - - -_CHANNELFEEREPORT = _descriptor.Descriptor( - name="ChannelFeeReport", - full_name="lnrpc.ChannelFeeReport", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelFeeReport.chan_id", - index=0, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelFeeReport.channel_point", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee_msat", - full_name="lnrpc.ChannelFeeReport.base_fee_msat", - index=2, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_mil", - full_name="lnrpc.ChannelFeeReport.fee_per_mil", - index=3, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.ChannelFeeReport.fee_rate", - index=4, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21906, - serialized_end=22030, -) - - -_FEEREPORTRESPONSE = _descriptor.Descriptor( - name="FeeReportResponse", - full_name="lnrpc.FeeReportResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_fees", - full_name="lnrpc.FeeReportResponse.channel_fees", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="day_fee_sum", - full_name="lnrpc.FeeReportResponse.day_fee_sum", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="week_fee_sum", - full_name="lnrpc.FeeReportResponse.week_fee_sum", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="month_fee_sum", - full_name="lnrpc.FeeReportResponse.month_fee_sum", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22033, - serialized_end=22165, -) - - -_POLICYUPDATEREQUEST = _descriptor.Descriptor( - name="PolicyUpdateRequest", - full_name="lnrpc.PolicyUpdateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="global", - full_name="lnrpc.PolicyUpdateRequest.global", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.PolicyUpdateRequest.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee_msat", - full_name="lnrpc.PolicyUpdateRequest.base_fee_msat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.PolicyUpdateRequest.fee_rate", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.PolicyUpdateRequest.time_lock_delta", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_msat", - full_name="lnrpc.PolicyUpdateRequest.max_htlc_msat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.PolicyUpdateRequest.min_htlc_msat", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat_specified", - full_name="lnrpc.PolicyUpdateRequest.min_htlc_msat_specified", - index=7, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="scope", - full_name="lnrpc.PolicyUpdateRequest.scope", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=22168, - serialized_end=22404, -) - - -_FAILEDUPDATE = _descriptor.Descriptor( - name="FailedUpdate", - full_name="lnrpc.FailedUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.FailedUpdate.outpoint", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reason", - full_name="lnrpc.FailedUpdate.reason", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="update_error", - full_name="lnrpc.FailedUpdate.update_error", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22406, - serialized_end=22515, -) - - -_POLICYUPDATERESPONSE = _descriptor.Descriptor( - name="PolicyUpdateResponse", - full_name="lnrpc.PolicyUpdateResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="failed_updates", - full_name="lnrpc.PolicyUpdateResponse.failed_updates", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22517, - serialized_end=22584, -) - - -_FORWARDINGHISTORYREQUEST = _descriptor.Descriptor( - name="ForwardingHistoryRequest", - full_name="lnrpc.ForwardingHistoryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="lnrpc.ForwardingHistoryRequest.start_time", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="lnrpc.ForwardingHistoryRequest.end_time", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ForwardingHistoryRequest.index_offset", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_max_events", - full_name="lnrpc.ForwardingHistoryRequest.num_max_events", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22586, - serialized_end=22696, -) - - -_FORWARDINGEVENT = _descriptor.Descriptor( - name="ForwardingEvent", - full_name="lnrpc.ForwardingEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.ForwardingEvent.timestamp", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id_in", - full_name="lnrpc.ForwardingEvent.chan_id_in", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id_out", - full_name="lnrpc.ForwardingEvent.chan_id_out", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_in", - full_name="lnrpc.ForwardingEvent.amt_in", - index=3, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_out", - full_name="lnrpc.ForwardingEvent.amt_out", - index=4, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.ForwardingEvent.fee", - index=5, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.ForwardingEvent.fee_msat", - index=6, - number=8, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_in_msat", - full_name="lnrpc.ForwardingEvent.amt_in_msat", - index=7, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_out_msat", - full_name="lnrpc.ForwardingEvent.amt_out_msat", - index=8, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp_ns", - full_name="lnrpc.ForwardingEvent.timestamp_ns", - index=9, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22699, - serialized_end=22917, -) - - -_FORWARDINGHISTORYRESPONSE = _descriptor.Descriptor( - name="ForwardingHistoryResponse", - full_name="lnrpc.ForwardingHistoryResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="forwarding_events", - full_name="lnrpc.ForwardingHistoryResponse.forwarding_events", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_offset_index", - full_name="lnrpc.ForwardingHistoryResponse.last_offset_index", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22919, - serialized_end=23024, -) - - -_EXPORTCHANNELBACKUPREQUEST = _descriptor.Descriptor( - name="ExportChannelBackupRequest", - full_name="lnrpc.ExportChannelBackupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ExportChannelBackupRequest.chan_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23026, - serialized_end=23095, -) - - -_CHANNELBACKUP = _descriptor.Descriptor( - name="ChannelBackup", - full_name="lnrpc.ChannelBackup", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelBackup.chan_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_backup", - full_name="lnrpc.ChannelBackup.chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23097, - serialized_end=23174, -) - - -_MULTICHANBACKUP = _descriptor.Descriptor( - name="MultiChanBackup", - full_name="lnrpc.MultiChanBackup", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_points", - full_name="lnrpc.MultiChanBackup.chan_points", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.MultiChanBackup.multi_chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23176, - serialized_end=23262, -) - - -_CHANBACKUPEXPORTREQUEST = _descriptor.Descriptor( - name="ChanBackupExportRequest", - full_name="lnrpc.ChanBackupExportRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23264, - serialized_end=23289, -) - - -_CHANBACKUPSNAPSHOT = _descriptor.Descriptor( - name="ChanBackupSnapshot", - full_name="lnrpc.ChanBackupSnapshot", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="single_chan_backups", - full_name="lnrpc.ChanBackupSnapshot.single_chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.ChanBackupSnapshot.multi_chan_backup", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23291, - serialized_end=23414, -) - - -_CHANNELBACKUPS = _descriptor.Descriptor( - name="ChannelBackups", - full_name="lnrpc.ChannelBackups", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_backups", - full_name="lnrpc.ChannelBackups.chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23416, - serialized_end=23476, -) - - -_RESTORECHANBACKUPREQUEST = _descriptor.Descriptor( - name="RestoreChanBackupRequest", - full_name="lnrpc.RestoreChanBackupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_backups", - full_name="lnrpc.RestoreChanBackupRequest.chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.RestoreChanBackupRequest.multi_chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="backup", - full_name="lnrpc.RestoreChanBackupRequest.backup", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=23478, - serialized_end=23590, -) - - -_RESTOREBACKUPRESPONSE = _descriptor.Descriptor( - name="RestoreBackupResponse", - full_name="lnrpc.RestoreBackupResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23592, - serialized_end=23615, -) - - -_CHANNELBACKUPSUBSCRIPTION = _descriptor.Descriptor( - name="ChannelBackupSubscription", - full_name="lnrpc.ChannelBackupSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23617, - serialized_end=23644, -) - - -_VERIFYCHANBACKUPRESPONSE = _descriptor.Descriptor( - name="VerifyChanBackupResponse", - full_name="lnrpc.VerifyChanBackupResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23646, - serialized_end=23672, -) - - -_MACAROONPERMISSION = _descriptor.Descriptor( - name="MacaroonPermission", - full_name="lnrpc.MacaroonPermission", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="lnrpc.MacaroonPermission.entity", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="action", - full_name="lnrpc.MacaroonPermission.action", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23674, - serialized_end=23726, -) - - -_BAKEMACAROONREQUEST = _descriptor.Descriptor( - name="BakeMacaroonRequest", - full_name="lnrpc.BakeMacaroonRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.BakeMacaroonRequest.permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="root_key_id", - full_name="lnrpc.BakeMacaroonRequest.root_key_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="allow_external_permissions", - full_name="lnrpc.BakeMacaroonRequest.allow_external_permissions", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23728, - serialized_end=23854, -) - - -_BAKEMACAROONRESPONSE = _descriptor.Descriptor( - name="BakeMacaroonResponse", - full_name="lnrpc.BakeMacaroonResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="macaroon", - full_name="lnrpc.BakeMacaroonResponse.macaroon", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23856, - serialized_end=23896, -) - - -_LISTMACAROONIDSREQUEST = _descriptor.Descriptor( - name="ListMacaroonIDsRequest", - full_name="lnrpc.ListMacaroonIDsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23898, - serialized_end=23922, -) - - -_LISTMACAROONIDSRESPONSE = _descriptor.Descriptor( - name="ListMacaroonIDsResponse", - full_name="lnrpc.ListMacaroonIDsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_key_ids", - full_name="lnrpc.ListMacaroonIDsResponse.root_key_ids", - index=0, - number=1, - type=4, - cpp_type=4, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23924, - serialized_end=23971, -) - - -_DELETEMACAROONIDREQUEST = _descriptor.Descriptor( - name="DeleteMacaroonIDRequest", - full_name="lnrpc.DeleteMacaroonIDRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_key_id", - full_name="lnrpc.DeleteMacaroonIDRequest.root_key_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23973, - serialized_end=24019, -) - - -_DELETEMACAROONIDRESPONSE = _descriptor.Descriptor( - name="DeleteMacaroonIDResponse", - full_name="lnrpc.DeleteMacaroonIDResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="deleted", - full_name="lnrpc.DeleteMacaroonIDResponse.deleted", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24021, - serialized_end=24064, -) - - -_MACAROONPERMISSIONLIST = _descriptor.Descriptor( - name="MacaroonPermissionList", - full_name="lnrpc.MacaroonPermissionList", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.MacaroonPermissionList.permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24066, - serialized_end=24138, -) - - -_LISTPERMISSIONSREQUEST = _descriptor.Descriptor( - name="ListPermissionsRequest", - full_name="lnrpc.ListPermissionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24140, - serialized_end=24164, -) - - -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY = _descriptor.Descriptor( - name="MethodPermissionsEntry", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24277, - serialized_end=24364, -) - -_LISTPERMISSIONSRESPONSE = _descriptor.Descriptor( - name="ListPermissionsResponse", - full_name="lnrpc.ListPermissionsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_permissions", - full_name="lnrpc.ListPermissionsResponse.method_permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24167, - serialized_end=24364, -) - - -_FAILURE = _descriptor.Descriptor( - name="Failure", - full_name="lnrpc.Failure", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="lnrpc.Failure.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_update", - full_name="lnrpc.Failure.channel_update", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_msat", - full_name="lnrpc.Failure.htlc_msat", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="onion_sha_256", - full_name="lnrpc.Failure.onion_sha_256", - index=3, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.Failure.cltv_expiry", - index=4, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="flags", - full_name="lnrpc.Failure.flags", - index=5, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure_source_index", - full_name="lnrpc.Failure.failure_source_index", - index=6, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="lnrpc.Failure.height", - index=7, - number=9, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FAILURE_FAILURECODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24367, - serialized_end=25348, -) - - -_CHANNELUPDATE = _descriptor.Descriptor( - name="ChannelUpdate", - full_name="lnrpc.ChannelUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.ChannelUpdate.signature", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelUpdate.chain_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelUpdate.chan_id", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.ChannelUpdate.timestamp", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="message_flags", - full_name="lnrpc.ChannelUpdate.message_flags", - index=4, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_flags", - full_name="lnrpc.ChannelUpdate.channel_flags", - index=5, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.ChannelUpdate.time_lock_delta", - index=6, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_minimum_msat", - full_name="lnrpc.ChannelUpdate.htlc_minimum_msat", - index=7, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee", - full_name="lnrpc.ChannelUpdate.base_fee", - index=8, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.ChannelUpdate.fee_rate", - index=9, - number=9, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_maximum_msat", - full_name="lnrpc.ChannelUpdate.htlc_maximum_msat", - index=10, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="extra_opaque_data", - full_name="lnrpc.ChannelUpdate.extra_opaque_data", - index=11, - number=12, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25351, - serialized_end=25633, -) - - -_MACAROONID = _descriptor.Descriptor( - name="MacaroonId", - full_name="lnrpc.MacaroonId", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="nonce", - full_name="lnrpc.MacaroonId.nonce", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="storageId", - full_name="lnrpc.MacaroonId.storageId", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ops", - full_name="lnrpc.MacaroonId.ops", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25635, - serialized_end=25705, -) - - -_OP = _descriptor.Descriptor( - name="Op", - full_name="lnrpc.Op", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="lnrpc.Op.entity", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="actions", - full_name="lnrpc.Op.actions", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25707, - serialized_end=25744, -) - - -_CHECKMACPERMREQUEST = _descriptor.Descriptor( - name="CheckMacPermRequest", - full_name="lnrpc.CheckMacPermRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="macaroon", - full_name="lnrpc.CheckMacPermRequest.macaroon", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.CheckMacPermRequest.permissions", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fullMethod", - full_name="lnrpc.CheckMacPermRequest.fullMethod", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25746, - serialized_end=25853, -) - - -_CHECKMACPERMRESPONSE = _descriptor.Descriptor( - name="CheckMacPermResponse", - full_name="lnrpc.CheckMacPermResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="valid", - full_name="lnrpc.CheckMacPermResponse.valid", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25855, - serialized_end=25892, -) - - -_RPCMIDDLEWAREREQUEST = _descriptor.Descriptor( - name="RPCMiddlewareRequest", - full_name="lnrpc.RPCMiddlewareRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="lnrpc.RPCMiddlewareRequest.request_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="raw_macaroon", - full_name="lnrpc.RPCMiddlewareRequest.raw_macaroon", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_caveat_condition", - full_name="lnrpc.RPCMiddlewareRequest.custom_caveat_condition", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stream_auth", - full_name="lnrpc.RPCMiddlewareRequest.stream_auth", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="request", - full_name="lnrpc.RPCMiddlewareRequest.request", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="response", - full_name="lnrpc.RPCMiddlewareRequest.response", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="intercept_type", - full_name="lnrpc.RPCMiddlewareRequest.intercept_type", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=25895, - serialized_end=26129, -) - - -_STREAMAUTH = _descriptor.Descriptor( - name="StreamAuth", - full_name="lnrpc.StreamAuth", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_full_uri", - full_name="lnrpc.StreamAuth.method_full_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26131, - serialized_end=26168, -) - - -_RPCMESSAGE = _descriptor.Descriptor( - name="RPCMessage", - full_name="lnrpc.RPCMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_full_uri", - full_name="lnrpc.RPCMessage.method_full_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stream_rpc", - full_name="lnrpc.RPCMessage.stream_rpc", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type_name", - full_name="lnrpc.RPCMessage.type_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="serialized", - full_name="lnrpc.RPCMessage.serialized", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26170, - serialized_end=26266, -) - - -_RPCMIDDLEWARERESPONSE = _descriptor.Descriptor( - name="RPCMiddlewareResponse", - full_name="lnrpc.RPCMiddlewareResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="lnrpc.RPCMiddlewareResponse.request_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="register", - full_name="lnrpc.RPCMiddlewareResponse.register", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="feedback", - full_name="lnrpc.RPCMiddlewareResponse.feedback", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="middleware_message", - full_name="lnrpc.RPCMiddlewareResponse.middleware_message", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=26269, - serialized_end=26431, -) - - -_MIDDLEWAREREGISTRATION = _descriptor.Descriptor( - name="MiddlewareRegistration", - full_name="lnrpc.MiddlewareRegistration", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="middleware_name", - full_name="lnrpc.MiddlewareRegistration.middleware_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_macaroon_caveat_name", - full_name="lnrpc.MiddlewareRegistration.custom_macaroon_caveat_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="read_only_mode", - full_name="lnrpc.MiddlewareRegistration.read_only_mode", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26433, - serialized_end=26543, -) - - -_INTERCEPTFEEDBACK = _descriptor.Descriptor( - name="InterceptFeedback", - full_name="lnrpc.InterceptFeedback", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.InterceptFeedback.error", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="replace_response", - full_name="lnrpc.InterceptFeedback.replace_response", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="replacement_serialized", - full_name="lnrpc.InterceptFeedback.replacement_serialized", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26545, - serialized_end=26637, -) - -_UTXO.fields_by_name["address_type"].enum_type = _ADDRESSTYPE -_UTXO.fields_by_name["outpoint"].message_type = _OUTPOINT -_TRANSACTIONDETAILS.fields_by_name["transactions"].message_type = _TRANSACTION -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["fixed"]) -_FEELIMIT.fields_by_name["fixed"].containing_oneof = _FEELIMIT.oneofs_by_name["limit"] -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["fixed_msat"]) -_FEELIMIT.fields_by_name["fixed_msat"].containing_oneof = _FEELIMIT.oneofs_by_name[ - "limit" -] -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["percent"]) -_FEELIMIT.fields_by_name["percent"].containing_oneof = _FEELIMIT.oneofs_by_name["limit"] -_SENDREQUEST_DESTCUSTOMRECORDSENTRY.containing_type = _SENDREQUEST -_SENDREQUEST.fields_by_name["fee_limit"].message_type = _FEELIMIT -_SENDREQUEST.fields_by_name[ - "dest_custom_records" -].message_type = _SENDREQUEST_DESTCUSTOMRECORDSENTRY -_SENDREQUEST.fields_by_name["dest_features"].enum_type = _FEATUREBIT -_SENDRESPONSE.fields_by_name["payment_route"].message_type = _ROUTE -_SENDTOROUTEREQUEST.fields_by_name["route"].message_type = _ROUTE -_CHANNELACCEPTREQUEST.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_CHANNELPOINT.oneofs_by_name["funding_txid"].fields.append( - _CHANNELPOINT.fields_by_name["funding_txid_bytes"] -) -_CHANNELPOINT.fields_by_name[ - "funding_txid_bytes" -].containing_oneof = _CHANNELPOINT.oneofs_by_name["funding_txid"] -_CHANNELPOINT.oneofs_by_name["funding_txid"].fields.append( - _CHANNELPOINT.fields_by_name["funding_txid_str"] -) -_CHANNELPOINT.fields_by_name[ - "funding_txid_str" -].containing_oneof = _CHANNELPOINT.oneofs_by_name["funding_txid"] -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY.containing_type = _ESTIMATEFEEREQUEST -_ESTIMATEFEEREQUEST.fields_by_name[ - "AddrToAmount" -].message_type = _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY.containing_type = _SENDMANYREQUEST -_SENDMANYREQUEST.fields_by_name[ - "AddrToAmount" -].message_type = _SENDMANYREQUEST_ADDRTOAMOUNTENTRY -_LISTUNSPENTRESPONSE.fields_by_name["utxos"].message_type = _UTXO -_NEWADDRESSREQUEST.fields_by_name["type"].enum_type = _ADDRESSTYPE -_CONNECTPEERREQUEST.fields_by_name["addr"].message_type = _LIGHTNINGADDRESS -_CHANNEL.fields_by_name["pending_htlcs"].message_type = _HTLC -_CHANNEL.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_CHANNEL.fields_by_name["local_constraints"].message_type = _CHANNELCONSTRAINTS -_CHANNEL.fields_by_name["remote_constraints"].message_type = _CHANNELCONSTRAINTS -_LISTCHANNELSRESPONSE.fields_by_name["channels"].message_type = _CHANNEL -_CHANNELCLOSESUMMARY.fields_by_name[ - "close_type" -].enum_type = _CHANNELCLOSESUMMARY_CLOSURETYPE -_CHANNELCLOSESUMMARY.fields_by_name["open_initiator"].enum_type = _INITIATOR -_CHANNELCLOSESUMMARY.fields_by_name["close_initiator"].enum_type = _INITIATOR -_CHANNELCLOSESUMMARY.fields_by_name["resolutions"].message_type = _RESOLUTION -_CHANNELCLOSESUMMARY_CLOSURETYPE.containing_type = _CHANNELCLOSESUMMARY -_RESOLUTION.fields_by_name["resolution_type"].enum_type = _RESOLUTIONTYPE -_RESOLUTION.fields_by_name["outcome"].enum_type = _RESOLUTIONOUTCOME -_RESOLUTION.fields_by_name["outpoint"].message_type = _OUTPOINT -_CLOSEDCHANNELSRESPONSE.fields_by_name["channels"].message_type = _CHANNELCLOSESUMMARY -_PEER_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_PEER_FEATURESENTRY.containing_type = _PEER -_PEER.fields_by_name["sync_type"].enum_type = _PEER_SYNCTYPE -_PEER.fields_by_name["features"].message_type = _PEER_FEATURESENTRY -_PEER.fields_by_name["errors"].message_type = _TIMESTAMPEDERROR -_PEER_SYNCTYPE.containing_type = _PEER -_LISTPEERSRESPONSE.fields_by_name["peers"].message_type = _PEER -_PEEREVENT.fields_by_name["type"].enum_type = _PEEREVENT_EVENTTYPE -_PEEREVENT_EVENTTYPE.containing_type = _PEEREVENT -_GETINFORESPONSE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_GETINFORESPONSE_FEATURESENTRY.containing_type = _GETINFORESPONSE -_GETINFORESPONSE.fields_by_name["chains"].message_type = _CHAIN -_GETINFORESPONSE.fields_by_name[ - "features" -].message_type = _GETINFORESPONSE_FEATURESENTRY -_CHANNELOPENUPDATE.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_CLOSECHANNELREQUEST.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_CLOSESTATUSUPDATE.fields_by_name["close_pending"].message_type = _PENDINGUPDATE -_CLOSESTATUSUPDATE.fields_by_name["chan_close"].message_type = _CHANNELCLOSEUPDATE -_CLOSESTATUSUPDATE.oneofs_by_name["update"].fields.append( - _CLOSESTATUSUPDATE.fields_by_name["close_pending"] -) -_CLOSESTATUSUPDATE.fields_by_name[ - "close_pending" -].containing_oneof = _CLOSESTATUSUPDATE.oneofs_by_name["update"] -_CLOSESTATUSUPDATE.oneofs_by_name["update"].fields.append( - _CLOSESTATUSUPDATE.fields_by_name["chan_close"] -) -_CLOSESTATUSUPDATE.fields_by_name[ - "chan_close" -].containing_oneof = _CLOSESTATUSUPDATE.oneofs_by_name["update"] -_BATCHOPENCHANNELREQUEST.fields_by_name["channels"].message_type = _BATCHOPENCHANNEL -_BATCHOPENCHANNEL.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_BATCHOPENCHANNELRESPONSE.fields_by_name[ - "pending_channels" -].message_type = _PENDINGUPDATE -_OPENCHANNELREQUEST.fields_by_name["funding_shim"].message_type = _FUNDINGSHIM -_OPENCHANNELREQUEST.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_OPENSTATUSUPDATE.fields_by_name["chan_pending"].message_type = _PENDINGUPDATE -_OPENSTATUSUPDATE.fields_by_name["chan_open"].message_type = _CHANNELOPENUPDATE -_OPENSTATUSUPDATE.fields_by_name["psbt_fund"].message_type = _READYFORPSBTFUNDING -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["chan_pending"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "chan_pending" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["chan_open"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "chan_open" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["psbt_fund"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "psbt_fund" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_KEYDESCRIPTOR.fields_by_name["key_loc"].message_type = _KEYLOCATOR -_CHANPOINTSHIM.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANPOINTSHIM.fields_by_name["local_key"].message_type = _KEYDESCRIPTOR -_FUNDINGSHIM.fields_by_name["chan_point_shim"].message_type = _CHANPOINTSHIM -_FUNDINGSHIM.fields_by_name["psbt_shim"].message_type = _PSBTSHIM -_FUNDINGSHIM.oneofs_by_name["shim"].fields.append( - _FUNDINGSHIM.fields_by_name["chan_point_shim"] -) -_FUNDINGSHIM.fields_by_name[ - "chan_point_shim" -].containing_oneof = _FUNDINGSHIM.oneofs_by_name["shim"] -_FUNDINGSHIM.oneofs_by_name["shim"].fields.append( - _FUNDINGSHIM.fields_by_name["psbt_shim"] -) -_FUNDINGSHIM.fields_by_name["psbt_shim"].containing_oneof = _FUNDINGSHIM.oneofs_by_name[ - "shim" -] -_FUNDINGTRANSITIONMSG.fields_by_name["shim_register"].message_type = _FUNDINGSHIM -_FUNDINGTRANSITIONMSG.fields_by_name["shim_cancel"].message_type = _FUNDINGSHIMCANCEL -_FUNDINGTRANSITIONMSG.fields_by_name["psbt_verify"].message_type = _FUNDINGPSBTVERIFY -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_finalize" -].message_type = _FUNDINGPSBTFINALIZE -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["shim_register"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "shim_register" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["shim_cancel"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "shim_cancel" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["psbt_verify"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_verify" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["psbt_finalize"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_finalize" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.fields_by_name[ - "initiator" -].enum_type = _INITIATOR -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.fields_by_name[ - "commitment_type" -].enum_type = _COMMITMENTTYPE -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.fields_by_name[ - "commitments" -].message_type = _PENDINGCHANNELSRESPONSE_COMMITMENTS -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_COMMITMENTS.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "pending_htlcs" -].message_type = _PENDINGHTLC -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "anchor" -].enum_type = _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE.containing_type = ( - _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL -) -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_open_channels" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_closing_channels" -].message_type = _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_force_closing_channels" -].message_type = _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "waiting_close_channels" -].message_type = _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL -_CHANNELEVENTUPDATE.fields_by_name["open_channel"].message_type = _CHANNEL -_CHANNELEVENTUPDATE.fields_by_name["closed_channel"].message_type = _CHANNELCLOSESUMMARY -_CHANNELEVENTUPDATE.fields_by_name["active_channel"].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["inactive_channel"].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["pending_open_channel"].message_type = _PENDINGUPDATE -_CHANNELEVENTUPDATE.fields_by_name[ - "fully_resolved_channel" -].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["type"].enum_type = _CHANNELEVENTUPDATE_UPDATETYPE -_CHANNELEVENTUPDATE_UPDATETYPE.containing_type = _CHANNELEVENTUPDATE -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["open_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "open_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["closed_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "closed_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["active_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "active_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["inactive_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "inactive_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["pending_open_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "pending_open_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["fully_resolved_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "fully_resolved_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY.fields_by_name[ - "value" -].message_type = _WALLETACCOUNTBALANCE -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY.containing_type = _WALLETBALANCERESPONSE -_WALLETBALANCERESPONSE.fields_by_name[ - "account_balance" -].message_type = _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY -_CHANNELBALANCERESPONSE.fields_by_name["local_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name["remote_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name["unsettled_local_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "unsettled_remote_balance" -].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "pending_open_local_balance" -].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "pending_open_remote_balance" -].message_type = _AMOUNT -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY.containing_type = _QUERYROUTESREQUEST -_QUERYROUTESREQUEST.fields_by_name["fee_limit"].message_type = _FEELIMIT -_QUERYROUTESREQUEST.fields_by_name["ignored_edges"].message_type = _EDGELOCATOR -_QUERYROUTESREQUEST.fields_by_name["ignored_pairs"].message_type = _NODEPAIR -_QUERYROUTESREQUEST.fields_by_name[ - "dest_custom_records" -].message_type = _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY -_QUERYROUTESREQUEST.fields_by_name["route_hints"].message_type = _ROUTEHINT -_QUERYROUTESREQUEST.fields_by_name["dest_features"].enum_type = _FEATUREBIT -_QUERYROUTESRESPONSE.fields_by_name["routes"].message_type = _ROUTE -_HOP_CUSTOMRECORDSENTRY.containing_type = _HOP -_HOP.fields_by_name["mpp_record"].message_type = _MPPRECORD -_HOP.fields_by_name["amp_record"].message_type = _AMPRECORD -_HOP.fields_by_name["custom_records"].message_type = _HOP_CUSTOMRECORDSENTRY -_ROUTE.fields_by_name["hops"].message_type = _HOP -_NODEINFO.fields_by_name["node"].message_type = _LIGHTNINGNODE -_NODEINFO.fields_by_name["channels"].message_type = _CHANNELEDGE -_LIGHTNINGNODE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_LIGHTNINGNODE_FEATURESENTRY.containing_type = _LIGHTNINGNODE -_LIGHTNINGNODE.fields_by_name["addresses"].message_type = _NODEADDRESS -_LIGHTNINGNODE.fields_by_name["features"].message_type = _LIGHTNINGNODE_FEATURESENTRY -_CHANNELEDGE.fields_by_name["node1_policy"].message_type = _ROUTINGPOLICY -_CHANNELEDGE.fields_by_name["node2_policy"].message_type = _ROUTINGPOLICY -_CHANNELGRAPH.fields_by_name["nodes"].message_type = _LIGHTNINGNODE -_CHANNELGRAPH.fields_by_name["edges"].message_type = _CHANNELEDGE -_NODEMETRICSREQUEST.fields_by_name["types"].enum_type = _NODEMETRICTYPE -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY.fields_by_name[ - "value" -].message_type = _FLOATMETRIC -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY.containing_type = _NODEMETRICSRESPONSE -_NODEMETRICSRESPONSE.fields_by_name[ - "betweenness_centrality" -].message_type = _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY -_GRAPHTOPOLOGYUPDATE.fields_by_name["node_updates"].message_type = _NODEUPDATE -_GRAPHTOPOLOGYUPDATE.fields_by_name["channel_updates"].message_type = _CHANNELEDGEUPDATE -_GRAPHTOPOLOGYUPDATE.fields_by_name["closed_chans"].message_type = _CLOSEDCHANNELUPDATE -_NODEUPDATE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_NODEUPDATE_FEATURESENTRY.containing_type = _NODEUPDATE -_NODEUPDATE.fields_by_name["node_addresses"].message_type = _NODEADDRESS -_NODEUPDATE.fields_by_name["features"].message_type = _NODEUPDATE_FEATURESENTRY -_CHANNELEDGEUPDATE.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANNELEDGEUPDATE.fields_by_name["routing_policy"].message_type = _ROUTINGPOLICY -_CLOSEDCHANNELUPDATE.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_ROUTEHINT.fields_by_name["hop_hints"].message_type = _HOPHINT -_AMPINVOICESTATE.fields_by_name["state"].enum_type = _INVOICEHTLCSTATE -_INVOICE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_INVOICE_FEATURESENTRY.containing_type = _INVOICE -_INVOICE_AMPINVOICESTATEENTRY.fields_by_name["value"].message_type = _AMPINVOICESTATE -_INVOICE_AMPINVOICESTATEENTRY.containing_type = _INVOICE -_INVOICE.fields_by_name["route_hints"].message_type = _ROUTEHINT -_INVOICE.fields_by_name["state"].enum_type = _INVOICE_INVOICESTATE -_INVOICE.fields_by_name["htlcs"].message_type = _INVOICEHTLC -_INVOICE.fields_by_name["features"].message_type = _INVOICE_FEATURESENTRY -_INVOICE.fields_by_name[ - "amp_invoice_state" -].message_type = _INVOICE_AMPINVOICESTATEENTRY -_INVOICE_INVOICESTATE.containing_type = _INVOICE -_INVOICEHTLC_CUSTOMRECORDSENTRY.containing_type = _INVOICEHTLC -_INVOICEHTLC.fields_by_name["state"].enum_type = _INVOICEHTLCSTATE -_INVOICEHTLC.fields_by_name[ - "custom_records" -].message_type = _INVOICEHTLC_CUSTOMRECORDSENTRY -_INVOICEHTLC.fields_by_name["amp"].message_type = _AMP -_LISTINVOICERESPONSE.fields_by_name["invoices"].message_type = _INVOICE -_PAYMENT.fields_by_name["status"].enum_type = _PAYMENT_PAYMENTSTATUS -_PAYMENT.fields_by_name["htlcs"].message_type = _HTLCATTEMPT -_PAYMENT.fields_by_name["failure_reason"].enum_type = _PAYMENTFAILUREREASON -_PAYMENT_PAYMENTSTATUS.containing_type = _PAYMENT -_HTLCATTEMPT.fields_by_name["status"].enum_type = _HTLCATTEMPT_HTLCSTATUS -_HTLCATTEMPT.fields_by_name["route"].message_type = _ROUTE -_HTLCATTEMPT.fields_by_name["failure"].message_type = _FAILURE -_HTLCATTEMPT_HTLCSTATUS.containing_type = _HTLCATTEMPT -_LISTPAYMENTSRESPONSE.fields_by_name["payments"].message_type = _PAYMENT -_ABANDONCHANNELREQUEST.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_PAYREQ_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_PAYREQ_FEATURESENTRY.containing_type = _PAYREQ -_PAYREQ.fields_by_name["route_hints"].message_type = _ROUTEHINT -_PAYREQ.fields_by_name["features"].message_type = _PAYREQ_FEATURESENTRY -_FEEREPORTRESPONSE.fields_by_name["channel_fees"].message_type = _CHANNELFEEREPORT -_POLICYUPDATEREQUEST.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_POLICYUPDATEREQUEST.oneofs_by_name["scope"].fields.append( - _POLICYUPDATEREQUEST.fields_by_name["global"] -) -_POLICYUPDATEREQUEST.fields_by_name[ - "global" -].containing_oneof = _POLICYUPDATEREQUEST.oneofs_by_name["scope"] -_POLICYUPDATEREQUEST.oneofs_by_name["scope"].fields.append( - _POLICYUPDATEREQUEST.fields_by_name["chan_point"] -) -_POLICYUPDATEREQUEST.fields_by_name[ - "chan_point" -].containing_oneof = _POLICYUPDATEREQUEST.oneofs_by_name["scope"] -_FAILEDUPDATE.fields_by_name["outpoint"].message_type = _OUTPOINT -_FAILEDUPDATE.fields_by_name["reason"].enum_type = _UPDATEFAILURE -_POLICYUPDATERESPONSE.fields_by_name["failed_updates"].message_type = _FAILEDUPDATE -_FORWARDINGHISTORYRESPONSE.fields_by_name[ - "forwarding_events" -].message_type = _FORWARDINGEVENT -_EXPORTCHANNELBACKUPREQUEST.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANNELBACKUP.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_MULTICHANBACKUP.fields_by_name["chan_points"].message_type = _CHANNELPOINT -_CHANBACKUPSNAPSHOT.fields_by_name["single_chan_backups"].message_type = _CHANNELBACKUPS -_CHANBACKUPSNAPSHOT.fields_by_name["multi_chan_backup"].message_type = _MULTICHANBACKUP -_CHANNELBACKUPS.fields_by_name["chan_backups"].message_type = _CHANNELBACKUP -_RESTORECHANBACKUPREQUEST.fields_by_name["chan_backups"].message_type = _CHANNELBACKUPS -_RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"].fields.append( - _RESTORECHANBACKUPREQUEST.fields_by_name["chan_backups"] -) -_RESTORECHANBACKUPREQUEST.fields_by_name[ - "chan_backups" -].containing_oneof = _RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"] -_RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"].fields.append( - _RESTORECHANBACKUPREQUEST.fields_by_name["multi_chan_backup"] -) -_RESTORECHANBACKUPREQUEST.fields_by_name[ - "multi_chan_backup" -].containing_oneof = _RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"] -_BAKEMACAROONREQUEST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_MACAROONPERMISSIONLIST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY.fields_by_name[ - "value" -].message_type = _MACAROONPERMISSIONLIST -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY.containing_type = ( - _LISTPERMISSIONSRESPONSE -) -_LISTPERMISSIONSRESPONSE.fields_by_name[ - "method_permissions" -].message_type = _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY -_FAILURE.fields_by_name["code"].enum_type = _FAILURE_FAILURECODE -_FAILURE.fields_by_name["channel_update"].message_type = _CHANNELUPDATE -_FAILURE_FAILURECODE.containing_type = _FAILURE -_MACAROONID.fields_by_name["ops"].message_type = _OP -_CHECKMACPERMREQUEST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_RPCMIDDLEWAREREQUEST.fields_by_name["stream_auth"].message_type = _STREAMAUTH -_RPCMIDDLEWAREREQUEST.fields_by_name["request"].message_type = _RPCMESSAGE -_RPCMIDDLEWAREREQUEST.fields_by_name["response"].message_type = _RPCMESSAGE -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["stream_auth"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "stream_auth" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["request"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "request" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["response"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "response" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWARERESPONSE.fields_by_name["register"].message_type = _MIDDLEWAREREGISTRATION -_RPCMIDDLEWARERESPONSE.fields_by_name["feedback"].message_type = _INTERCEPTFEEDBACK -_RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"].fields.append( - _RPCMIDDLEWARERESPONSE.fields_by_name["register"] -) -_RPCMIDDLEWARERESPONSE.fields_by_name[ - "register" -].containing_oneof = _RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"] -_RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"].fields.append( - _RPCMIDDLEWARERESPONSE.fields_by_name["feedback"] -) -_RPCMIDDLEWARERESPONSE.fields_by_name[ - "feedback" -].containing_oneof = _RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"] -DESCRIPTOR.message_types_by_name[ +_SUBSCRIBECUSTOMMESSAGESREQUEST = DESCRIPTOR.message_types_by_name[ "SubscribeCustomMessagesRequest" -] = _SUBSCRIBECUSTOMMESSAGESREQUEST -DESCRIPTOR.message_types_by_name["CustomMessage"] = _CUSTOMMESSAGE -DESCRIPTOR.message_types_by_name["SendCustomMessageRequest"] = _SENDCUSTOMMESSAGEREQUEST -DESCRIPTOR.message_types_by_name[ +] +_CUSTOMMESSAGE = DESCRIPTOR.message_types_by_name["CustomMessage"] +_SENDCUSTOMMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["SendCustomMessageRequest"] +_SENDCUSTOMMESSAGERESPONSE = DESCRIPTOR.message_types_by_name[ "SendCustomMessageResponse" -] = _SENDCUSTOMMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["Utxo"] = _UTXO -DESCRIPTOR.message_types_by_name["Transaction"] = _TRANSACTION -DESCRIPTOR.message_types_by_name["GetTransactionsRequest"] = _GETTRANSACTIONSREQUEST -DESCRIPTOR.message_types_by_name["TransactionDetails"] = _TRANSACTIONDETAILS -DESCRIPTOR.message_types_by_name["FeeLimit"] = _FEELIMIT -DESCRIPTOR.message_types_by_name["SendRequest"] = _SENDREQUEST -DESCRIPTOR.message_types_by_name["SendResponse"] = _SENDRESPONSE -DESCRIPTOR.message_types_by_name["SendToRouteRequest"] = _SENDTOROUTEREQUEST -DESCRIPTOR.message_types_by_name["ChannelAcceptRequest"] = _CHANNELACCEPTREQUEST -DESCRIPTOR.message_types_by_name["ChannelAcceptResponse"] = _CHANNELACCEPTRESPONSE -DESCRIPTOR.message_types_by_name["ChannelPoint"] = _CHANNELPOINT -DESCRIPTOR.message_types_by_name["OutPoint"] = _OUTPOINT -DESCRIPTOR.message_types_by_name["LightningAddress"] = _LIGHTNINGADDRESS -DESCRIPTOR.message_types_by_name["EstimateFeeRequest"] = _ESTIMATEFEEREQUEST -DESCRIPTOR.message_types_by_name["EstimateFeeResponse"] = _ESTIMATEFEERESPONSE -DESCRIPTOR.message_types_by_name["SendManyRequest"] = _SENDMANYREQUEST -DESCRIPTOR.message_types_by_name["SendManyResponse"] = _SENDMANYRESPONSE -DESCRIPTOR.message_types_by_name["SendCoinsRequest"] = _SENDCOINSREQUEST -DESCRIPTOR.message_types_by_name["SendCoinsResponse"] = _SENDCOINSRESPONSE -DESCRIPTOR.message_types_by_name["ListUnspentRequest"] = _LISTUNSPENTREQUEST -DESCRIPTOR.message_types_by_name["ListUnspentResponse"] = _LISTUNSPENTRESPONSE -DESCRIPTOR.message_types_by_name["NewAddressRequest"] = _NEWADDRESSREQUEST -DESCRIPTOR.message_types_by_name["NewAddressResponse"] = _NEWADDRESSRESPONSE -DESCRIPTOR.message_types_by_name["SignMessageRequest"] = _SIGNMESSAGEREQUEST -DESCRIPTOR.message_types_by_name["SignMessageResponse"] = _SIGNMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["VerifyMessageRequest"] = _VERIFYMESSAGEREQUEST -DESCRIPTOR.message_types_by_name["VerifyMessageResponse"] = _VERIFYMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["ConnectPeerRequest"] = _CONNECTPEERREQUEST -DESCRIPTOR.message_types_by_name["ConnectPeerResponse"] = _CONNECTPEERRESPONSE -DESCRIPTOR.message_types_by_name["DisconnectPeerRequest"] = _DISCONNECTPEERREQUEST -DESCRIPTOR.message_types_by_name["DisconnectPeerResponse"] = _DISCONNECTPEERRESPONSE -DESCRIPTOR.message_types_by_name["HTLC"] = _HTLC -DESCRIPTOR.message_types_by_name["ChannelConstraints"] = _CHANNELCONSTRAINTS -DESCRIPTOR.message_types_by_name["Channel"] = _CHANNEL -DESCRIPTOR.message_types_by_name["ListChannelsRequest"] = _LISTCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["ListChannelsResponse"] = _LISTCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["ChannelCloseSummary"] = _CHANNELCLOSESUMMARY -DESCRIPTOR.message_types_by_name["Resolution"] = _RESOLUTION -DESCRIPTOR.message_types_by_name["ClosedChannelsRequest"] = _CLOSEDCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["ClosedChannelsResponse"] = _CLOSEDCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["Peer"] = _PEER -DESCRIPTOR.message_types_by_name["TimestampedError"] = _TIMESTAMPEDERROR -DESCRIPTOR.message_types_by_name["ListPeersRequest"] = _LISTPEERSREQUEST -DESCRIPTOR.message_types_by_name["ListPeersResponse"] = _LISTPEERSRESPONSE -DESCRIPTOR.message_types_by_name["PeerEventSubscription"] = _PEEREVENTSUBSCRIPTION -DESCRIPTOR.message_types_by_name["PeerEvent"] = _PEEREVENT -DESCRIPTOR.message_types_by_name["GetInfoRequest"] = _GETINFOREQUEST -DESCRIPTOR.message_types_by_name["GetInfoResponse"] = _GETINFORESPONSE -DESCRIPTOR.message_types_by_name["GetRecoveryInfoRequest"] = _GETRECOVERYINFOREQUEST -DESCRIPTOR.message_types_by_name["GetRecoveryInfoResponse"] = _GETRECOVERYINFORESPONSE -DESCRIPTOR.message_types_by_name["Chain"] = _CHAIN -DESCRIPTOR.message_types_by_name["ConfirmationUpdate"] = _CONFIRMATIONUPDATE -DESCRIPTOR.message_types_by_name["ChannelOpenUpdate"] = _CHANNELOPENUPDATE -DESCRIPTOR.message_types_by_name["ChannelCloseUpdate"] = _CHANNELCLOSEUPDATE -DESCRIPTOR.message_types_by_name["CloseChannelRequest"] = _CLOSECHANNELREQUEST -DESCRIPTOR.message_types_by_name["CloseStatusUpdate"] = _CLOSESTATUSUPDATE -DESCRIPTOR.message_types_by_name["PendingUpdate"] = _PENDINGUPDATE -DESCRIPTOR.message_types_by_name["ReadyForPsbtFunding"] = _READYFORPSBTFUNDING -DESCRIPTOR.message_types_by_name["BatchOpenChannelRequest"] = _BATCHOPENCHANNELREQUEST -DESCRIPTOR.message_types_by_name["BatchOpenChannel"] = _BATCHOPENCHANNEL -DESCRIPTOR.message_types_by_name["BatchOpenChannelResponse"] = _BATCHOPENCHANNELRESPONSE -DESCRIPTOR.message_types_by_name["OpenChannelRequest"] = _OPENCHANNELREQUEST -DESCRIPTOR.message_types_by_name["OpenStatusUpdate"] = _OPENSTATUSUPDATE -DESCRIPTOR.message_types_by_name["KeyLocator"] = _KEYLOCATOR -DESCRIPTOR.message_types_by_name["KeyDescriptor"] = _KEYDESCRIPTOR -DESCRIPTOR.message_types_by_name["ChanPointShim"] = _CHANPOINTSHIM -DESCRIPTOR.message_types_by_name["PsbtShim"] = _PSBTSHIM -DESCRIPTOR.message_types_by_name["FundingShim"] = _FUNDINGSHIM -DESCRIPTOR.message_types_by_name["FundingShimCancel"] = _FUNDINGSHIMCANCEL -DESCRIPTOR.message_types_by_name["FundingPsbtVerify"] = _FUNDINGPSBTVERIFY -DESCRIPTOR.message_types_by_name["FundingPsbtFinalize"] = _FUNDINGPSBTFINALIZE -DESCRIPTOR.message_types_by_name["FundingTransitionMsg"] = _FUNDINGTRANSITIONMSG -DESCRIPTOR.message_types_by_name["FundingStateStepResp"] = _FUNDINGSTATESTEPRESP -DESCRIPTOR.message_types_by_name["PendingHTLC"] = _PENDINGHTLC -DESCRIPTOR.message_types_by_name["PendingChannelsRequest"] = _PENDINGCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["PendingChannelsResponse"] = _PENDINGCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["ChannelEventSubscription"] = _CHANNELEVENTSUBSCRIPTION -DESCRIPTOR.message_types_by_name["ChannelEventUpdate"] = _CHANNELEVENTUPDATE -DESCRIPTOR.message_types_by_name["WalletAccountBalance"] = _WALLETACCOUNTBALANCE -DESCRIPTOR.message_types_by_name["WalletBalanceRequest"] = _WALLETBALANCEREQUEST -DESCRIPTOR.message_types_by_name["WalletBalanceResponse"] = _WALLETBALANCERESPONSE -DESCRIPTOR.message_types_by_name["Amount"] = _AMOUNT -DESCRIPTOR.message_types_by_name["ChannelBalanceRequest"] = _CHANNELBALANCEREQUEST -DESCRIPTOR.message_types_by_name["ChannelBalanceResponse"] = _CHANNELBALANCERESPONSE -DESCRIPTOR.message_types_by_name["QueryRoutesRequest"] = _QUERYROUTESREQUEST -DESCRIPTOR.message_types_by_name["NodePair"] = _NODEPAIR -DESCRIPTOR.message_types_by_name["EdgeLocator"] = _EDGELOCATOR -DESCRIPTOR.message_types_by_name["QueryRoutesResponse"] = _QUERYROUTESRESPONSE -DESCRIPTOR.message_types_by_name["Hop"] = _HOP -DESCRIPTOR.message_types_by_name["MPPRecord"] = _MPPRECORD -DESCRIPTOR.message_types_by_name["AMPRecord"] = _AMPRECORD -DESCRIPTOR.message_types_by_name["Route"] = _ROUTE -DESCRIPTOR.message_types_by_name["NodeInfoRequest"] = _NODEINFOREQUEST -DESCRIPTOR.message_types_by_name["NodeInfo"] = _NODEINFO -DESCRIPTOR.message_types_by_name["LightningNode"] = _LIGHTNINGNODE -DESCRIPTOR.message_types_by_name["NodeAddress"] = _NODEADDRESS -DESCRIPTOR.message_types_by_name["RoutingPolicy"] = _ROUTINGPOLICY -DESCRIPTOR.message_types_by_name["ChannelEdge"] = _CHANNELEDGE -DESCRIPTOR.message_types_by_name["ChannelGraphRequest"] = _CHANNELGRAPHREQUEST -DESCRIPTOR.message_types_by_name["ChannelGraph"] = _CHANNELGRAPH -DESCRIPTOR.message_types_by_name["NodeMetricsRequest"] = _NODEMETRICSREQUEST -DESCRIPTOR.message_types_by_name["NodeMetricsResponse"] = _NODEMETRICSRESPONSE -DESCRIPTOR.message_types_by_name["FloatMetric"] = _FLOATMETRIC -DESCRIPTOR.message_types_by_name["ChanInfoRequest"] = _CHANINFOREQUEST -DESCRIPTOR.message_types_by_name["NetworkInfoRequest"] = _NETWORKINFOREQUEST -DESCRIPTOR.message_types_by_name["NetworkInfo"] = _NETWORKINFO -DESCRIPTOR.message_types_by_name["StopRequest"] = _STOPREQUEST -DESCRIPTOR.message_types_by_name["StopResponse"] = _STOPRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_UTXO = DESCRIPTOR.message_types_by_name["Utxo"] +_OUTPUTDETAIL = DESCRIPTOR.message_types_by_name["OutputDetail"] +_TRANSACTION = DESCRIPTOR.message_types_by_name["Transaction"] +_GETTRANSACTIONSREQUEST = DESCRIPTOR.message_types_by_name["GetTransactionsRequest"] +_TRANSACTIONDETAILS = DESCRIPTOR.message_types_by_name["TransactionDetails"] +_FEELIMIT = DESCRIPTOR.message_types_by_name["FeeLimit"] +_SENDREQUEST = DESCRIPTOR.message_types_by_name["SendRequest"] +_SENDREQUEST_DESTCUSTOMRECORDSENTRY = _SENDREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_SENDRESPONSE = DESCRIPTOR.message_types_by_name["SendResponse"] +_SENDTOROUTEREQUEST = DESCRIPTOR.message_types_by_name["SendToRouteRequest"] +_CHANNELACCEPTREQUEST = DESCRIPTOR.message_types_by_name["ChannelAcceptRequest"] +_CHANNELACCEPTRESPONSE = DESCRIPTOR.message_types_by_name["ChannelAcceptResponse"] +_CHANNELPOINT = DESCRIPTOR.message_types_by_name["ChannelPoint"] +_OUTPOINT = DESCRIPTOR.message_types_by_name["OutPoint"] +_PREVIOUSOUTPOINT = DESCRIPTOR.message_types_by_name["PreviousOutPoint"] +_LIGHTNINGADDRESS = DESCRIPTOR.message_types_by_name["LightningAddress"] +_ESTIMATEFEEREQUEST = DESCRIPTOR.message_types_by_name["EstimateFeeRequest"] +_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY = _ESTIMATEFEEREQUEST.nested_types_by_name[ + "AddrToAmountEntry" +] +_ESTIMATEFEERESPONSE = DESCRIPTOR.message_types_by_name["EstimateFeeResponse"] +_SENDMANYREQUEST = DESCRIPTOR.message_types_by_name["SendManyRequest"] +_SENDMANYREQUEST_ADDRTOAMOUNTENTRY = _SENDMANYREQUEST.nested_types_by_name[ + "AddrToAmountEntry" +] +_SENDMANYRESPONSE = DESCRIPTOR.message_types_by_name["SendManyResponse"] +_SENDCOINSREQUEST = DESCRIPTOR.message_types_by_name["SendCoinsRequest"] +_SENDCOINSRESPONSE = DESCRIPTOR.message_types_by_name["SendCoinsResponse"] +_LISTUNSPENTREQUEST = DESCRIPTOR.message_types_by_name["ListUnspentRequest"] +_LISTUNSPENTRESPONSE = DESCRIPTOR.message_types_by_name["ListUnspentResponse"] +_NEWADDRESSREQUEST = DESCRIPTOR.message_types_by_name["NewAddressRequest"] +_NEWADDRESSRESPONSE = DESCRIPTOR.message_types_by_name["NewAddressResponse"] +_SIGNMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["SignMessageRequest"] +_SIGNMESSAGERESPONSE = DESCRIPTOR.message_types_by_name["SignMessageResponse"] +_VERIFYMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["VerifyMessageRequest"] +_VERIFYMESSAGERESPONSE = DESCRIPTOR.message_types_by_name["VerifyMessageResponse"] +_CONNECTPEERREQUEST = DESCRIPTOR.message_types_by_name["ConnectPeerRequest"] +_CONNECTPEERRESPONSE = DESCRIPTOR.message_types_by_name["ConnectPeerResponse"] +_DISCONNECTPEERREQUEST = DESCRIPTOR.message_types_by_name["DisconnectPeerRequest"] +_DISCONNECTPEERRESPONSE = DESCRIPTOR.message_types_by_name["DisconnectPeerResponse"] +_HTLC = DESCRIPTOR.message_types_by_name["HTLC"] +_CHANNELCONSTRAINTS = DESCRIPTOR.message_types_by_name["ChannelConstraints"] +_CHANNEL = DESCRIPTOR.message_types_by_name["Channel"] +_LISTCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["ListChannelsRequest"] +_LISTCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["ListChannelsResponse"] +_CHANNELCLOSESUMMARY = DESCRIPTOR.message_types_by_name["ChannelCloseSummary"] +_RESOLUTION = DESCRIPTOR.message_types_by_name["Resolution"] +_CLOSEDCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["ClosedChannelsRequest"] +_CLOSEDCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["ClosedChannelsResponse"] +_PEER = DESCRIPTOR.message_types_by_name["Peer"] +_PEER_FEATURESENTRY = _PEER.nested_types_by_name["FeaturesEntry"] +_TIMESTAMPEDERROR = DESCRIPTOR.message_types_by_name["TimestampedError"] +_LISTPEERSREQUEST = DESCRIPTOR.message_types_by_name["ListPeersRequest"] +_LISTPEERSRESPONSE = DESCRIPTOR.message_types_by_name["ListPeersResponse"] +_PEEREVENTSUBSCRIPTION = DESCRIPTOR.message_types_by_name["PeerEventSubscription"] +_PEEREVENT = DESCRIPTOR.message_types_by_name["PeerEvent"] +_GETINFOREQUEST = DESCRIPTOR.message_types_by_name["GetInfoRequest"] +_GETINFORESPONSE = DESCRIPTOR.message_types_by_name["GetInfoResponse"] +_GETINFORESPONSE_FEATURESENTRY = _GETINFORESPONSE.nested_types_by_name["FeaturesEntry"] +_GETRECOVERYINFOREQUEST = DESCRIPTOR.message_types_by_name["GetRecoveryInfoRequest"] +_GETRECOVERYINFORESPONSE = DESCRIPTOR.message_types_by_name["GetRecoveryInfoResponse"] +_CHAIN = DESCRIPTOR.message_types_by_name["Chain"] +_CONFIRMATIONUPDATE = DESCRIPTOR.message_types_by_name["ConfirmationUpdate"] +_CHANNELOPENUPDATE = DESCRIPTOR.message_types_by_name["ChannelOpenUpdate"] +_CHANNELCLOSEUPDATE = DESCRIPTOR.message_types_by_name["ChannelCloseUpdate"] +_CLOSECHANNELREQUEST = DESCRIPTOR.message_types_by_name["CloseChannelRequest"] +_CLOSESTATUSUPDATE = DESCRIPTOR.message_types_by_name["CloseStatusUpdate"] +_PENDINGUPDATE = DESCRIPTOR.message_types_by_name["PendingUpdate"] +_READYFORPSBTFUNDING = DESCRIPTOR.message_types_by_name["ReadyForPsbtFunding"] +_BATCHOPENCHANNELREQUEST = DESCRIPTOR.message_types_by_name["BatchOpenChannelRequest"] +_BATCHOPENCHANNEL = DESCRIPTOR.message_types_by_name["BatchOpenChannel"] +_BATCHOPENCHANNELRESPONSE = DESCRIPTOR.message_types_by_name["BatchOpenChannelResponse"] +_OPENCHANNELREQUEST = DESCRIPTOR.message_types_by_name["OpenChannelRequest"] +_OPENSTATUSUPDATE = DESCRIPTOR.message_types_by_name["OpenStatusUpdate"] +_KEYLOCATOR = DESCRIPTOR.message_types_by_name["KeyLocator"] +_KEYDESCRIPTOR = DESCRIPTOR.message_types_by_name["KeyDescriptor"] +_CHANPOINTSHIM = DESCRIPTOR.message_types_by_name["ChanPointShim"] +_PSBTSHIM = DESCRIPTOR.message_types_by_name["PsbtShim"] +_FUNDINGSHIM = DESCRIPTOR.message_types_by_name["FundingShim"] +_FUNDINGSHIMCANCEL = DESCRIPTOR.message_types_by_name["FundingShimCancel"] +_FUNDINGPSBTVERIFY = DESCRIPTOR.message_types_by_name["FundingPsbtVerify"] +_FUNDINGPSBTFINALIZE = DESCRIPTOR.message_types_by_name["FundingPsbtFinalize"] +_FUNDINGTRANSITIONMSG = DESCRIPTOR.message_types_by_name["FundingTransitionMsg"] +_FUNDINGSTATESTEPRESP = DESCRIPTOR.message_types_by_name["FundingStateStepResp"] +_PENDINGHTLC = DESCRIPTOR.message_types_by_name["PendingHTLC"] +_PENDINGCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["PendingChannelsRequest"] +_PENDINGCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["PendingChannelsResponse"] +_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "PendingChannel" +] +_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["PendingOpenChannel"] +) +_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["WaitingCloseChannel"] +) +_PENDINGCHANNELSRESPONSE_COMMITMENTS = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "Commitments" +] +_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "ClosedChannel" +] +_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["ForceClosedChannel"] +) +_CHANNELEVENTSUBSCRIPTION = DESCRIPTOR.message_types_by_name["ChannelEventSubscription"] +_CHANNELEVENTUPDATE = DESCRIPTOR.message_types_by_name["ChannelEventUpdate"] +_WALLETACCOUNTBALANCE = DESCRIPTOR.message_types_by_name["WalletAccountBalance"] +_WALLETBALANCEREQUEST = DESCRIPTOR.message_types_by_name["WalletBalanceRequest"] +_WALLETBALANCERESPONSE = DESCRIPTOR.message_types_by_name["WalletBalanceResponse"] +_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY = ( + _WALLETBALANCERESPONSE.nested_types_by_name["AccountBalanceEntry"] +) +_AMOUNT = DESCRIPTOR.message_types_by_name["Amount"] +_CHANNELBALANCEREQUEST = DESCRIPTOR.message_types_by_name["ChannelBalanceRequest"] +_CHANNELBALANCERESPONSE = DESCRIPTOR.message_types_by_name["ChannelBalanceResponse"] +_QUERYROUTESREQUEST = DESCRIPTOR.message_types_by_name["QueryRoutesRequest"] +_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY = _QUERYROUTESREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_NODEPAIR = DESCRIPTOR.message_types_by_name["NodePair"] +_EDGELOCATOR = DESCRIPTOR.message_types_by_name["EdgeLocator"] +_QUERYROUTESRESPONSE = DESCRIPTOR.message_types_by_name["QueryRoutesResponse"] +_HOP = DESCRIPTOR.message_types_by_name["Hop"] +_HOP_CUSTOMRECORDSENTRY = _HOP.nested_types_by_name["CustomRecordsEntry"] +_MPPRECORD = DESCRIPTOR.message_types_by_name["MPPRecord"] +_AMPRECORD = DESCRIPTOR.message_types_by_name["AMPRecord"] +_ROUTE = DESCRIPTOR.message_types_by_name["Route"] +_NODEINFOREQUEST = DESCRIPTOR.message_types_by_name["NodeInfoRequest"] +_NODEINFO = DESCRIPTOR.message_types_by_name["NodeInfo"] +_LIGHTNINGNODE = DESCRIPTOR.message_types_by_name["LightningNode"] +_LIGHTNINGNODE_FEATURESENTRY = _LIGHTNINGNODE.nested_types_by_name["FeaturesEntry"] +_NODEADDRESS = DESCRIPTOR.message_types_by_name["NodeAddress"] +_ROUTINGPOLICY = DESCRIPTOR.message_types_by_name["RoutingPolicy"] +_CHANNELEDGE = DESCRIPTOR.message_types_by_name["ChannelEdge"] +_CHANNELGRAPHREQUEST = DESCRIPTOR.message_types_by_name["ChannelGraphRequest"] +_CHANNELGRAPH = DESCRIPTOR.message_types_by_name["ChannelGraph"] +_NODEMETRICSREQUEST = DESCRIPTOR.message_types_by_name["NodeMetricsRequest"] +_NODEMETRICSRESPONSE = DESCRIPTOR.message_types_by_name["NodeMetricsResponse"] +_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY = ( + _NODEMETRICSRESPONSE.nested_types_by_name["BetweennessCentralityEntry"] +) +_FLOATMETRIC = DESCRIPTOR.message_types_by_name["FloatMetric"] +_CHANINFOREQUEST = DESCRIPTOR.message_types_by_name["ChanInfoRequest"] +_NETWORKINFOREQUEST = DESCRIPTOR.message_types_by_name["NetworkInfoRequest"] +_NETWORKINFO = DESCRIPTOR.message_types_by_name["NetworkInfo"] +_STOPREQUEST = DESCRIPTOR.message_types_by_name["StopRequest"] +_STOPRESPONSE = DESCRIPTOR.message_types_by_name["StopResponse"] +_GRAPHTOPOLOGYSUBSCRIPTION = DESCRIPTOR.message_types_by_name[ "GraphTopologySubscription" -] = _GRAPHTOPOLOGYSUBSCRIPTION -DESCRIPTOR.message_types_by_name["GraphTopologyUpdate"] = _GRAPHTOPOLOGYUPDATE -DESCRIPTOR.message_types_by_name["NodeUpdate"] = _NODEUPDATE -DESCRIPTOR.message_types_by_name["ChannelEdgeUpdate"] = _CHANNELEDGEUPDATE -DESCRIPTOR.message_types_by_name["ClosedChannelUpdate"] = _CLOSEDCHANNELUPDATE -DESCRIPTOR.message_types_by_name["HopHint"] = _HOPHINT -DESCRIPTOR.message_types_by_name["SetID"] = _SETID -DESCRIPTOR.message_types_by_name["RouteHint"] = _ROUTEHINT -DESCRIPTOR.message_types_by_name["AMPInvoiceState"] = _AMPINVOICESTATE -DESCRIPTOR.message_types_by_name["Invoice"] = _INVOICE -DESCRIPTOR.message_types_by_name["InvoiceHTLC"] = _INVOICEHTLC -DESCRIPTOR.message_types_by_name["AMP"] = _AMP -DESCRIPTOR.message_types_by_name["AddInvoiceResponse"] = _ADDINVOICERESPONSE -DESCRIPTOR.message_types_by_name["PaymentHash"] = _PAYMENTHASH -DESCRIPTOR.message_types_by_name["ListInvoiceRequest"] = _LISTINVOICEREQUEST -DESCRIPTOR.message_types_by_name["ListInvoiceResponse"] = _LISTINVOICERESPONSE -DESCRIPTOR.message_types_by_name["InvoiceSubscription"] = _INVOICESUBSCRIPTION -DESCRIPTOR.message_types_by_name["Payment"] = _PAYMENT -DESCRIPTOR.message_types_by_name["HTLCAttempt"] = _HTLCATTEMPT -DESCRIPTOR.message_types_by_name["ListPaymentsRequest"] = _LISTPAYMENTSREQUEST -DESCRIPTOR.message_types_by_name["ListPaymentsResponse"] = _LISTPAYMENTSRESPONSE -DESCRIPTOR.message_types_by_name["DeletePaymentRequest"] = _DELETEPAYMENTREQUEST -DESCRIPTOR.message_types_by_name["DeleteAllPaymentsRequest"] = _DELETEALLPAYMENTSREQUEST -DESCRIPTOR.message_types_by_name["DeletePaymentResponse"] = _DELETEPAYMENTRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_GRAPHTOPOLOGYUPDATE = DESCRIPTOR.message_types_by_name["GraphTopologyUpdate"] +_NODEUPDATE = DESCRIPTOR.message_types_by_name["NodeUpdate"] +_NODEUPDATE_FEATURESENTRY = _NODEUPDATE.nested_types_by_name["FeaturesEntry"] +_CHANNELEDGEUPDATE = DESCRIPTOR.message_types_by_name["ChannelEdgeUpdate"] +_CLOSEDCHANNELUPDATE = DESCRIPTOR.message_types_by_name["ClosedChannelUpdate"] +_HOPHINT = DESCRIPTOR.message_types_by_name["HopHint"] +_SETID = DESCRIPTOR.message_types_by_name["SetID"] +_ROUTEHINT = DESCRIPTOR.message_types_by_name["RouteHint"] +_AMPINVOICESTATE = DESCRIPTOR.message_types_by_name["AMPInvoiceState"] +_INVOICE = DESCRIPTOR.message_types_by_name["Invoice"] +_INVOICE_FEATURESENTRY = _INVOICE.nested_types_by_name["FeaturesEntry"] +_INVOICE_AMPINVOICESTATEENTRY = _INVOICE.nested_types_by_name["AmpInvoiceStateEntry"] +_INVOICEHTLC = DESCRIPTOR.message_types_by_name["InvoiceHTLC"] +_INVOICEHTLC_CUSTOMRECORDSENTRY = _INVOICEHTLC.nested_types_by_name[ + "CustomRecordsEntry" +] +_AMP = DESCRIPTOR.message_types_by_name["AMP"] +_ADDINVOICERESPONSE = DESCRIPTOR.message_types_by_name["AddInvoiceResponse"] +_PAYMENTHASH = DESCRIPTOR.message_types_by_name["PaymentHash"] +_LISTINVOICEREQUEST = DESCRIPTOR.message_types_by_name["ListInvoiceRequest"] +_LISTINVOICERESPONSE = DESCRIPTOR.message_types_by_name["ListInvoiceResponse"] +_INVOICESUBSCRIPTION = DESCRIPTOR.message_types_by_name["InvoiceSubscription"] +_PAYMENT = DESCRIPTOR.message_types_by_name["Payment"] +_HTLCATTEMPT = DESCRIPTOR.message_types_by_name["HTLCAttempt"] +_LISTPAYMENTSREQUEST = DESCRIPTOR.message_types_by_name["ListPaymentsRequest"] +_LISTPAYMENTSRESPONSE = DESCRIPTOR.message_types_by_name["ListPaymentsResponse"] +_DELETEPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["DeletePaymentRequest"] +_DELETEALLPAYMENTSREQUEST = DESCRIPTOR.message_types_by_name["DeleteAllPaymentsRequest"] +_DELETEPAYMENTRESPONSE = DESCRIPTOR.message_types_by_name["DeletePaymentResponse"] +_DELETEALLPAYMENTSRESPONSE = DESCRIPTOR.message_types_by_name[ "DeleteAllPaymentsResponse" -] = _DELETEALLPAYMENTSRESPONSE -DESCRIPTOR.message_types_by_name["AbandonChannelRequest"] = _ABANDONCHANNELREQUEST -DESCRIPTOR.message_types_by_name["AbandonChannelResponse"] = _ABANDONCHANNELRESPONSE -DESCRIPTOR.message_types_by_name["DebugLevelRequest"] = _DEBUGLEVELREQUEST -DESCRIPTOR.message_types_by_name["DebugLevelResponse"] = _DEBUGLEVELRESPONSE -DESCRIPTOR.message_types_by_name["PayReqString"] = _PAYREQSTRING -DESCRIPTOR.message_types_by_name["PayReq"] = _PAYREQ -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["FeeReportRequest"] = _FEEREPORTREQUEST -DESCRIPTOR.message_types_by_name["ChannelFeeReport"] = _CHANNELFEEREPORT -DESCRIPTOR.message_types_by_name["FeeReportResponse"] = _FEEREPORTRESPONSE -DESCRIPTOR.message_types_by_name["PolicyUpdateRequest"] = _POLICYUPDATEREQUEST -DESCRIPTOR.message_types_by_name["FailedUpdate"] = _FAILEDUPDATE -DESCRIPTOR.message_types_by_name["PolicyUpdateResponse"] = _POLICYUPDATERESPONSE -DESCRIPTOR.message_types_by_name["ForwardingHistoryRequest"] = _FORWARDINGHISTORYREQUEST -DESCRIPTOR.message_types_by_name["ForwardingEvent"] = _FORWARDINGEVENT -DESCRIPTOR.message_types_by_name[ +] +_ABANDONCHANNELREQUEST = DESCRIPTOR.message_types_by_name["AbandonChannelRequest"] +_ABANDONCHANNELRESPONSE = DESCRIPTOR.message_types_by_name["AbandonChannelResponse"] +_DEBUGLEVELREQUEST = DESCRIPTOR.message_types_by_name["DebugLevelRequest"] +_DEBUGLEVELRESPONSE = DESCRIPTOR.message_types_by_name["DebugLevelResponse"] +_PAYREQSTRING = DESCRIPTOR.message_types_by_name["PayReqString"] +_PAYREQ = DESCRIPTOR.message_types_by_name["PayReq"] +_PAYREQ_FEATURESENTRY = _PAYREQ.nested_types_by_name["FeaturesEntry"] +_FEATURE = DESCRIPTOR.message_types_by_name["Feature"] +_FEEREPORTREQUEST = DESCRIPTOR.message_types_by_name["FeeReportRequest"] +_CHANNELFEEREPORT = DESCRIPTOR.message_types_by_name["ChannelFeeReport"] +_FEEREPORTRESPONSE = DESCRIPTOR.message_types_by_name["FeeReportResponse"] +_POLICYUPDATEREQUEST = DESCRIPTOR.message_types_by_name["PolicyUpdateRequest"] +_FAILEDUPDATE = DESCRIPTOR.message_types_by_name["FailedUpdate"] +_POLICYUPDATERESPONSE = DESCRIPTOR.message_types_by_name["PolicyUpdateResponse"] +_FORWARDINGHISTORYREQUEST = DESCRIPTOR.message_types_by_name["ForwardingHistoryRequest"] +_FORWARDINGEVENT = DESCRIPTOR.message_types_by_name["ForwardingEvent"] +_FORWARDINGHISTORYRESPONSE = DESCRIPTOR.message_types_by_name[ "ForwardingHistoryResponse" -] = _FORWARDINGHISTORYRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_EXPORTCHANNELBACKUPREQUEST = DESCRIPTOR.message_types_by_name[ "ExportChannelBackupRequest" -] = _EXPORTCHANNELBACKUPREQUEST -DESCRIPTOR.message_types_by_name["ChannelBackup"] = _CHANNELBACKUP -DESCRIPTOR.message_types_by_name["MultiChanBackup"] = _MULTICHANBACKUP -DESCRIPTOR.message_types_by_name["ChanBackupExportRequest"] = _CHANBACKUPEXPORTREQUEST -DESCRIPTOR.message_types_by_name["ChanBackupSnapshot"] = _CHANBACKUPSNAPSHOT -DESCRIPTOR.message_types_by_name["ChannelBackups"] = _CHANNELBACKUPS -DESCRIPTOR.message_types_by_name["RestoreChanBackupRequest"] = _RESTORECHANBACKUPREQUEST -DESCRIPTOR.message_types_by_name["RestoreBackupResponse"] = _RESTOREBACKUPRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_CHANNELBACKUP = DESCRIPTOR.message_types_by_name["ChannelBackup"] +_MULTICHANBACKUP = DESCRIPTOR.message_types_by_name["MultiChanBackup"] +_CHANBACKUPEXPORTREQUEST = DESCRIPTOR.message_types_by_name["ChanBackupExportRequest"] +_CHANBACKUPSNAPSHOT = DESCRIPTOR.message_types_by_name["ChanBackupSnapshot"] +_CHANNELBACKUPS = DESCRIPTOR.message_types_by_name["ChannelBackups"] +_RESTORECHANBACKUPREQUEST = DESCRIPTOR.message_types_by_name["RestoreChanBackupRequest"] +_RESTOREBACKUPRESPONSE = DESCRIPTOR.message_types_by_name["RestoreBackupResponse"] +_CHANNELBACKUPSUBSCRIPTION = DESCRIPTOR.message_types_by_name[ "ChannelBackupSubscription" -] = _CHANNELBACKUPSUBSCRIPTION -DESCRIPTOR.message_types_by_name["VerifyChanBackupResponse"] = _VERIFYCHANBACKUPRESPONSE -DESCRIPTOR.message_types_by_name["MacaroonPermission"] = _MACAROONPERMISSION -DESCRIPTOR.message_types_by_name["BakeMacaroonRequest"] = _BAKEMACAROONREQUEST -DESCRIPTOR.message_types_by_name["BakeMacaroonResponse"] = _BAKEMACAROONRESPONSE -DESCRIPTOR.message_types_by_name["ListMacaroonIDsRequest"] = _LISTMACAROONIDSREQUEST -DESCRIPTOR.message_types_by_name["ListMacaroonIDsResponse"] = _LISTMACAROONIDSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteMacaroonIDRequest"] = _DELETEMACAROONIDREQUEST -DESCRIPTOR.message_types_by_name["DeleteMacaroonIDResponse"] = _DELETEMACAROONIDRESPONSE -DESCRIPTOR.message_types_by_name["MacaroonPermissionList"] = _MACAROONPERMISSIONLIST -DESCRIPTOR.message_types_by_name["ListPermissionsRequest"] = _LISTPERMISSIONSREQUEST -DESCRIPTOR.message_types_by_name["ListPermissionsResponse"] = _LISTPERMISSIONSRESPONSE -DESCRIPTOR.message_types_by_name["Failure"] = _FAILURE -DESCRIPTOR.message_types_by_name["ChannelUpdate"] = _CHANNELUPDATE -DESCRIPTOR.message_types_by_name["MacaroonId"] = _MACAROONID -DESCRIPTOR.message_types_by_name["Op"] = _OP -DESCRIPTOR.message_types_by_name["CheckMacPermRequest"] = _CHECKMACPERMREQUEST -DESCRIPTOR.message_types_by_name["CheckMacPermResponse"] = _CHECKMACPERMRESPONSE -DESCRIPTOR.message_types_by_name["RPCMiddlewareRequest"] = _RPCMIDDLEWAREREQUEST -DESCRIPTOR.message_types_by_name["StreamAuth"] = _STREAMAUTH -DESCRIPTOR.message_types_by_name["RPCMessage"] = _RPCMESSAGE -DESCRIPTOR.message_types_by_name["RPCMiddlewareResponse"] = _RPCMIDDLEWARERESPONSE -DESCRIPTOR.message_types_by_name["MiddlewareRegistration"] = _MIDDLEWAREREGISTRATION -DESCRIPTOR.message_types_by_name["InterceptFeedback"] = _INTERCEPTFEEDBACK -DESCRIPTOR.enum_types_by_name["AddressType"] = _ADDRESSTYPE -DESCRIPTOR.enum_types_by_name["CommitmentType"] = _COMMITMENTTYPE -DESCRIPTOR.enum_types_by_name["Initiator"] = _INITIATOR -DESCRIPTOR.enum_types_by_name["ResolutionType"] = _RESOLUTIONTYPE -DESCRIPTOR.enum_types_by_name["ResolutionOutcome"] = _RESOLUTIONOUTCOME -DESCRIPTOR.enum_types_by_name["NodeMetricType"] = _NODEMETRICTYPE -DESCRIPTOR.enum_types_by_name["InvoiceHTLCState"] = _INVOICEHTLCSTATE -DESCRIPTOR.enum_types_by_name["PaymentFailureReason"] = _PAYMENTFAILUREREASON -DESCRIPTOR.enum_types_by_name["FeatureBit"] = _FEATUREBIT -DESCRIPTOR.enum_types_by_name["UpdateFailure"] = _UPDATEFAILURE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +] +_VERIFYCHANBACKUPRESPONSE = DESCRIPTOR.message_types_by_name["VerifyChanBackupResponse"] +_MACAROONPERMISSION = DESCRIPTOR.message_types_by_name["MacaroonPermission"] +_BAKEMACAROONREQUEST = DESCRIPTOR.message_types_by_name["BakeMacaroonRequest"] +_BAKEMACAROONRESPONSE = DESCRIPTOR.message_types_by_name["BakeMacaroonResponse"] +_LISTMACAROONIDSREQUEST = DESCRIPTOR.message_types_by_name["ListMacaroonIDsRequest"] +_LISTMACAROONIDSRESPONSE = DESCRIPTOR.message_types_by_name["ListMacaroonIDsResponse"] +_DELETEMACAROONIDREQUEST = DESCRIPTOR.message_types_by_name["DeleteMacaroonIDRequest"] +_DELETEMACAROONIDRESPONSE = DESCRIPTOR.message_types_by_name["DeleteMacaroonIDResponse"] +_MACAROONPERMISSIONLIST = DESCRIPTOR.message_types_by_name["MacaroonPermissionList"] +_LISTPERMISSIONSREQUEST = DESCRIPTOR.message_types_by_name["ListPermissionsRequest"] +_LISTPERMISSIONSRESPONSE = DESCRIPTOR.message_types_by_name["ListPermissionsResponse"] +_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY = ( + _LISTPERMISSIONSRESPONSE.nested_types_by_name["MethodPermissionsEntry"] +) +_FAILURE = DESCRIPTOR.message_types_by_name["Failure"] +_CHANNELUPDATE = DESCRIPTOR.message_types_by_name["ChannelUpdate"] +_MACAROONID = DESCRIPTOR.message_types_by_name["MacaroonId"] +_OP = DESCRIPTOR.message_types_by_name["Op"] +_CHECKMACPERMREQUEST = DESCRIPTOR.message_types_by_name["CheckMacPermRequest"] +_CHECKMACPERMRESPONSE = DESCRIPTOR.message_types_by_name["CheckMacPermResponse"] +_RPCMIDDLEWAREREQUEST = DESCRIPTOR.message_types_by_name["RPCMiddlewareRequest"] +_STREAMAUTH = DESCRIPTOR.message_types_by_name["StreamAuth"] +_RPCMESSAGE = DESCRIPTOR.message_types_by_name["RPCMessage"] +_RPCMIDDLEWARERESPONSE = DESCRIPTOR.message_types_by_name["RPCMiddlewareResponse"] +_MIDDLEWAREREGISTRATION = DESCRIPTOR.message_types_by_name["MiddlewareRegistration"] +_INTERCEPTFEEDBACK = DESCRIPTOR.message_types_by_name["InterceptFeedback"] +_CHANNELCLOSESUMMARY_CLOSURETYPE = _CHANNELCLOSESUMMARY.enum_types_by_name[ + "ClosureType" +] +_PEER_SYNCTYPE = _PEER.enum_types_by_name["SyncType"] +_PEEREVENT_EVENTTYPE = _PEEREVENT.enum_types_by_name["EventType"] +_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE = ( + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.enum_types_by_name["AnchorState"] +) +_CHANNELEVENTUPDATE_UPDATETYPE = _CHANNELEVENTUPDATE.enum_types_by_name["UpdateType"] +_INVOICE_INVOICESTATE = _INVOICE.enum_types_by_name["InvoiceState"] +_PAYMENT_PAYMENTSTATUS = _PAYMENT.enum_types_by_name["PaymentStatus"] +_HTLCATTEMPT_HTLCSTATUS = _HTLCATTEMPT.enum_types_by_name["HTLCStatus"] +_FAILURE_FAILURECODE = _FAILURE.enum_types_by_name["FailureCode"] SubscribeCustomMessagesRequest = _reflection.GeneratedProtocolMessageType( "SubscribeCustomMessagesRequest", (_message.Message,), @@ -21376,6 +437,17 @@ Utxo = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(Utxo) +OutputDetail = _reflection.GeneratedProtocolMessageType( + "OutputDetail", + (_message.Message,), + { + "DESCRIPTOR": _OUTPUTDETAIL, + "__module__": "lightning_pb2" + # @@protoc_insertion_point(class_scope:lnrpc.OutputDetail) + }, +) +_sym_db.RegisterMessage(OutputDetail) + Transaction = _reflection.GeneratedProtocolMessageType( "Transaction", (_message.Message,), @@ -21507,6 +579,17 @@ OutPoint = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(OutPoint) +PreviousOutPoint = _reflection.GeneratedProtocolMessageType( + "PreviousOutPoint", + (_message.Message,), + { + "DESCRIPTOR": _PREVIOUSOUTPOINT, + "__module__": "lightning_pb2" + # @@protoc_insertion_point(class_scope:lnrpc.PreviousOutPoint) + }, +) +_sym_db.RegisterMessage(PreviousOutPoint) + LightningAddress = _reflection.GeneratedProtocolMessageType( "LightningAddress", (_message.Message,), @@ -23576,738 +2659,623 @@ InterceptFeedback = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(InterceptFeedback) +_LIGHTNING = DESCRIPTOR.services_by_name["Lightning"] +if _descriptor._USE_C_DESCRIPTORS == False: -DESCRIPTOR._options = None -_SENDREQUEST_DESTCUSTOMRECORDSENTRY._options = None -_SENDREQUEST.fields_by_name["dest_string"]._options = None -_SENDREQUEST.fields_by_name["payment_hash_string"]._options = None -_SENDREQUEST.fields_by_name["outgoing_chan_id"]._options = None -_SENDTOROUTEREQUEST.fields_by_name["payment_hash_string"]._options = None -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._options = None -_ESTIMATEFEERESPONSE.fields_by_name["feerate_sat_per_byte"]._options = None -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY._options = None -_SENDMANYREQUEST.fields_by_name["sat_per_byte"]._options = None -_SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._options = None -_CHANNEL.fields_by_name["chan_id"]._options = None -_CHANNEL.fields_by_name["csv_delay"]._options = None -_CHANNEL.fields_by_name["local_chan_reserve_sat"]._options = None -_CHANNEL.fields_by_name["remote_chan_reserve_sat"]._options = None -_CHANNEL.fields_by_name["static_remote_key"]._options = None -_CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._options = None -_PEER_FEATURESENTRY._options = None -_GETINFORESPONSE_FEATURESENTRY._options = None -_GETINFORESPONSE.fields_by_name["testnet"]._options = None -_CLOSECHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None -_OPENCHANNELREQUEST.fields_by_name["node_pubkey_string"]._options = None -_OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None -_PENDINGCHANNELSRESPONSE.fields_by_name["pending_closing_channels"]._options = None -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._options = None -_CHANNELBALANCERESPONSE.fields_by_name["balance"]._options = None -_CHANNELBALANCERESPONSE.fields_by_name["pending_open_balance"]._options = None -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._options = None -_QUERYROUTESREQUEST.fields_by_name["ignored_edges"]._options = None -_QUERYROUTESREQUEST.fields_by_name["outgoing_chan_id"]._options = None -_EDGELOCATOR.fields_by_name["channel_id"]._options = None -_HOP_CUSTOMRECORDSENTRY._options = None -_HOP.fields_by_name["chan_id"]._options = None -_HOP.fields_by_name["chan_capacity"]._options = None -_HOP.fields_by_name["amt_to_forward"]._options = None -_HOP.fields_by_name["fee"]._options = None -_ROUTE.fields_by_name["total_fees"]._options = None -_ROUTE.fields_by_name["total_amt"]._options = None -_LIGHTNINGNODE_FEATURESENTRY._options = None -_CHANNELEDGE.fields_by_name["channel_id"]._options = None -_CHANNELEDGE.fields_by_name["last_update"]._options = None -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._options = None -_CHANINFOREQUEST.fields_by_name["chan_id"]._options = None -_NODEUPDATE_FEATURESENTRY._options = None -_NODEUPDATE.fields_by_name["addresses"]._options = None -_NODEUPDATE.fields_by_name["global_features"]._options = None -_CHANNELEDGEUPDATE.fields_by_name["chan_id"]._options = None -_CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._options = None -_HOPHINT.fields_by_name["chan_id"]._options = None -_INVOICE_FEATURESENTRY._options = None -_INVOICE_AMPINVOICESTATEENTRY._options = None -_INVOICE.fields_by_name["settled"]._options = None -_INVOICE.fields_by_name["amt_paid"]._options = None -_INVOICEHTLC_CUSTOMRECORDSENTRY._options = None -_INVOICEHTLC.fields_by_name["chan_id"]._options = None -_PAYMENTHASH.fields_by_name["r_hash_str"]._options = None -_PAYMENT.fields_by_name["value"]._options = None -_PAYMENT.fields_by_name["creation_date"]._options = None -_PAYMENT.fields_by_name["fee"]._options = None -_PAYREQ_FEATURESENTRY._options = None -_CHANNELFEEREPORT.fields_by_name["chan_id"]._options = None -_FORWARDINGEVENT.fields_by_name["timestamp"]._options = None -_FORWARDINGEVENT.fields_by_name["chan_id_in"]._options = None -_FORWARDINGEVENT.fields_by_name["chan_id_out"]._options = None -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._options = None -_CHANNELUPDATE.fields_by_name["chan_id"]._options = None - -_LIGHTNING = _descriptor.ServiceDescriptor( - name="Lightning", - full_name="lnrpc.Lightning", - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=28310, - serialized_end=33119, - methods=[ - _descriptor.MethodDescriptor( - name="WalletBalance", - full_name="lnrpc.Lightning.WalletBalance", - index=0, - containing_service=None, - input_type=_WALLETBALANCEREQUEST, - output_type=_WALLETBALANCERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ChannelBalance", - full_name="lnrpc.Lightning.ChannelBalance", - index=1, - containing_service=None, - input_type=_CHANNELBALANCEREQUEST, - output_type=_CHANNELBALANCERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetTransactions", - full_name="lnrpc.Lightning.GetTransactions", - index=2, - containing_service=None, - input_type=_GETTRANSACTIONSREQUEST, - output_type=_TRANSACTIONDETAILS, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="EstimateFee", - full_name="lnrpc.Lightning.EstimateFee", - index=3, - containing_service=None, - input_type=_ESTIMATEFEEREQUEST, - output_type=_ESTIMATEFEERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendCoins", - full_name="lnrpc.Lightning.SendCoins", - index=4, - containing_service=None, - input_type=_SENDCOINSREQUEST, - output_type=_SENDCOINSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListUnspent", - full_name="lnrpc.Lightning.ListUnspent", - index=5, - containing_service=None, - input_type=_LISTUNSPENTREQUEST, - output_type=_LISTUNSPENTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeTransactions", - full_name="lnrpc.Lightning.SubscribeTransactions", - index=6, - containing_service=None, - input_type=_GETTRANSACTIONSREQUEST, - output_type=_TRANSACTION, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendMany", - full_name="lnrpc.Lightning.SendMany", - index=7, - containing_service=None, - input_type=_SENDMANYREQUEST, - output_type=_SENDMANYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="NewAddress", - full_name="lnrpc.Lightning.NewAddress", - index=8, - containing_service=None, - input_type=_NEWADDRESSREQUEST, - output_type=_NEWADDRESSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SignMessage", - full_name="lnrpc.Lightning.SignMessage", - index=9, - containing_service=None, - input_type=_SIGNMESSAGEREQUEST, - output_type=_SIGNMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="VerifyMessage", - full_name="lnrpc.Lightning.VerifyMessage", - index=10, - containing_service=None, - input_type=_VERIFYMESSAGEREQUEST, - output_type=_VERIFYMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ConnectPeer", - full_name="lnrpc.Lightning.ConnectPeer", - index=11, - containing_service=None, - input_type=_CONNECTPEERREQUEST, - output_type=_CONNECTPEERRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DisconnectPeer", - full_name="lnrpc.Lightning.DisconnectPeer", - index=12, - containing_service=None, - input_type=_DISCONNECTPEERREQUEST, - output_type=_DISCONNECTPEERRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPeers", - full_name="lnrpc.Lightning.ListPeers", - index=13, - containing_service=None, - input_type=_LISTPEERSREQUEST, - output_type=_LISTPEERSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribePeerEvents", - full_name="lnrpc.Lightning.SubscribePeerEvents", - index=14, - containing_service=None, - input_type=_PEEREVENTSUBSCRIPTION, - output_type=_PEEREVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetInfo", - full_name="lnrpc.Lightning.GetInfo", - index=15, - containing_service=None, - input_type=_GETINFOREQUEST, - output_type=_GETINFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetRecoveryInfo", - full_name="lnrpc.Lightning.GetRecoveryInfo", - index=16, - containing_service=None, - input_type=_GETRECOVERYINFOREQUEST, - output_type=_GETRECOVERYINFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="PendingChannels", - full_name="lnrpc.Lightning.PendingChannels", - index=17, - containing_service=None, - input_type=_PENDINGCHANNELSREQUEST, - output_type=_PENDINGCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListChannels", - full_name="lnrpc.Lightning.ListChannels", - index=18, - containing_service=None, - input_type=_LISTCHANNELSREQUEST, - output_type=_LISTCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelEvents", - full_name="lnrpc.Lightning.SubscribeChannelEvents", - index=19, - containing_service=None, - input_type=_CHANNELEVENTSUBSCRIPTION, - output_type=_CHANNELEVENTUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ClosedChannels", - full_name="lnrpc.Lightning.ClosedChannels", - index=20, - containing_service=None, - input_type=_CLOSEDCHANNELSREQUEST, - output_type=_CLOSEDCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="OpenChannelSync", - full_name="lnrpc.Lightning.OpenChannelSync", - index=21, - containing_service=None, - input_type=_OPENCHANNELREQUEST, - output_type=_CHANNELPOINT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="OpenChannel", - full_name="lnrpc.Lightning.OpenChannel", - index=22, - containing_service=None, - input_type=_OPENCHANNELREQUEST, - output_type=_OPENSTATUSUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="BatchOpenChannel", - full_name="lnrpc.Lightning.BatchOpenChannel", - index=23, - containing_service=None, - input_type=_BATCHOPENCHANNELREQUEST, - output_type=_BATCHOPENCHANNELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="FundingStateStep", - full_name="lnrpc.Lightning.FundingStateStep", - index=24, - containing_service=None, - input_type=_FUNDINGTRANSITIONMSG, - output_type=_FUNDINGSTATESTEPRESP, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ChannelAcceptor", - full_name="lnrpc.Lightning.ChannelAcceptor", - index=25, - containing_service=None, - input_type=_CHANNELACCEPTRESPONSE, - output_type=_CHANNELACCEPTREQUEST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="CloseChannel", - full_name="lnrpc.Lightning.CloseChannel", - index=26, - containing_service=None, - input_type=_CLOSECHANNELREQUEST, - output_type=_CLOSESTATUSUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="AbandonChannel", - full_name="lnrpc.Lightning.AbandonChannel", - index=27, - containing_service=None, - input_type=_ABANDONCHANNELREQUEST, - output_type=_ABANDONCHANNELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendPayment", - full_name="lnrpc.Lightning.SendPayment", - index=28, - containing_service=None, - input_type=_SENDREQUEST, - output_type=_SENDRESPONSE, - serialized_options=b"\210\002\001", - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendPaymentSync", - full_name="lnrpc.Lightning.SendPaymentSync", - index=29, - containing_service=None, - input_type=_SENDREQUEST, - output_type=_SENDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendToRoute", - full_name="lnrpc.Lightning.SendToRoute", - index=30, - containing_service=None, - input_type=_SENDTOROUTEREQUEST, - output_type=_SENDRESPONSE, - serialized_options=b"\210\002\001", - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendToRouteSync", - full_name="lnrpc.Lightning.SendToRouteSync", - index=31, - containing_service=None, - input_type=_SENDTOROUTEREQUEST, - output_type=_SENDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="AddInvoice", - full_name="lnrpc.Lightning.AddInvoice", - index=32, - containing_service=None, - input_type=_INVOICE, - output_type=_ADDINVOICERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListInvoices", - full_name="lnrpc.Lightning.ListInvoices", - index=33, - containing_service=None, - input_type=_LISTINVOICEREQUEST, - output_type=_LISTINVOICERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="LookupInvoice", - full_name="lnrpc.Lightning.LookupInvoice", - index=34, - containing_service=None, - input_type=_PAYMENTHASH, - output_type=_INVOICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeInvoices", - full_name="lnrpc.Lightning.SubscribeInvoices", - index=35, - containing_service=None, - input_type=_INVOICESUBSCRIPTION, - output_type=_INVOICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DecodePayReq", - full_name="lnrpc.Lightning.DecodePayReq", - index=36, - containing_service=None, - input_type=_PAYREQSTRING, - output_type=_PAYREQ, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPayments", - full_name="lnrpc.Lightning.ListPayments", - index=37, - containing_service=None, - input_type=_LISTPAYMENTSREQUEST, - output_type=_LISTPAYMENTSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeletePayment", - full_name="lnrpc.Lightning.DeletePayment", - index=38, - containing_service=None, - input_type=_DELETEPAYMENTREQUEST, - output_type=_DELETEPAYMENTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeleteAllPayments", - full_name="lnrpc.Lightning.DeleteAllPayments", - index=39, - containing_service=None, - input_type=_DELETEALLPAYMENTSREQUEST, - output_type=_DELETEALLPAYMENTSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DescribeGraph", - full_name="lnrpc.Lightning.DescribeGraph", - index=40, - containing_service=None, - input_type=_CHANNELGRAPHREQUEST, - output_type=_CHANNELGRAPH, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNodeMetrics", - full_name="lnrpc.Lightning.GetNodeMetrics", - index=41, - containing_service=None, - input_type=_NODEMETRICSREQUEST, - output_type=_NODEMETRICSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetChanInfo", - full_name="lnrpc.Lightning.GetChanInfo", - index=42, - containing_service=None, - input_type=_CHANINFOREQUEST, - output_type=_CHANNELEDGE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNodeInfo", - full_name="lnrpc.Lightning.GetNodeInfo", - index=43, - containing_service=None, - input_type=_NODEINFOREQUEST, - output_type=_NODEINFO, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="QueryRoutes", - full_name="lnrpc.Lightning.QueryRoutes", - index=44, - containing_service=None, - input_type=_QUERYROUTESREQUEST, - output_type=_QUERYROUTESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNetworkInfo", - full_name="lnrpc.Lightning.GetNetworkInfo", - index=45, - containing_service=None, - input_type=_NETWORKINFOREQUEST, - output_type=_NETWORKINFO, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="StopDaemon", - full_name="lnrpc.Lightning.StopDaemon", - index=46, - containing_service=None, - input_type=_STOPREQUEST, - output_type=_STOPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelGraph", - full_name="lnrpc.Lightning.SubscribeChannelGraph", - index=47, - containing_service=None, - input_type=_GRAPHTOPOLOGYSUBSCRIPTION, - output_type=_GRAPHTOPOLOGYUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DebugLevel", - full_name="lnrpc.Lightning.DebugLevel", - index=48, - containing_service=None, - input_type=_DEBUGLEVELREQUEST, - output_type=_DEBUGLEVELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="FeeReport", - full_name="lnrpc.Lightning.FeeReport", - index=49, - containing_service=None, - input_type=_FEEREPORTREQUEST, - output_type=_FEEREPORTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="UpdateChannelPolicy", - full_name="lnrpc.Lightning.UpdateChannelPolicy", - index=50, - containing_service=None, - input_type=_POLICYUPDATEREQUEST, - output_type=_POLICYUPDATERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ForwardingHistory", - full_name="lnrpc.Lightning.ForwardingHistory", - index=51, - containing_service=None, - input_type=_FORWARDINGHISTORYREQUEST, - output_type=_FORWARDINGHISTORYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ExportChannelBackup", - full_name="lnrpc.Lightning.ExportChannelBackup", - index=52, - containing_service=None, - input_type=_EXPORTCHANNELBACKUPREQUEST, - output_type=_CHANNELBACKUP, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ExportAllChannelBackups", - full_name="lnrpc.Lightning.ExportAllChannelBackups", - index=53, - containing_service=None, - input_type=_CHANBACKUPEXPORTREQUEST, - output_type=_CHANBACKUPSNAPSHOT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="VerifyChanBackup", - full_name="lnrpc.Lightning.VerifyChanBackup", - index=54, - containing_service=None, - input_type=_CHANBACKUPSNAPSHOT, - output_type=_VERIFYCHANBACKUPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="RestoreChannelBackups", - full_name="lnrpc.Lightning.RestoreChannelBackups", - index=55, - containing_service=None, - input_type=_RESTORECHANBACKUPREQUEST, - output_type=_RESTOREBACKUPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelBackups", - full_name="lnrpc.Lightning.SubscribeChannelBackups", - index=56, - containing_service=None, - input_type=_CHANNELBACKUPSUBSCRIPTION, - output_type=_CHANBACKUPSNAPSHOT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="BakeMacaroon", - full_name="lnrpc.Lightning.BakeMacaroon", - index=57, - containing_service=None, - input_type=_BAKEMACAROONREQUEST, - output_type=_BAKEMACAROONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListMacaroonIDs", - full_name="lnrpc.Lightning.ListMacaroonIDs", - index=58, - containing_service=None, - input_type=_LISTMACAROONIDSREQUEST, - output_type=_LISTMACAROONIDSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeleteMacaroonID", - full_name="lnrpc.Lightning.DeleteMacaroonID", - index=59, - containing_service=None, - input_type=_DELETEMACAROONIDREQUEST, - output_type=_DELETEMACAROONIDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPermissions", - full_name="lnrpc.Lightning.ListPermissions", - index=60, - containing_service=None, - input_type=_LISTPERMISSIONSREQUEST, - output_type=_LISTPERMISSIONSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="CheckMacaroonPermissions", - full_name="lnrpc.Lightning.CheckMacaroonPermissions", - index=61, - containing_service=None, - input_type=_CHECKMACPERMREQUEST, - output_type=_CHECKMACPERMRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="RegisterRPCMiddleware", - full_name="lnrpc.Lightning.RegisterRPCMiddleware", - index=62, - containing_service=None, - input_type=_RPCMIDDLEWARERESPONSE, - output_type=_RPCMIDDLEWAREREQUEST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendCustomMessage", - full_name="lnrpc.Lightning.SendCustomMessage", - index=63, - containing_service=None, - input_type=_SENDCUSTOMMESSAGEREQUEST, - output_type=_SENDCUSTOMMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeCustomMessages", - full_name="lnrpc.Lightning.SubscribeCustomMessages", - index=64, - containing_service=None, - input_type=_SUBSCRIBECUSTOMMESSAGESREQUEST, - output_type=_CUSTOMMESSAGE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_LIGHTNING) - -DESCRIPTOR.services_by_name["Lightning"] = _LIGHTNING - + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"Z%github.com/lightningnetwork/lnd/lnrpc" + _TRANSACTION.fields_by_name["dest_addresses"]._options = None + _TRANSACTION.fields_by_name["dest_addresses"]._serialized_options = b"\030\001" + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _SENDREQUEST.fields_by_name["dest_string"]._options = None + _SENDREQUEST.fields_by_name["dest_string"]._serialized_options = b"\030\001" + _SENDREQUEST.fields_by_name["payment_hash_string"]._options = None + _SENDREQUEST.fields_by_name["payment_hash_string"]._serialized_options = b"\030\001" + _SENDREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _SENDREQUEST.fields_by_name["outgoing_chan_id"]._serialized_options = b"0\001" + _SENDTOROUTEREQUEST.fields_by_name["payment_hash_string"]._options = None + _SENDTOROUTEREQUEST.fields_by_name[ + "payment_hash_string" + ]._serialized_options = b"\030\001" + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._options = None + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_options = b"8\001" + _ESTIMATEFEERESPONSE.fields_by_name["feerate_sat_per_byte"]._options = None + _ESTIMATEFEERESPONSE.fields_by_name[ + "feerate_sat_per_byte" + ]._serialized_options = b"\030\001" + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._options = None + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_options = b"8\001" + _SENDMANYREQUEST.fields_by_name["sat_per_byte"]._options = None + _SENDMANYREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._options = None + _SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["chan_id"]._options = None + _CHANNEL.fields_by_name["chan_id"]._serialized_options = b"0\001" + _CHANNEL.fields_by_name["csv_delay"]._options = None + _CHANNEL.fields_by_name["csv_delay"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["local_chan_reserve_sat"]._options = None + _CHANNEL.fields_by_name["local_chan_reserve_sat"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["remote_chan_reserve_sat"]._options = None + _CHANNEL.fields_by_name["remote_chan_reserve_sat"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["static_remote_key"]._options = None + _CHANNEL.fields_by_name["static_remote_key"]._serialized_options = b"\030\001" + _CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._options = None + _CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._serialized_options = b"0\001" + _PEER_FEATURESENTRY._options = None + _PEER_FEATURESENTRY._serialized_options = b"8\001" + _GETINFORESPONSE_FEATURESENTRY._options = None + _GETINFORESPONSE_FEATURESENTRY._serialized_options = b"8\001" + _GETINFORESPONSE.fields_by_name["testnet"]._options = None + _GETINFORESPONSE.fields_by_name["testnet"]._serialized_options = b"\030\001" + _CLOSECHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None + _CLOSECHANNELREQUEST.fields_by_name[ + "sat_per_byte" + ]._serialized_options = b"\030\001" + _OPENCHANNELREQUEST.fields_by_name["node_pubkey_string"]._options = None + _OPENCHANNELREQUEST.fields_by_name[ + "node_pubkey_string" + ]._serialized_options = b"\030\001" + _OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None + _OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _PENDINGCHANNELSRESPONSE.fields_by_name["pending_closing_channels"]._options = None + _PENDINGCHANNELSRESPONSE.fields_by_name[ + "pending_closing_channels" + ]._serialized_options = b"\030\001" + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._options = None + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_options = b"8\001" + _CHANNELBALANCERESPONSE.fields_by_name["balance"]._options = None + _CHANNELBALANCERESPONSE.fields_by_name["balance"]._serialized_options = b"\030\001" + _CHANNELBALANCERESPONSE.fields_by_name["pending_open_balance"]._options = None + _CHANNELBALANCERESPONSE.fields_by_name[ + "pending_open_balance" + ]._serialized_options = b"\030\001" + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _QUERYROUTESREQUEST.fields_by_name["ignored_edges"]._options = None + _QUERYROUTESREQUEST.fields_by_name[ + "ignored_edges" + ]._serialized_options = b"\030\001" + _QUERYROUTESREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _QUERYROUTESREQUEST.fields_by_name[ + "outgoing_chan_id" + ]._serialized_options = b"0\001" + _EDGELOCATOR.fields_by_name["channel_id"]._options = None + _EDGELOCATOR.fields_by_name["channel_id"]._serialized_options = b"0\001" + _HOP_CUSTOMRECORDSENTRY._options = None + _HOP_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _HOP.fields_by_name["chan_id"]._options = None + _HOP.fields_by_name["chan_id"]._serialized_options = b"0\001" + _HOP.fields_by_name["chan_capacity"]._options = None + _HOP.fields_by_name["chan_capacity"]._serialized_options = b"\030\001" + _HOP.fields_by_name["amt_to_forward"]._options = None + _HOP.fields_by_name["amt_to_forward"]._serialized_options = b"\030\001" + _HOP.fields_by_name["fee"]._options = None + _HOP.fields_by_name["fee"]._serialized_options = b"\030\001" + _HOP.fields_by_name["tlv_payload"]._options = None + _HOP.fields_by_name["tlv_payload"]._serialized_options = b"\030\001" + _ROUTE.fields_by_name["total_fees"]._options = None + _ROUTE.fields_by_name["total_fees"]._serialized_options = b"\030\001" + _ROUTE.fields_by_name["total_amt"]._options = None + _ROUTE.fields_by_name["total_amt"]._serialized_options = b"\030\001" + _LIGHTNINGNODE_FEATURESENTRY._options = None + _LIGHTNINGNODE_FEATURESENTRY._serialized_options = b"8\001" + _CHANNELEDGE.fields_by_name["channel_id"]._options = None + _CHANNELEDGE.fields_by_name["channel_id"]._serialized_options = b"0\001" + _CHANNELEDGE.fields_by_name["last_update"]._options = None + _CHANNELEDGE.fields_by_name["last_update"]._serialized_options = b"\030\001" + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._options = None + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_options = b"8\001" + _CHANINFOREQUEST.fields_by_name["chan_id"]._options = None + _CHANINFOREQUEST.fields_by_name["chan_id"]._serialized_options = b"0\001" + _NODEUPDATE_FEATURESENTRY._options = None + _NODEUPDATE_FEATURESENTRY._serialized_options = b"8\001" + _NODEUPDATE.fields_by_name["addresses"]._options = None + _NODEUPDATE.fields_by_name["addresses"]._serialized_options = b"\030\001" + _NODEUPDATE.fields_by_name["global_features"]._options = None + _NODEUPDATE.fields_by_name["global_features"]._serialized_options = b"\030\001" + _CHANNELEDGEUPDATE.fields_by_name["chan_id"]._options = None + _CHANNELEDGEUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._options = None + _CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _HOPHINT.fields_by_name["chan_id"]._options = None + _HOPHINT.fields_by_name["chan_id"]._serialized_options = b"0\001" + _INVOICE_FEATURESENTRY._options = None + _INVOICE_FEATURESENTRY._serialized_options = b"8\001" + _INVOICE_AMPINVOICESTATEENTRY._options = None + _INVOICE_AMPINVOICESTATEENTRY._serialized_options = b"8\001" + _INVOICE.fields_by_name["settled"]._options = None + _INVOICE.fields_by_name["settled"]._serialized_options = b"\030\001" + _INVOICE.fields_by_name["amt_paid"]._options = None + _INVOICE.fields_by_name["amt_paid"]._serialized_options = b"\030\001" + _INVOICEHTLC_CUSTOMRECORDSENTRY._options = None + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _INVOICEHTLC.fields_by_name["chan_id"]._options = None + _INVOICEHTLC.fields_by_name["chan_id"]._serialized_options = b"0\001" + _PAYMENTHASH.fields_by_name["r_hash_str"]._options = None + _PAYMENTHASH.fields_by_name["r_hash_str"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["value"]._options = None + _PAYMENT.fields_by_name["value"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["creation_date"]._options = None + _PAYMENT.fields_by_name["creation_date"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["fee"]._options = None + _PAYMENT.fields_by_name["fee"]._serialized_options = b"\030\001" + _PAYREQ_FEATURESENTRY._options = None + _PAYREQ_FEATURESENTRY._serialized_options = b"8\001" + _CHANNELFEEREPORT.fields_by_name["chan_id"]._options = None + _CHANNELFEEREPORT.fields_by_name["chan_id"]._serialized_options = b"0\001" + _FORWARDINGEVENT.fields_by_name["timestamp"]._options = None + _FORWARDINGEVENT.fields_by_name["timestamp"]._serialized_options = b"\030\001" + _FORWARDINGEVENT.fields_by_name["chan_id_in"]._options = None + _FORWARDINGEVENT.fields_by_name["chan_id_in"]._serialized_options = b"0\001" + _FORWARDINGEVENT.fields_by_name["chan_id_out"]._options = None + _FORWARDINGEVENT.fields_by_name["chan_id_out"]._serialized_options = b"0\001" + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._options = None + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_options = b"8\001" + _CHANNELUPDATE.fields_by_name["chan_id"]._options = None + _CHANNELUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _LIGHTNING.methods_by_name["SendPayment"]._options = None + _LIGHTNING.methods_by_name["SendPayment"]._serialized_options = b"\210\002\001" + _LIGHTNING.methods_by_name["SendToRoute"]._options = None + _LIGHTNING.methods_by_name["SendToRoute"]._serialized_options = b"\210\002\001" + _OUTPUTSCRIPTTYPE._serialized_start = 27318 + _OUTPUTSCRIPTTYPE._serialized_end = 27613 + _ADDRESSTYPE._serialized_start = 27616 + _ADDRESSTYPE._serialized_end = 27788 + _COMMITMENTTYPE._serialized_start = 27790 + _COMMITMENTTYPE._serialized_end = 27910 + _INITIATOR._serialized_start = 27912 + _INITIATOR._serialized_end = 28009 + _RESOLUTIONTYPE._serialized_start = 28011 + _RESOLUTIONTYPE._serialized_end = 28107 + _RESOLUTIONOUTCOME._serialized_start = 28109 + _RESOLUTIONOUTCOME._serialized_end = 28222 + _NODEMETRICTYPE._serialized_start = 28224 + _NODEMETRICTYPE._serialized_end = 28281 + _INVOICEHTLCSTATE._serialized_start = 28283 + _INVOICEHTLCSTATE._serialized_end = 28342 + _PAYMENTFAILUREREASON._serialized_start = 28345 + _PAYMENTFAILUREREASON._serialized_end = 28562 + _FEATUREBIT._serialized_start = 28565 + _FEATUREBIT._serialized_end = 29156 + _UPDATEFAILURE._serialized_start = 29159 + _UPDATEFAILURE._serialized_end = 29331 + _SUBSCRIBECUSTOMMESSAGESREQUEST._serialized_start = 26 + _SUBSCRIBECUSTOMMESSAGESREQUEST._serialized_end = 58 + _CUSTOMMESSAGE._serialized_start = 60 + _CUSTOMMESSAGE._serialized_end = 117 + _SENDCUSTOMMESSAGEREQUEST._serialized_start = 119 + _SENDCUSTOMMESSAGEREQUEST._serialized_end = 187 + _SENDCUSTOMMESSAGERESPONSE._serialized_start = 189 + _SENDCUSTOMMESSAGERESPONSE._serialized_end = 216 + _UTXO._serialized_start = 219 + _UTXO._serialized_end = 381 + _OUTPUTDETAIL._serialized_start = 384 + _OUTPUTDETAIL._serialized_end = 542 + _TRANSACTION._serialized_start = 545 + _TRANSACTION._serialized_end = 861 + _GETTRANSACTIONSREQUEST._serialized_start = 863 + _GETTRANSACTIONSREQUEST._serialized_end = 946 + _TRANSACTIONDETAILS._serialized_start = 948 + _TRANSACTIONDETAILS._serialized_end = 1010 + _FEELIMIT._serialized_start = 1012 + _FEELIMIT._serialized_end = 1089 + _SENDREQUEST._serialized_start = 1092 + _SENDREQUEST._serialized_end = 1614 + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 1558 + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 1614 + _SENDRESPONSE._serialized_start = 1616 + _SENDRESPONSE._serialized_end = 1738 + _SENDTOROUTEREQUEST._serialized_start = 1740 + _SENDTOROUTEREQUEST._serialized_end = 1850 + _CHANNELACCEPTREQUEST._serialized_start = 1853 + _CHANNELACCEPTREQUEST._serialized_end = 2210 + _CHANNELACCEPTRESPONSE._serialized_start = 2213 + _CHANNELACCEPTRESPONSE._serialized_end = 2476 + _CHANNELPOINT._serialized_start = 2478 + _CHANNELPOINT._serialized_end = 2588 + _OUTPOINT._serialized_start = 2590 + _OUTPOINT._serialized_end = 2660 + _PREVIOUSOUTPOINT._serialized_start = 2662 + _PREVIOUSOUTPOINT._serialized_end = 2721 + _LIGHTNINGADDRESS._serialized_start = 2723 + _LIGHTNINGADDRESS._serialized_end = 2771 + _ESTIMATEFEEREQUEST._serialized_start = 2774 + _ESTIMATEFEEREQUEST._serialized_end = 2981 + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_start = 2930 + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_end = 2981 + _ESTIMATEFEERESPONSE._serialized_start = 2983 + _ESTIMATEFEERESPONSE._serialized_end = 3078 + _SENDMANYREQUEST._serialized_start = 3081 + _SENDMANYREQUEST._serialized_end = 3346 + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_start = 2930 + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_end = 2981 + _SENDMANYRESPONSE._serialized_start = 3348 + _SENDMANYRESPONSE._serialized_end = 3380 + _SENDCOINSREQUEST._serialized_start = 3383 + _SENDCOINSREQUEST._serialized_end = 3580 + _SENDCOINSRESPONSE._serialized_start = 3582 + _SENDCOINSRESPONSE._serialized_end = 3615 + _LISTUNSPENTREQUEST._serialized_start = 3617 + _LISTUNSPENTREQUEST._serialized_end = 3692 + _LISTUNSPENTRESPONSE._serialized_start = 3694 + _LISTUNSPENTRESPONSE._serialized_end = 3743 + _NEWADDRESSREQUEST._serialized_start = 3745 + _NEWADDRESSREQUEST._serialized_end = 3815 + _NEWADDRESSRESPONSE._serialized_start = 3817 + _NEWADDRESSRESPONSE._serialized_end = 3854 + _SIGNMESSAGEREQUEST._serialized_start = 3856 + _SIGNMESSAGEREQUEST._serialized_end = 3910 + _SIGNMESSAGERESPONSE._serialized_start = 3912 + _SIGNMESSAGERESPONSE._serialized_end = 3952 + _VERIFYMESSAGEREQUEST._serialized_start = 3954 + _VERIFYMESSAGEREQUEST._serialized_end = 4008 + _VERIFYMESSAGERESPONSE._serialized_start = 4010 + _VERIFYMESSAGERESPONSE._serialized_end = 4064 + _CONNECTPEERREQUEST._serialized_start = 4066 + _CONNECTPEERREQUEST._serialized_end = 4156 + _CONNECTPEERRESPONSE._serialized_start = 4158 + _CONNECTPEERRESPONSE._serialized_end = 4179 + _DISCONNECTPEERREQUEST._serialized_start = 4181 + _DISCONNECTPEERREQUEST._serialized_end = 4221 + _DISCONNECTPEERRESPONSE._serialized_start = 4223 + _DISCONNECTPEERRESPONSE._serialized_end = 4247 + _HTLC._serialized_start = 4250 + _HTLC._serialized_end = 4415 + _CHANNELCONSTRAINTS._serialized_start = 4418 + _CHANNELCONSTRAINTS._serialized_end = 4588 + _CHANNEL._serialized_start = 4591 + _CHANNEL._serialized_end = 5407 + _LISTCHANNELSREQUEST._serialized_start = 5409 + _LISTCHANNELSREQUEST._serialized_end = 5531 + _LISTCHANNELSRESPONSE._serialized_start = 5533 + _LISTCHANNELSRESPONSE._serialized_end = 5589 + _CHANNELCLOSESUMMARY._serialized_start = 5592 + _CHANNELCLOSESUMMARY._serialized_end = 6145 + _CHANNELCLOSESUMMARY_CLOSURETYPE._serialized_start = 6007 + _CHANNELCLOSESUMMARY_CLOSURETYPE._serialized_end = 6145 + _RESOLUTION._serialized_start = 6148 + _RESOLUTION._serialized_end = 6326 + _CLOSEDCHANNELSREQUEST._serialized_start = 6329 + _CLOSEDCHANNELSREQUEST._serialized_end = 6477 + _CLOSEDCHANNELSRESPONSE._serialized_start = 6479 + _CLOSEDCHANNELSRESPONSE._serialized_end = 6549 + _PEER._serialized_start = 6552 + _PEER._serialized_end = 7047 + _PEER_FEATURESENTRY._serialized_start = 6902 + _PEER_FEATURESENTRY._serialized_end = 6965 + _PEER_SYNCTYPE._serialized_start = 6967 + _PEER_SYNCTYPE._serialized_end = 7047 + _TIMESTAMPEDERROR._serialized_start = 7049 + _TIMESTAMPEDERROR._serialized_end = 7101 + _LISTPEERSREQUEST._serialized_start = 7103 + _LISTPEERSREQUEST._serialized_end = 7143 + _LISTPEERSRESPONSE._serialized_start = 7145 + _LISTPEERSRESPONSE._serialized_end = 7192 + _PEEREVENTSUBSCRIPTION._serialized_start = 7194 + _PEEREVENTSUBSCRIPTION._serialized_end = 7217 + _PEEREVENT._serialized_start = 7219 + _PEEREVENT._serialized_end = 7337 + _PEEREVENT_EVENTTYPE._serialized_start = 7291 + _PEEREVENT_EVENTTYPE._serialized_end = 7337 + _GETINFOREQUEST._serialized_start = 7339 + _GETINFOREQUEST._serialized_end = 7355 + _GETINFORESPONSE._serialized_start = 7358 + _GETINFORESPONSE._serialized_end = 7926 + _GETINFORESPONSE_FEATURESENTRY._serialized_start = 6902 + _GETINFORESPONSE_FEATURESENTRY._serialized_end = 6965 + _GETRECOVERYINFOREQUEST._serialized_start = 7928 + _GETRECOVERYINFOREQUEST._serialized_end = 7952 + _GETRECOVERYINFORESPONSE._serialized_start = 7954 + _GETRECOVERYINFORESPONSE._serialized_end = 8047 + _CHAIN._serialized_start = 8049 + _CHAIN._serialized_end = 8088 + _CONFIRMATIONUPDATE._serialized_start = 8090 + _CONFIRMATIONUPDATE._serialized_end = 8175 + _CHANNELOPENUPDATE._serialized_start = 8177 + _CHANNELOPENUPDATE._serialized_end = 8240 + _CHANNELCLOSEUPDATE._serialized_start = 8242 + _CHANNELCLOSEUPDATE._serialized_end = 8301 + _CLOSECHANNELREQUEST._serialized_start = 8304 + _CLOSECHANNELREQUEST._serialized_end = 8480 + _CLOSESTATUSUPDATE._serialized_start = 8482 + _CLOSESTATUSUPDATE._serialized_end = 8607 + _PENDINGUPDATE._serialized_start = 8609 + _PENDINGUPDATE._serialized_end = 8660 + _READYFORPSBTFUNDING._serialized_start = 8662 + _READYFORPSBTFUNDING._serialized_end = 8746 + _BATCHOPENCHANNELREQUEST._serialized_start = 8749 + _BATCHOPENCHANNELREQUEST._serialized_end = 8922 + _BATCHOPENCHANNEL._serialized_start = 8925 + _BATCHOPENCHANNEL._serialized_end = 9174 + _BATCHOPENCHANNELRESPONSE._serialized_start = 9176 + _BATCHOPENCHANNELRESPONSE._serialized_end = 9250 + _OPENCHANNELREQUEST._serialized_start = 9253 + _OPENCHANNELREQUEST._serialized_end = 9798 + _OPENSTATUSUPDATE._serialized_start = 9801 + _OPENSTATUSUPDATE._serialized_end = 9996 + _KEYLOCATOR._serialized_start = 9998 + _KEYLOCATOR._serialized_end = 10049 + _KEYDESCRIPTOR._serialized_start = 10051 + _KEYDESCRIPTOR._serialized_end = 10125 + _CHANPOINTSHIM._serialized_start = 10128 + _CHANPOINTSHIM._serialized_end = 10304 + _PSBTSHIM._serialized_start = 10306 + _PSBTSHIM._serialized_end = 10380 + _FUNDINGSHIM._serialized_start = 10382 + _FUNDINGSHIM._serialized_end = 10490 + _FUNDINGSHIMCANCEL._serialized_start = 10492 + _FUNDINGSHIMCANCEL._serialized_end = 10536 + _FUNDINGPSBTVERIFY._serialized_start = 10538 + _FUNDINGPSBTVERIFY._serialized_end = 10626 + _FUNDINGPSBTFINALIZE._serialized_start = 10628 + _FUNDINGPSBTFINALIZE._serialized_end = 10717 + _FUNDINGTRANSITIONMSG._serialized_start = 10720 + _FUNDINGTRANSITIONMSG._serialized_end = 10949 + _FUNDINGSTATESTEPRESP._serialized_start = 10951 + _FUNDINGSTATESTEPRESP._serialized_end = 10973 + _PENDINGHTLC._serialized_start = 10976 + _PENDINGHTLC._serialized_end = 11110 + _PENDINGCHANNELSREQUEST._serialized_start = 11112 + _PENDINGCHANNELSREQUEST._serialized_end = 11136 + _PENDINGCHANNELSRESPONSE._serialized_start = 11139 + _PENDINGCHANNELSRESPONSE._serialized_end = 12922 + _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL._serialized_start = 11537 + _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL._serialized_end = 11893 + _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL._serialized_start = 11896 + _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL._serialized_end = 12049 + _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL._serialized_start = 12052 + _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL._serialized_end = 12247 + _PENDINGCHANNELSRESPONSE_COMMITMENTS._serialized_start = 12250 + _PENDINGCHANNELSRESPONSE_COMMITMENTS._serialized_end = 12433 + _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL._serialized_start = 12435 + _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL._serialized_end = 12536 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL._serialized_start = 12539 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL._serialized_end = 12922 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE._serialized_start = 12873 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE._serialized_end = 12922 + _CHANNELEVENTSUBSCRIPTION._serialized_start = 12924 + _CHANNELEVENTSUBSCRIPTION._serialized_end = 12950 + _CHANNELEVENTUPDATE._serialized_start = 12953 + _CHANNELEVENTUPDATE._serialized_end = 13484 + _CHANNELEVENTUPDATE_UPDATETYPE._serialized_start = 13327 + _CHANNELEVENTUPDATE_UPDATETYPE._serialized_end = 13473 + _WALLETACCOUNTBALANCE._serialized_start = 13486 + _WALLETACCOUNTBALANCE._serialized_end = 13564 + _WALLETBALANCEREQUEST._serialized_start = 13566 + _WALLETBALANCEREQUEST._serialized_end = 13588 + _WALLETBALANCERESPONSE._serialized_start = 13591 + _WALLETBALANCERESPONSE._serialized_end = 13914 + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_start = 13832 + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_end = 13914 + _AMOUNT._serialized_start = 13916 + _AMOUNT._serialized_end = 13951 + _CHANNELBALANCEREQUEST._serialized_start = 13953 + _CHANNELBALANCEREQUEST._serialized_end = 13976 + _CHANNELBALANCERESPONSE._serialized_start = 13979 + _CHANNELBALANCERESPONSE._serialized_end = 14335 + _QUERYROUTESREQUEST._serialized_start = 14338 + _QUERYROUTESREQUEST._serialized_end = 14949 + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 1558 + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 1614 + _NODEPAIR._serialized_start = 14951 + _NODEPAIR._serialized_end = 14987 + _EDGELOCATOR._serialized_start = 14989 + _EDGELOCATOR._serialized_end = 15053 + _QUERYROUTESRESPONSE._serialized_start = 15055 + _QUERYROUTESRESPONSE._serialized_end = 15128 + _HOP._serialized_start = 15131 + _HOP._serialized_end = 15537 + _HOP_CUSTOMRECORDSENTRY._serialized_start = 15485 + _HOP_CUSTOMRECORDSENTRY._serialized_end = 15537 + _MPPRECORD._serialized_start = 15539 + _MPPRECORD._serialized_end = 15596 + _AMPRECORD._serialized_start = 15598 + _AMPRECORD._serialized_end = 15666 + _ROUTE._serialized_start = 15669 + _ROUTE._serialized_end = 15823 + _NODEINFOREQUEST._serialized_start = 15825 + _NODEINFOREQUEST._serialized_end = 15885 + _NODEINFO._serialized_start = 15888 + _NODEINFO._serialized_end = 16018 + _LIGHTNINGNODE._serialized_start = 16021 + _LIGHTNINGNODE._serialized_end = 16262 + _LIGHTNINGNODE_FEATURESENTRY._serialized_start = 6902 + _LIGHTNINGNODE_FEATURESENTRY._serialized_end = 6965 + _NODEADDRESS._serialized_start = 16264 + _NODEADDRESS._serialized_end = 16308 + _ROUTINGPOLICY._serialized_start = 16311 + _ROUTINGPOLICY._serialized_end = 16483 + _CHANNELEDGE._serialized_start = 16486 + _CHANNELEDGE._serialized_end = 16712 + _CHANNELGRAPHREQUEST._serialized_start = 16714 + _CHANNELGRAPHREQUEST._serialized_end = 16764 + _CHANNELGRAPH._serialized_start = 16766 + _CHANNELGRAPH._serialized_end = 16852 + _NODEMETRICSREQUEST._serialized_start = 16854 + _NODEMETRICSREQUEST._serialized_end = 16912 + _NODEMETRICSRESPONSE._serialized_start = 16915 + _NODEMETRICSRESPONSE._serialized_end = 17105 + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_start = 17025 + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_end = 17105 + _FLOATMETRIC._serialized_start = 17107 + _FLOATMETRIC._serialized_end = 17161 + _CHANINFOREQUEST._serialized_start = 17163 + _CHANINFOREQUEST._serialized_end = 17201 + _NETWORKINFOREQUEST._serialized_start = 17203 + _NETWORKINFOREQUEST._serialized_end = 17223 + _NETWORKINFO._serialized_start = 17226 + _NETWORKINFO._serialized_end = 17521 + _STOPREQUEST._serialized_start = 17523 + _STOPREQUEST._serialized_end = 17536 + _STOPRESPONSE._serialized_start = 17538 + _STOPRESPONSE._serialized_end = 17552 + _GRAPHTOPOLOGYSUBSCRIPTION._serialized_start = 17554 + _GRAPHTOPOLOGYSUBSCRIPTION._serialized_end = 17581 + _GRAPHTOPOLOGYUPDATE._serialized_start = 17584 + _GRAPHTOPOLOGYUPDATE._serialized_end = 17747 + _NODEUPDATE._serialized_start = 17750 + _NODEUPDATE._serialized_end = 18026 + _NODEUPDATE_FEATURESENTRY._serialized_start = 6902 + _NODEUPDATE_FEATURESENTRY._serialized_end = 6965 + _CHANNELEDGEUPDATE._serialized_start = 18029 + _CHANNELEDGEUPDATE._serialized_end = 18225 + _CLOSEDCHANNELUPDATE._serialized_start = 18227 + _CLOSEDCHANNELUPDATE._serialized_end = 18351 + _HOPHINT._serialized_start = 18354 + _HOPHINT._serialized_end = 18488 + _SETID._serialized_start = 18490 + _SETID._serialized_end = 18513 + _ROUTEHINT._serialized_start = 18515 + _ROUTEHINT._serialized_end = 18561 + _AMPINVOICESTATE._serialized_start = 18563 + _AMPINVOICESTATE._serialized_end = 18686 + _INVOICE._serialized_start = 18689 + _INVOICE._serialized_end = 19590 + _INVOICE_FEATURESENTRY._serialized_start = 6902 + _INVOICE_FEATURESENTRY._serialized_end = 6965 + _INVOICE_AMPINVOICESTATEENTRY._serialized_start = 19439 + _INVOICE_AMPINVOICESTATEENTRY._serialized_end = 19517 + _INVOICE_INVOICESTATE._serialized_start = 19519 + _INVOICE_INVOICESTATE._serialized_end = 19584 + _INVOICEHTLC._serialized_start = 19593 + _INVOICEHTLC._serialized_end = 19964 + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_start = 15485 + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_end = 15537 + _AMP._serialized_start = 19966 + _AMP._serialized_end = 20060 + _ADDINVOICERESPONSE._serialized_start = 20062 + _ADDINVOICERESPONSE._serialized_end = 20164 + _PAYMENTHASH._serialized_start = 20166 + _PAYMENTHASH._serialized_end = 20219 + _LISTINVOICEREQUEST._serialized_start = 20221 + _LISTINVOICEREQUEST._serialized_end = 20329 + _LISTINVOICERESPONSE._serialized_start = 20331 + _LISTINVOICERESPONSE._serialized_end = 20441 + _INVOICESUBSCRIPTION._serialized_start = 20443 + _INVOICESUBSCRIPTION._serialized_end = 20505 + _PAYMENT._serialized_start = 20508 + _PAYMENT._serialized_end = 20988 + _PAYMENT_PAYMENTSTATUS._serialized_start = 20912 + _PAYMENT_PAYMENTSTATUS._serialized_end = 20982 + _HTLCATTEMPT._serialized_start = 20991 + _HTLCATTEMPT._serialized_end = 21257 + _HTLCATTEMPT_HTLCSTATUS._serialized_start = 21203 + _HTLCATTEMPT_HTLCSTATUS._serialized_end = 21257 + _LISTPAYMENTSREQUEST._serialized_start = 21260 + _LISTPAYMENTSREQUEST._serialized_end = 21401 + _LISTPAYMENTSRESPONSE._serialized_start = 21404 + _LISTPAYMENTSRESPONSE._serialized_end = 21543 + _DELETEPAYMENTREQUEST._serialized_start = 21545 + _DELETEPAYMENTREQUEST._serialized_end = 21616 + _DELETEALLPAYMENTSREQUEST._serialized_start = 21618 + _DELETEALLPAYMENTSREQUEST._serialized_end = 21701 + _DELETEPAYMENTRESPONSE._serialized_start = 21703 + _DELETEPAYMENTRESPONSE._serialized_end = 21726 + _DELETEALLPAYMENTSRESPONSE._serialized_start = 21728 + _DELETEALLPAYMENTSRESPONSE._serialized_end = 21755 + _ABANDONCHANNELREQUEST._serialized_start = 21758 + _ABANDONCHANNELREQUEST._serialized_end = 21892 + _ABANDONCHANNELRESPONSE._serialized_start = 21894 + _ABANDONCHANNELRESPONSE._serialized_end = 21918 + _DEBUGLEVELREQUEST._serialized_start = 21920 + _DEBUGLEVELREQUEST._serialized_end = 21973 + _DEBUGLEVELRESPONSE._serialized_start = 21975 + _DEBUGLEVELRESPONSE._serialized_end = 22016 + _PAYREQSTRING._serialized_start = 22018 + _PAYREQSTRING._serialized_end = 22049 + _PAYREQ._serialized_start = 22052 + _PAYREQ._serialized_end = 22442 + _PAYREQ_FEATURESENTRY._serialized_start = 6902 + _PAYREQ_FEATURESENTRY._serialized_end = 6965 + _FEATURE._serialized_start = 22444 + _FEATURE._serialized_end = 22506 + _FEEREPORTREQUEST._serialized_start = 22508 + _FEEREPORTREQUEST._serialized_end = 22526 + _CHANNELFEEREPORT._serialized_start = 22528 + _CHANNELFEEREPORT._serialized_end = 22652 + _FEEREPORTRESPONSE._serialized_start = 22655 + _FEEREPORTRESPONSE._serialized_end = 22787 + _POLICYUPDATEREQUEST._serialized_start = 22790 + _POLICYUPDATEREQUEST._serialized_end = 23048 + _FAILEDUPDATE._serialized_start = 23050 + _FAILEDUPDATE._serialized_end = 23159 + _POLICYUPDATERESPONSE._serialized_start = 23161 + _POLICYUPDATERESPONSE._serialized_end = 23228 + _FORWARDINGHISTORYREQUEST._serialized_start = 23230 + _FORWARDINGHISTORYREQUEST._serialized_end = 23340 + _FORWARDINGEVENT._serialized_start = 23343 + _FORWARDINGEVENT._serialized_end = 23561 + _FORWARDINGHISTORYRESPONSE._serialized_start = 23563 + _FORWARDINGHISTORYRESPONSE._serialized_end = 23668 + _EXPORTCHANNELBACKUPREQUEST._serialized_start = 23670 + _EXPORTCHANNELBACKUPREQUEST._serialized_end = 23739 + _CHANNELBACKUP._serialized_start = 23741 + _CHANNELBACKUP._serialized_end = 23818 + _MULTICHANBACKUP._serialized_start = 23820 + _MULTICHANBACKUP._serialized_end = 23906 + _CHANBACKUPEXPORTREQUEST._serialized_start = 23908 + _CHANBACKUPEXPORTREQUEST._serialized_end = 23933 + _CHANBACKUPSNAPSHOT._serialized_start = 23935 + _CHANBACKUPSNAPSHOT._serialized_end = 24058 + _CHANNELBACKUPS._serialized_start = 24060 + _CHANNELBACKUPS._serialized_end = 24120 + _RESTORECHANBACKUPREQUEST._serialized_start = 24122 + _RESTORECHANBACKUPREQUEST._serialized_end = 24234 + _RESTOREBACKUPRESPONSE._serialized_start = 24236 + _RESTOREBACKUPRESPONSE._serialized_end = 24259 + _CHANNELBACKUPSUBSCRIPTION._serialized_start = 24261 + _CHANNELBACKUPSUBSCRIPTION._serialized_end = 24288 + _VERIFYCHANBACKUPRESPONSE._serialized_start = 24290 + _VERIFYCHANBACKUPRESPONSE._serialized_end = 24316 + _MACAROONPERMISSION._serialized_start = 24318 + _MACAROONPERMISSION._serialized_end = 24370 + _BAKEMACAROONREQUEST._serialized_start = 24372 + _BAKEMACAROONREQUEST._serialized_end = 24498 + _BAKEMACAROONRESPONSE._serialized_start = 24500 + _BAKEMACAROONRESPONSE._serialized_end = 24540 + _LISTMACAROONIDSREQUEST._serialized_start = 24542 + _LISTMACAROONIDSREQUEST._serialized_end = 24566 + _LISTMACAROONIDSRESPONSE._serialized_start = 24568 + _LISTMACAROONIDSRESPONSE._serialized_end = 24615 + _DELETEMACAROONIDREQUEST._serialized_start = 24617 + _DELETEMACAROONIDREQUEST._serialized_end = 24663 + _DELETEMACAROONIDRESPONSE._serialized_start = 24665 + _DELETEMACAROONIDRESPONSE._serialized_end = 24708 + _MACAROONPERMISSIONLIST._serialized_start = 24710 + _MACAROONPERMISSIONLIST._serialized_end = 24782 + _LISTPERMISSIONSREQUEST._serialized_start = 24784 + _LISTPERMISSIONSREQUEST._serialized_end = 24808 + _LISTPERMISSIONSRESPONSE._serialized_start = 24811 + _LISTPERMISSIONSRESPONSE._serialized_end = 25008 + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_start = 24921 + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_end = 25008 + _FAILURE._serialized_start = 25011 + _FAILURE._serialized_end = 25992 + _FAILURE_FAILURECODE._serialized_start = 25235 + _FAILURE_FAILURECODE._serialized_end = 25986 + _CHANNELUPDATE._serialized_start = 25995 + _CHANNELUPDATE._serialized_end = 26277 + _MACAROONID._serialized_start = 26279 + _MACAROONID._serialized_end = 26349 + _OP._serialized_start = 26351 + _OP._serialized_end = 26388 + _CHECKMACPERMREQUEST._serialized_start = 26390 + _CHECKMACPERMREQUEST._serialized_end = 26497 + _CHECKMACPERMRESPONSE._serialized_start = 26499 + _CHECKMACPERMRESPONSE._serialized_end = 26536 + _RPCMIDDLEWAREREQUEST._serialized_start = 26539 + _RPCMIDDLEWAREREQUEST._serialized_end = 26789 + _STREAMAUTH._serialized_start = 26791 + _STREAMAUTH._serialized_end = 26828 + _RPCMESSAGE._serialized_start = 26830 + _RPCMESSAGE._serialized_end = 26944 + _RPCMIDDLEWARERESPONSE._serialized_start = 26947 + _RPCMIDDLEWARERESPONSE._serialized_end = 27109 + _MIDDLEWAREREGISTRATION._serialized_start = 27111 + _MIDDLEWAREREGISTRATION._serialized_end = 27221 + _INTERCEPTFEEDBACK._serialized_start = 27223 + _INTERCEPTFEEDBACK._serialized_end = 27315 + _LIGHTNING._serialized_start = 29334 + _LIGHTNING._serialized_end = 34143 # @@protoc_insertion_point(module_scope) diff --git a/lnbits/wallets/lnd_grpc_files/router_pb2.py b/lnbits/wallets/lnd_grpc_files/router_pb2.py new file mode 100644 index 00000000..4237556b --- /dev/null +++ b/lnbits/wallets/lnd_grpc_files/router_pb2.py @@ -0,0 +1,665 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: router.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import enum_type_wrapper + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import lnbits.wallets.lnd_grpc_files.lightning_pb2 as lightning__pb2 + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x0crouter.proto\x12\trouterrpc\x1a\x0flightning.proto"\xb7\x05\n\x12SendPaymentRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12\x14\n\x0cpayment_addr\x18\x14 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x05 \x01(\t\x12\x17\n\x0ftimeout_seconds\x18\x06 \x01(\x05\x12\x15\n\rfee_limit_sat\x18\x07 \x01(\x03\x12\x16\n\x0e\x66\x65\x65_limit_msat\x18\r \x01(\x03\x12\x1e\n\x10outgoing_chan_id\x18\x08 \x01(\x04\x42\x04\x18\x01\x30\x01\x12\x19\n\x11outgoing_chan_ids\x18\x13 \x03(\x04\x12\x17\n\x0flast_hop_pubkey\x18\x0e \x01(\x0c\x12\x12\n\ncltv_limit\x18\t \x01(\x05\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12Q\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32\x34.routerrpc.SendPaymentRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0f \x01(\x08\x12(\n\rdest_features\x18\x10 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x11\n\tmax_parts\x18\x11 \x01(\r\x12\x1b\n\x13no_inflight_updates\x18\x12 \x01(\x08\x12\x1b\n\x13max_shard_size_msat\x18\x15 \x01(\x04\x12\x0b\n\x03\x61mp\x18\x16 \x01(\x08\x12\x11\n\ttime_pref\x18\x17 \x01(\x01\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"H\n\x13TrackPaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1b\n\x13no_inflight_updates\x18\x02 \x01(\x08"0\n\x0fRouteFeeRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x0f\n\x07\x61mt_sat\x18\x02 \x01(\x03"E\n\x10RouteFeeResponse\x12\x18\n\x10routing_fee_msat\x18\x01 \x01(\x03\x12\x17\n\x0ftime_lock_delay\x18\x02 \x01(\x03"^\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x15\n\rskip_temp_err\x18\x03 \x01(\x08"H\n\x13SendToRouteResponse\x12\x10\n\x08preimage\x18\x01 \x01(\x0c\x12\x1f\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Failure"\x1c\n\x1aResetMissionControlRequest"\x1d\n\x1bResetMissionControlResponse"\x1c\n\x1aQueryMissionControlRequest"J\n\x1bQueryMissionControlResponse\x12%\n\x05pairs\x18\x02 \x03(\x0b\x32\x16.routerrpc.PairHistoryJ\x04\x08\x01\x10\x02"T\n\x1cXImportMissionControlRequest\x12%\n\x05pairs\x18\x01 \x03(\x0b\x32\x16.routerrpc.PairHistory\x12\r\n\x05\x66orce\x18\x02 \x01(\x08"\x1f\n\x1dXImportMissionControlResponse"o\n\x0bPairHistory\x12\x11\n\tnode_from\x18\x01 \x01(\x0c\x12\x0f\n\x07node_to\x18\x02 \x01(\x0c\x12$\n\x07history\x18\x07 \x01(\x0b\x32\x13.routerrpc.PairDataJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07"\x99\x01\n\x08PairData\x12\x11\n\tfail_time\x18\x01 \x01(\x03\x12\x14\n\x0c\x66\x61il_amt_sat\x18\x02 \x01(\x03\x12\x15\n\rfail_amt_msat\x18\x04 \x01(\x03\x12\x14\n\x0csuccess_time\x18\x05 \x01(\x03\x12\x17\n\x0fsuccess_amt_sat\x18\x06 \x01(\x03\x12\x18\n\x10success_amt_msat\x18\x07 \x01(\x03J\x04\x08\x03\x10\x04" \n\x1eGetMissionControlConfigRequest"R\n\x1fGetMissionControlConfigResponse\x12/\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1f.routerrpc.MissionControlConfig"Q\n\x1eSetMissionControlConfigRequest\x12/\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1f.routerrpc.MissionControlConfig"!\n\x1fSetMissionControlConfigResponse"\xa3\x01\n\x14MissionControlConfig\x12\x19\n\x11half_life_seconds\x18\x01 \x01(\x04\x12\x17\n\x0fhop_probability\x18\x02 \x01(\x02\x12\x0e\n\x06weight\x18\x03 \x01(\x02\x12\x1f\n\x17maximum_payment_results\x18\x04 \x01(\r\x12&\n\x1eminimum_failure_relax_interval\x18\x05 \x01(\x04"O\n\x17QueryProbabilityRequest\x12\x11\n\tfrom_node\x18\x01 \x01(\x0c\x12\x0f\n\x07to_node\x18\x02 \x01(\x0c\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x03"U\n\x18QueryProbabilityResponse\x12\x13\n\x0bprobability\x18\x01 \x01(\x01\x12$\n\x07history\x18\x02 \x01(\x0b\x32\x13.routerrpc.PairData"\x88\x01\n\x11\x42uildRouteRequest\x12\x10\n\x08\x61mt_msat\x18\x01 \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x02 \x01(\x05\x12\x1c\n\x10outgoing_chan_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x0bhop_pubkeys\x18\x04 \x03(\x0c\x12\x14\n\x0cpayment_addr\x18\x05 \x01(\x0c"1\n\x12\x42uildRouteResponse\x12\x1b\n\x05route\x18\x01 \x01(\x0b\x32\x0c.lnrpc.Route"\x1c\n\x1aSubscribeHtlcEventsRequest"\xdc\x03\n\tHtlcEvent\x12\x1b\n\x13incoming_channel_id\x18\x01 \x01(\x04\x12\x1b\n\x13outgoing_channel_id\x18\x02 \x01(\x04\x12\x18\n\x10incoming_htlc_id\x18\x03 \x01(\x04\x12\x18\n\x10outgoing_htlc_id\x18\x04 \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x05 \x01(\x04\x12\x32\n\nevent_type\x18\x06 \x01(\x0e\x32\x1e.routerrpc.HtlcEvent.EventType\x12\x30\n\rforward_event\x18\x07 \x01(\x0b\x32\x17.routerrpc.ForwardEventH\x00\x12\x39\n\x12\x66orward_fail_event\x18\x08 \x01(\x0b\x32\x1b.routerrpc.ForwardFailEventH\x00\x12.\n\x0csettle_event\x18\t \x01(\x0b\x32\x16.routerrpc.SettleEventH\x00\x12\x33\n\x0flink_fail_event\x18\n \x01(\x0b\x32\x18.routerrpc.LinkFailEventH\x00"<\n\tEventType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04SEND\x10\x01\x12\x0b\n\x07RECEIVE\x10\x02\x12\x0b\n\x07\x46ORWARD\x10\x03\x42\x07\n\x05\x65vent"v\n\x08HtlcInfo\x12\x19\n\x11incoming_timelock\x18\x01 \x01(\r\x12\x19\n\x11outgoing_timelock\x18\x02 \x01(\r\x12\x19\n\x11incoming_amt_msat\x18\x03 \x01(\x04\x12\x19\n\x11outgoing_amt_msat\x18\x04 \x01(\x04"1\n\x0c\x46orwardEvent\x12!\n\x04info\x18\x01 \x01(\x0b\x32\x13.routerrpc.HtlcInfo"\x12\n\x10\x46orwardFailEvent"\x1f\n\x0bSettleEvent\x12\x10\n\x08preimage\x18\x01 \x01(\x0c"\xae\x01\n\rLinkFailEvent\x12!\n\x04info\x18\x01 \x01(\x0b\x32\x13.routerrpc.HtlcInfo\x12\x30\n\x0cwire_failure\x18\x02 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12\x30\n\x0e\x66\x61ilure_detail\x18\x03 \x01(\x0e\x32\x18.routerrpc.FailureDetail\x12\x16\n\x0e\x66\x61ilure_string\x18\x04 \x01(\t"r\n\rPaymentStatus\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.routerrpc.PaymentState\x12\x10\n\x08preimage\x18\x02 \x01(\x0c\x12!\n\x05htlcs\x18\x04 \x03(\x0b\x32\x12.lnrpc.HTLCAttemptJ\x04\x08\x03\x10\x04".\n\nCircuitKey\x12\x0f\n\x07\x63han_id\x18\x01 \x01(\x04\x12\x0f\n\x07htlc_id\x18\x02 \x01(\x04"\x97\x03\n\x1b\x46orwardHtlcInterceptRequest\x12\x33\n\x14incoming_circuit_key\x18\x01 \x01(\x0b\x32\x15.routerrpc.CircuitKey\x12\x1c\n\x14incoming_amount_msat\x18\x05 \x01(\x04\x12\x17\n\x0fincoming_expiry\x18\x06 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12"\n\x1aoutgoing_requested_chan_id\x18\x07 \x01(\x04\x12\x1c\n\x14outgoing_amount_msat\x18\x03 \x01(\x04\x12\x17\n\x0foutgoing_expiry\x18\x04 \x01(\r\x12Q\n\x0e\x63ustom_records\x18\x08 \x03(\x0b\x32\x39.routerrpc.ForwardHtlcInterceptRequest.CustomRecordsEntry\x12\x12\n\nonion_blob\x18\t \x01(\x0c\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"\xe5\x01\n\x1c\x46orwardHtlcInterceptResponse\x12\x33\n\x14incoming_circuit_key\x18\x01 \x01(\x0b\x32\x15.routerrpc.CircuitKey\x12\x33\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32#.routerrpc.ResolveHoldForwardAction\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\x12\x17\n\x0f\x66\x61ilure_message\x18\x04 \x01(\x0c\x12\x30\n\x0c\x66\x61ilure_code\x18\x05 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode"o\n\x17UpdateChanStatusRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12+\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1b.routerrpc.ChanStatusAction"\x1a\n\x18UpdateChanStatusResponse*\x81\x04\n\rFailureDetail\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tNO_DETAIL\x10\x01\x12\x10\n\x0cONION_DECODE\x10\x02\x12\x15\n\x11LINK_NOT_ELIGIBLE\x10\x03\x12\x14\n\x10ON_CHAIN_TIMEOUT\x10\x04\x12\x14\n\x10HTLC_EXCEEDS_MAX\x10\x05\x12\x18\n\x14INSUFFICIENT_BALANCE\x10\x06\x12\x16\n\x12INCOMPLETE_FORWARD\x10\x07\x12\x13\n\x0fHTLC_ADD_FAILED\x10\x08\x12\x15\n\x11\x46ORWARDS_DISABLED\x10\t\x12\x14\n\x10INVOICE_CANCELED\x10\n\x12\x15\n\x11INVOICE_UNDERPAID\x10\x0b\x12\x1b\n\x17INVOICE_EXPIRY_TOO_SOON\x10\x0c\x12\x14\n\x10INVOICE_NOT_OPEN\x10\r\x12\x17\n\x13MPP_INVOICE_TIMEOUT\x10\x0e\x12\x14\n\x10\x41\x44\x44RESS_MISMATCH\x10\x0f\x12\x16\n\x12SET_TOTAL_MISMATCH\x10\x10\x12\x15\n\x11SET_TOTAL_TOO_LOW\x10\x11\x12\x10\n\x0cSET_OVERPAID\x10\x12\x12\x13\n\x0fUNKNOWN_INVOICE\x10\x13\x12\x13\n\x0fINVALID_KEYSEND\x10\x14\x12\x13\n\x0fMPP_IN_PROGRESS\x10\x15\x12\x12\n\x0e\x43IRCULAR_ROUTE\x10\x16*\xae\x01\n\x0cPaymentState\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\x12\n\x0e\x46\x41ILED_TIMEOUT\x10\x02\x12\x13\n\x0f\x46\x41ILED_NO_ROUTE\x10\x03\x12\x10\n\x0c\x46\x41ILED_ERROR\x10\x04\x12$\n FAILED_INCORRECT_PAYMENT_DETAILS\x10\x05\x12\x1f\n\x1b\x46\x41ILED_INSUFFICIENT_BALANCE\x10\x06*<\n\x18ResolveHoldForwardAction\x12\n\n\x06SETTLE\x10\x00\x12\x08\n\x04\x46\x41IL\x10\x01\x12\n\n\x06RESUME\x10\x02*5\n\x10\x43hanStatusAction\x12\n\n\x06\x45NABLE\x10\x00\x12\x0b\n\x07\x44ISABLE\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x32\xf1\x0b\n\x06Router\x12@\n\rSendPaymentV2\x12\x1d.routerrpc.SendPaymentRequest\x1a\x0e.lnrpc.Payment0\x01\x12\x42\n\x0eTrackPaymentV2\x12\x1e.routerrpc.TrackPaymentRequest\x1a\x0e.lnrpc.Payment0\x01\x12K\n\x10\x45stimateRouteFee\x12\x1a.routerrpc.RouteFeeRequest\x1a\x1b.routerrpc.RouteFeeResponse\x12Q\n\x0bSendToRoute\x12\x1d.routerrpc.SendToRouteRequest\x1a\x1e.routerrpc.SendToRouteResponse"\x03\x88\x02\x01\x12\x42\n\rSendToRouteV2\x12\x1d.routerrpc.SendToRouteRequest\x1a\x12.lnrpc.HTLCAttempt\x12\x64\n\x13ResetMissionControl\x12%.routerrpc.ResetMissionControlRequest\x1a&.routerrpc.ResetMissionControlResponse\x12\x64\n\x13QueryMissionControl\x12%.routerrpc.QueryMissionControlRequest\x1a&.routerrpc.QueryMissionControlResponse\x12j\n\x15XImportMissionControl\x12\'.routerrpc.XImportMissionControlRequest\x1a(.routerrpc.XImportMissionControlResponse\x12p\n\x17GetMissionControlConfig\x12).routerrpc.GetMissionControlConfigRequest\x1a*.routerrpc.GetMissionControlConfigResponse\x12p\n\x17SetMissionControlConfig\x12).routerrpc.SetMissionControlConfigRequest\x1a*.routerrpc.SetMissionControlConfigResponse\x12[\n\x10QueryProbability\x12".routerrpc.QueryProbabilityRequest\x1a#.routerrpc.QueryProbabilityResponse\x12I\n\nBuildRoute\x12\x1c.routerrpc.BuildRouteRequest\x1a\x1d.routerrpc.BuildRouteResponse\x12T\n\x13SubscribeHtlcEvents\x12%.routerrpc.SubscribeHtlcEventsRequest\x1a\x14.routerrpc.HtlcEvent0\x01\x12M\n\x0bSendPayment\x12\x1d.routerrpc.SendPaymentRequest\x1a\x18.routerrpc.PaymentStatus"\x03\x88\x02\x01\x30\x01\x12O\n\x0cTrackPayment\x12\x1e.routerrpc.TrackPaymentRequest\x1a\x18.routerrpc.PaymentStatus"\x03\x88\x02\x01\x30\x01\x12\x66\n\x0fHtlcInterceptor\x12\'.routerrpc.ForwardHtlcInterceptResponse\x1a&.routerrpc.ForwardHtlcInterceptRequest(\x01\x30\x01\x12[\n\x10UpdateChanStatus\x12".routerrpc.UpdateChanStatusRequest\x1a#.routerrpc.UpdateChanStatusResponseB1Z/github.com/lightningnetwork/lnd/lnrpc/routerrpcb\x06proto3' +) + +_FAILUREDETAIL = DESCRIPTOR.enum_types_by_name["FailureDetail"] +FailureDetail = enum_type_wrapper.EnumTypeWrapper(_FAILUREDETAIL) +_PAYMENTSTATE = DESCRIPTOR.enum_types_by_name["PaymentState"] +PaymentState = enum_type_wrapper.EnumTypeWrapper(_PAYMENTSTATE) +_RESOLVEHOLDFORWARDACTION = DESCRIPTOR.enum_types_by_name["ResolveHoldForwardAction"] +ResolveHoldForwardAction = enum_type_wrapper.EnumTypeWrapper(_RESOLVEHOLDFORWARDACTION) +_CHANSTATUSACTION = DESCRIPTOR.enum_types_by_name["ChanStatusAction"] +ChanStatusAction = enum_type_wrapper.EnumTypeWrapper(_CHANSTATUSACTION) +UNKNOWN = 0 +NO_DETAIL = 1 +ONION_DECODE = 2 +LINK_NOT_ELIGIBLE = 3 +ON_CHAIN_TIMEOUT = 4 +HTLC_EXCEEDS_MAX = 5 +INSUFFICIENT_BALANCE = 6 +INCOMPLETE_FORWARD = 7 +HTLC_ADD_FAILED = 8 +FORWARDS_DISABLED = 9 +INVOICE_CANCELED = 10 +INVOICE_UNDERPAID = 11 +INVOICE_EXPIRY_TOO_SOON = 12 +INVOICE_NOT_OPEN = 13 +MPP_INVOICE_TIMEOUT = 14 +ADDRESS_MISMATCH = 15 +SET_TOTAL_MISMATCH = 16 +SET_TOTAL_TOO_LOW = 17 +SET_OVERPAID = 18 +UNKNOWN_INVOICE = 19 +INVALID_KEYSEND = 20 +MPP_IN_PROGRESS = 21 +CIRCULAR_ROUTE = 22 +IN_FLIGHT = 0 +SUCCEEDED = 1 +FAILED_TIMEOUT = 2 +FAILED_NO_ROUTE = 3 +FAILED_ERROR = 4 +FAILED_INCORRECT_PAYMENT_DETAILS = 5 +FAILED_INSUFFICIENT_BALANCE = 6 +SETTLE = 0 +FAIL = 1 +RESUME = 2 +ENABLE = 0 +DISABLE = 1 +AUTO = 2 + + +_SENDPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["SendPaymentRequest"] +_SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY = _SENDPAYMENTREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_TRACKPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["TrackPaymentRequest"] +_ROUTEFEEREQUEST = DESCRIPTOR.message_types_by_name["RouteFeeRequest"] +_ROUTEFEERESPONSE = DESCRIPTOR.message_types_by_name["RouteFeeResponse"] +_SENDTOROUTEREQUEST = DESCRIPTOR.message_types_by_name["SendToRouteRequest"] +_SENDTOROUTERESPONSE = DESCRIPTOR.message_types_by_name["SendToRouteResponse"] +_RESETMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "ResetMissionControlRequest" +] +_RESETMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "ResetMissionControlResponse" +] +_QUERYMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "QueryMissionControlRequest" +] +_QUERYMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "QueryMissionControlResponse" +] +_XIMPORTMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "XImportMissionControlRequest" +] +_XIMPORTMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "XImportMissionControlResponse" +] +_PAIRHISTORY = DESCRIPTOR.message_types_by_name["PairHistory"] +_PAIRDATA = DESCRIPTOR.message_types_by_name["PairData"] +_GETMISSIONCONTROLCONFIGREQUEST = DESCRIPTOR.message_types_by_name[ + "GetMissionControlConfigRequest" +] +_GETMISSIONCONTROLCONFIGRESPONSE = DESCRIPTOR.message_types_by_name[ + "GetMissionControlConfigResponse" +] +_SETMISSIONCONTROLCONFIGREQUEST = DESCRIPTOR.message_types_by_name[ + "SetMissionControlConfigRequest" +] +_SETMISSIONCONTROLCONFIGRESPONSE = DESCRIPTOR.message_types_by_name[ + "SetMissionControlConfigResponse" +] +_MISSIONCONTROLCONFIG = DESCRIPTOR.message_types_by_name["MissionControlConfig"] +_QUERYPROBABILITYREQUEST = DESCRIPTOR.message_types_by_name["QueryProbabilityRequest"] +_QUERYPROBABILITYRESPONSE = DESCRIPTOR.message_types_by_name["QueryProbabilityResponse"] +_BUILDROUTEREQUEST = DESCRIPTOR.message_types_by_name["BuildRouteRequest"] +_BUILDROUTERESPONSE = DESCRIPTOR.message_types_by_name["BuildRouteResponse"] +_SUBSCRIBEHTLCEVENTSREQUEST = DESCRIPTOR.message_types_by_name[ + "SubscribeHtlcEventsRequest" +] +_HTLCEVENT = DESCRIPTOR.message_types_by_name["HtlcEvent"] +_HTLCINFO = DESCRIPTOR.message_types_by_name["HtlcInfo"] +_FORWARDEVENT = DESCRIPTOR.message_types_by_name["ForwardEvent"] +_FORWARDFAILEVENT = DESCRIPTOR.message_types_by_name["ForwardFailEvent"] +_SETTLEEVENT = DESCRIPTOR.message_types_by_name["SettleEvent"] +_LINKFAILEVENT = DESCRIPTOR.message_types_by_name["LinkFailEvent"] +_PAYMENTSTATUS = DESCRIPTOR.message_types_by_name["PaymentStatus"] +_CIRCUITKEY = DESCRIPTOR.message_types_by_name["CircuitKey"] +_FORWARDHTLCINTERCEPTREQUEST = DESCRIPTOR.message_types_by_name[ + "ForwardHtlcInterceptRequest" +] +_FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY = ( + _FORWARDHTLCINTERCEPTREQUEST.nested_types_by_name["CustomRecordsEntry"] +) +_FORWARDHTLCINTERCEPTRESPONSE = DESCRIPTOR.message_types_by_name[ + "ForwardHtlcInterceptResponse" +] +_UPDATECHANSTATUSREQUEST = DESCRIPTOR.message_types_by_name["UpdateChanStatusRequest"] +_UPDATECHANSTATUSRESPONSE = DESCRIPTOR.message_types_by_name["UpdateChanStatusResponse"] +_HTLCEVENT_EVENTTYPE = _HTLCEVENT.enum_types_by_name["EventType"] +SendPaymentRequest = _reflection.GeneratedProtocolMessageType( + "SendPaymentRequest", + (_message.Message,), + { + "DestCustomRecordsEntry": _reflection.GeneratedProtocolMessageType( + "DestCustomRecordsEntry", + (_message.Message,), + { + "DESCRIPTOR": _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendPaymentRequest.DestCustomRecordsEntry) + }, + ), + "DESCRIPTOR": _SENDPAYMENTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendPaymentRequest) + }, +) +_sym_db.RegisterMessage(SendPaymentRequest) +_sym_db.RegisterMessage(SendPaymentRequest.DestCustomRecordsEntry) + +TrackPaymentRequest = _reflection.GeneratedProtocolMessageType( + "TrackPaymentRequest", + (_message.Message,), + { + "DESCRIPTOR": _TRACKPAYMENTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.TrackPaymentRequest) + }, +) +_sym_db.RegisterMessage(TrackPaymentRequest) + +RouteFeeRequest = _reflection.GeneratedProtocolMessageType( + "RouteFeeRequest", + (_message.Message,), + { + "DESCRIPTOR": _ROUTEFEEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.RouteFeeRequest) + }, +) +_sym_db.RegisterMessage(RouteFeeRequest) + +RouteFeeResponse = _reflection.GeneratedProtocolMessageType( + "RouteFeeResponse", + (_message.Message,), + { + "DESCRIPTOR": _ROUTEFEERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.RouteFeeResponse) + }, +) +_sym_db.RegisterMessage(RouteFeeResponse) + +SendToRouteRequest = _reflection.GeneratedProtocolMessageType( + "SendToRouteRequest", + (_message.Message,), + { + "DESCRIPTOR": _SENDTOROUTEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendToRouteRequest) + }, +) +_sym_db.RegisterMessage(SendToRouteRequest) + +SendToRouteResponse = _reflection.GeneratedProtocolMessageType( + "SendToRouteResponse", + (_message.Message,), + { + "DESCRIPTOR": _SENDTOROUTERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendToRouteResponse) + }, +) +_sym_db.RegisterMessage(SendToRouteResponse) + +ResetMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "ResetMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _RESETMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ResetMissionControlRequest) + }, +) +_sym_db.RegisterMessage(ResetMissionControlRequest) + +ResetMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "ResetMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _RESETMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ResetMissionControlResponse) + }, +) +_sym_db.RegisterMessage(ResetMissionControlResponse) + +QueryMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "QueryMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryMissionControlRequest) + }, +) +_sym_db.RegisterMessage(QueryMissionControlRequest) + +QueryMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "QueryMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryMissionControlResponse) + }, +) +_sym_db.RegisterMessage(QueryMissionControlResponse) + +XImportMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "XImportMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _XIMPORTMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.XImportMissionControlRequest) + }, +) +_sym_db.RegisterMessage(XImportMissionControlRequest) + +XImportMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "XImportMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _XIMPORTMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.XImportMissionControlResponse) + }, +) +_sym_db.RegisterMessage(XImportMissionControlResponse) + +PairHistory = _reflection.GeneratedProtocolMessageType( + "PairHistory", + (_message.Message,), + { + "DESCRIPTOR": _PAIRHISTORY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PairHistory) + }, +) +_sym_db.RegisterMessage(PairHistory) + +PairData = _reflection.GeneratedProtocolMessageType( + "PairData", + (_message.Message,), + { + "DESCRIPTOR": _PAIRDATA, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PairData) + }, +) +_sym_db.RegisterMessage(PairData) + +GetMissionControlConfigRequest = _reflection.GeneratedProtocolMessageType( + "GetMissionControlConfigRequest", + (_message.Message,), + { + "DESCRIPTOR": _GETMISSIONCONTROLCONFIGREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.GetMissionControlConfigRequest) + }, +) +_sym_db.RegisterMessage(GetMissionControlConfigRequest) + +GetMissionControlConfigResponse = _reflection.GeneratedProtocolMessageType( + "GetMissionControlConfigResponse", + (_message.Message,), + { + "DESCRIPTOR": _GETMISSIONCONTROLCONFIGRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.GetMissionControlConfigResponse) + }, +) +_sym_db.RegisterMessage(GetMissionControlConfigResponse) + +SetMissionControlConfigRequest = _reflection.GeneratedProtocolMessageType( + "SetMissionControlConfigRequest", + (_message.Message,), + { + "DESCRIPTOR": _SETMISSIONCONTROLCONFIGREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SetMissionControlConfigRequest) + }, +) +_sym_db.RegisterMessage(SetMissionControlConfigRequest) + +SetMissionControlConfigResponse = _reflection.GeneratedProtocolMessageType( + "SetMissionControlConfigResponse", + (_message.Message,), + { + "DESCRIPTOR": _SETMISSIONCONTROLCONFIGRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SetMissionControlConfigResponse) + }, +) +_sym_db.RegisterMessage(SetMissionControlConfigResponse) + +MissionControlConfig = _reflection.GeneratedProtocolMessageType( + "MissionControlConfig", + (_message.Message,), + { + "DESCRIPTOR": _MISSIONCONTROLCONFIG, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.MissionControlConfig) + }, +) +_sym_db.RegisterMessage(MissionControlConfig) + +QueryProbabilityRequest = _reflection.GeneratedProtocolMessageType( + "QueryProbabilityRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYPROBABILITYREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryProbabilityRequest) + }, +) +_sym_db.RegisterMessage(QueryProbabilityRequest) + +QueryProbabilityResponse = _reflection.GeneratedProtocolMessageType( + "QueryProbabilityResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYPROBABILITYRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryProbabilityResponse) + }, +) +_sym_db.RegisterMessage(QueryProbabilityResponse) + +BuildRouteRequest = _reflection.GeneratedProtocolMessageType( + "BuildRouteRequest", + (_message.Message,), + { + "DESCRIPTOR": _BUILDROUTEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.BuildRouteRequest) + }, +) +_sym_db.RegisterMessage(BuildRouteRequest) + +BuildRouteResponse = _reflection.GeneratedProtocolMessageType( + "BuildRouteResponse", + (_message.Message,), + { + "DESCRIPTOR": _BUILDROUTERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.BuildRouteResponse) + }, +) +_sym_db.RegisterMessage(BuildRouteResponse) + +SubscribeHtlcEventsRequest = _reflection.GeneratedProtocolMessageType( + "SubscribeHtlcEventsRequest", + (_message.Message,), + { + "DESCRIPTOR": _SUBSCRIBEHTLCEVENTSREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SubscribeHtlcEventsRequest) + }, +) +_sym_db.RegisterMessage(SubscribeHtlcEventsRequest) + +HtlcEvent = _reflection.GeneratedProtocolMessageType( + "HtlcEvent", + (_message.Message,), + { + "DESCRIPTOR": _HTLCEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.HtlcEvent) + }, +) +_sym_db.RegisterMessage(HtlcEvent) + +HtlcInfo = _reflection.GeneratedProtocolMessageType( + "HtlcInfo", + (_message.Message,), + { + "DESCRIPTOR": _HTLCINFO, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.HtlcInfo) + }, +) +_sym_db.RegisterMessage(HtlcInfo) + +ForwardEvent = _reflection.GeneratedProtocolMessageType( + "ForwardEvent", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardEvent) + }, +) +_sym_db.RegisterMessage(ForwardEvent) + +ForwardFailEvent = _reflection.GeneratedProtocolMessageType( + "ForwardFailEvent", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDFAILEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardFailEvent) + }, +) +_sym_db.RegisterMessage(ForwardFailEvent) + +SettleEvent = _reflection.GeneratedProtocolMessageType( + "SettleEvent", + (_message.Message,), + { + "DESCRIPTOR": _SETTLEEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SettleEvent) + }, +) +_sym_db.RegisterMessage(SettleEvent) + +LinkFailEvent = _reflection.GeneratedProtocolMessageType( + "LinkFailEvent", + (_message.Message,), + { + "DESCRIPTOR": _LINKFAILEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.LinkFailEvent) + }, +) +_sym_db.RegisterMessage(LinkFailEvent) + +PaymentStatus = _reflection.GeneratedProtocolMessageType( + "PaymentStatus", + (_message.Message,), + { + "DESCRIPTOR": _PAYMENTSTATUS, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PaymentStatus) + }, +) +_sym_db.RegisterMessage(PaymentStatus) + +CircuitKey = _reflection.GeneratedProtocolMessageType( + "CircuitKey", + (_message.Message,), + { + "DESCRIPTOR": _CIRCUITKEY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.CircuitKey) + }, +) +_sym_db.RegisterMessage(CircuitKey) + +ForwardHtlcInterceptRequest = _reflection.GeneratedProtocolMessageType( + "ForwardHtlcInterceptRequest", + (_message.Message,), + { + "CustomRecordsEntry": _reflection.GeneratedProtocolMessageType( + "CustomRecordsEntry", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptRequest.CustomRecordsEntry) + }, + ), + "DESCRIPTOR": _FORWARDHTLCINTERCEPTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptRequest) + }, +) +_sym_db.RegisterMessage(ForwardHtlcInterceptRequest) +_sym_db.RegisterMessage(ForwardHtlcInterceptRequest.CustomRecordsEntry) + +ForwardHtlcInterceptResponse = _reflection.GeneratedProtocolMessageType( + "ForwardHtlcInterceptResponse", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDHTLCINTERCEPTRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptResponse) + }, +) +_sym_db.RegisterMessage(ForwardHtlcInterceptResponse) + +UpdateChanStatusRequest = _reflection.GeneratedProtocolMessageType( + "UpdateChanStatusRequest", + (_message.Message,), + { + "DESCRIPTOR": _UPDATECHANSTATUSREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.UpdateChanStatusRequest) + }, +) +_sym_db.RegisterMessage(UpdateChanStatusRequest) + +UpdateChanStatusResponse = _reflection.GeneratedProtocolMessageType( + "UpdateChanStatusResponse", + (_message.Message,), + { + "DESCRIPTOR": _UPDATECHANSTATUSRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.UpdateChanStatusResponse) + }, +) +_sym_db.RegisterMessage(UpdateChanStatusResponse) + +_ROUTER = DESCRIPTOR.services_by_name["Router"] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = ( + b"Z/github.com/lightningnetwork/lnd/lnrpc/routerrpc" + ) + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _SENDPAYMENTREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _SENDPAYMENTREQUEST.fields_by_name[ + "outgoing_chan_id" + ]._serialized_options = b"\030\0010\001" + _BUILDROUTEREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _BUILDROUTEREQUEST.fields_by_name["outgoing_chan_id"]._serialized_options = b"0\001" + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._options = None + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _ROUTER.methods_by_name["SendToRoute"]._options = None + _ROUTER.methods_by_name["SendToRoute"]._serialized_options = b"\210\002\001" + _ROUTER.methods_by_name["SendPayment"]._options = None + _ROUTER.methods_by_name["SendPayment"]._serialized_options = b"\210\002\001" + _ROUTER.methods_by_name["TrackPayment"]._options = None + _ROUTER.methods_by_name["TrackPayment"]._serialized_options = b"\210\002\001" + _FAILUREDETAIL._serialized_start = 4280 + _FAILUREDETAIL._serialized_end = 4793 + _PAYMENTSTATE._serialized_start = 4796 + _PAYMENTSTATE._serialized_end = 4970 + _RESOLVEHOLDFORWARDACTION._serialized_start = 4972 + _RESOLVEHOLDFORWARDACTION._serialized_end = 5032 + _CHANSTATUSACTION._serialized_start = 5034 + _CHANSTATUSACTION._serialized_end = 5087 + _SENDPAYMENTREQUEST._serialized_start = 45 + _SENDPAYMENTREQUEST._serialized_end = 740 + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 684 + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 740 + _TRACKPAYMENTREQUEST._serialized_start = 742 + _TRACKPAYMENTREQUEST._serialized_end = 814 + _ROUTEFEEREQUEST._serialized_start = 816 + _ROUTEFEEREQUEST._serialized_end = 864 + _ROUTEFEERESPONSE._serialized_start = 866 + _ROUTEFEERESPONSE._serialized_end = 935 + _SENDTOROUTEREQUEST._serialized_start = 937 + _SENDTOROUTEREQUEST._serialized_end = 1031 + _SENDTOROUTERESPONSE._serialized_start = 1033 + _SENDTOROUTERESPONSE._serialized_end = 1105 + _RESETMISSIONCONTROLREQUEST._serialized_start = 1107 + _RESETMISSIONCONTROLREQUEST._serialized_end = 1135 + _RESETMISSIONCONTROLRESPONSE._serialized_start = 1137 + _RESETMISSIONCONTROLRESPONSE._serialized_end = 1166 + _QUERYMISSIONCONTROLREQUEST._serialized_start = 1168 + _QUERYMISSIONCONTROLREQUEST._serialized_end = 1196 + _QUERYMISSIONCONTROLRESPONSE._serialized_start = 1198 + _QUERYMISSIONCONTROLRESPONSE._serialized_end = 1272 + _XIMPORTMISSIONCONTROLREQUEST._serialized_start = 1274 + _XIMPORTMISSIONCONTROLREQUEST._serialized_end = 1358 + _XIMPORTMISSIONCONTROLRESPONSE._serialized_start = 1360 + _XIMPORTMISSIONCONTROLRESPONSE._serialized_end = 1391 + _PAIRHISTORY._serialized_start = 1393 + _PAIRHISTORY._serialized_end = 1504 + _PAIRDATA._serialized_start = 1507 + _PAIRDATA._serialized_end = 1660 + _GETMISSIONCONTROLCONFIGREQUEST._serialized_start = 1662 + _GETMISSIONCONTROLCONFIGREQUEST._serialized_end = 1694 + _GETMISSIONCONTROLCONFIGRESPONSE._serialized_start = 1696 + _GETMISSIONCONTROLCONFIGRESPONSE._serialized_end = 1778 + _SETMISSIONCONTROLCONFIGREQUEST._serialized_start = 1780 + _SETMISSIONCONTROLCONFIGREQUEST._serialized_end = 1861 + _SETMISSIONCONTROLCONFIGRESPONSE._serialized_start = 1863 + _SETMISSIONCONTROLCONFIGRESPONSE._serialized_end = 1896 + _MISSIONCONTROLCONFIG._serialized_start = 1899 + _MISSIONCONTROLCONFIG._serialized_end = 2062 + _QUERYPROBABILITYREQUEST._serialized_start = 2064 + _QUERYPROBABILITYREQUEST._serialized_end = 2143 + _QUERYPROBABILITYRESPONSE._serialized_start = 2145 + _QUERYPROBABILITYRESPONSE._serialized_end = 2230 + _BUILDROUTEREQUEST._serialized_start = 2233 + _BUILDROUTEREQUEST._serialized_end = 2369 + _BUILDROUTERESPONSE._serialized_start = 2371 + _BUILDROUTERESPONSE._serialized_end = 2420 + _SUBSCRIBEHTLCEVENTSREQUEST._serialized_start = 2422 + _SUBSCRIBEHTLCEVENTSREQUEST._serialized_end = 2450 + _HTLCEVENT._serialized_start = 2453 + _HTLCEVENT._serialized_end = 2929 + _HTLCEVENT_EVENTTYPE._serialized_start = 2860 + _HTLCEVENT_EVENTTYPE._serialized_end = 2920 + _HTLCINFO._serialized_start = 2931 + _HTLCINFO._serialized_end = 3049 + _FORWARDEVENT._serialized_start = 3051 + _FORWARDEVENT._serialized_end = 3100 + _FORWARDFAILEVENT._serialized_start = 3102 + _FORWARDFAILEVENT._serialized_end = 3120 + _SETTLEEVENT._serialized_start = 3122 + _SETTLEEVENT._serialized_end = 3153 + _LINKFAILEVENT._serialized_start = 3156 + _LINKFAILEVENT._serialized_end = 3330 + _PAYMENTSTATUS._serialized_start = 3332 + _PAYMENTSTATUS._serialized_end = 3446 + _CIRCUITKEY._serialized_start = 3448 + _CIRCUITKEY._serialized_end = 3494 + _FORWARDHTLCINTERCEPTREQUEST._serialized_start = 3497 + _FORWARDHTLCINTERCEPTREQUEST._serialized_end = 3904 + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_start = 3852 + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_end = 3904 + _FORWARDHTLCINTERCEPTRESPONSE._serialized_start = 3907 + _FORWARDHTLCINTERCEPTRESPONSE._serialized_end = 4136 + _UPDATECHANSTATUSREQUEST._serialized_start = 4138 + _UPDATECHANSTATUSREQUEST._serialized_end = 4249 + _UPDATECHANSTATUSRESPONSE._serialized_start = 4251 + _UPDATECHANSTATUSRESPONSE._serialized_end = 4277 + _ROUTER._serialized_start = 5090 + _ROUTER._serialized_end = 6611 +# @@protoc_insertion_point(module_scope) diff --git a/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py b/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py new file mode 100644 index 00000000..32923a91 --- /dev/null +++ b/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py @@ -0,0 +1,871 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +import lnbits.wallets.lnd_grpc_files.lightning_pb2 as lightning__pb2 +import lnbits.wallets.lnd_grpc_files.router_pb2 as router__pb2 + + +class RouterStub(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SendPaymentV2 = channel.unary_stream( + "/routerrpc.Router/SendPaymentV2", + request_serializer=router__pb2.SendPaymentRequest.SerializeToString, + response_deserializer=lightning__pb2.Payment.FromString, + ) + self.TrackPaymentV2 = channel.unary_stream( + "/routerrpc.Router/TrackPaymentV2", + request_serializer=router__pb2.TrackPaymentRequest.SerializeToString, + response_deserializer=lightning__pb2.Payment.FromString, + ) + self.EstimateRouteFee = channel.unary_unary( + "/routerrpc.Router/EstimateRouteFee", + request_serializer=router__pb2.RouteFeeRequest.SerializeToString, + response_deserializer=router__pb2.RouteFeeResponse.FromString, + ) + self.SendToRoute = channel.unary_unary( + "/routerrpc.Router/SendToRoute", + request_serializer=router__pb2.SendToRouteRequest.SerializeToString, + response_deserializer=router__pb2.SendToRouteResponse.FromString, + ) + self.SendToRouteV2 = channel.unary_unary( + "/routerrpc.Router/SendToRouteV2", + request_serializer=router__pb2.SendToRouteRequest.SerializeToString, + response_deserializer=lightning__pb2.HTLCAttempt.FromString, + ) + self.ResetMissionControl = channel.unary_unary( + "/routerrpc.Router/ResetMissionControl", + request_serializer=router__pb2.ResetMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.ResetMissionControlResponse.FromString, + ) + self.QueryMissionControl = channel.unary_unary( + "/routerrpc.Router/QueryMissionControl", + request_serializer=router__pb2.QueryMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.QueryMissionControlResponse.FromString, + ) + self.XImportMissionControl = channel.unary_unary( + "/routerrpc.Router/XImportMissionControl", + request_serializer=router__pb2.XImportMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.XImportMissionControlResponse.FromString, + ) + self.GetMissionControlConfig = channel.unary_unary( + "/routerrpc.Router/GetMissionControlConfig", + request_serializer=router__pb2.GetMissionControlConfigRequest.SerializeToString, + response_deserializer=router__pb2.GetMissionControlConfigResponse.FromString, + ) + self.SetMissionControlConfig = channel.unary_unary( + "/routerrpc.Router/SetMissionControlConfig", + request_serializer=router__pb2.SetMissionControlConfigRequest.SerializeToString, + response_deserializer=router__pb2.SetMissionControlConfigResponse.FromString, + ) + self.QueryProbability = channel.unary_unary( + "/routerrpc.Router/QueryProbability", + request_serializer=router__pb2.QueryProbabilityRequest.SerializeToString, + response_deserializer=router__pb2.QueryProbabilityResponse.FromString, + ) + self.BuildRoute = channel.unary_unary( + "/routerrpc.Router/BuildRoute", + request_serializer=router__pb2.BuildRouteRequest.SerializeToString, + response_deserializer=router__pb2.BuildRouteResponse.FromString, + ) + self.SubscribeHtlcEvents = channel.unary_stream( + "/routerrpc.Router/SubscribeHtlcEvents", + request_serializer=router__pb2.SubscribeHtlcEventsRequest.SerializeToString, + response_deserializer=router__pb2.HtlcEvent.FromString, + ) + self.SendPayment = channel.unary_stream( + "/routerrpc.Router/SendPayment", + request_serializer=router__pb2.SendPaymentRequest.SerializeToString, + response_deserializer=router__pb2.PaymentStatus.FromString, + ) + self.TrackPayment = channel.unary_stream( + "/routerrpc.Router/TrackPayment", + request_serializer=router__pb2.TrackPaymentRequest.SerializeToString, + response_deserializer=router__pb2.PaymentStatus.FromString, + ) + self.HtlcInterceptor = channel.stream_stream( + "/routerrpc.Router/HtlcInterceptor", + request_serializer=router__pb2.ForwardHtlcInterceptResponse.SerializeToString, + response_deserializer=router__pb2.ForwardHtlcInterceptRequest.FromString, + ) + self.UpdateChanStatus = channel.unary_unary( + "/routerrpc.Router/UpdateChanStatus", + request_serializer=router__pb2.UpdateChanStatusRequest.SerializeToString, + response_deserializer=router__pb2.UpdateChanStatusResponse.FromString, + ) + + +class RouterServicer(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + def SendPaymentV2(self, request, context): + """ + SendPaymentV2 attempts to route a payment described by the passed + PaymentRequest to the final destination. The call returns a stream of + payment updates. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def TrackPaymentV2(self, request, context): + """ + TrackPaymentV2 returns an update stream for the payment identified by the + payment hash. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def EstimateRouteFee(self, request, context): + """ + EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + may cost to send an HTLC to the target end destination. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendToRoute(self, request, context): + """ + Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + the specified route. This method differs from SendPayment in that it + allows users to specify a full route manually. This can be used for + things like rebalancing, and atomic swaps. It differs from the newer + SendToRouteV2 in that it doesn't return the full HTLC information. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendToRouteV2(self, request, context): + """ + SendToRouteV2 attempts to make a payment via the specified route. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ResetMissionControl(self, request, context): + """ + ResetMissionControl clears all mission control state and starts with a clean + slate. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def QueryMissionControl(self, request, context): + """ + QueryMissionControl exposes the internal mission control state to callers. + It is a development feature. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def XImportMissionControl(self, request, context): + """ + XImportMissionControl is an experimental API that imports the state provided + to the internal mission control's state, using all results which are more + recent than our existing values. These values will only be imported + in-memory, and will not be persisted across restarts. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetMissionControlConfig(self, request, context): + """ + GetMissionControlConfig returns mission control's current config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SetMissionControlConfig(self, request, context): + """ + SetMissionControlConfig will set mission control's config, if the config + provided is valid. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def QueryProbability(self, request, context): + """ + QueryProbability returns the current success probability estimate for a + given node pair and amount. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def BuildRoute(self, request, context): + """ + BuildRoute builds a fully specified route based on a list of hop public + keys. It retrieves the relevant channel policies from the graph in order to + calculate the correct fees and time locks. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SubscribeHtlcEvents(self, request, context): + """ + SubscribeHtlcEvents creates a uni-directional stream from the server to + the client which delivers a stream of htlc events. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendPayment(self, request, context): + """ + Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + described by the passed PaymentRequest to the final destination. The call + returns a stream of payment status updates. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def TrackPayment(self, request, context): + """ + Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + the payment identified by the payment hash. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def HtlcInterceptor(self, request_iterator, context): + """* + HtlcInterceptor dispatches a bi-directional streaming RPC in which + Forwarded HTLC requests are sent to the client and the client responds with + a boolean that tells LND if this htlc should be intercepted. + In case of interception, the htlc can be either settled, cancelled or + resumed later by using the ResolveHoldForward endpoint. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def UpdateChanStatus(self, request, context): + """ + UpdateChanStatus attempts to manually set the state of a channel + (enabled, disabled, or auto). A manual "disable" request will cause the + channel to stay disabled until a subsequent manual request of either + "enable" or "auto". + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_RouterServicer_to_server(servicer, server): + rpc_method_handlers = { + "SendPaymentV2": grpc.unary_stream_rpc_method_handler( + servicer.SendPaymentV2, + request_deserializer=router__pb2.SendPaymentRequest.FromString, + response_serializer=lightning__pb2.Payment.SerializeToString, + ), + "TrackPaymentV2": grpc.unary_stream_rpc_method_handler( + servicer.TrackPaymentV2, + request_deserializer=router__pb2.TrackPaymentRequest.FromString, + response_serializer=lightning__pb2.Payment.SerializeToString, + ), + "EstimateRouteFee": grpc.unary_unary_rpc_method_handler( + servicer.EstimateRouteFee, + request_deserializer=router__pb2.RouteFeeRequest.FromString, + response_serializer=router__pb2.RouteFeeResponse.SerializeToString, + ), + "SendToRoute": grpc.unary_unary_rpc_method_handler( + servicer.SendToRoute, + request_deserializer=router__pb2.SendToRouteRequest.FromString, + response_serializer=router__pb2.SendToRouteResponse.SerializeToString, + ), + "SendToRouteV2": grpc.unary_unary_rpc_method_handler( + servicer.SendToRouteV2, + request_deserializer=router__pb2.SendToRouteRequest.FromString, + response_serializer=lightning__pb2.HTLCAttempt.SerializeToString, + ), + "ResetMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.ResetMissionControl, + request_deserializer=router__pb2.ResetMissionControlRequest.FromString, + response_serializer=router__pb2.ResetMissionControlResponse.SerializeToString, + ), + "QueryMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.QueryMissionControl, + request_deserializer=router__pb2.QueryMissionControlRequest.FromString, + response_serializer=router__pb2.QueryMissionControlResponse.SerializeToString, + ), + "XImportMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.XImportMissionControl, + request_deserializer=router__pb2.XImportMissionControlRequest.FromString, + response_serializer=router__pb2.XImportMissionControlResponse.SerializeToString, + ), + "GetMissionControlConfig": grpc.unary_unary_rpc_method_handler( + servicer.GetMissionControlConfig, + request_deserializer=router__pb2.GetMissionControlConfigRequest.FromString, + response_serializer=router__pb2.GetMissionControlConfigResponse.SerializeToString, + ), + "SetMissionControlConfig": grpc.unary_unary_rpc_method_handler( + servicer.SetMissionControlConfig, + request_deserializer=router__pb2.SetMissionControlConfigRequest.FromString, + response_serializer=router__pb2.SetMissionControlConfigResponse.SerializeToString, + ), + "QueryProbability": grpc.unary_unary_rpc_method_handler( + servicer.QueryProbability, + request_deserializer=router__pb2.QueryProbabilityRequest.FromString, + response_serializer=router__pb2.QueryProbabilityResponse.SerializeToString, + ), + "BuildRoute": grpc.unary_unary_rpc_method_handler( + servicer.BuildRoute, + request_deserializer=router__pb2.BuildRouteRequest.FromString, + response_serializer=router__pb2.BuildRouteResponse.SerializeToString, + ), + "SubscribeHtlcEvents": grpc.unary_stream_rpc_method_handler( + servicer.SubscribeHtlcEvents, + request_deserializer=router__pb2.SubscribeHtlcEventsRequest.FromString, + response_serializer=router__pb2.HtlcEvent.SerializeToString, + ), + "SendPayment": grpc.unary_stream_rpc_method_handler( + servicer.SendPayment, + request_deserializer=router__pb2.SendPaymentRequest.FromString, + response_serializer=router__pb2.PaymentStatus.SerializeToString, + ), + "TrackPayment": grpc.unary_stream_rpc_method_handler( + servicer.TrackPayment, + request_deserializer=router__pb2.TrackPaymentRequest.FromString, + response_serializer=router__pb2.PaymentStatus.SerializeToString, + ), + "HtlcInterceptor": grpc.stream_stream_rpc_method_handler( + servicer.HtlcInterceptor, + request_deserializer=router__pb2.ForwardHtlcInterceptResponse.FromString, + response_serializer=router__pb2.ForwardHtlcInterceptRequest.SerializeToString, + ), + "UpdateChanStatus": grpc.unary_unary_rpc_method_handler( + servicer.UpdateChanStatus, + request_deserializer=router__pb2.UpdateChanStatusRequest.FromString, + response_serializer=router__pb2.UpdateChanStatusResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "routerrpc.Router", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class Router(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + @staticmethod + def SendPaymentV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SendPaymentV2", + router__pb2.SendPaymentRequest.SerializeToString, + lightning__pb2.Payment.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def TrackPaymentV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/TrackPaymentV2", + router__pb2.TrackPaymentRequest.SerializeToString, + lightning__pb2.Payment.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def EstimateRouteFee( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/EstimateRouteFee", + router__pb2.RouteFeeRequest.SerializeToString, + router__pb2.RouteFeeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendToRoute( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SendToRoute", + router__pb2.SendToRouteRequest.SerializeToString, + router__pb2.SendToRouteResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendToRouteV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SendToRouteV2", + router__pb2.SendToRouteRequest.SerializeToString, + lightning__pb2.HTLCAttempt.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ResetMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/ResetMissionControl", + router__pb2.ResetMissionControlRequest.SerializeToString, + router__pb2.ResetMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def QueryMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/QueryMissionControl", + router__pb2.QueryMissionControlRequest.SerializeToString, + router__pb2.QueryMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def XImportMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/XImportMissionControl", + router__pb2.XImportMissionControlRequest.SerializeToString, + router__pb2.XImportMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def GetMissionControlConfig( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/GetMissionControlConfig", + router__pb2.GetMissionControlConfigRequest.SerializeToString, + router__pb2.GetMissionControlConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SetMissionControlConfig( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SetMissionControlConfig", + router__pb2.SetMissionControlConfigRequest.SerializeToString, + router__pb2.SetMissionControlConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def QueryProbability( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/QueryProbability", + router__pb2.QueryProbabilityRequest.SerializeToString, + router__pb2.QueryProbabilityResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def BuildRoute( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/BuildRoute", + router__pb2.BuildRouteRequest.SerializeToString, + router__pb2.BuildRouteResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SubscribeHtlcEvents( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SubscribeHtlcEvents", + router__pb2.SubscribeHtlcEventsRequest.SerializeToString, + router__pb2.HtlcEvent.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendPayment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SendPayment", + router__pb2.SendPaymentRequest.SerializeToString, + router__pb2.PaymentStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def TrackPayment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/TrackPayment", + router__pb2.TrackPaymentRequest.SerializeToString, + router__pb2.PaymentStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def HtlcInterceptor( + request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.stream_stream( + request_iterator, + target, + "/routerrpc.Router/HtlcInterceptor", + router__pb2.ForwardHtlcInterceptResponse.SerializeToString, + router__pb2.ForwardHtlcInterceptRequest.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def UpdateChanStatus( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/UpdateChanStatus", + router__pb2.UpdateChanStatusRequest.SerializeToString, + router__pb2.UpdateChanStatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/lnbits/wallets/lndgrpc.py b/lnbits/wallets/lndgrpc.py index 44fee78c..7f6135ad 100644 --- a/lnbits/wallets/lndgrpc.py +++ b/lnbits/wallets/lndgrpc.py @@ -2,10 +2,11 @@ imports_ok = True try: import grpc from google import protobuf + from grpc import RpcError except ImportError: # pragma: nocover imports_ok = False - +import asyncio import base64 import binascii import hashlib @@ -19,6 +20,8 @@ from .macaroon import AESCipher, load_macaroon if imports_ok: import lnbits.wallets.lnd_grpc_files.lightning_pb2 as ln import lnbits.wallets.lnd_grpc_files.lightning_pb2_grpc as lnrpc + import lnbits.wallets.lnd_grpc_files.router_pb2 as router + import lnbits.wallets.lnd_grpc_files.router_pb2_grpc as routerrpc from .base import ( InvoiceResponse, @@ -62,14 +65,32 @@ def get_ssl_context(cert_path: str): return context -def parse_checking_id(checking_id: str) -> bytes: +def b64_to_bytes(checking_id: str) -> bytes: return base64.b64decode(checking_id.replace("_", "/")) -def stringify_checking_id(r_hash: bytes) -> str: +def bytes_to_b64(r_hash: bytes) -> str: return base64.b64encode(r_hash).decode("utf-8").replace("/", "_") +def hex_to_b64(hex_str: str) -> str: + try: + return base64.b64encode(bytes.fromhex(hex_str)).decode() + except ValueError: + return "" + + +def hex_to_bytes(hex_str: str) -> bytes: + try: + return bytes.fromhex(hex_str) + except: + return b"" + + +def bytes_to_hex(b: bytes) -> str: + return b.hex() + + # Due to updated ECDSA generated tls.cert we need to let gprc know that # we need to use that cipher suite otherwise there will be a handhsake # error when we communicate with the lnd rpc server. @@ -111,6 +132,7 @@ class LndWallet(Wallet): f"{self.endpoint}:{self.port}", composite_creds ) self.rpc = lnrpc.LightningStub(channel) + self.routerpc = routerrpc.RouterStub(channel) def metadata_callback(self, _, callback): callback([("macaroon", self.macaroon)], None) @@ -118,6 +140,8 @@ class LndWallet(Wallet): async def status(self) -> StatusResponse: try: resp = await self.rpc.ChannelBalance(ln.ChannelBalanceRequest()) + except RpcError as exc: + return StatusResponse(str(exc._details), 0) except Exception as exc: return StatusResponse(str(exc), 0) @@ -128,11 +152,15 @@ class LndWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: params: Dict = {"value": amount, "expiry": 600, "private": True} - if description_hash: - params["description_hash"] = description_hash # as bytes directly + params["description_hash"] = description_hash + elif unhashed_description: + params["description_hash"] = hashlib.sha256( + unhashed_description + ).digest() # as bytes directly else: params["memo"] = memo or "" @@ -143,27 +171,82 @@ class LndWallet(Wallet): error_message = str(exc) return InvoiceResponse(False, None, None, error_message) - checking_id = stringify_checking_id(resp.r_hash) + checking_id = bytes_to_hex(resp.r_hash) payment_request = str(resp.payment_request) return InvoiceResponse(True, checking_id, payment_request, None) async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: - fee_limit_fixed = ln.FeeLimit(fixed=fee_limit_msat // 1000) - req = ln.SendRequest(payment_request=bolt11, fee_limit=fee_limit_fixed) - resp = await self.rpc.SendPaymentSync(req) + # fee_limit_fixed = ln.FeeLimit(fixed=fee_limit_msat // 1000) + req = router.SendPaymentRequest( + payment_request=bolt11, + fee_limit_msat=fee_limit_msat, + timeout_seconds=30, + no_inflight_updates=True, + ) + try: + resp = await self.routerpc.SendPaymentV2(req).read() + except RpcError as exc: + return PaymentResponse(False, None, None, None, exc._details) + except Exception as exc: + return PaymentResponse(False, None, None, None, str(exc)) - if resp.payment_error: - return PaymentResponse(False, "", 0, None, resp.payment_error) + # PaymentStatus from https://github.com/lightningnetwork/lnd/blob/master/channeldb/payments.go#L178 + statuses = { + 0: None, # NON_EXISTENT + 1: None, # IN_FLIGHT + 2: True, # SUCCEEDED + 3: False, # FAILED + } - r_hash = hashlib.sha256(resp.payment_preimage).digest() - checking_id = stringify_checking_id(r_hash) - fee_msat = resp.payment_route.total_fees_msat - preimage = resp.payment_preimage.hex() - return PaymentResponse(True, checking_id, fee_msat, preimage, None) + failure_reasons = { + 0: "No error given.", + 1: "Payment timed out.", + 2: "No route to destination.", + 3: "Error.", + 4: "Incorrect payment details.", + 5: "Insufficient balance.", + } + + fee_msat = None + preimage = None + error_message = None + checking_id = None + + if statuses[resp.status] == True: # SUCCEEDED + fee_msat = -resp.htlcs[-1].route.total_fees_msat + preimage = resp.payment_preimage + checking_id = resp.payment_hash + elif statuses[resp.status] == False: + error_message = failure_reasons[resp.failure_reason] + + return PaymentResponse( + statuses[resp.status], checking_id, fee_msat, preimage, error_message + ) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: try: - r_hash = parse_checking_id(checking_id) + r_hash = hex_to_bytes(checking_id) + if len(r_hash) != 32: + raise binascii.Error + except binascii.Error: + # this may happen if we switch between backend wallets + # that use different checking_id formats + return PaymentStatus(None) + try: + resp = await self.rpc.LookupInvoice(ln.PaymentHash(r_hash=r_hash)) + except RpcError as exc: + return PaymentStatus(None) + if resp.settled: + return PaymentStatus(True) + + return PaymentStatus(None) + + async def get_payment_status(self, checking_id: str) -> PaymentStatus: + """ + This routine checks the payment status using routerpc.TrackPaymentV2. + """ + try: + r_hash = hex_to_bytes(checking_id) if len(r_hash) != 32: raise binascii.Error except binascii.Error: @@ -171,27 +254,50 @@ class LndWallet(Wallet): # that use different checking_id formats return PaymentStatus(None) - resp = await self.rpc.LookupInvoice(ln.PaymentHash(r_hash=r_hash)) - if resp.settled: - return PaymentStatus(True) + resp = self.routerpc.TrackPaymentV2( + router.TrackPaymentRequest(payment_hash=r_hash) + ) + + # # HTLCAttempt.HTLCStatus: + # # https://github.com/lightningnetwork/lnd/blob/master/lnrpc/lightning.proto#L3641 + # htlc_statuses = { + # 0: None, # IN_FLIGHT + # 1: True, # "SUCCEEDED" + # 2: False, # "FAILED" + # } + statuses = { + 0: None, # NON_EXISTENT + 1: None, # IN_FLIGHT + 2: True, # SUCCEEDED + 3: False, # FAILED + } + + try: + async for payment in resp: + if len(payment.htlcs) and statuses[payment.status]: + return PaymentStatus( + True, + -payment.htlcs[-1].route.total_fees_msat, + bytes_to_hex(payment.htlcs[-1].preimage), + ) + return PaymentStatus(statuses[payment.status]) + except: # most likely the payment wasn't found + return PaymentStatus(None) return PaymentStatus(None) - async def get_payment_status(self, checking_id: str) -> PaymentStatus: - return PaymentStatus(True) - async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: - request = ln.InvoiceSubscription() - try: - async for i in self.rpc.SubscribeInvoices(request): - if not i.settled: - continue + while True: + try: + request = ln.InvoiceSubscription() + async for i in self.rpc.SubscribeInvoices(request): + if not i.settled: + continue - checking_id = stringify_checking_id(i.r_hash) - yield checking_id - except error: - logger.error(error) - - logger.error( - "lost connection to lnd InvoiceSubscription, please restart lnbits." - ) + checking_id = bytes_to_hex(i.r_hash) + yield checking_id + except Exception as exc: + logger.error( + f"lost connection to lnd invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index 575db64d..1083e48a 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -1,5 +1,6 @@ import asyncio import base64 +import hashlib import json from os import getenv from pydoc import describe @@ -72,12 +73,18 @@ class LndRestWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"value": amount, "private": True} if description_hash: data["description_hash"] = base64.b64encode(description_hash).decode( "ascii" ) + elif unhashed_description: + data["description_hash"] = base64.b64encode( + hashlib.sha256(unhashed_description).digest() + ).decode("ascii") else: data["memo"] = memo or "" @@ -116,18 +123,15 @@ class LndRestWallet(Wallet): if r.is_error or r.json().get("payment_error"): error_message = r.json().get("payment_error") or r.text - return PaymentResponse(False, None, 0, None, error_message) + return PaymentResponse(False, None, None, None, error_message) data = r.json() - payment_hash = data["payment_hash"] - checking_id = payment_hash + checking_id = base64.b64decode(data["payment_hash"]).hex() fee_msat = int(data["payment_route"]["total_fees_msat"]) preimage = base64.b64decode(data["payment_preimage"]).hex() return PaymentResponse(True, checking_id, fee_msat, preimage, None) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: - checking_id = checking_id.replace("_", "/") - async with httpx.AsyncClient(verify=self.cert) as client: r = await client.get( url=f"{self.endpoint}/v1/invoice/{checking_id}", headers=self.auth @@ -141,18 +145,21 @@ class LndRestWallet(Wallet): return PaymentStatus(True) async def get_payment_status(self, checking_id: str) -> PaymentStatus: - async with httpx.AsyncClient(verify=self.cert) as client: - r = await client.get( - url=f"{self.endpoint}/v1/payments", - headers=self.auth, - params={"max_payments": "20", "reversed": True}, + """ + This routine checks the payment status using routerpc.TrackPaymentV2. + """ + # convert checking_id from hex to base64 and some LND magic + try: + checking_id = base64.urlsafe_b64encode(bytes.fromhex(checking_id)).decode( + "ascii" ) - - if r.is_error: + except ValueError: return PaymentStatus(None) + url = f"{self.endpoint}/v2/router/track/{checking_id}" + # check payment.status: - # https://api.lightning.community/rest/index.html?python#peersynctype + # https://api.lightning.community/?python=#paymentpaymentstatus statuses = { "UNKNOWN": None, "IN_FLIGHT": None, @@ -160,22 +167,38 @@ class LndRestWallet(Wallet): "FAILED": False, } - # for some reason our checking_ids are in base64 but the payment hashes - # returned here are in hex, lnd is weird - checking_id = checking_id.replace("_", "/") - checking_id = base64.b64decode(checking_id).hex() - - for p in r.json()["payments"]: - if p["payment_hash"] == checking_id: - return PaymentStatus(statuses[p["status"]]) + async with httpx.AsyncClient( + timeout=None, headers=self.auth, verify=self.cert + ) as client: + async with client.stream("GET", url) as r: + async for l in r.aiter_lines(): + try: + line = json.loads(l) + if line.get("error"): + logger.error( + line["error"]["message"] + if "message" in line["error"] + else line["error"] + ) + return PaymentStatus(None) + payment = line.get("result") + if payment is not None and payment.get("status"): + return PaymentStatus( + paid=statuses[payment["status"]], + fee_msat=payment.get("fee_msat"), + preimage=payment.get("payment_preimage"), + ) + else: + return PaymentStatus(None) + except: + continue return PaymentStatus(None) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: - url = self.endpoint + "/v1/invoices/subscribe" - while True: try: + url = self.endpoint + "/v1/invoices/subscribe" async with httpx.AsyncClient( timeout=None, headers=self.auth, verify=self.cert ) as client: @@ -190,10 +213,8 @@ class LndRestWallet(Wallet): payment_hash = base64.b64decode(inv["r_hash"]).hex() yield payment_hash - except (OSError, httpx.ConnectError, httpx.ReadError): - pass - - logger.error( - "lost connection to lnd invoices stream, retrying in 5 seconds" - ) - await asyncio.sleep(5) + except Exception as exc: + logger.error( + f"lost connection to lnd invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) diff --git a/lnbits/wallets/lnpay.py b/lnbits/wallets/lnpay.py index 18b4f8bb..5db68e1f 100644 --- a/lnbits/wallets/lnpay.py +++ b/lnbits/wallets/lnpay.py @@ -1,4 +1,5 @@ import asyncio +import hashlib import json from http import HTTPStatus from os import getenv @@ -51,10 +52,14 @@ class LNPayWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"num_satoshis": f"{amount}"} if description_hash: data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["memo"] = memo or "" @@ -95,7 +100,7 @@ class LNPayWallet(Wallet): ) if r.is_error: - return PaymentResponse(False, None, 0, None, data["message"]) + return PaymentResponse(False, None, None, None, data["message"]) checking_id = data["lnTx"]["id"] fee_msat = 0 @@ -108,15 +113,18 @@ class LNPayWallet(Wallet): async def get_payment_status(self, checking_id: str) -> PaymentStatus: async with httpx.AsyncClient() as client: r = await client.get( - url=f"{self.endpoint}/lntx/{checking_id}?fields=settled", + url=f"{self.endpoint}/lntx/{checking_id}", headers=self.auth, ) if r.is_error: return PaymentStatus(None) + data = r.json() + preimage = data["payment_preimage"] + fee_msat = data["fee_msat"] statuses = {0: None, 1: True, -1: False} - return PaymentStatus(statuses[r.json()["settled"]]) + return PaymentStatus(statuses[data["settled"]], fee_msat, preimage) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: self.queue: asyncio.Queue = asyncio.Queue(0) diff --git a/lnbits/wallets/lntxbot.py b/lnbits/wallets/lntxbot.py index 3c758e6c..13046d26 100644 --- a/lnbits/wallets/lntxbot.py +++ b/lnbits/wallets/lntxbot.py @@ -1,4 +1,5 @@ import asyncio +import hashlib import json from os import getenv from typing import AsyncGenerator, Dict, Optional @@ -51,10 +52,14 @@ class LntxbotWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"amt": str(amount)} if description_hash: data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["memo"] = memo or "" @@ -92,10 +97,11 @@ class LntxbotWallet(Wallet): except: error_message = r.text pass - - return PaymentResponse(False, None, 0, None, error_message) + return PaymentResponse(False, None, None, None, error_message) data = r.json() + if data.get("type") != "paid_invoice": + return PaymentResponse(None) checking_id = data["payment_hash"] fee_msat = -data["fee_msat"] preimage = data["payment_preimage"] diff --git a/lnbits/wallets/opennode.py b/lnbits/wallets/opennode.py index be82365d..f7dcba40 100644 --- a/lnbits/wallets/opennode.py +++ b/lnbits/wallets/opennode.py @@ -47,15 +47,17 @@ class OpenNodeWallet(Wallet): if r.is_error: return StatusResponse(data["message"], 0) - return StatusResponse(None, data["balance"]["BTC"] / 100_000_000_000) + return StatusResponse(None, data["balance"]["BTC"] * 1000) async def create_invoice( self, amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: - if description_hash: + if description_hash or unhashed_description: raise Unsupported("description_hash") async with httpx.AsyncClient() as client: @@ -65,7 +67,7 @@ class OpenNodeWallet(Wallet): json={ "amount": amount, "description": memo or "", - "callback_url": url_for("/webhook_listener", _external=True), + # "callback_url": url_for("/webhook_listener", _external=True), }, timeout=40, ) @@ -90,11 +92,15 @@ class OpenNodeWallet(Wallet): if r.is_error: error_message = r.json()["message"] - return PaymentResponse(False, None, 0, None, error_message) + return PaymentResponse(False, None, None, None, error_message) data = r.json()["data"] checking_id = data["id"] - fee_msat = data["fee"] * 1000 + fee_msat = -data["fee"] * 1000 + + if data["status"] != "paid": + return PaymentResponse(None, checking_id, fee_msat, None, "payment failed") + return PaymentResponse(True, checking_id, fee_msat, None, None) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: @@ -104,9 +110,9 @@ class OpenNodeWallet(Wallet): ) if r.is_error: return PaymentStatus(None) - - statuses = {"processing": None, "paid": True, "unpaid": False} - return PaymentStatus(statuses[r.json()["data"]["status"]]) + data = r.json()["data"] + statuses = {"processing": None, "paid": True, "unpaid": None} + return PaymentStatus(statuses[data.get("status")]) async def get_payment_status(self, checking_id: str) -> PaymentStatus: async with httpx.AsyncClient() as client: @@ -117,14 +123,16 @@ class OpenNodeWallet(Wallet): if r.is_error: return PaymentStatus(None) + data = r.json()["data"] statuses = { "initial": None, "pending": None, "confirmed": True, - "error": False, + "error": None, "failed": False, } - return PaymentStatus(statuses[r.json()["data"]["status"]]) + fee_msat = -data.get("fee") * 1000 + return PaymentStatus(statuses[data.get("status")], fee_msat) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: self.queue: asyncio.Queue = asyncio.Queue(0) diff --git a/lnbits/wallets/spark.py b/lnbits/wallets/spark.py index 142e388d..414d4e47 100644 --- a/lnbits/wallets/spark.py +++ b/lnbits/wallets/spark.py @@ -1,4 +1,5 @@ import asyncio +import hashlib import json import random from os import getenv @@ -92,6 +93,8 @@ class SparkWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: label = "lbs{}".format(random.random()) checking_id = label @@ -103,6 +106,12 @@ class SparkWallet(Wallet): label=label, description_hash=description_hash.hex(), ) + elif unhashed_description: + r = await self.invoicewithdescriptionhash( + msatoshi=amount * 1000, + label=label, + description_hash=hashlib.sha256(unhashed_description).hexdigest(), + ) else: r = await self.invoice( msatoshi=amount * 1000, @@ -128,7 +137,7 @@ class SparkWallet(Wallet): pays = listpays["pays"] if len(pays) == 0: - return PaymentResponse(False, None, 0, None, str(exc)) + return PaymentResponse(False, None, None, None, str(exc)) pay = pays[0] payment_hash = pay["payment_hash"] @@ -139,11 +148,9 @@ class SparkWallet(Wallet): ) if pay["status"] == "failed": - return PaymentResponse(False, None, 0, None, str(exc)) + return PaymentResponse(False, None, None, None, str(exc)) elif pay["status"] == "pending": - return PaymentResponse( - None, payment_hash, fee_limit_msat, None, None - ) + return PaymentResponse(None, payment_hash, None, None, None) elif pay["status"] == "complete": r = pay r["payment_preimage"] = pay["preimage"] @@ -154,7 +161,7 @@ class SparkWallet(Wallet): # this is good pass - fee_msat = r["msatoshi_sent"] - r["msatoshi"] + fee_msat = -int(r["msatoshi_sent"] - r["msatoshi"]) preimage = r["payment_preimage"] return PaymentResponse(True, r["payment_hash"], fee_msat, preimage, None) @@ -192,7 +199,10 @@ class SparkWallet(Wallet): if r["pays"][0]["payment_hash"] == checking_id: status = r["pays"][0]["status"] if status == "complete": - return PaymentStatus(True) + fee_msat = -int( + r["pays"][0]["amount_sent_msat"] - r["pays"][0]["amount_msat"] + ) + return PaymentStatus(True, fee_msat, r["pays"][0]["preimage"]) elif status == "failed": return PaymentStatus(False) return PaymentStatus(None) diff --git a/lnbits/wallets/void.py b/lnbits/wallets/void.py index 1139f7a8..0de387aa 100644 --- a/lnbits/wallets/void.py +++ b/lnbits/wallets/void.py @@ -18,6 +18,7 @@ class VoidWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: raise Unsupported("") @@ -31,10 +32,10 @@ class VoidWallet(Wallet): raise Unsupported("") async def get_invoice_status(self, checking_id: str) -> PaymentStatus: - raise Unsupported("") + return PaymentStatus(None) async def get_payment_status(self, checking_id: str) -> PaymentStatus: - raise Unsupported("") + return PaymentStatus(None) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: yield "" diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index e5a974b5..00000000 --- a/mypy.ini +++ /dev/null @@ -1,8 +0,0 @@ -[mypy] -ignore_missing_imports = True -exclude = (?x)( - ^lnbits/extensions. - | ^lnbits/wallets/lnd_grpc_files. - ) -[mypy-lnbits.wallets.lnd_grpc_files.*] -follow_imports = skip diff --git a/nix/modules/lnbits-service.nix b/nix/modules/lnbits-service.nix index 5d8e0640..e7029e67 100644 --- a/nix/modules/lnbits-service.nix +++ b/nix/modules/lnbits-service.nix @@ -3,7 +3,7 @@ let defaultUser = "lnbits"; cfg = config.services.lnbits; - inherit (lib) mkOption mkIf types optionalAttrs; + inherit (lib) mkOption mkIf types optionalAttrs literalExpression; in { @@ -25,6 +25,7 @@ in }; package = mkOption { type = types.package; + defaultText = literalExpression "pkgs.lnbits"; default = pkgs.lnbits; description = '' The lnbits package to use. diff --git a/poetry.lock b/poetry.lock index 48c508ce..ea83e25e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,6 +1,6 @@ [[package]] name = "aiofiles" -version = "0.7.0" +version = "0.8.0" description = "File support for asyncio." category = "main" optional = false @@ -17,10 +17,11 @@ python-versions = ">=3.6.2" [package.dependencies] idna = ">=2.8" sniffio = ">=1.1" +typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -doc = ["packaging", "sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"] -test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "contextlib2", "uvloop (<0.15)", "mock (>=4)", "uvloop (>=0.15)"] +doc = ["packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphinx-rtd-theme"] +test = ["contextlib2", "coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "mock (>=4)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (<0.15)", "uvloop (>=0.15)"] trio = ["trio (>=0.16)"] [[package]] @@ -31,8 +32,19 @@ category = "main" optional = false python-versions = ">=3.6" +[package.dependencies] +typing-extensions = {version = "*", markers = "python_version < \"3.8\""} + [package.extras] -tests = ["pytest", "pytest-asyncio", "mypy (>=0.800)"] +tests = ["mypy (>=0.800)", "pytest", "pytest-asyncio"] + +[[package]] +name = "asn1crypto" +version = "1.5.1" +description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP" +category = "main" +optional = false +python-versions = "*" [[package]] name = "attrs" @@ -43,10 +55,21 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] -docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +dev = ["coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six", "sphinx", "sphinx-notfound-page", "zope.interface"] +docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "mypy", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "mypy", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six"] + +[[package]] +name = "base58" +version = "2.1.1" +description = "Base58 and Base58Check implementation." +category = "main" +optional = false +python-versions = ">=3.5" + +[package.extras] +tests = ["PyHamcrest (>=2.0.2)", "mypy", "pytest (>=4.6)", "pytest-benchmark", "pytest-cov", "pytest-flake8"] [[package]] name = "bech32" @@ -64,6 +87,29 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "black" +version = "22.8.0" +description = "The uncompromising code formatter." +category = "dev" +optional = false +python-versions = ">=3.6.2" + +[package.dependencies] +click = ">=8.0.0" +mypy-extensions = ">=0.4.3" +pathspec = ">=0.9.0" +platformdirs = ">=2" +tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} +typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} +typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.7.4)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +uvloop = ["uvloop (>=0.15.2)"] + [[package]] name = "cerberus" version = "1.3.4" @@ -112,6 +158,19 @@ python-versions = ">=3.6" [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + +[[package]] +name = "coincurve" +version = "17.0.0" +description = "Cross-platform Python CFFI bindings for libsecp256k1" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +asn1crypto = "*" +cffi = ">=1.3.0" [[package]] name = "colorama" @@ -121,6 +180,39 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +[[package]] +name = "coverage" +version = "6.4.4" +description = "Code coverage measurement for Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.11.0a6\" and extra == \"toml\""} + +[package.extras] +toml = ["tomli"] + +[[package]] +name = "cryptography" +version = "36.0.2" +description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +cffi = ">=1.12" + +[package.extras] +docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] +docstest = ["pyenchant (>=1.6.11)", "sphinxcontrib-spelling (>=4.0.1)", "twine (>=1.12.0)"] +pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] +sdist = ["setuptools_rust (>=0.11.4)"] +ssh = ["bcrypt (>=3.1.5)"] +test = ["hypothesis (>=1.11.4,!=3.79.2)", "iso8601", "pretend", "pytest (>=6.2.0)", "pytest-cov", "pytest-subtests", "pytest-xdist", "pytz"] + [[package]] name = "ecdsa" version = "0.17.0" @@ -144,6 +236,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "enum34" +version = "1.1.10" +description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "environs" version = "9.3.3" @@ -157,10 +257,10 @@ marshmallow = ">=3.0.0" python-dotenv = "*" [package.extras] -dev = ["pytest", "dj-database-url", "dj-email-url", "django-cache-url", "flake8 (==3.9.2)", "flake8-bugbear (==21.4.3)", "mypy (==0.910)", "pre-commit (>=2.4,<3.0)", "tox"] +dev = ["dj-database-url", "dj-email-url", "django-cache-url", "flake8 (==3.9.2)", "flake8-bugbear (==21.4.3)", "mypy (==0.910)", "pre-commit (>=2.4,<3.0)", "pytest", "tox"] django = ["dj-database-url", "dj-email-url", "django-cache-url"] lint = ["flake8 (==3.9.2)", "flake8-bugbear (==21.4.3)", "mypy (==0.910)", "pre-commit (>=2.4,<3.0)"] -tests = ["pytest", "dj-database-url", "dj-email-url", "django-cache-url"] +tests = ["dj-database-url", "dj-email-url", "django-cache-url", "pytest"] [[package]] name = "fastapi" @@ -175,10 +275,24 @@ pydantic = ">=1.6.2,<1.7 || >1.7,<1.7.1 || >1.7.1,<1.7.2 || >1.7.2,<1.7.3 || >1. starlette = "0.19.1" [package.extras] -all = ["requests (>=2.24.0,<3.0.0)", "jinja2 (>=2.11.2,<4.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "itsdangerous (>=1.1.0,<3.0.0)", "pyyaml (>=5.3.1,<7.0.0)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0)", "orjson (>=3.2.1,<4.0.0)", "email_validator (>=1.1.1,<2.0.0)", "uvicorn[standard] (>=0.12.0,<0.18.0)"] -dev = ["python-jose[cryptography] (>=3.3.0,<4.0.0)", "passlib[bcrypt] (>=1.7.2,<2.0.0)", "autoflake (>=1.4.0,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "uvicorn[standard] (>=0.12.0,<0.18.0)", "pre-commit (>=2.17.0,<3.0.0)"] -doc = ["mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs-markdownextradata-plugin (>=0.1.7,<0.3.0)", "typer (>=0.4.1,<0.5.0)", "pyyaml (>=5.3.1,<7.0.0)"] -test = ["pytest (>=6.2.4,<7.0.0)", "pytest-cov (>=2.12.0,<4.0.0)", "mypy (==0.910)", "flake8 (>=3.8.3,<4.0.0)", "black (==22.3.0)", "isort (>=5.0.6,<6.0.0)", "requests (>=2.24.0,<3.0.0)", "httpx (>=0.14.0,<0.19.0)", "email_validator (>=1.1.1,<2.0.0)", "sqlalchemy (>=1.3.18,<1.5.0)", "peewee (>=3.13.3,<4.0.0)", "databases[sqlite] (>=0.3.2,<0.6.0)", "orjson (>=3.2.1,<4.0.0)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "flask (>=1.1.2,<3.0.0)", "anyio[trio] (>=3.2.1,<4.0.0)", "types-ujson (==4.2.1)", "types-orjson (==3.6.2)", "types-dataclasses (==0.6.5)"] +all = ["email_validator (>=1.1.1,<2.0.0)", "itsdangerous (>=1.1.0,<3.0.0)", "jinja2 (>=2.11.2,<4.0.0)", "orjson (>=3.2.1,<4.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "pyyaml (>=5.3.1,<7.0.0)", "requests (>=2.24.0,<3.0.0)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0)", "uvicorn[standard] (>=0.12.0,<0.18.0)"] +dev = ["autoflake (>=1.4.0,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "passlib[bcrypt] (>=1.7.2,<2.0.0)", "pre-commit (>=2.17.0,<3.0.0)", "python-jose[cryptography] (>=3.3.0,<4.0.0)", "uvicorn[standard] (>=0.12.0,<0.18.0)"] +doc = ["mdx-include (>=1.4.1,<2.0.0)", "mkdocs (>=1.1.2,<2.0.0)", "mkdocs-markdownextradata-plugin (>=0.1.7,<0.3.0)", "mkdocs-material (>=8.1.4,<9.0.0)", "pyyaml (>=5.3.1,<7.0.0)", "typer (>=0.4.1,<0.5.0)"] +test = ["anyio[trio] (>=3.2.1,<4.0.0)", "black (==22.3.0)", "databases[sqlite] (>=0.3.2,<0.6.0)", "email_validator (>=1.1.1,<2.0.0)", "flake8 (>=3.8.3,<4.0.0)", "flask (>=1.1.2,<3.0.0)", "httpx (>=0.14.0,<0.19.0)", "isort (>=5.0.6,<6.0.0)", "mypy (==0.910)", "orjson (>=3.2.1,<4.0.0)", "peewee (>=3.13.3,<4.0.0)", "pytest (>=6.2.4,<7.0.0)", "pytest-cov (>=2.12.0,<4.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "requests (>=2.24.0,<3.0.0)", "sqlalchemy (>=1.3.18,<1.5.0)", "types-dataclasses (==0.6.5)", "types-orjson (==3.6.2)", "types-ujson (==4.2.1)", "ujson (>=4.0.1,!=4.0.2,!=4.1.0,!=4.2.0,!=4.3.0,!=5.0.0,!=5.1.0,<6.0.0)"] + +[[package]] +name = "grpcio" +version = "1.49.1" +description = "HTTP/2-based RPC framework" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +six = ">=1.5.2" + +[package.extras] +protobuf = ["grpcio-tools (>=1.49.1)"] [[package]] name = "h11" @@ -190,49 +304,52 @@ python-versions = ">=3.6" [[package]] name = "httpcore" -version = "0.13.7" +version = "0.15.0" description = "A minimal low-level HTTP client." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] anyio = ">=3.0.0,<4.0.0" +certifi = "*" h11 = ">=0.11,<0.13" sniffio = ">=1.0.0,<2.0.0" [package.extras] http2 = ["h2 (>=3,<5)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "httptools" -version = "0.2.0" +version = "0.4.0" description = "A collection of framework independent HTTP protocol utils." category = "main" optional = false -python-versions = "*" +python-versions = ">=3.5.0" [package.extras] -test = ["Cython (==0.29.22)"] +test = ["Cython (>=0.29.24,<0.30.0)"] [[package]] name = "httpx" -version = "0.19.0" +version = "0.23.0" description = "The next generation HTTP client." category = "main" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" [package.dependencies] certifi = "*" -charset-normalizer = "*" -httpcore = ">=0.13.3,<0.14.0" +httpcore = ">=0.15.0,<0.16.0" rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]} sniffio = "*" [package.extras] -brotli = ["brotlicffi", "brotli"] +brotli = ["brotli", "brotlicffi"] +cli = ["click (>=8.0.0,<9.0.0)", "pygments (>=2.0.0,<3.0.0)", "rich (>=10,<13)"] http2 = ["h2 (>=3,<5)"] +socks = ["socksio (>=1.0.0,<2.0.0)"] [[package]] name = "idna" @@ -251,12 +368,35 @@ optional = false python-versions = ">=3.6" [package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] perf = ["ipython"] -testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pep517", "pyfakefs", "pytest (>=4.6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy", "pytest-perf (>=0.9.2)"] + +[[package]] +name = "iniconfig" +version = "1.1.1" +description = "iniconfig: brain-dead simple config-ini parsing" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "isort" +version = "5.10.1" +description = "A Python utility / library to sort Python imports." +category = "dev" +optional = false +python-versions = ">=3.6.1,<4.0" + +[package.extras] +colors = ["colorama (>=0.4.3,<0.5.0)"] +pipfile_deprecated_finder = ["pipreqs", "requirementslib"] +plugins = ["setuptools"] +requirements_deprecated_finder = ["pip-api", "pipreqs"] [[package]] name = "jinja2" @@ -283,6 +423,7 @@ python-versions = ">=3.6" [package.dependencies] bech32 = "*" pydantic = "*" +typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "loguru" @@ -297,7 +438,7 @@ colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} [package.extras] -dev = ["codecov (>=2.0.15)", "colorama (>=0.3.4)", "flake8 (>=3.7.7)", "tox (>=3.9.0)", "tox-travis (>=0.12)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "Sphinx (>=2.2.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "black (>=19.10b0)", "isort (>=5.1.1)"] +dev = ["Sphinx (>=2.2.1)", "black (>=19.10b0)", "codecov (>=2.0.15)", "colorama (>=0.3.4)", "flake8 (>=3.7.7)", "isort (>=5.1.1)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "tox (>=3.9.0)", "tox-travis (>=0.12)"] [[package]] name = "markupsafe" @@ -309,18 +450,61 @@ python-versions = ">=3.6" [[package]] name = "marshmallow" -version = "3.13.0" +version = "3.17.0" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" + +[package.dependencies] +packaging = ">=17.0" [package.extras] -dev = ["pytest", "pytz", "simplejson", "mypy (==0.910)", "flake8 (==3.9.2)", "flake8-bugbear (==21.4.3)", "pre-commit (>=2.4,<3.0)", "tox"] -docs = ["sphinx (==4.1.1)", "sphinx-issues (==1.2.0)", "alabaster (==0.7.12)", "sphinx-version-warning (==1.1.2)", "autodocsumm (==0.2.6)"] -lint = ["mypy (==0.910)", "flake8 (==3.9.2)", "flake8-bugbear (==21.4.3)", "pre-commit (>=2.4,<3.0)"] +dev = ["flake8 (==4.0.1)", "flake8-bugbear (==22.6.22)", "mypy (==0.961)", "pre-commit (>=2.4,<3.0)", "pytest", "pytz", "simplejson", "tox"] +docs = ["alabaster (==0.7.12)", "autodocsumm (==0.2.8)", "sphinx (==4.5.0)", "sphinx-issues (==3.0.1)", "sphinx-version-warning (==1.1.2)"] +lint = ["flake8 (==4.0.1)", "flake8-bugbear (==22.6.22)", "mypy (==0.961)", "pre-commit (>=2.4,<3.0)"] tests = ["pytest", "pytz", "simplejson"] +[[package]] +name = "mock" +version = "4.0.3" +description = "Rolling backport of unittest.mock for all Pythons" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +build = ["blurb", "twine", "wheel"] +docs = ["sphinx"] +test = ["pytest (<5.4)", "pytest-cov"] + +[[package]] +name = "mypy" +version = "0.971" +description = "Optional static typing for Python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +mypy-extensions = ">=0.4.3" +tomli = {version = ">=1.1.0", markers = "python_version < \"3.11\""} +typed-ast = {version = ">=1.4.0,<2", markers = "python_version < \"3.8\""} +typing-extensions = ">=3.10" + +[package.extras] +dmypy = ["psutil (>=4.0)"] +python2 = ["typed-ast (>=1.4.0,<2)"] +reports = ["lxml"] + +[[package]] +name = "mypy-extensions" +version = "0.4.3" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "outcome" version = "1.1.0" @@ -332,6 +516,71 @@ python-versions = ">=3.6" [package.dependencies] attrs = ">=19.2.0" +[[package]] +name = "packaging" +version = "21.3" +description = "Core utilities for Python packages" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyparsing = ">=2.0.2,<3.0.5 || >3.0.5" + +[[package]] +name = "pathlib2" +version = "2.3.7.post1" +description = "Object-oriented filesystem paths" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = "*" + +[[package]] +name = "pathspec" +version = "0.10.1" +description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "platformdirs" +version = "2.5.2" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx (>=4)", "sphinx-autodoc-typehints (>=1.12)"] +test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] + +[[package]] +name = "pluggy" +version = "1.0.0" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + +[package.extras] +dev = ["pre-commit", "tox"] +testing = ["pytest", "pytest-benchmark"] + +[[package]] +name = "protobuf" +version = "4.21.6" +description = "" +category = "main" +optional = false +python-versions = ">=3.7" + [[package]] name = "psycopg2-binary" version = "2.9.1" @@ -340,6 +589,14 @@ category = "main" optional = false python-versions = ">=3.6" +[[package]] +name = "py" +version = "1.11.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + [[package]] name = "pycparser" version = "2.21" @@ -371,6 +628,52 @@ typing-extensions = ">=3.7.4.3" dotenv = ["python-dotenv (>=0.10.4)"] email = ["email-validator (>=1.0.3)"] +[[package]] +name = "pyln-bolt7" +version = "1.0.246" +description = "BOLT7" +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[[package]] +name = "pyln-client" +version = "0.12.0.post1" +description = "Client library and plugin library for Core Lightning" +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +pyln-bolt7 = ">=1.0,<2.0" +pyln-proto = ">=0.11,<0.12" + +[[package]] +name = "pyln-proto" +version = "0.11.1" +description = "This package implements some of the Lightning Network protocol in pure python. It is intended for protocol testing and some minor tooling only. It is not deemed secure enough to handle any amount of real funds (you have been warned!)." +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +base58 = ">=2.1.1,<3.0.0" +bitstring = ">=3.1.9,<4.0.0" +coincurve = ">=17.0.0,<18.0.0" +cryptography = ">=36.0.1,<37.0.0" +PySocks = ">=1.7.1,<2.0.0" + +[[package]] +name = "pyparsing" +version = "3.0.9" +description = "pyparsing module - Classes and methods to define and execute parsing grammars" +category = "main" +optional = false +python-versions = ">=3.6.8" + +[package.extras] +diagrams = ["jinja2", "railroad-diagrams"] + [[package]] name = "pypng" version = "0.0.21" @@ -392,15 +695,76 @@ PNG = ["pypng (>=0.0.13)"] [[package]] name = "pyscss" -version = "1.3.7" +version = "1.4.0" description = "pyScss, a Scss compiler for Python" category = "main" optional = false python-versions = "*" [package.dependencies] +enum34 = "*" +pathlib2 = "*" six = "*" +[[package]] +name = "pysocks" +version = "1.7.1" +description = "A Python SOCKS client module. See https://github.com/Anorov/PySocks for more information." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pytest" +version = "7.1.3" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +attrs = ">=19.2.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} +iniconfig = "*" +packaging = "*" +pluggy = ">=0.12,<2.0" +py = ">=1.8.2" +tomli = ">=1.0.0" + +[package.extras] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "xmlschema"] + +[[package]] +name = "pytest-asyncio" +version = "0.19.0" +description = "Pytest support for asyncio" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +pytest = ">=6.1.0" +typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} + +[package.extras] +testing = ["coverage (>=6.2)", "flaky (>=3.5.0)", "hypothesis (>=5.7.1)", "mypy (>=0.931)", "pytest-trio (>=0.7.0)"] + +[[package]] +name = "pytest-cov" +version = "3.0.0" +description = "Pytest plugin for measuring coverage." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +coverage = {version = ">=5.2.1", extras = ["toml"]} +pytest = ">=4.6" + +[package.extras] +testing = ["fields", "hunter", "process-tests", "pytest-xdist", "six", "virtualenv"] + [[package]] name = "python-dotenv" version = "0.19.0" @@ -432,7 +796,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" six = ">=1.8.0" [package.extras] -test = ["ipython", "pytest (>=3.0.5)", "mock"] +test = ["ipython", "mock", "pytest (>=3.0.5)"] [[package]] name = "rfc3986" @@ -501,11 +865,11 @@ postgresql = ["psycopg2"] postgresql_pg8000 = ["pg8000 (<1.16.6)"] postgresql_psycopg2binary = ["psycopg2-binary"] postgresql_psycopg2cffi = ["psycopg2cffi"] -pymysql = ["pymysql (<1)", "pymysql"] +pymysql = ["pymysql", "pymysql (<1)"] [[package]] name = "sqlalchemy-aio" -version = "0.16.0" +version = "0.17.0" description = "Async support for SQLAlchemy." category = "main" optional = false @@ -514,7 +878,7 @@ python-versions = ">=3.6" [package.dependencies] outcome = "*" represent = ">=1.4" -sqlalchemy = "*" +sqlalchemy = "<1.4" [package.extras] test = ["pytest (>=5.4)", "pytest-asyncio (>=0.14)", "pytest-trio (>=0.6)"] @@ -544,6 +908,30 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" [package.extras] full = ["itsdangerous", "jinja2", "python-multipart", "pyyaml", "requests"] +[[package]] +name = "tomli" +version = "2.0.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.7" + +[[package]] +name = "typed-ast" +version = "1.5.4" +description = "a fork of Python 2 and 3 ast modules with type comment support" +category = "dev" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "types-protobuf" +version = "3.20.4" +description = "Typing stubs for protobuf" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "typing-extensions" version = "3.10.0.2" @@ -563,9 +951,10 @@ python-versions = ">=3.7" [package.dependencies] click = ">=7.0" h11 = ">=0.8" +typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -standard = ["websockets (>=10.0)", "httptools (>=0.4.0)", "watchfiles (>=0.13)", "python-dotenv (>=0.13)", "PyYAML (>=5.1)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "colorama (>=0.4)"] +standard = ["PyYAML (>=5.1)", "colorama (>=0.4)", "httptools (>=0.4.0)", "python-dotenv (>=0.13)", "uvloop (>=0.14.0,!=0.15.0,!=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.0)"] [[package]] name = "uvloop" @@ -576,9 +965,9 @@ optional = false python-versions = ">=3.7" [package.extras] -dev = ["Cython (>=0.29.24,<0.30.0)", "pytest (>=3.6.0)", "Sphinx (>=4.1.2,<4.2.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)", "aiohttp", "flake8 (>=3.9.2,<3.10.0)", "psutil", "pycodestyle (>=2.7.0,<2.8.0)", "pyOpenSSL (>=19.0.0,<19.1.0)", "mypy (>=0.800)"] -docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)"] -test = ["aiohttp", "flake8 (>=3.9.2,<3.10.0)", "psutil", "pycodestyle (>=2.7.0,<2.8.0)", "pyOpenSSL (>=19.0.0,<19.1.0)", "mypy (>=0.800)"] +dev = ["Cython (>=0.29.24,<0.30.0)", "Sphinx (>=4.1.2,<4.2.0)", "aiohttp", "flake8 (>=3.9.2,<3.10.0)", "mypy (>=0.800)", "psutil", "pyOpenSSL (>=19.0.0,<19.1.0)", "pycodestyle (>=2.7.0,<2.8.0)", "pytest (>=3.6.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"] +docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)"] +test = ["aiohttp", "flake8 (>=3.9.2,<3.10.0)", "mypy (>=0.800)", "psutil", "pyOpenSSL (>=19.0.0,<19.1.0)", "pycodestyle (>=2.7.0,<2.8.0)"] [[package]] name = "watchgod" @@ -588,6 +977,19 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "websocket-client" +version = "1.3.3" +description = "WebSocket client for Python with low level API options" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.extras] +docs = ["Sphinx (>=3.4)", "sphinx-rtd-theme (>=0.5)"] +optional = ["python-socks", "wsaccel"] +test = ["websockets"] + [[package]] name = "websockets" version = "10.0" @@ -605,7 +1007,7 @@ optional = false python-versions = ">=3.5" [package.extras] -dev = ["pytest (>=4.6.2)", "black (>=19.3b0)"] +dev = ["black (>=19.3b0)", "pytest (>=4.6.2)"] [[package]] name = "zipp" @@ -616,18 +1018,18 @@ optional = false python-versions = ">=3.6" [package.extras] -docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] +docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] +testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy"] [metadata] lock-version = "1.1" -python-versions = "^3.9" -content-hash = "921a5f4fe1a4d1a4c3b490f8631ed4bdd0d8af1f1992f1a4f74eaed986c4eb0b" +python-versions = "^3.10 | ^3.9 | ^3.8 | ^3.7" +content-hash = "d0556d4a307864ba04a1e5da517884e523396c98a00ae09d9192c37b1d2c555b" [metadata.files] aiofiles = [ - {file = "aiofiles-0.7.0-py3-none-any.whl", hash = "sha256:c67a6823b5f23fcab0a2595a289cec7d8c863ffcb4322fb8cd6b90400aedfdbc"}, - {file = "aiofiles-0.7.0.tar.gz", hash = "sha256:a1c4fc9b2ff81568c83e21392a82f344ea9d23da906e4f6a52662764545e19d4"}, + {file = "aiofiles-0.8.0-py3-none-any.whl", hash = "sha256:7a973fc22b29e9962d0897805ace5856e6a566ab1f0c8e5c91ff6c866519c937"}, + {file = "aiofiles-0.8.0.tar.gz", hash = "sha256:8334f23235248a3b2e83b2c3a78a22674f39969b96397126cc93664d9a901e59"}, ] anyio = [ {file = "anyio-3.6.1-py3-none-any.whl", hash = "sha256:cb29b9c70620506a9a8f87a309591713446953302d7d995344d0d7c6c0c9a7be"}, @@ -637,10 +1039,18 @@ asgiref = [ {file = "asgiref-3.4.1-py3-none-any.whl", hash = "sha256:ffc141aa908e6f175673e7b1b3b7af4fdb0ecb738fc5c8b88f69f055c2415214"}, {file = "asgiref-3.4.1.tar.gz", hash = "sha256:4ef1ab46b484e3c706329cedeff284a5d40824200638503f5768edb6de7d58e9"}, ] +asn1crypto = [ + {file = "asn1crypto-1.5.1-py2.py3-none-any.whl", hash = "sha256:db4e40728b728508912cbb3d44f19ce188f218e9eba635821bb4b68564f8fd67"}, + {file = "asn1crypto-1.5.1.tar.gz", hash = "sha256:13ae38502be632115abf8a24cbe5f4da52e3b5231990aff31123c805306ccb9c"}, +] attrs = [ {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, ] +base58 = [ + {file = "base58-2.1.1-py3-none-any.whl", hash = "sha256:11a36f4d3ce51dfc1043f3218591ac4eb1ceb172919cebe05b52a5bcc8d245c2"}, + {file = "base58-2.1.1.tar.gz", hash = "sha256:c5d0cb3f5b6e81e8e35da5754388ddcc6d0d14b6c6a132cb93d69ed580a7278c"}, +] bech32 = [ {file = "bech32-1.2.0-py3-none-any.whl", hash = "sha256:990dc8e5a5e4feabbdf55207b5315fdd9b73db40be294a19b3752cde9e79d981"}, {file = "bech32-1.2.0.tar.gz", hash = "sha256:7d6db8214603bd7871fcfa6c0826ef68b85b0abd90fa21c285a9c5e21d2bd899"}, @@ -650,6 +1060,31 @@ bitstring = [ {file = "bitstring-3.1.9-py3-none-any.whl", hash = "sha256:0de167daa6a00c9386255a7cac931b45e6e24e0ad7ea64f1f92a64ac23ad4578"}, {file = "bitstring-3.1.9.tar.gz", hash = "sha256:a5848a3f63111785224dca8bb4c0a75b62ecdef56a042c8d6be74b16f7e860e7"}, ] +black = [ + {file = "black-22.8.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:ce957f1d6b78a8a231b18e0dd2d94a33d2ba738cd88a7fe64f53f659eea49fdd"}, + {file = "black-22.8.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5107ea36b2b61917956d018bd25129baf9ad1125e39324a9b18248d362156a27"}, + {file = "black-22.8.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e8166b7bfe5dcb56d325385bd1d1e0f635f24aae14b3ae437102dedc0c186747"}, + {file = "black-22.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd82842bb272297503cbec1a2600b6bfb338dae017186f8f215c8958f8acf869"}, + {file = "black-22.8.0-cp310-cp310-win_amd64.whl", hash = "sha256:d839150f61d09e7217f52917259831fe2b689f5c8e5e32611736351b89bb2a90"}, + {file = "black-22.8.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:a05da0430bd5ced89176db098567973be52ce175a55677436a271102d7eaa3fe"}, + {file = "black-22.8.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4a098a69a02596e1f2a58a2a1c8d5a05d5a74461af552b371e82f9fa4ada8342"}, + {file = "black-22.8.0-cp36-cp36m-win_amd64.whl", hash = "sha256:5594efbdc35426e35a7defa1ea1a1cb97c7dbd34c0e49af7fb593a36bd45edab"}, + {file = "black-22.8.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a983526af1bea1e4cf6768e649990f28ee4f4137266921c2c3cee8116ae42ec3"}, + {file = "black-22.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b2c25f8dea5e8444bdc6788a2f543e1fb01494e144480bc17f806178378005e"}, + {file = "black-22.8.0-cp37-cp37m-win_amd64.whl", hash = "sha256:78dd85caaab7c3153054756b9fe8c611efa63d9e7aecfa33e533060cb14b6d16"}, + {file = "black-22.8.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:cea1b2542d4e2c02c332e83150e41e3ca80dc0fb8de20df3c5e98e242156222c"}, + {file = "black-22.8.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5b879eb439094751185d1cfdca43023bc6786bd3c60372462b6f051efa6281a5"}, + {file = "black-22.8.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:0a12e4e1353819af41df998b02c6742643cfef58282915f781d0e4dd7a200411"}, + {file = "black-22.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c3a73f66b6d5ba7288cd5d6dad9b4c9b43f4e8a4b789a94bf5abfb878c663eb3"}, + {file = "black-22.8.0-cp38-cp38-win_amd64.whl", hash = "sha256:e981e20ec152dfb3e77418fb616077937378b322d7b26aa1ff87717fb18b4875"}, + {file = "black-22.8.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8ce13ffed7e66dda0da3e0b2eb1bdfc83f5812f66e09aca2b0978593ed636b6c"}, + {file = "black-22.8.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:32a4b17f644fc288c6ee2bafdf5e3b045f4eff84693ac069d87b1a347d861497"}, + {file = "black-22.8.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:0ad827325a3a634bae88ae7747db1a395d5ee02cf05d9aa7a9bd77dfb10e940c"}, + {file = "black-22.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53198e28a1fb865e9fe97f88220da2e44df6da82b18833b588b1883b16bb5d41"}, + {file = "black-22.8.0-cp39-cp39-win_amd64.whl", hash = "sha256:bc4d4123830a2d190e9cc42a2e43570f82ace35c3aeb26a512a2102bce5af7ec"}, + {file = "black-22.8.0-py3-none-any.whl", hash = "sha256:d2c21d439b2baf7aa80d6dd4e3659259be64c6f49dfd0f32091063db0e006db4"}, + {file = "black-22.8.0.tar.gz", hash = "sha256:792f7eb540ba9a17e8656538701d3eb1afcb134e3b45b71f20b25c77a8db7e6e"}, +] cerberus = [ {file = "Cerberus-1.3.4.tar.gz", hash = "sha256:d1b21b3954b2498d9a79edf16b3170a3ac1021df88d197dc2ce5928ba519237c"}, ] @@ -717,10 +1152,120 @@ click = [ {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, ] +coincurve = [ + {file = "coincurve-17.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ac8c87d6fd080faa74e7ecf64a6ed20c11a254863238759eb02c3f13ad12b0c4"}, + {file = "coincurve-17.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:25dfa105beba24c8de886f8ed654bb1133866e4e22cfd7ea5ad8438cae6ed924"}, + {file = "coincurve-17.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:698efdd53e4fe1bbebaee9b75cbc851be617974c1c60098e9145cb7198ae97fb"}, + {file = "coincurve-17.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:30dd44d1039f1d237aaa2da6d14a455ca88df3bcb00610b41f3253fdca1be97b"}, + {file = "coincurve-17.0.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d154e2eb5711db8c5ef52fcd80935b5a0e751c057bc6ffb215a7bb409aedef03"}, + {file = "coincurve-17.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c71caffb97dd3d0c243beb62352669b1e5dafa3a4bccdbb27d36bd82f5e65d20"}, + {file = "coincurve-17.0.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:747215254e51dd4dfbe6dded9235491263da5d88fe372d66541ca16b51ea078f"}, + {file = "coincurve-17.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad2f6df39ba1e2b7b14bb984505ffa7d0a0ecdd697e8d7dbd19e04bc245c87ed"}, + {file = "coincurve-17.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0503326963916c85b61d16f611ea0545f03c9e418fa8007c233c815429e381e8"}, + {file = "coincurve-17.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1013c1597b65684ae1c3e42497f9ef5a04527fa6136a84a16b34602606428c74"}, + {file = "coincurve-17.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4beef321fd6434448aab03a0c245f31c4e77f43b54b82108c0948d29852ac7e"}, + {file = "coincurve-17.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f47806527d3184da3e8b146fac92a8ed567bbd225194f4517943d8cdc85f9542"}, + {file = "coincurve-17.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:51e56373ac79f4ec1cfc5da53d72c55f5e5ac28d848b0849ef5e687ace857888"}, + {file = "coincurve-17.0.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:3d694ad194bee9e8792e2e75879dc5238d8a184010cde36c5ad518fcfe2cd8f2"}, + {file = "coincurve-17.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:74cedb3d3a1dc5abe0c9c2396e1b82cc64496babc5b42e007e72e185cb1edad8"}, + {file = "coincurve-17.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:db874c5c1dcb1f3a19379773b5e8cffc777625a7a7a60dd9a67206e31e62e2e9"}, + {file = "coincurve-17.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:896b01941254f0a218cf331a9bddfe2d43892f7f1ba10d6e372e2eb744a744c2"}, + {file = "coincurve-17.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6aec70238dbe7a5d66b5f9438ff45b08eb5e0990d49c32ebb65247c5d5b89d7a"}, + {file = "coincurve-17.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d24284d17162569df917a640f19d9654ba3b43cf560ced8864f270da903f73a5"}, + {file = "coincurve-17.0.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4ea057f777842396d387103c606babeb3a1b4c6126769cc0a12044312fc6c465"}, + {file = "coincurve-17.0.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:b88642edf7f281649b0c0b6ffade051945ccceae4b885e40445634877d0b3049"}, + {file = "coincurve-17.0.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:a80a207131813b038351c5bdae8f20f5f774bbf53622081f208d040dd2b7528f"}, + {file = "coincurve-17.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:f1ef72574aa423bc33665ef4be859164a478bad24d48442da874ef3dc39a474d"}, + {file = "coincurve-17.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:dfd4fab857bcd975edc39111cb5f5c104f138dac2e9ace35ea8434d37bcea3be"}, + {file = "coincurve-17.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:73f39579dd651a9fc29da5a8fc0d8153d872bcbc166f876457baced1a1c01501"}, + {file = "coincurve-17.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8852dc01af4f0fe941ffd04069f7e4fecdce9b867a016f823a02286a1a1f07b5"}, + {file = "coincurve-17.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1bef812da1da202cdd601a256825abcf26d86e8634fac3ec3e615e3bb3ff08c"}, + {file = "coincurve-17.0.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abbefc9ccb170cb255a31df32457c2e43084b9f37589d0694dacc2dea6ddaf7c"}, + {file = "coincurve-17.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:abbd9d017a7638dc38a3b9bb4851f8801b7818d4e5ac22e0c75e373b3c1dbff0"}, + {file = "coincurve-17.0.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e2c2e8a1f0b1f8e48049c891af4ae3cad65d115d358bde72f6b8abdbb8a23170"}, + {file = "coincurve-17.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8c571445b166c714af4f8155e38a894376c16c0431e88963f2fff474a9985d87"}, + {file = "coincurve-17.0.0-py3-none-win32.whl", hash = "sha256:b956b0b2c85e25a7d00099970ff5d8338254b45e46f0a940f4a2379438ce0dde"}, + {file = "coincurve-17.0.0-py3-none-win_amd64.whl", hash = "sha256:630388080da3026e0b0176cc6762eaabecba857ee3fc85767577dea063ea7c6e"}, + {file = "coincurve-17.0.0.tar.gz", hash = "sha256:68da55aff898702952fda3ee04fd6ed60bb6b91f919c69270786ed766b548b93"}, +] colorama = [ {file = "colorama-0.4.5-py2.py3-none-any.whl", hash = "sha256:854bf444933e37f5824ae7bfc1e98d5bce2ebe4160d46b5edf346a89358e99da"}, {file = "colorama-0.4.5.tar.gz", hash = "sha256:e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4"}, ] +coverage = [ + {file = "coverage-6.4.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e7b4da9bafad21ea45a714d3ea6f3e1679099e420c8741c74905b92ee9bfa7cc"}, + {file = "coverage-6.4.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fde17bc42e0716c94bf19d92e4c9f5a00c5feb401f5bc01101fdf2a8b7cacf60"}, + {file = "coverage-6.4.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cdbb0d89923c80dbd435b9cf8bba0ff55585a3cdb28cbec65f376c041472c60d"}, + {file = "coverage-6.4.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:67f9346aeebea54e845d29b487eb38ec95f2ecf3558a3cffb26ee3f0dcc3e760"}, + {file = "coverage-6.4.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:42c499c14efd858b98c4e03595bf914089b98400d30789511577aa44607a1b74"}, + {file = "coverage-6.4.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:c35cca192ba700979d20ac43024a82b9b32a60da2f983bec6c0f5b84aead635c"}, + {file = "coverage-6.4.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:9cc4f107009bca5a81caef2fca843dbec4215c05e917a59dec0c8db5cff1d2aa"}, + {file = "coverage-6.4.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:5f444627b3664b80d078c05fe6a850dd711beeb90d26731f11d492dcbadb6973"}, + {file = "coverage-6.4.4-cp310-cp310-win32.whl", hash = "sha256:66e6df3ac4659a435677d8cd40e8eb1ac7219345d27c41145991ee9bf4b806a0"}, + {file = "coverage-6.4.4-cp310-cp310-win_amd64.whl", hash = "sha256:35ef1f8d8a7a275aa7410d2f2c60fa6443f4a64fae9be671ec0696a68525b875"}, + {file = "coverage-6.4.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c1328d0c2f194ffda30a45f11058c02410e679456276bfa0bbe0b0ee87225fac"}, + {file = "coverage-6.4.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:61b993f3998ee384935ee423c3d40894e93277f12482f6e777642a0141f55782"}, + {file = "coverage-6.4.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d5dd4b8e9cd0deb60e6fcc7b0647cbc1da6c33b9e786f9c79721fd303994832f"}, + {file = "coverage-6.4.4-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7026f5afe0d1a933685d8f2169d7c2d2e624f6255fb584ca99ccca8c0e966fd7"}, + {file = "coverage-6.4.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:9c7b9b498eb0c0d48b4c2abc0e10c2d78912203f972e0e63e3c9dc21f15abdaa"}, + {file = "coverage-6.4.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ee2b2fb6eb4ace35805f434e0f6409444e1466a47f620d1d5763a22600f0f892"}, + {file = "coverage-6.4.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:ab066f5ab67059d1f1000b5e1aa8bbd75b6ed1fc0014559aea41a9eb66fc2ce0"}, + {file = "coverage-6.4.4-cp311-cp311-win32.whl", hash = "sha256:9d6e1f3185cbfd3d91ac77ea065d85d5215d3dfa45b191d14ddfcd952fa53796"}, + {file = "coverage-6.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:e3d3c4cc38b2882f9a15bafd30aec079582b819bec1b8afdbde8f7797008108a"}, + {file = "coverage-6.4.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a095aa0a996ea08b10580908e88fbaf81ecf798e923bbe64fb98d1807db3d68a"}, + {file = "coverage-6.4.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ef6f44409ab02e202b31a05dd6666797f9de2aa2b4b3534e9d450e42dea5e817"}, + {file = "coverage-6.4.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4b7101938584d67e6f45f0015b60e24a95bf8dea19836b1709a80342e01b472f"}, + {file = "coverage-6.4.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:14a32ec68d721c3d714d9b105c7acf8e0f8a4f4734c811eda75ff3718570b5e3"}, + {file = "coverage-6.4.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:6a864733b22d3081749450466ac80698fe39c91cb6849b2ef8752fd7482011f3"}, + {file = "coverage-6.4.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:08002f9251f51afdcc5e3adf5d5d66bb490ae893d9e21359b085f0e03390a820"}, + {file = "coverage-6.4.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a3b2752de32c455f2521a51bd3ffb53c5b3ae92736afde67ce83477f5c1dd928"}, + {file = "coverage-6.4.4-cp37-cp37m-win32.whl", hash = "sha256:f855b39e4f75abd0dfbcf74a82e84ae3fc260d523fcb3532786bcbbcb158322c"}, + {file = "coverage-6.4.4-cp37-cp37m-win_amd64.whl", hash = "sha256:ee6ae6bbcac0786807295e9687169fba80cb0617852b2fa118a99667e8e6815d"}, + {file = "coverage-6.4.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:564cd0f5b5470094df06fab676c6d77547abfdcb09b6c29c8a97c41ad03b103c"}, + {file = "coverage-6.4.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:cbbb0e4cd8ddcd5ef47641cfac97d8473ab6b132dd9a46bacb18872828031685"}, + {file = "coverage-6.4.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6113e4df2fa73b80f77663445be6d567913fb3b82a86ceb64e44ae0e4b695de1"}, + {file = "coverage-6.4.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8d032bfc562a52318ae05047a6eb801ff31ccee172dc0d2504614e911d8fa83e"}, + {file = "coverage-6.4.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e431e305a1f3126477abe9a184624a85308da8edf8486a863601d58419d26ffa"}, + {file = "coverage-6.4.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:cf2afe83a53f77aec067033199797832617890e15bed42f4a1a93ea24794ae3e"}, + {file = "coverage-6.4.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:783bc7c4ee524039ca13b6d9b4186a67f8e63d91342c713e88c1865a38d0892a"}, + {file = "coverage-6.4.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ff934ced84054b9018665ca3967fc48e1ac99e811f6cc99ea65978e1d384454b"}, + {file = "coverage-6.4.4-cp38-cp38-win32.whl", hash = "sha256:e1fabd473566fce2cf18ea41171d92814e4ef1495e04471786cbc943b89a3781"}, + {file = "coverage-6.4.4-cp38-cp38-win_amd64.whl", hash = "sha256:4179502f210ebed3ccfe2f78bf8e2d59e50b297b598b100d6c6e3341053066a2"}, + {file = "coverage-6.4.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:98c0b9e9b572893cdb0a00e66cf961a238f8d870d4e1dc8e679eb8bdc2eb1b86"}, + {file = "coverage-6.4.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fc600f6ec19b273da1d85817eda339fb46ce9eef3e89f220055d8696e0a06908"}, + {file = "coverage-6.4.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7a98d6bf6d4ca5c07a600c7b4e0c5350cd483c85c736c522b786be90ea5bac4f"}, + {file = "coverage-6.4.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:01778769097dbd705a24e221f42be885c544bb91251747a8a3efdec6eb4788f2"}, + {file = "coverage-6.4.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dfa0b97eb904255e2ab24166071b27408f1f69c8fbda58e9c0972804851e0558"}, + {file = "coverage-6.4.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:fcbe3d9a53e013f8ab88734d7e517eb2cd06b7e689bedf22c0eb68db5e4a0a19"}, + {file = "coverage-6.4.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:15e38d853ee224e92ccc9a851457fb1e1f12d7a5df5ae44544ce7863691c7a0d"}, + {file = "coverage-6.4.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:6913dddee2deff8ab2512639c5168c3e80b3ebb0f818fed22048ee46f735351a"}, + {file = "coverage-6.4.4-cp39-cp39-win32.whl", hash = "sha256:354df19fefd03b9a13132fa6643527ef7905712109d9c1c1903f2133d3a4e145"}, + {file = "coverage-6.4.4-cp39-cp39-win_amd64.whl", hash = "sha256:1238b08f3576201ebf41f7c20bf59baa0d05da941b123c6656e42cdb668e9827"}, + {file = "coverage-6.4.4-pp36.pp37.pp38-none-any.whl", hash = "sha256:f67cf9f406cf0d2f08a3515ce2db5b82625a7257f88aad87904674def6ddaec1"}, + {file = "coverage-6.4.4.tar.gz", hash = "sha256:e16c45b726acb780e1e6f88b286d3c10b3914ab03438f32117c4aa52d7f30d58"}, +] +cryptography = [ + {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_universal2.whl", hash = "sha256:4e2dddd38a5ba733be6a025a1475a9f45e4e41139d1321f412c6b360b19070b6"}, + {file = "cryptography-36.0.2-cp36-abi3-macosx_10_10_x86_64.whl", hash = "sha256:4881d09298cd0b669bb15b9cfe6166f16fc1277b4ed0d04a22f3d6430cb30f1d"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ea634401ca02367c1567f012317502ef3437522e2fc44a3ea1844de028fa4b84"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:7be666cc4599b415f320839e36367b273db8501127b38316f3b9f22f17a0b815"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8241cac0aae90b82d6b5c443b853723bcc66963970c67e56e71a2609dc4b5eaf"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b2d54e787a884ffc6e187262823b6feb06c338084bbe80d45166a1cb1c6c5bf"}, + {file = "cryptography-36.0.2-cp36-abi3-manylinux_2_24_x86_64.whl", hash = "sha256:c2c5250ff0d36fd58550252f54915776940e4e866f38f3a7866d92b32a654b86"}, + {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:ec6597aa85ce03f3e507566b8bcdf9da2227ec86c4266bd5e6ab4d9e0cc8dab2"}, + {file = "cryptography-36.0.2-cp36-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:ca9f686517ec2c4a4ce930207f75c00bf03d94e5063cbc00a1dc42531511b7eb"}, + {file = "cryptography-36.0.2-cp36-abi3-win32.whl", hash = "sha256:f64b232348ee82f13aac22856515ce0195837f6968aeaa94a3d0353ea2ec06a6"}, + {file = "cryptography-36.0.2-cp36-abi3-win_amd64.whl", hash = "sha256:53e0285b49fd0ab6e604f4c5d9c5ddd98de77018542e88366923f152dbeb3c29"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:32db5cc49c73f39aac27574522cecd0a4bb7384e71198bc65a0d23f901e89bb7"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2b3d199647468d410994dbeb8cec5816fb74feb9368aedf300af709ef507e3e"}, + {file = "cryptography-36.0.2-pp37-pypy37_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:da73d095f8590ad437cd5e9faf6628a218aa7c387e1fdf67b888b47ba56a17f0"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-macosx_10_10_x86_64.whl", hash = "sha256:0a3bf09bb0b7a2c93ce7b98cb107e9170a90c51a0162a20af1c61c765b90e60b"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8897b7b7ec077c819187a123174b645eb680c13df68354ed99f9b40a50898f77"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:82740818f2f240a5da8dfb8943b360e4f24022b093207160c77cadade47d7c85"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-manylinux_2_24_x86_64.whl", hash = "sha256:1f64a62b3b75e4005df19d3b5235abd43fa6358d5516cfc43d87aeba8d08dd51"}, + {file = "cryptography-36.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:e167b6b710c7f7bc54e67ef593f8731e1f45aa35f8a8a7b72d6e42ec76afd4b3"}, + {file = "cryptography-36.0.2.tar.gz", hash = "sha256:70f8f4f7bb2ac9f340655cbac89d68c527af5bb4387522a8413e841e3e6628c9"}, +] ecdsa = [ {file = "ecdsa-0.17.0-py2.py3-none-any.whl", hash = "sha256:5cf31d5b33743abe0dfc28999036c849a69d548f994b535e527ee3cb7f3ef676"}, {file = "ecdsa-0.17.0.tar.gz", hash = "sha256:b9f500bb439e4153d0330610f5d26baaf18d17b8ced1bc54410d189385ea68aa"}, @@ -728,6 +1273,11 @@ ecdsa = [ embit = [ {file = "embit-0.4.9.tar.gz", hash = "sha256:992332bd89af6e2d027e26fe437eb14aa33997db08c882c49064d49c3e6f4ab9"}, ] +enum34 = [ + {file = "enum34-1.1.10-py2-none-any.whl", hash = "sha256:a98a201d6de3f2ab3db284e70a33b0f896fbf35f8086594e8c9e74b909058d53"}, + {file = "enum34-1.1.10-py3-none-any.whl", hash = "sha256:c3858660960c984d6ab0ebad691265180da2b43f07e061c0f8dca9ef3cffd328"}, + {file = "enum34-1.1.10.tar.gz", hash = "sha256:cce6a7477ed816bd2542d03d53db9f0db935dd013b70f336a95c73979289f248"}, +] environs = [ {file = "environs-9.3.3-py2.py3-none-any.whl", hash = "sha256:ee5466156b50fe03aa9fec6e720feea577b5bf515d7f21b2c46608272557ba26"}, {file = "environs-9.3.3.tar.gz", hash = "sha256:72b867ff7b553076cdd90f3ee01ecc1cf854987639c9c459f0ed0d3d44ae490c"}, @@ -736,34 +1286,100 @@ fastapi = [ {file = "fastapi-0.78.0-py3-none-any.whl", hash = "sha256:15fcabd5c78c266fa7ae7d8de9b384bfc2375ee0503463a6febbe3bab69d6f65"}, {file = "fastapi-0.78.0.tar.gz", hash = "sha256:3233d4a789ba018578658e2af1a4bb5e38bdd122ff722b313666a9b2c6786a83"}, ] +grpcio = [ + {file = "grpcio-1.49.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:fd86040232e805b8e6378b2348c928490ee595b058ce9aaa27ed8e4b0f172b20"}, + {file = "grpcio-1.49.1-cp310-cp310-macosx_10_10_x86_64.whl", hash = "sha256:6fd0c9cede9552bf00f8c5791d257d5bf3790d7057b26c59df08be5e7a1e021d"}, + {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:d0d402e158d4e84e49c158cb5204119d55e1baf363ee98d6cb5dce321c3a065d"}, + {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:822ceec743d42a627e64ea266059a62d214c5a3cdfcd0d7fe2b7a8e4e82527c7"}, + {file = "grpcio-1.49.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2106d9c16527f0a85e2eea6e6b91a74fc99579c60dd810d8690843ea02bc0f5f"}, + {file = "grpcio-1.49.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:52dd02b7e7868233c571b49bc38ebd347c3bb1ff8907bb0cb74cb5f00c790afc"}, + {file = "grpcio-1.49.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:120fecba2ec5d14b5a15d11063b39783fda8dc8d24addd83196acb6582cabd9b"}, + {file = "grpcio-1.49.1-cp310-cp310-win32.whl", hash = "sha256:f1a3b88e3c53c1a6e6bed635ec1bbb92201bb6a1f2db186179f7f3f244829788"}, + {file = "grpcio-1.49.1-cp310-cp310-win_amd64.whl", hash = "sha256:a7d0017b92d3850abea87c1bdec6ea41104e71c77bca44c3e17f175c6700af62"}, + {file = "grpcio-1.49.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:9fb17ff8c0d56099ac6ebfa84f670c5a62228d6b5c695cf21c02160c2ac1446b"}, + {file = "grpcio-1.49.1-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:075f2d06e3db6b48a2157a1bcd52d6cbdca980dd18988fe6afdb41795d51625f"}, + {file = "grpcio-1.49.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:46d93a1b4572b461a227f1db6b8d35a88952db1c47e5fadcf8b8a2f0e1dd9201"}, + {file = "grpcio-1.49.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc79b2b37d779ac42341ddef40ad5bf0966a64af412c89fc2b062e3ddabb093f"}, + {file = "grpcio-1.49.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5f8b3a971c7820ea9878f3fd70086240a36aeee15d1b7e9ecbc2743b0e785568"}, + {file = "grpcio-1.49.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49b301740cf5bc8fed4fee4c877570189ae3951432d79fa8e524b09353659811"}, + {file = "grpcio-1.49.1-cp311-cp311-win32.whl", hash = "sha256:1c66a25afc6c71d357867b341da594a5587db5849b48f4b7d5908d236bb62ede"}, + {file = "grpcio-1.49.1-cp311-cp311-win_amd64.whl", hash = "sha256:6b6c3a95d27846f4145d6967899b3ab25fffc6ae99544415e1adcacef84842d2"}, + {file = "grpcio-1.49.1-cp37-cp37m-linux_armv7l.whl", hash = "sha256:1cc400c8a2173d1c042997d98a9563e12d9bb3fb6ad36b7f355bc77c7663b8af"}, + {file = "grpcio-1.49.1-cp37-cp37m-macosx_10_10_x86_64.whl", hash = "sha256:34f736bd4d0deae90015c0e383885b431444fe6b6c591dea288173df20603146"}, + {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:196082b9c89ebf0961dcd77cb114bed8171964c8e3063b9da2fb33536a6938ed"}, + {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8c9f89c42749890618cd3c2464e1fbf88446e3d2f67f1e334c8e5db2f3272bbd"}, + {file = "grpcio-1.49.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:64419cb8a5b612cdb1550c2fd4acbb7d4fb263556cf4625f25522337e461509e"}, + {file = "grpcio-1.49.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:8a5272061826e6164f96e3255405ef6f73b88fd3e8bef464c7d061af8585ac62"}, + {file = "grpcio-1.49.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ea9d0172445241ad7cb49577314e39d0af2c5267395b3561d7ced5d70458a9f3"}, + {file = "grpcio-1.49.1-cp37-cp37m-win32.whl", hash = "sha256:2070e87d95991473244c72d96d13596c751cb35558e11f5df5414981e7ed2492"}, + {file = "grpcio-1.49.1-cp37-cp37m-win_amd64.whl", hash = "sha256:4fcedcab49baaa9db4a2d240ac81f2d57eb0052b1c6a9501b46b8ae912720fbf"}, + {file = "grpcio-1.49.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:afbb3475cf7f4f7d380c2ca37ee826e51974f3e2665613996a91d6a58583a534"}, + {file = "grpcio-1.49.1-cp38-cp38-macosx_10_10_x86_64.whl", hash = "sha256:a4f9ba141380abde6c3adc1727f21529137a2552002243fa87c41a07e528245c"}, + {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:cf0a1fb18a7204b9c44623dfbd1465b363236ce70c7a4ed30402f9f60d8b743b"}, + {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:17bb6fe72784b630728c6cff9c9d10ccc3b6d04e85da6e0a7b27fb1d135fac62"}, + {file = "grpcio-1.49.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:18305d5a082d1593b005a895c10041f833b16788e88b02bb81061f5ebcc465df"}, + {file = "grpcio-1.49.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:b6a1b39e59ac5a3067794a0e498911cf2e37e4b19ee9e9977dc5e7051714f13f"}, + {file = "grpcio-1.49.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:0e20d59aafc086b1cc68400463bddda6e41d3e5ed30851d1e2e0f6a2e7e342d3"}, + {file = "grpcio-1.49.1-cp38-cp38-win32.whl", hash = "sha256:e1e83233d4680863a421f3ee4a7a9b80d33cd27ee9ed7593bc93f6128302d3f2"}, + {file = "grpcio-1.49.1-cp38-cp38-win_amd64.whl", hash = "sha256:221d42c654d2a41fa31323216279c73ed17d92f533bc140a3390cc1bd78bf63c"}, + {file = "grpcio-1.49.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:fa9e6e61391e99708ac87fc3436f6b7b9c6b845dc4639b406e5e61901e1aacde"}, + {file = "grpcio-1.49.1-cp39-cp39-macosx_10_10_x86_64.whl", hash = "sha256:9b449e966ef518ce9c860d21f8afe0b0f055220d95bc710301752ac1db96dd6a"}, + {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:aa34d2ad9f24e47fa9a3172801c676e4037d862247e39030165fe83821a7aafd"}, + {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5207f4eed1b775d264fcfe379d8541e1c43b878f2b63c0698f8f5c56c40f3d68"}, + {file = "grpcio-1.49.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0b24a74651438d45619ac67004638856f76cc13d78b7478f2457754cbcb1c8ad"}, + {file = "grpcio-1.49.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:fe763781669790dc8b9618e7e677c839c87eae6cf28b655ee1fa69ae04eea03f"}, + {file = "grpcio-1.49.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:2f2ff7ba0f8f431f32d4b4bc3a3713426949d3533b08466c4ff1b2b475932ca8"}, + {file = "grpcio-1.49.1-cp39-cp39-win32.whl", hash = "sha256:08ff74aec8ff457a89b97152d36cb811dcc1d17cd5a92a65933524e363327394"}, + {file = "grpcio-1.49.1-cp39-cp39-win_amd64.whl", hash = "sha256:274ffbb39717918c514b35176510ae9be06e1d93121e84d50b350861dcb9a705"}, + {file = "grpcio-1.49.1.tar.gz", hash = "sha256:d4725fc9ec8e8822906ae26bb26f5546891aa7fbc3443de970cc556d43a5c99f"}, +] h11 = [ {file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"}, {file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"}, ] httpcore = [ - {file = "httpcore-0.13.7-py3-none-any.whl", hash = "sha256:369aa481b014cf046f7067fddd67d00560f2f00426e79569d99cb11245134af0"}, - {file = "httpcore-0.13.7.tar.gz", hash = "sha256:036f960468759e633574d7c121afba48af6419615d36ab8ede979f1ad6276fa3"}, + {file = "httpcore-0.15.0-py3-none-any.whl", hash = "sha256:1105b8b73c025f23ff7c36468e4432226cbb959176eab66864b8e31c4ee27fa6"}, + {file = "httpcore-0.15.0.tar.gz", hash = "sha256:18b68ab86a3ccf3e7dc0f43598eaddcf472b602aba29f9aa6ab85fe2ada3980b"}, ] httptools = [ - {file = "httptools-0.2.0-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:79dbc21f3612a78b28384e989b21872e2e3cf3968532601544696e4ed0007ce5"}, - {file = "httptools-0.2.0-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:78d03dd39b09c99ec917d50189e6743adbfd18c15d5944392d2eabda688bf149"}, - {file = "httptools-0.2.0-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:a23166e5ae2775709cf4f7ad4c2048755ebfb272767d244e1a96d55ac775cca7"}, - {file = "httptools-0.2.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:3ab1f390d8867f74b3b5ee2a7ecc9b8d7f53750bd45714bf1cb72a953d7dfa77"}, - {file = "httptools-0.2.0-cp36-cp36m-win_amd64.whl", hash = "sha256:a7594f9a010cdf1e16a58b3bf26c9da39bbf663e3b8d46d39176999d71816658"}, - {file = "httptools-0.2.0-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:01b392a166adcc8bc2f526a939a8aabf89fe079243e1543fd0e7dc1b58d737cb"}, - {file = "httptools-0.2.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:80ffa04fe8c8dfacf6e4cef8277347d35b0442c581f5814f3b0cf41b65c43c6e"}, - {file = "httptools-0.2.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d5682eeb10cca0606c4a8286a3391d4c3c5a36f0c448e71b8bd05be4e1694bfb"}, - {file = "httptools-0.2.0-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:a289c27ccae399a70eacf32df9a44059ca2ba4ac444604b00a19a6c1f0809943"}, - {file = "httptools-0.2.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:813871f961edea6cb2fe312f2d9b27d12a51ba92545380126f80d0de1917ea15"}, - {file = "httptools-0.2.0-cp38-cp38-win_amd64.whl", hash = "sha256:cc9be041e428c10f8b6ab358c6b393648f9457094e1dcc11b4906026d43cd380"}, - {file = "httptools-0.2.0-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:b08d00d889a118f68f37f3c43e359aab24ee29eb2e3fe96d64c6a2ba8b9d6557"}, - {file = "httptools-0.2.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:fd3b8905e21431ad306eeaf56644a68fdd621bf8f3097eff54d0f6bdf7262065"}, - {file = "httptools-0.2.0-cp39-cp39-win_amd64.whl", hash = "sha256:200fc1cdf733a9ff554c0bb97a4047785cfaad9875307d6087001db3eb2b417f"}, - {file = "httptools-0.2.0.tar.gz", hash = "sha256:94505026be56652d7a530ab03d89474dc6021019d6b8682281977163b3471ea0"}, + {file = "httptools-0.4.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fcddfe70553be717d9745990dfdb194e22ee0f60eb8f48c0794e7bfeda30d2d5"}, + {file = "httptools-0.4.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:1ee0b459257e222b878a6c09ccf233957d3a4dcb883b0847640af98d2d9aac23"}, + {file = "httptools-0.4.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceafd5e960b39c7e0d160a1936b68eb87c5e79b3979d66e774f0c77d4d8faaed"}, + {file = "httptools-0.4.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:fdb9f9ed79bc6f46b021b3319184699ba1a22410a82204e6e89c774530069683"}, + {file = "httptools-0.4.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:abe829275cdd4174b4c4e65ad718715d449e308d59793bf3a931ee1bf7e7b86c"}, + {file = "httptools-0.4.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7af6bdbd21a2a25d6784f6d67f44f5df33ef39b6159543b9f9064d365c01f919"}, + {file = "httptools-0.4.0-cp310-cp310-win_amd64.whl", hash = "sha256:5d1fe6b6661022fd6cac541f54a4237496b246e6f1c0a6b41998ee08a1135afe"}, + {file = "httptools-0.4.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:48e48530d9b995a84d1d89ae6b3ec4e59ea7d494b150ac3bbc5e2ac4acce92cd"}, + {file = "httptools-0.4.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a113789e53ac1fa26edf99856a61e4c493868e125ae0dd6354cf518948fbbd5c"}, + {file = "httptools-0.4.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8e2eb957787cbb614a0f006bfc5798ff1d90ac7c4dd24854c84edbdc8c02369e"}, + {file = "httptools-0.4.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:7ee9f226acab9085037582c059d66769862706e8e8cd2340470ceb8b3850873d"}, + {file = "httptools-0.4.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:701e66b59dd21a32a274771238025d58db7e2b6ecebbab64ceff51b8e31527ae"}, + {file = "httptools-0.4.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6a1a7dfc1f9c78a833e2c4904757a0f47ce25d08634dd2a52af394eefe5f9777"}, + {file = "httptools-0.4.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:903f739c9fb78dab8970b0f3ea51f21955b24b45afa77b22ff0e172fc11ef111"}, + {file = "httptools-0.4.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:54bbd295f031b866b9799dd39cb45deee81aca036c9bff9f58ca06726f6494f1"}, + {file = "httptools-0.4.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3194f6d6443befa8d4db16c1946b2fc428a3ceb8ab32eb6f09a59f86104dc1a0"}, + {file = "httptools-0.4.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:cd1295f52971097f757edfbfce827b6dbbfb0f7a74901ee7d4933dff5ad4c9af"}, + {file = "httptools-0.4.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:20a45bcf22452a10fa8d58b7dbdb474381f6946bf5b8933e3662d572bc61bae4"}, + {file = "httptools-0.4.0-cp37-cp37m-win_amd64.whl", hash = "sha256:d1f27bb0f75bef722d6e22dc609612bfa2f994541621cd2163f8c943b6463dfe"}, + {file = "httptools-0.4.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:7f7bfb74718f52d5ed47d608d507bf66d3bc01d4a8b3e6dd7134daaae129357b"}, + {file = "httptools-0.4.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a522d12e2ddbc2e91842ffb454a1aeb0d47607972c7d8fc88bd0838d97fb8a2a"}, + {file = "httptools-0.4.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2db44a0b294d317199e9f80123e72c6b005c55b625b57fae36de68670090fa48"}, + {file = "httptools-0.4.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c286985b5e194ca0ebb2908d71464b9be8f17cc66d6d3e330e8d5407248f56ad"}, + {file = "httptools-0.4.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:d3a4e165ca6204f34856b765d515d558dc84f1352033b8721e8d06c3e44930c3"}, + {file = "httptools-0.4.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:72aa3fbe636b16d22e04b5a9d24711b043495e0ecfe58080addf23a1a37f3409"}, + {file = "httptools-0.4.0-cp38-cp38-win_amd64.whl", hash = "sha256:9967d9758df505975913304c434cb9ab21e2c609ad859eb921f2f615a038c8de"}, + {file = "httptools-0.4.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:f72b5d24d6730035128b238decdc4c0f2104b7056a7ca55cf047c106842ec890"}, + {file = "httptools-0.4.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:29bf97a5c532da9c7a04de2c7a9c31d1d54f3abd65a464119b680206bbbb1055"}, + {file = "httptools-0.4.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:98993805f1e3cdb53de4eed02b55dcc953cdf017ba7bbb2fd89226c086a6d855"}, + {file = "httptools-0.4.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d9b90bf58f3ba04e60321a23a8723a1ff2a9377502535e70495e5ada8e6e6722"}, + {file = "httptools-0.4.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:1a99346ebcb801b213c591540837340bdf6fd060a8687518d01c607d338b7424"}, + {file = "httptools-0.4.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:645373c070080e632480a3d251d892cb795be3d3a15f86975d0f1aca56fd230d"}, + {file = "httptools-0.4.0-cp39-cp39-win_amd64.whl", hash = "sha256:34d2903dd2a3dd85d33705b6fde40bf91fc44411661283763fd0746723963c83"}, + {file = "httptools-0.4.0.tar.gz", hash = "sha256:2c9a930c378b3d15d6b695fb95ebcff81a7395b4f9775c4f10a076beb0b2c1ff"}, ] httpx = [ - {file = "httpx-0.19.0-py3-none-any.whl", hash = "sha256:9bd728a6c5ec0a9e243932a9983d57d3cc4a87bb4f554e1360fce407f78f9435"}, - {file = "httpx-0.19.0.tar.gz", hash = "sha256:92ecd2c00c688b529eda11cedb15161eaf02dee9116712f621c70d9a40b2cdd0"}, + {file = "httpx-0.23.0-py3-none-any.whl", hash = "sha256:42974f577483e1e932c3cdc3cd2303e883cbfba17fe228b0f63589764d7b9c4b"}, + {file = "httpx-0.23.0.tar.gz", hash = "sha256:f28eac771ec9eb4866d3fb4ab65abd42d38c424739e80c08d8d20570de60b0ef"}, ] idna = [ {file = "idna-3.2-py3-none-any.whl", hash = "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a"}, @@ -773,6 +1389,14 @@ importlib-metadata = [ {file = "importlib_metadata-4.8.1-py3-none-any.whl", hash = "sha256:b618b6d2d5ffa2f16add5697cf57a46c76a56229b0ed1c438322e4e95645bd15"}, {file = "importlib_metadata-4.8.1.tar.gz", hash = "sha256:f284b3e11256ad1e5d03ab86bb2ccd6f5339688ff17a4d797a0fe7df326f23b1"}, ] +iniconfig = [ + {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, + {file = "iniconfig-1.1.1.tar.gz", hash = "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32"}, +] +isort = [ + {file = "isort-5.10.1-py3-none-any.whl", hash = "sha256:6f62d78e2f89b4500b080fe3a81690850cd254227f27f75c3a0c491a1f351ba7"}, + {file = "isort-5.10.1.tar.gz", hash = "sha256:e8443a5e7a020e9d7f97f1d7d9cd17c88bcb3bc7e218bf9cf5095fe550be2951"}, +] jinja2 = [ {file = "Jinja2-3.0.1-py3-none-any.whl", hash = "sha256:1f06f2da51e7b56b8f238affdd6b4e2c61e39598a378cc49345bc1bd42a978a4"}, {file = "Jinja2-3.0.1.tar.gz", hash = "sha256:703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4"}, @@ -857,13 +1481,82 @@ markupsafe = [ {file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"}, ] marshmallow = [ - {file = "marshmallow-3.13.0-py2.py3-none-any.whl", hash = "sha256:dd4724335d3c2b870b641ffe4a2f8728a1380cd2e7e2312756715ffeaa82b842"}, - {file = "marshmallow-3.13.0.tar.gz", hash = "sha256:c67929438fd73a2be92128caa0325b1b5ed8b626d91a094d2f7f2771bf1f1c0e"}, + {file = "marshmallow-3.17.0-py3-none-any.whl", hash = "sha256:00040ab5ea0c608e8787137627a8efae97fabd60552a05dc889c888f814e75eb"}, + {file = "marshmallow-3.17.0.tar.gz", hash = "sha256:635fb65a3285a31a30f276f30e958070f5214c7196202caa5c7ecf28f5274bc7"}, +] +mock = [ + {file = "mock-4.0.3-py3-none-any.whl", hash = "sha256:122fcb64ee37cfad5b3f48d7a7d51875d7031aaf3d8be7c42e2bee25044eee62"}, + {file = "mock-4.0.3.tar.gz", hash = "sha256:7d3fbbde18228f4ff2f1f119a45cdffa458b4c0dee32eb4d2bb2f82554bac7bc"}, +] +mypy = [ + {file = "mypy-0.971-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f2899a3cbd394da157194f913a931edfd4be5f274a88041c9dc2d9cdcb1c315c"}, + {file = "mypy-0.971-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:98e02d56ebe93981c41211c05adb630d1d26c14195d04d95e49cd97dbc046dc5"}, + {file = "mypy-0.971-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:19830b7dba7d5356d3e26e2427a2ec91c994cd92d983142cbd025ebe81d69cf3"}, + {file = "mypy-0.971-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:02ef476f6dcb86e6f502ae39a16b93285fef97e7f1ff22932b657d1ef1f28655"}, + {file = "mypy-0.971-cp310-cp310-win_amd64.whl", hash = "sha256:25c5750ba5609a0c7550b73a33deb314ecfb559c350bb050b655505e8aed4103"}, + {file = "mypy-0.971-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d3348e7eb2eea2472db611486846742d5d52d1290576de99d59edeb7cd4a42ca"}, + {file = "mypy-0.971-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3fa7a477b9900be9b7dd4bab30a12759e5abe9586574ceb944bc29cddf8f0417"}, + {file = "mypy-0.971-cp36-cp36m-win_amd64.whl", hash = "sha256:2ad53cf9c3adc43cf3bea0a7d01a2f2e86db9fe7596dfecb4496a5dda63cbb09"}, + {file = "mypy-0.971-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:855048b6feb6dfe09d3353466004490b1872887150c5bb5caad7838b57328cc8"}, + {file = "mypy-0.971-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:23488a14a83bca6e54402c2e6435467a4138785df93ec85aeff64c6170077fb0"}, + {file = "mypy-0.971-cp37-cp37m-win_amd64.whl", hash = "sha256:4b21e5b1a70dfb972490035128f305c39bc4bc253f34e96a4adf9127cf943eb2"}, + {file = "mypy-0.971-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:9796a2ba7b4b538649caa5cecd398d873f4022ed2333ffde58eaf604c4d2cb27"}, + {file = "mypy-0.971-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5a361d92635ad4ada1b1b2d3630fc2f53f2127d51cf2def9db83cba32e47c856"}, + {file = "mypy-0.971-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b793b899f7cf563b1e7044a5c97361196b938e92f0a4343a5d27966a53d2ec71"}, + {file = "mypy-0.971-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d1ea5d12c8e2d266b5fb8c7a5d2e9c0219fedfeb493b7ed60cd350322384ac27"}, + {file = "mypy-0.971-cp38-cp38-win_amd64.whl", hash = "sha256:23c7ff43fff4b0df93a186581885c8512bc50fc4d4910e0f838e35d6bb6b5e58"}, + {file = "mypy-0.971-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1f7656b69974a6933e987ee8ffb951d836272d6c0f81d727f1d0e2696074d9e6"}, + {file = "mypy-0.971-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d2022bfadb7a5c2ef410d6a7c9763188afdb7f3533f22a0a32be10d571ee4bbe"}, + {file = "mypy-0.971-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef943c72a786b0f8d90fd76e9b39ce81fb7171172daf84bf43eaf937e9f220a9"}, + {file = "mypy-0.971-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d744f72eb39f69312bc6c2abf8ff6656973120e2eb3f3ec4f758ed47e414a4bf"}, + {file = "mypy-0.971-cp39-cp39-win_amd64.whl", hash = "sha256:77a514ea15d3007d33a9e2157b0ba9c267496acf12a7f2b9b9f8446337aac5b0"}, + {file = "mypy-0.971-py3-none-any.whl", hash = "sha256:0d054ef16b071149917085f51f89555a576e2618d5d9dd70bd6eea6410af3ac9"}, + {file = "mypy-0.971.tar.gz", hash = "sha256:40b0f21484238269ae6a57200c807d80debc6459d444c0489a102d7c6a75fa56"}, +] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, ] outcome = [ {file = "outcome-1.1.0-py2.py3-none-any.whl", hash = "sha256:c7dd9375cfd3c12db9801d080a3b63d4b0a261aa996c4c13152380587288d958"}, {file = "outcome-1.1.0.tar.gz", hash = "sha256:e862f01d4e626e63e8f92c38d1f8d5546d3f9cce989263c521b2e7990d186967"}, ] +packaging = [ + {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, + {file = "packaging-21.3.tar.gz", hash = "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb"}, +] +pathlib2 = [ + {file = "pathlib2-2.3.7.post1-py2.py3-none-any.whl", hash = "sha256:5266a0fd000452f1b3467d782f079a4343c63aaa119221fbdc4e39577489ca5b"}, + {file = "pathlib2-2.3.7.post1.tar.gz", hash = "sha256:9fe0edad898b83c0c3e199c842b27ed216645d2e177757b2dd67384d4113c641"}, +] +pathspec = [ + {file = "pathspec-0.10.1-py3-none-any.whl", hash = "sha256:46846318467efc4556ccfd27816e004270a9eeeeb4d062ce5e6fc7a87c573f93"}, + {file = "pathspec-0.10.1.tar.gz", hash = "sha256:7ace6161b621d31e7902eb6b5ae148d12cfd23f4a249b9ffb6b9fee12084323d"}, +] +platformdirs = [ + {file = "platformdirs-2.5.2-py3-none-any.whl", hash = "sha256:027d8e83a2d7de06bbac4e5ef7e023c02b863d7ea5d079477e722bb41ab25788"}, + {file = "platformdirs-2.5.2.tar.gz", hash = "sha256:58c8abb07dcb441e6ee4b11d8df0ac856038f944ab98b7be6b27b2a3c7feef19"}, +] +pluggy = [ + {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, + {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, +] +protobuf = [ + {file = "protobuf-4.21.6-cp310-abi3-win32.whl", hash = "sha256:49f88d56a9180dbb7f6199c920f5bb5c1dd0172f672983bb281298d57c2ac8eb"}, + {file = "protobuf-4.21.6-cp310-abi3-win_amd64.whl", hash = "sha256:7a6cc8842257265bdfd6b74d088b829e44bcac3cca234c5fdd6052730017b9ea"}, + {file = "protobuf-4.21.6-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:ba596b9ffb85c909fcfe1b1a23136224ed678af3faf9912d3fa483d5f9813c4e"}, + {file = "protobuf-4.21.6-cp37-abi3-manylinux2014_aarch64.whl", hash = "sha256:4143513c766db85b9d7c18dbf8339673c8a290131b2a0fe73855ab20770f72b0"}, + {file = "protobuf-4.21.6-cp37-abi3-manylinux2014_x86_64.whl", hash = "sha256:b6cea204865595a92a7b240e4b65bcaaca3ad5d2ce25d9db3756eba06041138e"}, + {file = "protobuf-4.21.6-cp37-cp37m-win32.whl", hash = "sha256:9666da97129138585b26afcb63ad4887f602e169cafe754a8258541c553b8b5d"}, + {file = "protobuf-4.21.6-cp37-cp37m-win_amd64.whl", hash = "sha256:308173d3e5a3528787bb8c93abea81d5a950bdce62840d9760effc84127fb39c"}, + {file = "protobuf-4.21.6-cp38-cp38-win32.whl", hash = "sha256:aa29113ec901281f29d9d27b01193407a98aa9658b8a777b0325e6d97149f5ce"}, + {file = "protobuf-4.21.6-cp38-cp38-win_amd64.whl", hash = "sha256:8f9e60f7d44592c66e7b332b6a7b4b6e8d8b889393c79dbc3a91f815118f8eac"}, + {file = "protobuf-4.21.6-cp39-cp39-win32.whl", hash = "sha256:80e6540381080715fddac12690ee42d087d0d17395f8d0078dfd6f1181e7be4c"}, + {file = "protobuf-4.21.6-cp39-cp39-win_amd64.whl", hash = "sha256:77b355c8604fe285536155286b28b0c4cbc57cf81b08d8357bf34829ea982860"}, + {file = "protobuf-4.21.6-py2.py3-none-any.whl", hash = "sha256:07a0bb9cc6114f16a39c866dc28b6e3d96fa4ffb9cc1033057412547e6e75cb9"}, + {file = "protobuf-4.21.6-py3-none-any.whl", hash = "sha256:c7c864148a237f058c739ae7a05a2b403c0dfa4ce7d1f3e5213f352ad52d57c6"}, + {file = "protobuf-4.21.6.tar.gz", hash = "sha256:6b1040a5661cd5f6e610cbca9cfaa2a17d60e2bb545309bc1b278bb05be44bdd"}, +] psycopg2-binary = [ {file = "psycopg2-binary-2.9.1.tar.gz", hash = "sha256:b0221ca5a9837e040ebf61f48899926b5783668b7807419e4adae8175a31f773"}, {file = "psycopg2_binary-2.9.1-cp310-cp310-macosx_10_14_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:24b0b6688b9f31a911f2361fe818492650795c9e5d3a1bc647acbd7440142a4f"}, @@ -902,6 +1595,10 @@ psycopg2-binary = [ {file = "psycopg2_binary-2.9.1-cp39-cp39-win32.whl", hash = "sha256:0b7dae87f0b729922e06f85f667de7bf16455d411971b2043bbd9577af9d1975"}, {file = "psycopg2_binary-2.9.1-cp39-cp39-win_amd64.whl", hash = "sha256:b4d7679a08fea64573c969f6994a2631908bb2c0e69a7235648642f3d2e39a68"}, ] +py = [ + {file = "py-1.11.0-py2.py3-none-any.whl", hash = "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378"}, + {file = "py-1.11.0.tar.gz", hash = "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719"}, +] pycparser = [ {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, @@ -959,6 +1656,22 @@ pydantic = [ {file = "pydantic-1.8.2-py3-none-any.whl", hash = "sha256:fec866a0b59f372b7e776f2d7308511784dace622e0992a0b59ea3ccee0ae833"}, {file = "pydantic-1.8.2.tar.gz", hash = "sha256:26464e57ccaafe72b7ad156fdaa4e9b9ef051f69e175dbbb463283000c05ab7b"}, ] +pyln-bolt7 = [ + {file = "pyln-bolt7-1.0.246.tar.gz", hash = "sha256:2b53744fa21c1b12d2c9c9df153651b122e38fa65d4a5c3f2957317ee148e089"}, + {file = "pyln_bolt7-1.0.246-py3-none-any.whl", hash = "sha256:54d48ec27fdc8751762cb068b0a9f2757a58fb57933c6d8f8255d02c27eb63c5"}, +] +pyln-client = [ + {file = "pyln-client-0.12.0.post1.tar.gz", hash = "sha256:c80338e8e9f435720c0e5f552dc4016fc8fba16d4b79764f881067e0fcd5d5c7"}, + {file = "pyln_client-0.12.0.post1-py3-none-any.whl", hash = "sha256:cfe3404eb88f294015145e668d774dd754b3baec36b44fe773fa354f1e1e48c1"}, +] +pyln-proto = [ + {file = "pyln-proto-0.11.1.tar.gz", hash = "sha256:9bed240f41917c4fd526b767218a77d0fbe69242876eef72c35a856796f922d6"}, + {file = "pyln_proto-0.11.1-py3-none-any.whl", hash = "sha256:27b2e04a81b894f69018279c0ce4aa2e7ccd03b86dd9783f96b9d8d1498c8393"}, +] +pyparsing = [ + {file = "pyparsing-3.0.9-py3-none-any.whl", hash = "sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc"}, + {file = "pyparsing-3.0.9.tar.gz", hash = "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb"}, +] pypng = [ {file = "pypng-0.0.21-py3-none-any.whl", hash = "sha256:76f8a1539ec56451da7ab7121f12a361969fe0f2d48d703d198ce2a99d6c5afd"}, ] @@ -967,7 +1680,24 @@ pyqrcode = [ {file = "PyQRCode-1.2.1.zip", hash = "sha256:1b2812775fa6ff5c527977c4cd2ccb07051ca7d0bc0aecf937a43864abe5eff6"}, ] pyscss = [ - {file = "pyScss-1.3.7.tar.gz", hash = "sha256:f1df571569021a23941a538eb154405dde80bed35dc1ea7c5f3e18e0144746bf"}, + {file = "pyScss-1.4.0.tar.gz", hash = "sha256:8f35521ffe36afa8b34c7d6f3195088a7057c185c2b8f15ee459ab19748669ff"}, +] +pysocks = [ + {file = "PySocks-1.7.1-py27-none-any.whl", hash = "sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299"}, + {file = "PySocks-1.7.1-py3-none-any.whl", hash = "sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5"}, + {file = "PySocks-1.7.1.tar.gz", hash = "sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"}, +] +pytest = [ + {file = "pytest-7.1.3-py3-none-any.whl", hash = "sha256:1377bda3466d70b55e3f5cecfa55bb7cfcf219c7964629b967c37cf0bda818b7"}, + {file = "pytest-7.1.3.tar.gz", hash = "sha256:4f365fec2dff9c1162f834d9f18af1ba13062db0c708bf7b946f8a5c76180c39"}, +] +pytest-asyncio = [ + {file = "pytest-asyncio-0.19.0.tar.gz", hash = "sha256:ac4ebf3b6207259750bc32f4c1d8fcd7e79739edbc67ad0c58dd150b1d072fed"}, + {file = "pytest_asyncio-0.19.0-py3-none-any.whl", hash = "sha256:7a97e37cfe1ed296e2e84941384bdd37c376453912d397ed39293e0916f521fa"}, +] +pytest-cov = [ + {file = "pytest-cov-3.0.0.tar.gz", hash = "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470"}, + {file = "pytest_cov-3.0.0-py3-none-any.whl", hash = "sha256:578d5d15ac4a25e5f961c938b85a05b09fdaae9deef3bb6de9a6e766622ca7a6"}, ] python-dotenv = [ {file = "python-dotenv-0.19.0.tar.gz", hash = "sha256:f521bc2ac9a8e03c736f62911605c5d83970021e3fa95b37d769e2bbbe9b6172"}, @@ -1090,8 +1820,8 @@ sqlalchemy = [ {file = "SQLAlchemy-1.3.23.tar.gz", hash = "sha256:6fca33672578666f657c131552c4ef8979c1606e494f78cd5199742dfb26918b"}, ] sqlalchemy-aio = [ - {file = "sqlalchemy_aio-0.16.0-py2.py3-none-any.whl", hash = "sha256:f767320427c22c66fa5840a1f17f3261110a8ddc8560558f4fbf12d31a66b17b"}, - {file = "sqlalchemy_aio-0.16.0.tar.gz", hash = "sha256:7f77366f55d34891c87386dd0962a28b948b684e8ea5edb7daae4187c0b291bf"}, + {file = "sqlalchemy_aio-0.17.0-py3-none-any.whl", hash = "sha256:3f4aa392c38f032d6734826a4138a0f02ed3122d442ed142be1e5964f2a33b60"}, + {file = "sqlalchemy_aio-0.17.0.tar.gz", hash = "sha256:f531c7982662d71dfc0b117e77bb2ed544e25cd5361e76cf9f5208edcfb71f7b"}, ] sse-starlette = [ {file = "sse-starlette-0.6.2.tar.gz", hash = "sha256:1c0cc62cc7d021a386dc06a16a9ddc3e2861d19da6bc2e654e65cc111e820456"}, @@ -1100,6 +1830,40 @@ starlette = [ {file = "starlette-0.19.1-py3-none-any.whl", hash = "sha256:5a60c5c2d051f3a8eb546136aa0c9399773a689595e099e0877704d5888279bf"}, {file = "starlette-0.19.1.tar.gz", hash = "sha256:c6d21096774ecb9639acad41b86b7706e52ba3bf1dc13ea4ed9ad593d47e24c7"}, ] +tomli = [ + {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"}, + {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, +] +typed-ast = [ + {file = "typed_ast-1.5.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:669dd0c4167f6f2cd9f57041e03c3c2ebf9063d0757dc89f79ba1daa2bfca9d4"}, + {file = "typed_ast-1.5.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:211260621ab1cd7324e0798d6be953d00b74e0428382991adfddb352252f1d62"}, + {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:267e3f78697a6c00c689c03db4876dd1efdfea2f251a5ad6555e82a26847b4ac"}, + {file = "typed_ast-1.5.4-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c542eeda69212fa10a7ada75e668876fdec5f856cd3d06829e6aa64ad17c8dfe"}, + {file = "typed_ast-1.5.4-cp310-cp310-win_amd64.whl", hash = "sha256:a9916d2bb8865f973824fb47436fa45e1ebf2efd920f2b9f99342cb7fab93f72"}, + {file = "typed_ast-1.5.4-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:79b1e0869db7c830ba6a981d58711c88b6677506e648496b1f64ac7d15633aec"}, + {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a94d55d142c9265f4ea46fab70977a1944ecae359ae867397757d836ea5a3f47"}, + {file = "typed_ast-1.5.4-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:183afdf0ec5b1b211724dfef3d2cad2d767cbefac291f24d69b00546c1837fb6"}, + {file = "typed_ast-1.5.4-cp36-cp36m-win_amd64.whl", hash = "sha256:639c5f0b21776605dd6c9dbe592d5228f021404dafd377e2b7ac046b0349b1a1"}, + {file = "typed_ast-1.5.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cf4afcfac006ece570e32d6fa90ab74a17245b83dfd6655a6f68568098345ff6"}, + {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ed855bbe3eb3715fca349c80174cfcfd699c2f9de574d40527b8429acae23a66"}, + {file = "typed_ast-1.5.4-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6778e1b2f81dfc7bc58e4b259363b83d2e509a65198e85d5700dfae4c6c8ff1c"}, + {file = "typed_ast-1.5.4-cp37-cp37m-win_amd64.whl", hash = "sha256:0261195c2062caf107831e92a76764c81227dae162c4f75192c0d489faf751a2"}, + {file = "typed_ast-1.5.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2efae9db7a8c05ad5547d522e7dbe62c83d838d3906a3716d1478b6c1d61388d"}, + {file = "typed_ast-1.5.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7d5d014b7daa8b0bf2eaef684295acae12b036d79f54178b92a2b6a56f92278f"}, + {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:370788a63915e82fd6f212865a596a0fefcbb7d408bbbb13dea723d971ed8bdc"}, + {file = "typed_ast-1.5.4-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4e964b4ff86550a7a7d56345c7864b18f403f5bd7380edf44a3c1fb4ee7ac6c6"}, + {file = "typed_ast-1.5.4-cp38-cp38-win_amd64.whl", hash = "sha256:683407d92dc953c8a7347119596f0b0e6c55eb98ebebd9b23437501b28dcbb8e"}, + {file = "typed_ast-1.5.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4879da6c9b73443f97e731b617184a596ac1235fe91f98d279a7af36c796da35"}, + {file = "typed_ast-1.5.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:3e123d878ba170397916557d31c8f589951e353cc95fb7f24f6bb69adc1a8a97"}, + {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ebd9d7f80ccf7a82ac5f88c521115cc55d84e35bf8b446fcd7836eb6b98929a3"}, + {file = "typed_ast-1.5.4-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:98f80dee3c03455e92796b58b98ff6ca0b2a6f652120c263efdba4d6c5e58f72"}, + {file = "typed_ast-1.5.4-cp39-cp39-win_amd64.whl", hash = "sha256:0fdbcf2fef0ca421a3f5912555804296f0b0960f0418c440f5d6d3abb549f3e1"}, + {file = "typed_ast-1.5.4.tar.gz", hash = "sha256:39e21ceb7388e4bb37f4c679d72707ed46c2fbf2a5609b8b8ebc4b067d977df2"}, +] +types-protobuf = [ + {file = "types-protobuf-3.20.4.tar.gz", hash = "sha256:0dad3a5009895c985a56e2837f61902bad9594151265ac0ee907bb16d0b01eb7"}, + {file = "types_protobuf-3.20.4-py3-none-any.whl", hash = "sha256:5082437afe64ce3b31c8db109eae86e02fda11e4d5f9ac59cb8578a8a138aa70"}, +] typing-extensions = [ {file = "typing_extensions-3.10.0.2-py2-none-any.whl", hash = "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7"}, {file = "typing_extensions-3.10.0.2-py3-none-any.whl", hash = "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34"}, @@ -1131,6 +1895,10 @@ watchgod = [ {file = "watchgod-0.7-py3-none-any.whl", hash = "sha256:d6c1ea21df37847ac0537ca0d6c2f4cdf513562e95f77bb93abbcf05573407b7"}, {file = "watchgod-0.7.tar.gz", hash = "sha256:48140d62b0ebe9dd9cf8381337f06351e1f2e70b2203fa9c6eff4e572ca84f29"}, ] +websocket-client = [ + {file = "websocket-client-1.3.3.tar.gz", hash = "sha256:d58c5f284d6a9bf8379dab423259fe8f85b70d5fa5d2916d5791a84594b122b1"}, + {file = "websocket_client-1.3.3-py3-none-any.whl", hash = "sha256:5d55652dc1d0b3c734f044337d929aaf83f4f9138816ec680c1aefefb4dc4877"}, +] websockets = [ {file = "websockets-10.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:cd8c6f2ec24aedace251017bc7a414525171d4e6578f914acab9349362def4da"}, {file = "websockets-10.0-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:1f6b814cff6aadc4288297cb3a248614829c6e4ff5556593c44a115e9dd49939"}, @@ -1158,7 +1926,10 @@ websockets = [ {file = "websockets-10.0-cp39-cp39-win_amd64.whl", hash = "sha256:c5880442f5fc268f1ef6d37b2c152c114deccca73f48e3a8c48004d2f16f4567"}, {file = "websockets-10.0.tar.gz", hash = "sha256:c4fc9a1d242317892590abe5b61a9127f1a61740477bfb121743f290b8054002"}, ] -win32-setctime = [] +win32-setctime = [ + {file = "win32_setctime-1.1.0-py3-none-any.whl", hash = "sha256:231db239e959c2fe7eb1d7dc129f11172354f98361c4fa2d6d2d7e278baa8aad"}, + {file = "win32_setctime-1.1.0.tar.gz", hash = "sha256:15cf5750465118d6929ae4de4eb46e8edae9a5634350c01ba582df868e932cb2"}, +] zipp = [ {file = "zipp-3.5.0-py3-none-any.whl", hash = "sha256:957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3"}, {file = "zipp-3.5.0.tar.gz", hash = "sha256:f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4"}, diff --git a/pyproject.toml b/pyproject.toml index 5c4bc7a0..7f833aa5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,8 @@ generate-setup-file = false script = "build.py" [tool.poetry.dependencies] -python = "^3.9" -aiofiles = "0.7.0" +python = "^3.10 | ^3.9 | ^3.8 | ^3.7" +aiofiles = "0.8.0" asgiref = "3.4.1" attrs = "21.2.0" bech32 = "1.2.0" @@ -24,22 +24,22 @@ embit = "0.4.9" environs = "9.3.3" fastapi = "0.78.0" h11 = "0.12.0" -httpcore = "0.13.7" -httptools = "0.2.0" -httpx = "0.19.0" +httpcore = "0.15.0" +httptools = "0.4.0" +httpx = "0.23.0" idna = "3.2" importlib-metadata = "4.8.1" jinja2 = "3.0.1" lnurl = "0.3.6" markupsafe = "2.0.1" -marshmallow = "3.13.0" +marshmallow = "3.17.0" outcome = "1.1.0" psycopg2-binary = "2.9.1" pycryptodomex = "3.14.1" pydantic = "1.8.2" pypng = "0.0.21" pyqrcode = "1.2.1" -pyscss = "1.3.7" +pyScss = "1.4.0" python-dotenv = "0.19.0" pyyaml = "5.4.1" represent = "1.6.0.post0" @@ -49,7 +49,7 @@ shortuuid = "1.0.1" six = "1.16.0" sniffio = "1.2.0" sqlalchemy = "1.3.23" -sqlalchemy-aio = "0.16.0" +sqlalchemy-aio = "0.17.0" sse-starlette = "0.6.2" typing-extensions = "3.10.0.2" uvicorn = "0.18.1" @@ -59,12 +59,41 @@ websockets = "10.0" zipp = "3.5.0" loguru = "0.5.3" cffi = "1.15.0" +websocket-client = "1.3.3" +grpcio = "^1.49.1" +protobuf = "^4.21.6" +pyln-client = "^0.12.0" [tool.poetry.dev-dependencies] +isort = "^5.10.1" +pytest = "^7.1.2" +mock = "^4.0.3" +black = "^22.6.0" +pytest-asyncio = "^0.19.0" +pytest-cov = "^3.0.0" +mypy = "^0.971" +types-protobuf = "^3.19.22" [build-system] -requires = ["poetry-core>=1.0.0"] +requires = ["poetry-core>=1.0.0", "pyScss"] build-backend = "poetry.core.masonry.api" [tool.poetry.scripts] lnbits = "lnbits.server:main" + +[tool.isort] +profile = "black" + +[tool.mypy] +ignore_missing_imports = "True" +files = "lnbits" +exclude = """(?x)( + ^lnbits/extensions. + | ^lnbits/wallets/lnd_grpc_files. +)""" + +[tool.pytest.ini_options] +addopts = "--durations=1 -s --cov=lnbits --cov-report=xml" +testpaths = [ + "tests" +] diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 33eea052..00000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -filterwarnings = - ignore::pytest.PytestCacheWarning diff --git a/requirements.txt b/requirements.txt index 23d428e5..697ea1d4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -50,3 +50,4 @@ uvicorn==0.18.2 uvloop==0.16.0 watchfiles==0.16.0 websockets==10.3 +websocket-client==1.3.3 diff --git a/tests/conftest.py b/tests/conftest.py index adb1fa36..1e719c76 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,19 +1,17 @@ import asyncio -import pytest_asyncio +from typing import Tuple +import pytest_asyncio from httpx import AsyncClient + from lnbits.app import create_app from lnbits.commands import migrate_databases -from lnbits.settings import HOST, PORT - -from lnbits.core.views.api import api_payments_create_invoice, CreateInvoiceData - from lnbits.core.crud import create_account, create_wallet, get_wallet -from tests.helpers import credit_wallet, get_random_invoice_data - +from lnbits.core.models import BalanceCheck, Payment, User, Wallet +from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice from lnbits.db import Database -from lnbits.core.models import User, Wallet, Payment, BalanceCheck -from typing import Tuple +from lnbits.settings import HOST, PORT +from tests.helpers import credit_wallet, get_random_invoice_data @pytest_asyncio.fixture(scope="session") @@ -122,12 +120,8 @@ async def adminkey_headers_to(to_wallet): @pytest_asyncio.fixture(scope="session") async def invoice(to_wallet): - wallet = to_wallet data = await get_random_invoice_data() invoiceData = CreateInvoiceData(**data) - stuff_lock = asyncio.Lock() - async with stuff_lock: - invoice = await api_payments_create_invoice(invoiceData, wallet) - await asyncio.sleep(1) + invoice = await api_payments_create_invoice(invoiceData, to_wallet) yield invoice del invoice diff --git a/tests/core/views/test_api.py b/tests/core/views/test_api.py index dfd2b32a..e0f6b576 100644 --- a/tests/core/views/test_api.py +++ b/tests/core/views/test_api.py @@ -1,9 +1,20 @@ +import hashlib +from binascii import hexlify + import pytest import pytest_asyncio -from lnbits.core.crud import get_wallet -from lnbits.core.views.api import api_payment -from ...helpers import get_random_invoice_data +from lnbits import bolt11 +from lnbits.core.crud import get_wallet +from lnbits.core.views.api import ( + CreateInvoiceData, + api_payment, + api_payments_create_invoice, +) +from lnbits.settings import wallet_class + +from ...helpers import get_random_invoice_data, is_regtest + # check if the client is working @pytest.mark.asyncio @@ -34,6 +45,20 @@ async def test_get_wallet_adminkey(client, adminkey_headers_to): assert "id" in result +# check PUT /api/v1/wallet/newwallet: empty request where admin key is needed +@pytest.mark.asyncio +async def test_put_empty_request_expected_admin_keys(client): + response = await client.put("/api/v1/wallet/newwallet") + assert response.status_code == 401 + + +# check POST /api/v1/payments: empty request where invoice key is needed +@pytest.mark.asyncio +async def test_post_empty_request_expected_invoice_keys(client): + response = await client.post("/api/v1/payments") + assert response.status_code == 401 + + # check POST /api/v1/payments: invoice creation @pytest.mark.asyncio async def test_create_invoice(client, inkey_headers_to): @@ -137,6 +162,7 @@ async def test_pay_invoice_invoicekey(client, invoice, inkey_headers_from): # check POST /api/v1/payments: payment with admin key [should pass] @pytest.mark.asyncio +@pytest.mark.skipif(is_regtest, reason="this only works in fakewallet") async def test_pay_invoice_adminkey(client, invoice, adminkey_headers_from): data = {"out": True, "bolt11": invoice["payment_request"]} # try payment with admin key @@ -179,3 +205,42 @@ async def test_api_payment_with_key(invoice, inkey_headers_from): assert type(response) == dict assert response["paid"] == True assert "details" in response + + +# check POST /api/v1/payments: invoice creation with a description hash +@pytest.mark.skipif( + wallet_class.__name__ in ["CoreLightningWallet"], + reason="wallet does not support description_hash", +) +@pytest.mark.asyncio +async def test_create_invoice_with_description_hash(client, inkey_headers_to): + data = await get_random_invoice_data() + descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest() + data["description_hash"] = descr_hash + + response = await client.post( + "/api/v1/payments", json=data, headers=inkey_headers_to + ) + invoice = response.json() + + invoice_bolt11 = bolt11.decode(invoice["payment_request"]) + assert invoice_bolt11.description_hash == descr_hash + assert invoice_bolt11.description is None + return invoice + + +@pytest.mark.asyncio +async def test_create_invoice_with_unhashed_description(client, inkey_headers_to): + data = await get_random_invoice_data() + descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest() + data["unhashed_description"] = "asdasdasd".encode("utf-8").hex() + + response = await client.post( + "/api/v1/payments", json=data, headers=inkey_headers_to + ) + invoice = response.json() + + invoice_bolt11 = bolt11.decode(invoice["payment_request"]) + assert invoice_bolt11.description_hash == descr_hash + assert invoice_bolt11.description is None + return invoice diff --git a/tests/core/views/test_generic.py b/tests/core/views/test_generic.py index 6e6354d1..4300b78b 100644 --- a/tests/core/views/test_generic.py +++ b/tests/core/views/test_generic.py @@ -1,5 +1,6 @@ import pytest import pytest_asyncio + from tests.conftest import client diff --git a/tests/core/views/test_public_api.py b/tests/core/views/test_public_api.py index d9c253c2..6ebaeabd 100644 --- a/tests/core/views/test_public_api.py +++ b/tests/core/views/test_public_api.py @@ -1,7 +1,9 @@ import pytest import pytest_asyncio + from lnbits.core.crud import get_wallet + # check if the client is working @pytest.mark.asyncio async def test_core_views_generic(client): diff --git a/tests/data/mock_data.zip b/tests/data/mock_data.zip index 6f7165b3..d184f94a 100644 Binary files a/tests/data/mock_data.zip and b/tests/data/mock_data.zip differ diff --git a/tests/extensions/bleskomat/conftest.py b/tests/extensions/bleskomat/conftest.py index b4ad0bfc..13be2b57 100644 --- a/tests/extensions/bleskomat/conftest.py +++ b/tests/extensions/bleskomat/conftest.py @@ -1,17 +1,19 @@ import json +import secrets + import pytest import pytest_asyncio -import secrets + from lnbits.core.crud import create_account, create_wallet from lnbits.extensions.bleskomat.crud import create_bleskomat, create_bleskomat_lnurl -from lnbits.extensions.bleskomat.models import CreateBleskomat +from lnbits.extensions.bleskomat.exchange_rates import exchange_rate_providers from lnbits.extensions.bleskomat.helpers import ( generate_bleskomat_lnurl_secret, generate_bleskomat_lnurl_signature, prepare_lnurl_params, query_to_signing_payload, ) -from lnbits.extensions.bleskomat.exchange_rates import exchange_rate_providers +from lnbits.extensions.bleskomat.models import CreateBleskomat exchange_rate_providers["dummy"] = { "name": "dummy", diff --git a/tests/extensions/bleskomat/test_lnurl_api.py b/tests/extensions/bleskomat/test_lnurl_api.py index 0189e119..3f723266 100644 --- a/tests/extensions/bleskomat/test_lnurl_api.py +++ b/tests/extensions/bleskomat/test_lnurl_api.py @@ -1,16 +1,18 @@ +import secrets + import pytest import pytest_asyncio -import secrets + from lnbits.core.crud import get_wallet -from lnbits.settings import HOST, PORT from lnbits.extensions.bleskomat.crud import get_bleskomat_lnurl from lnbits.extensions.bleskomat.helpers import ( generate_bleskomat_lnurl_signature, query_to_signing_payload, ) +from lnbits.settings import HOST, PORT from tests.conftest import client -from tests.helpers import credit_wallet from tests.extensions.bleskomat.conftest import bleskomat, lnurl +from tests.helpers import credit_wallet, is_regtest from tests.mocks import WALLET @@ -95,6 +97,7 @@ async def test_bleskomat_lnurl_api_valid_signature(client, bleskomat): @pytest.mark.asyncio +@pytest.mark.skipif(is_regtest, reason="this test is only passes in fakewallet") async def test_bleskomat_lnurl_api_action_insufficient_balance(client, lnurl): bleskomat = lnurl["bleskomat"] secret = lnurl["secret"] @@ -114,6 +117,7 @@ async def test_bleskomat_lnurl_api_action_insufficient_balance(client, lnurl): @pytest.mark.asyncio +@pytest.mark.skipif(is_regtest, reason="this test is only passes in fakewallet") async def test_bleskomat_lnurl_api_action_success(client, lnurl): bleskomat = lnurl["bleskomat"] secret = lnurl["secret"] diff --git a/tests/extensions/boltz/__init__.py b/tests/extensions/boltz/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/extensions/boltz/conftest.py b/tests/extensions/boltz/conftest.py new file mode 100644 index 00000000..b9ef7887 --- /dev/null +++ b/tests/extensions/boltz/conftest.py @@ -0,0 +1,25 @@ +import asyncio +import json +import secrets + +import pytest +import pytest_asyncio + +from lnbits.core.crud import create_account, create_wallet, get_wallet +from lnbits.extensions.boltz.boltz import create_reverse_swap, create_swap +from lnbits.extensions.boltz.models import ( + CreateReverseSubmarineSwap, + CreateSubmarineSwap, +) +from tests.mocks import WALLET + + +@pytest_asyncio.fixture(scope="session") +async def reverse_swap(from_wallet): + data = CreateReverseSubmarineSwap( + wallet=from_wallet.id, + instant_settlement=True, + onchain_address="bcrt1q4vfyszl4p8cuvqh07fyhtxve5fxq8e2ux5gx43", + amount=20_000, + ) + return await create_reverse_swap(data) diff --git a/tests/extensions/boltz/test_api.py b/tests/extensions/boltz/test_api.py new file mode 100644 index 00000000..90ce6ec1 --- /dev/null +++ b/tests/extensions/boltz/test_api.py @@ -0,0 +1,103 @@ +import pytest +import pytest_asyncio + +from tests.helpers import is_fake, is_regtest + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_mempool_url(client): + response = await client.get("/boltz/api/v1/swap/mempool") + assert response.status_code == 200 + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_boltz_config(client): + response = await client.get("/boltz/api/v1/swap/boltz") + assert response.status_code == 200 + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_endpoints_unauthenticated(client): + response = await client.get("/boltz/api/v1/swap?all_wallets=true") + assert response.status_code == 401 + response = await client.get("/boltz/api/v1/swap/reverse?all_wallets=true") + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap") + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/reverse") + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/status") + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/check") + assert response.status_code == 401 + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_endpoints_inkey(client, inkey_headers_to): + response = await client.get( + "/boltz/api/v1/swap?all_wallets=true", headers=inkey_headers_to + ) + assert response.status_code == 200 + response = await client.get( + "/boltz/api/v1/swap/reverse?all_wallets=true", headers=inkey_headers_to + ) + assert response.status_code == 200 + + response = await client.post("/boltz/api/v1/swap", headers=inkey_headers_to) + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/reverse", headers=inkey_headers_to) + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/refund", headers=inkey_headers_to) + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/status", headers=inkey_headers_to) + assert response.status_code == 401 + response = await client.post("/boltz/api/v1/swap/check", headers=inkey_headers_to) + assert response.status_code == 401 + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_endpoints_adminkey_nocontent(client, adminkey_headers_to): + response = await client.post("/boltz/api/v1/swap", headers=adminkey_headers_to) + assert response.status_code == 204 + response = await client.post( + "/boltz/api/v1/swap/reverse", headers=adminkey_headers_to + ) + assert response.status_code == 204 + response = await client.post( + "/boltz/api/v1/swap/refund", headers=adminkey_headers_to + ) + assert response.status_code == 204 + response = await client.post( + "/boltz/api/v1/swap/status", headers=adminkey_headers_to + ) + assert response.status_code == 204 + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest") +async def test_endpoints_adminkey_regtest(client, from_wallet, adminkey_headers_to): + swap = { + "wallet": from_wallet.id, + "refund_address": "bcrt1q3cwq33y435h52gq3qqsdtczh38ltlnf69zvypm", + "amount": 50_000, + } + response = await client.post( + "/boltz/api/v1/swap", json=swap, headers=adminkey_headers_to + ) + assert response.status_code == 201 + + reverse_swap = { + "wallet": from_wallet.id, + "instant_settlement": True, + "onchain_address": "bcrt1q4vfyszl4p8cuvqh07fyhtxve5fxq8e2ux5gx43", + "amount": 50_000, + } + response = await client.post( + "/boltz/api/v1/swap/reverse", json=reverse_swap, headers=adminkey_headers_to + ) + assert response.status_code == 201 diff --git a/tests/extensions/boltz/test_swap.py b/tests/extensions/boltz/test_swap.py new file mode 100644 index 00000000..ab5954ac --- /dev/null +++ b/tests/extensions/boltz/test_swap.py @@ -0,0 +1,31 @@ +import asyncio + +import pytest +import pytest_asyncio + +from lnbits.extensions.boltz.boltz import create_reverse_swap, create_swap +from lnbits.extensions.boltz.crud import ( + create_reverse_submarine_swap, + create_submarine_swap, + get_reverse_submarine_swap, + get_submarine_swap, +) +from tests.extensions.boltz.conftest import reverse_swap +from tests.helpers import is_fake, is_regtest + + +@pytest.mark.asyncio +@pytest.mark.skipif(is_fake, reason="this test is only passes in regtest") +async def test_create_reverse_swap(client, reverse_swap): + swap, wait_for_onchain = reverse_swap + assert swap.status == "pending" + assert swap.id is not None + assert swap.boltz_id is not None + assert swap.claim_privkey is not None + assert swap.onchain_address is not None + assert swap.lockup_address is not None + newswap = await create_reverse_submarine_swap(swap) + await wait_for_onchain + newswap = await get_reverse_submarine_swap(swap.id) + assert newswap is not None + assert newswap.status == "complete" diff --git a/tests/extensions/invoices/__init__.py b/tests/extensions/invoices/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/extensions/invoices/conftest.py b/tests/extensions/invoices/conftest.py new file mode 100644 index 00000000..09ac42ec --- /dev/null +++ b/tests/extensions/invoices/conftest.py @@ -0,0 +1,37 @@ +import pytest +import pytest_asyncio + +from lnbits.core.crud import create_account, create_wallet +from lnbits.extensions.invoices.crud import ( + create_invoice_internal, + create_invoice_items, +) +from lnbits.extensions.invoices.models import CreateInvoiceData + + +@pytest_asyncio.fixture +async def invoices_wallet(): + user = await create_account() + wallet = await create_wallet(user_id=user.id, wallet_name="invoices_test") + + return wallet + + +@pytest_asyncio.fixture +async def accounting_invoice(invoices_wallet): + invoice_data = CreateInvoiceData( + status="open", + currency="USD", + company_name="LNBits, Inc", + first_name="Ben", + last_name="Arc", + items=[{"amount": 10.20, "description": "Item costs 10.20"}], + ) + invoice = await create_invoice_internal( + wallet_id=invoices_wallet.id, data=invoice_data + ) + items = await create_invoice_items(invoice_id=invoice.id, data=invoice_data.items) + + invoice_dict = invoice.dict() + invoice_dict["items"] = items + return invoice_dict diff --git a/tests/extensions/invoices/test_invoices_api.py b/tests/extensions/invoices/test_invoices_api.py new file mode 100644 index 00000000..eaadd07b --- /dev/null +++ b/tests/extensions/invoices/test_invoices_api.py @@ -0,0 +1,135 @@ +import pytest +import pytest_asyncio +from loguru import logger + +from lnbits.core.crud import get_wallet +from tests.conftest import adminkey_headers_from, client, invoice +from tests.extensions.invoices.conftest import accounting_invoice, invoices_wallet +from tests.helpers import credit_wallet +from tests.mocks import WALLET + + +@pytest.mark.asyncio +async def test_invoices_unknown_invoice(client): + response = await client.get("/invoices/pay/u") + assert response.json() == {"detail": "Invoice does not exist."} + + +@pytest.mark.asyncio +async def test_invoices_api_create_invoice_valid(client, invoices_wallet): + query = { + "status": "open", + "currency": "EUR", + "company_name": "LNBits, Inc.", + "first_name": "Ben", + "last_name": "Arc", + "email": "ben@legend.arc", + "items": [ + {"amount": 2.34, "description": "Item 1"}, + {"amount": 0.98, "description": "Item 2"}, + ], + } + + status = query["status"] + currency = query["currency"] + fname = query["first_name"] + total = sum(d["amount"] for d in query["items"]) + + response = await client.post( + "/invoices/api/v1/invoice", + json=query, + headers={"X-Api-Key": invoices_wallet.inkey}, + ) + + assert response.status_code == 201 + data = response.json() + + assert data["status"] == status + assert data["wallet"] == invoices_wallet.id + assert data["currency"] == currency + assert data["first_name"] == fname + assert sum(d["amount"] / 100 for d in data["items"]) == total + + +@pytest.mark.asyncio +async def test_invoices_api_partial_pay_invoice( + client, accounting_invoice, adminkey_headers_from +): + invoice_id = accounting_invoice["id"] + amount_to_pay = int(5.05 * 100) # mock invoice total amount is 10 USD + + # ask for an invoice + response = await client.post( + f"/invoices/api/v1/invoice/{invoice_id}/payments?famount={amount_to_pay}" + ) + assert response.status_code < 300 + data = response.json() + payment_hash = data["payment_hash"] + + # pay the invoice + data = {"out": True, "bolt11": data["payment_request"]} + response = await client.post( + "/api/v1/payments", json=data, headers=adminkey_headers_from + ) + assert response.status_code < 300 + assert len(response.json()["payment_hash"]) == 64 + assert len(response.json()["checking_id"]) > 0 + + # check invoice is paid + response = await client.get( + f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}" + ) + assert response.status_code == 200 + assert response.json()["paid"] == True + + # check invoice status + response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}") + assert response.status_code == 200 + data = response.json() + + assert data["status"] == "open" + + +#### +# +# TEST FAILS FOR NOW, AS LISTENERS ARE NOT WORKING ON TESTING +# +### + +# @pytest.mark.asyncio +# async def test_invoices_api_full_pay_invoice(client, accounting_invoice, adminkey_headers_to): +# invoice_id = accounting_invoice["id"] +# print(accounting_invoice["id"]) +# amount_to_pay = int(10.20 * 100) + +# # ask for an invoice +# response = await client.post( +# f"/invoices/api/v1/invoice/{invoice_id}/payments?famount={amount_to_pay}" +# ) +# assert response.status_code == 201 +# data = response.json() +# payment_hash = data["payment_hash"] + +# # pay the invoice +# data = {"out": True, "bolt11": data["payment_request"]} +# response = await client.post( +# "/api/v1/payments", json=data, headers=adminkey_headers_to +# ) +# assert response.status_code < 300 +# assert len(response.json()["payment_hash"]) == 64 +# assert len(response.json()["checking_id"]) > 0 + +# # check invoice is paid +# response = await client.get( +# f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}" +# ) +# assert response.status_code == 200 +# assert response.json()["paid"] == True + +# # check invoice status +# response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}") +# assert response.status_code == 200 +# data = response.json() + +# print(data) +# assert data["status"] == "paid" diff --git a/tests/helpers.py b/tests/helpers.py index 0ba1963d..fc5931bc 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -1,8 +1,10 @@ import hashlib -import secrets import random +import secrets import string + from lnbits.core.crud import create_payment +from lnbits.settings import wallet_class async def credit_wallet(wallet_id: str, amount: int): @@ -31,3 +33,7 @@ def get_random_string(N=10): async def get_random_invoice_data(): return {"out": False, "amount": 10, "memo": f"test_memo_{get_random_string(10)}"} + + +is_fake: bool = wallet_class.__name__ == "FakeWallet" +is_regtest: bool = not is_fake diff --git a/tests/mocks.py b/tests/mocks.py index c99691cb..3fc0efae 100644 --- a/tests/mocks.py +++ b/tests/mocks.py @@ -1,15 +1,11 @@ from mock import AsyncMock -from lnbits import bolt11 -from lnbits.wallets.base import ( - StatusResponse, - PaymentResponse, - PaymentStatus, -) -from lnbits.settings import WALLET +from lnbits import bolt11 +from lnbits.settings import WALLET +from lnbits.wallets.base import PaymentResponse, PaymentStatus, StatusResponse from lnbits.wallets.fake import FakeWallet -from .helpers import get_random_string +from .helpers import get_random_string, is_fake # generates an invoice with FakeWallet @@ -20,12 +16,13 @@ async def generate_mock_invoice(**x): return invoice -WALLET.status = AsyncMock( - return_value=StatusResponse( - "", # no error - 1000000, # msats +if is_fake: + WALLET.status = AsyncMock( + return_value=StatusResponse( + "", # no error + 1000000, # msats + ) ) -) # Note: if this line is uncommented, invoices will always be generated by FakeWallet # WALLET.create_invoice = generate_mock_invoice @@ -55,26 +52,27 @@ WALLET.status = AsyncMock( # ) -def pay_invoice_side_effect( - payment_request: str, fee_limit_msat: int -) -> PaymentResponse: - invoice = bolt11.decode(payment_request) - return PaymentResponse( - True, # ok - invoice.payment_hash, # checking_id (i.e. payment_hash) - 0, # fee_msat - "", # no error - ) +if is_fake: + def pay_invoice_side_effect( + payment_request: str, fee_limit_msat: int + ) -> PaymentResponse: + invoice = bolt11.decode(payment_request) + return PaymentResponse( + True, # ok + invoice.payment_hash, # checking_id (i.e. payment_hash) + 0, # fee_msat + "", # no error + ) -WALLET.pay_invoice = AsyncMock(side_effect=pay_invoice_side_effect) -WALLET.get_invoice_status = AsyncMock( - return_value=PaymentStatus( - True, # paid + WALLET.pay_invoice = AsyncMock(side_effect=pay_invoice_side_effect) + WALLET.get_invoice_status = AsyncMock( + return_value=PaymentStatus( + True, # paid + ) ) -) -WALLET.get_payment_status = AsyncMock( - return_value=PaymentStatus( - True, # paid + WALLET.get_payment_status = AsyncMock( + return_value=PaymentStatus( + True, # paid + ) ) -) diff --git a/tools/conv.py b/tools/conv.py index b93bcfbe..5084660f 100644 --- a/tools/conv.py +++ b/tools/conv.py @@ -1,6 +1,7 @@ import argparse import os import sqlite3 +from typing import List import psycopg2 from environs import Env # type: ignore @@ -18,16 +19,12 @@ env.read_env() # Change these values as needed -sqfolder = "data/" +sqfolder = env.str("LNBITS_DATA_FOLDER", default=None) LNBITS_DATABASE_URL = env.str("LNBITS_DATABASE_URL", default=None) if LNBITS_DATABASE_URL is None: - pgdb = "lnbits" - pguser = "lnbits" - pgpswd = "postgres" - pghost = "localhost" - pgport = "5432" - pgschema = "" + print("missing LNBITS_DATABASE_URL") + sys.exit(1) else: # parse postgres://lnbits:postgres@localhost:5432/lnbits pgdb = LNBITS_DATABASE_URL.split("/")[-1] @@ -110,627 +107,59 @@ def insert_to_pg(query, data): connection.close() -def migrate_core(sqlite_db_file): - sq = get_sqlite_cursor(sqlite_db_file) +def migrate_core(file: str, exclude_tables: List[str] = []): + print(f"Migrating core: {file}") + migrate_db(file, "public", exclude_tables) + print("✅ Migrated core") - # ACCOUNTS - res = sq.execute("SELECT * FROM accounts;") - q = f"INSERT INTO public.accounts (id, email, pass) VALUES (%s, %s, %s);" - insert_to_pg(q, res.fetchall()) - # WALLETS - res = sq.execute("SELECT * FROM wallets;") - q = f'INSERT INTO public.wallets (id, name, "user", adminkey, inkey) VALUES (%s, %s, %s, %s, %s);' - insert_to_pg(q, res.fetchall()) +def migrate_ext(file: str): + filename = os.path.basename(file) + schema = filename.replace("ext_", "").split(".")[0] + print(f"Migrating ext: {file}.{schema}") + migrate_db(file, schema) + print(f"✅ Migrated ext: {schema}") - # API PAYMENTS - res = sq.execute("SELECT * FROM apipayments;") - q = f""" - INSERT INTO public.apipayments( - checking_id, amount, fee, wallet, pending, memo, "time", hash, preimage, bolt11, extra, webhook, webhook_status) - VALUES (%s, %s, %s, %s, %s::boolean, %s, to_timestamp(%s), %s, %s, %s, %s, %s, %s); + +def migrate_db(file: str, schema: str, exclude_tables: List[str] = []): + sq = get_sqlite_cursor(file) + tables = sq.execute( + """ + SELECT name FROM sqlite_master + WHERE type='table' AND name not like 'sqlite?_%' escape '?' """ - insert_to_pg(q, res.fetchall()) + ).fetchall() - # BALANCE CHECK - res = sq.execute("SELECT * FROM balance_check;") - q = f"INSERT INTO public.balance_check(wallet, service, url) VALUES (%s, %s, %s);" - insert_to_pg(q, res.fetchall()) + for table in tables: + tableName = table[0] + if tableName in exclude_tables: + continue - # BALANCE NOTIFY - res = sq.execute("SELECT * FROM balance_notify;") - q = f"INSERT INTO public.balance_notify(wallet, url) VALUES (%s, %s);" - insert_to_pg(q, res.fetchall()) + columns = sq.execute(f"PRAGMA table_info({tableName})").fetchall() + q = build_insert_query(schema, tableName, columns) - # EXTENSIONS - res = sq.execute("SELECT * FROM extensions;") - q = f'INSERT INTO public.extensions("user", extension, active) VALUES (%s, %s, %s::boolean);' - insert_to_pg(q, res.fetchall()) - - print("Migrated: core") - - -def migrate_ext(sqlite_db_file, schema, ignore_missing=True): - - # skip this file it has been moved to ext_lnurldevices.sqlite3 - if sqlite_db_file == "data/ext_lnurlpos.sqlite3": - return - - print(f"Migrating {sqlite_db_file}.{schema}") - sq = get_sqlite_cursor(sqlite_db_file) - if schema == "bleskomat": - # BLESKOMAT LNURLS - res = sq.execute("SELECT * FROM bleskomat_lnurls;") - q = f""" - INSERT INTO bleskomat.bleskomat_lnurls( - id, bleskomat, wallet, hash, tag, params, api_key_id, initial_uses, remaining_uses, created_time, updated_time) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - - # BLESKOMATS - res = sq.execute("SELECT * FROM bleskomats;") - q = f""" - INSERT INTO bleskomat.bleskomats( - id, wallet, api_key_id, api_key_secret, api_key_encoding, name, fiat_currency, exchange_rate_provider, fee) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "captcha": - # CAPTCHA - res = sq.execute("SELECT * FROM captchas;") - q = f""" - INSERT INTO captcha.captchas( - id, wallet, url, memo, description, amount, "time", remembers, extras) - VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s), %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "copilot": - # OLD COPILOTS - res = sq.execute("SELECT * FROM copilots;") - q = f""" - INSERT INTO copilot.copilots( - id, "user", title, lnurl_toggle, wallet, animation1, animation2, animation3, animation1threshold, animation2threshold, animation3threshold, animation1webhook, animation2webhook, animation3webhook, lnurl_title, show_message, show_ack, show_price, amount_made, fullscreen_cam, iframe_url, "timestamp") - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - - # NEW COPILOTS - q = f""" - INSERT INTO copilot.newer_copilots( - id, "user", title, lnurl_toggle, wallet, animation1, animation2, animation3, animation1threshold, animation2threshold, animation3threshold, animation1webhook, animation2webhook, animation3webhook, lnurl_title, show_message, show_ack, show_price, amount_made, fullscreen_cam, iframe_url, "timestamp") - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "events": - # EVENTS - res = sq.execute("SELECT * FROM events;") - q = f""" - INSERT INTO events.events( - id, wallet, name, info, closing_date, event_start_date, event_end_date, amount_tickets, price_per_ticket, sold, "time") - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - # EVENT TICKETS - res = sq.execute("SELECT * FROM ticket;") - q = f""" - INSERT INTO events.ticket( - id, wallet, event, name, email, registered, paid, "time") - VALUES (%s, %s, %s, %s, %s, %s::boolean, %s::boolean, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "example": - # Example doesn't have a database at the moment - pass - elif schema == "hivemind": - # Hivemind doesn't have a database at the moment - pass - elif schema == "jukebox": - # JUKEBOXES - res = sq.execute("SELECT * FROM jukebox;") - q = f""" - INSERT INTO jukebox.jukebox( - id, "user", title, wallet, inkey, sp_user, sp_secret, sp_access_token, sp_refresh_token, sp_device, sp_playlists, price, profit) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # JUKEBOX PAYMENTS - res = sq.execute("SELECT * FROM jukebox_payment;") - q = f""" - INSERT INTO jukebox.jukebox_payment( - payment_hash, juke_id, song_id, paid) - VALUES (%s, %s, %s, %s::boolean); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "withdraw": - # WITHDRAW LINK - res = sq.execute("SELECT * FROM withdraw_link;") - q = f""" - INSERT INTO withdraw.withdraw_link ( - id, - wallet, - title, - min_withdrawable, - max_withdrawable, - uses, - wait_time, - is_unique, - unique_hash, - k1, - open_time, - used, - usescsv, - webhook_url, - custom_url - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # WITHDRAW HASH CHECK - res = sq.execute("SELECT * FROM hash_check;") - q = f""" - INSERT INTO withdraw.hash_check (id, lnurl_id) - VALUES (%s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "watchonly": - # WALLETS - res = sq.execute("SELECT * FROM wallets;") - q = f""" - INSERT INTO watchonly.wallets ( - id, - "user", - masterpub, - title, - address_no, - balance, - type, - fingerprint - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # ADDRESSES - res = sq.execute("SELECT * FROM addresses;") - q = f""" - INSERT INTO watchonly.addresses (id, address, wallet, amount, branch_index, address_index, has_activity, note) - VALUES (%s, %s, %s, %s, %s, %s, %s::boolean, %s); - """ - insert_to_pg(q, res.fetchall()) - # CONFIG - res = sq.execute("SELECT * FROM config;") - q = f""" - INSERT INTO watchonly.config ("user", json_data) - VALUES (%s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "usermanager": - # USERS - res = sq.execute("SELECT * FROM users;") - q = f""" - INSERT INTO usermanager.users (id, name, admin, email, password) - VALUES (%s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # WALLETS - res = sq.execute("SELECT * FROM wallets;") - q = f""" - INSERT INTO usermanager.wallets (id, admin, name, "user", adminkey, inkey) - VALUES (%s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "tpos": - # TPOSS - res = sq.execute("SELECT * FROM tposs;") - q = f""" - INSERT INTO tpos.tposs (id, wallet, name, currency, tip_wallet, tip_options) - VALUES (%s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "tipjar": - # TIPJARS - res = sq.execute("SELECT * FROM TipJars;") - q = f""" - INSERT INTO tipjar.TipJars (id, name, wallet, onchain, webhook) - VALUES (%s, %s, %s, %s, %s); - """ - pay_links = res.fetchall() - insert_to_pg(q, pay_links) - fix_id("tipjar.tipjars_id_seq", pay_links) - # TIPS - res = sq.execute("SELECT * FROM Tips;") - q = f""" - INSERT INTO tipjar.Tips (id, wallet, name, message, sats, tipjar) - VALUES (%s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "subdomains": - # DOMAIN - res = sq.execute("SELECT * FROM domain;") - q = f""" - INSERT INTO subdomains.domain ( - id, - wallet, - domain, - webhook, - cf_token, - cf_zone_id, - description, - cost, - amountmade, - allowed_record_types, - time - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - # SUBDOMAIN - res = sq.execute("SELECT * FROM subdomain;") - q = f""" - INSERT INTO subdomains.subdomain ( - id, - domain, - email, - subdomain, - ip, - wallet, - sats, - duration, - paid, - record_type, - time - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s::boolean, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "streamalerts": - # SERVICES - res = sq.execute("SELECT * FROM Services;") - q = f""" - INSERT INTO streamalerts.Services ( - id, - state, - twitchuser, - client_id, - client_secret, - wallet, - onchain, - servicename, - authenticated, - token - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s::boolean, %s); - """ - services = res.fetchall() - insert_to_pg(q, services) - fix_id("streamalerts.services_id_seq", services) - # DONATIONS - res = sq.execute("SELECT * FROM Donations;") - q = f""" - INSERT INTO streamalerts.Donations ( - id, - wallet, - name, - message, - cur_code, - sats, - amount, - service, - posted, - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s::boolean); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "splitpayments": - # TARGETS - res = sq.execute("SELECT * FROM targets;") - q = f""" - INSERT INTO splitpayments.targets (wallet, source, percent, alias) - VALUES (%s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "satspay": - # CHARGES - res = sq.execute("SELECT * FROM charges;") - q = f""" - INSERT INTO satspay.charges ( - id, - "user", - description, - onchainwallet, - onchainaddress, - lnbitswallet, - payment_request, - payment_hash, - webhook, - completelink, - completelinktext, - time, - amount, - balance, - timestamp - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "satsdice": - # SATSDICE PAY - res = sq.execute("SELECT * FROM satsdice_pay;") - q = f""" - INSERT INTO satsdice.satsdice_pay ( - id, - wallet, - title, - min_bet, - max_bet, - amount, - served_meta, - served_pr, - multiplier, - haircut, - chance, - base_url, - open_time - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # SATSDICE WITHDRAW - res = sq.execute("SELECT * FROM satsdice_withdraw;") - q = f""" - INSERT INTO satsdice.satsdice_withdraw ( - id, - satsdice_pay, - value, - unique_hash, - k1, - open_time, - used - ) - VALUES (%s, %s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # SATSDICE PAYMENT - res = sq.execute("SELECT * FROM satsdice_payment;") - q = f""" - INSERT INTO satsdice.satsdice_payment ( - payment_hash, - satsdice_pay, - value, - paid, - lost - ) - VALUES (%s, %s, %s, %s::boolean, %s::boolean); - """ - insert_to_pg(q, res.fetchall()) - # SATSDICE HASH CHECK - res = sq.execute("SELECT * FROM hash_checkw;") - q = f""" - INSERT INTO satsdice.hash_checkw (id, lnurl_id) - VALUES (%s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "paywall": - # PAYWALLS - res = sq.execute("SELECT * FROM paywalls;") - q = f""" - INSERT INTO paywall.paywalls( - id, - wallet, - url, - memo, - description, - amount, - time, - remembers, - extras - ) - VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s), %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "offlineshop": - # SHOPS - res = sq.execute("SELECT * FROM shops;") - q = f""" - INSERT INTO offlineshop.shops (id, wallet, method, wordlist) - VALUES (%s, %s, %s, %s); - """ - shops = res.fetchall() - insert_to_pg(q, shops) - fix_id("offlineshop.shops_id_seq", shops) - # ITEMS - res = sq.execute("SELECT * FROM items;") - q = f""" - INSERT INTO offlineshop.items (shop, id, name, description, image, enabled, price, unit, fiat_base_multiplier) - VALUES (%s, %s, %s, %s, %s, %s::boolean, %s, %s, %s); - """ - items = res.fetchall() - insert_to_pg(q, items) - fix_id("offlineshop.items_id_seq", items) - elif schema == "lnurlpos" or schema == "lnurldevice": - # lnurldevice - res = sq.execute("SELECT * FROM lnurldevices;") - q = f""" - INSERT INTO lnurldevice.lnurldevices (id, key, title, wallet, currency, device, profit, timestamp) - VALUES (%s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - # lnurldevice PAYMENT - res = sq.execute("SELECT * FROM lnurldevicepayment;") - q = f""" - INSERT INTO lnurldevice.lnurldevicepayment (id, deviceid, payhash, payload, pin, sats, timestamp) - VALUES (%s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "lnurlp": - # PAY LINKS - res = sq.execute("SELECT * FROM pay_links;") - q = f""" - INSERT INTO lnurlp.pay_links ( - id, - wallet, - description, - min, - served_meta, - served_pr, - webhook_url, - success_text, - success_url, - currency, - comment_chars, - max, - fiat_base_multiplier - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); - """ - pay_links = res.fetchall() - insert_to_pg(q, pay_links) - fix_id("lnurlp.pay_links_id_seq", pay_links) - elif schema == "lndhub": - # LndHub doesn't have a database at the moment - pass - elif schema == "lnticket": - # TICKET - res = sq.execute("SELECT * FROM ticket;") - q = f""" - INSERT INTO lnticket.ticket ( - id, - form, - email, - ltext, - name, - wallet, - sats, - paid, - time - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s::boolean, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - # FORM - res = sq.execute("SELECT * FROM form2;") - q = f""" - INSERT INTO lnticket.form2 ( - id, - wallet, - name, - webhook, - description, - flatrate, - amount, - amountmade, - time - ) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "livestream": - # LIVESTREAMS - res = sq.execute("SELECT * FROM livestreams;") - q = f""" - INSERT INTO livestream.livestreams ( - id, - wallet, - fee_pct, - current_track - ) - VALUES (%s, %s, %s, %s); - """ - livestreams = res.fetchall() - insert_to_pg(q, livestreams) - fix_id("livestream.livestreams_id_seq", livestreams) - # PRODUCERS - res = sq.execute("SELECT * FROM producers;") - q = f""" - INSERT INTO livestream.producers ( - livestream, - id, - "user", - wallet, - name - ) - VALUES (%s, %s, %s, %s, %s); - """ - producers = res.fetchall() - insert_to_pg(q, producers) - fix_id("livestream.producers_id_seq", producers) - # TRACKS - res = sq.execute("SELECT * FROM tracks;") - q = f""" - INSERT INTO livestream.tracks ( - livestream, - id, - download_url, - price_msat, - name, - producer - ) - VALUES (%s, %s, %s, %s, %s, %s); - """ - tracks = res.fetchall() - insert_to_pg(q, tracks) - fix_id("livestream.tracks_id_seq", tracks) - elif schema == "lnaddress": - # DOMAINS - res = sq.execute("SELECT * FROM domain;") - q = f""" - INSERT INTO lnaddress.domain( - id, wallet, domain, webhook, cf_token, cf_zone_id, cost, "time") - VALUES (%s, %s, %s, %s, %s, %s, %s, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - # ADDRESSES - res = sq.execute("SELECT * FROM address;") - q = f""" - INSERT INTO lnaddress.address( - id, wallet, domain, email, username, wallet_key, wallet_endpoint, sats, duration, paid, "time") - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s::boolean, to_timestamp(%s)); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "discordbot": - # USERS - res = sq.execute("SELECT * FROM users;") - q = f""" - INSERT INTO discordbot.users( - id, name, admin, discord_id) - VALUES (%s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - # WALLETS - res = sq.execute("SELECT * FROM wallets;") - q = f""" - INSERT INTO discordbot.wallets( - id, admin, name, "user", adminkey, inkey) - VALUES (%s, %s, %s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - elif schema == "scrub": - # SCRUB LINKS - res = sq.execute("SELECT * FROM scrub_links;") - q = f""" - INSERT INTO scrub.scrub_links ( - id, - wallet, - description, - payoraddress - ) - VALUES (%s, %s, %s, %s); - """ - insert_to_pg(q, res.fetchall()) - else: - print(f"❌ Not implemented: {schema}") - sq.close() - - if ignore_missing == False: - raise Exception( - f"Not implemented: {schema}. Use --ignore-missing to skip missing extensions." - ) - return - - print(f"✅ Migrated: {schema}") + data = sq.execute(f"SELECT * FROM {tableName};").fetchall() + insert_to_pg(q, data) sq.close() +def build_insert_query(schema, tableName, columns): + to_columns = ", ".join(map(lambda column: f'"{column[1]}"', columns)) + values = ", ".join(map(lambda column: to_column_type(column[2]), columns)) + return f""" + INSERT INTO {schema}.{tableName}({to_columns}) + VALUES ({values}); + """ + + +def to_column_type(columnType): + if columnType == "TIMESTAMP": + return "to_timestamp(%s)" + if columnType == "BOOLEAN": + return "%s::boolean" + return "%s" + + parser = argparse.ArgumentParser( description="LNbits migration tool for migrating data from SQLite to PostgreSQL" ) @@ -774,11 +203,11 @@ args = parser.parse_args() print("Selected path: ", args.sqlite_path) if os.path.isdir(args.sqlite_path): + exclude_tables = ["dbversions"] file = os.path.join(args.sqlite_path, "database.sqlite3") check_db_versions(file) if not args.extensions_only: - print(f"Migrating: {file}") - migrate_core(file) + migrate_core(file, exclude_tables) if os.path.isdir(args.sqlite_path): files = [ @@ -787,13 +216,8 @@ if os.path.isdir(args.sqlite_path): else: files = [args.sqlite_path] +excluded_exts = ["ext_lnurlpos.sqlite3"] for file in files: filename = os.path.basename(file) - if filename.startswith("ext_"): - schema = filename.replace("ext_", "").split(".")[0] - print(f"Migrating: {file}") - migrate_ext( - file, - schema, - ignore_missing=args.skip_missing, - ) + if filename.startswith("ext_") and filename not in excluded_exts: + migrate_ext(file)