From ba453e7bdb2779b29878985ebfa13ea9391fb3a5 Mon Sep 17 00:00:00 2001 From: fusion44 Date: Mon, 3 Oct 2022 20:22:00 +0200 Subject: [PATCH] refactor: switch to domain driven directory layout --- app/{models => api}/__init__.py | 0 app/{ => api}/constants.py | 0 app/{models/api.py => api/models.py} | 0 app/{ => api}/sse_manager.py | 0 app/{core_utils.py => api/utils.py} | 2 +- app/{ => api}/warmup.py | 6 +- app/{routers/apps_docs.py => apps/docs.py} | 0 .../apps_impl => apps/impl}/apps_base.py | 0 .../apps_impl => apps/impl}/native_python.py | 2 +- .../apps_impl => apps/impl}/raspiblitz.py | 22 +++-- app/{routers/apps.py => apps/router.py} | 4 +- app/{repositories/apps.py => apps/service.py} | 6 +- .../bitcoin_docs.py => bitcoind/docs.py} | 0 .../bitcoind.py => bitcoind/models.py} | 0 .../bitcoin.py => bitcoind/router.py} | 10 +-- .../bitcoin.py => bitcoind/service.py} | 6 +- .../utils/bitcoin.py => bitcoind/utils.py} | 2 +- .../lightning_docs.py => lightning/docs.py} | 65 +++++++++++++++ .../impl}/__init__.py | 0 .../ln_impl => lightning/impl}/cln_grpc.py | 14 ++-- .../ln_impl => lightning/impl}/ln_base.py | 2 +- .../ln_impl => lightning/impl}/lnd_grpc.py | 2 +- .../impl}/protos/cln/README.md | 0 .../impl}/protos/cln/node_pb2.py | 2 +- .../impl}/protos/cln/node_pb2_grpc.py | 2 +- .../impl}/protos/cln/primitives_pb2.py | 0 .../impl}/protos/cln/primitives_pb2_grpc.py | 0 .../impl}/protos/lnd/lightning_pb2.py | 0 .../impl}/protos/lnd/lightning_pb2_grpc.py | 0 .../impl}/protos/lnd/router_pb2.py | 0 .../impl}/protos/lnd/router_pb2_grpc.py | 0 .../impl}/protos/lnd/signer_pb2.py | 0 .../impl}/protos/lnd/signer_pb2_grpc.py | 0 .../impl}/protos/lnd/walletunlocker_pb2.py | 0 .../protos/lnd/walletunlocker_pb2_grpc.py | 0 .../impl}/specializations/README.md | 0 .../impl}/specializations/cln_grpc_blitz.py | 2 +- .../lightning.py => lightning/models.py} | 2 +- .../lightning.py => lightning/router.py} | 20 ++--- .../lightning.py => lightning/service.py} | 12 +-- app/main.py | 43 +++++----- app/models/lightning_docs.py | 64 --------------- .../hardware_impl/hardware_base.py | 11 --- app/repositories/hardware_impl/raspiblitz.py | 73 ----------------- app/repositories/setup.py | 9 -- app/repositories/setup_impl/README.md | 2 - app/repositories/system_impl/native_python.py | 70 ---------------- app/routers/setup.py | 1 - app/routers/wallet.py | 0 app/setup/README.md | 2 + .../ln_impl => setup}/__init__.py | 0 .../utils => setup/impl}/__init__.py | 0 app/setup/impl/raspiblitz/README.md | 3 + .../impl}/raspiblitz/router.py | 6 +- app/setup/router.py | 9 ++ app/{routers => system}/__init__.py | 0 .../system_docs.py => system/docs.py} | 0 .../system_impl => system/impl}/README.md | 0 .../impl}/native_python.py | 69 +++++++++++++++- .../system_impl => system/impl}/raspiblitz.py | 82 +++++++++++++++++-- .../impl/raspiblitz_utils.py} | 15 ---- .../impl}/system_base.py | 10 ++- app/{models/system.py => system/models.py} | 2 +- app/{routers/system.py => system/router.py} | 18 ++-- .../system.py => system/service.py} | 17 ++-- tests/models/test_bitcoind.py | 2 +- .../system_impl/test_native_python.py | 2 +- tests/repositories/test_system.py | 4 +- 68 files changed, 340 insertions(+), 357 deletions(-) rename app/{models => api}/__init__.py (100%) rename app/{ => api}/constants.py (100%) rename app/{models/api.py => api/models.py} (100%) rename app/{ => api}/sse_manager.py (100%) rename app/{core_utils.py => api/utils.py} (99%) rename app/{ => api}/warmup.py (88%) rename app/{routers/apps_docs.py => apps/docs.py} (100%) rename app/{repositories/apps_impl => apps/impl}/apps_base.py (100%) rename app/{repositories/apps_impl => apps/impl}/native_python.py (89%) rename app/{repositories/apps_impl => apps/impl}/raspiblitz.py (96%) rename app/{routers/apps.py => apps/router.py} (96%) rename app/{repositories/apps.py => apps/service.py} (80%) rename app/{routers/bitcoin_docs.py => bitcoind/docs.py} (100%) rename app/{models/bitcoind.py => bitcoind/models.py} (100%) rename app/{routers/bitcoin.py => bitcoind/router.py} (93%) rename app/{repositories/bitcoin.py => bitcoind/service.py} (96%) rename app/{repositories/utils/bitcoin.py => bitcoind/utils.py} (98%) rename app/{routers/lightning_docs.py => lightning/docs.py} (64%) rename app/{repositories => lightning/impl}/__init__.py (100%) rename app/{repositories/ln_impl => lightning/impl}/cln_grpc.py (98%) rename app/{repositories/ln_impl => lightning/impl}/ln_base.py (98%) rename app/{repositories/ln_impl => lightning/impl}/lnd_grpc.py (99%) rename app/{repositories/ln_impl => lightning/impl}/protos/cln/README.md (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/cln/node_pb2.py (99%) rename app/{repositories/ln_impl => lightning/impl}/protos/cln/node_pb2_grpc.py (99%) rename app/{repositories/ln_impl => lightning/impl}/protos/cln/primitives_pb2.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/cln/primitives_pb2_grpc.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/lightning_pb2.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/lightning_pb2_grpc.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/router_pb2.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/router_pb2_grpc.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/signer_pb2.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/signer_pb2_grpc.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/walletunlocker_pb2.py (100%) rename app/{repositories/ln_impl => lightning/impl}/protos/lnd/walletunlocker_pb2_grpc.py (100%) rename app/{repositories/ln_impl => lightning/impl}/specializations/README.md (100%) rename app/{repositories/ln_impl => lightning/impl}/specializations/cln_grpc_blitz.py (99%) rename app/{models/lightning.py => lightning/models.py} (99%) rename app/{routers/lightning.py => lightning/router.py} (99%) rename app/{repositories/lightning.py => lightning/service.py} (95%) delete mode 100644 app/models/lightning_docs.py delete mode 100644 app/repositories/hardware_impl/hardware_base.py delete mode 100644 app/repositories/hardware_impl/raspiblitz.py delete mode 100644 app/repositories/setup.py delete mode 100644 app/repositories/setup_impl/README.md delete mode 100644 app/repositories/system_impl/native_python.py delete mode 100644 app/routers/setup.py delete mode 100644 app/routers/wallet.py create mode 100644 app/setup/README.md rename app/{repositories/ln_impl => setup}/__init__.py (100%) rename app/{repositories/utils => setup/impl}/__init__.py (100%) create mode 100644 app/setup/impl/raspiblitz/README.md rename app/{repositories/setup_impl => setup/impl}/raspiblitz/router.py (98%) create mode 100644 app/setup/router.py rename app/{routers => system}/__init__.py (100%) rename app/{routers/system_docs.py => system/docs.py} (100%) rename app/{repositories/system_impl => system/impl}/README.md (100%) rename app/{repositories/hardware_impl => system/impl}/native_python.py (55%) rename app/{repositories/system_impl => system/impl}/raspiblitz.py (80%) rename app/{repositories/utils/raspiblitz.py => system/impl/raspiblitz_utils.py} (52%) rename app/{repositories/system_impl => system/impl}/system_base.py (74%) rename app/{models/system.py => system/models.py} (98%) rename app/{routers/system.py => system/router.py} (96%) rename app/{repositories/system.py => system/service.py} (85%) diff --git a/app/models/__init__.py b/app/api/__init__.py similarity index 100% rename from app/models/__init__.py rename to app/api/__init__.py diff --git a/app/constants.py b/app/api/constants.py similarity index 100% rename from app/constants.py rename to app/api/constants.py diff --git a/app/models/api.py b/app/api/models.py similarity index 100% rename from app/models/api.py rename to app/api/models.py diff --git a/app/sse_manager.py b/app/api/sse_manager.py similarity index 100% rename from app/sse_manager.py rename to app/api/sse_manager.py diff --git a/app/core_utils.py b/app/api/utils.py similarity index 99% rename from app/core_utils.py rename to app/api/utils.py index 8e0ba5d..9e041e4 100644 --- a/app/core_utils.py +++ b/app/api/utils.py @@ -12,8 +12,8 @@ from typing import Dict, Optional from fastapi.encoders import jsonable_encoder from fastapi_plugins import redis_plugin +from app.api.sse_manager import SSEManager from app.external.sse_starlette import ServerSentEvent -from app.sse_manager import SSEManager sse_mgr = SSEManager() sse_mgr.setup() diff --git a/app/warmup.py b/app/api/warmup.py similarity index 88% rename from app/warmup.py rename to app/api/warmup.py index 9a8401b..531fe55 100644 --- a/app/warmup.py +++ b/app/api/warmup.py @@ -1,14 +1,14 @@ import asyncio from typing import List -from app.repositories.bitcoin import get_btc_info -from app.repositories.lightning import ( +from app.bitcoind.service import get_btc_info +from app.lightning.service import ( get_fee_revenue, get_ln_info, get_ln_info_lite, get_wallet_balance, ) -from app.repositories.system import get_hardware_info, get_system_info +from app.system.service import get_hardware_info, get_system_info async def get_bitcoin_client_warmup_data() -> List: diff --git a/app/routers/apps_docs.py b/app/apps/docs.py similarity index 100% rename from app/routers/apps_docs.py rename to app/apps/docs.py diff --git a/app/repositories/apps_impl/apps_base.py b/app/apps/impl/apps_base.py similarity index 100% rename from app/repositories/apps_impl/apps_base.py rename to app/apps/impl/apps_base.py diff --git a/app/repositories/apps_impl/native_python.py b/app/apps/impl/native_python.py similarity index 89% rename from app/repositories/apps_impl/native_python.py rename to app/apps/impl/native_python.py index c528f5e..cc6cc31 100644 --- a/app/repositories/apps_impl/native_python.py +++ b/app/apps/impl/native_python.py @@ -1,4 +1,4 @@ -from app.repositories.apps_impl.apps_base import AppsBase +from app.apps.impl.apps_base import AppsBase class NativePythonApps(AppsBase): diff --git a/app/repositories/apps_impl/raspiblitz.py b/app/apps/impl/raspiblitz.py similarity index 96% rename from app/repositories/apps_impl/raspiblitz.py rename to app/apps/impl/raspiblitz.py index e040694..ea6b555 100644 --- a/app/repositories/apps_impl/raspiblitz.py +++ b/app/apps/impl/raspiblitz.py @@ -9,14 +9,20 @@ from decouple import config from fastapi import HTTPException, status from fastapi.encoders import jsonable_encoder -from app.core_utils import ( - SSE, - broadcast_sse_msg, - call_sudo_script, - parse_key_value_text, -) -from app.repositories.apps_impl.apps_base import AppsBase -from app.repositories.utils.raspiblitz import available_app_ids +from app.api.utils import SSE, broadcast_sse_msg, call_sudo_script, parse_key_value_text +from app.apps.impl import AppsBase + +available_app_ids = { + "btc-rpc-explorer", + "rtl", + # Specter is deactivated for now because it uses its own self signed HTTPS cert that makes trouble in Chrome on last test + # "specter", + "btcpayserver", + "lnbits", + "mempool", + "thunderhub", +} + SHELL_SCRIPT_PATH = config("shell_script_path") diff --git a/app/routers/apps.py b/app/apps/router.py similarity index 96% rename from app/routers/apps.py rename to app/apps/router.py index 5fa9838..24c7c40 100644 --- a/app/routers/apps.py +++ b/app/apps/router.py @@ -2,8 +2,8 @@ from fastapi import APIRouter, HTTPException, status from fastapi.params import Depends from pydantic import BaseModel -import app.repositories.apps as repo -import app.routers.apps_docs as docs +import app.apps.docs as docs +import app.apps.service as repo from app.auth.auth_bearer import JWTBearer from app.external.sse_starlette import EventSourceResponse diff --git a/app/repositories/apps.py b/app/apps/service.py similarity index 80% rename from app/repositories/apps.py rename to app/apps/service.py index 5d65056..52e4787 100644 --- a/app/repositories/apps.py +++ b/app/apps/service.py @@ -1,14 +1,14 @@ from decouple import config -from app.models.system import APIPlatform +from app.system.models import APIPlatform PLATFORM = config("platform", default=APIPlatform.RASPIBLITZ) apps = None if PLATFORM == APIPlatform.RASPIBLITZ: - from .apps_impl.raspiblitz import RaspiBlitzApps as Apps + from app.apps.impl.raspiblitz import RaspiBlitzApps as Apps elif PLATFORM == APIPlatform.NATIVE_PYTHON: - from .apps_impl.native_python import NativePythonApps as Apps + from app.apps.impl.native_python import NativePythonApps as Apps apps = Apps() diff --git a/app/routers/bitcoin_docs.py b/app/bitcoind/docs.py similarity index 100% rename from app/routers/bitcoin_docs.py rename to app/bitcoind/docs.py diff --git a/app/models/bitcoind.py b/app/bitcoind/models.py similarity index 100% rename from app/models/bitcoind.py rename to app/bitcoind/models.py diff --git a/app/routers/bitcoin.py b/app/bitcoind/router.py similarity index 93% rename from app/routers/bitcoin.py rename to app/bitcoind/router.py index b709231..85af0bf 100644 --- a/app/routers/bitcoin.py +++ b/app/bitcoind/router.py @@ -2,17 +2,17 @@ from fastapi import APIRouter, HTTPException, Request, status from fastapi.params import Depends, Query from app.auth.auth_bearer import JWTBearer -from app.external.sse_starlette import EventSourceResponse -from app.models.bitcoind import BlockchainInfo, BtcInfo, FeeEstimationMode, NetworkInfo -from app.repositories.bitcoin import ( +from app.bitcoind.docs import blocks_sub_doc, estimate_fee_mode_desc +from app.bitcoind.models import BlockchainInfo, BtcInfo, FeeEstimationMode, NetworkInfo +from app.bitcoind.service import ( estimate_fee, get_blockchain_info, get_btc_info, get_network_info, handle_block_sub, ) -from app.repositories.utils.bitcoin import bitcoin_rpc -from app.routers.bitcoin_docs import blocks_sub_doc, estimate_fee_mode_desc +from app.bitcoind.utils import bitcoin_rpc +from app.external.sse_starlette import EventSourceResponse _PREFIX = "bitcoin" diff --git a/app/repositories/bitcoin.py b/app/bitcoind/service.py similarity index 96% rename from app/repositories/bitcoin.py rename to app/bitcoind/service.py index dd215ea..b63a714 100644 --- a/app/repositories/bitcoin.py +++ b/app/bitcoind/service.py @@ -10,15 +10,15 @@ from fastapi import Request from fastapi.exceptions import HTTPException from starlette import status -from app.core_utils import SSE, broadcast_sse_msg -from app.models.bitcoind import ( +from app.api.utils import SSE, broadcast_sse_msg +from app.bitcoind.models import ( BlockchainInfo, BlockRpcFunc, BtcInfo, FeeEstimationMode, NetworkInfo, ) -from app.repositories.utils.bitcoin import bitcoin_config, bitcoin_rpc_async +from app.bitcoind.utils import bitcoin_config, bitcoin_rpc_async _initialized = False diff --git a/app/repositories/utils/bitcoin.py b/app/bitcoind/utils.py similarity index 98% rename from app/repositories/utils/bitcoin.py rename to app/bitcoind/utils.py index 5ac2dae..6676d7d 100644 --- a/app/repositories/utils/bitcoin.py +++ b/app/bitcoind/utils.py @@ -6,7 +6,7 @@ import requests from decouple import config from starlette import status -from app.models.bitcoind import BlockRpcFunc +from app.bitcoind.models import BlockRpcFunc class _BitcoinConfig: diff --git a/app/routers/lightning_docs.py b/app/lightning/docs.py similarity index 64% rename from app/routers/lightning_docs.py rename to app/lightning/docs.py index aa94562..a0be4b9 100644 --- a/app/routers/lightning_docs.py +++ b/app/lightning/docs.py @@ -1,3 +1,68 @@ +tx_id_desc = """ +Unique identifier for this transaction. + +Depending on the type of the transaction it will be different: +#### On-chain +The transaction hash + +#### Lightning Invoice and Payment +The payment request +""" + +tx_amount_desc = """ +The value of the transaction, depending on the category in satoshis or millisatoshis. + +#### On-chain +Transaction amount in satoshis + +#### Lightning Invoice +* value in millisatoshis of the invoice if *unsettled* +* amount in millisatoshis paid if invoice is *settled* + +#### Lightning Payment +* amount sent in millisatoshis + +""" + +tx_status_desc = """ +The status of the transaction. Depending on the transaction category this can be different values: + +May have different meanings in different situations: +#### unknown +An unknown state was found. + +#### in_flight +* A lightning payment is being sent +* An invoice is waiting for the incoming payment +* An on-chain transaction is waiting in the mempool + +#### succeeded +* A lighting payment was successfully sent +* An incoming payment was received for an invoice +* An on-chain transaction was included in a block + +#### failed +* A lightning payment attempt which could not be completed (no route found, insufficient funds, ...) +* An invoice is expired or some other error happened +""" + +tx_time_stamp_desc = """ +The unix timestamp in seconds for the transaction. + +The timestamp can mean different things in different situations: + +#### Lightning Invoice +* Creation date for in-flight or failed invoices +* Settle date for succeeded invoices + +#### On-chain +* Creation date for transaction waiting in the mempool +* Timestamp of the block where this transaction is included + +#### Lightning Payment + +""" + add_invoice_desc = """ Adds a new invoice to the database. diff --git a/app/repositories/__init__.py b/app/lightning/impl/__init__.py similarity index 100% rename from app/repositories/__init__.py rename to app/lightning/impl/__init__.py diff --git a/app/repositories/ln_impl/cln_grpc.py b/app/lightning/impl/cln_grpc.py similarity index 98% rename from app/repositories/ln_impl/cln_grpc.py rename to app/lightning/impl/cln_grpc.py index 5a5ae6c..7aefbb7 100644 --- a/app/repositories/ln_impl/cln_grpc.py +++ b/app/lightning/impl/cln_grpc.py @@ -11,11 +11,13 @@ from decouple import config from fastapi.exceptions import HTTPException from starlette import status -import app.repositories.ln_impl.protos.cln.node_pb2 as ln -import app.repositories.ln_impl.protos.cln.node_pb2_grpc as clnrpc -import app.repositories.ln_impl.protos.cln.primitives_pb2 as lnp -from app.core_utils import config_get_hex_str, next_push_id -from app.models.lightning import ( +import app.lightning.impl.protos.cln.node_pb2 as ln +import app.lightning.impl.protos.cln.node_pb2_grpc as clnrpc +import app.lightning.impl.protos.cln.primitives_pb2 as lnp +from app.api.utils import config_get_hex_str, next_push_id +from app.bitcoind.utils import bitcoin_rpc_async +from app.lightning.impl.ln_base import LightningNodeBase +from app.lightning.models import ( Channel, FeeRevenue, ForwardSuccessEvent, @@ -35,8 +37,6 @@ from app.models.lightning import ( TxStatus, WalletBalance, ) -from app.repositories.ln_impl.ln_base import LightningNodeBase -from app.repositories.utils.bitcoin import bitcoin_rpc_async async def _make_local_call(cmd: str): diff --git a/app/repositories/ln_impl/ln_base.py b/app/lightning/impl/ln_base.py similarity index 98% rename from app/repositories/ln_impl/ln_base.py rename to app/lightning/impl/ln_base.py index ee46116..7380494 100644 --- a/app/repositories/ln_impl/ln_base.py +++ b/app/lightning/impl/ln_base.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import AsyncGenerator, List, Optional -from app.models.lightning import ( +from app.lightning.models import ( Channel, FeeRevenue, ForwardSuccessEvent, diff --git a/app/repositories/ln_impl/lnd_grpc.py b/app/lightning/impl/lnd_grpc.py similarity index 99% rename from app/repositories/ln_impl/lnd_grpc.py rename to app/lightning/impl/lnd_grpc.py index 03aba20..079d316 100644 --- a/app/repositories/ln_impl/lnd_grpc.py +++ b/app/lightning/impl/lnd_grpc.py @@ -14,7 +14,7 @@ import app.repositories.ln_impl.protos.lnd.router_pb2 as router import app.repositories.ln_impl.protos.lnd.router_pb2_grpc as routerrpc import app.repositories.ln_impl.protos.lnd.walletunlocker_pb2 as unlocker import app.repositories.ln_impl.protos.lnd.walletunlocker_pb2_grpc as unlockerrpc -from app.core_utils import SSE, broadcast_sse_msg, config_get_hex_str +from app.api.utils import SSE, broadcast_sse_msg, config_get_hex_str from app.models.lightning import ( Channel, FeeRevenue, diff --git a/app/repositories/ln_impl/protos/cln/README.md b/app/lightning/impl/protos/cln/README.md similarity index 100% rename from app/repositories/ln_impl/protos/cln/README.md rename to app/lightning/impl/protos/cln/README.md diff --git a/app/repositories/ln_impl/protos/cln/node_pb2.py b/app/lightning/impl/protos/cln/node_pb2.py similarity index 99% rename from app/repositories/ln_impl/protos/cln/node_pb2.py rename to app/lightning/impl/protos/cln/node_pb2.py index 07a53c6..fa936fc 100644 --- a/app/repositories/ln_impl/protos/cln/node_pb2.py +++ b/app/lightning/impl/protos/cln/node_pb2.py @@ -13,7 +13,7 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() -import app.repositories.ln_impl.protos.cln.primitives_pb2 as primitives__pb2 +import app.lightning.impl.protos.cln.primitives_pb2 as primitives__pb2 DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( b'\n\nnode.proto\x12\x03\x63ln\x1a\x10primitives.proto"\x10\n\x0eGetinfoRequest"\xec\x03\n\x0fGetinfoResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x03 \x01(\x0c\x12\x11\n\tnum_peers\x18\x04 \x01(\r\x12\x1c\n\x14num_pending_channels\x18\x05 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x06 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\t\x12\x15\n\rlightning_dir\x18\t \x01(\t\x12\x13\n\x0b\x62lockheight\x18\x0b \x01(\r\x12\x0f\n\x07network\x18\x0c \x01(\t\x12(\n\x13\x66\x65\x65s_collected_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12$\n\x07\x61\x64\x64ress\x18\x0e \x03(\x0b\x32\x13.cln.GetinfoAddress\x12$\n\x07\x62inding\x18\x0f \x03(\x0b\x32\x13.cln.GetinfoBinding\x12"\n\x15warning_bitcoind_sync\x18\x10 \x01(\tH\x00\x88\x01\x01\x12$\n\x17warning_lightningd_sync\x18\x11 \x01(\tH\x01\x88\x01\x01\x42\x18\n\x16_warning_bitcoind_syncB\x1a\n\x18_warning_lightningd_sync"S\n\x13GetinfoOur_features\x12\x0c\n\x04init\x18\x01 \x01(\x0c\x12\x0c\n\x04node\x18\x02 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x03 \x01(\x0c\x12\x0f\n\x07invoice\x18\x04 \x01(\x0c"\xd3\x01\n\x0eGetinfoAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoAddress.GetinfoAddressType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01"V\n\x12GetinfoAddressType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x12\r\n\tWEBSOCKET\x10\x05\x42\n\n\x08_address"\xfb\x01\n\x0eGetinfoBinding\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.GetinfoBinding.GetinfoBindingType\x12\x14\n\x07\x61\x64\x64ress\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06socket\x18\x04 \x01(\tH\x02\x88\x01\x01"P\n\x12GetinfoBindingType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\n\n\x08_addressB\x07\n\x05_portB\t\n\x07_socket"H\n\x10ListpeersRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05level\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\x05\n\x03_idB\x08\n\x06_level"7\n\x11ListpeersResponse\x12"\n\x05peers\x18\x01 \x03(\x0b\x32\x13.cln.ListpeersPeers"\xb8\x01\n\x0eListpeersPeers\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x11\n\tconnected\x18\x02 \x01(\x08\x12#\n\x03log\x18\x03 \x03(\x0b\x32\x16.cln.ListpeersPeersLog\x12-\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x1b.cln.ListpeersPeersChannels\x12\x0f\n\x07netaddr\x18\x05 \x03(\t\x12\x15\n\x08\x66\x65\x61tures\x18\x06 \x01(\x0cH\x00\x88\x01\x01\x42\x0b\n\t_features"\xfd\x02\n\x11ListpeersPeersLog\x12?\n\titem_type\x18\x01 \x01(\x0e\x32,.cln.ListpeersPeersLog.ListpeersPeersLogType\x12\x18\n\x0bnum_skipped\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x11\n\x04time\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06source\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x10\n\x03log\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x07node_id\x18\x06 \x01(\x0cH\x04\x88\x01\x01\x12\x11\n\x04\x64\x61ta\x18\x07 \x01(\x0cH\x05\x88\x01\x01"i\n\x15ListpeersPeersLogType\x12\x0b\n\x07SKIPPED\x10\x00\x12\n\n\x06\x42ROKEN\x10\x01\x12\x0b\n\x07UNUSUAL\x10\x02\x12\x08\n\x04INFO\x10\x03\x12\t\n\x05\x44\x45\x42UG\x10\x04\x12\t\n\x05IO_IN\x10\x05\x12\n\n\x06IO_OUT\x10\x06\x42\x0e\n\x0c_num_skippedB\x07\n\x05_timeB\t\n\x07_sourceB\x06\n\x04_logB\n\n\x08_node_idB\x07\n\x05_data"\xd8\x15\n\x16ListpeersPeersChannels\x12\x46\n\x05state\x18\x01 \x01(\x0e\x32\x37.cln.ListpeersPeersChannels.ListpeersPeersChannelsState\x12\x19\n\x0cscratch_txid\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\x05owner\x18\x04 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10short_channel_id\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x17\n\nchannel_id\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x19\n\x0c\x66unding_txid\x18\x07 \x01(\x0cH\x04\x88\x01\x01\x12\x1b\n\x0e\x66unding_outnum\x18\x08 \x01(\rH\x05\x88\x01\x01\x12\x1c\n\x0finitial_feerate\x18\t \x01(\tH\x06\x88\x01\x01\x12\x19\n\x0clast_feerate\x18\n \x01(\tH\x07\x88\x01\x01\x12\x19\n\x0cnext_feerate\x18\x0b \x01(\tH\x08\x88\x01\x01\x12\x1a\n\rnext_fee_step\x18\x0c \x01(\rH\t\x88\x01\x01\x12\x35\n\x08inflight\x18\r \x03(\x0b\x32#.cln.ListpeersPeersChannelsInflight\x12\x15\n\x08\x63lose_to\x18\x0e \x01(\x0cH\n\x88\x01\x01\x12\x14\n\x07private\x18\x0f \x01(\x08H\x0b\x88\x01\x01\x12 \n\x06opener\x18\x10 \x01(\x0e\x32\x10.cln.ChannelSide\x12\x10\n\x08\x66\x65\x61tures\x18\x12 \x03(\t\x12$\n\nto_us_msat\x18\x14 \x01(\x0b\x32\x0b.cln.AmountH\x0c\x88\x01\x01\x12(\n\x0emin_to_us_msat\x18\x15 \x01(\x0b\x32\x0b.cln.AmountH\r\x88\x01\x01\x12(\n\x0emax_to_us_msat\x18\x16 \x01(\x0b\x32\x0b.cln.AmountH\x0e\x88\x01\x01\x12$\n\ntotal_msat\x18\x17 \x01(\x0b\x32\x0b.cln.AmountH\x0f\x88\x01\x01\x12\'\n\rfee_base_msat\x18\x18 \x01(\x0b\x32\x0b.cln.AmountH\x10\x88\x01\x01\x12(\n\x1b\x66\x65\x65_proportional_millionths\x18\x19 \x01(\rH\x11\x88\x01\x01\x12)\n\x0f\x64ust_limit_msat\x18\x1a \x01(\x0b\x32\x0b.cln.AmountH\x12\x88\x01\x01\x12\x30\n\x16max_total_htlc_in_msat\x18\x1b \x01(\x0b\x32\x0b.cln.AmountH\x13\x88\x01\x01\x12,\n\x12their_reserve_msat\x18\x1c \x01(\x0b\x32\x0b.cln.AmountH\x14\x88\x01\x01\x12*\n\x10our_reserve_msat\x18\x1d \x01(\x0b\x32\x0b.cln.AmountH\x15\x88\x01\x01\x12(\n\x0espendable_msat\x18\x1e \x01(\x0b\x32\x0b.cln.AmountH\x16\x88\x01\x01\x12)\n\x0freceivable_msat\x18\x1f \x01(\x0b\x32\x0b.cln.AmountH\x17\x88\x01\x01\x12.\n\x14minimum_htlc_in_msat\x18 \x01(\x0b\x32\x0b.cln.AmountH\x18\x88\x01\x01\x12/\n\x15minimum_htlc_out_msat\x18\x30 \x01(\x0b\x32\x0b.cln.AmountH\x19\x88\x01\x01\x12/\n\x15maximum_htlc_out_msat\x18\x31 \x01(\x0b\x32\x0b.cln.AmountH\x1a\x88\x01\x01\x12 \n\x13their_to_self_delay\x18! \x01(\rH\x1b\x88\x01\x01\x12\x1e\n\x11our_to_self_delay\x18" \x01(\rH\x1c\x88\x01\x01\x12\x1f\n\x12max_accepted_htlcs\x18# \x01(\rH\x1d\x88\x01\x01\x12\x0e\n\x06status\x18% \x03(\t\x12 \n\x13in_payments_offered\x18& \x01(\x04H\x1e\x88\x01\x01\x12)\n\x0fin_offered_msat\x18\' \x01(\x0b\x32\x0b.cln.AmountH\x1f\x88\x01\x01\x12"\n\x15in_payments_fulfilled\x18( \x01(\x04H \x88\x01\x01\x12+\n\x11in_fulfilled_msat\x18) \x01(\x0b\x32\x0b.cln.AmountH!\x88\x01\x01\x12!\n\x14out_payments_offered\x18* \x01(\x04H"\x88\x01\x01\x12*\n\x10out_offered_msat\x18+ \x01(\x0b\x32\x0b.cln.AmountH#\x88\x01\x01\x12#\n\x16out_payments_fulfilled\x18, \x01(\x04H$\x88\x01\x01\x12,\n\x12out_fulfilled_msat\x18- \x01(\x0b\x32\x0b.cln.AmountH%\x88\x01\x01\x12/\n\x05htlcs\x18. \x03(\x0b\x32 .cln.ListpeersPeersChannelsHtlcs\x12\x1a\n\rclose_to_addr\x18/ \x01(\tH&\x88\x01\x01"\xa1\x02\n\x1bListpeersPeersChannelsState\x12\x0c\n\x08OPENINGD\x10\x00\x12\x1c\n\x18\x43HANNELD_AWAITING_LOCKIN\x10\x01\x12\x13\n\x0f\x43HANNELD_NORMAL\x10\x02\x12\x1a\n\x16\x43HANNELD_SHUTTING_DOWN\x10\x03\x12\x18\n\x14\x43LOSINGD_SIGEXCHANGE\x10\x04\x12\x15\n\x11\x43LOSINGD_COMPLETE\x10\x05\x12\x17\n\x13\x41WAITING_UNILATERAL\x10\x06\x12\x16\n\x12\x46UNDING_SPEND_SEEN\x10\x07\x12\x0b\n\x07ONCHAIN\x10\x08\x12\x17\n\x13\x44UALOPEND_OPEN_INIT\x10\t\x12\x1d\n\x19\x44UALOPEND_AWAITING_LOCKIN\x10\nB\x0f\n\r_scratch_txidB\x08\n\x06_ownerB\x13\n\x11_short_channel_idB\r\n\x0b_channel_idB\x0f\n\r_funding_txidB\x11\n\x0f_funding_outnumB\x12\n\x10_initial_feerateB\x0f\n\r_last_feerateB\x0f\n\r_next_feerateB\x10\n\x0e_next_fee_stepB\x0b\n\t_close_toB\n\n\x08_privateB\r\n\x0b_to_us_msatB\x11\n\x0f_min_to_us_msatB\x11\n\x0f_max_to_us_msatB\r\n\x0b_total_msatB\x10\n\x0e_fee_base_msatB\x1e\n\x1c_fee_proportional_millionthsB\x12\n\x10_dust_limit_msatB\x19\n\x17_max_total_htlc_in_msatB\x15\n\x13_their_reserve_msatB\x13\n\x11_our_reserve_msatB\x11\n\x0f_spendable_msatB\x12\n\x10_receivable_msatB\x17\n\x15_minimum_htlc_in_msatB\x18\n\x16_minimum_htlc_out_msatB\x18\n\x16_maximum_htlc_out_msatB\x16\n\x14_their_to_self_delayB\x14\n\x12_our_to_self_delayB\x15\n\x13_max_accepted_htlcsB\x16\n\x14_in_payments_offeredB\x12\n\x10_in_offered_msatB\x18\n\x16_in_payments_fulfilledB\x14\n\x12_in_fulfilled_msatB\x17\n\x15_out_payments_offeredB\x13\n\x11_out_offered_msatB\x19\n\x17_out_payments_fulfilledB\x15\n\x13_out_fulfilled_msatB\x10\n\x0e_close_to_addr"=\n\x1dListpeersPeersChannelsFeerate\x12\r\n\x05perkw\x18\x01 \x01(\r\x12\r\n\x05perkb\x18\x02 \x01(\r"\xc5\x01\n\x1eListpeersPeersChannelsInflight\x12\x14\n\x0c\x66unding_txid\x18\x01 \x01(\x0c\x12\x16\n\x0e\x66unding_outnum\x18\x02 \x01(\r\x12\x0f\n\x07\x66\x65\x65rate\x18\x03 \x01(\t\x12\'\n\x12total_funding_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10our_funding_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscratch_txid\x18\x06 \x01(\x0c"\x84\x01\n\x1dListpeersPeersChannelsFunding\x12\x1f\n\nlocal_msat\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0bremote_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0bpushed_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount"\xd2\x02\n\x1bListpeersPeersChannelsHtlcs\x12X\n\tdirection\x18\x01 \x01(\x0e\x32\x45.cln.ListpeersPeersChannelsHtlcs.ListpeersPeersChannelsHtlcsDirection\x12\n\n\x02id\x18\x02 \x01(\x04\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x0e\n\x06\x65xpiry\x18\x04 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x05 \x01(\x0c\x12\x1a\n\rlocal_trimmed\x18\x06 \x01(\x08H\x00\x88\x01\x01\x12\x13\n\x06status\x18\x07 \x01(\tH\x01\x88\x01\x01"7\n$ListpeersPeersChannelsHtlcsDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01\x42\x10\n\x0e_local_trimmedB\t\n\x07_status"0\n\x10ListfundsRequest\x12\x12\n\x05spent\x18\x01 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_spent"e\n\x11ListfundsResponse\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.cln.ListfundsOutputs\x12(\n\x08\x63hannels\x18\x02 \x03(\x0b\x32\x16.cln.ListfundsChannels"\xe3\x02\n\x10ListfundsOutputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0e\n\x06output\x18\x02 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptpubkey\x18\x04 \x01(\x0c\x12\x14\n\x07\x61\x64\x64ress\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0credeemscript\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12<\n\x06status\x18\x07 \x01(\x0e\x32,.cln.ListfundsOutputs.ListfundsOutputsStatus\x12\x18\n\x0b\x62lockheight\x18\x08 \x01(\rH\x02\x88\x01\x01"C\n\x16ListfundsOutputsStatus\x12\x0f\n\x0bUNCONFIRMED\x10\x00\x12\r\n\tCONFIRMED\x10\x01\x12\t\n\x05SPENT\x10\x02\x42\n\n\x08_addressB\x0f\n\r_redeemscriptB\x0e\n\x0c_blockheight"\x83\x02\n\x11ListfundsChannels\x12\x0f\n\x07peer_id\x18\x01 \x01(\x0c\x12$\n\x0four_amount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12 \n\x0b\x61mount_msat\x18\x03 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0c\x66unding_txid\x18\x04 \x01(\x0c\x12\x16\n\x0e\x66unding_output\x18\x05 \x01(\r\x12\x11\n\tconnected\x18\x06 \x01(\x08\x12 \n\x05state\x18\x07 \x01(\x0e\x32\x11.cln.ChannelState\x12\x1d\n\x10short_channel_id\x18\x08 \x01(\tH\x00\x88\x01\x01\x42\x13\n\x11_short_channel_id"\xd5\x02\n\x0eSendpayRequest\x12 \n\x05route\x18\x01 \x03(\x0b\x32\x11.cln.SendpayRoute\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12"\n\x08msatoshi\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x05 \x01(\tH\x02\x88\x01\x01\x12\x1b\n\x0epayment_secret\x18\x06 \x01(\x0cH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x19\n\x0clocalofferid\x18\x08 \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\t \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\x0b\n\t_msatoshiB\t\n\x07_bolt11B\x11\n\x0f_payment_secretB\t\n\x07_partidB\x0f\n\r_localofferidB\n\n\x08_groupid"\xa5\x04\n\x0fSendpayResponse\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x32\n\x06status\x18\x04 \x01(\x0e\x32".cln.SendpayResponse.SendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x04\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\x07\x88\x01\x01\x12\x14\n\x07message\x18\x0e \x01(\tH\x08\x88\x01\x01"*\n\rSendpayStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\n\n\x08_message"Y\n\x0cSendpayRoute\x12\x1d\n\x08msatoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\n\n\x02id\x18\x02 \x01(\x0c\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r\x12\x0f\n\x07\x63hannel\x18\x04 \x01(\t"\x93\x01\n\x13ListchannelsRequest\x12\x1d\n\x10short_channel_id\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06source\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x42\x13\n\x11_short_channel_idB\t\n\x07_sourceB\x0e\n\x0c_destination"C\n\x14ListchannelsResponse\x12+\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x19.cln.ListchannelsChannels"\xa0\x03\n\x14ListchannelsChannels\x12\x0e\n\x06source\x18\x01 \x01(\x0c\x12\x13\n\x0b\x64\x65stination\x18\x02 \x01(\x0c\x12\x18\n\x10short_channel_id\x18\x03 \x01(\t\x12\x0e\n\x06public\x18\x04 \x01(\x08\x12 \n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.Amount\x12\x15\n\rmessage_flags\x18\x06 \x01(\r\x12\x15\n\rchannel_flags\x18\x07 \x01(\r\x12\x0e\n\x06\x61\x63tive\x18\x08 \x01(\x08\x12\x13\n\x0blast_update\x18\t \x01(\r\x12\x1d\n\x15\x62\x61se_fee_millisatoshi\x18\n \x01(\r\x12\x19\n\x11\x66\x65\x65_per_millionth\x18\x0b \x01(\r\x12\r\n\x05\x64\x65lay\x18\x0c \x01(\r\x12&\n\x11htlc_minimum_msat\x18\r \x01(\x0b\x32\x0b.cln.Amount\x12+\n\x11htlc_maximum_msat\x18\x0e \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x10\n\x08\x66\x65\x61tures\x18\x0f \x01(\x0c\x42\x14\n\x12_htlc_maximum_msat"#\n\x10\x41\x64\x64gossipRequest\x12\x0f\n\x07message\x18\x01 \x01(\x0c"\x13\n\x11\x41\x64\x64gossipResponse"o\n\x17\x41utocleaninvoiceRequest\x12\x17\n\nexpired_by\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds"\x81\x01\n\x18\x41utocleaninvoiceResponse\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12\x17\n\nexpired_by\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x1a\n\rcycle_seconds\x18\x03 \x01(\x04H\x01\x88\x01\x01\x42\r\n\x0b_expired_byB\x10\n\x0e_cycle_seconds"U\n\x13\x43heckmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t\x12\r\n\x05zbase\x18\x02 \x01(\t\x12\x13\n\x06pubkey\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey"H\n\x14\x43heckmessageResponse\x12\x10\n\x08verified\x18\x01 \x01(\x08\x12\x13\n\x06pubkey\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x42\t\n\x07_pubkey"\xbc\x02\n\x0c\x43loseRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x1e\n\x11unilateraltimeout\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\tH\x01\x88\x01\x01\x12!\n\x14\x66\x65\x65_negotiation_step\x18\x04 \x01(\tH\x02\x88\x01\x01\x12\x1a\n\rwrong_funding\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12\x1f\n\x12\x66orce_lease_closed\x18\x06 \x01(\x08H\x04\x88\x01\x01\x12\x1e\n\x08\x66\x65\x65range\x18\x07 \x03(\x0b\x32\x0c.cln.FeerateB\x14\n\x12_unilateraltimeoutB\x0e\n\x0c_destinationB\x17\n\x15_fee_negotiation_stepB\x10\n\x0e_wrong_fundingB\x15\n\x13_force_lease_closed"\xab\x01\n\rCloseResponse\x12/\n\titem_type\x18\x01 \x01(\x0e\x32\x1c.cln.CloseResponse.CloseType\x12\x0f\n\x02tx\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x11\n\x04txid\x18\x03 \x01(\x0cH\x01\x88\x01\x01"5\n\tCloseType\x12\n\n\x06MUTUAL\x10\x00\x12\x0e\n\nUNILATERAL\x10\x01\x12\x0c\n\x08UNOPENED\x10\x02\x42\x05\n\x03_txB\x07\n\x05_txid"T\n\x0e\x43onnectRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\x04host\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x11\n\x04port\x18\x03 \x01(\rH\x01\x88\x01\x01\x42\x07\n\x05_hostB\x07\n\x05_port"\x8e\x01\n\x0f\x43onnectResponse\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x08\x66\x65\x61tures\x18\x02 \x01(\x0c\x12\x38\n\tdirection\x18\x03 \x01(\x0e\x32%.cln.ConnectResponse.ConnectDirection"#\n\x10\x43onnectDirection\x12\x06\n\x02IN\x10\x00\x12\x07\n\x03OUT\x10\x01"\xfb\x01\n\x0e\x43onnectAddress\x12\x39\n\titem_type\x18\x01 \x01(\x0e\x32&.cln.ConnectAddress.ConnectAddressType\x12\x13\n\x06socket\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x11\n\x04port\x18\x04 \x01(\rH\x02\x88\x01\x01"P\n\x12\x43onnectAddressType\x12\x10\n\x0cLOCAL_SOCKET\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x42\t\n\x07_socketB\n\n\x08_addressB\x07\n\x05_port"J\n\x14\x43reateinvoiceRequest\x12\x11\n\tinvstring\x18\x01 \x01(\t\x12\r\n\x05label\x18\x02 \x01(\t\x12\x10\n\x08preimage\x18\x03 \x01(\x0c"\xf3\x04\n\x15\x43reateinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12>\n\x06status\x18\x06 \x01(\x0e\x32..cln.CreateinvoiceResponse.CreateinvoiceStatus\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x16\n\tpay_index\x18\t \x01(\x04H\x03\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x05\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x06\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\r \x01(\x0cH\x07\x88\x01\x01\x12\x17\n\npayer_note\x18\x0e \x01(\tH\x08\x88\x01\x01"8\n\x13\x43reateinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x13\n\x11_payment_preimageB\x11\n\x0f_local_offer_idB\r\n\x0b_payer_note"\xb4\x02\n\x10\x44\x61tastoreRequest\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x13\n\x06string\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x36\n\x04mode\x18\x03 \x01(\x0e\x32#.cln.DatastoreRequest.DatastoreModeH\x02\x88\x01\x01\x12\x17\n\ngeneration\x18\x04 \x01(\x04H\x03\x88\x01\x01"p\n\rDatastoreMode\x12\x0f\n\x0bMUST_CREATE\x10\x00\x12\x10\n\x0cMUST_REPLACE\x10\x01\x12\x15\n\x11\x43REATE_OR_REPLACE\x10\x02\x12\x0f\n\x0bMUST_APPEND\x10\x03\x12\x14\n\x10\x43REATE_OR_APPEND\x10\x04\x42\t\n\x07_stringB\x06\n\x04_hexB\x07\n\x05_modeB\r\n\x0b_generation"\x82\x01\n\x11\x44\x61tastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string"\x9d\x01\n\x12\x43reateonionRequest\x12"\n\x04hops\x18\x01 \x03(\x0b\x32\x14.cln.CreateonionHops\x12\x11\n\tassocdata\x18\x02 \x01(\x0c\x12\x18\n\x0bsession_key\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x17\n\nonion_size\x18\x04 \x01(\rH\x01\x88\x01\x01\x42\x0e\n\x0c_session_keyB\r\n\x0b_onion_size"<\n\x13\x43reateonionResponse\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x16\n\x0eshared_secrets\x18\x02 \x03(\x0c"2\n\x0f\x43reateonionHops\x12\x0e\n\x06pubkey\x18\x01 \x01(\x0c\x12\x0f\n\x07payload\x18\x02 \x01(\x0c"J\n\x13\x44\x65ldatastoreRequest\x12\x0b\n\x03key\x18\x03 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x42\r\n\x0b_generation"\x85\x01\n\x14\x44\x65ldatastoreResponse\x12\x0b\n\x03key\x18\x05 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string"H\n\x18\x44\x65lexpiredinvoiceRequest\x12\x1a\n\rmaxexpirytime\x18\x01 \x01(\x04H\x00\x88\x01\x01\x42\x10\n\x0e_maxexpirytime"\x1b\n\x19\x44\x65lexpiredinvoiceResponse"\xb6\x01\n\x11\x44\x65linvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t\x12\x37\n\x06status\x18\x02 \x01(\x0e\x32\'.cln.DelinvoiceRequest.DelinvoiceStatus\x12\x15\n\x08\x64\x65sconly\x18\x03 \x01(\x08H\x00\x88\x01\x01"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\x0b\n\t_desconly"\xb7\x03\n\x12\x44\x65linvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x06\x62olt11\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x03 \x01(\tH\x01\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tH\x03\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x06 \x01(\x0c\x12\x38\n\x06status\x18\x07 \x01(\x0e\x32(.cln.DelinvoiceResponse.DelinvoiceStatus\x12\x12\n\nexpires_at\x18\x08 \x01(\x04\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x17\n\npayer_note\x18\n \x01(\tH\x05\x88\x01\x01"5\n\x10\x44\x65linvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x12\n\n\x06UNPAID\x10\x02\x42\t\n\x07_bolt11B\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x0e\n\x0c_descriptionB\x11\n\x0f_local_offer_idB\r\n\x0b_payer_note"\xb5\x02\n\x0eInvoiceRequest\x12"\n\x08msatoshi\x18\x01 \x01(\x0b\x32\x10.cln.AmountOrAny\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\r\n\x05label\x18\x03 \x01(\t\x12\x13\n\x06\x65xpiry\x18\x07 \x01(\x04H\x00\x88\x01\x01\x12\x11\n\tfallbacks\x18\x04 \x03(\t\x12\x15\n\x08preimage\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12"\n\x15\x65xposeprivatechannels\x18\x08 \x01(\x08H\x02\x88\x01\x01\x12\x11\n\x04\x63ltv\x18\x06 \x01(\rH\x03\x88\x01\x01\x12\x19\n\x0c\x64\x65schashonly\x18\t \x01(\x08H\x04\x88\x01\x01\x42\t\n\x07_expiryB\x0b\n\t_preimageB\x18\n\x16_exposeprivatechannelsB\x07\n\x05_cltvB\x0f\n\r_deschashonly"\xe7\x02\n\x0fInvoiceResponse\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x16\n\x0epayment_secret\x18\x03 \x01(\x0c\x12\x12\n\nexpires_at\x18\x04 \x01(\x04\x12\x1d\n\x10warning_capacity\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x1c\n\x0fwarning_offline\x18\x06 \x01(\tH\x01\x88\x01\x01\x12\x1d\n\x10warning_deadends\x18\x07 \x01(\tH\x02\x88\x01\x01\x12#\n\x16warning_private_unused\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x18\n\x0bwarning_mpp\x18\t \x01(\tH\x04\x88\x01\x01\x42\x13\n\x11_warning_capacityB\x12\n\x10_warning_offlineB\x13\n\x11_warning_deadendsB\x19\n\x17_warning_private_unusedB\x0e\n\x0c_warning_mpp"#\n\x14ListdatastoreRequest\x12\x0b\n\x03key\x18\x02 \x03(\t"G\n\x15ListdatastoreResponse\x12.\n\tdatastore\x18\x01 \x03(\x0b\x32\x1b.cln.ListdatastoreDatastore"\x87\x01\n\x16ListdatastoreDatastore\x12\x0b\n\x03key\x18\x01 \x03(\t\x12\x17\n\ngeneration\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x10\n\x03hex\x18\x03 \x01(\x0cH\x01\x88\x01\x01\x12\x13\n\x06string\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_generationB\x06\n\x04_hexB\t\n\x07_string"\xa9\x01\n\x13ListinvoicesRequest\x12\x12\n\x05label\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tinvstring\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x03 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08offer_id\x18\x04 \x01(\tH\x03\x88\x01\x01\x42\x08\n\x06_labelB\x0c\n\n_invstringB\x0f\n\r_payment_hashB\x0b\n\t_offer_id"C\n\x14ListinvoicesResponse\x12+\n\x08invoices\x18\x01 \x03(\x0b\x32\x19.cln.ListinvoicesInvoices"\x94\x05\n\x14ListinvoicesInvoices\x12\r\n\x05label\x18\x01 \x01(\t\x12\x18\n\x0b\x64\x65scription\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListinvoicesInvoices.ListinvoicesInvoicesStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x03\x88\x01\x01\x12\x1b\n\x0elocal_offer_id\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x17\n\npayer_note\x18\n \x01(\tH\x05\x88\x01\x01\x12\x16\n\tpay_index\x18\x0b \x01(\x04H\x06\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\x0c \x01(\x0b\x32\x0b.cln.AmountH\x07\x88\x01\x01\x12\x14\n\x07paid_at\x18\r \x01(\x04H\x08\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0e \x01(\x0cH\t\x88\x01\x01"?\n\x1aListinvoicesInvoicesStatus\x12\n\n\x06UNPAID\x10\x00\x12\x08\n\x04PAID\x10\x01\x12\x0b\n\x07\x45XPIRED\x10\x02\x42\x0e\n\x0c_descriptionB\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x11\n\x0f_local_offer_idB\r\n\x0b_payer_noteB\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x13\n\x11_payment_preimage"\xd6\x02\n\x10SendonionRequest\x12\r\n\x05onion\x18\x01 \x01(\x0c\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\x05label\x18\x04 \x01(\tH\x00\x88\x01\x01\x12\x16\n\x0eshared_secrets\x18\x05 \x03(\x0c\x12\x13\n\x06partid\x18\x06 \x01(\rH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x02\x88\x01\x01\x12"\n\x08msatoshi\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\t \x01(\x0cH\x04\x88\x01\x01\x12\x19\n\x0clocalofferid\x18\n \x01(\x0cH\x05\x88\x01\x01\x12\x14\n\x07groupid\x18\x0b \x01(\x04H\x06\x88\x01\x01\x42\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\x0b\n\t_msatoshiB\x0e\n\x0c_destinationB\x0f\n\r_localofferidB\n\n\x08_groupid"\x8b\x04\n\x11SendonionResponse\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12\x36\n\x06status\x18\x03 \x01(\x0e\x32&.cln.SendonionResponse.SendonionStatus\x12%\n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x12\n\ncreated_at\x18\x06 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\t \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\n \x01(\tH\x04\x88\x01\x01\x12\x13\n\x06partid\x18\r \x01(\x04H\x05\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0b \x01(\x0cH\x06\x88\x01\x01\x12\x14\n\x07message\x18\x0c \x01(\tH\x07\x88\x01\x01",\n\x0fSendonionStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x42\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\t\n\x07_bolt12B\t\n\x07_partidB\x13\n\x11_payment_preimageB\n\n\x08_message"Q\n\x12SendonionFirst_hop\x12\n\n\x02id\x18\x01 \x01(\x0c\x12 \n\x0b\x61mount_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x03 \x01(\r"\xeb\x01\n\x13ListsendpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12@\n\x06status\x18\x03 \x01(\x0e\x32+.cln.ListsendpaysRequest.ListsendpaysStatusH\x02\x88\x01\x01";\n\x12ListsendpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status"C\n\x14ListsendpaysResponse\x12+\n\x08payments\x18\x01 \x03(\x0b\x32\x19.cln.ListsendpaysPayments"\xe5\x04\n\x14ListsendpaysPayments\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x44\n\x06status\x18\x04 \x01(\x0e\x32\x34.cln.ListsendpaysPayments.ListsendpaysPaymentsStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\n \x01(\tH\x04\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0e \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0b \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x07\x88\x01\x01\x12\x17\n\nerroronion\x18\r \x01(\x0cH\x08\x88\x01\x01"C\n\x1aListsendpaysPaymentsStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x13\n\x11_payment_preimageB\r\n\x0b_erroronion"\x19\n\x17ListtransactionsRequest"S\n\x18ListtransactionsResponse\x12\x37\n\x0ctransactions\x18\x01 \x03(\x0b\x32!.cln.ListtransactionsTransactions"\x9a\x02\n\x1cListtransactionsTransactions\x12\x0c\n\x04hash\x18\x01 \x01(\x0c\x12\r\n\x05rawtx\x18\x02 \x01(\x0c\x12\x13\n\x0b\x62lockheight\x18\x03 \x01(\r\x12\x0f\n\x07txindex\x18\x04 \x01(\r\x12\x14\n\x07\x63hannel\x18\x06 \x01(\tH\x00\x88\x01\x01\x12\x10\n\x08locktime\x18\x07 \x01(\r\x12\x0f\n\x07version\x18\x08 \x01(\r\x12\x37\n\x06inputs\x18\t \x03(\x0b\x32\'.cln.ListtransactionsTransactionsInputs\x12\x39\n\x07outputs\x18\n \x03(\x0b\x32(.cln.ListtransactionsTransactionsOutputsB\n\n\x08_channel"\x84\x04\n"ListtransactionsTransactionsInputs\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\r\n\x05index\x18\x02 \x01(\r\x12\x10\n\x08sequence\x18\x03 \x01(\r\x12\x66\n\titem_type\x18\x04 \x01(\x0e\x32N.cln.ListtransactionsTransactionsInputs.ListtransactionsTransactionsInputsTypeH\x00\x88\x01\x01\x12\x14\n\x07\x63hannel\x18\x05 \x01(\tH\x01\x88\x01\x01"\x96\x02\n&ListtransactionsTransactionsInputsType\x12\n\n\x06THEIRS\x10\x00\x12\x0b\n\x07\x44\x45POSIT\x10\x01\x12\x0c\n\x08WITHDRAW\x10\x02\x12\x13\n\x0f\x43HANNEL_FUNDING\x10\x03\x12\x18\n\x14\x43HANNEL_MUTUAL_CLOSE\x10\x04\x12\x1c\n\x18\x43HANNEL_UNILATERAL_CLOSE\x10\x05\x12\x11\n\rCHANNEL_SWEEP\x10\x06\x12\x18\n\x14\x43HANNEL_HTLC_SUCCESS\x10\x07\x12\x18\n\x14\x43HANNEL_HTLC_TIMEOUT\x10\x08\x12\x13\n\x0f\x43HANNEL_PENALTY\x10\t\x12\x1c\n\x18\x43HANNEL_UNILATERAL_CHEAT\x10\nB\x0c\n\n_item_typeB\n\n\x08_channel"\x99\x04\n#ListtransactionsTransactionsOutputs\x12\r\n\x05index\x18\x01 \x01(\r\x12\x19\n\x04msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x14\n\x0cscriptPubKey\x18\x03 \x01(\x0c\x12h\n\titem_type\x18\x04 \x01(\x0e\x32P.cln.ListtransactionsTransactionsOutputs.ListtransactionsTransactionsOutputsTypeH\x00\x88\x01\x01\x12\x14\n\x07\x63hannel\x18\x05 \x01(\tH\x01\x88\x01\x01"\x97\x02\n\'ListtransactionsTransactionsOutputsType\x12\n\n\x06THEIRS\x10\x00\x12\x0b\n\x07\x44\x45POSIT\x10\x01\x12\x0c\n\x08WITHDRAW\x10\x02\x12\x13\n\x0f\x43HANNEL_FUNDING\x10\x03\x12\x18\n\x14\x43HANNEL_MUTUAL_CLOSE\x10\x04\x12\x1c\n\x18\x43HANNEL_UNILATERAL_CLOSE\x10\x05\x12\x11\n\rCHANNEL_SWEEP\x10\x06\x12\x18\n\x14\x43HANNEL_HTLC_SUCCESS\x10\x07\x12\x18\n\x14\x43HANNEL_HTLC_TIMEOUT\x10\x08\x12\x13\n\x0f\x43HANNEL_PENALTY\x10\t\x12\x1c\n\x18\x43HANNEL_UNILATERAL_CHEAT\x10\nB\x0c\n\n_item_typeB\n\n\x08_channel"\xd2\x03\n\nPayRequest\x12\x0e\n\x06\x62olt11\x18\x01 \x01(\t\x12"\n\x08msatoshi\x18\x02 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x12\n\x05label\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nriskfactor\x18\x08 \x01(\x01H\x02\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x03\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x04\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x05\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x19\n\x0clocalofferid\x18\t \x01(\x0cH\x07\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\n \x03(\t\x12 \n\x06maxfee\x18\x0b \x01(\x0b\x32\x0b.cln.AmountH\x08\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0c \x01(\tH\t\x88\x01\x01\x42\x0b\n\t_msatoshiB\x08\n\x06_labelB\r\n\x0b_riskfactorB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\x0f\n\r_localofferidB\t\n\x07_maxfeeB\x0e\n\x0c_description"\xfb\x02\n\x0bPayResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12*\n\x06status\x18\t \x01(\x0e\x32\x1a.cln.PayResponse.PayStatus"2\n\tPayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion"*\n\x10ListnodesRequest\x12\x0f\n\x02id\x18\x01 \x01(\x0cH\x00\x88\x01\x01\x42\x05\n\x03_id"7\n\x11ListnodesResponse\x12"\n\x05nodes\x18\x01 \x03(\x0b\x32\x13.cln.ListnodesNodes"\xe1\x01\n\x0eListnodesNodes\x12\x0e\n\x06nodeid\x18\x01 \x01(\x0c\x12\x1b\n\x0elast_timestamp\x18\x02 \x01(\rH\x00\x88\x01\x01\x12\x12\n\x05\x61lias\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x12\n\x05\x63olor\x18\x04 \x01(\x0cH\x02\x88\x01\x01\x12\x15\n\x08\x66\x65\x61tures\x18\x05 \x01(\x0cH\x03\x88\x01\x01\x12/\n\taddresses\x18\x06 \x03(\x0b\x32\x1c.cln.ListnodesNodesAddressesB\x11\n\x0f_last_timestampB\x08\n\x06_aliasB\x08\n\x06_colorB\x0b\n\t_features"\xf7\x01\n\x17ListnodesNodesAddresses\x12K\n\titem_type\x18\x01 \x01(\x0e\x32\x38.cln.ListnodesNodesAddresses.ListnodesNodesAddressesType\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x14\n\x07\x61\x64\x64ress\x18\x03 \x01(\tH\x00\x88\x01\x01"_\n\x1bListnodesNodesAddressesType\x12\x07\n\x03\x44NS\x10\x00\x12\x08\n\x04IPV4\x10\x01\x12\x08\n\x04IPV6\x10\x02\x12\t\n\x05TORV2\x10\x03\x12\t\n\x05TORV3\x10\x04\x12\r\n\tWEBSOCKET\x10\x05\x42\n\n\x08_address"g\n\x15WaitanyinvoiceRequest\x12\x1a\n\rlastpay_index\x18\x01 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x07timeout\x18\x02 \x01(\x04H\x01\x88\x01\x01\x42\x10\n\x0e_lastpay_indexB\n\n\x08_timeout"\x93\x04\n\x16WaitanyinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12@\n\x06status\x18\x04 \x01(\x0e\x32\x30.cln.WaitanyinvoiceResponse.WaitanyinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x03\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x05\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x06\x88\x01\x01"-\n\x14WaitanyinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x13\n\x11_payment_preimage"#\n\x12WaitinvoiceRequest\x12\r\n\x05label\x18\x01 \x01(\t"\x87\x04\n\x13WaitinvoiceResponse\x12\r\n\x05label\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitinvoiceResponse.WaitinvoiceStatus\x12\x12\n\nexpires_at\x18\x05 \x01(\x04\x12%\n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.AmountH\x00\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x07 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x08 \x01(\tH\x02\x88\x01\x01\x12\x16\n\tpay_index\x18\t \x01(\x04H\x03\x88\x01\x01\x12.\n\x14\x61mount_received_msat\x18\n \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12\x14\n\x07paid_at\x18\x0b \x01(\x04H\x05\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\x0c \x01(\x0cH\x06\x88\x01\x01"*\n\x11WaitinvoiceStatus\x12\x08\n\x04PAID\x10\x00\x12\x0b\n\x07\x45XPIRED\x10\x01\x42\x0e\n\x0c_amount_msatB\t\n\x07_bolt11B\t\n\x07_bolt12B\x0c\n\n_pay_indexB\x17\n\x15_amount_received_msatB\n\n\x08_paid_atB\x13\n\x11_payment_preimage"\x8e\x01\n\x12WaitsendpayRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x14\n\x07timeout\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x13\n\x06partid\x18\x02 \x01(\x04H\x01\x88\x01\x01\x12\x14\n\x07groupid\x18\x04 \x01(\x04H\x02\x88\x01\x01\x42\n\n\x08_timeoutB\t\n\x07_partidB\n\n\x08_groupid"\x86\x04\n\x13WaitsendpayResponse\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x14\n\x07groupid\x18\x02 \x01(\x04H\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12:\n\x06status\x18\x04 \x01(\x0e\x32*.cln.WaitsendpayResponse.WaitsendpayStatus\x12%\n\x0b\x61mount_msat\x18\x05 \x01(\x0b\x32\x0b.cln.AmountH\x01\x88\x01\x01\x12\x18\n\x0b\x64\x65stination\x18\x06 \x01(\x0cH\x02\x88\x01\x01\x12\x12\n\ncreated_at\x18\x07 \x01(\x04\x12%\n\x10\x61mount_sent_msat\x18\x08 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\t \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06partid\x18\n \x01(\x04H\x04\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x0b \x01(\tH\x05\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x0c \x01(\tH\x06\x88\x01\x01\x12\x1d\n\x10payment_preimage\x18\r \x01(\x0cH\x07\x88\x01\x01"!\n\x11WaitsendpayStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\n\n\x08_groupidB\x0e\n\x0c_amount_msatB\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_partidB\t\n\x07_bolt11B\t\n\x07_bolt12B\x13\n\x11_payment_preimage"\x9e\x01\n\x0eNewaddrRequest\x12@\n\x0b\x61\x64\x64resstype\x18\x01 \x01(\x0e\x32&.cln.NewaddrRequest.NewaddrAddresstypeH\x00\x88\x01\x01":\n\x12NewaddrAddresstype\x12\n\n\x06\x42\x45\x43H32\x10\x00\x12\x0f\n\x0bP2SH_SEGWIT\x10\x01\x12\x07\n\x03\x41LL\x10\x02\x42\x0e\n\x0c_addresstype"[\n\x0fNewaddrResponse\x12\x13\n\x06\x62\x65\x63h32\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x18\n\x0bp2sh_segwit\x18\x02 \x01(\tH\x01\x88\x01\x01\x42\t\n\x07_bech32B\x0e\n\x0c_p2sh_segwit"\xca\x01\n\x0fWithdrawRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12&\n\x07satoshi\x18\x02 \x01(\x0b\x32\x10.cln.AmountOrAllH\x00\x88\x01\x01\x12"\n\x07\x66\x65\x65rate\x18\x05 \x01(\x0b\x32\x0c.cln.FeerateH\x01\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x02\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_satoshiB\n\n\x08_feerateB\n\n\x08_minconf":\n\x10WithdrawResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c\x12\x0c\n\x04psbt\x18\x03 \x01(\t"\xc9\x02\n\x0eKeysendRequest\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\x0c\x12\x1d\n\x08msatoshi\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\x05label\x18\x03 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rmaxfeepercent\x18\x04 \x01(\x01H\x01\x88\x01\x01\x12\x16\n\tretry_for\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x15\n\x08maxdelay\x18\x06 \x01(\rH\x03\x88\x01\x01\x12#\n\texemptfee\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01\x12+\n\nroutehints\x18\x08 \x01(\x0b\x32\x12.cln.RoutehintListH\x05\x88\x01\x01\x42\x08\n\x06_labelB\x10\n\x0e_maxfeepercentB\x0c\n\n_retry_forB\x0b\n\t_maxdelayB\x0c\n\n_exemptfeeB\r\n\x0b_routehints"\xf2\x02\n\x0fKeysendResponse\x12\x18\n\x10payment_preimage\x18\x01 \x01(\x0c\x12\x18\n\x0b\x64\x65stination\x18\x02 \x01(\x0cH\x00\x88\x01\x01\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\x12\r\n\x05parts\x18\x05 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x06 \x01(\x0b\x32\x0b.cln.Amount\x12%\n\x10\x61mount_sent_msat\x18\x07 \x01(\x0b\x32\x0b.cln.Amount\x12\'\n\x1awarning_partial_completion\x18\x08 \x01(\tH\x01\x88\x01\x01\x12\x32\n\x06status\x18\t \x01(\x0e\x32".cln.KeysendResponse.KeysendStatus"\x1d\n\rKeysendStatus\x12\x0c\n\x08\x43OMPLETE\x10\x00\x42\x0e\n\x0c_destinationB\x1d\n\x1b_warning_partial_completion"\x12\n\x10KeysendExtratlvs"\xb7\x02\n\x0f\x46undpsbtRequest\x12\x1c\n\x07satoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x14\n\x07minconf\x18\x04 \x01(\rH\x00\x88\x01\x01\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\x08 \x01(\x08H\x04\x88\x01\x01\x42\n\n\x08_minconfB\n\n\x08_reserveB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_change"\xd9\x01\n\x10\x46undpsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.FundpsbtReservationsB\x10\n\x0e_change_outnum"u\n\x14\x46undpsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r"A\n\x0fSendpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x14\n\x07reserve\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\n\n\x08_reserve",\n\x10SendpsbtResponse\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c"1\n\x0fSignpsbtRequest\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x10\n\x08signonly\x18\x02 \x03(\r"\'\n\x10SignpsbtResponse\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\t"\xdb\x02\n\x0fUtxopsbtRequest\x12\x1c\n\x07satoshi\x18\x01 \x01(\x0b\x32\x0b.cln.Amount\x12\x1d\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.Feerate\x12\x13\n\x0bstartweight\x18\x03 \x01(\r\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.Outpoint\x12\x14\n\x07reserve\x18\x05 \x01(\rH\x00\x88\x01\x01\x12\x17\n\nreservedok\x18\x08 \x01(\x08H\x01\x88\x01\x01\x12\x15\n\x08locktime\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x1f\n\x12min_witness_weight\x18\x07 \x01(\rH\x03\x88\x01\x01\x12\x1d\n\x10\x65xcess_as_change\x18\t \x01(\x08H\x04\x88\x01\x01\x42\n\n\x08_reserveB\r\n\x0b_reservedokB\x0b\n\t_locktimeB\x15\n\x13_min_witness_weightB\x13\n\x11_excess_as_change"\xd9\x01\n\x10UtxopsbtResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x16\n\x0e\x66\x65\x65rate_per_kw\x18\x02 \x01(\r\x12\x1e\n\x16\x65stimated_final_weight\x18\x03 \x01(\r\x12 \n\x0b\x65xcess_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\x1a\n\rchange_outnum\x18\x05 \x01(\rH\x00\x88\x01\x01\x12/\n\x0creservations\x18\x06 \x03(\x0b\x32\x19.cln.UtxopsbtReservationsB\x10\n\x0e_change_outnum"u\n\x14UtxopsbtReservations\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x0c\n\x04vout\x18\x02 \x01(\r\x12\x14\n\x0cwas_reserved\x18\x03 \x01(\x08\x12\x10\n\x08reserved\x18\x04 \x01(\x08\x12\x19\n\x11reserved_to_block\x18\x05 \x01(\r" \n\x10TxdiscardRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c"6\n\x11TxdiscardResponse\x12\x13\n\x0bunsigned_tx\x18\x01 \x01(\x0c\x12\x0c\n\x04txid\x18\x02 \x01(\x0c"\xa4\x01\n\x10TxprepareRequest\x12 \n\x07outputs\x18\x05 \x03(\x0b\x32\x0f.cln.OutputDesc\x12"\n\x07\x66\x65\x65rate\x18\x02 \x01(\x0b\x32\x0c.cln.FeerateH\x00\x88\x01\x01\x12\x14\n\x07minconf\x18\x03 \x01(\rH\x01\x88\x01\x01\x12\x1c\n\x05utxos\x18\x04 \x03(\x0b\x32\r.cln.OutpointB\n\n\x08_feerateB\n\n\x08_minconf"D\n\x11TxprepareResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\x13\n\x0bunsigned_tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c"\x1d\n\rTxsendRequest\x12\x0c\n\x04txid\x18\x01 \x01(\x0c"8\n\x0eTxsendResponse\x12\x0c\n\x04psbt\x18\x01 \x01(\t\x12\n\n\x02tx\x18\x02 \x01(\x0c\x12\x0c\n\x04txid\x18\x03 \x01(\x0c"=\n\x11\x44isconnectRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x12\n\x05\x66orce\x18\x02 \x01(\x08H\x00\x88\x01\x01\x42\x08\n\x06_force"\x14\n\x12\x44isconnectResponse"k\n\x0f\x46\x65\x65ratesRequest\x12\x31\n\x05style\x18\x01 \x01(\x0e\x32".cln.FeeratesRequest.FeeratesStyle"%\n\rFeeratesStyle\x12\t\n\x05PERKB\x10\x00\x12\t\n\x05PERKW\x10\x01"V\n\x10\x46\x65\x65ratesResponse\x12%\n\x18warning_missing_feerates\x18\x01 \x01(\tH\x00\x88\x01\x01\x42\x1b\n\x19_warning_missing_feerates"\xc3\x02\n\rFeeratesPerkb\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x14\n\x07opening\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x03\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x05\x88\x01\x01\x42\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty"\xc3\x02\n\rFeeratesPerkw\x12\x16\n\x0emin_acceptable\x18\x01 \x01(\r\x12\x16\n\x0emax_acceptable\x18\x02 \x01(\r\x12\x14\n\x07opening\x18\x03 \x01(\rH\x00\x88\x01\x01\x12\x19\n\x0cmutual_close\x18\x04 \x01(\rH\x01\x88\x01\x01\x12\x1d\n\x10unilateral_close\x18\x05 \x01(\rH\x02\x88\x01\x01\x12\x1a\n\rdelayed_to_us\x18\x06 \x01(\rH\x03\x88\x01\x01\x12\x1c\n\x0fhtlc_resolution\x18\x07 \x01(\rH\x04\x88\x01\x01\x12\x14\n\x07penalty\x18\x08 \x01(\rH\x05\x88\x01\x01\x42\n\n\x08_openingB\x0f\n\r_mutual_closeB\x13\n\x11_unilateral_closeB\x10\n\x0e_delayed_to_usB\x12\n\x10_htlc_resolutionB\n\n\x08_penalty"\xc1\x01\n\x1d\x46\x65\x65ratesOnchain_fee_estimates\x12 \n\x18opening_channel_satoshis\x18\x01 \x01(\x04\x12\x1d\n\x15mutual_close_satoshis\x18\x02 \x01(\x04\x12!\n\x19unilateral_close_satoshis\x18\x03 \x01(\x04\x12\x1d\n\x15htlc_timeout_satoshis\x18\x04 \x01(\x04\x12\x1d\n\x15htlc_success_satoshis\x18\x05 \x01(\x04"\xe9\x01\n\x0fGetrouteRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x1d\n\x08msatoshi\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x12\n\nriskfactor\x18\x03 \x01(\x04\x12\x11\n\x04\x63ltv\x18\x04 \x01(\x01H\x00\x88\x01\x01\x12\x13\n\x06\x66romid\x18\x05 \x01(\x0cH\x01\x88\x01\x01\x12\x18\n\x0b\x66uzzpercent\x18\x06 \x01(\rH\x02\x88\x01\x01\x12\x0f\n\x07\x65xclude\x18\x07 \x03(\t\x12\x14\n\x07maxhops\x18\x08 \x01(\rH\x03\x88\x01\x01\x42\x07\n\x05_cltvB\t\n\x07_fromidB\x0e\n\x0c_fuzzpercentB\n\n\x08_maxhops"5\n\x10GetrouteResponse\x12!\n\x05route\x18\x01 \x03(\x0b\x32\x12.cln.GetrouteRoute"\xc5\x01\n\rGetrouteRoute\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63hannel\x18\x02 \x01(\t\x12\x11\n\tdirection\x18\x03 \x01(\r\x12 \n\x0b\x61mount_msat\x18\x04 \x01(\x0b\x32\x0b.cln.Amount\x12\r\n\x05\x64\x65lay\x18\x05 \x01(\r\x12\x34\n\x05style\x18\x06 \x01(\x0e\x32%.cln.GetrouteRoute.GetrouteRouteStyle"\x1d\n\x12GetrouteRouteStyle\x12\x07\n\x03TLV\x10\x00"\x82\x02\n\x13ListforwardsRequest\x12@\n\x06status\x18\x01 \x01(\x0e\x32+.cln.ListforwardsRequest.ListforwardsStatusH\x00\x88\x01\x01\x12\x17\n\nin_channel\x18\x02 \x01(\tH\x01\x88\x01\x01\x12\x18\n\x0bout_channel\x18\x03 \x01(\tH\x02\x88\x01\x01"L\n\x12ListforwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x42\t\n\x07_statusB\r\n\x0b_in_channelB\x0e\n\x0c_out_channel"C\n\x14ListforwardsResponse\x12+\n\x08\x66orwards\x18\x01 \x03(\x0b\x32\x19.cln.ListforwardsForwards"\xb8\x04\n\x14ListforwardsForwards\x12\x12\n\nin_channel\x18\x01 \x01(\t\x12\x1c\n\x07in_msat\x18\x02 \x01(\x0b\x32\x0b.cln.Amount\x12\x44\n\x06status\x18\x03 \x01(\x0e\x32\x34.cln.ListforwardsForwards.ListforwardsForwardsStatus\x12\x15\n\rreceived_time\x18\x04 \x01(\x01\x12\x18\n\x0bout_channel\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x06 \x01(\x0cH\x01\x88\x01\x01\x12G\n\x05style\x18\t \x01(\x0e\x32\x33.cln.ListforwardsForwards.ListforwardsForwardsStyleH\x02\x88\x01\x01\x12"\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x0b\x32\x0b.cln.AmountH\x03\x88\x01\x01\x12"\n\x08out_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x04\x88\x01\x01"T\n\x1aListforwardsForwardsStatus\x12\x0b\n\x07OFFERED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x10\n\x0cLOCAL_FAILED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03"0\n\x19ListforwardsForwardsStyle\x12\n\n\x06LEGACY\x10\x00\x12\x07\n\x03TLV\x10\x01\x42\x0e\n\x0c_out_channelB\x0f\n\r_payment_hashB\x08\n\x06_styleB\x0b\n\t_fee_msatB\x0b\n\t_out_msat"\xdb\x01\n\x0fListpaysRequest\x12\x13\n\x06\x62olt11\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x19\n\x0cpayment_hash\x18\x02 \x01(\x0cH\x01\x88\x01\x01\x12\x38\n\x06status\x18\x03 \x01(\x0e\x32#.cln.ListpaysRequest.ListpaysStatusH\x02\x88\x01\x01"7\n\x0eListpaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\x0c\n\x08\x43OMPLETE\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x42\t\n\x07_bolt11B\x0f\n\r_payment_hashB\t\n\x07_status"3\n\x10ListpaysResponse\x12\x1f\n\x04pays\x18\x01 \x03(\x0b\x32\x11.cln.ListpaysPays"\xfd\x03\n\x0cListpaysPays\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x34\n\x06status\x18\x02 \x01(\x0e\x32$.cln.ListpaysPays.ListpaysPaysStatus\x12\x18\n\x0b\x64\x65stination\x18\x03 \x01(\x0cH\x00\x88\x01\x01\x12\x12\n\ncreated_at\x18\x04 \x01(\x04\x12\x12\n\x05label\x18\x05 \x01(\tH\x01\x88\x01\x01\x12\x13\n\x06\x62olt11\x18\x06 \x01(\tH\x02\x88\x01\x01\x12\x18\n\x0b\x64\x65scription\x18\x0b \x01(\tH\x03\x88\x01\x01\x12\x13\n\x06\x62olt12\x18\x07 \x01(\tH\x04\x88\x01\x01\x12%\n\x0b\x61mount_msat\x18\x08 \x01(\x0b\x32\x0b.cln.AmountH\x05\x88\x01\x01\x12*\n\x10\x61mount_sent_msat\x18\t \x01(\x0b\x32\x0b.cln.AmountH\x06\x88\x01\x01\x12\x17\n\nerroronion\x18\n \x01(\x0cH\x07\x88\x01\x01";\n\x12ListpaysPaysStatus\x12\x0b\n\x07PENDING\x10\x00\x12\n\n\x06\x46\x41ILED\x10\x01\x12\x0c\n\x08\x43OMPLETE\x10\x02\x42\x0e\n\x0c_destinationB\x08\n\x06_labelB\t\n\x07_bolt11B\x0e\n\x0c_descriptionB\t\n\x07_bolt12B\x0e\n\x0c_amount_msatB\x13\n\x11_amount_sent_msatB\r\n\x0b_erroronion"Y\n\x0bPingRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\x10\n\x03len\x18\x02 \x01(\x01H\x00\x88\x01\x01\x12\x16\n\tpongbytes\x18\x03 \x01(\x01H\x01\x88\x01\x01\x42\x06\n\x04_lenB\x0c\n\n_pongbytes"\x1e\n\x0cPingResponse\x12\x0e\n\x06totlen\x18\x01 \x01(\r"%\n\x12SignmessageRequest\x12\x0f\n\x07message\x18\x01 \x01(\t"F\n\x13SignmessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\r\n\x05recid\x18\x02 \x01(\x0c\x12\r\n\x05zbase\x18\x03 \x01(\t2\xfd\x15\n\x04Node\x12\x36\n\x07Getinfo\x12\x13.cln.GetinfoRequest\x1a\x14.cln.GetinfoResponse"\x00\x12<\n\tListPeers\x12\x15.cln.ListpeersRequest\x1a\x16.cln.ListpeersResponse"\x00\x12<\n\tListFunds\x12\x15.cln.ListfundsRequest\x1a\x16.cln.ListfundsResponse"\x00\x12\x36\n\x07SendPay\x12\x13.cln.SendpayRequest\x1a\x14.cln.SendpayResponse"\x00\x12\x45\n\x0cListChannels\x12\x18.cln.ListchannelsRequest\x1a\x19.cln.ListchannelsResponse"\x00\x12<\n\tAddGossip\x12\x15.cln.AddgossipRequest\x1a\x16.cln.AddgossipResponse"\x00\x12Q\n\x10\x41utoCleanInvoice\x12\x1c.cln.AutocleaninvoiceRequest\x1a\x1d.cln.AutocleaninvoiceResponse"\x00\x12\x45\n\x0c\x43heckMessage\x12\x18.cln.CheckmessageRequest\x1a\x19.cln.CheckmessageResponse"\x00\x12\x30\n\x05\x43lose\x12\x11.cln.CloseRequest\x1a\x12.cln.CloseResponse"\x00\x12:\n\x0b\x43onnectPeer\x12\x13.cln.ConnectRequest\x1a\x14.cln.ConnectResponse"\x00\x12H\n\rCreateInvoice\x12\x19.cln.CreateinvoiceRequest\x1a\x1a.cln.CreateinvoiceResponse"\x00\x12<\n\tDatastore\x12\x15.cln.DatastoreRequest\x1a\x16.cln.DatastoreResponse"\x00\x12\x42\n\x0b\x43reateOnion\x12\x17.cln.CreateonionRequest\x1a\x18.cln.CreateonionResponse"\x00\x12\x45\n\x0c\x44\x65lDatastore\x12\x18.cln.DeldatastoreRequest\x1a\x19.cln.DeldatastoreResponse"\x00\x12T\n\x11\x44\x65lExpiredInvoice\x12\x1d.cln.DelexpiredinvoiceRequest\x1a\x1e.cln.DelexpiredinvoiceResponse"\x00\x12?\n\nDelInvoice\x12\x16.cln.DelinvoiceRequest\x1a\x17.cln.DelinvoiceResponse"\x00\x12\x36\n\x07Invoice\x12\x13.cln.InvoiceRequest\x1a\x14.cln.InvoiceResponse"\x00\x12H\n\rListDatastore\x12\x19.cln.ListdatastoreRequest\x1a\x1a.cln.ListdatastoreResponse"\x00\x12\x45\n\x0cListInvoices\x12\x18.cln.ListinvoicesRequest\x1a\x19.cln.ListinvoicesResponse"\x00\x12<\n\tSendOnion\x12\x15.cln.SendonionRequest\x1a\x16.cln.SendonionResponse"\x00\x12\x45\n\x0cListSendPays\x12\x18.cln.ListsendpaysRequest\x1a\x19.cln.ListsendpaysResponse"\x00\x12Q\n\x10ListTransactions\x12\x1c.cln.ListtransactionsRequest\x1a\x1d.cln.ListtransactionsResponse"\x00\x12*\n\x03Pay\x12\x0f.cln.PayRequest\x1a\x10.cln.PayResponse"\x00\x12<\n\tListNodes\x12\x15.cln.ListnodesRequest\x1a\x16.cln.ListnodesResponse"\x00\x12K\n\x0eWaitAnyInvoice\x12\x1a.cln.WaitanyinvoiceRequest\x1a\x1b.cln.WaitanyinvoiceResponse"\x00\x12\x42\n\x0bWaitInvoice\x12\x17.cln.WaitinvoiceRequest\x1a\x18.cln.WaitinvoiceResponse"\x00\x12\x42\n\x0bWaitSendPay\x12\x17.cln.WaitsendpayRequest\x1a\x18.cln.WaitsendpayResponse"\x00\x12\x36\n\x07NewAddr\x12\x13.cln.NewaddrRequest\x1a\x14.cln.NewaddrResponse"\x00\x12\x39\n\x08Withdraw\x12\x14.cln.WithdrawRequest\x1a\x15.cln.WithdrawResponse"\x00\x12\x36\n\x07KeySend\x12\x13.cln.KeysendRequest\x1a\x14.cln.KeysendResponse"\x00\x12\x39\n\x08\x46undPsbt\x12\x14.cln.FundpsbtRequest\x1a\x15.cln.FundpsbtResponse"\x00\x12\x39\n\x08SendPsbt\x12\x14.cln.SendpsbtRequest\x1a\x15.cln.SendpsbtResponse"\x00\x12\x39\n\x08SignPsbt\x12\x14.cln.SignpsbtRequest\x1a\x15.cln.SignpsbtResponse"\x00\x12\x39\n\x08UtxoPsbt\x12\x14.cln.UtxopsbtRequest\x1a\x15.cln.UtxopsbtResponse"\x00\x12<\n\tTxDiscard\x12\x15.cln.TxdiscardRequest\x1a\x16.cln.TxdiscardResponse"\x00\x12<\n\tTxPrepare\x12\x15.cln.TxprepareRequest\x1a\x16.cln.TxprepareResponse"\x00\x12\x33\n\x06TxSend\x12\x12.cln.TxsendRequest\x1a\x13.cln.TxsendResponse"\x00\x12?\n\nDisconnect\x12\x16.cln.DisconnectRequest\x1a\x17.cln.DisconnectResponse"\x00\x12\x39\n\x08\x46\x65\x65rates\x12\x14.cln.FeeratesRequest\x1a\x15.cln.FeeratesResponse"\x00\x12\x39\n\x08GetRoute\x12\x14.cln.GetrouteRequest\x1a\x15.cln.GetrouteResponse"\x00\x12\x45\n\x0cListForwards\x12\x18.cln.ListforwardsRequest\x1a\x19.cln.ListforwardsResponse"\x00\x12\x39\n\x08ListPays\x12\x14.cln.ListpaysRequest\x1a\x15.cln.ListpaysResponse"\x00\x12-\n\x04Ping\x12\x10.cln.PingRequest\x1a\x11.cln.PingResponse"\x00\x12\x42\n\x0bSignMessage\x12\x17.cln.SignmessageRequest\x1a\x18.cln.SignmessageResponse"\x00\x62\x06proto3' diff --git a/app/repositories/ln_impl/protos/cln/node_pb2_grpc.py b/app/lightning/impl/protos/cln/node_pb2_grpc.py similarity index 99% rename from app/repositories/ln_impl/protos/cln/node_pb2_grpc.py rename to app/lightning/impl/protos/cln/node_pb2_grpc.py index 5b8d2c8..29143a6 100644 --- a/app/repositories/ln_impl/protos/cln/node_pb2_grpc.py +++ b/app/lightning/impl/protos/cln/node_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -import app.repositories.ln_impl.protos.cln.node_pb2 as node__pb2 +import app.lightning.impl.protos.cln.node_pb2 as node__pb2 class NodeStub(object): diff --git a/app/repositories/ln_impl/protos/cln/primitives_pb2.py b/app/lightning/impl/protos/cln/primitives_pb2.py similarity index 100% rename from app/repositories/ln_impl/protos/cln/primitives_pb2.py rename to app/lightning/impl/protos/cln/primitives_pb2.py diff --git a/app/repositories/ln_impl/protos/cln/primitives_pb2_grpc.py b/app/lightning/impl/protos/cln/primitives_pb2_grpc.py similarity index 100% rename from app/repositories/ln_impl/protos/cln/primitives_pb2_grpc.py rename to app/lightning/impl/protos/cln/primitives_pb2_grpc.py diff --git a/app/repositories/ln_impl/protos/lnd/lightning_pb2.py b/app/lightning/impl/protos/lnd/lightning_pb2.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/lightning_pb2.py rename to app/lightning/impl/protos/lnd/lightning_pb2.py diff --git a/app/repositories/ln_impl/protos/lnd/lightning_pb2_grpc.py b/app/lightning/impl/protos/lnd/lightning_pb2_grpc.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/lightning_pb2_grpc.py rename to app/lightning/impl/protos/lnd/lightning_pb2_grpc.py diff --git a/app/repositories/ln_impl/protos/lnd/router_pb2.py b/app/lightning/impl/protos/lnd/router_pb2.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/router_pb2.py rename to app/lightning/impl/protos/lnd/router_pb2.py diff --git a/app/repositories/ln_impl/protos/lnd/router_pb2_grpc.py b/app/lightning/impl/protos/lnd/router_pb2_grpc.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/router_pb2_grpc.py rename to app/lightning/impl/protos/lnd/router_pb2_grpc.py diff --git a/app/repositories/ln_impl/protos/lnd/signer_pb2.py b/app/lightning/impl/protos/lnd/signer_pb2.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/signer_pb2.py rename to app/lightning/impl/protos/lnd/signer_pb2.py diff --git a/app/repositories/ln_impl/protos/lnd/signer_pb2_grpc.py b/app/lightning/impl/protos/lnd/signer_pb2_grpc.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/signer_pb2_grpc.py rename to app/lightning/impl/protos/lnd/signer_pb2_grpc.py diff --git a/app/repositories/ln_impl/protos/lnd/walletunlocker_pb2.py b/app/lightning/impl/protos/lnd/walletunlocker_pb2.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/walletunlocker_pb2.py rename to app/lightning/impl/protos/lnd/walletunlocker_pb2.py diff --git a/app/repositories/ln_impl/protos/lnd/walletunlocker_pb2_grpc.py b/app/lightning/impl/protos/lnd/walletunlocker_pb2_grpc.py similarity index 100% rename from app/repositories/ln_impl/protos/lnd/walletunlocker_pb2_grpc.py rename to app/lightning/impl/protos/lnd/walletunlocker_pb2_grpc.py diff --git a/app/repositories/ln_impl/specializations/README.md b/app/lightning/impl/specializations/README.md similarity index 100% rename from app/repositories/ln_impl/specializations/README.md rename to app/lightning/impl/specializations/README.md diff --git a/app/repositories/ln_impl/specializations/cln_grpc_blitz.py b/app/lightning/impl/specializations/cln_grpc_blitz.py similarity index 99% rename from app/repositories/ln_impl/specializations/cln_grpc_blitz.py rename to app/lightning/impl/specializations/cln_grpc_blitz.py index 1ea3ab9..c8ad124 100644 --- a/app/repositories/ln_impl/specializations/cln_grpc_blitz.py +++ b/app/lightning/impl/specializations/cln_grpc_blitz.py @@ -6,7 +6,7 @@ from decouple import config from fastapi.exceptions import HTTPException from starlette import status -from app.core_utils import call_script2, redis_get +from app.api.utils import call_script2, redis_get from app.models.lightning import ( Channel, FeeRevenue, diff --git a/app/models/lightning.py b/app/lightning/models.py similarity index 99% rename from app/models/lightning.py rename to app/lightning/models.py index 093fe06..cc21a9b 100644 --- a/app/models/lightning.py +++ b/app/lightning/models.py @@ -7,7 +7,7 @@ from fastapi.param_functions import Query from pydantic import BaseModel from pydantic.types import conint -import app.models.lightning_docs as docs +import app.lightning.docs as docs class LnInitState(str, Enum): diff --git a/app/routers/lightning.py b/app/lightning/router.py similarity index 99% rename from app/routers/lightning.py rename to app/lightning/router.py index 73b89a2..2508ce1 100644 --- a/app/routers/lightning.py +++ b/app/lightning/router.py @@ -4,7 +4,15 @@ from fastapi import APIRouter, HTTPException, Query, status from fastapi.params import Depends from app.auth.auth_bearer import JWTBearer -from app.models.lightning import ( +from app.lightning.docs import ( + get_balance_response_desc, + new_address_desc, + open_channel_desc, + send_coins_desc, + send_payment_desc, + unlock_wallet_desc, +) +from app.lightning.models import ( Channel, FeeRevenue, GenericTx, @@ -20,7 +28,7 @@ from app.models.lightning import ( UnlockWalletInput, WalletBalance, ) -from app.repositories.lightning import ( +from app.lightning.service import ( add_invoice, channel_close, channel_list, @@ -39,14 +47,6 @@ from app.repositories.lightning import ( send_payment, unlock_wallet, ) -from app.routers.lightning_docs import ( - get_balance_response_desc, - new_address_desc, - open_channel_desc, - send_coins_desc, - send_payment_desc, - unlock_wallet_desc, -) _PREFIX = "lightning" diff --git a/app/repositories/lightning.py b/app/lightning/service.py similarity index 95% rename from app/repositories/lightning.py rename to app/lightning/service.py index ba64659..071b77a 100644 --- a/app/repositories/lightning.py +++ b/app/lightning/service.py @@ -6,8 +6,8 @@ from decouple import config from fastapi import status from fastapi.exceptions import HTTPException -from app.core_utils import SSE, broadcast_sse_msg, redis_get -from app.models.lightning import ( +from app.api.utils import SSE, broadcast_sse_msg, redis_get +from app.lightning.models import ( Channel, FeeRevenue, GenericTx, @@ -22,17 +22,17 @@ from app.models.lightning import ( SendCoinsInput, SendCoinsResponse, ) -from app.models.system import APIPlatform +from app.system.models import APIPlatform PLATFORM = config("platform", cast=str) ln_node = config("ln_node") if ln_node == "lnd_grpc": - from app.repositories.ln_impl.lnd_grpc import LnNodeLNDgRPC as LnNode + from app.lightning.impl.lnd_grpc import LnNodeLNDgRPC as LnNode elif ln_node == "cln_grpc" and PLATFORM != APIPlatform.RASPIBLITZ: - from app.repositories.ln_impl.cln_grpc import LnNodeCLNgRPC as LnNode + from app.lightning.impl.cln_grpc import LnNodeCLNgRPC as LnNode elif ln_node == "cln_grpc" and PLATFORM == APIPlatform.RASPIBLITZ: - from app.repositories.ln_impl.specializations.cln_grpc_blitz import ( + from app.lightning.impl.specializations.cln_grpc_blitz import ( LnNodeCLNgRPCBlitz as LnNode, ) elif ln_node == "none": diff --git a/app/main.py b/app/main.py index 0f9ca07..9b6f84c 100644 --- a/app/main.py +++ b/app/main.py @@ -15,29 +15,34 @@ from starlette import status from starlette.middleware.cors import CORSMiddleware from starlette.responses import RedirectResponse +from app.api.models import ApiStartupStatus, StartupState +from app.api.utils import SSE, broadcast_sse_msg, build_sse_event, sse_mgr +from app.api.warmup import ( + get_bitcoin_client_warmup_data, + get_full_client_warmup_data, + get_full_client_warmup_data_bitcoinonly, +) +from app.apps import router +from app.apps.router import router as app_router from app.auth.auth_bearer import JWTBearer from app.auth.auth_handler import ( handle_local_cookie, register_cookie_updater, remove_local_cookie, ) -from app.core_utils import SSE, broadcast_sse_msg, build_sse_event, sse_mgr -from app.external.fastapi_versioning import VersionedFastAPI -from app.models.api import ApiStartupStatus, StartupState -from app.models.lightning import LnInitState -from app.repositories.bitcoin import ( +from app.bitcoind.router import router as bitcoin_router +from app.bitcoind.service import ( initialize_bitcoin_repo, register_bitcoin_status_gatherer, register_bitcoin_zmq_sub, ) -from app.repositories.lightning import initialize_ln_repo, register_lightning_listener -from app.repositories.system import get_hardware_info, register_hardware_info_gatherer -from app.routers import apps, bitcoin, lightning, setup, system -from app.warmup import ( - get_bitcoin_client_warmup_data, - get_full_client_warmup_data, - get_full_client_warmup_data_bitcoinonly, -) +from app.external.fastapi_versioning import VersionedFastAPI +from app.lightning.models import LnInitState +from app.lightning.router import router as ln_router +from app.lightning.service import initialize_ln_repo, register_lightning_listener +from app.setup.router import router as setup_router +from app.system.router import router as system_router +from app.system.service import get_hardware_info, register_hardware_info_gatherer logging.basicConfig(level=logging.WARNING) @@ -52,13 +57,13 @@ class AppSettings(RedisSettings): unversioned_app = FastAPI() config = get_config() -unversioned_app.include_router(apps.router) -unversioned_app.include_router(bitcoin.router) +unversioned_app.include_router(app_router) +unversioned_app.include_router(bitcoin_router) if node_type != "none": - unversioned_app.include_router(lightning.router) -unversioned_app.include_router(system.router) -if setup.router is not None: - unversioned_app.include_router(setup.router) + unversioned_app.include_router(ln_router) +unversioned_app.include_router(system_router) +if setup_router is not None: + unversioned_app.include_router(setup_router) app = VersionedFastAPI( diff --git a/app/models/lightning_docs.py b/app/models/lightning_docs.py deleted file mode 100644 index 4b7dc51..0000000 --- a/app/models/lightning_docs.py +++ /dev/null @@ -1,64 +0,0 @@ -tx_id_desc = """ -Unique identifier for this transaction. - -Depending on the type of the transaction it will be different: -#### On-chain -The transaction hash - -#### Lightning Invoice and Payment -The payment request -""" - -tx_amount_desc = """ -The value of the transaction, depending on the category in satoshis or millisatoshis. - -#### On-chain -Transaction amount in satoshis - -#### Lightning Invoice -* value in millisatoshis of the invoice if *unsettled* -* amount in millisatoshis paid if invoice is *settled* - -#### Lightning Payment -* amount sent in millisatoshis - -""" - -tx_status_desc = """ -The status of the transaction. Depending on the transaction category this can be different values: - -May have different meanings in different situations: -#### unknown -An unknown state was found. - -#### in_flight -* A lightning payment is being sent -* An invoice is waiting for the incoming payment -* An on-chain transaction is waiting in the mempool - -#### succeeded -* A lighting payment was successfully sent -* An incoming payment was received for an invoice -* An on-chain transaction was included in a block - -#### failed -* A lightning payment attempt which could not be completed (no route found, insufficient funds, ...) -* An invoice is expired or some other error happened -""" - -tx_time_stamp_desc = """ -The unix timestamp in seconds for the transaction. - -The timestamp can mean different things in different situations: - -#### Lightning Invoice -* Creation date for in-flight or failed invoices -* Settle date for succeeded invoices - -#### On-chain -* Creation date for transaction waiting in the mempool -* Timestamp of the block where this transaction is included - -#### Lightning Payment - -""" diff --git a/app/repositories/hardware_impl/hardware_base.py b/app/repositories/hardware_impl/hardware_base.py deleted file mode 100644 index e8dd95c..0000000 --- a/app/repositories/hardware_impl/hardware_base.py +++ /dev/null @@ -1,11 +0,0 @@ -from abc import abstractmethod - - -class HardwareBase: - @abstractmethod - async def get_hardware_info(self) -> map: - raise NotImplementedError() - - @abstractmethod - def get_hardware_info_yield_time(self) -> float: - raise NotImplementedError() diff --git a/app/repositories/hardware_impl/raspiblitz.py b/app/repositories/hardware_impl/raspiblitz.py deleted file mode 100644 index 38e9612..0000000 --- a/app/repositories/hardware_impl/raspiblitz.py +++ /dev/null @@ -1,73 +0,0 @@ -import time - -from app.core_utils import redis_get -from app.repositories.hardware_impl.hardware_base import HardwareBase - -_HW_INFO_YIELD_TIME = 2 - - -class RaspiBlitzHardware(HardwareBase): - async def get_hardware_info(self) -> map: - info = {} - - loads = (await redis_get("system_cpu_load")).split(",") - iloads = [] - total = 0 - for l in loads: - value = float(l) - total += value - iloads.append(value) - info["cpu_overall_percent"] = round(total / len(loads), 2) - info["cpu_per_cpu_percent"] = iloads - - info["vram_total_bytes"] = int(await redis_get("system_ram_mb")) * 1000 * 1000 - - info["vram_available_bytes"] = ( - int(await redis_get("system_ram_available_mb")) * 1000 * 1000 - ) - - info["vram_used_bytes"] = ( - info["vram_total_bytes"] - info["vram_available_bytes"] - ) - info["vram_usage_percent"] = round( - (100 / info["vram_total_bytes"]) * info["vram_used_bytes"], 2 - ) - - info["temperatures_celsius"] = { - "system_temp": float(await redis_get("system_temp_celsius")), - "coretemp": [], - } - - now = time.time() - boot = float(await redis_get("system_up")) - info["boot_time_timestamp"] = now - boot - - info["networks"] = { - "internet_online": await redis_get("internet_online"), - "tor_web_addr": await redis_get("tor_web_addr"), - "internet_localip": await redis_get("internet_localip"), - "internet_localiprange": await redis_get("internet_localiprange"), - } - - # the following is just available when setup is done - setup_phase = await redis_get("setupPhase") - info["disks"] = [] - if setup_phase == "done": - total = int(await redis_get("hdd_capacity_bytes")) - free = int(await redis_get("hdd_free_bytes")) - info["disks"] = [ - { - "device": "/", - "mountpoint": "/", - "filesystem_type": "ext4", - "partition_total_bytes": total, - "partition_used_bytes": total - free, - "partition_free_bytes": free, - "partition_percent": round((100 / total) * free, 2), - } - ] - - return info - - def get_hardware_info_yield_time(self) -> float: - return _HW_INFO_YIELD_TIME diff --git a/app/repositories/setup.py b/app/repositories/setup.py deleted file mode 100644 index a1a84cb..0000000 --- a/app/repositories/setup.py +++ /dev/null @@ -1,9 +0,0 @@ -from decouple import config - -from app.models.system import APIPlatform - -router = None - -_PLATFORM = config("platform", default=APIPlatform.RASPIBLITZ) -if _PLATFORM == APIPlatform.RASPIBLITZ: - from app.repositories.setup_impl.raspiblitz.router import router diff --git a/app/repositories/setup_impl/README.md b/app/repositories/setup_impl/README.md deleted file mode 100644 index 5bf06ba..0000000 --- a/app/repositories/setup_impl/README.md +++ /dev/null @@ -1,2 +0,0 @@ -### Setup -Since the setup is not highly specific to the underlying platform, we don't provide an abstraction to it like in the other parts of the framework. Instead, the platform should provide a router that is simply attached to the main router in `main.py` by the API. diff --git a/app/repositories/system_impl/native_python.py b/app/repositories/system_impl/native_python.py deleted file mode 100644 index fbc2c24..0000000 --- a/app/repositories/system_impl/native_python.py +++ /dev/null @@ -1,70 +0,0 @@ -import logging -import secrets -from typing import Dict - -from decouple import config -from fastapi import HTTPException, status - -from app.auth.auth_handler import sign_jwt -from app.constants import API_VERSION -from app.models.system import ( - APIPlatform, - ConnectionInfo, - LoginInput, - RawDebugLogData, - SystemInfo, -) -from app.repositories.lightning import get_ln_info -from app.repositories.system_impl.system_base import SystemBase - - -class NativePythonSystem(SystemBase): - async def get_system_info(self) -> SystemInfo: - lninfo = await get_ln_info() - - version = config("np_version", default="") - - tor_api = config("np_tor_address_api_endpoint", default="") - tor_api_docs = config("np_tor_address_api_docs", default="") - - lan_api = config("np_local_address_api_endpoint", default="") - lan_api_docs = config("np_local_address_api_docs", default="") - - ssh_address = config("np_ssh_address", default="") - - return SystemInfo( - alias=lninfo.alias, - color=lninfo.color, - platform=APIPlatform.NATIVE_PYTHON, - platform_version=version, - api_version=API_VERSION, - tor_web_ui=tor_api_docs, - tor_api=tor_api, - lan_web_ui=lan_api_docs, - lan_api=lan_api, - ssh_address=ssh_address, - chain=lninfo.chains[0].network, - ) - - async def shutdown(self, reboot: bool) -> bool: - logging.info("Shutdown / reboot not supported in native_python mode.") - return False - - async def get_connection_info(self) -> ConnectionInfo: - # return an empty connection info object for now - return ConnectionInfo() - - async def login(self, i: LoginInput) -> Dict[str, str]: - matches = secrets.compare_digest(i.password, config("login_password", cast=str)) - if matches: - return sign_jwt() - - raise HTTPException( - status.HTTP_401_UNAUTHORIZED, detail="Password is incorrect" - ) - - async def change_password(self, type: str, old_password: str, new_password: str): - raise NotImplementedError() - - async def get_debug_logs_raw(self) -> RawDebugLogData: - raise NotImplementedError() diff --git a/app/routers/setup.py b/app/routers/setup.py deleted file mode 100644 index 65ffaa7..0000000 --- a/app/routers/setup.py +++ /dev/null @@ -1 +0,0 @@ -from app.repositories.setup import router diff --git a/app/routers/wallet.py b/app/routers/wallet.py deleted file mode 100644 index e69de29..0000000 diff --git a/app/setup/README.md b/app/setup/README.md new file mode 100644 index 0000000..7fbaf4b --- /dev/null +++ b/app/setup/README.md @@ -0,0 +1,2 @@ +### Setup +Since the setup is not highly specific to the underlying platform, we don't provide an abstraction to it like in the other parts of the framework. Instead, the platform implementation itself should provide a router that is simply attached to the main router in `main.py` by the API. diff --git a/app/repositories/ln_impl/__init__.py b/app/setup/__init__.py similarity index 100% rename from app/repositories/ln_impl/__init__.py rename to app/setup/__init__.py diff --git a/app/repositories/utils/__init__.py b/app/setup/impl/__init__.py similarity index 100% rename from app/repositories/utils/__init__.py rename to app/setup/impl/__init__.py diff --git a/app/setup/impl/raspiblitz/README.md b/app/setup/impl/raspiblitz/README.md new file mode 100644 index 0000000..35aab28 --- /dev/null +++ b/app/setup/impl/raspiblitz/README.md @@ -0,0 +1,3 @@ +# TODO + +Split router into `router.py` and `service.py` (or something like that) diff --git a/app/repositories/setup_impl/raspiblitz/router.py b/app/setup/impl/raspiblitz/router.py similarity index 98% rename from app/repositories/setup_impl/raspiblitz/router.py rename to app/setup/impl/raspiblitz/router.py index d92e799..08ec9c9 100644 --- a/app/repositories/setup_impl/raspiblitz/router.py +++ b/app/setup/impl/raspiblitz/router.py @@ -4,11 +4,11 @@ from fastapi import APIRouter, HTTPException, status from fastapi.params import Depends from pydantic import BaseModel +from app.api.utils import call_script, parse_key_value_lines, redis_get from app.auth.auth_bearer import JWTBearer from app.auth.auth_handler import sign_jwt -from app.core_utils import call_script, parse_key_value_lines, redis_get -from app.repositories.system_impl.raspiblitz import RaspiBlitzSystem -from app.repositories.utils.raspiblitz import name_valid, password_valid +from app.system.impl.raspiblitz import RaspiBlitzSystem +from app.system.impl.raspiblitz_utils import name_valid, password_valid router = APIRouter(prefix="/setup", tags=["RaspiBlitz Setup"]) diff --git a/app/setup/router.py b/app/setup/router.py new file mode 100644 index 0000000..569c6dc --- /dev/null +++ b/app/setup/router.py @@ -0,0 +1,9 @@ +from decouple import config + +from app.system.models import APIPlatform + +router = None + +_PLATFORM = config("platform", default=APIPlatform.RASPIBLITZ) +if _PLATFORM != APIPlatform.RASPIBLITZ: + from app.setup.impl.raspiblitz.router import router diff --git a/app/routers/__init__.py b/app/system/__init__.py similarity index 100% rename from app/routers/__init__.py rename to app/system/__init__.py diff --git a/app/routers/system_docs.py b/app/system/docs.py similarity index 100% rename from app/routers/system_docs.py rename to app/system/docs.py diff --git a/app/repositories/system_impl/README.md b/app/system/impl/README.md similarity index 100% rename from app/repositories/system_impl/README.md rename to app/system/impl/README.md diff --git a/app/repositories/hardware_impl/native_python.py b/app/system/impl/native_python.py similarity index 55% rename from app/repositories/hardware_impl/native_python.py rename to app/system/impl/native_python.py index 2155630..5efec14 100644 --- a/app/repositories/hardware_impl/native_python.py +++ b/app/system/impl/native_python.py @@ -1,14 +1,79 @@ +import logging +import secrets +from typing import Dict + import psutil from decouple import config +from fastapi import HTTPException, status -from app.repositories.hardware_impl.hardware_base import HardwareBase +from app.api.constants import API_VERSION +from app.auth.auth_handler import sign_jwt +from app.lightning.service import get_ln_info +from app.system.impl.system_base import SystemBase +from app.system.models import ( + APIPlatform, + ConnectionInfo, + LoginInput, + RawDebugLogData, + SystemInfo, +) _SLEEP_TIME = config("gather_hw_info_interval", default=2, cast=float) _CPU_AVG_PERIOD = config("cpu_usage_averaging_period", default=0.5, cast=float) _HW_INFO_YIELD_TIME = _SLEEP_TIME + _CPU_AVG_PERIOD -class NativePythonHardware(HardwareBase): +class NativePythonSystem(SystemBase): + async def get_system_info(self) -> SystemInfo: + lninfo = await get_ln_info() + + version = config("np_version", default="") + + tor_api = config("np_tor_address_api_endpoint", default="") + tor_api_docs = config("np_tor_address_api_docs", default="") + + lan_api = config("np_local_address_api_endpoint", default="") + lan_api_docs = config("np_local_address_api_docs", default="") + + ssh_address = config("np_ssh_address", default="") + + return SystemInfo( + alias=lninfo.alias, + color=lninfo.color, + platform=APIPlatform.NATIVE_PYTHON, + platform_version=version, + api_version=API_VERSION, + tor_web_ui=tor_api_docs, + tor_api=tor_api, + lan_web_ui=lan_api_docs, + lan_api=lan_api, + ssh_address=ssh_address, + chain=lninfo.chains[0].network, + ) + + async def shutdown(self, reboot: bool) -> bool: + logging.info("Shutdown / reboot not supported in native_python mode.") + return False + + async def get_connection_info(self) -> ConnectionInfo: + # return an empty connection info object for now + return ConnectionInfo() + + async def login(self, i: LoginInput) -> Dict[str, str]: + matches = secrets.compare_digest(i.password, config("login_password", cast=str)) + if matches: + return sign_jwt() + + raise HTTPException( + status.HTTP_401_UNAUTHORIZED, detail="Password is incorrect" + ) + + async def change_password(self, type: str, old_password: str, new_password: str): + raise NotImplementedError() + + async def get_debug_logs_raw(self) -> RawDebugLogData: + raise NotImplementedError() + async def get_hardware_info(self) -> map: info = {} diff --git a/app/repositories/system_impl/raspiblitz.py b/app/system/impl/raspiblitz.py similarity index 80% rename from app/repositories/system_impl/raspiblitz.py rename to app/system/impl/raspiblitz.py index 24f24c6..0cebc33 100644 --- a/app/repositories/system_impl/raspiblitz.py +++ b/app/system/impl/raspiblitz.py @@ -1,14 +1,14 @@ import asyncio import logging import os +import time from typing import Dict from decouple import config from fastapi import HTTPException, status -from app.auth.auth_handler import sign_jwt -from app.constants import API_VERSION -from app.core_utils import ( +from app.api.constants import API_VERSION +from app.api.utils import ( SSE, broadcast_sse_msg, call_script, @@ -16,16 +16,19 @@ from app.core_utils import ( parse_key_value_text, redis_get, ) -from app.models.system import ( +from app.auth.auth_handler import sign_jwt +from app.lightning.service import get_ln_info +from app.system.impl.raspiblitz_utils import password_valid +from app.system.impl.system_base import SystemBase +from app.system.models import ( APIPlatform, ConnectionInfo, LoginInput, RawDebugLogData, SystemInfo, ) -from app.repositories.lightning import get_ln_info -from app.repositories.system_impl.system_base import SystemBase -from app.repositories.utils.raspiblitz import password_valid + +_HW_INFO_YIELD_TIME = 2 SHELL_SCRIPT_PATH = config("shell_script_path") GET_DEBUG_LOG_SCRIPT = os.path.join( @@ -288,3 +291,68 @@ class RaspiBlitzSystem(SystemBase): status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=f"{cmd} returned no error and no output.", ) + + async def get_hardware_info(self) -> map: + info = {} + + loads = (await redis_get("system_cpu_load")).split(",") + iloads = [] + total = 0 + for l in loads: + value = float(l) + total += value + iloads.append(value) + info["cpu_overall_percent"] = round(total / len(loads), 2) + info["cpu_per_cpu_percent"] = iloads + + info["vram_total_bytes"] = int(await redis_get("system_ram_mb")) * 1000 * 1000 + + info["vram_available_bytes"] = ( + int(await redis_get("system_ram_available_mb")) * 1000 * 1000 + ) + + info["vram_used_bytes"] = ( + info["vram_total_bytes"] - info["vram_available_bytes"] + ) + info["vram_usage_percent"] = round( + (100 / info["vram_total_bytes"]) * info["vram_used_bytes"], 2 + ) + + info["temperatures_celsius"] = { + "system_temp": float(await redis_get("system_temp_celsius")), + "coretemp": [], + } + + now = time.time() + boot = float(await redis_get("system_up")) + info["boot_time_timestamp"] = now - boot + + info["networks"] = { + "internet_online": await redis_get("internet_online"), + "tor_web_addr": await redis_get("tor_web_addr"), + "internet_localip": await redis_get("internet_localip"), + "internet_localiprange": await redis_get("internet_localiprange"), + } + + # the following is just available when setup is done + setup_phase = await redis_get("setupPhase") + info["disks"] = [] + if setup_phase == "done": + total = int(await redis_get("hdd_capacity_bytes")) + free = int(await redis_get("hdd_free_bytes")) + info["disks"] = [ + { + "device": "/", + "mountpoint": "/", + "filesystem_type": "ext4", + "partition_total_bytes": total, + "partition_used_bytes": total - free, + "partition_free_bytes": free, + "partition_percent": round((100 / total) * free, 2), + } + ] + + return info + + def get_hardware_info_yield_time(self) -> float: + return _HW_INFO_YIELD_TIME diff --git a/app/repositories/utils/raspiblitz.py b/app/system/impl/raspiblitz_utils.py similarity index 52% rename from app/repositories/utils/raspiblitz.py rename to app/system/impl/raspiblitz_utils.py index b472485..0e8fda8 100644 --- a/app/repositories/utils/raspiblitz.py +++ b/app/system/impl/raspiblitz_utils.py @@ -1,20 +1,5 @@ import re -from decouple import config - -SHELL_SCRIPT_PATH = config("shell_script_path") - -available_app_ids = { - "btc-rpc-explorer", - "rtl", - # Specter is deactivated for now because it uses its own self signed HTTPS cert that makes trouble in Chrome on last test - # "specter", - "btcpayserver", - "lnbits", - "mempool", - "thunderhub", -} - def password_valid(password: str): if len(password) < 8: diff --git a/app/repositories/system_impl/system_base.py b/app/system/impl/system_base.py similarity index 74% rename from app/repositories/system_impl/system_base.py rename to app/system/impl/system_base.py index df5db15..6684025 100644 --- a/app/repositories/system_impl/system_base.py +++ b/app/system/impl/system_base.py @@ -1,7 +1,7 @@ from abc import abstractmethod from typing import Dict -from app.models.system import ConnectionInfo, LoginInput, RawDebugLogData, SystemInfo +from app.system.models import ConnectionInfo, LoginInput, RawDebugLogData, SystemInfo class SystemBase: @@ -28,3 +28,11 @@ class SystemBase: @abstractmethod async def get_debug_logs_raw(self) -> RawDebugLogData: raise NotImplementedError() + + @abstractmethod + async def get_hardware_info(self) -> map: + raise NotImplementedError() + + @abstractmethod + def get_hardware_info_yield_time(self) -> float: + raise NotImplementedError() diff --git a/app/models/system.py b/app/system/models.py similarity index 98% rename from app/models/system.py rename to app/system/models.py index 9134fbe..8773617 100644 --- a/app/models/system.py +++ b/app/system/models.py @@ -7,7 +7,7 @@ from fastapi.param_functions import Query from pydantic import BaseModel from pydantic.types import constr -from app.routers.system_docs import get_debug_data_sample_str +from app.system.docs import get_debug_data_sample_str class LoginInput(BaseModel): diff --git a/app/routers/system.py b/app/system/router.py similarity index 96% rename from app/routers/system.py rename to app/system/router.py index 78c0a4c..8bd9018 100644 --- a/app/routers/system.py +++ b/app/system/router.py @@ -3,12 +3,18 @@ from typing import Optional from fastapi import APIRouter, HTTPException, Request, status from fastapi.params import Depends, Query +from app.api.utils import SSE from app.auth.auth_bearer import JWTBearer from app.auth.auth_handler import sign_jwt -from app.core_utils import SSE from app.external.sse_starlette import EventSourceResponse -from app.models.system import ConnectionInfo, LoginInput, RawDebugLogData, SystemInfo -from app.repositories.system import ( +from app.system.docs import ( + get_debug_logs_raw_desc, + get_debug_logs_raw_resp_desc, + get_debug_logs_raw_summary, + get_hw_info_json, +) +from app.system.models import ConnectionInfo, LoginInput, RawDebugLogData, SystemInfo +from app.system.service import ( HW_INFO_YIELD_TIME, change_password, get_connection_info, @@ -19,12 +25,6 @@ from app.repositories.system import ( shutdown, subscribe_hardware_info, ) -from app.routers.system_docs import ( - get_debug_logs_raw_desc, - get_debug_logs_raw_resp_desc, - get_debug_logs_raw_summary, - get_hw_info_json, -) _PREFIX = "system" diff --git a/app/repositories/system.py b/app/system/service.py similarity index 85% rename from app/repositories/system.py rename to app/system/service.py index 1222536..a70d011 100644 --- a/app/repositories/system.py +++ b/app/system/service.py @@ -4,8 +4,8 @@ from typing import Dict, Optional from decouple import config from fastapi import HTTPException, Request, status -from app.core_utils import SSE, broadcast_sse_msg -from app.models.system import ( +from app.api.utils import SSE, broadcast_sse_msg +from app.system.models import ( APIPlatform, ConnectionInfo, LoginInput, @@ -15,20 +15,17 @@ from app.models.system import ( PLATFORM = config("platform", default=APIPlatform.RASPIBLITZ) if PLATFORM == APIPlatform.RASPIBLITZ: - from .hardware_impl.raspiblitz import RaspiBlitzHardware as Hardware - from .system_impl.raspiblitz import RaspiBlitzSystem as System + from app.system.impl.raspiblitz import RaspiBlitzSystem as System elif PLATFORM == APIPlatform.NATIVE_PYTHON: - from .hardware_impl.native_python import NativePythonHardware as Hardware - from .system_impl.native_python import NativePythonSystem as System + from app.system.impl.native_python import NativePythonSystem as System system = System() -hw = Hardware() -if hw is None or system is None: +if system is None: raise RuntimeError(f"Unknown platform {PLATFORM}") -HW_INFO_YIELD_TIME = hw.get_hardware_info_yield_time() +HW_INFO_YIELD_TIME = system.get_hardware_info_yield_time() async def change_password(type: Optional[str], old_password: str, new_password: str): @@ -51,7 +48,7 @@ async def get_system_info() -> SystemInfo: async def get_hardware_info() -> map: try: - return await hw.get_hardware_info() + return await system.get_hardware_info() except HTTPException as r: raise except NotImplementedError as r: diff --git a/tests/models/test_bitcoind.py b/tests/models/test_bitcoind.py index 8bc2a9b..09b5d52 100644 --- a/tests/models/test_bitcoind.py +++ b/tests/models/test_bitcoind.py @@ -1,4 +1,4 @@ -from app.models.bitcoind import * +from app.bitcoind.models import * blockhain_info = { "chain": "main", diff --git a/tests/repositories/system_impl/test_native_python.py b/tests/repositories/system_impl/test_native_python.py index e30361f..2819f37 100644 --- a/tests/repositories/system_impl/test_native_python.py +++ b/tests/repositories/system_impl/test_native_python.py @@ -2,7 +2,7 @@ import pytest from pydantic import AnyStrMinLengthError, ValidationError import app.repositories.system_impl.native_python as npy -from app.models.system import LoginInput +from app.system.models import LoginInput @pytest.mark.asyncio diff --git a/tests/repositories/test_system.py b/tests/repositories/test_system.py index 4d248f6..a2c7007 100644 --- a/tests/repositories/test_system.py +++ b/tests/repositories/test_system.py @@ -1,8 +1,8 @@ import pytest from fastapi import HTTPException, status -import app.repositories.system as sys -from app.models.system import LoginInput +import app.system.service as sys +from app.system.models import LoginInput @pytest.mark.asyncio