From d93b1997357ae3da602a281e43e570fa2bdd2996 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 11:35:11 +0300 Subject: [PATCH 001/421] fix: pass `charge` param as JSON --- .../satspay/templates/satspay/display.html | 16 +++++++++------- lnbits/extensions/satspay/views.py | 5 +++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index 8c577fbed..680e5fbe1 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -226,6 +226,7 @@ mixins: [windowMixin], data() { return { + charge: JSON.parse('{{charge | tojson}}'), newProgress: 0.4, counter: 1, newTimeLeft: '', @@ -246,7 +247,7 @@ startPaymentNotifier() { this.cancelListener() - this.cancelListener = LNbits.event.onInvoicePaid( + this.cancelListener = LNbits.events.onInvoicePaid( this.wallet, payment => { this.checkBalance() @@ -258,7 +259,7 @@ LNbits.api .request( 'GET', - '/satspay/api/v1/charges/balance/{{ charge.id }}', + `/satspay/api/v1/charges/balance/${this.charge.id}`, 'filla' ) .then(function (response) { @@ -316,12 +317,13 @@ } }, created: function () { - console.log('{{ charge.onchainaddress }}' == 'None') - if ('{{ charge.lnbitswallet }}' == 'None') { - this.lnbtc = false - this.onbtc = true - } + console.log('### charge ', this.charge) + this.lnbtc = !!this.charge.lnbitswallet + this.onbtc = !!this.charge.onchainwallet + + // empty for onchain this.wallet.inkey = '{{ wallet_inkey }}' + this.getTheTime() this.getThePercentage() var timerCount = this.timerCount diff --git a/lnbits/extensions/satspay/views.py b/lnbits/extensions/satspay/views.py index d33d5c17e..67dfe1a09 100644 --- a/lnbits/extensions/satspay/views.py +++ b/lnbits/extensions/satspay/views.py @@ -24,14 +24,15 @@ async def index(request: Request, user: User = Depends(check_user_exists)): @satspay_ext.get("/{charge_id}", response_class=HTMLResponse) -async def display(request: Request, charge_id): +async def display(request: Request, charge_id: str): charge = await get_charge(charge_id) if not charge: raise HTTPException( status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist." ) wallet = await get_wallet(charge.lnbitswallet) + inkey = wallet.inkey if wallet else None return satspay_renderer().TemplateResponse( "satspay/display.html", - {"request": request, "charge": charge, "wallet_key": wallet.inkey}, + {"request": request, "charge": charge.dict(), "wallet_inkey": inkey}, ) From 5a005e830cfe21b09a24363b8bcb05a909f9d03f Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 12:55:34 +0300 Subject: [PATCH 002/421] chore: add a todo --- lnbits/extensions/satspay/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnbits/extensions/satspay/models.py b/lnbits/extensions/satspay/models.py index 7e8080dc9..b0a3a064b 100644 --- a/lnbits/extensions/satspay/models.py +++ b/lnbits/extensions/satspay/models.py @@ -40,6 +40,10 @@ class Charges(BaseModel): @property def time_elapsed(self): + # todo: + # now = datetime.utcnow().timestamp() + # start = datetime.utcfromtimestamp(self.timestamp) + # expiration = (start + timedelta(minutes=self.time)).timestamp() if (self.timestamp + (self.time * 60)) >= time.time(): return False else: From 6cfa8e30bc7c4cb722a03423490945aaa7b1fdc7 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 16:16:29 +0300 Subject: [PATCH 003/421] refactor: replace promises with async/await --- .../satspay/templates/satspay/index.html | 124 ++++++++---------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 551b81b8e..7b1ce4927 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -246,7 +246,7 @@ filled dense emit-value - v-model="formDialogCharge.data.onchainwallet" + v-model="onchainwallet" :options="walletLinks" label="Onchain Wallet" /> @@ -401,6 +401,7 @@ show: false, data: { onchain: false, + onchainwallet: '', lnbits: false, description: '', time: null, @@ -426,24 +427,21 @@ self.formDialogCharge.show = false }, - getWalletLinks: function () { - var self = this - - LNbits.api - .request( + getWalletLinks: async function () { + try { + const {data} = await LNbits.api.request( 'GET', '/watchonly/api/v1/wallet', this.g.user.wallets[0].inkey ) - .then(function (response) { - for (i = 0; i < response.data.length; i++) { - self.walletLinks.push(response.data[i].id) - } - return - }) - .catch(function (error) { - LNbits.utils.notifyApiError(error) - }) + this.walletLinks = data.map(w => ({ + id: w.id, + label: w.title + })) + + } catch (error) { + LNbits.utils.notifyApiError(error) + } }, closeFormDialog: function () { this.formDialog.data = { @@ -457,22 +455,17 @@ self.current = linkId self.Addresses.show = true }, - getCharges: function () { - var self = this - var getAddressBalance = this.getAddressBalance - - LNbits.api - .request( + getCharges: async function () { + try { + const {data} = await LNbits.api.request( 'GET', '/satspay/api/v1/charges', this.g.user.wallets[0].inkey ) - .then(function (response) { - self.ChargeLinks = response.data.map(mapCharge) - }) - .catch(function (error) { - LNbits.utils.notifyApiError(error) - }) + this.ChargeLinks = data.map(mapCharge) + } catch (error) { + LNbits.utils.notifyApiError(error) + } }, sendFormDataCharge: function () { var self = this @@ -480,6 +473,7 @@ var data = this.formDialogCharge.data data.amount = parseInt(data.amount) data.time = parseInt(data.time) + data.onchainwallet = this.onchainwallet?.id this.createCharge(wallet, data) }, timerCount: function () { @@ -487,40 +481,40 @@ var refreshIntervalId = setInterval(function () { for (i = 0; i < self.ChargeLinks.length - 1; i++) { if (self.ChargeLinks[i]['paid'] == 'True') { - setTimeout(function () { - LNbits.api - .request( - 'GET', - '/satspay/api/v1/charges/balance/' + - self.ChargeLinks[i]['id'], - 'filla' - ) - .then(function (response) {}) + setTimeout(async function () { + await LNbits.api.request( + 'GET', + '/satspay/api/v1/charges/balance/' + + self.ChargeLinks[i]['id'], + 'filla' + ) }, 2000) } } self.getCharges() }, 20000) }, - createCharge: function (wallet, data) { - var self = this + createCharge: async function (wallet, data) { + try { + const resp = await LNbits.api.request( + 'POST', + '/satspay/api/v1/charge', + wallet, + data + ) - LNbits.api - .request('POST', '/satspay/api/v1/charge', wallet, data) - .then(function (response) { - self.ChargeLinks.push(mapCharge(response.data)) - self.formDialogCharge.show = false - self.formDialogCharge.data = { - onchain: false, - lnbits: false, - description: '', - time: null, - amount: null - } - }) - .catch(function (error) { - LNbits.utils.notifyApiError(error) - }) + this.ChargeLinks.push(mapCharge(resp.data)) + this.formDialogCharge.show = false + this.formDialogCharge.data = { + onchain: false, + lnbits: false, + description: '', + time: null, + amount: null + } + } catch (error) { + LNbits.utils.notifyApiError(error) + } }, deleteChargeLink: function (chargeId) { @@ -528,26 +522,24 @@ var link = _.findWhere(this.ChargeLinks, {id: chargeId}) LNbits.utils .confirmDialog('Are you sure you want to delete this pay link?') - .onOk(function () { - LNbits.api - .request( + .onOk(async function () { + try { + const response = await LNbits.api.request( 'DELETE', '/satspay/api/v1/charge/' + chargeId, self.g.user.wallets[0].adminkey ) - .then(function (response) { - self.ChargeLinks = _.reject(self.ChargeLinks, function (obj) { - return obj.id === chargeId - }) - }) - .catch(function (error) { - LNbits.utils.notifyApiError(error) + + self.ChargeLinks = _.reject(self.ChargeLinks, function (obj) { + return obj.id === chargeId }) + } catch (error) { + LNbits.utils.notifyApiError(error) + } }) }, exportchargeCSV: function () { - var self = this - LNbits.utils.exportCSV(self.ChargesTable.columns, this.ChargeLinks) + LNbits.utils.exportCSV(this.ChargesTable.columns, this.ChargeLinks) } }, created: function () { From 50b2dcfcaac793a370d52883286c6fe276747578 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 16:19:33 +0300 Subject: [PATCH 004/421] refactor: clean-up unnecessary `self` --- .../satspay/templates/satspay/index.html | 46 ++++++++----------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 7b1ce4927..b050b95e1 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -416,15 +416,14 @@ }, methods: { cancelCharge: function (data) { - var self = this - self.formDialogCharge.data.description = '' - self.formDialogCharge.data.onchainwallet = '' - self.formDialogCharge.data.lnbitswallet = '' - self.formDialogCharge.data.time = null - self.formDialogCharge.data.amount = null - self.formDialogCharge.data.webhook = '' - self.formDialogCharge.data.completelink = '' - self.formDialogCharge.show = false + this.formDialogCharge.data.description = '' + this.formDialogCharge.data.onchainwallet = '' + this.formDialogCharge.data.lnbitswallet = '' + this.formDialogCharge.data.time = null + this.formDialogCharge.data.amount = null + this.formDialogCharge.data.webhook = '' + this.formDialogCharge.data.completelink = '' + this.formDialogCharge.show = false }, getWalletLinks: async function () { @@ -449,11 +448,10 @@ } }, openQrCodeDialog: function (linkId) { - var self = this var getAddresses = this.getAddresses getAddresses(linkId) - self.current = linkId - self.Addresses.show = true + this.current = linkId + this.Addresses.show = true }, getCharges: async function () { try { @@ -468,30 +466,28 @@ } }, sendFormDataCharge: function () { - var self = this - var wallet = this.g.user.wallets[0].inkey - var data = this.formDialogCharge.data + const wallet = this.g.user.wallets[0].inkey + const data = this.formDialogCharge.data data.amount = parseInt(data.amount) data.time = parseInt(data.time) data.onchainwallet = this.onchainwallet?.id this.createCharge(wallet, data) }, timerCount: function () { - self = this - var refreshIntervalId = setInterval(function () { - for (i = 0; i < self.ChargeLinks.length - 1; i++) { - if (self.ChargeLinks[i]['paid'] == 'True') { + var refreshIntervalId = setInterval( () => { + for (i = 0; i < this.ChargeLinks.length - 1; i++) { + if (this.ChargeLinks[i]['paid'] == 'True') { setTimeout(async function () { await LNbits.api.request( 'GET', '/satspay/api/v1/charges/balance/' + - self.ChargeLinks[i]['id'], + this.ChargeLinks[i]['id'], 'filla' ) }, 2000) } } - self.getCharges() + this.getCharges() }, 20000) }, createCharge: async function (wallet, data) { @@ -518,19 +514,18 @@ }, deleteChargeLink: function (chargeId) { - var self = this var link = _.findWhere(this.ChargeLinks, {id: chargeId}) LNbits.utils .confirmDialog('Are you sure you want to delete this pay link?') - .onOk(async function () { + .onOk(async () => { try { const response = await LNbits.api.request( 'DELETE', '/satspay/api/v1/charge/' + chargeId, - self.g.user.wallets[0].adminkey + this.g.user.wallets[0].adminkey ) - self.ChargeLinks = _.reject(self.ChargeLinks, function (obj) { + this.ChargeLinks = _.reject(this.ChargeLinks, function (obj) { return obj.id === chargeId }) } catch (error) { @@ -544,7 +539,6 @@ }, created: function () { console.log(this.g.user) - var self = this var getCharges = this.getCharges getCharges() var getWalletLinks = this.getWalletLinks From 8e05a11978a3e9883a98b33c17f9758a44c1bdc6 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 16:39:23 +0300 Subject: [PATCH 005/421] refactor: replace `var` with `const` --- .../satspay/templates/satspay/index.html | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index b050b95e1..343a163a4 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -287,7 +287,7 @@ From b5e97f08a6e79c9ac65f08e544e9e14b32ec51ce Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 6 Jul 2022 16:45:03 +0300 Subject: [PATCH 006/421] chore: code clean-up --- .../satspay/templates/satspay/index.html | 49 ++++++------------- 1 file changed, 14 insertions(+), 35 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 343a163a4..0d212109b 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -38,10 +38,10 @@ @@ -330,6 +436,12 @@ label: 'Balance', field: 'balance' }, + { + name: 'pendingBalance', + align: 'left', + label: 'Pending Balance', + field: 'pendingBalance' + }, { name: 'onchain address', align: 'left', @@ -394,7 +506,7 @@ ) this.walletLinks = data.map(w => ({ id: w.id, - label: w.title + label: w.title + ' - ' + w.id })) } catch (error) { LNbits.utils.notifyApiError(error) @@ -413,6 +525,16 @@ LNbits.utils.notifyApiError(error) } }, + getOnchainWalletName: function (walletId) { + const wallet = this.walletLinks.find(w => w.id === walletId) + if (!wallet) return 'unknown' + return wallet.label + }, + getLNbitsWalletName: function (walletId) { + const wallet = this.g.user.walletOptions.find(w => w.value === walletId) + if (!wallet) return 'unknown' + return wallet.label + }, getCharges: async function () { try { @@ -421,7 +543,13 @@ '/satspay/api/v1/charges', this.g.user.wallets[0].inkey ) - this.chargeLinks = data.map(mapCharge) + this.chargeLinks = data.map(c => + mapCharge( + c, + this.chargeLinks.find(old => old.id === c.id) + ) + ) + console.log('### this.chargeLinks', this.chargeLinks) } catch (error) { LNbits.utils.notifyApiError(error) } @@ -466,7 +594,7 @@ }) const utxos = await retryWithDelay(fn) - charge.balance = utxos.reduce((t, u) => t + u.value, 0) + charge.pendingBalance = utxos.reduce((t, u) => t + u.value, 0) } } catch (error) { console.error(error) From 4cb54ce549a2811f541be3769013cd73122afa50 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 8 Jul 2022 15:58:43 +0300 Subject: [PATCH 031/421] feat: allow refresh balance for individual charge - expired or paid charges are not auto-refreshed --- .../satspay/templates/satspay/index.html | 43 ++++++++++++++----- 1 file changed, 33 insertions(+), 10 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 7c0f36ce4..3c4418be3 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -208,16 +208,27 @@
- Details
+ Details + Refresh Balance +
Date: Fri, 8 Jul 2022 16:37:35 +0300 Subject: [PATCH 032/421] feat: use custom mempool_endpoint for the charge details --- lnbits/extensions/satspay/crud.py | 2 +- .../satspay/templates/satspay/display.html | 18 ++++++++++++++---- .../satspay/templates/satspay/index.html | 12 ++++++------ lnbits/extensions/satspay/views.py | 9 ++++++++- lnbits/extensions/satspay/views_api.py | 1 - 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/lnbits/extensions/satspay/crud.py b/lnbits/extensions/satspay/crud.py index 65f9e2281..be681dc21 100644 --- a/lnbits/extensions/satspay/crud.py +++ b/lnbits/extensions/satspay/crud.py @@ -6,7 +6,7 @@ from lnbits.core.services import create_invoice from lnbits.core.views.api import api_payment from lnbits.helpers import urlsafe_short_hash -from ..watchonly.crud import get_fresh_address, get_config, get_watch_wallet +from ..watchonly.crud import get_fresh_address, get_config # from lnbits.db import open_ext_db from . import db diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index b6d2019d9..94ff5e002 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -215,7 +215,15 @@ class="row items-center" >
- + +
@@ -294,6 +302,7 @@ data() { return { charge: JSON.parse('{{charge_data | tojson}}'), + mempool_endpoint: '{{mempool_endpoint}}', pendingFunds: 0, ws: null, newProgress: 0.4, @@ -339,7 +348,9 @@ checkPendingOnchain: async function () { const { bitcoin: {addresses: addressesAPI} - } = mempoolJS() + } = mempoolJS({ + hostname: new URL(this.mempool_endpoint).hostname + }) try { const utxos = await addressesAPI.getAddressTxsUtxo({ @@ -394,7 +405,7 @@ const { bitcoin: {websocket} } = mempoolJS({ - hostname: 'mempool.space' + hostname: new URL(this.mempool_endpoint).hostname }) this.ws = new WebSocket('wss://mempool.space/api/v1/ws') @@ -434,7 +445,6 @@ } }, created: async function () { - console.log('### charge', this.charge) if (this.charge.lnbitswallet) this.payInvoice() else this.payOnchain() await this.checkBalances() diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 3c4418be3..0e02285db 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -532,6 +532,8 @@ this.g.user.wallets[0].inkey ) this.mempool.endpoint = data.mempool_endpoint + const url = new URL(this.mempool.endpoint) + this.mempool.hostname = url.hostname } catch (error) { LNbits.utils.notifyApiError(error) } @@ -560,7 +562,6 @@ this.chargeLinks.find(old => old.id === c.id) ) ) - console.log('### this.chargeLinks', this.chargeLinks) } catch (error) { LNbits.utils.notifyApiError(error) } @@ -587,7 +588,7 @@ await this.getCharges() }, 20000) }, - refreshBalance: async function(charge) { + refreshBalance: async function (charge) { try { const {data} = await LNbits.api.request( 'GET', @@ -595,16 +596,15 @@ 'filla' ) charge.balance = data.balance - } catch (error) { - - } + } catch (error) {} }, rescanOnchainAddresses: async function () { if (this.rescanning) return this.rescanning = true + const { bitcoin: {addresses: addressesAPI} - } = mempoolJS() + } = mempoolJS({hostname: this.mempool.hostname}) try { const onchainActiveCharges = this.chargeLinks.filter( diff --git a/lnbits/extensions/satspay/views.py b/lnbits/extensions/satspay/views.py index d4fc457df..5b641510a 100644 --- a/lnbits/extensions/satspay/views.py +++ b/lnbits/extensions/satspay/views.py @@ -9,6 +9,7 @@ from starlette.responses import HTMLResponse from lnbits.core.crud import get_wallet from lnbits.core.models import User from lnbits.decorators import check_user_exists +from lnbits.extensions.watchonly.crud import get_config from . import satspay_ext, satspay_renderer from .crud import get_charge @@ -31,8 +32,14 @@ async def display(request: Request, charge_id: str): status_code=HTTPStatus.NOT_FOUND, detail="Charge link does not exist." ) wallet = await get_wallet(charge.lnbitswallet) + onchainwallet_config = await get_config(charge.user) inkey = wallet.inkey if wallet else None return satspay_renderer().TemplateResponse( "satspay/display.html", - {"request": request, "charge_data": charge.dict(), "wallet_inkey": inkey}, + { + "request": request, + "charge_data": charge.dict(), + "wallet_inkey": inkey, + "mempool_endpoint": onchainwallet_config.mempool_endpoint, + }, ) diff --git a/lnbits/extensions/satspay/views_api.py b/lnbits/extensions/satspay/views_api.py index 5aaf04f13..43593cb39 100644 --- a/lnbits/extensions/satspay/views_api.py +++ b/lnbits/extensions/satspay/views_api.py @@ -1,7 +1,6 @@ from http import HTTPStatus import httpx -from fastapi import Query from fastapi.params import Depends from starlette.exceptions import HTTPException From 86f7ea64c4dd5e801b82fda9a966a552fb6de473 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 10:22:12 +0300 Subject: [PATCH 033/421] fix: use the config mempool.space endpoint --- lnbits/extensions/watchonly/static/js/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 5eee21761..31644f185 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -647,7 +647,7 @@ new Vue({ getAddressTxsDelayed: async function (addrData) { const { bitcoin: {addresses: addressesAPI} - } = mempoolJS() + } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) const fn = async () => addressesAPI.getAddressTxs({ @@ -660,7 +660,7 @@ new Vue({ refreshRecommendedFees: async function () { const { bitcoin: {fees: feesAPI} - } = mempoolJS() + } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) const fn = async () => feesAPI.getFeesRecommended() this.payment.recommededFees = await retryWithDelay(fn) @@ -668,7 +668,7 @@ new Vue({ getAddressTxsUtxoDelayed: async function (address) { const { bitcoin: {addresses: addressesAPI} - } = mempoolJS() + } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) const fn = async () => addressesAPI.getAddressTxsUtxo({ @@ -679,7 +679,7 @@ new Vue({ fetchTxHex: async function (txId) { const { bitcoin: {transactions: transactionsAPI} - } = mempoolJS() + } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) try { const response = await transactionsAPI.getTxHex({txid: txId}) From e960285c8f694f9191183acbfb4007f659259af4 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 10:35:27 +0300 Subject: [PATCH 034/421] chore: code format --- lnbits/extensions/watchonly/static/js/index.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 31644f185..f44d30cd1 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -647,7 +647,9 @@ new Vue({ getAddressTxsDelayed: async function (addrData) { const { bitcoin: {addresses: addressesAPI} - } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) + } = mempoolJS({ + hostname: new URL(this.config.data.mempool_endpoint).hostname + }) const fn = async () => addressesAPI.getAddressTxs({ @@ -660,7 +662,9 @@ new Vue({ refreshRecommendedFees: async function () { const { bitcoin: {fees: feesAPI} - } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) + } = mempoolJS({ + hostname: new URL(this.config.data.mempool_endpoint).hostname + }) const fn = async () => feesAPI.getFeesRecommended() this.payment.recommededFees = await retryWithDelay(fn) @@ -668,7 +672,9 @@ new Vue({ getAddressTxsUtxoDelayed: async function (address) { const { bitcoin: {addresses: addressesAPI} - } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) + } = mempoolJS({ + hostname: new URL(this.config.data.mempool_endpoint).hostname + }) const fn = async () => addressesAPI.getAddressTxsUtxo({ @@ -679,7 +685,9 @@ new Vue({ fetchTxHex: async function (txId) { const { bitcoin: {transactions: transactionsAPI} - } = mempoolJS({hostname: new URL(this.config.data.mempool_endpoint).hostname}) + } = mempoolJS({ + hostname: new URL(this.config.data.mempool_endpoint).hostname + }) try { const response = await transactionsAPI.getTxHex({txid: txId}) From 31b6a9410c3ed078373abae349897b11929dc2cb Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 10:36:03 +0300 Subject: [PATCH 035/421] refactor: move setInterval outside method logic --- .../satspay/templates/satspay/index.html | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 0e02285db..1879925fd 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -574,19 +574,17 @@ data.onchainwallet = this.onchainwallet?.id this.createCharge(wallet, data) }, - timerCount: function () { - setInterval(async () => { - const activeLinkIds = this.chargeLinks - .filter(c => !c.paid && !c.time_elapsed) - .map(c => c.id) - .join(',') - await LNbits.api.request( - 'GET', - '/satspay/api/v1/charges/balance/' + activeLinkIds, - 'filla' - ) - await this.getCharges() - }, 20000) + refreshActiveChargesBalance: async function () { + const activeLinkIds = this.chargeLinks + .filter(c => !c.paid && !c.time_elapsed) + .map(c => c.id) + .join(',') + await LNbits.api.request( + 'GET', + '/satspay/api/v1/charges/balance/' + activeLinkIds, + 'filla' + ) + await this.getCharges() }, refreshBalance: async function (charge) { try { @@ -617,7 +615,9 @@ }) const utxos = await retryWithDelay(fn) - charge.pendingBalance = utxos.reduce((t, u) => t + u.value, 0) + charge.pendingBalance = utxos + .filter(u => !u.status.confirmed) + .reduce((t, u) => t + u.value, 0) } } catch (error) { console.error(error) @@ -669,14 +669,18 @@ }) }, exportchargeCSV: function () { - LNbits.utils.exportCSV(this.chargesTable.columns, this.chargeLinks) + LNbits.utils.exportCSV( + this.chargesTable.columns, + this.chargeLinks, + 'charges' + ) } }, created: async function () { await this.getCharges() await this.getWalletLinks() await this.getWalletConfig() - this.timerCount() + setInterval(() => this.refreshActiveChargesBalance(), 10 * 2000) await this.rescanOnchainAddresses() setInterval(() => this.rescanOnchainAddresses(), 10 * 1000) } From 057de41678af1c35869ac6521f9816d2e4d34ab8 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 11:13:26 +0300 Subject: [PATCH 036/421] feat: only refresh balance on the back-end if new funds are detected by the front-end refresh --- .../satspay/templates/satspay/display.html | 11 +++++++++++ .../extensions/satspay/templates/satspay/index.html | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index 94ff5e002..a60bce17d 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -329,6 +329,9 @@ ) }, checkBalances: async function () { + console.log('### checkBalances 1', this.charge.hasStaleBalance) + if (!this.charge.hasStaleBalance) return + console.log('### checkBalances 2') try { const {data} = await LNbits.api.request( 'GET', @@ -356,10 +359,18 @@ const utxos = await addressesAPI.getAddressTxsUtxo({ address: this.charge.onchainaddress }) + const newBalance = utxos.reduce((t, u) => t + u.value, 0) + this.charge.hasStaleBalance = this.charge.balance === newBalance this.pendingFunds = utxos .filter(u => !u.status.confirmed) .reduce((t, u) => t + u.value, 0) + + console.log( + '### charge new funds', + this.charge.balance === newBalance, + this.charge + ) } catch (error) { console.error('cannot check pending funds') } diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 1879925fd..c007b44ac 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -576,9 +576,10 @@ }, refreshActiveChargesBalance: async function () { const activeLinkIds = this.chargeLinks - .filter(c => !c.paid && !c.time_elapsed) + .filter(c => !c.paid && !c.time_elapsed && !c.hasStaleBalance) .map(c => c.id) .join(',') + console.log('### activeLinkIds', activeLinkIds) await LNbits.api.request( 'GET', '/satspay/api/v1/charges/balance/' + activeLinkIds, @@ -615,9 +616,18 @@ }) const utxos = await retryWithDelay(fn) + const newBalance = utxos.reduce((t, u) => t + u.value, 0) + charge.pendingBalance = utxos .filter(u => !u.status.confirmed) .reduce((t, u) => t + u.value, 0) + + charge.hasStaleBalance = charge.balance === newBalance + console.log( + '### charge new funds', + charge.balance === newBalance, + charge + ) } } catch (error) { console.error(error) From 25f37b0e4fc4181b654cf863fba7a809bf17f69d Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 11:26:43 +0300 Subject: [PATCH 037/421] chore: code clean-up --- lnbits/extensions/satspay/templates/satspay/display.html | 8 -------- lnbits/extensions/satspay/templates/satspay/index.html | 6 ------ 2 files changed, 14 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index a60bce17d..58f6b51c4 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -329,9 +329,7 @@ ) }, checkBalances: async function () { - console.log('### checkBalances 1', this.charge.hasStaleBalance) if (!this.charge.hasStaleBalance) return - console.log('### checkBalances 2') try { const {data} = await LNbits.api.request( 'GET', @@ -365,12 +363,6 @@ this.pendingFunds = utxos .filter(u => !u.status.confirmed) .reduce((t, u) => t + u.value, 0) - - console.log( - '### charge new funds', - this.charge.balance === newBalance, - this.charge - ) } catch (error) { console.error('cannot check pending funds') } diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index c007b44ac..abef0291b 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -579,7 +579,6 @@ .filter(c => !c.paid && !c.time_elapsed && !c.hasStaleBalance) .map(c => c.id) .join(',') - console.log('### activeLinkIds', activeLinkIds) await LNbits.api.request( 'GET', '/satspay/api/v1/charges/balance/' + activeLinkIds, @@ -623,11 +622,6 @@ .reduce((t, u) => t + u.value, 0) charge.hasStaleBalance = charge.balance === newBalance - console.log( - '### charge new funds', - charge.balance === newBalance, - charge - ) } } catch (error) { console.error(error) From e4078504bac93f8e1e88eb7fb1f38ef1a03f2640 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:03:19 +0300 Subject: [PATCH 038/421] fix: do not update charge if balance has not changed --- lnbits/extensions/satspay/crud.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/satspay/crud.py b/lnbits/extensions/satspay/crud.py index be681dc21..dfc5c47af 100644 --- a/lnbits/extensions/satspay/crud.py +++ b/lnbits/extensions/satspay/crud.py @@ -111,7 +111,7 @@ async def check_address_balance(charge_id: str) -> List[Charges]: + charge.onchainaddress ) respAmount = r.json()["chain_stats"]["funded_txo_sum"] - if respAmount >= charge.balance: + if respAmount > charge.balance: await update_charge(charge_id=charge_id, balance=respAmount) except Exception: pass From d79d4e371e78a3bba372326b744ef7fe91c9cd6c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:03:48 +0300 Subject: [PATCH 039/421] feat: use `datetime` to compute `time_left` and `time_elapsed` --- lnbits/extensions/satspay/models.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lnbits/extensions/satspay/models.py b/lnbits/extensions/satspay/models.py index b0a3a064b..325ce817e 100644 --- a/lnbits/extensions/satspay/models.py +++ b/lnbits/extensions/satspay/models.py @@ -1,4 +1,4 @@ -import time +from datetime import datetime, timedelta from sqlite3 import Row from typing import Optional @@ -38,16 +38,17 @@ class Charges(BaseModel): def from_row(cls, row: Row) -> "Charges": return cls(**dict(row)) + @property + def time_left(self): + now = datetime.utcnow().timestamp() + start = datetime.fromtimestamp(self.timestamp) + expiration = (start + timedelta(minutes=self.time)).timestamp() + return (expiration - now) / 60 + @property def time_elapsed(self): - # todo: - # now = datetime.utcnow().timestamp() - # start = datetime.utcfromtimestamp(self.timestamp) - # expiration = (start + timedelta(minutes=self.time)).timestamp() - if (self.timestamp + (self.time * 60)) >= time.time(): - return False - else: - return True + return self.time_left < 0 + @property def paid(self): From 8c6b31ec123c247abacd6d4b0fa96f7631b7489c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:05:12 +0300 Subject: [PATCH 040/421] feat: `mapCharge` now computes fields `progress`, `timeLeft` and fixes `time` --- lnbits/extensions/satspay/static/js/utils.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lnbits/extensions/satspay/static/js/utils.js b/lnbits/extensions/satspay/static/js/utils.js index 535615af5..5f686755f 100644 --- a/lnbits/extensions/satspay/static/js/utils.js +++ b/lnbits/extensions/satspay/static/js/utils.js @@ -15,20 +15,20 @@ const retryWithDelay = async function (fn, retryCount = 0) { const mapCharge = (obj, oldObj = {}) => { obj._data = _.clone(obj) - obj.theTime = obj.time * 60 - (Date.now() / 1000 - obj.timestamp) - obj.time = obj.time + ' min' - if (obj.time_elapsed) { - obj.date = '' - } else { - obj.date = Quasar.utils.date.formatDate( - new Date((obj.theTime - 3600) * 1000), - 'HH:mm:ss' - ) - } + obj.progress = obj.time_left < 0 ? 1 : 1 - obj.time_left / obj.time + obj.time = minutesToShortTime(obj.time) + obj.timeLeft = minutesToTime(obj.time_left) + obj.expanded = false obj.displayUrl = ['/satspay/', obj.id].join('') obj.expanded = oldObj.expanded obj.pendingBalance = oldObj.pendingBalance || 0 return obj } + +const minutesToTime = min => + min > 0 ? new Date(min * 1000).toISOString().substring(11, 19) : '' + +const minutesToShortTime = min => + min > 0 ? new Date(min * 1000).toISOString().substring(14, 22) : '' From 0f204485c37115534539a73e193916ac39382af1 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:05:45 +0300 Subject: [PATCH 041/421] feat: return `time_elapsed`, `time_left` and `paid` fields --- lnbits/extensions/satspay/views_api.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lnbits/extensions/satspay/views_api.py b/lnbits/extensions/satspay/views_api.py index 43593cb39..f94b970af 100644 --- a/lnbits/extensions/satspay/views_api.py +++ b/lnbits/extensions/satspay/views_api.py @@ -30,7 +30,12 @@ async def api_charge_create( data: CreateCharge, wallet: WalletTypeInfo = Depends(require_invoice_key) ): charge = await create_charge(user=wallet.wallet.user, data=data) - return charge.dict() + return { + **charge.dict(), + **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, + **{"paid": charge.paid}, + } @satspay_ext.put("/api/v1/charge/{charge_id}") @@ -50,6 +55,7 @@ async def api_charges_retrieve(wallet: WalletTypeInfo = Depends(get_key_type)): { **charge.dict(), **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, **{"paid": charge.paid}, } for charge in await get_charges(wallet.wallet.user) @@ -72,6 +78,7 @@ async def api_charge_retrieve( return { **charge.dict(), **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, **{"paid": charge.paid}, } @@ -133,4 +140,9 @@ async def api_charge_balance(charge_id): ) except AssertionError: charge.webhook = None - return charge.dict() + return { + **charge.dict(), + **{"time_elapsed": charge.time_elapsed}, + **{"time_left": charge.time_left}, + **{"paid": charge.paid}, + } From 46a7b54a00a40c878383c36e6611f8577e23008e Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:06:33 +0300 Subject: [PATCH 042/421] fix: fix progress for charges --- .../satspay/templates/satspay/display.html | 63 ++++++++----------- .../satspay/templates/satspay/index.html | 15 +++-- 2 files changed, 36 insertions(+), 42 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html index 58f6b51c4..02bec9303 100644 --- a/lnbits/extensions/satspay/templates/satspay/display.html +++ b/lnbits/extensions/satspay/templates/satspay/display.html @@ -13,7 +13,7 @@
Time elapsed
@@ -25,14 +25,18 @@ Charge paid
- + Awaiting payment... - {% raw %} {{ newTimeLeft }} {% endraw %} @@ -155,7 +159,7 @@
-
+
-
+
-
+
= this.charge.amount) { - this.charge.paid = true - } + this.charge = mapCharge(data, this.charge) + } catch (error) { + LNbits.utils.notifyApiError(error) + } + }, + refreshCharge: async function () { + try { + const {data} = await LNbits.api.request( + 'GET', + `/satspay/api/v1/charge/${this.charge.id}` + ) + this.charge = mapCharge(data, this.charge) + console.log('### ', this.charge) } catch (error) { LNbits.utils.notifyApiError(error) } @@ -375,28 +380,13 @@ this.lnbtc = false this.onbtc = true }, - refreshExpirationTime: function () { - this.timetoComplete = - parseInt(this.charge.time) * 60 - - (Date.now() / 1000 - parseInt(this.charge.timestamp)) - this.newTimeLeft = Quasar.utils.date.formatDate( - new Date((this.timeToComplete - 3600) * 1000), - 'HH:mm:ss' - ) - }, - refreshProgres: function () { - this.refreshExpirationTime() - this.newProgress = - 1 - this.timeToComplete / (parseInt(this.charge.time) * 60) - }, loopRefresh: function () { // invoice only const refreshIntervalId = setInterval(async () => { - if (this.charge.paid || this.timetoComplete < 1) { + if (this.charge.paid || !this.charge.timeLeft) { clearInterval(refreshIntervalId) } - this.refreshProgres() if (this.counter % 10 === 0) { await this.checkBalances() await this.checkPendingOnchain() @@ -456,7 +446,6 @@ this.wallet.inkey = '{{ wallet_inkey }}' this.startPaymentNotifier() - this.refreshProgres() if (!this.charge.paid) { this.loopRefresh() } diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index abef0291b..7158453ff 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -125,8 +125,13 @@ >{{props.row.description}} - -
{{props.row.date}}
+ +
{{props.row.timeLeft}}
+ +
{{props.row.time}}
@@ -424,10 +429,10 @@ field: 'description' }, { - name: 'timeleft', + name: 'timeLeft', align: 'left', label: 'Time left', - field: 'date' + field: 'timeLeft' }, { name: 'time to pay', @@ -638,7 +643,7 @@ data ) - this.chargeLinks.push(mapCharge(resp.data)) + this.chargeLinks.unshift(mapCharge(resp.data)) this.formDialogCharge.show = false this.formDialogCharge.data = { onchain: false, From c419afc1b12b7a9658913bfcb1f5ca4450e24e26 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:14:51 +0300 Subject: [PATCH 043/421] refactor: code clean-up --- lnbits/extensions/satspay/static/js/utils.js | 24 +++++++++----------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/lnbits/extensions/satspay/static/js/utils.js b/lnbits/extensions/satspay/static/js/utils.js index 5f686755f..9015803df 100644 --- a/lnbits/extensions/satspay/static/js/utils.js +++ b/lnbits/extensions/satspay/static/js/utils.js @@ -14,21 +14,19 @@ const retryWithDelay = async function (fn, retryCount = 0) { } const mapCharge = (obj, oldObj = {}) => { - obj._data = _.clone(obj) + const charge = _.clone(obj) - obj.progress = obj.time_left < 0 ? 1 : 1 - obj.time_left / obj.time - obj.time = minutesToShortTime(obj.time) - obj.timeLeft = minutesToTime(obj.time_left) + charge.progress = obj.time_left < 0 ? 1 : 1 - obj.time_left / obj.time + charge.time = minutesToTime(obj.time) + charge.timeLeft = minutesToTime(obj.time_left) - obj.expanded = false - obj.displayUrl = ['/satspay/', obj.id].join('') - obj.expanded = oldObj.expanded - obj.pendingBalance = oldObj.pendingBalance || 0 - return obj + charge.expanded = false + charge.displayUrl = ['/satspay/', obj.id].join('') + charge.expanded = oldObj.expanded + charge.pendingBalance = oldObj.pendingBalance || 0 + console.log('### charge', charge) + return charge } const minutesToTime = min => - min > 0 ? new Date(min * 1000).toISOString().substring(11, 19) : '' - -const minutesToShortTime = min => - min > 0 ? new Date(min * 1000).toISOString().substring(14, 22) : '' + min > 0 ? new Date(min * 1000).toISOString().substring(14, 19) : '' From 739c108bdf5b36821e42070bf004c84f5418c20b Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 11 Jul 2022 15:15:12 +0300 Subject: [PATCH 044/421] feat: add `(hh:mm)` to time columns --- lnbits/extensions/satspay/templates/satspay/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html index 7158453ff..3108324e7 100644 --- a/lnbits/extensions/satspay/templates/satspay/index.html +++ b/lnbits/extensions/satspay/templates/satspay/index.html @@ -58,10 +58,10 @@
-
+
+
+
+ + The payed amount is higher than the selected amount! + +
+
+ @@ -993,6 +1007,7 @@
+
- - The payed amount is higher than the selected amount! - + + + + + + + Serial Port + Send the PSBT using an USB port + + + + + + + + + + Animated QR Code + Comming Soon + + + +
Date: Tue, 12 Jul 2022 17:34:40 +0300 Subject: [PATCH 095/421] feat: add basic communication via the serial port --- .../extensions/watchonly/static/js/index.js | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 70c3ae165..c7938f568 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -501,7 +501,43 @@ new Vue({ } }, sharePsbtOnSerialPort: async function () { - console.log('### sharePsbtOnSerialPort') + console.log('### sharePsbtOnSerialPort', navigator.serial, navigator) + if (!navigator.serial) { + this.$q.notify({ + type: 'warning', + message: 'Serial port communication not supported!', + caption: + 'Make sure your browser supports Serial Port and that you are using HTTPS.', + timeout: 10000 + }) + return + } + navigator.serial.addEventListener('connect', event => { + console.log('### navigator.serial event: connected!', event) + }) + + navigator.serial.addEventListener('disconnect', event => { + console.log('### navigator.serial event: disconnected!', event) + }) + // const ports = await navigator.serial.getPorts(); + const port = await navigator.serial.requestPort() + console.log('### port', port) + + // Wait for the serial port to open. + await port.open({baudRate: 9600}) + + const writer = port.writable.getWriter() + + const psbtByteArray = Uint8Array.from(atob(this.payment.psbtBase64), c => + c.charCodeAt(0) + ) + await writer.write(psbtByteArray) + + // Allow the serial port to be closed later. + writer.releaseLock() + + await port.close() + console.log('### sharePsbtOnSerialPort done') }, sharePsbtWithAnimatedQRCode: async function () { console.log('### sharePsbtWithAnimatedQRCode') From ae68c4dc6e3c57bb3ad2338760c4445efea8a70c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 13 Jul 2022 12:45:38 +0300 Subject: [PATCH 096/421] chore: code format --- .../extensions/watchonly/static/js/index.js | 39 ++++++++++++------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index c7938f568..afde985c6 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -519,25 +519,36 @@ new Vue({ navigator.serial.addEventListener('disconnect', event => { console.log('### navigator.serial event: disconnected!', event) }) - // const ports = await navigator.serial.getPorts(); - const port = await navigator.serial.requestPort() - console.log('### port', port) + try { + // const ports = await navigator.serial.getPorts(); + const port = await navigator.serial.requestPort() + console.log('### port', port) - // Wait for the serial port to open. - await port.open({baudRate: 9600}) + // Wait for the serial port to open. + await port.open({baudRate: 9600}) - const writer = port.writable.getWriter() + const writer = port.writable.getWriter() - const psbtByteArray = Uint8Array.from(atob(this.payment.psbtBase64), c => - c.charCodeAt(0) - ) - await writer.write(psbtByteArray) + const psbtByteArray = Uint8Array.from( + atob(this.payment.psbtBase64), + c => c.charCodeAt(0) + ) + await writer.write(psbtByteArray) - // Allow the serial port to be closed later. - writer.releaseLock() + // Allow the serial port to be closed later. + writer.releaseLock() - await port.close() - console.log('### sharePsbtOnSerialPort done') + await port.close() + console.log('### sharePsbtOnSerialPort done') + } catch (error) { + console.log('### error', error) + this.$q.notify({ + type: 'warning', + message: 'Serial port communication failed!', + caption: `${error}`, + timeout: 10000 + }) + } }, sharePsbtWithAnimatedQRCode: async function () { console.log('### sharePsbtWithAnimatedQRCode') From 75944741897f010891f4edc933a8f0147c171598 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 13 Jul 2022 17:22:45 +0300 Subject: [PATCH 097/421] feat: send data to and from serial port --- .../extensions/watchonly/static/js/index.js | 136 ++++++++++++++---- .../extensions/watchonly/static/js/tables.js | 13 ++ .../watchonly/templates/watchonly/index.html | 114 ++++++++------- 3 files changed, 184 insertions(+), 79 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index afde985c6..1e1b597dc 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -33,6 +33,16 @@ new Vue({ show: false }, + serial: { + selectedPort: null, + writableStreamClosed: null, + writer: null, + readableStreamClosed: null, + reader: null, + showAdvancedConfig: false, + config: {} + }, + formDialog: { show: false, data: {} @@ -500,8 +510,7 @@ new Vue({ LNbits.utils.notifyApiError(err) } }, - sharePsbtOnSerialPort: async function () { - console.log('### sharePsbtOnSerialPort', navigator.serial, navigator) + checkSerialPortSupported: function () { if (!navigator.serial) { this.$q.notify({ type: 'warning', @@ -510,46 +519,119 @@ new Vue({ 'Make sure your browser supports Serial Port and that you are using HTTPS.', timeout: 10000 }) - return + return false } - navigator.serial.addEventListener('connect', event => { - console.log('### navigator.serial event: connected!', event) - }) - - navigator.serial.addEventListener('disconnect', event => { - console.log('### navigator.serial event: disconnected!', event) - }) + return true + }, + openSerialPort: async function () { + if (!this.checkSerialPortSupported()) return + console.log('### openSerialPort', this.serial.selectedPort) try { - // const ports = await navigator.serial.getPorts(); - const port = await navigator.serial.requestPort() - console.log('### port', port) + navigator.serial.addEventListener('connect', event => { + console.log('### navigator.serial event: connected!', event) + }) + navigator.serial.addEventListener('disconnect', event => { + console.log('### navigator.serial event: disconnected!', event) + }) + this.serial.selectedPort = await navigator.serial.requestPort() // Wait for the serial port to open. - await port.open({baudRate: 9600}) + await this.serial.selectedPort.open({baudRate: 9600}) + this.startSerialPortReading() - const writer = port.writable.getWriter() - - const psbtByteArray = Uint8Array.from( - atob(this.payment.psbtBase64), - c => c.charCodeAt(0) + const textEncoder = new TextEncoderStream() + this.serial.writableStreamClosed = textEncoder.readable.pipeTo( + this.serial.selectedPort.writable ) - await writer.write(psbtByteArray) - // Allow the serial port to be closed later. - writer.releaseLock() - - await port.close() - console.log('### sharePsbtOnSerialPort done') + this.serial.writer = textEncoder.writable.getWriter() } catch (error) { - console.log('### error', error) this.$q.notify({ type: 'warning', - message: 'Serial port communication failed!', + message: 'Cannot open serial port!', caption: `${error}`, timeout: 10000 }) } }, + closeSerialPort: async function () { + try { + console.log('### closeSerialPort', this.serial.selectedPort) + if (this.serial.writer) this.serial.writer.close() + if (this.serial.writableStreamClosed) + await this.serial.writableStreamClosed + if (this.serial.reader) this.reader.writer.close() + if (this.serial.readableStreamClosed) + await this.serial.readableStreamClosed + if (this.serial.selectedPort) await this.serial.selectedPort.close() + this.serial.selectedPort = null + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot close serial port!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + sendPsbtToSerialPort: async function () { + try { + await this.serial.writer.write(this.payment.psbtBase64 + '\n') + this.$q.notify({ + type: 'positive', + message: 'Data sent to serial port!', + timeout: 5000 + }) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send data to serial port!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + + startSerialPortReading: async function () { + const port = this.serial.selectedPort + + while (port && port.readable) { + const textDecoder = new TextDecoderStream() + this.serial.readableStreamClosed = port.readable.pipeTo( + textDecoder.writable + ) + this.serial.reader = textDecoder.readable.getReader() + + try { + while (true) { + console.log('### reader.read()') + const {value, done} = await this.serial.reader.read() + if (value) { + console.log(value) + this.$q.notify({ + type: 'warning', + message: 'Received data from serial port (not psbt)', + caption: value.slice(0, 80) + '...', + timeout: 5000 + }) + } + if (done) { + this.serial.reader.close() + this.serial.readereadableStreamClosed() + return + } + } + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Serial port communication error!', + caption: `${error}`, + timeout: 10000 + }) + } + } + console.log('### startSerialPortReading DONE') + }, sharePsbtWithAnimatedQRCode: async function () { console.log('### sharePsbtWithAnimatedQRCode') }, diff --git a/lnbits/extensions/watchonly/static/js/tables.js b/lnbits/extensions/watchonly/static/js/tables.js index fdd558bde..26182912d 100644 --- a/lnbits/extensions/watchonly/static/js/tables.js +++ b/lnbits/extensions/watchonly/static/js/tables.js @@ -260,6 +260,7 @@ const tableData = { fee: 0, txSize: 0, psbtBase64: '', + psbtBase64Signed: '', utxoSelectionModes: [ 'Manual', 'Random', @@ -268,6 +269,18 @@ const tableData = { 'Larger Inputs First' ], utxoSelectionMode: 'Manual', + signModes: [ + { + label: 'Serial Port', + value: 'serial-port' + }, + { + label: 'Animated QR', + value: 'animated-qr', + disable: true + } + ], + signMode: '', show: false, showAdvanced: false }, diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 16ebdabbd..f140494a1 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -1009,72 +1009,82 @@
-
+
Create PSBT
-
- + - - - - - - - Serial Port - Send the PSBT using an USB port - - - - - - - - - - Animated QR Code - Comming Soon - - - - + v-model="payment.psbtBase64" + filled + readonly + />
-
+
Sign With
+
+ +
+
+ +
+
+
+ Connect + Disconnect +
+
+ Send PSBT +
+
+ +
+
+
+
+
From 3bf0bb1e63dbe6177dc585e0e263119ae1661e24 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 13 Jul 2022 17:56:12 +0300 Subject: [PATCH 098/421] fix: port disconnect --- lnbits/extensions/watchonly/static/js/index.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 1e1b597dc..b3d692999 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -560,12 +560,20 @@ new Vue({ if (this.serial.writer) this.serial.writer.close() if (this.serial.writableStreamClosed) await this.serial.writableStreamClosed - if (this.serial.reader) this.reader.writer.close() + if (this.serial.reader) this.serial.reader.cancel() if (this.serial.readableStreamClosed) - await this.serial.readableStreamClosed + await this.serial.readableStreamClosed.catch(() => { + /* Ignore the error */ + }) if (this.serial.selectedPort) await this.serial.selectedPort.close() this.serial.selectedPort = null + this.$q.notify({ + type: 'positive', + message: 'Serial port disconnected!', + timeout: 5000 + }) } catch (error) { + console.log('### error', error) this.$q.notify({ type: 'warning', message: 'Cannot close serial port!', @@ -616,8 +624,6 @@ new Vue({ }) } if (done) { - this.serial.reader.close() - this.serial.readereadableStreamClosed() return } } From 73adc4a7e825cef033a26554755487726fdadc34 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 14 Jul 2022 14:15:11 +0300 Subject: [PATCH 099/421] feat: handle psbt extract --- lnbits/extensions/watchonly/models.py | 12 ++- .../extensions/watchonly/static/js/index.js | 66 +++++++++++++-- .../extensions/watchonly/static/js/tables.js | 2 +- .../extensions/watchonly/static/js/utils.js | 2 + .../watchonly/templates/watchonly/index.html | 19 ++--- lnbits/extensions/watchonly/views_api.py | 80 ++++++++++++++++--- 6 files changed, 149 insertions(+), 32 deletions(-) diff --git a/lnbits/extensions/watchonly/models.py b/lnbits/extensions/watchonly/models.py index bc10e4210..d499c5044 100644 --- a/lnbits/extensions/watchonly/models.py +++ b/lnbits/extensions/watchonly/models.py @@ -1,6 +1,5 @@ from sqlite3 import Row -from typing import List - +from typing import List, Optional from fastapi.param_functions import Query from pydantic import BaseModel @@ -82,6 +81,15 @@ class CreatePsbt(BaseModel): tx_size: int +class ExtractPsbt(BaseModel): + psbtBase64 = "" + + +class SignedTransaction(BaseModel): + tx_hex: Optional[str] + tx_json: Optional[str] + + class Config(BaseModel): mempool_endpoint = "https://mempool.space" receive_gap_limit = 20 diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index b3d692999..d6b21f31f 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -587,7 +587,7 @@ new Vue({ await this.serial.writer.write(this.payment.psbtBase64 + '\n') this.$q.notify({ type: 'positive', - message: 'Data sent to serial port!', + message: 'Data sent to serial port device!', timeout: 5000 }) } catch (error) { @@ -609,19 +609,42 @@ new Vue({ textDecoder.writable ) this.serial.reader = textDecoder.readable.getReader() + let psbtChunks = [] try { while (true) { console.log('### reader.read()') const {value, done} = await this.serial.reader.read() + console.log('### value', value) if (value) { - console.log(value) - this.$q.notify({ - type: 'warning', - message: 'Received data from serial port (not psbt)', - caption: value.slice(0, 80) + '...', - timeout: 5000 - }) + const data = value.split('\n') + console.log('### xxx', data) + const isPsbtStartChunk = data[0].startsWith(PSBT_BASE64_PREFIX) + if (isPsbtStartChunk) { + psbtChunks = [data[0]] + } else if (psbtChunks.length) { + psbtChunks.push(data[0]) + if (data.length > 1) { + console.log('### psbtChunks', psbtChunks) + this.$q.notify({ + type: 'positive', + message: 'PSBT received from serial port device!', + timeout: 10000 + }) + const transaction = await this.etractTxFromPsbt( + psbtChunks.join('') + ) + console.log('### transaction', transaction) + } + } else { + psbtChunks = [] + this.$q.notify({ + type: 'warning', + message: 'Received data from serial port (not psbt)', + caption: value.slice(0, 80) + '...', + timeout: 5000 + }) + } } if (done) { return @@ -638,6 +661,33 @@ new Vue({ } console.log('### startSerialPortReading DONE') }, + etractTxFromPsbt: async function (psbtBase64) { + const wallet = this.g.user.wallets[0] + try { + const {data} = await LNbits.api.request( + 'PUT', + '/watchonly/api/v1/psbt/extract', + wallet.adminkey, + { + psbtBase64 + } + ) + console.log('### data', data) + if (data.error) { + this.$q.notify({ + type: 'warning', + message: 'Cannot process received PSBT!', + caption: data.error, + timeout: 10000 + }) + } + + return data + } catch (error) { + console.log('### error', error, JSON.stringify(error)) + LNbits.utils.notifyApiError(error) + } + }, sharePsbtWithAnimatedQRCode: async function () { console.log('### sharePsbtWithAnimatedQRCode') }, diff --git a/lnbits/extensions/watchonly/static/js/tables.js b/lnbits/extensions/watchonly/static/js/tables.js index 26182912d..49597bd2a 100644 --- a/lnbits/extensions/watchonly/static/js/tables.js +++ b/lnbits/extensions/watchonly/static/js/tables.js @@ -271,7 +271,7 @@ const tableData = { utxoSelectionMode: 'Manual', signModes: [ { - label: 'Serial Port', + label: 'Serial Port Device', value: 'serial-port' }, { diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 26bebac66..3726d8679 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -1,3 +1,5 @@ +const PSBT_BASE64_PREFIX = 'cHNidP8' + const blockTimeToDate = blockTime => blockTime ? moment(blockTime * 1000).format('LLL') : '' diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index f140494a1..c5993d2af 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -1044,7 +1044,7 @@ class="row items-center no-wrap q-mb-md q-mt-lg" >
-
+
+ +
+
Send PSBTSend to Device
-
- -
diff --git a/lnbits/extensions/watchonly/views_api.py b/lnbits/extensions/watchonly/views_api.py index ae6565403..2c0970225 100644 --- a/lnbits/extensions/watchonly/views_api.py +++ b/lnbits/extensions/watchonly/views_api.py @@ -1,34 +1,40 @@ from http import HTTPStatus +import json -from embit import script -from embit.descriptor import Descriptor, Key -from embit.ec import PublicKey -from embit.psbt import PSBT, DerivationPath -from embit.transaction import Transaction, TransactionInput, TransactionOutput from fastapi import Query, Request from fastapi.params import Depends from starlette.exceptions import HTTPException +from embit.descriptor import Descriptor, Key +from embit.psbt import PSBT, DerivationPath +from embit.ec import PublicKey +from embit.transaction import Transaction, TransactionInput, TransactionOutput +from embit import script, finalizer + from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key from lnbits.extensions.watchonly import watchonly_ext from .crud import ( - create_config, - create_fresh_addresses, + create_mempool, create_watch_wallet, - delete_addresses_for_wallet, delete_watch_wallet, get_addresses, - get_config, get_fresh_address, + create_fresh_addresses, + update_address, + delete_addresses_for_wallet, + get_mempool, get_watch_wallet, get_watch_wallets, - update_address, - update_config, + update_mempool, update_watch_wallet, + create_config, + get_config, + update_config, ) +from .models import SignedTransaction, CreateWallet, CreatePsbt, Config, WalletAccount, ExtractPsbt from .helpers import parse_key -from .models import Config, CreatePsbt, CreateWallet, WalletAccount + ###################WALLETS############################# @@ -261,6 +267,36 @@ async def api_psbt_create( raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) +@watchonly_ext.put("/api/v1/psbt/extract") +async def api_psbt_extract_tx( + data: ExtractPsbt, w: WalletTypeInfo = Depends(require_admin_key) +): + res = SignedTransaction() + try: + psbt = PSBT.from_base64(data.psbtBase64) + final_psbt = finalizer.finalize_psbt(psbt) + if not final_psbt: + raise ValueError("PSBT cannot be finalized!") + res.tx_hex = final_psbt.to_string() + + transaction = Transaction.from_string(res.tx_hex) + tx = { + "locktime": transaction.locktime, + "version": transaction.version, + "outputs": [], + "fee": psbt.fee(), + } + + for out in transaction.vout: + tx["outputs"].append( + {"value": out.value, "address": out.script_pubkey.address()} + ) + res.tx_json = json.dumps(tx) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) + return res.dict() + + #############################CONFIG########################## @@ -278,3 +314,23 @@ async def api_get_config(w: WalletTypeInfo = Depends(get_key_type)): if not config: config = await create_config(user=w.wallet.user) return config.dict() + + +#############################MEMPOOL########################## + +### TODO: fix statspay dependcy and remove +@watchonly_ext.put("/api/v1/mempool") +async def api_update_mempool( + endpoint: str = Query(...), w: WalletTypeInfo = Depends(require_admin_key) +): + mempool = await update_mempool(**{"endpoint": endpoint}, user=w.wallet.user) + return mempool.dict() + + +### TODO: fix statspay dependcy and remove +@watchonly_ext.get("/api/v1/mempool") +async def api_get_mempool(w: WalletTypeInfo = Depends(require_admin_key)): + mempool = await get_mempool(w.wallet.user) + if not mempool: + mempool = await create_mempool(user=w.wallet.user) + return mempool.dict() From d80ae7de1b429f88ca05a0c094e5b05e5ec15c14 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 14 Jul 2022 17:37:36 +0300 Subject: [PATCH 100/421] feat: show signed transaction details --- .../extensions/watchonly/static/js/index.js | 18 ++----- .../extensions/watchonly/static/js/tables.js | 1 + .../watchonly/templates/watchonly/index.html | 52 +++++++++++++++---- lnbits/extensions/watchonly/views_api.py | 11 +++- 4 files changed, 57 insertions(+), 25 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index d6b21f31f..5448159e6 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -626,15 +626,16 @@ new Vue({ psbtChunks.push(data[0]) if (data.length > 1) { console.log('### psbtChunks', psbtChunks) + this.payment.psbtBase64Signed = psbtChunks.join('') this.$q.notify({ type: 'positive', message: 'PSBT received from serial port device!', timeout: 10000 }) - const transaction = await this.etractTxFromPsbt( - psbtChunks.join('') + const data = await this.etractTxFromPsbt( + this.payment.psbtBase64Signed ) - console.log('### transaction', transaction) + this.payment.signedTx = JSON.parse(data.tx_json) } } else { psbtChunks = [] @@ -672,19 +673,8 @@ new Vue({ psbtBase64 } ) - console.log('### data', data) - if (data.error) { - this.$q.notify({ - type: 'warning', - message: 'Cannot process received PSBT!', - caption: data.error, - timeout: 10000 - }) - } - return data } catch (error) { - console.log('### error', error, JSON.stringify(error)) LNbits.utils.notifyApiError(error) } }, diff --git a/lnbits/extensions/watchonly/static/js/tables.js b/lnbits/extensions/watchonly/static/js/tables.js index 49597bd2a..ffb095b39 100644 --- a/lnbits/extensions/watchonly/static/js/tables.js +++ b/lnbits/extensions/watchonly/static/js/tables.js @@ -261,6 +261,7 @@ const tableData = { txSize: 0, psbtBase64: '', psbtBase64Signed: '', + signedTx: null, utxoSelectionModes: [ 'Manual', 'Random', diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index c5993d2af..ef9fb1314 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -1043,13 +1043,14 @@ v-if="payment.psbtBase64 && payment.signMode === 'serial-port'" class="row items-center no-wrap q-mb-md q-mt-lg" > -
-
+ +
Connect Disconnect
-
+
@@ -1074,21 +1075,54 @@ @click="sendPsbtToSerialPort()" unelevated color="secondary float-right" - >Send to DeviceSend PSBT to Device
-
-
-
+
+
PSBT from device
+
+
+
+
+
+
Version
+
{{payment.signedTx.version}}
+
+
+
Locktime
+
{{payment.signedTx.locktime}}
+
+
+
Fee
+
+ {{satBtc(payment.signedTx.fee)}}
+
+
+
Send
+
+
+
{{satBtc(out.amount)}}
+
to
+
{{out.address}}
+
+
+
+
+
diff --git a/lnbits/extensions/watchonly/views_api.py b/lnbits/extensions/watchonly/views_api.py index 2c0970225..b5dd2c3c8 100644 --- a/lnbits/extensions/watchonly/views_api.py +++ b/lnbits/extensions/watchonly/views_api.py @@ -32,7 +32,14 @@ from .crud import ( get_config, update_config, ) -from .models import SignedTransaction, CreateWallet, CreatePsbt, Config, WalletAccount, ExtractPsbt +from .models import ( + SignedTransaction, + CreateWallet, + CreatePsbt, + Config, + WalletAccount, + ExtractPsbt, +) from .helpers import parse_key @@ -289,7 +296,7 @@ async def api_psbt_extract_tx( for out in transaction.vout: tx["outputs"].append( - {"value": out.value, "address": out.script_pubkey.address()} + {"amount": out.value, "address": out.script_pubkey.address()} ) res.tx_json = json.dumps(tx) except Exception as e: From 0e87e6608ffb0c91c68926a15c2825ef3f3cade3 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 14 Jul 2022 18:21:16 +0300 Subject: [PATCH 101/421] fix: handle Connect/Disconnect failure state --- lnbits/extensions/watchonly/static/js/index.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 5448159e6..19d375a18 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -546,6 +546,7 @@ new Vue({ this.serial.writer = textEncoder.writable.getWriter() } catch (error) { + this.serial.selectedPort = null this.$q.notify({ type: 'warning', message: 'Cannot open serial port!', @@ -573,6 +574,7 @@ new Vue({ timeout: 5000 }) } catch (error) { + this.serial.selectedPort = null console.log('### error', error) this.$q.notify({ type: 'warning', From 6098b8308ea7e19cf1fe420b276c8b4f0e2487f3 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 14 Jul 2022 18:47:52 +0300 Subject: [PATCH 102/421] feat:small UI improvements --- .../extensions/watchonly/static/js/index.js | 6 ++- .../watchonly/templates/watchonly/index.html | 47 +++++++++++-------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 19d375a18..bbfe2ad72 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -637,7 +637,11 @@ new Vue({ const data = await this.etractTxFromPsbt( this.payment.psbtBase64Signed ) - this.payment.signedTx = JSON.parse(data.tx_json) + if (data) { + this.payment.signedTx = JSON.parse(data.tx_json) + } else { + this.payment.signedTx = null + } } } else { psbtChunks = [] diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index ef9fb1314..fe7bd59eb 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -173,24 +173,29 @@
-
+
Scan Blockchain - +
-
+
+ +
+
Make Payment - {{payment.changeAmount ? payment.changeAmount: + {{payment.changeAmount ? satBtc(payment.changeAmount): 'no change'}} Connect Disconnect
@@ -1066,10 +1069,11 @@
-
+
{{satBtc(payment.signedTx.fee)}}
-
-
Send
+ +
+
{{satBtc(out.amount)}}
+
-
-
{{satBtc(out.amount)}}
-
to
-
{{out.address}}
-
-
+ {{out.address}}
+
@@ -1298,7 +1300,12 @@
{% endblock %} {% block scripts %} {{ window_vars(user) }} - + From 367faf437a3d8e6fe530104f337692e6553f7d75 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 15 Jul 2022 09:02:50 +0300 Subject: [PATCH 103/421] feat: broadcast transaction (partial solution) --- lnbits/extensions/watchonly/models.py | 6 +- .../extensions/watchonly/static/js/index.js | 23 +++++++ .../extensions/watchonly/static/js/tables.js | 2 + .../watchonly/templates/watchonly/index.html | 64 ++++++++++++++----- lnbits/extensions/watchonly/views_api.py | 23 +++++++ 5 files changed, 101 insertions(+), 17 deletions(-) diff --git a/lnbits/extensions/watchonly/models.py b/lnbits/extensions/watchonly/models.py index d499c5044..cce93b480 100644 --- a/lnbits/extensions/watchonly/models.py +++ b/lnbits/extensions/watchonly/models.py @@ -82,7 +82,7 @@ class CreatePsbt(BaseModel): class ExtractPsbt(BaseModel): - psbtBase64 = "" + psbtBase64 = "" # // todo snake case class SignedTransaction(BaseModel): @@ -90,6 +90,10 @@ class SignedTransaction(BaseModel): tx_json: Optional[str] +class BroadcastTransaction(BaseModel): + tx_hex: str + + class Config(BaseModel): mempool_endpoint = "https://mempool.space" receive_gap_limit = 20 diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index bbfe2ad72..79a0e6e37 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -639,8 +639,10 @@ new Vue({ ) if (data) { this.payment.signedTx = JSON.parse(data.tx_json) + this.payment.signedTxHex = data.tx_hex } else { this.payment.signedTx = null + his.payment.signedTxHex = null } } } else { @@ -688,6 +690,27 @@ new Vue({ console.log('### sharePsbtWithAnimatedQRCode') }, + broadcastTransaction: async function () { + console.log('### broadcastTransaction', this.payment.signedTxHex) + + try { + const wallet = this.g.user.wallets[0] + await LNbits.api.request( + 'POST', + '/watchonly/api/v1/tx', + wallet.adminkey, + {tx_hex: this.payment.signedTxHex} + ) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to broadcast!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + //################### UTXOs ################### scanAllAddresses: async function () { await this.refreshAddresses() diff --git a/lnbits/extensions/watchonly/static/js/tables.js b/lnbits/extensions/watchonly/static/js/tables.js index ffb095b39..616b70606 100644 --- a/lnbits/extensions/watchonly/static/js/tables.js +++ b/lnbits/extensions/watchonly/static/js/tables.js @@ -262,6 +262,8 @@ const tableData = { psbtBase64: '', psbtBase64Signed: '', signedTx: null, + signedTxHex: null, + sentTxId: null, utxoSelectionModes: [ 'Manual', 'Random', diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index fe7bd59eb..18414480d 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -182,14 +182,13 @@ :disabled="scan.scanning == true" >Scan Blockchain -
+ v-if="scan.scanning == true" + color="primary" + size="2.55em" + >
- {{payment.changeAmount ? satBtc(payment.changeAmount): - 'no change'}} + {{payment.changeAmount ? + satBtc(payment.changeAmount): 'no change'}} Disconnect
-
+
-
+
Fee
- {{satBtc(payment.signedTx.fee)}}
+ {{satBtc(payment.signedTx.fee)}} + +
-
-
{{satBtc(out.amount)}}
- +
+
+ {{satBtc(out.amount)}} +
+
- {{out.address}}
+ {{out.address}} +
- +
+
+
+
+ Send Payment +
+
+
@@ -1301,7 +1334,6 @@ {% endblock %} {% block scripts %} {{ window_vars(user) }} + + + + + + + + + + + {% endblock %} diff --git a/lnbits/extensions/watchonly/views_api.py b/lnbits/extensions/watchonly/views_api.py index ae6565403..1a4b93ed4 100644 --- a/lnbits/extensions/watchonly/views_api.py +++ b/lnbits/extensions/watchonly/views_api.py @@ -1,7 +1,8 @@ +import json from http import HTTPStatus -from embit import script -from embit.descriptor import Descriptor, Key +import httpx +from embit import finalizer, script from embit.ec import PublicKey from embit.psbt import PSBT, DerivationPath from embit.transaction import Transaction, TransactionInput, TransactionOutput @@ -28,18 +29,31 @@ from .crud import ( update_watch_wallet, ) from .helpers import parse_key -from .models import Config, CreatePsbt, CreateWallet, WalletAccount +from .models import ( + BroadcastTransaction, + Config, + CreatePsbt, + CreateWallet, + ExtractPsbt, + SignedTransaction, + WalletAccount, +) ###################WALLETS############################# @watchonly_ext.get("/api/v1/wallet") -async def api_wallets_retrieve(wallet: WalletTypeInfo = Depends(get_key_type)): +async def api_wallets_retrieve( + network: str = Query("Mainnet"), wallet: WalletTypeInfo = Depends(get_key_type) +): try: - return [wallet.dict() for wallet in await get_watch_wallets(wallet.wallet.user)] + return [ + wallet.dict() + for wallet in await get_watch_wallets(wallet.wallet.user, network) + ] except: - return "" + return [] @watchonly_ext.get("/api/v1/wallet/{wallet_id}") @@ -61,7 +75,13 @@ async def api_wallet_create_or_update( data: CreateWallet, w: WalletTypeInfo = Depends(require_admin_key) ): try: - (descriptor, _) = parse_key(data.masterpub) + (descriptor, network) = parse_key(data.masterpub) + if data.network != network["name"]: + raise ValueError( + "Account network error. This account is for '{}'".format( + network["name"] + ) + ) new_wallet = WalletAccount( id="none", @@ -72,11 +92,19 @@ async def api_wallet_create_or_update( title=data.title, address_no=-1, # so fresh address on empty wallet can get address with index 0 balance=0, + network=network["name"], ) - wallets = await get_watch_wallets(w.wallet.user) + wallets = await get_watch_wallets(w.wallet.user, network["name"]) existing_wallet = next( - (ew for ew in wallets if ew.fingerprint == new_wallet.fingerprint), None + ( + ew + for ew in wallets + if ew.fingerprint == new_wallet.fingerprint + and ew.network == new_wallet.network + and ew.masterpub == new_wallet.masterpub + ), + None, ) if existing_wallet: raise ValueError( @@ -215,12 +243,13 @@ async def api_psbt_create( descriptors = {} for _, masterpub in enumerate(data.masterpubs): - descriptors[masterpub.fingerprint] = parse_key(masterpub.public_key) + descriptors[masterpub.id] = parse_key(masterpub.public_key) inputs_extra = [] - bip32_derivations = {} + for i, inp in enumerate(data.inputs): - descriptor = descriptors[inp.masterpub_fingerprint][0] + bip32_derivations = {} + descriptor = descriptors[inp.wallet][0] d = descriptor.derive(inp.address_index, inp.branch_index) for k in d.keys: bip32_derivations[PublicKey.parse(k.sec())] = DerivationPath( @@ -239,12 +268,13 @@ async def api_psbt_create( for i, inp in enumerate(inputs_extra): psbt.inputs[i].bip32_derivations = inp["bip32_derivations"] psbt.inputs[i].non_witness_utxo = inp.get("non_witness_utxo", None) + print("### ", inp.get("non_witness_utxo", None)) outputs_extra = [] bip32_derivations = {} for i, out in enumerate(data.outputs): if out.branch_index == 1: - descriptor = descriptors[out.masterpub_fingerprint][0] + descriptor = descriptors[out.wallet][0] d = descriptor.derive(out.address_index, out.branch_index) for k in d.keys: bip32_derivations[PublicKey.parse(k.sec())] = DerivationPath( @@ -261,6 +291,66 @@ async def api_psbt_create( raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) +@watchonly_ext.put("/api/v1/psbt/extract") +async def api_psbt_extract_tx( + data: ExtractPsbt, w: WalletTypeInfo = Depends(require_admin_key) +): + res = SignedTransaction() + try: + psbt = PSBT.from_base64(data.psbtBase64) + for i, inp in enumerate(data.inputs): + psbt.inputs[i].non_witness_utxo = Transaction.from_string(inp.tx_hex) + + final_psbt = finalizer.finalize_psbt(psbt) + if not final_psbt: + raise ValueError("PSBT cannot be finalized!") + res.tx_hex = final_psbt.to_string() + + transaction = Transaction.from_string(res.tx_hex) + tx = { + "locktime": transaction.locktime, + "version": transaction.version, + "outputs": [], + "fee": psbt.fee(), + } + + for out in transaction.vout: + tx["outputs"].append( + {"amount": out.value, "address": out.script_pubkey.address()} + ) + res.tx_json = json.dumps(tx) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) + return res.dict() + + +@watchonly_ext.post("/api/v1/tx") +async def api_tx_broadcast( + data: BroadcastTransaction, w: WalletTypeInfo = Depends(require_admin_key) +): + try: + config = await get_config(w.wallet.user) + if not config: + raise ValueError( + "Cannot broadcast transaction. Mempool endpoint not defined!" + ) + + endpoint = ( + config.mempool_endpoint + if config.network == "Mainnet" + else config.mempool_endpoint + "/testnet" + ) + async with httpx.AsyncClient() as client: + r = await client.post(endpoint + "/api/tx", data=data.tx_hex) + tx_id = r.text + print("### broadcast tx_id: ", tx_id) + return tx_id + # return "0f0f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0f0f0f0f00f0f0f0f0f0f0.mock.transaction.id" + except Exception as e: + print("### broadcast error: ", str(e)) + raise HTTPException(status_code=HTTPStatus.BAD_REQUEST, detail=str(e)) + + #############################CONFIG########################## From 4fc0a25d41928e30b51fb42a2ca90957edc4c3ef Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Tue, 9 Aug 2022 11:49:39 +0200 Subject: [PATCH 213/421] Mega-merge 4: Reenable LndWallet gRPC and use TrackPaymentV2 (#745) * readd lndgrpc * debug logging * Use TrackPaymentV2 * /v2/router/track * lnd_router_grpc * flag for blocking check * error handling * fix name * regtest lndgrpc * new test pipeline * fix env * check for description hash * remove unnecessary asserts for clarity * assume that description_hash is a hash already * no lock * description hashing in backend * restore bolt11.py * /api/v1/payments with hex of description * comment * refactor wallets * forgot eclair * fix lnpay * bytes directly * make format * mypy check * make format * remove old code * WIP status check * LND GRPC docs * restore cln to main * fix regtest * import * remove unused import * format * do not expect ok * check ok * delete comments --- .github/workflows/regtest.yml | 42 +- docs/guide/wallets.md | 16 + lnbits/core/crud.py | 4 +- lnbits/core/models.py | 10 +- lnbits/core/services.py | 11 +- lnbits/core/views/api.py | 6 +- lnbits/core/views/generic.py | 4 +- lnbits/extensions/lnaddress/views_api.py | 4 +- lnbits/extensions/paywall/views_api.py | 4 +- lnbits/extensions/subdomains/views_api.py | 4 +- lnbits/wallets/__init__.py | 1 + .../wallets/lnd_grpc_files/lightning_pb2.py | 22878 +--------------- lnbits/wallets/lnd_grpc_files/router_pb2.py | 665 + .../wallets/lnd_grpc_files/router_pb2_grpc.py | 871 + lnbits/wallets/lndgrpc.py | 119 +- lnbits/wallets/lndrest.py | 54 +- 16 files changed, 2668 insertions(+), 22025 deletions(-) create mode 100644 lnbits/wallets/lnd_grpc_files/router_pb2.py create mode 100644 lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index bb893b551..fcd3c164f 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -40,7 +40,47 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - file: ./coverage.xml + file: ./coverage.xml + LndWallet: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - uses: abatilo/actions-poetry@v2.1.3 + - name: Setup Regtest + run: | + git clone https://github.com/lnbits/legend-regtest-enviroment.git docker + cd docker + chmod +x ./tests + ./tests + sudo chmod -R a+rwx . + - name: Install dependencies + run: | + poetry install + poetry add grpcio protobuf + - name: Run tests + env: + PYTHONUNBUFFERED: 1 + PORT: 5123 + LNBITS_DATA_FOLDER: ./data + LNBITS_BACKEND_WALLET_CLASS: LndWallet + LND_GRPC_ENDPOINT: localhost + LND_GRPC_PORT: 10009 + LND_GRPC_CERT: docker/data/lnd-1/tls.cert + LND_GRPC_MACAROON: docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon + run: | + sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data + make test-real-wallet + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + file: ./coverage.xml CoreLightningWallet: runs-on: ubuntu-latest strategy: diff --git a/docs/guide/wallets.md b/docs/guide/wallets.md index 1a65c7521..592c29ef1 100644 --- a/docs/guide/wallets.md +++ b/docs/guide/wallets.md @@ -37,6 +37,22 @@ or - `LND_REST_MACAROON_ENCRYPTED`: eNcRyPtEdMaCaRoOn +### LND (gRPC) + +Using this wallet requires the installation of the `grpcio` and `protobuf` Python packages. + +- `LNBITS_BACKEND_WALLET_CLASS`: **LndWallet** +- `LND_GRPC_ENDPOINT`: ip_address +- `LND_GRPC_PORT`: port +- `LND_GRPC_CERT`: /file/path/tls.cert +- `LND_GRPC_MACAROON`: /file/path/admin.macaroon or Bech64/Hex + +You can also use an AES-encrypted macaroon (more info) instead by using + +- `LND_GRPC_MACAROON_ENCRYPTED`: eNcRyPtEdMaCaRoOn + +To encrypt your macaroon, run `./venv/bin/python lnbits/wallets/macaroon/macaroon.py`. + ### LNbits - `LNBITS_BACKEND_WALLET_CLASS`: **LNbitsWallet** diff --git a/lnbits/core/crud.py b/lnbits/core/crud.py index db802d7bb..f150270a8 100644 --- a/lnbits/core/crud.py +++ b/lnbits/core/crud.py @@ -4,6 +4,8 @@ from typing import Any, Dict, List, Optional from urllib.parse import urlparse from uuid import uuid4 +from loguru import logger + from lnbits import bolt11 from lnbits.db import COCKROACH, POSTGRES, Connection from lnbits.settings import DEFAULT_WALLET_NAME, LNBITS_ADMIN_USERS @@ -334,7 +336,7 @@ async def delete_expired_invoices( expiration_date = datetime.datetime.fromtimestamp(invoice.date + invoice.expiry) if expiration_date > datetime.datetime.utcnow(): continue - + logger.debug(f"Deleting expired invoice: {invoice.payment_hash}") await (conn or db).execute( """ DELETE FROM apipayments diff --git a/lnbits/core/models.py b/lnbits/core/models.py index 0f7eba737..c019d941d 100644 --- a/lnbits/core/models.py +++ b/lnbits/core/models.py @@ -141,19 +141,25 @@ class Payment(BaseModel): if self.is_uncheckable: return + logger.debug( + f"Checking {'outgoing' if self.is_out else 'incoming'} pending payment {self.checking_id}" + ) + if self.is_out: status = await WALLET.get_payment_status(self.checking_id) else: status = await WALLET.get_invoice_status(self.checking_id) + logger.debug(f"Status: {status}") + if self.is_out and status.failed: logger.info( - f" - deleting outgoing failed payment {self.checking_id}: {status}" + f"Deleting outgoing failed payment {self.checking_id}: {status}" ) await self.delete() elif not status.pending: logger.info( - f" - marking '{'in' if self.is_in else 'out'}' {self.checking_id} as not pending anymore: {status}" + f"Marking '{'in' if self.is_in else 'out'}' {self.checking_id} as not pending anymore: {status}" ) await self.set_pending(status.pending) diff --git a/lnbits/core/services.py b/lnbits/core/services.py index b9aec8997..678c89e30 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -182,7 +182,7 @@ async def pay_invoice( payment_request, fee_reserve_msat ) logger.debug(f"backend: pay_invoice finished {temp_id}") - if payment.checking_id: + if payment.ok and payment.checking_id: logger.debug(f"creating final payment {payment.checking_id}") async with db.connect() as conn: await create_payment( @@ -196,7 +196,7 @@ async def pay_invoice( logger.debug(f"deleting temporary payment {temp_id}") await delete_payment(temp_id, conn=conn) else: - logger.debug(f"backend payment failed, no checking_id {temp_id}") + logger.debug(f"backend payment failed") async with db.connect() as conn: logger.debug(f"deleting temporary payment {temp_id}") await delete_payment(temp_id, conn=conn) @@ -337,13 +337,16 @@ async def perform_lnurlauth( ) -async def check_invoice_status( +async def check_transaction_status( wallet_id: str, payment_hash: str, conn: Optional[Connection] = None ) -> PaymentStatus: payment = await get_wallet_payment(wallet_id, payment_hash, conn=conn) if not payment: return PaymentStatus(None) - status = await WALLET.get_invoice_status(payment.checking_id) + if payment.is_out: + status = await WALLET.get_payment_status(payment.checking_id) + else: + status = await WALLET.get_invoice_status(payment.checking_id) if not payment.pending: return status if payment.is_out and status.failed: diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index ab6bed507..8f9af8518 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -48,7 +48,7 @@ from ..crud import ( from ..services import ( InvoiceFailure, PaymentFailure, - check_invoice_status, + check_transaction_status, create_invoice, pay_invoice, perform_lnurlauth, @@ -123,7 +123,7 @@ async def api_payments( offset=offset, ) for payment in pendingPayments: - await check_invoice_status( + await check_transaction_status( wallet_id=payment.wallet_id, payment_hash=payment.payment_hash ) return await get_payments( @@ -407,7 +407,7 @@ async def api_payment(payment_hash, X_Api_Key: Optional[str] = Header(None)): raise HTTPException( status_code=HTTPStatus.NOT_FOUND, detail="Payment does not exist." ) - await check_invoice_status(payment.wallet_id, payment_hash) + await check_transaction_status(payment.wallet_id, payment_hash) payment = await get_standalone_payment( payment_hash, wallet_id=wallet.id if wallet else None ) diff --git a/lnbits/core/views/generic.py b/lnbits/core/views/generic.py index 21572b285..31a7b0300 100644 --- a/lnbits/core/views/generic.py +++ b/lnbits/core/views/generic.py @@ -148,7 +148,9 @@ async def wallet( status_code=status.HTTP_307_TEMPORARY_REDIRECT, ) - logger.debug(f"Access wallet {wallet_name}{'of user '+ user.id if user else ''}") + logger.debug( + f"Access {'user '+ user.id + ' ' if user else ''} {'wallet ' + wallet_name if wallet_name else ''}" + ) userwallet = user.get_wallet(wallet_id) # type: ignore if not userwallet: return template_renderer().TemplateResponse( diff --git a/lnbits/extensions/lnaddress/views_api.py b/lnbits/extensions/lnaddress/views_api.py index b1f1f0049..8f403a381 100644 --- a/lnbits/extensions/lnaddress/views_api.py +++ b/lnbits/extensions/lnaddress/views_api.py @@ -6,7 +6,7 @@ from fastapi.params import Depends, Query from starlette.exceptions import HTTPException from lnbits.core.crud import get_user -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.extensions.lnaddress.models import CreateAddress, CreateDomain @@ -229,7 +229,7 @@ async def api_address_send_address(payment_hash): address = await get_address(payment_hash) domain = await get_domain(address.domain) try: - status = await check_invoice_status(domain.wallet, payment_hash) + status = await check_transaction_status(domain.wallet, payment_hash) is_paid = not status.pending except Exception as e: return {"paid": False, "error": str(e)} diff --git a/lnbits/extensions/paywall/views_api.py b/lnbits/extensions/paywall/views_api.py index 8052c63ba..d2d498536 100644 --- a/lnbits/extensions/paywall/views_api.py +++ b/lnbits/extensions/paywall/views_api.py @@ -4,7 +4,7 @@ from fastapi import Depends, Query from starlette.exceptions import HTTPException from lnbits.core.crud import get_user, get_wallet -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from . import paywall_ext @@ -87,7 +87,7 @@ async def api_paywal_check_invoice( status_code=HTTPStatus.NOT_FOUND, detail="Paywall does not exist." ) try: - status = await check_invoice_status(paywall.wallet, payment_hash) + status = await check_transaction_status(paywall.wallet, payment_hash) is_paid = not status.pending except Exception: return {"paid": False} diff --git a/lnbits/extensions/subdomains/views_api.py b/lnbits/extensions/subdomains/views_api.py index ba87bc982..b01e6ffbb 100644 --- a/lnbits/extensions/subdomains/views_api.py +++ b/lnbits/extensions/subdomains/views_api.py @@ -5,7 +5,7 @@ from fastapi.params import Depends from starlette.exceptions import HTTPException from lnbits.core.crud import get_user -from lnbits.core.services import check_invoice_status, create_invoice +from lnbits.core.services import check_transaction_status, create_invoice from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.extensions.subdomains.models import CreateDomain, CreateSubdomain @@ -161,7 +161,7 @@ async def api_subdomain_make_subdomain(domain_id, data: CreateSubdomain): async def api_subdomain_send_subdomain(payment_hash): subdomain = await get_subdomain(payment_hash) try: - status = await check_invoice_status(subdomain.wallet, payment_hash) + status = await check_transaction_status(subdomain.wallet, payment_hash) is_paid = not status.pending except Exception: return {"paid": False} diff --git a/lnbits/wallets/__init__.py b/lnbits/wallets/__init__.py index 4cf425cf8..41949652d 100644 --- a/lnbits/wallets/__init__.py +++ b/lnbits/wallets/__init__.py @@ -6,6 +6,7 @@ from .cln import CoreLightningWallet as CLightningWallet from .eclair import EclairWallet from .fake import FakeWallet from .lnbits import LNbitsWallet +from .lndgrpc import LndWallet from .lndrest import LndRestWallet from .lnpay import LNPayWallet from .lntxbot import LntxbotWallet diff --git a/lnbits/wallets/lnd_grpc_files/lightning_pb2.py b/lnbits/wallets/lnd_grpc_files/lightning_pb2.py index 9065e3f68..bac57e5b7 100644 --- a/lnbits/wallets/lnd_grpc_files/lightning_pb2.py +++ b/lnbits/wallets/lnd_grpc_files/lightning_pb2.py @@ -3,6 +3,7 @@ # source: lightning.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database @@ -13,699 +14,47 @@ from google.protobuf.internal import enum_type_wrapper _sym_db = _symbol_database.Default() -DESCRIPTOR = _descriptor.FileDescriptor( - name="lightning.proto", - package="lnrpc", - syntax="proto3", - serialized_options=b"Z%github.com/lightningnetwork/lnd/lnrpc", - create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0flightning.proto\x12\x05lnrpc" \n\x1eSubscribeCustomMessagesRequest"9\n\rCustomMessage\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"D\n\x18SendCustomMessageRequest\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"\x1b\n\x19SendCustomMessageResponse"\xa2\x01\n\x04Utxo\x12(\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x12\n\namount_sat\x18\x03 \x01(\x03\x12\x11\n\tpk_script\x18\x04 \x01(\t\x12!\n\x08outpoint\x18\x05 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x15\n\rconfirmations\x18\x06 \x01(\x03"\xd6\x01\n\x0bTransaction\x12\x0f\n\x07tx_hash\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x19\n\x11num_confirmations\x18\x03 \x01(\x05\x12\x12\n\nblock_hash\x18\x04 \x01(\t\x12\x14\n\x0c\x62lock_height\x18\x05 \x01(\x05\x12\x12\n\ntime_stamp\x18\x06 \x01(\x03\x12\x12\n\ntotal_fees\x18\x07 \x01(\x03\x12\x16\n\x0e\x64\x65st_addresses\x18\x08 \x03(\t\x12\x12\n\nraw_tx_hex\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t"S\n\x16GetTransactionsRequest\x12\x14\n\x0cstart_height\x18\x01 \x01(\x05\x12\x12\n\nend_height\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t">\n\x12TransactionDetails\x12(\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x12.lnrpc.Transaction"M\n\x08\x46\x65\x65Limit\x12\x0f\n\x05\x66ixed\x18\x01 \x01(\x03H\x00\x12\x14\n\nfixed_msat\x18\x03 \x01(\x03H\x00\x12\x11\n\x07percent\x18\x02 \x01(\x03H\x00\x42\x07\n\x05limit"\x8a\x04\n\x0bSendRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x17\n\x0b\x64\x65st_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x0b\n\x03\x61mt\x18\x03 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x05 \x01(\tB\x02\x18\x01\x12\x17\n\x0fpayment_request\x18\x06 \x01(\t\x12\x18\n\x10\x66inal_cltv_delta\x18\x07 \x01(\x05\x12"\n\tfee_limit\x18\x08 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x1c\n\x10outgoing_chan_id\x18\t \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\r \x01(\x0c\x12\x12\n\ncltv_limit\x18\n \x01(\r\x12\x46\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32).lnrpc.SendRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0e \x01(\x08\x12(\n\rdest_features\x18\x0f \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x14\n\x0cpayment_addr\x18\x10 \x01(\x0c\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"z\n\x0cSendResponse\x12\x15\n\rpayment_error\x18\x01 \x01(\t\x12\x18\n\x10payment_preimage\x18\x02 \x01(\x0c\x12#\n\rpayment_route\x18\x03 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c"n\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x05route\x18\x04 \x01(\x0b\x32\x0c.lnrpc.RouteJ\x04\x08\x03\x10\x04"\xe5\x02\n\x14\x43hannelAcceptRequest\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x03 \x01(\x0c\x12\x13\n\x0b\x66unding_amt\x18\x04 \x01(\x04\x12\x10\n\x08push_amt\x18\x05 \x01(\x04\x12\x12\n\ndust_limit\x18\x06 \x01(\x04\x12\x1b\n\x13max_value_in_flight\x18\x07 \x01(\x04\x12\x17\n\x0f\x63hannel_reserve\x18\x08 \x01(\x04\x12\x10\n\x08min_htlc\x18\t \x01(\x04\x12\x12\n\nfee_per_kw\x18\n \x01(\x04\x12\x11\n\tcsv_delay\x18\x0b \x01(\r\x12\x1a\n\x12max_accepted_htlcs\x18\x0c \x01(\r\x12\x15\n\rchannel_flags\x18\r \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x0e \x01(\x0e\x32\x15.lnrpc.CommitmentType"\xf4\x01\n\x15\x43hannelAcceptResponse\x12\x0e\n\x06\x61\x63\x63\x65pt\x18\x01 \x01(\x08\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x18\n\x10upfront_shutdown\x18\x04 \x01(\t\x12\x11\n\tcsv_delay\x18\x05 \x01(\r\x12\x13\n\x0breserve_sat\x18\x06 \x01(\x04\x12\x1a\n\x12in_flight_max_msat\x18\x07 \x01(\x04\x12\x16\n\x0emax_htlc_count\x18\x08 \x01(\r\x12\x13\n\x0bmin_htlc_in\x18\t \x01(\x04\x12\x18\n\x10min_accept_depth\x18\n \x01(\r"n\n\x0c\x43hannelPoint\x12\x1c\n\x12\x66unding_txid_bytes\x18\x01 \x01(\x0cH\x00\x12\x1a\n\x10\x66unding_txid_str\x18\x02 \x01(\tH\x00\x12\x14\n\x0coutput_index\x18\x03 \x01(\rB\x0e\n\x0c\x66unding_txid"F\n\x08OutPoint\x12\x12\n\ntxid_bytes\x18\x01 \x01(\x0c\x12\x10\n\x08txid_str\x18\x02 \x01(\t\x12\x14\n\x0coutput_index\x18\x03 \x01(\r"0\n\x10LightningAddress\x12\x0e\n\x06pubkey\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t"\xcf\x01\n\x12\x45stimateFeeRequest\x12\x41\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32+.lnrpc.EstimateFeeRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x11\n\tmin_confs\x18\x03 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x04 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"_\n\x13\x45stimateFeeResponse\x12\x0f\n\x07\x66\x65\x65_sat\x18\x01 \x01(\x03\x12 \n\x14\x66\x65\x65rate_sat_per_byte\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x04"\x89\x02\n\x0fSendManyRequest\x12>\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32(.lnrpc.SendManyRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\r\n\x05label\x18\x06 \x01(\t\x12\x11\n\tmin_confs\x18\x07 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x08 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01" \n\x10SendManyResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"\xc5\x01\n\x10SendCoinsRequest\x12\x0c\n\x04\x61\x64\x64r\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x10\n\x08send_all\x18\x06 \x01(\x08\x12\r\n\x05label\x18\x07 \x01(\t\x12\x11\n\tmin_confs\x18\x08 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\t \x01(\x08"!\n\x11SendCoinsResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"K\n\x12ListUnspentRequest\x12\x11\n\tmin_confs\x18\x01 \x01(\x05\x12\x11\n\tmax_confs\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t"1\n\x13ListUnspentResponse\x12\x1a\n\x05utxos\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Utxo"F\n\x11NewAddressRequest\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x63\x63ount\x18\x02 \x01(\t"%\n\x12NewAddressResponse\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t"6\n\x12SignMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x13\n\x0bsingle_hash\x18\x02 \x01(\x08"(\n\x13SignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\t"6\n\x14VerifyMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\t"6\n\x15VerifyMessageResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\t"Z\n\x12\x43onnectPeerRequest\x12%\n\x04\x61\x64\x64r\x18\x01 \x01(\x0b\x32\x17.lnrpc.LightningAddress\x12\x0c\n\x04perm\x18\x02 \x01(\x08\x12\x0f\n\x07timeout\x18\x03 \x01(\x04"\x15\n\x13\x43onnectPeerResponse"(\n\x15\x44isconnectPeerRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t"\x18\n\x16\x44isconnectPeerResponse"\xa5\x01\n\x04HTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x11\n\thash_lock\x18\x03 \x01(\x0c\x12\x19\n\x11\x65xpiration_height\x18\x04 \x01(\r\x12\x12\n\nhtlc_index\x18\x05 \x01(\x04\x12\x1a\n\x12\x66orwarding_channel\x18\x06 \x01(\x04\x12\x1d\n\x15\x66orwarding_htlc_index\x18\x07 \x01(\x04"\xaa\x01\n\x12\x43hannelConstraints\x12\x11\n\tcsv_delay\x18\x01 \x01(\r\x12\x18\n\x10\x63han_reserve_sat\x18\x02 \x01(\x04\x12\x16\n\x0e\x64ust_limit_sat\x18\x03 \x01(\x04\x12\x1c\n\x14max_pending_amt_msat\x18\x04 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x04\x12\x1a\n\x12max_accepted_htlcs\x18\x06 \x01(\r"\xb0\x06\n\x07\x43hannel\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x15\n\rremote_pubkey\x18\x02 \x01(\t\x12\x15\n\rchannel_point\x18\x03 \x01(\t\x12\x13\n\x07\x63han_id\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x05 \x01(\x03\x12\x15\n\rlocal_balance\x18\x06 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x07 \x01(\x03\x12\x12\n\ncommit_fee\x18\x08 \x01(\x03\x12\x15\n\rcommit_weight\x18\t \x01(\x03\x12\x12\n\nfee_per_kw\x18\n \x01(\x03\x12\x19\n\x11unsettled_balance\x18\x0b \x01(\x03\x12\x1b\n\x13total_satoshis_sent\x18\x0c \x01(\x03\x12\x1f\n\x17total_satoshis_received\x18\r \x01(\x03\x12\x13\n\x0bnum_updates\x18\x0e \x01(\x04\x12"\n\rpending_htlcs\x18\x0f \x03(\x0b\x32\x0b.lnrpc.HTLC\x12\x15\n\tcsv_delay\x18\x10 \x01(\rB\x02\x18\x01\x12\x0f\n\x07private\x18\x11 \x01(\x08\x12\x11\n\tinitiator\x18\x12 \x01(\x08\x12\x19\n\x11\x63han_status_flags\x18\x13 \x01(\t\x12"\n\x16local_chan_reserve_sat\x18\x14 \x01(\x03\x42\x02\x18\x01\x12#\n\x17remote_chan_reserve_sat\x18\x15 \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x11static_remote_key\x18\x16 \x01(\x08\x42\x02\x18\x01\x12.\n\x0f\x63ommitment_type\x18\x1a \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x10\n\x08lifetime\x18\x17 \x01(\x03\x12\x0e\n\x06uptime\x18\x18 \x01(\x03\x12\x15\n\rclose_address\x18\x19 \x01(\t\x12\x17\n\x0fpush_amount_sat\x18\x1b \x01(\x04\x12\x13\n\x0bthaw_height\x18\x1c \x01(\r\x12\x34\n\x11local_constraints\x18\x1d \x01(\x0b\x32\x19.lnrpc.ChannelConstraints\x12\x35\n\x12remote_constraints\x18\x1e \x01(\x0b\x32\x19.lnrpc.ChannelConstraints"z\n\x13ListChannelsRequest\x12\x13\n\x0b\x61\x63tive_only\x18\x01 \x01(\x08\x12\x15\n\rinactive_only\x18\x02 \x01(\x08\x12\x13\n\x0bpublic_only\x18\x03 \x01(\x08\x12\x14\n\x0cprivate_only\x18\x04 \x01(\x08\x12\x0c\n\x04peer\x18\x05 \x01(\x0c"8\n\x14ListChannelsResponse\x12 \n\x08\x63hannels\x18\x0b \x03(\x0b\x32\x0e.lnrpc.Channel"\xa9\x04\n\x13\x43hannelCloseSummary\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchain_hash\x18\x03 \x01(\t\x12\x17\n\x0f\x63losing_tx_hash\x18\x04 \x01(\t\x12\x15\n\rremote_pubkey\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12\x14\n\x0c\x63lose_height\x18\x07 \x01(\r\x12\x17\n\x0fsettled_balance\x18\x08 \x01(\x03\x12\x1b\n\x13time_locked_balance\x18\t \x01(\x03\x12:\n\nclose_type\x18\n \x01(\x0e\x32&.lnrpc.ChannelCloseSummary.ClosureType\x12(\n\x0eopen_initiator\x18\x0b \x01(\x0e\x32\x10.lnrpc.Initiator\x12)\n\x0f\x63lose_initiator\x18\x0c \x01(\x0e\x32\x10.lnrpc.Initiator\x12&\n\x0bresolutions\x18\r \x03(\x0b\x32\x11.lnrpc.Resolution"\x8a\x01\n\x0b\x43losureType\x12\x15\n\x11\x43OOPERATIVE_CLOSE\x10\x00\x12\x15\n\x11LOCAL_FORCE_CLOSE\x10\x01\x12\x16\n\x12REMOTE_FORCE_CLOSE\x10\x02\x12\x10\n\x0c\x42REACH_CLOSE\x10\x03\x12\x14\n\x10\x46UNDING_CANCELED\x10\x04\x12\r\n\tABANDONED\x10\x05"\xb2\x01\n\nResolution\x12.\n\x0fresolution_type\x18\x01 \x01(\x0e\x32\x15.lnrpc.ResolutionType\x12)\n\x07outcome\x18\x02 \x01(\x0e\x32\x18.lnrpc.ResolutionOutcome\x12!\n\x08outpoint\x18\x03 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x12\n\namount_sat\x18\x04 \x01(\x04\x12\x12\n\nsweep_txid\x18\x05 \x01(\t"\x94\x01\n\x15\x43losedChannelsRequest\x12\x13\n\x0b\x63ooperative\x18\x01 \x01(\x08\x12\x13\n\x0blocal_force\x18\x02 \x01(\x08\x12\x14\n\x0cremote_force\x18\x03 \x01(\x08\x12\x0e\n\x06\x62reach\x18\x04 \x01(\x08\x12\x18\n\x10\x66unding_canceled\x18\x05 \x01(\x08\x12\x11\n\tabandoned\x18\x06 \x01(\x08"F\n\x16\x43losedChannelsResponse\x12,\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1a.lnrpc.ChannelCloseSummary"\xef\x03\n\x04Peer\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x01(\t\x12\x12\n\nbytes_sent\x18\x04 \x01(\x04\x12\x12\n\nbytes_recv\x18\x05 \x01(\x04\x12\x10\n\x08sat_sent\x18\x06 \x01(\x03\x12\x10\n\x08sat_recv\x18\x07 \x01(\x03\x12\x0f\n\x07inbound\x18\x08 \x01(\x08\x12\x11\n\tping_time\x18\t \x01(\x03\x12\'\n\tsync_type\x18\n \x01(\x0e\x32\x14.lnrpc.Peer.SyncType\x12+\n\x08\x66\x65\x61tures\x18\x0b \x03(\x0b\x32\x19.lnrpc.Peer.FeaturesEntry\x12\'\n\x06\x65rrors\x18\x0c \x03(\x0b\x32\x17.lnrpc.TimestampedError\x12\x12\n\nflap_count\x18\r \x01(\x05\x12\x14\n\x0clast_flap_ns\x18\x0e \x01(\x03\x12\x19\n\x11last_ping_payload\x18\x0f \x01(\x0c\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"P\n\x08SyncType\x12\x10\n\x0cUNKNOWN_SYNC\x10\x00\x12\x0f\n\x0b\x41\x43TIVE_SYNC\x10\x01\x12\x10\n\x0cPASSIVE_SYNC\x10\x02\x12\x0f\n\x0bPINNED_SYNC\x10\x03"4\n\x10TimestampedError\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t"(\n\x10ListPeersRequest\x12\x14\n\x0clatest_error\x18\x01 \x01(\x08"/\n\x11ListPeersResponse\x12\x1a\n\x05peers\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Peer"\x17\n\x15PeerEventSubscription"v\n\tPeerEvent\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x1a.lnrpc.PeerEvent.EventType".\n\tEventType\x12\x0f\n\x0bPEER_ONLINE\x10\x00\x12\x10\n\x0cPEER_OFFLINE\x10\x01"\x10\n\x0eGetInfoRequest"\x96\x04\n\x0fGetInfoResponse\x12\x0f\n\x07version\x18\x0e \x01(\t\x12\x13\n\x0b\x63ommit_hash\x18\x14 \x01(\t\x12\x17\n\x0fidentity_pubkey\x18\x01 \x01(\t\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x11 \x01(\t\x12\x1c\n\x14num_pending_channels\x18\x03 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x04 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x0f \x01(\r\x12\x11\n\tnum_peers\x18\x05 \x01(\r\x12\x14\n\x0c\x62lock_height\x18\x06 \x01(\r\x12\x12\n\nblock_hash\x18\x08 \x01(\t\x12\x1d\n\x15\x62\x65st_header_timestamp\x18\r \x01(\x03\x12\x17\n\x0fsynced_to_chain\x18\t \x01(\x08\x12\x17\n\x0fsynced_to_graph\x18\x12 \x01(\x08\x12\x13\n\x07testnet\x18\n \x01(\x08\x42\x02\x18\x01\x12\x1c\n\x06\x63hains\x18\x10 \x03(\x0b\x32\x0c.lnrpc.Chain\x12\x0c\n\x04uris\x18\x0c \x03(\t\x12\x36\n\x08\x66\x65\x61tures\x18\x13 \x03(\x0b\x32$.lnrpc.GetInfoResponse.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01J\x04\x08\x0b\x10\x0c"\x18\n\x16GetRecoveryInfoRequest"]\n\x17GetRecoveryInfoResponse\x12\x15\n\rrecovery_mode\x18\x01 \x01(\x08\x12\x19\n\x11recovery_finished\x18\x02 \x01(\x08\x12\x10\n\x08progress\x18\x03 \x01(\x01"\'\n\x05\x43hain\x12\r\n\x05\x63hain\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t"U\n\x12\x43onfirmationUpdate\x12\x11\n\tblock_sha\x18\x01 \x01(\x0c\x12\x14\n\x0c\x62lock_height\x18\x02 \x01(\x05\x12\x16\n\x0enum_confs_left\x18\x03 \x01(\r"?\n\x11\x43hannelOpenUpdate\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint";\n\x12\x43hannelCloseUpdate\x12\x14\n\x0c\x63losing_txid\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08"\xb0\x01\n\x13\x43loseChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10\x64\x65livery_address\x18\x05 \x01(\t\x12\x15\n\rsat_per_vbyte\x18\x06 \x01(\x04"}\n\x11\x43loseStatusUpdate\x12-\n\rclose_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12/\n\nchan_close\x18\x03 \x01(\x0b\x32\x19.lnrpc.ChannelCloseUpdateH\x00\x42\x08\n\x06update"3\n\rPendingUpdate\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x14\n\x0coutput_index\x18\x02 \x01(\r"T\n\x13ReadyForPsbtFunding\x12\x17\n\x0f\x66unding_address\x18\x01 \x01(\t\x12\x16\n\x0e\x66unding_amount\x18\x02 \x01(\x03\x12\x0c\n\x04psbt\x18\x03 \x01(\x0c"\xad\x01\n\x17\x42\x61tchOpenChannelRequest\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.lnrpc.BatchOpenChannel\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x03\x12\x11\n\tmin_confs\x18\x04 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t"\xf9\x01\n\x10\x42\x61tchOpenChannel\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x1c\n\x14local_funding_amount\x18\x02 \x01(\x03\x12\x10\n\x08push_sat\x18\x03 \x01(\x03\x12\x0f\n\x07private\x18\x04 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\x06 \x01(\r\x12\x15\n\rclose_address\x18\x07 \x01(\t\x12\x17\n\x0fpending_chan_id\x18\x08 \x01(\x0c\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType"J\n\x18\x42\x61tchOpenChannelResponse\x12.\n\x10pending_channels\x18\x01 \x03(\x0b\x32\x14.lnrpc.PendingUpdate"\xfa\x03\n\x12OpenChannelRequest\x12\x15\n\rsat_per_vbyte\x18\x01 \x01(\x04\x12\x13\n\x0bnode_pubkey\x18\x02 \x01(\x0c\x12\x1e\n\x12node_pubkey_string\x18\x03 \x01(\tB\x02\x18\x01\x12\x1c\n\x14local_funding_amount\x18\x04 \x01(\x03\x12\x10\n\x08push_sat\x18\x05 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x06 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x07 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x07private\x18\x08 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\t \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\n \x01(\r\x12\x11\n\tmin_confs\x18\x0b \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x0c \x01(\x08\x12\x15\n\rclose_address\x18\r \x01(\t\x12(\n\x0c\x66unding_shim\x18\x0e \x01(\x0b\x32\x12.lnrpc.FundingShim\x12\'\n\x1fremote_max_value_in_flight_msat\x18\x0f \x01(\x04\x12\x18\n\x10remote_max_htlcs\x18\x10 \x01(\r\x12\x15\n\rmax_local_csv\x18\x11 \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x12 \x01(\x0e\x32\x15.lnrpc.CommitmentType"\xc3\x01\n\x10OpenStatusUpdate\x12,\n\x0c\x63han_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12-\n\tchan_open\x18\x03 \x01(\x0b\x32\x18.lnrpc.ChannelOpenUpdateH\x00\x12/\n\tpsbt_fund\x18\x05 \x01(\x0b\x32\x1a.lnrpc.ReadyForPsbtFundingH\x00\x12\x17\n\x0fpending_chan_id\x18\x04 \x01(\x0c\x42\x08\n\x06update"3\n\nKeyLocator\x12\x12\n\nkey_family\x18\x01 \x01(\x05\x12\x11\n\tkey_index\x18\x02 \x01(\x05"J\n\rKeyDescriptor\x12\x15\n\rraw_key_bytes\x18\x01 \x01(\x0c\x12"\n\x07key_loc\x18\x02 \x01(\x0b\x32\x11.lnrpc.KeyLocator"\xb0\x01\n\rChanPointShim\x12\x0b\n\x03\x61mt\x18\x01 \x01(\x03\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\'\n\tlocal_key\x18\x03 \x01(\x0b\x32\x14.lnrpc.KeyDescriptor\x12\x12\n\nremote_key\x18\x04 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x05 \x01(\x0c\x12\x13\n\x0bthaw_height\x18\x06 \x01(\r"J\n\x08PsbtShim\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c\x12\x11\n\tbase_psbt\x18\x02 \x01(\x0c\x12\x12\n\nno_publish\x18\x03 \x01(\x08"l\n\x0b\x46undingShim\x12/\n\x0f\x63han_point_shim\x18\x01 \x01(\x0b\x32\x14.lnrpc.ChanPointShimH\x00\x12$\n\tpsbt_shim\x18\x02 \x01(\x0b\x32\x0f.lnrpc.PsbtShimH\x00\x42\x06\n\x04shim",\n\x11\x46undingShimCancel\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c"X\n\x11\x46undingPsbtVerify\x12\x13\n\x0b\x66unded_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x15\n\rskip_finalize\x18\x03 \x01(\x08"Y\n\x13\x46undingPsbtFinalize\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x14\n\x0c\x66inal_raw_tx\x18\x03 \x01(\x0c"\xe5\x01\n\x14\x46undingTransitionMsg\x12+\n\rshim_register\x18\x01 \x01(\x0b\x32\x12.lnrpc.FundingShimH\x00\x12/\n\x0bshim_cancel\x18\x02 \x01(\x0b\x32\x18.lnrpc.FundingShimCancelH\x00\x12/\n\x0bpsbt_verify\x18\x03 \x01(\x0b\x32\x18.lnrpc.FundingPsbtVerifyH\x00\x12\x33\n\rpsbt_finalize\x18\x04 \x01(\x0b\x32\x1a.lnrpc.FundingPsbtFinalizeH\x00\x42\t\n\x07trigger"\x16\n\x14\x46undingStateStepResp"\x86\x01\n\x0bPendingHTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x10\n\x08outpoint\x18\x03 \x01(\t\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\r\n\x05stage\x18\x06 \x01(\r"\x18\n\x16PendingChannelsRequest"\xcc\r\n\x17PendingChannelsResponse\x12\x1b\n\x13total_limbo_balance\x18\x01 \x01(\x03\x12P\n\x15pending_open_channels\x18\x02 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.PendingOpenChannel\x12R\n\x18pending_closing_channels\x18\x03 \x03(\x0b\x32,.lnrpc.PendingChannelsResponse.ClosedChannelB\x02\x18\x01\x12Y\n\x1epending_force_closing_channels\x18\x04 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.ForceClosedChannel\x12R\n\x16waiting_close_channels\x18\x05 \x03(\x0b\x32\x32.lnrpc.PendingChannelsResponse.WaitingCloseChannel\x1a\xb8\x02\n\x0ePendingChannel\x12\x17\n\x0fremote_node_pub\x18\x01 \x01(\t\x12\x15\n\rchannel_point\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12\x15\n\rlocal_balance\x18\x04 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x05 \x01(\x03\x12\x1e\n\x16local_chan_reserve_sat\x18\x06 \x01(\x03\x12\x1f\n\x17remote_chan_reserve_sat\x18\x07 \x01(\x03\x12#\n\tinitiator\x18\x08 \x01(\x0e\x32\x10.lnrpc.Initiator\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x1f\n\x17num_forwarding_packages\x18\n \x01(\x03\x1a\xb0\x01\n\x12PendingOpenChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x1b\n\x13\x63onfirmation_height\x18\x02 \x01(\r\x12\x12\n\ncommit_fee\x18\x04 \x01(\x03\x12\x15\n\rcommit_weight\x18\x05 \x01(\x03\x12\x12\n\nfee_per_kw\x18\x06 \x01(\x03\x1a\xad\x01\n\x13WaitingCloseChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x15\n\rlimbo_balance\x18\x02 \x01(\x03\x12?\n\x0b\x63ommitments\x18\x03 \x01(\x0b\x32*.lnrpc.PendingChannelsResponse.Commitments\x1a\xb7\x01\n\x0b\x43ommitments\x12\x12\n\nlocal_txid\x18\x01 \x01(\t\x12\x13\n\x0bremote_txid\x18\x02 \x01(\t\x12\x1b\n\x13remote_pending_txid\x18\x03 \x01(\t\x12\x1c\n\x14local_commit_fee_sat\x18\x04 \x01(\x04\x12\x1d\n\x15remote_commit_fee_sat\x18\x05 \x01(\x04\x12%\n\x1dremote_pending_commit_fee_sat\x18\x06 \x01(\x04\x1a\x65\n\rClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x1a\xff\x02\n\x12\x46orceClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x12\x15\n\rlimbo_balance\x18\x03 \x01(\x03\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\x19\n\x11recovered_balance\x18\x06 \x01(\x03\x12)\n\rpending_htlcs\x18\x08 \x03(\x0b\x32\x12.lnrpc.PendingHTLC\x12M\n\x06\x61nchor\x18\t \x01(\x0e\x32=.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState"1\n\x0b\x41nchorState\x12\t\n\x05LIMBO\x10\x00\x12\r\n\tRECOVERED\x10\x01\x12\x08\n\x04LOST\x10\x02"\x1a\n\x18\x43hannelEventSubscription"\x93\x04\n\x12\x43hannelEventUpdate\x12&\n\x0copen_channel\x18\x01 \x01(\x0b\x32\x0e.lnrpc.ChannelH\x00\x12\x34\n\x0e\x63losed_channel\x18\x02 \x01(\x0b\x32\x1a.lnrpc.ChannelCloseSummaryH\x00\x12-\n\x0e\x61\x63tive_channel\x18\x03 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12/\n\x10inactive_channel\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x34\n\x14pending_open_channel\x18\x06 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12\x35\n\x16\x66ully_resolved_channel\x18\x07 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x32\n\x04type\x18\x05 \x01(\x0e\x32$.lnrpc.ChannelEventUpdate.UpdateType"\x92\x01\n\nUpdateType\x12\x10\n\x0cOPEN_CHANNEL\x10\x00\x12\x12\n\x0e\x43LOSED_CHANNEL\x10\x01\x12\x12\n\x0e\x41\x43TIVE_CHANNEL\x10\x02\x12\x14\n\x10INACTIVE_CHANNEL\x10\x03\x12\x18\n\x14PENDING_OPEN_CHANNEL\x10\x04\x12\x1a\n\x16\x46ULLY_RESOLVED_CHANNEL\x10\x05\x42\t\n\x07\x63hannel"N\n\x14WalletAccountBalance\x12\x19\n\x11\x63onfirmed_balance\x18\x01 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x02 \x01(\x03"\x16\n\x14WalletBalanceRequest"\x85\x02\n\x15WalletBalanceResponse\x12\x15\n\rtotal_balance\x18\x01 \x01(\x03\x12\x19\n\x11\x63onfirmed_balance\x18\x02 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x03 \x01(\x03\x12I\n\x0f\x61\x63\x63ount_balance\x18\x04 \x03(\x0b\x32\x30.lnrpc.WalletBalanceResponse.AccountBalanceEntry\x1aR\n\x13\x41\x63\x63ountBalanceEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.lnrpc.WalletAccountBalance:\x02\x38\x01"#\n\x06\x41mount\x12\x0b\n\x03sat\x18\x01 \x01(\x04\x12\x0c\n\x04msat\x18\x02 \x01(\x04"\x17\n\x15\x43hannelBalanceRequest"\xe4\x02\n\x16\x43hannelBalanceResponse\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x03\x42\x02\x18\x01\x12 \n\x14pending_open_balance\x18\x02 \x01(\x03\x42\x02\x18\x01\x12$\n\rlocal_balance\x18\x03 \x01(\x0b\x32\r.lnrpc.Amount\x12%\n\x0eremote_balance\x18\x04 \x01(\x0b\x32\r.lnrpc.Amount\x12.\n\x17unsettled_local_balance\x18\x05 \x01(\x0b\x32\r.lnrpc.Amount\x12/\n\x18unsettled_remote_balance\x18\x06 \x01(\x0b\x32\r.lnrpc.Amount\x12\x31\n\x1apending_open_local_balance\x18\x07 \x01(\x0b\x32\r.lnrpc.Amount\x12\x32\n\x1bpending_open_remote_balance\x18\x08 \x01(\x0b\x32\r.lnrpc.Amount"\xd0\x04\n\x12QueryRoutesRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12"\n\tfee_limit\x18\x05 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x15\n\rignored_nodes\x18\x06 \x03(\x0c\x12-\n\rignored_edges\x18\x07 \x03(\x0b\x32\x12.lnrpc.EdgeLocatorB\x02\x18\x01\x12\x16\n\x0esource_pub_key\x18\x08 \x01(\t\x12\x1b\n\x13use_mission_control\x18\t \x01(\x08\x12&\n\rignored_pairs\x18\n \x03(\x0b\x32\x0f.lnrpc.NodePair\x12\x12\n\ncltv_limit\x18\x0b \x01(\r\x12M\n\x13\x64\x65st_custom_records\x18\r \x03(\x0b\x32\x30.lnrpc.QueryRoutesRequest.DestCustomRecordsEntry\x12\x1c\n\x10outgoing_chan_id\x18\x0e \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\x0f \x01(\x0c\x12%\n\x0broute_hints\x18\x10 \x03(\x0b\x32\x10.lnrpc.RouteHint\x12(\n\rdest_features\x18\x11 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01J\x04\x08\x03\x10\x04"$\n\x08NodePair\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\n\n\x02to\x18\x02 \x01(\x0c"@\n\x0b\x45\x64geLocator\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x64irection_reverse\x18\x02 \x01(\x08"I\n\x13QueryRoutesResponse\x12\x1c\n\x06routes\x18\x01 \x03(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0csuccess_prob\x18\x02 \x01(\x01"\x80\x03\n\x03Hop\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\rchan_capacity\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x1a\n\x0e\x61mt_to_forward\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\r\x12\x1b\n\x13\x61mt_to_forward_msat\x18\x06 \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x03\x12\x0f\n\x07pub_key\x18\x08 \x01(\t\x12\x13\n\x0btlv_payload\x18\t \x01(\x08\x12$\n\nmpp_record\x18\n \x01(\x0b\x32\x10.lnrpc.MPPRecord\x12$\n\namp_record\x18\x0c \x01(\x0b\x32\x10.lnrpc.AMPRecord\x12\x35\n\x0e\x63ustom_records\x18\x0b \x03(\x0b\x32\x1d.lnrpc.Hop.CustomRecordsEntry\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"9\n\tMPPRecord\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x16\n\x0etotal_amt_msat\x18\n \x01(\x03"D\n\tAMPRecord\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r"\x9a\x01\n\x05Route\x12\x17\n\x0ftotal_time_lock\x18\x01 \x01(\r\x12\x16\n\ntotal_fees\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\ttotal_amt\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x04hops\x18\x04 \x03(\x0b\x32\n.lnrpc.Hop\x12\x17\n\x0ftotal_fees_msat\x18\x05 \x01(\x03\x12\x16\n\x0etotal_amt_msat\x18\x06 \x01(\x03"<\n\x0fNodeInfoRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x18\n\x10include_channels\x18\x02 \x01(\x08"\x82\x01\n\x08NodeInfo\x12"\n\x04node\x18\x01 \x01(\x0b\x32\x14.lnrpc.LightningNode\x12\x14\n\x0cnum_channels\x18\x02 \x01(\r\x12\x16\n\x0etotal_capacity\x18\x03 \x01(\x03\x12$\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x12.lnrpc.ChannelEdge"\xf1\x01\n\rLightningNode\x12\x13\n\x0blast_update\x18\x01 \x01(\r\x12\x0f\n\x07pub_key\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12%\n\taddresses\x18\x04 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12\x34\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32".lnrpc.LightningNode.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01",\n\x0bNodeAddress\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t"\xac\x01\n\rRoutingPolicy\x12\x17\n\x0ftime_lock_delta\x18\x01 \x01(\r\x12\x10\n\x08min_htlc\x18\x02 \x01(\x03\x12\x15\n\rfee_base_msat\x18\x03 \x01(\x03\x12\x1b\n\x13\x66\x65\x65_rate_milli_msat\x18\x04 \x01(\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x13\n\x0blast_update\x18\x07 \x01(\r"\xe2\x01\n\x0b\x43hannelEdge\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchan_point\x18\x02 \x01(\t\x12\x17\n\x0blast_update\x18\x03 \x01(\rB\x02\x18\x01\x12\x11\n\tnode1_pub\x18\x04 \x01(\t\x12\x11\n\tnode2_pub\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12*\n\x0cnode1_policy\x18\x07 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12*\n\x0cnode2_policy\x18\x08 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy"2\n\x13\x43hannelGraphRequest\x12\x1b\n\x13include_unannounced\x18\x01 \x01(\x08"V\n\x0c\x43hannelGraph\x12#\n\x05nodes\x18\x01 \x03(\x0b\x32\x14.lnrpc.LightningNode\x12!\n\x05\x65\x64ges\x18\x02 \x03(\x0b\x32\x12.lnrpc.ChannelEdge":\n\x12NodeMetricsRequest\x12$\n\x05types\x18\x01 \x03(\x0e\x32\x15.lnrpc.NodeMetricType"\xbe\x01\n\x13NodeMetricsResponse\x12U\n\x16\x62\x65tweenness_centrality\x18\x01 \x03(\x0b\x32\x35.lnrpc.NodeMetricsResponse.BetweennessCentralityEntry\x1aP\n\x1a\x42\x65tweennessCentralityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.lnrpc.FloatMetric:\x02\x38\x01"6\n\x0b\x46loatMetric\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x18\n\x10normalized_value\x18\x02 \x01(\x01"&\n\x0f\x43hanInfoRequest\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01"\x14\n\x12NetworkInfoRequest"\xa7\x02\n\x0bNetworkInfo\x12\x16\n\x0egraph_diameter\x18\x01 \x01(\r\x12\x16\n\x0e\x61vg_out_degree\x18\x02 \x01(\x01\x12\x16\n\x0emax_out_degree\x18\x03 \x01(\r\x12\x11\n\tnum_nodes\x18\x04 \x01(\r\x12\x14\n\x0cnum_channels\x18\x05 \x01(\r\x12\x1e\n\x16total_network_capacity\x18\x06 \x01(\x03\x12\x18\n\x10\x61vg_channel_size\x18\x07 \x01(\x01\x12\x18\n\x10min_channel_size\x18\x08 \x01(\x03\x12\x18\n\x10max_channel_size\x18\t \x01(\x03\x12\x1f\n\x17median_channel_size_sat\x18\n \x01(\x03\x12\x18\n\x10num_zombie_chans\x18\x0b \x01(\x04"\r\n\x0bStopRequest"\x0e\n\x0cStopResponse"\x1b\n\x19GraphTopologySubscription"\xa3\x01\n\x13GraphTopologyUpdate\x12\'\n\x0cnode_updates\x18\x01 \x03(\x0b\x32\x11.lnrpc.NodeUpdate\x12\x31\n\x0f\x63hannel_updates\x18\x02 \x03(\x0b\x32\x18.lnrpc.ChannelEdgeUpdate\x12\x30\n\x0c\x63losed_chans\x18\x03 \x03(\x0b\x32\x1a.lnrpc.ClosedChannelUpdate"\x94\x02\n\nNodeUpdate\x12\x15\n\taddresses\x18\x01 \x03(\tB\x02\x18\x01\x12\x14\n\x0cidentity_key\x18\x02 \x01(\t\x12\x1b\n\x0fglobal_features\x18\x03 \x01(\x0c\x42\x02\x18\x01\x12\r\n\x05\x61lias\x18\x04 \x01(\t\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12*\n\x0enode_addresses\x18\x07 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\x31\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32\x1f.lnrpc.NodeUpdate.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"\xc4\x01\n\x11\x43hannelEdgeUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12,\n\x0erouting_policy\x18\x04 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12\x18\n\x10\x61\x64vertising_node\x18\x05 \x01(\t\x12\x17\n\x0f\x63onnecting_node\x18\x06 \x01(\t"|\n\x13\x43losedChannelUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x02 \x01(\x03\x12\x15\n\rclosed_height\x18\x03 \x01(\r\x12\'\n\nchan_point\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"\x86\x01\n\x07HopHint\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rfee_base_msat\x18\x03 \x01(\r\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x04 \x01(\r\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\r"\x17\n\x05SetID\x12\x0e\n\x06set_id\x18\x01 \x01(\x0c".\n\tRouteHint\x12!\n\thop_hints\x18\x01 \x03(\x0b\x32\x0e.lnrpc.HopHint"{\n\x0f\x41MPInvoiceState\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04\x12\x13\n\x0bsettle_time\x18\x03 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x05 \x01(\x03"\x85\x07\n\x07Invoice\x12\x0c\n\x04memo\x18\x01 \x01(\t\x12\x12\n\nr_preimage\x18\x03 \x01(\x0c\x12\x0e\n\x06r_hash\x18\x04 \x01(\x0c\x12\r\n\x05value\x18\x05 \x01(\x03\x12\x12\n\nvalue_msat\x18\x17 \x01(\x03\x12\x13\n\x07settled\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x15\n\rcreation_date\x18\x07 \x01(\x03\x12\x13\n\x0bsettle_date\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\n \x01(\x0c\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\x12\x15\n\rfallback_addr\x18\x0c \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\r \x01(\x04\x12%\n\x0broute_hints\x18\x0e \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x0f\n\x07private\x18\x0f \x01(\x08\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0csettle_index\x18\x11 \x01(\x04\x12\x14\n\x08\x61mt_paid\x18\x12 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x61mt_paid_sat\x18\x13 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x14 \x01(\x03\x12*\n\x05state\x18\x15 \x01(\x0e\x32\x1b.lnrpc.Invoice.InvoiceState\x12!\n\x05htlcs\x18\x16 \x03(\x0b\x32\x12.lnrpc.InvoiceHTLC\x12.\n\x08\x66\x65\x61tures\x18\x18 \x03(\x0b\x32\x1c.lnrpc.Invoice.FeaturesEntry\x12\x12\n\nis_keysend\x18\x19 \x01(\x08\x12\x14\n\x0cpayment_addr\x18\x1a \x01(\x0c\x12\x0e\n\x06is_amp\x18\x1b \x01(\x08\x12>\n\x11\x61mp_invoice_state\x18\x1c \x03(\x0b\x32#.lnrpc.Invoice.AmpInvoiceStateEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01\x1aN\n\x14\x41mpInvoiceStateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.lnrpc.AMPInvoiceState:\x02\x38\x01"A\n\x0cInvoiceState\x12\x08\n\x04OPEN\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x03J\x04\x08\x02\x10\x03"\xf3\x02\n\x0bInvoiceHTLC\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nhtlc_index\x18\x02 \x01(\x04\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x04\x12\x15\n\raccept_height\x18\x04 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x03\x12\x14\n\x0cresolve_time\x18\x06 \x01(\x03\x12\x15\n\rexpiry_height\x18\x07 \x01(\x05\x12&\n\x05state\x18\x08 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12=\n\x0e\x63ustom_records\x18\t \x03(\x0b\x32%.lnrpc.InvoiceHTLC.CustomRecordsEntry\x12\x1a\n\x12mpp_total_amt_msat\x18\n \x01(\x04\x12\x17\n\x03\x61mp\x18\x0b \x01(\x0b\x32\n.lnrpc.AMP\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"^\n\x03\x41MP\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r\x12\x0c\n\x04hash\x18\x04 \x01(\x0c\x12\x10\n\x08preimage\x18\x05 \x01(\x0c"f\n\x12\x41\x64\x64InvoiceResponse\x12\x0e\n\x06r_hash\x18\x01 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x02 \x01(\t\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0cpayment_addr\x18\x11 \x01(\x0c"5\n\x0bPaymentHash\x12\x16\n\nr_hash_str\x18\x01 \x01(\tB\x02\x18\x01\x12\x0e\n\x06r_hash\x18\x02 \x01(\x0c"l\n\x12ListInvoiceRequest\x12\x14\n\x0cpending_only\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x04 \x01(\x04\x12\x18\n\x10num_max_invoices\x18\x05 \x01(\x04\x12\x10\n\x08reversed\x18\x06 \x01(\x08"n\n\x13ListInvoiceResponse\x12 \n\x08invoices\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Invoice\x12\x19\n\x11last_index_offset\x18\x02 \x01(\x04\x12\x1a\n\x12\x66irst_index_offset\x18\x03 \x01(\x04">\n\x13InvoiceSubscription\x12\x11\n\tadd_index\x18\x01 \x01(\x04\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04"\xe0\x03\n\x07Payment\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x11\n\x05value\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x19\n\rcreation_date\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10payment_preimage\x18\x06 \x01(\t\x12\x11\n\tvalue_sat\x18\x07 \x01(\x03\x12\x12\n\nvalue_msat\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12,\n\x06status\x18\n \x01(\x0e\x32\x1c.lnrpc.Payment.PaymentStatus\x12\x0f\n\x07\x66\x65\x65_sat\x18\x0b \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x63reation_time_ns\x18\r \x01(\x03\x12!\n\x05htlcs\x18\x0e \x03(\x0b\x32\x12.lnrpc.HTLCAttempt\x12\x15\n\rpayment_index\x18\x0f \x01(\x04\x12\x33\n\x0e\x66\x61ilure_reason\x18\x10 \x01(\x0e\x32\x1b.lnrpc.PaymentFailureReason"F\n\rPaymentStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tIN_FLIGHT\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03J\x04\x08\x04\x10\x05"\x8a\x02\n\x0bHTLCAttempt\x12\x12\n\nattempt_id\x18\x07 \x01(\x04\x12-\n\x06status\x18\x01 \x01(\x0e\x32\x1d.lnrpc.HTLCAttempt.HTLCStatus\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x17\n\x0f\x61ttempt_time_ns\x18\x03 \x01(\x03\x12\x17\n\x0fresolve_time_ns\x18\x04 \x01(\x03\x12\x1f\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32\x0e.lnrpc.Failure\x12\x10\n\x08preimage\x18\x06 \x01(\x0c"6\n\nHTLCStatus\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02"o\n\x13ListPaymentsRequest\x12\x1a\n\x12include_incomplete\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x02 \x01(\x04\x12\x14\n\x0cmax_payments\x18\x03 \x01(\x04\x12\x10\n\x08reversed\x18\x04 \x01(\x08"o\n\x14ListPaymentsResponse\x12 \n\x08payments\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Payment\x12\x1a\n\x12\x66irst_index_offset\x18\x02 \x01(\x04\x12\x19\n\x11last_index_offset\x18\x03 \x01(\x04"G\n\x14\x44\x65letePaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"S\n\x18\x44\x65leteAllPaymentsRequest\x12\x1c\n\x14\x66\x61iled_payments_only\x18\x01 \x01(\x08\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"\x17\n\x15\x44\x65letePaymentResponse"\x1b\n\x19\x44\x65leteAllPaymentsResponse"\x86\x01\n\x15\x41\x62\x61ndonChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12!\n\x19pending_funding_shim_only\x18\x02 \x01(\x08\x12\x1e\n\x16i_know_what_i_am_doing\x18\x03 \x01(\x08"\x18\n\x16\x41\x62\x61ndonChannelResponse"5\n\x11\x44\x65\x62ugLevelRequest\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x12\n\nlevel_spec\x18\x02 \x01(\t")\n\x12\x44\x65\x62ugLevelResponse\x12\x13\n\x0bsub_systems\x18\x01 \x01(\t"\x1f\n\x0cPayReqString\x12\x0f\n\x07pay_req\x18\x01 \x01(\t"\x86\x03\n\x06PayReq\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\t\x12\x14\n\x0cnum_satoshis\x18\x03 \x01(\x03\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\x07 \x01(\t\x12\x15\n\rfallback_addr\x18\x08 \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\t \x01(\x03\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x10\n\x08num_msat\x18\x0c \x01(\x03\x12-\n\x08\x66\x65\x61tures\x18\r \x03(\x0b\x32\x1b.lnrpc.PayReq.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01">\n\x07\x46\x65\x61ture\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0bis_required\x18\x03 \x01(\x08\x12\x10\n\x08is_known\x18\x04 \x01(\x08"\x12\n\x10\x46\x65\x65ReportRequest"|\n\x10\x43hannelFeeReport\x12\x13\n\x07\x63han_id\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x15\n\rbase_fee_msat\x18\x02 \x01(\x03\x12\x13\n\x0b\x66\x65\x65_per_mil\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01"\x84\x01\n\x11\x46\x65\x65ReportResponse\x12-\n\x0c\x63hannel_fees\x18\x01 \x03(\x0b\x32\x17.lnrpc.ChannelFeeReport\x12\x13\n\x0b\x64\x61y_fee_sum\x18\x02 \x01(\x04\x12\x14\n\x0cweek_fee_sum\x18\x03 \x01(\x04\x12\x15\n\rmonth_fee_sum\x18\x04 \x01(\x04"\xec\x01\n\x13PolicyUpdateRequest\x12\x10\n\x06global\x18\x01 \x01(\x08H\x00\x12)\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x15\n\rbase_fee_msat\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01\x12\x17\n\x0ftime_lock_delta\x18\x05 \x01(\r\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x07 \x01(\x04\x12\x1f\n\x17min_htlc_msat_specified\x18\x08 \x01(\x08\x42\x07\n\x05scope"m\n\x0c\x46\x61iledUpdate\x12!\n\x08outpoint\x18\x01 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12$\n\x06reason\x18\x02 \x01(\x0e\x32\x14.lnrpc.UpdateFailure\x12\x14\n\x0cupdate_error\x18\x03 \x01(\t"C\n\x14PolicyUpdateResponse\x12+\n\x0e\x66\x61iled_updates\x18\x01 \x03(\x0b\x32\x13.lnrpc.FailedUpdate"n\n\x18\x46orwardingHistoryRequest\x12\x12\n\nstart_time\x18\x01 \x01(\x04\x12\x10\n\x08\x65nd_time\x18\x02 \x01(\x04\x12\x14\n\x0cindex_offset\x18\x03 \x01(\r\x12\x16\n\x0enum_max_events\x18\x04 \x01(\r"\xda\x01\n\x0f\x46orwardingEvent\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x18\x01\x12\x16\n\nchan_id_in\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x63han_id_out\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06\x61mt_in\x18\x05 \x01(\x04\x12\x0f\n\x07\x61mt_out\x18\x06 \x01(\x04\x12\x0b\n\x03\x66\x65\x65\x18\x07 \x01(\x04\x12\x10\n\x08\x66\x65\x65_msat\x18\x08 \x01(\x04\x12\x13\n\x0b\x61mt_in_msat\x18\t \x01(\x04\x12\x14\n\x0c\x61mt_out_msat\x18\n \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x0b \x01(\x04"i\n\x19\x46orwardingHistoryResponse\x12\x31\n\x11\x66orwarding_events\x18\x01 \x03(\x0b\x32\x16.lnrpc.ForwardingEvent\x12\x19\n\x11last_offset_index\x18\x02 \x01(\r"E\n\x1a\x45xportChannelBackupRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"M\n\rChannelBackup\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x13\n\x0b\x63han_backup\x18\x02 \x01(\x0c"V\n\x0fMultiChanBackup\x12(\n\x0b\x63han_points\x18\x01 \x03(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x19\n\x11multi_chan_backup\x18\x02 \x01(\x0c"\x19\n\x17\x43hanBackupExportRequest"{\n\x12\x43hanBackupSnapshot\x12\x32\n\x13single_chan_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackups\x12\x31\n\x11multi_chan_backup\x18\x02 \x01(\x0b\x32\x16.lnrpc.MultiChanBackup"<\n\x0e\x43hannelBackups\x12*\n\x0c\x63han_backups\x18\x01 \x03(\x0b\x32\x14.lnrpc.ChannelBackup"p\n\x18RestoreChanBackupRequest\x12-\n\x0c\x63han_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackupsH\x00\x12\x1b\n\x11multi_chan_backup\x18\x02 \x01(\x0cH\x00\x42\x08\n\x06\x62\x61\x63kup"\x17\n\x15RestoreBackupResponse"\x1b\n\x19\x43hannelBackupSubscription"\x1a\n\x18VerifyChanBackupResponse"4\n\x12MacaroonPermission\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t"~\n\x13\x42\x61keMacaroonRequest\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x13\n\x0broot_key_id\x18\x02 \x01(\x04\x12"\n\x1a\x61llow_external_permissions\x18\x03 \x01(\x08"(\n\x14\x42\x61keMacaroonResponse\x12\x10\n\x08macaroon\x18\x01 \x01(\t"\x18\n\x16ListMacaroonIDsRequest"/\n\x17ListMacaroonIDsResponse\x12\x14\n\x0croot_key_ids\x18\x01 \x03(\x04".\n\x17\x44\x65leteMacaroonIDRequest\x12\x13\n\x0broot_key_id\x18\x01 \x01(\x04"+\n\x18\x44\x65leteMacaroonIDResponse\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08"H\n\x16MacaroonPermissionList\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission"\x18\n\x16ListPermissionsRequest"\xc5\x01\n\x17ListPermissionsResponse\x12Q\n\x12method_permissions\x18\x01 \x03(\x0b\x32\x35.lnrpc.ListPermissionsResponse.MethodPermissionsEntry\x1aW\n\x16MethodPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MacaroonPermissionList:\x02\x38\x01"\xd5\x07\n\x07\x46\x61ilure\x12(\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12,\n\x0e\x63hannel_update\x18\x03 \x01(\x0b\x32\x14.lnrpc.ChannelUpdate\x12\x11\n\thtlc_msat\x18\x04 \x01(\x04\x12\x15\n\ronion_sha_256\x18\x05 \x01(\x0c\x12\x13\n\x0b\x63ltv_expiry\x18\x06 \x01(\r\x12\r\n\x05\x66lags\x18\x07 \x01(\r\x12\x1c\n\x14\x66\x61ilure_source_index\x18\x08 \x01(\r\x12\x0e\n\x06height\x18\t \x01(\r"\xef\x05\n\x0b\x46\x61ilureCode\x12\x0c\n\x08RESERVED\x10\x00\x12(\n$INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS\x10\x01\x12\x1c\n\x18INCORRECT_PAYMENT_AMOUNT\x10\x02\x12\x1f\n\x1b\x46INAL_INCORRECT_CLTV_EXPIRY\x10\x03\x12\x1f\n\x1b\x46INAL_INCORRECT_HTLC_AMOUNT\x10\x04\x12\x19\n\x15\x46INAL_EXPIRY_TOO_SOON\x10\x05\x12\x11\n\rINVALID_REALM\x10\x06\x12\x13\n\x0f\x45XPIRY_TOO_SOON\x10\x07\x12\x19\n\x15INVALID_ONION_VERSION\x10\x08\x12\x16\n\x12INVALID_ONION_HMAC\x10\t\x12\x15\n\x11INVALID_ONION_KEY\x10\n\x12\x18\n\x14\x41MOUNT_BELOW_MINIMUM\x10\x0b\x12\x14\n\x10\x46\x45\x45_INSUFFICIENT\x10\x0c\x12\x19\n\x15INCORRECT_CLTV_EXPIRY\x10\r\x12\x14\n\x10\x43HANNEL_DISABLED\x10\x0e\x12\x1d\n\x19TEMPORARY_CHANNEL_FAILURE\x10\x0f\x12!\n\x1dREQUIRED_NODE_FEATURE_MISSING\x10\x10\x12$\n REQUIRED_CHANNEL_FEATURE_MISSING\x10\x11\x12\x15\n\x11UNKNOWN_NEXT_PEER\x10\x12\x12\x1a\n\x16TEMPORARY_NODE_FAILURE\x10\x13\x12\x1a\n\x16PERMANENT_NODE_FAILURE\x10\x14\x12\x1d\n\x19PERMANENT_CHANNEL_FAILURE\x10\x15\x12\x12\n\x0e\x45XPIRY_TOO_FAR\x10\x16\x12\x0f\n\x0bMPP_TIMEOUT\x10\x17\x12\x19\n\x15INVALID_ONION_PAYLOAD\x10\x18\x12\x15\n\x10INTERNAL_FAILURE\x10\xe5\x07\x12\x14\n\x0fUNKNOWN_FAILURE\x10\xe6\x07\x12\x17\n\x12UNREADABLE_FAILURE\x10\xe7\x07J\x04\x08\x02\x10\x03"\x9a\x02\n\rChannelUpdate\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x13\n\x07\x63han_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x11\n\ttimestamp\x18\x04 \x01(\r\x12\x15\n\rmessage_flags\x18\n \x01(\r\x12\x15\n\rchannel_flags\x18\x05 \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x06 \x01(\r\x12\x19\n\x11htlc_minimum_msat\x18\x07 \x01(\x04\x12\x10\n\x08\x62\x61se_fee\x18\x08 \x01(\r\x12\x10\n\x08\x66\x65\x65_rate\x18\t \x01(\r\x12\x19\n\x11htlc_maximum_msat\x18\x0b \x01(\x04\x12\x19\n\x11\x65xtra_opaque_data\x18\x0c \x01(\x0c"F\n\nMacaroonId\x12\r\n\x05nonce\x18\x01 \x01(\x0c\x12\x11\n\tstorageId\x18\x02 \x01(\x0c\x12\x16\n\x03ops\x18\x03 \x03(\x0b\x32\t.lnrpc.Op"%\n\x02Op\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t"k\n\x13\x43heckMacPermRequest\x12\x10\n\x08macaroon\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x12\n\nfullMethod\x18\x03 \x01(\t"%\n\x14\x43heckMacPermResponse\x12\r\n\x05valid\x18\x01 \x01(\x08"\xea\x01\n\x14RPCMiddlewareRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x14\n\x0craw_macaroon\x18\x02 \x01(\x0c\x12\x1f\n\x17\x63ustom_caveat_condition\x18\x03 \x01(\t\x12(\n\x0bstream_auth\x18\x04 \x01(\x0b\x32\x11.lnrpc.StreamAuthH\x00\x12$\n\x07request\x18\x05 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12%\n\x08response\x18\x06 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x42\x10\n\x0eintercept_type"%\n\nStreamAuth\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t"`\n\nRPCMessage\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t\x12\x12\n\nstream_rpc\x18\x02 \x01(\x08\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x12\n\nserialized\x18\x04 \x01(\x0c"\xa2\x01\n\x15RPCMiddlewareResponse\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x31\n\x08register\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MiddlewareRegistrationH\x00\x12,\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x03 \x01(\x0b\x32\x18.lnrpc.InterceptFeedbackH\x00\x42\x14\n\x12middleware_message"n\n\x16MiddlewareRegistration\x12\x17\n\x0fmiddleware_name\x18\x01 \x01(\t\x12#\n\x1b\x63ustom_macaroon_caveat_name\x18\x02 \x01(\t\x12\x16\n\x0eread_only_mode\x18\x03 \x01(\x08"\\\n\x11InterceptFeedback\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x18\n\x10replace_response\x18\x02 \x01(\x08\x12\x1e\n\x16replacement_serialized\x18\x03 \x01(\x0c*}\n\x0b\x41\x64\x64ressType\x12\x17\n\x13WITNESS_PUBKEY_HASH\x10\x00\x12\x16\n\x12NESTED_PUBKEY_HASH\x10\x01\x12\x1e\n\x1aUNUSED_WITNESS_PUBKEY_HASH\x10\x02\x12\x1d\n\x19UNUSED_NESTED_PUBKEY_HASH\x10\x03*x\n\x0e\x43ommitmentType\x12\x1b\n\x17UNKNOWN_COMMITMENT_TYPE\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x15\n\x11STATIC_REMOTE_KEY\x10\x02\x12\x0b\n\x07\x41NCHORS\x10\x03\x12\x19\n\x15SCRIPT_ENFORCED_LEASE\x10\x04*a\n\tInitiator\x12\x15\n\x11INITIATOR_UNKNOWN\x10\x00\x12\x13\n\x0fINITIATOR_LOCAL\x10\x01\x12\x14\n\x10INITIATOR_REMOTE\x10\x02\x12\x12\n\x0eINITIATOR_BOTH\x10\x03*`\n\x0eResolutionType\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06\x41NCHOR\x10\x01\x12\x11\n\rINCOMING_HTLC\x10\x02\x12\x11\n\rOUTGOING_HTLC\x10\x03\x12\n\n\x06\x43OMMIT\x10\x04*q\n\x11ResolutionOutcome\x12\x13\n\x0fOUTCOME_UNKNOWN\x10\x00\x12\x0b\n\x07\x43LAIMED\x10\x01\x12\r\n\tUNCLAIMED\x10\x02\x12\r\n\tABANDONED\x10\x03\x12\x0f\n\x0b\x46IRST_STAGE\x10\x04\x12\x0b\n\x07TIMEOUT\x10\x05*9\n\x0eNodeMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x1a\n\x16\x42\x45TWEENNESS_CENTRALITY\x10\x01*;\n\x10InvoiceHTLCState\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02*\xd9\x01\n\x14PaymentFailureReason\x12\x17\n\x13\x46\x41ILURE_REASON_NONE\x10\x00\x12\x1a\n\x16\x46\x41ILURE_REASON_TIMEOUT\x10\x01\x12\x1b\n\x17\x46\x41ILURE_REASON_NO_ROUTE\x10\x02\x12\x18\n\x14\x46\x41ILURE_REASON_ERROR\x10\x03\x12,\n(FAILURE_REASON_INCORRECT_PAYMENT_DETAILS\x10\x04\x12\'\n#FAILURE_REASON_INSUFFICIENT_BALANCE\x10\x05*\xcf\x04\n\nFeatureBit\x12\x18\n\x14\x44\x41TALOSS_PROTECT_REQ\x10\x00\x12\x18\n\x14\x44\x41TALOSS_PROTECT_OPT\x10\x01\x12\x17\n\x13INITIAL_ROUING_SYNC\x10\x03\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_REQ\x10\x04\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_OPT\x10\x05\x12\x16\n\x12GOSSIP_QUERIES_REQ\x10\x06\x12\x16\n\x12GOSSIP_QUERIES_OPT\x10\x07\x12\x11\n\rTLV_ONION_REQ\x10\x08\x12\x11\n\rTLV_ONION_OPT\x10\t\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_REQ\x10\n\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_OPT\x10\x0b\x12\x19\n\x15STATIC_REMOTE_KEY_REQ\x10\x0c\x12\x19\n\x15STATIC_REMOTE_KEY_OPT\x10\r\x12\x14\n\x10PAYMENT_ADDR_REQ\x10\x0e\x12\x14\n\x10PAYMENT_ADDR_OPT\x10\x0f\x12\x0b\n\x07MPP_REQ\x10\x10\x12\x0b\n\x07MPP_OPT\x10\x11\x12\x16\n\x12WUMBO_CHANNELS_REQ\x10\x12\x12\x16\n\x12WUMBO_CHANNELS_OPT\x10\x13\x12\x0f\n\x0b\x41NCHORS_REQ\x10\x14\x12\x0f\n\x0b\x41NCHORS_OPT\x10\x15\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_REQ\x10\x16\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_OPT\x10\x17\x12\x0b\n\x07\x41MP_REQ\x10\x1e\x12\x0b\n\x07\x41MP_OPT\x10\x1f*\xac\x01\n\rUpdateFailure\x12\x1a\n\x16UPDATE_FAILURE_UNKNOWN\x10\x00\x12\x1a\n\x16UPDATE_FAILURE_PENDING\x10\x01\x12\x1c\n\x18UPDATE_FAILURE_NOT_FOUND\x10\x02\x12\x1f\n\x1bUPDATE_FAILURE_INTERNAL_ERR\x10\x03\x12$\n UPDATE_FAILURE_INVALID_PARAMETER\x10\x04\x32\xc9%\n\tLightning\x12J\n\rWalletBalance\x12\x1b.lnrpc.WalletBalanceRequest\x1a\x1c.lnrpc.WalletBalanceResponse\x12M\n\x0e\x43hannelBalance\x12\x1c.lnrpc.ChannelBalanceRequest\x1a\x1d.lnrpc.ChannelBalanceResponse\x12K\n\x0fGetTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x19.lnrpc.TransactionDetails\x12\x44\n\x0b\x45stimateFee\x12\x19.lnrpc.EstimateFeeRequest\x1a\x1a.lnrpc.EstimateFeeResponse\x12>\n\tSendCoins\x12\x17.lnrpc.SendCoinsRequest\x1a\x18.lnrpc.SendCoinsResponse\x12\x44\n\x0bListUnspent\x12\x19.lnrpc.ListUnspentRequest\x1a\x1a.lnrpc.ListUnspentResponse\x12L\n\x15SubscribeTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x12.lnrpc.Transaction0\x01\x12;\n\x08SendMany\x12\x16.lnrpc.SendManyRequest\x1a\x17.lnrpc.SendManyResponse\x12\x41\n\nNewAddress\x12\x18.lnrpc.NewAddressRequest\x1a\x19.lnrpc.NewAddressResponse\x12\x44\n\x0bSignMessage\x12\x19.lnrpc.SignMessageRequest\x1a\x1a.lnrpc.SignMessageResponse\x12J\n\rVerifyMessage\x12\x1b.lnrpc.VerifyMessageRequest\x1a\x1c.lnrpc.VerifyMessageResponse\x12\x44\n\x0b\x43onnectPeer\x12\x19.lnrpc.ConnectPeerRequest\x1a\x1a.lnrpc.ConnectPeerResponse\x12M\n\x0e\x44isconnectPeer\x12\x1c.lnrpc.DisconnectPeerRequest\x1a\x1d.lnrpc.DisconnectPeerResponse\x12>\n\tListPeers\x12\x17.lnrpc.ListPeersRequest\x1a\x18.lnrpc.ListPeersResponse\x12G\n\x13SubscribePeerEvents\x12\x1c.lnrpc.PeerEventSubscription\x1a\x10.lnrpc.PeerEvent0\x01\x12\x38\n\x07GetInfo\x12\x15.lnrpc.GetInfoRequest\x1a\x16.lnrpc.GetInfoResponse\x12P\n\x0fGetRecoveryInfo\x12\x1d.lnrpc.GetRecoveryInfoRequest\x1a\x1e.lnrpc.GetRecoveryInfoResponse\x12P\n\x0fPendingChannels\x12\x1d.lnrpc.PendingChannelsRequest\x1a\x1e.lnrpc.PendingChannelsResponse\x12G\n\x0cListChannels\x12\x1a.lnrpc.ListChannelsRequest\x1a\x1b.lnrpc.ListChannelsResponse\x12V\n\x16SubscribeChannelEvents\x12\x1f.lnrpc.ChannelEventSubscription\x1a\x19.lnrpc.ChannelEventUpdate0\x01\x12M\n\x0e\x43losedChannels\x12\x1c.lnrpc.ClosedChannelsRequest\x1a\x1d.lnrpc.ClosedChannelsResponse\x12\x41\n\x0fOpenChannelSync\x12\x19.lnrpc.OpenChannelRequest\x1a\x13.lnrpc.ChannelPoint\x12\x43\n\x0bOpenChannel\x12\x19.lnrpc.OpenChannelRequest\x1a\x17.lnrpc.OpenStatusUpdate0\x01\x12S\n\x10\x42\x61tchOpenChannel\x12\x1e.lnrpc.BatchOpenChannelRequest\x1a\x1f.lnrpc.BatchOpenChannelResponse\x12L\n\x10\x46undingStateStep\x12\x1b.lnrpc.FundingTransitionMsg\x1a\x1b.lnrpc.FundingStateStepResp\x12P\n\x0f\x43hannelAcceptor\x12\x1c.lnrpc.ChannelAcceptResponse\x1a\x1b.lnrpc.ChannelAcceptRequest(\x01\x30\x01\x12\x46\n\x0c\x43loseChannel\x12\x1a.lnrpc.CloseChannelRequest\x1a\x18.lnrpc.CloseStatusUpdate0\x01\x12M\n\x0e\x41\x62\x61ndonChannel\x12\x1c.lnrpc.AbandonChannelRequest\x1a\x1d.lnrpc.AbandonChannelResponse\x12?\n\x0bSendPayment\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12:\n\x0fSendPaymentSync\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse\x12\x46\n\x0bSendToRoute\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12\x41\n\x0fSendToRouteSync\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse\x12\x37\n\nAddInvoice\x12\x0e.lnrpc.Invoice\x1a\x19.lnrpc.AddInvoiceResponse\x12\x45\n\x0cListInvoices\x12\x19.lnrpc.ListInvoiceRequest\x1a\x1a.lnrpc.ListInvoiceResponse\x12\x33\n\rLookupInvoice\x12\x12.lnrpc.PaymentHash\x1a\x0e.lnrpc.Invoice\x12\x41\n\x11SubscribeInvoices\x12\x1a.lnrpc.InvoiceSubscription\x1a\x0e.lnrpc.Invoice0\x01\x12\x32\n\x0c\x44\x65\x63odePayReq\x12\x13.lnrpc.PayReqString\x1a\r.lnrpc.PayReq\x12G\n\x0cListPayments\x12\x1a.lnrpc.ListPaymentsRequest\x1a\x1b.lnrpc.ListPaymentsResponse\x12J\n\rDeletePayment\x12\x1b.lnrpc.DeletePaymentRequest\x1a\x1c.lnrpc.DeletePaymentResponse\x12V\n\x11\x44\x65leteAllPayments\x12\x1f.lnrpc.DeleteAllPaymentsRequest\x1a .lnrpc.DeleteAllPaymentsResponse\x12@\n\rDescribeGraph\x12\x1a.lnrpc.ChannelGraphRequest\x1a\x13.lnrpc.ChannelGraph\x12G\n\x0eGetNodeMetrics\x12\x19.lnrpc.NodeMetricsRequest\x1a\x1a.lnrpc.NodeMetricsResponse\x12\x39\n\x0bGetChanInfo\x12\x16.lnrpc.ChanInfoRequest\x1a\x12.lnrpc.ChannelEdge\x12\x36\n\x0bGetNodeInfo\x12\x16.lnrpc.NodeInfoRequest\x1a\x0f.lnrpc.NodeInfo\x12\x44\n\x0bQueryRoutes\x12\x19.lnrpc.QueryRoutesRequest\x1a\x1a.lnrpc.QueryRoutesResponse\x12?\n\x0eGetNetworkInfo\x12\x19.lnrpc.NetworkInfoRequest\x1a\x12.lnrpc.NetworkInfo\x12\x35\n\nStopDaemon\x12\x12.lnrpc.StopRequest\x1a\x13.lnrpc.StopResponse\x12W\n\x15SubscribeChannelGraph\x12 .lnrpc.GraphTopologySubscription\x1a\x1a.lnrpc.GraphTopologyUpdate0\x01\x12\x41\n\nDebugLevel\x12\x18.lnrpc.DebugLevelRequest\x1a\x19.lnrpc.DebugLevelResponse\x12>\n\tFeeReport\x12\x17.lnrpc.FeeReportRequest\x1a\x18.lnrpc.FeeReportResponse\x12N\n\x13UpdateChannelPolicy\x12\x1a.lnrpc.PolicyUpdateRequest\x1a\x1b.lnrpc.PolicyUpdateResponse\x12V\n\x11\x46orwardingHistory\x12\x1f.lnrpc.ForwardingHistoryRequest\x1a .lnrpc.ForwardingHistoryResponse\x12N\n\x13\x45xportChannelBackup\x12!.lnrpc.ExportChannelBackupRequest\x1a\x14.lnrpc.ChannelBackup\x12T\n\x17\x45xportAllChannelBackups\x12\x1e.lnrpc.ChanBackupExportRequest\x1a\x19.lnrpc.ChanBackupSnapshot\x12N\n\x10VerifyChanBackup\x12\x19.lnrpc.ChanBackupSnapshot\x1a\x1f.lnrpc.VerifyChanBackupResponse\x12V\n\x15RestoreChannelBackups\x12\x1f.lnrpc.RestoreChanBackupRequest\x1a\x1c.lnrpc.RestoreBackupResponse\x12X\n\x17SubscribeChannelBackups\x12 .lnrpc.ChannelBackupSubscription\x1a\x19.lnrpc.ChanBackupSnapshot0\x01\x12G\n\x0c\x42\x61keMacaroon\x12\x1a.lnrpc.BakeMacaroonRequest\x1a\x1b.lnrpc.BakeMacaroonResponse\x12P\n\x0fListMacaroonIDs\x12\x1d.lnrpc.ListMacaroonIDsRequest\x1a\x1e.lnrpc.ListMacaroonIDsResponse\x12S\n\x10\x44\x65leteMacaroonID\x12\x1e.lnrpc.DeleteMacaroonIDRequest\x1a\x1f.lnrpc.DeleteMacaroonIDResponse\x12P\n\x0fListPermissions\x12\x1d.lnrpc.ListPermissionsRequest\x1a\x1e.lnrpc.ListPermissionsResponse\x12S\n\x18\x43heckMacaroonPermissions\x12\x1a.lnrpc.CheckMacPermRequest\x1a\x1b.lnrpc.CheckMacPermResponse\x12V\n\x15RegisterRPCMiddleware\x12\x1c.lnrpc.RPCMiddlewareResponse\x1a\x1b.lnrpc.RPCMiddlewareRequest(\x01\x30\x01\x12V\n\x11SendCustomMessage\x12\x1f.lnrpc.SendCustomMessageRequest\x1a .lnrpc.SendCustomMessageResponse\x12X\n\x17SubscribeCustomMessages\x12%.lnrpc.SubscribeCustomMessagesRequest\x1a\x14.lnrpc.CustomMessage0\x01\x42\'Z%github.com/lightningnetwork/lnd/lnrpcb\x06proto3', +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x0flightning.proto\x12\x05lnrpc" \n\x1eSubscribeCustomMessagesRequest"9\n\rCustomMessage\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"D\n\x18SendCustomMessageRequest\x12\x0c\n\x04peer\x18\x01 \x01(\x0c\x12\x0c\n\x04type\x18\x02 \x01(\r\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c"\x1b\n\x19SendCustomMessageResponse"\xa2\x01\n\x04Utxo\x12(\n\x0c\x61\x64\x64ress_type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x12\n\namount_sat\x18\x03 \x01(\x03\x12\x11\n\tpk_script\x18\x04 \x01(\t\x12!\n\x08outpoint\x18\x05 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x15\n\rconfirmations\x18\x06 \x01(\x03"\x9e\x01\n\x0cOutputDetail\x12,\n\x0boutput_type\x18\x01 \x01(\x0e\x32\x17.lnrpc.OutputScriptType\x12\x0f\n\x07\x61\x64\x64ress\x18\x02 \x01(\t\x12\x11\n\tpk_script\x18\x03 \x01(\t\x12\x14\n\x0coutput_index\x18\x04 \x01(\x03\x12\x0e\n\x06\x61mount\x18\x05 \x01(\x03\x12\x16\n\x0eis_our_address\x18\x06 \x01(\x08"\xbc\x02\n\x0bTransaction\x12\x0f\n\x07tx_hash\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x19\n\x11num_confirmations\x18\x03 \x01(\x05\x12\x12\n\nblock_hash\x18\x04 \x01(\t\x12\x14\n\x0c\x62lock_height\x18\x05 \x01(\x05\x12\x12\n\ntime_stamp\x18\x06 \x01(\x03\x12\x12\n\ntotal_fees\x18\x07 \x01(\x03\x12\x1a\n\x0e\x64\x65st_addresses\x18\x08 \x03(\tB\x02\x18\x01\x12+\n\x0eoutput_details\x18\x0b \x03(\x0b\x32\x13.lnrpc.OutputDetail\x12\x12\n\nraw_tx_hex\x18\t \x01(\t\x12\r\n\x05label\x18\n \x01(\t\x12\x33\n\x12previous_outpoints\x18\x0c \x03(\x0b\x32\x17.lnrpc.PreviousOutPoint"S\n\x16GetTransactionsRequest\x12\x14\n\x0cstart_height\x18\x01 \x01(\x05\x12\x12\n\nend_height\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t">\n\x12TransactionDetails\x12(\n\x0ctransactions\x18\x01 \x03(\x0b\x32\x12.lnrpc.Transaction"M\n\x08\x46\x65\x65Limit\x12\x0f\n\x05\x66ixed\x18\x01 \x01(\x03H\x00\x12\x14\n\nfixed_msat\x18\x03 \x01(\x03H\x00\x12\x11\n\x07percent\x18\x02 \x01(\x03H\x00\x42\x07\n\x05limit"\x8a\x04\n\x0bSendRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x17\n\x0b\x64\x65st_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x0b\n\x03\x61mt\x18\x03 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x05 \x01(\tB\x02\x18\x01\x12\x17\n\x0fpayment_request\x18\x06 \x01(\t\x12\x18\n\x10\x66inal_cltv_delta\x18\x07 \x01(\x05\x12"\n\tfee_limit\x18\x08 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x1c\n\x10outgoing_chan_id\x18\t \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\r \x01(\x0c\x12\x12\n\ncltv_limit\x18\n \x01(\r\x12\x46\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32).lnrpc.SendRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0e \x01(\x08\x12(\n\rdest_features\x18\x0f \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x14\n\x0cpayment_addr\x18\x10 \x01(\x0c\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"z\n\x0cSendResponse\x12\x15\n\rpayment_error\x18\x01 \x01(\t\x12\x18\n\x10payment_preimage\x18\x02 \x01(\x0c\x12#\n\rpayment_route\x18\x03 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0cpayment_hash\x18\x04 \x01(\x0c"n\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1f\n\x13payment_hash_string\x18\x02 \x01(\tB\x02\x18\x01\x12\x1b\n\x05route\x18\x04 \x01(\x0b\x32\x0c.lnrpc.RouteJ\x04\x08\x03\x10\x04"\xe5\x02\n\x14\x43hannelAcceptRequest\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x03 \x01(\x0c\x12\x13\n\x0b\x66unding_amt\x18\x04 \x01(\x04\x12\x10\n\x08push_amt\x18\x05 \x01(\x04\x12\x12\n\ndust_limit\x18\x06 \x01(\x04\x12\x1b\n\x13max_value_in_flight\x18\x07 \x01(\x04\x12\x17\n\x0f\x63hannel_reserve\x18\x08 \x01(\x04\x12\x10\n\x08min_htlc\x18\t \x01(\x04\x12\x12\n\nfee_per_kw\x18\n \x01(\x04\x12\x11\n\tcsv_delay\x18\x0b \x01(\r\x12\x1a\n\x12max_accepted_htlcs\x18\x0c \x01(\r\x12\x15\n\rchannel_flags\x18\r \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x0e \x01(\x0e\x32\x15.lnrpc.CommitmentType"\x87\x02\n\x15\x43hannelAcceptResponse\x12\x0e\n\x06\x61\x63\x63\x65pt\x18\x01 \x01(\x08\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\r\n\x05\x65rror\x18\x03 \x01(\t\x12\x18\n\x10upfront_shutdown\x18\x04 \x01(\t\x12\x11\n\tcsv_delay\x18\x05 \x01(\r\x12\x13\n\x0breserve_sat\x18\x06 \x01(\x04\x12\x1a\n\x12in_flight_max_msat\x18\x07 \x01(\x04\x12\x16\n\x0emax_htlc_count\x18\x08 \x01(\r\x12\x13\n\x0bmin_htlc_in\x18\t \x01(\x04\x12\x18\n\x10min_accept_depth\x18\n \x01(\r\x12\x11\n\tzero_conf\x18\x0b \x01(\x08"n\n\x0c\x43hannelPoint\x12\x1c\n\x12\x66unding_txid_bytes\x18\x01 \x01(\x0cH\x00\x12\x1a\n\x10\x66unding_txid_str\x18\x02 \x01(\tH\x00\x12\x14\n\x0coutput_index\x18\x03 \x01(\rB\x0e\n\x0c\x66unding_txid"F\n\x08OutPoint\x12\x12\n\ntxid_bytes\x18\x01 \x01(\x0c\x12\x10\n\x08txid_str\x18\x02 \x01(\t\x12\x14\n\x0coutput_index\x18\x03 \x01(\r";\n\x10PreviousOutPoint\x12\x10\n\x08outpoint\x18\x01 \x01(\t\x12\x15\n\ris_our_output\x18\x02 \x01(\x08"0\n\x10LightningAddress\x12\x0e\n\x06pubkey\x18\x01 \x01(\t\x12\x0c\n\x04host\x18\x02 \x01(\t"\xcf\x01\n\x12\x45stimateFeeRequest\x12\x41\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32+.lnrpc.EstimateFeeRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x11\n\tmin_confs\x18\x03 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x04 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01"_\n\x13\x45stimateFeeResponse\x12\x0f\n\x07\x66\x65\x65_sat\x18\x01 \x01(\x03\x12 \n\x14\x66\x65\x65rate_sat_per_byte\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x04"\x89\x02\n\x0fSendManyRequest\x12>\n\x0c\x41\x64\x64rToAmount\x18\x01 \x03(\x0b\x32(.lnrpc.SendManyRequest.AddrToAmountEntry\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\r\n\x05label\x18\x06 \x01(\t\x12\x11\n\tmin_confs\x18\x07 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x08 \x01(\x08\x1a\x33\n\x11\x41\x64\x64rToAmountEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01" \n\x10SendManyResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"\xc5\x01\n\x10SendCoinsRequest\x12\x0c\n\x04\x61\x64\x64r\x18\x01 \x01(\t\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x04 \x01(\x04\x12\x18\n\x0csat_per_byte\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x10\n\x08send_all\x18\x06 \x01(\x08\x12\r\n\x05label\x18\x07 \x01(\t\x12\x11\n\tmin_confs\x18\x08 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\t \x01(\x08"!\n\x11SendCoinsResponse\x12\x0c\n\x04txid\x18\x01 \x01(\t"K\n\x12ListUnspentRequest\x12\x11\n\tmin_confs\x18\x01 \x01(\x05\x12\x11\n\tmax_confs\x18\x02 \x01(\x05\x12\x0f\n\x07\x61\x63\x63ount\x18\x03 \x01(\t"1\n\x13ListUnspentResponse\x12\x1a\n\x05utxos\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Utxo"F\n\x11NewAddressRequest\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.lnrpc.AddressType\x12\x0f\n\x07\x61\x63\x63ount\x18\x02 \x01(\t"%\n\x12NewAddressResponse\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t"6\n\x12SignMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x13\n\x0bsingle_hash\x18\x02 \x01(\x08"(\n\x13SignMessageResponse\x12\x11\n\tsignature\x18\x01 \x01(\t"6\n\x14VerifyMessageRequest\x12\x0b\n\x03msg\x18\x01 \x01(\x0c\x12\x11\n\tsignature\x18\x02 \x01(\t"6\n\x15VerifyMessageResponse\x12\r\n\x05valid\x18\x01 \x01(\x08\x12\x0e\n\x06pubkey\x18\x02 \x01(\t"Z\n\x12\x43onnectPeerRequest\x12%\n\x04\x61\x64\x64r\x18\x01 \x01(\x0b\x32\x17.lnrpc.LightningAddress\x12\x0c\n\x04perm\x18\x02 \x01(\x08\x12\x0f\n\x07timeout\x18\x03 \x01(\x04"\x15\n\x13\x43onnectPeerResponse"(\n\x15\x44isconnectPeerRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t"\x18\n\x16\x44isconnectPeerResponse"\xa5\x01\n\x04HTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x11\n\thash_lock\x18\x03 \x01(\x0c\x12\x19\n\x11\x65xpiration_height\x18\x04 \x01(\r\x12\x12\n\nhtlc_index\x18\x05 \x01(\x04\x12\x1a\n\x12\x66orwarding_channel\x18\x06 \x01(\x04\x12\x1d\n\x15\x66orwarding_htlc_index\x18\x07 \x01(\x04"\xaa\x01\n\x12\x43hannelConstraints\x12\x11\n\tcsv_delay\x18\x01 \x01(\r\x12\x18\n\x10\x63han_reserve_sat\x18\x02 \x01(\x04\x12\x16\n\x0e\x64ust_limit_sat\x18\x03 \x01(\x04\x12\x1c\n\x14max_pending_amt_msat\x18\x04 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x04\x12\x1a\n\x12max_accepted_htlcs\x18\x06 \x01(\r"\xb0\x06\n\x07\x43hannel\x12\x0e\n\x06\x61\x63tive\x18\x01 \x01(\x08\x12\x15\n\rremote_pubkey\x18\x02 \x01(\t\x12\x15\n\rchannel_point\x18\x03 \x01(\t\x12\x13\n\x07\x63han_id\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x05 \x01(\x03\x12\x15\n\rlocal_balance\x18\x06 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x07 \x01(\x03\x12\x12\n\ncommit_fee\x18\x08 \x01(\x03\x12\x15\n\rcommit_weight\x18\t \x01(\x03\x12\x12\n\nfee_per_kw\x18\n \x01(\x03\x12\x19\n\x11unsettled_balance\x18\x0b \x01(\x03\x12\x1b\n\x13total_satoshis_sent\x18\x0c \x01(\x03\x12\x1f\n\x17total_satoshis_received\x18\r \x01(\x03\x12\x13\n\x0bnum_updates\x18\x0e \x01(\x04\x12"\n\rpending_htlcs\x18\x0f \x03(\x0b\x32\x0b.lnrpc.HTLC\x12\x15\n\tcsv_delay\x18\x10 \x01(\rB\x02\x18\x01\x12\x0f\n\x07private\x18\x11 \x01(\x08\x12\x11\n\tinitiator\x18\x12 \x01(\x08\x12\x19\n\x11\x63han_status_flags\x18\x13 \x01(\t\x12"\n\x16local_chan_reserve_sat\x18\x14 \x01(\x03\x42\x02\x18\x01\x12#\n\x17remote_chan_reserve_sat\x18\x15 \x01(\x03\x42\x02\x18\x01\x12\x1d\n\x11static_remote_key\x18\x16 \x01(\x08\x42\x02\x18\x01\x12.\n\x0f\x63ommitment_type\x18\x1a \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x10\n\x08lifetime\x18\x17 \x01(\x03\x12\x0e\n\x06uptime\x18\x18 \x01(\x03\x12\x15\n\rclose_address\x18\x19 \x01(\t\x12\x17\n\x0fpush_amount_sat\x18\x1b \x01(\x04\x12\x13\n\x0bthaw_height\x18\x1c \x01(\r\x12\x34\n\x11local_constraints\x18\x1d \x01(\x0b\x32\x19.lnrpc.ChannelConstraints\x12\x35\n\x12remote_constraints\x18\x1e \x01(\x0b\x32\x19.lnrpc.ChannelConstraints"z\n\x13ListChannelsRequest\x12\x13\n\x0b\x61\x63tive_only\x18\x01 \x01(\x08\x12\x15\n\rinactive_only\x18\x02 \x01(\x08\x12\x13\n\x0bpublic_only\x18\x03 \x01(\x08\x12\x14\n\x0cprivate_only\x18\x04 \x01(\x08\x12\x0c\n\x04peer\x18\x05 \x01(\x0c"8\n\x14ListChannelsResponse\x12 \n\x08\x63hannels\x18\x0b \x03(\x0b\x32\x0e.lnrpc.Channel"\xa9\x04\n\x13\x43hannelCloseSummary\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchain_hash\x18\x03 \x01(\t\x12\x17\n\x0f\x63losing_tx_hash\x18\x04 \x01(\t\x12\x15\n\rremote_pubkey\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12\x14\n\x0c\x63lose_height\x18\x07 \x01(\r\x12\x17\n\x0fsettled_balance\x18\x08 \x01(\x03\x12\x1b\n\x13time_locked_balance\x18\t \x01(\x03\x12:\n\nclose_type\x18\n \x01(\x0e\x32&.lnrpc.ChannelCloseSummary.ClosureType\x12(\n\x0eopen_initiator\x18\x0b \x01(\x0e\x32\x10.lnrpc.Initiator\x12)\n\x0f\x63lose_initiator\x18\x0c \x01(\x0e\x32\x10.lnrpc.Initiator\x12&\n\x0bresolutions\x18\r \x03(\x0b\x32\x11.lnrpc.Resolution"\x8a\x01\n\x0b\x43losureType\x12\x15\n\x11\x43OOPERATIVE_CLOSE\x10\x00\x12\x15\n\x11LOCAL_FORCE_CLOSE\x10\x01\x12\x16\n\x12REMOTE_FORCE_CLOSE\x10\x02\x12\x10\n\x0c\x42REACH_CLOSE\x10\x03\x12\x14\n\x10\x46UNDING_CANCELED\x10\x04\x12\r\n\tABANDONED\x10\x05"\xb2\x01\n\nResolution\x12.\n\x0fresolution_type\x18\x01 \x01(\x0e\x32\x15.lnrpc.ResolutionType\x12)\n\x07outcome\x18\x02 \x01(\x0e\x32\x18.lnrpc.ResolutionOutcome\x12!\n\x08outpoint\x18\x03 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12\x12\n\namount_sat\x18\x04 \x01(\x04\x12\x12\n\nsweep_txid\x18\x05 \x01(\t"\x94\x01\n\x15\x43losedChannelsRequest\x12\x13\n\x0b\x63ooperative\x18\x01 \x01(\x08\x12\x13\n\x0blocal_force\x18\x02 \x01(\x08\x12\x14\n\x0cremote_force\x18\x03 \x01(\x08\x12\x0e\n\x06\x62reach\x18\x04 \x01(\x08\x12\x18\n\x10\x66unding_canceled\x18\x05 \x01(\x08\x12\x11\n\tabandoned\x18\x06 \x01(\x08"F\n\x16\x43losedChannelsResponse\x12,\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x1a.lnrpc.ChannelCloseSummary"\xef\x03\n\x04Peer\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x64\x64ress\x18\x03 \x01(\t\x12\x12\n\nbytes_sent\x18\x04 \x01(\x04\x12\x12\n\nbytes_recv\x18\x05 \x01(\x04\x12\x10\n\x08sat_sent\x18\x06 \x01(\x03\x12\x10\n\x08sat_recv\x18\x07 \x01(\x03\x12\x0f\n\x07inbound\x18\x08 \x01(\x08\x12\x11\n\tping_time\x18\t \x01(\x03\x12\'\n\tsync_type\x18\n \x01(\x0e\x32\x14.lnrpc.Peer.SyncType\x12+\n\x08\x66\x65\x61tures\x18\x0b \x03(\x0b\x32\x19.lnrpc.Peer.FeaturesEntry\x12\'\n\x06\x65rrors\x18\x0c \x03(\x0b\x32\x17.lnrpc.TimestampedError\x12\x12\n\nflap_count\x18\r \x01(\x05\x12\x14\n\x0clast_flap_ns\x18\x0e \x01(\x03\x12\x19\n\x11last_ping_payload\x18\x0f \x01(\x0c\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"P\n\x08SyncType\x12\x10\n\x0cUNKNOWN_SYNC\x10\x00\x12\x0f\n\x0b\x41\x43TIVE_SYNC\x10\x01\x12\x10\n\x0cPASSIVE_SYNC\x10\x02\x12\x0f\n\x0bPINNED_SYNC\x10\x03"4\n\x10TimestampedError\x12\x11\n\ttimestamp\x18\x01 \x01(\x04\x12\r\n\x05\x65rror\x18\x02 \x01(\t"(\n\x10ListPeersRequest\x12\x14\n\x0clatest_error\x18\x01 \x01(\x08"/\n\x11ListPeersResponse\x12\x1a\n\x05peers\x18\x01 \x03(\x0b\x32\x0b.lnrpc.Peer"\x17\n\x15PeerEventSubscription"v\n\tPeerEvent\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12(\n\x04type\x18\x02 \x01(\x0e\x32\x1a.lnrpc.PeerEvent.EventType".\n\tEventType\x12\x0f\n\x0bPEER_ONLINE\x10\x00\x12\x10\n\x0cPEER_OFFLINE\x10\x01"\x10\n\x0eGetInfoRequest"\xb8\x04\n\x0fGetInfoResponse\x12\x0f\n\x07version\x18\x0e \x01(\t\x12\x13\n\x0b\x63ommit_hash\x18\x14 \x01(\t\x12\x17\n\x0fidentity_pubkey\x18\x01 \x01(\t\x12\r\n\x05\x61lias\x18\x02 \x01(\t\x12\r\n\x05\x63olor\x18\x11 \x01(\t\x12\x1c\n\x14num_pending_channels\x18\x03 \x01(\r\x12\x1b\n\x13num_active_channels\x18\x04 \x01(\r\x12\x1d\n\x15num_inactive_channels\x18\x0f \x01(\r\x12\x11\n\tnum_peers\x18\x05 \x01(\r\x12\x14\n\x0c\x62lock_height\x18\x06 \x01(\r\x12\x12\n\nblock_hash\x18\x08 \x01(\t\x12\x1d\n\x15\x62\x65st_header_timestamp\x18\r \x01(\x03\x12\x17\n\x0fsynced_to_chain\x18\t \x01(\x08\x12\x17\n\x0fsynced_to_graph\x18\x12 \x01(\x08\x12\x13\n\x07testnet\x18\n \x01(\x08\x42\x02\x18\x01\x12\x1c\n\x06\x63hains\x18\x10 \x03(\x0b\x32\x0c.lnrpc.Chain\x12\x0c\n\x04uris\x18\x0c \x03(\t\x12\x36\n\x08\x66\x65\x61tures\x18\x13 \x03(\x0b\x32$.lnrpc.GetInfoResponse.FeaturesEntry\x12 \n\x18require_htlc_interceptor\x18\x15 \x01(\x08\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01J\x04\x08\x0b\x10\x0c"\x18\n\x16GetRecoveryInfoRequest"]\n\x17GetRecoveryInfoResponse\x12\x15\n\rrecovery_mode\x18\x01 \x01(\x08\x12\x19\n\x11recovery_finished\x18\x02 \x01(\x08\x12\x10\n\x08progress\x18\x03 \x01(\x01"\'\n\x05\x43hain\x12\r\n\x05\x63hain\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t"U\n\x12\x43onfirmationUpdate\x12\x11\n\tblock_sha\x18\x01 \x01(\x0c\x12\x14\n\x0c\x62lock_height\x18\x02 \x01(\x05\x12\x16\n\x0enum_confs_left\x18\x03 \x01(\r"?\n\x11\x43hannelOpenUpdate\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint";\n\x12\x43hannelCloseUpdate\x12\x14\n\x0c\x63losing_txid\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08"\xb0\x01\n\x13\x43loseChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\r\n\x05\x66orce\x18\x02 \x01(\x08\x12\x13\n\x0btarget_conf\x18\x03 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10\x64\x65livery_address\x18\x05 \x01(\t\x12\x15\n\rsat_per_vbyte\x18\x06 \x01(\x04"}\n\x11\x43loseStatusUpdate\x12-\n\rclose_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12/\n\nchan_close\x18\x03 \x01(\x0b\x32\x19.lnrpc.ChannelCloseUpdateH\x00\x42\x08\n\x06update"3\n\rPendingUpdate\x12\x0c\n\x04txid\x18\x01 \x01(\x0c\x12\x14\n\x0coutput_index\x18\x02 \x01(\r"T\n\x13ReadyForPsbtFunding\x12\x17\n\x0f\x66unding_address\x18\x01 \x01(\t\x12\x16\n\x0e\x66unding_amount\x18\x02 \x01(\x03\x12\x0c\n\x04psbt\x18\x03 \x01(\x0c"\xad\x01\n\x17\x42\x61tchOpenChannelRequest\x12)\n\x08\x63hannels\x18\x01 \x03(\x0b\x32\x17.lnrpc.BatchOpenChannel\x12\x13\n\x0btarget_conf\x18\x02 \x01(\x05\x12\x15\n\rsat_per_vbyte\x18\x03 \x01(\x03\x12\x11\n\tmin_confs\x18\x04 \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x05 \x01(\x08\x12\r\n\x05label\x18\x06 \x01(\t"\xf9\x01\n\x10\x42\x61tchOpenChannel\x12\x13\n\x0bnode_pubkey\x18\x01 \x01(\x0c\x12\x1c\n\x14local_funding_amount\x18\x02 \x01(\x03\x12\x10\n\x08push_sat\x18\x03 \x01(\x03\x12\x0f\n\x07private\x18\x04 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\x05 \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\x06 \x01(\r\x12\x15\n\rclose_address\x18\x07 \x01(\t\x12\x17\n\x0fpending_chan_id\x18\x08 \x01(\x0c\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType"J\n\x18\x42\x61tchOpenChannelResponse\x12.\n\x10pending_channels\x18\x01 \x03(\x0b\x32\x14.lnrpc.PendingUpdate"\xa1\x04\n\x12OpenChannelRequest\x12\x15\n\rsat_per_vbyte\x18\x01 \x01(\x04\x12\x13\n\x0bnode_pubkey\x18\x02 \x01(\x0c\x12\x1e\n\x12node_pubkey_string\x18\x03 \x01(\tB\x02\x18\x01\x12\x1c\n\x14local_funding_amount\x18\x04 \x01(\x03\x12\x10\n\x08push_sat\x18\x05 \x01(\x03\x12\x13\n\x0btarget_conf\x18\x06 \x01(\x05\x12\x18\n\x0csat_per_byte\x18\x07 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x07private\x18\x08 \x01(\x08\x12\x15\n\rmin_htlc_msat\x18\t \x01(\x03\x12\x18\n\x10remote_csv_delay\x18\n \x01(\r\x12\x11\n\tmin_confs\x18\x0b \x01(\x05\x12\x19\n\x11spend_unconfirmed\x18\x0c \x01(\x08\x12\x15\n\rclose_address\x18\r \x01(\t\x12(\n\x0c\x66unding_shim\x18\x0e \x01(\x0b\x32\x12.lnrpc.FundingShim\x12\'\n\x1fremote_max_value_in_flight_msat\x18\x0f \x01(\x04\x12\x18\n\x10remote_max_htlcs\x18\x10 \x01(\r\x12\x15\n\rmax_local_csv\x18\x11 \x01(\r\x12.\n\x0f\x63ommitment_type\x18\x12 \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x11\n\tzero_conf\x18\x13 \x01(\x08\x12\x12\n\nscid_alias\x18\x14 \x01(\x08"\xc3\x01\n\x10OpenStatusUpdate\x12,\n\x0c\x63han_pending\x18\x01 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12-\n\tchan_open\x18\x03 \x01(\x0b\x32\x18.lnrpc.ChannelOpenUpdateH\x00\x12/\n\tpsbt_fund\x18\x05 \x01(\x0b\x32\x1a.lnrpc.ReadyForPsbtFundingH\x00\x12\x17\n\x0fpending_chan_id\x18\x04 \x01(\x0c\x42\x08\n\x06update"3\n\nKeyLocator\x12\x12\n\nkey_family\x18\x01 \x01(\x05\x12\x11\n\tkey_index\x18\x02 \x01(\x05"J\n\rKeyDescriptor\x12\x15\n\rraw_key_bytes\x18\x01 \x01(\x0c\x12"\n\x07key_loc\x18\x02 \x01(\x0b\x32\x11.lnrpc.KeyLocator"\xb0\x01\n\rChanPointShim\x12\x0b\n\x03\x61mt\x18\x01 \x01(\x03\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\'\n\tlocal_key\x18\x03 \x01(\x0b\x32\x14.lnrpc.KeyDescriptor\x12\x12\n\nremote_key\x18\x04 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x05 \x01(\x0c\x12\x13\n\x0bthaw_height\x18\x06 \x01(\r"J\n\x08PsbtShim\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c\x12\x11\n\tbase_psbt\x18\x02 \x01(\x0c\x12\x12\n\nno_publish\x18\x03 \x01(\x08"l\n\x0b\x46undingShim\x12/\n\x0f\x63han_point_shim\x18\x01 \x01(\x0b\x32\x14.lnrpc.ChanPointShimH\x00\x12$\n\tpsbt_shim\x18\x02 \x01(\x0b\x32\x0f.lnrpc.PsbtShimH\x00\x42\x06\n\x04shim",\n\x11\x46undingShimCancel\x12\x17\n\x0fpending_chan_id\x18\x01 \x01(\x0c"X\n\x11\x46undingPsbtVerify\x12\x13\n\x0b\x66unded_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x15\n\rskip_finalize\x18\x03 \x01(\x08"Y\n\x13\x46undingPsbtFinalize\x12\x13\n\x0bsigned_psbt\x18\x01 \x01(\x0c\x12\x17\n\x0fpending_chan_id\x18\x02 \x01(\x0c\x12\x14\n\x0c\x66inal_raw_tx\x18\x03 \x01(\x0c"\xe5\x01\n\x14\x46undingTransitionMsg\x12+\n\rshim_register\x18\x01 \x01(\x0b\x32\x12.lnrpc.FundingShimH\x00\x12/\n\x0bshim_cancel\x18\x02 \x01(\x0b\x32\x18.lnrpc.FundingShimCancelH\x00\x12/\n\x0bpsbt_verify\x18\x03 \x01(\x0b\x32\x18.lnrpc.FundingPsbtVerifyH\x00\x12\x33\n\rpsbt_finalize\x18\x04 \x01(\x0b\x32\x1a.lnrpc.FundingPsbtFinalizeH\x00\x42\t\n\x07trigger"\x16\n\x14\x46undingStateStepResp"\x86\x01\n\x0bPendingHTLC\x12\x10\n\x08incoming\x18\x01 \x01(\x08\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x03\x12\x10\n\x08outpoint\x18\x03 \x01(\t\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\r\n\x05stage\x18\x06 \x01(\r"\x18\n\x16PendingChannelsRequest"\xf7\r\n\x17PendingChannelsResponse\x12\x1b\n\x13total_limbo_balance\x18\x01 \x01(\x03\x12P\n\x15pending_open_channels\x18\x02 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.PendingOpenChannel\x12R\n\x18pending_closing_channels\x18\x03 \x03(\x0b\x32,.lnrpc.PendingChannelsResponse.ClosedChannelB\x02\x18\x01\x12Y\n\x1epending_force_closing_channels\x18\x04 \x03(\x0b\x32\x31.lnrpc.PendingChannelsResponse.ForceClosedChannel\x12R\n\x16waiting_close_channels\x18\x05 \x03(\x0b\x32\x32.lnrpc.PendingChannelsResponse.WaitingCloseChannel\x1a\xe4\x02\n\x0ePendingChannel\x12\x17\n\x0fremote_node_pub\x18\x01 \x01(\t\x12\x15\n\rchannel_point\x18\x02 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12\x15\n\rlocal_balance\x18\x04 \x01(\x03\x12\x16\n\x0eremote_balance\x18\x05 \x01(\x03\x12\x1e\n\x16local_chan_reserve_sat\x18\x06 \x01(\x03\x12\x1f\n\x17remote_chan_reserve_sat\x18\x07 \x01(\x03\x12#\n\tinitiator\x18\x08 \x01(\x0e\x32\x10.lnrpc.Initiator\x12.\n\x0f\x63ommitment_type\x18\t \x01(\x0e\x32\x15.lnrpc.CommitmentType\x12\x1f\n\x17num_forwarding_packages\x18\n \x01(\x03\x12\x19\n\x11\x63han_status_flags\x18\x0b \x01(\t\x12\x0f\n\x07private\x18\x0c \x01(\x08\x1a\x99\x01\n\x12PendingOpenChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x12\n\ncommit_fee\x18\x04 \x01(\x03\x12\x15\n\rcommit_weight\x18\x05 \x01(\x03\x12\x12\n\nfee_per_kw\x18\x06 \x01(\x03J\x04\x08\x02\x10\x03\x1a\xc3\x01\n\x13WaitingCloseChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x15\n\rlimbo_balance\x18\x02 \x01(\x03\x12?\n\x0b\x63ommitments\x18\x03 \x01(\x0b\x32*.lnrpc.PendingChannelsResponse.Commitments\x12\x14\n\x0c\x63losing_txid\x18\x04 \x01(\t\x1a\xb7\x01\n\x0b\x43ommitments\x12\x12\n\nlocal_txid\x18\x01 \x01(\t\x12\x13\n\x0bremote_txid\x18\x02 \x01(\t\x12\x1b\n\x13remote_pending_txid\x18\x03 \x01(\t\x12\x1c\n\x14local_commit_fee_sat\x18\x04 \x01(\x04\x12\x1d\n\x15remote_commit_fee_sat\x18\x05 \x01(\x04\x12%\n\x1dremote_pending_commit_fee_sat\x18\x06 \x01(\x04\x1a\x65\n\rClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x1a\xff\x02\n\x12\x46orceClosedChannel\x12>\n\x07\x63hannel\x18\x01 \x01(\x0b\x32-.lnrpc.PendingChannelsResponse.PendingChannel\x12\x14\n\x0c\x63losing_txid\x18\x02 \x01(\t\x12\x15\n\rlimbo_balance\x18\x03 \x01(\x03\x12\x17\n\x0fmaturity_height\x18\x04 \x01(\r\x12\x1b\n\x13\x62locks_til_maturity\x18\x05 \x01(\x05\x12\x19\n\x11recovered_balance\x18\x06 \x01(\x03\x12)\n\rpending_htlcs\x18\x08 \x03(\x0b\x32\x12.lnrpc.PendingHTLC\x12M\n\x06\x61nchor\x18\t \x01(\x0e\x32=.lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState"1\n\x0b\x41nchorState\x12\t\n\x05LIMBO\x10\x00\x12\r\n\tRECOVERED\x10\x01\x12\x08\n\x04LOST\x10\x02"\x1a\n\x18\x43hannelEventSubscription"\x93\x04\n\x12\x43hannelEventUpdate\x12&\n\x0copen_channel\x18\x01 \x01(\x0b\x32\x0e.lnrpc.ChannelH\x00\x12\x34\n\x0e\x63losed_channel\x18\x02 \x01(\x0b\x32\x1a.lnrpc.ChannelCloseSummaryH\x00\x12-\n\x0e\x61\x63tive_channel\x18\x03 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12/\n\x10inactive_channel\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x34\n\x14pending_open_channel\x18\x06 \x01(\x0b\x32\x14.lnrpc.PendingUpdateH\x00\x12\x35\n\x16\x66ully_resolved_channel\x18\x07 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x32\n\x04type\x18\x05 \x01(\x0e\x32$.lnrpc.ChannelEventUpdate.UpdateType"\x92\x01\n\nUpdateType\x12\x10\n\x0cOPEN_CHANNEL\x10\x00\x12\x12\n\x0e\x43LOSED_CHANNEL\x10\x01\x12\x12\n\x0e\x41\x43TIVE_CHANNEL\x10\x02\x12\x14\n\x10INACTIVE_CHANNEL\x10\x03\x12\x18\n\x14PENDING_OPEN_CHANNEL\x10\x04\x12\x1a\n\x16\x46ULLY_RESOLVED_CHANNEL\x10\x05\x42\t\n\x07\x63hannel"N\n\x14WalletAccountBalance\x12\x19\n\x11\x63onfirmed_balance\x18\x01 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x02 \x01(\x03"\x16\n\x14WalletBalanceRequest"\xc3\x02\n\x15WalletBalanceResponse\x12\x15\n\rtotal_balance\x18\x01 \x01(\x03\x12\x19\n\x11\x63onfirmed_balance\x18\x02 \x01(\x03\x12\x1b\n\x13unconfirmed_balance\x18\x03 \x01(\x03\x12\x16\n\x0elocked_balance\x18\x05 \x01(\x03\x12$\n\x1creserved_balance_anchor_chan\x18\x06 \x01(\x03\x12I\n\x0f\x61\x63\x63ount_balance\x18\x04 \x03(\x0b\x32\x30.lnrpc.WalletBalanceResponse.AccountBalanceEntry\x1aR\n\x13\x41\x63\x63ountBalanceEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12*\n\x05value\x18\x02 \x01(\x0b\x32\x1b.lnrpc.WalletAccountBalance:\x02\x38\x01"#\n\x06\x41mount\x12\x0b\n\x03sat\x18\x01 \x01(\x04\x12\x0c\n\x04msat\x18\x02 \x01(\x04"\x17\n\x15\x43hannelBalanceRequest"\xe4\x02\n\x16\x43hannelBalanceResponse\x12\x13\n\x07\x62\x61lance\x18\x01 \x01(\x03\x42\x02\x18\x01\x12 \n\x14pending_open_balance\x18\x02 \x01(\x03\x42\x02\x18\x01\x12$\n\rlocal_balance\x18\x03 \x01(\x0b\x32\r.lnrpc.Amount\x12%\n\x0eremote_balance\x18\x04 \x01(\x0b\x32\r.lnrpc.Amount\x12.\n\x17unsettled_local_balance\x18\x05 \x01(\x0b\x32\r.lnrpc.Amount\x12/\n\x18unsettled_remote_balance\x18\x06 \x01(\x0b\x32\r.lnrpc.Amount\x12\x31\n\x1apending_open_local_balance\x18\x07 \x01(\x0b\x32\r.lnrpc.Amount\x12\x32\n\x1bpending_open_remote_balance\x18\x08 \x01(\x0b\x32\r.lnrpc.Amount"\xe3\x04\n\x12QueryRoutesRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12"\n\tfee_limit\x18\x05 \x01(\x0b\x32\x0f.lnrpc.FeeLimit\x12\x15\n\rignored_nodes\x18\x06 \x03(\x0c\x12-\n\rignored_edges\x18\x07 \x03(\x0b\x32\x12.lnrpc.EdgeLocatorB\x02\x18\x01\x12\x16\n\x0esource_pub_key\x18\x08 \x01(\t\x12\x1b\n\x13use_mission_control\x18\t \x01(\x08\x12&\n\rignored_pairs\x18\n \x03(\x0b\x32\x0f.lnrpc.NodePair\x12\x12\n\ncltv_limit\x18\x0b \x01(\r\x12M\n\x13\x64\x65st_custom_records\x18\r \x03(\x0b\x32\x30.lnrpc.QueryRoutesRequest.DestCustomRecordsEntry\x12\x1c\n\x10outgoing_chan_id\x18\x0e \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0flast_hop_pubkey\x18\x0f \x01(\x0c\x12%\n\x0broute_hints\x18\x10 \x03(\x0b\x32\x10.lnrpc.RouteHint\x12(\n\rdest_features\x18\x11 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x11\n\ttime_pref\x18\x12 \x01(\x01\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01J\x04\x08\x03\x10\x04"$\n\x08NodePair\x12\x0c\n\x04\x66rom\x18\x01 \x01(\x0c\x12\n\n\x02to\x18\x02 \x01(\x0c"@\n\x0b\x45\x64geLocator\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\x11\x64irection_reverse\x18\x02 \x01(\x08"I\n\x13QueryRoutesResponse\x12\x1c\n\x06routes\x18\x01 \x03(\x0b\x32\x0c.lnrpc.Route\x12\x14\n\x0csuccess_prob\x18\x02 \x01(\x01"\x96\x03\n\x03Hop\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x19\n\rchan_capacity\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x1a\n\x0e\x61mt_to_forward\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x04 \x01(\x03\x42\x02\x18\x01\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\r\x12\x1b\n\x13\x61mt_to_forward_msat\x18\x06 \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x07 \x01(\x03\x12\x0f\n\x07pub_key\x18\x08 \x01(\t\x12\x17\n\x0btlv_payload\x18\t \x01(\x08\x42\x02\x18\x01\x12$\n\nmpp_record\x18\n \x01(\x0b\x32\x10.lnrpc.MPPRecord\x12$\n\namp_record\x18\x0c \x01(\x0b\x32\x10.lnrpc.AMPRecord\x12\x35\n\x0e\x63ustom_records\x18\x0b \x03(\x0b\x32\x1d.lnrpc.Hop.CustomRecordsEntry\x12\x10\n\x08metadata\x18\r \x01(\x0c\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"9\n\tMPPRecord\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x16\n\x0etotal_amt_msat\x18\n \x01(\x03"D\n\tAMPRecord\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r"\x9a\x01\n\x05Route\x12\x17\n\x0ftotal_time_lock\x18\x01 \x01(\r\x12\x16\n\ntotal_fees\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x15\n\ttotal_amt\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x04hops\x18\x04 \x03(\x0b\x32\n.lnrpc.Hop\x12\x17\n\x0ftotal_fees_msat\x18\x05 \x01(\x03\x12\x16\n\x0etotal_amt_msat\x18\x06 \x01(\x03"<\n\x0fNodeInfoRequest\x12\x0f\n\x07pub_key\x18\x01 \x01(\t\x12\x18\n\x10include_channels\x18\x02 \x01(\x08"\x82\x01\n\x08NodeInfo\x12"\n\x04node\x18\x01 \x01(\x0b\x32\x14.lnrpc.LightningNode\x12\x14\n\x0cnum_channels\x18\x02 \x01(\r\x12\x16\n\x0etotal_capacity\x18\x03 \x01(\x03\x12$\n\x08\x63hannels\x18\x04 \x03(\x0b\x32\x12.lnrpc.ChannelEdge"\xf1\x01\n\rLightningNode\x12\x13\n\x0blast_update\x18\x01 \x01(\r\x12\x0f\n\x07pub_key\x18\x02 \x01(\t\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12%\n\taddresses\x18\x04 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12\x34\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32".lnrpc.LightningNode.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01",\n\x0bNodeAddress\x12\x0f\n\x07network\x18\x01 \x01(\t\x12\x0c\n\x04\x61\x64\x64r\x18\x02 \x01(\t"\xac\x01\n\rRoutingPolicy\x12\x17\n\x0ftime_lock_delta\x18\x01 \x01(\r\x12\x10\n\x08min_htlc\x18\x02 \x01(\x03\x12\x15\n\rfee_base_msat\x18\x03 \x01(\x03\x12\x1b\n\x13\x66\x65\x65_rate_milli_msat\x18\x04 \x01(\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x13\n\x0blast_update\x18\x07 \x01(\r"\xe2\x01\n\x0b\x43hannelEdge\x12\x16\n\nchannel_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nchan_point\x18\x02 \x01(\t\x12\x17\n\x0blast_update\x18\x03 \x01(\rB\x02\x18\x01\x12\x11\n\tnode1_pub\x18\x04 \x01(\t\x12\x11\n\tnode2_pub\x18\x05 \x01(\t\x12\x10\n\x08\x63\x61pacity\x18\x06 \x01(\x03\x12*\n\x0cnode1_policy\x18\x07 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12*\n\x0cnode2_policy\x18\x08 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy"2\n\x13\x43hannelGraphRequest\x12\x1b\n\x13include_unannounced\x18\x01 \x01(\x08"V\n\x0c\x43hannelGraph\x12#\n\x05nodes\x18\x01 \x03(\x0b\x32\x14.lnrpc.LightningNode\x12!\n\x05\x65\x64ges\x18\x02 \x03(\x0b\x32\x12.lnrpc.ChannelEdge":\n\x12NodeMetricsRequest\x12$\n\x05types\x18\x01 \x03(\x0e\x32\x15.lnrpc.NodeMetricType"\xbe\x01\n\x13NodeMetricsResponse\x12U\n\x16\x62\x65tweenness_centrality\x18\x01 \x03(\x0b\x32\x35.lnrpc.NodeMetricsResponse.BetweennessCentralityEntry\x1aP\n\x1a\x42\x65tweennessCentralityEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12!\n\x05value\x18\x02 \x01(\x0b\x32\x12.lnrpc.FloatMetric:\x02\x38\x01"6\n\x0b\x46loatMetric\x12\r\n\x05value\x18\x01 \x01(\x01\x12\x18\n\x10normalized_value\x18\x02 \x01(\x01"&\n\x0f\x43hanInfoRequest\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01"\x14\n\x12NetworkInfoRequest"\xa7\x02\n\x0bNetworkInfo\x12\x16\n\x0egraph_diameter\x18\x01 \x01(\r\x12\x16\n\x0e\x61vg_out_degree\x18\x02 \x01(\x01\x12\x16\n\x0emax_out_degree\x18\x03 \x01(\r\x12\x11\n\tnum_nodes\x18\x04 \x01(\r\x12\x14\n\x0cnum_channels\x18\x05 \x01(\r\x12\x1e\n\x16total_network_capacity\x18\x06 \x01(\x03\x12\x18\n\x10\x61vg_channel_size\x18\x07 \x01(\x01\x12\x18\n\x10min_channel_size\x18\x08 \x01(\x03\x12\x18\n\x10max_channel_size\x18\t \x01(\x03\x12\x1f\n\x17median_channel_size_sat\x18\n \x01(\x03\x12\x18\n\x10num_zombie_chans\x18\x0b \x01(\x04"\r\n\x0bStopRequest"\x0e\n\x0cStopResponse"\x1b\n\x19GraphTopologySubscription"\xa3\x01\n\x13GraphTopologyUpdate\x12\'\n\x0cnode_updates\x18\x01 \x03(\x0b\x32\x11.lnrpc.NodeUpdate\x12\x31\n\x0f\x63hannel_updates\x18\x02 \x03(\x0b\x32\x18.lnrpc.ChannelEdgeUpdate\x12\x30\n\x0c\x63losed_chans\x18\x03 \x03(\x0b\x32\x1a.lnrpc.ClosedChannelUpdate"\x94\x02\n\nNodeUpdate\x12\x15\n\taddresses\x18\x01 \x03(\tB\x02\x18\x01\x12\x14\n\x0cidentity_key\x18\x02 \x01(\t\x12\x1b\n\x0fglobal_features\x18\x03 \x01(\x0c\x42\x02\x18\x01\x12\r\n\x05\x61lias\x18\x04 \x01(\t\x12\r\n\x05\x63olor\x18\x05 \x01(\t\x12*\n\x0enode_addresses\x18\x07 \x03(\x0b\x32\x12.lnrpc.NodeAddress\x12\x31\n\x08\x66\x65\x61tures\x18\x06 \x03(\x0b\x32\x1f.lnrpc.NodeUpdate.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01"\xc4\x01\n\x11\x43hannelEdgeUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\'\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x10\n\x08\x63\x61pacity\x18\x03 \x01(\x03\x12,\n\x0erouting_policy\x18\x04 \x01(\x0b\x32\x14.lnrpc.RoutingPolicy\x12\x18\n\x10\x61\x64vertising_node\x18\x05 \x01(\t\x12\x17\n\x0f\x63onnecting_node\x18\x06 \x01(\t"|\n\x13\x43losedChannelUpdate\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x10\n\x08\x63\x61pacity\x18\x02 \x01(\x03\x12\x15\n\rclosed_height\x18\x03 \x01(\r\x12\'\n\nchan_point\x18\x04 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"\x86\x01\n\x07HopHint\x12\x0f\n\x07node_id\x18\x01 \x01(\t\x12\x13\n\x07\x63han_id\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rfee_base_msat\x18\x03 \x01(\r\x12#\n\x1b\x66\x65\x65_proportional_millionths\x18\x04 \x01(\r\x12\x19\n\x11\x63ltv_expiry_delta\x18\x05 \x01(\r"\x17\n\x05SetID\x12\x0e\n\x06set_id\x18\x01 \x01(\x0c".\n\tRouteHint\x12!\n\thop_hints\x18\x01 \x03(\x0b\x32\x0e.lnrpc.HopHint"{\n\x0f\x41MPInvoiceState\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04\x12\x13\n\x0bsettle_time\x18\x03 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x05 \x01(\x03"\x85\x07\n\x07Invoice\x12\x0c\n\x04memo\x18\x01 \x01(\t\x12\x12\n\nr_preimage\x18\x03 \x01(\x0c\x12\x0e\n\x06r_hash\x18\x04 \x01(\x0c\x12\r\n\x05value\x18\x05 \x01(\x03\x12\x12\n\nvalue_msat\x18\x17 \x01(\x03\x12\x13\n\x07settled\x18\x06 \x01(\x08\x42\x02\x18\x01\x12\x15\n\rcreation_date\x18\x07 \x01(\x03\x12\x13\n\x0bsettle_date\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\n \x01(\x0c\x12\x0e\n\x06\x65xpiry\x18\x0b \x01(\x03\x12\x15\n\rfallback_addr\x18\x0c \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\r \x01(\x04\x12%\n\x0broute_hints\x18\x0e \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x0f\n\x07private\x18\x0f \x01(\x08\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0csettle_index\x18\x11 \x01(\x04\x12\x14\n\x08\x61mt_paid\x18\x12 \x01(\x03\x42\x02\x18\x01\x12\x14\n\x0c\x61mt_paid_sat\x18\x13 \x01(\x03\x12\x15\n\ramt_paid_msat\x18\x14 \x01(\x03\x12*\n\x05state\x18\x15 \x01(\x0e\x32\x1b.lnrpc.Invoice.InvoiceState\x12!\n\x05htlcs\x18\x16 \x03(\x0b\x32\x12.lnrpc.InvoiceHTLC\x12.\n\x08\x66\x65\x61tures\x18\x18 \x03(\x0b\x32\x1c.lnrpc.Invoice.FeaturesEntry\x12\x12\n\nis_keysend\x18\x19 \x01(\x08\x12\x14\n\x0cpayment_addr\x18\x1a \x01(\x0c\x12\x0e\n\x06is_amp\x18\x1b \x01(\x08\x12>\n\x11\x61mp_invoice_state\x18\x1c \x03(\x0b\x32#.lnrpc.Invoice.AmpInvoiceStateEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01\x1aN\n\x14\x41mpInvoiceStateEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.lnrpc.AMPInvoiceState:\x02\x38\x01"A\n\x0cInvoiceState\x12\x08\n\x04OPEN\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x03J\x04\x08\x02\x10\x03"\xf3\x02\n\x0bInvoiceHTLC\x12\x13\n\x07\x63han_id\x18\x01 \x01(\x04\x42\x02\x30\x01\x12\x12\n\nhtlc_index\x18\x02 \x01(\x04\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x04\x12\x15\n\raccept_height\x18\x04 \x01(\x05\x12\x13\n\x0b\x61\x63\x63\x65pt_time\x18\x05 \x01(\x03\x12\x14\n\x0cresolve_time\x18\x06 \x01(\x03\x12\x15\n\rexpiry_height\x18\x07 \x01(\x05\x12&\n\x05state\x18\x08 \x01(\x0e\x32\x17.lnrpc.InvoiceHTLCState\x12=\n\x0e\x63ustom_records\x18\t \x03(\x0b\x32%.lnrpc.InvoiceHTLC.CustomRecordsEntry\x12\x1a\n\x12mpp_total_amt_msat\x18\n \x01(\x04\x12\x17\n\x03\x61mp\x18\x0b \x01(\x0b\x32\n.lnrpc.AMP\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"^\n\x03\x41MP\x12\x12\n\nroot_share\x18\x01 \x01(\x0c\x12\x0e\n\x06set_id\x18\x02 \x01(\x0c\x12\x13\n\x0b\x63hild_index\x18\x03 \x01(\r\x12\x0c\n\x04hash\x18\x04 \x01(\x0c\x12\x10\n\x08preimage\x18\x05 \x01(\x0c"f\n\x12\x41\x64\x64InvoiceResponse\x12\x0e\n\x06r_hash\x18\x01 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x02 \x01(\t\x12\x11\n\tadd_index\x18\x10 \x01(\x04\x12\x14\n\x0cpayment_addr\x18\x11 \x01(\x0c"5\n\x0bPaymentHash\x12\x16\n\nr_hash_str\x18\x01 \x01(\tB\x02\x18\x01\x12\x0e\n\x06r_hash\x18\x02 \x01(\x0c"l\n\x12ListInvoiceRequest\x12\x14\n\x0cpending_only\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x04 \x01(\x04\x12\x18\n\x10num_max_invoices\x18\x05 \x01(\x04\x12\x10\n\x08reversed\x18\x06 \x01(\x08"n\n\x13ListInvoiceResponse\x12 \n\x08invoices\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Invoice\x12\x19\n\x11last_index_offset\x18\x02 \x01(\x04\x12\x1a\n\x12\x66irst_index_offset\x18\x03 \x01(\x04">\n\x13InvoiceSubscription\x12\x11\n\tadd_index\x18\x01 \x01(\x04\x12\x14\n\x0csettle_index\x18\x02 \x01(\x04"\xe0\x03\n\x07Payment\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\t\x12\x11\n\x05value\x18\x02 \x01(\x03\x42\x02\x18\x01\x12\x19\n\rcreation_date\x18\x03 \x01(\x03\x42\x02\x18\x01\x12\x0f\n\x03\x66\x65\x65\x18\x05 \x01(\x03\x42\x02\x18\x01\x12\x18\n\x10payment_preimage\x18\x06 \x01(\t\x12\x11\n\tvalue_sat\x18\x07 \x01(\x03\x12\x12\n\nvalue_msat\x18\x08 \x01(\x03\x12\x17\n\x0fpayment_request\x18\t \x01(\t\x12,\n\x06status\x18\n \x01(\x0e\x32\x1c.lnrpc.Payment.PaymentStatus\x12\x0f\n\x07\x66\x65\x65_sat\x18\x0b \x01(\x03\x12\x10\n\x08\x66\x65\x65_msat\x18\x0c \x01(\x03\x12\x18\n\x10\x63reation_time_ns\x18\r \x01(\x03\x12!\n\x05htlcs\x18\x0e \x03(\x0b\x32\x12.lnrpc.HTLCAttempt\x12\x15\n\rpayment_index\x18\x0f \x01(\x04\x12\x33\n\x0e\x66\x61ilure_reason\x18\x10 \x01(\x0e\x32\x1b.lnrpc.PaymentFailureReason"F\n\rPaymentStatus\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tIN_FLIGHT\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03J\x04\x08\x04\x10\x05"\x8a\x02\n\x0bHTLCAttempt\x12\x12\n\nattempt_id\x18\x07 \x01(\x04\x12-\n\x06status\x18\x01 \x01(\x0e\x32\x1d.lnrpc.HTLCAttempt.HTLCStatus\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x17\n\x0f\x61ttempt_time_ns\x18\x03 \x01(\x03\x12\x17\n\x0fresolve_time_ns\x18\x04 \x01(\x03\x12\x1f\n\x07\x66\x61ilure\x18\x05 \x01(\x0b\x32\x0e.lnrpc.Failure\x12\x10\n\x08preimage\x18\x06 \x01(\x0c"6\n\nHTLCStatus\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02"\x8d\x01\n\x13ListPaymentsRequest\x12\x1a\n\x12include_incomplete\x18\x01 \x01(\x08\x12\x14\n\x0cindex_offset\x18\x02 \x01(\x04\x12\x14\n\x0cmax_payments\x18\x03 \x01(\x04\x12\x10\n\x08reversed\x18\x04 \x01(\x08\x12\x1c\n\x14\x63ount_total_payments\x18\x05 \x01(\x08"\x8b\x01\n\x14ListPaymentsResponse\x12 \n\x08payments\x18\x01 \x03(\x0b\x32\x0e.lnrpc.Payment\x12\x1a\n\x12\x66irst_index_offset\x18\x02 \x01(\x04\x12\x19\n\x11last_index_offset\x18\x03 \x01(\x04\x12\x1a\n\x12total_num_payments\x18\x04 \x01(\x04"G\n\x14\x44\x65letePaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"S\n\x18\x44\x65leteAllPaymentsRequest\x12\x1c\n\x14\x66\x61iled_payments_only\x18\x01 \x01(\x08\x12\x19\n\x11\x66\x61iled_htlcs_only\x18\x02 \x01(\x08"\x17\n\x15\x44\x65letePaymentResponse"\x1b\n\x19\x44\x65leteAllPaymentsResponse"\x86\x01\n\x15\x41\x62\x61ndonChannelRequest\x12*\n\rchannel_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12!\n\x19pending_funding_shim_only\x18\x02 \x01(\x08\x12\x1e\n\x16i_know_what_i_am_doing\x18\x03 \x01(\x08"\x18\n\x16\x41\x62\x61ndonChannelResponse"5\n\x11\x44\x65\x62ugLevelRequest\x12\x0c\n\x04show\x18\x01 \x01(\x08\x12\x12\n\nlevel_spec\x18\x02 \x01(\t")\n\x12\x44\x65\x62ugLevelResponse\x12\x13\n\x0bsub_systems\x18\x01 \x01(\t"\x1f\n\x0cPayReqString\x12\x0f\n\x07pay_req\x18\x01 \x01(\t"\x86\x03\n\x06PayReq\x12\x13\n\x0b\x64\x65stination\x18\x01 \x01(\t\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\t\x12\x14\n\x0cnum_satoshis\x18\x03 \x01(\x03\x12\x11\n\ttimestamp\x18\x04 \x01(\x03\x12\x0e\n\x06\x65xpiry\x18\x05 \x01(\x03\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10\x64\x65scription_hash\x18\x07 \x01(\t\x12\x15\n\rfallback_addr\x18\x08 \x01(\t\x12\x13\n\x0b\x63ltv_expiry\x18\t \x01(\x03\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12\x14\n\x0cpayment_addr\x18\x0b \x01(\x0c\x12\x10\n\x08num_msat\x18\x0c \x01(\x03\x12-\n\x08\x66\x65\x61tures\x18\r \x03(\x0b\x32\x1b.lnrpc.PayReq.FeaturesEntry\x1a?\n\rFeaturesEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x1d\n\x05value\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Feature:\x02\x38\x01">\n\x07\x46\x65\x61ture\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0bis_required\x18\x03 \x01(\x08\x12\x10\n\x08is_known\x18\x04 \x01(\x08"\x12\n\x10\x46\x65\x65ReportRequest"|\n\x10\x43hannelFeeReport\x12\x13\n\x07\x63han_id\x18\x05 \x01(\x04\x42\x02\x30\x01\x12\x15\n\rchannel_point\x18\x01 \x01(\t\x12\x15\n\rbase_fee_msat\x18\x02 \x01(\x03\x12\x13\n\x0b\x66\x65\x65_per_mil\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01"\x84\x01\n\x11\x46\x65\x65ReportResponse\x12-\n\x0c\x63hannel_fees\x18\x01 \x03(\x0b\x32\x17.lnrpc.ChannelFeeReport\x12\x13\n\x0b\x64\x61y_fee_sum\x18\x02 \x01(\x04\x12\x14\n\x0cweek_fee_sum\x18\x03 \x01(\x04\x12\x15\n\rmonth_fee_sum\x18\x04 \x01(\x04"\x82\x02\n\x13PolicyUpdateRequest\x12\x10\n\x06global\x18\x01 \x01(\x08H\x00\x12)\n\nchan_point\x18\x02 \x01(\x0b\x32\x13.lnrpc.ChannelPointH\x00\x12\x15\n\rbase_fee_msat\x18\x03 \x01(\x03\x12\x10\n\x08\x66\x65\x65_rate\x18\x04 \x01(\x01\x12\x14\n\x0c\x66\x65\x65_rate_ppm\x18\t \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x05 \x01(\r\x12\x15\n\rmax_htlc_msat\x18\x06 \x01(\x04\x12\x15\n\rmin_htlc_msat\x18\x07 \x01(\x04\x12\x1f\n\x17min_htlc_msat_specified\x18\x08 \x01(\x08\x42\x07\n\x05scope"m\n\x0c\x46\x61iledUpdate\x12!\n\x08outpoint\x18\x01 \x01(\x0b\x32\x0f.lnrpc.OutPoint\x12$\n\x06reason\x18\x02 \x01(\x0e\x32\x14.lnrpc.UpdateFailure\x12\x14\n\x0cupdate_error\x18\x03 \x01(\t"C\n\x14PolicyUpdateResponse\x12+\n\x0e\x66\x61iled_updates\x18\x01 \x03(\x0b\x32\x13.lnrpc.FailedUpdate"n\n\x18\x46orwardingHistoryRequest\x12\x12\n\nstart_time\x18\x01 \x01(\x04\x12\x10\n\x08\x65nd_time\x18\x02 \x01(\x04\x12\x14\n\x0cindex_offset\x18\x03 \x01(\r\x12\x16\n\x0enum_max_events\x18\x04 \x01(\r"\xda\x01\n\x0f\x46orwardingEvent\x12\x15\n\ttimestamp\x18\x01 \x01(\x04\x42\x02\x18\x01\x12\x16\n\nchan_id_in\x18\x02 \x01(\x04\x42\x02\x30\x01\x12\x17\n\x0b\x63han_id_out\x18\x04 \x01(\x04\x42\x02\x30\x01\x12\x0e\n\x06\x61mt_in\x18\x05 \x01(\x04\x12\x0f\n\x07\x61mt_out\x18\x06 \x01(\x04\x12\x0b\n\x03\x66\x65\x65\x18\x07 \x01(\x04\x12\x10\n\x08\x66\x65\x65_msat\x18\x08 \x01(\x04\x12\x13\n\x0b\x61mt_in_msat\x18\t \x01(\x04\x12\x14\n\x0c\x61mt_out_msat\x18\n \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x0b \x01(\x04"i\n\x19\x46orwardingHistoryResponse\x12\x31\n\x11\x66orwarding_events\x18\x01 \x03(\x0b\x32\x16.lnrpc.ForwardingEvent\x12\x19\n\x11last_offset_index\x18\x02 \x01(\r"E\n\x1a\x45xportChannelBackupRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint"M\n\rChannelBackup\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x13\n\x0b\x63han_backup\x18\x02 \x01(\x0c"V\n\x0fMultiChanBackup\x12(\n\x0b\x63han_points\x18\x01 \x03(\x0b\x32\x13.lnrpc.ChannelPoint\x12\x19\n\x11multi_chan_backup\x18\x02 \x01(\x0c"\x19\n\x17\x43hanBackupExportRequest"{\n\x12\x43hanBackupSnapshot\x12\x32\n\x13single_chan_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackups\x12\x31\n\x11multi_chan_backup\x18\x02 \x01(\x0b\x32\x16.lnrpc.MultiChanBackup"<\n\x0e\x43hannelBackups\x12*\n\x0c\x63han_backups\x18\x01 \x03(\x0b\x32\x14.lnrpc.ChannelBackup"p\n\x18RestoreChanBackupRequest\x12-\n\x0c\x63han_backups\x18\x01 \x01(\x0b\x32\x15.lnrpc.ChannelBackupsH\x00\x12\x1b\n\x11multi_chan_backup\x18\x02 \x01(\x0cH\x00\x42\x08\n\x06\x62\x61\x63kup"\x17\n\x15RestoreBackupResponse"\x1b\n\x19\x43hannelBackupSubscription"\x1a\n\x18VerifyChanBackupResponse"4\n\x12MacaroonPermission\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t"~\n\x13\x42\x61keMacaroonRequest\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x13\n\x0broot_key_id\x18\x02 \x01(\x04\x12"\n\x1a\x61llow_external_permissions\x18\x03 \x01(\x08"(\n\x14\x42\x61keMacaroonResponse\x12\x10\n\x08macaroon\x18\x01 \x01(\t"\x18\n\x16ListMacaroonIDsRequest"/\n\x17ListMacaroonIDsResponse\x12\x14\n\x0croot_key_ids\x18\x01 \x03(\x04".\n\x17\x44\x65leteMacaroonIDRequest\x12\x13\n\x0broot_key_id\x18\x01 \x01(\x04"+\n\x18\x44\x65leteMacaroonIDResponse\x12\x0f\n\x07\x64\x65leted\x18\x01 \x01(\x08"H\n\x16MacaroonPermissionList\x12.\n\x0bpermissions\x18\x01 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission"\x18\n\x16ListPermissionsRequest"\xc5\x01\n\x17ListPermissionsResponse\x12Q\n\x12method_permissions\x18\x01 \x03(\x0b\x32\x35.lnrpc.ListPermissionsResponse.MethodPermissionsEntry\x1aW\n\x16MethodPermissionsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12,\n\x05value\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MacaroonPermissionList:\x02\x38\x01"\xd5\x07\n\x07\x46\x61ilure\x12(\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12,\n\x0e\x63hannel_update\x18\x03 \x01(\x0b\x32\x14.lnrpc.ChannelUpdate\x12\x11\n\thtlc_msat\x18\x04 \x01(\x04\x12\x15\n\ronion_sha_256\x18\x05 \x01(\x0c\x12\x13\n\x0b\x63ltv_expiry\x18\x06 \x01(\r\x12\r\n\x05\x66lags\x18\x07 \x01(\r\x12\x1c\n\x14\x66\x61ilure_source_index\x18\x08 \x01(\r\x12\x0e\n\x06height\x18\t \x01(\r"\xef\x05\n\x0b\x46\x61ilureCode\x12\x0c\n\x08RESERVED\x10\x00\x12(\n$INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS\x10\x01\x12\x1c\n\x18INCORRECT_PAYMENT_AMOUNT\x10\x02\x12\x1f\n\x1b\x46INAL_INCORRECT_CLTV_EXPIRY\x10\x03\x12\x1f\n\x1b\x46INAL_INCORRECT_HTLC_AMOUNT\x10\x04\x12\x19\n\x15\x46INAL_EXPIRY_TOO_SOON\x10\x05\x12\x11\n\rINVALID_REALM\x10\x06\x12\x13\n\x0f\x45XPIRY_TOO_SOON\x10\x07\x12\x19\n\x15INVALID_ONION_VERSION\x10\x08\x12\x16\n\x12INVALID_ONION_HMAC\x10\t\x12\x15\n\x11INVALID_ONION_KEY\x10\n\x12\x18\n\x14\x41MOUNT_BELOW_MINIMUM\x10\x0b\x12\x14\n\x10\x46\x45\x45_INSUFFICIENT\x10\x0c\x12\x19\n\x15INCORRECT_CLTV_EXPIRY\x10\r\x12\x14\n\x10\x43HANNEL_DISABLED\x10\x0e\x12\x1d\n\x19TEMPORARY_CHANNEL_FAILURE\x10\x0f\x12!\n\x1dREQUIRED_NODE_FEATURE_MISSING\x10\x10\x12$\n REQUIRED_CHANNEL_FEATURE_MISSING\x10\x11\x12\x15\n\x11UNKNOWN_NEXT_PEER\x10\x12\x12\x1a\n\x16TEMPORARY_NODE_FAILURE\x10\x13\x12\x1a\n\x16PERMANENT_NODE_FAILURE\x10\x14\x12\x1d\n\x19PERMANENT_CHANNEL_FAILURE\x10\x15\x12\x12\n\x0e\x45XPIRY_TOO_FAR\x10\x16\x12\x0f\n\x0bMPP_TIMEOUT\x10\x17\x12\x19\n\x15INVALID_ONION_PAYLOAD\x10\x18\x12\x15\n\x10INTERNAL_FAILURE\x10\xe5\x07\x12\x14\n\x0fUNKNOWN_FAILURE\x10\xe6\x07\x12\x17\n\x12UNREADABLE_FAILURE\x10\xe7\x07J\x04\x08\x02\x10\x03"\x9a\x02\n\rChannelUpdate\x12\x11\n\tsignature\x18\x01 \x01(\x0c\x12\x12\n\nchain_hash\x18\x02 \x01(\x0c\x12\x13\n\x07\x63han_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x11\n\ttimestamp\x18\x04 \x01(\r\x12\x15\n\rmessage_flags\x18\n \x01(\r\x12\x15\n\rchannel_flags\x18\x05 \x01(\r\x12\x17\n\x0ftime_lock_delta\x18\x06 \x01(\r\x12\x19\n\x11htlc_minimum_msat\x18\x07 \x01(\x04\x12\x10\n\x08\x62\x61se_fee\x18\x08 \x01(\r\x12\x10\n\x08\x66\x65\x65_rate\x18\t \x01(\r\x12\x19\n\x11htlc_maximum_msat\x18\x0b \x01(\x04\x12\x19\n\x11\x65xtra_opaque_data\x18\x0c \x01(\x0c"F\n\nMacaroonId\x12\r\n\x05nonce\x18\x01 \x01(\x0c\x12\x11\n\tstorageId\x18\x02 \x01(\x0c\x12\x16\n\x03ops\x18\x03 \x03(\x0b\x32\t.lnrpc.Op"%\n\x02Op\x12\x0e\n\x06\x65ntity\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63tions\x18\x02 \x03(\t"k\n\x13\x43heckMacPermRequest\x12\x10\n\x08macaroon\x18\x01 \x01(\x0c\x12.\n\x0bpermissions\x18\x02 \x03(\x0b\x32\x19.lnrpc.MacaroonPermission\x12\x12\n\nfullMethod\x18\x03 \x01(\t"%\n\x14\x43heckMacPermResponse\x12\r\n\x05valid\x18\x01 \x01(\x08"\xfa\x01\n\x14RPCMiddlewareRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\x04\x12\x14\n\x0craw_macaroon\x18\x02 \x01(\x0c\x12\x1f\n\x17\x63ustom_caveat_condition\x18\x03 \x01(\t\x12(\n\x0bstream_auth\x18\x04 \x01(\x0b\x32\x11.lnrpc.StreamAuthH\x00\x12$\n\x07request\x18\x05 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12%\n\x08response\x18\x06 \x01(\x0b\x32\x11.lnrpc.RPCMessageH\x00\x12\x0e\n\x06msg_id\x18\x07 \x01(\x04\x42\x10\n\x0eintercept_type"%\n\nStreamAuth\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t"r\n\nRPCMessage\x12\x17\n\x0fmethod_full_uri\x18\x01 \x01(\t\x12\x12\n\nstream_rpc\x18\x02 \x01(\x08\x12\x11\n\ttype_name\x18\x03 \x01(\t\x12\x12\n\nserialized\x18\x04 \x01(\x0c\x12\x10\n\x08is_error\x18\x05 \x01(\x08"\xa2\x01\n\x15RPCMiddlewareResponse\x12\x12\n\nref_msg_id\x18\x01 \x01(\x04\x12\x31\n\x08register\x18\x02 \x01(\x0b\x32\x1d.lnrpc.MiddlewareRegistrationH\x00\x12,\n\x08\x66\x65\x65\x64\x62\x61\x63k\x18\x03 \x01(\x0b\x32\x18.lnrpc.InterceptFeedbackH\x00\x42\x14\n\x12middleware_message"n\n\x16MiddlewareRegistration\x12\x17\n\x0fmiddleware_name\x18\x01 \x01(\t\x12#\n\x1b\x63ustom_macaroon_caveat_name\x18\x02 \x01(\t\x12\x16\n\x0eread_only_mode\x18\x03 \x01(\x08"\\\n\x11InterceptFeedback\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x18\n\x10replace_response\x18\x02 \x01(\x08\x12\x1e\n\x16replacement_serialized\x18\x03 \x01(\x0c*\xa7\x02\n\x10OutputScriptType\x12\x1b\n\x17SCRIPT_TYPE_PUBKEY_HASH\x10\x00\x12\x1b\n\x17SCRIPT_TYPE_SCRIPT_HASH\x10\x01\x12&\n"SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH\x10\x02\x12&\n"SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH\x10\x03\x12\x16\n\x12SCRIPT_TYPE_PUBKEY\x10\x04\x12\x18\n\x14SCRIPT_TYPE_MULTISIG\x10\x05\x12\x18\n\x14SCRIPT_TYPE_NULLDATA\x10\x06\x12\x1c\n\x18SCRIPT_TYPE_NON_STANDARD\x10\x07\x12\x1f\n\x1bSCRIPT_TYPE_WITNESS_UNKNOWN\x10\x08*\xac\x01\n\x0b\x41\x64\x64ressType\x12\x17\n\x13WITNESS_PUBKEY_HASH\x10\x00\x12\x16\n\x12NESTED_PUBKEY_HASH\x10\x01\x12\x1e\n\x1aUNUSED_WITNESS_PUBKEY_HASH\x10\x02\x12\x1d\n\x19UNUSED_NESTED_PUBKEY_HASH\x10\x03\x12\x12\n\x0eTAPROOT_PUBKEY\x10\x04\x12\x19\n\x15UNUSED_TAPROOT_PUBKEY\x10\x05*x\n\x0e\x43ommitmentType\x12\x1b\n\x17UNKNOWN_COMMITMENT_TYPE\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x15\n\x11STATIC_REMOTE_KEY\x10\x02\x12\x0b\n\x07\x41NCHORS\x10\x03\x12\x19\n\x15SCRIPT_ENFORCED_LEASE\x10\x04*a\n\tInitiator\x12\x15\n\x11INITIATOR_UNKNOWN\x10\x00\x12\x13\n\x0fINITIATOR_LOCAL\x10\x01\x12\x14\n\x10INITIATOR_REMOTE\x10\x02\x12\x12\n\x0eINITIATOR_BOTH\x10\x03*`\n\x0eResolutionType\x12\x10\n\x0cTYPE_UNKNOWN\x10\x00\x12\n\n\x06\x41NCHOR\x10\x01\x12\x11\n\rINCOMING_HTLC\x10\x02\x12\x11\n\rOUTGOING_HTLC\x10\x03\x12\n\n\x06\x43OMMIT\x10\x04*q\n\x11ResolutionOutcome\x12\x13\n\x0fOUTCOME_UNKNOWN\x10\x00\x12\x0b\n\x07\x43LAIMED\x10\x01\x12\r\n\tUNCLAIMED\x10\x02\x12\r\n\tABANDONED\x10\x03\x12\x0f\n\x0b\x46IRST_STAGE\x10\x04\x12\x0b\n\x07TIMEOUT\x10\x05*9\n\x0eNodeMetricType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x1a\n\x16\x42\x45TWEENNESS_CENTRALITY\x10\x01*;\n\x10InvoiceHTLCState\x12\x0c\n\x08\x41\x43\x43\x45PTED\x10\x00\x12\x0b\n\x07SETTLED\x10\x01\x12\x0c\n\x08\x43\x41NCELED\x10\x02*\xd9\x01\n\x14PaymentFailureReason\x12\x17\n\x13\x46\x41ILURE_REASON_NONE\x10\x00\x12\x1a\n\x16\x46\x41ILURE_REASON_TIMEOUT\x10\x01\x12\x1b\n\x17\x46\x41ILURE_REASON_NO_ROUTE\x10\x02\x12\x18\n\x14\x46\x41ILURE_REASON_ERROR\x10\x03\x12,\n(FAILURE_REASON_INCORRECT_PAYMENT_DETAILS\x10\x04\x12\'\n#FAILURE_REASON_INSUFFICIENT_BALANCE\x10\x05*\xcf\x04\n\nFeatureBit\x12\x18\n\x14\x44\x41TALOSS_PROTECT_REQ\x10\x00\x12\x18\n\x14\x44\x41TALOSS_PROTECT_OPT\x10\x01\x12\x17\n\x13INITIAL_ROUING_SYNC\x10\x03\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_REQ\x10\x04\x12\x1f\n\x1bUPFRONT_SHUTDOWN_SCRIPT_OPT\x10\x05\x12\x16\n\x12GOSSIP_QUERIES_REQ\x10\x06\x12\x16\n\x12GOSSIP_QUERIES_OPT\x10\x07\x12\x11\n\rTLV_ONION_REQ\x10\x08\x12\x11\n\rTLV_ONION_OPT\x10\t\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_REQ\x10\n\x12\x1a\n\x16\x45XT_GOSSIP_QUERIES_OPT\x10\x0b\x12\x19\n\x15STATIC_REMOTE_KEY_REQ\x10\x0c\x12\x19\n\x15STATIC_REMOTE_KEY_OPT\x10\r\x12\x14\n\x10PAYMENT_ADDR_REQ\x10\x0e\x12\x14\n\x10PAYMENT_ADDR_OPT\x10\x0f\x12\x0b\n\x07MPP_REQ\x10\x10\x12\x0b\n\x07MPP_OPT\x10\x11\x12\x16\n\x12WUMBO_CHANNELS_REQ\x10\x12\x12\x16\n\x12WUMBO_CHANNELS_OPT\x10\x13\x12\x0f\n\x0b\x41NCHORS_REQ\x10\x14\x12\x0f\n\x0b\x41NCHORS_OPT\x10\x15\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_REQ\x10\x16\x12\x1d\n\x19\x41NCHORS_ZERO_FEE_HTLC_OPT\x10\x17\x12\x0b\n\x07\x41MP_REQ\x10\x1e\x12\x0b\n\x07\x41MP_OPT\x10\x1f*\xac\x01\n\rUpdateFailure\x12\x1a\n\x16UPDATE_FAILURE_UNKNOWN\x10\x00\x12\x1a\n\x16UPDATE_FAILURE_PENDING\x10\x01\x12\x1c\n\x18UPDATE_FAILURE_NOT_FOUND\x10\x02\x12\x1f\n\x1bUPDATE_FAILURE_INTERNAL_ERR\x10\x03\x12$\n UPDATE_FAILURE_INVALID_PARAMETER\x10\x04\x32\xc9%\n\tLightning\x12J\n\rWalletBalance\x12\x1b.lnrpc.WalletBalanceRequest\x1a\x1c.lnrpc.WalletBalanceResponse\x12M\n\x0e\x43hannelBalance\x12\x1c.lnrpc.ChannelBalanceRequest\x1a\x1d.lnrpc.ChannelBalanceResponse\x12K\n\x0fGetTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x19.lnrpc.TransactionDetails\x12\x44\n\x0b\x45stimateFee\x12\x19.lnrpc.EstimateFeeRequest\x1a\x1a.lnrpc.EstimateFeeResponse\x12>\n\tSendCoins\x12\x17.lnrpc.SendCoinsRequest\x1a\x18.lnrpc.SendCoinsResponse\x12\x44\n\x0bListUnspent\x12\x19.lnrpc.ListUnspentRequest\x1a\x1a.lnrpc.ListUnspentResponse\x12L\n\x15SubscribeTransactions\x12\x1d.lnrpc.GetTransactionsRequest\x1a\x12.lnrpc.Transaction0\x01\x12;\n\x08SendMany\x12\x16.lnrpc.SendManyRequest\x1a\x17.lnrpc.SendManyResponse\x12\x41\n\nNewAddress\x12\x18.lnrpc.NewAddressRequest\x1a\x19.lnrpc.NewAddressResponse\x12\x44\n\x0bSignMessage\x12\x19.lnrpc.SignMessageRequest\x1a\x1a.lnrpc.SignMessageResponse\x12J\n\rVerifyMessage\x12\x1b.lnrpc.VerifyMessageRequest\x1a\x1c.lnrpc.VerifyMessageResponse\x12\x44\n\x0b\x43onnectPeer\x12\x19.lnrpc.ConnectPeerRequest\x1a\x1a.lnrpc.ConnectPeerResponse\x12M\n\x0e\x44isconnectPeer\x12\x1c.lnrpc.DisconnectPeerRequest\x1a\x1d.lnrpc.DisconnectPeerResponse\x12>\n\tListPeers\x12\x17.lnrpc.ListPeersRequest\x1a\x18.lnrpc.ListPeersResponse\x12G\n\x13SubscribePeerEvents\x12\x1c.lnrpc.PeerEventSubscription\x1a\x10.lnrpc.PeerEvent0\x01\x12\x38\n\x07GetInfo\x12\x15.lnrpc.GetInfoRequest\x1a\x16.lnrpc.GetInfoResponse\x12P\n\x0fGetRecoveryInfo\x12\x1d.lnrpc.GetRecoveryInfoRequest\x1a\x1e.lnrpc.GetRecoveryInfoResponse\x12P\n\x0fPendingChannels\x12\x1d.lnrpc.PendingChannelsRequest\x1a\x1e.lnrpc.PendingChannelsResponse\x12G\n\x0cListChannels\x12\x1a.lnrpc.ListChannelsRequest\x1a\x1b.lnrpc.ListChannelsResponse\x12V\n\x16SubscribeChannelEvents\x12\x1f.lnrpc.ChannelEventSubscription\x1a\x19.lnrpc.ChannelEventUpdate0\x01\x12M\n\x0e\x43losedChannels\x12\x1c.lnrpc.ClosedChannelsRequest\x1a\x1d.lnrpc.ClosedChannelsResponse\x12\x41\n\x0fOpenChannelSync\x12\x19.lnrpc.OpenChannelRequest\x1a\x13.lnrpc.ChannelPoint\x12\x43\n\x0bOpenChannel\x12\x19.lnrpc.OpenChannelRequest\x1a\x17.lnrpc.OpenStatusUpdate0\x01\x12S\n\x10\x42\x61tchOpenChannel\x12\x1e.lnrpc.BatchOpenChannelRequest\x1a\x1f.lnrpc.BatchOpenChannelResponse\x12L\n\x10\x46undingStateStep\x12\x1b.lnrpc.FundingTransitionMsg\x1a\x1b.lnrpc.FundingStateStepResp\x12P\n\x0f\x43hannelAcceptor\x12\x1c.lnrpc.ChannelAcceptResponse\x1a\x1b.lnrpc.ChannelAcceptRequest(\x01\x30\x01\x12\x46\n\x0c\x43loseChannel\x12\x1a.lnrpc.CloseChannelRequest\x1a\x18.lnrpc.CloseStatusUpdate0\x01\x12M\n\x0e\x41\x62\x61ndonChannel\x12\x1c.lnrpc.AbandonChannelRequest\x1a\x1d.lnrpc.AbandonChannelResponse\x12?\n\x0bSendPayment\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12:\n\x0fSendPaymentSync\x12\x12.lnrpc.SendRequest\x1a\x13.lnrpc.SendResponse\x12\x46\n\x0bSendToRoute\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse"\x03\x88\x02\x01(\x01\x30\x01\x12\x41\n\x0fSendToRouteSync\x12\x19.lnrpc.SendToRouteRequest\x1a\x13.lnrpc.SendResponse\x12\x37\n\nAddInvoice\x12\x0e.lnrpc.Invoice\x1a\x19.lnrpc.AddInvoiceResponse\x12\x45\n\x0cListInvoices\x12\x19.lnrpc.ListInvoiceRequest\x1a\x1a.lnrpc.ListInvoiceResponse\x12\x33\n\rLookupInvoice\x12\x12.lnrpc.PaymentHash\x1a\x0e.lnrpc.Invoice\x12\x41\n\x11SubscribeInvoices\x12\x1a.lnrpc.InvoiceSubscription\x1a\x0e.lnrpc.Invoice0\x01\x12\x32\n\x0c\x44\x65\x63odePayReq\x12\x13.lnrpc.PayReqString\x1a\r.lnrpc.PayReq\x12G\n\x0cListPayments\x12\x1a.lnrpc.ListPaymentsRequest\x1a\x1b.lnrpc.ListPaymentsResponse\x12J\n\rDeletePayment\x12\x1b.lnrpc.DeletePaymentRequest\x1a\x1c.lnrpc.DeletePaymentResponse\x12V\n\x11\x44\x65leteAllPayments\x12\x1f.lnrpc.DeleteAllPaymentsRequest\x1a .lnrpc.DeleteAllPaymentsResponse\x12@\n\rDescribeGraph\x12\x1a.lnrpc.ChannelGraphRequest\x1a\x13.lnrpc.ChannelGraph\x12G\n\x0eGetNodeMetrics\x12\x19.lnrpc.NodeMetricsRequest\x1a\x1a.lnrpc.NodeMetricsResponse\x12\x39\n\x0bGetChanInfo\x12\x16.lnrpc.ChanInfoRequest\x1a\x12.lnrpc.ChannelEdge\x12\x36\n\x0bGetNodeInfo\x12\x16.lnrpc.NodeInfoRequest\x1a\x0f.lnrpc.NodeInfo\x12\x44\n\x0bQueryRoutes\x12\x19.lnrpc.QueryRoutesRequest\x1a\x1a.lnrpc.QueryRoutesResponse\x12?\n\x0eGetNetworkInfo\x12\x19.lnrpc.NetworkInfoRequest\x1a\x12.lnrpc.NetworkInfo\x12\x35\n\nStopDaemon\x12\x12.lnrpc.StopRequest\x1a\x13.lnrpc.StopResponse\x12W\n\x15SubscribeChannelGraph\x12 .lnrpc.GraphTopologySubscription\x1a\x1a.lnrpc.GraphTopologyUpdate0\x01\x12\x41\n\nDebugLevel\x12\x18.lnrpc.DebugLevelRequest\x1a\x19.lnrpc.DebugLevelResponse\x12>\n\tFeeReport\x12\x17.lnrpc.FeeReportRequest\x1a\x18.lnrpc.FeeReportResponse\x12N\n\x13UpdateChannelPolicy\x12\x1a.lnrpc.PolicyUpdateRequest\x1a\x1b.lnrpc.PolicyUpdateResponse\x12V\n\x11\x46orwardingHistory\x12\x1f.lnrpc.ForwardingHistoryRequest\x1a .lnrpc.ForwardingHistoryResponse\x12N\n\x13\x45xportChannelBackup\x12!.lnrpc.ExportChannelBackupRequest\x1a\x14.lnrpc.ChannelBackup\x12T\n\x17\x45xportAllChannelBackups\x12\x1e.lnrpc.ChanBackupExportRequest\x1a\x19.lnrpc.ChanBackupSnapshot\x12N\n\x10VerifyChanBackup\x12\x19.lnrpc.ChanBackupSnapshot\x1a\x1f.lnrpc.VerifyChanBackupResponse\x12V\n\x15RestoreChannelBackups\x12\x1f.lnrpc.RestoreChanBackupRequest\x1a\x1c.lnrpc.RestoreBackupResponse\x12X\n\x17SubscribeChannelBackups\x12 .lnrpc.ChannelBackupSubscription\x1a\x19.lnrpc.ChanBackupSnapshot0\x01\x12G\n\x0c\x42\x61keMacaroon\x12\x1a.lnrpc.BakeMacaroonRequest\x1a\x1b.lnrpc.BakeMacaroonResponse\x12P\n\x0fListMacaroonIDs\x12\x1d.lnrpc.ListMacaroonIDsRequest\x1a\x1e.lnrpc.ListMacaroonIDsResponse\x12S\n\x10\x44\x65leteMacaroonID\x12\x1e.lnrpc.DeleteMacaroonIDRequest\x1a\x1f.lnrpc.DeleteMacaroonIDResponse\x12P\n\x0fListPermissions\x12\x1d.lnrpc.ListPermissionsRequest\x1a\x1e.lnrpc.ListPermissionsResponse\x12S\n\x18\x43heckMacaroonPermissions\x12\x1a.lnrpc.CheckMacPermRequest\x1a\x1b.lnrpc.CheckMacPermResponse\x12V\n\x15RegisterRPCMiddleware\x12\x1c.lnrpc.RPCMiddlewareResponse\x1a\x1b.lnrpc.RPCMiddlewareRequest(\x01\x30\x01\x12V\n\x11SendCustomMessage\x12\x1f.lnrpc.SendCustomMessageRequest\x1a .lnrpc.SendCustomMessageResponse\x12X\n\x17SubscribeCustomMessages\x12%.lnrpc.SubscribeCustomMessagesRequest\x1a\x14.lnrpc.CustomMessage0\x01\x42\'Z%github.com/lightningnetwork/lnd/lnrpcb\x06proto3' ) -_ADDRESSTYPE = _descriptor.EnumDescriptor( - name="AddressType", - full_name="lnrpc.AddressType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="WITNESS_PUBKEY_HASH", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="NESTED_PUBKEY_HASH", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNUSED_WITNESS_PUBKEY_HASH", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNUSED_NESTED_PUBKEY_HASH", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26639, - serialized_end=26764, -) -_sym_db.RegisterEnumDescriptor(_ADDRESSTYPE) - +_OUTPUTSCRIPTTYPE = DESCRIPTOR.enum_types_by_name["OutputScriptType"] +OutputScriptType = enum_type_wrapper.EnumTypeWrapper(_OUTPUTSCRIPTTYPE) +_ADDRESSTYPE = DESCRIPTOR.enum_types_by_name["AddressType"] AddressType = enum_type_wrapper.EnumTypeWrapper(_ADDRESSTYPE) -_COMMITMENTTYPE = _descriptor.EnumDescriptor( - name="CommitmentType", - full_name="lnrpc.CommitmentType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_COMMITMENT_TYPE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LEGACY", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SCRIPT_ENFORCED_LEASE", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26766, - serialized_end=26886, -) -_sym_db.RegisterEnumDescriptor(_COMMITMENTTYPE) - +_COMMITMENTTYPE = DESCRIPTOR.enum_types_by_name["CommitmentType"] CommitmentType = enum_type_wrapper.EnumTypeWrapper(_COMMITMENTTYPE) -_INITIATOR = _descriptor.EnumDescriptor( - name="Initiator", - full_name="lnrpc.Initiator", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="INITIATOR_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_LOCAL", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_REMOTE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIATOR_BOTH", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26888, - serialized_end=26985, -) -_sym_db.RegisterEnumDescriptor(_INITIATOR) - +_INITIATOR = DESCRIPTOR.enum_types_by_name["Initiator"] Initiator = enum_type_wrapper.EnumTypeWrapper(_INITIATOR) -_RESOLUTIONTYPE = _descriptor.EnumDescriptor( - name="ResolutionType", - full_name="lnrpc.ResolutionType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHOR", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCOMING_HTLC", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="OUTGOING_HTLC", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="COMMIT", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=26987, - serialized_end=27083, -) -_sym_db.RegisterEnumDescriptor(_RESOLUTIONTYPE) - +_RESOLUTIONTYPE = DESCRIPTOR.enum_types_by_name["ResolutionType"] ResolutionType = enum_type_wrapper.EnumTypeWrapper(_RESOLUTIONTYPE) -_RESOLUTIONOUTCOME = _descriptor.EnumDescriptor( - name="ResolutionOutcome", - full_name="lnrpc.ResolutionOutcome", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OUTCOME_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CLAIMED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNCLAIMED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ABANDONED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FIRST_STAGE", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TIMEOUT", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27085, - serialized_end=27198, -) -_sym_db.RegisterEnumDescriptor(_RESOLUTIONOUTCOME) - +_RESOLUTIONOUTCOME = DESCRIPTOR.enum_types_by_name["ResolutionOutcome"] ResolutionOutcome = enum_type_wrapper.EnumTypeWrapper(_RESOLUTIONOUTCOME) -_NODEMETRICTYPE = _descriptor.EnumDescriptor( - name="NodeMetricType", - full_name="lnrpc.NodeMetricType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="BETWEENNESS_CENTRALITY", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27200, - serialized_end=27257, -) -_sym_db.RegisterEnumDescriptor(_NODEMETRICTYPE) - +_NODEMETRICTYPE = DESCRIPTOR.enum_types_by_name["NodeMetricType"] NodeMetricType = enum_type_wrapper.EnumTypeWrapper(_NODEMETRICTYPE) -_INVOICEHTLCSTATE = _descriptor.EnumDescriptor( - name="InvoiceHTLCState", - full_name="lnrpc.InvoiceHTLCState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="ACCEPTED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SETTLED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27259, - serialized_end=27318, -) -_sym_db.RegisterEnumDescriptor(_INVOICEHTLCSTATE) - +_INVOICEHTLCSTATE = DESCRIPTOR.enum_types_by_name["InvoiceHTLCState"] InvoiceHTLCState = enum_type_wrapper.EnumTypeWrapper(_INVOICEHTLCSTATE) -_PAYMENTFAILUREREASON = _descriptor.EnumDescriptor( - name="PaymentFailureReason", - full_name="lnrpc.PaymentFailureReason", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_NONE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_TIMEOUT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_NO_ROUTE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_ERROR", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_INCORRECT_PAYMENT_DETAILS", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILURE_REASON_INSUFFICIENT_BALANCE", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27321, - serialized_end=27538, -) -_sym_db.RegisterEnumDescriptor(_PAYMENTFAILUREREASON) - +_PAYMENTFAILUREREASON = DESCRIPTOR.enum_types_by_name["PaymentFailureReason"] PaymentFailureReason = enum_type_wrapper.EnumTypeWrapper(_PAYMENTFAILUREREASON) -_FEATUREBIT = _descriptor.EnumDescriptor( - name="FeatureBit", - full_name="lnrpc.FeatureBit", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="DATALOSS_PROTECT_REQ", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="DATALOSS_PROTECT_OPT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INITIAL_ROUING_SYNC", - index=2, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPFRONT_SHUTDOWN_SCRIPT_REQ", - index=3, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPFRONT_SHUTDOWN_SCRIPT_OPT", - index=4, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="GOSSIP_QUERIES_REQ", - index=5, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="GOSSIP_QUERIES_OPT", - index=6, - number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TLV_ONION_REQ", - index=7, - number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TLV_ONION_OPT", - index=8, - number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXT_GOSSIP_QUERIES_REQ", - index=9, - number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXT_GOSSIP_QUERIES_OPT", - index=10, - number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY_REQ", - index=11, - number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="STATIC_REMOTE_KEY_OPT", - index=12, - number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAYMENT_ADDR_REQ", - index=13, - number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PAYMENT_ADDR_OPT", - index=14, - number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_REQ", - index=15, - number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_OPT", - index=16, - number=17, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WUMBO_CHANNELS_REQ", - index=17, - number=18, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="WUMBO_CHANNELS_OPT", - index=18, - number=19, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_REQ", - index=19, - number=20, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_OPT", - index=20, - number=21, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_ZERO_FEE_HTLC_REQ", - index=21, - number=22, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ANCHORS_ZERO_FEE_HTLC_OPT", - index=22, - number=23, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMP_REQ", - index=23, - number=30, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMP_OPT", - index=24, - number=31, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=27541, - serialized_end=28132, -) -_sym_db.RegisterEnumDescriptor(_FEATUREBIT) - +_FEATUREBIT = DESCRIPTOR.enum_types_by_name["FeatureBit"] FeatureBit = enum_type_wrapper.EnumTypeWrapper(_FEATUREBIT) -_UPDATEFAILURE = _descriptor.EnumDescriptor( - name="UpdateFailure", - full_name="lnrpc.UpdateFailure", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_PENDING", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_NOT_FOUND", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_INTERNAL_ERR", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_FAILURE_INVALID_PARAMETER", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=28135, - serialized_end=28307, -) -_sym_db.RegisterEnumDescriptor(_UPDATEFAILURE) - +_UPDATEFAILURE = DESCRIPTOR.enum_types_by_name["UpdateFailure"] UpdateFailure = enum_type_wrapper.EnumTypeWrapper(_UPDATEFAILURE) +SCRIPT_TYPE_PUBKEY_HASH = 0 +SCRIPT_TYPE_SCRIPT_HASH = 1 +SCRIPT_TYPE_WITNESS_V0_PUBKEY_HASH = 2 +SCRIPT_TYPE_WITNESS_V0_SCRIPT_HASH = 3 +SCRIPT_TYPE_PUBKEY = 4 +SCRIPT_TYPE_MULTISIG = 5 +SCRIPT_TYPE_NULLDATA = 6 +SCRIPT_TYPE_NON_STANDARD = 7 +SCRIPT_TYPE_WITNESS_UNKNOWN = 8 WITNESS_PUBKEY_HASH = 0 NESTED_PUBKEY_HASH = 1 UNUSED_WITNESS_PUBKEY_HASH = 2 UNUSED_NESTED_PUBKEY_HASH = 3 +TAPROOT_PUBKEY = 4 +UNUSED_TAPROOT_PUBKEY = 5 UNKNOWN_COMMITMENT_TYPE = 0 LEGACY = 1 STATIC_REMOTE_KEY = 2 @@ -769,20558 +118,270 @@ UPDATE_FAILURE_INTERNAL_ERR = 3 UPDATE_FAILURE_INVALID_PARAMETER = 4 -_CHANNELCLOSESUMMARY_CLOSURETYPE = _descriptor.EnumDescriptor( - name="ClosureType", - full_name="lnrpc.ChannelCloseSummary.ClosureType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="COOPERATIVE_CLOSE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LOCAL_FORCE_CLOSE", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REMOTE_FORCE_CLOSE", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="BREACH_CLOSE", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FUNDING_CANCELED", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ABANDONED", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5664, - serialized_end=5802, -) -_sym_db.RegisterEnumDescriptor(_CHANNELCLOSESUMMARY_CLOSURETYPE) - -_PEER_SYNCTYPE = _descriptor.EnumDescriptor( - name="SyncType", - full_name="lnrpc.Peer.SyncType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_SYNC", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACTIVE_SYNC", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PASSIVE_SYNC", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PINNED_SYNC", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6624, - serialized_end=6704, -) -_sym_db.RegisterEnumDescriptor(_PEER_SYNCTYPE) - -_PEEREVENT_EVENTTYPE = _descriptor.EnumDescriptor( - name="EventType", - full_name="lnrpc.PeerEvent.EventType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="PEER_ONLINE", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PEER_OFFLINE", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6948, - serialized_end=6994, -) -_sym_db.RegisterEnumDescriptor(_PEEREVENT_EVENTTYPE) - -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE = _descriptor.EnumDescriptor( - name="AnchorState", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="LIMBO", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="RECOVERED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="LOST", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=12414, - serialized_end=12463, -) -_sym_db.RegisterEnumDescriptor(_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE) - -_CHANNELEVENTUPDATE_UPDATETYPE = _descriptor.EnumDescriptor( - name="UpdateType", - full_name="lnrpc.ChannelEventUpdate.UpdateType", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OPEN_CHANNEL", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CLOSED_CHANNEL", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACTIVE_CHANNEL", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INACTIVE_CHANNEL", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PENDING_OPEN_CHANNEL", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FULLY_RESOLVED_CHANNEL", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=12868, - serialized_end=13014, -) -_sym_db.RegisterEnumDescriptor(_CHANNELEVENTUPDATE_UPDATETYPE) - -_INVOICE_INVOICESTATE = _descriptor.EnumDescriptor( - name="InvoiceState", - full_name="lnrpc.Invoice.InvoiceState", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="OPEN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SETTLED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CANCELED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="ACCEPTED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=18957, - serialized_end=19022, -) -_sym_db.RegisterEnumDescriptor(_INVOICE_INVOICESTATE) - -_PAYMENT_PAYMENTSTATUS = _descriptor.EnumDescriptor( - name="PaymentStatus", - full_name="lnrpc.Payment.PaymentStatus", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="IN_FLIGHT", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=20350, - serialized_end=20420, -) -_sym_db.RegisterEnumDescriptor(_PAYMENT_PAYMENTSTATUS) - -_HTLCATTEMPT_HTLCSTATUS = _descriptor.EnumDescriptor( - name="HTLCStatus", - full_name="lnrpc.HTLCAttempt.HTLCStatus", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="IN_FLIGHT", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FAILED", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=20641, - serialized_end=20695, -) -_sym_db.RegisterEnumDescriptor(_HTLCATTEMPT_HTLCSTATUS) - -_FAILURE_FAILURECODE = _descriptor.EnumDescriptor( - name="FailureCode", - full_name="lnrpc.Failure.FailureCode", - filename=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - values=[ - _descriptor.EnumValueDescriptor( - name="RESERVED", - index=0, - number=0, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS", - index=1, - number=1, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_PAYMENT_AMOUNT", - index=2, - number=2, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_INCORRECT_CLTV_EXPIRY", - index=3, - number=3, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_INCORRECT_HTLC_AMOUNT", - index=4, - number=4, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FINAL_EXPIRY_TOO_SOON", - index=5, - number=5, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_REALM", - index=6, - number=6, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXPIRY_TOO_SOON", - index=7, - number=7, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_VERSION", - index=8, - number=8, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_HMAC", - index=9, - number=9, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_KEY", - index=10, - number=10, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="AMOUNT_BELOW_MINIMUM", - index=11, - number=11, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="FEE_INSUFFICIENT", - index=12, - number=12, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INCORRECT_CLTV_EXPIRY", - index=13, - number=13, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="CHANNEL_DISABLED", - index=14, - number=14, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TEMPORARY_CHANNEL_FAILURE", - index=15, - number=15, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REQUIRED_NODE_FEATURE_MISSING", - index=16, - number=16, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="REQUIRED_CHANNEL_FEATURE_MISSING", - index=17, - number=17, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNKNOWN_NEXT_PEER", - index=18, - number=18, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="TEMPORARY_NODE_FAILURE", - index=19, - number=19, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PERMANENT_NODE_FAILURE", - index=20, - number=20, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="PERMANENT_CHANNEL_FAILURE", - index=21, - number=21, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="EXPIRY_TOO_FAR", - index=22, - number=22, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="MPP_TIMEOUT", - index=23, - number=23, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INVALID_ONION_PAYLOAD", - index=24, - number=24, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="INTERNAL_FAILURE", - index=25, - number=997, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNKNOWN_FAILURE", - index=26, - number=998, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.EnumValueDescriptor( - name="UNREADABLE_FAILURE", - index=27, - number=999, - serialized_options=None, - type=None, - create_key=_descriptor._internal_create_key, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=24591, - serialized_end=25342, -) -_sym_db.RegisterEnumDescriptor(_FAILURE_FAILURECODE) - - -_SUBSCRIBECUSTOMMESSAGESREQUEST = _descriptor.Descriptor( - name="SubscribeCustomMessagesRequest", - full_name="lnrpc.SubscribeCustomMessagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26, - serialized_end=58, -) - - -_CUSTOMMESSAGE = _descriptor.Descriptor( - name="CustomMessage", - full_name="lnrpc.CustomMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.CustomMessage.peer", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.CustomMessage.type", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="data", - full_name="lnrpc.CustomMessage.data", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=60, - serialized_end=117, -) - - -_SENDCUSTOMMESSAGEREQUEST = _descriptor.Descriptor( - name="SendCustomMessageRequest", - full_name="lnrpc.SendCustomMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.SendCustomMessageRequest.peer", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.SendCustomMessageRequest.type", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="data", - full_name="lnrpc.SendCustomMessageRequest.data", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=119, - serialized_end=187, -) - - -_SENDCUSTOMMESSAGERESPONSE = _descriptor.Descriptor( - name="SendCustomMessageResponse", - full_name="lnrpc.SendCustomMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=189, - serialized_end=216, -) - - -_UTXO = _descriptor.Descriptor( - name="Utxo", - full_name="lnrpc.Utxo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="address_type", - full_name="lnrpc.Utxo.address_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.Utxo.address", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount_sat", - full_name="lnrpc.Utxo.amount_sat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pk_script", - full_name="lnrpc.Utxo.pk_script", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.Utxo.outpoint", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmations", - full_name="lnrpc.Utxo.confirmations", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=219, - serialized_end=381, -) - - -_TRANSACTION = _descriptor.Descriptor( - name="Transaction", - full_name="lnrpc.Transaction", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="tx_hash", - full_name="lnrpc.Transaction.tx_hash", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.Transaction.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_confirmations", - full_name="lnrpc.Transaction.num_confirmations", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_hash", - full_name="lnrpc.Transaction.block_hash", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.Transaction.block_height", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_stamp", - full_name="lnrpc.Transaction.time_stamp", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees", - full_name="lnrpc.Transaction.total_fees", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_addresses", - full_name="lnrpc.Transaction.dest_addresses", - index=7, - number=8, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="raw_tx_hex", - full_name="lnrpc.Transaction.raw_tx_hex", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.Transaction.label", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=384, - serialized_end=598, -) - - -_GETTRANSACTIONSREQUEST = _descriptor.Descriptor( - name="GetTransactionsRequest", - full_name="lnrpc.GetTransactionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="start_height", - full_name="lnrpc.GetTransactionsRequest.start_height", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="end_height", - full_name="lnrpc.GetTransactionsRequest.end_height", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.GetTransactionsRequest.account", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=600, - serialized_end=683, -) - - -_TRANSACTIONDETAILS = _descriptor.Descriptor( - name="TransactionDetails", - full_name="lnrpc.TransactionDetails", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="transactions", - full_name="lnrpc.TransactionDetails.transactions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=685, - serialized_end=747, -) - - -_FEELIMIT = _descriptor.Descriptor( - name="FeeLimit", - full_name="lnrpc.FeeLimit", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="fixed", - full_name="lnrpc.FeeLimit.fixed", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fixed_msat", - full_name="lnrpc.FeeLimit.fixed_msat", - index=1, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="percent", - full_name="lnrpc.FeeLimit.percent", - index=2, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="limit", - full_name="lnrpc.FeeLimit.limit", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=749, - serialized_end=826, -) - - -_SENDREQUEST_DESTCUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="DestCustomRecordsEntry", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.SendRequest.DestCustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1295, - serialized_end=1351, -) - -_SENDREQUEST = _descriptor.Descriptor( - name="SendRequest", - full_name="lnrpc.SendRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="dest", - full_name="lnrpc.SendRequest.dest", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_string", - full_name="lnrpc.SendRequest.dest_string", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.SendRequest.amt", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.SendRequest.amt_msat", - index=3, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendRequest.payment_hash", - index=4, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash_string", - full_name="lnrpc.SendRequest.payment_hash_string", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.SendRequest.payment_request", - index=6, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_cltv_delta", - full_name="lnrpc.SendRequest.final_cltv_delta", - index=7, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_limit", - full_name="lnrpc.SendRequest.fee_limit", - index=8, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outgoing_chan_id", - full_name="lnrpc.SendRequest.outgoing_chan_id", - index=9, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_hop_pubkey", - full_name="lnrpc.SendRequest.last_hop_pubkey", - index=10, - number=13, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_limit", - full_name="lnrpc.SendRequest.cltv_limit", - index=11, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_custom_records", - full_name="lnrpc.SendRequest.dest_custom_records", - index=12, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="allow_self_payment", - full_name="lnrpc.SendRequest.allow_self_payment", - index=13, - number=14, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_features", - full_name="lnrpc.SendRequest.dest_features", - index=14, - number=15, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.SendRequest.payment_addr", - index=15, - number=16, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_SENDREQUEST_DESTCUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=829, - serialized_end=1351, -) - - -_SENDRESPONSE = _descriptor.Descriptor( - name="SendResponse", - full_name="lnrpc.SendResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_error", - full_name="lnrpc.SendResponse.payment_error", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_preimage", - full_name="lnrpc.SendResponse.payment_preimage", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_route", - full_name="lnrpc.SendResponse.payment_route", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendResponse.payment_hash", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1353, - serialized_end=1475, -) - - -_SENDTOROUTEREQUEST = _descriptor.Descriptor( - name="SendToRouteRequest", - full_name="lnrpc.SendToRouteRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.SendToRouteRequest.payment_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash_string", - full_name="lnrpc.SendToRouteRequest.payment_hash_string", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route", - full_name="lnrpc.SendToRouteRequest.route", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1477, - serialized_end=1587, -) - - -_CHANNELACCEPTREQUEST = _descriptor.Descriptor( - name="ChannelAcceptRequest", - full_name="lnrpc.ChannelAcceptRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.ChannelAcceptRequest.node_pubkey", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelAcceptRequest.chain_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChannelAcceptRequest.pending_chan_id", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_amt", - full_name="lnrpc.ChannelAcceptRequest.funding_amt", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_amt", - full_name="lnrpc.ChannelAcceptRequest.push_amt", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dust_limit", - full_name="lnrpc.ChannelAcceptRequest.dust_limit", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_value_in_flight", - full_name="lnrpc.ChannelAcceptRequest.max_value_in_flight", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_reserve", - full_name="lnrpc.ChannelAcceptRequest.channel_reserve", - index=7, - number=8, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc", - full_name="lnrpc.ChannelAcceptRequest.min_htlc", - index=8, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.ChannelAcceptRequest.fee_per_kw", - index=9, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelAcceptRequest.csv_delay", - index=10, - number=11, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_accepted_htlcs", - full_name="lnrpc.ChannelAcceptRequest.max_accepted_htlcs", - index=11, - number=12, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_flags", - full_name="lnrpc.ChannelAcceptRequest.channel_flags", - index=12, - number=13, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.ChannelAcceptRequest.commitment_type", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1590, - serialized_end=1947, -) - - -_CHANNELACCEPTRESPONSE = _descriptor.Descriptor( - name="ChannelAcceptResponse", - full_name="lnrpc.ChannelAcceptResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="accept", - full_name="lnrpc.ChannelAcceptResponse.accept", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChannelAcceptResponse.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.ChannelAcceptResponse.error", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="upfront_shutdown", - full_name="lnrpc.ChannelAcceptResponse.upfront_shutdown", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelAcceptResponse.csv_delay", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reserve_sat", - full_name="lnrpc.ChannelAcceptResponse.reserve_sat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="in_flight_max_msat", - full_name="lnrpc.ChannelAcceptResponse.in_flight_max_msat", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_count", - full_name="lnrpc.ChannelAcceptResponse.max_htlc_count", - index=7, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_in", - full_name="lnrpc.ChannelAcceptResponse.min_htlc_in", - index=8, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_accept_depth", - full_name="lnrpc.ChannelAcceptResponse.min_accept_depth", - index=9, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1950, - serialized_end=2194, -) - - -_CHANNELPOINT = _descriptor.Descriptor( - name="ChannelPoint", - full_name="lnrpc.ChannelPoint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funding_txid_bytes", - full_name="lnrpc.ChannelPoint.funding_txid_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_txid_str", - full_name="lnrpc.ChannelPoint.funding_txid_str", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.ChannelPoint.output_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="funding_txid", - full_name="lnrpc.ChannelPoint.funding_txid", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=2196, - serialized_end=2306, -) - - -_OUTPOINT = _descriptor.Descriptor( - name="OutPoint", - full_name="lnrpc.OutPoint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid_bytes", - full_name="lnrpc.OutPoint.txid_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="txid_str", - full_name="lnrpc.OutPoint.txid_str", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.OutPoint.output_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2308, - serialized_end=2378, -) - - -_LIGHTNINGADDRESS = _descriptor.Descriptor( - name="LightningAddress", - full_name="lnrpc.LightningAddress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pubkey", - full_name="lnrpc.LightningAddress.pubkey", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="host", - full_name="lnrpc.LightningAddress.host", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2380, - serialized_end=2428, -) - - -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY = _descriptor.Descriptor( - name="AddrToAmountEntry", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.EstimateFeeRequest.AddrToAmountEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2587, - serialized_end=2638, -) - -_ESTIMATEFEEREQUEST = _descriptor.Descriptor( - name="EstimateFeeRequest", - full_name="lnrpc.EstimateFeeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="AddrToAmount", - full_name="lnrpc.EstimateFeeRequest.AddrToAmount", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.EstimateFeeRequest.target_conf", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.EstimateFeeRequest.min_confs", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.EstimateFeeRequest.spend_unconfirmed", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2431, - serialized_end=2638, -) - - -_ESTIMATEFEERESPONSE = _descriptor.Descriptor( - name="EstimateFeeResponse", - full_name="lnrpc.EstimateFeeResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="fee_sat", - full_name="lnrpc.EstimateFeeResponse.fee_sat", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="feerate_sat_per_byte", - full_name="lnrpc.EstimateFeeResponse.feerate_sat_per_byte", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.EstimateFeeResponse.sat_per_vbyte", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2640, - serialized_end=2735, -) - - -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY = _descriptor.Descriptor( - name="AddrToAmountEntry", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.SendManyRequest.AddrToAmountEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2587, - serialized_end=2638, -) - -_SENDMANYREQUEST = _descriptor.Descriptor( - name="SendManyRequest", - full_name="lnrpc.SendManyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="AddrToAmount", - full_name="lnrpc.SendManyRequest.AddrToAmount", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.SendManyRequest.target_conf", - index=1, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.SendManyRequest.sat_per_vbyte", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.SendManyRequest.sat_per_byte", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.SendManyRequest.label", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.SendManyRequest.min_confs", - index=5, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.SendManyRequest.spend_unconfirmed", - index=6, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_SENDMANYREQUEST_ADDRTOAMOUNTENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2738, - serialized_end=3003, -) - - -_SENDMANYRESPONSE = _descriptor.Descriptor( - name="SendManyResponse", - full_name="lnrpc.SendManyResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.SendManyResponse.txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3005, - serialized_end=3037, -) - - -_SENDCOINSREQUEST = _descriptor.Descriptor( - name="SendCoinsRequest", - full_name="lnrpc.SendCoinsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.SendCoinsRequest.addr", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.SendCoinsRequest.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.SendCoinsRequest.target_conf", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.SendCoinsRequest.sat_per_vbyte", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.SendCoinsRequest.sat_per_byte", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="send_all", - full_name="lnrpc.SendCoinsRequest.send_all", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.SendCoinsRequest.label", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.SendCoinsRequest.min_confs", - index=7, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.SendCoinsRequest.spend_unconfirmed", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3040, - serialized_end=3237, -) - - -_SENDCOINSRESPONSE = _descriptor.Descriptor( - name="SendCoinsResponse", - full_name="lnrpc.SendCoinsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.SendCoinsResponse.txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3239, - serialized_end=3272, -) - - -_LISTUNSPENTREQUEST = _descriptor.Descriptor( - name="ListUnspentRequest", - full_name="lnrpc.ListUnspentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.ListUnspentRequest.min_confs", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_confs", - full_name="lnrpc.ListUnspentRequest.max_confs", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.ListUnspentRequest.account", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3274, - serialized_end=3349, -) - - -_LISTUNSPENTRESPONSE = _descriptor.Descriptor( - name="ListUnspentResponse", - full_name="lnrpc.ListUnspentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="utxos", - full_name="lnrpc.ListUnspentResponse.utxos", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3351, - serialized_end=3400, -) - - -_NEWADDRESSREQUEST = _descriptor.Descriptor( - name="NewAddressRequest", - full_name="lnrpc.NewAddressRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.NewAddressRequest.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account", - full_name="lnrpc.NewAddressRequest.account", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3402, - serialized_end=3472, -) - - -_NEWADDRESSRESPONSE = _descriptor.Descriptor( - name="NewAddressResponse", - full_name="lnrpc.NewAddressResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.NewAddressResponse.address", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3474, - serialized_end=3511, -) - - -_SIGNMESSAGEREQUEST = _descriptor.Descriptor( - name="SignMessageRequest", - full_name="lnrpc.SignMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="msg", - full_name="lnrpc.SignMessageRequest.msg", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="single_hash", - full_name="lnrpc.SignMessageRequest.single_hash", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3513, - serialized_end=3567, -) - - -_SIGNMESSAGERESPONSE = _descriptor.Descriptor( - name="SignMessageResponse", - full_name="lnrpc.SignMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.SignMessageResponse.signature", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3569, - serialized_end=3609, -) - - -_VERIFYMESSAGEREQUEST = _descriptor.Descriptor( - name="VerifyMessageRequest", - full_name="lnrpc.VerifyMessageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="msg", - full_name="lnrpc.VerifyMessageRequest.msg", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.VerifyMessageRequest.signature", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3611, - serialized_end=3665, -) - - -_VERIFYMESSAGERESPONSE = _descriptor.Descriptor( - name="VerifyMessageResponse", - full_name="lnrpc.VerifyMessageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="valid", - full_name="lnrpc.VerifyMessageResponse.valid", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pubkey", - full_name="lnrpc.VerifyMessageResponse.pubkey", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3667, - serialized_end=3721, -) - - -_CONNECTPEERREQUEST = _descriptor.Descriptor( - name="ConnectPeerRequest", - full_name="lnrpc.ConnectPeerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.ConnectPeerRequest.addr", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="perm", - full_name="lnrpc.ConnectPeerRequest.perm", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timeout", - full_name="lnrpc.ConnectPeerRequest.timeout", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3723, - serialized_end=3813, -) - - -_CONNECTPEERRESPONSE = _descriptor.Descriptor( - name="ConnectPeerResponse", - full_name="lnrpc.ConnectPeerResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3815, - serialized_end=3836, -) - - -_DISCONNECTPEERREQUEST = _descriptor.Descriptor( - name="DisconnectPeerRequest", - full_name="lnrpc.DisconnectPeerRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.DisconnectPeerRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3838, - serialized_end=3878, -) - - -_DISCONNECTPEERRESPONSE = _descriptor.Descriptor( - name="DisconnectPeerResponse", - full_name="lnrpc.DisconnectPeerResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3880, - serialized_end=3904, -) - - -_HTLC = _descriptor.Descriptor( - name="HTLC", - full_name="lnrpc.HTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="incoming", - full_name="lnrpc.HTLC.incoming", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.HTLC.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hash_lock", - full_name="lnrpc.HTLC.hash_lock", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiration_height", - full_name="lnrpc.HTLC.expiration_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_index", - full_name="lnrpc.HTLC.htlc_index", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="forwarding_channel", - full_name="lnrpc.HTLC.forwarding_channel", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="forwarding_htlc_index", - full_name="lnrpc.HTLC.forwarding_htlc_index", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3907, - serialized_end=4072, -) - - -_CHANNELCONSTRAINTS = _descriptor.Descriptor( - name="ChannelConstraints", - full_name="lnrpc.ChannelConstraints", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.ChannelConstraints.csv_delay", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_reserve_sat", - full_name="lnrpc.ChannelConstraints.chan_reserve_sat", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dust_limit_sat", - full_name="lnrpc.ChannelConstraints.dust_limit_sat", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_pending_amt_msat", - full_name="lnrpc.ChannelConstraints.max_pending_amt_msat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.ChannelConstraints.min_htlc_msat", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_accepted_htlcs", - full_name="lnrpc.ChannelConstraints.max_accepted_htlcs", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4075, - serialized_end=4245, -) - - -_CHANNEL = _descriptor.Descriptor( - name="Channel", - full_name="lnrpc.Channel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="active", - full_name="lnrpc.Channel.active", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pubkey", - full_name="lnrpc.Channel.remote_pubkey", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.Channel.channel_point", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.Channel.chan_id", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.Channel.capacity", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.Channel.local_balance", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.Channel.remote_balance", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_fee", - full_name="lnrpc.Channel.commit_fee", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_weight", - full_name="lnrpc.Channel.commit_weight", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.Channel.fee_per_kw", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_balance", - full_name="lnrpc.Channel.unsettled_balance", - index=10, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_satoshis_sent", - full_name="lnrpc.Channel.total_satoshis_sent", - index=11, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_satoshis_received", - full_name="lnrpc.Channel.total_satoshis_received", - index=12, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_updates", - full_name="lnrpc.Channel.num_updates", - index=13, - number=14, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_htlcs", - full_name="lnrpc.Channel.pending_htlcs", - index=14, - number=15, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="csv_delay", - full_name="lnrpc.Channel.csv_delay", - index=15, - number=16, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.Channel.private", - index=16, - number=17, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="initiator", - full_name="lnrpc.Channel.initiator", - index=17, - number=18, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_status_flags", - full_name="lnrpc.Channel.chan_status_flags", - index=18, - number=19, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_chan_reserve_sat", - full_name="lnrpc.Channel.local_chan_reserve_sat", - index=19, - number=20, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_chan_reserve_sat", - full_name="lnrpc.Channel.remote_chan_reserve_sat", - index=20, - number=21, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="static_remote_key", - full_name="lnrpc.Channel.static_remote_key", - index=21, - number=22, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.Channel.commitment_type", - index=22, - number=26, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="lifetime", - full_name="lnrpc.Channel.lifetime", - index=23, - number=23, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="uptime", - full_name="lnrpc.Channel.uptime", - index=24, - number=24, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.Channel.close_address", - index=25, - number=25, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_amount_sat", - full_name="lnrpc.Channel.push_amount_sat", - index=26, - number=27, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="thaw_height", - full_name="lnrpc.Channel.thaw_height", - index=27, - number=28, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_constraints", - full_name="lnrpc.Channel.local_constraints", - index=28, - number=29, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_constraints", - full_name="lnrpc.Channel.remote_constraints", - index=29, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4248, - serialized_end=5064, -) - - -_LISTCHANNELSREQUEST = _descriptor.Descriptor( - name="ListChannelsRequest", - full_name="lnrpc.ListChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="active_only", - full_name="lnrpc.ListChannelsRequest.active_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inactive_only", - full_name="lnrpc.ListChannelsRequest.inactive_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="public_only", - full_name="lnrpc.ListChannelsRequest.public_only", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private_only", - full_name="lnrpc.ListChannelsRequest.private_only", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="peer", - full_name="lnrpc.ListChannelsRequest.peer", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5066, - serialized_end=5188, -) - - -_LISTCHANNELSRESPONSE = _descriptor.Descriptor( - name="ListChannelsResponse", - full_name="lnrpc.ListChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.ListChannelsResponse.channels", - index=0, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5190, - serialized_end=5246, -) - - -_CHANNELCLOSESUMMARY = _descriptor.Descriptor( - name="ChannelCloseSummary", - full_name="lnrpc.ChannelCloseSummary", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelCloseSummary.channel_point", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelCloseSummary.chan_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelCloseSummary.chain_hash", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_tx_hash", - full_name="lnrpc.ChannelCloseSummary.closing_tx_hash", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pubkey", - full_name="lnrpc.ChannelCloseSummary.remote_pubkey", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelCloseSummary.capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_height", - full_name="lnrpc.ChannelCloseSummary.close_height", - index=6, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settled_balance", - full_name="lnrpc.ChannelCloseSummary.settled_balance", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_locked_balance", - full_name="lnrpc.ChannelCloseSummary.time_locked_balance", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_type", - full_name="lnrpc.ChannelCloseSummary.close_type", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="open_initiator", - full_name="lnrpc.ChannelCloseSummary.open_initiator", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_initiator", - full_name="lnrpc.ChannelCloseSummary.close_initiator", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolutions", - full_name="lnrpc.ChannelCloseSummary.resolutions", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CHANNELCLOSESUMMARY_CLOSURETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5249, - serialized_end=5802, -) - - -_RESOLUTION = _descriptor.Descriptor( - name="Resolution", - full_name="lnrpc.Resolution", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="resolution_type", - full_name="lnrpc.Resolution.resolution_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outcome", - full_name="lnrpc.Resolution.outcome", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.Resolution.outpoint", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount_sat", - full_name="lnrpc.Resolution.amount_sat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sweep_txid", - full_name="lnrpc.Resolution.sweep_txid", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5805, - serialized_end=5983, -) - - -_CLOSEDCHANNELSREQUEST = _descriptor.Descriptor( - name="ClosedChannelsRequest", - full_name="lnrpc.ClosedChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="cooperative", - full_name="lnrpc.ClosedChannelsRequest.cooperative", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_force", - full_name="lnrpc.ClosedChannelsRequest.local_force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_force", - full_name="lnrpc.ClosedChannelsRequest.remote_force", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="breach", - full_name="lnrpc.ClosedChannelsRequest.breach", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_canceled", - full_name="lnrpc.ClosedChannelsRequest.funding_canceled", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="abandoned", - full_name="lnrpc.ClosedChannelsRequest.abandoned", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5986, - serialized_end=6134, -) - - -_CLOSEDCHANNELSRESPONSE = _descriptor.Descriptor( - name="ClosedChannelsResponse", - full_name="lnrpc.ClosedChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.ClosedChannelsResponse.channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6136, - serialized_end=6206, -) - - -_PEER_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.Peer.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Peer.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Peer.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_PEER = _descriptor.Descriptor( - name="Peer", - full_name="lnrpc.Peer", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.Peer.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="lnrpc.Peer.address", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bytes_sent", - full_name="lnrpc.Peer.bytes_sent", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="bytes_recv", - full_name="lnrpc.Peer.bytes_recv", - index=3, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_sent", - full_name="lnrpc.Peer.sat_sent", - index=4, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_recv", - full_name="lnrpc.Peer.sat_recv", - index=5, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inbound", - full_name="lnrpc.Peer.inbound", - index=6, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ping_time", - full_name="lnrpc.Peer.ping_time", - index=7, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sync_type", - full_name="lnrpc.Peer.sync_type", - index=8, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.Peer.features", - index=9, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="errors", - full_name="lnrpc.Peer.errors", - index=10, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="flap_count", - full_name="lnrpc.Peer.flap_count", - index=11, - number=13, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_flap_ns", - full_name="lnrpc.Peer.last_flap_ns", - index=12, - number=14, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_ping_payload", - full_name="lnrpc.Peer.last_ping_payload", - index=13, - number=15, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_PEER_FEATURESENTRY], - enum_types=[_PEER_SYNCTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6209, - serialized_end=6704, -) - - -_TIMESTAMPEDERROR = _descriptor.Descriptor( - name="TimestampedError", - full_name="lnrpc.TimestampedError", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.TimestampedError.timestamp", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.TimestampedError.error", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6706, - serialized_end=6758, -) - - -_LISTPEERSREQUEST = _descriptor.Descriptor( - name="ListPeersRequest", - full_name="lnrpc.ListPeersRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="latest_error", - full_name="lnrpc.ListPeersRequest.latest_error", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6760, - serialized_end=6800, -) - - -_LISTPEERSRESPONSE = _descriptor.Descriptor( - name="ListPeersResponse", - full_name="lnrpc.ListPeersResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="peers", - full_name="lnrpc.ListPeersResponse.peers", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6802, - serialized_end=6849, -) - - -_PEEREVENTSUBSCRIPTION = _descriptor.Descriptor( - name="PeerEventSubscription", - full_name="lnrpc.PeerEventSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6851, - serialized_end=6874, -) - - -_PEEREVENT = _descriptor.Descriptor( - name="PeerEvent", - full_name="lnrpc.PeerEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.PeerEvent.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.PeerEvent.type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PEEREVENT_EVENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6876, - serialized_end=6994, -) - - -_GETINFOREQUEST = _descriptor.Descriptor( - name="GetInfoRequest", - full_name="lnrpc.GetInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6996, - serialized_end=7012, -) - - -_GETINFORESPONSE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.GetInfoResponse.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.GetInfoResponse.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.GetInfoResponse.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_GETINFORESPONSE = _descriptor.Descriptor( - name="GetInfoResponse", - full_name="lnrpc.GetInfoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="version", - full_name="lnrpc.GetInfoResponse.version", - index=0, - number=14, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_hash", - full_name="lnrpc.GetInfoResponse.commit_hash", - index=1, - number=20, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="identity_pubkey", - full_name="lnrpc.GetInfoResponse.identity_pubkey", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.GetInfoResponse.alias", - index=3, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.GetInfoResponse.color", - index=4, - number=17, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_pending_channels", - full_name="lnrpc.GetInfoResponse.num_pending_channels", - index=5, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_active_channels", - full_name="lnrpc.GetInfoResponse.num_active_channels", - index=6, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_inactive_channels", - full_name="lnrpc.GetInfoResponse.num_inactive_channels", - index=7, - number=15, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_peers", - full_name="lnrpc.GetInfoResponse.num_peers", - index=8, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.GetInfoResponse.block_height", - index=9, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_hash", - full_name="lnrpc.GetInfoResponse.block_hash", - index=10, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="best_header_timestamp", - full_name="lnrpc.GetInfoResponse.best_header_timestamp", - index=11, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="synced_to_chain", - full_name="lnrpc.GetInfoResponse.synced_to_chain", - index=12, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="synced_to_graph", - full_name="lnrpc.GetInfoResponse.synced_to_graph", - index=13, - number=18, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="testnet", - full_name="lnrpc.GetInfoResponse.testnet", - index=14, - number=10, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chains", - full_name="lnrpc.GetInfoResponse.chains", - index=15, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="uris", - full_name="lnrpc.GetInfoResponse.uris", - index=16, - number=12, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.GetInfoResponse.features", - index=17, - number=19, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_GETINFORESPONSE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7015, - serialized_end=7549, -) - - -_GETRECOVERYINFOREQUEST = _descriptor.Descriptor( - name="GetRecoveryInfoRequest", - full_name="lnrpc.GetRecoveryInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7551, - serialized_end=7575, -) - - -_GETRECOVERYINFORESPONSE = _descriptor.Descriptor( - name="GetRecoveryInfoResponse", - full_name="lnrpc.GetRecoveryInfoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="recovery_mode", - full_name="lnrpc.GetRecoveryInfoResponse.recovery_mode", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="recovery_finished", - full_name="lnrpc.GetRecoveryInfoResponse.recovery_finished", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="progress", - full_name="lnrpc.GetRecoveryInfoResponse.progress", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7577, - serialized_end=7670, -) - - -_CHAIN = _descriptor.Descriptor( - name="Chain", - full_name="lnrpc.Chain", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chain", - full_name="lnrpc.Chain.chain", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="network", - full_name="lnrpc.Chain.network", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7672, - serialized_end=7711, -) - - -_CONFIRMATIONUPDATE = _descriptor.Descriptor( - name="ConfirmationUpdate", - full_name="lnrpc.ConfirmationUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="block_sha", - full_name="lnrpc.ConfirmationUpdate.block_sha", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="block_height", - full_name="lnrpc.ConfirmationUpdate.block_height", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_confs_left", - full_name="lnrpc.ConfirmationUpdate.num_confs_left", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7713, - serialized_end=7798, -) - - -_CHANNELOPENUPDATE = _descriptor.Descriptor( - name="ChannelOpenUpdate", - full_name="lnrpc.ChannelOpenUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelOpenUpdate.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7800, - serialized_end=7863, -) - - -_CHANNELCLOSEUPDATE = _descriptor.Descriptor( - name="ChannelCloseUpdate", - full_name="lnrpc.ChannelCloseUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.ChannelCloseUpdate.closing_txid", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="success", - full_name="lnrpc.ChannelCloseUpdate.success", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7865, - serialized_end=7924, -) - - -_CLOSECHANNELREQUEST = _descriptor.Descriptor( - name="CloseChannelRequest", - full_name="lnrpc.CloseChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.CloseChannelRequest.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="force", - full_name="lnrpc.CloseChannelRequest.force", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.CloseChannelRequest.target_conf", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.CloseChannelRequest.sat_per_byte", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="delivery_address", - full_name="lnrpc.CloseChannelRequest.delivery_address", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.CloseChannelRequest.sat_per_vbyte", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7927, - serialized_end=8103, -) - - -_CLOSESTATUSUPDATE = _descriptor.Descriptor( - name="CloseStatusUpdate", - full_name="lnrpc.CloseStatusUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="close_pending", - full_name="lnrpc.CloseStatusUpdate.close_pending", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_close", - full_name="lnrpc.CloseStatusUpdate.chan_close", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="update", - full_name="lnrpc.CloseStatusUpdate.update", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=8105, - serialized_end=8230, -) - - -_PENDINGUPDATE = _descriptor.Descriptor( - name="PendingUpdate", - full_name="lnrpc.PendingUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="txid", - full_name="lnrpc.PendingUpdate.txid", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="output_index", - full_name="lnrpc.PendingUpdate.output_index", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8232, - serialized_end=8283, -) - - -_READYFORPSBTFUNDING = _descriptor.Descriptor( - name="ReadyForPsbtFunding", - full_name="lnrpc.ReadyForPsbtFunding", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funding_address", - full_name="lnrpc.ReadyForPsbtFunding.funding_address", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_amount", - full_name="lnrpc.ReadyForPsbtFunding.funding_amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt", - full_name="lnrpc.ReadyForPsbtFunding.psbt", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8285, - serialized_end=8369, -) - - -_BATCHOPENCHANNELREQUEST = _descriptor.Descriptor( - name="BatchOpenChannelRequest", - full_name="lnrpc.BatchOpenChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.BatchOpenChannelRequest.channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.BatchOpenChannelRequest.target_conf", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.BatchOpenChannelRequest.sat_per_vbyte", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.BatchOpenChannelRequest.min_confs", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.BatchOpenChannelRequest.spend_unconfirmed", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="label", - full_name="lnrpc.BatchOpenChannelRequest.label", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8372, - serialized_end=8545, -) - - -_BATCHOPENCHANNEL = _descriptor.Descriptor( - name="BatchOpenChannel", - full_name="lnrpc.BatchOpenChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.BatchOpenChannel.node_pubkey", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_funding_amount", - full_name="lnrpc.BatchOpenChannel.local_funding_amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_sat", - full_name="lnrpc.BatchOpenChannel.push_sat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.BatchOpenChannel.private", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.BatchOpenChannel.min_htlc_msat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_csv_delay", - full_name="lnrpc.BatchOpenChannel.remote_csv_delay", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.BatchOpenChannel.close_address", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.BatchOpenChannel.pending_chan_id", - index=7, - number=8, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.BatchOpenChannel.commitment_type", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8548, - serialized_end=8797, -) - - -_BATCHOPENCHANNELRESPONSE = _descriptor.Descriptor( - name="BatchOpenChannelResponse", - full_name="lnrpc.BatchOpenChannelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_channels", - full_name="lnrpc.BatchOpenChannelResponse.pending_channels", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8799, - serialized_end=8873, -) - - -_OPENCHANNELREQUEST = _descriptor.Descriptor( - name="OpenChannelRequest", - full_name="lnrpc.OpenChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sat_per_vbyte", - full_name="lnrpc.OpenChannelRequest.sat_per_vbyte", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_pubkey", - full_name="lnrpc.OpenChannelRequest.node_pubkey", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_pubkey_string", - full_name="lnrpc.OpenChannelRequest.node_pubkey_string", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_funding_amount", - full_name="lnrpc.OpenChannelRequest.local_funding_amount", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="push_sat", - full_name="lnrpc.OpenChannelRequest.push_sat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="target_conf", - full_name="lnrpc.OpenChannelRequest.target_conf", - index=5, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="sat_per_byte", - full_name="lnrpc.OpenChannelRequest.sat_per_byte", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.OpenChannelRequest.private", - index=7, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.OpenChannelRequest.min_htlc_msat", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_csv_delay", - full_name="lnrpc.OpenChannelRequest.remote_csv_delay", - index=9, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_confs", - full_name="lnrpc.OpenChannelRequest.min_confs", - index=10, - number=11, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="spend_unconfirmed", - full_name="lnrpc.OpenChannelRequest.spend_unconfirmed", - index=11, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="close_address", - full_name="lnrpc.OpenChannelRequest.close_address", - index=12, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="funding_shim", - full_name="lnrpc.OpenChannelRequest.funding_shim", - index=13, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_max_value_in_flight_msat", - full_name="lnrpc.OpenChannelRequest.remote_max_value_in_flight_msat", - index=14, - number=15, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_max_htlcs", - full_name="lnrpc.OpenChannelRequest.remote_max_htlcs", - index=15, - number=16, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_local_csv", - full_name="lnrpc.OpenChannelRequest.max_local_csv", - index=16, - number=17, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.OpenChannelRequest.commitment_type", - index=17, - number=18, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8876, - serialized_end=9382, -) - - -_OPENSTATUSUPDATE = _descriptor.Descriptor( - name="OpenStatusUpdate", - full_name="lnrpc.OpenStatusUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_pending", - full_name="lnrpc.OpenStatusUpdate.chan_pending", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_open", - full_name="lnrpc.OpenStatusUpdate.chan_open", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_fund", - full_name="lnrpc.OpenStatusUpdate.psbt_fund", - index=2, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.OpenStatusUpdate.pending_chan_id", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="update", - full_name="lnrpc.OpenStatusUpdate.update", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=9385, - serialized_end=9580, -) - - -_KEYLOCATOR = _descriptor.Descriptor( - name="KeyLocator", - full_name="lnrpc.KeyLocator", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key_family", - full_name="lnrpc.KeyLocator.key_family", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="key_index", - full_name="lnrpc.KeyLocator.key_index", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9582, - serialized_end=9633, -) - - -_KEYDESCRIPTOR = _descriptor.Descriptor( - name="KeyDescriptor", - full_name="lnrpc.KeyDescriptor", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="raw_key_bytes", - full_name="lnrpc.KeyDescriptor.raw_key_bytes", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="key_loc", - full_name="lnrpc.KeyDescriptor.key_loc", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9635, - serialized_end=9709, -) - - -_CHANPOINTSHIM = _descriptor.Descriptor( - name="ChanPointShim", - full_name="lnrpc.ChanPointShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.ChanPointShim.amt", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChanPointShim.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_key", - full_name="lnrpc.ChanPointShim.local_key", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_key", - full_name="lnrpc.ChanPointShim.remote_key", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.ChanPointShim.pending_chan_id", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="thaw_height", - full_name="lnrpc.ChanPointShim.thaw_height", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9712, - serialized_end=9888, -) - - -_PSBTSHIM = _descriptor.Descriptor( - name="PsbtShim", - full_name="lnrpc.PsbtShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.PsbtShim.pending_chan_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_psbt", - full_name="lnrpc.PsbtShim.base_psbt", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="no_publish", - full_name="lnrpc.PsbtShim.no_publish", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=9890, - serialized_end=9964, -) - - -_FUNDINGSHIM = _descriptor.Descriptor( - name="FundingShim", - full_name="lnrpc.FundingShim", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point_shim", - full_name="lnrpc.FundingShim.chan_point_shim", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_shim", - full_name="lnrpc.FundingShim.psbt_shim", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="shim", - full_name="lnrpc.FundingShim.shim", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=9966, - serialized_end=10074, -) - - -_FUNDINGSHIMCANCEL = _descriptor.Descriptor( - name="FundingShimCancel", - full_name="lnrpc.FundingShimCancel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingShimCancel.pending_chan_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10076, - serialized_end=10120, -) - - -_FUNDINGPSBTVERIFY = _descriptor.Descriptor( - name="FundingPsbtVerify", - full_name="lnrpc.FundingPsbtVerify", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="funded_psbt", - full_name="lnrpc.FundingPsbtVerify.funded_psbt", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingPsbtVerify.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="skip_finalize", - full_name="lnrpc.FundingPsbtVerify.skip_finalize", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10122, - serialized_end=10210, -) - - -_FUNDINGPSBTFINALIZE = _descriptor.Descriptor( - name="FundingPsbtFinalize", - full_name="lnrpc.FundingPsbtFinalize", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signed_psbt", - full_name="lnrpc.FundingPsbtFinalize.signed_psbt", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_chan_id", - full_name="lnrpc.FundingPsbtFinalize.pending_chan_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_raw_tx", - full_name="lnrpc.FundingPsbtFinalize.final_raw_tx", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10212, - serialized_end=10301, -) - - -_FUNDINGTRANSITIONMSG = _descriptor.Descriptor( - name="FundingTransitionMsg", - full_name="lnrpc.FundingTransitionMsg", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="shim_register", - full_name="lnrpc.FundingTransitionMsg.shim_register", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="shim_cancel", - full_name="lnrpc.FundingTransitionMsg.shim_cancel", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_verify", - full_name="lnrpc.FundingTransitionMsg.psbt_verify", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="psbt_finalize", - full_name="lnrpc.FundingTransitionMsg.psbt_finalize", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="trigger", - full_name="lnrpc.FundingTransitionMsg.trigger", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=10304, - serialized_end=10533, -) - - -_FUNDINGSTATESTEPRESP = _descriptor.Descriptor( - name="FundingStateStepResp", - full_name="lnrpc.FundingStateStepResp", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10535, - serialized_end=10557, -) - - -_PENDINGHTLC = _descriptor.Descriptor( - name="PendingHTLC", - full_name="lnrpc.PendingHTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="incoming", - full_name="lnrpc.PendingHTLC.incoming", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="lnrpc.PendingHTLC.amount", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.PendingHTLC.outpoint", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="maturity_height", - full_name="lnrpc.PendingHTLC.maturity_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="blocks_til_maturity", - full_name="lnrpc.PendingHTLC.blocks_til_maturity", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stage", - full_name="lnrpc.PendingHTLC.stage", - index=5, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10560, - serialized_end=10694, -) - - -_PENDINGCHANNELSREQUEST = _descriptor.Descriptor( - name="PendingChannelsRequest", - full_name="lnrpc.PendingChannelsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10696, - serialized_end=10720, -) - - -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL = _descriptor.Descriptor( - name="PendingChannel", - full_name="lnrpc.PendingChannelsResponse.PendingChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="remote_node_pub", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_node_pub", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.channel_point", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.local_balance", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_balance", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_chan_reserve_sat", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.local_chan_reserve_sat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_chan_reserve_sat", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.remote_chan_reserve_sat", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="initiator", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.initiator", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitment_type", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.commitment_type", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_forwarding_packages", - full_name="lnrpc.PendingChannelsResponse.PendingChannel.num_forwarding_packages", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11121, - serialized_end=11433, -) - -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL = _descriptor.Descriptor( - name="PendingOpenChannel", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmation_height", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.confirmation_height", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_fee", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.commit_fee", - index=2, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commit_weight", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.commit_weight", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_kw", - full_name="lnrpc.PendingChannelsResponse.PendingOpenChannel.fee_per_kw", - index=4, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11436, - serialized_end=11612, -) - -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL = _descriptor.Descriptor( - name="WaitingCloseChannel", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="limbo_balance", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.limbo_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="commitments", - full_name="lnrpc.PendingChannelsResponse.WaitingCloseChannel.commitments", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11615, - serialized_end=11788, -) - -_PENDINGCHANNELSRESPONSE_COMMITMENTS = _descriptor.Descriptor( - name="Commitments", - full_name="lnrpc.PendingChannelsResponse.Commitments", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="local_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.local_txid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pending_txid", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_pending_txid", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.local_commit_fee_sat", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_commit_fee_sat", - index=4, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_pending_commit_fee_sat", - full_name="lnrpc.PendingChannelsResponse.Commitments.remote_pending_commit_fee_sat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11791, - serialized_end=11974, -) - -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL = _descriptor.Descriptor( - name="ClosedChannel", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.PendingChannelsResponse.ClosedChannel.closing_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=11976, - serialized_end=12077, -) - -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL = _descriptor.Descriptor( - name="ForceClosedChannel", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closing_txid", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.closing_txid", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="limbo_balance", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.limbo_balance", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="maturity_height", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.maturity_height", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="blocks_til_maturity", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.blocks_til_maturity", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="recovered_balance", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.recovered_balance", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_htlcs", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.pending_htlcs", - index=6, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="anchor", - full_name="lnrpc.PendingChannelsResponse.ForceClosedChannel.anchor", - index=7, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12080, - serialized_end=12463, -) - -_PENDINGCHANNELSRESPONSE = _descriptor.Descriptor( - name="PendingChannelsResponse", - full_name="lnrpc.PendingChannelsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_limbo_balance", - full_name="lnrpc.PendingChannelsResponse.total_limbo_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_channels", - full_name="lnrpc.PendingChannelsResponse.pending_open_channels", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_closing_channels", - full_name="lnrpc.PendingChannelsResponse.pending_closing_channels", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_force_closing_channels", - full_name="lnrpc.PendingChannelsResponse.pending_force_closing_channels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="waiting_close_channels", - full_name="lnrpc.PendingChannelsResponse.waiting_close_channels", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[ - _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL, - _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL, - _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL, - _PENDINGCHANNELSRESPONSE_COMMITMENTS, - _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL, - _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=10723, - serialized_end=12463, -) - - -_CHANNELEVENTSUBSCRIPTION = _descriptor.Descriptor( - name="ChannelEventSubscription", - full_name="lnrpc.ChannelEventSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=12465, - serialized_end=12491, -) - - -_CHANNELEVENTUPDATE = _descriptor.Descriptor( - name="ChannelEventUpdate", - full_name="lnrpc.ChannelEventUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="open_channel", - full_name="lnrpc.ChannelEventUpdate.open_channel", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_channel", - full_name="lnrpc.ChannelEventUpdate.closed_channel", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="active_channel", - full_name="lnrpc.ChannelEventUpdate.active_channel", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="inactive_channel", - full_name="lnrpc.ChannelEventUpdate.inactive_channel", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_channel", - full_name="lnrpc.ChannelEventUpdate.pending_open_channel", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fully_resolved_channel", - full_name="lnrpc.ChannelEventUpdate.fully_resolved_channel", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="lnrpc.ChannelEventUpdate.type", - index=6, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_CHANNELEVENTUPDATE_UPDATETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="channel", - full_name="lnrpc.ChannelEventUpdate.channel", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=12494, - serialized_end=13025, -) - - -_WALLETACCOUNTBALANCE = _descriptor.Descriptor( - name="WalletAccountBalance", - full_name="lnrpc.WalletAccountBalance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="confirmed_balance", - full_name="lnrpc.WalletAccountBalance.confirmed_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unconfirmed_balance", - full_name="lnrpc.WalletAccountBalance.unconfirmed_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13027, - serialized_end=13105, -) - - -_WALLETBALANCEREQUEST = _descriptor.Descriptor( - name="WalletBalanceRequest", - full_name="lnrpc.WalletBalanceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13107, - serialized_end=13129, -) - - -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY = _descriptor.Descriptor( - name="AccountBalanceEntry", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.WalletBalanceResponse.AccountBalanceEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13311, - serialized_end=13393, -) - -_WALLETBALANCERESPONSE = _descriptor.Descriptor( - name="WalletBalanceResponse", - full_name="lnrpc.WalletBalanceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_balance", - full_name="lnrpc.WalletBalanceResponse.total_balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="confirmed_balance", - full_name="lnrpc.WalletBalanceResponse.confirmed_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unconfirmed_balance", - full_name="lnrpc.WalletBalanceResponse.unconfirmed_balance", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="account_balance", - full_name="lnrpc.WalletBalanceResponse.account_balance", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13132, - serialized_end=13393, -) - - -_AMOUNT = _descriptor.Descriptor( - name="Amount", - full_name="lnrpc.Amount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sat", - full_name="lnrpc.Amount.sat", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="msat", - full_name="lnrpc.Amount.msat", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13395, - serialized_end=13430, -) - - -_CHANNELBALANCEREQUEST = _descriptor.Descriptor( - name="ChannelBalanceRequest", - full_name="lnrpc.ChannelBalanceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13432, - serialized_end=13455, -) - - -_CHANNELBALANCERESPONSE = _descriptor.Descriptor( - name="ChannelBalanceResponse", - full_name="lnrpc.ChannelBalanceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="balance", - full_name="lnrpc.ChannelBalanceResponse.balance", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_balance", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="local_balance", - full_name="lnrpc.ChannelBalanceResponse.local_balance", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="remote_balance", - full_name="lnrpc.ChannelBalanceResponse.remote_balance", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_local_balance", - full_name="lnrpc.ChannelBalanceResponse.unsettled_local_balance", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="unsettled_remote_balance", - full_name="lnrpc.ChannelBalanceResponse.unsettled_remote_balance", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_local_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_local_balance", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_open_remote_balance", - full_name="lnrpc.ChannelBalanceResponse.pending_open_remote_balance", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13458, - serialized_end=13814, -) - - -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="DestCustomRecordsEntry", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.QueryRoutesRequest.DestCustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1295, - serialized_end=1351, -) - -_QUERYROUTESREQUEST = _descriptor.Descriptor( - name="QueryRoutesRequest", - full_name="lnrpc.QueryRoutesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.QueryRoutesRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt", - full_name="lnrpc.QueryRoutesRequest.amt", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.QueryRoutesRequest.amt_msat", - index=2, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="final_cltv_delta", - full_name="lnrpc.QueryRoutesRequest.final_cltv_delta", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_limit", - full_name="lnrpc.QueryRoutesRequest.fee_limit", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_nodes", - full_name="lnrpc.QueryRoutesRequest.ignored_nodes", - index=5, - number=6, - type=12, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_edges", - full_name="lnrpc.QueryRoutesRequest.ignored_edges", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="source_pub_key", - full_name="lnrpc.QueryRoutesRequest.source_pub_key", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="use_mission_control", - full_name="lnrpc.QueryRoutesRequest.use_mission_control", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ignored_pairs", - full_name="lnrpc.QueryRoutesRequest.ignored_pairs", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_limit", - full_name="lnrpc.QueryRoutesRequest.cltv_limit", - index=10, - number=11, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_custom_records", - full_name="lnrpc.QueryRoutesRequest.dest_custom_records", - index=11, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="outgoing_chan_id", - full_name="lnrpc.QueryRoutesRequest.outgoing_chan_id", - index=12, - number=14, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_hop_pubkey", - full_name="lnrpc.QueryRoutesRequest.last_hop_pubkey", - index=13, - number=15, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.QueryRoutesRequest.route_hints", - index=14, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="dest_features", - full_name="lnrpc.QueryRoutesRequest.dest_features", - index=15, - number=17, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=13817, - serialized_end=14409, -) - - -_NODEPAIR = _descriptor.Descriptor( - name="NodePair", - full_name="lnrpc.NodePair", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="from", - full_name="lnrpc.NodePair.from", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="to", - full_name="lnrpc.NodePair.to", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14411, - serialized_end=14447, -) - - -_EDGELOCATOR = _descriptor.Descriptor( - name="EdgeLocator", - full_name="lnrpc.EdgeLocator", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_id", - full_name="lnrpc.EdgeLocator.channel_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="direction_reverse", - full_name="lnrpc.EdgeLocator.direction_reverse", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14449, - serialized_end=14513, -) - - -_QUERYROUTESRESPONSE = _descriptor.Descriptor( - name="QueryRoutesResponse", - full_name="lnrpc.QueryRoutesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="routes", - full_name="lnrpc.QueryRoutesResponse.routes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="success_prob", - full_name="lnrpc.QueryRoutesResponse.success_prob", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14515, - serialized_end=14588, -) - - -_HOP_CUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="CustomRecordsEntry", - full_name="lnrpc.Hop.CustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Hop.CustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Hop.CustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14923, - serialized_end=14975, -) - -_HOP = _descriptor.Descriptor( - name="Hop", - full_name="lnrpc.Hop", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.Hop.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_capacity", - full_name="lnrpc.Hop.chan_capacity", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_to_forward", - full_name="lnrpc.Hop.amt_to_forward", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.Hop.fee", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.Hop.expiry", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_to_forward_msat", - full_name="lnrpc.Hop.amt_to_forward_msat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.Hop.fee_msat", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.Hop.pub_key", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="tlv_payload", - full_name="lnrpc.Hop.tlv_payload", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mpp_record", - full_name="lnrpc.Hop.mpp_record", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp_record", - full_name="lnrpc.Hop.amp_record", - index=10, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_records", - full_name="lnrpc.Hop.custom_records", - index=11, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_HOP_CUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14591, - serialized_end=14975, -) - - -_MPPRECORD = _descriptor.Descriptor( - name="MPPRecord", - full_name="lnrpc.MPPRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.MPPRecord.payment_addr", - index=0, - number=11, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt_msat", - full_name="lnrpc.MPPRecord.total_amt_msat", - index=1, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14977, - serialized_end=15034, -) - - -_AMPRECORD = _descriptor.Descriptor( - name="AMPRecord", - full_name="lnrpc.AMPRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_share", - full_name="lnrpc.AMPRecord.root_share", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.AMPRecord.set_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="child_index", - full_name="lnrpc.AMPRecord.child_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15036, - serialized_end=15104, -) - - -_ROUTE = _descriptor.Descriptor( - name="Route", - full_name="lnrpc.Route", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="total_time_lock", - full_name="lnrpc.Route.total_time_lock", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees", - full_name="lnrpc.Route.total_fees", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt", - full_name="lnrpc.Route.total_amt", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hops", - full_name="lnrpc.Route.hops", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_fees_msat", - full_name="lnrpc.Route.total_fees_msat", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_amt_msat", - full_name="lnrpc.Route.total_amt_msat", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15107, - serialized_end=15261, -) - - -_NODEINFOREQUEST = _descriptor.Descriptor( - name="NodeInfoRequest", - full_name="lnrpc.NodeInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.NodeInfoRequest.pub_key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="include_channels", - full_name="lnrpc.NodeInfoRequest.include_channels", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15263, - serialized_end=15323, -) - - -_NODEINFO = _descriptor.Descriptor( - name="NodeInfo", - full_name="lnrpc.NodeInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node", - full_name="lnrpc.NodeInfo.node", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_channels", - full_name="lnrpc.NodeInfo.num_channels", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_capacity", - full_name="lnrpc.NodeInfo.total_capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channels", - full_name="lnrpc.NodeInfo.channels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15326, - serialized_end=15456, -) - - -_LIGHTNINGNODE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.LightningNode.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.LightningNode.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.LightningNode.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_LIGHTNINGNODE = _descriptor.Descriptor( - name="LightningNode", - full_name="lnrpc.LightningNode", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.LightningNode.last_update", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pub_key", - full_name="lnrpc.LightningNode.pub_key", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.LightningNode.alias", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="addresses", - full_name="lnrpc.LightningNode.addresses", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.LightningNode.color", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.LightningNode.features", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_LIGHTNINGNODE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15459, - serialized_end=15700, -) - - -_NODEADDRESS = _descriptor.Descriptor( - name="NodeAddress", - full_name="lnrpc.NodeAddress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="network", - full_name="lnrpc.NodeAddress.network", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="addr", - full_name="lnrpc.NodeAddress.addr", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15702, - serialized_end=15746, -) - - -_ROUTINGPOLICY = _descriptor.Descriptor( - name="RoutingPolicy", - full_name="lnrpc.RoutingPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.RoutingPolicy.time_lock_delta", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc", - full_name="lnrpc.RoutingPolicy.min_htlc", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_base_msat", - full_name="lnrpc.RoutingPolicy.fee_base_msat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate_milli_msat", - full_name="lnrpc.RoutingPolicy.fee_rate_milli_msat", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="disabled", - full_name="lnrpc.RoutingPolicy.disabled", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_msat", - full_name="lnrpc.RoutingPolicy.max_htlc_msat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.RoutingPolicy.last_update", - index=6, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15749, - serialized_end=15921, -) - - -_CHANNELEDGE = _descriptor.Descriptor( - name="ChannelEdge", - full_name="lnrpc.ChannelEdge", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_id", - full_name="lnrpc.ChannelEdge.channel_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelEdge.chan_point", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_update", - full_name="lnrpc.ChannelEdge.last_update", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node1_pub", - full_name="lnrpc.ChannelEdge.node1_pub", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node2_pub", - full_name="lnrpc.ChannelEdge.node2_pub", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelEdge.capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node1_policy", - full_name="lnrpc.ChannelEdge.node1_policy", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node2_policy", - full_name="lnrpc.ChannelEdge.node2_policy", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=15924, - serialized_end=16150, -) - - -_CHANNELGRAPHREQUEST = _descriptor.Descriptor( - name="ChannelGraphRequest", - full_name="lnrpc.ChannelGraphRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="include_unannounced", - full_name="lnrpc.ChannelGraphRequest.include_unannounced", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16152, - serialized_end=16202, -) - - -_CHANNELGRAPH = _descriptor.Descriptor( - name="ChannelGraph", - full_name="lnrpc.ChannelGraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="nodes", - full_name="lnrpc.ChannelGraph.nodes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="edges", - full_name="lnrpc.ChannelGraph.edges", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16204, - serialized_end=16290, -) - - -_NODEMETRICSREQUEST = _descriptor.Descriptor( - name="NodeMetricsRequest", - full_name="lnrpc.NodeMetricsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="types", - full_name="lnrpc.NodeMetricsRequest.types", - index=0, - number=1, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16292, - serialized_end=16350, -) - - -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY = _descriptor.Descriptor( - name="BetweennessCentralityEntry", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.NodeMetricsResponse.BetweennessCentralityEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16463, - serialized_end=16543, -) - -_NODEMETRICSRESPONSE = _descriptor.Descriptor( - name="NodeMetricsResponse", - full_name="lnrpc.NodeMetricsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="betweenness_centrality", - full_name="lnrpc.NodeMetricsResponse.betweenness_centrality", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16353, - serialized_end=16543, -) - - -_FLOATMETRIC = _descriptor.Descriptor( - name="FloatMetric", - full_name="lnrpc.FloatMetric", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.FloatMetric.value", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="normalized_value", - full_name="lnrpc.FloatMetric.normalized_value", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16545, - serialized_end=16599, -) - - -_CHANINFOREQUEST = _descriptor.Descriptor( - name="ChanInfoRequest", - full_name="lnrpc.ChanInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChanInfoRequest.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16601, - serialized_end=16639, -) - - -_NETWORKINFOREQUEST = _descriptor.Descriptor( - name="NetworkInfoRequest", - full_name="lnrpc.NetworkInfoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16641, - serialized_end=16661, -) - - -_NETWORKINFO = _descriptor.Descriptor( - name="NetworkInfo", - full_name="lnrpc.NetworkInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="graph_diameter", - full_name="lnrpc.NetworkInfo.graph_diameter", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="avg_out_degree", - full_name="lnrpc.NetworkInfo.avg_out_degree", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_out_degree", - full_name="lnrpc.NetworkInfo.max_out_degree", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_nodes", - full_name="lnrpc.NetworkInfo.num_nodes", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_channels", - full_name="lnrpc.NetworkInfo.num_channels", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="total_network_capacity", - full_name="lnrpc.NetworkInfo.total_network_capacity", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="avg_channel_size", - full_name="lnrpc.NetworkInfo.avg_channel_size", - index=6, - number=7, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_channel_size", - full_name="lnrpc.NetworkInfo.min_channel_size", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_channel_size", - full_name="lnrpc.NetworkInfo.max_channel_size", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="median_channel_size_sat", - full_name="lnrpc.NetworkInfo.median_channel_size_sat", - index=9, - number=10, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_zombie_chans", - full_name="lnrpc.NetworkInfo.num_zombie_chans", - index=10, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16664, - serialized_end=16959, -) - - -_STOPREQUEST = _descriptor.Descriptor( - name="StopRequest", - full_name="lnrpc.StopRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16961, - serialized_end=16974, -) - - -_STOPRESPONSE = _descriptor.Descriptor( - name="StopResponse", - full_name="lnrpc.StopResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16976, - serialized_end=16990, -) - - -_GRAPHTOPOLOGYSUBSCRIPTION = _descriptor.Descriptor( - name="GraphTopologySubscription", - full_name="lnrpc.GraphTopologySubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=16992, - serialized_end=17019, -) - - -_GRAPHTOPOLOGYUPDATE = _descriptor.Descriptor( - name="GraphTopologyUpdate", - full_name="lnrpc.GraphTopologyUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_updates", - full_name="lnrpc.GraphTopologyUpdate.node_updates", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_updates", - full_name="lnrpc.GraphTopologyUpdate.channel_updates", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_chans", - full_name="lnrpc.GraphTopologyUpdate.closed_chans", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17022, - serialized_end=17185, -) - - -_NODEUPDATE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.NodeUpdate.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.NodeUpdate.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.NodeUpdate.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_NODEUPDATE = _descriptor.Descriptor( - name="NodeUpdate", - full_name="lnrpc.NodeUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="addresses", - full_name="lnrpc.NodeUpdate.addresses", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="identity_key", - full_name="lnrpc.NodeUpdate.identity_key", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="global_features", - full_name="lnrpc.NodeUpdate.global_features", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="alias", - full_name="lnrpc.NodeUpdate.alias", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="color", - full_name="lnrpc.NodeUpdate.color", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="node_addresses", - full_name="lnrpc.NodeUpdate.node_addresses", - index=5, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.NodeUpdate.features", - index=6, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_NODEUPDATE_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17188, - serialized_end=17464, -) - - -_CHANNELEDGEUPDATE = _descriptor.Descriptor( - name="ChannelEdgeUpdate", - full_name="lnrpc.ChannelEdgeUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelEdgeUpdate.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelEdgeUpdate.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ChannelEdgeUpdate.capacity", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="routing_policy", - full_name="lnrpc.ChannelEdgeUpdate.routing_policy", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="advertising_node", - full_name="lnrpc.ChannelEdgeUpdate.advertising_node", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="connecting_node", - full_name="lnrpc.ChannelEdgeUpdate.connecting_node", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17467, - serialized_end=17663, -) - - -_CLOSEDCHANNELUPDATE = _descriptor.Descriptor( - name="ClosedChannelUpdate", - full_name="lnrpc.ClosedChannelUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ClosedChannelUpdate.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="capacity", - full_name="lnrpc.ClosedChannelUpdate.capacity", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="closed_height", - full_name="lnrpc.ClosedChannelUpdate.closed_height", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ClosedChannelUpdate.chan_point", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17665, - serialized_end=17789, -) - - -_HOPHINT = _descriptor.Descriptor( - name="HopHint", - full_name="lnrpc.HopHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="node_id", - full_name="lnrpc.HopHint.node_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.HopHint.chan_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_base_msat", - full_name="lnrpc.HopHint.fee_base_msat", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_proportional_millionths", - full_name="lnrpc.HopHint.fee_proportional_millionths", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry_delta", - full_name="lnrpc.HopHint.cltv_expiry_delta", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17792, - serialized_end=17926, -) - - -_SETID = _descriptor.Descriptor( - name="SetID", - full_name="lnrpc.SetID", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.SetID.set_id", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17928, - serialized_end=17951, -) - - -_ROUTEHINT = _descriptor.Descriptor( - name="RouteHint", - full_name="lnrpc.RouteHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="hop_hints", - full_name="lnrpc.RouteHint.hop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=17953, - serialized_end=17999, -) - - -_AMPINVOICESTATE = _descriptor.Descriptor( - name="AMPInvoiceState", - full_name="lnrpc.AMPInvoiceState", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.AMPInvoiceState.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.AMPInvoiceState.settle_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_time", - full_name="lnrpc.AMPInvoiceState.settle_time", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_msat", - full_name="lnrpc.AMPInvoiceState.amt_paid_msat", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18001, - serialized_end=18124, -) - - -_INVOICE_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.Invoice.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Invoice.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_INVOICE_AMPINVOICESTATEENTRY = _descriptor.Descriptor( - name="AmpInvoiceStateEntry", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.AmpInvoiceStateEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18877, - serialized_end=18955, -) - -_INVOICE = _descriptor.Descriptor( - name="Invoice", - full_name="lnrpc.Invoice", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="memo", - full_name="lnrpc.Invoice.memo", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_preimage", - full_name="lnrpc.Invoice.r_preimage", - index=1, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.Invoice.r_hash", - index=2, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Invoice.value", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_msat", - full_name="lnrpc.Invoice.value_msat", - index=4, - number=23, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settled", - full_name="lnrpc.Invoice.settled", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_date", - full_name="lnrpc.Invoice.creation_date", - index=6, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_date", - full_name="lnrpc.Invoice.settle_date", - index=7, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.Invoice.payment_request", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description_hash", - full_name="lnrpc.Invoice.description_hash", - index=9, - number=10, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.Invoice.expiry", - index=10, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fallback_addr", - full_name="lnrpc.Invoice.fallback_addr", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.Invoice.cltv_expiry", - index=12, - number=13, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.Invoice.route_hints", - index=13, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="private", - full_name="lnrpc.Invoice.private", - index=14, - number=15, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.Invoice.add_index", - index=15, - number=16, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.Invoice.settle_index", - index=16, - number=17, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid", - full_name="lnrpc.Invoice.amt_paid", - index=17, - number=18, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_sat", - full_name="lnrpc.Invoice.amt_paid_sat", - index=18, - number=19, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_paid_msat", - full_name="lnrpc.Invoice.amt_paid_msat", - index=19, - number=20, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.Invoice.state", - index=20, - number=21, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlcs", - full_name="lnrpc.Invoice.htlcs", - index=21, - number=22, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.Invoice.features", - index=22, - number=24, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_keysend", - full_name="lnrpc.Invoice.is_keysend", - index=23, - number=25, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.Invoice.payment_addr", - index=24, - number=26, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_amp", - full_name="lnrpc.Invoice.is_amp", - index=25, - number=27, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp_invoice_state", - full_name="lnrpc.Invoice.amp_invoice_state", - index=26, - number=28, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_INVOICE_FEATURESENTRY, _INVOICE_AMPINVOICESTATEENTRY], - enum_types=[_INVOICE_INVOICESTATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=18127, - serialized_end=19028, -) - - -_INVOICEHTLC_CUSTOMRECORDSENTRY = _descriptor.Descriptor( - name="CustomRecordsEntry", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry.key", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.InvoiceHTLC.CustomRecordsEntry.value", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=14923, - serialized_end=14975, -) - -_INVOICEHTLC = _descriptor.Descriptor( - name="InvoiceHTLC", - full_name="lnrpc.InvoiceHTLC", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.InvoiceHTLC.chan_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_index", - full_name="lnrpc.InvoiceHTLC.htlc_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_msat", - full_name="lnrpc.InvoiceHTLC.amt_msat", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="accept_height", - full_name="lnrpc.InvoiceHTLC.accept_height", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="accept_time", - full_name="lnrpc.InvoiceHTLC.accept_time", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolve_time", - full_name="lnrpc.InvoiceHTLC.resolve_time", - index=5, - number=6, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry_height", - full_name="lnrpc.InvoiceHTLC.expiry_height", - index=6, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="lnrpc.InvoiceHTLC.state", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_records", - full_name="lnrpc.InvoiceHTLC.custom_records", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="mpp_total_amt_msat", - full_name="lnrpc.InvoiceHTLC.mpp_total_amt_msat", - index=9, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amp", - full_name="lnrpc.InvoiceHTLC.amp", - index=10, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_INVOICEHTLC_CUSTOMRECORDSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19031, - serialized_end=19402, -) - - -_AMP = _descriptor.Descriptor( - name="AMP", - full_name="lnrpc.AMP", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_share", - full_name="lnrpc.AMP.root_share", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="set_id", - full_name="lnrpc.AMP.set_id", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="child_index", - full_name="lnrpc.AMP.child_index", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="hash", - full_name="lnrpc.AMP.hash", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="preimage", - full_name="lnrpc.AMP.preimage", - index=4, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19404, - serialized_end=19498, -) - - -_ADDINVOICERESPONSE = _descriptor.Descriptor( - name="AddInvoiceResponse", - full_name="lnrpc.AddInvoiceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.AddInvoiceResponse.r_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.AddInvoiceResponse.payment_request", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.AddInvoiceResponse.add_index", - index=2, - number=16, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.AddInvoiceResponse.payment_addr", - index=3, - number=17, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19500, - serialized_end=19602, -) - - -_PAYMENTHASH = _descriptor.Descriptor( - name="PaymentHash", - full_name="lnrpc.PaymentHash", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="r_hash_str", - full_name="lnrpc.PaymentHash.r_hash_str", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="r_hash", - full_name="lnrpc.PaymentHash.r_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19604, - serialized_end=19657, -) - - -_LISTINVOICEREQUEST = _descriptor.Descriptor( - name="ListInvoiceRequest", - full_name="lnrpc.ListInvoiceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pending_only", - full_name="lnrpc.ListInvoiceRequest.pending_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ListInvoiceRequest.index_offset", - index=1, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_max_invoices", - full_name="lnrpc.ListInvoiceRequest.num_max_invoices", - index=2, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reversed", - full_name="lnrpc.ListInvoiceRequest.reversed", - index=3, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19659, - serialized_end=19767, -) - - -_LISTINVOICERESPONSE = _descriptor.Descriptor( - name="ListInvoiceResponse", - full_name="lnrpc.ListInvoiceResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="invoices", - full_name="lnrpc.ListInvoiceResponse.invoices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_index_offset", - full_name="lnrpc.ListInvoiceResponse.last_index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="first_index_offset", - full_name="lnrpc.ListInvoiceResponse.first_index_offset", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19769, - serialized_end=19879, -) - - -_INVOICESUBSCRIPTION = _descriptor.Descriptor( - name="InvoiceSubscription", - full_name="lnrpc.InvoiceSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="add_index", - full_name="lnrpc.InvoiceSubscription.add_index", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="settle_index", - full_name="lnrpc.InvoiceSubscription.settle_index", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19881, - serialized_end=19943, -) - - -_PAYMENT = _descriptor.Descriptor( - name="Payment", - full_name="lnrpc.Payment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.Payment.payment_hash", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.Payment.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_date", - full_name="lnrpc.Payment.creation_date", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.Payment.fee", - index=3, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_preimage", - full_name="lnrpc.Payment.payment_preimage", - index=4, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_sat", - full_name="lnrpc.Payment.value_sat", - index=5, - number=7, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value_msat", - full_name="lnrpc.Payment.value_msat", - index=6, - number=8, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_request", - full_name="lnrpc.Payment.payment_request", - index=7, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="lnrpc.Payment.status", - index=8, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_sat", - full_name="lnrpc.Payment.fee_sat", - index=9, - number=11, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.Payment.fee_msat", - index=10, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="creation_time_ns", - full_name="lnrpc.Payment.creation_time_ns", - index=11, - number=13, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlcs", - full_name="lnrpc.Payment.htlcs", - index=12, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_index", - full_name="lnrpc.Payment.payment_index", - index=13, - number=15, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure_reason", - full_name="lnrpc.Payment.failure_reason", - index=14, - number=16, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PAYMENT_PAYMENTSTATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=19946, - serialized_end=20426, -) - - -_HTLCATTEMPT = _descriptor.Descriptor( - name="HTLCAttempt", - full_name="lnrpc.HTLCAttempt", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="attempt_id", - full_name="lnrpc.HTLCAttempt.attempt_id", - index=0, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="lnrpc.HTLCAttempt.status", - index=1, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route", - full_name="lnrpc.HTLCAttempt.route", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="attempt_time_ns", - full_name="lnrpc.HTLCAttempt.attempt_time_ns", - index=3, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="resolve_time_ns", - full_name="lnrpc.HTLCAttempt.resolve_time_ns", - index=4, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure", - full_name="lnrpc.HTLCAttempt.failure", - index=5, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="preimage", - full_name="lnrpc.HTLCAttempt.preimage", - index=6, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_HTLCATTEMPT_HTLCSTATUS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20429, - serialized_end=20695, -) - - -_LISTPAYMENTSREQUEST = _descriptor.Descriptor( - name="ListPaymentsRequest", - full_name="lnrpc.ListPaymentsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="include_incomplete", - full_name="lnrpc.ListPaymentsRequest.include_incomplete", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ListPaymentsRequest.index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_payments", - full_name="lnrpc.ListPaymentsRequest.max_payments", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reversed", - full_name="lnrpc.ListPaymentsRequest.reversed", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20697, - serialized_end=20808, -) - - -_LISTPAYMENTSRESPONSE = _descriptor.Descriptor( - name="ListPaymentsResponse", - full_name="lnrpc.ListPaymentsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payments", - full_name="lnrpc.ListPaymentsResponse.payments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="first_index_offset", - full_name="lnrpc.ListPaymentsResponse.first_index_offset", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_index_offset", - full_name="lnrpc.ListPaymentsResponse.last_index_offset", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20810, - serialized_end=20921, -) - - -_DELETEPAYMENTREQUEST = _descriptor.Descriptor( - name="DeletePaymentRequest", - full_name="lnrpc.DeletePaymentRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.DeletePaymentRequest.payment_hash", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failed_htlcs_only", - full_name="lnrpc.DeletePaymentRequest.failed_htlcs_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20923, - serialized_end=20994, -) - - -_DELETEALLPAYMENTSREQUEST = _descriptor.Descriptor( - name="DeleteAllPaymentsRequest", - full_name="lnrpc.DeleteAllPaymentsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="failed_payments_only", - full_name="lnrpc.DeleteAllPaymentsRequest.failed_payments_only", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failed_htlcs_only", - full_name="lnrpc.DeleteAllPaymentsRequest.failed_htlcs_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=20996, - serialized_end=21079, -) - - -_DELETEPAYMENTRESPONSE = _descriptor.Descriptor( - name="DeletePaymentResponse", - full_name="lnrpc.DeletePaymentResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21081, - serialized_end=21104, -) - - -_DELETEALLPAYMENTSRESPONSE = _descriptor.Descriptor( - name="DeleteAllPaymentsResponse", - full_name="lnrpc.DeleteAllPaymentsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21106, - serialized_end=21133, -) - - -_ABANDONCHANNELREQUEST = _descriptor.Descriptor( - name="AbandonChannelRequest", - full_name="lnrpc.AbandonChannelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.AbandonChannelRequest.channel_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="pending_funding_shim_only", - full_name="lnrpc.AbandonChannelRequest.pending_funding_shim_only", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="i_know_what_i_am_doing", - full_name="lnrpc.AbandonChannelRequest.i_know_what_i_am_doing", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21136, - serialized_end=21270, -) - - -_ABANDONCHANNELRESPONSE = _descriptor.Descriptor( - name="AbandonChannelResponse", - full_name="lnrpc.AbandonChannelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21272, - serialized_end=21296, -) - - -_DEBUGLEVELREQUEST = _descriptor.Descriptor( - name="DebugLevelRequest", - full_name="lnrpc.DebugLevelRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="show", - full_name="lnrpc.DebugLevelRequest.show", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="level_spec", - full_name="lnrpc.DebugLevelRequest.level_spec", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21298, - serialized_end=21351, -) - - -_DEBUGLEVELRESPONSE = _descriptor.Descriptor( - name="DebugLevelResponse", - full_name="lnrpc.DebugLevelResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="sub_systems", - full_name="lnrpc.DebugLevelResponse.sub_systems", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21353, - serialized_end=21394, -) - - -_PAYREQSTRING = _descriptor.Descriptor( - name="PayReqString", - full_name="lnrpc.PayReqString", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="pay_req", - full_name="lnrpc.PayReqString.pay_req", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21396, - serialized_end=21427, -) - - -_PAYREQ_FEATURESENTRY = _descriptor.Descriptor( - name="FeaturesEntry", - full_name="lnrpc.PayReq.FeaturesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.PayReq.FeaturesEntry.key", - index=0, - number=1, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.PayReq.FeaturesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6559, - serialized_end=6622, -) - -_PAYREQ = _descriptor.Descriptor( - name="PayReq", - full_name="lnrpc.PayReq", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="destination", - full_name="lnrpc.PayReq.destination", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_hash", - full_name="lnrpc.PayReq.payment_hash", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_satoshis", - full_name="lnrpc.PayReq.num_satoshis", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.PayReq.timestamp", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="expiry", - full_name="lnrpc.PayReq.expiry", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="lnrpc.PayReq.description", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="description_hash", - full_name="lnrpc.PayReq.description_hash", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fallback_addr", - full_name="lnrpc.PayReq.fallback_addr", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.PayReq.cltv_expiry", - index=8, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="route_hints", - full_name="lnrpc.PayReq.route_hints", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="payment_addr", - full_name="lnrpc.PayReq.payment_addr", - index=10, - number=11, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_msat", - full_name="lnrpc.PayReq.num_msat", - index=11, - number=12, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="lnrpc.PayReq.features", - index=12, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[_PAYREQ_FEATURESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21430, - serialized_end=21820, -) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="lnrpc.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="lnrpc.Feature.name", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_required", - full_name="lnrpc.Feature.is_required", - index=1, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="is_known", - full_name="lnrpc.Feature.is_known", - index=2, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21822, - serialized_end=21884, -) - - -_FEEREPORTREQUEST = _descriptor.Descriptor( - name="FeeReportRequest", - full_name="lnrpc.FeeReportRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21886, - serialized_end=21904, -) - - -_CHANNELFEEREPORT = _descriptor.Descriptor( - name="ChannelFeeReport", - full_name="lnrpc.ChannelFeeReport", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelFeeReport.chan_id", - index=0, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_point", - full_name="lnrpc.ChannelFeeReport.channel_point", - index=1, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee_msat", - full_name="lnrpc.ChannelFeeReport.base_fee_msat", - index=2, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_per_mil", - full_name="lnrpc.ChannelFeeReport.fee_per_mil", - index=3, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.ChannelFeeReport.fee_rate", - index=4, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=21906, - serialized_end=22030, -) - - -_FEEREPORTRESPONSE = _descriptor.Descriptor( - name="FeeReportResponse", - full_name="lnrpc.FeeReportResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="channel_fees", - full_name="lnrpc.FeeReportResponse.channel_fees", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="day_fee_sum", - full_name="lnrpc.FeeReportResponse.day_fee_sum", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="week_fee_sum", - full_name="lnrpc.FeeReportResponse.week_fee_sum", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="month_fee_sum", - full_name="lnrpc.FeeReportResponse.month_fee_sum", - index=3, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22033, - serialized_end=22165, -) - - -_POLICYUPDATEREQUEST = _descriptor.Descriptor( - name="PolicyUpdateRequest", - full_name="lnrpc.PolicyUpdateRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="global", - full_name="lnrpc.PolicyUpdateRequest.global", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.PolicyUpdateRequest.chan_point", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee_msat", - full_name="lnrpc.PolicyUpdateRequest.base_fee_msat", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.PolicyUpdateRequest.fee_rate", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.PolicyUpdateRequest.time_lock_delta", - index=4, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="max_htlc_msat", - full_name="lnrpc.PolicyUpdateRequest.max_htlc_msat", - index=5, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat", - full_name="lnrpc.PolicyUpdateRequest.min_htlc_msat", - index=6, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="min_htlc_msat_specified", - full_name="lnrpc.PolicyUpdateRequest.min_htlc_msat_specified", - index=7, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="scope", - full_name="lnrpc.PolicyUpdateRequest.scope", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=22168, - serialized_end=22404, -) - - -_FAILEDUPDATE = _descriptor.Descriptor( - name="FailedUpdate", - full_name="lnrpc.FailedUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="outpoint", - full_name="lnrpc.FailedUpdate.outpoint", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="reason", - full_name="lnrpc.FailedUpdate.reason", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="update_error", - full_name="lnrpc.FailedUpdate.update_error", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22406, - serialized_end=22515, -) - - -_POLICYUPDATERESPONSE = _descriptor.Descriptor( - name="PolicyUpdateResponse", - full_name="lnrpc.PolicyUpdateResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="failed_updates", - full_name="lnrpc.PolicyUpdateResponse.failed_updates", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22517, - serialized_end=22584, -) - - -_FORWARDINGHISTORYREQUEST = _descriptor.Descriptor( - name="ForwardingHistoryRequest", - full_name="lnrpc.ForwardingHistoryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="lnrpc.ForwardingHistoryRequest.start_time", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="lnrpc.ForwardingHistoryRequest.end_time", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="index_offset", - full_name="lnrpc.ForwardingHistoryRequest.index_offset", - index=2, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="num_max_events", - full_name="lnrpc.ForwardingHistoryRequest.num_max_events", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22586, - serialized_end=22696, -) - - -_FORWARDINGEVENT = _descriptor.Descriptor( - name="ForwardingEvent", - full_name="lnrpc.ForwardingEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.ForwardingEvent.timestamp", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"\030\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id_in", - full_name="lnrpc.ForwardingEvent.chan_id_in", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id_out", - full_name="lnrpc.ForwardingEvent.chan_id_out", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_in", - full_name="lnrpc.ForwardingEvent.amt_in", - index=3, - number=5, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_out", - full_name="lnrpc.ForwardingEvent.amt_out", - index=4, - number=6, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee", - full_name="lnrpc.ForwardingEvent.fee", - index=5, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_msat", - full_name="lnrpc.ForwardingEvent.fee_msat", - index=6, - number=8, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_in_msat", - full_name="lnrpc.ForwardingEvent.amt_in_msat", - index=7, - number=9, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="amt_out_msat", - full_name="lnrpc.ForwardingEvent.amt_out_msat", - index=8, - number=10, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp_ns", - full_name="lnrpc.ForwardingEvent.timestamp_ns", - index=9, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22699, - serialized_end=22917, -) - - -_FORWARDINGHISTORYRESPONSE = _descriptor.Descriptor( - name="ForwardingHistoryResponse", - full_name="lnrpc.ForwardingHistoryResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="forwarding_events", - full_name="lnrpc.ForwardingHistoryResponse.forwarding_events", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="last_offset_index", - full_name="lnrpc.ForwardingHistoryResponse.last_offset_index", - index=1, - number=2, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=22919, - serialized_end=23024, -) - - -_EXPORTCHANNELBACKUPREQUEST = _descriptor.Descriptor( - name="ExportChannelBackupRequest", - full_name="lnrpc.ExportChannelBackupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ExportChannelBackupRequest.chan_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23026, - serialized_end=23095, -) - - -_CHANNELBACKUP = _descriptor.Descriptor( - name="ChannelBackup", - full_name="lnrpc.ChannelBackup", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_point", - full_name="lnrpc.ChannelBackup.chan_point", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_backup", - full_name="lnrpc.ChannelBackup.chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23097, - serialized_end=23174, -) - - -_MULTICHANBACKUP = _descriptor.Descriptor( - name="MultiChanBackup", - full_name="lnrpc.MultiChanBackup", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_points", - full_name="lnrpc.MultiChanBackup.chan_points", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.MultiChanBackup.multi_chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23176, - serialized_end=23262, -) - - -_CHANBACKUPEXPORTREQUEST = _descriptor.Descriptor( - name="ChanBackupExportRequest", - full_name="lnrpc.ChanBackupExportRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23264, - serialized_end=23289, -) - - -_CHANBACKUPSNAPSHOT = _descriptor.Descriptor( - name="ChanBackupSnapshot", - full_name="lnrpc.ChanBackupSnapshot", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="single_chan_backups", - full_name="lnrpc.ChanBackupSnapshot.single_chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.ChanBackupSnapshot.multi_chan_backup", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23291, - serialized_end=23414, -) - - -_CHANNELBACKUPS = _descriptor.Descriptor( - name="ChannelBackups", - full_name="lnrpc.ChannelBackups", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_backups", - full_name="lnrpc.ChannelBackups.chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23416, - serialized_end=23476, -) - - -_RESTORECHANBACKUPREQUEST = _descriptor.Descriptor( - name="RestoreChanBackupRequest", - full_name="lnrpc.RestoreChanBackupRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="chan_backups", - full_name="lnrpc.RestoreChanBackupRequest.chan_backups", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="multi_chan_backup", - full_name="lnrpc.RestoreChanBackupRequest.multi_chan_backup", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="backup", - full_name="lnrpc.RestoreChanBackupRequest.backup", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=23478, - serialized_end=23590, -) - - -_RESTOREBACKUPRESPONSE = _descriptor.Descriptor( - name="RestoreBackupResponse", - full_name="lnrpc.RestoreBackupResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23592, - serialized_end=23615, -) - - -_CHANNELBACKUPSUBSCRIPTION = _descriptor.Descriptor( - name="ChannelBackupSubscription", - full_name="lnrpc.ChannelBackupSubscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23617, - serialized_end=23644, -) - - -_VERIFYCHANBACKUPRESPONSE = _descriptor.Descriptor( - name="VerifyChanBackupResponse", - full_name="lnrpc.VerifyChanBackupResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23646, - serialized_end=23672, -) - - -_MACAROONPERMISSION = _descriptor.Descriptor( - name="MacaroonPermission", - full_name="lnrpc.MacaroonPermission", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="lnrpc.MacaroonPermission.entity", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="action", - full_name="lnrpc.MacaroonPermission.action", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23674, - serialized_end=23726, -) - - -_BAKEMACAROONREQUEST = _descriptor.Descriptor( - name="BakeMacaroonRequest", - full_name="lnrpc.BakeMacaroonRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.BakeMacaroonRequest.permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="root_key_id", - full_name="lnrpc.BakeMacaroonRequest.root_key_id", - index=1, - number=2, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="allow_external_permissions", - full_name="lnrpc.BakeMacaroonRequest.allow_external_permissions", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23728, - serialized_end=23854, -) - - -_BAKEMACAROONRESPONSE = _descriptor.Descriptor( - name="BakeMacaroonResponse", - full_name="lnrpc.BakeMacaroonResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="macaroon", - full_name="lnrpc.BakeMacaroonResponse.macaroon", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23856, - serialized_end=23896, -) - - -_LISTMACAROONIDSREQUEST = _descriptor.Descriptor( - name="ListMacaroonIDsRequest", - full_name="lnrpc.ListMacaroonIDsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23898, - serialized_end=23922, -) - - -_LISTMACAROONIDSRESPONSE = _descriptor.Descriptor( - name="ListMacaroonIDsResponse", - full_name="lnrpc.ListMacaroonIDsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_key_ids", - full_name="lnrpc.ListMacaroonIDsResponse.root_key_ids", - index=0, - number=1, - type=4, - cpp_type=4, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23924, - serialized_end=23971, -) - - -_DELETEMACAROONIDREQUEST = _descriptor.Descriptor( - name="DeleteMacaroonIDRequest", - full_name="lnrpc.DeleteMacaroonIDRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="root_key_id", - full_name="lnrpc.DeleteMacaroonIDRequest.root_key_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=23973, - serialized_end=24019, -) - - -_DELETEMACAROONIDRESPONSE = _descriptor.Descriptor( - name="DeleteMacaroonIDResponse", - full_name="lnrpc.DeleteMacaroonIDResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="deleted", - full_name="lnrpc.DeleteMacaroonIDResponse.deleted", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24021, - serialized_end=24064, -) - - -_MACAROONPERMISSIONLIST = _descriptor.Descriptor( - name="MacaroonPermissionList", - full_name="lnrpc.MacaroonPermissionList", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.MacaroonPermissionList.permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24066, - serialized_end=24138, -) - - -_LISTPERMISSIONSREQUEST = _descriptor.Descriptor( - name="ListPermissionsRequest", - full_name="lnrpc.ListPermissionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24140, - serialized_end=24164, -) - - -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY = _descriptor.Descriptor( - name="MethodPermissionsEntry", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="lnrpc.ListPermissionsResponse.MethodPermissionsEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=b"8\001", - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24277, - serialized_end=24364, -) - -_LISTPERMISSIONSRESPONSE = _descriptor.Descriptor( - name="ListPermissionsResponse", - full_name="lnrpc.ListPermissionsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_permissions", - full_name="lnrpc.ListPermissionsResponse.method_permissions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24167, - serialized_end=24364, -) - - -_FAILURE = _descriptor.Descriptor( - name="Failure", - full_name="lnrpc.Failure", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="code", - full_name="lnrpc.Failure.code", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_update", - full_name="lnrpc.Failure.channel_update", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_msat", - full_name="lnrpc.Failure.htlc_msat", - index=2, - number=4, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="onion_sha_256", - full_name="lnrpc.Failure.onion_sha_256", - index=3, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="cltv_expiry", - full_name="lnrpc.Failure.cltv_expiry", - index=4, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="flags", - full_name="lnrpc.Failure.flags", - index=5, - number=7, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="failure_source_index", - full_name="lnrpc.Failure.failure_source_index", - index=6, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="lnrpc.Failure.height", - index=7, - number=9, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FAILURE_FAILURECODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=24367, - serialized_end=25348, -) - - -_CHANNELUPDATE = _descriptor.Descriptor( - name="ChannelUpdate", - full_name="lnrpc.ChannelUpdate", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="signature", - full_name="lnrpc.ChannelUpdate.signature", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chain_hash", - full_name="lnrpc.ChannelUpdate.chain_hash", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="chan_id", - full_name="lnrpc.ChannelUpdate.chan_id", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=b"0\001", - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="timestamp", - full_name="lnrpc.ChannelUpdate.timestamp", - index=3, - number=4, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="message_flags", - full_name="lnrpc.ChannelUpdate.message_flags", - index=4, - number=10, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="channel_flags", - full_name="lnrpc.ChannelUpdate.channel_flags", - index=5, - number=5, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="time_lock_delta", - full_name="lnrpc.ChannelUpdate.time_lock_delta", - index=6, - number=6, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_minimum_msat", - full_name="lnrpc.ChannelUpdate.htlc_minimum_msat", - index=7, - number=7, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="base_fee", - full_name="lnrpc.ChannelUpdate.base_fee", - index=8, - number=8, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fee_rate", - full_name="lnrpc.ChannelUpdate.fee_rate", - index=9, - number=9, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="htlc_maximum_msat", - full_name="lnrpc.ChannelUpdate.htlc_maximum_msat", - index=10, - number=11, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="extra_opaque_data", - full_name="lnrpc.ChannelUpdate.extra_opaque_data", - index=11, - number=12, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25351, - serialized_end=25633, -) - - -_MACAROONID = _descriptor.Descriptor( - name="MacaroonId", - full_name="lnrpc.MacaroonId", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="nonce", - full_name="lnrpc.MacaroonId.nonce", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="storageId", - full_name="lnrpc.MacaroonId.storageId", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="ops", - full_name="lnrpc.MacaroonId.ops", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25635, - serialized_end=25705, -) - - -_OP = _descriptor.Descriptor( - name="Op", - full_name="lnrpc.Op", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="lnrpc.Op.entity", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="actions", - full_name="lnrpc.Op.actions", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25707, - serialized_end=25744, -) - - -_CHECKMACPERMREQUEST = _descriptor.Descriptor( - name="CheckMacPermRequest", - full_name="lnrpc.CheckMacPermRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="macaroon", - full_name="lnrpc.CheckMacPermRequest.macaroon", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="permissions", - full_name="lnrpc.CheckMacPermRequest.permissions", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="fullMethod", - full_name="lnrpc.CheckMacPermRequest.fullMethod", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25746, - serialized_end=25853, -) - - -_CHECKMACPERMRESPONSE = _descriptor.Descriptor( - name="CheckMacPermResponse", - full_name="lnrpc.CheckMacPermResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="valid", - full_name="lnrpc.CheckMacPermResponse.valid", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=25855, - serialized_end=25892, -) - - -_RPCMIDDLEWAREREQUEST = _descriptor.Descriptor( - name="RPCMiddlewareRequest", - full_name="lnrpc.RPCMiddlewareRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="lnrpc.RPCMiddlewareRequest.request_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="raw_macaroon", - full_name="lnrpc.RPCMiddlewareRequest.raw_macaroon", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_caveat_condition", - full_name="lnrpc.RPCMiddlewareRequest.custom_caveat_condition", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stream_auth", - full_name="lnrpc.RPCMiddlewareRequest.stream_auth", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="request", - full_name="lnrpc.RPCMiddlewareRequest.request", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="response", - full_name="lnrpc.RPCMiddlewareRequest.response", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="intercept_type", - full_name="lnrpc.RPCMiddlewareRequest.intercept_type", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=25895, - serialized_end=26129, -) - - -_STREAMAUTH = _descriptor.Descriptor( - name="StreamAuth", - full_name="lnrpc.StreamAuth", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_full_uri", - full_name="lnrpc.StreamAuth.method_full_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26131, - serialized_end=26168, -) - - -_RPCMESSAGE = _descriptor.Descriptor( - name="RPCMessage", - full_name="lnrpc.RPCMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="method_full_uri", - full_name="lnrpc.RPCMessage.method_full_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="stream_rpc", - full_name="lnrpc.RPCMessage.stream_rpc", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="type_name", - full_name="lnrpc.RPCMessage.type_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="serialized", - full_name="lnrpc.RPCMessage.serialized", - index=3, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26170, - serialized_end=26266, -) - - -_RPCMIDDLEWARERESPONSE = _descriptor.Descriptor( - name="RPCMiddlewareResponse", - full_name="lnrpc.RPCMiddlewareResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="lnrpc.RPCMiddlewareResponse.request_id", - index=0, - number=1, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="register", - full_name="lnrpc.RPCMiddlewareResponse.register", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="feedback", - full_name="lnrpc.RPCMiddlewareResponse.feedback", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="middleware_message", - full_name="lnrpc.RPCMiddlewareResponse.middleware_message", - index=0, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[], - ) - ], - serialized_start=26269, - serialized_end=26431, -) - - -_MIDDLEWAREREGISTRATION = _descriptor.Descriptor( - name="MiddlewareRegistration", - full_name="lnrpc.MiddlewareRegistration", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="middleware_name", - full_name="lnrpc.MiddlewareRegistration.middleware_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="custom_macaroon_caveat_name", - full_name="lnrpc.MiddlewareRegistration.custom_macaroon_caveat_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="read_only_mode", - full_name="lnrpc.MiddlewareRegistration.read_only_mode", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26433, - serialized_end=26543, -) - - -_INTERCEPTFEEDBACK = _descriptor.Descriptor( - name="InterceptFeedback", - full_name="lnrpc.InterceptFeedback", - filename=None, - file=DESCRIPTOR, - containing_type=None, - create_key=_descriptor._internal_create_key, - fields=[ - _descriptor.FieldDescriptor( - name="error", - full_name="lnrpc.InterceptFeedback.error", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"".decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="replace_response", - full_name="lnrpc.InterceptFeedback.replace_response", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - _descriptor.FieldDescriptor( - name="replacement_serialized", - full_name="lnrpc.InterceptFeedback.replacement_serialized", - index=2, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=b"", - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - create_key=_descriptor._internal_create_key, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=26545, - serialized_end=26637, -) - -_UTXO.fields_by_name["address_type"].enum_type = _ADDRESSTYPE -_UTXO.fields_by_name["outpoint"].message_type = _OUTPOINT -_TRANSACTIONDETAILS.fields_by_name["transactions"].message_type = _TRANSACTION -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["fixed"]) -_FEELIMIT.fields_by_name["fixed"].containing_oneof = _FEELIMIT.oneofs_by_name["limit"] -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["fixed_msat"]) -_FEELIMIT.fields_by_name["fixed_msat"].containing_oneof = _FEELIMIT.oneofs_by_name[ - "limit" -] -_FEELIMIT.oneofs_by_name["limit"].fields.append(_FEELIMIT.fields_by_name["percent"]) -_FEELIMIT.fields_by_name["percent"].containing_oneof = _FEELIMIT.oneofs_by_name["limit"] -_SENDREQUEST_DESTCUSTOMRECORDSENTRY.containing_type = _SENDREQUEST -_SENDREQUEST.fields_by_name["fee_limit"].message_type = _FEELIMIT -_SENDREQUEST.fields_by_name[ - "dest_custom_records" -].message_type = _SENDREQUEST_DESTCUSTOMRECORDSENTRY -_SENDREQUEST.fields_by_name["dest_features"].enum_type = _FEATUREBIT -_SENDRESPONSE.fields_by_name["payment_route"].message_type = _ROUTE -_SENDTOROUTEREQUEST.fields_by_name["route"].message_type = _ROUTE -_CHANNELACCEPTREQUEST.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_CHANNELPOINT.oneofs_by_name["funding_txid"].fields.append( - _CHANNELPOINT.fields_by_name["funding_txid_bytes"] -) -_CHANNELPOINT.fields_by_name[ - "funding_txid_bytes" -].containing_oneof = _CHANNELPOINT.oneofs_by_name["funding_txid"] -_CHANNELPOINT.oneofs_by_name["funding_txid"].fields.append( - _CHANNELPOINT.fields_by_name["funding_txid_str"] -) -_CHANNELPOINT.fields_by_name[ - "funding_txid_str" -].containing_oneof = _CHANNELPOINT.oneofs_by_name["funding_txid"] -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY.containing_type = _ESTIMATEFEEREQUEST -_ESTIMATEFEEREQUEST.fields_by_name[ - "AddrToAmount" -].message_type = _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY.containing_type = _SENDMANYREQUEST -_SENDMANYREQUEST.fields_by_name[ - "AddrToAmount" -].message_type = _SENDMANYREQUEST_ADDRTOAMOUNTENTRY -_LISTUNSPENTRESPONSE.fields_by_name["utxos"].message_type = _UTXO -_NEWADDRESSREQUEST.fields_by_name["type"].enum_type = _ADDRESSTYPE -_CONNECTPEERREQUEST.fields_by_name["addr"].message_type = _LIGHTNINGADDRESS -_CHANNEL.fields_by_name["pending_htlcs"].message_type = _HTLC -_CHANNEL.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_CHANNEL.fields_by_name["local_constraints"].message_type = _CHANNELCONSTRAINTS -_CHANNEL.fields_by_name["remote_constraints"].message_type = _CHANNELCONSTRAINTS -_LISTCHANNELSRESPONSE.fields_by_name["channels"].message_type = _CHANNEL -_CHANNELCLOSESUMMARY.fields_by_name[ - "close_type" -].enum_type = _CHANNELCLOSESUMMARY_CLOSURETYPE -_CHANNELCLOSESUMMARY.fields_by_name["open_initiator"].enum_type = _INITIATOR -_CHANNELCLOSESUMMARY.fields_by_name["close_initiator"].enum_type = _INITIATOR -_CHANNELCLOSESUMMARY.fields_by_name["resolutions"].message_type = _RESOLUTION -_CHANNELCLOSESUMMARY_CLOSURETYPE.containing_type = _CHANNELCLOSESUMMARY -_RESOLUTION.fields_by_name["resolution_type"].enum_type = _RESOLUTIONTYPE -_RESOLUTION.fields_by_name["outcome"].enum_type = _RESOLUTIONOUTCOME -_RESOLUTION.fields_by_name["outpoint"].message_type = _OUTPOINT -_CLOSEDCHANNELSRESPONSE.fields_by_name["channels"].message_type = _CHANNELCLOSESUMMARY -_PEER_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_PEER_FEATURESENTRY.containing_type = _PEER -_PEER.fields_by_name["sync_type"].enum_type = _PEER_SYNCTYPE -_PEER.fields_by_name["features"].message_type = _PEER_FEATURESENTRY -_PEER.fields_by_name["errors"].message_type = _TIMESTAMPEDERROR -_PEER_SYNCTYPE.containing_type = _PEER -_LISTPEERSRESPONSE.fields_by_name["peers"].message_type = _PEER -_PEEREVENT.fields_by_name["type"].enum_type = _PEEREVENT_EVENTTYPE -_PEEREVENT_EVENTTYPE.containing_type = _PEEREVENT -_GETINFORESPONSE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_GETINFORESPONSE_FEATURESENTRY.containing_type = _GETINFORESPONSE -_GETINFORESPONSE.fields_by_name["chains"].message_type = _CHAIN -_GETINFORESPONSE.fields_by_name[ - "features" -].message_type = _GETINFORESPONSE_FEATURESENTRY -_CHANNELOPENUPDATE.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_CLOSECHANNELREQUEST.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_CLOSESTATUSUPDATE.fields_by_name["close_pending"].message_type = _PENDINGUPDATE -_CLOSESTATUSUPDATE.fields_by_name["chan_close"].message_type = _CHANNELCLOSEUPDATE -_CLOSESTATUSUPDATE.oneofs_by_name["update"].fields.append( - _CLOSESTATUSUPDATE.fields_by_name["close_pending"] -) -_CLOSESTATUSUPDATE.fields_by_name[ - "close_pending" -].containing_oneof = _CLOSESTATUSUPDATE.oneofs_by_name["update"] -_CLOSESTATUSUPDATE.oneofs_by_name["update"].fields.append( - _CLOSESTATUSUPDATE.fields_by_name["chan_close"] -) -_CLOSESTATUSUPDATE.fields_by_name[ - "chan_close" -].containing_oneof = _CLOSESTATUSUPDATE.oneofs_by_name["update"] -_BATCHOPENCHANNELREQUEST.fields_by_name["channels"].message_type = _BATCHOPENCHANNEL -_BATCHOPENCHANNEL.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_BATCHOPENCHANNELRESPONSE.fields_by_name[ - "pending_channels" -].message_type = _PENDINGUPDATE -_OPENCHANNELREQUEST.fields_by_name["funding_shim"].message_type = _FUNDINGSHIM -_OPENCHANNELREQUEST.fields_by_name["commitment_type"].enum_type = _COMMITMENTTYPE -_OPENSTATUSUPDATE.fields_by_name["chan_pending"].message_type = _PENDINGUPDATE -_OPENSTATUSUPDATE.fields_by_name["chan_open"].message_type = _CHANNELOPENUPDATE -_OPENSTATUSUPDATE.fields_by_name["psbt_fund"].message_type = _READYFORPSBTFUNDING -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["chan_pending"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "chan_pending" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["chan_open"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "chan_open" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_OPENSTATUSUPDATE.oneofs_by_name["update"].fields.append( - _OPENSTATUSUPDATE.fields_by_name["psbt_fund"] -) -_OPENSTATUSUPDATE.fields_by_name[ - "psbt_fund" -].containing_oneof = _OPENSTATUSUPDATE.oneofs_by_name["update"] -_KEYDESCRIPTOR.fields_by_name["key_loc"].message_type = _KEYLOCATOR -_CHANPOINTSHIM.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANPOINTSHIM.fields_by_name["local_key"].message_type = _KEYDESCRIPTOR -_FUNDINGSHIM.fields_by_name["chan_point_shim"].message_type = _CHANPOINTSHIM -_FUNDINGSHIM.fields_by_name["psbt_shim"].message_type = _PSBTSHIM -_FUNDINGSHIM.oneofs_by_name["shim"].fields.append( - _FUNDINGSHIM.fields_by_name["chan_point_shim"] -) -_FUNDINGSHIM.fields_by_name[ - "chan_point_shim" -].containing_oneof = _FUNDINGSHIM.oneofs_by_name["shim"] -_FUNDINGSHIM.oneofs_by_name["shim"].fields.append( - _FUNDINGSHIM.fields_by_name["psbt_shim"] -) -_FUNDINGSHIM.fields_by_name["psbt_shim"].containing_oneof = _FUNDINGSHIM.oneofs_by_name[ - "shim" -] -_FUNDINGTRANSITIONMSG.fields_by_name["shim_register"].message_type = _FUNDINGSHIM -_FUNDINGTRANSITIONMSG.fields_by_name["shim_cancel"].message_type = _FUNDINGSHIMCANCEL -_FUNDINGTRANSITIONMSG.fields_by_name["psbt_verify"].message_type = _FUNDINGPSBTVERIFY -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_finalize" -].message_type = _FUNDINGPSBTFINALIZE -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["shim_register"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "shim_register" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["shim_cancel"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "shim_cancel" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["psbt_verify"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_verify" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"].fields.append( - _FUNDINGTRANSITIONMSG.fields_by_name["psbt_finalize"] -) -_FUNDINGTRANSITIONMSG.fields_by_name[ - "psbt_finalize" -].containing_oneof = _FUNDINGTRANSITIONMSG.oneofs_by_name["trigger"] -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.fields_by_name[ - "initiator" -].enum_type = _INITIATOR -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.fields_by_name[ - "commitment_type" -].enum_type = _COMMITMENTTYPE -_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.fields_by_name[ - "commitments" -].message_type = _PENDINGCHANNELSRESPONSE_COMMITMENTS -_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_COMMITMENTS.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "channel" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "pending_htlcs" -].message_type = _PENDINGHTLC -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.fields_by_name[ - "anchor" -].enum_type = _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.containing_type = _PENDINGCHANNELSRESPONSE -_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE.containing_type = ( - _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL -) -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_open_channels" -].message_type = _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_closing_channels" -].message_type = _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "pending_force_closing_channels" -].message_type = _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL -_PENDINGCHANNELSRESPONSE.fields_by_name[ - "waiting_close_channels" -].message_type = _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL -_CHANNELEVENTUPDATE.fields_by_name["open_channel"].message_type = _CHANNEL -_CHANNELEVENTUPDATE.fields_by_name["closed_channel"].message_type = _CHANNELCLOSESUMMARY -_CHANNELEVENTUPDATE.fields_by_name["active_channel"].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["inactive_channel"].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["pending_open_channel"].message_type = _PENDINGUPDATE -_CHANNELEVENTUPDATE.fields_by_name[ - "fully_resolved_channel" -].message_type = _CHANNELPOINT -_CHANNELEVENTUPDATE.fields_by_name["type"].enum_type = _CHANNELEVENTUPDATE_UPDATETYPE -_CHANNELEVENTUPDATE_UPDATETYPE.containing_type = _CHANNELEVENTUPDATE -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["open_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "open_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["closed_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "closed_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["active_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "active_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["inactive_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "inactive_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["pending_open_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "pending_open_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_CHANNELEVENTUPDATE.oneofs_by_name["channel"].fields.append( - _CHANNELEVENTUPDATE.fields_by_name["fully_resolved_channel"] -) -_CHANNELEVENTUPDATE.fields_by_name[ - "fully_resolved_channel" -].containing_oneof = _CHANNELEVENTUPDATE.oneofs_by_name["channel"] -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY.fields_by_name[ - "value" -].message_type = _WALLETACCOUNTBALANCE -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY.containing_type = _WALLETBALANCERESPONSE -_WALLETBALANCERESPONSE.fields_by_name[ - "account_balance" -].message_type = _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY -_CHANNELBALANCERESPONSE.fields_by_name["local_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name["remote_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name["unsettled_local_balance"].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "unsettled_remote_balance" -].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "pending_open_local_balance" -].message_type = _AMOUNT -_CHANNELBALANCERESPONSE.fields_by_name[ - "pending_open_remote_balance" -].message_type = _AMOUNT -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY.containing_type = _QUERYROUTESREQUEST -_QUERYROUTESREQUEST.fields_by_name["fee_limit"].message_type = _FEELIMIT -_QUERYROUTESREQUEST.fields_by_name["ignored_edges"].message_type = _EDGELOCATOR -_QUERYROUTESREQUEST.fields_by_name["ignored_pairs"].message_type = _NODEPAIR -_QUERYROUTESREQUEST.fields_by_name[ - "dest_custom_records" -].message_type = _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY -_QUERYROUTESREQUEST.fields_by_name["route_hints"].message_type = _ROUTEHINT -_QUERYROUTESREQUEST.fields_by_name["dest_features"].enum_type = _FEATUREBIT -_QUERYROUTESRESPONSE.fields_by_name["routes"].message_type = _ROUTE -_HOP_CUSTOMRECORDSENTRY.containing_type = _HOP -_HOP.fields_by_name["mpp_record"].message_type = _MPPRECORD -_HOP.fields_by_name["amp_record"].message_type = _AMPRECORD -_HOP.fields_by_name["custom_records"].message_type = _HOP_CUSTOMRECORDSENTRY -_ROUTE.fields_by_name["hops"].message_type = _HOP -_NODEINFO.fields_by_name["node"].message_type = _LIGHTNINGNODE -_NODEINFO.fields_by_name["channels"].message_type = _CHANNELEDGE -_LIGHTNINGNODE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_LIGHTNINGNODE_FEATURESENTRY.containing_type = _LIGHTNINGNODE -_LIGHTNINGNODE.fields_by_name["addresses"].message_type = _NODEADDRESS -_LIGHTNINGNODE.fields_by_name["features"].message_type = _LIGHTNINGNODE_FEATURESENTRY -_CHANNELEDGE.fields_by_name["node1_policy"].message_type = _ROUTINGPOLICY -_CHANNELEDGE.fields_by_name["node2_policy"].message_type = _ROUTINGPOLICY -_CHANNELGRAPH.fields_by_name["nodes"].message_type = _LIGHTNINGNODE -_CHANNELGRAPH.fields_by_name["edges"].message_type = _CHANNELEDGE -_NODEMETRICSREQUEST.fields_by_name["types"].enum_type = _NODEMETRICTYPE -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY.fields_by_name[ - "value" -].message_type = _FLOATMETRIC -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY.containing_type = _NODEMETRICSRESPONSE -_NODEMETRICSRESPONSE.fields_by_name[ - "betweenness_centrality" -].message_type = _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY -_GRAPHTOPOLOGYUPDATE.fields_by_name["node_updates"].message_type = _NODEUPDATE -_GRAPHTOPOLOGYUPDATE.fields_by_name["channel_updates"].message_type = _CHANNELEDGEUPDATE -_GRAPHTOPOLOGYUPDATE.fields_by_name["closed_chans"].message_type = _CLOSEDCHANNELUPDATE -_NODEUPDATE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_NODEUPDATE_FEATURESENTRY.containing_type = _NODEUPDATE -_NODEUPDATE.fields_by_name["node_addresses"].message_type = _NODEADDRESS -_NODEUPDATE.fields_by_name["features"].message_type = _NODEUPDATE_FEATURESENTRY -_CHANNELEDGEUPDATE.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANNELEDGEUPDATE.fields_by_name["routing_policy"].message_type = _ROUTINGPOLICY -_CLOSEDCHANNELUPDATE.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_ROUTEHINT.fields_by_name["hop_hints"].message_type = _HOPHINT -_AMPINVOICESTATE.fields_by_name["state"].enum_type = _INVOICEHTLCSTATE -_INVOICE_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_INVOICE_FEATURESENTRY.containing_type = _INVOICE -_INVOICE_AMPINVOICESTATEENTRY.fields_by_name["value"].message_type = _AMPINVOICESTATE -_INVOICE_AMPINVOICESTATEENTRY.containing_type = _INVOICE -_INVOICE.fields_by_name["route_hints"].message_type = _ROUTEHINT -_INVOICE.fields_by_name["state"].enum_type = _INVOICE_INVOICESTATE -_INVOICE.fields_by_name["htlcs"].message_type = _INVOICEHTLC -_INVOICE.fields_by_name["features"].message_type = _INVOICE_FEATURESENTRY -_INVOICE.fields_by_name[ - "amp_invoice_state" -].message_type = _INVOICE_AMPINVOICESTATEENTRY -_INVOICE_INVOICESTATE.containing_type = _INVOICE -_INVOICEHTLC_CUSTOMRECORDSENTRY.containing_type = _INVOICEHTLC -_INVOICEHTLC.fields_by_name["state"].enum_type = _INVOICEHTLCSTATE -_INVOICEHTLC.fields_by_name[ - "custom_records" -].message_type = _INVOICEHTLC_CUSTOMRECORDSENTRY -_INVOICEHTLC.fields_by_name["amp"].message_type = _AMP -_LISTINVOICERESPONSE.fields_by_name["invoices"].message_type = _INVOICE -_PAYMENT.fields_by_name["status"].enum_type = _PAYMENT_PAYMENTSTATUS -_PAYMENT.fields_by_name["htlcs"].message_type = _HTLCATTEMPT -_PAYMENT.fields_by_name["failure_reason"].enum_type = _PAYMENTFAILUREREASON -_PAYMENT_PAYMENTSTATUS.containing_type = _PAYMENT -_HTLCATTEMPT.fields_by_name["status"].enum_type = _HTLCATTEMPT_HTLCSTATUS -_HTLCATTEMPT.fields_by_name["route"].message_type = _ROUTE -_HTLCATTEMPT.fields_by_name["failure"].message_type = _FAILURE -_HTLCATTEMPT_HTLCSTATUS.containing_type = _HTLCATTEMPT -_LISTPAYMENTSRESPONSE.fields_by_name["payments"].message_type = _PAYMENT -_ABANDONCHANNELREQUEST.fields_by_name["channel_point"].message_type = _CHANNELPOINT -_PAYREQ_FEATURESENTRY.fields_by_name["value"].message_type = _FEATURE -_PAYREQ_FEATURESENTRY.containing_type = _PAYREQ -_PAYREQ.fields_by_name["route_hints"].message_type = _ROUTEHINT -_PAYREQ.fields_by_name["features"].message_type = _PAYREQ_FEATURESENTRY -_FEEREPORTRESPONSE.fields_by_name["channel_fees"].message_type = _CHANNELFEEREPORT -_POLICYUPDATEREQUEST.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_POLICYUPDATEREQUEST.oneofs_by_name["scope"].fields.append( - _POLICYUPDATEREQUEST.fields_by_name["global"] -) -_POLICYUPDATEREQUEST.fields_by_name[ - "global" -].containing_oneof = _POLICYUPDATEREQUEST.oneofs_by_name["scope"] -_POLICYUPDATEREQUEST.oneofs_by_name["scope"].fields.append( - _POLICYUPDATEREQUEST.fields_by_name["chan_point"] -) -_POLICYUPDATEREQUEST.fields_by_name[ - "chan_point" -].containing_oneof = _POLICYUPDATEREQUEST.oneofs_by_name["scope"] -_FAILEDUPDATE.fields_by_name["outpoint"].message_type = _OUTPOINT -_FAILEDUPDATE.fields_by_name["reason"].enum_type = _UPDATEFAILURE -_POLICYUPDATERESPONSE.fields_by_name["failed_updates"].message_type = _FAILEDUPDATE -_FORWARDINGHISTORYRESPONSE.fields_by_name[ - "forwarding_events" -].message_type = _FORWARDINGEVENT -_EXPORTCHANNELBACKUPREQUEST.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_CHANNELBACKUP.fields_by_name["chan_point"].message_type = _CHANNELPOINT -_MULTICHANBACKUP.fields_by_name["chan_points"].message_type = _CHANNELPOINT -_CHANBACKUPSNAPSHOT.fields_by_name["single_chan_backups"].message_type = _CHANNELBACKUPS -_CHANBACKUPSNAPSHOT.fields_by_name["multi_chan_backup"].message_type = _MULTICHANBACKUP -_CHANNELBACKUPS.fields_by_name["chan_backups"].message_type = _CHANNELBACKUP -_RESTORECHANBACKUPREQUEST.fields_by_name["chan_backups"].message_type = _CHANNELBACKUPS -_RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"].fields.append( - _RESTORECHANBACKUPREQUEST.fields_by_name["chan_backups"] -) -_RESTORECHANBACKUPREQUEST.fields_by_name[ - "chan_backups" -].containing_oneof = _RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"] -_RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"].fields.append( - _RESTORECHANBACKUPREQUEST.fields_by_name["multi_chan_backup"] -) -_RESTORECHANBACKUPREQUEST.fields_by_name[ - "multi_chan_backup" -].containing_oneof = _RESTORECHANBACKUPREQUEST.oneofs_by_name["backup"] -_BAKEMACAROONREQUEST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_MACAROONPERMISSIONLIST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY.fields_by_name[ - "value" -].message_type = _MACAROONPERMISSIONLIST -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY.containing_type = ( - _LISTPERMISSIONSRESPONSE -) -_LISTPERMISSIONSRESPONSE.fields_by_name[ - "method_permissions" -].message_type = _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY -_FAILURE.fields_by_name["code"].enum_type = _FAILURE_FAILURECODE -_FAILURE.fields_by_name["channel_update"].message_type = _CHANNELUPDATE -_FAILURE_FAILURECODE.containing_type = _FAILURE -_MACAROONID.fields_by_name["ops"].message_type = _OP -_CHECKMACPERMREQUEST.fields_by_name["permissions"].message_type = _MACAROONPERMISSION -_RPCMIDDLEWAREREQUEST.fields_by_name["stream_auth"].message_type = _STREAMAUTH -_RPCMIDDLEWAREREQUEST.fields_by_name["request"].message_type = _RPCMESSAGE -_RPCMIDDLEWAREREQUEST.fields_by_name["response"].message_type = _RPCMESSAGE -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["stream_auth"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "stream_auth" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["request"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "request" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"].fields.append( - _RPCMIDDLEWAREREQUEST.fields_by_name["response"] -) -_RPCMIDDLEWAREREQUEST.fields_by_name[ - "response" -].containing_oneof = _RPCMIDDLEWAREREQUEST.oneofs_by_name["intercept_type"] -_RPCMIDDLEWARERESPONSE.fields_by_name["register"].message_type = _MIDDLEWAREREGISTRATION -_RPCMIDDLEWARERESPONSE.fields_by_name["feedback"].message_type = _INTERCEPTFEEDBACK -_RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"].fields.append( - _RPCMIDDLEWARERESPONSE.fields_by_name["register"] -) -_RPCMIDDLEWARERESPONSE.fields_by_name[ - "register" -].containing_oneof = _RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"] -_RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"].fields.append( - _RPCMIDDLEWARERESPONSE.fields_by_name["feedback"] -) -_RPCMIDDLEWARERESPONSE.fields_by_name[ - "feedback" -].containing_oneof = _RPCMIDDLEWARERESPONSE.oneofs_by_name["middleware_message"] -DESCRIPTOR.message_types_by_name[ +_SUBSCRIBECUSTOMMESSAGESREQUEST = DESCRIPTOR.message_types_by_name[ "SubscribeCustomMessagesRequest" -] = _SUBSCRIBECUSTOMMESSAGESREQUEST -DESCRIPTOR.message_types_by_name["CustomMessage"] = _CUSTOMMESSAGE -DESCRIPTOR.message_types_by_name["SendCustomMessageRequest"] = _SENDCUSTOMMESSAGEREQUEST -DESCRIPTOR.message_types_by_name[ +] +_CUSTOMMESSAGE = DESCRIPTOR.message_types_by_name["CustomMessage"] +_SENDCUSTOMMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["SendCustomMessageRequest"] +_SENDCUSTOMMESSAGERESPONSE = DESCRIPTOR.message_types_by_name[ "SendCustomMessageResponse" -] = _SENDCUSTOMMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["Utxo"] = _UTXO -DESCRIPTOR.message_types_by_name["Transaction"] = _TRANSACTION -DESCRIPTOR.message_types_by_name["GetTransactionsRequest"] = _GETTRANSACTIONSREQUEST -DESCRIPTOR.message_types_by_name["TransactionDetails"] = _TRANSACTIONDETAILS -DESCRIPTOR.message_types_by_name["FeeLimit"] = _FEELIMIT -DESCRIPTOR.message_types_by_name["SendRequest"] = _SENDREQUEST -DESCRIPTOR.message_types_by_name["SendResponse"] = _SENDRESPONSE -DESCRIPTOR.message_types_by_name["SendToRouteRequest"] = _SENDTOROUTEREQUEST -DESCRIPTOR.message_types_by_name["ChannelAcceptRequest"] = _CHANNELACCEPTREQUEST -DESCRIPTOR.message_types_by_name["ChannelAcceptResponse"] = _CHANNELACCEPTRESPONSE -DESCRIPTOR.message_types_by_name["ChannelPoint"] = _CHANNELPOINT -DESCRIPTOR.message_types_by_name["OutPoint"] = _OUTPOINT -DESCRIPTOR.message_types_by_name["LightningAddress"] = _LIGHTNINGADDRESS -DESCRIPTOR.message_types_by_name["EstimateFeeRequest"] = _ESTIMATEFEEREQUEST -DESCRIPTOR.message_types_by_name["EstimateFeeResponse"] = _ESTIMATEFEERESPONSE -DESCRIPTOR.message_types_by_name["SendManyRequest"] = _SENDMANYREQUEST -DESCRIPTOR.message_types_by_name["SendManyResponse"] = _SENDMANYRESPONSE -DESCRIPTOR.message_types_by_name["SendCoinsRequest"] = _SENDCOINSREQUEST -DESCRIPTOR.message_types_by_name["SendCoinsResponse"] = _SENDCOINSRESPONSE -DESCRIPTOR.message_types_by_name["ListUnspentRequest"] = _LISTUNSPENTREQUEST -DESCRIPTOR.message_types_by_name["ListUnspentResponse"] = _LISTUNSPENTRESPONSE -DESCRIPTOR.message_types_by_name["NewAddressRequest"] = _NEWADDRESSREQUEST -DESCRIPTOR.message_types_by_name["NewAddressResponse"] = _NEWADDRESSRESPONSE -DESCRIPTOR.message_types_by_name["SignMessageRequest"] = _SIGNMESSAGEREQUEST -DESCRIPTOR.message_types_by_name["SignMessageResponse"] = _SIGNMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["VerifyMessageRequest"] = _VERIFYMESSAGEREQUEST -DESCRIPTOR.message_types_by_name["VerifyMessageResponse"] = _VERIFYMESSAGERESPONSE -DESCRIPTOR.message_types_by_name["ConnectPeerRequest"] = _CONNECTPEERREQUEST -DESCRIPTOR.message_types_by_name["ConnectPeerResponse"] = _CONNECTPEERRESPONSE -DESCRIPTOR.message_types_by_name["DisconnectPeerRequest"] = _DISCONNECTPEERREQUEST -DESCRIPTOR.message_types_by_name["DisconnectPeerResponse"] = _DISCONNECTPEERRESPONSE -DESCRIPTOR.message_types_by_name["HTLC"] = _HTLC -DESCRIPTOR.message_types_by_name["ChannelConstraints"] = _CHANNELCONSTRAINTS -DESCRIPTOR.message_types_by_name["Channel"] = _CHANNEL -DESCRIPTOR.message_types_by_name["ListChannelsRequest"] = _LISTCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["ListChannelsResponse"] = _LISTCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["ChannelCloseSummary"] = _CHANNELCLOSESUMMARY -DESCRIPTOR.message_types_by_name["Resolution"] = _RESOLUTION -DESCRIPTOR.message_types_by_name["ClosedChannelsRequest"] = _CLOSEDCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["ClosedChannelsResponse"] = _CLOSEDCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["Peer"] = _PEER -DESCRIPTOR.message_types_by_name["TimestampedError"] = _TIMESTAMPEDERROR -DESCRIPTOR.message_types_by_name["ListPeersRequest"] = _LISTPEERSREQUEST -DESCRIPTOR.message_types_by_name["ListPeersResponse"] = _LISTPEERSRESPONSE -DESCRIPTOR.message_types_by_name["PeerEventSubscription"] = _PEEREVENTSUBSCRIPTION -DESCRIPTOR.message_types_by_name["PeerEvent"] = _PEEREVENT -DESCRIPTOR.message_types_by_name["GetInfoRequest"] = _GETINFOREQUEST -DESCRIPTOR.message_types_by_name["GetInfoResponse"] = _GETINFORESPONSE -DESCRIPTOR.message_types_by_name["GetRecoveryInfoRequest"] = _GETRECOVERYINFOREQUEST -DESCRIPTOR.message_types_by_name["GetRecoveryInfoResponse"] = _GETRECOVERYINFORESPONSE -DESCRIPTOR.message_types_by_name["Chain"] = _CHAIN -DESCRIPTOR.message_types_by_name["ConfirmationUpdate"] = _CONFIRMATIONUPDATE -DESCRIPTOR.message_types_by_name["ChannelOpenUpdate"] = _CHANNELOPENUPDATE -DESCRIPTOR.message_types_by_name["ChannelCloseUpdate"] = _CHANNELCLOSEUPDATE -DESCRIPTOR.message_types_by_name["CloseChannelRequest"] = _CLOSECHANNELREQUEST -DESCRIPTOR.message_types_by_name["CloseStatusUpdate"] = _CLOSESTATUSUPDATE -DESCRIPTOR.message_types_by_name["PendingUpdate"] = _PENDINGUPDATE -DESCRIPTOR.message_types_by_name["ReadyForPsbtFunding"] = _READYFORPSBTFUNDING -DESCRIPTOR.message_types_by_name["BatchOpenChannelRequest"] = _BATCHOPENCHANNELREQUEST -DESCRIPTOR.message_types_by_name["BatchOpenChannel"] = _BATCHOPENCHANNEL -DESCRIPTOR.message_types_by_name["BatchOpenChannelResponse"] = _BATCHOPENCHANNELRESPONSE -DESCRIPTOR.message_types_by_name["OpenChannelRequest"] = _OPENCHANNELREQUEST -DESCRIPTOR.message_types_by_name["OpenStatusUpdate"] = _OPENSTATUSUPDATE -DESCRIPTOR.message_types_by_name["KeyLocator"] = _KEYLOCATOR -DESCRIPTOR.message_types_by_name["KeyDescriptor"] = _KEYDESCRIPTOR -DESCRIPTOR.message_types_by_name["ChanPointShim"] = _CHANPOINTSHIM -DESCRIPTOR.message_types_by_name["PsbtShim"] = _PSBTSHIM -DESCRIPTOR.message_types_by_name["FundingShim"] = _FUNDINGSHIM -DESCRIPTOR.message_types_by_name["FundingShimCancel"] = _FUNDINGSHIMCANCEL -DESCRIPTOR.message_types_by_name["FundingPsbtVerify"] = _FUNDINGPSBTVERIFY -DESCRIPTOR.message_types_by_name["FundingPsbtFinalize"] = _FUNDINGPSBTFINALIZE -DESCRIPTOR.message_types_by_name["FundingTransitionMsg"] = _FUNDINGTRANSITIONMSG -DESCRIPTOR.message_types_by_name["FundingStateStepResp"] = _FUNDINGSTATESTEPRESP -DESCRIPTOR.message_types_by_name["PendingHTLC"] = _PENDINGHTLC -DESCRIPTOR.message_types_by_name["PendingChannelsRequest"] = _PENDINGCHANNELSREQUEST -DESCRIPTOR.message_types_by_name["PendingChannelsResponse"] = _PENDINGCHANNELSRESPONSE -DESCRIPTOR.message_types_by_name["ChannelEventSubscription"] = _CHANNELEVENTSUBSCRIPTION -DESCRIPTOR.message_types_by_name["ChannelEventUpdate"] = _CHANNELEVENTUPDATE -DESCRIPTOR.message_types_by_name["WalletAccountBalance"] = _WALLETACCOUNTBALANCE -DESCRIPTOR.message_types_by_name["WalletBalanceRequest"] = _WALLETBALANCEREQUEST -DESCRIPTOR.message_types_by_name["WalletBalanceResponse"] = _WALLETBALANCERESPONSE -DESCRIPTOR.message_types_by_name["Amount"] = _AMOUNT -DESCRIPTOR.message_types_by_name["ChannelBalanceRequest"] = _CHANNELBALANCEREQUEST -DESCRIPTOR.message_types_by_name["ChannelBalanceResponse"] = _CHANNELBALANCERESPONSE -DESCRIPTOR.message_types_by_name["QueryRoutesRequest"] = _QUERYROUTESREQUEST -DESCRIPTOR.message_types_by_name["NodePair"] = _NODEPAIR -DESCRIPTOR.message_types_by_name["EdgeLocator"] = _EDGELOCATOR -DESCRIPTOR.message_types_by_name["QueryRoutesResponse"] = _QUERYROUTESRESPONSE -DESCRIPTOR.message_types_by_name["Hop"] = _HOP -DESCRIPTOR.message_types_by_name["MPPRecord"] = _MPPRECORD -DESCRIPTOR.message_types_by_name["AMPRecord"] = _AMPRECORD -DESCRIPTOR.message_types_by_name["Route"] = _ROUTE -DESCRIPTOR.message_types_by_name["NodeInfoRequest"] = _NODEINFOREQUEST -DESCRIPTOR.message_types_by_name["NodeInfo"] = _NODEINFO -DESCRIPTOR.message_types_by_name["LightningNode"] = _LIGHTNINGNODE -DESCRIPTOR.message_types_by_name["NodeAddress"] = _NODEADDRESS -DESCRIPTOR.message_types_by_name["RoutingPolicy"] = _ROUTINGPOLICY -DESCRIPTOR.message_types_by_name["ChannelEdge"] = _CHANNELEDGE -DESCRIPTOR.message_types_by_name["ChannelGraphRequest"] = _CHANNELGRAPHREQUEST -DESCRIPTOR.message_types_by_name["ChannelGraph"] = _CHANNELGRAPH -DESCRIPTOR.message_types_by_name["NodeMetricsRequest"] = _NODEMETRICSREQUEST -DESCRIPTOR.message_types_by_name["NodeMetricsResponse"] = _NODEMETRICSRESPONSE -DESCRIPTOR.message_types_by_name["FloatMetric"] = _FLOATMETRIC -DESCRIPTOR.message_types_by_name["ChanInfoRequest"] = _CHANINFOREQUEST -DESCRIPTOR.message_types_by_name["NetworkInfoRequest"] = _NETWORKINFOREQUEST -DESCRIPTOR.message_types_by_name["NetworkInfo"] = _NETWORKINFO -DESCRIPTOR.message_types_by_name["StopRequest"] = _STOPREQUEST -DESCRIPTOR.message_types_by_name["StopResponse"] = _STOPRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_UTXO = DESCRIPTOR.message_types_by_name["Utxo"] +_OUTPUTDETAIL = DESCRIPTOR.message_types_by_name["OutputDetail"] +_TRANSACTION = DESCRIPTOR.message_types_by_name["Transaction"] +_GETTRANSACTIONSREQUEST = DESCRIPTOR.message_types_by_name["GetTransactionsRequest"] +_TRANSACTIONDETAILS = DESCRIPTOR.message_types_by_name["TransactionDetails"] +_FEELIMIT = DESCRIPTOR.message_types_by_name["FeeLimit"] +_SENDREQUEST = DESCRIPTOR.message_types_by_name["SendRequest"] +_SENDREQUEST_DESTCUSTOMRECORDSENTRY = _SENDREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_SENDRESPONSE = DESCRIPTOR.message_types_by_name["SendResponse"] +_SENDTOROUTEREQUEST = DESCRIPTOR.message_types_by_name["SendToRouteRequest"] +_CHANNELACCEPTREQUEST = DESCRIPTOR.message_types_by_name["ChannelAcceptRequest"] +_CHANNELACCEPTRESPONSE = DESCRIPTOR.message_types_by_name["ChannelAcceptResponse"] +_CHANNELPOINT = DESCRIPTOR.message_types_by_name["ChannelPoint"] +_OUTPOINT = DESCRIPTOR.message_types_by_name["OutPoint"] +_PREVIOUSOUTPOINT = DESCRIPTOR.message_types_by_name["PreviousOutPoint"] +_LIGHTNINGADDRESS = DESCRIPTOR.message_types_by_name["LightningAddress"] +_ESTIMATEFEEREQUEST = DESCRIPTOR.message_types_by_name["EstimateFeeRequest"] +_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY = _ESTIMATEFEEREQUEST.nested_types_by_name[ + "AddrToAmountEntry" +] +_ESTIMATEFEERESPONSE = DESCRIPTOR.message_types_by_name["EstimateFeeResponse"] +_SENDMANYREQUEST = DESCRIPTOR.message_types_by_name["SendManyRequest"] +_SENDMANYREQUEST_ADDRTOAMOUNTENTRY = _SENDMANYREQUEST.nested_types_by_name[ + "AddrToAmountEntry" +] +_SENDMANYRESPONSE = DESCRIPTOR.message_types_by_name["SendManyResponse"] +_SENDCOINSREQUEST = DESCRIPTOR.message_types_by_name["SendCoinsRequest"] +_SENDCOINSRESPONSE = DESCRIPTOR.message_types_by_name["SendCoinsResponse"] +_LISTUNSPENTREQUEST = DESCRIPTOR.message_types_by_name["ListUnspentRequest"] +_LISTUNSPENTRESPONSE = DESCRIPTOR.message_types_by_name["ListUnspentResponse"] +_NEWADDRESSREQUEST = DESCRIPTOR.message_types_by_name["NewAddressRequest"] +_NEWADDRESSRESPONSE = DESCRIPTOR.message_types_by_name["NewAddressResponse"] +_SIGNMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["SignMessageRequest"] +_SIGNMESSAGERESPONSE = DESCRIPTOR.message_types_by_name["SignMessageResponse"] +_VERIFYMESSAGEREQUEST = DESCRIPTOR.message_types_by_name["VerifyMessageRequest"] +_VERIFYMESSAGERESPONSE = DESCRIPTOR.message_types_by_name["VerifyMessageResponse"] +_CONNECTPEERREQUEST = DESCRIPTOR.message_types_by_name["ConnectPeerRequest"] +_CONNECTPEERRESPONSE = DESCRIPTOR.message_types_by_name["ConnectPeerResponse"] +_DISCONNECTPEERREQUEST = DESCRIPTOR.message_types_by_name["DisconnectPeerRequest"] +_DISCONNECTPEERRESPONSE = DESCRIPTOR.message_types_by_name["DisconnectPeerResponse"] +_HTLC = DESCRIPTOR.message_types_by_name["HTLC"] +_CHANNELCONSTRAINTS = DESCRIPTOR.message_types_by_name["ChannelConstraints"] +_CHANNEL = DESCRIPTOR.message_types_by_name["Channel"] +_LISTCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["ListChannelsRequest"] +_LISTCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["ListChannelsResponse"] +_CHANNELCLOSESUMMARY = DESCRIPTOR.message_types_by_name["ChannelCloseSummary"] +_RESOLUTION = DESCRIPTOR.message_types_by_name["Resolution"] +_CLOSEDCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["ClosedChannelsRequest"] +_CLOSEDCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["ClosedChannelsResponse"] +_PEER = DESCRIPTOR.message_types_by_name["Peer"] +_PEER_FEATURESENTRY = _PEER.nested_types_by_name["FeaturesEntry"] +_TIMESTAMPEDERROR = DESCRIPTOR.message_types_by_name["TimestampedError"] +_LISTPEERSREQUEST = DESCRIPTOR.message_types_by_name["ListPeersRequest"] +_LISTPEERSRESPONSE = DESCRIPTOR.message_types_by_name["ListPeersResponse"] +_PEEREVENTSUBSCRIPTION = DESCRIPTOR.message_types_by_name["PeerEventSubscription"] +_PEEREVENT = DESCRIPTOR.message_types_by_name["PeerEvent"] +_GETINFOREQUEST = DESCRIPTOR.message_types_by_name["GetInfoRequest"] +_GETINFORESPONSE = DESCRIPTOR.message_types_by_name["GetInfoResponse"] +_GETINFORESPONSE_FEATURESENTRY = _GETINFORESPONSE.nested_types_by_name["FeaturesEntry"] +_GETRECOVERYINFOREQUEST = DESCRIPTOR.message_types_by_name["GetRecoveryInfoRequest"] +_GETRECOVERYINFORESPONSE = DESCRIPTOR.message_types_by_name["GetRecoveryInfoResponse"] +_CHAIN = DESCRIPTOR.message_types_by_name["Chain"] +_CONFIRMATIONUPDATE = DESCRIPTOR.message_types_by_name["ConfirmationUpdate"] +_CHANNELOPENUPDATE = DESCRIPTOR.message_types_by_name["ChannelOpenUpdate"] +_CHANNELCLOSEUPDATE = DESCRIPTOR.message_types_by_name["ChannelCloseUpdate"] +_CLOSECHANNELREQUEST = DESCRIPTOR.message_types_by_name["CloseChannelRequest"] +_CLOSESTATUSUPDATE = DESCRIPTOR.message_types_by_name["CloseStatusUpdate"] +_PENDINGUPDATE = DESCRIPTOR.message_types_by_name["PendingUpdate"] +_READYFORPSBTFUNDING = DESCRIPTOR.message_types_by_name["ReadyForPsbtFunding"] +_BATCHOPENCHANNELREQUEST = DESCRIPTOR.message_types_by_name["BatchOpenChannelRequest"] +_BATCHOPENCHANNEL = DESCRIPTOR.message_types_by_name["BatchOpenChannel"] +_BATCHOPENCHANNELRESPONSE = DESCRIPTOR.message_types_by_name["BatchOpenChannelResponse"] +_OPENCHANNELREQUEST = DESCRIPTOR.message_types_by_name["OpenChannelRequest"] +_OPENSTATUSUPDATE = DESCRIPTOR.message_types_by_name["OpenStatusUpdate"] +_KEYLOCATOR = DESCRIPTOR.message_types_by_name["KeyLocator"] +_KEYDESCRIPTOR = DESCRIPTOR.message_types_by_name["KeyDescriptor"] +_CHANPOINTSHIM = DESCRIPTOR.message_types_by_name["ChanPointShim"] +_PSBTSHIM = DESCRIPTOR.message_types_by_name["PsbtShim"] +_FUNDINGSHIM = DESCRIPTOR.message_types_by_name["FundingShim"] +_FUNDINGSHIMCANCEL = DESCRIPTOR.message_types_by_name["FundingShimCancel"] +_FUNDINGPSBTVERIFY = DESCRIPTOR.message_types_by_name["FundingPsbtVerify"] +_FUNDINGPSBTFINALIZE = DESCRIPTOR.message_types_by_name["FundingPsbtFinalize"] +_FUNDINGTRANSITIONMSG = DESCRIPTOR.message_types_by_name["FundingTransitionMsg"] +_FUNDINGSTATESTEPRESP = DESCRIPTOR.message_types_by_name["FundingStateStepResp"] +_PENDINGHTLC = DESCRIPTOR.message_types_by_name["PendingHTLC"] +_PENDINGCHANNELSREQUEST = DESCRIPTOR.message_types_by_name["PendingChannelsRequest"] +_PENDINGCHANNELSRESPONSE = DESCRIPTOR.message_types_by_name["PendingChannelsResponse"] +_PENDINGCHANNELSRESPONSE_PENDINGCHANNEL = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "PendingChannel" +] +_PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["PendingOpenChannel"] +) +_PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["WaitingCloseChannel"] +) +_PENDINGCHANNELSRESPONSE_COMMITMENTS = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "Commitments" +] +_PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL = _PENDINGCHANNELSRESPONSE.nested_types_by_name[ + "ClosedChannel" +] +_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL = ( + _PENDINGCHANNELSRESPONSE.nested_types_by_name["ForceClosedChannel"] +) +_CHANNELEVENTSUBSCRIPTION = DESCRIPTOR.message_types_by_name["ChannelEventSubscription"] +_CHANNELEVENTUPDATE = DESCRIPTOR.message_types_by_name["ChannelEventUpdate"] +_WALLETACCOUNTBALANCE = DESCRIPTOR.message_types_by_name["WalletAccountBalance"] +_WALLETBALANCEREQUEST = DESCRIPTOR.message_types_by_name["WalletBalanceRequest"] +_WALLETBALANCERESPONSE = DESCRIPTOR.message_types_by_name["WalletBalanceResponse"] +_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY = ( + _WALLETBALANCERESPONSE.nested_types_by_name["AccountBalanceEntry"] +) +_AMOUNT = DESCRIPTOR.message_types_by_name["Amount"] +_CHANNELBALANCEREQUEST = DESCRIPTOR.message_types_by_name["ChannelBalanceRequest"] +_CHANNELBALANCERESPONSE = DESCRIPTOR.message_types_by_name["ChannelBalanceResponse"] +_QUERYROUTESREQUEST = DESCRIPTOR.message_types_by_name["QueryRoutesRequest"] +_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY = _QUERYROUTESREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_NODEPAIR = DESCRIPTOR.message_types_by_name["NodePair"] +_EDGELOCATOR = DESCRIPTOR.message_types_by_name["EdgeLocator"] +_QUERYROUTESRESPONSE = DESCRIPTOR.message_types_by_name["QueryRoutesResponse"] +_HOP = DESCRIPTOR.message_types_by_name["Hop"] +_HOP_CUSTOMRECORDSENTRY = _HOP.nested_types_by_name["CustomRecordsEntry"] +_MPPRECORD = DESCRIPTOR.message_types_by_name["MPPRecord"] +_AMPRECORD = DESCRIPTOR.message_types_by_name["AMPRecord"] +_ROUTE = DESCRIPTOR.message_types_by_name["Route"] +_NODEINFOREQUEST = DESCRIPTOR.message_types_by_name["NodeInfoRequest"] +_NODEINFO = DESCRIPTOR.message_types_by_name["NodeInfo"] +_LIGHTNINGNODE = DESCRIPTOR.message_types_by_name["LightningNode"] +_LIGHTNINGNODE_FEATURESENTRY = _LIGHTNINGNODE.nested_types_by_name["FeaturesEntry"] +_NODEADDRESS = DESCRIPTOR.message_types_by_name["NodeAddress"] +_ROUTINGPOLICY = DESCRIPTOR.message_types_by_name["RoutingPolicy"] +_CHANNELEDGE = DESCRIPTOR.message_types_by_name["ChannelEdge"] +_CHANNELGRAPHREQUEST = DESCRIPTOR.message_types_by_name["ChannelGraphRequest"] +_CHANNELGRAPH = DESCRIPTOR.message_types_by_name["ChannelGraph"] +_NODEMETRICSREQUEST = DESCRIPTOR.message_types_by_name["NodeMetricsRequest"] +_NODEMETRICSRESPONSE = DESCRIPTOR.message_types_by_name["NodeMetricsResponse"] +_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY = ( + _NODEMETRICSRESPONSE.nested_types_by_name["BetweennessCentralityEntry"] +) +_FLOATMETRIC = DESCRIPTOR.message_types_by_name["FloatMetric"] +_CHANINFOREQUEST = DESCRIPTOR.message_types_by_name["ChanInfoRequest"] +_NETWORKINFOREQUEST = DESCRIPTOR.message_types_by_name["NetworkInfoRequest"] +_NETWORKINFO = DESCRIPTOR.message_types_by_name["NetworkInfo"] +_STOPREQUEST = DESCRIPTOR.message_types_by_name["StopRequest"] +_STOPRESPONSE = DESCRIPTOR.message_types_by_name["StopResponse"] +_GRAPHTOPOLOGYSUBSCRIPTION = DESCRIPTOR.message_types_by_name[ "GraphTopologySubscription" -] = _GRAPHTOPOLOGYSUBSCRIPTION -DESCRIPTOR.message_types_by_name["GraphTopologyUpdate"] = _GRAPHTOPOLOGYUPDATE -DESCRIPTOR.message_types_by_name["NodeUpdate"] = _NODEUPDATE -DESCRIPTOR.message_types_by_name["ChannelEdgeUpdate"] = _CHANNELEDGEUPDATE -DESCRIPTOR.message_types_by_name["ClosedChannelUpdate"] = _CLOSEDCHANNELUPDATE -DESCRIPTOR.message_types_by_name["HopHint"] = _HOPHINT -DESCRIPTOR.message_types_by_name["SetID"] = _SETID -DESCRIPTOR.message_types_by_name["RouteHint"] = _ROUTEHINT -DESCRIPTOR.message_types_by_name["AMPInvoiceState"] = _AMPINVOICESTATE -DESCRIPTOR.message_types_by_name["Invoice"] = _INVOICE -DESCRIPTOR.message_types_by_name["InvoiceHTLC"] = _INVOICEHTLC -DESCRIPTOR.message_types_by_name["AMP"] = _AMP -DESCRIPTOR.message_types_by_name["AddInvoiceResponse"] = _ADDINVOICERESPONSE -DESCRIPTOR.message_types_by_name["PaymentHash"] = _PAYMENTHASH -DESCRIPTOR.message_types_by_name["ListInvoiceRequest"] = _LISTINVOICEREQUEST -DESCRIPTOR.message_types_by_name["ListInvoiceResponse"] = _LISTINVOICERESPONSE -DESCRIPTOR.message_types_by_name["InvoiceSubscription"] = _INVOICESUBSCRIPTION -DESCRIPTOR.message_types_by_name["Payment"] = _PAYMENT -DESCRIPTOR.message_types_by_name["HTLCAttempt"] = _HTLCATTEMPT -DESCRIPTOR.message_types_by_name["ListPaymentsRequest"] = _LISTPAYMENTSREQUEST -DESCRIPTOR.message_types_by_name["ListPaymentsResponse"] = _LISTPAYMENTSRESPONSE -DESCRIPTOR.message_types_by_name["DeletePaymentRequest"] = _DELETEPAYMENTREQUEST -DESCRIPTOR.message_types_by_name["DeleteAllPaymentsRequest"] = _DELETEALLPAYMENTSREQUEST -DESCRIPTOR.message_types_by_name["DeletePaymentResponse"] = _DELETEPAYMENTRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_GRAPHTOPOLOGYUPDATE = DESCRIPTOR.message_types_by_name["GraphTopologyUpdate"] +_NODEUPDATE = DESCRIPTOR.message_types_by_name["NodeUpdate"] +_NODEUPDATE_FEATURESENTRY = _NODEUPDATE.nested_types_by_name["FeaturesEntry"] +_CHANNELEDGEUPDATE = DESCRIPTOR.message_types_by_name["ChannelEdgeUpdate"] +_CLOSEDCHANNELUPDATE = DESCRIPTOR.message_types_by_name["ClosedChannelUpdate"] +_HOPHINT = DESCRIPTOR.message_types_by_name["HopHint"] +_SETID = DESCRIPTOR.message_types_by_name["SetID"] +_ROUTEHINT = DESCRIPTOR.message_types_by_name["RouteHint"] +_AMPINVOICESTATE = DESCRIPTOR.message_types_by_name["AMPInvoiceState"] +_INVOICE = DESCRIPTOR.message_types_by_name["Invoice"] +_INVOICE_FEATURESENTRY = _INVOICE.nested_types_by_name["FeaturesEntry"] +_INVOICE_AMPINVOICESTATEENTRY = _INVOICE.nested_types_by_name["AmpInvoiceStateEntry"] +_INVOICEHTLC = DESCRIPTOR.message_types_by_name["InvoiceHTLC"] +_INVOICEHTLC_CUSTOMRECORDSENTRY = _INVOICEHTLC.nested_types_by_name[ + "CustomRecordsEntry" +] +_AMP = DESCRIPTOR.message_types_by_name["AMP"] +_ADDINVOICERESPONSE = DESCRIPTOR.message_types_by_name["AddInvoiceResponse"] +_PAYMENTHASH = DESCRIPTOR.message_types_by_name["PaymentHash"] +_LISTINVOICEREQUEST = DESCRIPTOR.message_types_by_name["ListInvoiceRequest"] +_LISTINVOICERESPONSE = DESCRIPTOR.message_types_by_name["ListInvoiceResponse"] +_INVOICESUBSCRIPTION = DESCRIPTOR.message_types_by_name["InvoiceSubscription"] +_PAYMENT = DESCRIPTOR.message_types_by_name["Payment"] +_HTLCATTEMPT = DESCRIPTOR.message_types_by_name["HTLCAttempt"] +_LISTPAYMENTSREQUEST = DESCRIPTOR.message_types_by_name["ListPaymentsRequest"] +_LISTPAYMENTSRESPONSE = DESCRIPTOR.message_types_by_name["ListPaymentsResponse"] +_DELETEPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["DeletePaymentRequest"] +_DELETEALLPAYMENTSREQUEST = DESCRIPTOR.message_types_by_name["DeleteAllPaymentsRequest"] +_DELETEPAYMENTRESPONSE = DESCRIPTOR.message_types_by_name["DeletePaymentResponse"] +_DELETEALLPAYMENTSRESPONSE = DESCRIPTOR.message_types_by_name[ "DeleteAllPaymentsResponse" -] = _DELETEALLPAYMENTSRESPONSE -DESCRIPTOR.message_types_by_name["AbandonChannelRequest"] = _ABANDONCHANNELREQUEST -DESCRIPTOR.message_types_by_name["AbandonChannelResponse"] = _ABANDONCHANNELRESPONSE -DESCRIPTOR.message_types_by_name["DebugLevelRequest"] = _DEBUGLEVELREQUEST -DESCRIPTOR.message_types_by_name["DebugLevelResponse"] = _DEBUGLEVELRESPONSE -DESCRIPTOR.message_types_by_name["PayReqString"] = _PAYREQSTRING -DESCRIPTOR.message_types_by_name["PayReq"] = _PAYREQ -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["FeeReportRequest"] = _FEEREPORTREQUEST -DESCRIPTOR.message_types_by_name["ChannelFeeReport"] = _CHANNELFEEREPORT -DESCRIPTOR.message_types_by_name["FeeReportResponse"] = _FEEREPORTRESPONSE -DESCRIPTOR.message_types_by_name["PolicyUpdateRequest"] = _POLICYUPDATEREQUEST -DESCRIPTOR.message_types_by_name["FailedUpdate"] = _FAILEDUPDATE -DESCRIPTOR.message_types_by_name["PolicyUpdateResponse"] = _POLICYUPDATERESPONSE -DESCRIPTOR.message_types_by_name["ForwardingHistoryRequest"] = _FORWARDINGHISTORYREQUEST -DESCRIPTOR.message_types_by_name["ForwardingEvent"] = _FORWARDINGEVENT -DESCRIPTOR.message_types_by_name[ +] +_ABANDONCHANNELREQUEST = DESCRIPTOR.message_types_by_name["AbandonChannelRequest"] +_ABANDONCHANNELRESPONSE = DESCRIPTOR.message_types_by_name["AbandonChannelResponse"] +_DEBUGLEVELREQUEST = DESCRIPTOR.message_types_by_name["DebugLevelRequest"] +_DEBUGLEVELRESPONSE = DESCRIPTOR.message_types_by_name["DebugLevelResponse"] +_PAYREQSTRING = DESCRIPTOR.message_types_by_name["PayReqString"] +_PAYREQ = DESCRIPTOR.message_types_by_name["PayReq"] +_PAYREQ_FEATURESENTRY = _PAYREQ.nested_types_by_name["FeaturesEntry"] +_FEATURE = DESCRIPTOR.message_types_by_name["Feature"] +_FEEREPORTREQUEST = DESCRIPTOR.message_types_by_name["FeeReportRequest"] +_CHANNELFEEREPORT = DESCRIPTOR.message_types_by_name["ChannelFeeReport"] +_FEEREPORTRESPONSE = DESCRIPTOR.message_types_by_name["FeeReportResponse"] +_POLICYUPDATEREQUEST = DESCRIPTOR.message_types_by_name["PolicyUpdateRequest"] +_FAILEDUPDATE = DESCRIPTOR.message_types_by_name["FailedUpdate"] +_POLICYUPDATERESPONSE = DESCRIPTOR.message_types_by_name["PolicyUpdateResponse"] +_FORWARDINGHISTORYREQUEST = DESCRIPTOR.message_types_by_name["ForwardingHistoryRequest"] +_FORWARDINGEVENT = DESCRIPTOR.message_types_by_name["ForwardingEvent"] +_FORWARDINGHISTORYRESPONSE = DESCRIPTOR.message_types_by_name[ "ForwardingHistoryResponse" -] = _FORWARDINGHISTORYRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_EXPORTCHANNELBACKUPREQUEST = DESCRIPTOR.message_types_by_name[ "ExportChannelBackupRequest" -] = _EXPORTCHANNELBACKUPREQUEST -DESCRIPTOR.message_types_by_name["ChannelBackup"] = _CHANNELBACKUP -DESCRIPTOR.message_types_by_name["MultiChanBackup"] = _MULTICHANBACKUP -DESCRIPTOR.message_types_by_name["ChanBackupExportRequest"] = _CHANBACKUPEXPORTREQUEST -DESCRIPTOR.message_types_by_name["ChanBackupSnapshot"] = _CHANBACKUPSNAPSHOT -DESCRIPTOR.message_types_by_name["ChannelBackups"] = _CHANNELBACKUPS -DESCRIPTOR.message_types_by_name["RestoreChanBackupRequest"] = _RESTORECHANBACKUPREQUEST -DESCRIPTOR.message_types_by_name["RestoreBackupResponse"] = _RESTOREBACKUPRESPONSE -DESCRIPTOR.message_types_by_name[ +] +_CHANNELBACKUP = DESCRIPTOR.message_types_by_name["ChannelBackup"] +_MULTICHANBACKUP = DESCRIPTOR.message_types_by_name["MultiChanBackup"] +_CHANBACKUPEXPORTREQUEST = DESCRIPTOR.message_types_by_name["ChanBackupExportRequest"] +_CHANBACKUPSNAPSHOT = DESCRIPTOR.message_types_by_name["ChanBackupSnapshot"] +_CHANNELBACKUPS = DESCRIPTOR.message_types_by_name["ChannelBackups"] +_RESTORECHANBACKUPREQUEST = DESCRIPTOR.message_types_by_name["RestoreChanBackupRequest"] +_RESTOREBACKUPRESPONSE = DESCRIPTOR.message_types_by_name["RestoreBackupResponse"] +_CHANNELBACKUPSUBSCRIPTION = DESCRIPTOR.message_types_by_name[ "ChannelBackupSubscription" -] = _CHANNELBACKUPSUBSCRIPTION -DESCRIPTOR.message_types_by_name["VerifyChanBackupResponse"] = _VERIFYCHANBACKUPRESPONSE -DESCRIPTOR.message_types_by_name["MacaroonPermission"] = _MACAROONPERMISSION -DESCRIPTOR.message_types_by_name["BakeMacaroonRequest"] = _BAKEMACAROONREQUEST -DESCRIPTOR.message_types_by_name["BakeMacaroonResponse"] = _BAKEMACAROONRESPONSE -DESCRIPTOR.message_types_by_name["ListMacaroonIDsRequest"] = _LISTMACAROONIDSREQUEST -DESCRIPTOR.message_types_by_name["ListMacaroonIDsResponse"] = _LISTMACAROONIDSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteMacaroonIDRequest"] = _DELETEMACAROONIDREQUEST -DESCRIPTOR.message_types_by_name["DeleteMacaroonIDResponse"] = _DELETEMACAROONIDRESPONSE -DESCRIPTOR.message_types_by_name["MacaroonPermissionList"] = _MACAROONPERMISSIONLIST -DESCRIPTOR.message_types_by_name["ListPermissionsRequest"] = _LISTPERMISSIONSREQUEST -DESCRIPTOR.message_types_by_name["ListPermissionsResponse"] = _LISTPERMISSIONSRESPONSE -DESCRIPTOR.message_types_by_name["Failure"] = _FAILURE -DESCRIPTOR.message_types_by_name["ChannelUpdate"] = _CHANNELUPDATE -DESCRIPTOR.message_types_by_name["MacaroonId"] = _MACAROONID -DESCRIPTOR.message_types_by_name["Op"] = _OP -DESCRIPTOR.message_types_by_name["CheckMacPermRequest"] = _CHECKMACPERMREQUEST -DESCRIPTOR.message_types_by_name["CheckMacPermResponse"] = _CHECKMACPERMRESPONSE -DESCRIPTOR.message_types_by_name["RPCMiddlewareRequest"] = _RPCMIDDLEWAREREQUEST -DESCRIPTOR.message_types_by_name["StreamAuth"] = _STREAMAUTH -DESCRIPTOR.message_types_by_name["RPCMessage"] = _RPCMESSAGE -DESCRIPTOR.message_types_by_name["RPCMiddlewareResponse"] = _RPCMIDDLEWARERESPONSE -DESCRIPTOR.message_types_by_name["MiddlewareRegistration"] = _MIDDLEWAREREGISTRATION -DESCRIPTOR.message_types_by_name["InterceptFeedback"] = _INTERCEPTFEEDBACK -DESCRIPTOR.enum_types_by_name["AddressType"] = _ADDRESSTYPE -DESCRIPTOR.enum_types_by_name["CommitmentType"] = _COMMITMENTTYPE -DESCRIPTOR.enum_types_by_name["Initiator"] = _INITIATOR -DESCRIPTOR.enum_types_by_name["ResolutionType"] = _RESOLUTIONTYPE -DESCRIPTOR.enum_types_by_name["ResolutionOutcome"] = _RESOLUTIONOUTCOME -DESCRIPTOR.enum_types_by_name["NodeMetricType"] = _NODEMETRICTYPE -DESCRIPTOR.enum_types_by_name["InvoiceHTLCState"] = _INVOICEHTLCSTATE -DESCRIPTOR.enum_types_by_name["PaymentFailureReason"] = _PAYMENTFAILUREREASON -DESCRIPTOR.enum_types_by_name["FeatureBit"] = _FEATUREBIT -DESCRIPTOR.enum_types_by_name["UpdateFailure"] = _UPDATEFAILURE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - +] +_VERIFYCHANBACKUPRESPONSE = DESCRIPTOR.message_types_by_name["VerifyChanBackupResponse"] +_MACAROONPERMISSION = DESCRIPTOR.message_types_by_name["MacaroonPermission"] +_BAKEMACAROONREQUEST = DESCRIPTOR.message_types_by_name["BakeMacaroonRequest"] +_BAKEMACAROONRESPONSE = DESCRIPTOR.message_types_by_name["BakeMacaroonResponse"] +_LISTMACAROONIDSREQUEST = DESCRIPTOR.message_types_by_name["ListMacaroonIDsRequest"] +_LISTMACAROONIDSRESPONSE = DESCRIPTOR.message_types_by_name["ListMacaroonIDsResponse"] +_DELETEMACAROONIDREQUEST = DESCRIPTOR.message_types_by_name["DeleteMacaroonIDRequest"] +_DELETEMACAROONIDRESPONSE = DESCRIPTOR.message_types_by_name["DeleteMacaroonIDResponse"] +_MACAROONPERMISSIONLIST = DESCRIPTOR.message_types_by_name["MacaroonPermissionList"] +_LISTPERMISSIONSREQUEST = DESCRIPTOR.message_types_by_name["ListPermissionsRequest"] +_LISTPERMISSIONSRESPONSE = DESCRIPTOR.message_types_by_name["ListPermissionsResponse"] +_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY = ( + _LISTPERMISSIONSRESPONSE.nested_types_by_name["MethodPermissionsEntry"] +) +_FAILURE = DESCRIPTOR.message_types_by_name["Failure"] +_CHANNELUPDATE = DESCRIPTOR.message_types_by_name["ChannelUpdate"] +_MACAROONID = DESCRIPTOR.message_types_by_name["MacaroonId"] +_OP = DESCRIPTOR.message_types_by_name["Op"] +_CHECKMACPERMREQUEST = DESCRIPTOR.message_types_by_name["CheckMacPermRequest"] +_CHECKMACPERMRESPONSE = DESCRIPTOR.message_types_by_name["CheckMacPermResponse"] +_RPCMIDDLEWAREREQUEST = DESCRIPTOR.message_types_by_name["RPCMiddlewareRequest"] +_STREAMAUTH = DESCRIPTOR.message_types_by_name["StreamAuth"] +_RPCMESSAGE = DESCRIPTOR.message_types_by_name["RPCMessage"] +_RPCMIDDLEWARERESPONSE = DESCRIPTOR.message_types_by_name["RPCMiddlewareResponse"] +_MIDDLEWAREREGISTRATION = DESCRIPTOR.message_types_by_name["MiddlewareRegistration"] +_INTERCEPTFEEDBACK = DESCRIPTOR.message_types_by_name["InterceptFeedback"] +_CHANNELCLOSESUMMARY_CLOSURETYPE = _CHANNELCLOSESUMMARY.enum_types_by_name[ + "ClosureType" +] +_PEER_SYNCTYPE = _PEER.enum_types_by_name["SyncType"] +_PEEREVENT_EVENTTYPE = _PEEREVENT.enum_types_by_name["EventType"] +_PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE = ( + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL.enum_types_by_name["AnchorState"] +) +_CHANNELEVENTUPDATE_UPDATETYPE = _CHANNELEVENTUPDATE.enum_types_by_name["UpdateType"] +_INVOICE_INVOICESTATE = _INVOICE.enum_types_by_name["InvoiceState"] +_PAYMENT_PAYMENTSTATUS = _PAYMENT.enum_types_by_name["PaymentStatus"] +_HTLCATTEMPT_HTLCSTATUS = _HTLCATTEMPT.enum_types_by_name["HTLCStatus"] +_FAILURE_FAILURECODE = _FAILURE.enum_types_by_name["FailureCode"] SubscribeCustomMessagesRequest = _reflection.GeneratedProtocolMessageType( "SubscribeCustomMessagesRequest", (_message.Message,), @@ -21376,6 +437,17 @@ Utxo = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(Utxo) +OutputDetail = _reflection.GeneratedProtocolMessageType( + "OutputDetail", + (_message.Message,), + { + "DESCRIPTOR": _OUTPUTDETAIL, + "__module__": "lightning_pb2" + # @@protoc_insertion_point(class_scope:lnrpc.OutputDetail) + }, +) +_sym_db.RegisterMessage(OutputDetail) + Transaction = _reflection.GeneratedProtocolMessageType( "Transaction", (_message.Message,), @@ -21507,6 +579,17 @@ OutPoint = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(OutPoint) +PreviousOutPoint = _reflection.GeneratedProtocolMessageType( + "PreviousOutPoint", + (_message.Message,), + { + "DESCRIPTOR": _PREVIOUSOUTPOINT, + "__module__": "lightning_pb2" + # @@protoc_insertion_point(class_scope:lnrpc.PreviousOutPoint) + }, +) +_sym_db.RegisterMessage(PreviousOutPoint) + LightningAddress = _reflection.GeneratedProtocolMessageType( "LightningAddress", (_message.Message,), @@ -23576,738 +2659,623 @@ InterceptFeedback = _reflection.GeneratedProtocolMessageType( ) _sym_db.RegisterMessage(InterceptFeedback) +_LIGHTNING = DESCRIPTOR.services_by_name["Lightning"] +if _descriptor._USE_C_DESCRIPTORS == False: -DESCRIPTOR._options = None -_SENDREQUEST_DESTCUSTOMRECORDSENTRY._options = None -_SENDREQUEST.fields_by_name["dest_string"]._options = None -_SENDREQUEST.fields_by_name["payment_hash_string"]._options = None -_SENDREQUEST.fields_by_name["outgoing_chan_id"]._options = None -_SENDTOROUTEREQUEST.fields_by_name["payment_hash_string"]._options = None -_ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._options = None -_ESTIMATEFEERESPONSE.fields_by_name["feerate_sat_per_byte"]._options = None -_SENDMANYREQUEST_ADDRTOAMOUNTENTRY._options = None -_SENDMANYREQUEST.fields_by_name["sat_per_byte"]._options = None -_SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._options = None -_CHANNEL.fields_by_name["chan_id"]._options = None -_CHANNEL.fields_by_name["csv_delay"]._options = None -_CHANNEL.fields_by_name["local_chan_reserve_sat"]._options = None -_CHANNEL.fields_by_name["remote_chan_reserve_sat"]._options = None -_CHANNEL.fields_by_name["static_remote_key"]._options = None -_CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._options = None -_PEER_FEATURESENTRY._options = None -_GETINFORESPONSE_FEATURESENTRY._options = None -_GETINFORESPONSE.fields_by_name["testnet"]._options = None -_CLOSECHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None -_OPENCHANNELREQUEST.fields_by_name["node_pubkey_string"]._options = None -_OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None -_PENDINGCHANNELSRESPONSE.fields_by_name["pending_closing_channels"]._options = None -_WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._options = None -_CHANNELBALANCERESPONSE.fields_by_name["balance"]._options = None -_CHANNELBALANCERESPONSE.fields_by_name["pending_open_balance"]._options = None -_QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._options = None -_QUERYROUTESREQUEST.fields_by_name["ignored_edges"]._options = None -_QUERYROUTESREQUEST.fields_by_name["outgoing_chan_id"]._options = None -_EDGELOCATOR.fields_by_name["channel_id"]._options = None -_HOP_CUSTOMRECORDSENTRY._options = None -_HOP.fields_by_name["chan_id"]._options = None -_HOP.fields_by_name["chan_capacity"]._options = None -_HOP.fields_by_name["amt_to_forward"]._options = None -_HOP.fields_by_name["fee"]._options = None -_ROUTE.fields_by_name["total_fees"]._options = None -_ROUTE.fields_by_name["total_amt"]._options = None -_LIGHTNINGNODE_FEATURESENTRY._options = None -_CHANNELEDGE.fields_by_name["channel_id"]._options = None -_CHANNELEDGE.fields_by_name["last_update"]._options = None -_NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._options = None -_CHANINFOREQUEST.fields_by_name["chan_id"]._options = None -_NODEUPDATE_FEATURESENTRY._options = None -_NODEUPDATE.fields_by_name["addresses"]._options = None -_NODEUPDATE.fields_by_name["global_features"]._options = None -_CHANNELEDGEUPDATE.fields_by_name["chan_id"]._options = None -_CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._options = None -_HOPHINT.fields_by_name["chan_id"]._options = None -_INVOICE_FEATURESENTRY._options = None -_INVOICE_AMPINVOICESTATEENTRY._options = None -_INVOICE.fields_by_name["settled"]._options = None -_INVOICE.fields_by_name["amt_paid"]._options = None -_INVOICEHTLC_CUSTOMRECORDSENTRY._options = None -_INVOICEHTLC.fields_by_name["chan_id"]._options = None -_PAYMENTHASH.fields_by_name["r_hash_str"]._options = None -_PAYMENT.fields_by_name["value"]._options = None -_PAYMENT.fields_by_name["creation_date"]._options = None -_PAYMENT.fields_by_name["fee"]._options = None -_PAYREQ_FEATURESENTRY._options = None -_CHANNELFEEREPORT.fields_by_name["chan_id"]._options = None -_FORWARDINGEVENT.fields_by_name["timestamp"]._options = None -_FORWARDINGEVENT.fields_by_name["chan_id_in"]._options = None -_FORWARDINGEVENT.fields_by_name["chan_id_out"]._options = None -_LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._options = None -_CHANNELUPDATE.fields_by_name["chan_id"]._options = None - -_LIGHTNING = _descriptor.ServiceDescriptor( - name="Lightning", - full_name="lnrpc.Lightning", - file=DESCRIPTOR, - index=0, - serialized_options=None, - create_key=_descriptor._internal_create_key, - serialized_start=28310, - serialized_end=33119, - methods=[ - _descriptor.MethodDescriptor( - name="WalletBalance", - full_name="lnrpc.Lightning.WalletBalance", - index=0, - containing_service=None, - input_type=_WALLETBALANCEREQUEST, - output_type=_WALLETBALANCERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ChannelBalance", - full_name="lnrpc.Lightning.ChannelBalance", - index=1, - containing_service=None, - input_type=_CHANNELBALANCEREQUEST, - output_type=_CHANNELBALANCERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetTransactions", - full_name="lnrpc.Lightning.GetTransactions", - index=2, - containing_service=None, - input_type=_GETTRANSACTIONSREQUEST, - output_type=_TRANSACTIONDETAILS, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="EstimateFee", - full_name="lnrpc.Lightning.EstimateFee", - index=3, - containing_service=None, - input_type=_ESTIMATEFEEREQUEST, - output_type=_ESTIMATEFEERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendCoins", - full_name="lnrpc.Lightning.SendCoins", - index=4, - containing_service=None, - input_type=_SENDCOINSREQUEST, - output_type=_SENDCOINSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListUnspent", - full_name="lnrpc.Lightning.ListUnspent", - index=5, - containing_service=None, - input_type=_LISTUNSPENTREQUEST, - output_type=_LISTUNSPENTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeTransactions", - full_name="lnrpc.Lightning.SubscribeTransactions", - index=6, - containing_service=None, - input_type=_GETTRANSACTIONSREQUEST, - output_type=_TRANSACTION, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendMany", - full_name="lnrpc.Lightning.SendMany", - index=7, - containing_service=None, - input_type=_SENDMANYREQUEST, - output_type=_SENDMANYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="NewAddress", - full_name="lnrpc.Lightning.NewAddress", - index=8, - containing_service=None, - input_type=_NEWADDRESSREQUEST, - output_type=_NEWADDRESSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SignMessage", - full_name="lnrpc.Lightning.SignMessage", - index=9, - containing_service=None, - input_type=_SIGNMESSAGEREQUEST, - output_type=_SIGNMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="VerifyMessage", - full_name="lnrpc.Lightning.VerifyMessage", - index=10, - containing_service=None, - input_type=_VERIFYMESSAGEREQUEST, - output_type=_VERIFYMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ConnectPeer", - full_name="lnrpc.Lightning.ConnectPeer", - index=11, - containing_service=None, - input_type=_CONNECTPEERREQUEST, - output_type=_CONNECTPEERRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DisconnectPeer", - full_name="lnrpc.Lightning.DisconnectPeer", - index=12, - containing_service=None, - input_type=_DISCONNECTPEERREQUEST, - output_type=_DISCONNECTPEERRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPeers", - full_name="lnrpc.Lightning.ListPeers", - index=13, - containing_service=None, - input_type=_LISTPEERSREQUEST, - output_type=_LISTPEERSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribePeerEvents", - full_name="lnrpc.Lightning.SubscribePeerEvents", - index=14, - containing_service=None, - input_type=_PEEREVENTSUBSCRIPTION, - output_type=_PEEREVENT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetInfo", - full_name="lnrpc.Lightning.GetInfo", - index=15, - containing_service=None, - input_type=_GETINFOREQUEST, - output_type=_GETINFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetRecoveryInfo", - full_name="lnrpc.Lightning.GetRecoveryInfo", - index=16, - containing_service=None, - input_type=_GETRECOVERYINFOREQUEST, - output_type=_GETRECOVERYINFORESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="PendingChannels", - full_name="lnrpc.Lightning.PendingChannels", - index=17, - containing_service=None, - input_type=_PENDINGCHANNELSREQUEST, - output_type=_PENDINGCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListChannels", - full_name="lnrpc.Lightning.ListChannels", - index=18, - containing_service=None, - input_type=_LISTCHANNELSREQUEST, - output_type=_LISTCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelEvents", - full_name="lnrpc.Lightning.SubscribeChannelEvents", - index=19, - containing_service=None, - input_type=_CHANNELEVENTSUBSCRIPTION, - output_type=_CHANNELEVENTUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ClosedChannels", - full_name="lnrpc.Lightning.ClosedChannels", - index=20, - containing_service=None, - input_type=_CLOSEDCHANNELSREQUEST, - output_type=_CLOSEDCHANNELSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="OpenChannelSync", - full_name="lnrpc.Lightning.OpenChannelSync", - index=21, - containing_service=None, - input_type=_OPENCHANNELREQUEST, - output_type=_CHANNELPOINT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="OpenChannel", - full_name="lnrpc.Lightning.OpenChannel", - index=22, - containing_service=None, - input_type=_OPENCHANNELREQUEST, - output_type=_OPENSTATUSUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="BatchOpenChannel", - full_name="lnrpc.Lightning.BatchOpenChannel", - index=23, - containing_service=None, - input_type=_BATCHOPENCHANNELREQUEST, - output_type=_BATCHOPENCHANNELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="FundingStateStep", - full_name="lnrpc.Lightning.FundingStateStep", - index=24, - containing_service=None, - input_type=_FUNDINGTRANSITIONMSG, - output_type=_FUNDINGSTATESTEPRESP, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ChannelAcceptor", - full_name="lnrpc.Lightning.ChannelAcceptor", - index=25, - containing_service=None, - input_type=_CHANNELACCEPTRESPONSE, - output_type=_CHANNELACCEPTREQUEST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="CloseChannel", - full_name="lnrpc.Lightning.CloseChannel", - index=26, - containing_service=None, - input_type=_CLOSECHANNELREQUEST, - output_type=_CLOSESTATUSUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="AbandonChannel", - full_name="lnrpc.Lightning.AbandonChannel", - index=27, - containing_service=None, - input_type=_ABANDONCHANNELREQUEST, - output_type=_ABANDONCHANNELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendPayment", - full_name="lnrpc.Lightning.SendPayment", - index=28, - containing_service=None, - input_type=_SENDREQUEST, - output_type=_SENDRESPONSE, - serialized_options=b"\210\002\001", - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendPaymentSync", - full_name="lnrpc.Lightning.SendPaymentSync", - index=29, - containing_service=None, - input_type=_SENDREQUEST, - output_type=_SENDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendToRoute", - full_name="lnrpc.Lightning.SendToRoute", - index=30, - containing_service=None, - input_type=_SENDTOROUTEREQUEST, - output_type=_SENDRESPONSE, - serialized_options=b"\210\002\001", - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendToRouteSync", - full_name="lnrpc.Lightning.SendToRouteSync", - index=31, - containing_service=None, - input_type=_SENDTOROUTEREQUEST, - output_type=_SENDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="AddInvoice", - full_name="lnrpc.Lightning.AddInvoice", - index=32, - containing_service=None, - input_type=_INVOICE, - output_type=_ADDINVOICERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListInvoices", - full_name="lnrpc.Lightning.ListInvoices", - index=33, - containing_service=None, - input_type=_LISTINVOICEREQUEST, - output_type=_LISTINVOICERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="LookupInvoice", - full_name="lnrpc.Lightning.LookupInvoice", - index=34, - containing_service=None, - input_type=_PAYMENTHASH, - output_type=_INVOICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeInvoices", - full_name="lnrpc.Lightning.SubscribeInvoices", - index=35, - containing_service=None, - input_type=_INVOICESUBSCRIPTION, - output_type=_INVOICE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DecodePayReq", - full_name="lnrpc.Lightning.DecodePayReq", - index=36, - containing_service=None, - input_type=_PAYREQSTRING, - output_type=_PAYREQ, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPayments", - full_name="lnrpc.Lightning.ListPayments", - index=37, - containing_service=None, - input_type=_LISTPAYMENTSREQUEST, - output_type=_LISTPAYMENTSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeletePayment", - full_name="lnrpc.Lightning.DeletePayment", - index=38, - containing_service=None, - input_type=_DELETEPAYMENTREQUEST, - output_type=_DELETEPAYMENTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeleteAllPayments", - full_name="lnrpc.Lightning.DeleteAllPayments", - index=39, - containing_service=None, - input_type=_DELETEALLPAYMENTSREQUEST, - output_type=_DELETEALLPAYMENTSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DescribeGraph", - full_name="lnrpc.Lightning.DescribeGraph", - index=40, - containing_service=None, - input_type=_CHANNELGRAPHREQUEST, - output_type=_CHANNELGRAPH, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNodeMetrics", - full_name="lnrpc.Lightning.GetNodeMetrics", - index=41, - containing_service=None, - input_type=_NODEMETRICSREQUEST, - output_type=_NODEMETRICSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetChanInfo", - full_name="lnrpc.Lightning.GetChanInfo", - index=42, - containing_service=None, - input_type=_CHANINFOREQUEST, - output_type=_CHANNELEDGE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNodeInfo", - full_name="lnrpc.Lightning.GetNodeInfo", - index=43, - containing_service=None, - input_type=_NODEINFOREQUEST, - output_type=_NODEINFO, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="QueryRoutes", - full_name="lnrpc.Lightning.QueryRoutes", - index=44, - containing_service=None, - input_type=_QUERYROUTESREQUEST, - output_type=_QUERYROUTESRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="GetNetworkInfo", - full_name="lnrpc.Lightning.GetNetworkInfo", - index=45, - containing_service=None, - input_type=_NETWORKINFOREQUEST, - output_type=_NETWORKINFO, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="StopDaemon", - full_name="lnrpc.Lightning.StopDaemon", - index=46, - containing_service=None, - input_type=_STOPREQUEST, - output_type=_STOPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelGraph", - full_name="lnrpc.Lightning.SubscribeChannelGraph", - index=47, - containing_service=None, - input_type=_GRAPHTOPOLOGYSUBSCRIPTION, - output_type=_GRAPHTOPOLOGYUPDATE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DebugLevel", - full_name="lnrpc.Lightning.DebugLevel", - index=48, - containing_service=None, - input_type=_DEBUGLEVELREQUEST, - output_type=_DEBUGLEVELRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="FeeReport", - full_name="lnrpc.Lightning.FeeReport", - index=49, - containing_service=None, - input_type=_FEEREPORTREQUEST, - output_type=_FEEREPORTRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="UpdateChannelPolicy", - full_name="lnrpc.Lightning.UpdateChannelPolicy", - index=50, - containing_service=None, - input_type=_POLICYUPDATEREQUEST, - output_type=_POLICYUPDATERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ForwardingHistory", - full_name="lnrpc.Lightning.ForwardingHistory", - index=51, - containing_service=None, - input_type=_FORWARDINGHISTORYREQUEST, - output_type=_FORWARDINGHISTORYRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ExportChannelBackup", - full_name="lnrpc.Lightning.ExportChannelBackup", - index=52, - containing_service=None, - input_type=_EXPORTCHANNELBACKUPREQUEST, - output_type=_CHANNELBACKUP, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ExportAllChannelBackups", - full_name="lnrpc.Lightning.ExportAllChannelBackups", - index=53, - containing_service=None, - input_type=_CHANBACKUPEXPORTREQUEST, - output_type=_CHANBACKUPSNAPSHOT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="VerifyChanBackup", - full_name="lnrpc.Lightning.VerifyChanBackup", - index=54, - containing_service=None, - input_type=_CHANBACKUPSNAPSHOT, - output_type=_VERIFYCHANBACKUPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="RestoreChannelBackups", - full_name="lnrpc.Lightning.RestoreChannelBackups", - index=55, - containing_service=None, - input_type=_RESTORECHANBACKUPREQUEST, - output_type=_RESTOREBACKUPRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeChannelBackups", - full_name="lnrpc.Lightning.SubscribeChannelBackups", - index=56, - containing_service=None, - input_type=_CHANNELBACKUPSUBSCRIPTION, - output_type=_CHANBACKUPSNAPSHOT, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="BakeMacaroon", - full_name="lnrpc.Lightning.BakeMacaroon", - index=57, - containing_service=None, - input_type=_BAKEMACAROONREQUEST, - output_type=_BAKEMACAROONRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListMacaroonIDs", - full_name="lnrpc.Lightning.ListMacaroonIDs", - index=58, - containing_service=None, - input_type=_LISTMACAROONIDSREQUEST, - output_type=_LISTMACAROONIDSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="DeleteMacaroonID", - full_name="lnrpc.Lightning.DeleteMacaroonID", - index=59, - containing_service=None, - input_type=_DELETEMACAROONIDREQUEST, - output_type=_DELETEMACAROONIDRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="ListPermissions", - full_name="lnrpc.Lightning.ListPermissions", - index=60, - containing_service=None, - input_type=_LISTPERMISSIONSREQUEST, - output_type=_LISTPERMISSIONSRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="CheckMacaroonPermissions", - full_name="lnrpc.Lightning.CheckMacaroonPermissions", - index=61, - containing_service=None, - input_type=_CHECKMACPERMREQUEST, - output_type=_CHECKMACPERMRESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="RegisterRPCMiddleware", - full_name="lnrpc.Lightning.RegisterRPCMiddleware", - index=62, - containing_service=None, - input_type=_RPCMIDDLEWARERESPONSE, - output_type=_RPCMIDDLEWAREREQUEST, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SendCustomMessage", - full_name="lnrpc.Lightning.SendCustomMessage", - index=63, - containing_service=None, - input_type=_SENDCUSTOMMESSAGEREQUEST, - output_type=_SENDCUSTOMMESSAGERESPONSE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - _descriptor.MethodDescriptor( - name="SubscribeCustomMessages", - full_name="lnrpc.Lightning.SubscribeCustomMessages", - index=64, - containing_service=None, - input_type=_SUBSCRIBECUSTOMMESSAGESREQUEST, - output_type=_CUSTOMMESSAGE, - serialized_options=None, - create_key=_descriptor._internal_create_key, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_LIGHTNING) - -DESCRIPTOR.services_by_name["Lightning"] = _LIGHTNING - + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b"Z%github.com/lightningnetwork/lnd/lnrpc" + _TRANSACTION.fields_by_name["dest_addresses"]._options = None + _TRANSACTION.fields_by_name["dest_addresses"]._serialized_options = b"\030\001" + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _SENDREQUEST.fields_by_name["dest_string"]._options = None + _SENDREQUEST.fields_by_name["dest_string"]._serialized_options = b"\030\001" + _SENDREQUEST.fields_by_name["payment_hash_string"]._options = None + _SENDREQUEST.fields_by_name["payment_hash_string"]._serialized_options = b"\030\001" + _SENDREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _SENDREQUEST.fields_by_name["outgoing_chan_id"]._serialized_options = b"0\001" + _SENDTOROUTEREQUEST.fields_by_name["payment_hash_string"]._options = None + _SENDTOROUTEREQUEST.fields_by_name[ + "payment_hash_string" + ]._serialized_options = b"\030\001" + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._options = None + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_options = b"8\001" + _ESTIMATEFEERESPONSE.fields_by_name["feerate_sat_per_byte"]._options = None + _ESTIMATEFEERESPONSE.fields_by_name[ + "feerate_sat_per_byte" + ]._serialized_options = b"\030\001" + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._options = None + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_options = b"8\001" + _SENDMANYREQUEST.fields_by_name["sat_per_byte"]._options = None + _SENDMANYREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._options = None + _SENDCOINSREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["chan_id"]._options = None + _CHANNEL.fields_by_name["chan_id"]._serialized_options = b"0\001" + _CHANNEL.fields_by_name["csv_delay"]._options = None + _CHANNEL.fields_by_name["csv_delay"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["local_chan_reserve_sat"]._options = None + _CHANNEL.fields_by_name["local_chan_reserve_sat"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["remote_chan_reserve_sat"]._options = None + _CHANNEL.fields_by_name["remote_chan_reserve_sat"]._serialized_options = b"\030\001" + _CHANNEL.fields_by_name["static_remote_key"]._options = None + _CHANNEL.fields_by_name["static_remote_key"]._serialized_options = b"\030\001" + _CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._options = None + _CHANNELCLOSESUMMARY.fields_by_name["chan_id"]._serialized_options = b"0\001" + _PEER_FEATURESENTRY._options = None + _PEER_FEATURESENTRY._serialized_options = b"8\001" + _GETINFORESPONSE_FEATURESENTRY._options = None + _GETINFORESPONSE_FEATURESENTRY._serialized_options = b"8\001" + _GETINFORESPONSE.fields_by_name["testnet"]._options = None + _GETINFORESPONSE.fields_by_name["testnet"]._serialized_options = b"\030\001" + _CLOSECHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None + _CLOSECHANNELREQUEST.fields_by_name[ + "sat_per_byte" + ]._serialized_options = b"\030\001" + _OPENCHANNELREQUEST.fields_by_name["node_pubkey_string"]._options = None + _OPENCHANNELREQUEST.fields_by_name[ + "node_pubkey_string" + ]._serialized_options = b"\030\001" + _OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._options = None + _OPENCHANNELREQUEST.fields_by_name["sat_per_byte"]._serialized_options = b"\030\001" + _PENDINGCHANNELSRESPONSE.fields_by_name["pending_closing_channels"]._options = None + _PENDINGCHANNELSRESPONSE.fields_by_name[ + "pending_closing_channels" + ]._serialized_options = b"\030\001" + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._options = None + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_options = b"8\001" + _CHANNELBALANCERESPONSE.fields_by_name["balance"]._options = None + _CHANNELBALANCERESPONSE.fields_by_name["balance"]._serialized_options = b"\030\001" + _CHANNELBALANCERESPONSE.fields_by_name["pending_open_balance"]._options = None + _CHANNELBALANCERESPONSE.fields_by_name[ + "pending_open_balance" + ]._serialized_options = b"\030\001" + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _QUERYROUTESREQUEST.fields_by_name["ignored_edges"]._options = None + _QUERYROUTESREQUEST.fields_by_name[ + "ignored_edges" + ]._serialized_options = b"\030\001" + _QUERYROUTESREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _QUERYROUTESREQUEST.fields_by_name[ + "outgoing_chan_id" + ]._serialized_options = b"0\001" + _EDGELOCATOR.fields_by_name["channel_id"]._options = None + _EDGELOCATOR.fields_by_name["channel_id"]._serialized_options = b"0\001" + _HOP_CUSTOMRECORDSENTRY._options = None + _HOP_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _HOP.fields_by_name["chan_id"]._options = None + _HOP.fields_by_name["chan_id"]._serialized_options = b"0\001" + _HOP.fields_by_name["chan_capacity"]._options = None + _HOP.fields_by_name["chan_capacity"]._serialized_options = b"\030\001" + _HOP.fields_by_name["amt_to_forward"]._options = None + _HOP.fields_by_name["amt_to_forward"]._serialized_options = b"\030\001" + _HOP.fields_by_name["fee"]._options = None + _HOP.fields_by_name["fee"]._serialized_options = b"\030\001" + _HOP.fields_by_name["tlv_payload"]._options = None + _HOP.fields_by_name["tlv_payload"]._serialized_options = b"\030\001" + _ROUTE.fields_by_name["total_fees"]._options = None + _ROUTE.fields_by_name["total_fees"]._serialized_options = b"\030\001" + _ROUTE.fields_by_name["total_amt"]._options = None + _ROUTE.fields_by_name["total_amt"]._serialized_options = b"\030\001" + _LIGHTNINGNODE_FEATURESENTRY._options = None + _LIGHTNINGNODE_FEATURESENTRY._serialized_options = b"8\001" + _CHANNELEDGE.fields_by_name["channel_id"]._options = None + _CHANNELEDGE.fields_by_name["channel_id"]._serialized_options = b"0\001" + _CHANNELEDGE.fields_by_name["last_update"]._options = None + _CHANNELEDGE.fields_by_name["last_update"]._serialized_options = b"\030\001" + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._options = None + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_options = b"8\001" + _CHANINFOREQUEST.fields_by_name["chan_id"]._options = None + _CHANINFOREQUEST.fields_by_name["chan_id"]._serialized_options = b"0\001" + _NODEUPDATE_FEATURESENTRY._options = None + _NODEUPDATE_FEATURESENTRY._serialized_options = b"8\001" + _NODEUPDATE.fields_by_name["addresses"]._options = None + _NODEUPDATE.fields_by_name["addresses"]._serialized_options = b"\030\001" + _NODEUPDATE.fields_by_name["global_features"]._options = None + _NODEUPDATE.fields_by_name["global_features"]._serialized_options = b"\030\001" + _CHANNELEDGEUPDATE.fields_by_name["chan_id"]._options = None + _CHANNELEDGEUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._options = None + _CLOSEDCHANNELUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _HOPHINT.fields_by_name["chan_id"]._options = None + _HOPHINT.fields_by_name["chan_id"]._serialized_options = b"0\001" + _INVOICE_FEATURESENTRY._options = None + _INVOICE_FEATURESENTRY._serialized_options = b"8\001" + _INVOICE_AMPINVOICESTATEENTRY._options = None + _INVOICE_AMPINVOICESTATEENTRY._serialized_options = b"8\001" + _INVOICE.fields_by_name["settled"]._options = None + _INVOICE.fields_by_name["settled"]._serialized_options = b"\030\001" + _INVOICE.fields_by_name["amt_paid"]._options = None + _INVOICE.fields_by_name["amt_paid"]._serialized_options = b"\030\001" + _INVOICEHTLC_CUSTOMRECORDSENTRY._options = None + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _INVOICEHTLC.fields_by_name["chan_id"]._options = None + _INVOICEHTLC.fields_by_name["chan_id"]._serialized_options = b"0\001" + _PAYMENTHASH.fields_by_name["r_hash_str"]._options = None + _PAYMENTHASH.fields_by_name["r_hash_str"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["value"]._options = None + _PAYMENT.fields_by_name["value"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["creation_date"]._options = None + _PAYMENT.fields_by_name["creation_date"]._serialized_options = b"\030\001" + _PAYMENT.fields_by_name["fee"]._options = None + _PAYMENT.fields_by_name["fee"]._serialized_options = b"\030\001" + _PAYREQ_FEATURESENTRY._options = None + _PAYREQ_FEATURESENTRY._serialized_options = b"8\001" + _CHANNELFEEREPORT.fields_by_name["chan_id"]._options = None + _CHANNELFEEREPORT.fields_by_name["chan_id"]._serialized_options = b"0\001" + _FORWARDINGEVENT.fields_by_name["timestamp"]._options = None + _FORWARDINGEVENT.fields_by_name["timestamp"]._serialized_options = b"\030\001" + _FORWARDINGEVENT.fields_by_name["chan_id_in"]._options = None + _FORWARDINGEVENT.fields_by_name["chan_id_in"]._serialized_options = b"0\001" + _FORWARDINGEVENT.fields_by_name["chan_id_out"]._options = None + _FORWARDINGEVENT.fields_by_name["chan_id_out"]._serialized_options = b"0\001" + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._options = None + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_options = b"8\001" + _CHANNELUPDATE.fields_by_name["chan_id"]._options = None + _CHANNELUPDATE.fields_by_name["chan_id"]._serialized_options = b"0\001" + _LIGHTNING.methods_by_name["SendPayment"]._options = None + _LIGHTNING.methods_by_name["SendPayment"]._serialized_options = b"\210\002\001" + _LIGHTNING.methods_by_name["SendToRoute"]._options = None + _LIGHTNING.methods_by_name["SendToRoute"]._serialized_options = b"\210\002\001" + _OUTPUTSCRIPTTYPE._serialized_start = 27318 + _OUTPUTSCRIPTTYPE._serialized_end = 27613 + _ADDRESSTYPE._serialized_start = 27616 + _ADDRESSTYPE._serialized_end = 27788 + _COMMITMENTTYPE._serialized_start = 27790 + _COMMITMENTTYPE._serialized_end = 27910 + _INITIATOR._serialized_start = 27912 + _INITIATOR._serialized_end = 28009 + _RESOLUTIONTYPE._serialized_start = 28011 + _RESOLUTIONTYPE._serialized_end = 28107 + _RESOLUTIONOUTCOME._serialized_start = 28109 + _RESOLUTIONOUTCOME._serialized_end = 28222 + _NODEMETRICTYPE._serialized_start = 28224 + _NODEMETRICTYPE._serialized_end = 28281 + _INVOICEHTLCSTATE._serialized_start = 28283 + _INVOICEHTLCSTATE._serialized_end = 28342 + _PAYMENTFAILUREREASON._serialized_start = 28345 + _PAYMENTFAILUREREASON._serialized_end = 28562 + _FEATUREBIT._serialized_start = 28565 + _FEATUREBIT._serialized_end = 29156 + _UPDATEFAILURE._serialized_start = 29159 + _UPDATEFAILURE._serialized_end = 29331 + _SUBSCRIBECUSTOMMESSAGESREQUEST._serialized_start = 26 + _SUBSCRIBECUSTOMMESSAGESREQUEST._serialized_end = 58 + _CUSTOMMESSAGE._serialized_start = 60 + _CUSTOMMESSAGE._serialized_end = 117 + _SENDCUSTOMMESSAGEREQUEST._serialized_start = 119 + _SENDCUSTOMMESSAGEREQUEST._serialized_end = 187 + _SENDCUSTOMMESSAGERESPONSE._serialized_start = 189 + _SENDCUSTOMMESSAGERESPONSE._serialized_end = 216 + _UTXO._serialized_start = 219 + _UTXO._serialized_end = 381 + _OUTPUTDETAIL._serialized_start = 384 + _OUTPUTDETAIL._serialized_end = 542 + _TRANSACTION._serialized_start = 545 + _TRANSACTION._serialized_end = 861 + _GETTRANSACTIONSREQUEST._serialized_start = 863 + _GETTRANSACTIONSREQUEST._serialized_end = 946 + _TRANSACTIONDETAILS._serialized_start = 948 + _TRANSACTIONDETAILS._serialized_end = 1010 + _FEELIMIT._serialized_start = 1012 + _FEELIMIT._serialized_end = 1089 + _SENDREQUEST._serialized_start = 1092 + _SENDREQUEST._serialized_end = 1614 + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 1558 + _SENDREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 1614 + _SENDRESPONSE._serialized_start = 1616 + _SENDRESPONSE._serialized_end = 1738 + _SENDTOROUTEREQUEST._serialized_start = 1740 + _SENDTOROUTEREQUEST._serialized_end = 1850 + _CHANNELACCEPTREQUEST._serialized_start = 1853 + _CHANNELACCEPTREQUEST._serialized_end = 2210 + _CHANNELACCEPTRESPONSE._serialized_start = 2213 + _CHANNELACCEPTRESPONSE._serialized_end = 2476 + _CHANNELPOINT._serialized_start = 2478 + _CHANNELPOINT._serialized_end = 2588 + _OUTPOINT._serialized_start = 2590 + _OUTPOINT._serialized_end = 2660 + _PREVIOUSOUTPOINT._serialized_start = 2662 + _PREVIOUSOUTPOINT._serialized_end = 2721 + _LIGHTNINGADDRESS._serialized_start = 2723 + _LIGHTNINGADDRESS._serialized_end = 2771 + _ESTIMATEFEEREQUEST._serialized_start = 2774 + _ESTIMATEFEEREQUEST._serialized_end = 2981 + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_start = 2930 + _ESTIMATEFEEREQUEST_ADDRTOAMOUNTENTRY._serialized_end = 2981 + _ESTIMATEFEERESPONSE._serialized_start = 2983 + _ESTIMATEFEERESPONSE._serialized_end = 3078 + _SENDMANYREQUEST._serialized_start = 3081 + _SENDMANYREQUEST._serialized_end = 3346 + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_start = 2930 + _SENDMANYREQUEST_ADDRTOAMOUNTENTRY._serialized_end = 2981 + _SENDMANYRESPONSE._serialized_start = 3348 + _SENDMANYRESPONSE._serialized_end = 3380 + _SENDCOINSREQUEST._serialized_start = 3383 + _SENDCOINSREQUEST._serialized_end = 3580 + _SENDCOINSRESPONSE._serialized_start = 3582 + _SENDCOINSRESPONSE._serialized_end = 3615 + _LISTUNSPENTREQUEST._serialized_start = 3617 + _LISTUNSPENTREQUEST._serialized_end = 3692 + _LISTUNSPENTRESPONSE._serialized_start = 3694 + _LISTUNSPENTRESPONSE._serialized_end = 3743 + _NEWADDRESSREQUEST._serialized_start = 3745 + _NEWADDRESSREQUEST._serialized_end = 3815 + _NEWADDRESSRESPONSE._serialized_start = 3817 + _NEWADDRESSRESPONSE._serialized_end = 3854 + _SIGNMESSAGEREQUEST._serialized_start = 3856 + _SIGNMESSAGEREQUEST._serialized_end = 3910 + _SIGNMESSAGERESPONSE._serialized_start = 3912 + _SIGNMESSAGERESPONSE._serialized_end = 3952 + _VERIFYMESSAGEREQUEST._serialized_start = 3954 + _VERIFYMESSAGEREQUEST._serialized_end = 4008 + _VERIFYMESSAGERESPONSE._serialized_start = 4010 + _VERIFYMESSAGERESPONSE._serialized_end = 4064 + _CONNECTPEERREQUEST._serialized_start = 4066 + _CONNECTPEERREQUEST._serialized_end = 4156 + _CONNECTPEERRESPONSE._serialized_start = 4158 + _CONNECTPEERRESPONSE._serialized_end = 4179 + _DISCONNECTPEERREQUEST._serialized_start = 4181 + _DISCONNECTPEERREQUEST._serialized_end = 4221 + _DISCONNECTPEERRESPONSE._serialized_start = 4223 + _DISCONNECTPEERRESPONSE._serialized_end = 4247 + _HTLC._serialized_start = 4250 + _HTLC._serialized_end = 4415 + _CHANNELCONSTRAINTS._serialized_start = 4418 + _CHANNELCONSTRAINTS._serialized_end = 4588 + _CHANNEL._serialized_start = 4591 + _CHANNEL._serialized_end = 5407 + _LISTCHANNELSREQUEST._serialized_start = 5409 + _LISTCHANNELSREQUEST._serialized_end = 5531 + _LISTCHANNELSRESPONSE._serialized_start = 5533 + _LISTCHANNELSRESPONSE._serialized_end = 5589 + _CHANNELCLOSESUMMARY._serialized_start = 5592 + _CHANNELCLOSESUMMARY._serialized_end = 6145 + _CHANNELCLOSESUMMARY_CLOSURETYPE._serialized_start = 6007 + _CHANNELCLOSESUMMARY_CLOSURETYPE._serialized_end = 6145 + _RESOLUTION._serialized_start = 6148 + _RESOLUTION._serialized_end = 6326 + _CLOSEDCHANNELSREQUEST._serialized_start = 6329 + _CLOSEDCHANNELSREQUEST._serialized_end = 6477 + _CLOSEDCHANNELSRESPONSE._serialized_start = 6479 + _CLOSEDCHANNELSRESPONSE._serialized_end = 6549 + _PEER._serialized_start = 6552 + _PEER._serialized_end = 7047 + _PEER_FEATURESENTRY._serialized_start = 6902 + _PEER_FEATURESENTRY._serialized_end = 6965 + _PEER_SYNCTYPE._serialized_start = 6967 + _PEER_SYNCTYPE._serialized_end = 7047 + _TIMESTAMPEDERROR._serialized_start = 7049 + _TIMESTAMPEDERROR._serialized_end = 7101 + _LISTPEERSREQUEST._serialized_start = 7103 + _LISTPEERSREQUEST._serialized_end = 7143 + _LISTPEERSRESPONSE._serialized_start = 7145 + _LISTPEERSRESPONSE._serialized_end = 7192 + _PEEREVENTSUBSCRIPTION._serialized_start = 7194 + _PEEREVENTSUBSCRIPTION._serialized_end = 7217 + _PEEREVENT._serialized_start = 7219 + _PEEREVENT._serialized_end = 7337 + _PEEREVENT_EVENTTYPE._serialized_start = 7291 + _PEEREVENT_EVENTTYPE._serialized_end = 7337 + _GETINFOREQUEST._serialized_start = 7339 + _GETINFOREQUEST._serialized_end = 7355 + _GETINFORESPONSE._serialized_start = 7358 + _GETINFORESPONSE._serialized_end = 7926 + _GETINFORESPONSE_FEATURESENTRY._serialized_start = 6902 + _GETINFORESPONSE_FEATURESENTRY._serialized_end = 6965 + _GETRECOVERYINFOREQUEST._serialized_start = 7928 + _GETRECOVERYINFOREQUEST._serialized_end = 7952 + _GETRECOVERYINFORESPONSE._serialized_start = 7954 + _GETRECOVERYINFORESPONSE._serialized_end = 8047 + _CHAIN._serialized_start = 8049 + _CHAIN._serialized_end = 8088 + _CONFIRMATIONUPDATE._serialized_start = 8090 + _CONFIRMATIONUPDATE._serialized_end = 8175 + _CHANNELOPENUPDATE._serialized_start = 8177 + _CHANNELOPENUPDATE._serialized_end = 8240 + _CHANNELCLOSEUPDATE._serialized_start = 8242 + _CHANNELCLOSEUPDATE._serialized_end = 8301 + _CLOSECHANNELREQUEST._serialized_start = 8304 + _CLOSECHANNELREQUEST._serialized_end = 8480 + _CLOSESTATUSUPDATE._serialized_start = 8482 + _CLOSESTATUSUPDATE._serialized_end = 8607 + _PENDINGUPDATE._serialized_start = 8609 + _PENDINGUPDATE._serialized_end = 8660 + _READYFORPSBTFUNDING._serialized_start = 8662 + _READYFORPSBTFUNDING._serialized_end = 8746 + _BATCHOPENCHANNELREQUEST._serialized_start = 8749 + _BATCHOPENCHANNELREQUEST._serialized_end = 8922 + _BATCHOPENCHANNEL._serialized_start = 8925 + _BATCHOPENCHANNEL._serialized_end = 9174 + _BATCHOPENCHANNELRESPONSE._serialized_start = 9176 + _BATCHOPENCHANNELRESPONSE._serialized_end = 9250 + _OPENCHANNELREQUEST._serialized_start = 9253 + _OPENCHANNELREQUEST._serialized_end = 9798 + _OPENSTATUSUPDATE._serialized_start = 9801 + _OPENSTATUSUPDATE._serialized_end = 9996 + _KEYLOCATOR._serialized_start = 9998 + _KEYLOCATOR._serialized_end = 10049 + _KEYDESCRIPTOR._serialized_start = 10051 + _KEYDESCRIPTOR._serialized_end = 10125 + _CHANPOINTSHIM._serialized_start = 10128 + _CHANPOINTSHIM._serialized_end = 10304 + _PSBTSHIM._serialized_start = 10306 + _PSBTSHIM._serialized_end = 10380 + _FUNDINGSHIM._serialized_start = 10382 + _FUNDINGSHIM._serialized_end = 10490 + _FUNDINGSHIMCANCEL._serialized_start = 10492 + _FUNDINGSHIMCANCEL._serialized_end = 10536 + _FUNDINGPSBTVERIFY._serialized_start = 10538 + _FUNDINGPSBTVERIFY._serialized_end = 10626 + _FUNDINGPSBTFINALIZE._serialized_start = 10628 + _FUNDINGPSBTFINALIZE._serialized_end = 10717 + _FUNDINGTRANSITIONMSG._serialized_start = 10720 + _FUNDINGTRANSITIONMSG._serialized_end = 10949 + _FUNDINGSTATESTEPRESP._serialized_start = 10951 + _FUNDINGSTATESTEPRESP._serialized_end = 10973 + _PENDINGHTLC._serialized_start = 10976 + _PENDINGHTLC._serialized_end = 11110 + _PENDINGCHANNELSREQUEST._serialized_start = 11112 + _PENDINGCHANNELSREQUEST._serialized_end = 11136 + _PENDINGCHANNELSRESPONSE._serialized_start = 11139 + _PENDINGCHANNELSRESPONSE._serialized_end = 12922 + _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL._serialized_start = 11537 + _PENDINGCHANNELSRESPONSE_PENDINGCHANNEL._serialized_end = 11893 + _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL._serialized_start = 11896 + _PENDINGCHANNELSRESPONSE_PENDINGOPENCHANNEL._serialized_end = 12049 + _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL._serialized_start = 12052 + _PENDINGCHANNELSRESPONSE_WAITINGCLOSECHANNEL._serialized_end = 12247 + _PENDINGCHANNELSRESPONSE_COMMITMENTS._serialized_start = 12250 + _PENDINGCHANNELSRESPONSE_COMMITMENTS._serialized_end = 12433 + _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL._serialized_start = 12435 + _PENDINGCHANNELSRESPONSE_CLOSEDCHANNEL._serialized_end = 12536 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL._serialized_start = 12539 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL._serialized_end = 12922 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE._serialized_start = 12873 + _PENDINGCHANNELSRESPONSE_FORCECLOSEDCHANNEL_ANCHORSTATE._serialized_end = 12922 + _CHANNELEVENTSUBSCRIPTION._serialized_start = 12924 + _CHANNELEVENTSUBSCRIPTION._serialized_end = 12950 + _CHANNELEVENTUPDATE._serialized_start = 12953 + _CHANNELEVENTUPDATE._serialized_end = 13484 + _CHANNELEVENTUPDATE_UPDATETYPE._serialized_start = 13327 + _CHANNELEVENTUPDATE_UPDATETYPE._serialized_end = 13473 + _WALLETACCOUNTBALANCE._serialized_start = 13486 + _WALLETACCOUNTBALANCE._serialized_end = 13564 + _WALLETBALANCEREQUEST._serialized_start = 13566 + _WALLETBALANCEREQUEST._serialized_end = 13588 + _WALLETBALANCERESPONSE._serialized_start = 13591 + _WALLETBALANCERESPONSE._serialized_end = 13914 + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_start = 13832 + _WALLETBALANCERESPONSE_ACCOUNTBALANCEENTRY._serialized_end = 13914 + _AMOUNT._serialized_start = 13916 + _AMOUNT._serialized_end = 13951 + _CHANNELBALANCEREQUEST._serialized_start = 13953 + _CHANNELBALANCEREQUEST._serialized_end = 13976 + _CHANNELBALANCERESPONSE._serialized_start = 13979 + _CHANNELBALANCERESPONSE._serialized_end = 14335 + _QUERYROUTESREQUEST._serialized_start = 14338 + _QUERYROUTESREQUEST._serialized_end = 14949 + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 1558 + _QUERYROUTESREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 1614 + _NODEPAIR._serialized_start = 14951 + _NODEPAIR._serialized_end = 14987 + _EDGELOCATOR._serialized_start = 14989 + _EDGELOCATOR._serialized_end = 15053 + _QUERYROUTESRESPONSE._serialized_start = 15055 + _QUERYROUTESRESPONSE._serialized_end = 15128 + _HOP._serialized_start = 15131 + _HOP._serialized_end = 15537 + _HOP_CUSTOMRECORDSENTRY._serialized_start = 15485 + _HOP_CUSTOMRECORDSENTRY._serialized_end = 15537 + _MPPRECORD._serialized_start = 15539 + _MPPRECORD._serialized_end = 15596 + _AMPRECORD._serialized_start = 15598 + _AMPRECORD._serialized_end = 15666 + _ROUTE._serialized_start = 15669 + _ROUTE._serialized_end = 15823 + _NODEINFOREQUEST._serialized_start = 15825 + _NODEINFOREQUEST._serialized_end = 15885 + _NODEINFO._serialized_start = 15888 + _NODEINFO._serialized_end = 16018 + _LIGHTNINGNODE._serialized_start = 16021 + _LIGHTNINGNODE._serialized_end = 16262 + _LIGHTNINGNODE_FEATURESENTRY._serialized_start = 6902 + _LIGHTNINGNODE_FEATURESENTRY._serialized_end = 6965 + _NODEADDRESS._serialized_start = 16264 + _NODEADDRESS._serialized_end = 16308 + _ROUTINGPOLICY._serialized_start = 16311 + _ROUTINGPOLICY._serialized_end = 16483 + _CHANNELEDGE._serialized_start = 16486 + _CHANNELEDGE._serialized_end = 16712 + _CHANNELGRAPHREQUEST._serialized_start = 16714 + _CHANNELGRAPHREQUEST._serialized_end = 16764 + _CHANNELGRAPH._serialized_start = 16766 + _CHANNELGRAPH._serialized_end = 16852 + _NODEMETRICSREQUEST._serialized_start = 16854 + _NODEMETRICSREQUEST._serialized_end = 16912 + _NODEMETRICSRESPONSE._serialized_start = 16915 + _NODEMETRICSRESPONSE._serialized_end = 17105 + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_start = 17025 + _NODEMETRICSRESPONSE_BETWEENNESSCENTRALITYENTRY._serialized_end = 17105 + _FLOATMETRIC._serialized_start = 17107 + _FLOATMETRIC._serialized_end = 17161 + _CHANINFOREQUEST._serialized_start = 17163 + _CHANINFOREQUEST._serialized_end = 17201 + _NETWORKINFOREQUEST._serialized_start = 17203 + _NETWORKINFOREQUEST._serialized_end = 17223 + _NETWORKINFO._serialized_start = 17226 + _NETWORKINFO._serialized_end = 17521 + _STOPREQUEST._serialized_start = 17523 + _STOPREQUEST._serialized_end = 17536 + _STOPRESPONSE._serialized_start = 17538 + _STOPRESPONSE._serialized_end = 17552 + _GRAPHTOPOLOGYSUBSCRIPTION._serialized_start = 17554 + _GRAPHTOPOLOGYSUBSCRIPTION._serialized_end = 17581 + _GRAPHTOPOLOGYUPDATE._serialized_start = 17584 + _GRAPHTOPOLOGYUPDATE._serialized_end = 17747 + _NODEUPDATE._serialized_start = 17750 + _NODEUPDATE._serialized_end = 18026 + _NODEUPDATE_FEATURESENTRY._serialized_start = 6902 + _NODEUPDATE_FEATURESENTRY._serialized_end = 6965 + _CHANNELEDGEUPDATE._serialized_start = 18029 + _CHANNELEDGEUPDATE._serialized_end = 18225 + _CLOSEDCHANNELUPDATE._serialized_start = 18227 + _CLOSEDCHANNELUPDATE._serialized_end = 18351 + _HOPHINT._serialized_start = 18354 + _HOPHINT._serialized_end = 18488 + _SETID._serialized_start = 18490 + _SETID._serialized_end = 18513 + _ROUTEHINT._serialized_start = 18515 + _ROUTEHINT._serialized_end = 18561 + _AMPINVOICESTATE._serialized_start = 18563 + _AMPINVOICESTATE._serialized_end = 18686 + _INVOICE._serialized_start = 18689 + _INVOICE._serialized_end = 19590 + _INVOICE_FEATURESENTRY._serialized_start = 6902 + _INVOICE_FEATURESENTRY._serialized_end = 6965 + _INVOICE_AMPINVOICESTATEENTRY._serialized_start = 19439 + _INVOICE_AMPINVOICESTATEENTRY._serialized_end = 19517 + _INVOICE_INVOICESTATE._serialized_start = 19519 + _INVOICE_INVOICESTATE._serialized_end = 19584 + _INVOICEHTLC._serialized_start = 19593 + _INVOICEHTLC._serialized_end = 19964 + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_start = 15485 + _INVOICEHTLC_CUSTOMRECORDSENTRY._serialized_end = 15537 + _AMP._serialized_start = 19966 + _AMP._serialized_end = 20060 + _ADDINVOICERESPONSE._serialized_start = 20062 + _ADDINVOICERESPONSE._serialized_end = 20164 + _PAYMENTHASH._serialized_start = 20166 + _PAYMENTHASH._serialized_end = 20219 + _LISTINVOICEREQUEST._serialized_start = 20221 + _LISTINVOICEREQUEST._serialized_end = 20329 + _LISTINVOICERESPONSE._serialized_start = 20331 + _LISTINVOICERESPONSE._serialized_end = 20441 + _INVOICESUBSCRIPTION._serialized_start = 20443 + _INVOICESUBSCRIPTION._serialized_end = 20505 + _PAYMENT._serialized_start = 20508 + _PAYMENT._serialized_end = 20988 + _PAYMENT_PAYMENTSTATUS._serialized_start = 20912 + _PAYMENT_PAYMENTSTATUS._serialized_end = 20982 + _HTLCATTEMPT._serialized_start = 20991 + _HTLCATTEMPT._serialized_end = 21257 + _HTLCATTEMPT_HTLCSTATUS._serialized_start = 21203 + _HTLCATTEMPT_HTLCSTATUS._serialized_end = 21257 + _LISTPAYMENTSREQUEST._serialized_start = 21260 + _LISTPAYMENTSREQUEST._serialized_end = 21401 + _LISTPAYMENTSRESPONSE._serialized_start = 21404 + _LISTPAYMENTSRESPONSE._serialized_end = 21543 + _DELETEPAYMENTREQUEST._serialized_start = 21545 + _DELETEPAYMENTREQUEST._serialized_end = 21616 + _DELETEALLPAYMENTSREQUEST._serialized_start = 21618 + _DELETEALLPAYMENTSREQUEST._serialized_end = 21701 + _DELETEPAYMENTRESPONSE._serialized_start = 21703 + _DELETEPAYMENTRESPONSE._serialized_end = 21726 + _DELETEALLPAYMENTSRESPONSE._serialized_start = 21728 + _DELETEALLPAYMENTSRESPONSE._serialized_end = 21755 + _ABANDONCHANNELREQUEST._serialized_start = 21758 + _ABANDONCHANNELREQUEST._serialized_end = 21892 + _ABANDONCHANNELRESPONSE._serialized_start = 21894 + _ABANDONCHANNELRESPONSE._serialized_end = 21918 + _DEBUGLEVELREQUEST._serialized_start = 21920 + _DEBUGLEVELREQUEST._serialized_end = 21973 + _DEBUGLEVELRESPONSE._serialized_start = 21975 + _DEBUGLEVELRESPONSE._serialized_end = 22016 + _PAYREQSTRING._serialized_start = 22018 + _PAYREQSTRING._serialized_end = 22049 + _PAYREQ._serialized_start = 22052 + _PAYREQ._serialized_end = 22442 + _PAYREQ_FEATURESENTRY._serialized_start = 6902 + _PAYREQ_FEATURESENTRY._serialized_end = 6965 + _FEATURE._serialized_start = 22444 + _FEATURE._serialized_end = 22506 + _FEEREPORTREQUEST._serialized_start = 22508 + _FEEREPORTREQUEST._serialized_end = 22526 + _CHANNELFEEREPORT._serialized_start = 22528 + _CHANNELFEEREPORT._serialized_end = 22652 + _FEEREPORTRESPONSE._serialized_start = 22655 + _FEEREPORTRESPONSE._serialized_end = 22787 + _POLICYUPDATEREQUEST._serialized_start = 22790 + _POLICYUPDATEREQUEST._serialized_end = 23048 + _FAILEDUPDATE._serialized_start = 23050 + _FAILEDUPDATE._serialized_end = 23159 + _POLICYUPDATERESPONSE._serialized_start = 23161 + _POLICYUPDATERESPONSE._serialized_end = 23228 + _FORWARDINGHISTORYREQUEST._serialized_start = 23230 + _FORWARDINGHISTORYREQUEST._serialized_end = 23340 + _FORWARDINGEVENT._serialized_start = 23343 + _FORWARDINGEVENT._serialized_end = 23561 + _FORWARDINGHISTORYRESPONSE._serialized_start = 23563 + _FORWARDINGHISTORYRESPONSE._serialized_end = 23668 + _EXPORTCHANNELBACKUPREQUEST._serialized_start = 23670 + _EXPORTCHANNELBACKUPREQUEST._serialized_end = 23739 + _CHANNELBACKUP._serialized_start = 23741 + _CHANNELBACKUP._serialized_end = 23818 + _MULTICHANBACKUP._serialized_start = 23820 + _MULTICHANBACKUP._serialized_end = 23906 + _CHANBACKUPEXPORTREQUEST._serialized_start = 23908 + _CHANBACKUPEXPORTREQUEST._serialized_end = 23933 + _CHANBACKUPSNAPSHOT._serialized_start = 23935 + _CHANBACKUPSNAPSHOT._serialized_end = 24058 + _CHANNELBACKUPS._serialized_start = 24060 + _CHANNELBACKUPS._serialized_end = 24120 + _RESTORECHANBACKUPREQUEST._serialized_start = 24122 + _RESTORECHANBACKUPREQUEST._serialized_end = 24234 + _RESTOREBACKUPRESPONSE._serialized_start = 24236 + _RESTOREBACKUPRESPONSE._serialized_end = 24259 + _CHANNELBACKUPSUBSCRIPTION._serialized_start = 24261 + _CHANNELBACKUPSUBSCRIPTION._serialized_end = 24288 + _VERIFYCHANBACKUPRESPONSE._serialized_start = 24290 + _VERIFYCHANBACKUPRESPONSE._serialized_end = 24316 + _MACAROONPERMISSION._serialized_start = 24318 + _MACAROONPERMISSION._serialized_end = 24370 + _BAKEMACAROONREQUEST._serialized_start = 24372 + _BAKEMACAROONREQUEST._serialized_end = 24498 + _BAKEMACAROONRESPONSE._serialized_start = 24500 + _BAKEMACAROONRESPONSE._serialized_end = 24540 + _LISTMACAROONIDSREQUEST._serialized_start = 24542 + _LISTMACAROONIDSREQUEST._serialized_end = 24566 + _LISTMACAROONIDSRESPONSE._serialized_start = 24568 + _LISTMACAROONIDSRESPONSE._serialized_end = 24615 + _DELETEMACAROONIDREQUEST._serialized_start = 24617 + _DELETEMACAROONIDREQUEST._serialized_end = 24663 + _DELETEMACAROONIDRESPONSE._serialized_start = 24665 + _DELETEMACAROONIDRESPONSE._serialized_end = 24708 + _MACAROONPERMISSIONLIST._serialized_start = 24710 + _MACAROONPERMISSIONLIST._serialized_end = 24782 + _LISTPERMISSIONSREQUEST._serialized_start = 24784 + _LISTPERMISSIONSREQUEST._serialized_end = 24808 + _LISTPERMISSIONSRESPONSE._serialized_start = 24811 + _LISTPERMISSIONSRESPONSE._serialized_end = 25008 + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_start = 24921 + _LISTPERMISSIONSRESPONSE_METHODPERMISSIONSENTRY._serialized_end = 25008 + _FAILURE._serialized_start = 25011 + _FAILURE._serialized_end = 25992 + _FAILURE_FAILURECODE._serialized_start = 25235 + _FAILURE_FAILURECODE._serialized_end = 25986 + _CHANNELUPDATE._serialized_start = 25995 + _CHANNELUPDATE._serialized_end = 26277 + _MACAROONID._serialized_start = 26279 + _MACAROONID._serialized_end = 26349 + _OP._serialized_start = 26351 + _OP._serialized_end = 26388 + _CHECKMACPERMREQUEST._serialized_start = 26390 + _CHECKMACPERMREQUEST._serialized_end = 26497 + _CHECKMACPERMRESPONSE._serialized_start = 26499 + _CHECKMACPERMRESPONSE._serialized_end = 26536 + _RPCMIDDLEWAREREQUEST._serialized_start = 26539 + _RPCMIDDLEWAREREQUEST._serialized_end = 26789 + _STREAMAUTH._serialized_start = 26791 + _STREAMAUTH._serialized_end = 26828 + _RPCMESSAGE._serialized_start = 26830 + _RPCMESSAGE._serialized_end = 26944 + _RPCMIDDLEWARERESPONSE._serialized_start = 26947 + _RPCMIDDLEWARERESPONSE._serialized_end = 27109 + _MIDDLEWAREREGISTRATION._serialized_start = 27111 + _MIDDLEWAREREGISTRATION._serialized_end = 27221 + _INTERCEPTFEEDBACK._serialized_start = 27223 + _INTERCEPTFEEDBACK._serialized_end = 27315 + _LIGHTNING._serialized_start = 29334 + _LIGHTNING._serialized_end = 34143 # @@protoc_insertion_point(module_scope) diff --git a/lnbits/wallets/lnd_grpc_files/router_pb2.py b/lnbits/wallets/lnd_grpc_files/router_pb2.py new file mode 100644 index 000000000..4237556bc --- /dev/null +++ b/lnbits/wallets/lnd_grpc_files/router_pb2.py @@ -0,0 +1,665 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: router.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import message as _message +from google.protobuf import reflection as _reflection +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import enum_type_wrapper + +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import lnbits.wallets.lnd_grpc_files.lightning_pb2 as lightning__pb2 + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile( + b'\n\x0crouter.proto\x12\trouterrpc\x1a\x0flightning.proto"\xb7\x05\n\x12SendPaymentRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x0b\n\x03\x61mt\x18\x02 \x01(\x03\x12\x10\n\x08\x61mt_msat\x18\x0c \x01(\x03\x12\x14\n\x0cpayment_hash\x18\x03 \x01(\x0c\x12\x18\n\x10\x66inal_cltv_delta\x18\x04 \x01(\x05\x12\x14\n\x0cpayment_addr\x18\x14 \x01(\x0c\x12\x17\n\x0fpayment_request\x18\x05 \x01(\t\x12\x17\n\x0ftimeout_seconds\x18\x06 \x01(\x05\x12\x15\n\rfee_limit_sat\x18\x07 \x01(\x03\x12\x16\n\x0e\x66\x65\x65_limit_msat\x18\r \x01(\x03\x12\x1e\n\x10outgoing_chan_id\x18\x08 \x01(\x04\x42\x04\x18\x01\x30\x01\x12\x19\n\x11outgoing_chan_ids\x18\x13 \x03(\x04\x12\x17\n\x0flast_hop_pubkey\x18\x0e \x01(\x0c\x12\x12\n\ncltv_limit\x18\t \x01(\x05\x12%\n\x0broute_hints\x18\n \x03(\x0b\x32\x10.lnrpc.RouteHint\x12Q\n\x13\x64\x65st_custom_records\x18\x0b \x03(\x0b\x32\x34.routerrpc.SendPaymentRequest.DestCustomRecordsEntry\x12\x1a\n\x12\x61llow_self_payment\x18\x0f \x01(\x08\x12(\n\rdest_features\x18\x10 \x03(\x0e\x32\x11.lnrpc.FeatureBit\x12\x11\n\tmax_parts\x18\x11 \x01(\r\x12\x1b\n\x13no_inflight_updates\x18\x12 \x01(\x08\x12\x1b\n\x13max_shard_size_msat\x18\x15 \x01(\x04\x12\x0b\n\x03\x61mp\x18\x16 \x01(\x08\x12\x11\n\ttime_pref\x18\x17 \x01(\x01\x1a\x38\n\x16\x44\x65stCustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"H\n\x13TrackPaymentRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1b\n\x13no_inflight_updates\x18\x02 \x01(\x08"0\n\x0fRouteFeeRequest\x12\x0c\n\x04\x64\x65st\x18\x01 \x01(\x0c\x12\x0f\n\x07\x61mt_sat\x18\x02 \x01(\x03"E\n\x10RouteFeeResponse\x12\x18\n\x10routing_fee_msat\x18\x01 \x01(\x03\x12\x17\n\x0ftime_lock_delay\x18\x02 \x01(\x03"^\n\x12SendToRouteRequest\x12\x14\n\x0cpayment_hash\x18\x01 \x01(\x0c\x12\x1b\n\x05route\x18\x02 \x01(\x0b\x32\x0c.lnrpc.Route\x12\x15\n\rskip_temp_err\x18\x03 \x01(\x08"H\n\x13SendToRouteResponse\x12\x10\n\x08preimage\x18\x01 \x01(\x0c\x12\x1f\n\x07\x66\x61ilure\x18\x02 \x01(\x0b\x32\x0e.lnrpc.Failure"\x1c\n\x1aResetMissionControlRequest"\x1d\n\x1bResetMissionControlResponse"\x1c\n\x1aQueryMissionControlRequest"J\n\x1bQueryMissionControlResponse\x12%\n\x05pairs\x18\x02 \x03(\x0b\x32\x16.routerrpc.PairHistoryJ\x04\x08\x01\x10\x02"T\n\x1cXImportMissionControlRequest\x12%\n\x05pairs\x18\x01 \x03(\x0b\x32\x16.routerrpc.PairHistory\x12\r\n\x05\x66orce\x18\x02 \x01(\x08"\x1f\n\x1dXImportMissionControlResponse"o\n\x0bPairHistory\x12\x11\n\tnode_from\x18\x01 \x01(\x0c\x12\x0f\n\x07node_to\x18\x02 \x01(\x0c\x12$\n\x07history\x18\x07 \x01(\x0b\x32\x13.routerrpc.PairDataJ\x04\x08\x03\x10\x04J\x04\x08\x04\x10\x05J\x04\x08\x05\x10\x06J\x04\x08\x06\x10\x07"\x99\x01\n\x08PairData\x12\x11\n\tfail_time\x18\x01 \x01(\x03\x12\x14\n\x0c\x66\x61il_amt_sat\x18\x02 \x01(\x03\x12\x15\n\rfail_amt_msat\x18\x04 \x01(\x03\x12\x14\n\x0csuccess_time\x18\x05 \x01(\x03\x12\x17\n\x0fsuccess_amt_sat\x18\x06 \x01(\x03\x12\x18\n\x10success_amt_msat\x18\x07 \x01(\x03J\x04\x08\x03\x10\x04" \n\x1eGetMissionControlConfigRequest"R\n\x1fGetMissionControlConfigResponse\x12/\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1f.routerrpc.MissionControlConfig"Q\n\x1eSetMissionControlConfigRequest\x12/\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x1f.routerrpc.MissionControlConfig"!\n\x1fSetMissionControlConfigResponse"\xa3\x01\n\x14MissionControlConfig\x12\x19\n\x11half_life_seconds\x18\x01 \x01(\x04\x12\x17\n\x0fhop_probability\x18\x02 \x01(\x02\x12\x0e\n\x06weight\x18\x03 \x01(\x02\x12\x1f\n\x17maximum_payment_results\x18\x04 \x01(\r\x12&\n\x1eminimum_failure_relax_interval\x18\x05 \x01(\x04"O\n\x17QueryProbabilityRequest\x12\x11\n\tfrom_node\x18\x01 \x01(\x0c\x12\x0f\n\x07to_node\x18\x02 \x01(\x0c\x12\x10\n\x08\x61mt_msat\x18\x03 \x01(\x03"U\n\x18QueryProbabilityResponse\x12\x13\n\x0bprobability\x18\x01 \x01(\x01\x12$\n\x07history\x18\x02 \x01(\x0b\x32\x13.routerrpc.PairData"\x88\x01\n\x11\x42uildRouteRequest\x12\x10\n\x08\x61mt_msat\x18\x01 \x01(\x03\x12\x18\n\x10\x66inal_cltv_delta\x18\x02 \x01(\x05\x12\x1c\n\x10outgoing_chan_id\x18\x03 \x01(\x04\x42\x02\x30\x01\x12\x13\n\x0bhop_pubkeys\x18\x04 \x03(\x0c\x12\x14\n\x0cpayment_addr\x18\x05 \x01(\x0c"1\n\x12\x42uildRouteResponse\x12\x1b\n\x05route\x18\x01 \x01(\x0b\x32\x0c.lnrpc.Route"\x1c\n\x1aSubscribeHtlcEventsRequest"\xdc\x03\n\tHtlcEvent\x12\x1b\n\x13incoming_channel_id\x18\x01 \x01(\x04\x12\x1b\n\x13outgoing_channel_id\x18\x02 \x01(\x04\x12\x18\n\x10incoming_htlc_id\x18\x03 \x01(\x04\x12\x18\n\x10outgoing_htlc_id\x18\x04 \x01(\x04\x12\x14\n\x0ctimestamp_ns\x18\x05 \x01(\x04\x12\x32\n\nevent_type\x18\x06 \x01(\x0e\x32\x1e.routerrpc.HtlcEvent.EventType\x12\x30\n\rforward_event\x18\x07 \x01(\x0b\x32\x17.routerrpc.ForwardEventH\x00\x12\x39\n\x12\x66orward_fail_event\x18\x08 \x01(\x0b\x32\x1b.routerrpc.ForwardFailEventH\x00\x12.\n\x0csettle_event\x18\t \x01(\x0b\x32\x16.routerrpc.SettleEventH\x00\x12\x33\n\x0flink_fail_event\x18\n \x01(\x0b\x32\x18.routerrpc.LinkFailEventH\x00"<\n\tEventType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04SEND\x10\x01\x12\x0b\n\x07RECEIVE\x10\x02\x12\x0b\n\x07\x46ORWARD\x10\x03\x42\x07\n\x05\x65vent"v\n\x08HtlcInfo\x12\x19\n\x11incoming_timelock\x18\x01 \x01(\r\x12\x19\n\x11outgoing_timelock\x18\x02 \x01(\r\x12\x19\n\x11incoming_amt_msat\x18\x03 \x01(\x04\x12\x19\n\x11outgoing_amt_msat\x18\x04 \x01(\x04"1\n\x0c\x46orwardEvent\x12!\n\x04info\x18\x01 \x01(\x0b\x32\x13.routerrpc.HtlcInfo"\x12\n\x10\x46orwardFailEvent"\x1f\n\x0bSettleEvent\x12\x10\n\x08preimage\x18\x01 \x01(\x0c"\xae\x01\n\rLinkFailEvent\x12!\n\x04info\x18\x01 \x01(\x0b\x32\x13.routerrpc.HtlcInfo\x12\x30\n\x0cwire_failure\x18\x02 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode\x12\x30\n\x0e\x66\x61ilure_detail\x18\x03 \x01(\x0e\x32\x18.routerrpc.FailureDetail\x12\x16\n\x0e\x66\x61ilure_string\x18\x04 \x01(\t"r\n\rPaymentStatus\x12&\n\x05state\x18\x01 \x01(\x0e\x32\x17.routerrpc.PaymentState\x12\x10\n\x08preimage\x18\x02 \x01(\x0c\x12!\n\x05htlcs\x18\x04 \x03(\x0b\x32\x12.lnrpc.HTLCAttemptJ\x04\x08\x03\x10\x04".\n\nCircuitKey\x12\x0f\n\x07\x63han_id\x18\x01 \x01(\x04\x12\x0f\n\x07htlc_id\x18\x02 \x01(\x04"\x97\x03\n\x1b\x46orwardHtlcInterceptRequest\x12\x33\n\x14incoming_circuit_key\x18\x01 \x01(\x0b\x32\x15.routerrpc.CircuitKey\x12\x1c\n\x14incoming_amount_msat\x18\x05 \x01(\x04\x12\x17\n\x0fincoming_expiry\x18\x06 \x01(\r\x12\x14\n\x0cpayment_hash\x18\x02 \x01(\x0c\x12"\n\x1aoutgoing_requested_chan_id\x18\x07 \x01(\x04\x12\x1c\n\x14outgoing_amount_msat\x18\x03 \x01(\x04\x12\x17\n\x0foutgoing_expiry\x18\x04 \x01(\r\x12Q\n\x0e\x63ustom_records\x18\x08 \x03(\x0b\x32\x39.routerrpc.ForwardHtlcInterceptRequest.CustomRecordsEntry\x12\x12\n\nonion_blob\x18\t \x01(\x0c\x1a\x34\n\x12\x43ustomRecordsEntry\x12\x0b\n\x03key\x18\x01 \x01(\x04\x12\r\n\x05value\x18\x02 \x01(\x0c:\x02\x38\x01"\xe5\x01\n\x1c\x46orwardHtlcInterceptResponse\x12\x33\n\x14incoming_circuit_key\x18\x01 \x01(\x0b\x32\x15.routerrpc.CircuitKey\x12\x33\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32#.routerrpc.ResolveHoldForwardAction\x12\x10\n\x08preimage\x18\x03 \x01(\x0c\x12\x17\n\x0f\x66\x61ilure_message\x18\x04 \x01(\x0c\x12\x30\n\x0c\x66\x61ilure_code\x18\x05 \x01(\x0e\x32\x1a.lnrpc.Failure.FailureCode"o\n\x17UpdateChanStatusRequest\x12\'\n\nchan_point\x18\x01 \x01(\x0b\x32\x13.lnrpc.ChannelPoint\x12+\n\x06\x61\x63tion\x18\x02 \x01(\x0e\x32\x1b.routerrpc.ChanStatusAction"\x1a\n\x18UpdateChanStatusResponse*\x81\x04\n\rFailureDetail\x12\x0b\n\x07UNKNOWN\x10\x00\x12\r\n\tNO_DETAIL\x10\x01\x12\x10\n\x0cONION_DECODE\x10\x02\x12\x15\n\x11LINK_NOT_ELIGIBLE\x10\x03\x12\x14\n\x10ON_CHAIN_TIMEOUT\x10\x04\x12\x14\n\x10HTLC_EXCEEDS_MAX\x10\x05\x12\x18\n\x14INSUFFICIENT_BALANCE\x10\x06\x12\x16\n\x12INCOMPLETE_FORWARD\x10\x07\x12\x13\n\x0fHTLC_ADD_FAILED\x10\x08\x12\x15\n\x11\x46ORWARDS_DISABLED\x10\t\x12\x14\n\x10INVOICE_CANCELED\x10\n\x12\x15\n\x11INVOICE_UNDERPAID\x10\x0b\x12\x1b\n\x17INVOICE_EXPIRY_TOO_SOON\x10\x0c\x12\x14\n\x10INVOICE_NOT_OPEN\x10\r\x12\x17\n\x13MPP_INVOICE_TIMEOUT\x10\x0e\x12\x14\n\x10\x41\x44\x44RESS_MISMATCH\x10\x0f\x12\x16\n\x12SET_TOTAL_MISMATCH\x10\x10\x12\x15\n\x11SET_TOTAL_TOO_LOW\x10\x11\x12\x10\n\x0cSET_OVERPAID\x10\x12\x12\x13\n\x0fUNKNOWN_INVOICE\x10\x13\x12\x13\n\x0fINVALID_KEYSEND\x10\x14\x12\x13\n\x0fMPP_IN_PROGRESS\x10\x15\x12\x12\n\x0e\x43IRCULAR_ROUTE\x10\x16*\xae\x01\n\x0cPaymentState\x12\r\n\tIN_FLIGHT\x10\x00\x12\r\n\tSUCCEEDED\x10\x01\x12\x12\n\x0e\x46\x41ILED_TIMEOUT\x10\x02\x12\x13\n\x0f\x46\x41ILED_NO_ROUTE\x10\x03\x12\x10\n\x0c\x46\x41ILED_ERROR\x10\x04\x12$\n FAILED_INCORRECT_PAYMENT_DETAILS\x10\x05\x12\x1f\n\x1b\x46\x41ILED_INSUFFICIENT_BALANCE\x10\x06*<\n\x18ResolveHoldForwardAction\x12\n\n\x06SETTLE\x10\x00\x12\x08\n\x04\x46\x41IL\x10\x01\x12\n\n\x06RESUME\x10\x02*5\n\x10\x43hanStatusAction\x12\n\n\x06\x45NABLE\x10\x00\x12\x0b\n\x07\x44ISABLE\x10\x01\x12\x08\n\x04\x41UTO\x10\x02\x32\xf1\x0b\n\x06Router\x12@\n\rSendPaymentV2\x12\x1d.routerrpc.SendPaymentRequest\x1a\x0e.lnrpc.Payment0\x01\x12\x42\n\x0eTrackPaymentV2\x12\x1e.routerrpc.TrackPaymentRequest\x1a\x0e.lnrpc.Payment0\x01\x12K\n\x10\x45stimateRouteFee\x12\x1a.routerrpc.RouteFeeRequest\x1a\x1b.routerrpc.RouteFeeResponse\x12Q\n\x0bSendToRoute\x12\x1d.routerrpc.SendToRouteRequest\x1a\x1e.routerrpc.SendToRouteResponse"\x03\x88\x02\x01\x12\x42\n\rSendToRouteV2\x12\x1d.routerrpc.SendToRouteRequest\x1a\x12.lnrpc.HTLCAttempt\x12\x64\n\x13ResetMissionControl\x12%.routerrpc.ResetMissionControlRequest\x1a&.routerrpc.ResetMissionControlResponse\x12\x64\n\x13QueryMissionControl\x12%.routerrpc.QueryMissionControlRequest\x1a&.routerrpc.QueryMissionControlResponse\x12j\n\x15XImportMissionControl\x12\'.routerrpc.XImportMissionControlRequest\x1a(.routerrpc.XImportMissionControlResponse\x12p\n\x17GetMissionControlConfig\x12).routerrpc.GetMissionControlConfigRequest\x1a*.routerrpc.GetMissionControlConfigResponse\x12p\n\x17SetMissionControlConfig\x12).routerrpc.SetMissionControlConfigRequest\x1a*.routerrpc.SetMissionControlConfigResponse\x12[\n\x10QueryProbability\x12".routerrpc.QueryProbabilityRequest\x1a#.routerrpc.QueryProbabilityResponse\x12I\n\nBuildRoute\x12\x1c.routerrpc.BuildRouteRequest\x1a\x1d.routerrpc.BuildRouteResponse\x12T\n\x13SubscribeHtlcEvents\x12%.routerrpc.SubscribeHtlcEventsRequest\x1a\x14.routerrpc.HtlcEvent0\x01\x12M\n\x0bSendPayment\x12\x1d.routerrpc.SendPaymentRequest\x1a\x18.routerrpc.PaymentStatus"\x03\x88\x02\x01\x30\x01\x12O\n\x0cTrackPayment\x12\x1e.routerrpc.TrackPaymentRequest\x1a\x18.routerrpc.PaymentStatus"\x03\x88\x02\x01\x30\x01\x12\x66\n\x0fHtlcInterceptor\x12\'.routerrpc.ForwardHtlcInterceptResponse\x1a&.routerrpc.ForwardHtlcInterceptRequest(\x01\x30\x01\x12[\n\x10UpdateChanStatus\x12".routerrpc.UpdateChanStatusRequest\x1a#.routerrpc.UpdateChanStatusResponseB1Z/github.com/lightningnetwork/lnd/lnrpc/routerrpcb\x06proto3' +) + +_FAILUREDETAIL = DESCRIPTOR.enum_types_by_name["FailureDetail"] +FailureDetail = enum_type_wrapper.EnumTypeWrapper(_FAILUREDETAIL) +_PAYMENTSTATE = DESCRIPTOR.enum_types_by_name["PaymentState"] +PaymentState = enum_type_wrapper.EnumTypeWrapper(_PAYMENTSTATE) +_RESOLVEHOLDFORWARDACTION = DESCRIPTOR.enum_types_by_name["ResolveHoldForwardAction"] +ResolveHoldForwardAction = enum_type_wrapper.EnumTypeWrapper(_RESOLVEHOLDFORWARDACTION) +_CHANSTATUSACTION = DESCRIPTOR.enum_types_by_name["ChanStatusAction"] +ChanStatusAction = enum_type_wrapper.EnumTypeWrapper(_CHANSTATUSACTION) +UNKNOWN = 0 +NO_DETAIL = 1 +ONION_DECODE = 2 +LINK_NOT_ELIGIBLE = 3 +ON_CHAIN_TIMEOUT = 4 +HTLC_EXCEEDS_MAX = 5 +INSUFFICIENT_BALANCE = 6 +INCOMPLETE_FORWARD = 7 +HTLC_ADD_FAILED = 8 +FORWARDS_DISABLED = 9 +INVOICE_CANCELED = 10 +INVOICE_UNDERPAID = 11 +INVOICE_EXPIRY_TOO_SOON = 12 +INVOICE_NOT_OPEN = 13 +MPP_INVOICE_TIMEOUT = 14 +ADDRESS_MISMATCH = 15 +SET_TOTAL_MISMATCH = 16 +SET_TOTAL_TOO_LOW = 17 +SET_OVERPAID = 18 +UNKNOWN_INVOICE = 19 +INVALID_KEYSEND = 20 +MPP_IN_PROGRESS = 21 +CIRCULAR_ROUTE = 22 +IN_FLIGHT = 0 +SUCCEEDED = 1 +FAILED_TIMEOUT = 2 +FAILED_NO_ROUTE = 3 +FAILED_ERROR = 4 +FAILED_INCORRECT_PAYMENT_DETAILS = 5 +FAILED_INSUFFICIENT_BALANCE = 6 +SETTLE = 0 +FAIL = 1 +RESUME = 2 +ENABLE = 0 +DISABLE = 1 +AUTO = 2 + + +_SENDPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["SendPaymentRequest"] +_SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY = _SENDPAYMENTREQUEST.nested_types_by_name[ + "DestCustomRecordsEntry" +] +_TRACKPAYMENTREQUEST = DESCRIPTOR.message_types_by_name["TrackPaymentRequest"] +_ROUTEFEEREQUEST = DESCRIPTOR.message_types_by_name["RouteFeeRequest"] +_ROUTEFEERESPONSE = DESCRIPTOR.message_types_by_name["RouteFeeResponse"] +_SENDTOROUTEREQUEST = DESCRIPTOR.message_types_by_name["SendToRouteRequest"] +_SENDTOROUTERESPONSE = DESCRIPTOR.message_types_by_name["SendToRouteResponse"] +_RESETMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "ResetMissionControlRequest" +] +_RESETMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "ResetMissionControlResponse" +] +_QUERYMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "QueryMissionControlRequest" +] +_QUERYMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "QueryMissionControlResponse" +] +_XIMPORTMISSIONCONTROLREQUEST = DESCRIPTOR.message_types_by_name[ + "XImportMissionControlRequest" +] +_XIMPORTMISSIONCONTROLRESPONSE = DESCRIPTOR.message_types_by_name[ + "XImportMissionControlResponse" +] +_PAIRHISTORY = DESCRIPTOR.message_types_by_name["PairHistory"] +_PAIRDATA = DESCRIPTOR.message_types_by_name["PairData"] +_GETMISSIONCONTROLCONFIGREQUEST = DESCRIPTOR.message_types_by_name[ + "GetMissionControlConfigRequest" +] +_GETMISSIONCONTROLCONFIGRESPONSE = DESCRIPTOR.message_types_by_name[ + "GetMissionControlConfigResponse" +] +_SETMISSIONCONTROLCONFIGREQUEST = DESCRIPTOR.message_types_by_name[ + "SetMissionControlConfigRequest" +] +_SETMISSIONCONTROLCONFIGRESPONSE = DESCRIPTOR.message_types_by_name[ + "SetMissionControlConfigResponse" +] +_MISSIONCONTROLCONFIG = DESCRIPTOR.message_types_by_name["MissionControlConfig"] +_QUERYPROBABILITYREQUEST = DESCRIPTOR.message_types_by_name["QueryProbabilityRequest"] +_QUERYPROBABILITYRESPONSE = DESCRIPTOR.message_types_by_name["QueryProbabilityResponse"] +_BUILDROUTEREQUEST = DESCRIPTOR.message_types_by_name["BuildRouteRequest"] +_BUILDROUTERESPONSE = DESCRIPTOR.message_types_by_name["BuildRouteResponse"] +_SUBSCRIBEHTLCEVENTSREQUEST = DESCRIPTOR.message_types_by_name[ + "SubscribeHtlcEventsRequest" +] +_HTLCEVENT = DESCRIPTOR.message_types_by_name["HtlcEvent"] +_HTLCINFO = DESCRIPTOR.message_types_by_name["HtlcInfo"] +_FORWARDEVENT = DESCRIPTOR.message_types_by_name["ForwardEvent"] +_FORWARDFAILEVENT = DESCRIPTOR.message_types_by_name["ForwardFailEvent"] +_SETTLEEVENT = DESCRIPTOR.message_types_by_name["SettleEvent"] +_LINKFAILEVENT = DESCRIPTOR.message_types_by_name["LinkFailEvent"] +_PAYMENTSTATUS = DESCRIPTOR.message_types_by_name["PaymentStatus"] +_CIRCUITKEY = DESCRIPTOR.message_types_by_name["CircuitKey"] +_FORWARDHTLCINTERCEPTREQUEST = DESCRIPTOR.message_types_by_name[ + "ForwardHtlcInterceptRequest" +] +_FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY = ( + _FORWARDHTLCINTERCEPTREQUEST.nested_types_by_name["CustomRecordsEntry"] +) +_FORWARDHTLCINTERCEPTRESPONSE = DESCRIPTOR.message_types_by_name[ + "ForwardHtlcInterceptResponse" +] +_UPDATECHANSTATUSREQUEST = DESCRIPTOR.message_types_by_name["UpdateChanStatusRequest"] +_UPDATECHANSTATUSRESPONSE = DESCRIPTOR.message_types_by_name["UpdateChanStatusResponse"] +_HTLCEVENT_EVENTTYPE = _HTLCEVENT.enum_types_by_name["EventType"] +SendPaymentRequest = _reflection.GeneratedProtocolMessageType( + "SendPaymentRequest", + (_message.Message,), + { + "DestCustomRecordsEntry": _reflection.GeneratedProtocolMessageType( + "DestCustomRecordsEntry", + (_message.Message,), + { + "DESCRIPTOR": _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendPaymentRequest.DestCustomRecordsEntry) + }, + ), + "DESCRIPTOR": _SENDPAYMENTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendPaymentRequest) + }, +) +_sym_db.RegisterMessage(SendPaymentRequest) +_sym_db.RegisterMessage(SendPaymentRequest.DestCustomRecordsEntry) + +TrackPaymentRequest = _reflection.GeneratedProtocolMessageType( + "TrackPaymentRequest", + (_message.Message,), + { + "DESCRIPTOR": _TRACKPAYMENTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.TrackPaymentRequest) + }, +) +_sym_db.RegisterMessage(TrackPaymentRequest) + +RouteFeeRequest = _reflection.GeneratedProtocolMessageType( + "RouteFeeRequest", + (_message.Message,), + { + "DESCRIPTOR": _ROUTEFEEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.RouteFeeRequest) + }, +) +_sym_db.RegisterMessage(RouteFeeRequest) + +RouteFeeResponse = _reflection.GeneratedProtocolMessageType( + "RouteFeeResponse", + (_message.Message,), + { + "DESCRIPTOR": _ROUTEFEERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.RouteFeeResponse) + }, +) +_sym_db.RegisterMessage(RouteFeeResponse) + +SendToRouteRequest = _reflection.GeneratedProtocolMessageType( + "SendToRouteRequest", + (_message.Message,), + { + "DESCRIPTOR": _SENDTOROUTEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendToRouteRequest) + }, +) +_sym_db.RegisterMessage(SendToRouteRequest) + +SendToRouteResponse = _reflection.GeneratedProtocolMessageType( + "SendToRouteResponse", + (_message.Message,), + { + "DESCRIPTOR": _SENDTOROUTERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SendToRouteResponse) + }, +) +_sym_db.RegisterMessage(SendToRouteResponse) + +ResetMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "ResetMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _RESETMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ResetMissionControlRequest) + }, +) +_sym_db.RegisterMessage(ResetMissionControlRequest) + +ResetMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "ResetMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _RESETMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ResetMissionControlResponse) + }, +) +_sym_db.RegisterMessage(ResetMissionControlResponse) + +QueryMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "QueryMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryMissionControlRequest) + }, +) +_sym_db.RegisterMessage(QueryMissionControlRequest) + +QueryMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "QueryMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryMissionControlResponse) + }, +) +_sym_db.RegisterMessage(QueryMissionControlResponse) + +XImportMissionControlRequest = _reflection.GeneratedProtocolMessageType( + "XImportMissionControlRequest", + (_message.Message,), + { + "DESCRIPTOR": _XIMPORTMISSIONCONTROLREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.XImportMissionControlRequest) + }, +) +_sym_db.RegisterMessage(XImportMissionControlRequest) + +XImportMissionControlResponse = _reflection.GeneratedProtocolMessageType( + "XImportMissionControlResponse", + (_message.Message,), + { + "DESCRIPTOR": _XIMPORTMISSIONCONTROLRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.XImportMissionControlResponse) + }, +) +_sym_db.RegisterMessage(XImportMissionControlResponse) + +PairHistory = _reflection.GeneratedProtocolMessageType( + "PairHistory", + (_message.Message,), + { + "DESCRIPTOR": _PAIRHISTORY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PairHistory) + }, +) +_sym_db.RegisterMessage(PairHistory) + +PairData = _reflection.GeneratedProtocolMessageType( + "PairData", + (_message.Message,), + { + "DESCRIPTOR": _PAIRDATA, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PairData) + }, +) +_sym_db.RegisterMessage(PairData) + +GetMissionControlConfigRequest = _reflection.GeneratedProtocolMessageType( + "GetMissionControlConfigRequest", + (_message.Message,), + { + "DESCRIPTOR": _GETMISSIONCONTROLCONFIGREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.GetMissionControlConfigRequest) + }, +) +_sym_db.RegisterMessage(GetMissionControlConfigRequest) + +GetMissionControlConfigResponse = _reflection.GeneratedProtocolMessageType( + "GetMissionControlConfigResponse", + (_message.Message,), + { + "DESCRIPTOR": _GETMISSIONCONTROLCONFIGRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.GetMissionControlConfigResponse) + }, +) +_sym_db.RegisterMessage(GetMissionControlConfigResponse) + +SetMissionControlConfigRequest = _reflection.GeneratedProtocolMessageType( + "SetMissionControlConfigRequest", + (_message.Message,), + { + "DESCRIPTOR": _SETMISSIONCONTROLCONFIGREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SetMissionControlConfigRequest) + }, +) +_sym_db.RegisterMessage(SetMissionControlConfigRequest) + +SetMissionControlConfigResponse = _reflection.GeneratedProtocolMessageType( + "SetMissionControlConfigResponse", + (_message.Message,), + { + "DESCRIPTOR": _SETMISSIONCONTROLCONFIGRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SetMissionControlConfigResponse) + }, +) +_sym_db.RegisterMessage(SetMissionControlConfigResponse) + +MissionControlConfig = _reflection.GeneratedProtocolMessageType( + "MissionControlConfig", + (_message.Message,), + { + "DESCRIPTOR": _MISSIONCONTROLCONFIG, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.MissionControlConfig) + }, +) +_sym_db.RegisterMessage(MissionControlConfig) + +QueryProbabilityRequest = _reflection.GeneratedProtocolMessageType( + "QueryProbabilityRequest", + (_message.Message,), + { + "DESCRIPTOR": _QUERYPROBABILITYREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryProbabilityRequest) + }, +) +_sym_db.RegisterMessage(QueryProbabilityRequest) + +QueryProbabilityResponse = _reflection.GeneratedProtocolMessageType( + "QueryProbabilityResponse", + (_message.Message,), + { + "DESCRIPTOR": _QUERYPROBABILITYRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.QueryProbabilityResponse) + }, +) +_sym_db.RegisterMessage(QueryProbabilityResponse) + +BuildRouteRequest = _reflection.GeneratedProtocolMessageType( + "BuildRouteRequest", + (_message.Message,), + { + "DESCRIPTOR": _BUILDROUTEREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.BuildRouteRequest) + }, +) +_sym_db.RegisterMessage(BuildRouteRequest) + +BuildRouteResponse = _reflection.GeneratedProtocolMessageType( + "BuildRouteResponse", + (_message.Message,), + { + "DESCRIPTOR": _BUILDROUTERESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.BuildRouteResponse) + }, +) +_sym_db.RegisterMessage(BuildRouteResponse) + +SubscribeHtlcEventsRequest = _reflection.GeneratedProtocolMessageType( + "SubscribeHtlcEventsRequest", + (_message.Message,), + { + "DESCRIPTOR": _SUBSCRIBEHTLCEVENTSREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SubscribeHtlcEventsRequest) + }, +) +_sym_db.RegisterMessage(SubscribeHtlcEventsRequest) + +HtlcEvent = _reflection.GeneratedProtocolMessageType( + "HtlcEvent", + (_message.Message,), + { + "DESCRIPTOR": _HTLCEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.HtlcEvent) + }, +) +_sym_db.RegisterMessage(HtlcEvent) + +HtlcInfo = _reflection.GeneratedProtocolMessageType( + "HtlcInfo", + (_message.Message,), + { + "DESCRIPTOR": _HTLCINFO, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.HtlcInfo) + }, +) +_sym_db.RegisterMessage(HtlcInfo) + +ForwardEvent = _reflection.GeneratedProtocolMessageType( + "ForwardEvent", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardEvent) + }, +) +_sym_db.RegisterMessage(ForwardEvent) + +ForwardFailEvent = _reflection.GeneratedProtocolMessageType( + "ForwardFailEvent", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDFAILEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardFailEvent) + }, +) +_sym_db.RegisterMessage(ForwardFailEvent) + +SettleEvent = _reflection.GeneratedProtocolMessageType( + "SettleEvent", + (_message.Message,), + { + "DESCRIPTOR": _SETTLEEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.SettleEvent) + }, +) +_sym_db.RegisterMessage(SettleEvent) + +LinkFailEvent = _reflection.GeneratedProtocolMessageType( + "LinkFailEvent", + (_message.Message,), + { + "DESCRIPTOR": _LINKFAILEVENT, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.LinkFailEvent) + }, +) +_sym_db.RegisterMessage(LinkFailEvent) + +PaymentStatus = _reflection.GeneratedProtocolMessageType( + "PaymentStatus", + (_message.Message,), + { + "DESCRIPTOR": _PAYMENTSTATUS, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.PaymentStatus) + }, +) +_sym_db.RegisterMessage(PaymentStatus) + +CircuitKey = _reflection.GeneratedProtocolMessageType( + "CircuitKey", + (_message.Message,), + { + "DESCRIPTOR": _CIRCUITKEY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.CircuitKey) + }, +) +_sym_db.RegisterMessage(CircuitKey) + +ForwardHtlcInterceptRequest = _reflection.GeneratedProtocolMessageType( + "ForwardHtlcInterceptRequest", + (_message.Message,), + { + "CustomRecordsEntry": _reflection.GeneratedProtocolMessageType( + "CustomRecordsEntry", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptRequest.CustomRecordsEntry) + }, + ), + "DESCRIPTOR": _FORWARDHTLCINTERCEPTREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptRequest) + }, +) +_sym_db.RegisterMessage(ForwardHtlcInterceptRequest) +_sym_db.RegisterMessage(ForwardHtlcInterceptRequest.CustomRecordsEntry) + +ForwardHtlcInterceptResponse = _reflection.GeneratedProtocolMessageType( + "ForwardHtlcInterceptResponse", + (_message.Message,), + { + "DESCRIPTOR": _FORWARDHTLCINTERCEPTRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.ForwardHtlcInterceptResponse) + }, +) +_sym_db.RegisterMessage(ForwardHtlcInterceptResponse) + +UpdateChanStatusRequest = _reflection.GeneratedProtocolMessageType( + "UpdateChanStatusRequest", + (_message.Message,), + { + "DESCRIPTOR": _UPDATECHANSTATUSREQUEST, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.UpdateChanStatusRequest) + }, +) +_sym_db.RegisterMessage(UpdateChanStatusRequest) + +UpdateChanStatusResponse = _reflection.GeneratedProtocolMessageType( + "UpdateChanStatusResponse", + (_message.Message,), + { + "DESCRIPTOR": _UPDATECHANSTATUSRESPONSE, + "__module__": "router_pb2" + # @@protoc_insertion_point(class_scope:routerrpc.UpdateChanStatusResponse) + }, +) +_sym_db.RegisterMessage(UpdateChanStatusResponse) + +_ROUTER = DESCRIPTOR.services_by_name["Router"] +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = ( + b"Z/github.com/lightningnetwork/lnd/lnrpc/routerrpc" + ) + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._options = None + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_options = b"8\001" + _SENDPAYMENTREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _SENDPAYMENTREQUEST.fields_by_name[ + "outgoing_chan_id" + ]._serialized_options = b"\030\0010\001" + _BUILDROUTEREQUEST.fields_by_name["outgoing_chan_id"]._options = None + _BUILDROUTEREQUEST.fields_by_name["outgoing_chan_id"]._serialized_options = b"0\001" + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._options = None + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_options = b"8\001" + _ROUTER.methods_by_name["SendToRoute"]._options = None + _ROUTER.methods_by_name["SendToRoute"]._serialized_options = b"\210\002\001" + _ROUTER.methods_by_name["SendPayment"]._options = None + _ROUTER.methods_by_name["SendPayment"]._serialized_options = b"\210\002\001" + _ROUTER.methods_by_name["TrackPayment"]._options = None + _ROUTER.methods_by_name["TrackPayment"]._serialized_options = b"\210\002\001" + _FAILUREDETAIL._serialized_start = 4280 + _FAILUREDETAIL._serialized_end = 4793 + _PAYMENTSTATE._serialized_start = 4796 + _PAYMENTSTATE._serialized_end = 4970 + _RESOLVEHOLDFORWARDACTION._serialized_start = 4972 + _RESOLVEHOLDFORWARDACTION._serialized_end = 5032 + _CHANSTATUSACTION._serialized_start = 5034 + _CHANSTATUSACTION._serialized_end = 5087 + _SENDPAYMENTREQUEST._serialized_start = 45 + _SENDPAYMENTREQUEST._serialized_end = 740 + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_start = 684 + _SENDPAYMENTREQUEST_DESTCUSTOMRECORDSENTRY._serialized_end = 740 + _TRACKPAYMENTREQUEST._serialized_start = 742 + _TRACKPAYMENTREQUEST._serialized_end = 814 + _ROUTEFEEREQUEST._serialized_start = 816 + _ROUTEFEEREQUEST._serialized_end = 864 + _ROUTEFEERESPONSE._serialized_start = 866 + _ROUTEFEERESPONSE._serialized_end = 935 + _SENDTOROUTEREQUEST._serialized_start = 937 + _SENDTOROUTEREQUEST._serialized_end = 1031 + _SENDTOROUTERESPONSE._serialized_start = 1033 + _SENDTOROUTERESPONSE._serialized_end = 1105 + _RESETMISSIONCONTROLREQUEST._serialized_start = 1107 + _RESETMISSIONCONTROLREQUEST._serialized_end = 1135 + _RESETMISSIONCONTROLRESPONSE._serialized_start = 1137 + _RESETMISSIONCONTROLRESPONSE._serialized_end = 1166 + _QUERYMISSIONCONTROLREQUEST._serialized_start = 1168 + _QUERYMISSIONCONTROLREQUEST._serialized_end = 1196 + _QUERYMISSIONCONTROLRESPONSE._serialized_start = 1198 + _QUERYMISSIONCONTROLRESPONSE._serialized_end = 1272 + _XIMPORTMISSIONCONTROLREQUEST._serialized_start = 1274 + _XIMPORTMISSIONCONTROLREQUEST._serialized_end = 1358 + _XIMPORTMISSIONCONTROLRESPONSE._serialized_start = 1360 + _XIMPORTMISSIONCONTROLRESPONSE._serialized_end = 1391 + _PAIRHISTORY._serialized_start = 1393 + _PAIRHISTORY._serialized_end = 1504 + _PAIRDATA._serialized_start = 1507 + _PAIRDATA._serialized_end = 1660 + _GETMISSIONCONTROLCONFIGREQUEST._serialized_start = 1662 + _GETMISSIONCONTROLCONFIGREQUEST._serialized_end = 1694 + _GETMISSIONCONTROLCONFIGRESPONSE._serialized_start = 1696 + _GETMISSIONCONTROLCONFIGRESPONSE._serialized_end = 1778 + _SETMISSIONCONTROLCONFIGREQUEST._serialized_start = 1780 + _SETMISSIONCONTROLCONFIGREQUEST._serialized_end = 1861 + _SETMISSIONCONTROLCONFIGRESPONSE._serialized_start = 1863 + _SETMISSIONCONTROLCONFIGRESPONSE._serialized_end = 1896 + _MISSIONCONTROLCONFIG._serialized_start = 1899 + _MISSIONCONTROLCONFIG._serialized_end = 2062 + _QUERYPROBABILITYREQUEST._serialized_start = 2064 + _QUERYPROBABILITYREQUEST._serialized_end = 2143 + _QUERYPROBABILITYRESPONSE._serialized_start = 2145 + _QUERYPROBABILITYRESPONSE._serialized_end = 2230 + _BUILDROUTEREQUEST._serialized_start = 2233 + _BUILDROUTEREQUEST._serialized_end = 2369 + _BUILDROUTERESPONSE._serialized_start = 2371 + _BUILDROUTERESPONSE._serialized_end = 2420 + _SUBSCRIBEHTLCEVENTSREQUEST._serialized_start = 2422 + _SUBSCRIBEHTLCEVENTSREQUEST._serialized_end = 2450 + _HTLCEVENT._serialized_start = 2453 + _HTLCEVENT._serialized_end = 2929 + _HTLCEVENT_EVENTTYPE._serialized_start = 2860 + _HTLCEVENT_EVENTTYPE._serialized_end = 2920 + _HTLCINFO._serialized_start = 2931 + _HTLCINFO._serialized_end = 3049 + _FORWARDEVENT._serialized_start = 3051 + _FORWARDEVENT._serialized_end = 3100 + _FORWARDFAILEVENT._serialized_start = 3102 + _FORWARDFAILEVENT._serialized_end = 3120 + _SETTLEEVENT._serialized_start = 3122 + _SETTLEEVENT._serialized_end = 3153 + _LINKFAILEVENT._serialized_start = 3156 + _LINKFAILEVENT._serialized_end = 3330 + _PAYMENTSTATUS._serialized_start = 3332 + _PAYMENTSTATUS._serialized_end = 3446 + _CIRCUITKEY._serialized_start = 3448 + _CIRCUITKEY._serialized_end = 3494 + _FORWARDHTLCINTERCEPTREQUEST._serialized_start = 3497 + _FORWARDHTLCINTERCEPTREQUEST._serialized_end = 3904 + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_start = 3852 + _FORWARDHTLCINTERCEPTREQUEST_CUSTOMRECORDSENTRY._serialized_end = 3904 + _FORWARDHTLCINTERCEPTRESPONSE._serialized_start = 3907 + _FORWARDHTLCINTERCEPTRESPONSE._serialized_end = 4136 + _UPDATECHANSTATUSREQUEST._serialized_start = 4138 + _UPDATECHANSTATUSREQUEST._serialized_end = 4249 + _UPDATECHANSTATUSRESPONSE._serialized_start = 4251 + _UPDATECHANSTATUSRESPONSE._serialized_end = 4277 + _ROUTER._serialized_start = 5090 + _ROUTER._serialized_end = 6611 +# @@protoc_insertion_point(module_scope) diff --git a/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py b/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py new file mode 100644 index 000000000..32923a91e --- /dev/null +++ b/lnbits/wallets/lnd_grpc_files/router_pb2_grpc.py @@ -0,0 +1,871 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +import lnbits.wallets.lnd_grpc_files.lightning_pb2 as lightning__pb2 +import lnbits.wallets.lnd_grpc_files.router_pb2 as router__pb2 + + +class RouterStub(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.SendPaymentV2 = channel.unary_stream( + "/routerrpc.Router/SendPaymentV2", + request_serializer=router__pb2.SendPaymentRequest.SerializeToString, + response_deserializer=lightning__pb2.Payment.FromString, + ) + self.TrackPaymentV2 = channel.unary_stream( + "/routerrpc.Router/TrackPaymentV2", + request_serializer=router__pb2.TrackPaymentRequest.SerializeToString, + response_deserializer=lightning__pb2.Payment.FromString, + ) + self.EstimateRouteFee = channel.unary_unary( + "/routerrpc.Router/EstimateRouteFee", + request_serializer=router__pb2.RouteFeeRequest.SerializeToString, + response_deserializer=router__pb2.RouteFeeResponse.FromString, + ) + self.SendToRoute = channel.unary_unary( + "/routerrpc.Router/SendToRoute", + request_serializer=router__pb2.SendToRouteRequest.SerializeToString, + response_deserializer=router__pb2.SendToRouteResponse.FromString, + ) + self.SendToRouteV2 = channel.unary_unary( + "/routerrpc.Router/SendToRouteV2", + request_serializer=router__pb2.SendToRouteRequest.SerializeToString, + response_deserializer=lightning__pb2.HTLCAttempt.FromString, + ) + self.ResetMissionControl = channel.unary_unary( + "/routerrpc.Router/ResetMissionControl", + request_serializer=router__pb2.ResetMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.ResetMissionControlResponse.FromString, + ) + self.QueryMissionControl = channel.unary_unary( + "/routerrpc.Router/QueryMissionControl", + request_serializer=router__pb2.QueryMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.QueryMissionControlResponse.FromString, + ) + self.XImportMissionControl = channel.unary_unary( + "/routerrpc.Router/XImportMissionControl", + request_serializer=router__pb2.XImportMissionControlRequest.SerializeToString, + response_deserializer=router__pb2.XImportMissionControlResponse.FromString, + ) + self.GetMissionControlConfig = channel.unary_unary( + "/routerrpc.Router/GetMissionControlConfig", + request_serializer=router__pb2.GetMissionControlConfigRequest.SerializeToString, + response_deserializer=router__pb2.GetMissionControlConfigResponse.FromString, + ) + self.SetMissionControlConfig = channel.unary_unary( + "/routerrpc.Router/SetMissionControlConfig", + request_serializer=router__pb2.SetMissionControlConfigRequest.SerializeToString, + response_deserializer=router__pb2.SetMissionControlConfigResponse.FromString, + ) + self.QueryProbability = channel.unary_unary( + "/routerrpc.Router/QueryProbability", + request_serializer=router__pb2.QueryProbabilityRequest.SerializeToString, + response_deserializer=router__pb2.QueryProbabilityResponse.FromString, + ) + self.BuildRoute = channel.unary_unary( + "/routerrpc.Router/BuildRoute", + request_serializer=router__pb2.BuildRouteRequest.SerializeToString, + response_deserializer=router__pb2.BuildRouteResponse.FromString, + ) + self.SubscribeHtlcEvents = channel.unary_stream( + "/routerrpc.Router/SubscribeHtlcEvents", + request_serializer=router__pb2.SubscribeHtlcEventsRequest.SerializeToString, + response_deserializer=router__pb2.HtlcEvent.FromString, + ) + self.SendPayment = channel.unary_stream( + "/routerrpc.Router/SendPayment", + request_serializer=router__pb2.SendPaymentRequest.SerializeToString, + response_deserializer=router__pb2.PaymentStatus.FromString, + ) + self.TrackPayment = channel.unary_stream( + "/routerrpc.Router/TrackPayment", + request_serializer=router__pb2.TrackPaymentRequest.SerializeToString, + response_deserializer=router__pb2.PaymentStatus.FromString, + ) + self.HtlcInterceptor = channel.stream_stream( + "/routerrpc.Router/HtlcInterceptor", + request_serializer=router__pb2.ForwardHtlcInterceptResponse.SerializeToString, + response_deserializer=router__pb2.ForwardHtlcInterceptRequest.FromString, + ) + self.UpdateChanStatus = channel.unary_unary( + "/routerrpc.Router/UpdateChanStatus", + request_serializer=router__pb2.UpdateChanStatusRequest.SerializeToString, + response_deserializer=router__pb2.UpdateChanStatusResponse.FromString, + ) + + +class RouterServicer(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + def SendPaymentV2(self, request, context): + """ + SendPaymentV2 attempts to route a payment described by the passed + PaymentRequest to the final destination. The call returns a stream of + payment updates. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def TrackPaymentV2(self, request, context): + """ + TrackPaymentV2 returns an update stream for the payment identified by the + payment hash. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def EstimateRouteFee(self, request, context): + """ + EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + may cost to send an HTLC to the target end destination. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendToRoute(self, request, context): + """ + Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + the specified route. This method differs from SendPayment in that it + allows users to specify a full route manually. This can be used for + things like rebalancing, and atomic swaps. It differs from the newer + SendToRouteV2 in that it doesn't return the full HTLC information. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendToRouteV2(self, request, context): + """ + SendToRouteV2 attempts to make a payment via the specified route. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def ResetMissionControl(self, request, context): + """ + ResetMissionControl clears all mission control state and starts with a clean + slate. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def QueryMissionControl(self, request, context): + """ + QueryMissionControl exposes the internal mission control state to callers. + It is a development feature. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def XImportMissionControl(self, request, context): + """ + XImportMissionControl is an experimental API that imports the state provided + to the internal mission control's state, using all results which are more + recent than our existing values. These values will only be imported + in-memory, and will not be persisted across restarts. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def GetMissionControlConfig(self, request, context): + """ + GetMissionControlConfig returns mission control's current config. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SetMissionControlConfig(self, request, context): + """ + SetMissionControlConfig will set mission control's config, if the config + provided is valid. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def QueryProbability(self, request, context): + """ + QueryProbability returns the current success probability estimate for a + given node pair and amount. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def BuildRoute(self, request, context): + """ + BuildRoute builds a fully specified route based on a list of hop public + keys. It retrieves the relevant channel policies from the graph in order to + calculate the correct fees and time locks. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SubscribeHtlcEvents(self, request, context): + """ + SubscribeHtlcEvents creates a uni-directional stream from the server to + the client which delivers a stream of htlc events. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def SendPayment(self, request, context): + """ + Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + described by the passed PaymentRequest to the final destination. The call + returns a stream of payment status updates. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def TrackPayment(self, request, context): + """ + Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + the payment identified by the payment hash. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def HtlcInterceptor(self, request_iterator, context): + """* + HtlcInterceptor dispatches a bi-directional streaming RPC in which + Forwarded HTLC requests are sent to the client and the client responds with + a boolean that tells LND if this htlc should be intercepted. + In case of interception, the htlc can be either settled, cancelled or + resumed later by using the ResolveHoldForward endpoint. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + def UpdateChanStatus(self, request, context): + """ + UpdateChanStatus attempts to manually set the state of a channel + (enabled, disabled, or auto). A manual "disable" request will cause the + channel to stay disabled until a subsequent manual request of either + "enable" or "auto". + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details("Method not implemented!") + raise NotImplementedError("Method not implemented!") + + +def add_RouterServicer_to_server(servicer, server): + rpc_method_handlers = { + "SendPaymentV2": grpc.unary_stream_rpc_method_handler( + servicer.SendPaymentV2, + request_deserializer=router__pb2.SendPaymentRequest.FromString, + response_serializer=lightning__pb2.Payment.SerializeToString, + ), + "TrackPaymentV2": grpc.unary_stream_rpc_method_handler( + servicer.TrackPaymentV2, + request_deserializer=router__pb2.TrackPaymentRequest.FromString, + response_serializer=lightning__pb2.Payment.SerializeToString, + ), + "EstimateRouteFee": grpc.unary_unary_rpc_method_handler( + servicer.EstimateRouteFee, + request_deserializer=router__pb2.RouteFeeRequest.FromString, + response_serializer=router__pb2.RouteFeeResponse.SerializeToString, + ), + "SendToRoute": grpc.unary_unary_rpc_method_handler( + servicer.SendToRoute, + request_deserializer=router__pb2.SendToRouteRequest.FromString, + response_serializer=router__pb2.SendToRouteResponse.SerializeToString, + ), + "SendToRouteV2": grpc.unary_unary_rpc_method_handler( + servicer.SendToRouteV2, + request_deserializer=router__pb2.SendToRouteRequest.FromString, + response_serializer=lightning__pb2.HTLCAttempt.SerializeToString, + ), + "ResetMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.ResetMissionControl, + request_deserializer=router__pb2.ResetMissionControlRequest.FromString, + response_serializer=router__pb2.ResetMissionControlResponse.SerializeToString, + ), + "QueryMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.QueryMissionControl, + request_deserializer=router__pb2.QueryMissionControlRequest.FromString, + response_serializer=router__pb2.QueryMissionControlResponse.SerializeToString, + ), + "XImportMissionControl": grpc.unary_unary_rpc_method_handler( + servicer.XImportMissionControl, + request_deserializer=router__pb2.XImportMissionControlRequest.FromString, + response_serializer=router__pb2.XImportMissionControlResponse.SerializeToString, + ), + "GetMissionControlConfig": grpc.unary_unary_rpc_method_handler( + servicer.GetMissionControlConfig, + request_deserializer=router__pb2.GetMissionControlConfigRequest.FromString, + response_serializer=router__pb2.GetMissionControlConfigResponse.SerializeToString, + ), + "SetMissionControlConfig": grpc.unary_unary_rpc_method_handler( + servicer.SetMissionControlConfig, + request_deserializer=router__pb2.SetMissionControlConfigRequest.FromString, + response_serializer=router__pb2.SetMissionControlConfigResponse.SerializeToString, + ), + "QueryProbability": grpc.unary_unary_rpc_method_handler( + servicer.QueryProbability, + request_deserializer=router__pb2.QueryProbabilityRequest.FromString, + response_serializer=router__pb2.QueryProbabilityResponse.SerializeToString, + ), + "BuildRoute": grpc.unary_unary_rpc_method_handler( + servicer.BuildRoute, + request_deserializer=router__pb2.BuildRouteRequest.FromString, + response_serializer=router__pb2.BuildRouteResponse.SerializeToString, + ), + "SubscribeHtlcEvents": grpc.unary_stream_rpc_method_handler( + servicer.SubscribeHtlcEvents, + request_deserializer=router__pb2.SubscribeHtlcEventsRequest.FromString, + response_serializer=router__pb2.HtlcEvent.SerializeToString, + ), + "SendPayment": grpc.unary_stream_rpc_method_handler( + servicer.SendPayment, + request_deserializer=router__pb2.SendPaymentRequest.FromString, + response_serializer=router__pb2.PaymentStatus.SerializeToString, + ), + "TrackPayment": grpc.unary_stream_rpc_method_handler( + servicer.TrackPayment, + request_deserializer=router__pb2.TrackPaymentRequest.FromString, + response_serializer=router__pb2.PaymentStatus.SerializeToString, + ), + "HtlcInterceptor": grpc.stream_stream_rpc_method_handler( + servicer.HtlcInterceptor, + request_deserializer=router__pb2.ForwardHtlcInterceptResponse.FromString, + response_serializer=router__pb2.ForwardHtlcInterceptRequest.SerializeToString, + ), + "UpdateChanStatus": grpc.unary_unary_rpc_method_handler( + servicer.UpdateChanStatus, + request_deserializer=router__pb2.UpdateChanStatusRequest.FromString, + response_serializer=router__pb2.UpdateChanStatusResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + "routerrpc.Router", rpc_method_handlers + ) + server.add_generic_rpc_handlers((generic_handler,)) + + +# This class is part of an EXPERIMENTAL API. +class Router(object): + """Router is a service that offers advanced interaction with the router + subsystem of the daemon. + """ + + @staticmethod + def SendPaymentV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SendPaymentV2", + router__pb2.SendPaymentRequest.SerializeToString, + lightning__pb2.Payment.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def TrackPaymentV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/TrackPaymentV2", + router__pb2.TrackPaymentRequest.SerializeToString, + lightning__pb2.Payment.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def EstimateRouteFee( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/EstimateRouteFee", + router__pb2.RouteFeeRequest.SerializeToString, + router__pb2.RouteFeeResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendToRoute( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SendToRoute", + router__pb2.SendToRouteRequest.SerializeToString, + router__pb2.SendToRouteResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendToRouteV2( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SendToRouteV2", + router__pb2.SendToRouteRequest.SerializeToString, + lightning__pb2.HTLCAttempt.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def ResetMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/ResetMissionControl", + router__pb2.ResetMissionControlRequest.SerializeToString, + router__pb2.ResetMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def QueryMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/QueryMissionControl", + router__pb2.QueryMissionControlRequest.SerializeToString, + router__pb2.QueryMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def XImportMissionControl( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/XImportMissionControl", + router__pb2.XImportMissionControlRequest.SerializeToString, + router__pb2.XImportMissionControlResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def GetMissionControlConfig( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/GetMissionControlConfig", + router__pb2.GetMissionControlConfigRequest.SerializeToString, + router__pb2.GetMissionControlConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SetMissionControlConfig( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/SetMissionControlConfig", + router__pb2.SetMissionControlConfigRequest.SerializeToString, + router__pb2.SetMissionControlConfigResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def QueryProbability( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/QueryProbability", + router__pb2.QueryProbabilityRequest.SerializeToString, + router__pb2.QueryProbabilityResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def BuildRoute( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/BuildRoute", + router__pb2.BuildRouteRequest.SerializeToString, + router__pb2.BuildRouteResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SubscribeHtlcEvents( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SubscribeHtlcEvents", + router__pb2.SubscribeHtlcEventsRequest.SerializeToString, + router__pb2.HtlcEvent.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def SendPayment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/SendPayment", + router__pb2.SendPaymentRequest.SerializeToString, + router__pb2.PaymentStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def TrackPayment( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_stream( + request, + target, + "/routerrpc.Router/TrackPayment", + router__pb2.TrackPaymentRequest.SerializeToString, + router__pb2.PaymentStatus.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def HtlcInterceptor( + request_iterator, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.stream_stream( + request_iterator, + target, + "/routerrpc.Router/HtlcInterceptor", + router__pb2.ForwardHtlcInterceptResponse.SerializeToString, + router__pb2.ForwardHtlcInterceptRequest.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) + + @staticmethod + def UpdateChanStatus( + request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None, + ): + return grpc.experimental.unary_unary( + request, + target, + "/routerrpc.Router/UpdateChanStatus", + router__pb2.UpdateChanStatusRequest.SerializeToString, + router__pb2.UpdateChanStatusResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + ) diff --git a/lnbits/wallets/lndgrpc.py b/lnbits/wallets/lndgrpc.py index 7b23414ed..fee8b955a 100644 --- a/lnbits/wallets/lndgrpc.py +++ b/lnbits/wallets/lndgrpc.py @@ -2,10 +2,11 @@ imports_ok = True try: import grpc from google import protobuf + from grpc import RpcError except ImportError: # pragma: nocover imports_ok = False - +import asyncio import base64 import binascii import hashlib @@ -19,6 +20,8 @@ from .macaroon import AESCipher, load_macaroon if imports_ok: import lnbits.wallets.lnd_grpc_files.lightning_pb2 as ln import lnbits.wallets.lnd_grpc_files.lightning_pb2_grpc as lnrpc + import lnbits.wallets.lnd_grpc_files.router_pb2 as router + import lnbits.wallets.lnd_grpc_files.router_pb2_grpc as routerrpc from .base import ( InvoiceResponse, @@ -111,6 +114,7 @@ class LndWallet(Wallet): f"{self.endpoint}:{self.port}", composite_creds ) self.rpc = lnrpc.LightningStub(channel) + self.routerpc = routerrpc.RouterStub(channel) def metadata_callback(self, _, callback): callback([("macaroon", self.macaroon)], None) @@ -118,6 +122,8 @@ class LndWallet(Wallet): async def status(self) -> StatusResponse: try: resp = await self.rpc.ChannelBalance(ln.ChannelBalanceRequest()) + except RpcError as exc: + return StatusResponse(str(exc._details), 0) except Exception as exc: return StatusResponse(str(exc), 0) @@ -132,9 +138,10 @@ class LndWallet(Wallet): params: Dict = {"value": amount, "expiry": 600, "private": True} if description_hash: - params["description_hash"] = base64.b64encode( - hashlib.sha256(description_hash).digest() - ) # as bytes directly + params["description_hash"] = hashlib.sha256( + description_hash + ).digest() # as bytes directly + else: params["memo"] = memo or "" @@ -150,18 +157,39 @@ class LndWallet(Wallet): return InvoiceResponse(True, checking_id, payment_request, None) async def pay_invoice(self, bolt11: str, fee_limit_msat: int) -> PaymentResponse: - fee_limit_fixed = ln.FeeLimit(fixed=fee_limit_msat // 1000) - req = ln.SendRequest(payment_request=bolt11, fee_limit=fee_limit_fixed) - resp = await self.rpc.SendPaymentSync(req) + # fee_limit_fixed = ln.FeeLimit(fixed=fee_limit_msat // 1000) + req = router.SendPaymentRequest( + payment_request=bolt11, + fee_limit_msat=fee_limit_msat, + timeout_seconds=30, + no_inflight_updates=True, + ) + try: + resp = await self.routerpc.SendPaymentV2(req).read() + except RpcError as exc: + return PaymentResponse(False, "", 0, None, exc._details) + except Exception as exc: + return PaymentResponse(False, "", 0, None, str(exc)) - if resp.payment_error: - return PaymentResponse(False, "", 0, None, resp.payment_error) + # PaymentStatus from https://github.com/lightningnetwork/lnd/blob/master/channeldb/payments.go#L178 + statuses = { + 0: None, # NON_EXISTENT + 1: None, # IN_FLIGHT + 2: True, # SUCCEEDED + 3: False, # FAILED + } - r_hash = hashlib.sha256(resp.payment_preimage).digest() - checking_id = stringify_checking_id(r_hash) - fee_msat = resp.payment_route.total_fees_msat - preimage = resp.payment_preimage.hex() - return PaymentResponse(True, checking_id, fee_msat, preimage, None) + if resp.status in [0, 1, 3]: + fee_msat = 0 + preimage = "" + checking_id = "" + elif resp.status == 2: # SUCCEEDED + fee_msat = resp.htlcs[-1].route.total_fees_msat + preimage = resp.payment_preimage + checking_id = resp.payment_hash + return PaymentResponse( + statuses[resp.status], checking_id, fee_msat, preimage, None + ) async def get_invoice_status(self, checking_id: str) -> PaymentStatus: try: @@ -180,20 +208,55 @@ class LndWallet(Wallet): return PaymentStatus(None) async def get_payment_status(self, checking_id: str) -> PaymentStatus: - return PaymentStatus(True) + """ + This routine checks the payment status using routerpc.TrackPaymentV2. + """ + try: + r_hash = parse_checking_id(checking_id) + if len(r_hash) != 32: + raise binascii.Error + except binascii.Error: + # this may happen if we switch between backend wallets + # that use different checking_id formats + return PaymentStatus(None) + + # for some reason our checking_ids are in base64 but the payment hashes + # returned here are in hex, lnd is weird + checking_id = checking_id.replace("_", "/") + checking_id = base64.b64decode(checking_id).hex() + + resp = self.routerpc.TrackPaymentV2( + router.TrackPaymentRequest(payment_hash=r_hash) + ) + + # HTLCAttempt.HTLCStatus: + # https://github.com/lightningnetwork/lnd/blob/master/lnrpc/lightning.proto#L3641 + statuses = { + 0: None, # IN_FLIGHT + 1: True, # "SUCCEEDED" + 2: False, # "FAILED" + } + + try: + async for payment in resp: + return PaymentStatus(statuses[payment.htlcs[-1].status]) + except: # most likely the payment wasn't found + return PaymentStatus(None) + + return PaymentStatus(None) async def paid_invoices_stream(self) -> AsyncGenerator[str, None]: - request = ln.InvoiceSubscription() - try: - async for i in self.rpc.SubscribeInvoices(request): - if not i.settled: - continue + while True: + request = ln.InvoiceSubscription() + try: + async for i in self.rpc.SubscribeInvoices(request): + if not i.settled: + continue - checking_id = stringify_checking_id(i.r_hash) - yield checking_id - except error: - logger.error(error) - - logger.error( - "lost connection to lnd InvoiceSubscription, please restart lnbits." - ) + checking_id = stringify_checking_id(i.r_hash) + yield checking_id + except Exception as exc: + logger.error( + f"lost connection to lnd invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index 220b5baad..9f7f95581 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -142,15 +142,10 @@ class LndRestWallet(Wallet): return PaymentStatus(True) async def get_payment_status(self, checking_id: str) -> PaymentStatus: - async with httpx.AsyncClient(verify=self.cert) as client: - r = await client.get( - url=f"{self.endpoint}/v1/payments", - headers=self.auth, - params={"max_payments": "20", "reversed": True}, - ) - - if r.is_error: - return PaymentStatus(None) + """ + This routine checks the payment status using routerpc.TrackPaymentV2. + """ + url = f"{self.endpoint}/v2/router/track/{checking_id}" # check payment.status: # https://api.lightning.community/rest/index.html?python#peersynctype @@ -161,14 +156,27 @@ class LndRestWallet(Wallet): "FAILED": False, } - # for some reason our checking_ids are in base64 but the payment hashes - # returned here are in hex, lnd is weird - checking_id = checking_id.replace("_", "/") - checking_id = base64.b64decode(checking_id).hex() - - for p in r.json()["payments"]: - if p["payment_hash"] == checking_id: - return PaymentStatus(statuses[p["status"]]) + async with httpx.AsyncClient( + timeout=None, headers=self.auth, verify=self.cert + ) as client: + async with client.stream("GET", url) as r: + async for l in r.aiter_lines(): + try: + line = json.loads(l) + if line.get("error"): + logger.error( + line["error"]["message"] + if "message" in line["error"] + else line["error"] + ) + return PaymentStatus(None) + payment = line.get("result") + if payment is not None and payment.get("status"): + return PaymentStatus(statuses[payment["status"]]) + else: + return PaymentStatus(None) + except: + continue return PaymentStatus(None) @@ -191,10 +199,8 @@ class LndRestWallet(Wallet): payment_hash = base64.b64decode(inv["r_hash"]).hex() yield payment_hash - except (OSError, httpx.ConnectError, httpx.ReadError): - pass - - logger.error( - "lost connection to lnd invoices stream, retrying in 5 seconds" - ) - await asyncio.sleep(5) + except Exception as exc: + logger.error( + f"lost connection to lnd invoices stream: '{exc}', retrying in 5 seconds" + ) + await asyncio.sleep(5) From 05edd908f065584f9963d43cfc07bcdf8a9914e3 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Tue, 9 Aug 2022 12:48:10 +0200 Subject: [PATCH 214/421] fix lnurlw balance_check (#854) --- lnbits/core/views/api.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index 8f9af8518..ac61e52fd 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -186,11 +186,6 @@ async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet): if data.lnurl_callback: if data.lnurl_balance_check is not None: await save_balance_check(wallet.id, data.lnurl_balance_check) - else: - raise HTTPException( - status_code=HTTPStatus.BAD_REQUEST, - detail="lnurl_balance_check not set.", - ) async with httpx.AsyncClient() as client: try: From 8dfb4329d10eaa0813b35e08985f7c50fc4e4eeb Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Wed, 10 Aug 2022 10:32:43 +0200 Subject: [PATCH 215/421] ssl cert creation method using openssl (#860) --- docs/guide/installation.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 4bb5539da..d9b8d5d27 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -232,16 +232,22 @@ chmod +x mkcert-v*-linux-amd64 sudo cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert ``` #### Create certificate -To create a certificate, first `cd` into your lnbits folder and execute the following command ([more info](https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/)) +To create a certificate, first `cd` into your LNbits folder and execute the following command on Linux: +```sh +openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem +``` +This will create two new files (`key.pem` and `cert.pem `). + +Alternatively, you can use mkcert ([more info](https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/)): ```sh # add your local IP (192.x.x.x) as well if you want to use it in your local network mkcert localhost 127.0.0.1 ::1 ``` -This will create two new files (`localhost-key.pem` and `localhost.pem `) which you can then pass to uvicorn when you start LNbits: +You can then pass the certificate files to uvicorn when you start LNbits: ```sh -./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5000 --ssl-keyfile ./localhost-key.pem --ssl-certfile ./localhost.pem +./venv/bin/uvicorn lnbits.__main__:app --host 0.0.0.0 --port 5000 --ssl-keyfile ./key.pem --ssl-certfile ./cert.pem ``` From 6d4116b04903f0fd3c1ffee190c29a1f72b1937b Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 10 Aug 2022 16:53:39 +0300 Subject: [PATCH 216/421] feat: working version. commit not to lose --- .../components/serial-signer/serial-signer.js | 45 +- .../components/wallet-config/wallet-config.js | 119 ++ .../watchonly/static/js/crypto/aes.js | 803 +++++++++++ .../static/js/crypto/noble-secp256k1.js | 1177 +++++++++++++++++ .../extensions/watchonly/static/js/utils.js | 156 +++ .../watchonly/templates/watchonly/index.html | 2 + 6 files changed, 2299 insertions(+), 3 deletions(-) create mode 100644 lnbits/extensions/watchonly/static/js/crypto/aes.js create mode 100644 lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index b12550319..f756eaaa3 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -70,6 +70,7 @@ async function serialSigner(path) { navigator.serial.addEventListener('disconnect', () => { console.log('### navigator.serial event: disconnected!', event) + this.selectedPort = null this.hww.authenticated = false this.$q.notify({ type: 'warning', @@ -113,14 +114,12 @@ async function serialSigner(path) { /* Ignore the error */ }) if (this.selectedPort) await this.selectedPort.close() - this.selectedPort = null this.$q.notify({ type: 'positive', message: 'Serial port disconnected!', timeout: 5000 }) } catch (error) { - this.selectedPort = null this.$q.notify({ type: 'warning', message: 'Cannot close serial port!', @@ -128,6 +127,7 @@ async function serialSigner(path) { timeout: 10000 }) } finally { + this.selectedPort = null this.hww.authenticated = false } }, @@ -442,8 +442,47 @@ async function serialSigner(path) { }) }, hwwHelp: async function () { + const sharedSecret = + 'f96c85875055a5586688fea4cf7c4a2bd9541ffcf34f9d663d97e0cf2f6af4af' + const sharedSecretBytes = hexToBytes(sharedSecret) + console.log('### sharedSecret', sharedSecret) + const key = await window.crypto.subtle.importKey( + 'raw', + sharedSecretBytes, + { + name: 'AES-CBC', + length: 256 + }, + true, + ['encrypt', 'decrypt'] + ) + // d2b9e5e3ff8945236455424e9e25590b8264f13c7484862cca4f5b7b8bf8f1686d218b4f1aacdc27a1df71fa4b530adfd6c8cae6bd926d3f8be8ff55ee4358d1a32569e9f5263ffae7d0eaf413788498 + // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + // 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 + // 8f13a7763f021d7701f4100631f6c3d80576fcd0e3718b2594ceb7b910ceed29a334d1019dd6f0ffdba5b6be8c11637d6124d7adbd29c88af13800cb1f980f7d + + const message = + 'TextMustBe16ByteTextMustBe16ByteTextMustBe16ByteTextMustBe16Byte' + const encoded = asciiToUint8Array(message) + const encrypted = await encryptMessage(key, encoded) + const encryptedHex = bytesToHex(encrypted) + console.log('### encrypted hex: ', encryptedHex) + + const encryptedHex2 = await encryptMessage2(sharedSecretBytes, message) + console.log('### encryptedHex2', encryptedHex2) + + const decrypted = await decryptMessage(key, encrypted) + console.log( + '### decrypted hex: ', + bytesToHex(new Uint8Array(decrypted)) + ) + console.log( + '### decrypted ascii: ', + new TextDecoder().decode(new Uint8Array(decrypted)) + ) + try { - await this.writer.write(COMMAND_HELP + '\n') + await this.writer.write(COMMAND_HELP + ' ' + encryptedHex + '\n') this.$q.notify({ type: 'positive', message: 'Check display or console for details!', diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js index 447dc65c7..5ce63c796 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js @@ -58,10 +58,129 @@ async function walletConfig(path) { } catch (error) { LNbits.utils.notifyApiError(error) } + }, + deriveSecretKey: async function (privateKey, publicKey) { + return window.crypto.subtle.deriveKey( + { + name: 'ECDH', + public: publicKey + }, + privateKey, + { + name: 'AES-GCM', + length: 256 + }, + true, + ['encrypt', 'decrypt'] + ) + }, + old: async function () { + const alicesKeyPair = await window.crypto.subtle.generateKey( + { + name: 'ECDH', + namedCurve: 'P-256' + }, + true, + ['deriveKey'] + ) + const bobsKeyPair = await window.crypto.subtle.generateKey( + { + name: 'ECDH', + namedCurve: 'P-256' + }, + true, + ['deriveKey'] + ) + console.log('### alicesKeyPair', alicesKeyPair) + console.log('### alicesKeyPair.privateKey', alicesKeyPair.privateKey) + console.log('### alicesKeyPair.publicKey', alicesKeyPair.publicKey) + const alicesPriveKey = await window.crypto.subtle.exportKey( + 'jwk', + alicesKeyPair.privateKey + ) + console.log('### alicesPriveKey', alicesPriveKey) + + const alicesPriveKeyBase64 = toStdBase64(alicesPriveKey.d) + console.log( + '### alicesPriveKeyBase64', + alicesPriveKeyBase64, + base64ToHex(alicesPriveKeyBase64) + ) + + const bobPublicKey = await window.crypto.subtle.exportKey( + 'raw', + bobsKeyPair.publicKey + ) + console.log('### bobPublicKey hex', buf2hex(bobPublicKey)) + + // const sharedSecret01 = await this.deriveSecretKey(alicesKeyPair.privateKey, bobsKeyPair.publicKey) + // console.log('### sharedSecret01', sharedSecret01) + // const sharedSecret01Raw = await window.crypto.subtle.exportKey('jwk', sharedSecret01) + // console.log('### sharedSecret01Raw', sharedSecret01Raw) + + // const sharedSecret02 = await this.deriveSecretKey(bobsKeyPair.privateKey, alicesKeyPair.publicKey) + // console.log('### sharedSecret02', sharedSecret02) + // const sharedSecret02Raw = await window.crypto.subtle.exportKey('jwk', sharedSecret02) + // console.log('### sharedSecret02Raw', sharedSecret02Raw) + + const sharedSecret = nobleSecp256k1.getSharedSecret( + alicesPriveKey, + buf2hex(bobPublicKey) + ) + console.log('###', getSharedSecret) + }, + importSecretKey: async function (rawKey) { + return window.crypto.subtle.importKey('raw', rawKey, 'AES-GCM', true, [ + 'encrypt', + 'decrypt' + ]) } }, + created: async function () { await this.getConfig() + // ### in: 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 + // ### in2: 073059e23605fe508919d892501974905f8b5e13728db63b1b7b9326951abbe4f722c104bc82a4bcf3f1e15ede8ab7d5eb00be8c46271e1f65867f984e9cb5f1 + + const alicesPrivateKey = + '359A8CA1418C49DD26DC7D92C789AC33347F64C6B7789C666098805AF3CC60E5' + + const bobsPrivateKey = + 'AB52F1F981F639BD83F884703BC690B10DB709FF48806680A0D3FBC6475E6093' + + const alicesPublicKey = nobleSecp256k1.Point.fromPrivateKey( + alicesPrivateKey + ) + console.log('### alicesPublicKey', alicesPublicKey.toHex()) + + const bobsPublicKey = nobleSecp256k1.Point.fromPrivateKey(bobsPrivateKey) + console.log('### bobsPublicKey', bobsPublicKey.toHex()) + + const sharedSecret = nobleSecp256k1.getSharedSecret( + alicesPrivateKey, + bobsPublicKey + ) + + console.log('### sharedSecret naked', sharedSecret) + + console.log( + '### sharedSecret a', + nobleSecp256k1.utils.bytesToHex(sharedSecret) + ) + console.log( + '### sharedSecret b', + nobleSecp256k1.Point.fromHex(sharedSecret) + ) + console.log( + '### sharedSecret b', + nobleSecp256k1.Point.fromHex(sharedSecret).toHex(true) + ) + + const alicesPrivateKeyBytes = nobleSecp256k1.utils.hexToBytes( + alicesPrivateKey + ) + const x = await this.importSecretKey(alicesPrivateKeyBytes) + console.log('### x', x) } }) } diff --git a/lnbits/extensions/watchonly/static/js/crypto/aes.js b/lnbits/extensions/watchonly/static/js/crypto/aes.js new file mode 100644 index 000000000..2f6ef7607 --- /dev/null +++ b/lnbits/extensions/watchonly/static/js/crypto/aes.js @@ -0,0 +1,803 @@ +/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ +(function(root) { + "use strict"; + + function checkInt(value) { + return (parseInt(value) === value); + } + + function checkInts(arrayish) { + if (!checkInt(arrayish.length)) { return false; } + + for (var i = 0; i < arrayish.length; i++) { + if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) { + return false; + } + } + + return true; + } + + function coerceArray(arg, copy) { + + // ArrayBuffer view + if (arg.buffer && arg.name === 'Uint8Array') { + + if (copy) { + if (arg.slice) { + arg = arg.slice(); + } else { + arg = Array.prototype.slice.call(arg); + } + } + + return arg; + } + + // It's an array; check it is a valid representation of a byte + if (Array.isArray(arg)) { + if (!checkInts(arg)) { + throw new Error('Array contains invalid value: ' + arg); + } + + return new Uint8Array(arg); + } + + // Something else, but behaves like an array (maybe a Buffer? Arguments?) + if (checkInt(arg.length) && checkInts(arg)) { + return new Uint8Array(arg); + } + + throw new Error('unsupported array-like object'); + } + + function createArray(length) { + return new Uint8Array(length); + } + + function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) { + if (sourceStart != null || sourceEnd != null) { + if (sourceArray.slice) { + sourceArray = sourceArray.slice(sourceStart, sourceEnd); + } else { + sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd); + } + } + targetArray.set(sourceArray, targetStart); + } + + + + var convertUtf8 = (function() { + function toBytes(text) { + var result = [], i = 0; + text = encodeURI(text); + while (i < text.length) { + var c = text.charCodeAt(i++); + + // if it is a % sign, encode the following 2 bytes as a hex value + if (c === 37) { + result.push(parseInt(text.substr(i, 2), 16)) + i += 2; + + // otherwise, just the actual byte + } else { + result.push(c) + } + } + + return coerceArray(result); + } + + function fromBytes(bytes) { + var result = [], i = 0; + + while (i < bytes.length) { + var c = bytes[i]; + + if (c < 128) { + result.push(String.fromCharCode(c)); + i++; + } else if (c > 191 && c < 224) { + result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f))); + i += 2; + } else { + result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f))); + i += 3; + } + } + + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + var convertHex = (function() { + function toBytes(text) { + var result = []; + for (var i = 0; i < text.length; i += 2) { + result.push(parseInt(text.substr(i, 2), 16)); + } + + return result; + } + + // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html + var Hex = '0123456789abcdef'; + + function fromBytes(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i++) { + var v = bytes[i]; + result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]); + } + return result.join(''); + } + + return { + toBytes: toBytes, + fromBytes: fromBytes, + } + })(); + + + // Number of rounds by keysize + var numberOfRounds = {16: 10, 24: 12, 32: 14} + + // Round constant words + var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91]; + + // S-box and Inverse S-box (S is for Substitution) + var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]; + var Si =[0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]; + + // Transformations for encryption + var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a]; + var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616]; + var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16]; + var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c]; + + // Transformations for decryption + var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742]; + var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857]; + var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8]; + var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0]; + + // Transformations for decryption key expansion + var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]; + var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697]; + var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46]; + var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d]; + + function convertToInt32(bytes) { + var result = []; + for (var i = 0; i < bytes.length; i += 4) { + result.push( + (bytes[i ] << 24) | + (bytes[i + 1] << 16) | + (bytes[i + 2] << 8) | + bytes[i + 3] + ); + } + return result; + } + + var AES = function(key) { + if (!(this instanceof AES)) { + throw Error('AES must be instanitated with `new`'); + } + + Object.defineProperty(this, 'key', { + value: coerceArray(key, true) + }); + + this._prepare(); + } + + + AES.prototype._prepare = function() { + + var rounds = numberOfRounds[this.key.length]; + if (rounds == null) { + throw new Error('invalid key size (must be 16, 24 or 32 bytes)'); + } + + // encryption round keys + this._Ke = []; + + // decryption round keys + this._Kd = []; + + for (var i = 0; i <= rounds; i++) { + this._Ke.push([0, 0, 0, 0]); + this._Kd.push([0, 0, 0, 0]); + } + + var roundKeyCount = (rounds + 1) * 4; + var KC = this.key.length / 4; + + // convert the key into ints + var tk = convertToInt32(this.key); + + // copy values into round key arrays + var index; + for (var i = 0; i < KC; i++) { + index = i >> 2; + this._Ke[index][i % 4] = tk[i]; + this._Kd[rounds - index][i % 4] = tk[i]; + } + + // key expansion (fips-197 section 5.2) + var rconpointer = 0; + var t = KC, tt; + while (t < roundKeyCount) { + tt = tk[KC - 1]; + tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^ + (S[(tt >> 8) & 0xFF] << 16) ^ + (S[ tt & 0xFF] << 8) ^ + S[(tt >> 24) & 0xFF] ^ + (rcon[rconpointer] << 24)); + rconpointer += 1; + + // key expansion (for non-256 bit) + if (KC != 8) { + for (var i = 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + + // key expansion for 256-bit keys is "slightly different" (fips-197) + } else { + for (var i = 1; i < (KC / 2); i++) { + tk[i] ^= tk[i - 1]; + } + tt = tk[(KC / 2) - 1]; + + tk[KC / 2] ^= (S[ tt & 0xFF] ^ + (S[(tt >> 8) & 0xFF] << 8) ^ + (S[(tt >> 16) & 0xFF] << 16) ^ + (S[(tt >> 24) & 0xFF] << 24)); + + for (var i = (KC / 2) + 1; i < KC; i++) { + tk[i] ^= tk[i - 1]; + } + } + + // copy values into round key arrays + var i = 0, r, c; + while (i < KC && t < roundKeyCount) { + r = t >> 2; + c = t % 4; + this._Ke[r][c] = tk[i]; + this._Kd[rounds - r][c] = tk[i++]; + t++; + } + } + + // inverse-cipher-ify the decryption round key (fips-197 section 5.3) + for (var r = 1; r < rounds; r++) { + for (var c = 0; c < 4; c++) { + tt = this._Kd[r][c]; + this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^ + U2[(tt >> 16) & 0xFF] ^ + U3[(tt >> 8) & 0xFF] ^ + U4[ tt & 0xFF]); + } + } + } + + AES.prototype.encrypt = function(plaintext) { + if (plaintext.length != 16) { + throw new Error('invalid plaintext size (must be 16 bytes)'); + } + + var rounds = this._Ke.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(plaintext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Ke[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T1[(t[ i ] >> 24) & 0xff] ^ + T2[(t[(i + 1) % 4] >> 16) & 0xff] ^ + T3[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T4[ t[(i + 3) % 4] & 0xff] ^ + this._Ke[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Ke[rounds][i]; + result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + } + + AES.prototype.decrypt = function(ciphertext) { + if (ciphertext.length != 16) { + throw new Error('invalid ciphertext size (must be 16 bytes)'); + } + + var rounds = this._Kd.length - 1; + var a = [0, 0, 0, 0]; + + // convert plaintext to (ints ^ key) + var t = convertToInt32(ciphertext); + for (var i = 0; i < 4; i++) { + t[i] ^= this._Kd[0][i]; + } + + // apply round transforms + for (var r = 1; r < rounds; r++) { + for (var i = 0; i < 4; i++) { + a[i] = (T5[(t[ i ] >> 24) & 0xff] ^ + T6[(t[(i + 3) % 4] >> 16) & 0xff] ^ + T7[(t[(i + 2) % 4] >> 8) & 0xff] ^ + T8[ t[(i + 1) % 4] & 0xff] ^ + this._Kd[r][i]); + } + t = a.slice(); + } + + // the last round is special + var result = createArray(16), tt; + for (var i = 0; i < 4; i++) { + tt = this._Kd[rounds][i]; + result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff; + result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff; + result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff; + result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff; + } + + return result; + } + + + /** + * Mode Of Operation - Electonic Codebook (ECB) + */ + var ModeOfOperationECB = function(key) { + if (!(this instanceof ModeOfOperationECB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Electronic Code Block"; + this.name = "ecb"; + + this._aes = new AES(key); + } + + ModeOfOperationECB.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + block = this._aes.encrypt(block); + copyArray(block, ciphertext, i); + } + + return ciphertext; + } + + ModeOfOperationECB.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + copyArray(block, plaintext, i); + } + + return plaintext; + } + + + /** + * Mode Of Operation - Cipher Block Chaining (CBC) + */ + var ModeOfOperationCBC = function(key, iv) { + if (!(this instanceof ModeOfOperationCBC)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Block Chaining"; + this.name = "cbc"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastCipherblock = coerceArray(iv, true); + + this._aes = new AES(key); + } + + ModeOfOperationCBC.prototype.encrypt = function(plaintext) { + plaintext = coerceArray(plaintext); + + if ((plaintext.length % 16) !== 0) { + throw new Error('invalid plaintext size (must be multiple of 16 bytes)'); + } + + var ciphertext = createArray(plaintext.length); + var block = createArray(16); + + for (var i = 0; i < plaintext.length; i += 16) { + copyArray(plaintext, block, 0, i, i + 16); + + for (var j = 0; j < 16; j++) { + block[j] ^= this._lastCipherblock[j]; + } + + this._lastCipherblock = this._aes.encrypt(block); + copyArray(this._lastCipherblock, ciphertext, i); + } + + return ciphertext; + } + + ModeOfOperationCBC.prototype.decrypt = function(ciphertext) { + ciphertext = coerceArray(ciphertext); + + if ((ciphertext.length % 16) !== 0) { + throw new Error('invalid ciphertext size (must be multiple of 16 bytes)'); + } + + var plaintext = createArray(ciphertext.length); + var block = createArray(16); + + for (var i = 0; i < ciphertext.length; i += 16) { + copyArray(ciphertext, block, 0, i, i + 16); + block = this._aes.decrypt(block); + + for (var j = 0; j < 16; j++) { + plaintext[i + j] = block[j] ^ this._lastCipherblock[j]; + } + + copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16); + } + + return plaintext; + } + + + /** + * Mode Of Operation - Cipher Feedback (CFB) + */ + var ModeOfOperationCFB = function(key, iv, segmentSize) { + if (!(this instanceof ModeOfOperationCFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Cipher Feedback"; + this.name = "cfb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 size)'); + } + + if (!segmentSize) { segmentSize = 1; } + + this.segmentSize = segmentSize; + + this._shiftRegister = coerceArray(iv, true); + + this._aes = new AES(key); + } + + ModeOfOperationCFB.prototype.encrypt = function(plaintext) { + if ((plaintext.length % this.segmentSize) != 0) { + throw new Error('invalid plaintext size (must be segmentSize bytes)'); + } + + var encrypted = coerceArray(plaintext, true); + + var xorSegment; + for (var i = 0; i < encrypted.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + for (var j = 0; j < this.segmentSize; j++) { + encrypted[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return encrypted; + } + + ModeOfOperationCFB.prototype.decrypt = function(ciphertext) { + if ((ciphertext.length % this.segmentSize) != 0) { + throw new Error('invalid ciphertext size (must be segmentSize bytes)'); + } + + var plaintext = coerceArray(ciphertext, true); + + var xorSegment; + for (var i = 0; i < plaintext.length; i += this.segmentSize) { + xorSegment = this._aes.encrypt(this._shiftRegister); + + for (var j = 0; j < this.segmentSize; j++) { + plaintext[i + j] ^= xorSegment[j]; + } + + // Shift the register + copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize); + copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize); + } + + return plaintext; + } + + /** + * Mode Of Operation - Output Feedback (OFB) + */ + var ModeOfOperationOFB = function(key, iv) { + if (!(this instanceof ModeOfOperationOFB)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Output Feedback"; + this.name = "ofb"; + + if (!iv) { + iv = createArray(16); + + } else if (iv.length != 16) { + throw new Error('invalid initialation vector size (must be 16 bytes)'); + } + + this._lastPrecipher = coerceArray(iv, true); + this._lastPrecipherIndex = 16; + + this._aes = new AES(key); + } + + ModeOfOperationOFB.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._lastPrecipherIndex === 16) { + this._lastPrecipher = this._aes.encrypt(this._lastPrecipher); + this._lastPrecipherIndex = 0; + } + encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++]; + } + + return encrypted; + } + + // Decryption is symetric + ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt; + + + /** + * Counter object for CTR common mode of operation + */ + var Counter = function(initialValue) { + if (!(this instanceof Counter)) { + throw Error('Counter must be instanitated with `new`'); + } + + // We allow 0, but anything false-ish uses the default 1 + if (initialValue !== 0 && !initialValue) { initialValue = 1; } + + if (typeof(initialValue) === 'number') { + this._counter = createArray(16); + this.setValue(initialValue); + + } else { + this.setBytes(initialValue); + } + } + + Counter.prototype.setValue = function(value) { + if (typeof(value) !== 'number' || parseInt(value) != value) { + throw new Error('invalid counter value (must be an integer)'); + } + + // We cannot safely handle numbers beyond the safe range for integers + if (value > Number.MAX_SAFE_INTEGER) { + throw new Error('integer value out of safe range'); + } + + for (var index = 15; index >= 0; --index) { + this._counter[index] = value % 256; + value = parseInt(value / 256); + } + } + + Counter.prototype.setBytes = function(bytes) { + bytes = coerceArray(bytes, true); + + if (bytes.length != 16) { + throw new Error('invalid counter bytes size (must be 16 bytes)'); + } + + this._counter = bytes; + }; + + Counter.prototype.increment = function() { + for (var i = 15; i >= 0; i--) { + if (this._counter[i] === 255) { + this._counter[i] = 0; + } else { + this._counter[i]++; + break; + } + } + } + + + /** + * Mode Of Operation - Counter (CTR) + */ + var ModeOfOperationCTR = function(key, counter) { + if (!(this instanceof ModeOfOperationCTR)) { + throw Error('AES must be instanitated with `new`'); + } + + this.description = "Counter"; + this.name = "ctr"; + + if (!(counter instanceof Counter)) { + counter = new Counter(counter) + } + + this._counter = counter; + + this._remainingCounter = null; + this._remainingCounterIndex = 16; + + this._aes = new AES(key); + } + + ModeOfOperationCTR.prototype.encrypt = function(plaintext) { + var encrypted = coerceArray(plaintext, true); + + for (var i = 0; i < encrypted.length; i++) { + if (this._remainingCounterIndex === 16) { + this._remainingCounter = this._aes.encrypt(this._counter._counter); + this._remainingCounterIndex = 0; + this._counter.increment(); + } + encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++]; + } + + return encrypted; + } + + // Decryption is symetric + ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt; + + + /////////////////////// + // Padding + + // See:https://tools.ietf.org/html/rfc2315 + function pkcs7pad(data) { + data = coerceArray(data, true); + var padder = 16 - (data.length % 16); + var result = createArray(data.length + padder); + copyArray(data, result); + for (var i = data.length; i < result.length; i++) { + result[i] = padder; + } + return result; + } + + function pkcs7strip(data) { + data = coerceArray(data, true); + if (data.length < 16) { throw new Error('PKCS#7 invalid length'); } + + var padder = data[data.length - 1]; + if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); } + + var length = data.length - padder; + for (var i = 0; i < padder; i++) { + if (data[length + i] !== padder) { + throw new Error('PKCS#7 invalid padding byte'); + } + } + + var result = createArray(length); + copyArray(data, result, 0, 0, length); + return result; + } + + /////////////////////// + // Exporting + + + // The block cipher + var aesjs = { + AES: AES, + Counter: Counter, + + ModeOfOperation: { + ecb: ModeOfOperationECB, + cbc: ModeOfOperationCBC, + cfb: ModeOfOperationCFB, + ofb: ModeOfOperationOFB, + ctr: ModeOfOperationCTR + }, + + utils: { + hex: convertHex, + utf8: convertUtf8 + }, + + padding: { + pkcs7: { + pad: pkcs7pad, + strip: pkcs7strip + } + }, + + _arrayTest: { + coerceArray: coerceArray, + createArray: createArray, + copyArray: copyArray, + } + }; + + + // node.js + if (typeof exports !== 'undefined') { + module.exports = aesjs + + // RequireJS/AMD + // http://www.requirejs.org/docs/api.html + // https://github.com/amdjs/amdjs-api/wiki/AMD + } else if (typeof(define) === 'function' && define.amd) { + define([], function() { return aesjs; }); + + // Web Browsers + } else { + + // If there was an existing library at "aesjs" make sure it's still available + if (root.aesjs) { + aesjs._aesjs = root.aesjs; + } + + root.aesjs = aesjs; + } + + +})(this); \ No newline at end of file diff --git a/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js b/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js new file mode 100644 index 000000000..8be867293 --- /dev/null +++ b/lnbits/extensions/watchonly/static/js/crypto/noble-secp256k1.js @@ -0,0 +1,1177 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.nobleSecp256k1 = {})); +})(this, (function (exports) { 'use strict'; + + const _nodeResolve_empty = {}; + + const nodeCrypto = /*#__PURE__*/Object.freeze({ + __proto__: null, + 'default': _nodeResolve_empty + }); + + /*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */ + const _0n = BigInt(0); + const _1n = BigInt(1); + const _2n = BigInt(2); + const _3n = BigInt(3); + const _8n = BigInt(8); + const POW_2_256 = _2n ** BigInt(256); + const CURVE = { + a: _0n, + b: BigInt(7), + P: POW_2_256 - _2n ** BigInt(32) - BigInt(977), + n: POW_2_256 - BigInt('432420386565659656852420866394968145599'), + h: _1n, + Gx: BigInt('55066263022277343669578718895168534326250603453777594175500187360389116729240'), + Gy: BigInt('32670510020758816978083085130507043184471273380659243275938904335757337482424'), + beta: BigInt('0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee'), + }; + function weistrass(x) { + const { a, b } = CURVE; + const x2 = mod(x * x); + const x3 = mod(x2 * x); + return mod(x3 + a * x + b); + } + const USE_ENDOMORPHISM = CURVE.a === _0n; + class JacobianPoint { + constructor(x, y, z) { + this.x = x; + this.y = y; + this.z = z; + } + static fromAffine(p) { + if (!(p instanceof Point)) { + throw new TypeError('JacobianPoint#fromAffine: expected Point'); + } + return new JacobianPoint(p.x, p.y, _1n); + } + static toAffineBatch(points) { + const toInv = invertBatch(points.map((p) => p.z)); + return points.map((p, i) => p.toAffine(toInv[i])); + } + static normalizeZ(points) { + return JacobianPoint.toAffineBatch(points).map(JacobianPoint.fromAffine); + } + equals(other) { + if (!(other instanceof JacobianPoint)) + throw new TypeError('JacobianPoint expected'); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + const Z1Z1 = mod(Z1 ** _2n); + const Z2Z2 = mod(Z2 ** _2n); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + return U1 === U2 && S1 === S2; + } + negate() { + return new JacobianPoint(this.x, mod(-this.y), this.z); + } + double() { + const { x: X1, y: Y1, z: Z1 } = this; + const A = mod(X1 ** _2n); + const B = mod(Y1 ** _2n); + const C = mod(B ** _2n); + const D = mod(_2n * (mod((X1 + B) ** _2n) - A - C)); + const E = mod(_3n * A); + const F = mod(E ** _2n); + const X3 = mod(F - _2n * D); + const Y3 = mod(E * (D - X3) - _8n * C); + const Z3 = mod(_2n * Y1 * Z1); + return new JacobianPoint(X3, Y3, Z3); + } + add(other) { + if (!(other instanceof JacobianPoint)) + throw new TypeError('JacobianPoint expected'); + const { x: X1, y: Y1, z: Z1 } = this; + const { x: X2, y: Y2, z: Z2 } = other; + if (X2 === _0n || Y2 === _0n) + return this; + if (X1 === _0n || Y1 === _0n) + return other; + const Z1Z1 = mod(Z1 ** _2n); + const Z2Z2 = mod(Z2 ** _2n); + const U1 = mod(X1 * Z2Z2); + const U2 = mod(X2 * Z1Z1); + const S1 = mod(mod(Y1 * Z2) * Z2Z2); + const S2 = mod(mod(Y2 * Z1) * Z1Z1); + const H = mod(U2 - U1); + const r = mod(S2 - S1); + if (H === _0n) { + if (r === _0n) { + return this.double(); + } + else { + return JacobianPoint.ZERO; + } + } + const HH = mod(H ** _2n); + const HHH = mod(H * HH); + const V = mod(U1 * HH); + const X3 = mod(r ** _2n - HHH - _2n * V); + const Y3 = mod(r * (V - X3) - S1 * HHH); + const Z3 = mod(Z1 * Z2 * H); + return new JacobianPoint(X3, Y3, Z3); + } + subtract(other) { + return this.add(other.negate()); + } + multiplyUnsafe(scalar) { + const P0 = JacobianPoint.ZERO; + if (typeof scalar === 'bigint' && scalar === _0n) + return P0; + let n = normalizeScalar(scalar); + if (n === _1n) + return this; + if (!USE_ENDOMORPHISM) { + let p = P0; + let d = this; + while (n > _0n) { + if (n & _1n) + p = p.add(d); + d = d.double(); + n >>= _1n; + } + return p; + } + let { k1neg, k1, k2neg, k2 } = splitScalarEndo(n); + let k1p = P0; + let k2p = P0; + let d = this; + while (k1 > _0n || k2 > _0n) { + if (k1 & _1n) + k1p = k1p.add(d); + if (k2 & _1n) + k2p = k2p.add(d); + d = d.double(); + k1 >>= _1n; + k2 >>= _1n; + } + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new JacobianPoint(mod(k2p.x * CURVE.beta), k2p.y, k2p.z); + return k1p.add(k2p); + } + precomputeWindow(W) { + const windows = USE_ENDOMORPHISM ? 128 / W + 1 : 256 / W + 1; + const points = []; + let p = this; + let base = p; + for (let window = 0; window < windows; window++) { + base = p; + points.push(base); + for (let i = 1; i < 2 ** (W - 1); i++) { + base = base.add(p); + points.push(base); + } + p = base.double(); + } + return points; + } + wNAF(n, affinePoint) { + if (!affinePoint && this.equals(JacobianPoint.BASE)) + affinePoint = Point.BASE; + const W = (affinePoint && affinePoint._WINDOW_SIZE) || 1; + if (256 % W) { + throw new Error('Point#wNAF: Invalid precomputation window, must be power of 2'); + } + let precomputes = affinePoint && pointPrecomputes.get(affinePoint); + if (!precomputes) { + precomputes = this.precomputeWindow(W); + if (affinePoint && W !== 1) { + precomputes = JacobianPoint.normalizeZ(precomputes); + pointPrecomputes.set(affinePoint, precomputes); + } + } + let p = JacobianPoint.ZERO; + let f = JacobianPoint.ZERO; + const windows = 1 + (USE_ENDOMORPHISM ? 128 / W : 256 / W); + const windowSize = 2 ** (W - 1); + const mask = BigInt(2 ** W - 1); + const maxNumber = 2 ** W; + const shiftBy = BigInt(W); + for (let window = 0; window < windows; window++) { + const offset = window * windowSize; + let wbits = Number(n & mask); + n >>= shiftBy; + if (wbits > windowSize) { + wbits -= maxNumber; + n += _1n; + } + if (wbits === 0) { + let pr = precomputes[offset]; + if (window % 2) + pr = pr.negate(); + f = f.add(pr); + } + else { + let cached = precomputes[offset + Math.abs(wbits) - 1]; + if (wbits < 0) + cached = cached.negate(); + p = p.add(cached); + } + } + return { p, f }; + } + multiply(scalar, affinePoint) { + let n = normalizeScalar(scalar); + let point; + let fake; + if (USE_ENDOMORPHISM) { + const { k1neg, k1, k2neg, k2 } = splitScalarEndo(n); + let { p: k1p, f: f1p } = this.wNAF(k1, affinePoint); + let { p: k2p, f: f2p } = this.wNAF(k2, affinePoint); + if (k1neg) + k1p = k1p.negate(); + if (k2neg) + k2p = k2p.negate(); + k2p = new JacobianPoint(mod(k2p.x * CURVE.beta), k2p.y, k2p.z); + point = k1p.add(k2p); + fake = f1p.add(f2p); + } + else { + const { p, f } = this.wNAF(n, affinePoint); + point = p; + fake = f; + } + return JacobianPoint.normalizeZ([point, fake])[0]; + } + toAffine(invZ = invert(this.z)) { + const { x, y, z } = this; + const iz1 = invZ; + const iz2 = mod(iz1 * iz1); + const iz3 = mod(iz2 * iz1); + const ax = mod(x * iz2); + const ay = mod(y * iz3); + const zz = mod(z * iz1); + if (zz !== _1n) + throw new Error('invZ was invalid'); + return new Point(ax, ay); + } + } + JacobianPoint.BASE = new JacobianPoint(CURVE.Gx, CURVE.Gy, _1n); + JacobianPoint.ZERO = new JacobianPoint(_0n, _1n, _0n); + const pointPrecomputes = new WeakMap(); + class Point { + constructor(x, y) { + this.x = x; + this.y = y; + } + _setWindowSize(windowSize) { + this._WINDOW_SIZE = windowSize; + pointPrecomputes.delete(this); + } + static fromCompressedHex(bytes) { + const isShort = bytes.length === 32; + const x = bytesToNumber(isShort ? bytes : bytes.subarray(1)); + if (!isValidFieldElement(x)) + throw new Error('Point is not on curve'); + const y2 = weistrass(x); + let y = sqrtMod(y2); + const isYOdd = (y & _1n) === _1n; + if (isShort) { + if (isYOdd) + y = mod(-y); + } + else { + const isFirstByteOdd = (bytes[0] & 1) === 1; + if (isFirstByteOdd !== isYOdd) + y = mod(-y); + } + const point = new Point(x, y); + point.assertValidity(); + return point; + } + static fromUncompressedHex(bytes) { + const x = bytesToNumber(bytes.subarray(1, 33)); + const y = bytesToNumber(bytes.subarray(33, 65)); + const point = new Point(x, y); + point.assertValidity(); + return point; + } + static fromHex(hex) { + const bytes = ensureBytes(hex); + const len = bytes.length; + const header = bytes[0]; + if (len === 32 || (len === 33 && (header === 0x02 || header === 0x03))) { + return this.fromCompressedHex(bytes); + } + if (len === 65 && header === 0x04) + return this.fromUncompressedHex(bytes); + throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${len}`); + } + static fromPrivateKey(privateKey) { + return Point.BASE.multiply(normalizePrivateKey(privateKey)); + } + static fromSignature(msgHash, signature, recovery) { + msgHash = ensureBytes(msgHash); + const h = truncateHash(msgHash); + const { r, s } = normalizeSignature(signature); + if (recovery !== 0 && recovery !== 1) { + throw new Error('Cannot recover signature: invalid recovery bit'); + } + const prefix = recovery & 1 ? '03' : '02'; + const R = Point.fromHex(prefix + numTo32bStr(r)); + const { n } = CURVE; + const rinv = invert(r, n); + const u1 = mod(-h * rinv, n); + const u2 = mod(s * rinv, n); + const Q = Point.BASE.multiplyAndAddUnsafe(R, u1, u2); + if (!Q) + throw new Error('Cannot recover signature: point at infinify'); + Q.assertValidity(); + return Q; + } + toRawBytes(isCompressed = false) { + return hexToBytes(this.toHex(isCompressed)); + } + toHex(isCompressed = false) { + const x = numTo32bStr(this.x); + if (isCompressed) { + const prefix = this.y & _1n ? '03' : '02'; + return `${prefix}${x}`; + } + else { + return `04${x}${numTo32bStr(this.y)}`; + } + } + toHexX() { + return this.toHex(true).slice(2); + } + toRawX() { + return this.toRawBytes(true).slice(1); + } + assertValidity() { + const msg = 'Point is not on elliptic curve'; + const { x, y } = this; + if (!isValidFieldElement(x) || !isValidFieldElement(y)) + throw new Error(msg); + const left = mod(y * y); + const right = weistrass(x); + if (mod(left - right) !== _0n) + throw new Error(msg); + } + equals(other) { + return this.x === other.x && this.y === other.y; + } + negate() { + return new Point(this.x, mod(-this.y)); + } + double() { + return JacobianPoint.fromAffine(this).double().toAffine(); + } + add(other) { + return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(other)).toAffine(); + } + subtract(other) { + return this.add(other.negate()); + } + multiply(scalar) { + return JacobianPoint.fromAffine(this).multiply(scalar, this).toAffine(); + } + multiplyAndAddUnsafe(Q, a, b) { + const P = JacobianPoint.fromAffine(this); + const aP = a === _0n || a === _1n || this !== Point.BASE ? P.multiplyUnsafe(a) : P.multiply(a); + const bQ = JacobianPoint.fromAffine(Q).multiplyUnsafe(b); + const sum = aP.add(bQ); + return sum.equals(JacobianPoint.ZERO) ? undefined : sum.toAffine(); + } + } + Point.BASE = new Point(CURVE.Gx, CURVE.Gy); + Point.ZERO = new Point(_0n, _0n); + function sliceDER(s) { + return Number.parseInt(s[0], 16) >= 8 ? '00' + s : s; + } + function parseDERInt(data) { + if (data.length < 2 || data[0] !== 0x02) { + throw new Error(`Invalid signature integer tag: ${bytesToHex(data)}`); + } + const len = data[1]; + const res = data.subarray(2, len + 2); + if (!len || res.length !== len) { + throw new Error(`Invalid signature integer: wrong length`); + } + if (res[0] === 0x00 && res[1] <= 0x7f) { + throw new Error('Invalid signature integer: trailing length'); + } + return { data: bytesToNumber(res), left: data.subarray(len + 2) }; + } + function parseDERSignature(data) { + if (data.length < 2 || data[0] != 0x30) { + throw new Error(`Invalid signature tag: ${bytesToHex(data)}`); + } + if (data[1] !== data.length - 2) { + throw new Error('Invalid signature: incorrect length'); + } + const { data: r, left: sBytes } = parseDERInt(data.subarray(2)); + const { data: s, left: rBytesLeft } = parseDERInt(sBytes); + if (rBytesLeft.length) { + throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(rBytesLeft)}`); + } + return { r, s }; + } + class Signature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromCompact(hex) { + const arr = isUint8a(hex); + const name = 'Signature.fromCompact'; + if (typeof hex !== 'string' && !arr) + throw new TypeError(`${name}: Expected string or Uint8Array`); + const str = arr ? bytesToHex(hex) : hex; + if (str.length !== 128) + throw new Error(`${name}: Expected 64-byte hex`); + return new Signature(hexToNumber(str.slice(0, 64)), hexToNumber(str.slice(64, 128))); + } + static fromDER(hex) { + const arr = isUint8a(hex); + if (typeof hex !== 'string' && !arr) + throw new TypeError(`Signature.fromDER: Expected string or Uint8Array`); + const { r, s } = parseDERSignature(arr ? hex : hexToBytes(hex)); + return new Signature(r, s); + } + static fromHex(hex) { + return this.fromDER(hex); + } + assertValidity() { + const { r, s } = this; + if (!isWithinCurveOrder(r)) + throw new Error('Invalid Signature: r must be 0 < r < n'); + if (!isWithinCurveOrder(s)) + throw new Error('Invalid Signature: s must be 0 < s < n'); + } + hasHighS() { + const HALF = CURVE.n >> _1n; + return this.s > HALF; + } + normalizeS() { + return this.hasHighS() ? new Signature(this.r, CURVE.n - this.s) : this; + } + toDERRawBytes(isCompressed = false) { + return hexToBytes(this.toDERHex(isCompressed)); + } + toDERHex(isCompressed = false) { + const sHex = sliceDER(numberToHexUnpadded(this.s)); + if (isCompressed) + return sHex; + const rHex = sliceDER(numberToHexUnpadded(this.r)); + const rLen = numberToHexUnpadded(rHex.length / 2); + const sLen = numberToHexUnpadded(sHex.length / 2); + const length = numberToHexUnpadded(rHex.length / 2 + sHex.length / 2 + 4); + return `30${length}02${rLen}${rHex}02${sLen}${sHex}`; + } + toRawBytes() { + return this.toDERRawBytes(); + } + toHex() { + return this.toDERHex(); + } + toCompactRawBytes() { + return hexToBytes(this.toCompactHex()); + } + toCompactHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } + } + function concatBytes(...arrays) { + if (!arrays.every(isUint8a)) + throw new Error('Uint8Array list expected'); + if (arrays.length === 1) + return arrays[0]; + const length = arrays.reduce((a, arr) => a + arr.length, 0); + const result = new Uint8Array(length); + for (let i = 0, pad = 0; i < arrays.length; i++) { + const arr = arrays[i]; + result.set(arr, pad); + pad += arr.length; + } + return result; + } + function isUint8a(bytes) { + return bytes instanceof Uint8Array; + } + const hexes = Array.from({ length: 256 }, (v, i) => i.toString(16).padStart(2, '0')); + function bytesToHex(uint8a) { + if (!(uint8a instanceof Uint8Array)) + throw new Error('Expected Uint8Array'); + let hex = ''; + for (let i = 0; i < uint8a.length; i++) { + hex += hexes[uint8a[i]]; + } + return hex; + } + function numTo32bStr(num) { + if (num > POW_2_256) + throw new Error('Expected number < 2^256'); + return num.toString(16).padStart(64, '0'); + } + function numTo32b(num) { + return hexToBytes(numTo32bStr(num)); + } + function numberToHexUnpadded(num) { + const hex = num.toString(16); + return hex.length & 1 ? `0${hex}` : hex; + } + function hexToNumber(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToNumber: expected string, got ' + typeof hex); + } + return BigInt(`0x${hex}`); + } + function hexToBytes(hex) { + if (typeof hex !== 'string') { + throw new TypeError('hexToBytes: expected string, got ' + typeof hex); + } + if (hex.length % 2) + throw new Error('hexToBytes: received invalid unpadded hex' + hex.length); + const array = new Uint8Array(hex.length / 2); + for (let i = 0; i < array.length; i++) { + const j = i * 2; + const hexByte = hex.slice(j, j + 2); + const byte = Number.parseInt(hexByte, 16); + if (Number.isNaN(byte) || byte < 0) + throw new Error('Invalid byte sequence'); + array[i] = byte; + } + return array; + } + function bytesToNumber(bytes) { + return hexToNumber(bytesToHex(bytes)); + } + function ensureBytes(hex) { + return hex instanceof Uint8Array ? Uint8Array.from(hex) : hexToBytes(hex); + } + function normalizeScalar(num) { + if (typeof num === 'number' && Number.isSafeInteger(num) && num > 0) + return BigInt(num); + if (typeof num === 'bigint' && isWithinCurveOrder(num)) + return num; + throw new TypeError('Expected valid private scalar: 0 < scalar < curve.n'); + } + function mod(a, b = CURVE.P) { + const result = a % b; + return result >= _0n ? result : b + result; + } + function pow2(x, power) { + const { P } = CURVE; + let res = x; + while (power-- > _0n) { + res *= res; + res %= P; + } + return res; + } + function sqrtMod(x) { + const { P } = CURVE; + const _6n = BigInt(6); + const _11n = BigInt(11); + const _22n = BigInt(22); + const _23n = BigInt(23); + const _44n = BigInt(44); + const _88n = BigInt(88); + const b2 = (x * x * x) % P; + const b3 = (b2 * b2 * x) % P; + const b6 = (pow2(b3, _3n) * b3) % P; + const b9 = (pow2(b6, _3n) * b3) % P; + const b11 = (pow2(b9, _2n) * b2) % P; + const b22 = (pow2(b11, _11n) * b11) % P; + const b44 = (pow2(b22, _22n) * b22) % P; + const b88 = (pow2(b44, _44n) * b44) % P; + const b176 = (pow2(b88, _88n) * b88) % P; + const b220 = (pow2(b176, _44n) * b44) % P; + const b223 = (pow2(b220, _3n) * b3) % P; + const t1 = (pow2(b223, _23n) * b22) % P; + const t2 = (pow2(t1, _6n) * b2) % P; + return pow2(t2, _2n); + } + function invert(number, modulo = CURVE.P) { + if (number === _0n || modulo <= _0n) { + throw new Error(`invert: expected positive integers, got n=${number} mod=${modulo}`); + } + let a = mod(number, modulo); + let b = modulo; + let x = _0n, u = _1n; + while (a !== _0n) { + const q = b / a; + const r = b % a; + const m = x - u * q; + b = a, a = r, x = u, u = m; + } + const gcd = b; + if (gcd !== _1n) + throw new Error('invert: does not exist'); + return mod(x, modulo); + } + function invertBatch(nums, p = CURVE.P) { + const scratch = new Array(nums.length); + const lastMultiplied = nums.reduce((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = acc; + return mod(acc * num, p); + }, _1n); + const inverted = invert(lastMultiplied, p); + nums.reduceRight((acc, num, i) => { + if (num === _0n) + return acc; + scratch[i] = mod(acc * scratch[i], p); + return mod(acc * num, p); + }, inverted); + return scratch; + } + const divNearest = (a, b) => (a + b / _2n) / b; + const POW_2_128 = _2n ** BigInt(128); + function splitScalarEndo(k) { + const { n } = CURVE; + const a1 = BigInt('0x3086d221a7d46bcde86c90e49284eb15'); + const b1 = -_1n * BigInt('0xe4437ed6010e88286f547fa90abfe4c3'); + const a2 = BigInt('0x114ca50f7a8e2f3f657c1108d9d44cfd8'); + const b2 = a1; + const c1 = divNearest(b2 * k, n); + const c2 = divNearest(-b1 * k, n); + let k1 = mod(k - c1 * a1 - c2 * a2, n); + let k2 = mod(-c1 * b1 - c2 * b2, n); + const k1neg = k1 > POW_2_128; + const k2neg = k2 > POW_2_128; + if (k1neg) + k1 = n - k1; + if (k2neg) + k2 = n - k2; + if (k1 > POW_2_128 || k2 > POW_2_128) { + throw new Error('splitScalarEndo: Endomorphism failed, k=' + k); + } + return { k1neg, k1, k2neg, k2 }; + } + function truncateHash(hash) { + const { n } = CURVE; + const byteLength = hash.length; + const delta = byteLength * 8 - 256; + let h = bytesToNumber(hash); + if (delta > 0) + h = h >> BigInt(delta); + if (h >= n) + h -= n; + return h; + } + class HmacDrbg { + constructor() { + this.v = new Uint8Array(32).fill(1); + this.k = new Uint8Array(32).fill(0); + this.counter = 0; + } + hmac(...values) { + return utils.hmacSha256(this.k, ...values); + } + hmacSync(...values) { + if (typeof utils.hmacSha256Sync !== 'function') + throw new Error('utils.hmacSha256Sync is undefined, you need to set it'); + const res = utils.hmacSha256Sync(this.k, ...values); + if (res instanceof Promise) + throw new Error('To use sync sign(), ensure utils.hmacSha256 is sync'); + return res; + } + incr() { + if (this.counter >= 1000) { + throw new Error('Tried 1,000 k values for sign(), all were invalid'); + } + this.counter += 1; + } + async reseed(seed = new Uint8Array()) { + this.k = await this.hmac(this.v, Uint8Array.from([0x00]), seed); + this.v = await this.hmac(this.v); + if (seed.length === 0) + return; + this.k = await this.hmac(this.v, Uint8Array.from([0x01]), seed); + this.v = await this.hmac(this.v); + } + reseedSync(seed = new Uint8Array()) { + this.k = this.hmacSync(this.v, Uint8Array.from([0x00]), seed); + this.v = this.hmacSync(this.v); + if (seed.length === 0) + return; + this.k = this.hmacSync(this.v, Uint8Array.from([0x01]), seed); + this.v = this.hmacSync(this.v); + } + async generate() { + this.incr(); + this.v = await this.hmac(this.v); + return this.v; + } + generateSync() { + this.incr(); + this.v = this.hmacSync(this.v); + return this.v; + } + } + function isWithinCurveOrder(num) { + return _0n < num && num < CURVE.n; + } + function isValidFieldElement(num) { + return _0n < num && num < CURVE.P; + } + function kmdToSig(kBytes, m, d) { + const k = bytesToNumber(kBytes); + if (!isWithinCurveOrder(k)) + return; + const { n } = CURVE; + const q = Point.BASE.multiply(k); + const r = mod(q.x, n); + if (r === _0n) + return; + const s = mod(invert(k, n) * mod(m + d * r, n), n); + if (s === _0n) + return; + const sig = new Signature(r, s); + const recovery = (q.x === sig.r ? 0 : 2) | Number(q.y & _1n); + return { sig, recovery }; + } + function normalizePrivateKey(key) { + let num; + if (typeof key === 'bigint') { + num = key; + } + else if (typeof key === 'number' && Number.isSafeInteger(key) && key > 0) { + num = BigInt(key); + } + else if (typeof key === 'string') { + if (key.length !== 64) + throw new Error('Expected 32 bytes of private key'); + num = hexToNumber(key); + } + else if (isUint8a(key)) { + if (key.length !== 32) + throw new Error('Expected 32 bytes of private key'); + num = bytesToNumber(key); + } + else { + throw new TypeError('Expected valid private key'); + } + if (!isWithinCurveOrder(num)) + throw new Error('Expected private key: 0 < key < n'); + return num; + } + function normalizePublicKey(publicKey) { + if (publicKey instanceof Point) { + publicKey.assertValidity(); + return publicKey; + } + else { + return Point.fromHex(publicKey); + } + } + function normalizeSignature(signature) { + if (signature instanceof Signature) { + signature.assertValidity(); + return signature; + } + try { + return Signature.fromDER(signature); + } + catch (error) { + return Signature.fromCompact(signature); + } + } + function getPublicKey(privateKey, isCompressed = false) { + return Point.fromPrivateKey(privateKey).toRawBytes(isCompressed); + } + function recoverPublicKey(msgHash, signature, recovery, isCompressed = false) { + return Point.fromSignature(msgHash, signature, recovery).toRawBytes(isCompressed); + } + function isPub(item) { + const arr = isUint8a(item); + const str = typeof item === 'string'; + const len = (arr || str) && item.length; + if (arr) + return len === 33 || len === 65; + if (str) + return len === 66 || len === 130; + if (item instanceof Point) + return true; + return false; + } + function getSharedSecret(privateA, publicB, isCompressed = false) { + if (isPub(privateA)) + throw new TypeError('getSharedSecret: first arg must be private key'); + if (!isPub(publicB)) + throw new TypeError('getSharedSecret: second arg must be public key'); + const b = normalizePublicKey(publicB); + b.assertValidity(); + return b.multiply(normalizePrivateKey(privateA)).toRawBytes(isCompressed); + } + function bits2int(bytes) { + const slice = bytes.length > 32 ? bytes.slice(0, 32) : bytes; + return bytesToNumber(slice); + } + function bits2octets(bytes) { + const z1 = bits2int(bytes); + const z2 = mod(z1, CURVE.n); + return int2octets(z2 < _0n ? z1 : z2); + } + function int2octets(num) { + if (typeof num !== 'bigint') + throw new Error('Expected bigint'); + const hex = numTo32bStr(num); + return hexToBytes(hex); + } + function initSigArgs(msgHash, privateKey, extraEntropy) { + if (msgHash == null) + throw new Error(`sign: expected valid message hash, not "${msgHash}"`); + const h1 = ensureBytes(msgHash); + const d = normalizePrivateKey(privateKey); + const seedArgs = [int2octets(d), bits2octets(h1)]; + if (extraEntropy != null) { + if (extraEntropy === true) + extraEntropy = utils.randomBytes(32); + const e = ensureBytes(extraEntropy); + if (e.length !== 32) + throw new Error('sign: Expected 32 bytes of extra data'); + seedArgs.push(e); + } + const seed = concatBytes(...seedArgs); + const m = bits2int(h1); + return { seed, m, d }; + } + function finalizeSig(recSig, opts) { + let { sig, recovery } = recSig; + const { canonical, der, recovered } = Object.assign({ canonical: true, der: true }, opts); + if (canonical && sig.hasHighS()) { + sig = sig.normalizeS(); + recovery ^= 1; + } + const hashed = der ? sig.toDERRawBytes() : sig.toCompactRawBytes(); + return recovered ? [hashed, recovery] : hashed; + } + async function sign(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + let sig; + const drbg = new HmacDrbg(); + await drbg.reseed(seed); + while (!(sig = kmdToSig(await drbg.generate(), m, d))) + await drbg.reseed(); + return finalizeSig(sig, opts); + } + function signSync(msgHash, privKey, opts = {}) { + const { seed, m, d } = initSigArgs(msgHash, privKey, opts.extraEntropy); + let sig; + const drbg = new HmacDrbg(); + drbg.reseedSync(seed); + while (!(sig = kmdToSig(drbg.generateSync(), m, d))) + drbg.reseedSync(); + return finalizeSig(sig, opts); + } + const vopts = { strict: true }; + function verify(signature, msgHash, publicKey, opts = vopts) { + let sig; + try { + sig = normalizeSignature(signature); + msgHash = ensureBytes(msgHash); + } + catch (error) { + return false; + } + const { r, s } = sig; + if (opts.strict && sig.hasHighS()) + return false; + const h = truncateHash(msgHash); + let P; + try { + P = normalizePublicKey(publicKey); + } + catch (error) { + return false; + } + const { n } = CURVE; + const sinv = invert(s, n); + const u1 = mod(h * sinv, n); + const u2 = mod(r * sinv, n); + const R = Point.BASE.multiplyAndAddUnsafe(P, u1, u2); + if (!R) + return false; + const v = mod(R.x, n); + return v === r; + } + function finalizeSchnorrChallenge(ch) { + return mod(bytesToNumber(ch), CURVE.n); + } + function hasEvenY(point) { + return (point.y & _1n) === _0n; + } + class SchnorrSignature { + constructor(r, s) { + this.r = r; + this.s = s; + this.assertValidity(); + } + static fromHex(hex) { + const bytes = ensureBytes(hex); + if (bytes.length !== 64) + throw new TypeError(`SchnorrSignature.fromHex: expected 64 bytes, not ${bytes.length}`); + const r = bytesToNumber(bytes.subarray(0, 32)); + const s = bytesToNumber(bytes.subarray(32, 64)); + return new SchnorrSignature(r, s); + } + assertValidity() { + const { r, s } = this; + if (!isValidFieldElement(r) || !isWithinCurveOrder(s)) + throw new Error('Invalid signature'); + } + toHex() { + return numTo32bStr(this.r) + numTo32bStr(this.s); + } + toRawBytes() { + return hexToBytes(this.toHex()); + } + } + function schnorrGetPublicKey(privateKey) { + return Point.fromPrivateKey(privateKey).toRawX(); + } + function initSchnorrSigArgs(message, privateKey, auxRand) { + if (message == null) + throw new TypeError(`sign: Expected valid message, not "${message}"`); + const m = ensureBytes(message); + const d0 = normalizePrivateKey(privateKey); + const rand = ensureBytes(auxRand); + if (rand.length !== 32) + throw new TypeError('sign: Expected 32 bytes of aux randomness'); + const P = Point.fromPrivateKey(d0); + const px = P.toRawX(); + const d = hasEvenY(P) ? d0 : CURVE.n - d0; + return { m, P, px, d, rand }; + } + function initSchnorrNonce(d, t0h) { + return numTo32b(d ^ bytesToNumber(t0h)); + } + function finalizeSchnorrNonce(k0h) { + const k0 = mod(bytesToNumber(k0h), CURVE.n); + if (k0 === _0n) + throw new Error('sign: Creation of signature failed. k is zero'); + const R = Point.fromPrivateKey(k0); + const rx = R.toRawX(); + const k = hasEvenY(R) ? k0 : CURVE.n - k0; + return { R, rx, k }; + } + function finalizeSchnorrSig(R, k, e, d) { + return new SchnorrSignature(R.x, mod(k + e * d, CURVE.n)).toRawBytes(); + } + async function schnorrSign(message, privateKey, auxRand = utils.randomBytes()) { + const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand); + const t = initSchnorrNonce(d, await utils.taggedHash(TAGS.aux, rand)); + const { R, rx, k } = finalizeSchnorrNonce(await utils.taggedHash(TAGS.nonce, t, px, m)); + const e = finalizeSchnorrChallenge(await utils.taggedHash(TAGS.challenge, rx, px, m)); + const sig = finalizeSchnorrSig(R, k, e, d); + const isValid = await schnorrVerify(sig, m, px); + if (!isValid) + throw new Error('sign: Invalid signature produced'); + return sig; + } + function schnorrSignSync(message, privateKey, auxRand = utils.randomBytes()) { + const { m, px, d, rand } = initSchnorrSigArgs(message, privateKey, auxRand); + const t = initSchnorrNonce(d, utils.taggedHashSync(TAGS.aux, rand)); + const { R, rx, k } = finalizeSchnorrNonce(utils.taggedHashSync(TAGS.nonce, t, px, m)); + const e = finalizeSchnorrChallenge(utils.taggedHashSync(TAGS.challenge, rx, px, m)); + const sig = finalizeSchnorrSig(R, k, e, d); + const isValid = schnorrVerifySync(sig, m, px); + if (!isValid) + throw new Error('sign: Invalid signature produced'); + return sig; + } + function initSchnorrVerify(signature, message, publicKey) { + const raw = signature instanceof SchnorrSignature; + const sig = raw ? signature : SchnorrSignature.fromHex(signature); + if (raw) + sig.assertValidity(); + return { + ...sig, + m: ensureBytes(message), + P: normalizePublicKey(publicKey), + }; + } + function finalizeSchnorrVerify(r, P, s, e) { + const R = Point.BASE.multiplyAndAddUnsafe(P, normalizePrivateKey(s), mod(-e, CURVE.n)); + if (!R || !hasEvenY(R) || R.x !== r) + return false; + return true; + } + async function schnorrVerify(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = finalizeSchnorrChallenge(await utils.taggedHash(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + return false; + } + } + function schnorrVerifySync(signature, message, publicKey) { + try { + const { r, s, m, P } = initSchnorrVerify(signature, message, publicKey); + const e = finalizeSchnorrChallenge(utils.taggedHashSync(TAGS.challenge, numTo32b(r), P.toRawX(), m)); + return finalizeSchnorrVerify(r, P, s, e); + } + catch (error) { + return false; + } + } + const schnorr = { + Signature: SchnorrSignature, + getPublicKey: schnorrGetPublicKey, + sign: schnorrSign, + verify: schnorrVerify, + signSync: schnorrSignSync, + verifySync: schnorrVerifySync, + }; + Point.BASE._setWindowSize(8); + const crypto = { + node: nodeCrypto, + web: typeof self === 'object' && 'crypto' in self ? self.crypto : undefined, + }; + const TAGS = { + challenge: 'BIP0340/challenge', + aux: 'BIP0340/aux', + nonce: 'BIP0340/nonce', + }; + const TAGGED_HASH_PREFIXES = {}; + const utils = { + isValidPrivateKey(privateKey) { + try { + normalizePrivateKey(privateKey); + return true; + } + catch (error) { + return false; + } + }, + privateAdd: (privateKey, tweak) => { + const p = normalizePrivateKey(privateKey); + const t = normalizePrivateKey(tweak); + return numTo32b(mod(p + t, CURVE.n)); + }, + privateNegate: (privateKey) => { + const p = normalizePrivateKey(privateKey); + return numTo32b(CURVE.n - p); + }, + pointAddScalar: (p, tweak, isCompressed) => { + const P = Point.fromHex(p); + const t = normalizePrivateKey(tweak); + const Q = Point.BASE.multiplyAndAddUnsafe(P, t, _1n); + if (!Q) + throw new Error('Tweaked point at infinity'); + return Q.toRawBytes(isCompressed); + }, + pointMultiply: (p, tweak, isCompressed) => { + const P = Point.fromHex(p); + const t = bytesToNumber(ensureBytes(tweak)); + return P.multiply(t).toRawBytes(isCompressed); + }, + hashToPrivateKey: (hash) => { + hash = ensureBytes(hash); + if (hash.length < 40 || hash.length > 1024) + throw new Error('Expected 40-1024 bytes of private key as per FIPS 186'); + const num = mod(bytesToNumber(hash), CURVE.n - _1n) + _1n; + return numTo32b(num); + }, + randomBytes: (bytesLength = 32) => { + if (crypto.web) { + return crypto.web.getRandomValues(new Uint8Array(bytesLength)); + } + else if (crypto.node) { + const { randomBytes } = crypto.node; + return Uint8Array.from(randomBytes(bytesLength)); + } + else { + throw new Error("The environment doesn't have randomBytes function"); + } + }, + randomPrivateKey: () => { + return utils.hashToPrivateKey(utils.randomBytes(40)); + }, + bytesToHex, + hexToBytes, + concatBytes, + mod, + invert, + sha256: async (...messages) => { + if (crypto.web) { + const buffer = await crypto.web.subtle.digest('SHA-256', concatBytes(...messages)); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHash } = crypto.node; + const hash = createHash('sha256'); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have sha256 function"); + } + }, + hmacSha256: async (key, ...messages) => { + if (crypto.web) { + const ckey = await crypto.web.subtle.importKey('raw', key, { name: 'HMAC', hash: { name: 'SHA-256' } }, false, ['sign']); + const message = concatBytes(...messages); + const buffer = await crypto.web.subtle.sign('HMAC', ckey, message); + return new Uint8Array(buffer); + } + else if (crypto.node) { + const { createHmac } = crypto.node; + const hash = createHmac('sha256', key); + messages.forEach((m) => hash.update(m)); + return Uint8Array.from(hash.digest()); + } + else { + throw new Error("The environment doesn't have hmac-sha256 function"); + } + }, + sha256Sync: undefined, + hmacSha256Sync: undefined, + taggedHash: async (tag, ...messages) => { + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = await utils.sha256(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return utils.sha256(tagP, ...messages); + }, + taggedHashSync: (tag, ...messages) => { + if (typeof utils.sha256Sync !== 'function') + throw new Error('utils.sha256Sync is undefined, you need to set it'); + let tagP = TAGGED_HASH_PREFIXES[tag]; + if (tagP === undefined) { + const tagH = utils.sha256Sync(Uint8Array.from(tag, (c) => c.charCodeAt(0))); + tagP = concatBytes(tagH, tagH); + TAGGED_HASH_PREFIXES[tag] = tagP; + } + return utils.sha256Sync(tagP, ...messages); + }, + precompute(windowSize = 8, point = Point.BASE) { + const cached = point === Point.BASE ? point : new Point(point.x, point.y); + cached._setWindowSize(windowSize); + cached.multiply(_3n); + return cached; + }, + }; + + exports.CURVE = CURVE; + exports.Point = Point; + exports.Signature = Signature; + exports.getPublicKey = getPublicKey; + exports.getSharedSecret = getSharedSecret; + exports.recoverPublicKey = recoverPublicKey; + exports.schnorr = schnorr; + exports.sign = sign; + exports.signSync = signSync; + exports.utils = utils; + exports.verify = verify; + + Object.defineProperty(exports, '__esModule', { value: true }); + +})); diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 6065d74c7..3ac59ce8e 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -181,3 +181,159 @@ function findAccountPathIssues(path = '') { if (isNaN(p[i])) return `${p[i]} is not a valid value` } } + +/////////////// +let ivHex = '000102030405060708090a0b0c0d0e0f' +function hexToBytes(hex) { + const bytes = new Uint8Array(hex.length / 2) + for (c = 0; c < hex.length; c += 2) + bytes[c / 2] = parseInt(hex.substr(c, 2), 16) + return bytes +} +function bytesToHex(bytes) { + for (var hex = [], i = 0; i < bytes.length; i++) { + var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i] + hex.push((current >>> 4).toString(16)) + hex.push((current & 0xf).toString(16)) + } + return hex.join('') +} +function asciiToUint8Array(str) { + var chars = [] + for (var i = 0; i < str.length; ++i) { + chars.push(str.charCodeAt(i)) + } + return new Uint8Array(chars) +} +async function encryptMessage2(key, text) { + console.log('### key', bytesToHex(key)) + iv = new Uint8Array([ + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f + ]) + var textBytes = aesjs.utils.utf8.toBytes(text) + console.log('### textBytes2', bytesToHex(textBytes)) + console.log('### iv', bytesToHex(iv)) + + var aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + var encryptedBytes = aesCbc.encrypt(textBytes) + + // To print or store the binary data, you may convert it to hex + var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes) + return encryptedHex +} + +async function encryptMessage(key, message) { + // The iv must never be reused with a given key. + // iv = window.crypto.getRandomValues(new Uint8Array(16)); + iv = new Uint8Array([ + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f + ]) + const ciphertext = await window.crypto.subtle.encrypt( + { + name: 'AES-CBC', + iv + }, + key, + message + ) + + console.log('### #####################################') + return new Uint8Array(ciphertext) +} + +async function decryptMessage(key, ciphertext) { + iv = new Uint8Array([ + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f + ]) + + let decrypted = await window.crypto.subtle.decrypt( + { + name: 'AES-CBC', + iv + }, + key, + new Uint8Array(ciphertext) + ) + + return decrypted +} + +// TODO: weak: must re-check +// from https://stackoverflow.com/a/51838635/9014097 +function toStdBase64(input) { + input = input.replace(/-/g, '+').replace(/_/g, '/') + var pad = input.length % 4 + if (pad) { + input += new Array(5 - pad).join('=') + } + return input +} + +// TODO: weak: must re-check +function base64ToHex(str) { + const raw = atob(str) + let result = '' + for (let i = 0; i < raw.length; i++) { + const hex = raw.charCodeAt(i).toString(16) + result += hex.length === 2 ? hex : '0' + hex + } + return result.toUpperCase() +} + +function buf2hex(buffer) { + // buffer is an ArrayBuffer + return [...new Uint8Array(buffer)] + .map(x => x.toString(16).padStart(2, '0')) + .join('') +} + +// Alice private key +// 359A8CA1418C49DD26DC7D92C789AC33347F64C6B7789C666098805AF3CC60E5 + +// Bob private key +// AB52F1F981F639BD83F884703BC690B10DB709FF48806680A0D3FBC6475E6093 diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 982f90412..c90580272 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -237,5 +237,7 @@ + + {% endblock %} From f24149050d83c087d4d72cbfe241edab19a7a1f1 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 11 Aug 2022 08:59:06 +0300 Subject: [PATCH 217/421] feat: encrypt outgoing commands --- .../components/serial-signer/serial-signer.js | 178 +++++++++++------- .../components/wallet-config/wallet-config.js | 149 +++++++-------- .../extensions/watchonly/static/js/utils.js | 82 +------- 3 files changed, 186 insertions(+), 223 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index f756eaaa3..b5cd6b577 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -14,6 +14,8 @@ async function serialSigner(path) { reader: null, receivedData: '', config: {}, + decryptionKey: null, + dheKey: null, // todo: store in secure local storage hww: { password: null, @@ -222,6 +224,9 @@ async function serialSigner(path) { case COMMAND_XPUB: this.handleXpubResponse(commandData) break + case COMMAND_DH_EXCHANGE: + this.handleDhExchangeResponse(commandData) + break default: console.log('### console', value) } @@ -234,7 +239,7 @@ async function serialSigner(path) { hwwShowPasswordDialog: async function () { try { this.hww.showPasswordDialog = true - await this.writer.write(COMMAND_PASSWORD + '\n') + await this.sendCommandSecure(COMMAND_PASSWORD) } catch (error) { this.$q.notify({ type: 'warning', @@ -247,7 +252,7 @@ async function serialSigner(path) { hwwShowWipeDialog: async function () { try { this.hww.showWipeDialog = true - await this.writer.write(COMMAND_WIPE + '\n') + await this.sendCommandSecure(COMMAND_WIPE) } catch (error) { this.$q.notify({ type: 'warning', @@ -260,7 +265,7 @@ async function serialSigner(path) { hwwShowRestoreDialog: async function () { try { this.hww.showRestoreDialog = true - await this.writer.write(COMMAND_WIPE + '\n') + await this.sendCommandSecure(COMMAND_WIPE) } catch (error) { this.$q.notify({ type: 'warning', @@ -275,11 +280,11 @@ async function serialSigner(path) { if (this.hww.confirm.outputIndex >= this.tx.outputs.length) { this.hww.confirm.showFee = true } - await this.writer.write(COMMAND_CONFIRM_NEXT + '\n') + await this.sendCommandSecure(COMMAND_CONFIRM_NEXT) }, cancelOperation: async function () { try { - await this.writer.write(COMMAND_CANCEL + '\n') + await this.sendCommandSecure(COMMAND_CANCEL) } catch (error) { this.$q.notify({ type: 'warning', @@ -297,9 +302,7 @@ async function serialSigner(path) { }, hwwLogin: async function () { try { - await this.writer.write( - COMMAND_PASSWORD + ' ' + this.hww.password + '\n' - ) + await this.sendCommandSecure(COMMAND_PASSWORD, [this.hww.password]) } catch (error) { this.$q.notify({ type: 'warning', @@ -335,7 +338,7 @@ async function serialSigner(path) { }, hwwLogout: async function () { try { - await this.writer.write(COMMAND_PASSWORD_CLEAR + '\n') + await this.sendCommandSecure(COMMAND_PASSWORD_CLEAR) } catch (error) { this.$q.notify({ type: 'warning', @@ -359,9 +362,7 @@ async function serialSigner(path) { try { this.tx = tx this.hww.sendingPsbt = true - await this.writer.write( - COMMAND_SEND_PSBT + ' ' + this.network + ' ' + psbtBase64 + '\n' - ) + await this.sendCommandSecure(COMMAND_SEND_PSBT, [this.network, psbtBase64]) this.$q.notify({ type: 'positive', message: 'Data sent to serial port device!', @@ -411,7 +412,7 @@ async function serialSigner(path) { try { this.hww.showConfirmationDialog = false this.hww.signingPsbt = true - await this.writer.write(COMMAND_SIGN_PSBT + '\n') + await this.sendCommandSecure(COMMAND_SIGN_PSBT) } catch (error) { this.$q.notify({ type: 'warning', @@ -442,47 +443,55 @@ async function serialSigner(path) { }) }, hwwHelp: async function () { - const sharedSecret = - 'f96c85875055a5586688fea4cf7c4a2bd9541ffcf34f9d663d97e0cf2f6af4af' - const sharedSecretBytes = hexToBytes(sharedSecret) - console.log('### sharedSecret', sharedSecret) - const key = await window.crypto.subtle.importKey( - 'raw', - sharedSecretBytes, - { - name: 'AES-CBC', - length: 256 - }, - true, - ['encrypt', 'decrypt'] - ) + // const sharedSecret = + // 'f96c85875055a5586688fea4cf7c4a2bd9541ffcf34f9d663d97e0cf2f6af4af' + // const sharedSecretBytes = hexToBytes(sharedSecret) + // // console.log('### sharedSecret', sharedSecret) + // const key = await window.crypto.subtle.importKey( + // 'raw', + // sharedSecretBytes, + // { + // name: 'AES-CBC', + // length: 256 + // }, + // true, + // ['encrypt', 'decrypt'] + // ) // d2b9e5e3ff8945236455424e9e25590b8264f13c7484862cca4f5b7b8bf8f1686d218b4f1aacdc27a1df71fa4b530adfd6c8cae6bd926d3f8be8ff55ee4358d1a32569e9f5263ffae7d0eaf413788498 // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 // 8f13a7763f021d7701f4100631f6c3d80576fcd0e3718b2594ceb7b910ceed29a334d1019dd6f0ffdba5b6be8c11637d6124d7adbd29c88af13800cb1f980f7d - const message = - 'TextMustBe16ByteTextMustBe16ByteTextMustBe16ByteTextMustBe16Byte' - const encoded = asciiToUint8Array(message) - const encrypted = await encryptMessage(key, encoded) - const encryptedHex = bytesToHex(encrypted) - console.log('### encrypted hex: ', encryptedHex) + // const message = + // 'TextMustBe16ByteTextMustBe16ByteTextMustBe16ByteTextMustBe16Byte' + // const encoded = asciiToUint8Array(message) + // const encrypted = await encryptMessage(key, encoded) + // const encryptedHex = bytesToHex(encrypted) + // console.log('### encrypted hex: ', encryptedHex) - const encryptedHex2 = await encryptMessage2(sharedSecretBytes, message) - console.log('### encryptedHex2', encryptedHex2) + // const encryptedHex2 = await encryptMessage2(sharedSecretBytes, message) + // console.log('### encryptedHex2', encryptedHex2) - const decrypted = await decryptMessage(key, encrypted) - console.log( - '### decrypted hex: ', - bytesToHex(new Uint8Array(decrypted)) - ) - console.log( - '### decrypted ascii: ', - new TextDecoder().decode(new Uint8Array(decrypted)) - ) + // const decrypted = await decryptMessage(key, encrypted) + // console.log( + // '### decrypted hex: ', + // bytesToHex(new Uint8Array(decrypted)) + // ) + // console.log( + // '### decrypted ascii: ', + // new TextDecoder().decode(new Uint8Array(decrypted)) + // ) try { - await this.writer.write(COMMAND_HELP + ' ' + encryptedHex + '\n') + this.decryptionKey = nobleSecp256k1.utils.randomPrivateKey() + const publicKey = nobleSecp256k1.Point.fromPrivateKey( + this.decryptionKey + ) + const publicKeyHex = publicKey.toHex().slice(2) + console.log('### publicKeyHex:', publicKeyHex) + await this.writer.write( + COMMAND_DH_EXCHANGE + ' ' + publicKeyHex + '\n' + ) this.$q.notify({ type: 'positive', message: 'Check display or console for details!', @@ -500,7 +509,7 @@ async function serialSigner(path) { hwwWipe: async function () { try { this.hww.showWipeDialog = false - await this.writer.write(COMMAND_WIPE + ' ' + this.hww.password + '\n') + await this.sendCommandSecure(COMMAND_WIPE, [this.hww.password]) } catch (error) { this.$q.notify({ type: 'warning', @@ -537,9 +546,8 @@ async function serialSigner(path) { '### hwwXpub', COMMAND_XPUB + ' ' + this.network + ' ' + path ) - await this.writer.write( - COMMAND_XPUB + ' ' + this.network + ' ' + path + '\n' - ) + + await this.sendCommandSecure(COMMAND_XPUB, [this.network, path]) } catch (error) { this.$q.notify({ type: 'warning', @@ -565,13 +573,46 @@ async function serialSigner(path) { const fingerprint = args[2].trim() this.xpubResolve({xpub, fingerprint}) }, + handleDhExchangeResponse: async function (res = '') { + console.log('### handleDhExchangeResponse', res) + const [pubKeyHex, fingerprint] = res.trim().split(' ') + if (!pubKeyHex) { + this.$q.notify({ + type: 'warning', + message: 'Failed to exchange DH secret!', + caption: `${res}`, + timeout: 10000 + }) + + return + } + const hwwPublicKey = nobleSecp256k1.Point.fromHex('04' + pubKeyHex) + + const sharedSecret = nobleSecp256k1.getSharedSecret( + this.decryptionKey, + hwwPublicKey + ).slice(1, 33) + console.log( + '### sharedSecret', + nobleSecp256k1.utils.bytesToHex(sharedSecret) + ) + this.dheKey = await window.crypto.subtle.importKey( + 'raw', + sharedSecret, + { + name: 'AES-CBC', + length: 256 + }, + true, + ['encrypt', 'decrypt'] + ) + }, hwwShowSeed: async function () { try { this.hww.showSeedDialog = true this.hww.seedWordPosition = 1 - await this.writer.write( - COMMAND_SEED + ' ' + this.hww.seedWordPosition + '\n' - ) + + await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) } catch (error) { this.$q.notify({ type: 'warning', @@ -583,16 +624,11 @@ async function serialSigner(path) { }, showNextSeedWord: async function () { this.hww.seedWordPosition++ - await this.writer.write( - COMMAND_SEED + ' ' + this.hww.seedWordPosition + '\n' - ) + await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) }, showPrevSeedWord: async function () { this.hww.seedWordPosition = Math.max(1, this.hww.seedWordPosition - 1) - console.log('### this.hww.seedWordPosition', this.hww.seedWordPosition) - await this.writer.write( - COMMAND_SEED + ' ' + this.hww.seedWordPosition + '\n' - ) + await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) }, handleShowSeedResponse: function (res = '') { const args = res.trim().split(' ') @@ -608,12 +644,8 @@ async function serialSigner(path) { }, hwwRestore: async function () { try { - await this.writer.write( - COMMAND_RESTORE + ' ' + this.hww.mnemonic + '\n' - ) - await this.writer.write( - COMMAND_PASSWORD + ' ' + this.hww.password + '\n' - ) + await this.sendCommandSecure(COMMAND_RESTORE, [this.hww.mnemonic]) + await this.sendCommandSecure(COMMAND_PASSWORD, [this.hww.password]) } catch (error) { this.$q.notify({ type: 'warning', @@ -633,8 +665,22 @@ async function serialSigner(path) { updateSignedPsbt: async function (value) { this.$emit('signed:psbt', value) + }, + + sendCommandSecure: async function (command, attrs = []) { + const message = [command].concat(attrs).join(' ') + + const encodedMessage = asciiToUint8Array(message.length + ' ' + message) + const encrypted = await encryptMessage(this.dheKey, encodedMessage) + + const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) + console.log('### encrypted hex: ', encryptedHex) + + await this.writer.write(encryptedHex + '\n') } }, - created: async function () {} + created: async function () { + console.log('### nobleSecp256k1.utils', nobleSecp256k1.utils) + } }) } diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js index 5ce63c796..1f6789370 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.js @@ -75,59 +75,54 @@ async function walletConfig(path) { ) }, old: async function () { - const alicesKeyPair = await window.crypto.subtle.generateKey( - { - name: 'ECDH', - namedCurve: 'P-256' - }, - true, - ['deriveKey'] - ) - const bobsKeyPair = await window.crypto.subtle.generateKey( - { - name: 'ECDH', - namedCurve: 'P-256' - }, - true, - ['deriveKey'] - ) - console.log('### alicesKeyPair', alicesKeyPair) - console.log('### alicesKeyPair.privateKey', alicesKeyPair.privateKey) - console.log('### alicesKeyPair.publicKey', alicesKeyPair.publicKey) - const alicesPriveKey = await window.crypto.subtle.exportKey( - 'jwk', - alicesKeyPair.privateKey - ) - console.log('### alicesPriveKey', alicesPriveKey) - - const alicesPriveKeyBase64 = toStdBase64(alicesPriveKey.d) - console.log( - '### alicesPriveKeyBase64', - alicesPriveKeyBase64, - base64ToHex(alicesPriveKeyBase64) - ) - - const bobPublicKey = await window.crypto.subtle.exportKey( - 'raw', - bobsKeyPair.publicKey - ) - console.log('### bobPublicKey hex', buf2hex(bobPublicKey)) - + // const alicesKeyPair = await window.crypto.subtle.generateKey( + // { + // name: 'ECDH', + // namedCurve: 'P-256' + // }, + // true, + // ['deriveKey'] + // ) + // const bobsKeyPair = await window.crypto.subtle.generateKey( + // { + // name: 'ECDH', + // namedCurve: 'P-256' + // }, + // true, + // ['deriveKey'] + // ) + // console.log('### alicesKeyPair', alicesKeyPair) + // console.log('### alicesKeyPair.privateKey', alicesKeyPair.privateKey) + // console.log('### alicesKeyPair.publicKey', alicesKeyPair.publicKey) + // const alicesPriveKey = await window.crypto.subtle.exportKey( + // 'jwk', + // alicesKeyPair.privateKey + // ) + // console.log('### alicesPriveKey', alicesPriveKey) + // const alicesPriveKeyBase64 = toStdBase64(alicesPriveKey.d) + // console.log( + // '### alicesPriveKeyBase64', + // alicesPriveKeyBase64, + // base64ToHex(alicesPriveKeyBase64) + // ) + // const bobPublicKey = await window.crypto.subtle.exportKey( + // 'raw', + // bobsKeyPair.publicKey + // ) + // console.log('### bobPublicKey hex', buf2hex(bobPublicKey)) // const sharedSecret01 = await this.deriveSecretKey(alicesKeyPair.privateKey, bobsKeyPair.publicKey) // console.log('### sharedSecret01', sharedSecret01) // const sharedSecret01Raw = await window.crypto.subtle.exportKey('jwk', sharedSecret01) // console.log('### sharedSecret01Raw', sharedSecret01Raw) - // const sharedSecret02 = await this.deriveSecretKey(bobsKeyPair.privateKey, alicesKeyPair.publicKey) // console.log('### sharedSecret02', sharedSecret02) // const sharedSecret02Raw = await window.crypto.subtle.exportKey('jwk', sharedSecret02) // console.log('### sharedSecret02Raw', sharedSecret02Raw) - - const sharedSecret = nobleSecp256k1.getSharedSecret( - alicesPriveKey, - buf2hex(bobPublicKey) - ) - console.log('###', getSharedSecret) + // const sharedSecret = nobleSecp256k1.getSharedSecret( + // alicesPriveKey, + // buf2hex(bobPublicKey) + // ) + // console.log('###', getSharedSecret) }, importSecretKey: async function (rawKey) { return window.crypto.subtle.importKey('raw', rawKey, 'AES-GCM', true, [ @@ -142,45 +137,45 @@ async function walletConfig(path) { // ### in: 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 // ### in2: 073059e23605fe508919d892501974905f8b5e13728db63b1b7b9326951abbe4f722c104bc82a4bcf3f1e15ede8ab7d5eb00be8c46271e1f65867f984e9cb5f1 - const alicesPrivateKey = - '359A8CA1418C49DD26DC7D92C789AC33347F64C6B7789C666098805AF3CC60E5' + // const alicesPrivateKey = + // '359A8CA1418C49DD26DC7D92C789AC33347F64C6B7789C666098805AF3CC60E5' - const bobsPrivateKey = - 'AB52F1F981F639BD83F884703BC690B10DB709FF48806680A0D3FBC6475E6093' + // const bobsPrivateKey = + // 'AB52F1F981F639BD83F884703BC690B10DB709FF48806680A0D3FBC6475E6093' - const alicesPublicKey = nobleSecp256k1.Point.fromPrivateKey( - alicesPrivateKey - ) - console.log('### alicesPublicKey', alicesPublicKey.toHex()) + // const alicesPublicKey = nobleSecp256k1.Point.fromPrivateKey( + // alicesPrivateKey + // ) + // console.log('### alicesPublicKey', alicesPublicKey.toHex()) - const bobsPublicKey = nobleSecp256k1.Point.fromPrivateKey(bobsPrivateKey) - console.log('### bobsPublicKey', bobsPublicKey.toHex()) + // const bobsPublicKey = nobleSecp256k1.Point.fromPrivateKey(bobsPrivateKey) + // console.log('### bobsPublicKey', bobsPublicKey.toHex()) - const sharedSecret = nobleSecp256k1.getSharedSecret( - alicesPrivateKey, - bobsPublicKey - ) + // const sharedSecret = nobleSecp256k1.getSharedSecret( + // alicesPrivateKey, + // bobsPublicKey + // ) - console.log('### sharedSecret naked', sharedSecret) + // console.log('### sharedSecret naked', sharedSecret) - console.log( - '### sharedSecret a', - nobleSecp256k1.utils.bytesToHex(sharedSecret) - ) - console.log( - '### sharedSecret b', - nobleSecp256k1.Point.fromHex(sharedSecret) - ) - console.log( - '### sharedSecret b', - nobleSecp256k1.Point.fromHex(sharedSecret).toHex(true) - ) + // console.log( + // '### sharedSecret a', + // nobleSecp256k1.utils.bytesToHex(sharedSecret) + // ) + // console.log( + // '### sharedSecret b', + // nobleSecp256k1.Point.fromHex(sharedSecret) + // ) + // console.log( + // '### sharedSecret b', + // nobleSecp256k1.Point.fromHex(sharedSecret).toHex(true) + // ) - const alicesPrivateKeyBytes = nobleSecp256k1.utils.hexToBytes( - alicesPrivateKey - ) - const x = await this.importSecretKey(alicesPrivateKeyBytes) - console.log('### x', x) + // const alicesPrivateKeyBytes = nobleSecp256k1.utils.hexToBytes( + // alicesPrivateKey + // ) + // const x = await this.importSecretKey(alicesPrivateKeyBytes) + // console.log('### x', x) } }) } diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 3ac59ce8e..a83be7773 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -10,6 +10,7 @@ const COMMAND_RESTORE = '/restore' const COMMAND_CONFIRM_NEXT = '/confirm-next' const COMMAND_CANCEL = '/cancel' const COMMAND_XPUB = '/xpub' +const COMMAND_DH_EXCHANGE = '/dh-exchange' const DEFAULT_RECEIVE_GAP_LIMIT = 20 @@ -184,20 +185,7 @@ function findAccountPathIssues(path = '') { /////////////// let ivHex = '000102030405060708090a0b0c0d0e0f' -function hexToBytes(hex) { - const bytes = new Uint8Array(hex.length / 2) - for (c = 0; c < hex.length; c += 2) - bytes[c / 2] = parseInt(hex.substr(c, 2), 16) - return bytes -} -function bytesToHex(bytes) { - for (var hex = [], i = 0; i < bytes.length; i++) { - var current = bytes[i] < 0 ? bytes[i] + 256 : bytes[i] - hex.push((current >>> 4).toString(16)) - hex.push((current & 0xf).toString(16)) - } - return hex.join('') -} + function asciiToUint8Array(str) { var chars = [] for (var i = 0; i < str.length; ++i) { @@ -205,37 +193,6 @@ function asciiToUint8Array(str) { } return new Uint8Array(chars) } -async function encryptMessage2(key, text) { - console.log('### key', bytesToHex(key)) - iv = new Uint8Array([ - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f - ]) - var textBytes = aesjs.utils.utf8.toBytes(text) - console.log('### textBytes2', bytesToHex(textBytes)) - console.log('### iv', bytesToHex(iv)) - - var aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) - var encryptedBytes = aesCbc.encrypt(textBytes) - - // To print or store the binary data, you may convert it to hex - var encryptedHex = aesjs.utils.hex.fromBytes(encryptedBytes) - return encryptedHex -} async function encryptMessage(key, message) { // The iv must never be reused with a given key. @@ -302,38 +259,3 @@ async function decryptMessage(key, ciphertext) { return decrypted } - -// TODO: weak: must re-check -// from https://stackoverflow.com/a/51838635/9014097 -function toStdBase64(input) { - input = input.replace(/-/g, '+').replace(/_/g, '/') - var pad = input.length % 4 - if (pad) { - input += new Array(5 - pad).join('=') - } - return input -} - -// TODO: weak: must re-check -function base64ToHex(str) { - const raw = atob(str) - let result = '' - for (let i = 0; i < raw.length; i++) { - const hex = raw.charCodeAt(i).toString(16) - result += hex.length === 2 ? hex : '0' + hex - } - return result.toUpperCase() -} - -function buf2hex(buffer) { - // buffer is an ArrayBuffer - return [...new Uint8Array(buffer)] - .map(x => x.toString(16).padStart(2, '0')) - .join('') -} - -// Alice private key -// 359A8CA1418C49DD26DC7D92C789AC33347F64C6B7789C666098805AF3CC60E5 - -// Bob private key -// AB52F1F981F639BD83F884703BC690B10DB709FF48806680A0D3FBC6475E6093 From a6fba2755427cdad7ab3bd86f89320db979b705e Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 11 Aug 2022 13:02:02 +0300 Subject: [PATCH 218/421] fix: address link to `mempool.space` --- lnbits/extensions/watchonly/templates/watchonly/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 982f90412..43ad9556d 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -177,7 +177,7 @@ size="ms" icon="launch" type="a" - :href="mempoolHostname + '/address/' + currentAddress.address" + :href="'https://' + mempoolHostname + '/address/' + currentAddress.address" target="_blank" >

From 3d1ea76676fd7b8402d5f5642cdd8828f07620b4 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 11 Aug 2022 13:20:29 +0300 Subject: [PATCH 219/421] feat: add `Copy` button for addresses --- .../static/components/address-list/address-list.html | 12 +++++++++++- .../static/components/address-list/address-list.js | 10 ++++++++++ .../watchonly/templates/watchonly/index.html | 10 ++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/watchonly/static/components/address-list/address-list.html b/lnbits/extensions/watchonly/static/components/address-list/address-list.html index f21210631..8db6e4d03 100644 --- a/lnbits/extensions/watchonly/static/components/address-list/address-list.html +++ b/lnbits/extensions/watchonly/static/components/address-list/address-list.html @@ -111,7 +111,7 @@
-
+
+
+ Copy +
wl.id === walletId) return wallet ? wallet.title : 'unknown' diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 43ad9556d..03deeffa0 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -170,7 +170,17 @@ >

+ + {{ currentAddress.address }} + Date: Thu, 11 Aug 2022 14:22:14 +0300 Subject: [PATCH 220/421] fix: look&feel on small screens --- .../static/components/wallet-config/wallet-config.html | 8 ++++---- .../static/components/wallet-list/wallet-list.html | 7 +++---- .../extensions/watchonly/templates/watchonly/index.html | 7 ++++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html index 61a353625..4e75a3398 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html @@ -1,16 +1,16 @@

-
+
-
+
-
{{satBtc(total)}}
+
{{satBtc(total)}}
-
+
diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html index ccd6f678f..72ff2156e 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.html @@ -2,7 +2,7 @@
-
+
- -
-
+
+
@@ -33,7 +34,7 @@ {% raw %}
-
+
Scan Blockchain
-
+
-
+
Date: Thu, 11 Aug 2022 14:31:14 +0300 Subject: [PATCH 221/421] chore: code format --- .../static/components/wallet-config/wallet-config.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html index 4e75a3398..748d650df 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html +++ b/lnbits/extensions/watchonly/static/components/wallet-config/wallet-config.html @@ -10,7 +10,7 @@
{{satBtc(total)}}
-
+
From e20cfd3e6dfc9b479d15a03c3f974354b24c5511 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Thu, 11 Aug 2022 15:06:32 +0300 Subject: [PATCH 222/421] fix: handle serial port disconnect --- .../static/components/serial-signer/serial-signer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index b12550319..2f864414f 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -69,7 +69,8 @@ async function serialSigner(path) { }) navigator.serial.addEventListener('disconnect', () => { - console.log('### navigator.serial event: disconnected!', event) + console.log('### navigator.serial event: disconnected!') + this.selectedPort = null this.hww.authenticated = false this.$q.notify({ type: 'warning', @@ -113,14 +114,13 @@ async function serialSigner(path) { /* Ignore the error */ }) if (this.selectedPort) await this.selectedPort.close() - this.selectedPort = null + this.$q.notify({ type: 'positive', message: 'Serial port disconnected!', timeout: 5000 }) } catch (error) { - this.selectedPort = null this.$q.notify({ type: 'warning', message: 'Cannot close serial port!', @@ -128,6 +128,7 @@ async function serialSigner(path) { timeout: 10000 }) } finally { + this.selectedPort = null this.hww.authenticated = false } }, From 3f71df782935df5fda3ea36777e17939aeabbc64 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 10:25:54 +0300 Subject: [PATCH 223/421] feat: use external aes lib --- .../components/serial-signer/serial-signer.js | 114 +++++++++++++++--- .../extensions/watchonly/static/js/utils.js | 27 ++++- 2 files changed, 121 insertions(+), 20 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index b5cd6b577..ed06cf5ad 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -201,10 +201,44 @@ async function serialSigner(path) { } } }, - handleSerialPortResponse: function (value) { + handleSerialPortResponse: async function (value) { const command = value.split(' ')[0] const commandData = value.substring(command.length).trim() + if (command === COMMAND_DH_EXCHANGE) { + this.handleDhExchangeResponse(commandData) + return + } + if (this.dheKey) { + try { + console.log('### value', value) + const messageBin = nobleSecp256k1.utils.hexToBytes(value) + try { + const xx = await decryptMessage(this.dheKey, messageBin) + console.log('### xx: ', xx) + } catch (error) { + console.log('### error 1', error) + } + + try { + const decrypted1 = await decryptMessage2( + this.sharedSecret, + messageBin + ) + + console.log( + '### decrypted hex 1: ', + nobleSecp256k1.utils.bytesToHex(decrypted1) + ) + console.log('### decrypted text 1', new TextDecoder().decode(decrypted1)) + } catch (error) { + console.log('### error 2', error) + } + } catch (error) { + console.log(error) + } + } + switch (command) { case COMMAND_SIGN_PSBT: this.handleSignResponse(commandData) @@ -224,11 +258,11 @@ async function serialSigner(path) { case COMMAND_XPUB: this.handleXpubResponse(commandData) break - case COMMAND_DH_EXCHANGE: - this.handleDhExchangeResponse(commandData) + case COMMAND_SEED: + this.handleShowSeedResponse(commandData) break default: - console.log('### console', value) + console.log('### hww console', value) } }, updateSerialPortConsole: function (value) { @@ -362,7 +396,10 @@ async function serialSigner(path) { try { this.tx = tx this.hww.sendingPsbt = true - await this.sendCommandSecure(COMMAND_SEND_PSBT, [this.network, psbtBase64]) + await this.sendCommandSecure(COMMAND_SEND_PSBT, [ + this.network, + psbtBase64 + ]) this.$q.notify({ type: 'positive', message: 'Data sent to serial port device!', @@ -588,10 +625,10 @@ async function serialSigner(path) { } const hwwPublicKey = nobleSecp256k1.Point.fromHex('04' + pubKeyHex) - const sharedSecret = nobleSecp256k1.getSharedSecret( - this.decryptionKey, - hwwPublicKey - ).slice(1, 33) + const sharedSecret = nobleSecp256k1 + .getSharedSecret(this.decryptionKey, hwwPublicKey) + .slice(1, 33) + this.sharedSecret = sharedSecret console.log( '### sharedSecret', nobleSecp256k1.utils.bytesToHex(sharedSecret) @@ -612,7 +649,9 @@ async function serialSigner(path) { this.hww.showSeedDialog = true this.hww.seedWordPosition = 1 - await this.sendCommandSecure(COMMAND_SEED, [this.hww.seedWordPosition]) + await this.sendCommandSecure(COMMAND_SEED, [ + this.hww.seedWordPosition + ]) } catch (error) { this.$q.notify({ type: 'warning', @@ -632,15 +671,16 @@ async function serialSigner(path) { }, handleShowSeedResponse: function (res = '') { const args = res.trim().split(' ') - if (args.length < 2 || args[0].trim() !== '1') { - this.$q.notify({ - type: 'warning', - message: 'Failed to show seed!', - caption: `${res}`, - timeout: 10000 - }) - return - } + console.log('### handleShowSeedResponse: ', res) + // if (args.length < 2 || args[0].trim() !== '1') { + // this.$q.notify({ + // type: 'warning', + // message: 'Failed to show seed!', + // caption: `${res}`, + // timeout: 10000 + // }) + // return + // } }, hwwRestore: async function () { try { @@ -671,11 +711,47 @@ async function serialSigner(path) { const message = [command].concat(attrs).join(' ') const encodedMessage = asciiToUint8Array(message.length + ' ' + message) + // const encodedMessageHex = + // '6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710' + // const encodedMessage = nobleSecp256k1.utils.hexToBytes( + // encodedMessageHex + // ) const encrypted = await encryptMessage(this.dheKey, encodedMessage) const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) console.log('### encrypted hex: ', encryptedHex) + /* + + const decrypted = await decryptMessage(this.dheKey, encrypted) + console.log( + '### decrypted hex 0: ', + nobleSecp256k1.utils.bytesToHex(new Uint8Array(decrypted)) + ) + const encrypted1 = + '8f13a7763f021d7701f4100631f6c3d80576fcd0e3718b2594ceb7b910ceed29a334d1019dd6f0ffdba5b6be8c11637d6124d7adbd29c88af13800cb1f980f7d' + const encrypted1Bin = nobleSecp256k1.utils.hexToBytes(encrypted1) + + const decrypted1 = await decryptMessage2( + this.sharedSecret, + encrypted1Bin + ) + console.log( + '### decrypted hex 1: ', + nobleSecp256k1.utils.bytesToHex(decrypted1) + ) + + const encrypted2 = + '1e785d2d8cdf930aae61e8f3dbc5637917c1a621f4cdc6857cabbcdf696108d6b831cddce4c9f759e8b8eee2419f4a8f2133bb8893ae8bd251597439a6f4f7b172bd2c9eead0877cbf4cb996ad343330' + const encrypted2Bin = nobleSecp256k1.utils.hexToBytes(encrypted2) + + const decrypted2 = await decryptMessage(this.dheKey, encrypted2Bin) + console.log( + '### decrypted hex 2: ', + nobleSecp256k1.utils.bytesToHex(new Uint8Array(decrypted2)) + ) + */ + await this.writer.write(encryptedHex + '\n') } }, diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index a83be7773..23a945fe3 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -254,8 +254,33 @@ async function decryptMessage(key, ciphertext) { iv }, key, - new Uint8Array(ciphertext) + ciphertext ) return decrypted } + +async function decryptMessage2(key, encryptedBytes) { + iv = new Uint8Array([ + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f + ]) + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const decryptedBytes = aesCbc.decrypt(encryptedBytes) + console.log('### decryptedBytes', decryptedBytes) + return decryptedBytes +} From 174cc28fe1798e352cafa0008c0e1a66d8f7dc2c Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 12:07:41 +0300 Subject: [PATCH 224/421] feat: special log for hww --- .../components/serial-signer/serial-signer.js | 13 +++++++++++++ lnbits/extensions/watchonly/static/js/utils.js | 1 + 2 files changed, 14 insertions(+) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index ed06cf5ad..7966eea3a 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -209,6 +209,16 @@ async function serialSigner(path) { this.handleDhExchangeResponse(commandData) return } + switch (command) { + case COMMAND_DH_EXCHANGE: + this.handleDhExchangeResponse(commandData) + return + case COMMAND_LOG: + + console.log(` %c${commandData}`, 'background: #222; color: #bada55') + + return + } if (this.dheKey) { try { console.log('### value', value) @@ -231,6 +241,9 @@ async function serialSigner(path) { nobleSecp256k1.utils.bytesToHex(decrypted1) ) console.log('### decrypted text 1', new TextDecoder().decode(decrypted1)) + + var decryptedText = aesjs.utils.utf8.fromBytes(decrypted1); + console.log('### decrypted text utf8 1',decryptedText); } catch (error) { console.log('### error 2', error) } diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 23a945fe3..d6c5393d7 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -11,6 +11,7 @@ const COMMAND_CONFIRM_NEXT = '/confirm-next' const COMMAND_CANCEL = '/cancel' const COMMAND_XPUB = '/xpub' const COMMAND_DH_EXCHANGE = '/dh-exchange' +const COMMAND_LOG = '/log' const DEFAULT_RECEIVE_GAP_LIMIT = 20 From e6c8865ecac54d3dd387b7a209118ff8ee195357 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 14:12:40 +0300 Subject: [PATCH 225/421] feat: decrypt data from HWW --- .../components/serial-signer/serial-signer.js | 147 +++++++----------- 1 file changed, 58 insertions(+), 89 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 7966eea3a..8dadb1945 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -15,7 +15,7 @@ async function serialSigner(path) { receivedData: '', config: {}, decryptionKey: null, - dheKey: null, // todo: store in secure local storage + sharedSecret: null, // todo: store in secure local storage hww: { password: null, @@ -202,55 +202,8 @@ async function serialSigner(path) { } }, handleSerialPortResponse: async function (value) { - const command = value.split(' ')[0] - const commandData = value.substring(command.length).trim() - - if (command === COMMAND_DH_EXCHANGE) { - this.handleDhExchangeResponse(commandData) - return - } - switch (command) { - case COMMAND_DH_EXCHANGE: - this.handleDhExchangeResponse(commandData) - return - case COMMAND_LOG: - - console.log(` %c${commandData}`, 'background: #222; color: #bada55') - - return - } - if (this.dheKey) { - try { - console.log('### value', value) - const messageBin = nobleSecp256k1.utils.hexToBytes(value) - try { - const xx = await decryptMessage(this.dheKey, messageBin) - console.log('### xx: ', xx) - } catch (error) { - console.log('### error 1', error) - } - - try { - const decrypted1 = await decryptMessage2( - this.sharedSecret, - messageBin - ) - - console.log( - '### decrypted hex 1: ', - nobleSecp256k1.utils.bytesToHex(decrypted1) - ) - console.log('### decrypted text 1', new TextDecoder().decode(decrypted1)) - - var decryptedText = aesjs.utils.utf8.fromBytes(decrypted1); - console.log('### decrypted text utf8 1',decryptedText); - } catch (error) { - console.log('### error 2', error) - } - } catch (error) { - console.log(error) - } - } + console.log('### extract value', value) + const {command, commandData} = await this.extractCommand(value) switch (command) { case COMMAND_SIGN_PSBT: @@ -274,8 +227,17 @@ async function serialSigner(path) { case COMMAND_SEED: this.handleShowSeedResponse(commandData) break + case COMMAND_DH_EXCHANGE: + this.handleDhExchangeResponse(commandData) + break + case COMMAND_LOG: + console.log( + ` %c${commandData}`, + 'background: #222; color: #bada55' + ) + break default: - console.log('### hww console', value) + console.log(` %c${value}`, 'background: #222; color: red') } }, updateSerialPortConsole: function (value) { @@ -724,48 +686,55 @@ async function serialSigner(path) { const message = [command].concat(attrs).join(' ') const encodedMessage = asciiToUint8Array(message.length + ' ' + message) - // const encodedMessageHex = - // '6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710' - // const encodedMessage = nobleSecp256k1.utils.hexToBytes( - // encodedMessageHex - // ) const encrypted = await encryptMessage(this.dheKey, encodedMessage) const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) - console.log('### encrypted hex: ', encryptedHex) - - /* - - const decrypted = await decryptMessage(this.dheKey, encrypted) - console.log( - '### decrypted hex 0: ', - nobleSecp256k1.utils.bytesToHex(new Uint8Array(decrypted)) - ) - const encrypted1 = - '8f13a7763f021d7701f4100631f6c3d80576fcd0e3718b2594ceb7b910ceed29a334d1019dd6f0ffdba5b6be8c11637d6124d7adbd29c88af13800cb1f980f7d' - const encrypted1Bin = nobleSecp256k1.utils.hexToBytes(encrypted1) - - const decrypted1 = await decryptMessage2( - this.sharedSecret, - encrypted1Bin - ) - console.log( - '### decrypted hex 1: ', - nobleSecp256k1.utils.bytesToHex(decrypted1) - ) - - const encrypted2 = - '1e785d2d8cdf930aae61e8f3dbc5637917c1a621f4cdc6857cabbcdf696108d6b831cddce4c9f759e8b8eee2419f4a8f2133bb8893ae8bd251597439a6f4f7b172bd2c9eead0877cbf4cb996ad343330' - const encrypted2Bin = nobleSecp256k1.utils.hexToBytes(encrypted2) - - const decrypted2 = await decryptMessage(this.dheKey, encrypted2Bin) - console.log( - '### decrypted hex 2: ', - nobleSecp256k1.utils.bytesToHex(new Uint8Array(decrypted2)) - ) - */ - await this.writer.write(encryptedHex + '\n') + }, + extractCommand: async function (value) { + const command = value.split(' ')[0] + const commandData = value.substring(command.length).trim() + + if (command === COMMAND_DH_EXCHANGE || command === COMMAND_LOG) + return {command, commandData} + + const decryptedValue = await this.decryptData(value) + const decryptedCommand = decryptedValue.split(' ')[0] + const decryptedCommandData = decryptedValue.substring(decryptedCommand.length).trim() + return { + command: decryptedCommand, + commandData: decryptedCommandData + } + }, + decryptData: async function (value) { + if (!this.sharedSecret) { + this.$q.notify({ + type: 'warning', + message: 'Secure session not established!', + timeout: 10000 + }) + return '/error Secure session not established!' + } + try { + const messageBytes = nobleSecp256k1.utils.hexToBytes(value) + const decrypted1 = await decryptMessage2( + this.sharedSecret, + messageBytes + ) + const data = new TextDecoder().decode(decrypted1) + const [len] = data.split(' ') + const command = data.substring(len.length +1, +len + len.length + 1).trim() + console.log('### decryptData ', data, command) + return command + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to decrypt message from device!', + caption: `${error}`, + timeout: 10000 + }) + return '/error Failed to decrypt message from device!' + } } }, created: async function () { From 58ab68b876aa16694371382ae15e8c99c61efe27 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 15:12:03 +0300 Subject: [PATCH 226/421] feat: use `aes` lib foe encryption --- .../components/serial-signer/serial-signer.js | 91 ++++++++----------- .../watchonly/static/js/crypto/aes.js | 2 +- .../extensions/watchonly/static/js/utils.js | 31 +++++++ 3 files changed, 72 insertions(+), 52 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 8dadb1945..947a9cc73 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -66,12 +66,13 @@ async function serialSigner(path) { } try { - navigator.serial.addEventListener('connect', event => { - console.log('### navigator.serial event: connected!', event) + this.selectedPort = await navigator.serial.requestPort() + this.selectedPort.addEventListener('connect', event => { + console.log('### this.selectedPort event: connected!', event) }) - navigator.serial.addEventListener('disconnect', () => { - console.log('### navigator.serial event: disconnected!', event) + this.selectedPort.addEventListener('disconnect', () => { + console.log('### this.selectedPort event: disconnected!', event) this.selectedPort = null this.hww.authenticated = false this.$q.notify({ @@ -80,7 +81,7 @@ async function serialSigner(path) { timeout: 10000 }) }) - this.selectedPort = await navigator.serial.requestPort() + // Wait for the serial port to open. await this.selectedPort.open(config) this.startSerialPortReading() @@ -91,6 +92,7 @@ async function serialSigner(path) { ) this.writer = textEncoder.writable.getWriter() + this.hwwDhExchange() return true } catch (error) { this.selectedPort = null @@ -454,56 +456,32 @@ async function serialSigner(path) { timeout: 10000 }) }, - hwwHelp: async function () { - // const sharedSecret = - // 'f96c85875055a5586688fea4cf7c4a2bd9541ffcf34f9d663d97e0cf2f6af4af' - // const sharedSecretBytes = hexToBytes(sharedSecret) - // // console.log('### sharedSecret', sharedSecret) - // const key = await window.crypto.subtle.importKey( - // 'raw', - // sharedSecretBytes, - // { - // name: 'AES-CBC', - // length: 256 - // }, - // true, - // ['encrypt', 'decrypt'] - // ) - // d2b9e5e3ff8945236455424e9e25590b8264f13c7484862cca4f5b7b8bf8f1686d218b4f1aacdc27a1df71fa4b530adfd6c8cae6bd926d3f8be8ff55ee4358d1a32569e9f5263ffae7d0eaf413788498 - // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx - // 6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710 - // 8f13a7763f021d7701f4100631f6c3d80576fcd0e3718b2594ceb7b910ceed29a334d1019dd6f0ffdba5b6be8c11637d6124d7adbd29c88af13800cb1f980f7d - - // const message = - // 'TextMustBe16ByteTextMustBe16ByteTextMustBe16ByteTextMustBe16Byte' - // const encoded = asciiToUint8Array(message) - // const encrypted = await encryptMessage(key, encoded) - // const encryptedHex = bytesToHex(encrypted) - // console.log('### encrypted hex: ', encryptedHex) - - // const encryptedHex2 = await encryptMessage2(sharedSecretBytes, message) - // console.log('### encryptedHex2', encryptedHex2) - - // const decrypted = await decryptMessage(key, encrypted) - // console.log( - // '### decrypted hex: ', - // bytesToHex(new Uint8Array(decrypted)) - // ) - // console.log( - // '### decrypted ascii: ', - // new TextDecoder().decode(new Uint8Array(decrypted)) - // ) - + hwwDhExchange: async function () { try { this.decryptionKey = nobleSecp256k1.utils.randomPrivateKey() const publicKey = nobleSecp256k1.Point.fromPrivateKey( this.decryptionKey ) const publicKeyHex = publicKey.toHex().slice(2) - console.log('### publicKeyHex:', publicKeyHex) await this.writer.write( COMMAND_DH_EXCHANGE + ' ' + publicKeyHex + '\n' ) + this.$q.notify({ + type: 'positive', + message: 'Starting secure session!', + timeout: 5000 + }) + } catch (error) { + this.$q.notify({ + type: 'warning', + message: 'Failed to send DH Public Key to device!', + caption: `${error}`, + timeout: 10000 + }) + } + }, + hwwHelp: async function () { + try { this.$q.notify({ type: 'positive', message: 'Check display or console for details!', @@ -587,7 +565,7 @@ async function serialSigner(path) { }, handleDhExchangeResponse: async function (res = '') { console.log('### handleDhExchangeResponse', res) - const [pubKeyHex, fingerprint] = res.trim().split(' ') + const [pubKeyHex] = res.trim().split(' ') if (!pubKeyHex) { this.$q.notify({ type: 'warning', @@ -618,6 +596,11 @@ async function serialSigner(path) { true, ['encrypt', 'decrypt'] ) + this.$q.notify({ + type: 'positive', + message: 'Secure session created!', + timeout: 5000 + }) }, hwwShowSeed: async function () { try { @@ -685,8 +668,10 @@ async function serialSigner(path) { sendCommandSecure: async function (command, attrs = []) { const message = [command].concat(attrs).join(' ') - const encodedMessage = asciiToUint8Array(message.length + ' ' + message) - const encrypted = await encryptMessage(this.dheKey, encodedMessage) + const encrypted = await encryptMessage2( + this.sharedSecret, + message.length + ' ' + message + ) const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) await this.writer.write(encryptedHex + '\n') @@ -700,7 +685,9 @@ async function serialSigner(path) { const decryptedValue = await this.decryptData(value) const decryptedCommand = decryptedValue.split(' ')[0] - const decryptedCommandData = decryptedValue.substring(decryptedCommand.length).trim() + const decryptedCommandData = decryptedValue + .substring(decryptedCommand.length) + .trim() return { command: decryptedCommand, commandData: decryptedCommandData @@ -723,7 +710,9 @@ async function serialSigner(path) { ) const data = new TextDecoder().decode(decrypted1) const [len] = data.split(' ') - const command = data.substring(len.length +1, +len + len.length + 1).trim() + const command = data + .substring(len.length + 1, +len + len.length + 1) + .trim() console.log('### decryptData ', data, command) return command } catch (error) { diff --git a/lnbits/extensions/watchonly/static/js/crypto/aes.js b/lnbits/extensions/watchonly/static/js/crypto/aes.js index 2f6ef7607..8a28b655b 100644 --- a/lnbits/extensions/watchonly/static/js/crypto/aes.js +++ b/lnbits/extensions/watchonly/static/js/crypto/aes.js @@ -47,7 +47,7 @@ if (checkInt(arg.length) && checkInts(arg)) { return new Uint8Array(arg); } - + console.log('### aes encypt') throw new Error('unsupported array-like object'); } diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index d6c5393d7..36a2247c2 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -229,6 +229,37 @@ async function encryptMessage(key, message) { return new Uint8Array(ciphertext) } +async function encryptMessage2(key, message) { + // The iv must never be reused with a given key. + // iv = window.crypto.getRandomValues(new Uint8Array(16)); + while (message.length % 16 !== 0) message += ' ' + const encodedMessage = asciiToUint8Array(message) + iv = new Uint8Array([ + 0x00, + 0x01, + 0x02, + 0x03, + 0x04, + 0x05, + 0x06, + 0x07, + 0x08, + 0x09, + 0x0a, + 0x0b, + 0x0c, + 0x0d, + 0x0e, + 0x0f + ]) + + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const encryptedBytes = aesCbc.encrypt(encodedMessage) + + console.log('### #####################################') + return encryptedBytes +} + async function decryptMessage(key, ciphertext) { iv = new Uint8Array([ 0x00, From 1c03b28b77afb08720a73d646ac6ad408f7f1208 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 15:29:48 +0300 Subject: [PATCH 227/421] feat: add more logging for HWW --- .../components/serial-signer/serial-signer.js | 43 +++++++++---------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 947a9cc73..831400a56 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -204,8 +204,9 @@ async function serialSigner(path) { } }, handleSerialPortResponse: async function (value) { - console.log('### extract value', value) const {command, commandData} = await this.extractCommand(value) + this.logPublicCommandsResponse(command, commandData) + switch (command) { case COMMAND_SIGN_PSBT: @@ -242,6 +243,21 @@ async function serialSigner(path) { console.log(` %c${value}`, 'background: #222; color: red') } }, + logPublicCommandsResponse: function(command, commandData){ + switch (command) { + case COMMAND_SIGN_PSBT: + case COMMAND_PASSWORD: + case COMMAND_PASSWORD_CLEAR: + case COMMAND_SEND_PSBT: + case COMMAND_WIPE: + case COMMAND_XPUB: + case COMMAND_DH_EXCHANGE: + console.log( + ` %c${command} ${commandData}`, + 'background: #222; color: yellow' + ) + } + }, updateSerialPortConsole: function (value) { this.receivedData += value + '\n' const textArea = document.getElementById('serial-port-console') @@ -463,6 +479,7 @@ async function serialSigner(path) { this.decryptionKey ) const publicKeyHex = publicKey.toHex().slice(2) + // must not be encrypted await this.writer.write( COMMAND_DH_EXCHANGE + ' ' + publicKeyHex + '\n' ) @@ -532,11 +549,6 @@ async function serialSigner(path) { }, hwwXpub: async function (path) { try { - console.log( - '### hwwXpub', - COMMAND_XPUB + ' ' + this.network + ' ' + path - ) - await this.sendCommandSecure(COMMAND_XPUB, [this.network, path]) } catch (error) { this.$q.notify({ @@ -578,24 +590,11 @@ async function serialSigner(path) { } const hwwPublicKey = nobleSecp256k1.Point.fromHex('04' + pubKeyHex) - const sharedSecret = nobleSecp256k1 + this.sharedSecret = nobleSecp256k1 .getSharedSecret(this.decryptionKey, hwwPublicKey) .slice(1, 33) - this.sharedSecret = sharedSecret - console.log( - '### sharedSecret', - nobleSecp256k1.utils.bytesToHex(sharedSecret) - ) - this.dheKey = await window.crypto.subtle.importKey( - 'raw', - sharedSecret, - { - name: 'AES-CBC', - length: 256 - }, - true, - ['encrypt', 'decrypt'] - ) + + this.$q.notify({ type: 'positive', message: 'Secure session created!', From 19dfef6044a8c0e9151058cda1167bba32ed5df3 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 15:55:19 +0300 Subject: [PATCH 228/421] fix: help command --- .../watchonly/static/components/serial-signer/serial-signer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 831400a56..4766351f7 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -499,6 +499,7 @@ async function serialSigner(path) { }, hwwHelp: async function () { try { + await this.sendCommandSecure(COMMAND_HELP) this.$q.notify({ type: 'positive', message: 'Check display or console for details!', From a32754610ab7ac9cc8f1310e5ca4811ad9b43824 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Fri, 12 Aug 2022 16:52:55 +0300 Subject: [PATCH 229/421] feat: use random `IV` for each request --- .../components/serial-signer/serial-signer.js | 42 ++++-- .../watchonly/static/js/crypto/aes.js | 1 - .../extensions/watchonly/static/js/utils.js | 124 ------------------ 3 files changed, 29 insertions(+), 138 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js index 4766351f7..940d4ad63 100644 --- a/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js +++ b/lnbits/extensions/watchonly/static/components/serial-signer/serial-signer.js @@ -206,7 +206,6 @@ async function serialSigner(path) { handleSerialPortResponse: async function (value) { const {command, commandData} = await this.extractCommand(value) this.logPublicCommandsResponse(command, commandData) - switch (command) { case COMMAND_SIGN_PSBT: @@ -243,7 +242,7 @@ async function serialSigner(path) { console.log(` %c${value}`, 'background: #222; color: red') } }, - logPublicCommandsResponse: function(command, commandData){ + logPublicCommandsResponse: function (command, commandData) { switch (command) { case COMMAND_SIGN_PSBT: case COMMAND_PASSWORD: @@ -595,7 +594,6 @@ async function serialSigner(path) { .getSharedSecret(this.decryptionKey, hwwPublicKey) .slice(1, 33) - this.$q.notify({ type: 'positive', message: 'Secure session created!', @@ -666,15 +664,19 @@ async function serialSigner(path) { }, sendCommandSecure: async function (command, attrs = []) { + console.log('### sendCommandSecure') const message = [command].concat(attrs).join(' ') - - const encrypted = await encryptMessage2( + const iv = window.crypto.getRandomValues(new Uint8Array(16)) + const encrypted = await this.encryptMessage( this.sharedSecret, + iv, message.length + ' ' + message ) const encryptedHex = nobleSecp256k1.utils.bytesToHex(encrypted) - await this.writer.write(encryptedHex + '\n') + const encryptedIvHex = nobleSecp256k1.utils.bytesToHex(iv) + console.log('### encryptedIvHex', encryptedIvHex) + await this.writer.write(encryptedHex + encryptedIvHex + '\n') }, extractCommand: async function (value) { const command = value.split(' ')[0] @@ -695,17 +697,17 @@ async function serialSigner(path) { }, decryptData: async function (value) { if (!this.sharedSecret) { - this.$q.notify({ - type: 'warning', - message: 'Secure session not established!', - timeout: 10000 - }) return '/error Secure session not established!' } try { - const messageBytes = nobleSecp256k1.utils.hexToBytes(value) - const decrypted1 = await decryptMessage2( + const ivSize = 32 + const messageHex = value.substring(0, value.length - ivSize) + const ivHex = value.substring(value.length - ivSize) + const messageBytes = nobleSecp256k1.utils.hexToBytes(messageHex) + const iv = nobleSecp256k1.utils.hexToBytes(ivHex) + const decrypted1 = await this.decryptMessage( this.sharedSecret, + iv, messageBytes ) const data = new TextDecoder().decode(decrypted1) @@ -724,6 +726,20 @@ async function serialSigner(path) { }) return '/error Failed to decrypt message from device!' } + }, + encryptMessage: async function (key, iv, message) { + while (message.length % 16 !== 0) message += ' ' + const encodedMessage = asciiToUint8Array(message) + + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const encryptedBytes = aesCbc.encrypt(encodedMessage) + + return encryptedBytes + }, + decryptMessage: async function (key, iv, encryptedBytes) { + const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) + const decryptedBytes = aesCbc.decrypt(encryptedBytes) + return decryptedBytes } }, created: async function () { diff --git a/lnbits/extensions/watchonly/static/js/crypto/aes.js b/lnbits/extensions/watchonly/static/js/crypto/aes.js index 8a28b655b..92a17ca2a 100644 --- a/lnbits/extensions/watchonly/static/js/crypto/aes.js +++ b/lnbits/extensions/watchonly/static/js/crypto/aes.js @@ -47,7 +47,6 @@ if (checkInt(arg.length) && checkInts(arg)) { return new Uint8Array(arg); } - console.log('### aes encypt') throw new Error('unsupported array-like object'); } diff --git a/lnbits/extensions/watchonly/static/js/utils.js b/lnbits/extensions/watchonly/static/js/utils.js index 36a2247c2..adfd24225 100644 --- a/lnbits/extensions/watchonly/static/js/utils.js +++ b/lnbits/extensions/watchonly/static/js/utils.js @@ -184,9 +184,6 @@ function findAccountPathIssues(path = '') { } } -/////////////// -let ivHex = '000102030405060708090a0b0c0d0e0f' - function asciiToUint8Array(str) { var chars = [] for (var i = 0; i < str.length; ++i) { @@ -195,124 +192,3 @@ function asciiToUint8Array(str) { return new Uint8Array(chars) } -async function encryptMessage(key, message) { - // The iv must never be reused with a given key. - // iv = window.crypto.getRandomValues(new Uint8Array(16)); - iv = new Uint8Array([ - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f - ]) - const ciphertext = await window.crypto.subtle.encrypt( - { - name: 'AES-CBC', - iv - }, - key, - message - ) - - console.log('### #####################################') - return new Uint8Array(ciphertext) -} - -async function encryptMessage2(key, message) { - // The iv must never be reused with a given key. - // iv = window.crypto.getRandomValues(new Uint8Array(16)); - while (message.length % 16 !== 0) message += ' ' - const encodedMessage = asciiToUint8Array(message) - iv = new Uint8Array([ - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f - ]) - - const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) - const encryptedBytes = aesCbc.encrypt(encodedMessage) - - console.log('### #####################################') - return encryptedBytes -} - -async function decryptMessage(key, ciphertext) { - iv = new Uint8Array([ - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f - ]) - - let decrypted = await window.crypto.subtle.decrypt( - { - name: 'AES-CBC', - iv - }, - key, - ciphertext - ) - - return decrypted -} - -async function decryptMessage2(key, encryptedBytes) { - iv = new Uint8Array([ - 0x00, - 0x01, - 0x02, - 0x03, - 0x04, - 0x05, - 0x06, - 0x07, - 0x08, - 0x09, - 0x0a, - 0x0b, - 0x0c, - 0x0d, - 0x0e, - 0x0f - ]) - const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv) - const decryptedBytes = aesCbc.decrypt(encryptedBytes) - console.log('### decryptedBytes', decryptedBytes) - return decryptedBytes -} From 3457ff101e3d8dfc1bbd87c507851743c35947a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Fri, 12 Aug 2022 21:05:13 +0200 Subject: [PATCH 230/421] fix regtest (#867) Co-authored-by: dni --- .github/workflows/regtest.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index fcd3c164f..e35c9f930 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -17,6 +17,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | + docker build -t lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests @@ -40,7 +41,7 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - file: ./coverage.xml + file: ./coverage.xml LndWallet: runs-on: ubuntu-latest strategy: @@ -55,6 +56,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | + docker build -t lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests @@ -76,11 +78,11 @@ jobs: LND_GRPC_MACAROON: docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon run: | sudo chmod -R a+rwx . && rm -rf ./data && mkdir -p ./data - make test-real-wallet + make test-real-wallet - name: Upload coverage to Codecov uses: codecov/codecov-action@v3 with: - file: ./coverage.xml + file: ./coverage.xml CoreLightningWallet: runs-on: ubuntu-latest strategy: @@ -95,6 +97,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | + docker build -t lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests From e5d8c500d29d3cdaf0e87b11aec772346fe5c03e Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sat, 13 Aug 2022 14:29:04 +0200 Subject: [PATCH 231/421] Wallets/unhashed_description (#870) * new argument: unhashed_description * accept in api * set unhashed_description for memo case * bolt11.py: dont be like CLN, accept the hash * send hash to lnd in b64 * fix cln * skip descr_hash for cln * skip * format --- lnbits/bolt11.py | 2 +- lnbits/core/services.py | 6 +++++- lnbits/core/views/api.py | 8 ++++++++ lnbits/wallets/cliche.py | 13 ++++++++++--- lnbits/wallets/cln.py | 11 +++++++---- lnbits/wallets/eclair.py | 5 ++++- lnbits/wallets/fake.py | 6 +++++- lnbits/wallets/lnbits.py | 5 ++++- lnbits/wallets/lndgrpc.py | 7 ++++--- lnbits/wallets/lndrest.py | 8 +++++++- lnbits/wallets/lnpay.py | 6 +++++- lnbits/wallets/lntxbot.py | 6 +++++- lnbits/wallets/opennode.py | 4 +++- lnbits/wallets/spark.py | 10 +++++++++- lnbits/wallets/void.py | 1 + tests/core/views/test_api.py | 24 +++++++++++++++++++++++- 16 files changed, 101 insertions(+), 21 deletions(-) diff --git a/lnbits/bolt11.py b/lnbits/bolt11.py index 670397409..32b43feb6 100644 --- a/lnbits/bolt11.py +++ b/lnbits/bolt11.py @@ -216,7 +216,7 @@ def lnencode(addr, privkey): expirybits = expirybits[5:] data += tagged("x", expirybits) elif k == "h": - data += tagged_bytes("h", hashlib.sha256(v.encode("utf-8")).digest()) + data += tagged_bytes("h", v) elif k == "n": data += tagged_bytes("n", v) else: diff --git a/lnbits/core/services.py b/lnbits/core/services.py index 678c89e30..6cfad7b4e 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -54,6 +54,7 @@ async def create_invoice( amount: int, # in satoshis memo: str, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, extra: Optional[Dict] = None, webhook: Optional[str] = None, internal: Optional[bool] = False, @@ -65,7 +66,10 @@ async def create_invoice( wallet = FAKE_WALLET if internal else WALLET ok, checking_id, payment_request, error_message = await wallet.create_invoice( - amount=amount, memo=invoice_memo, description_hash=description_hash + amount=amount, + memo=invoice_memo, + description_hash=description_hash, + unhashed_description=unhashed_description, ) if not ok: raise InvoiceFailure(error_message or "unexpected backend error.") diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index ac61e52fd..fbe5f100b 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -141,6 +141,7 @@ class CreateInvoiceData(BaseModel): memo: Optional[str] = None unit: Optional[str] = "sat" description_hash: Optional[str] = None + unhashed_description: Optional[str] = None lnurl_callback: Optional[str] = None lnurl_balance_check: Optional[str] = None extra: Optional[dict] = None @@ -152,9 +153,15 @@ class CreateInvoiceData(BaseModel): async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet): if data.description_hash: description_hash = unhexlify(data.description_hash) + unhashed_description = b"" + memo = "" + elif data.unhashed_description: + unhashed_description = unhexlify(data.unhashed_description) + description_hash = b"" memo = "" else: description_hash = b"" + unhashed_description = b"" memo = data.memo or LNBITS_SITE_TITLE if data.unit == "sat": amount = int(data.amount) @@ -170,6 +177,7 @@ async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet): amount=amount, memo=memo, description_hash=description_hash, + unhashed_description=unhashed_description, extra=data.extra, webhook=data.webhook, internal=data.internal, diff --git a/lnbits/wallets/cliche.py b/lnbits/wallets/cliche.py index 7c0347176..9dbe5a229 100644 --- a/lnbits/wallets/cliche.py +++ b/lnbits/wallets/cliche.py @@ -46,12 +46,19 @@ class ClicheWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: - if description_hash: - description_hash_hashed = hashlib.sha256(description_hash).hexdigest() + if unhashed_description or description_hash: + description_hash_str = ( + description_hash.hex() + if description_hash + else hashlib.sha256(unhashed_description).hexdigest() + if unhashed_description + else None + ) ws = create_connection(self.endpoint) ws.send( - f"create-invoice --msatoshi {amount*1000} --description_hash {description_hash_hashed}" + f"create-invoice --msatoshi {amount*1000} --description_hash {description_hash_str}" ) r = ws.recv() else: diff --git a/lnbits/wallets/cln.py b/lnbits/wallets/cln.py index a92501f25..fe6ee2eb6 100644 --- a/lnbits/wallets/cln.py +++ b/lnbits/wallets/cln.py @@ -82,21 +82,24 @@ class CoreLightningWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: label = "lbl{}".format(random.random()) msat: int = int(amount * 1000) try: - if description_hash and not self.supports_description_hash: + if description_hash: raise Unsupported("description_hash") + if unhashed_description and not self.supports_description_hash: + raise Unsupported("unhashed_description") r = self.ln.invoice( msatoshi=msat, label=label, - description=description_hash.decode("utf-8") - if description_hash + description=unhashed_description.decode("utf-8") + if unhashed_description else memo, exposeprivatechannels=True, deschashonly=True - if description_hash + if unhashed_description else False, # we can't pass None here ) diff --git a/lnbits/wallets/eclair.py b/lnbits/wallets/eclair.py index 0a4f1f3e4..247b96e1e 100644 --- a/lnbits/wallets/eclair.py +++ b/lnbits/wallets/eclair.py @@ -69,11 +69,14 @@ class EclairWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: data: Dict = {"amountMsat": amount * 1000} if description_hash: - data["description_hash"] = hashlib.sha256(description_hash).hexdigest() + data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["description"] = memo or "" diff --git a/lnbits/wallets/fake.py b/lnbits/wallets/fake.py index 80a3d8c65..8424001b2 100644 --- a/lnbits/wallets/fake.py +++ b/lnbits/wallets/fake.py @@ -35,6 +35,7 @@ class FakeWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: # we set a default secret since FakeWallet is used for internal=True invoices # and the user might not have configured a secret yet @@ -61,7 +62,10 @@ class FakeWallet(Wallet): data["timestamp"] = datetime.now().timestamp() if description_hash: data["tags_set"] = ["h"] - data["description_hash"] = description_hash.decode("utf-8") + data["description_hash"] = description_hash + elif unhashed_description: + data["tags_set"] = ["d"] + data["description_hash"] = hashlib.sha256(unhashed_description).digest() else: data["tags_set"] = ["d"] data["memo"] = memo diff --git a/lnbits/wallets/lnbits.py b/lnbits/wallets/lnbits.py index 677b518aa..96b7dbb63 100644 --- a/lnbits/wallets/lnbits.py +++ b/lnbits/wallets/lnbits.py @@ -57,10 +57,13 @@ class LNbitsWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: data: Dict = {"out": False, "amount": amount} if description_hash: - data["description_hash"] = hashlib.sha256(description_hash).hexdigest() + data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["memo"] = memo or "" diff --git a/lnbits/wallets/lndgrpc.py b/lnbits/wallets/lndgrpc.py index fee8b955a..10bd27e7f 100644 --- a/lnbits/wallets/lndgrpc.py +++ b/lnbits/wallets/lndgrpc.py @@ -134,14 +134,15 @@ class LndWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, ) -> InvoiceResponse: params: Dict = {"value": amount, "expiry": 600, "private": True} - if description_hash: + params["description_hash"] = description_hash + elif unhashed_description: params["description_hash"] = hashlib.sha256( - description_hash + unhashed_description ).digest() # as bytes directly - else: params["memo"] = memo or "" diff --git a/lnbits/wallets/lndrest.py b/lnbits/wallets/lndrest.py index 9f7f95581..6bdbe5e07 100644 --- a/lnbits/wallets/lndrest.py +++ b/lnbits/wallets/lndrest.py @@ -73,11 +73,17 @@ class LndRestWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"value": amount, "private": True} if description_hash: + data["description_hash"] = base64.b64encode(description_hash).decode( + "ascii" + ) + elif unhashed_description: data["description_hash"] = base64.b64encode( - hashlib.sha256(description_hash).digest() + hashlib.sha256(unhashed_description).digest() ).decode("ascii") else: data["memo"] = memo or "" diff --git a/lnbits/wallets/lnpay.py b/lnbits/wallets/lnpay.py index 7ba45a228..de0a60a84 100644 --- a/lnbits/wallets/lnpay.py +++ b/lnbits/wallets/lnpay.py @@ -52,10 +52,14 @@ class LNPayWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"num_satoshis": f"{amount}"} if description_hash: - data["description_hash"] = hashlib.sha256(description_hash).hexdigest() + data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["memo"] = memo or "" diff --git a/lnbits/wallets/lntxbot.py b/lnbits/wallets/lntxbot.py index 9b0954e9e..ba310823a 100644 --- a/lnbits/wallets/lntxbot.py +++ b/lnbits/wallets/lntxbot.py @@ -52,10 +52,14 @@ class LntxbotWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: data: Dict = {"amt": str(amount)} if description_hash: - data["description_hash"] = hashlib.sha256(description_hash).hexdigest() + data["description_hash"] = description_hash.hex() + elif unhashed_description: + data["description_hash"] = hashlib.sha256(unhashed_description).hexdigest() else: data["memo"] = memo or "" diff --git a/lnbits/wallets/opennode.py b/lnbits/wallets/opennode.py index 0760d186b..9fcf374a7 100644 --- a/lnbits/wallets/opennode.py +++ b/lnbits/wallets/opennode.py @@ -54,8 +54,10 @@ class OpenNodeWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: - if description_hash: + if description_hash or unhashed_description: raise Unsupported("description_hash") async with httpx.AsyncClient() as client: diff --git a/lnbits/wallets/spark.py b/lnbits/wallets/spark.py index 55758aab0..a26177db9 100644 --- a/lnbits/wallets/spark.py +++ b/lnbits/wallets/spark.py @@ -93,6 +93,8 @@ class SparkWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + unhashed_description: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: label = "lbs{}".format(random.random()) checking_id = label @@ -102,7 +104,13 @@ class SparkWallet(Wallet): r = await self.invoicewithdescriptionhash( msatoshi=amount * 1000, label=label, - description_hash=hashlib.sha256(description_hash).hexdigest(), + description_hash=description_hash.hex(), + ) + elif unhashed_description: + r = await self.invoicewithdescriptionhash( + msatoshi=amount * 1000, + label=label, + description_hash=hashlib.sha256(unhashed_description).hexdigest(), ) else: r = await self.invoice( diff --git a/lnbits/wallets/void.py b/lnbits/wallets/void.py index d6a01d3ad..0de387aae 100644 --- a/lnbits/wallets/void.py +++ b/lnbits/wallets/void.py @@ -18,6 +18,7 @@ class VoidWallet(Wallet): amount: int, memo: Optional[str] = None, description_hash: Optional[bytes] = None, + **kwargs, ) -> InvoiceResponse: raise Unsupported("") diff --git a/tests/core/views/test_api.py b/tests/core/views/test_api.py index 9dd13004c..501379b8f 100644 --- a/tests/core/views/test_api.py +++ b/tests/core/views/test_api.py @@ -11,6 +11,7 @@ from lnbits.core.views.api import ( api_payment, api_payments_create_invoice, ) +from lnbits.settings import wallet_class from ...helpers import get_random_invoice_data @@ -192,11 +193,32 @@ async def test_api_payment_with_key(invoice, inkey_headers_from): # check POST /api/v1/payments: invoice creation with a description hash +@pytest.mark.skipif( + wallet_class.__name__ in ["CoreLightningWallet"], + reason="wallet does not support description_hash", +) @pytest.mark.asyncio async def test_create_invoice_with_description_hash(client, inkey_headers_to): data = await get_random_invoice_data() descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest() - data["description_hash"] = "asdasdasd".encode("utf-8").hex() + data["description_hash"] = descr_hash + + response = await client.post( + "/api/v1/payments", json=data, headers=inkey_headers_to + ) + invoice = response.json() + + invoice_bolt11 = bolt11.decode(invoice["payment_request"]) + assert invoice_bolt11.description_hash == descr_hash + assert invoice_bolt11.description is None + return invoice + + +@pytest.mark.asyncio +async def test_create_invoice_with_unhashed_description(client, inkey_headers_to): + data = await get_random_invoice_data() + descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest() + data["unhashed_description"] = "asdasdasd".encode("utf-8").hex() response = await client.post( "/api/v1/payments", json=data, headers=inkey_headers_to From 32a09f73590ed04bd5db275bc20d527271e5046b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Sat, 13 Aug 2022 14:41:23 +0200 Subject: [PATCH 232/421] add apache2 reverse proxy documentation (#868) * add apache2 reverse proxy documentation * add certbot Co-authored-by: dni --- docs/guide/installation.md | 43 +++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index d9b8d5d27..7885ff7e0 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -216,6 +216,47 @@ sudo systemctl enable lnbits.service sudo systemctl start lnbits.service ``` +## Running behind an apache2 reverse proxy over https +Install apache2 and enable apache2 mods +```sh +apt-get install apache2 certbot +a2enmod headers ssl proxy proxy-http +``` +create a ssl certificate with letsencrypt +```sh +certbot certonly --webroot --agree-tos --text --non-interactive --webroot-path /var/www/html -d lnbits.org +``` +create a apache2 vhost at: /etc/apache2/sites-enabled/lnbits.conf +```sh +cat < /etc/apache2/sites-enabled/lnbits.conf + + ServerName lnbits.org + SSLEngine On + SSLProxyEngine On + SSLCertificateFile /etc/letsencrypt/live/lnbits.org/fullchain.pem + SSLCertificateKeyFile /etc/letsencrypt/live/lnbits.org/privkey.pem + Include /etc/letsencrypt/options-ssl-apache.conf + LogLevel info + ErrorLog /var/log/apache2/lnbits.log + CustomLog /var/log/apache2/lnbits-access.log combined + RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME} + RequestHeader set "X-Forwarded-SSL" expr=%{HTTPS} + ProxyPreserveHost On + ProxyPass / http://localhost:5000/ + ProxyPassReverse / http://localhost:5000/ + + Order deny,allow + Allow from all + + +EOF +``` +restart apache2 +```sh +service restart apache2 +``` + + ## Using https without reverse proxy The most common way of using LNbits via https is to use a reverse proxy such as Caddy, nginx, or ngriok. However, you can also run LNbits via https without additional software. This is useful for development purposes or if you want to use LNbits in your local network. @@ -236,7 +277,7 @@ To create a certificate, first `cd` into your LNbits folder and execute the foll ```sh openssl req -new -newkey rsa:4096 -x509 -sha256 -days 3650 -nodes -out cert.pem -keyout key.pem ``` -This will create two new files (`key.pem` and `cert.pem `). +This will create two new files (`key.pem` and `cert.pem `). Alternatively, you can use mkcert ([more info](https://kifarunix.com/how-to-create-self-signed-ssl-certificate-with-mkcert-on-ubuntu-18-04/)): ```sh From 28661903b64c8206ad329164655e815cac570c92 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sat, 13 Aug 2022 14:41:44 +0200 Subject: [PATCH 233/421] return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing (#869) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing * fix regtest (#867) Co-authored-by: dni * return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing Co-authored-by: dni ⚡ Co-authored-by: dni --- lnbits/core/views/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index fbe5f100b..5a6d11404 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -270,7 +270,7 @@ async def api_payments_create( return await api_payments_create_invoice(invoiceData, wallet.wallet) else: raise HTTPException( - status_code=HTTPStatus.BAD_REQUEST, + status_code=HTTPStatus.UNAUTHORIZED, detail="Invoice (or Admin) key required.", ) From 034813a1ab66a253ecc753b2f8c8df93ef1c735a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Sat, 13 Aug 2022 14:46:47 +0200 Subject: [PATCH 234/421] stuck in retrying backend loop, fix issue #652 (#862) * maybe solution to issue #652 * formatting, when precommit merge? * Update lnbits/app.py * Update lnbits/app.py Co-authored-by: dni Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> --- lnbits/app.py | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index e1594a7b4..e2df6629d 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -1,6 +1,7 @@ import asyncio import importlib import logging +import signal import sys import traceback import warnings @@ -101,16 +102,27 @@ def create_app(config_object="lnbits.settings") -> FastAPI: def check_funding_source(app: FastAPI) -> None: @app.on_event("startup") async def check_wallet_status(): + original_sigint_handler = signal.getsignal(signal.SIGINT) + + def signal_handler(signal, frame): + logger.debug(f"SIGINT received, terminating LNbits.") + sys.exit(1) + + signal.signal(signal.SIGINT, signal_handler) while True: - error_message, balance = await WALLET.status() - if not error_message: - break - logger.error( - f"The backend for {WALLET.__class__.__name__} isn't working properly: '{error_message}'", - RuntimeWarning, - ) - logger.info("Retrying connection to backend in 5 seconds...") - await asyncio.sleep(5) + try: + error_message, balance = await WALLET.status() + if not error_message: + break + logger.error( + f"The backend for {WALLET.__class__.__name__} isn't working properly: '{error_message}'", + RuntimeWarning, + ) + logger.info("Retrying connection to backend in 5 seconds...") + await asyncio.sleep(5) + except: + pass + signal.signal(signal.SIGINT, original_sigint_handler) logger.info( f"✔️ Backend {WALLET.__class__.__name__} connected and with a balance of {balance} msat." ) From d9894415875fb3628ca21c7cb0f83f48b04c19d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Sat, 13 Aug 2022 14:47:29 +0200 Subject: [PATCH 235/421] added test for issue #847 and fixed it! (#848) * added test for empty post data, for issue #847 * black * fixed the failing testcase * Update lnbits/decorators.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> Co-authored-by: dni Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> --- lnbits/decorators.py | 8 +++++++- tests/core/views/test_api.py | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lnbits/decorators.py b/lnbits/decorators.py index 6685cfb2d..090c11c51 100644 --- a/lnbits/decorators.py +++ b/lnbits/decorators.py @@ -199,7 +199,13 @@ async def require_invoice_key( api_key_header: str = Security(api_key_header), # type: ignore api_key_query: str = Security(api_key_query), # type: ignore ): - token = api_key_header if api_key_header else api_key_query + token = api_key_header or api_key_query + + if token is None: + raise HTTPException( + status_code=status.HTTP_401_UNAUTHORIZED, + detail="Invoice (or Admin) key required.", + ) wallet = await get_key_type(r, token) diff --git a/tests/core/views/test_api.py b/tests/core/views/test_api.py index 501379b8f..219762d3c 100644 --- a/tests/core/views/test_api.py +++ b/tests/core/views/test_api.py @@ -45,6 +45,13 @@ async def test_get_wallet_adminkey(client, adminkey_headers_to): assert "id" in result +# check POST /api/v1/payments: empty request +@pytest.mark.asyncio +async def test_post_empty_request(client): + response = await client.post("/api/v1/payments") + assert response.status_code == 401 + + # check POST /api/v1/payments: invoice creation @pytest.mark.asyncio async def test_create_invoice(client, inkey_headers_to): From 197ff7d054f7f1780cd2354748154fa483e18cef Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Sat, 13 Aug 2022 19:19:08 +0100 Subject: [PATCH 236/421] Core: reserve fee as an .env variable (#631) * reserve fee as an .env variable * fixed bad import * Update .env.example Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> * Update lnbits/core/services.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> * Update lnbits/core/services.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> * Update lnbits/settings.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> * variable consistent names * fix services.py variable names * percent default fix * Update lnbits/settings.py int to float * Update lnbits/settings.py int to float * Update .env.example int to float * make format * fixed failing bleskomat test, expecting 2000 msats fee * Update tests/extensions/bleskomat/test_lnurl_api.py revert to 2 sat * Update .env.example * Update lnbits/settings.py Co-authored-by: calle <93376500+callebtc@users.noreply.github.com> --- .env.example | 2 ++ lnbits/core/services.py | 6 +++--- lnbits/settings.py | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index ec980775f..97105bc3f 100644 --- a/.env.example +++ b/.env.example @@ -25,6 +25,8 @@ LNBITS_DATA_FOLDER="./data" LNBITS_FORCE_HTTPS=true LNBITS_SERVICE_FEE="0.0" +LNBITS_RESERVE_FEE_MIN=2000 # value in millisats +LNBITS_RESERVE_FEE_PERCENT=1.0 # value in percent # Change theme LNBITS_SITE_TITLE="LNbits" diff --git a/lnbits/core/services.py b/lnbits/core/services.py index 6cfad7b4e..90f621862 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -21,7 +21,7 @@ from lnbits.decorators import ( ) from lnbits.helpers import url_for, urlsafe_short_hash from lnbits.requestvars import g -from lnbits.settings import FAKE_WALLET, WALLET +from lnbits.settings import FAKE_WALLET, RESERVE_FEE_MIN, RESERVE_FEE_PERCENT, WALLET from lnbits.wallets.base import PaymentResponse, PaymentStatus from . import db @@ -160,7 +160,7 @@ async def pay_invoice( logger.debug("balance is too low, deleting temporary payment") if not internal_checking_id and wallet.balance_msat > -fee_reserve_msat: raise PaymentFailure( - f"You must reserve at least 1% ({round(fee_reserve_msat/1000)} sat) to cover potential routing fees." + f"You must reserve at least ({round(fee_reserve_msat/1000)} sat) to cover potential routing fees." ) raise PermissionError("Insufficient balance.") @@ -366,4 +366,4 @@ async def check_transaction_status( # WARN: this same value must be used for balance check and passed to WALLET.pay_invoice(), it may cause a vulnerability if the values differ def fee_reserve(amount_msat: int) -> int: - return max(2000, int(amount_msat * 0.01)) + return max(int(RESERVE_FEE_MIN), int(amount_msat * RESERVE_FEE_PERCENT / 100.0)) diff --git a/lnbits/settings.py b/lnbits/settings.py index 5778b9e23..79c74fb45 100644 --- a/lnbits/settings.py +++ b/lnbits/settings.py @@ -55,6 +55,8 @@ FAKE_WALLET = getattr(wallets_module, "FakeWallet")() DEFAULT_WALLET_NAME = env.str("LNBITS_DEFAULT_WALLET_NAME", default="LNbits wallet") PREFER_SECURE_URLS = env.bool("LNBITS_FORCE_HTTPS", default=True) +RESERVE_FEE_MIN = env.int("LNBITS_RESERVE_FEE_MIN", default=2000) +RESERVE_FEE_PERCENT = env.float("LNBITS_RESERVE_FEE_PERCENT", default=1.0) SERVICE_FEE = env.float("LNBITS_SERVICE_FEE", default=0.0) try: From c32ff1de59345e148d55872f1de02376c541d87d Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Sat, 13 Aug 2022 13:37:44 -0600 Subject: [PATCH 237/421] New Extension: Invoicing (#733) * initial commit * add docs * black & prettier * mobile styles * add print view * prettier * make format * initial migrations un-messed * make migrations work for sqlite * add invoices table * clean migrations * add migration to conv * fix card size * hopefully fix test migration * add missing status * timestamp * init testing * remove draft invoice by default on create * what should i test * make format * raise if not invoice * new test and renaming * fix issue reported by @talvasconcelos which prevented users from setting status on creation * readme * run black * trying to make tests work * make it work again * send paid amount * partial pay flow * good coding * can't get these test to work * clean up and commenting * make format * validation for 2 decimals Co-authored-by: ben Co-authored-by: Tiago vasconcelos --- lnbits/extensions/invoices/README.md | 19 + lnbits/extensions/invoices/__init__.py | 36 ++ lnbits/extensions/invoices/config.json | 6 + lnbits/extensions/invoices/crud.py | 206 +++++++ lnbits/extensions/invoices/migrations.py | 55 ++ lnbits/extensions/invoices/models.py | 104 ++++ lnbits/extensions/invoices/static/css/pay.css | 55 ++ lnbits/extensions/invoices/tasks.py | 51 ++ .../templates/invoices/_api_docs.html | 153 +++++ .../invoices/templates/invoices/index.html | 571 ++++++++++++++++++ .../invoices/templates/invoices/pay.html | 430 +++++++++++++ lnbits/extensions/invoices/views.py | 59 ++ lnbits/extensions/invoices/views_api.py | 136 +++++ tests/data/mock_data.zip | Bin 24976 -> 26065 bytes tests/extensions/invoices/__init__.py | 0 tests/extensions/invoices/conftest.py | 37 ++ .../extensions/invoices/test_invoices_api.py | 135 +++++ 17 files changed, 2053 insertions(+) create mode 100644 lnbits/extensions/invoices/README.md create mode 100644 lnbits/extensions/invoices/__init__.py create mode 100644 lnbits/extensions/invoices/config.json create mode 100644 lnbits/extensions/invoices/crud.py create mode 100644 lnbits/extensions/invoices/migrations.py create mode 100644 lnbits/extensions/invoices/models.py create mode 100644 lnbits/extensions/invoices/static/css/pay.css create mode 100644 lnbits/extensions/invoices/tasks.py create mode 100644 lnbits/extensions/invoices/templates/invoices/_api_docs.html create mode 100644 lnbits/extensions/invoices/templates/invoices/index.html create mode 100644 lnbits/extensions/invoices/templates/invoices/pay.html create mode 100644 lnbits/extensions/invoices/views.py create mode 100644 lnbits/extensions/invoices/views_api.py create mode 100644 tests/extensions/invoices/__init__.py create mode 100644 tests/extensions/invoices/conftest.py create mode 100644 tests/extensions/invoices/test_invoices_api.py diff --git a/lnbits/extensions/invoices/README.md b/lnbits/extensions/invoices/README.md new file mode 100644 index 000000000..2b5bd538d --- /dev/null +++ b/lnbits/extensions/invoices/README.md @@ -0,0 +1,19 @@ +# Invoices + +## Create invoices that you can send to your client to pay online over Lightning. + +This extension allows users to create "traditional" invoices (not in the lightning sense) that contain one or more line items. Line items are denominated in a user-configurable fiat currency. Each invoice contains one or more payments up to the total of the invoice. Each invoice creates a public link that can be shared with a customer that they can use to (partially or in full) pay the invoice. + +## Usage + +1. Create an invoice by clicking "NEW INVOICE"\ + ![create new invoice](https://imgur.com/a/Dce3wrr.png) +2. Fill the options for your INVOICE + - select the wallet + - select the fiat currency the invoice will be denominated in + - select a status for the invoice (default is draft) + - enter a company name, first name, last name, email, phone & address (optional) + - add one or more line items + - enter a name & price for each line item +3. You can then use share your invoice link with your customer to receive payment\ + ![invoice link](https://imgur.com/a/L0JOj4T.png) \ No newline at end of file diff --git a/lnbits/extensions/invoices/__init__.py b/lnbits/extensions/invoices/__init__.py new file mode 100644 index 000000000..0b60837bb --- /dev/null +++ b/lnbits/extensions/invoices/__init__.py @@ -0,0 +1,36 @@ +import asyncio + +from fastapi import APIRouter +from starlette.staticfiles import StaticFiles + +from lnbits.db import Database +from lnbits.helpers import template_renderer +from lnbits.tasks import catch_everything_and_restart + +db = Database("ext_invoices") + +invoices_static_files = [ + { + "path": "/invoices/static", + "app": StaticFiles(directory="lnbits/extensions/invoices/static"), + "name": "invoices_static", + } +] + +invoices_ext: APIRouter = APIRouter(prefix="/invoices", tags=["invoices"]) + + +def invoices_renderer(): + return template_renderer(["lnbits/extensions/invoices/templates"]) + + +from .tasks import wait_for_paid_invoices + + +def invoices_start(): + loop = asyncio.get_event_loop() + loop.create_task(catch_everything_and_restart(wait_for_paid_invoices)) + + +from .views import * # noqa +from .views_api import * # noqa diff --git a/lnbits/extensions/invoices/config.json b/lnbits/extensions/invoices/config.json new file mode 100644 index 000000000..0811e0efd --- /dev/null +++ b/lnbits/extensions/invoices/config.json @@ -0,0 +1,6 @@ +{ + "name": "Invoices", + "short_description": "Create invoices for your clients.", + "icon": "request_quote", + "contributors": ["leesalminen"] +} diff --git a/lnbits/extensions/invoices/crud.py b/lnbits/extensions/invoices/crud.py new file mode 100644 index 000000000..4fd055e9c --- /dev/null +++ b/lnbits/extensions/invoices/crud.py @@ -0,0 +1,206 @@ +from typing import List, Optional, Union + +from lnbits.helpers import urlsafe_short_hash + +from . import db +from .models import ( + CreateInvoiceData, + CreateInvoiceItemData, + CreatePaymentData, + Invoice, + InvoiceItem, + Payment, + UpdateInvoiceData, + UpdateInvoiceItemData, +) + + +async def get_invoice(invoice_id: str) -> Optional[Invoice]: + row = await db.fetchone( + "SELECT * FROM invoices.invoices WHERE id = ?", (invoice_id,) + ) + return Invoice.from_row(row) if row else None + + +async def get_invoice_items(invoice_id: str) -> List[InvoiceItem]: + rows = await db.fetchall( + f"SELECT * FROM invoices.invoice_items WHERE invoice_id = ?", (invoice_id,) + ) + + return [InvoiceItem.from_row(row) for row in rows] + + +async def get_invoice_item(item_id: str) -> InvoiceItem: + row = await db.fetchone( + "SELECT * FROM invoices.invoice_items WHERE id = ?", (item_id,) + ) + return InvoiceItem.from_row(row) if row else None + + +async def get_invoice_total(items: List[InvoiceItem]) -> int: + return sum(item.amount for item in items) + + +async def get_invoices(wallet_ids: Union[str, List[str]]) -> List[Invoice]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM invoices.invoices WHERE wallet IN ({q})", (*wallet_ids,) + ) + + return [Invoice.from_row(row) for row in rows] + + +async def get_invoice_payments(invoice_id: str) -> List[Payment]: + rows = await db.fetchall( + f"SELECT * FROM invoices.payments WHERE invoice_id = ?", (invoice_id,) + ) + + return [Payment.from_row(row) for row in rows] + + +async def get_invoice_payment(payment_id: str) -> Payment: + row = await db.fetchone( + "SELECT * FROM invoices.payments WHERE id = ?", (payment_id,) + ) + return Payment.from_row(row) if row else None + + +async def get_payments_total(payments: List[Payment]) -> int: + return sum(item.amount for item in payments) + + +async def create_invoice_internal(wallet_id: str, data: CreateInvoiceData) -> Invoice: + invoice_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.invoices (id, wallet, status, currency, company_name, first_name, last_name, email, phone, address) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + invoice_id, + wallet_id, + data.status, + data.currency, + data.company_name, + data.first_name, + data.last_name, + data.email, + data.phone, + data.address, + ), + ) + + invoice = await get_invoice(invoice_id) + assert invoice, "Newly created invoice couldn't be retrieved" + return invoice + + +async def create_invoice_items( + invoice_id: str, data: List[CreateInvoiceItemData] +) -> List[InvoiceItem]: + for item in data: + item_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.invoice_items (id, invoice_id, description, amount) + VALUES (?, ?, ?, ?) + """, + ( + item_id, + invoice_id, + item.description, + int(item.amount * 100), + ), + ) + + invoice_items = await get_invoice_items(invoice_id) + return invoice_items + + +async def update_invoice_internal(wallet_id: str, data: UpdateInvoiceData) -> Invoice: + await db.execute( + """ + UPDATE invoices.invoices + SET wallet = ?, currency = ?, status = ?, company_name = ?, first_name = ?, last_name = ?, email = ?, phone = ?, address = ? + WHERE id = ? + """, + ( + wallet_id, + data.currency, + data.status, + data.company_name, + data.first_name, + data.last_name, + data.email, + data.phone, + data.address, + data.id, + ), + ) + + invoice = await get_invoice(data.id) + assert invoice, "Newly updated invoice couldn't be retrieved" + return invoice + + +async def update_invoice_items( + invoice_id: str, data: List[UpdateInvoiceItemData] +) -> List[InvoiceItem]: + updated_items = [] + for item in data: + if item.id: + updated_items.append(item.id) + await db.execute( + """ + UPDATE invoices.invoice_items + SET description = ?, amount = ? + WHERE id = ? + """, + (item.description, int(item.amount * 100), item.id), + ) + + placeholders = ",".join("?" for i in range(len(updated_items))) + if not placeholders: + placeholders = "?" + updated_items = ("skip",) + + await db.execute( + f""" + DELETE FROM invoices.invoice_items + WHERE invoice_id = ? + AND id NOT IN ({placeholders}) + """, + ( + invoice_id, + *tuple(updated_items), + ), + ) + + for item in data: + if not item.id: + await create_invoice_items(invoice_id=invoice_id, data=[item]) + + invoice_items = await get_invoice_items(invoice_id) + return invoice_items + + +async def create_invoice_payment(invoice_id: str, amount: int) -> Payment: + payment_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO invoices.payments (id, invoice_id, amount) + VALUES (?, ?, ?) + """, + ( + payment_id, + invoice_id, + amount, + ), + ) + + payment = await get_invoice_payment(payment_id) + assert payment, "Newly created payment couldn't be retrieved" + return payment diff --git a/lnbits/extensions/invoices/migrations.py b/lnbits/extensions/invoices/migrations.py new file mode 100644 index 000000000..c47a954ae --- /dev/null +++ b/lnbits/extensions/invoices/migrations.py @@ -0,0 +1,55 @@ +async def m001_initial_invoices(db): + + # STATUS COLUMN OPTIONS: 'draft', 'open', 'paid', 'canceled' + + await db.execute( + f""" + CREATE TABLE invoices.invoices ( + id TEXT PRIMARY KEY, + wallet TEXT NOT NULL, + + status TEXT NOT NULL DEFAULT 'draft', + + currency TEXT NOT NULL, + + company_name TEXT DEFAULT NULL, + first_name TEXT DEFAULT NULL, + last_name TEXT DEFAULT NULL, + email TEXT DEFAULT NULL, + phone TEXT DEFAULT NULL, + address TEXT DEFAULT NULL, + + + time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now} + ); + """ + ) + + await db.execute( + f""" + CREATE TABLE invoices.invoice_items ( + id TEXT PRIMARY KEY, + invoice_id TEXT NOT NULL, + + description TEXT NOT NULL, + amount INTEGER NOT NULL, + + FOREIGN KEY(invoice_id) REFERENCES {db.references_schema}invoices(id) + ); + """ + ) + + await db.execute( + f""" + CREATE TABLE invoices.payments ( + id TEXT PRIMARY KEY, + invoice_id TEXT NOT NULL, + + amount INT NOT NULL, + + time TIMESTAMP NOT NULL DEFAULT {db.timestamp_now}, + + FOREIGN KEY(invoice_id) REFERENCES {db.references_schema}invoices(id) + ); + """ + ) diff --git a/lnbits/extensions/invoices/models.py b/lnbits/extensions/invoices/models.py new file mode 100644 index 000000000..adf03e462 --- /dev/null +++ b/lnbits/extensions/invoices/models.py @@ -0,0 +1,104 @@ +from enum import Enum +from sqlite3 import Row +from typing import List, Optional + +from fastapi.param_functions import Query +from pydantic import BaseModel + + +class InvoiceStatusEnum(str, Enum): + draft = "draft" + open = "open" + paid = "paid" + canceled = "canceled" + + +class CreateInvoiceItemData(BaseModel): + description: str + amount: float = Query(..., ge=0.01) + + +class CreateInvoiceData(BaseModel): + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + items: List[CreateInvoiceItemData] + + class Config: + use_enum_values = True + + +class UpdateInvoiceItemData(BaseModel): + id: Optional[str] + description: str + amount: float = Query(..., ge=0.01) + + +class UpdateInvoiceData(BaseModel): + id: str + wallet: str + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + items: List[UpdateInvoiceItemData] + + +class Invoice(BaseModel): + id: str + wallet: str + status: InvoiceStatusEnum = InvoiceStatusEnum.draft + currency: str + company_name: Optional[str] + first_name: Optional[str] + last_name: Optional[str] + email: Optional[str] + phone: Optional[str] + address: Optional[str] + time: int + + class Config: + use_enum_values = True + + @classmethod + def from_row(cls, row: Row) -> "Invoice": + return cls(**dict(row)) + + +class InvoiceItem(BaseModel): + id: str + invoice_id: str + description: str + amount: int + + class Config: + orm_mode = True + + @classmethod + def from_row(cls, row: Row) -> "InvoiceItem": + return cls(**dict(row)) + + +class Payment(BaseModel): + id: str + invoice_id: str + amount: int + time: int + + @classmethod + def from_row(cls, row: Row) -> "Payment": + return cls(**dict(row)) + + +class CreatePaymentData(BaseModel): + invoice_id: str + amount: int diff --git a/lnbits/extensions/invoices/static/css/pay.css b/lnbits/extensions/invoices/static/css/pay.css new file mode 100644 index 000000000..626f5a43c --- /dev/null +++ b/lnbits/extensions/invoices/static/css/pay.css @@ -0,0 +1,55 @@ +#invoicePage>.row:first-child>.col-xs { + display: flex; +} + +#invoicePage>.row:first-child>.col-xs>.q-card { + flex: 1; +} + + +#invoicePage .clear { + margin-bottom: 25px; +} + +#printQrCode { + display: none; +} + +@media print { + * { + color: black !important; + } + + header, button, #payButtonContainer { + display: none !important; + } + + main, .q-page-container { + padding-top: 0px !important; + } + + .q-card { + box-shadow: none !important; + border: 1px solid black; + } + + .q-item { + padding: 5px; + } + + .q-card__section { + padding: 5px; + } + + #printQrCode { + display: block; + } + + p { + margin-bottom: 0px !important; + } + + #invoicePage .clear { + margin-bottom: 10px !important; + } +} \ No newline at end of file diff --git a/lnbits/extensions/invoices/tasks.py b/lnbits/extensions/invoices/tasks.py new file mode 100644 index 000000000..61bcb7b4b --- /dev/null +++ b/lnbits/extensions/invoices/tasks.py @@ -0,0 +1,51 @@ +import asyncio +import json + +from lnbits.core.models import Payment +from lnbits.helpers import urlsafe_short_hash +from lnbits.tasks import internal_invoice_queue, register_invoice_listener + +from .crud import ( + create_invoice_payment, + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_payments_total, + update_invoice_internal, +) + + +async def wait_for_paid_invoices(): + invoice_queue = asyncio.Queue() + register_invoice_listener(invoice_queue) + + while True: + payment = await invoice_queue.get() + await on_invoice_paid(payment) + + +async def on_invoice_paid(payment: Payment) -> None: + if payment.extra.get("tag") != "invoices": + # not relevant + return + + invoice_id = payment.extra.get("invoice_id") + + payment = await create_invoice_payment( + invoice_id=invoice_id, amount=payment.extra.get("famount") + ) + + invoice = await get_invoice(invoice_id) + + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + if payments_total >= invoice_total: + invoice.status = "paid" + await update_invoice_internal(invoice.wallet, invoice) + + return diff --git a/lnbits/extensions/invoices/templates/invoices/_api_docs.html b/lnbits/extensions/invoices/templates/invoices/_api_docs.html new file mode 100644 index 000000000..6e2a63554 --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/_api_docs.html @@ -0,0 +1,153 @@ + + + + + GET /invoices/api/v1/invoices +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ [<invoice_object>, ...] +
Curl example
+ curl -X GET {{ request.base_url }}invoices/api/v1/invoices -H + "X-Api-Key: <invoice_key>" + +
+
+
+ + + + + GET + /invoices/api/v1/invoice/{invoice_id} +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X GET {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id} -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + POST /invoices/api/v1/invoice +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X POST {{ request.base_url }}invoices/api/v1/invoice -H + "X-Api-Key: <invoice_key>" + +
+
+
+ + + + + POST + /invoices/api/v1/invoice/{invoice_id} +
Headers
+ {"X-Api-Key": <invoice_key>}
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {invoice_object} +
Curl example
+ curl -X POST {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id} -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + POST + /invoices/api/v1/invoice/{invoice_id}/payments +
Headers
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+ {payment_object} +
Curl example
+ curl -X POST {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id}/payments -H "X-Api-Key: + <invoice_key>" + +
+
+
+ + + + + GET + /invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash} +
Headers
+
Body (application/json)
+
+ Returns 200 OK (application/json) +
+
Curl example
+ curl -X GET {{ request.base_url + }}invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash} -H + "X-Api-Key: <invoice_key>" + +
+
+
+
diff --git a/lnbits/extensions/invoices/templates/invoices/index.html b/lnbits/extensions/invoices/templates/invoices/index.html new file mode 100644 index 000000000..e3093e3cb --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/index.html @@ -0,0 +1,571 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} +
+
+ + + New Invoice + + + + + +
+
+
Invoices
+
+
+ Export to CSV +
+
+ + {% raw %} + + + + {% endraw %} + +
+
+
+ +
+ + +
+ {{SITE_TITLE}} Invoices extension +
+
+ + + {% include "invoices/_api_docs.html" %} + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Add Line Item + + + + +
+ Create Invoice + Save Invoice + Cancel +
+
+
+
+
+{% endblock %} {% block scripts %} {{ window_vars(user) }} + +{% endblock %} diff --git a/lnbits/extensions/invoices/templates/invoices/pay.html b/lnbits/extensions/invoices/templates/invoices/pay.html new file mode 100644 index 000000000..14e3fcb7b --- /dev/null +++ b/lnbits/extensions/invoices/templates/invoices/pay.html @@ -0,0 +1,430 @@ +{% extends "public.html" %} {% block toolbar_title %} Invoice + + +{% endblock %} {% from "macros.jinja" import window_vars with context %} {% +block page %} + +
+
+
+ + +

+ Invoice +

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

+ Bill To +

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

+ Items +

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

+ Payments +

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

Scan to View & Pay Online!

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

{{ request.url }}

+
+
+ Copy URL + Close +
+
+
+
+{% endblock %} {% block scripts %} + +{% endblock %} diff --git a/lnbits/extensions/invoices/views.py b/lnbits/extensions/invoices/views.py new file mode 100644 index 000000000..08223df87 --- /dev/null +++ b/lnbits/extensions/invoices/views.py @@ -0,0 +1,59 @@ +from datetime import datetime +from http import HTTPStatus + +from fastapi import FastAPI, Request +from fastapi.params import Depends +from fastapi.templating import Jinja2Templates +from starlette.exceptions import HTTPException +from starlette.responses import HTMLResponse + +from lnbits.core.models import User +from lnbits.decorators import check_user_exists + +from . import invoices_ext, invoices_renderer +from .crud import ( + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_payments_total, +) + +templates = Jinja2Templates(directory="templates") + + +@invoices_ext.get("/", response_class=HTMLResponse) +async def index(request: Request, user: User = Depends(check_user_exists)): + return invoices_renderer().TemplateResponse( + "invoices/index.html", {"request": request, "user": user.dict()} + ) + + +@invoices_ext.get("/pay/{invoice_id}", response_class=HTMLResponse) +async def index(request: Request, invoice_id: str): + invoice = await get_invoice(invoice_id) + + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + return invoices_renderer().TemplateResponse( + "invoices/pay.html", + { + "request": request, + "invoice_id": invoice_id, + "invoice": invoice.dict(), + "invoice_items": invoice_items, + "invoice_total": invoice_total, + "invoice_payments": invoice_payments, + "payments_total": payments_total, + "datetime": datetime, + }, + ) diff --git a/lnbits/extensions/invoices/views_api.py b/lnbits/extensions/invoices/views_api.py new file mode 100644 index 000000000..23a262e39 --- /dev/null +++ b/lnbits/extensions/invoices/views_api.py @@ -0,0 +1,136 @@ +from http import HTTPStatus + +from fastapi import Query +from fastapi.params import Depends +from loguru import logger +from starlette.exceptions import HTTPException + +from lnbits.core.crud import get_user +from lnbits.core.services import create_invoice +from lnbits.core.views.api import api_payment +from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key +from lnbits.utils.exchange_rates import fiat_amount_as_satoshis + +from . import invoices_ext +from .crud import ( + create_invoice_internal, + create_invoice_items, + get_invoice, + get_invoice_items, + get_invoice_payments, + get_invoice_total, + get_invoices, + get_payments_total, + update_invoice_internal, + update_invoice_items, +) +from .models import CreateInvoiceData, UpdateInvoiceData + + +@invoices_ext.get("/api/v1/invoices", status_code=HTTPStatus.OK) +async def api_invoices( + all_wallets: bool = Query(None), wallet: WalletTypeInfo = Depends(get_key_type) +): + wallet_ids = [wallet.wallet.id] + if all_wallets: + wallet_ids = (await get_user(wallet.wallet.user)).wallet_ids + + return [invoice.dict() for invoice in await get_invoices(wallet_ids)] + + +@invoices_ext.get("/api/v1/invoice/{invoice_id}", status_code=HTTPStatus.OK) +async def api_invoice(invoice_id: str): + invoice = await get_invoice(invoice_id) + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + invoice_items = await get_invoice_items(invoice_id) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + invoice_dict = invoice.dict() + invoice_dict["items"] = invoice_items + invoice_dict["payments"] = payments_total + return invoice_dict + + +@invoices_ext.post("/api/v1/invoice", status_code=HTTPStatus.CREATED) +async def api_invoice_create( + data: CreateInvoiceData, wallet: WalletTypeInfo = Depends(get_key_type) +): + invoice = await create_invoice_internal(wallet_id=wallet.wallet.id, data=data) + items = await create_invoice_items(invoice_id=invoice.id, data=data.items) + invoice_dict = invoice.dict() + invoice_dict["items"] = items + return invoice_dict + + +@invoices_ext.post("/api/v1/invoice/{invoice_id}", status_code=HTTPStatus.OK) +async def api_invoice_update( + data: UpdateInvoiceData, + invoice_id: str, + wallet: WalletTypeInfo = Depends(get_key_type), +): + invoice = await update_invoice_internal(wallet_id=wallet.wallet.id, data=data) + items = await update_invoice_items(invoice_id=invoice.id, data=data.items) + invoice_dict = invoice.dict() + invoice_dict["items"] = items + return invoice_dict + + +@invoices_ext.post( + "/api/v1/invoice/{invoice_id}/payments", status_code=HTTPStatus.CREATED +) +async def api_invoices_create_payment( + famount: int = Query(..., ge=1), invoice_id: str = None +): + invoice = await get_invoice(invoice_id) + invoice_items = await get_invoice_items(invoice_id) + invoice_total = await get_invoice_total(invoice_items) + + invoice_payments = await get_invoice_payments(invoice_id) + payments_total = await get_payments_total(invoice_payments) + + if payments_total + famount > invoice_total: + raise HTTPException( + status_code=HTTPStatus.BAD_REQUEST, detail="Amount exceeds invoice due." + ) + + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + + price_in_sats = await fiat_amount_as_satoshis(famount / 100, invoice.currency) + + try: + payment_hash, payment_request = await create_invoice( + wallet_id=invoice.wallet, + amount=price_in_sats, + memo=f"Payment for invoice {invoice_id}", + extra={"tag": "invoices", "invoice_id": invoice_id, "famount": famount}, + ) + except Exception as e: + raise HTTPException(status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(e)) + + return {"payment_hash": payment_hash, "payment_request": payment_request} + + +@invoices_ext.get( + "/api/v1/invoice/{invoice_id}/payments/{payment_hash}", status_code=HTTPStatus.OK +) +async def api_invoices_check_payment(invoice_id: str, payment_hash: str): + invoice = await get_invoice(invoice_id) + if not invoice: + raise HTTPException( + status_code=HTTPStatus.NOT_FOUND, detail="Invoice does not exist." + ) + try: + status = await api_payment(payment_hash) + + except Exception as exc: + logger.error(exc) + return {"paid": False} + return status diff --git a/tests/data/mock_data.zip b/tests/data/mock_data.zip index 6f7165b3675246603ccd2df32fe193b58dd95028..3a7938917afec15b1d86421d25bf5f8947d4d1fc 100644 GIT binary patch delta 1149 zcmbPmnDOFi#trvF>zP?Z7#J8h7+RWGLJ#ifke$g4 z>lGK~WR|2FhlX%6Ft2$0I!WpF>!i{OZU#n{7eFmw;_c1*dAGu3*bAgNA}_h*iMp0xCUgls=xl z=C}8T)syn0ho4?3eSO1BWUcfO({Fp$2CvpVAJ?O_%yyH;{>wXb8l;vT^R_PCs4M#V z>}G|!;58!Frk&?^T)FsnfzPjE^Sx)5>;6`md$vt_<(sWX=B{n4@1Obk_o@0%x*L_Y z9dV1yVc-5bZO>=Nt8b>COj)((h*8_ptou6;?=$asF-dT%`qR7#)ARIxnEd@yS7SBR zZ}WYA^-9~{daGvUt(d@(YEkmi?9!U7b&n*Nvu<45oj8%-`HoQZbd#_8#V6BSU5rBg zprLS@RnBs zbC(@9oig!p#x$dSt3r>Ou^*8t*M0Q8*j_K=Q+~g@xyQUx*6*T3GpO%ZIZYcdVKdmi@F*XXov`$A9gL5$N!{R@(aHsmw%AyX~8t zu3VkEN9lx9o{|2g%>1CUODA*k)E7C`{r-L4{mqh(tydl~uP`Tivzd!_DcnZ9;g=;d=(_vW-JmFnH@wcchceh1WV^!@oZzy6HTzaRfi5AXe0 z25}t2hlRf_^fp{H7Tox|Fj1{a?qK}?{^Dw$?_Jd|WuZzQRJHz?qM&o+%i4P@w8UFJ zWzH?*a{v9P&^2_v8~?eJ6E?)>9NAOVZMf;4-J4Kp<;^PFqE!R4dBa#!jd#skwNmQ$ zpxzeu`Mn-Tm075n!2-sbB}HRed$MvMUUJk`3ZJ!Gx_f4yjyqX=j;E4@5I}x z&+h%m2Xi0e44qHz=k$*J^}Z;~G5PEN7n)4EMA$r%}ZT=A2!=1;-BnK77ECwW?#xXD~X}lZCfTK`gg%k>C1ww!~ TD;r3=JP>~8W?(oH3E}|&{ 0 + + # check invoice is paid + response = await client.get( + f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}" + ) + assert response.status_code == 200 + assert response.json()["paid"] == True + + # check invoice status + response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}") + assert response.status_code == 200 + data = response.json() + + assert data["status"] == "open" + + +#### +# +# TEST FAILS FOR NOW, AS LISTENERS ARE NOT WORKING ON TESTING +# +### + +# @pytest.mark.asyncio +# async def test_invoices_api_full_pay_invoice(client, accounting_invoice, adminkey_headers_to): +# invoice_id = accounting_invoice["id"] +# print(accounting_invoice["id"]) +# amount_to_pay = int(10.20 * 100) + +# # ask for an invoice +# response = await client.post( +# f"/invoices/api/v1/invoice/{invoice_id}/payments?famount={amount_to_pay}" +# ) +# assert response.status_code == 201 +# data = response.json() +# payment_hash = data["payment_hash"] + +# # pay the invoice +# data = {"out": True, "bolt11": data["payment_request"]} +# response = await client.post( +# "/api/v1/payments", json=data, headers=adminkey_headers_to +# ) +# assert response.status_code < 300 +# assert len(response.json()["payment_hash"]) == 64 +# assert len(response.json()["checking_id"]) > 0 + +# # check invoice is paid +# response = await client.get( +# f"/invoices/api/v1/invoice/{invoice_id}/payments/{payment_hash}" +# ) +# assert response.status_code == 200 +# assert response.json()["paid"] == True + +# # check invoice status +# response = await client.get(f"/invoices/api/v1/invoice/{invoice_id}") +# assert response.status_code == 200 +# data = response.json() + +# print(data) +# assert data["status"] == "paid" From 4fab2d31013dca9eb549e4cfb8e8e93320d1c24f Mon Sep 17 00:00:00 2001 From: iWarpBTC Date: Mon, 13 Jun 2022 21:08:06 +0200 Subject: [PATCH 238/421] new extension just proof of concept --- lnbits/extensions/boltcards/README.md | 11 + lnbits/extensions/boltcards/__init__.py | 19 + lnbits/extensions/boltcards/config.json | 6 + lnbits/extensions/boltcards/crud.py | 91 +++++ lnbits/extensions/boltcards/migrations.py | 20 + lnbits/extensions/boltcards/models.py | 21 + lnbits/extensions/boltcards/nxp424.py | 31 ++ .../templates/boltcards/_api_docs.html | 27 ++ .../boltcards/templates/boltcards/index.html | 375 ++++++++++++++++++ lnbits/extensions/boltcards/views.py | 18 + lnbits/extensions/boltcards/views_api.py | 161 ++++++++ 11 files changed, 780 insertions(+) create mode 100644 lnbits/extensions/boltcards/README.md create mode 100644 lnbits/extensions/boltcards/__init__.py create mode 100644 lnbits/extensions/boltcards/config.json create mode 100644 lnbits/extensions/boltcards/crud.py create mode 100644 lnbits/extensions/boltcards/migrations.py create mode 100644 lnbits/extensions/boltcards/models.py create mode 100644 lnbits/extensions/boltcards/nxp424.py create mode 100644 lnbits/extensions/boltcards/templates/boltcards/_api_docs.html create mode 100644 lnbits/extensions/boltcards/templates/boltcards/index.html create mode 100644 lnbits/extensions/boltcards/views.py create mode 100644 lnbits/extensions/boltcards/views_api.py diff --git a/lnbits/extensions/boltcards/README.md b/lnbits/extensions/boltcards/README.md new file mode 100644 index 000000000..7b9bd7218 --- /dev/null +++ b/lnbits/extensions/boltcards/README.md @@ -0,0 +1,11 @@ +

boltcards Extension

+

*tagline*

+This is an boltcards extension to help you organise and build you own. + +Try to include an image + + + +

If your extension has API endpoints, include useful ones here

+ +curl -H "Content-type: application/json" -X POST https://YOUR-LNBITS/YOUR-EXTENSION/api/v1/boltcards -d '{"amount":"100","memo":"boltcards"}' -H "X-Api-Key: YOUR_WALLET-ADMIN/INVOICE-KEY" diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py new file mode 100644 index 000000000..69326708f --- /dev/null +++ b/lnbits/extensions/boltcards/__init__.py @@ -0,0 +1,19 @@ +from fastapi import APIRouter + +from lnbits.db import Database +from lnbits.helpers import template_renderer + +db = Database("ext_boltcards") + +boltcards_ext: APIRouter = APIRouter( + prefix="/boltcards", + tags=["boltcards"] +) + + +def boltcards_renderer(): + return template_renderer(["lnbits/extensions/boltcards/templates"]) + + +from .views import * # noqa +from .views_api import * # noqa diff --git a/lnbits/extensions/boltcards/config.json b/lnbits/extensions/boltcards/config.json new file mode 100644 index 000000000..ef98a35ad --- /dev/null +++ b/lnbits/extensions/boltcards/config.json @@ -0,0 +1,6 @@ +{ + "name": "Bolt Cards", + "short_description": "Self custody Bolt Cards with one time LNURLw", + "icon": "payment", + "contributors": ["iwarpbtc"] +} diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py new file mode 100644 index 000000000..e8fb5477a --- /dev/null +++ b/lnbits/extensions/boltcards/crud.py @@ -0,0 +1,91 @@ +from optparse import Option +from typing import List, Optional, Union +from lnbits.helpers import urlsafe_short_hash + +from . import db +from .models import Card, CreateCardData + +async def create_card( + data: CreateCardData, wallet_id: str +) -> Card: + card_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO boltcards.cards ( + id, + wallet, + card_name, + uid, + counter, + withdraw, + file_key, + meta_key + ) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """, + ( + card_id, + wallet_id, + data.name, + data.uid, + data.counter, + data.withdraw, + data.file_key, + data.meta_key, + ), + ) + link = await get_card(card_id, 0) + assert link, "Newly created card couldn't be retrieved" + return link + +async def update_card(card_id: str, **kwargs) -> Optional[Card]: + if "is_unique" in kwargs: + kwargs["is_unique"] = int(kwargs["is_unique"]) + q = ", ".join([f"{field[0]} = ?" for field in kwargs.items()]) + await db.execute( + f"UPDATE boltcards.cards SET {q} WHERE id = ?", + (*kwargs.values(), card_id), + ) + row = await db.fetchone( + "SELECT * FROM boltcards.cards WHERE id = ?", (card_id,) + ) + return Card(**row) if row else None + +async def get_cards(wallet_ids: Union[str, List[str]]) -> List[Card]: + if isinstance(wallet_ids, str): + wallet_ids = [wallet_ids] + + q = ",".join(["?"] * len(wallet_ids)) + rows = await db.fetchall( + f"SELECT * FROM boltcards.cards WHERE wallet IN ({q})", (*wallet_ids,) + ) + + return [Card(**row) for row in rows] + +async def get_all_cards() -> List[Card]: + rows = await db.fetchall( + f"SELECT * FROM boltcards.cards" + ) + + return [Card(**row) for row in rows] + +async def get_card(card_id: str, id_is_uid: bool=False) -> Optional[Card]: + sql = "SELECT * FROM boltcards.cards WHERE {} = ?".format("uid" if id_is_uid else "id") + row = await db.fetchone( + sql, card_id, + ) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + +async def delete_card(card_id: str) -> None: + await db.execute("DELETE FROM boltcards.cards WHERE id = ?", (card_id,)) + +async def update_card_counter(counter: int, id: str): + await db.execute( + "UPDATE boltcards.cards SET counter = ? WHERE id = ?", + (counter, id), + ) \ No newline at end of file diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py new file mode 100644 index 000000000..eedbb5d34 --- /dev/null +++ b/lnbits/extensions/boltcards/migrations.py @@ -0,0 +1,20 @@ +from lnbits.helpers import urlsafe_short_hash + +async def m001_initial(db): + await db.execute( + """ + CREATE TABLE boltcards.cards ( + id TEXT PRIMARY KEY, + wallet TEXT NOT NULL, + card_name TEXT NOT NULL, + uid TEXT NOT NULL, + counter INT NOT NULL DEFAULT 0, + withdraw TEXT NOT NULL, + file_key TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + meta_key TEXT NOT NULL DEFAULT '', + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py new file mode 100644 index 000000000..6ef25d0c2 --- /dev/null +++ b/lnbits/extensions/boltcards/models.py @@ -0,0 +1,21 @@ +from pydantic import BaseModel +from fastapi.params import Query + +class Card(BaseModel): + id: str + wallet: str + card_name: str + uid: str + counter: int + withdraw: str + file_key: str + meta_key: str + time: int + +class CreateCardData(BaseModel): + card_name: str = Query(...) + uid: str = Query(...) + counter: str = Query(...) + withdraw: str = Query(...) + file_key: str = Query(...) + meta_key: str = Query(...) \ No newline at end of file diff --git a/lnbits/extensions/boltcards/nxp424.py b/lnbits/extensions/boltcards/nxp424.py new file mode 100644 index 000000000..a67b896f5 --- /dev/null +++ b/lnbits/extensions/boltcards/nxp424.py @@ -0,0 +1,31 @@ +from typing import Tuple +from Cryptodome.Hash import CMAC +from Cryptodome.Cipher import AES + +SV2 = "3CC300010080" + +def myCMAC(key: bytes, msg: bytes=b'') -> bytes: + cobj = CMAC.new(key, ciphermod=AES) + if msg != b'': + cobj.update(msg) + return cobj.digest() + +def decryptSUN(sun: bytes, key: bytes) -> Tuple[bytes, bytes]: + IVbytes = b"\x00" * 16 + + cipher = AES.new(key, AES.MODE_CBC, IVbytes) + sun_plain = cipher.decrypt(sun) + + UID = sun_plain[1:8] + counter = sun_plain[8:11] + + return UID, counter + +def getSunMAC(UID: bytes, counter: bytes, key: bytes) -> bytes: + sv2prefix = bytes.fromhex(SV2) + sv2bytes = sv2prefix + UID + counter + + mac1 = myCMAC(key, sv2bytes) + mac2 = myCMAC(mac1) + + return mac2[1::2] diff --git a/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html new file mode 100644 index 000000000..f49392558 --- /dev/null +++ b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html @@ -0,0 +1,27 @@ + + + +
+ Be your own card association +
+

+ Manage your Bolt Cards self custodian way
+ + More details +
+ + Created by, + iWarp +

+
+
+
diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html new file mode 100644 index 000000000..4910cb66f --- /dev/null +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -0,0 +1,375 @@ +{% extends "base.html" %} {% from "macros.jinja" import window_vars with context +%} {% block page %} + +
+
+ + + Add Card + + + + +
+
+
Cards
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
+
+
+ + +
+ {{SITE_TITLE}} Bolt Cards extension +
+
+ + + {% include "boltcards/_api_docs.html" %} + +
+
+ + + + + + + + The domain to use ex: "example.com" + + + + Create a "Edit zone DNS" API token in cloudflare + + + How much to charge per day +
+ Update Form + Create Card + Cancel +
+
+
+
+
+ + +{% endblock %} {% block scripts %} {{ window_vars(user) }} + +{% endblock %} diff --git a/lnbits/extensions/boltcards/views.py b/lnbits/extensions/boltcards/views.py new file mode 100644 index 000000000..8fcbb7def --- /dev/null +++ b/lnbits/extensions/boltcards/views.py @@ -0,0 +1,18 @@ +from fastapi import FastAPI, Request +from fastapi.params import Depends +from fastapi.templating import Jinja2Templates +from starlette.responses import HTMLResponse + +from lnbits.core.models import User +from lnbits.decorators import check_user_exists + +from . import boltcards_ext, boltcards_renderer + +templates = Jinja2Templates(directory="templates") + + +@boltcards_ext.get("/", response_class=HTMLResponse) +async def index(request: Request, user: User = Depends(check_user_exists)): + return boltcards_renderer().TemplateResponse( + "boltcards/index.html", {"request": request, "user": user.dict()} + ) diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py new file mode 100644 index 000000000..0acfb6858 --- /dev/null +++ b/lnbits/extensions/boltcards/views_api.py @@ -0,0 +1,161 @@ +# views_api.py is for you API endpoints that could be hit by another service + +# add your dependencies here + +# import httpx +# (use httpx just like requests, except instead of response.ok there's only the +# response.is_error that is its inverse) + +from http import HTTPStatus + +from fastapi.params import Depends, Query +from starlette.exceptions import HTTPException +from starlette.requests import Request + +from lnbits.core.crud import get_user +from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key +from lnbits.extensions.withdraw import get_withdraw_link + +from . import boltcards_ext +from .nxp424 import decryptSUN, getSunMAC +from .crud import ( + get_all_cards, + get_cards, + get_card, + create_card, + update_card, + delete_card, + update_card_counter +) +from .models import CreateCardData + +@boltcards_ext.get("/api/v1/cards") +async def api_cards( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + return [card.dict() for card in await get_cards(wallet_ids)] + +@boltcards_ext.post("/api/v1/cards", status_code=HTTPStatus.CREATED) +@boltcards_ext.put("/api/v1/cards/{card_id}", status_code=HTTPStatus.OK) +async def api_link_create_or_update( + req: Request, + data: CreateCardData, + card_id: str = None, + wallet: WalletTypeInfo = Depends(require_admin_key), +): + ''' + if data.uses > 250: + raise HTTPException( + detail="250 uses max.", status_code=HTTPStatus.BAD_REQUEST + ) + + if data.min_withdrawable < 1: + raise HTTPException( + detail="Min must be more than 1.", status_code=HTTPStatus.BAD_REQUEST + ) + + if data.max_withdrawable < data.min_withdrawable: + raise HTTPException( + detail="`max_withdrawable` needs to be at least `min_withdrawable`.", + status_code=HTTPStatus.BAD_REQUEST, + ) + ''' + if card_id: + card = await get_card(card_id) + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + if card.wallet != wallet.wallet.id: + raise HTTPException( + detail="Not your card.", status_code=HTTPStatus.FORBIDDEN + ) + card = await update_card( + card_id, **data.dict() + ) + else: + card = await create_card( + wallet_id=wallet.wallet.id, data=data + ) + return card.dict() + +@boltcards_ext.delete("/api/v1/cards/{card_id}") +async def api_link_delete(card_id, wallet: WalletTypeInfo = Depends(require_admin_key)): + card = await get_card(card_id) + + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + + if card.wallet != wallet.wallet.id: + raise HTTPException( + detail="Not your card.", status_code=HTTPStatus.FORBIDDEN + ) + + await delete_card(card_id) + raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + +@boltcards_ext.get("/api/v1/scan/") # pay.btcslovnik.cz/boltcards/api/v1/scan/?uid=00000000000000&ctr=000000&c=0000000000000000 +async def api_scan( + uid, ctr, c, + request: Request +): + card = await get_card(uid, id_is_uid=True) + + if card == None: + return {"status": "ERROR", "reason": "Unknown card."} + + if c != getSunMAC(bytes.fromhex(uid), bytes.fromhex(ctr)[::-1], bytes.fromhex(card.file_key)).hex().upper(): + print(c) + print(getSunMAC(bytes.fromhex(uid), bytes.fromhex(ctr)[::-1], bytes.fromhex(card.file_key)).hex().upper()) + return {"status": "ERROR", "reason": "CMAC does not check."} + + ctr_int = int(ctr, 16) + + if ctr_int <= card.counter: + return {"status": "ERROR", "reason": "This link is already used."} + + await update_card_counter(ctr_int, card.id) + + link = await get_withdraw_link(card.withdraw, 0) + + return link.lnurl_response(request) + +@boltcards_ext.get("/api/v1/scane/") +async def api_scane( + e, c, + request: Request +): + card = None + counter = b'' + + for cand in await get_all_cards(): + if cand.meta_key: + card_uid, counter = decryptSUN(bytes.fromhex(e), bytes.fromhex(cand.meta_key)) + + if card_uid.hex().upper() == cand.uid: + card = cand + break + + if card == None: + return {"status": "ERROR", "reason": "Unknown card."} + + if c != getSunMAC(card_uid, counter, bytes.fromhex(card.file_key)).hex().upper(): + print(c) + print(getSunMAC(card_uid, counter, bytes.fromhex(card.file_key)).hex().upper()) + return {"status": "ERROR", "reason": "CMAC does not check."} + + counter_int = int.from_bytes(counter, "little") + if counter_int <= card.counter: + return {"status": "ERROR", "reason": "This link is already used."} + + await update_card_counter(counter_int, card.id) + + link = await get_withdraw_link(card.withdraw, 0) + return link.lnurl_response(request) From 3cb62d1899d6a15895d97cc30ec0ac8483649d5b Mon Sep 17 00:00:00 2001 From: iWarpBTC Date: Tue, 21 Jun 2022 18:03:20 +0200 Subject: [PATCH 239/421] recording card tapping --- lnbits/extensions/boltcards/crud.py | 61 +++++++++++++++++-- lnbits/extensions/boltcards/migrations.py | 16 +++++ lnbits/extensions/boltcards/models.py | 20 +++++- .../boltcards/templates/boltcards/index.html | 1 + lnbits/extensions/boltcards/views_api.py | 11 +++- 5 files changed, 102 insertions(+), 7 deletions(-) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index e8fb5477a..62aad3560 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -3,7 +3,7 @@ from typing import List, Optional, Union from lnbits.helpers import urlsafe_short_hash from . import db -from .models import Card, CreateCardData +from .models import Card, CreateCardData, Hit async def create_card( data: CreateCardData, wallet_id: str @@ -34,9 +34,9 @@ async def create_card( data.meta_key, ), ) - link = await get_card(card_id, 0) - assert link, "Newly created card couldn't be retrieved" - return link + card = await get_card(card_id, 0) + assert card, "Newly created card couldn't be retrieved" + return card async def update_card(card_id: str, **kwargs) -> Optional[Card]: if "is_unique" in kwargs: @@ -88,4 +88,55 @@ async def update_card_counter(counter: int, id: str): await db.execute( "UPDATE boltcards.cards SET counter = ? WHERE id = ?", (counter, id), - ) \ No newline at end of file + ) + +async def get_hit(hit_id: str) -> Optional[Hit]: + row = await db.fetchone( + f"SELECT * FROM boltcards.hits WHERE id = ?", (hit_id) + ) + if not row: + return None + + hit = dict(**row) + + return Hit.parse_obj(hit) + +async def get_hits(wallet_ids: Union[str, List[str]]) -> List[Hit]: + + cards = get_cards(wallet_ids) + + q = ",".join(["?"] * len(cards)) + rows = await db.fetchall( + f"SELECT * FROM boltcards.hits WHERE wallet IN ({q})", (*(card.card_id for card in cards),) + ) + + return [Card(**row) for row in rows] + +async def create_hit( + card_id, ip, useragent, old_ctr, new_ctr +) -> Hit: + hit_id = urlsafe_short_hash() + await db.execute( + """ + INSERT INTO boltcards.hits ( + id, + card_id, + ip, + useragent, + old_ctr, + new_ctr + ) + VALUES (?, ?, ?, ?, ?, ?) + """, + ( + hit_id, + card_id, + ip, + useragent, + old_ctr, + new_ctr, + ), + ) + hit = await get_hit(hit_id) + assert hit, "Newly recorded hit couldn't be retrieved" + return hit diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py index eedbb5d34..e7236ce7a 100644 --- a/lnbits/extensions/boltcards/migrations.py +++ b/lnbits/extensions/boltcards/migrations.py @@ -18,3 +18,19 @@ async def m001_initial(db): ); """ ) + + await db.execute( + """ + CREATE TABLE boltcards.hits ( + id TEXT PRIMARY KEY, + card_id TEXT NOT NULL, + ip TEXT NOT NULL, + useragent TEXT, + old_ctr INT NOT NULL DEFAULT 0, + new_ctr INT NOT NULL DEFAULT 0, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 6ef25d0c2..75621269f 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -18,4 +18,22 @@ class CreateCardData(BaseModel): counter: str = Query(...) withdraw: str = Query(...) file_key: str = Query(...) - meta_key: str = Query(...) \ No newline at end of file + meta_key: str = Query(...) + +class Hit(BaseModel): + id: str + card_id: str + ip: str + useragent: str + old_ctr: int + new_ctr: int + time: int + +''' +class CreateHitData(BaseModel): + card_id: str = Query(...) + ip: str = Query(...) + useragent: str = Query(...) + old_ctr: int = Query(...) + new_ctr: int = Query(...) +''' diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 4910cb66f..a6997a5d1 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -368,6 +368,7 @@ if (this.g.user.wallets.length) { this.getCards() this.getWithdraws() + this.getHits() } } }) diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index 0acfb6858..75cfe129e 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -19,6 +19,7 @@ from lnbits.extensions.withdraw import get_withdraw_link from . import boltcards_ext from .nxp424 import decryptSUN, getSunMAC from .crud import ( + create_hit, get_all_cards, get_cards, get_card, @@ -43,7 +44,7 @@ async def api_cards( @boltcards_ext.post("/api/v1/cards", status_code=HTTPStatus.CREATED) @boltcards_ext.put("/api/v1/cards/{card_id}", status_code=HTTPStatus.OK) async def api_link_create_or_update( - req: Request, +# req: Request, data: CreateCardData, card_id: str = None, wallet: WalletTypeInfo = Depends(require_admin_key), @@ -157,5 +158,13 @@ async def api_scane( await update_card_counter(counter_int, card.id) + ip = request.client.host + if request.headers['x-real-ip']: + ip = request.headers['x-real-ip'] + elif request.headers['x-forwarded-for']: + ip = request.headers['x-forwarded-for'] + + await create_hit(card.id, ip, request.headers['user-agent'], card.counter, counter_int) + link = await get_withdraw_link(card.withdraw, 0) return link.lnurl_response(request) From 2f497ac0eeee7b72ce24f6342f30694f5bebb353 Mon Sep 17 00:00:00 2001 From: iWarpBTC Date: Tue, 21 Jun 2022 22:04:43 +0200 Subject: [PATCH 240/421] retreiving hits --- lnbits/extensions/boltcards/crud.py | 11 +++--- lnbits/extensions/boltcards/models.py | 9 ----- .../boltcards/templates/boltcards/index.html | 1 - lnbits/extensions/boltcards/views_api.py | 36 ++++++++++++++++--- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 62aad3560..f34ce6594 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -101,16 +101,13 @@ async def get_hit(hit_id: str) -> Optional[Hit]: return Hit.parse_obj(hit) -async def get_hits(wallet_ids: Union[str, List[str]]) -> List[Hit]: - - cards = get_cards(wallet_ids) - - q = ",".join(["?"] * len(cards)) +async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: + q = ",".join(["?"] * len(cards_ids)) rows = await db.fetchall( - f"SELECT * FROM boltcards.hits WHERE wallet IN ({q})", (*(card.card_id for card in cards),) + f"SELECT * FROM boltcards.hits WHERE card_id IN ({q})", (*cards_ids,) ) - return [Card(**row) for row in rows] + return [Hit(**row) for row in rows] async def create_hit( card_id, ip, useragent, old_ctr, new_ctr diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 75621269f..728aa2bb8 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -28,12 +28,3 @@ class Hit(BaseModel): old_ctr: int new_ctr: int time: int - -''' -class CreateHitData(BaseModel): - card_id: str = Query(...) - ip: str = Query(...) - useragent: str = Query(...) - old_ctr: int = Query(...) - new_ctr: int = Query(...) -''' diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index a6997a5d1..4910cb66f 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -368,7 +368,6 @@ if (this.g.user.wallets.length) { this.getCards() this.getWithdraws() - this.getHits() } } }) diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index 75cfe129e..8a8e33a2f 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -24,6 +24,7 @@ from .crud import ( get_cards, get_card, create_card, + get_hits, update_card, delete_card, update_card_counter @@ -102,6 +103,22 @@ async def api_link_delete(card_id, wallet: WalletTypeInfo = Depends(require_admi await delete_card(card_id) raise HTTPException(status_code=HTTPStatus.NO_CONTENT) +@boltcards_ext.get("/api/v1/hits") +async def api_hits( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + cards = await get_cards(wallet_ids) + cards_ids = [] + for card in cards: + cards_ids.append(card.id) + + return [hit.dict() for hit in await get_hits(cards_ids)] + @boltcards_ext.get("/api/v1/scan/") # pay.btcslovnik.cz/boltcards/api/v1/scan/?uid=00000000000000&ctr=000000&c=0000000000000000 async def api_scan( uid, ctr, c, @@ -124,8 +141,17 @@ async def api_scan( await update_card_counter(ctr_int, card.id) - link = await get_withdraw_link(card.withdraw, 0) + ip = request.client.host + if request.headers['x-real-ip']: + ip = request.headers['x-real-ip'] + elif request.headers['x-forwarded-for']: + ip = request.headers['x-forwarded-for'] + agent = request.headers['user-agent'] if 'user-agent' in request.headers else '' + + await create_hit(card.id, ip, agent, card.counter, ctr_int) + + link = await get_withdraw_link(card.withdraw, 0) return link.lnurl_response(request) @boltcards_ext.get("/api/v1/scane/") @@ -152,8 +178,8 @@ async def api_scane( print(getSunMAC(card_uid, counter, bytes.fromhex(card.file_key)).hex().upper()) return {"status": "ERROR", "reason": "CMAC does not check."} - counter_int = int.from_bytes(counter, "little") - if counter_int <= card.counter: + ctr_int = int.from_bytes(counter, "little") + if ctr_int <= card.counter: return {"status": "ERROR", "reason": "This link is already used."} await update_card_counter(counter_int, card.id) @@ -164,7 +190,9 @@ async def api_scane( elif request.headers['x-forwarded-for']: ip = request.headers['x-forwarded-for'] - await create_hit(card.id, ip, request.headers['user-agent'], card.counter, counter_int) + agent = request.headers['user-agent'] if 'user-agent' in request.headers else '' + + await create_hit(card.id, ip, agent, card.counter, ctr_int) link = await get_withdraw_link(card.withdraw, 0) return link.lnurl_response(request) From 5af49e38018594b16f46e9ab92acd575be9f42d8 Mon Sep 17 00:00:00 2001 From: iWarpBTC Date: Tue, 21 Jun 2022 23:41:08 +0200 Subject: [PATCH 241/421] comments and hints --- lnbits/extensions/boltcards/nxp424.py | 1 + .../boltcards/templates/boltcards/index.html | 12 ++++-------- lnbits/extensions/boltcards/views_api.py | 15 +++++++++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/lnbits/extensions/boltcards/nxp424.py b/lnbits/extensions/boltcards/nxp424.py index a67b896f5..effa987d4 100644 --- a/lnbits/extensions/boltcards/nxp424.py +++ b/lnbits/extensions/boltcards/nxp424.py @@ -1,3 +1,4 @@ +# https://www.nxp.com/docs/en/application-note/AN12196.pdf from typing import Tuple from Cryptodome.Hash import CMAC from Cryptodome.Cipher import AES diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 4910cb66f..21ac4a45a 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -126,17 +126,15 @@ v-model.trim="cardDialog.data.card_name" type="text" label="Card name " - >The domain to use ex: "example.com" - Create a "Edit zone DNS" API token in cloudflare How much to charge per dayZero if you don't know.
diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index 8a8e33a2f..b13d9c351 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -51,6 +51,7 @@ async def api_link_create_or_update( wallet: WalletTypeInfo = Depends(require_admin_key), ): ''' + TODO: some checks if data.uses > 250: raise HTTPException( detail="250 uses max.", status_code=HTTPStatus.BAD_REQUEST @@ -119,7 +120,8 @@ async def api_hits( return [hit.dict() for hit in await get_hits(cards_ids)] -@boltcards_ext.get("/api/v1/scan/") # pay.btcslovnik.cz/boltcards/api/v1/scan/?uid=00000000000000&ctr=000000&c=0000000000000000 +# /boltcards/api/v1/scan/?uid=00000000000000&ctr=000000&c=0000000000000000 +@boltcards_ext.get("/api/v1/scan/") async def api_scan( uid, ctr, c, request: Request @@ -141,6 +143,7 @@ async def api_scan( await update_card_counter(ctr_int, card.id) + # gathering some info for hit record ip = request.client.host if request.headers['x-real-ip']: ip = request.headers['x-real-ip'] @@ -154,6 +157,7 @@ async def api_scan( link = await get_withdraw_link(card.withdraw, 0) return link.lnurl_response(request) +# /boltcards/api/v1/scane/?e=00000000000000000000000000000000&c=0000000000000000 @boltcards_ext.get("/api/v1/scane/") async def api_scane( e, c, @@ -162,6 +166,8 @@ async def api_scane( card = None counter = b'' + # since this route is common to all cards I don't know whitch 'meta key' to use + # so I try one by one until decrypted uid matches for cand in await get_all_cards(): if cand.meta_key: card_uid, counter = decryptSUN(bytes.fromhex(e), bytes.fromhex(cand.meta_key)) @@ -182,12 +188,13 @@ async def api_scane( if ctr_int <= card.counter: return {"status": "ERROR", "reason": "This link is already used."} - await update_card_counter(counter_int, card.id) + await update_card_counter(ctr_int, card.id) + # gathering some info for hit record ip = request.client.host - if request.headers['x-real-ip']: + if 'x-real-ip' in request.headers: ip = request.headers['x-real-ip'] - elif request.headers['x-forwarded-for']: + elif 'x-forwarded-for' in request.headers: ip = request.headers['x-forwarded-for'] agent = request.headers['user-agent'] if 'user-agent' in request.headers else '' From 5b8d317441b1df27068b6005dbbb95f27c6ecdbc Mon Sep 17 00:00:00 2001 From: Gene Takavic Date: Fri, 15 Jul 2022 16:43:06 +0200 Subject: [PATCH 242/421] black & isort --- lnbits/extensions/boltcards/__init__.py | 5 +- lnbits/extensions/boltcards/crud.py | 40 ++++---- lnbits/extensions/boltcards/migrations.py | 1 + lnbits/extensions/boltcards/models.py | 5 +- lnbits/extensions/boltcards/nxp424.py | 12 ++- lnbits/extensions/boltcards/views_api.py | 111 ++++++++++------------ 6 files changed, 88 insertions(+), 86 deletions(-) diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py index 69326708f..f1ef972eb 100644 --- a/lnbits/extensions/boltcards/__init__.py +++ b/lnbits/extensions/boltcards/__init__.py @@ -5,10 +5,7 @@ from lnbits.helpers import template_renderer db = Database("ext_boltcards") -boltcards_ext: APIRouter = APIRouter( - prefix="/boltcards", - tags=["boltcards"] -) +boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) def boltcards_renderer(): diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index f34ce6594..7cf5cad18 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -1,13 +1,13 @@ from optparse import Option from typing import List, Optional, Union + from lnbits.helpers import urlsafe_short_hash from . import db from .models import Card, CreateCardData, Hit -async def create_card( - data: CreateCardData, wallet_id: str -) -> Card: + +async def create_card(data: CreateCardData, wallet_id: str) -> Card: card_id = urlsafe_short_hash() await db.execute( """ @@ -38,6 +38,7 @@ async def create_card( assert card, "Newly created card couldn't be retrieved" return card + async def update_card(card_id: str, **kwargs) -> Optional[Card]: if "is_unique" in kwargs: kwargs["is_unique"] = int(kwargs["is_unique"]) @@ -46,11 +47,10 @@ async def update_card(card_id: str, **kwargs) -> Optional[Card]: f"UPDATE boltcards.cards SET {q} WHERE id = ?", (*kwargs.values(), card_id), ) - row = await db.fetchone( - "SELECT * FROM boltcards.cards WHERE id = ?", (card_id,) - ) + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE id = ?", (card_id,)) return Card(**row) if row else None + async def get_cards(wallet_ids: Union[str, List[str]]) -> List[Card]: if isinstance(wallet_ids, str): wallet_ids = [wallet_ids] @@ -62,17 +62,20 @@ async def get_cards(wallet_ids: Union[str, List[str]]) -> List[Card]: return [Card(**row) for row in rows] + async def get_all_cards() -> List[Card]: - rows = await db.fetchall( - f"SELECT * FROM boltcards.cards" - ) + rows = await db.fetchall(f"SELECT * FROM boltcards.cards") return [Card(**row) for row in rows] -async def get_card(card_id: str, id_is_uid: bool=False) -> Optional[Card]: - sql = "SELECT * FROM boltcards.cards WHERE {} = ?".format("uid" if id_is_uid else "id") + +async def get_card(card_id: str, id_is_uid: bool = False) -> Optional[Card]: + sql = "SELECT * FROM boltcards.cards WHERE {} = ?".format( + "uid" if id_is_uid else "id" + ) row = await db.fetchone( - sql, card_id, + sql, + card_id, ) if not row: return None @@ -81,19 +84,20 @@ async def get_card(card_id: str, id_is_uid: bool=False) -> Optional[Card]: return Card.parse_obj(card) + async def delete_card(card_id: str) -> None: await db.execute("DELETE FROM boltcards.cards WHERE id = ?", (card_id,)) + async def update_card_counter(counter: int, id: str): await db.execute( "UPDATE boltcards.cards SET counter = ? WHERE id = ?", (counter, id), ) + async def get_hit(hit_id: str) -> Optional[Hit]: - row = await db.fetchone( - f"SELECT * FROM boltcards.hits WHERE id = ?", (hit_id) - ) + row = await db.fetchone(f"SELECT * FROM boltcards.hits WHERE id = ?", (hit_id)) if not row: return None @@ -101,6 +105,7 @@ async def get_hit(hit_id: str) -> Optional[Hit]: return Hit.parse_obj(hit) + async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: q = ",".join(["?"] * len(cards_ids)) rows = await db.fetchall( @@ -109,9 +114,8 @@ async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: return [Hit(**row) for row in rows] -async def create_hit( - card_id, ip, useragent, old_ctr, new_ctr -) -> Hit: + +async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: hit_id = urlsafe_short_hash() await db.execute( """ diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py index e7236ce7a..6e0fa0723 100644 --- a/lnbits/extensions/boltcards/migrations.py +++ b/lnbits/extensions/boltcards/migrations.py @@ -1,5 +1,6 @@ from lnbits.helpers import urlsafe_short_hash + async def m001_initial(db): await db.execute( """ diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 728aa2bb8..b6d521c3c 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -1,5 +1,6 @@ -from pydantic import BaseModel from fastapi.params import Query +from pydantic import BaseModel + class Card(BaseModel): id: str @@ -12,6 +13,7 @@ class Card(BaseModel): meta_key: str time: int + class CreateCardData(BaseModel): card_name: str = Query(...) uid: str = Query(...) @@ -20,6 +22,7 @@ class CreateCardData(BaseModel): file_key: str = Query(...) meta_key: str = Query(...) + class Hit(BaseModel): id: str card_id: str diff --git a/lnbits/extensions/boltcards/nxp424.py b/lnbits/extensions/boltcards/nxp424.py index effa987d4..83f4e50d5 100644 --- a/lnbits/extensions/boltcards/nxp424.py +++ b/lnbits/extensions/boltcards/nxp424.py @@ -1,18 +1,21 @@ # https://www.nxp.com/docs/en/application-note/AN12196.pdf from typing import Tuple -from Cryptodome.Hash import CMAC + from Cryptodome.Cipher import AES +from Cryptodome.Hash import CMAC SV2 = "3CC300010080" -def myCMAC(key: bytes, msg: bytes=b'') -> bytes: + +def myCMAC(key: bytes, msg: bytes = b"") -> bytes: cobj = CMAC.new(key, ciphermod=AES) - if msg != b'': + if msg != b"": cobj.update(msg) return cobj.digest() + def decryptSUN(sun: bytes, key: bytes) -> Tuple[bytes, bytes]: - IVbytes = b"\x00" * 16 + IVbytes = b"\x00" * 16 cipher = AES.new(key, AES.MODE_CBC, IVbytes) sun_plain = cipher.decrypt(sun) @@ -22,6 +25,7 @@ def decryptSUN(sun: bytes, key: bytes) -> Tuple[bytes, bytes]: return UID, counter + def getSunMAC(UID: bytes, counter: bytes, key: bytes) -> bytes: sv2prefix = bytes.fromhex(SV2) sv2bytes = sv2prefix + UID + counter diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index b13d9c351..fbd05cce0 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -17,19 +17,20 @@ from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key from lnbits.extensions.withdraw import get_withdraw_link from . import boltcards_ext -from .nxp424 import decryptSUN, getSunMAC from .crud import ( - create_hit, - get_all_cards, - get_cards, - get_card, create_card, + create_hit, + delete_card, + get_all_cards, + get_card, + get_cards, get_hits, update_card, - delete_card, - update_card_counter + update_card_counter, ) from .models import CreateCardData +from .nxp424 import decryptSUN, getSunMAC + @boltcards_ext.get("/api/v1/cards") async def api_cards( @@ -42,32 +43,15 @@ async def api_cards( return [card.dict() for card in await get_cards(wallet_ids)] + @boltcards_ext.post("/api/v1/cards", status_code=HTTPStatus.CREATED) @boltcards_ext.put("/api/v1/cards/{card_id}", status_code=HTTPStatus.OK) async def api_link_create_or_update( -# req: Request, + # req: Request, data: CreateCardData, card_id: str = None, wallet: WalletTypeInfo = Depends(require_admin_key), ): - ''' - TODO: some checks - if data.uses > 250: - raise HTTPException( - detail="250 uses max.", status_code=HTTPStatus.BAD_REQUEST - ) - - if data.min_withdrawable < 1: - raise HTTPException( - detail="Min must be more than 1.", status_code=HTTPStatus.BAD_REQUEST - ) - - if data.max_withdrawable < data.min_withdrawable: - raise HTTPException( - detail="`max_withdrawable` needs to be at least `min_withdrawable`.", - status_code=HTTPStatus.BAD_REQUEST, - ) - ''' if card_id: card = await get_card(card_id) if not card: @@ -78,15 +62,12 @@ async def api_link_create_or_update( raise HTTPException( detail="Not your card.", status_code=HTTPStatus.FORBIDDEN ) - card = await update_card( - card_id, **data.dict() - ) + card = await update_card(card_id, **data.dict()) else: - card = await create_card( - wallet_id=wallet.wallet.id, data=data - ) + card = await create_card(wallet_id=wallet.wallet.id, data=data) return card.dict() + @boltcards_ext.delete("/api/v1/cards/{card_id}") async def api_link_delete(card_id, wallet: WalletTypeInfo = Depends(require_admin_key)): card = await get_card(card_id) @@ -97,13 +78,12 @@ async def api_link_delete(card_id, wallet: WalletTypeInfo = Depends(require_admi ) if card.wallet != wallet.wallet.id: - raise HTTPException( - detail="Not your card.", status_code=HTTPStatus.FORBIDDEN - ) + raise HTTPException(detail="Not your card.", status_code=HTTPStatus.FORBIDDEN) await delete_card(card_id) raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + @boltcards_ext.get("/api/v1/hits") async def api_hits( g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) @@ -120,20 +100,33 @@ async def api_hits( return [hit.dict() for hit in await get_hits(cards_ids)] + # /boltcards/api/v1/scan/?uid=00000000000000&ctr=000000&c=0000000000000000 -@boltcards_ext.get("/api/v1/scan/") -async def api_scan( - uid, ctr, c, - request: Request -): +@boltcards_ext.get("/api/v1/scan/") +async def api_scan(uid, ctr, c, request: Request): card = await get_card(uid, id_is_uid=True) if card == None: return {"status": "ERROR", "reason": "Unknown card."} - if c != getSunMAC(bytes.fromhex(uid), bytes.fromhex(ctr)[::-1], bytes.fromhex(card.file_key)).hex().upper(): + if ( + c + != getSunMAC( + bytes.fromhex(uid), bytes.fromhex(ctr)[::-1], bytes.fromhex(card.file_key) + ) + .hex() + .upper() + ): print(c) - print(getSunMAC(bytes.fromhex(uid), bytes.fromhex(ctr)[::-1], bytes.fromhex(card.file_key)).hex().upper()) + print( + getSunMAC( + bytes.fromhex(uid), + bytes.fromhex(ctr)[::-1], + bytes.fromhex(card.file_key), + ) + .hex() + .upper() + ) return {"status": "ERROR", "reason": "CMAC does not check."} ctr_int = int(ctr, 16) @@ -145,32 +138,32 @@ async def api_scan( # gathering some info for hit record ip = request.client.host - if request.headers['x-real-ip']: - ip = request.headers['x-real-ip'] - elif request.headers['x-forwarded-for']: - ip = request.headers['x-forwarded-for'] + if request.headers["x-real-ip"]: + ip = request.headers["x-real-ip"] + elif request.headers["x-forwarded-for"]: + ip = request.headers["x-forwarded-for"] - agent = request.headers['user-agent'] if 'user-agent' in request.headers else '' + agent = request.headers["user-agent"] if "user-agent" in request.headers else "" await create_hit(card.id, ip, agent, card.counter, ctr_int) link = await get_withdraw_link(card.withdraw, 0) return link.lnurl_response(request) + # /boltcards/api/v1/scane/?e=00000000000000000000000000000000&c=0000000000000000 @boltcards_ext.get("/api/v1/scane/") -async def api_scane( - e, c, - request: Request -): +async def api_scane(e, c, request: Request): card = None - counter = b'' + counter = b"" # since this route is common to all cards I don't know whitch 'meta key' to use # so I try one by one until decrypted uid matches for cand in await get_all_cards(): if cand.meta_key: - card_uid, counter = decryptSUN(bytes.fromhex(e), bytes.fromhex(cand.meta_key)) + card_uid, counter = decryptSUN( + bytes.fromhex(e), bytes.fromhex(cand.meta_key) + ) if card_uid.hex().upper() == cand.uid: card = cand @@ -187,17 +180,17 @@ async def api_scane( ctr_int = int.from_bytes(counter, "little") if ctr_int <= card.counter: return {"status": "ERROR", "reason": "This link is already used."} - + await update_card_counter(ctr_int, card.id) # gathering some info for hit record ip = request.client.host - if 'x-real-ip' in request.headers: - ip = request.headers['x-real-ip'] - elif 'x-forwarded-for' in request.headers: - ip = request.headers['x-forwarded-for'] + if "x-real-ip" in request.headers: + ip = request.headers["x-real-ip"] + elif "x-forwarded-for" in request.headers: + ip = request.headers["x-forwarded-for"] - agent = request.headers['user-agent'] if 'user-agent' in request.headers else '' + agent = request.headers["user-agent"] if "user-agent" in request.headers else "" await create_hit(card.id, ip, agent, card.counter, ctr_int) From c04b0a19055d6b29f5ac38e314d783e9498b6768 Mon Sep 17 00:00:00 2001 From: iWarpBTC Date: Sun, 17 Jul 2022 12:23:56 +0200 Subject: [PATCH 243/421] Update index.html prettier --- .../boltcards/templates/boltcards/index.html | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 21ac4a45a..165d72fba 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -126,8 +126,7 @@ v-model.trim="cardDialog.data.card_name" type="text" label="Card name " - > + >
- {% endblock %} {% block scripts %} {{ window_vars(user) }} -{% endblock %} +{% endblock %} \ No newline at end of file From 293e5394a81fa4040acddf64b31c77a006939c1f Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Sun, 14 Aug 2022 10:58:35 -0600 Subject: [PATCH 246/421] run make format --- lnbits/extensions/boltcards/templates/boltcards/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 8ce57398c..61a962fec 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -458,4 +458,4 @@ } }) -{% endblock %} \ No newline at end of file +{% endblock %} From fc427e7ccc940815a0904d0b0659f3b0f8231aea Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Sun, 14 Aug 2022 11:38:26 -0600 Subject: [PATCH 247/421] resolves issue #872 & #815, error deleting lnurlp/lnurlw links (#877) * resolves issue #872, error deleting lnurlp link * apply the same fix for lnurlw in issue #815 --- lnbits/extensions/lnurlp/views_api.py | 4 ++-- lnbits/extensions/withdraw/views_api.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/lnurlp/views_api.py b/lnbits/extensions/lnurlp/views_api.py index 97e8fd4c4..f4ca505e2 100644 --- a/lnbits/extensions/lnurlp/views_api.py +++ b/lnbits/extensions/lnurlp/views_api.py @@ -121,7 +121,7 @@ async def api_link_create_or_update( return {**link.dict(), "lnurl": link.lnurl(request)} -@lnurlp_ext.delete("/api/v1/links/{link_id}") +@lnurlp_ext.delete("/api/v1/links/{link_id}", status_code=HTTPStatus.OK) async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(get_key_type)): link = await get_pay_link(link_id) @@ -136,7 +136,7 @@ async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(get_key_type ) await delete_pay_link(link_id) - raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + return {"success": True} @lnurlp_ext.get("/api/v1/rate/{currency}", status_code=HTTPStatus.OK) diff --git a/lnbits/extensions/withdraw/views_api.py b/lnbits/extensions/withdraw/views_api.py index 800fecced..e0d3e56fe 100644 --- a/lnbits/extensions/withdraw/views_api.py +++ b/lnbits/extensions/withdraw/views_api.py @@ -113,7 +113,7 @@ async def api_link_create_or_update( return {**link.dict(), **{"lnurl": link.lnurl(req)}} -@withdraw_ext.delete("/api/v1/links/{link_id}") +@withdraw_ext.delete("/api/v1/links/{link_id}", status_code=HTTPStatus.OK) async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(require_admin_key)): link = await get_withdraw_link(link_id) @@ -128,7 +128,7 @@ async def api_link_delete(link_id, wallet: WalletTypeInfo = Depends(require_admi ) await delete_withdraw_link(link_id) - raise HTTPException(status_code=HTTPStatus.NO_CONTENT) + return {"success": True} @withdraw_ext.get("/api/v1/links/{the_hash}/{lnurl_id}", status_code=HTTPStatus.OK) From c85be8dd22dffd5d2b5332bae7745674b1743811 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sun, 14 Aug 2022 19:40:46 +0200 Subject: [PATCH 248/421] dont assume field (#875) --- lnbits/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index e2df6629d..a6e64528f 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -76,7 +76,7 @@ def create_app(config_object="lnbits.settings") -> FastAPI: # Only the browser sends "text/html" request # not fail proof, but everything else get's a JSON response - if "text/html" in request.headers["accept"]: + if "text/html" in request.headers.get("accept"): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": f"{exc.errors()} is not a valid UUID."}, @@ -197,7 +197,7 @@ def register_exception_handlers(app: FastAPI): traceback.print_exception(etype, err, tb) exc = traceback.format_exc() - if "text/html" in request.headers["accept"]: + if "text/html" in request.headers.get("accept"): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": err} ) From 3df66334db687c097612ad4721719b53868133d0 Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Sun, 14 Aug 2022 11:41:26 -0600 Subject: [PATCH 249/421] clean up mobile layout per @callebtc (#874) --- lnbits/extensions/invoices/static/css/pay.css | 16 +++++++++++++--- .../invoices/templates/invoices/pay.html | 10 +++++----- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/lnbits/extensions/invoices/static/css/pay.css b/lnbits/extensions/invoices/static/css/pay.css index 626f5a43c..ad7ce914f 100644 --- a/lnbits/extensions/invoices/static/css/pay.css +++ b/lnbits/extensions/invoices/static/css/pay.css @@ -1,12 +1,11 @@ -#invoicePage>.row:first-child>.col-xs { +#invoicePage>.row:first-child>.col-md-6 { display: flex; } -#invoicePage>.row:first-child>.col-xs>.q-card { +#invoicePage>.row:first-child>.col-md-6>.q-card { flex: 1; } - #invoicePage .clear { margin-bottom: 25px; } @@ -15,6 +14,17 @@ display: none; } +@media (min-width: 1024px) { + #invoicePage>.row:first-child>.col-md-6:first-child>div { + margin-right: 5px; + } + + #invoicePage>.row:first-child>.col-md-6:nth-child(2)>div { + margin-left: 5px; + } +} + + @media print { * { color: black !important; diff --git a/lnbits/extensions/invoices/templates/invoices/pay.html b/lnbits/extensions/invoices/templates/invoices/pay.html index 14e3fcb7b..7b6452dc7 100644 --- a/lnbits/extensions/invoices/templates/invoices/pay.html +++ b/lnbits/extensions/invoices/templates/invoices/pay.html @@ -19,8 +19,8 @@ block page %}
-
-
+
+

@@ -88,7 +88,7 @@ block page %}

-
+

@@ -131,7 +131,7 @@ block page %}

-
+
@@ -162,7 +162,7 @@ block page %}
-
+
From 0f760bf39e0f9725db9c7dc637390b78568252b4 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sun, 14 Aug 2022 21:59:36 +0200 Subject: [PATCH 250/421] Lnurlp: use `unhashed_description` instead of `description_hash` (#878) * dont assume field * pass unhashed_description instead of description_hash for LNURL stuff * more --- lnbits/extensions/copilot/lnurl.py | 2 +- lnbits/extensions/livestream/lnurl.py | 2 +- lnbits/extensions/lnurldevice/lnurl.py | 2 +- lnbits/extensions/lnurlp/lnurl.py | 2 +- lnbits/extensions/offlineshop/lnurl.py | 2 +- lnbits/extensions/satsdice/lnurl.py | 2 +- lnbits/wallets/cln.py | 6 ++++-- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lnbits/extensions/copilot/lnurl.py b/lnbits/extensions/copilot/lnurl.py index 2fc3e1768..fa1996917 100644 --- a/lnbits/extensions/copilot/lnurl.py +++ b/lnbits/extensions/copilot/lnurl.py @@ -73,7 +73,7 @@ async def lnurl_callback( wallet_id=cp.wallet, amount=int(amount_received / 1000), memo=cp.lnurl_title, - description_hash=( + unhashed_description=( LnurlPayMetadata(json.dumps([["text/plain", str(cp.lnurl_title)]])) ).encode("utf-8"), extra={"tag": "copilot", "copilotid": cp.id, "comment": comment}, diff --git a/lnbits/extensions/livestream/lnurl.py b/lnbits/extensions/livestream/lnurl.py index 72cc1dbbe..349bb280d 100644 --- a/lnbits/extensions/livestream/lnurl.py +++ b/lnbits/extensions/livestream/lnurl.py @@ -90,7 +90,7 @@ async def lnurl_callback( wallet_id=ls.wallet, amount=int(amount_received / 1000), memo=await track.fullname(), - description_hash=(await track.lnurlpay_metadata()).encode("utf-8"), + unhashed_description=(await track.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "livestream", "track": track.id, "comment": comment}, ) diff --git a/lnbits/extensions/lnurldevice/lnurl.py b/lnbits/extensions/lnurldevice/lnurl.py index d8bd2e019..df0cd4b8f 100644 --- a/lnbits/extensions/lnurldevice/lnurl.py +++ b/lnbits/extensions/lnurldevice/lnurl.py @@ -205,7 +205,7 @@ async def lnurl_callback( wallet_id=device.wallet, amount=lnurldevicepayment.sats / 1000, memo=device.title, - description_hash=(await device.lnurlpay_metadata()).encode("utf-8"), + unhashed_description=(await device.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "PoS"}, ) lnurldevicepayment = await update_lnurldevicepayment( diff --git a/lnbits/extensions/lnurlp/lnurl.py b/lnbits/extensions/lnurlp/lnurl.py index 55f6807db..dea8037dd 100644 --- a/lnbits/extensions/lnurlp/lnurl.py +++ b/lnbits/extensions/lnurlp/lnurl.py @@ -87,7 +87,7 @@ async def api_lnurl_callback(request: Request, link_id): wallet_id=link.wallet, amount=int(amount_received / 1000), memo=link.description, - description_hash=link.lnurlpay_metadata.encode("utf-8"), + unhashed_description=link.lnurlpay_metadata.encode("utf-8"), extra={ "tag": "lnurlp", "link": link.id, diff --git a/lnbits/extensions/offlineshop/lnurl.py b/lnbits/extensions/offlineshop/lnurl.py index 5a2a0bcd2..f50df99ad 100644 --- a/lnbits/extensions/offlineshop/lnurl.py +++ b/lnbits/extensions/offlineshop/lnurl.py @@ -73,7 +73,7 @@ async def lnurl_callback(request: Request, item_id: int): wallet_id=shop.wallet, amount=int(amount_received / 1000), memo=item.name, - description_hash=(await item.lnurlpay_metadata()).encode("utf-8"), + unhashed_description=(await item.lnurlpay_metadata()).encode("utf-8"), extra={"tag": "offlineshop", "item": item.id}, ) except Exception as exc: diff --git a/lnbits/extensions/satsdice/lnurl.py b/lnbits/extensions/satsdice/lnurl.py index 73c5e5540..caafc3a48 100644 --- a/lnbits/extensions/satsdice/lnurl.py +++ b/lnbits/extensions/satsdice/lnurl.py @@ -77,7 +77,7 @@ async def api_lnurlp_callback( wallet_id=link.wallet, amount=int(amount_received / 1000), memo="Satsdice bet", - description_hash=link.lnurlpay_metadata.encode("utf-8"), + unhashed_description=link.lnurlpay_metadata.encode("utf-8"), extra={"tag": "satsdice", "link": link.id, "comment": "comment"}, ) diff --git a/lnbits/wallets/cln.py b/lnbits/wallets/cln.py index fe6ee2eb6..4761a59b6 100644 --- a/lnbits/wallets/cln.py +++ b/lnbits/wallets/cln.py @@ -87,8 +87,10 @@ class CoreLightningWallet(Wallet): label = "lbl{}".format(random.random()) msat: int = int(amount * 1000) try: - if description_hash: - raise Unsupported("description_hash") + if description_hash and not unhashed_description: + raise Unsupported( + "'description_hash' unsupported by CLN, provide 'unhashed_description'" + ) if unhashed_description and not self.supports_description_hash: raise Unsupported("unhashed_description") r = self.ln.invoice( From 9bc99f796b9dbc56e9969f8a0d6be5cabdcdaeb5 Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sun, 14 Aug 2022 22:59:02 +0200 Subject: [PATCH 251/421] Fix/header_lookup_none (#879) * dont assume field * fix header lookup --- lnbits/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index a6e64528f..d001e455f 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -76,7 +76,7 @@ def create_app(config_object="lnbits.settings") -> FastAPI: # Only the browser sends "text/html" request # not fail proof, but everything else get's a JSON response - if "text/html" in request.headers.get("accept"): + if request.headers and "text/html" in request.headers["accept"]: return template_renderer().TemplateResponse( "error.html", {"request": request, "err": f"{exc.errors()} is not a valid UUID."}, @@ -197,7 +197,7 @@ def register_exception_handlers(app: FastAPI): traceback.print_exception(etype, err, tb) exc = traceback.format_exc() - if "text/html" in request.headers.get("accept"): + if request.headers and "text/html" in request.headers["accept"]: return template_renderer().TemplateResponse( "error.html", {"request": request, "err": err} ) From befe96257d66de1b879b50df1a718c968139bc1d Mon Sep 17 00:00:00 2001 From: calle <93376500+callebtc@users.noreply.github.com> Date: Sun, 14 Aug 2022 23:17:53 +0200 Subject: [PATCH 252/421] Fix/header_check_fix_2 (#880) * dont assume field * check better --- lnbits/app.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lnbits/app.py b/lnbits/app.py index d001e455f..fb750eb32 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -76,7 +76,11 @@ def create_app(config_object="lnbits.settings") -> FastAPI: # Only the browser sends "text/html" request # not fail proof, but everything else get's a JSON response - if request.headers and "text/html" in request.headers["accept"]: + if ( + request.headers + and "accept" in request.headers + and "text/html" in request.headers["accept"] + ): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": f"{exc.errors()} is not a valid UUID."}, @@ -197,7 +201,11 @@ def register_exception_handlers(app: FastAPI): traceback.print_exception(etype, err, tb) exc = traceback.format_exc() - if request.headers and "text/html" in request.headers["accept"]: + if ( + request.headers + and "accept" in request.headers + and "text/html" in request.headers["accept"] + ): return template_renderer().TemplateResponse( "error.html", {"request": request, "err": err} ) From 0e5f6ac586d03288f42887b63eeb1694c66adf61 Mon Sep 17 00:00:00 2001 From: Gene Takavic Date: Sun, 14 Aug 2022 23:52:55 +0200 Subject: [PATCH 253/421] adapt to bolt-nfc-android-app --- lnbits/extensions/boltcards/README.md | 61 ++-- lnbits/extensions/boltcards/__init__.py | 9 + lnbits/extensions/boltcards/crud.py | 45 ++- lnbits/extensions/boltcards/migrations.py | 9 +- lnbits/extensions/boltcards/models.py | 21 +- .../extensions/boltcards/static/js/index.js | 299 +++++++++++++++++ .../boltcards/templates/boltcards/index.html | 314 ++++-------------- lnbits/extensions/boltcards/views_api.py | 97 ++---- 8 files changed, 504 insertions(+), 351 deletions(-) create mode 100644 lnbits/extensions/boltcards/static/js/index.js diff --git a/lnbits/extensions/boltcards/README.md b/lnbits/extensions/boltcards/README.md index ca239e42e..5fa6a9784 100644 --- a/lnbits/extensions/boltcards/README.md +++ b/lnbits/extensions/boltcards/README.md @@ -2,13 +2,50 @@ This extension allows you to link your Bolt card with a LNbits instance and use it more securely then just with a static LNURLw on it. A technology called [Secure Unique NFC](https://mishka-scan.com/blog/secure-unique-nfc) is utilized in this workflow. -***In order to use this extension you need to be able setup your card first.*** There's a [guide](https://www.whitewolftech.com/articles/payment-card/) to set it up with your computer. Or it can be done with [https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter](TagWriter app by NXP) Android app. +**Disclaim:** ***Use this only if you either know what you are doing or are enough reckless lightning pioneer. Only you are responsible for all your sats, cards and other devices. Always backup all your card keys!*** -## Setting the outside the extension - android -- Write tags +***In order to use this extension you need to be able setup your card.*** That is writting on the URL template pointing to your LNBits instance, configure some SUN (SDM) setting and optionaly changing the card keys. There's a [guide](https://www.whitewolftech.com/articles/payment-card/) to set it up with a card reader connected to your computer. It can be done (without setting the keys) with [TagWriter app by NXP](https://play.google.com/store/apps/details?id=com.nxp.nfc.tagwriter) Android app. Last but not least, an OSS android app by name [bolt-nfc-android-app](https://github.com/boltcard/bolt-nfc-android-app) is being developed for these purposes. + +## About the keys + +Up to five 16bytes keys can be stored on the card, numbered from 00 to 04. In the empty state they all should be set to zeros (00000000000000000000000000000000). For this extension only two keys need to be set: + +One for encrypting the card UID and the counter (p parameter), let's called it meta key, key #01or K1. + +One for calculating CMAC (c parameter), let's called it file key, key #02 or K2. + +The key #00, K0 or also auth key is skipped to be use as authentification key. Is not needed by this extension, but can be filled in order to write the keys in cooperation with bolt-nfc-android-app. + +***Always backup all keys that you're trying to write on the card. Without them you may not be able to change them in the future!*** + +## LNURLw +Create a withdraw link within the LNURLw extension before adding a card. Enable the `Use unique withdraw QR codes to reduce 'assmilking'` option. + +## Setting the card - bolt-nfc-android-app (easy way) +So far, regarding the keys, the app can only write a new key set on an empty card (with zero keys). **When you write non zero (and 'non debug') keys, they can't be rewrite with this app.** You have to do it on your computer. + +- Read the card with the app. Note UID so you can fill it in the extension later. +- Write the link on the card. It shoud be like `YOUR_LNBITS_DOMAIN/boltcards/api/v1/scan` +- Add new card in the extension. + - Leaving any key array empty means that key is 16bytes of zero (00000000000000000000000000000000). + - GENERATE KEY button fill the keys randomly. If there is "debug" in the card name, a debug set of keys is filled instead. + - Leaving initial counter empty means zero. +- Open the card details. **Backup the keys.** Scan the QR with the app to write the keys on the card. + +## Setting the card - computer (hard way) + +Follow the guide. + +The URI should be `lnurlw://YOUR-DOMAIN.COM/boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000` + +Then fill up the card parameters in the extension. Card Auth key (K0) can be omitted. Initical counter can be 0. + +## Setting the card - android NXP app (hard way) +- If you don't know the card ID, use NXP TagInfo app to find it out. +- In the TagWriter app tap Write tags - New Data Set > Link - Set URI type to Custom URL -- URL should look like lnurlw://YOUR_LNBITS_DOMAIN/boltcards/api/v1/scane?e=00000000000000000000000000000000&c=0000000000000000 +- URL should look like lnurlw://YOUR_LNBITS_DOMAIN/boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 - click Configure mirroring options - Select Card Type NTAG 424 DNA - Check Enable SDM Mirroring @@ -23,18 +60,4 @@ This extension allows you to link your Bolt card with a LNbits instance and use - Save & Write - Scan with compatible Wallet -## Setting the outside the extension - computer - -Follow the guide. - -The URI should be `lnurlw://YOUR-DOMAIN.COM/boltcards/api/v1/scane/?e=00000000000000000000000000000000&c=0000000000000000` - -(At this point the link is common to all cards. So the extension grabs one by one every added card's key and tries to decrypt the e parameter until there's a match.) - -Choose and note your Meta key and File key. - -## Adding the into the extension - -Create a withdraw link within the LNURLw extension before adding a card. Enable the `Use unique withdraw QR codes to reduce 'assmilking'` option. - -The card UID can be retrieve with `NFC TagInfo` mobile app or from `NXP TagXplorer` log. Use the keys you've set before. You can leave the counter zero, it gets synchronized with the first use. \ No newline at end of file +This app afaik cannot change the keys. If you cannot change them any other way, leave them empty in the extension dialog and remember you're not secure. Card Auth key (K0) can be omitted anyway. Initical counter can be 0. diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py index f1ef972eb..f53363411 100644 --- a/lnbits/extensions/boltcards/__init__.py +++ b/lnbits/extensions/boltcards/__init__.py @@ -1,10 +1,19 @@ from fastapi import APIRouter +from starlette.staticfiles import StaticFiles from lnbits.db import Database from lnbits.helpers import template_renderer db = Database("ext_boltcards") +boltcards_static_files = [ + { + "path": "/boltcards/static", + "app": StaticFiles(packages=[("lnbits", "extensions/boltcards/static")]), + "name": "boltcards_static", + } +] + boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 5c2824f4f..5affe3122 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -1,4 +1,4 @@ -from optparse import Option +import secrets from typing import List, Optional, Union from lnbits.helpers import urlsafe_short_hash @@ -18,10 +18,12 @@ async def create_card(data: CreateCardData, wallet_id: str) -> Card: uid, counter, withdraw, - file_key, - meta_key + k0, + k1, + k2, + otp ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, ( card_id, @@ -30,11 +32,13 @@ async def create_card(data: CreateCardData, wallet_id: str) -> Card: data.uid, data.counter, data.withdraw, - data.file_key, - data.meta_key, + data.k0, + data.k1, + data.k2, + secrets.token_hex(16), ), ) - card = await get_card(card_id, 0) + card = await get_card(card_id) assert card, "Newly created card couldn't be retrieved" return card @@ -69,14 +73,18 @@ async def get_all_cards() -> List[Card]: return [Card(**row) for row in rows] -async def get_card(card_id: str, id_is_uid: bool = False) -> Optional[Card]: - sql = "SELECT * FROM boltcards.cards WHERE {} = ?".format( - "uid" if id_is_uid else "id" - ) - row = await db.fetchone( - sql, - card_id, - ) +async def get_card(card_id: str) -> Optional[Card]: + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE id = ?", (card_id,)) + if not row: + return None + + card = dict(**row) + + return Card.parse_obj(card) + + +async def get_card_by_otp(otp: str) -> Optional[Card]: + row = await db.fetchone("SELECT * FROM boltcards.cards WHERE otp = ?", (otp,)) if not row: return None @@ -96,6 +104,13 @@ async def update_card_counter(counter: int, id: str): ) +async def update_card_otp(otp: str, id: str): + await db.execute( + "UPDATE boltcards.cards SET otp = ? WHERE id = ?", + (otp, id), + ) + + async def get_hit(hit_id: str) -> Optional[Hit]: row = await db.fetchone(f"SELECT * FROM boltcards.hits WHERE id = ?", (hit_id)) if not row: diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py index 6e0fa0723..7dc5acb44 100644 --- a/lnbits/extensions/boltcards/migrations.py +++ b/lnbits/extensions/boltcards/migrations.py @@ -11,8 +11,13 @@ async def m001_initial(db): uid TEXT NOT NULL, counter INT NOT NULL DEFAULT 0, withdraw TEXT NOT NULL, - file_key TEXT NOT NULL DEFAULT '00000000000000000000000000000000', - meta_key TEXT NOT NULL DEFAULT '', + k0 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + k1 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + k2 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k0 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k1 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + prev_k2 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', + otp TEXT NOT NULL DEFAULT '', time TIMESTAMP NOT NULL DEFAULT """ + db.timestamp_now + """ diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index b6d521c3c..6e1997545 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -1,6 +1,8 @@ from fastapi.params import Query from pydantic import BaseModel +ZERO_KEY = "00000000000000000000000000000000" + class Card(BaseModel): id: str @@ -9,18 +11,27 @@ class Card(BaseModel): uid: str counter: int withdraw: str - file_key: str - meta_key: str + k0: str + k1: str + k2: str + prev_k0: str + prev_k1: str + prev_k2: str + otp: str time: int class CreateCardData(BaseModel): card_name: str = Query(...) uid: str = Query(...) - counter: str = Query(...) + counter: int = Query(0) withdraw: str = Query(...) - file_key: str = Query(...) - meta_key: str = Query(...) + k0: str = Query(ZERO_KEY) + k1: str = Query(ZERO_KEY) + k2: str = Query(ZERO_KEY) + prev_k0: str = Query(ZERO_KEY) + prev_k1: str = Query(ZERO_KEY) + prev_k2: str = Query(ZERO_KEY) class Hit(BaseModel): diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js new file mode 100644 index 000000000..e2afbf1e4 --- /dev/null +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -0,0 +1,299 @@ +Vue.component(VueQrcode.name, VueQrcode) + +const mapCards = obj => { + obj.date = Quasar.utils.date.formatDate( + new Date(obj.time * 1000), + 'YYYY-MM-DD HH:mm' + ) + + return obj +} + +new Vue({ + el: '#vue', + mixins: [windowMixin], + data: function () { + return { + cards: [], + hits: [], + withdrawsOptions: [], + cardDialog: { + show: false, + data: {}, + temp: {} + }, + cardsTable: { + columns: [ + { + name: 'card_name', + align: 'left', + label: 'Card name', + field: 'card_name' + }, + { + name: 'counter', + align: 'left', + label: 'Counter', + field: 'counter' + }, + { + name: 'withdraw', + align: 'left', + label: 'Withdraw ID', + field: 'withdraw' + } + ], + pagination: { + rowsPerPage: 10 + } + }, + hitsTable: { + columns: [ + { + name: 'card_name', + align: 'left', + label: 'Card name', + field: 'card_name' + }, + { + name: 'old_ctr', + align: 'left', + label: 'Old counter', + field: 'old_ctr' + }, + { + name: 'new_ctr', + align: 'left', + label: 'New counter', + field: 'new_ctr' + }, + { + name: 'date', + align: 'left', + label: 'Time', + field: 'date' + }, + { + name: 'ip', + align: 'left', + label: 'IP', + field: 'ip' + }, + { + name: 'useragent', + align: 'left', + label: 'User agent', + field: 'useragent' + } + ], + pagination: { + rowsPerPage: 10, + sortBy: 'date', + descending: true + } + }, + qrCodeDialog: { + show: false, + data: null + } + } + }, + methods: { + getCards: function () { + var self = this + + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/cards?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.cards = response.data.map(function (obj) { + return mapCards(obj) + }) + console.log(self.cards) + }) + }, + getHits: function () { + var self = this + + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/hits?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.hits = response.data.map(function (obj) { + obj.card_name = self.cards.find(d => d.id == obj.card_id).card_name + return mapCards(obj) + }) + console.log(self.hits) + }) + }, + getWithdraws: function () { + var self = this + + LNbits.api + .request( + 'GET', + '/withdraw/api/v1/links?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.withdrawsOptions = response.data.map(function (obj) { + return { + label: [obj.title, ' - ', obj.id].join(''), + value: obj.id + } + }) + console.log(self.withdraws) + }) + }, + openQrCodeDialog(cardId) { + var card = _.findWhere(this.cards, {id: cardId}) + + this.qrCodeDialog.data = { + link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, + name: card.card_name, + uid: card.uid, + k0: card.k0, + k1: card.k1, + k2: card.k2 + } + this.qrCodeDialog.show = true + }, + generateKeys: function () { + const genRanHex = size => + [...Array(size)] + .map(() => Math.floor(Math.random() * 16).toString(16)) + .join('') + + debugcard = + typeof this.cardDialog.data.card_name === 'string' && + this.cardDialog.data.card_name.search('debug') > -1 + + this.cardDialog.data.k0 = debugcard + ? '11111111111111111111111111111111' + : genRanHex(32) + this.$refs['k0'].value = this.cardDialog.data.k0 + + this.cardDialog.data.k1 = debugcard + ? '22222222222222222222222222222222' + : genRanHex(32) + this.$refs['k1'].value = this.cardDialog.data.k1 + + this.cardDialog.data.k2 = debugcard + ? '33333333333333333333333333333333' + : genRanHex(32) + this.$refs['k2'].value = this.cardDialog.data.k2 + }, + closeFormDialog: function () { + this.cardDialog.data = {} + }, + sendFormData: function () { + let wallet = _.findWhere(this.g.user.wallets, { + id: this.cardDialog.data.wallet + }) + let data = this.cardDialog.data + if (data.id) { + this.updateCard(wallet, data) + } else { + this.createCard(wallet, data) + } + }, + createCard: function (wallet, data) { + var self = this + + LNbits.api + .request('POST', '/boltcards/api/v1/cards', wallet.adminkey, data) + .then(function (response) { + self.cards.push(mapCards(response.data)) + self.cardDialog.show = false + self.cardDialog.data = {} + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + updateCardDialog: function (formId) { + var card = _.findWhere(this.cards, {id: formId}) + console.log(card.id) + this.cardDialog.data = _.clone(card) + + this.cardDialog.temp.k0 = this.cardDialog.data.k0 + this.cardDialog.temp.k1 = this.cardDialog.data.k1 + this.cardDialog.temp.k2 = this.cardDialog.data.k2 + + this.cardDialog.show = true + }, + updateCard: function (wallet, data) { + var self = this + + if ( + this.cardDialog.temp.k0 != data.k0 || + this.cardDialog.temp.k1 != data.k1 || + this.cardDialog.temp.k2 != data.k2 + ) { + data.prev_k0 = this.cardDialog.temp.k0 + data.prev_k1 = this.cardDialog.temp.k1 + data.prev_k2 = this.cardDialog.temp.k2 + } + + console.log(data) + + LNbits.api + .request( + 'PUT', + '/boltcards/api/v1/cards/' + data.id, + wallet.adminkey, + data + ) + .then(function (response) { + self.cards = _.reject(self.cards, function (obj) { + return obj.id == data.id + }) + self.cards.push(mapCards(response.data)) + self.cardDialog.show = false + self.cardDialog.data = {} + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }, + deleteCard: function (cardId) { + let self = this + let cards = _.findWhere(this.cards, {id: cardId}) + + LNbits.utils + .confirmDialog('Are you sure you want to delete this card') + .onOk(function () { + LNbits.api + .request( + 'DELETE', + '/boltcards/api/v1/cards/' + cardId, + _.findWhere(self.g.user.wallets, {id: cards.wallet}).adminkey + ) + .then(function (response) { + self.cards = _.reject(self.cards, function (obj) { + return obj.id == cardId + }) + }) + .catch(function (error) { + LNbits.utils.notifyApiError(error) + }) + }) + }, + exportCardsCSV: function () { + LNbits.utils.exportCSV(this.cardsTable.columns, this.cards) + } + }, + created: function () { + if (this.g.user.wallets.length) { + this.getCards() + this.getHits() + this.getWithdraws() + } + } +}) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 61a962fec..a6961fe59 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -33,6 +33,7 @@ {% raw %}
+ +
+ + + + +
Enter new password (8 numbers/letters) -

- - For test purposes only. Do not enter word list with real funds!!! - +
Date: Mon, 22 Aug 2022 10:09:26 +0300 Subject: [PATCH 313/421] feat: UI improvements and fixes --- .../static/components/history/history.js | 4 ++++ .../static/components/payment/payment.js | 23 +++++++++++-------- .../components/wallet-list/wallet-list.js | 1 + .../extensions/watchonly/static/js/index.js | 7 ++++++ .../watchonly/templates/watchonly/index.html | 3 ++- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/lnbits/extensions/watchonly/static/components/history/history.js b/lnbits/extensions/watchonly/static/components/history/history.js index 574a1ef69..81cf44cc7 100644 --- a/lnbits/extensions/watchonly/static/components/history/history.js +++ b/lnbits/extensions/watchonly/static/components/history/history.js @@ -39,6 +39,10 @@ async function history(path) { label: 'Date', field: 'date', sortable: true + }, + { + name: 'txId', + field: 'txId' } ], exportColums: [ diff --git a/lnbits/extensions/watchonly/static/components/payment/payment.js b/lnbits/extensions/watchonly/static/components/payment/payment.js index 2056fcfeb..a74e5489d 100644 --- a/lnbits/extensions/watchonly/static/components/payment/payment.js +++ b/lnbits/extensions/watchonly/static/components/payment/payment.js @@ -33,7 +33,6 @@ async function payment(path) { signedTxHex: null, sentTxId: null, signedTxId: null, - paymentTab: 'destination', sendToList: [{address: '', amount: undefined}], changeWallet: null, changeAddress: {}, @@ -83,6 +82,17 @@ async function payment(path) { satBtc(val, showUnit = true) { return satOrBtc(val, showUnit, this.satsDenominated) }, + clearState: function () { + this.psbtBase64 = null + this.psbtBase64Signed = null + this.signedTx = null + this.signedTxHex = null + this.signedTxId = null + this.sendToList = [{address: '', amount: undefined}] + this.showChecking = false + this.showPsbt = false + this.showFinalTx = false + }, checkAndSend: async function () { this.showChecking = true try { @@ -143,7 +153,6 @@ async function payment(path) { }, createPsbt: async function () { try { - console.log('### this.createPsbt') this.tx = this.createTx() for (const input of this.tx.inputs) { input.tx_hex = await this.fetchTxHex(input.tx_id) @@ -237,8 +246,6 @@ async function payment(path) { this.showChecking = true this.psbtBase64Signed = psbtBase64 - console.log('### payment updateSignedPsbt psbtBase64', psbtBase64) - const data = await this.extractTxFromPsbt(psbtBase64) this.showFinalTx = true if (data) { @@ -253,7 +260,6 @@ async function payment(path) { } }, extractTxFromPsbt: async function (psbtBase64) { - console.log('### extractTxFromPsbt psbtBase64', psbtBase64) try { const {data} = await LNbits.api.request( 'PUT', @@ -264,13 +270,12 @@ async function payment(path) { inputs: this.tx.inputs } ) - console.log('### extractTxFromPsbt data', data) return data } catch (error) { - console.log('### error', error) this.$q.notify({ type: 'warning', message: 'Cannot finalize PSBT!', + caption: `${error}`, timeout: 10000 }) LNbits.utils.notifyApiError(error) @@ -293,8 +298,8 @@ async function payment(path) { timeout: 10000 }) - // todo: event rescan with amount - // todo: display tx id + this.clearState() + this.$emit('broadcast-done', this.sentTxId) } catch (error) { this.sentTxId = null this.$q.notify({ diff --git a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js index c545ed2e6..f36e0d59f 100644 --- a/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js +++ b/lnbits/extensions/watchonly/static/components/wallet-list/wallet-list.js @@ -99,6 +99,7 @@ async function walletList(path) { async network(newNet, oldNet) { if (newNet !== oldNet) { await this.refreshWalletAccounts() + this.handleAddressTypeChanged(this.addressTypeOptions[1]) } } }, diff --git a/lnbits/extensions/watchonly/static/js/index.js b/lnbits/extensions/watchonly/static/js/index.js index 68204aca4..ad1cdc143 100644 --- a/lnbits/extensions/watchonly/static/js/index.js +++ b/lnbits/extensions/watchonly/static/js/index.js @@ -386,6 +386,13 @@ const watchOnly = async () => { this.addresses = addresses this.scanAddressWithAmount() } + }, + handleBroadcastSuccess: async function (txId) { + this.tab = 'history' + this.searchInTab({tab: 'history', value: txId}) + this.showPayment = false + await this.refreshAddresses() + await this.scanAddressWithAmount() } }, created: async function () { diff --git a/lnbits/extensions/watchonly/templates/watchonly/index.html b/lnbits/extensions/watchonly/templates/watchonly/index.html index 5108da91f..b9ce361ce 100644 --- a/lnbits/extensions/watchonly/templates/watchonly/index.html +++ b/lnbits/extensions/watchonly/templates/watchonly/index.html @@ -136,6 +136,7 @@ :adminkey="g.user.wallets[0].adminkey" :serial-signer-ref="$refs.serialSigner" :sats-denominated="config.sats_denominated" + @broadcast-done="handleBroadcastSuccess" >
@@ -176,7 +177,7 @@ dense size="ms" icon="content_copy" - @click="copyText(props.row.address)" + @click="copyText(currentAddress.address)" class="q-ml-sm" > From 4e68c114fd2ec6c5b5d8b7b53eb32f01a7c66c77 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 22 Aug 2022 20:14:19 +0100 Subject: [PATCH 314/421] UI updated --- .../extensions/boltcards/static/js/index.js | 6 +++-- .../boltcards/templates/boltcards/index.html | 25 +++++++++++-------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index e2afbf1e4..d8beaa083 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -13,13 +13,14 @@ new Vue({ el: '#vue', mixins: [windowMixin], data: function () { - return { + return { + toggleAdvanced: false, cards: [], hits: [], withdrawsOptions: [], cardDialog: { show: false, - data: {}, + data: {counter:1}, temp: {} }, cardsTable: { @@ -193,6 +194,7 @@ new Vue({ this.cardDialog.data = {} }, sendFormData: function () { + this.generateKeys() let wallet = _.findWhere(this.g.user.wallets, { id: this.cardDialog.data.wallet }) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index a6961fe59..8b06b7500 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -171,9 +171,13 @@ v-model.trim="cardDialog.data.uid" type="text" label="Card UID" - hint="Card unique identificator (7 bytes in HEX)." - > + >From the NFC 424 ntag card that will be loaded + +
Zero if you don't know. + Generate keys +
Create Card - Generate keys Cancel From 56c9234aff636aec73acf935ee2631102628bd26 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 22 Aug 2022 22:33:20 +0100 Subject: [PATCH 315/421] LNURLs handled internally Has bugs --- lnbits/extensions/boltcards/__init__.py | 2 +- lnbits/extensions/boltcards/lnurl.py | 197 ++++++++++++++++++ lnbits/extensions/boltcards/migrations.py | 18 +- lnbits/extensions/boltcards/models.py | 25 ++- .../extensions/boltcards/static/js/index.js | 29 +-- .../boltcards/templates/boltcards/index.html | 77 ++++++- lnbits/extensions/boltcards/views_api.py | 97 +-------- 7 files changed, 312 insertions(+), 133 deletions(-) create mode 100644 lnbits/extensions/boltcards/lnurl.py diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py index f53363411..5fcbd12e1 100644 --- a/lnbits/extensions/boltcards/__init__.py +++ b/lnbits/extensions/boltcards/__init__.py @@ -20,6 +20,6 @@ boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) def boltcards_renderer(): return template_renderer(["lnbits/extensions/boltcards/templates"]) - +from .lnurl import * # noqa from .views import * # noqa from .views_api import * # noqa diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py new file mode 100644 index 000000000..51a85e8a9 --- /dev/null +++ b/lnbits/extensions/boltcards/lnurl.py @@ -0,0 +1,197 @@ +import base64 +import hashlib +import hmac +from http import HTTPStatus +from io import BytesIO +from typing import Optional + +from embit import bech32, compact +from fastapi import Request +from fastapi.param_functions import Query +from starlette.exceptions import HTTPException + +from lnbits.core.services import create_invoice +from lnbits.core.views.api import pay_invoice + +from lnurl import Lnurl, LnurlWithdrawResponse +from lnurl import encode as lnurl_encode # type: ignore +from lnurl.types import LnurlPayMetadata # type: ignore + +from . import boltcards_ext +from .crud import ( + create_hit, + get_card, + get_card_by_otp, + get_card_by_uid, + get_hit, + update_card, + update_card_counter, + update_card_otp, +) +from .models import CreateCardData +from .nxp424 import decryptSUN, getSunMAC + +# /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 +@boltcards_ext.get("/api/v1/scan/{card_uid}") +async def api_scan(p, c, request: Request, card_uid: str = None): + # some wallets send everything as lower case, no bueno + p = p.upper() + c = c.upper() + card = None + counter = b"" + try: + card = await get_card_by_uid(card_uid) + card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) + + if card.uid.upper() != card_uid.hex().upper(): + return {"status": "ERROR", "reason": "Card UID mis-match."} + except: + return {"status": "ERROR", "reason": "Error decrypting card."} + + if card == None: + return {"status": "ERROR", "reason": "Unknown card."} + + if c != getSunMAC(card_uid, counter, bytes.fromhex(card.k2)).hex().upper(): + return {"status": "ERROR", "reason": "CMAC does not check."} + + ctr_int = int.from_bytes(counter, "little") + + if ctr_int <= card.counter: + return {"status": "ERROR", "reason": "This link is already used."} + + await update_card_counter(ctr_int, card.id) + + # gathering some info for hit record + ip = request.client.host + if "x-real-ip" in request.headers: + ip = request.headers["x-real-ip"] + elif "x-forwarded-for" in request.headers: + ip = request.headers["x-forwarded-for"] + + agent = request.headers["user-agent"] if "user-agent" in request.headers else "" + todays_hits = await get_hits_today(card.id) + int hits_amount = 0 + for hit in todays_hits: + hits_amount = hits_amount + hit.amount + if (hits_amount + card.tx_limit) > card.daily_limit: + return {"status": "ERROR", "reason": "Max daily liit spent."} + hit = await create_hit(card.id, ip, agent, card.counter, ctr_int) + + # link = await get_withdraw_link(card.withdraw, 0) + return link.lnurl_response(request) + return { + "tag": "withdrawRequest", + "callback": request.url_for( + "boltcards.lnurl_callback" + ), + "k1": hit.id, + "minWithdrawable": 1 * 1000, + "maxWithdrawable": card.tx_limit * 1000, + "defaultDescription": f"Boltcard (Refunds address {lnurl_encode(req.url_for("boltcards.lnurlp_response", hit_id=hit.id))})", + } + +@boltcards_ext.get( + "/api/v1/lnurl/cb/{hitid}", + status_code=HTTPStatus.OK, + name="boltcards.lnurl_callback", +) +async def lnurl_callback( + request: Request, + pr: str = Query(None), + k1: str = Query(None), +): + hit = await get_hit(k1) + card = await get_card(hit.id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + + if pr: + if hit.id != k1: + return {"status": "ERROR", "reason": "Bad K1"} + if hit.spent: + return {"status": "ERROR", "reason": f"Payment already claimed"} + hit = await spend_hit(hit.id) + if not hit: + return {"status": "ERROR", "reason": f"Payment failed"} + await pay_invoice( + wallet_id=card.wallet, + payment_request=pr, + max_sat=card.tx_limit / 1000, + extra={"tag": "boltcard"}, + ) + return {"status": "OK"} + else: + return {"status": "ERROR", "reason": f"Payment failed"} + + +# /boltcards/api/v1/auth?a=00000000000000000000000000000000 +@boltcards_ext.get("/api/v1/auth") +async def api_auth(a, request: Request): + if a == "00000000000000000000000000000000": + response = {"k0": "0" * 32, "k1": "1" * 32, "k2": "2" * 32} + return response + + card = await get_card_by_otp(a) + + if not card: + raise HTTPException( + detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND + ) + + new_otp = secrets.token_hex(16) + print(card.otp) + print(new_otp) + await update_card_otp(new_otp, card.id) + + response = {"k0": card.k0, "k1": card.k1, "k2": card.k2} + + return response + +###############LNURLPAY REFUNDS################# + +@satsdice_ext.get( + "/api/v1/lnurlp/{hit_id}", + response_class=HTMLResponse, + name="boltcards.lnurlp_response", +) +async def api_lnurlp_response(req: Request, hit_id: str = Query(None)): + hit = await get_hit(hit_id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + payResponse = { + "tag": "payRequest", + "callback": req.url_for("boltcards.lnurlp_callback", hit_id=hit_id), + "metadata": LnurlPayMetadata(json.dumps([["text/plain", "Refund"]])), + "minSendable": math.ceil(link.min_bet * 1) * 1000, + "maxSendable": round(link.max_bet * 1) * 1000, + } + return json.dumps(payResponse) + + +@satsdice_ext.get( + "/api/v1/lnurlp/cb/{hit_id}", + response_class=HTMLResponse, + name="boltcards.lnurlp_callback", +) +async def api_lnurlp_callback( + req: Request, hit_id: str = Query(None), amount: str = Query(None) +): + hit = await get_hit(hit_id) + if not hit: + return {"status": "ERROR", "reason": f"LNURL-pay record not found."} + + payment_hash, payment_request = await create_invoice( + wallet_id=link.wallet, + amount=int(amount / 1000), + memo=f"Refund {hit_id}", + unhashed_description=LnurlPayMetadata(json.dumps([["text/plain", hit_id]])).encode("utf-8"), + extra={"refund": hit_id}, + ) + + payResponse = {"pr": payment_request, "successAction": success_action, "routes": []} + + return json.dumps(payResponse) + + + + diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py index 7dc5acb44..99f425837 100644 --- a/lnbits/extensions/boltcards/migrations.py +++ b/lnbits/extensions/boltcards/migrations.py @@ -10,7 +10,8 @@ async def m001_initial(db): card_name TEXT NOT NULL, uid TEXT NOT NULL, counter INT NOT NULL DEFAULT 0, - withdraw TEXT NOT NULL, + tx_limit TEXT NOT NULL, + daily_limit TEXT NOT NULL, k0 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', k1 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', k2 TEXT NOT NULL DEFAULT '00000000000000000000000000000000', @@ -31,9 +32,24 @@ async def m001_initial(db): id TEXT PRIMARY KEY, card_id TEXT NOT NULL, ip TEXT NOT NULL, + spent BOOL NOT NULL DEFAULT True, useragent TEXT, old_ctr INT NOT NULL DEFAULT 0, new_ctr INT NOT NULL DEFAULT 0, + amount INT NOT NULL, + time TIMESTAMP NOT NULL DEFAULT """ + + db.timestamp_now + + """ + ); + """ + ) + + await db.execute( + """ + CREATE TABLE boltcards.refunds ( + id TEXT PRIMARY KEY, + hit_id TEXT NOT NULL, + refund_amount INT NOT NULL, time TIMESTAMP NOT NULL DEFAULT """ + db.timestamp_now + """ diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 6e1997545..e272d2f91 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -10,7 +10,8 @@ class Card(BaseModel): card_name: str uid: str counter: int - withdraw: str + tx_limit: int + daily_limit: int k0: str k1: str k2: str @@ -20,12 +21,24 @@ class Card(BaseModel): otp: str time: int + def from_row(cls, row: Row) -> "Card": + return cls(**dict(row)) + + def lnurl(self, req: Request) -> Lnurl: + url = req.url_for( + "boltcard.lnurl_response", device_id=self.id, _external=True + ) + return lnurl_encode(url) + + async def lnurlpay_metadata(self) -> LnurlPayMetadata: + return LnurlPayMetadata(json.dumps([["text/plain", self.title]])) class CreateCardData(BaseModel): card_name: str = Query(...) uid: str = Query(...) counter: int = Query(0) - withdraw: str = Query(...) + tx_limit: int = Query(0) + daily_limit: int = Query(0) k0: str = Query(ZERO_KEY) k1: str = Query(ZERO_KEY) k2: str = Query(ZERO_KEY) @@ -33,12 +46,18 @@ class CreateCardData(BaseModel): prev_k1: str = Query(ZERO_KEY) prev_k2: str = Query(ZERO_KEY) - class Hit(BaseModel): id: str card_id: str ip: str + spent: bool useragent: str old_ctr: int new_ctr: int time: int + +class Refund(BaseModel): + id: str + hit_id: str + refund_amount: int + time: int \ No newline at end of file diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index d8beaa083..55f2d178d 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -17,10 +17,14 @@ new Vue({ toggleAdvanced: false, cards: [], hits: [], - withdrawsOptions: [], cardDialog: { show: false, - data: {counter:1}, + data: { + counter:1, + k0: '', + k1: '', + k2: '', + card_name:''}, temp: {} }, cardsTable: { @@ -133,25 +137,6 @@ new Vue({ console.log(self.hits) }) }, - getWithdraws: function () { - var self = this - - LNbits.api - .request( - 'GET', - '/withdraw/api/v1/links?all_wallets=true', - this.g.user.wallets[0].inkey - ) - .then(function (response) { - self.withdrawsOptions = response.data.map(function (obj) { - return { - label: [obj.title, ' - ', obj.id].join(''), - value: obj.id - } - }) - console.log(self.withdraws) - }) - }, openQrCodeDialog(cardId) { var card = _.findWhere(this.cards, {id: cardId}) @@ -166,6 +151,7 @@ new Vue({ this.qrCodeDialog.show = true }, generateKeys: function () { + this.cardDialog.show = true const genRanHex = size => [...Array(size)] .map(() => Math.floor(Math.random() * 16).toString(16)) @@ -194,7 +180,6 @@ new Vue({ this.cardDialog.data = {} }, sendFormData: function () { - this.generateKeys() let wallet = _.findWhere(this.g.user.wallets, { id: this.cardDialog.data.wallet }) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 8b06b7500..4c409387b 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -5,7 +5,7 @@
- Add Card @@ -122,6 +122,45 @@ + + +
+
+
Refunds
+
+
+ Export to CSV +
+
+ + {% raw %} + + + {% endraw %} + +
+
@@ -148,15 +187,32 @@ label="Wallet *" > - - + +
+
+ +
+
+ +
+
+ + From the NFC 424 ntag card that will be loaded diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index 37a796262..ee91cffb4 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -1,11 +1,3 @@ -# views_api.py is for you API endpoints that could be hit by another service - -# add your dependencies here - -# import httpx -# (use httpx just like requests, except instead of response.ok there's only the -# response.is_error that is its inverse) - import secrets from http import HTTPStatus @@ -15,7 +7,6 @@ from starlette.requests import Request from lnbits.core.crud import get_user from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key -from lnbits.extensions.withdraw import get_withdraw_link from . import boltcards_ext from .crud import ( @@ -127,90 +118,4 @@ async def api_hits( for card in cards: cards_ids.append(card.id) - return [hit.dict() for hit in await get_hits(cards_ids)] - - -# /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 -@boltcards_ext.get("/api/v1/scan") -@boltcards_ext.get("/api/v1/scan/{card_uid}") -async def api_scan(p, c, request: Request, card_uid: str = None): - # some wallets send everything as lower case, no bueno - p = p.upper() - c = c.upper() - card = None - counter = b"" - - if not card_uid: - # since this route is common to all cards I don't know whitch 'meta key' to use - # so I try one by one until decrypted uid matches - for cand in await get_all_cards(): - if cand.k1: - try: - card_uid, counter = decryptSUN( - bytes.fromhex(p), bytes.fromhex(cand.k1) - ) - - if card_uid.hex().upper() == cand.uid.upper(): - card = cand - break - except: - continue - else: - try: - card = await get_card_by_uid(card_uid) - card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) - - if card.uid.upper() != card_uid.hex().upper(): - return {"status": "ERROR", "reason": "Card UID mis-match."} - except: - return {"status": "ERROR", "reason": "Error decrypting card."} - - if card == None: - return {"status": "ERROR", "reason": "Unknown card."} - - if c != getSunMAC(card_uid, counter, bytes.fromhex(card.k2)).hex().upper(): - return {"status": "ERROR", "reason": "CMAC does not check."} - - ctr_int = int.from_bytes(counter, "little") - if ctr_int <= card.counter: - return {"status": "ERROR", "reason": "This link is already used."} - - await update_card_counter(ctr_int, card.id) - - # gathering some info for hit record - ip = request.client.host - if "x-real-ip" in request.headers: - ip = request.headers["x-real-ip"] - elif "x-forwarded-for" in request.headers: - ip = request.headers["x-forwarded-for"] - - agent = request.headers["user-agent"] if "user-agent" in request.headers else "" - - await create_hit(card.id, ip, agent, card.counter, ctr_int) - - link = await get_withdraw_link(card.withdraw, 0) - return link.lnurl_response(request) - - -# /boltcards/api/v1/auth?a=00000000000000000000000000000000 -@boltcards_ext.get("/api/v1/auth") -async def api_auth(a, request: Request): - if a == "00000000000000000000000000000000": - response = {"k0": "0" * 32, "k1": "1" * 32, "k2": "2" * 32} - return response - - card = await get_card_by_otp(a) - - if not card: - raise HTTPException( - detail="Card does not exist.", status_code=HTTPStatus.NOT_FOUND - ) - - new_otp = secrets.token_hex(16) - print(card.otp) - print(new_otp) - await update_card_otp(new_otp, card.id) - - response = {"k0": card.k0, "k1": card.k1, "k2": card.k2} - - return response + return [hit.dict() for hit in await get_hits(cards_ids)] \ No newline at end of file From c10f89e1d60cba5cb64d414d8937f1986fdfef78 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 22 Aug 2022 23:29:42 +0100 Subject: [PATCH 316/421] Boots, errors, needs work --- lnbits/extensions/boltcards/__init__.py | 1 - lnbits/extensions/boltcards/crud.py | 9 +++++- lnbits/extensions/boltcards/lnurl.py | 28 +++++++++++++------ lnbits/extensions/boltcards/models.py | 18 +++++++++++- .../extensions/boltcards/static/js/index.js | 27 ++++++++++++++++++ 5 files changed, 71 insertions(+), 12 deletions(-) diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py index 5fcbd12e1..63b1252d3 100644 --- a/lnbits/extensions/boltcards/__init__.py +++ b/lnbits/extensions/boltcards/__init__.py @@ -16,7 +16,6 @@ boltcards_static_files = [ boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) - def boltcards_renderer(): return template_renderer(["lnbits/extensions/boltcards/templates"]) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 8707a9697..1a846d685 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -4,7 +4,7 @@ from typing import List, Optional, Union from lnbits.helpers import urlsafe_short_hash from . import db -from .models import Card, CreateCardData, Hit +from .models import Card, CreateCardData, Hit, Refund async def create_card(data: CreateCardData, wallet_id: str) -> Card: @@ -143,6 +143,13 @@ async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: return [Hit(**row) for row in rows] +async def get_hits_today(card_id: Union[str, List[str]]) -> List[Hit]: + rows = await db.fetchall( + f"SELECT * FROM boltcards.hits WHERE card_id = ? AND timestamp >= DATE() AND timestamp < DATE() + INTERVAL ? DAY", (card_id, 1) + ) + + return [Hit(**row) for row in rows] + async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: hit_id = urlsafe_short_hash() diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index 51a85e8a9..5d98d28db 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -10,6 +10,14 @@ from fastapi import Request from fastapi.param_functions import Query from starlette.exceptions import HTTPException +import secrets +from http import HTTPStatus + +from fastapi.params import Depends, Query +from starlette.exceptions import HTTPException +from starlette.requests import Request +from starlette.responses import HTMLResponse + from lnbits.core.services import create_invoice from lnbits.core.views.api import pay_invoice @@ -24,6 +32,7 @@ from .crud import ( get_card_by_otp, get_card_by_uid, get_hit, + get_hits_today, update_card, update_card_counter, update_card_otp, @@ -31,6 +40,8 @@ from .crud import ( from .models import CreateCardData from .nxp424 import decryptSUN, getSunMAC +###############LNURLWITHDRAW################# + # /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 @boltcards_ext.get("/api/v1/scan/{card_uid}") async def api_scan(p, c, request: Request, card_uid: str = None): @@ -70,15 +81,14 @@ async def api_scan(p, c, request: Request, card_uid: str = None): agent = request.headers["user-agent"] if "user-agent" in request.headers else "" todays_hits = await get_hits_today(card.id) - int hits_amount = 0 + + hits_amount = 0 for hit in todays_hits: hits_amount = hits_amount + hit.amount if (hits_amount + card.tx_limit) > card.daily_limit: return {"status": "ERROR", "reason": "Max daily liit spent."} hit = await create_hit(card.id, ip, agent, card.counter, ctr_int) - - # link = await get_withdraw_link(card.withdraw, 0) - return link.lnurl_response(request) + lnurlpay = lnurl_encode(request.url_for("boltcards.lnurlp_response", hit_id=hit.id)) return { "tag": "withdrawRequest", "callback": request.url_for( @@ -87,7 +97,7 @@ async def api_scan(p, c, request: Request, card_uid: str = None): "k1": hit.id, "minWithdrawable": 1 * 1000, "maxWithdrawable": card.tx_limit * 1000, - "defaultDescription": f"Boltcard (Refunds address {lnurl_encode(req.url_for("boltcards.lnurlp_response", hit_id=hit.id))})", + "defaultDescription": f"Boltcard (refund address {lnurlpay})", } @boltcards_ext.get( @@ -149,12 +159,12 @@ async def api_auth(a, request: Request): ###############LNURLPAY REFUNDS################# -@satsdice_ext.get( +@boltcards_ext.get( "/api/v1/lnurlp/{hit_id}", response_class=HTMLResponse, name="boltcards.lnurlp_response", ) -async def api_lnurlp_response(req: Request, hit_id: str = Query(None)): +async def lnurlp_response(req: Request, hit_id: str = Query(None)): hit = await get_hit(hit_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} @@ -168,12 +178,12 @@ async def api_lnurlp_response(req: Request, hit_id: str = Query(None)): return json.dumps(payResponse) -@satsdice_ext.get( +@boltcards_ext.get( "/api/v1/lnurlp/cb/{hit_id}", response_class=HTMLResponse, name="boltcards.lnurlp_callback", ) -async def api_lnurlp_callback( +async def lnurlp_callback( req: Request, hit_id: str = Query(None), amount: str = Query(None) ): hit = await get_hit(hit_id) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index e272d2f91..022d636ca 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -1,5 +1,15 @@ from fastapi.params import Query from pydantic import BaseModel +from sqlite3 import Row +from typing import Optional + +from fastapi import Request +from lnurl import Lnurl +from lnurl import encode as lnurl_encode # type: ignore +from lnurl.models import LnurlPaySuccessAction, UrlAction # type: ignore +from lnurl.types import LnurlPayMetadata # type: ignore +from pydantic import BaseModel +from pydantic.main import BaseModel ZERO_KEY = "00000000000000000000000000000000" @@ -56,8 +66,14 @@ class Hit(BaseModel): new_ctr: int time: int + def from_row(cls, row: Row) -> "Hit": + return cls(**dict(row)) + class Refund(BaseModel): id: str hit_id: str refund_amount: int - time: int \ No newline at end of file + time: int + + def from_row(cls, row: Row) -> "Refund": + return cls(**dict(row)) \ No newline at end of file diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 55f2d178d..7757ffb44 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -52,6 +52,33 @@ new Vue({ rowsPerPage: 10 } }, + refundsTable: { + columns: [ + { + name: 'hit_id', + align: 'left', + label: 'Hit ID', + field: 'hit_id' + }, + { + name: 'refund_amount', + align: 'left', + label: 'Refund Amount', + field: 'oldrefund_amount_ctr' + }, + { + name: 'time', + align: 'left', + label: 'Time', + field: 'time' + } + ], + pagination: { + rowsPerPage: 10, + sortBy: 'date', + descending: true + } + }, hitsTable: { columns: [ { From 59d6b654c573b65997ba762d53279a6624fca6cd Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 24 Aug 2022 09:33:38 +0100 Subject: [PATCH 317/421] push before removing uuid --- .../extensions/boltcards/static/js/index.js | 27 +++++++++++++++++-- .../boltcards/templates/boltcards/index.html | 5 ++-- lnbits/extensions/boltcards/views_api.py | 16 +++++++++++ 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 7757ffb44..ff23c4d1f 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -17,6 +17,7 @@ new Vue({ toggleAdvanced: false, cards: [], hits: [], + refunds: [], cardDialog: { show: false, data: { @@ -164,6 +165,23 @@ new Vue({ console.log(self.hits) }) }, + getRefunds: function () { + var self = this + + LNbits.api + .request( + 'GET', + '/boltcards/api/v1/refunds?all_wallets=true', + this.g.user.wallets[0].inkey + ) + .then(function (response) { + self.refunds = response.data.map(function (obj) { + obj.card_name = self.cards.find(d => d.id == obj.card_id).card_name + return mapCards(obj) + }) + console.log(self.hits) + }) + }, openQrCodeDialog(cardId) { var card = _.findWhere(this.cards, {id: cardId}) @@ -177,8 +195,13 @@ new Vue({ } this.qrCodeDialog.show = true }, - generateKeys: function () { + addCardOpen: function () { this.cardDialog.show = true + var elem = this.$els.myBtn + elem.click() + }, + generateKeys: function () { + const genRanHex = size => [...Array(size)] .map(() => Math.floor(Math.random() * 16).toString(16)) @@ -307,7 +330,7 @@ new Vue({ if (this.g.user.wallets.length) { this.getCards() this.getHits() - this.getWithdraws() + this.getRefunds() } } }) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 4c409387b..d8421754d 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -5,7 +5,7 @@
- Add Card @@ -234,7 +234,7 @@ v-model="toggleAdvanced" label="Show advanced options" > -
+
Generate keys
diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index ee91cffb4..cccc6a289 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -110,6 +110,22 @@ async def api_hits( ): wallet_ids = [g.wallet.id] + if all_wallets: + wallet_ids = (await get_user(g.wallet.user)).wallet_ids + + cards = await get_cards(wallet_ids) + cards_ids = [] + for card in cards: + cards_ids.append(card.id) + + return [hit.dict() for hit in await get_hits(cards_ids)] + +@boltcards_ext.get("/api/v1/refunds") +async def api_hits( + g: WalletTypeInfo = Depends(get_key_type), all_wallets: bool = Query(False) +): + wallet_ids = [g.wallet.id] + if all_wallets: wallet_ids = (await get_user(g.wallet.user)).wallet_ids From 4e8766ce08d5487a7b2952cadb9f9bccc098940f Mon Sep 17 00:00:00 2001 From: ben Date: Thu, 25 Aug 2022 13:07:18 +0100 Subject: [PATCH 318/421] removed uid for justa card id --- lnbits/extensions/boltcards/crud.py | 2 -- lnbits/extensions/boltcards/lnurl.py | 14 +++++++------- lnbits/extensions/boltcards/static/js/index.js | 7 +------ .../boltcards/templates/boltcards/index.html | 13 +------------ 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 1a846d685..6d9f8b1c5 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -15,7 +15,6 @@ async def create_card(data: CreateCardData, wallet_id: str) -> Card: id, wallet, card_name, - uid, counter, withdraw, k0, @@ -29,7 +28,6 @@ async def create_card(data: CreateCardData, wallet_id: str) -> Card: card_id, wallet_id, data.card_name, - data.uid.upper(), data.counter, data.withdraw, data.k0, diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index 5d98d28db..1d62199f3 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -30,7 +30,7 @@ from .crud import ( create_hit, get_card, get_card_by_otp, - get_card_by_uid, + get_card, get_hit, get_hits_today, update_card, @@ -43,18 +43,18 @@ from .nxp424 import decryptSUN, getSunMAC ###############LNURLWITHDRAW################# # /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 -@boltcards_ext.get("/api/v1/scan/{card_uid}") -async def api_scan(p, c, request: Request, card_uid: str = None): +@boltcards_ext.get("/api/v1/scan/{card_id}") +async def api_scan(p, c, request: Request, card_id: str = None): # some wallets send everything as lower case, no bueno p = p.upper() c = c.upper() card = None counter = b"" try: - card = await get_card_by_uid(card_uid) - card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) + card = await get_card(card_id) + card_id, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) - if card.uid.upper() != card_uid.hex().upper(): + if card.uid.upper() != card_id.hex().upper(): return {"status": "ERROR", "reason": "Card UID mis-match."} except: return {"status": "ERROR", "reason": "Error decrypting card."} @@ -62,7 +62,7 @@ async def api_scan(p, c, request: Request, card_uid: str = None): if card == None: return {"status": "ERROR", "reason": "Unknown card."} - if c != getSunMAC(card_uid, counter, bytes.fromhex(card.k2)).hex().upper(): + if c != getSunMAC(card_id, counter, bytes.fromhex(card.k2)).hex().upper(): return {"status": "ERROR", "reason": "CMAC does not check."} ctr_int = int.from_bytes(counter, "little") diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index ff23c4d1f..4ce6d7596 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -150,7 +150,6 @@ new Vue({ }, getHits: function () { var self = this - LNbits.api .request( 'GET', @@ -167,7 +166,6 @@ new Vue({ }, getRefunds: function () { var self = this - LNbits.api .request( 'GET', @@ -184,7 +182,6 @@ new Vue({ }, openQrCodeDialog(cardId) { var card = _.findWhere(this.cards, {id: cardId}) - this.qrCodeDialog.data = { link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, name: card.card_name, @@ -197,11 +194,9 @@ new Vue({ }, addCardOpen: function () { this.cardDialog.show = true - var elem = this.$els.myBtn - elem.click() + this.generateKeys() }, generateKeys: function () { - const genRanHex = size => [...Array(size)] .map(() => Math.floor(Math.random() * 16).toString(16)) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index d8421754d..1c58f8e57 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -5,7 +5,7 @@
- Add Card @@ -187,7 +187,6 @@ label="Wallet *" > -
- - - From the NFC 424 ntag card that will be loaded - Date: Thu, 25 Aug 2022 14:17:03 +0100 Subject: [PATCH 319/421] Added UID scan for form --- .../boltcards/templates/boltcards/index.html | 52 ++++++++++++------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index d8421754d..1c0c54f26 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -5,7 +5,7 @@
- Add Card @@ -187,7 +187,6 @@ label="Wallet *" > -
+ +
+
+ + Get from the card you'll use, using an NFC app + + +
+
+ Tap card to scan UID (coming soon) +
+
- - From the NFC 424 ntag card that will be loaded - + Date: Fri, 26 Aug 2022 19:22:03 +0100 Subject: [PATCH 320/421] Pretty much works --- lnbits/extensions/boltcards/crud.py | 29 +++++++++++++------ lnbits/extensions/boltcards/lnurl.py | 26 ++++++++++------- lnbits/extensions/boltcards/models.py | 1 + .../extensions/boltcards/static/js/index.js | 14 ++++----- .../boltcards/templates/boltcards/index.html | 11 ++++++- lnbits/extensions/boltcards/views_api.py | 2 ++ 6 files changed, 54 insertions(+), 29 deletions(-) diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index 1a846d685..ebcaf9d95 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -8,30 +8,32 @@ from .models import Card, CreateCardData, Hit, Refund async def create_card(data: CreateCardData, wallet_id: str) -> Card: - card_id = urlsafe_short_hash() + card_id = urlsafe_short_hash().upper() await db.execute( """ INSERT INTO boltcards.cards ( id, + uid, wallet, card_name, - uid, counter, - withdraw, + tx_limit, + daily_limit, k0, k1, k2, otp ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, ( card_id, + data.uid.upper(), wallet_id, data.card_name, - data.uid.upper(), data.counter, - data.withdraw, + data.tx_limit, + data.daily_limit, data.k0, data.k1, data.k2, @@ -145,11 +147,16 @@ async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: async def get_hits_today(card_id: Union[str, List[str]]) -> List[Hit]: rows = await db.fetchall( - f"SELECT * FROM boltcards.hits WHERE card_id = ? AND timestamp >= DATE() AND timestamp < DATE() + INTERVAL ? DAY", (card_id, 1) + f"SELECT * FROM boltcards.hits WHERE card_id = ? AND time >= DATE('now') AND time < DATE('now', '+1 day')", (card_id,) ) return [Hit(**row) for row in rows] +async def spend_hit(id: str): + await db.execute( + "UPDATE boltcards.hits SET spent = ? WHERE id = ?", + (True, id), + ) async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: hit_id = urlsafe_short_hash() @@ -159,19 +166,23 @@ async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: id, card_id, ip, + spent, useragent, old_ctr, - new_ctr + new_ctr, + amount ) - VALUES (?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) """, ( hit_id, card_id, ip, + False, useragent, old_ctr, new_ctr, + 0, ), ) hit = await get_hit(hit_id) diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index 5d98d28db..3fe09d875 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -1,10 +1,13 @@ import base64 import hashlib import hmac +import json from http import HTTPStatus from io import BytesIO from typing import Optional +from loguru import logger + from embit import bech32, compact from fastapi import Request from fastapi.param_functions import Query @@ -33,6 +36,7 @@ from .crud import ( get_card_by_uid, get_hit, get_hits_today, + spend_hit, update_card, update_card_counter, update_card_otp, @@ -50,10 +54,10 @@ async def api_scan(p, c, request: Request, card_uid: str = None): c = c.upper() card = None counter = b"" + try: card = await get_card_by_uid(card_uid) card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) - if card.uid.upper() != card_uid.hex().upper(): return {"status": "ERROR", "reason": "Card UID mis-match."} except: @@ -67,8 +71,8 @@ async def api_scan(p, c, request: Request, card_uid: str = None): ctr_int = int.from_bytes(counter, "little") - if ctr_int <= card.counter: - return {"status": "ERROR", "reason": "This link is already used."} + # if ctr_int <= card.counter: + # return {"status": "ERROR", "reason": "This link is already used."} await update_card_counter(ctr_int, card.id) @@ -86,13 +90,13 @@ async def api_scan(p, c, request: Request, card_uid: str = None): for hit in todays_hits: hits_amount = hits_amount + hit.amount if (hits_amount + card.tx_limit) > card.daily_limit: - return {"status": "ERROR", "reason": "Max daily liit spent."} + return {"status": "ERROR", "reason": "Max daily limit spent."} hit = await create_hit(card.id, ip, agent, card.counter, ctr_int) lnurlpay = lnurl_encode(request.url_for("boltcards.lnurlp_response", hit_id=hit.id)) return { "tag": "withdrawRequest", "callback": request.url_for( - "boltcards.lnurl_callback" + "boltcards.lnurl_callback", hitid=hit.id ), "k1": hit.id, "minWithdrawable": 1 * 1000, @@ -166,14 +170,15 @@ async def api_auth(a, request: Request): ) async def lnurlp_response(req: Request, hit_id: str = Query(None)): hit = await get_hit(hit_id) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} payResponse = { "tag": "payRequest", "callback": req.url_for("boltcards.lnurlp_callback", hit_id=hit_id), "metadata": LnurlPayMetadata(json.dumps([["text/plain", "Refund"]])), - "minSendable": math.ceil(link.min_bet * 1) * 1000, - "maxSendable": round(link.max_bet * 1) * 1000, + "minSendable": 1 * 1000, + "maxSendable": card.tx_limit * 1000, } return json.dumps(payResponse) @@ -187,14 +192,15 @@ async def lnurlp_callback( req: Request, hit_id: str = Query(None), amount: str = Query(None) ): hit = await get_hit(hit_id) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} payment_hash, payment_request = await create_invoice( - wallet_id=link.wallet, - amount=int(amount / 1000), + wallet_id=card.wallet, + amount=int(amount) / 1000, memo=f"Refund {hit_id}", - unhashed_description=LnurlPayMetadata(json.dumps([["text/plain", hit_id]])).encode("utf-8"), + unhashed_description=LnurlPayMetadata(json.dumps([["text/plain", "Refund"]])).encode("utf-8"), extra={"refund": hit_id}, ) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 022d636ca..4f23b745e 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -64,6 +64,7 @@ class Hit(BaseModel): useragent: str old_ctr: int new_ctr: int + amount: int time: int def from_row(cls, row: Row) -> "Hit": diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index ff23c4d1f..7e824ea91 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -18,6 +18,7 @@ new Vue({ cards: [], hits: [], refunds: [], + lnurlLink: location.hostname + '/boltcards/api/v1/scan/', cardDialog: { show: false, data: { @@ -43,10 +44,10 @@ new Vue({ field: 'counter' }, { - name: 'withdraw', + name: 'uid', align: 'left', - label: 'Withdraw ID', - field: 'withdraw' + label: 'Card ID', + field: 'uid' } ], pagination: { @@ -150,7 +151,6 @@ new Vue({ }, getHits: function () { var self = this - LNbits.api .request( 'GET', @@ -167,7 +167,6 @@ new Vue({ }, getRefunds: function () { var self = this - LNbits.api .request( 'GET', @@ -184,7 +183,6 @@ new Vue({ }, openQrCodeDialog(cardId) { var card = _.findWhere(this.cards, {id: cardId}) - this.qrCodeDialog.data = { link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, name: card.card_name, @@ -197,11 +195,9 @@ new Vue({ }, addCardOpen: function () { this.cardDialog.show = true - var elem = this.$els.myBtn - elem.click() + this.generateKeys() }, generateKeys: function () { - const genRanHex = size => [...Array(size)] .map(() => Math.floor(Math.random() * 16).toString(16)) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 1c0c54f26..0ba64f0ec 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -34,6 +34,7 @@ @@ -255,7 +268,6 @@ @@ -263,7 +275,7 @@ Date: Sun, 28 Aug 2022 11:05:26 +0100 Subject: [PATCH 324/421] Fixed enable --- lnbits/extensions/boltcards/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index cdba5dd3a..c1b113af3 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -50,7 +50,7 @@ class CreateCardData(BaseModel): counter: int = Query(0) tx_limit: int = Query(0) daily_limit: int = Query(0) - enable: bool = Query(...) + enable: bool = Query(True) k0: str = Query(ZERO_KEY) k1: str = Query(ZERO_KEY) k2: str = Query(ZERO_KEY) From 8cabd7b5a4d81796a02e72b079330afe58ae120e Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 28 Aug 2022 11:59:21 +0100 Subject: [PATCH 325/421] withdraws working --- lnbits/extensions/boltcards/lnurl.py | 37 ++++++++++-------------- lnbits/extensions/boltcards/views_api.py | 3 -- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index 398f218e2..93ca6390a 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -32,6 +32,7 @@ from . import boltcards_ext from .crud import ( create_hit, get_card, + get_card_by_uid, get_card_by_otp, get_card, get_hit, @@ -47,34 +48,31 @@ from .nxp424 import decryptSUN, getSunMAC ###############LNURLWITHDRAW################# # /boltcards/api/v1/scan?p=00000000000000000000000000000000&c=0000000000000000 -@boltcards_ext.get("/api/v1/scan/{card_id}") -async def api_scan(p, c, request: Request, card_id: str = None): +@boltcards_ext.get("/api/v1/scan/{card_uid}") +async def api_scan(p, c, request: Request, card_uid: str = None): # some wallets send everything as lower case, no bueno p = p.upper() c = c.upper() card = None counter = b"" - + card = await get_card_by_uid(card_uid) + if not card: + return {"status": "ERROR", "reason": "No card."} + if not card.enable: + return {"status": "ERROR", "reason": "Card is disabled."} try: - card = await get_card_by_uid(card_uid) - if not card.enable: - return {"status": "ERROR", "reason": "Card is disabled."} card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) if card.uid.upper() != card_uid.hex().upper(): return {"status": "ERROR", "reason": "Card UID mis-match."} + if c != getSunMAC(card_uid, counter, bytes.fromhex(card.k2)).hex().upper(): + return {"status": "ERROR", "reason": "CMAC does not check."} except: return {"status": "ERROR", "reason": "Error decrypting card."} - if card == None: - return {"status": "ERROR", "reason": "Unknown card."} - - if c != getSunMAC(card_id, counter, bytes.fromhex(card.k2)).hex().upper(): - return {"status": "ERROR", "reason": "CMAC does not check."} - ctr_int = int.from_bytes(counter, "little") - # if ctr_int <= card.counter: - # return {"status": "ERROR", "reason": "This link is already used."} + if ctr_int <= card.counter: + return {"status": "ERROR", "reason": "This link is already used."} await update_card_counter(ctr_int, card.id) @@ -117,26 +115,23 @@ async def lnurl_callback( k1: str = Query(None), ): hit = await get_hit(k1) - card = await get_card(hit.id) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} - - if pr: + try: if hit.id != k1: return {"status": "ERROR", "reason": "Bad K1"} if hit.spent: return {"status": "ERROR", "reason": f"Payment already claimed"} hit = await spend_hit(hit.id) - if not hit: - return {"status": "ERROR", "reason": f"Payment failed"} await pay_invoice( wallet_id=card.wallet, payment_request=pr, - max_sat=card.tx_limit / 1000, + max_sat=card.tx_limit, extra={"tag": "boltcard"}, ) return {"status": "OK"} - else: + except: return {"status": "ERROR", "reason": f"Payment failed"} diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index 3891d1fe1..4d2db17db 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -49,7 +49,6 @@ async def api_card_create_or_update( card_id: str = None, wallet: WalletTypeInfo = Depends(require_admin_key), ): - logger.debug(len(bytes.fromhex(data.uid))) try: if len(bytes.fromhex(data.uid)) != 7: raise HTTPException( @@ -106,8 +105,6 @@ async def enable_card( detail="Not your card.", status_code=HTTPStatus.FORBIDDEN ) card = await enable_disable_card(enable=enable, id=card_id) - logger.debug(enable) - logger.debug(card) return card.dict() @boltcards_ext.delete("/api/v1/cards/{card_id}") From 6e9fd28d286a329b9a88fb976ec11ef65b182c2f Mon Sep 17 00:00:00 2001 From: ben Date: Sun, 28 Aug 2022 12:16:23 +0100 Subject: [PATCH 326/421] UI tidy --- lnbits/extensions/boltcards/static/js/index.js | 18 +++++++++++++++--- .../boltcards/templates/boltcards/index.html | 5 ++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 167d22c76..8bd9c411d 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -45,10 +45,22 @@ new Vue({ field: 'counter' }, { - name: 'withdraw', + name: 'wallet', align: 'left', - label: 'Withdraw ID', - field: 'withdraw' + label: 'Wallet', + field: 'wallet' + }, + { + name: 'tx_limit', + align: 'left', + label: 'Max tx', + field: 'tx_limit' + }, + { + name: 'daily_limit', + align: 'left', + label: 'Daily tx limit', + field: 'daily_limit' } ], pagination: { diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index cbb869800..8943d5ddd 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -48,11 +48,10 @@ + >Card key credentials Date: Sun, 28 Aug 2022 12:29:27 +0100 Subject: [PATCH 327/421] Added pretty "add card" button --- .../boltcards/templates/boltcards/index.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 8943d5ddd..96f4f994b 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -3,18 +3,20 @@
- - - Add Card - -
-
Cards
+
+
+
Cards
+
+
+ + Add card + +
+
Date: Mon, 29 Aug 2022 10:55:35 +0200 Subject: [PATCH 328/421] change docker image name for regtest tests (#931) --- .github/workflows/regtest.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/regtest.yml b/.github/workflows/regtest.yml index e35c9f930..250a66c72 100644 --- a/.github/workflows/regtest.yml +++ b/.github/workflows/regtest.yml @@ -17,7 +17,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | - docker build -t lnbits-legend . + docker build -t lnbitsdocker/lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests @@ -56,7 +56,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | - docker build -t lnbits-legend . + docker build -t lnbitsdocker/lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests @@ -97,7 +97,7 @@ jobs: - uses: abatilo/actions-poetry@v2.1.3 - name: Setup Regtest run: | - docker build -t lnbits-legend . + docker build -t lnbitsdocker/lnbits-legend . git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker chmod +x ./tests From 7bfc0848ef31f03342c6b016ebfd03e5eb67d429 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 29 Aug 2022 14:18:18 +0100 Subject: [PATCH 329/421] Black/prettier --- lnbits/extensions/boltcards/__init__.py | 2 + lnbits/extensions/boltcards/config.json | 2 +- lnbits/extensions/boltcards/crud.py | 21 +- lnbits/extensions/boltcards/lnurl.py | 31 ++- lnbits/extensions/boltcards/models.py | 9 +- .../extensions/boltcards/static/js/index.js | 14 +- lnbits/extensions/boltcards/tasks.py | 7 +- .../templates/boltcards/_api_docs.html | 4 - .../boltcards/templates/boltcards/index.html | 193 ++++++++++-------- lnbits/extensions/boltcards/views_api.py | 14 +- 10 files changed, 161 insertions(+), 136 deletions(-) diff --git a/lnbits/extensions/boltcards/__init__.py b/lnbits/extensions/boltcards/__init__.py index fe99ee2e0..11b8dd2d1 100644 --- a/lnbits/extensions/boltcards/__init__.py +++ b/lnbits/extensions/boltcards/__init__.py @@ -16,9 +16,11 @@ boltcards_static_files = [ boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"]) + def boltcards_renderer(): return template_renderer(["lnbits/extensions/boltcards/templates"]) + from .lnurl import * # noqa from .tasks import * # noqa from .views import * # noqa diff --git a/lnbits/extensions/boltcards/config.json b/lnbits/extensions/boltcards/config.json index ef98a35ad..e46070d30 100644 --- a/lnbits/extensions/boltcards/config.json +++ b/lnbits/extensions/boltcards/config.json @@ -2,5 +2,5 @@ "name": "Bolt Cards", "short_description": "Self custody Bolt Cards with one time LNURLw", "icon": "payment", - "contributors": ["iwarpbtc"] + "contributors": ["iwarpbtc", "arcbtc", "leesalminen"] } diff --git a/lnbits/extensions/boltcards/crud.py b/lnbits/extensions/boltcards/crud.py index c6b09694b..1c48500da 100644 --- a/lnbits/extensions/boltcards/crud.py +++ b/lnbits/extensions/boltcards/crud.py @@ -116,7 +116,9 @@ async def delete_card(card_id: str) -> None: # Delete refunds refunds = await get_refunds([hit]) for refund in refunds: - await db.execute("DELETE FROM boltcards.refunds WHERE id = ?", (refund.hit_id,)) + await db.execute( + "DELETE FROM boltcards.refunds WHERE id = ?", (refund.hit_id,) + ) async def update_card_counter(counter: int, id: str): @@ -125,6 +127,7 @@ async def update_card_counter(counter: int, id: str): (counter, id), ) + async def enable_disable_card(enable: bool, id: str) -> Optional[Card]: row = await db.execute( "UPDATE boltcards.cards SET enable = ? WHERE id = ?", @@ -132,6 +135,7 @@ async def enable_disable_card(enable: bool, id: str) -> Optional[Card]: ) return await get_card(id) + async def update_card_otp(otp: str, id: str): await db.execute( "UPDATE boltcards.cards SET otp = ? WHERE id = ?", @@ -157,19 +161,23 @@ async def get_hits(cards_ids: Union[str, List[str]]) -> List[Hit]: return [Hit(**row) for row in rows] + async def get_hits_today(card_id: Union[str, List[str]]) -> List[Hit]: rows = await db.fetchall( - f"SELECT * FROM boltcards.hits WHERE card_id = ? AND time >= DATE('now') AND time < DATE('now', '+1 day')", (card_id,) + f"SELECT * FROM boltcards.hits WHERE card_id = ? AND time >= DATE('now') AND time < DATE('now', '+1 day')", + (card_id,), ) return [Hit(**row) for row in rows] + async def spend_hit(id: str): await db.execute( "UPDATE boltcards.hits SET spent = ? WHERE id = ?", (True, id), ) + async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: hit_id = urlsafe_short_hash() await db.execute( @@ -201,6 +209,7 @@ async def create_hit(card_id, ip, useragent, old_ctr, new_ctr) -> Hit: assert hit, "Newly recorded hit couldn't be retrieved" return hit + async def create_refund(hit_id, refund_amount) -> Refund: refund_id = urlsafe_short_hash() await db.execute( @@ -224,17 +233,21 @@ async def create_refund(hit_id, refund_amount) -> Refund: assert refund, "Newly recorded hit couldn't be retrieved" return refund + async def get_refund(refund_id: str) -> Optional[Refund]: - row = await db.fetchone(f"SELECT * FROM boltcards.refunds WHERE id = ?", (refund_id)) + row = await db.fetchone( + f"SELECT * FROM boltcards.refunds WHERE id = ?", (refund_id) + ) if not row: return None refund = dict(**row) return Refund.parse_obj(refund) + async def get_refunds(hits_ids: Union[str, List[str]]) -> List[Refund]: q = ",".join(["?"] * len(hits_ids)) rows = await db.fetchall( f"SELECT * FROM boltcards.refunds WHERE hit_id IN ({q})", (*hits_ids,) ) - return [Refund(**row) for row in rows] \ No newline at end of file + return [Refund(**row) for row in rows] diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index 93ca6390a..a1630e2be 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -59,7 +59,7 @@ async def api_scan(p, c, request: Request, card_uid: str = None): if not card: return {"status": "ERROR", "reason": "No card."} if not card.enable: - return {"status": "ERROR", "reason": "Card is disabled."} + return {"status": "ERROR", "reason": "Card is disabled."} try: card_uid, counter = decryptSUN(bytes.fromhex(p), bytes.fromhex(card.k1)) if card.uid.upper() != card_uid.hex().upper(): @@ -70,7 +70,7 @@ async def api_scan(p, c, request: Request, card_uid: str = None): return {"status": "ERROR", "reason": "Error decrypting card."} ctr_int = int.from_bytes(counter, "little") - + if ctr_int <= card.counter: return {"status": "ERROR", "reason": "This link is already used."} @@ -95,15 +95,14 @@ async def api_scan(p, c, request: Request, card_uid: str = None): lnurlpay = lnurl_encode(request.url_for("boltcards.lnurlp_response", hit_id=hit.id)) return { "tag": "withdrawRequest", - "callback": request.url_for( - "boltcards.lnurl_callback", hitid=hit.id - ), + "callback": request.url_for("boltcards.lnurl_callback", hitid=hit.id), "k1": hit.id, "minWithdrawable": 1 * 1000, "maxWithdrawable": card.tx_limit * 1000, "defaultDescription": f"Boltcard (refund address {lnurlpay})", } + @boltcards_ext.get( "/api/v1/lnurl/cb/{hitid}", status_code=HTTPStatus.OK, @@ -114,8 +113,8 @@ async def lnurl_callback( pr: str = Query(None), k1: str = Query(None), ): - hit = await get_hit(k1) - card = await get_card(hit.card_id) + hit = await get_hit(k1) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} try: @@ -158,16 +157,18 @@ async def api_auth(a, request: Request): return response + ###############LNURLPAY REFUNDS################# + @boltcards_ext.get( "/api/v1/lnurlp/{hit_id}", response_class=HTMLResponse, name="boltcards.lnurlp_response", ) async def lnurlp_response(req: Request, hit_id: str = Query(None)): - hit = await get_hit(hit_id) - card = await get_card(hit.card_id) + hit = await get_hit(hit_id) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} if not card.enable: @@ -190,8 +191,8 @@ async def lnurlp_response(req: Request, hit_id: str = Query(None)): async def lnurlp_callback( req: Request, hit_id: str = Query(None), amount: str = Query(None) ): - hit = await get_hit(hit_id) - card = await get_card(hit.card_id) + hit = await get_hit(hit_id) + card = await get_card(hit.card_id) if not hit: return {"status": "ERROR", "reason": f"LNURL-pay record not found."} @@ -199,14 +200,12 @@ async def lnurlp_callback( wallet_id=card.wallet, amount=int(amount) / 1000, memo=f"Refund {hit_id}", - unhashed_description=LnurlPayMetadata(json.dumps([["text/plain", "Refund"]])).encode("utf-8"), + unhashed_description=LnurlPayMetadata( + json.dumps([["text/plain", "Refund"]]) + ).encode("utf-8"), extra={"refund": hit_id}, ) payResponse = {"pr": payment_request, "successAction": success_action, "routes": []} return json.dumps(payResponse) - - - - diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index c1b113af3..80e3b9734 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -36,14 +36,13 @@ class Card(BaseModel): return cls(**dict(row)) def lnurl(self, req: Request) -> Lnurl: - url = req.url_for( - "boltcard.lnurl_response", device_id=self.id, _external=True - ) + url = req.url_for("boltcard.lnurl_response", device_id=self.id, _external=True) return lnurl_encode(url) async def lnurlpay_metadata(self) -> LnurlPayMetadata: return LnurlPayMetadata(json.dumps([["text/plain", self.title]])) + class CreateCardData(BaseModel): card_name: str = Query(...) uid: str = Query(...) @@ -58,6 +57,7 @@ class CreateCardData(BaseModel): prev_k1: str = Query(ZERO_KEY) prev_k2: str = Query(ZERO_KEY) + class Hit(BaseModel): id: str card_id: str @@ -72,6 +72,7 @@ class Hit(BaseModel): def from_row(cls, row: Row) -> "Hit": return cls(**dict(row)) + class Refund(BaseModel): id: str hit_id: str @@ -79,4 +80,4 @@ class Refund(BaseModel): time: int def from_row(cls, row: Row) -> "Refund": - return cls(**dict(row)) \ No newline at end of file + return cls(**dict(row)) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 8bd9c411d..33704f3a2 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -9,12 +9,11 @@ const mapCards = obj => { return obj } - new Vue({ el: '#vue', mixins: [windowMixin], data: function () { - return { + return { toggleAdvanced: false, nfcTagReading: false, cards: [], @@ -23,11 +22,12 @@ new Vue({ cardDialog: { show: false, data: { - counter:1, + counter: 1, k0: '', k1: '', k2: '', - card_name:''}, + card_name: '' + }, temp: {} }, cardsTable: { @@ -190,7 +190,7 @@ new Vue({ }) }) }, - openQrCodeDialog(cardId) { + openQrCodeDialog (cardId) { var card = _.findWhere(this.cards, {id: cardId}) this.qrCodeDialog.data = { link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, @@ -217,7 +217,7 @@ new Vue({ typeof this.cardDialog.data.card_name === 'string' && this.cardDialog.data.card_name.search('debug') > -1 - self.cardDialog.data.k0 = debugcard + self.cardDialog.data.k0 = debugcard ? '11111111111111111111111111111111' : genRanHex(32) @@ -352,7 +352,7 @@ new Vue({ }, exportRefundsCSV: function () { LNbits.utils.exportCSV(this.refundsTable.columns, this.refunds) - }, + } }, created: function () { if (this.g.user.wallets.length) { diff --git a/lnbits/extensions/boltcards/tasks.py b/lnbits/extensions/boltcards/tasks.py index 30a290e9d..bfe4f257b 100644 --- a/lnbits/extensions/boltcards/tasks.py +++ b/lnbits/extensions/boltcards/tasks.py @@ -27,8 +27,9 @@ async def on_invoice_paid(payment: Payment) -> None: if payment.extra.get("wh_status"): # this webhook has already been sent return - hit = await get_hit(payment.extra.get("tag")[7:len(payment.extra.get("tag"))]) + hit = await get_hit(payment.extra.get("tag")[7 : len(payment.extra.get("tag"))]) if hit: - refund = await create_refund(hit_id=hit.id, refund_amount=payment.extra.get("amount")) + refund = await create_refund( + hit_id=hit.id, refund_amount=payment.extra.get("amount") + ) await mark_webhook_sent(payment, 1) - diff --git a/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html index e67ba14bf..be4e2ae86 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html +++ b/lnbits/extensions/boltcards/templates/boltcards/_api_docs.html @@ -15,10 +15,6 @@ >More details
- - Created by, - iWarp

diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 96f4f994b..2a613fda2 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -7,12 +7,19 @@
-
-
+
+
Cards
- + Add card
@@ -53,32 +60,38 @@ icon="qr_code" :color="($q.dark.isActive) ? 'grey-7' : 'grey-5'" @click="openQrCodeDialog(props.row.id)" - >Card key credentials + >Card key credentials lnurl://...Click to copy, then add to NFC card - + lnurlLink + >lnurl://...Click to copy, then add to NFC card + {{ col.value }} - DISABLE + >DISABLE ENABLE + v-else + dense + @click="enableCard(props.row.wallet, props.row.id, true)" + color="green" + >ENABLE Edit card + >Edit card Deleting card will also delete all records + >Deleting card will also delete all records @@ -220,7 +237,7 @@ type="number" label="Max transaction (sats)" class="q-pr-sm" - > + >
+ filled + dense + emit-value + v-model.trim="cardDialog.data.card_name" + type="text" + label="Card name " + >
- - - Get from the card you'll use, using an NFC app - - + Get from the card you'll use, using an NFC app
Tap card to scan UID (coming soon) + outline + disable + color="grey" + icon="nfc" + :disable="nfcTagReading" + >Tap card to scan UID (coming soon) +
-
- - + -
- - - - - - Zero if you don't know. - +
+ + + + + + Zero if you don't know. + Generate keys -
+
Date: Mon, 29 Aug 2022 07:34:56 -0600 Subject: [PATCH 330/421] make format --- lnbits/extensions/boltcards/lnurl.py | 19 ++++++------------- lnbits/extensions/boltcards/models.py | 3 +-- .../extensions/boltcards/static/js/index.js | 2 +- lnbits/extensions/boltcards/tasks.py | 2 +- .../boltcards/templates/boltcards/index.html | 2 +- lnbits/extensions/boltcards/views_api.py | 7 +++---- 6 files changed, 13 insertions(+), 22 deletions(-) diff --git a/lnbits/extensions/boltcards/lnurl.py b/lnbits/extensions/boltcards/lnurl.py index a1630e2be..9399fb369 100644 --- a/lnbits/extensions/boltcards/lnurl.py +++ b/lnbits/extensions/boltcards/lnurl.py @@ -2,21 +2,19 @@ import base64 import hashlib import hmac import json +import secrets from http import HTTPStatus from io import BytesIO from typing import Optional -from loguru import logger - from embit import bech32, compact from fastapi import Request from fastapi.param_functions import Query -from starlette.exceptions import HTTPException - -import secrets -from http import HTTPStatus - from fastapi.params import Depends, Query +from lnurl import Lnurl, LnurlWithdrawResponse +from lnurl import encode as lnurl_encode # type: ignore +from lnurl.types import LnurlPayMetadata # type: ignore +from loguru import logger from starlette.exceptions import HTTPException from starlette.requests import Request from starlette.responses import HTMLResponse @@ -24,17 +22,12 @@ from starlette.responses import HTMLResponse from lnbits.core.services import create_invoice from lnbits.core.views.api import pay_invoice -from lnurl import Lnurl, LnurlWithdrawResponse -from lnurl import encode as lnurl_encode # type: ignore -from lnurl.types import LnurlPayMetadata # type: ignore - from . import boltcards_ext from .crud import ( create_hit, get_card, - get_card_by_uid, get_card_by_otp, - get_card, + get_card_by_uid, get_hit, get_hits_today, spend_hit, diff --git a/lnbits/extensions/boltcards/models.py b/lnbits/extensions/boltcards/models.py index 80e3b9734..21096640a 100644 --- a/lnbits/extensions/boltcards/models.py +++ b/lnbits/extensions/boltcards/models.py @@ -1,9 +1,8 @@ -from fastapi.params import Query -from pydantic import BaseModel from sqlite3 import Row from typing import Optional from fastapi import Request +from fastapi.params import Query from lnurl import Lnurl from lnurl import encode as lnurl_encode # type: ignore from lnurl.models import LnurlPaySuccessAction, UrlAction # type: ignore diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 33704f3a2..27536304f 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -190,7 +190,7 @@ new Vue({ }) }) }, - openQrCodeDialog (cardId) { + openQrCodeDialog(cardId) { var card = _.findWhere(this.cards, {id: cardId}) this.qrCodeDialog.data = { link: window.location.origin + '/boltcards/api/v1/auth?a=' + card.otp, diff --git a/lnbits/extensions/boltcards/tasks.py b/lnbits/extensions/boltcards/tasks.py index bfe4f257b..a7eea026d 100644 --- a/lnbits/extensions/boltcards/tasks.py +++ b/lnbits/extensions/boltcards/tasks.py @@ -7,7 +7,7 @@ from lnbits.core import db as core_db from lnbits.core.models import Payment from lnbits.tasks import register_invoice_listener -from .crud import get_hit, create_refund +from .crud import create_refund, get_hit async def wait_for_paid_invoices(): diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 2a613fda2..73e5820b0 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -7,7 +7,7 @@
-
+
Cards
diff --git a/lnbits/extensions/boltcards/views_api.py b/lnbits/extensions/boltcards/views_api.py index f1e02810f..698e10948 100644 --- a/lnbits/extensions/boltcards/views_api.py +++ b/lnbits/extensions/boltcards/views_api.py @@ -2,6 +2,7 @@ import secrets from http import HTTPStatus from fastapi.params import Depends, Query +from loguru import logger from starlette.exceptions import HTTPException from starlette.requests import Request @@ -13,22 +14,20 @@ from .crud import ( create_card, create_hit, delete_card, + enable_disable_card, get_card, get_card_by_otp, get_card_by_uid, get_cards, get_hits, + get_refunds, update_card, update_card_counter, update_card_otp, - enable_disable_card, - get_refunds, ) from .models import CreateCardData from .nxp424 import decryptSUN, getSunMAC -from loguru import logger - @boltcards_ext.get("/api/v1/cards") async def api_cards( From c8b725830bee3e35302c454acbacd50e17208006 Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Mon, 29 Aug 2022 07:55:51 -0600 Subject: [PATCH 331/421] make copy lnurl to clipboard work --- lnbits/extensions/boltcards/static/js/index.js | 1 + lnbits/extensions/boltcards/templates/boltcards/index.html | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 27536304f..e6c052ace 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -16,6 +16,7 @@ new Vue({ return { toggleAdvanced: false, nfcTagReading: false, + lnurlLink: `lnurlw://${window.location.host}/boltcards/api/v1/scan/`, cards: [], hits: [], refunds: [], diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 73e5820b0..6938eb46a 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -68,8 +68,7 @@ outline color="grey" @click="copyText(lnurlLink + props.row.uid)" - lnurlLink - >lnurl://...lnurlw://...Click to copy, then add to NFC card From 7400d7f43046c660060977c858a35c96cda76b16 Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Mon, 29 Aug 2022 07:58:29 -0600 Subject: [PATCH 332/421] link to play store app in qr code dialog --- lnbits/extensions/boltcards/templates/boltcards/index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 6938eb46a..0561cc018 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -370,7 +370,12 @@ >

- (QR code is for setting the keys with bolt-nfc-android-app) + (QR code is for setting the keys with + bolt-nfc-android-app)

Name: {{ qrCodeDialog.data.name }}
From 7ea3830fed2f6028263b8b91fdc06fe7ce44c20f Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 29 Aug 2022 15:11:25 +0100 Subject: [PATCH 333/421] Added NFC to get UID --- .../extensions/boltcards/static/js/index.js | 59 +++++++++++++++ .../boltcards/templates/boltcards/index.html | 74 +++++++++++-------- 2 files changed, 104 insertions(+), 29 deletions(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 33704f3a2..8f387f95d 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -26,6 +26,7 @@ new Vue({ k0: '', k1: '', k2: '', + uid: '', card_name: '' }, temp: {} @@ -146,6 +147,64 @@ new Vue({ } }, methods: { + readNfcTag: function () { + try { + const self = this + + if (typeof NDEFReader == 'undefined') { + throw { + toString: function () { + return 'NFC not supported on this device or browser.' + } + } + } + + const ndef = new NDEFReader() + + const readerAbortController = new AbortController() + readerAbortController.signal.onabort = event => { + console.log('All NFC Read operations have been aborted.') + } + + this.nfcTagReading = true + this.$q.notify({ + message: 'Tap your NFC tag to pay this invoice with LNURLw.' + }) + + return ndef.scan({signal: readerAbortController.signal}).then(() => { + ndef.onreadingerror = () => { + self.nfcTagReading = false + + this.$q.notify({ + type: 'negative', + message: 'There was an error reading this NFC tag.' + }) + + readerAbortController.abort() + } + + ndef.onreading = ({message, serialNumber}) => { + //Decode NDEF data from tag + var self = this + self.cardDialog.data.uid = serialNumber + .toUpperCase() + .replaceAll(':', '') + this.$q.notify({ + type: 'positive', + message: 'NFC tag read successfully.' + }) + } + }) + } catch (error) { + this.nfcTagReading = false + this.$q.notify({ + type: 'negative', + message: error + ? error.toString() + : 'An unexpected error has occurred.' + }) + } + }, getCards: function () { var self = this diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 2a613fda2..ec2611a98 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -43,7 +43,6 @@ @@ -257,7 +248,8 @@ v-model.trim="cardDialog.data.card_name" type="text" label="Card name " - > + > +

Get from the card you'll use, using an NFC app + Get from the card you'll use, using an NFC app +
Tap card to scan UID (coming soon) + Tap card to scan UID +
@@ -322,10 +317,11 @@ v-model.number="cardDialog.data.counter" type="number" label="Initial counter" - >Zero if you don't know. + Zero if you don't know. + Create Card + >Create Card + Cancel @@ -371,7 +367,7 @@ >

- (QR code is for setting the keys with bolt-nfc-android-app) + (Keys for bolt-nfc-android-app)

Name: {{ qrCodeDialog.data.name }}
@@ -380,6 +376,26 @@ Meta key: {{ qrCodeDialog.data.k1 }}
File key: {{ qrCodeDialog.data.k2 }}

+
+ + + + + + Click to copy, then add to NFC card + {% endraw %}
Close From a8ac90da5c79a76b16cc07c9bbf3cd6474700f4d Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Mon, 29 Aug 2022 08:19:39 -0600 Subject: [PATCH 334/421] make scan nfc button work --- .../extensions/boltcards/static/js/index.js | 63 +++++++++++++++++++ .../boltcards/templates/boltcards/index.html | 3 +- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index e6c052ace..315ed59fd 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -230,6 +230,69 @@ new Vue({ ? '33333333333333333333333333333333' : genRanHex(32) }, + readNfcTag: function () { + try { + const self = this + + if (typeof NDEFReader == 'undefined') { + throw { + toString: function () { + return 'NFC not supported on this device or browser.' + } + } + } + + const ndef = new NDEFReader() + + const readerAbortController = new AbortController() + readerAbortController.signal.onabort = event => { + console.log('All NFC Read operations have been aborted.') + } + + this.nfcTagReading = true + this.$q.notify({ + message: 'Tap your NFC tag to read its UID' + }) + + return ndef.scan({signal: readerAbortController.signal}).then(() => { + ndef.onreadingerror = () => { + self.nfcTagReading = false + + this.$q.notify({ + type: 'negative', + message: 'There was an error reading this NFC tag.' + }) + + readerAbortController.abort() + } + + ndef.onreading = ({message, serialNumber}) => { + self.nfcTagReading = false + + self.cardDialog.data.uid = serialNumber + .replaceAll(':', '') + .toUpperCase() + + this.$q.notify({ + type: 'positive', + message: 'NFC tag read successfully.' + }) + + setTimeout(() => { + readerAbortController.abort() + }, 1000) + } + }) + } catch (error) { + this.nfcTagReading = false + this.$q.notify({ + type: 'negative', + message: error + ? error.toString() + : 'An unexpected error has occurred.' + }) + } + }, closeFormDialog: function () { this.cardDialog.data = {} }, diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index 0561cc018..eb29e5436 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -278,7 +278,8 @@ color="grey" icon="nfc" :disable="nfcTagReading" - >Tap card to scan UID (coming soon)Tap card to scan UID
From c35ae109a4bb91b0d0beb004f49c0de44ca6943b Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Mon, 29 Aug 2022 08:21:47 -0600 Subject: [PATCH 335/421] remove v-el from element, this was removed in Vue v2, ref does not appear to be used anywhere --- lnbits/extensions/boltcards/templates/boltcards/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index eb29e5436..c4a53bd7b 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -332,7 +332,6 @@ class="q-ml-auto" v-on:click="generateKeys" v-on:click.right="debugKeys" - v-el:keybtn >Generate keys
From 630cc296fb56ddb33995b6c659add7c8d26f4163 Mon Sep 17 00:00:00 2001 From: Lee Salminen Date: Mon, 29 Aug 2022 08:22:51 -0600 Subject: [PATCH 336/421] do not add lnurlw:// to the string --- lnbits/extensions/boltcards/static/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnbits/extensions/boltcards/static/js/index.js b/lnbits/extensions/boltcards/static/js/index.js index 315ed59fd..b59b712b7 100644 --- a/lnbits/extensions/boltcards/static/js/index.js +++ b/lnbits/extensions/boltcards/static/js/index.js @@ -16,7 +16,7 @@ new Vue({ return { toggleAdvanced: false, nfcTagReading: false, - lnurlLink: `lnurlw://${window.location.host}/boltcards/api/v1/scan/`, + lnurlLink: `${window.location.host}/boltcards/api/v1/scan/`, cards: [], hits: [], refunds: [], From 33f9ae9f66f8e1185f907691d467a8a9486d2f64 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 29 Aug 2022 15:37:31 +0100 Subject: [PATCH 337/421] Added some unique checks so only 1 record can be made per card --- lnbits/extensions/boltcards/migrations.py | 8 +- .../boltcards/templates/boltcards/index.html | 272 ++++-------------- lnbits/extensions/boltcards/views_api.py | 6 +- 3 files changed, 59 insertions(+), 227 deletions(-) diff --git a/lnbits/extensions/boltcards/migrations.py b/lnbits/extensions/boltcards/migrations.py index c20ef449c..5be3d08fb 100644 --- a/lnbits/extensions/boltcards/migrations.py +++ b/lnbits/extensions/boltcards/migrations.py @@ -5,10 +5,10 @@ async def m001_initial(db): await db.execute( """ CREATE TABLE boltcards.cards ( - id TEXT PRIMARY KEY, + id TEXT PRIMARY KEY UNIQUE, wallet TEXT NOT NULL, card_name TEXT NOT NULL, - uid TEXT NOT NULL, + uid TEXT NOT NULL UNIQUE, counter INT NOT NULL DEFAULT 0, tx_limit TEXT NOT NULL, daily_limit TEXT NOT NULL, @@ -30,7 +30,7 @@ async def m001_initial(db): await db.execute( """ CREATE TABLE boltcards.hits ( - id TEXT PRIMARY KEY, + id TEXT PRIMARY KEY UNIQUE, card_id TEXT NOT NULL, ip TEXT NOT NULL, spent BOOL NOT NULL DEFAULT True, @@ -48,7 +48,7 @@ async def m001_initial(db): await db.execute( """ CREATE TABLE boltcards.refunds ( - id TEXT PRIMARY KEY, + id TEXT PRIMARY KEY UNIQUE, hit_id TEXT NOT NULL, refund_amount INT NOT NULL, time TIMESTAMP NOT NULL DEFAULT """ diff --git a/lnbits/extensions/boltcards/templates/boltcards/index.html b/lnbits/extensions/boltcards/templates/boltcards/index.html index ec2611a98..43901f724 100644 --- a/lnbits/extensions/boltcards/templates/boltcards/index.html +++ b/lnbits/extensions/boltcards/templates/boltcards/index.html @@ -12,33 +12,18 @@
Cards
- + Add card
- Export to CSV + Export to CSV
- + {% raw %}