electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 18963405eeb54259210a761aac23134b005dd40a
parent 4fdf1b9b842eeb58d22bf24e829da02938cc22fe
Author: Janus <ysangkok@gmail.com>
Date:   Wed, 23 May 2018 15:46:30 +0200

lightning: remove hub based approach, port qt gui to lnbase

Diffstat:
Melectrum/commands.py | 19+------------------
Melectrum/gui/qt/__init__.py | 5-----
Melectrum/gui/qt/main_window.py | 11+++++++----
Melectrum/wallet.py | 3---
Mgui/qt/lightning_channels_list.py | 162++++++++++++++++++++-----------------------------------------------------------
Mgui/qt/lightning_invoice_list.py | 73+++++++++++++++++++++++++++++++++++++------------------------------------
Dlib/lightning.py | 919-------------------------------------------------------------------------------
Dlib/ln/__init__.py | 0
Dlib/ln/google/api/annotations_pb2.py | 46----------------------------------------------
Dlib/ln/google/api/http_pb2.py | 236-------------------------------------------------------------------------------
Dlib/ln/rpc_pb2.py | 2895-------------------------------------------------------------------------------
Mlib/lnbase.py | 55++++++++++++++++++++++++++++++++++++++++++++++---------
Mlib/tests/test_lnbase_online.py | 2+-
Dprotoc_lightning.sh | 15---------------
14 files changed, 132 insertions(+), 4309 deletions(-)

diff --git a/electrum/commands.py b/electrum/commands.py @@ -23,7 +23,6 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -import queue import sys import datetime import copy @@ -47,6 +46,7 @@ from .synchronizer import Notifier from .wallet import Abstract_Wallet, create_new_wallet, restore_wallet_from_text from .address_synchronizer import TX_HEIGHT_LOCAL from .import lightning +from .mnemonic import Mnemonic if TYPE_CHECKING: from .network import Network @@ -763,22 +763,6 @@ class Commands: # for the python console return sorted(known_commands.keys()) - @command("wn") - def lightning(self, lcmd, lightningargs=None): - q = queue.Queue() - class FakeQtSignal: - def emit(self, data): - q.put(data) - class MyConsole: - new_lightning_result = FakeQtSignal() - self.wallet.network.lightningrpc.setConsole(MyConsole()) - if lightningargs: - lightningargs = json_decode(lightningargs) - else: - lightningargs = [] - lightning.lightningCall(self.wallet.network.lightningrpc, lcmd)(*lightningargs) - return q.get(block=True, timeout=600) - def eval_bool(x: str) -> bool: if x == 'false': return False if x == 'true': return True @@ -846,7 +830,6 @@ command_options = { 'fee_level': (None, "Float between 0.0 and 1.0, representing fee slider position"), 'from_height': (None, "Only show transactions that confirmed after given block height"), 'to_height': (None, "Only show transactions that confirmed before given block height"), - 'lightningargs':(None, "Arguments for an lncli subcommand, encoded as a JSON array"), } diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py @@ -140,11 +140,6 @@ class ElectrumGui(Logger): # the OS/window manager/etc might set *a dark theme*. # Hence, try to choose colors accordingly: ColorScheme.update_from_widget(QWidget(), force_dark=use_dark_theme) - self.lightning = LightningUI(self.set_console_and_return_lightning) - - def set_console_and_return_lightning(self): - self.windows[0].wallet.network.lightningrpc.setConsole(self.windows[0].console) - return self.windows[0].wallet.network.lightningrpc def build_tray_menu(self): # Avoid immediate GC of old menu when window closed via its action diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py @@ -173,7 +173,10 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.utxo_tab = self.create_utxo_tab() self.console_tab = self.create_console_tab() self.contacts_tab = self.create_contacts_tab() - if config.get("lightning", False): + tabs.addTab(self.create_history_tab(), QIcon(":icons/tab_history.png"), _('History')) + tabs.addTab(self.send_tab, QIcon(":icons/tab_send.png"), _('Send')) + tabs.addTab(self.receive_tab, QIcon(":icons/tab_receive.png"), _('Receive')) + if config.get("lnbase", False): self.lightning_invoices_tab = self.create_lightning_invoices_tab(wallet) tabs.addTab(self.lightning_invoices_tab, _("Lightning Invoices")) @@ -879,11 +882,11 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): self.update_completions() def create_lightning_invoices_tab(self, wallet): - self.lightning_invoice_list = LightningInvoiceList(self, wallet.network.lightningworker, wallet.network.lightningrpc) + self.lightning_invoice_list = LightningInvoiceList(self, wallet.lnworker) return self.lightning_invoice_list def create_lightning_channels_tab(self, wallet): - self.lightning_channels_list = LightningChannelsList(self, wallet.network.lightningworker, wallet.network.lightningrpc) + self.lightning_channels_list = LightningChannelsList(self, wallet.lnworker) return self.lightning_channels_list def create_history_tab(self): @@ -2089,7 +2092,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger): 'wallet': self.wallet, 'network': self.network, 'plugins': self.gui_object.plugins, - 'l': self.gui_object.lightning, + 'lightning' : self.wallet.lnworker.console_interface, 'window': self, 'config': self.config, 'electrum': electrum, diff --git a/electrum/wallet.py b/electrum/wallet.py @@ -73,9 +73,6 @@ if TYPE_CHECKING: _logger = get_logger(__name__) -from .lightning import LightningRPC -from .lightning import LightningWorker - TX_STATUS = [ _('Unconfirmed'), _('Unconfirmed parent'), diff --git a/gui/qt/lightning_channels_list.py b/gui/qt/lightning_channels_list.py @@ -3,11 +3,11 @@ import binascii, base64 from PyQt5 import QtCore, QtWidgets from collections import OrderedDict import logging -from electrum.lightning import lightningCall import traceback -mapping = {0: "channel_point"} -revMapp = {"channel_point": 0} +# https://api.lightning.community/#listchannels +mapping = {0: "chan_id"} +revMapp = {"chan_id": 0} datatable = OrderedDict([]) class MyTableRow(QtWidgets.QTreeWidgetItem): @@ -29,78 +29,64 @@ class MyTableRow(QtWidgets.QTreeWidgetItem): def addChannelRow(new): made = MyTableRow(new) - datatable[new["channel_point"]] = made - datatable.move_to_end(new["channel_point"], last=False) + datatable[new["chan_id"]] = made + datatable.move_to_end(new["chan_id"], last=False) return made -def clickHandler(nodeIdInput, local_amt_inp, push_amt_inp, lightningRpc): - nodeId = nodeIdInput.text() - print("creating channel with connstr {}".format(nodeId)) - lightningCall(lightningRpc, "openchannel")(str(nodeId), local_amt_inp.text(), push_amt_inp.text()) - class LightningChannelsList(QtWidgets.QWidget): - update_rows = QtCore.pyqtSignal(str, dict) + update_rows = QtCore.pyqtSignal(dict) + update_single_row = QtCore.pyqtSignal(dict) - def create_menu(self, position): - menu = QtWidgets.QMenu() - cur = self._tv.currentItem() - channel_point = cur["channel_point"] - def close(): - params = [str(channel_point)] + (["--force"] if not cur["active"] else []) # TODO test if force is being used correctly - lightningCall(self.lightningRpc, "closechannel")(*params) - menu.addAction("Close channel", close) - menu.exec_(self._tv.viewport().mapToGlobal(position)) - def lightningWorkerHandler(self, sourceClassName, obj): - new = {} - for k, v in obj.items(): - try: - v = binascii.hexlify(base64.b64decode(v)).decode("ascii") - except: - pass - new[k] = v + def clickHandler(self, nodeIdInput, local_amt_inp, push_amt_inp, lnworker): + nodeId = nodeIdInput.text() + print("creating channel with connstr {}".format(nodeId)) + local_amt = int(local_amt_inp.text()) + try: + push_amt = int(push_amt_inp.text()) + except ValueError: + push_amt = 0 + assert local_amt >= 200000 + assert local_amt >= push_amt + obj = lnworker.open_channel_from_other_thread(node_id=str(nodeId), local_amt=local_amt, push_amt=push_amt, emit_function=self.update_rows.emit, get_password=self.main_window.password_dialog) + + @QtCore.pyqtSlot(dict) + def do_update_single_row(self, new): try: - obj = datatable[new["channel_point"]] + obj = datatable[new["chan_id"]] except KeyError: - print("lightning channel_point {} unknown!".format(new["channel_point"])) + print("lightning chan_id {} unknown!".format(new["chan_id"])) else: for k, v in new.items(): try: if obj[k] != v: obj[k] = v except KeyError: obj[k] = v - def lightningRpcHandler(self, methodName, obj): - if isinstance(obj, Exception): - try: - raise obj - except: - traceback.print_exc() - else: - self.update_rows.emit(methodName, obj) - def do_update_rows(self, methodName, obj): - if methodName != "listchannels": - print("channel list ignoring reply {} to {}".format(obj, methodName)) - return + def create_menu(self, position): + menu = QtWidgets.QMenu() + cur = self._tv.currentItem() + def close(): + print("closechannel result", lnworker.close_channel_from_other_thread(cur.di)) + menu.addAction("Close channel", close) + menu.exec_(self._tv.viewport().mapToGlobal(position)) + + @QtCore.pyqtSlot(dict) + def do_update_rows(self, obj): self._tv.clear() for i in obj["channels"]: self._tv.insertTopLevelItem(0, addChannelRow(i)) - - def __init__(self, parent, lightningWorker, lightningRpc): + def __init__(self, parent, lnworker): QtWidgets.QWidget.__init__(self, parent) + self.main_window = parent self.update_rows.connect(self.do_update_rows) + self.update_single_row.connect(self.do_update_single_row) - def tick(): - lightningCall(lightningRpc, "listchannels")() - - timer = QtCore.QTimer(self) - timer.timeout.connect(tick) - timer.start(5000) + self.lnworker = lnworker - lightningWorker.subscribe(self.lightningWorkerHandler) - lightningRpc.subscribe(self.lightningRpcHandler) - self.lightningRpc = lightningRpc + lnworker.subscribe_channel_list_updates_from_other_thread(self.update_rows.emit) + lnworker.subscribe_single_channel_update_from_other_thread(self.update_single_row.emit) self._tv=QtWidgets.QTreeWidget(self) self._tv.setHeaderLabels([mapping[i] for i in range(len(mapping))]) @@ -113,7 +99,7 @@ class LightningChannelsList(QtWidgets.QWidget): push_amt_inp = QtWidgets.QLineEdit(self) button = QtWidgets.QPushButton('Open channel', self) - button.clicked.connect(lambda: clickHandler(nodeid_inp, local_amt_inp, push_amt_inp, lightningRpc)) + button.clicked.connect(lambda: self.clickHandler(nodeid_inp, local_amt_inp, push_amt_inp, lnworker)) l=QtWidgets.QVBoxLayout(self) h=QtWidgets.QGridLayout(self) @@ -139,71 +125,3 @@ class LightningChannelsList(QtWidgets.QWidget): l.addWidget(self._tv) self.resize(2500,1000) - -class MockLightningWorker: - def subscribe(self, handler): - pass - -if __name__=="__main__": - import queue, threading, asyncio - from sys import argv, exit - import signal , traceback, os - - loop = asyncio.new_event_loop() - - async def loopstop(): - loop.stop() - - def signal_handler(signal, frame): - asyncio.run_coroutine_threadsafe(loopstop(), loop) - - signal.signal(signal.SIGINT, signal_handler) - - a=QtWidgets.QApplication(argv) - - gotReplyHandlerLock = threading.Lock() - gotReplyHandlerLock.acquire() - replyHandler = None - - class MockLightningRPC: - def __init__(self, q): - self.queue = q - def subscribe(self, handler): - global replyHandler - replyHandler = handler - gotReplyHandlerLock.release() - - q = queue.Queue() - w=LightningChannelsList(None, MockLightningWorker(), MockLightningRPC(q)) - w.show() - w.raise_() - - async def the_job(): - try: - acquired_once = False - while loop.is_running(): - try: - cmd = q.get_nowait() - except queue.Empty: - await asyncio.sleep(1) - continue - if not acquired_once: - gotReplyHandlerLock.acquire() - acquired_once = True - if cmd[0] == "listchannels": - #replyHandler("listchannels", Exception("Test exception")) - replyHandler("listchannels", {"channels": [{"channel_point": binascii.hexlify(os.urandom(32)).decode("ascii"), "active": True}]}) - elif cmd[0] == "openchannel": - replyHandler("openchannel", {}) - else: - print("mock rpc server ignoring", cmd[0]) - except: - traceback.print_exc() - - def asyncioThread(): - loop.create_task(the_job()) - loop.run_forever() - - threading.Thread(target=asyncioThread).start() - - exit(a.exec_()) diff --git a/gui/qt/lightning_invoice_list.py b/gui/qt/lightning_invoice_list.py @@ -4,8 +4,8 @@ import binascii from PyQt5 import QtCore, QtWidgets from collections import OrderedDict import logging -from electrum.lightning import lightningCall from .qrcodewidget import QRDialog +from PyQt5.QtCore import pyqtSignal, pyqtSlot mapping = {0: "r_hash", 1: "pay_req", 2: "settled"} revMapp = {"r_hash": 0, "pay_req": 1, "settled": 2} @@ -38,23 +38,29 @@ def addInvoiceRow(new): datatable.move_to_end(new["r_hash"], last=False) return made -def clickHandler(numInput, treeView, lightningRpc): - amt = numInput.value() - if amt < 1: - print("value too small") - return - print("creating invoice with value {}".format(amt)) - global idx - #obj = { - # "r_hash": binascii.hexlify((int.from_bytes(bytearray.fromhex("9500edb0994b7bc23349193486b25c82097045db641f35fa988c0e849acdec29"), "big")+idx).to_bytes(byteorder="big", length=32)).decode("ascii"), - # "pay_req": "lntb81920n1pdf258s" + str(idx), - # "settled": False - #} - #treeView.insertTopLevelItem(0, addInvoiceRow(obj)) - idx += 1 - lightningCall(lightningRpc, "addinvoice")("--amt=" + str(amt)) - class LightningInvoiceList(QtWidgets.QWidget): + invoice_added_signal = QtCore.pyqtSignal(dict) + + @QtCore.pyqtSlot(dict) + def invoice_added_handler(self, di): + self._tv.insertTopLevelItem(0, addInvoiceRow(invoice)) + + def clickHandler(self, numInput, treeView, lnworker): + amt = numInput.value() + if amt < 1: + print("value too small") + return + print("creating invoice with value {}".format(amt)) + global idx + #obj = { + # "r_hash": binascii.hexlify((int.from_bytes(bytearray.fromhex("9500edb0994b7bc23349193486b25c82097045db641f35fa988c0e849acdec29"), "big")+idx).to_bytes(byteorder="big", length=32)).decode("ascii"), + # "pay_req": "lntb81920n1pdf258s" + str(idx), + # "settled": False + #} + #treeView.insertTopLevelItem(0, addInvoiceRow(obj)) + idx += 1 + lnworker.add_invoice_from_other_thread(amt) + def create_menu(self, position): menu = QtWidgets.QMenu() pay_req = self._tv.currentItem()["pay_req"] @@ -68,14 +74,11 @@ class LightningInvoiceList(QtWidgets.QWidget): menu.addAction("Copy payment request", copy) menu.addAction("Show payment request as QR code", qr) menu.exec_(self._tv.viewport().mapToGlobal(position)) - def lightningWorkerHandler(self, sourceClassName, obj): - new = {} - for k, v in obj.items(): - try: - v = binascii.hexlify(base64.b64decode(v)).decode("ascii") - except: - pass - new[k] = v + + payment_received_signal = pyqtSignal(dict) + + @pyqtSlot(dict) + def paymentReceived(self, new): try: obj = datatable[new["r_hash"]] except KeyError: @@ -86,17 +89,15 @@ class LightningInvoiceList(QtWidgets.QWidget): if obj[k] != v: obj[k] = v except KeyError: obj[k] = v - def lightningRpcHandler(self, methodName, obj): - if methodName != "addinvoice": - print("ignoring reply {} to {}".format(obj, methodName)) - return - self._tv.insertTopLevelItem(0, addInvoiceRow(obj)) - - def __init__(self, parent, lightningWorker, lightningRpc): + + def __init__(self, parent, lnworker): QtWidgets.QWidget.__init__(self, parent) - lightningWorker.subscribe(self.lightningWorkerHandler) - lightningRpc.subscribe(self.lightningRpcHandler) + self.payment_received_signal.connect(self.paymentReceived) + self.invoice_added_signal.connect(self.invoice_added_handler) + + lnworker.subscribe_payment_received_from_other_thread(self.payment_received_signal.emit) + lnworker.subscribe_invoice_added_from_other_thread(self.invoice_added_signal.emit) self._tv=QtWidgets.QTreeWidget(self) self._tv.setHeaderLabels([mapping[i] for i in range(len(mapping))]) @@ -108,12 +109,12 @@ class LightningInvoiceList(QtWidgets.QWidget): def keyPressEvent(self2, e): super(SatoshiCountSpinBox, self2).keyPressEvent(e) if QtCore.Qt.Key_Return == e.key(): - clickHandler(self2, self._tv, lightningRpc) + self.clickHandler(self2, self._tv, lnworker) numInput = SatoshiCountSpinBox(self) button = QtWidgets.QPushButton('Add invoice', self) - button.clicked.connect(lambda: clickHandler(numInput, self._tv, lightningRpc)) + button.clicked.connect(lambda: self.clickHandler(numInput, self._tv, lnworker)) l=QtWidgets.QVBoxLayout(self) h=QtWidgets.QGridLayout(self) diff --git a/lib/lightning.py b/lib/lightning.py @@ -1,919 +0,0 @@ -import functools -import datetime -import sys -import struct -import traceback -import os.path -from .ln import rpc_pb2 - -from jsonrpclib import Server -from google.protobuf import json_format -import binascii -import ecdsa.util -import hashlib -from .bitcoin import EC_KEY, MySigningKey -from ecdsa.curves import SECP256k1 -from . import bitcoin -from . import transaction -from . import keystore - -import queue - -import threading -import json -import base64 - -import asyncio - -from concurrent.futures import TimeoutError - -WALLET = None -NETWORK = None -CONFIG = None -locked = set() - - -def WriteDb(json): - req = rpc_pb2.WriteDbRequest() - json_format.Parse(json, req) - print("writedb unimplemented", req.dbData) - m = rpc_pb2.WriteDbResponse() - msg = json_format.MessageToJson(m) - return msg - - -def ConfirmedBalance(json): - request = rpc_pb2.ConfirmedBalanceRequest() - json_format.Parse(json, request) - m = rpc_pb2.ConfirmedBalanceResponse() - confs = request.confirmations - #witness = request.witness # bool - - m.amount = sum(WALLET.get_balance()) - msg = json_format.MessageToJson(m) - return msg - - -def NewAddress(json): - request = rpc_pb2.NewAddressRequest() - json_format.Parse(json, request) - m = rpc_pb2.NewAddressResponse() - if request.type == rpc_pb2.WITNESS_PUBKEY_HASH: - m.address = WALLET.get_unused_address() - elif request.type == rpc_pb2.NESTED_PUBKEY_HASH: - assert False, "cannot handle nested-pubkey-hash address type generation yet" - elif request.type == rpc_pb2.PUBKEY_HASH: - assert False, "cannot handle pubkey_hash generation yet" - else: - assert False, "unknown address type" - msg = json_format.MessageToJson(m) - return msg - - -#def FetchRootKey(json): -# request = rpc_pb2.FetchRootKeyRequest() -# json_format.Parse(json, request) -# m = rpc_pb2.FetchRootKeyResponse() -# m.rootKey = WALLET.keystore.get_private_key([151,151,151,151], None)[0] -# msg = json_format.MessageToJson(m) -# return msg - - -cl = rpc_pb2.ListUnspentWitnessRequest - -assert rpc_pb2.WITNESS_PUBKEY_HASH is not None - - -def ListUnspentWitness(json): - req = cl() - json_format.Parse(json, req) - confs = req.minConfirmations #TODO regard this - - unspent = WALLET.get_utxos() - m = rpc_pb2.ListUnspentWitnessResponse() - for utxo in unspent: - # print(utxo) - # example: - # {'prevout_n': 0, - # 'address': 'sb1qt52ccplvtpehz7qvvqft2udf2eaqvfsal08xre', - # 'prevout_hash': '0d4caccd6e8a906c8ca22badf597c4dedc6dd7839f3cac3137f8f29212099882', - # 'coinbase': False, - # 'height': 326, - # 'value': 400000000} - - global locked - if (utxo["prevout_hash"], utxo["prevout_n"]) in locked: - print("SKIPPING LOCKED OUTPOINT", utxo["prevout_hash"]) - continue - towire = m.utxos.add() - towire.addressType = rpc_pb2.WITNESS_PUBKEY_HASH - towire.redeemScript = b"" - towire.pkScript = b"" - towire.witnessScript = bytes(bytearray.fromhex( - bitcoin.address_to_script(utxo["address"]))) - towire.value = utxo["value"] - towire.outPoint.hash = utxo["prevout_hash"] - towire.outPoint.index = utxo["prevout_n"] - return json_format.MessageToJson(m) - -def LockOutpoint(json): - req = rpc_pb2.LockOutpointRequest() - json_format.Parse(json, req) - global locked - locked.add((req.outpoint.hash, req.outpoint.index)) - - -def UnlockOutpoint(json): - req = rpc_pb2.UnlockOutpointRequest() - json_format.Parse(json, req) - global locked - # throws KeyError if not existing. Use .discard() if we do not care - locked.remove((req.outpoint.hash, req.outpoint.index)) - -def ListTransactionDetails(json): - global WALLET - global NETWORK - m = rpc_pb2.ListTransactionDetailsResponse() - for tx_hash, height, conf, timestamp, delta, balance in WALLET.get_history(): - if height == 0: - print("WARNING", tx_hash, "has zero height!") - detail = m.details.add() - detail.hash = tx_hash - detail.value = delta - detail.numConfirmations = conf - detail.blockHash = NETWORK.blockchain().get_hash(height) - detail.blockHeight = height - detail.timestamp = timestamp - detail.totalFees = 1337 # TODO - return json_format.MessageToJson(m) - -def FetchInputInfo(json): - req = rpc_pb2.FetchInputInfoRequest() - json_format.Parse(json, req) - has = req.outPoint.hash - idx = req.outPoint.index - txoinfo = WALLET.txo.get(has, {}) - m = rpc_pb2.FetchInputInfoResponse() - if has in WALLET.transactions: - tx = WALLET.transactions[has] - m.mine = True - else: - tx = WALLET.get_input_tx(has) - print("did not find tx with hash", has) - print("tx", tx) - - m.mine = False - return json_format.MessageToJson(m) - outputs = tx.outputs() - assert {bitcoin.TYPE_SCRIPT: "SCRIPT", bitcoin.TYPE_ADDRESS: "ADDRESS", - bitcoin.TYPE_PUBKEY: "PUBKEY"}[outputs[idx][0]] == "ADDRESS" - scr = transaction.Transaction.pay_script(outputs[idx][0], outputs[idx][1]) - m.txOut.value = outputs[idx][2] # type, addr, val - m.txOut.pkScript = bytes(bytearray.fromhex(scr)) - msg = json_format.MessageToJson(m) - return msg - -def SendOutputs(json): - global NETWORK, WALLET, CONFIG - - req = rpc_pb2.SendOutputsRequest() - json_format.Parse(json, req) - - m = rpc_pb2.SendOutputsResponse() - - elecOutputs = [(bitcoin.TYPE_SCRIPT, binascii.hexlify(txout.pkScript).decode("utf-8"), txout.value) for txout in req.outputs] - - print("ignoring feeSatPerByte", req.feeSatPerByte) # TODO - - tx = None - try: - # outputs, password, config, fee - tx = WALLET.mktx(elecOutputs, None, CONFIG, 1000) - except Exception as e: - m.success = False - m.error = str(e) - m.resultHash = "" - return json_format.MessageToJson(m) - - publishTxThread(tx) - m.success = True - m.error = "" - m.resultHash = tx.txid() - return json_format.MessageToJson(m) - -def isSynced(): - global NETWORK - local_height, server_height = NETWORK.get_status_value("updated") - synced = server_height != 0 and NETWORK.is_up_to_date() and local_height >= server_height - return synced, local_height, server_height - -def IsSynced(json): - m = rpc_pb2.IsSyncedResponse() - m.synced, localHeight, _ = isSynced() - block = NETWORK.blockchain().read_header(localHeight) - m.lastBlockTimeStamp = block["timestamp"] - return json_format.MessageToJson(m) - -def SignMessage(json): - req = rpc_pb2.SignMessageRequest() - json_format.Parse(json, req) - m = rpc_pb2.SignMessageResponse() - - pri = privKeyForPubKey(req.pubKey) - - m.signature = pri.sign(bitcoin.Hash(req.messageToBeSigned), ecdsa.util.sigencode_der) - m.error = "" - m.success = True - return json_format.MessageToJson(m) - -def LEtobytes(x, l): - if l == 2: - fmt = "<H" - elif l == 4: - fmt = "<I" - elif l == 8: - fmt = "<Q" - else: - assert False, "invalid format for LEtobytes" - return struct.pack(fmt, x) - - -def toint(x): - if len(x) == 1: - return ord(x) - elif len(x) == 2: - fmt = ">H" - elif len(x) == 4: - fmt = ">I" - elif len(x) == 8: - fmt = ">Q" - else: - assert False, "invalid length for toint(): " + str(len(x)) - return struct.unpack(fmt, x)[0] - -class TxSigHashes(object): - def __init__(self, hashOutputs=None, hashSequence=None, hashPrevOuts=None): - self.hashOutputs = hashOutputs - self.hashSequence = hashSequence - self.hashPrevOuts = hashPrevOuts - - -class Output(object): - def __init__(self, value=None, pkScript=None): - assert value is not None and pkScript is not None - self.value = value - self.pkScript = pkScript - - -class InputScript(object): - def __init__(self, scriptSig, witness): - assert witness is None or type(witness[0]) is type(bytes([])) - assert type(scriptSig) is type(bytes([])) - self.scriptSig = scriptSig - self.witness = witness - - -def tweakPrivKey(basePriv, commitTweak): - tweakInt = int.from_bytes(commitTweak, byteorder="big") - tweakInt += basePriv.secret # D is secret - tweakInt %= SECP256k1.generator.order() - return EC_KEY(tweakInt.to_bytes(32, 'big')) - -def singleTweakBytes(commitPoint, basePoint): - m = hashlib.sha256() - m.update(bytearray.fromhex(commitPoint)) - m.update(bytearray.fromhex(basePoint)) - return m.digest() - -def deriveRevocationPrivKey(revokeBasePriv, commitSecret): - revokeTweakBytes = singleTweakBytes(revokeBasePriv.get_public_key(True), - commitSecret.get_public_key(True)) - revokeTweakInt = int.from_bytes(revokeTweakBytes, byteorder="big") - - commitTweakBytes = singleTweakBytes(commitSecret.get_public_key(True), - revokeBasePriv.get_public_key(True)) - commitTweakInt = int.from_bytes(commitTweakBytes, byteorder="big") - - revokeHalfPriv = revokeTweakInt * revokeBasePriv.secret # D is secret - commitHalfPriv = commitTweakInt * commitSecret.secret - - revocationPriv = revokeHalfPriv + commitHalfPriv - revocationPriv %= SECP256k1.generator.order() - - return EC_KEY(revocationPriv.to_bytes(32, byteorder="big")) - - -def maybeTweakPrivKey(signdesc, pri): - if len(signdesc.singleTweak) > 0: - pri2 = tweakPrivKey(pri, signdesc.singleTweak) - elif len(signdesc.doubleTweak) > 0: - pri2 = deriveRevocationPrivKey(pri, EC_KEY(signdesc.doubleTweak)) - else: - pri2 = pri - - if pri2 != pri: - have_keys = WALLET.storage.get("lightning_extra_keys", []) - if pri2.secret not in have_keys: - WALLET.storage.put("lightning_extra_keys", have_keys + [pri2.secret]) - WALLET.storage.write() - print("saved new tweaked key", pri2.secret) - - return pri2 - - -def isWitnessPubKeyHash(script): - if len(script) != 2: - return False - haveop0 = (transaction.opcodes.OP_0 == script[0][0]) - haveopdata20 = (20 == script[1][0]) - return haveop0 and haveopdata20 - -#// calcWitnessSignatureHash computes the sighash digest of a transaction's -#// segwit input using the new, optimized digest calculation algorithm defined -#// in BIP0143: https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki. -#// This function makes use of pre-calculated sighash fragments stored within -#// the passed HashCache to eliminate duplicate hashing computations when -#// calculating the final digest, reducing the complexity from O(N^2) to O(N). -#// Additionally, signatures now cover the input value of the referenced unspent -#// output. This allows offline, or hardware wallets to compute the exact amount -#// being spent, in addition to the final transaction fee. In the case the -#// wallet if fed an invalid input amount, the real sighash will differ causing -#// the produced signature to be invalid. - - -def calcWitnessSignatureHash(original, sigHashes, hashType, tx, idx, amt): - assert len(original) != 0 - decoded = transaction.deserialize(binascii.hexlify(tx).decode("utf-8")) - if idx > len(decoded["inputs"]) - 1: - raise Exception("invalid inputIndex") - txin = decoded["inputs"][idx] - #tohash = transaction.Transaction.serialize_witness(txin) - sigHash = LEtobytes(decoded["version"], 4) - if toint(hashType) & toint(sigHashAnyOneCanPay) == 0: - sigHash += bytes(bytearray.fromhex(sigHashes.hashPrevOuts))[::-1] - else: - sigHash += b"\x00" * 32 - - if toint(hashType) & toint(sigHashAnyOneCanPay) == 0 and toint(hashType) & toint(sigHashMask) != toint(sigHashSingle) and toint(hashType) & toint(sigHashMask) != toint(sigHashNone): - sigHash += bytes(bytearray.fromhex(sigHashes.hashSequence))[::-1] - else: - sigHash += b"\x00" * 32 - - sigHash += bytes(bytearray.fromhex(txin["prevout_hash"]))[::-1] - sigHash += LEtobytes(txin["prevout_n"], 4) - # byte 72 - - subscript = list(transaction.script_GetOp(original)) - if isWitnessPubKeyHash(subscript): - sigHash += b"\x19" - sigHash += bytes([transaction.opcodes.OP_DUP]) - sigHash += bytes([transaction.opcodes.OP_HASH160]) - sigHash += b"\x14" # 20 bytes - assert len(subscript) == 2, subscript - opcode, data, length = subscript[1] - sigHash += data - sigHash += bytes([transaction.opcodes.OP_EQUALVERIFY]) - sigHash += bytes([transaction.opcodes.OP_CHECKSIG]) - else: - # For p2wsh outputs, and future outputs, the script code is - # the original script, with all code separators removed, - # serialized with a var int length prefix. - - assert len(sigHash) == 104, len(sigHash) - sigHash += bytes(bytearray.fromhex(bitcoin.var_int(len(original)))) - assert len(sigHash) == 105, len(sigHash) - - sigHash += original - - sigHash += LEtobytes(amt, 8) - sigHash += LEtobytes(txin["sequence"], 4) - - if toint(hashType) & toint(sigHashSingle) != toint(sigHashSingle) and toint(hashType) & toint(sigHashNone) != toint(sigHashNone): - sigHash += bytes(bytearray.fromhex(sigHashes.hashOutputs))[::-1] - elif toint(hashtype) & toint(sigHashMask) == toint(sigHashSingle) and idx < len(decoded["outputs"]): - raise Exception("TODO 1") - else: - raise Exception("TODO 2") - - sigHash += LEtobytes(decoded["lockTime"], 4) - sigHash += LEtobytes(toint(hashType), 4) - - return transaction.Hash(sigHash) - -#// RawTxInWitnessSignature returns the serialized ECDA signature for the input -#// idx of the given transaction, with the hashType appended to it. This -#// function is identical to RawTxInSignature, however the signature generated -#// signs a new sighash digest defined in BIP0143. -# func RawTxInWitnessSignature(tx *MsgTx, sigHashes *TxSigHashes, idx int, -# amt int64, subScript []byte, hashType SigHashType, -# key *btcec.PrivateKey) ([]byte, error) { - - -def rawTxInWitnessSignature(tx, sigHashes, idx, amt, subscript, hashType, key): - digest = calcWitnessSignatureHash( - subscript, sigHashes, hashType, tx, idx, amt) - return key.sign(digest, sigencode=ecdsa.util.sigencode_der) + hashType - -# WitnessSignature creates an input witness stack for tx to spend BTC sent -# from a previous output to the owner of privKey using the p2wkh script -# template. The passed transaction must contain all the inputs and outputs as -# dictated by the passed hashType. The signature generated observes the new -# transaction digest algorithm defined within BIP0143. -def witnessSignature(tx, sigHashes, idx, amt, subscript, hashType, privKey, compress): - sig = rawTxInWitnessSignature( - tx, sigHashes, idx, amt, subscript, hashType, privKey) - - pkData = bytes(bytearray.fromhex( - privKey.get_public_key(compressed=compress))) - - return sig, pkData - - -sigHashMask = b"\x1f" - -sigHashAll = b"\x01" -sigHashNone = b"\x02" -sigHashSingle = b"\x03" -sigHashAnyOneCanPay = b"\x80" - -test = rpc_pb2.ComputeInputScriptResponse() - -test.witnessScript.append(b"\x01") -test.witnessScript.append(b"\x02") - - -def SignOutputRaw(json): - req = rpc_pb2.SignOutputRawRequest() - json_format.Parse(json, req) - - #assert len(req.signDesc.pubKey) in [33, 0] - assert len(req.signDesc.doubleTweak) in [32, 0] - assert len(req.signDesc.sigHashes.hashPrevOuts) == 64 - assert len(req.signDesc.sigHashes.hashSequence) == 64 - assert len(req.signDesc.sigHashes.hashOutputs) == 64 - - m = rpc_pb2.SignOutputRawResponse() - - m.signature = signOutputRaw(req.tx, req.signDesc) - - msg = json_format.MessageToJson(m) - return msg - - -def signOutputRaw(tx, signDesc): - pri = derivePrivKey(signDesc.keyDescriptor) - assert pri is not None - pri2 = maybeTweakPrivKey(signDesc, pri) - sig = rawTxInWitnessSignature(tx, signDesc.sigHashes, signDesc.inputIndex, - signDesc.output.value, signDesc.witnessScript, sigHashAll, pri2) - return sig[:len(sig) - 1] - -def publishTxThread(tx): - global NETWORK - def target(tx, NETWORK): - try: - res = NETWORK.broadcast(tx) - print("PUBLISH TRANSACTION IN SEPARATE THREAD PRODUCED", res) - except: - traceback.print_exc() - threading.Thread(target=target, args=(tx, NETWORK)).start() - -async def PublishTransaction(json): - req = rpc_pb2.PublishTransactionRequest() - json_format.Parse(json, req) - tx = transaction.Transaction(binascii.hexlify(req.tx).decode("utf-8")) - publishTxThread(tx) - m = rpc_pb2.PublishTransactionResponse() - m.success = True - m.error = "" - if m.error: - print("PublishTransaction", m.error) - if "Missing inputs" in m.error: - print("inputs", tx.inputs()) - return json_format.MessageToJson(m) - - -def ComputeInputScript(json): - req = rpc_pb2.ComputeInputScriptRequest() - json_format.Parse(json, req) - - #assert len(req.signDesc.pubKey) in [33, 0] - assert len(req.signDesc.doubleTweak) in [32, 0] - assert len(req.signDesc.sigHashes.hashPrevOuts) == 64 - assert len(req.signDesc.sigHashes.hashSequence) == 64 - assert len(req.signDesc.sigHashes.hashOutputs) == 64 - # singleTweak , witnessScript variable length - - try: - inpscr = computeInputScript(req.tx, req.signDesc) - except: - print("catched!") - traceback.print_exc() - return None - - m = rpc_pb2.ComputeInputScriptResponse() - - m.witnessScript.append(inpscr.witness[0]) - m.witnessScript.append(inpscr.witness[1]) - m.scriptSig = inpscr.scriptSig - - msg = json_format.MessageToJson(m) - return msg - - -def fetchPrivKey(str_address, keyLocatorFamily, keyLocatorIndex): - pri = None - - if str_address is not None: - pri, redeem_script = WALLET.export_private_key(str_address, None) - - if redeem_script: - print("ignoring redeem script", redeem_script) - - typ, pri, compressed = bitcoin.deserialize_privkey(pri) - if keyLocatorFamily == 0 and keyLocatorIndex == 0: return EC_KEY(pri) - - ks = keystore.BIP32_KeyStore({}) - der = "m/0'/" - xtype = 'p2wpkh' - ks.add_xprv_from_seed(pri, xtype, der) - else: - ks = WALLET.keystore - - if keyLocatorFamily != 0 or keyLocatorIndex != 0: - pri = ks.get_private_key([1017, keyLocatorFamily, keyLocatorIndex], password=None)[0] - pri = EC_KEY(pri) - - assert pri is not None - - return pri - - -def computeInputScript(tx, signdesc): - typ, str_address = transaction.get_address_from_output_script( - signdesc.output.pkScript) - assert typ != bitcoin.TYPE_SCRIPT - - assert len(signdesc.keyDescriptor.pubKey) == 0 - pri = fetchPrivKey(str_address, signdesc.keyDescriptor.keyLocator.family, signdesc.keyDescriptor.keyLocator.index) - - isNestedWitness = False # because NewAddress only does native addresses - - witnessProgram = None - ourScriptSig = None - - if isNestedWitness: - pub = pri.get_public_key() - - scr = bitcoin.hash_160(pub) - - witnessProgram = b"\x00\x14" + scr - - # \x14 is OP_20 - ourScriptSig = b"\x16\x00\x14" + scr - else: - # TODO TEST - witnessProgram = signdesc.output.pkScript - ourScriptSig = b"" - print("set empty ourScriptSig") - print("witnessProgram", witnessProgram) - - # If a tweak (single or double) is specified, then we'll need to use - # this tweak to derive the final private key to be used for signing - # this output. - pri2 = maybeTweakPrivKey(signdesc, pri) - - # - # Generate a valid witness stack for the input. - # TODO(roasbeef): adhere to passed HashType - witnessScript, pkData = witnessSignature(tx, signdesc.sigHashes, - signdesc.inputIndex, signdesc.output.value, witnessProgram, - sigHashAll, pri2, True) - return InputScript(witness=(witnessScript, pkData), scriptSig=ourScriptSig) - -from collections import namedtuple -QueueItem = namedtuple("QueueItem", ["methodName", "args"]) - -class LightningRPC: - def __init__(self): - super(LightningRPC, self).__init__() - self.queue = queue.Queue() - self.subscribers = [] - self.console = None - - # overridden - async def run(self, netAndWalLock): - while asyncio.get_event_loop().is_running(): - try: - qitem = self.queue.get(block=False) - except queue.Empty: - await asyncio.sleep(5) - pass - else: - def lightningRpcNetworkRequestThreadTarget(qitem): - machine = CONFIG.get('lndhost', '127.0.0.1') - applyMethodName = lambda x: functools.partial(x, qitem.methodName) - client = Server("http://" + machine + ":8090") - argumentStrings = [str(x) for x in qitem.args] - lightningSessionKey = base64.b64encode(privateKeyHash[:6]).decode("ascii") - resolvedMethod = getattr(client, qitem.methodName) - try: - result = resolvedMethod(lightningSessionKey, *argumentStrings) - except Exception as e: - traceback.print_exc() - for i in self.subscribers: applyMethodName(i)(e) - raise - toprint = result - try: - assert type(result) is not str, result - assert result["stderr"] == "" and result["returncode"] == 0, "LightningRPC detected error: " + result["stderr"] - toprint = json.loads(result["stdout"]) - for i in self.subscribers: applyMethodName(i)(toprint) - except Exception as e: - traceback.print_exc() - for i in self.subscribers: applyMethodName(i)(e) - if self.console: - self.console.new_lightning_result.emit(json.dumps(toprint, indent=4)) - threading.Thread(target=lightningRpcNetworkRequestThreadTarget, args=(qitem, )).start() - def setConsole(self, console): - self.console = console - def subscribe(self, notifyFunction): - self.subscribers.append(notifyFunction) - def clearSubscribers(self): - self.subscribers = [] - -def lightningCall(rpc, methodName): - def fun(*args): - rpc.queue.put(QueueItem(methodName, args)) - return fun - -class LightningUI(): - def __init__(self, lightningGetter): - self.rpc = lightningGetter - def __getattr__(self, nam): - synced, local, server = isSynced() - if not synced: - return lambda *args: "Not synced yet: local/server: {}/{}".format(local, server) - return lightningCall(self.rpc(), nam) - -privateKeyHash = None - -class LightningWorker: - def __init__(self, wallet, network, config): - global privateKeyHash - super(LightningWorker, self).__init__() - self.server = None - self.wallet = wallet - self.network = network - self.config = config - ks = self.wallet.keystore - assert hasattr(ks, "xprv"), "Wallet must have xprv, can't be e.g. imported" - try: - xprv = ks.get_master_private_key(None) - xprv, xpub = bitcoin.bip32_private_derivation(xprv, "m/", "m/152/152/152/152") - except: - raise Exception("Could not get master private key, is the wallet password protected?") - tupl = bitcoin.deserialize_xprv(xprv) - privKey = tupl[-1] - assert type(privKey) is type(bytes([])) - privateKeyHash = bitcoin.Hash(privKey) - deser = bitcoin.deserialize_xpub(wallet.keystore.xpub) - assert deser[0] == "p2wpkh", deser - self.subscribers = [] - - async def run(self, netAndWalLock): - global WALLET, NETWORK - global CONFIG - global globalIdx - - wasAlreadyUpToDate = False - while asyncio.get_event_loop().is_running(): - WALLET = self.wallet - NETWORK = self.network - CONFIG = self.config - machine = CONFIG.get('lndhost', '127.0.0.1') - globalIdx = WALLET.storage.get("lightning_global_key_index", 0) - if globalIdx != 0: - print("initial lightning global key index", globalIdx) - writer = None - print("OPENING CONNECTION") - try: - reader, writer = await asyncio.wait_for(asyncio.open_connection(machine, 1080), 5) - writer.write(b"MAGIC") - writer.write(privateKeyHash[:6]) - await asyncio.wait_for(writer.drain(), 5) - while asyncio.get_event_loop().is_running(): - print(datetime.datetime.now(), "READING REQUEST") - obj = await readJson(reader) - if not obj: continue - if "id" not in obj: - print("Invoice update?", obj) - for i in self.subscribers: i(obj) - continue - print(datetime.datetime.now(), "making reply") - await asyncio.wait_for(readReqAndReply(obj, writer, netAndWalLock), 10) - except: - traceback.print_exc() - await asyncio.sleep(5) - continue - - def subscribe(self, notifyFunction): - self.subscribers.append(functools.partial(notifyFunction, "LightningWorker")) - -async def readJson(reader): - data = b"" - while asyncio.get_event_loop().is_running(): - newlines = sum(1 if x == b"\n"[0] else 0 for x in data) - if newlines > 1: print("Too many newlines in Electrum/lightning.py!", data) - try: - return json.loads(data.decode("ascii")) # decoding for python3.5 compat - except ValueError: - try: - data += await asyncio.wait_for(reader.read(1), 1) - except TimeoutError: - continue - -globLock = None - -async def readReqAndReply(obj, writer, netAndWalLock): - global globLock - methods = [ - # SecretKeyRing - DerivePrivKey, - DeriveNextKey, - DeriveKey, - ScalarMult - # Signer / BlockchainIO - ,ConfirmedBalance - ,NewAddress - ,ListUnspentWitness - ,WriteDb - ,FetchInputInfo - ,ComputeInputScript - ,SignOutputRaw - ,PublishTransaction - ,LockOutpoint - ,UnlockOutpoint - ,ListTransactionDetails - ,SendOutputs - ,IsSynced - ,SignMessage] - result = None - found = False - try: - for method in methods: - if method.__name__ == obj["method"]: - params = obj["params"][0] - print("calling method", obj["method"], "with", params) - globLock = netAndWalLock - netAndWalLock.acquire() - if asyncio.iscoroutinefunction(method): - result = await method(params) - else: - result = method(params) - netAndWalLock.release() - found = True - break - except Exception as e: - traceback.print_exc() - print("exception while calling method", obj["method"]) - writer.write(json.dumps({"id":obj["id"],"error": {"code": -32002, "message": traceback.format_exc()}}).encode("ascii") + b"\n") - await writer.drain() - else: - if not found: - # TODO assumes obj has id - writer.write(json.dumps({"id":obj["id"],"error": {"code": -32601, "message": "invalid method"}}).encode("ascii") + b"\n") - else: - print("result was", result) - if result is None: - result = "{}" - try: - assert type({}) is type(json.loads(result)) - except: - traceback.print_exc() - print("wrong method implementation") - writer.write(json.dumps({"id":obj["id"],"error": {"code": -32000, "message": "wrong return type in electrum-lightning-hub"}}).encode("ascii") + b"\n") - else: - writer.write(json.dumps({"id":obj["id"],"result": result}).encode("ascii") + b"\n") - await writer.drain() - -def privKeyForPubKey(pubKey): - global globalIdx - priv_keys = WALLET.storage.get("lightning_extra_keys", []) - for i in priv_keys: - candidate = EC_KEY(i.to_bytes(32, "big")) - if pubkFromECKEY(candidate) == pubKey: - return candidate - - attemptKeyIdx = globalIdx - 1 - while attemptKeyIdx >= 0: - attemptPrivKey = fetchPrivKey(None, 9000, attemptKeyIdx) - attempt = pubkFromECKEY(attemptPrivKey) - if attempt == pubKey: - return attemptPrivKey - attemptKeyIdx -= 1 - - adr = bitcoin.pubkey_to_address('p2wpkh', binascii.hexlify(pubKey).decode("utf-8")) - pri, redeem_script = WALLET.export_private_key(adr, None) - - if redeem_script: - print("ignoring redeem script", redeem_script) - - typ, pri, compressed = bitcoin.deserialize_privkey(pri) - return EC_KEY(pri) - - #assert False, "could not find private key for pubkey {} hex={}".format(pubKey, binascii.hexlify(pubKey).decode("ascii")) - -def derivePrivKey(keyDesc): - keyDescFam = keyDesc.keyLocator.family - keyDescIdx = keyDesc.keyLocator.index - keyDescPubKey = keyDesc.pubKey - privKey = None - - if len(keyDescPubKey) != 0: - return privKeyForPubKey(keyDescPubKey) - - return fetchPrivKey(None, keyDescFam, keyDescIdx) - -def DerivePrivKey(json): - req = rpc_pb2.DerivePrivKeyRequest() - json_format.Parse(json, req) - - m = rpc_pb2.DerivePrivKeyResponse() - - m.privKey = derivePrivKey(req.keyDescriptor).secret.to_bytes(32, "big") - - msg = json_format.MessageToJson(m) - return msg - -globalIdx = None - -def DeriveNextKey(json): - global globalIdx - req = rpc_pb2.DeriveNextKeyRequest() - json_format.Parse(json, req) - - family = req.keyFamily - - m = rpc_pb2.DeriveNextKeyResponse() - - # lnd leaves these unset: - # source: https://github.com/lightningnetwork/lnd/pull/769/files#diff-c954f5135a8995b1a3dfa298101dd0efR160 - #m.keyDescriptor.keyLocator.family = - #m.keyDescriptor.keyLocator.index = - - m.keyDescriptor.pubKey = pubkFromECKEY(fetchPrivKey(None, 9000, globalIdx)) - globalIdx += 1 - WALLET.storage.put("lightning_global_key_index", globalIdx) - WALLET.storage.write() - - msg = json_format.MessageToJson(m) - return msg - -def DeriveKey(json): - req = rpc_pb2.DeriveKeyRequest() - json_format.Parse(json, req) - - family = req.keyLocator.family - idx = req.keyLocator.index - - m = rpc_pb2.DeriveKeyResponse() - - #lnd sets these to parameter values - m.keyDescriptor.keyLocator.family = family - m.keyDescriptor.keyLocator.index = index - - m.keyDescriptor.pubKey = pubkFromECKEY(fetchPrivKey(None, family, index)) - - msg = json_format.MessageToJson(m) - return msg - -#// ScalarMult performs a scalar multiplication (ECDH-like operation) between -#// the target key descriptor and remote public key. The output returned will be -#// the sha256 of the resulting shared point serialized in compressed format. If -#// k is our private key, and P is the public key, we perform the following -#// operation: -#// -#// sx := k*P s := sha256(sx.SerializeCompressed()) -def ScalarMult(json): - req = rpc_pb2.ScalarMultRequest() - json_format.Parse(json, req) - - privKey = derivePrivKey(req.keyDescriptor) - - point = bitcoin.ser_to_point(req.pubKey) - - point = point * privKey.secret - - c = hashlib.sha256() - c.update(bitcoin.point_to_ser(point, True)) - - m = rpc_pb2.ScalarMultResponse() - - m.hashResult = c.digest() - - msg = json_format.MessageToJson(m) - return msg - -def pubkFromECKEY(eckey): - return bytes(bytearray.fromhex(eckey.get_public_key(True))) #compressed=True diff --git a/lib/ln/__init__.py b/lib/ln/__init__.py diff --git a/lib/ln/google/api/annotations_pb2.py b/lib/ln/google/api/annotations_pb2.py @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/annotations.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -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 import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from . import http_pb2 as google_dot_api_dot_http__pb2 -from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/api/annotations.proto', - package='google.api', - syntax='proto3', - serialized_pb=_b('\n\x1cgoogle/api/annotations.proto\x12\ngoogle.api\x1a\x15google/api/http.proto\x1a google/protobuf/descriptor.proto:E\n\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0\xca\xbc\" \x01(\x0b\x32\x14.google.api.HttpRuleBn\n\x0e\x63om.google.apiB\x10\x41nnotationsProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3') - , - dependencies=[google_dot_api_dot_http__pb2.DESCRIPTOR,google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,]) - - -HTTP_FIELD_NUMBER = 72295728 -http = _descriptor.FieldDescriptor( - name='http', full_name='google.api.http', index=0, - number=72295728, 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=True, extension_scope=None, - options=None, file=DESCRIPTOR) - -DESCRIPTOR.extensions_by_name['http'] = http -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -http.message_type = google_dot_api_dot_http__pb2._HTTPRULE -google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(http) - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\020AnnotationsProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI')) -# @@protoc_insertion_point(module_scope) diff --git a/lib/ln/google/api/http_pb2.py b/lib/ln/google/api/http_pb2.py @@ -1,236 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/api/http.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf import descriptor as _descriptor -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 import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='google/api/http.proto', - package='google.api', - syntax='proto3', - serialized_pb=_b('\n\x15google/api/http.proto\x12\ngoogle.api\"+\n\x04Http\x12#\n\x05rules\x18\x01 \x03(\x0b\x32\x14.google.api.HttpRule\"\xea\x01\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12/\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1d.google.api.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x31\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x14.google.api.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3') -) - - - - -_HTTP = _descriptor.Descriptor( - name='Http', - full_name='google.api.Http', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='rules', full_name='google.api.Http.rules', 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, - options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=37, - serialized_end=80, -) - - -_HTTPRULE = _descriptor.Descriptor( - name='HttpRule', - full_name='google.api.HttpRule', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='selector', full_name='google.api.HttpRule.selector', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='get', full_name='google.api.HttpRule.get', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='put', full_name='google.api.HttpRule.put', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='post', full_name='google.api.HttpRule.post', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='delete', full_name='google.api.HttpRule.delete', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='patch', full_name='google.api.HttpRule.patch', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='custom', full_name='google.api.HttpRule.custom', index=6, - 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='body', full_name='google.api.HttpRule.body', index=7, - 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='additional_bindings', full_name='google.api.HttpRule.additional_bindings', index=8, - 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, - options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name='pattern', full_name='google.api.HttpRule.pattern', - index=0, containing_type=None, fields=[]), - ], - serialized_start=83, - serialized_end=317, -) - - -_CUSTOMHTTPPATTERN = _descriptor.Descriptor( - name='CustomHttpPattern', - full_name='google.api.CustomHttpPattern', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='kind', full_name='google.api.CustomHttpPattern.kind', 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, - options=None, file=DESCRIPTOR), - _descriptor.FieldDescriptor( - name='path', full_name='google.api.CustomHttpPattern.path', 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, - options=None, file=DESCRIPTOR), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=319, - serialized_end=366, -) - -_HTTP.fields_by_name['rules'].message_type = _HTTPRULE -_HTTPRULE.fields_by_name['custom'].message_type = _CUSTOMHTTPPATTERN -_HTTPRULE.fields_by_name['additional_bindings'].message_type = _HTTPRULE -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['get']) -_HTTPRULE.fields_by_name['get'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['put']) -_HTTPRULE.fields_by_name['put'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['post']) -_HTTPRULE.fields_by_name['post'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['delete']) -_HTTPRULE.fields_by_name['delete'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['patch']) -_HTTPRULE.fields_by_name['patch'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -_HTTPRULE.oneofs_by_name['pattern'].fields.append( - _HTTPRULE.fields_by_name['custom']) -_HTTPRULE.fields_by_name['custom'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern'] -DESCRIPTOR.message_types_by_name['Http'] = _HTTP -DESCRIPTOR.message_types_by_name['HttpRule'] = _HTTPRULE -DESCRIPTOR.message_types_by_name['CustomHttpPattern'] = _CUSTOMHTTPPATTERN -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Http = _reflection.GeneratedProtocolMessageType('Http', (_message.Message,), dict( - DESCRIPTOR = _HTTP, - __module__ = 'google.api.http_pb2' - # @@protoc_insertion_point(class_scope:google.api.Http) - )) -_sym_db.RegisterMessage(Http) - -HttpRule = _reflection.GeneratedProtocolMessageType('HttpRule', (_message.Message,), dict( - DESCRIPTOR = _HTTPRULE, - __module__ = 'google.api.http_pb2' - # @@protoc_insertion_point(class_scope:google.api.HttpRule) - )) -_sym_db.RegisterMessage(HttpRule) - -CustomHttpPattern = _reflection.GeneratedProtocolMessageType('CustomHttpPattern', (_message.Message,), dict( - DESCRIPTOR = _CUSTOMHTTPPATTERN, - __module__ = 'google.api.http_pb2' - # @@protoc_insertion_point(class_scope:google.api.CustomHttpPattern) - )) -_sym_db.RegisterMessage(CustomHttpPattern) - - -DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\370\001\001\242\002\004GAPI')) -# @@protoc_insertion_point(module_scope) diff --git a/lib/ln/rpc_pb2.py b/lib/ln/rpc_pb2.py @@ -1,2895 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: rpc.proto - -import sys -_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -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 import descriptor_pb2 -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from .google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name='rpc.proto', - package='electrumbridge', - syntax='proto3', - serialized_pb=_b('\n\trpc.proto\x12\x0e\x65lectrumbridge\x1a\x1cgoogle/api/annotations.proto\"?\n\x12SignMessageRequest\x12\x19\n\x11messageToBeSigned\x18\x01 \x01(\x0c\x12\x0e\n\x06pubKey\x18\x02 \x01(\x0c\"H\n\x13SignMessageResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x11\n\tsignature\x18\x03 \x01(\x0c\"\x11\n\x0fIsSyncedRequest\">\n\x10IsSyncedResponse\x12\x0e\n\x06synced\x18\x01 \x01(\x08\x12\x1a\n\x12lastBlockTimeStamp\x18\x02 \x01(\x03\"S\n\x12SendOutputsRequest\x12&\n\x07outputs\x18\x01 \x03(\x0b\x32\x15.electrumbridge.TxOut\x12\x15\n\rfeeSatPerByte\x18\x02 \x01(\x03\"I\n\x13SendOutputsResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\r\n\x05\x65rror\x18\x02 \x01(\t\x12\x12\n\nresultHash\x18\x03 \x01(\t\"\x1f\n\x1dListTransactionDetailsRequest\"T\n\x1eListTransactionDetailsResponse\x12\x32\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32!.electrumbridge.TransactionDetail\"\x98\x01\n\x11TransactionDetail\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03\x12\x18\n\x10numConfirmations\x18\x03 \x01(\x05\x12\x11\n\tblockHash\x18\x04 \x01(\t\x12\x13\n\x0b\x62lockHeight\x18\x05 \x01(\x05\x12\x11\n\ttimestamp\x18\x06 \x01(\x03\x12\x11\n\ttotalFees\x18\x07 \x01(\x03\"A\n\x13LockOutpointRequest\x12*\n\x08outpoint\x18\x01 \x01(\x0b\x32\x18.electrumbridge.OutPoint\"C\n\x15UnlockOutpointRequest\x12*\n\x08outpoint\x18\x01 \x01(\x0b\x32\x18.electrumbridge.OutPoint\"\x16\n\x14LockOutpointResponse\"\x18\n\x16UnlockOutpointResponse\"\'\n\x19PublishTransactionRequest\x12\n\n\x02tx\x18\x01 \x01(\x0c\"<\n\x1aPublishTransactionResponse\x12\x0f\n\x07success\x18\x01 \x01(\x08\x12\r\n\x05\x65rror\x18\x02 \x01(\t\"T\n\x14SignOutputRawRequest\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x30\n\x08signDesc\x18\x02 \x01(\x0b\x32\x1e.electrumbridge.SignDescriptor\"*\n\x15SignOutputRawResponse\x12\x11\n\tsignature\x18\x01 \x01(\x0c\"Y\n\x19\x43omputeInputScriptRequest\x12\n\n\x02tx\x18\x01 \x01(\x0c\x12\x30\n\x08signDesc\x18\x02 \x01(\x0b\x32\x1e.electrumbridge.SignDescriptor\"\x82\x02\n\x0eSignDescriptor\x12\x34\n\rkeyDescriptor\x18\x01 \x01(\x0b\x32\x1d.electrumbridge.KeyDescriptor\x12,\n\tsigHashes\x18\x02 \x01(\x0b\x32\x19.electrumbridge.SigHashes\x12\x10\n\x08hashType\x18\x03 \x01(\x05\x12\x13\n\x0bsingleTweak\x18\x04 \x01(\x0c\x12\x13\n\x0b\x64oubleTweak\x18\x05 \x01(\x0c\x12\x15\n\rwitnessScript\x18\x06 \x01(\x0c\x12%\n\x06output\x18\x07 \x01(\x0b\x32\x15.electrumbridge.TxOut\x12\x12\n\ninputIndex\x18\x08 \x01(\x05\"L\n\tSigHashes\x12\x14\n\x0chashPrevOuts\x18\x01 \x01(\t\x12\x14\n\x0chashSequence\x18\x02 \x01(\t\x12\x13\n\x0bhashOutputs\x18\x03 \x01(\t\"F\n\x1a\x43omputeInputScriptResponse\x12\x15\n\rwitnessScript\x18\x01 \x03(\x0c\x12\x11\n\tscriptSig\x18\x02 \x01(\x0c\"C\n\x15\x46\x65tchInputInfoRequest\x12*\n\x08outPoint\x18\x01 \x01(\x0b\x32\x18.electrumbridge.OutPoint\"L\n\x16\x46\x65tchInputInfoResponse\x12\x0c\n\x04mine\x18\x01 \x01(\x08\x12$\n\x05txOut\x18\x02 \x01(\x0b\x32\x15.electrumbridge.TxOut\"(\n\x05TxOut\x12\r\n\x05value\x18\x01 \x01(\x03\x12\x10\n\x08pkScript\x18\x02 \x01(\x0c\" \n\x0eWriteDbRequest\x12\x0e\n\x06\x64\x62\x44\x61ta\x18\x01 \x01(\x0c\"\x11\n\x0fWriteDbResponse\"5\n\x19ListUnspentWitnessRequest\x12\x18\n\x10minConfirmations\x18\x01 \x01(\x05\"A\n\x1aListUnspentWitnessResponse\x12#\n\x05utxos\x18\x01 \x03(\x0b\x32\x14.electrumbridge.Utxo\"\xb2\x01\n\x04Utxo\x12\r\n\x05value\x18\x01 \x01(\x04\x12*\n\x08outPoint\x18\x02 \x01(\x0b\x32\x18.electrumbridge.OutPoint\x12\x30\n\x0b\x61\x64\x64ressType\x18\x03 \x01(\x0e\x32\x1b.electrumbridge.AddressType\x12\x15\n\rwitnessScript\x18\x04 \x01(\x0c\x12\x14\n\x0credeemScript\x18\x05 \x01(\x0c\x12\x10\n\x08pkScript\x18\x06 \x01(\x0c\"\'\n\x08OutPoint\x12\x0c\n\x04hash\x18\x01 \x01(\t\x12\r\n\x05index\x18\x02 \x01(\r\"0\n\x17\x43onfirmedBalanceRequest\x12\x15\n\rconfirmations\x18\x01 \x01(\x05\"*\n\x18\x43onfirmedBalanceResponse\x12\x0e\n\x06\x61mount\x18\x01 \x01(\x03\"N\n\x11NewAddressRequest\x12)\n\x04type\x18\x01 \x01(\x0e\x32\x1b.electrumbridge.AddressType\x12\x0e\n\x06\x63hange\x18\x02 \x01(\x08\".\n\x12NewAddressResponse\x12\x18\n\x07\x61\x64\x64ress\x18\x01 \x01(\tR\x07\x61\x64\x64ress\"+\n\nKeyLocator\x12\x0e\n\x06\x66\x61mily\x18\x01 \x01(\r\x12\r\n\x05index\x18\x02 \x01(\r\"O\n\rKeyDescriptor\x12.\n\nkeyLocator\x18\x01 \x01(\x0b\x32\x1a.electrumbridge.KeyLocator\x12\x0e\n\x06pubKey\x18\x02 \x01(\x0c\"Y\n\x11ScalarMultRequest\x12\x34\n\rkeyDescriptor\x18\x01 \x01(\x0b\x32\x1d.electrumbridge.KeyDescriptor\x12\x0e\n\x06pubKey\x18\x02 \x01(\x0c\"7\n\x12ScalarMultResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x12\n\nhashResult\x18\x02 \x01(\x0c\"L\n\x14\x44\x65rivePrivKeyRequest\x12\x34\n\rkeyDescriptor\x18\x01 \x01(\x0b\x32\x1d.electrumbridge.KeyDescriptor\"7\n\x15\x44\x65rivePrivKeyResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x0f\n\x07privKey\x18\x02 \x01(\x0c\")\n\x14\x44\x65riveNextKeyRequest\x12\x11\n\tkeyFamily\x18\x01 \x01(\r\"\\\n\x15\x44\x65riveNextKeyResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x34\n\rkeyDescriptor\x18\x02 \x01(\x0b\x32\x1d.electrumbridge.KeyDescriptor\"B\n\x10\x44\x65riveKeyRequest\x12.\n\nkeyLocator\x18\x01 \x01(\x0b\x32\x1a.electrumbridge.KeyLocator\"X\n\x11\x44\x65riveKeyResponse\x12\r\n\x05\x65rror\x18\x01 \x01(\t\x12\x34\n\rkeyDescriptor\x18\x02 \x01(\x0b\x32\x1d.electrumbridge.KeyDescriptor*>\n\x0b\x41\x64\x64ressType\x12\x17\n\x13WITNESS_PUBKEY_HASH\x10\x00\x12\x16\n\x12NESTED_PUBKEY_HASH\x10\x01\x32\xa3\x11\n\x0e\x45lectrumBridge\x12_\n\x07WriteDb\x12\x1e.electrumbridge.WriteDbRequest\x1a\x1f.electrumbridge.WriteDbResponse\"\x13\x82\xd3\xe4\x93\x02\r\x12\x0b/v1/writedb\x12k\n\nNewAddress\x12!.electrumbridge.NewAddressRequest\x1a\".electrumbridge.NewAddressResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/newaddress\x12\x83\x01\n\x10\x43onfirmedBalance\x12\'.electrumbridge.ConfirmedBalanceRequest\x1a(.electrumbridge.ConfirmedBalanceResponse\"\x1c\x82\xd3\xe4\x93\x02\x16\x12\x14/v1/confirmedbalance\x12\x8b\x01\n\x12ListUnspentWitness\x12).electrumbridge.ListUnspentWitnessRequest\x1a*.electrumbridge.ListUnspentWitnessResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/listunspentwitness\x12{\n\x0e\x46\x65tchInputInfo\x12%.electrumbridge.FetchInputInfoRequest\x1a&.electrumbridge.FetchInputInfoResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/fetchinputinfo\x12\x8b\x01\n\x12\x43omputeInputScript\x12).electrumbridge.ComputeInputScriptRequest\x1a*.electrumbridge.ComputeInputScriptResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/computeinputscript\x12w\n\rSignOutputRaw\x12$.electrumbridge.SignOutputRawRequest\x1a%.electrumbridge.SignOutputRawResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/signoutputraw\x12\x8b\x01\n\x12PublishTransaction\x12).electrumbridge.PublishTransactionRequest\x1a*.electrumbridge.PublishTransactionResponse\"\x1e\x82\xd3\xe4\x93\x02\x18\x12\x16/v1/publishtransaction\x12s\n\x0cLockOutpoint\x12#.electrumbridge.LockOutpointRequest\x1a$.electrumbridge.LockOutpointResponse\"\x18\x82\xd3\xe4\x93\x02\x12\x12\x10/v1/lockoutpoint\x12{\n\x0eUnlockOutpoint\x12%.electrumbridge.UnlockOutpointRequest\x1a&.electrumbridge.UnlockOutpointResponse\"\x1a\x82\xd3\xe4\x93\x02\x14\x12\x12/v1/unlockoutpoint\x12\x9b\x01\n\x16ListTransactionDetails\x12-.electrumbridge.ListTransactionDetailsRequest\x1a..electrumbridge.ListTransactionDetailsResponse\"\"\x82\xd3\xe4\x93\x02\x1c\x12\x1a/v1/listtransactiondetails\x12o\n\x0bSendOutputs\x12\".electrumbridge.SendOutputsRequest\x1a#.electrumbridge.SendOutputsResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/sendoutputs\x12\x63\n\x08IsSynced\x12\x1f.electrumbridge.IsSyncedRequest\x1a .electrumbridge.IsSyncedResponse\"\x14\x82\xd3\xe4\x93\x02\x0e\x12\x0c/v1/issynced\x12o\n\x0bSignMessage\x12\".electrumbridge.SignMessageRequest\x1a#.electrumbridge.SignMessageResponse\"\x17\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/signmessage\x12g\n\tDeriveKey\x12 .electrumbridge.DeriveKeyRequest\x1a!.electrumbridge.DeriveKeyResponse\"\x15\x82\xd3\xe4\x93\x02\x0f\x12\r/v1/derivekey\x12w\n\rDeriveNextKey\x12$.electrumbridge.DeriveNextKeyRequest\x1a%.electrumbridge.DeriveNextKeyResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/derivenextkey\x12w\n\rDerivePrivKey\x12$.electrumbridge.DerivePrivKeyRequest\x1a%.electrumbridge.DerivePrivKeyResponse\"\x19\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/deriveprivkey\x12k\n\nScalarMult\x12!.electrumbridge.ScalarMultRequest\x1a\".electrumbridge.ScalarMultResponse\"\x16\x82\xd3\xe4\x93\x02\x10\x12\x0e/v1/scalarmultb\x06proto3') - , - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,]) - -_ADDRESSTYPE = _descriptor.EnumDescriptor( - name='AddressType', - full_name='electrumbridge.AddressType', - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name='WITNESS_PUBKEY_HASH', index=0, number=0, - options=None, - type=None), - _descriptor.EnumValueDescriptor( - name='NESTED_PUBKEY_HASH', index=1, number=1, - options=None, - type=None), - ], - containing_type=None, - options=None, - serialized_start=3148, - serialized_end=3210, -) -_sym_db.RegisterEnumDescriptor(_ADDRESSTYPE) - -AddressType = enum_type_wrapper.EnumTypeWrapper(_ADDRESSTYPE) -WITNESS_PUBKEY_HASH = 0 -NESTED_PUBKEY_HASH = 1 - - - -_SIGNMESSAGEREQUEST = _descriptor.Descriptor( - name='SignMessageRequest', - full_name='electrumbridge.SignMessageRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='messageToBeSigned', full_name='electrumbridge.SignMessageRequest.messageToBeSigned', 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, - options=None), - _descriptor.FieldDescriptor( - name='pubKey', full_name='electrumbridge.SignMessageRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=59, - serialized_end=122, -) - - -_SIGNMESSAGERESPONSE = _descriptor.Descriptor( - name='SignMessageResponse', - full_name='electrumbridge.SignMessageResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.SignMessageResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='success', full_name='electrumbridge.SignMessageResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='signature', full_name='electrumbridge.SignMessageResponse.signature', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=124, - serialized_end=196, -) - - -_ISSYNCEDREQUEST = _descriptor.Descriptor( - name='IsSyncedRequest', - full_name='electrumbridge.IsSyncedRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=198, - serialized_end=215, -) - - -_ISSYNCEDRESPONSE = _descriptor.Descriptor( - name='IsSyncedResponse', - full_name='electrumbridge.IsSyncedResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='synced', full_name='electrumbridge.IsSyncedResponse.synced', 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, - options=None), - _descriptor.FieldDescriptor( - name='lastBlockTimeStamp', full_name='electrumbridge.IsSyncedResponse.lastBlockTimeStamp', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=217, - serialized_end=279, -) - - -_SENDOUTPUTSREQUEST = _descriptor.Descriptor( - name='SendOutputsRequest', - full_name='electrumbridge.SendOutputsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='outputs', full_name='electrumbridge.SendOutputsRequest.outputs', 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, - options=None), - _descriptor.FieldDescriptor( - name='feeSatPerByte', full_name='electrumbridge.SendOutputsRequest.feeSatPerByte', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=281, - serialized_end=364, -) - - -_SENDOUTPUTSRESPONSE = _descriptor.Descriptor( - name='SendOutputsResponse', - full_name='electrumbridge.SendOutputsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='success', full_name='electrumbridge.SendOutputsResponse.success', 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, - options=None), - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.SendOutputsResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='resultHash', full_name='electrumbridge.SendOutputsResponse.resultHash', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=366, - serialized_end=439, -) - - -_LISTTRANSACTIONDETAILSREQUEST = _descriptor.Descriptor( - name='ListTransactionDetailsRequest', - full_name='electrumbridge.ListTransactionDetailsRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=441, - serialized_end=472, -) - - -_LISTTRANSACTIONDETAILSRESPONSE = _descriptor.Descriptor( - name='ListTransactionDetailsResponse', - full_name='electrumbridge.ListTransactionDetailsResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='details', full_name='electrumbridge.ListTransactionDetailsResponse.details', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=474, - serialized_end=558, -) - - -_TRANSACTIONDETAIL = _descriptor.Descriptor( - name='TransactionDetail', - full_name='electrumbridge.TransactionDetail', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='hash', full_name='electrumbridge.TransactionDetail.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, - options=None), - _descriptor.FieldDescriptor( - name='value', full_name='electrumbridge.TransactionDetail.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, - options=None), - _descriptor.FieldDescriptor( - name='numConfirmations', full_name='electrumbridge.TransactionDetail.numConfirmations', 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, - options=None), - _descriptor.FieldDescriptor( - name='blockHash', full_name='electrumbridge.TransactionDetail.blockHash', 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, - options=None), - _descriptor.FieldDescriptor( - name='blockHeight', full_name='electrumbridge.TransactionDetail.blockHeight', 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, - options=None), - _descriptor.FieldDescriptor( - name='timestamp', full_name='electrumbridge.TransactionDetail.timestamp', 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, - options=None), - _descriptor.FieldDescriptor( - name='totalFees', full_name='electrumbridge.TransactionDetail.totalFees', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=561, - serialized_end=713, -) - - -_LOCKOUTPOINTREQUEST = _descriptor.Descriptor( - name='LockOutpointRequest', - full_name='electrumbridge.LockOutpointRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='outpoint', full_name='electrumbridge.LockOutpointRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=715, - serialized_end=780, -) - - -_UNLOCKOUTPOINTREQUEST = _descriptor.Descriptor( - name='UnlockOutpointRequest', - full_name='electrumbridge.UnlockOutpointRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='outpoint', full_name='electrumbridge.UnlockOutpointRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=782, - serialized_end=849, -) - - -_LOCKOUTPOINTRESPONSE = _descriptor.Descriptor( - name='LockOutpointResponse', - full_name='electrumbridge.LockOutpointResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=851, - serialized_end=873, -) - - -_UNLOCKOUTPOINTRESPONSE = _descriptor.Descriptor( - name='UnlockOutpointResponse', - full_name='electrumbridge.UnlockOutpointResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=875, - serialized_end=899, -) - - -_PUBLISHTRANSACTIONREQUEST = _descriptor.Descriptor( - name='PublishTransactionRequest', - full_name='electrumbridge.PublishTransactionRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='tx', full_name='electrumbridge.PublishTransactionRequest.tx', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=901, - serialized_end=940, -) - - -_PUBLISHTRANSACTIONRESPONSE = _descriptor.Descriptor( - name='PublishTransactionResponse', - full_name='electrumbridge.PublishTransactionResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='success', full_name='electrumbridge.PublishTransactionResponse.success', 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, - options=None), - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.PublishTransactionResponse.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=942, - serialized_end=1002, -) - - -_SIGNOUTPUTRAWREQUEST = _descriptor.Descriptor( - name='SignOutputRawRequest', - full_name='electrumbridge.SignOutputRawRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='tx', full_name='electrumbridge.SignOutputRawRequest.tx', 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, - options=None), - _descriptor.FieldDescriptor( - name='signDesc', full_name='electrumbridge.SignOutputRawRequest.signDesc', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1004, - serialized_end=1088, -) - - -_SIGNOUTPUTRAWRESPONSE = _descriptor.Descriptor( - name='SignOutputRawResponse', - full_name='electrumbridge.SignOutputRawResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='signature', full_name='electrumbridge.SignOutputRawResponse.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1090, - serialized_end=1132, -) - - -_COMPUTEINPUTSCRIPTREQUEST = _descriptor.Descriptor( - name='ComputeInputScriptRequest', - full_name='electrumbridge.ComputeInputScriptRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='tx', full_name='electrumbridge.ComputeInputScriptRequest.tx', 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, - options=None), - _descriptor.FieldDescriptor( - name='signDesc', full_name='electrumbridge.ComputeInputScriptRequest.signDesc', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1134, - serialized_end=1223, -) - - -_SIGNDESCRIPTOR = _descriptor.Descriptor( - name='SignDescriptor', - full_name='electrumbridge.SignDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyDescriptor', full_name='electrumbridge.SignDescriptor.keyDescriptor', 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, - options=None), - _descriptor.FieldDescriptor( - name='sigHashes', full_name='electrumbridge.SignDescriptor.sigHashes', 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, - options=None), - _descriptor.FieldDescriptor( - name='hashType', full_name='electrumbridge.SignDescriptor.hashType', 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, - options=None), - _descriptor.FieldDescriptor( - name='singleTweak', full_name='electrumbridge.SignDescriptor.singleTweak', 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, - options=None), - _descriptor.FieldDescriptor( - name='doubleTweak', full_name='electrumbridge.SignDescriptor.doubleTweak', 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, - options=None), - _descriptor.FieldDescriptor( - name='witnessScript', full_name='electrumbridge.SignDescriptor.witnessScript', index=5, - 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, - options=None), - _descriptor.FieldDescriptor( - name='output', full_name='electrumbridge.SignDescriptor.output', 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, - options=None), - _descriptor.FieldDescriptor( - name='inputIndex', full_name='electrumbridge.SignDescriptor.inputIndex', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1226, - serialized_end=1484, -) - - -_SIGHASHES = _descriptor.Descriptor( - name='SigHashes', - full_name='electrumbridge.SigHashes', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='hashPrevOuts', full_name='electrumbridge.SigHashes.hashPrevOuts', 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, - options=None), - _descriptor.FieldDescriptor( - name='hashSequence', full_name='electrumbridge.SigHashes.hashSequence', 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, - options=None), - _descriptor.FieldDescriptor( - name='hashOutputs', full_name='electrumbridge.SigHashes.hashOutputs', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1486, - serialized_end=1562, -) - - -_COMPUTEINPUTSCRIPTRESPONSE = _descriptor.Descriptor( - name='ComputeInputScriptResponse', - full_name='electrumbridge.ComputeInputScriptResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='witnessScript', full_name='electrumbridge.ComputeInputScriptResponse.witnessScript', index=0, - number=1, 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, - options=None), - _descriptor.FieldDescriptor( - name='scriptSig', full_name='electrumbridge.ComputeInputScriptResponse.scriptSig', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1564, - serialized_end=1634, -) - - -_FETCHINPUTINFOREQUEST = _descriptor.Descriptor( - name='FetchInputInfoRequest', - full_name='electrumbridge.FetchInputInfoRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='outPoint', full_name='electrumbridge.FetchInputInfoRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1636, - serialized_end=1703, -) - - -_FETCHINPUTINFORESPONSE = _descriptor.Descriptor( - name='FetchInputInfoResponse', - full_name='electrumbridge.FetchInputInfoResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='mine', full_name='electrumbridge.FetchInputInfoResponse.mine', 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, - options=None), - _descriptor.FieldDescriptor( - name='txOut', full_name='electrumbridge.FetchInputInfoResponse.txOut', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1705, - serialized_end=1781, -) - - -_TXOUT = _descriptor.Descriptor( - name='TxOut', - full_name='electrumbridge.TxOut', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='value', full_name='electrumbridge.TxOut.value', 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, - options=None), - _descriptor.FieldDescriptor( - name='pkScript', full_name='electrumbridge.TxOut.pkScript', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1783, - serialized_end=1823, -) - - -_WRITEDBREQUEST = _descriptor.Descriptor( - name='WriteDbRequest', - full_name='electrumbridge.WriteDbRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='dbData', full_name='electrumbridge.WriteDbRequest.dbData', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1825, - serialized_end=1857, -) - - -_WRITEDBRESPONSE = _descriptor.Descriptor( - name='WriteDbResponse', - full_name='electrumbridge.WriteDbResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1859, - serialized_end=1876, -) - - -_LISTUNSPENTWITNESSREQUEST = _descriptor.Descriptor( - name='ListUnspentWitnessRequest', - full_name='electrumbridge.ListUnspentWitnessRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='minConfirmations', full_name='electrumbridge.ListUnspentWitnessRequest.minConfirmations', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1878, - serialized_end=1931, -) - - -_LISTUNSPENTWITNESSRESPONSE = _descriptor.Descriptor( - name='ListUnspentWitnessResponse', - full_name='electrumbridge.ListUnspentWitnessResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='utxos', full_name='electrumbridge.ListUnspentWitnessResponse.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=1933, - serialized_end=1998, -) - - -_UTXO = _descriptor.Descriptor( - name='Utxo', - full_name='electrumbridge.Utxo', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='value', full_name='electrumbridge.Utxo.value', 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, - options=None), - _descriptor.FieldDescriptor( - name='outPoint', full_name='electrumbridge.Utxo.outPoint', 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, - options=None), - _descriptor.FieldDescriptor( - name='addressType', full_name='electrumbridge.Utxo.addressType', index=2, - number=3, 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, - options=None), - _descriptor.FieldDescriptor( - name='witnessScript', full_name='electrumbridge.Utxo.witnessScript', 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, - options=None), - _descriptor.FieldDescriptor( - name='redeemScript', full_name='electrumbridge.Utxo.redeemScript', 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, - options=None), - _descriptor.FieldDescriptor( - name='pkScript', full_name='electrumbridge.Utxo.pkScript', index=5, - 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2001, - serialized_end=2179, -) - - -_OUTPOINT = _descriptor.Descriptor( - name='OutPoint', - full_name='electrumbridge.OutPoint', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='hash', full_name='electrumbridge.OutPoint.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, - options=None), - _descriptor.FieldDescriptor( - name='index', full_name='electrumbridge.OutPoint.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2181, - serialized_end=2220, -) - - -_CONFIRMEDBALANCEREQUEST = _descriptor.Descriptor( - name='ConfirmedBalanceRequest', - full_name='electrumbridge.ConfirmedBalanceRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='confirmations', full_name='electrumbridge.ConfirmedBalanceRequest.confirmations', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2222, - serialized_end=2270, -) - - -_CONFIRMEDBALANCERESPONSE = _descriptor.Descriptor( - name='ConfirmedBalanceResponse', - full_name='electrumbridge.ConfirmedBalanceResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='amount', full_name='electrumbridge.ConfirmedBalanceResponse.amount', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2272, - serialized_end=2314, -) - - -_NEWADDRESSREQUEST = _descriptor.Descriptor( - name='NewAddressRequest', - full_name='electrumbridge.NewAddressRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='type', full_name='electrumbridge.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, - options=None), - _descriptor.FieldDescriptor( - name='change', full_name='electrumbridge.NewAddressRequest.change', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2316, - serialized_end=2394, -) - - -_NEWADDRESSRESPONSE = _descriptor.Descriptor( - name='NewAddressResponse', - full_name='electrumbridge.NewAddressResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='address', full_name='electrumbridge.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, - options=None, json_name='address'), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2396, - serialized_end=2442, -) - - -_KEYLOCATOR = _descriptor.Descriptor( - name='KeyLocator', - full_name='electrumbridge.KeyLocator', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='family', full_name='electrumbridge.KeyLocator.family', 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, - options=None), - _descriptor.FieldDescriptor( - name='index', full_name='electrumbridge.KeyLocator.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2444, - serialized_end=2487, -) - - -_KEYDESCRIPTOR = _descriptor.Descriptor( - name='KeyDescriptor', - full_name='electrumbridge.KeyDescriptor', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyLocator', full_name='electrumbridge.KeyDescriptor.keyLocator', 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, - options=None), - _descriptor.FieldDescriptor( - name='pubKey', full_name='electrumbridge.KeyDescriptor.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2489, - serialized_end=2568, -) - - -_SCALARMULTREQUEST = _descriptor.Descriptor( - name='ScalarMultRequest', - full_name='electrumbridge.ScalarMultRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyDescriptor', full_name='electrumbridge.ScalarMultRequest.keyDescriptor', 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, - options=None), - _descriptor.FieldDescriptor( - name='pubKey', full_name='electrumbridge.ScalarMultRequest.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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2570, - serialized_end=2659, -) - - -_SCALARMULTRESPONSE = _descriptor.Descriptor( - name='ScalarMultResponse', - full_name='electrumbridge.ScalarMultResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.ScalarMultResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='hashResult', full_name='electrumbridge.ScalarMultResponse.hashResult', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2661, - serialized_end=2716, -) - - -_DERIVEPRIVKEYREQUEST = _descriptor.Descriptor( - name='DerivePrivKeyRequest', - full_name='electrumbridge.DerivePrivKeyRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyDescriptor', full_name='electrumbridge.DerivePrivKeyRequest.keyDescriptor', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2718, - serialized_end=2794, -) - - -_DERIVEPRIVKEYRESPONSE = _descriptor.Descriptor( - name='DerivePrivKeyResponse', - full_name='electrumbridge.DerivePrivKeyResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.DerivePrivKeyResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='privKey', full_name='electrumbridge.DerivePrivKeyResponse.privKey', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2796, - serialized_end=2851, -) - - -_DERIVENEXTKEYREQUEST = _descriptor.Descriptor( - name='DeriveNextKeyRequest', - full_name='electrumbridge.DeriveNextKeyRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyFamily', full_name='electrumbridge.DeriveNextKeyRequest.keyFamily', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2853, - serialized_end=2894, -) - - -_DERIVENEXTKEYRESPONSE = _descriptor.Descriptor( - name='DeriveNextKeyResponse', - full_name='electrumbridge.DeriveNextKeyResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.DeriveNextKeyResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='keyDescriptor', full_name='electrumbridge.DeriveNextKeyResponse.keyDescriptor', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2896, - serialized_end=2988, -) - - -_DERIVEKEYREQUEST = _descriptor.Descriptor( - name='DeriveKeyRequest', - full_name='electrumbridge.DeriveKeyRequest', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='keyLocator', full_name='electrumbridge.DeriveKeyRequest.keyLocator', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=2990, - serialized_end=3056, -) - - -_DERIVEKEYRESPONSE = _descriptor.Descriptor( - name='DeriveKeyResponse', - full_name='electrumbridge.DeriveKeyResponse', - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name='error', full_name='electrumbridge.DeriveKeyResponse.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, - options=None), - _descriptor.FieldDescriptor( - name='keyDescriptor', full_name='electrumbridge.DeriveKeyResponse.keyDescriptor', 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, - options=None), - ], - extensions=[ - ], - nested_types=[], - enum_types=[ - ], - options=None, - is_extendable=False, - syntax='proto3', - extension_ranges=[], - oneofs=[ - ], - serialized_start=3058, - serialized_end=3146, -) - -_SENDOUTPUTSREQUEST.fields_by_name['outputs'].message_type = _TXOUT -_LISTTRANSACTIONDETAILSRESPONSE.fields_by_name['details'].message_type = _TRANSACTIONDETAIL -_LOCKOUTPOINTREQUEST.fields_by_name['outpoint'].message_type = _OUTPOINT -_UNLOCKOUTPOINTREQUEST.fields_by_name['outpoint'].message_type = _OUTPOINT -_SIGNOUTPUTRAWREQUEST.fields_by_name['signDesc'].message_type = _SIGNDESCRIPTOR -_COMPUTEINPUTSCRIPTREQUEST.fields_by_name['signDesc'].message_type = _SIGNDESCRIPTOR -_SIGNDESCRIPTOR.fields_by_name['keyDescriptor'].message_type = _KEYDESCRIPTOR -_SIGNDESCRIPTOR.fields_by_name['sigHashes'].message_type = _SIGHASHES -_SIGNDESCRIPTOR.fields_by_name['output'].message_type = _TXOUT -_FETCHINPUTINFOREQUEST.fields_by_name['outPoint'].message_type = _OUTPOINT -_FETCHINPUTINFORESPONSE.fields_by_name['txOut'].message_type = _TXOUT -_LISTUNSPENTWITNESSRESPONSE.fields_by_name['utxos'].message_type = _UTXO -_UTXO.fields_by_name['outPoint'].message_type = _OUTPOINT -_UTXO.fields_by_name['addressType'].enum_type = _ADDRESSTYPE -_NEWADDRESSREQUEST.fields_by_name['type'].enum_type = _ADDRESSTYPE -_KEYDESCRIPTOR.fields_by_name['keyLocator'].message_type = _KEYLOCATOR -_SCALARMULTREQUEST.fields_by_name['keyDescriptor'].message_type = _KEYDESCRIPTOR -_DERIVEPRIVKEYREQUEST.fields_by_name['keyDescriptor'].message_type = _KEYDESCRIPTOR -_DERIVENEXTKEYRESPONSE.fields_by_name['keyDescriptor'].message_type = _KEYDESCRIPTOR -_DERIVEKEYREQUEST.fields_by_name['keyLocator'].message_type = _KEYLOCATOR -_DERIVEKEYRESPONSE.fields_by_name['keyDescriptor'].message_type = _KEYDESCRIPTOR -DESCRIPTOR.message_types_by_name['SignMessageRequest'] = _SIGNMESSAGEREQUEST -DESCRIPTOR.message_types_by_name['SignMessageResponse'] = _SIGNMESSAGERESPONSE -DESCRIPTOR.message_types_by_name['IsSyncedRequest'] = _ISSYNCEDREQUEST -DESCRIPTOR.message_types_by_name['IsSyncedResponse'] = _ISSYNCEDRESPONSE -DESCRIPTOR.message_types_by_name['SendOutputsRequest'] = _SENDOUTPUTSREQUEST -DESCRIPTOR.message_types_by_name['SendOutputsResponse'] = _SENDOUTPUTSRESPONSE -DESCRIPTOR.message_types_by_name['ListTransactionDetailsRequest'] = _LISTTRANSACTIONDETAILSREQUEST -DESCRIPTOR.message_types_by_name['ListTransactionDetailsResponse'] = _LISTTRANSACTIONDETAILSRESPONSE -DESCRIPTOR.message_types_by_name['TransactionDetail'] = _TRANSACTIONDETAIL -DESCRIPTOR.message_types_by_name['LockOutpointRequest'] = _LOCKOUTPOINTREQUEST -DESCRIPTOR.message_types_by_name['UnlockOutpointRequest'] = _UNLOCKOUTPOINTREQUEST -DESCRIPTOR.message_types_by_name['LockOutpointResponse'] = _LOCKOUTPOINTRESPONSE -DESCRIPTOR.message_types_by_name['UnlockOutpointResponse'] = _UNLOCKOUTPOINTRESPONSE -DESCRIPTOR.message_types_by_name['PublishTransactionRequest'] = _PUBLISHTRANSACTIONREQUEST -DESCRIPTOR.message_types_by_name['PublishTransactionResponse'] = _PUBLISHTRANSACTIONRESPONSE -DESCRIPTOR.message_types_by_name['SignOutputRawRequest'] = _SIGNOUTPUTRAWREQUEST -DESCRIPTOR.message_types_by_name['SignOutputRawResponse'] = _SIGNOUTPUTRAWRESPONSE -DESCRIPTOR.message_types_by_name['ComputeInputScriptRequest'] = _COMPUTEINPUTSCRIPTREQUEST -DESCRIPTOR.message_types_by_name['SignDescriptor'] = _SIGNDESCRIPTOR -DESCRIPTOR.message_types_by_name['SigHashes'] = _SIGHASHES -DESCRIPTOR.message_types_by_name['ComputeInputScriptResponse'] = _COMPUTEINPUTSCRIPTRESPONSE -DESCRIPTOR.message_types_by_name['FetchInputInfoRequest'] = _FETCHINPUTINFOREQUEST -DESCRIPTOR.message_types_by_name['FetchInputInfoResponse'] = _FETCHINPUTINFORESPONSE -DESCRIPTOR.message_types_by_name['TxOut'] = _TXOUT -DESCRIPTOR.message_types_by_name['WriteDbRequest'] = _WRITEDBREQUEST -DESCRIPTOR.message_types_by_name['WriteDbResponse'] = _WRITEDBRESPONSE -DESCRIPTOR.message_types_by_name['ListUnspentWitnessRequest'] = _LISTUNSPENTWITNESSREQUEST -DESCRIPTOR.message_types_by_name['ListUnspentWitnessResponse'] = _LISTUNSPENTWITNESSRESPONSE -DESCRIPTOR.message_types_by_name['Utxo'] = _UTXO -DESCRIPTOR.message_types_by_name['OutPoint'] = _OUTPOINT -DESCRIPTOR.message_types_by_name['ConfirmedBalanceRequest'] = _CONFIRMEDBALANCEREQUEST -DESCRIPTOR.message_types_by_name['ConfirmedBalanceResponse'] = _CONFIRMEDBALANCERESPONSE -DESCRIPTOR.message_types_by_name['NewAddressRequest'] = _NEWADDRESSREQUEST -DESCRIPTOR.message_types_by_name['NewAddressResponse'] = _NEWADDRESSRESPONSE -DESCRIPTOR.message_types_by_name['KeyLocator'] = _KEYLOCATOR -DESCRIPTOR.message_types_by_name['KeyDescriptor'] = _KEYDESCRIPTOR -DESCRIPTOR.message_types_by_name['ScalarMultRequest'] = _SCALARMULTREQUEST -DESCRIPTOR.message_types_by_name['ScalarMultResponse'] = _SCALARMULTRESPONSE -DESCRIPTOR.message_types_by_name['DerivePrivKeyRequest'] = _DERIVEPRIVKEYREQUEST -DESCRIPTOR.message_types_by_name['DerivePrivKeyResponse'] = _DERIVEPRIVKEYRESPONSE -DESCRIPTOR.message_types_by_name['DeriveNextKeyRequest'] = _DERIVENEXTKEYREQUEST -DESCRIPTOR.message_types_by_name['DeriveNextKeyResponse'] = _DERIVENEXTKEYRESPONSE -DESCRIPTOR.message_types_by_name['DeriveKeyRequest'] = _DERIVEKEYREQUEST -DESCRIPTOR.message_types_by_name['DeriveKeyResponse'] = _DERIVEKEYRESPONSE -DESCRIPTOR.enum_types_by_name['AddressType'] = _ADDRESSTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -SignMessageRequest = _reflection.GeneratedProtocolMessageType('SignMessageRequest', (_message.Message,), dict( - DESCRIPTOR = _SIGNMESSAGEREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SignMessageRequest) - )) -_sym_db.RegisterMessage(SignMessageRequest) - -SignMessageResponse = _reflection.GeneratedProtocolMessageType('SignMessageResponse', (_message.Message,), dict( - DESCRIPTOR = _SIGNMESSAGERESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SignMessageResponse) - )) -_sym_db.RegisterMessage(SignMessageResponse) - -IsSyncedRequest = _reflection.GeneratedProtocolMessageType('IsSyncedRequest', (_message.Message,), dict( - DESCRIPTOR = _ISSYNCEDREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.IsSyncedRequest) - )) -_sym_db.RegisterMessage(IsSyncedRequest) - -IsSyncedResponse = _reflection.GeneratedProtocolMessageType('IsSyncedResponse', (_message.Message,), dict( - DESCRIPTOR = _ISSYNCEDRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.IsSyncedResponse) - )) -_sym_db.RegisterMessage(IsSyncedResponse) - -SendOutputsRequest = _reflection.GeneratedProtocolMessageType('SendOutputsRequest', (_message.Message,), dict( - DESCRIPTOR = _SENDOUTPUTSREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SendOutputsRequest) - )) -_sym_db.RegisterMessage(SendOutputsRequest) - -SendOutputsResponse = _reflection.GeneratedProtocolMessageType('SendOutputsResponse', (_message.Message,), dict( - DESCRIPTOR = _SENDOUTPUTSRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SendOutputsResponse) - )) -_sym_db.RegisterMessage(SendOutputsResponse) - -ListTransactionDetailsRequest = _reflection.GeneratedProtocolMessageType('ListTransactionDetailsRequest', (_message.Message,), dict( - DESCRIPTOR = _LISTTRANSACTIONDETAILSREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ListTransactionDetailsRequest) - )) -_sym_db.RegisterMessage(ListTransactionDetailsRequest) - -ListTransactionDetailsResponse = _reflection.GeneratedProtocolMessageType('ListTransactionDetailsResponse', (_message.Message,), dict( - DESCRIPTOR = _LISTTRANSACTIONDETAILSRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ListTransactionDetailsResponse) - )) -_sym_db.RegisterMessage(ListTransactionDetailsResponse) - -TransactionDetail = _reflection.GeneratedProtocolMessageType('TransactionDetail', (_message.Message,), dict( - DESCRIPTOR = _TRANSACTIONDETAIL, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.TransactionDetail) - )) -_sym_db.RegisterMessage(TransactionDetail) - -LockOutpointRequest = _reflection.GeneratedProtocolMessageType('LockOutpointRequest', (_message.Message,), dict( - DESCRIPTOR = _LOCKOUTPOINTREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.LockOutpointRequest) - )) -_sym_db.RegisterMessage(LockOutpointRequest) - -UnlockOutpointRequest = _reflection.GeneratedProtocolMessageType('UnlockOutpointRequest', (_message.Message,), dict( - DESCRIPTOR = _UNLOCKOUTPOINTREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.UnlockOutpointRequest) - )) -_sym_db.RegisterMessage(UnlockOutpointRequest) - -LockOutpointResponse = _reflection.GeneratedProtocolMessageType('LockOutpointResponse', (_message.Message,), dict( - DESCRIPTOR = _LOCKOUTPOINTRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.LockOutpointResponse) - )) -_sym_db.RegisterMessage(LockOutpointResponse) - -UnlockOutpointResponse = _reflection.GeneratedProtocolMessageType('UnlockOutpointResponse', (_message.Message,), dict( - DESCRIPTOR = _UNLOCKOUTPOINTRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.UnlockOutpointResponse) - )) -_sym_db.RegisterMessage(UnlockOutpointResponse) - -PublishTransactionRequest = _reflection.GeneratedProtocolMessageType('PublishTransactionRequest', (_message.Message,), dict( - DESCRIPTOR = _PUBLISHTRANSACTIONREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.PublishTransactionRequest) - )) -_sym_db.RegisterMessage(PublishTransactionRequest) - -PublishTransactionResponse = _reflection.GeneratedProtocolMessageType('PublishTransactionResponse', (_message.Message,), dict( - DESCRIPTOR = _PUBLISHTRANSACTIONRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.PublishTransactionResponse) - )) -_sym_db.RegisterMessage(PublishTransactionResponse) - -SignOutputRawRequest = _reflection.GeneratedProtocolMessageType('SignOutputRawRequest', (_message.Message,), dict( - DESCRIPTOR = _SIGNOUTPUTRAWREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SignOutputRawRequest) - )) -_sym_db.RegisterMessage(SignOutputRawRequest) - -SignOutputRawResponse = _reflection.GeneratedProtocolMessageType('SignOutputRawResponse', (_message.Message,), dict( - DESCRIPTOR = _SIGNOUTPUTRAWRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SignOutputRawResponse) - )) -_sym_db.RegisterMessage(SignOutputRawResponse) - -ComputeInputScriptRequest = _reflection.GeneratedProtocolMessageType('ComputeInputScriptRequest', (_message.Message,), dict( - DESCRIPTOR = _COMPUTEINPUTSCRIPTREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ComputeInputScriptRequest) - )) -_sym_db.RegisterMessage(ComputeInputScriptRequest) - -SignDescriptor = _reflection.GeneratedProtocolMessageType('SignDescriptor', (_message.Message,), dict( - DESCRIPTOR = _SIGNDESCRIPTOR, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SignDescriptor) - )) -_sym_db.RegisterMessage(SignDescriptor) - -SigHashes = _reflection.GeneratedProtocolMessageType('SigHashes', (_message.Message,), dict( - DESCRIPTOR = _SIGHASHES, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.SigHashes) - )) -_sym_db.RegisterMessage(SigHashes) - -ComputeInputScriptResponse = _reflection.GeneratedProtocolMessageType('ComputeInputScriptResponse', (_message.Message,), dict( - DESCRIPTOR = _COMPUTEINPUTSCRIPTRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ComputeInputScriptResponse) - )) -_sym_db.RegisterMessage(ComputeInputScriptResponse) - -FetchInputInfoRequest = _reflection.GeneratedProtocolMessageType('FetchInputInfoRequest', (_message.Message,), dict( - DESCRIPTOR = _FETCHINPUTINFOREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.FetchInputInfoRequest) - )) -_sym_db.RegisterMessage(FetchInputInfoRequest) - -FetchInputInfoResponse = _reflection.GeneratedProtocolMessageType('FetchInputInfoResponse', (_message.Message,), dict( - DESCRIPTOR = _FETCHINPUTINFORESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.FetchInputInfoResponse) - )) -_sym_db.RegisterMessage(FetchInputInfoResponse) - -TxOut = _reflection.GeneratedProtocolMessageType('TxOut', (_message.Message,), dict( - DESCRIPTOR = _TXOUT, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.TxOut) - )) -_sym_db.RegisterMessage(TxOut) - -WriteDbRequest = _reflection.GeneratedProtocolMessageType('WriteDbRequest', (_message.Message,), dict( - DESCRIPTOR = _WRITEDBREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.WriteDbRequest) - )) -_sym_db.RegisterMessage(WriteDbRequest) - -WriteDbResponse = _reflection.GeneratedProtocolMessageType('WriteDbResponse', (_message.Message,), dict( - DESCRIPTOR = _WRITEDBRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.WriteDbResponse) - )) -_sym_db.RegisterMessage(WriteDbResponse) - -ListUnspentWitnessRequest = _reflection.GeneratedProtocolMessageType('ListUnspentWitnessRequest', (_message.Message,), dict( - DESCRIPTOR = _LISTUNSPENTWITNESSREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ListUnspentWitnessRequest) - )) -_sym_db.RegisterMessage(ListUnspentWitnessRequest) - -ListUnspentWitnessResponse = _reflection.GeneratedProtocolMessageType('ListUnspentWitnessResponse', (_message.Message,), dict( - DESCRIPTOR = _LISTUNSPENTWITNESSRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ListUnspentWitnessResponse) - )) -_sym_db.RegisterMessage(ListUnspentWitnessResponse) - -Utxo = _reflection.GeneratedProtocolMessageType('Utxo', (_message.Message,), dict( - DESCRIPTOR = _UTXO, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.Utxo) - )) -_sym_db.RegisterMessage(Utxo) - -OutPoint = _reflection.GeneratedProtocolMessageType('OutPoint', (_message.Message,), dict( - DESCRIPTOR = _OUTPOINT, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.OutPoint) - )) -_sym_db.RegisterMessage(OutPoint) - -ConfirmedBalanceRequest = _reflection.GeneratedProtocolMessageType('ConfirmedBalanceRequest', (_message.Message,), dict( - DESCRIPTOR = _CONFIRMEDBALANCEREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ConfirmedBalanceRequest) - )) -_sym_db.RegisterMessage(ConfirmedBalanceRequest) - -ConfirmedBalanceResponse = _reflection.GeneratedProtocolMessageType('ConfirmedBalanceResponse', (_message.Message,), dict( - DESCRIPTOR = _CONFIRMEDBALANCERESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ConfirmedBalanceResponse) - )) -_sym_db.RegisterMessage(ConfirmedBalanceResponse) - -NewAddressRequest = _reflection.GeneratedProtocolMessageType('NewAddressRequest', (_message.Message,), dict( - DESCRIPTOR = _NEWADDRESSREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.NewAddressRequest) - )) -_sym_db.RegisterMessage(NewAddressRequest) - -NewAddressResponse = _reflection.GeneratedProtocolMessageType('NewAddressResponse', (_message.Message,), dict( - DESCRIPTOR = _NEWADDRESSRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.NewAddressResponse) - )) -_sym_db.RegisterMessage(NewAddressResponse) - -KeyLocator = _reflection.GeneratedProtocolMessageType('KeyLocator', (_message.Message,), dict( - DESCRIPTOR = _KEYLOCATOR, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.KeyLocator) - )) -_sym_db.RegisterMessage(KeyLocator) - -KeyDescriptor = _reflection.GeneratedProtocolMessageType('KeyDescriptor', (_message.Message,), dict( - DESCRIPTOR = _KEYDESCRIPTOR, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.KeyDescriptor) - )) -_sym_db.RegisterMessage(KeyDescriptor) - -ScalarMultRequest = _reflection.GeneratedProtocolMessageType('ScalarMultRequest', (_message.Message,), dict( - DESCRIPTOR = _SCALARMULTREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ScalarMultRequest) - )) -_sym_db.RegisterMessage(ScalarMultRequest) - -ScalarMultResponse = _reflection.GeneratedProtocolMessageType('ScalarMultResponse', (_message.Message,), dict( - DESCRIPTOR = _SCALARMULTRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.ScalarMultResponse) - )) -_sym_db.RegisterMessage(ScalarMultResponse) - -DerivePrivKeyRequest = _reflection.GeneratedProtocolMessageType('DerivePrivKeyRequest', (_message.Message,), dict( - DESCRIPTOR = _DERIVEPRIVKEYREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DerivePrivKeyRequest) - )) -_sym_db.RegisterMessage(DerivePrivKeyRequest) - -DerivePrivKeyResponse = _reflection.GeneratedProtocolMessageType('DerivePrivKeyResponse', (_message.Message,), dict( - DESCRIPTOR = _DERIVEPRIVKEYRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DerivePrivKeyResponse) - )) -_sym_db.RegisterMessage(DerivePrivKeyResponse) - -DeriveNextKeyRequest = _reflection.GeneratedProtocolMessageType('DeriveNextKeyRequest', (_message.Message,), dict( - DESCRIPTOR = _DERIVENEXTKEYREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DeriveNextKeyRequest) - )) -_sym_db.RegisterMessage(DeriveNextKeyRequest) - -DeriveNextKeyResponse = _reflection.GeneratedProtocolMessageType('DeriveNextKeyResponse', (_message.Message,), dict( - DESCRIPTOR = _DERIVENEXTKEYRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DeriveNextKeyResponse) - )) -_sym_db.RegisterMessage(DeriveNextKeyResponse) - -DeriveKeyRequest = _reflection.GeneratedProtocolMessageType('DeriveKeyRequest', (_message.Message,), dict( - DESCRIPTOR = _DERIVEKEYREQUEST, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DeriveKeyRequest) - )) -_sym_db.RegisterMessage(DeriveKeyRequest) - -DeriveKeyResponse = _reflection.GeneratedProtocolMessageType('DeriveKeyResponse', (_message.Message,), dict( - DESCRIPTOR = _DERIVEKEYRESPONSE, - __module__ = 'rpc_pb2' - # @@protoc_insertion_point(class_scope:electrumbridge.DeriveKeyResponse) - )) -_sym_db.RegisterMessage(DeriveKeyResponse) - - - -_ELECTRUMBRIDGE = _descriptor.ServiceDescriptor( - name='ElectrumBridge', - full_name='electrumbridge.ElectrumBridge', - file=DESCRIPTOR, - index=0, - options=None, - serialized_start=3213, - serialized_end=5424, - methods=[ - _descriptor.MethodDescriptor( - name='WriteDb', - full_name='electrumbridge.ElectrumBridge.WriteDb', - index=0, - containing_service=None, - input_type=_WRITEDBREQUEST, - output_type=_WRITEDBRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\r\022\013/v1/writedb')), - ), - _descriptor.MethodDescriptor( - name='NewAddress', - full_name='electrumbridge.ElectrumBridge.NewAddress', - index=1, - containing_service=None, - input_type=_NEWADDRESSREQUEST, - output_type=_NEWADDRESSRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\020\022\016/v1/newaddress')), - ), - _descriptor.MethodDescriptor( - name='ConfirmedBalance', - full_name='electrumbridge.ElectrumBridge.ConfirmedBalance', - index=2, - containing_service=None, - input_type=_CONFIRMEDBALANCEREQUEST, - output_type=_CONFIRMEDBALANCERESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\026\022\024/v1/confirmedbalance')), - ), - _descriptor.MethodDescriptor( - name='ListUnspentWitness', - full_name='electrumbridge.ElectrumBridge.ListUnspentWitness', - index=3, - containing_service=None, - input_type=_LISTUNSPENTWITNESSREQUEST, - output_type=_LISTUNSPENTWITNESSRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\030\022\026/v1/listunspentwitness')), - ), - _descriptor.MethodDescriptor( - name='FetchInputInfo', - full_name='electrumbridge.ElectrumBridge.FetchInputInfo', - index=4, - containing_service=None, - input_type=_FETCHINPUTINFOREQUEST, - output_type=_FETCHINPUTINFORESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\024\022\022/v1/fetchinputinfo')), - ), - _descriptor.MethodDescriptor( - name='ComputeInputScript', - full_name='electrumbridge.ElectrumBridge.ComputeInputScript', - index=5, - containing_service=None, - input_type=_COMPUTEINPUTSCRIPTREQUEST, - output_type=_COMPUTEINPUTSCRIPTRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\030\022\026/v1/computeinputscript')), - ), - _descriptor.MethodDescriptor( - name='SignOutputRaw', - full_name='electrumbridge.ElectrumBridge.SignOutputRaw', - index=6, - containing_service=None, - input_type=_SIGNOUTPUTRAWREQUEST, - output_type=_SIGNOUTPUTRAWRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\023\022\021/v1/signoutputraw')), - ), - _descriptor.MethodDescriptor( - name='PublishTransaction', - full_name='electrumbridge.ElectrumBridge.PublishTransaction', - index=7, - containing_service=None, - input_type=_PUBLISHTRANSACTIONREQUEST, - output_type=_PUBLISHTRANSACTIONRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\030\022\026/v1/publishtransaction')), - ), - _descriptor.MethodDescriptor( - name='LockOutpoint', - full_name='electrumbridge.ElectrumBridge.LockOutpoint', - index=8, - containing_service=None, - input_type=_LOCKOUTPOINTREQUEST, - output_type=_LOCKOUTPOINTRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\022\022\020/v1/lockoutpoint')), - ), - _descriptor.MethodDescriptor( - name='UnlockOutpoint', - full_name='electrumbridge.ElectrumBridge.UnlockOutpoint', - index=9, - containing_service=None, - input_type=_UNLOCKOUTPOINTREQUEST, - output_type=_UNLOCKOUTPOINTRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\024\022\022/v1/unlockoutpoint')), - ), - _descriptor.MethodDescriptor( - name='ListTransactionDetails', - full_name='electrumbridge.ElectrumBridge.ListTransactionDetails', - index=10, - containing_service=None, - input_type=_LISTTRANSACTIONDETAILSREQUEST, - output_type=_LISTTRANSACTIONDETAILSRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\034\022\032/v1/listtransactiondetails')), - ), - _descriptor.MethodDescriptor( - name='SendOutputs', - full_name='electrumbridge.ElectrumBridge.SendOutputs', - index=11, - containing_service=None, - input_type=_SENDOUTPUTSREQUEST, - output_type=_SENDOUTPUTSRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\021\022\017/v1/sendoutputs')), - ), - _descriptor.MethodDescriptor( - name='IsSynced', - full_name='electrumbridge.ElectrumBridge.IsSynced', - index=12, - containing_service=None, - input_type=_ISSYNCEDREQUEST, - output_type=_ISSYNCEDRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\016\022\014/v1/issynced')), - ), - _descriptor.MethodDescriptor( - name='SignMessage', - full_name='electrumbridge.ElectrumBridge.SignMessage', - index=13, - containing_service=None, - input_type=_SIGNMESSAGEREQUEST, - output_type=_SIGNMESSAGERESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\021\022\017/v1/signmessage')), - ), - _descriptor.MethodDescriptor( - name='DeriveKey', - full_name='electrumbridge.ElectrumBridge.DeriveKey', - index=14, - containing_service=None, - input_type=_DERIVEKEYREQUEST, - output_type=_DERIVEKEYRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\017\022\r/v1/derivekey')), - ), - _descriptor.MethodDescriptor( - name='DeriveNextKey', - full_name='electrumbridge.ElectrumBridge.DeriveNextKey', - index=15, - containing_service=None, - input_type=_DERIVENEXTKEYREQUEST, - output_type=_DERIVENEXTKEYRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\023\022\021/v1/derivenextkey')), - ), - _descriptor.MethodDescriptor( - name='DerivePrivKey', - full_name='electrumbridge.ElectrumBridge.DerivePrivKey', - index=16, - containing_service=None, - input_type=_DERIVEPRIVKEYREQUEST, - output_type=_DERIVEPRIVKEYRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\023\022\021/v1/deriveprivkey')), - ), - _descriptor.MethodDescriptor( - name='ScalarMult', - full_name='electrumbridge.ElectrumBridge.ScalarMult', - index=17, - containing_service=None, - input_type=_SCALARMULTREQUEST, - output_type=_SCALARMULTRESPONSE, - options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\020\022\016/v1/scalarmult')), - ), -]) -_sym_db.RegisterServiceDescriptor(_ELECTRUMBRIDGE) - -DESCRIPTOR.services_by_name['ElectrumBridge'] = _ELECTRUMBRIDGE - -try: - # THESE ELEMENTS WILL BE DEPRECATED. - # Please use the generated *_pb2_grpc.py files instead. - import grpc - from grpc.beta import implementations as beta_implementations - from grpc.beta import interfaces as beta_interfaces - from grpc.framework.common import cardinality - from grpc.framework.interfaces.face import utilities as face_utilities - - - class ElectrumBridgeStub(object): - # missing associated documentation comment in .proto file - pass - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.WriteDb = channel.unary_unary( - '/electrumbridge.ElectrumBridge/WriteDb', - request_serializer=WriteDbRequest.SerializeToString, - response_deserializer=WriteDbResponse.FromString, - ) - self.NewAddress = channel.unary_unary( - '/electrumbridge.ElectrumBridge/NewAddress', - request_serializer=NewAddressRequest.SerializeToString, - response_deserializer=NewAddressResponse.FromString, - ) - self.ConfirmedBalance = channel.unary_unary( - '/electrumbridge.ElectrumBridge/ConfirmedBalance', - request_serializer=ConfirmedBalanceRequest.SerializeToString, - response_deserializer=ConfirmedBalanceResponse.FromString, - ) - self.ListUnspentWitness = channel.unary_unary( - '/electrumbridge.ElectrumBridge/ListUnspentWitness', - request_serializer=ListUnspentWitnessRequest.SerializeToString, - response_deserializer=ListUnspentWitnessResponse.FromString, - ) - self.FetchInputInfo = channel.unary_unary( - '/electrumbridge.ElectrumBridge/FetchInputInfo', - request_serializer=FetchInputInfoRequest.SerializeToString, - response_deserializer=FetchInputInfoResponse.FromString, - ) - self.ComputeInputScript = channel.unary_unary( - '/electrumbridge.ElectrumBridge/ComputeInputScript', - request_serializer=ComputeInputScriptRequest.SerializeToString, - response_deserializer=ComputeInputScriptResponse.FromString, - ) - self.SignOutputRaw = channel.unary_unary( - '/electrumbridge.ElectrumBridge/SignOutputRaw', - request_serializer=SignOutputRawRequest.SerializeToString, - response_deserializer=SignOutputRawResponse.FromString, - ) - self.PublishTransaction = channel.unary_unary( - '/electrumbridge.ElectrumBridge/PublishTransaction', - request_serializer=PublishTransactionRequest.SerializeToString, - response_deserializer=PublishTransactionResponse.FromString, - ) - self.LockOutpoint = channel.unary_unary( - '/electrumbridge.ElectrumBridge/LockOutpoint', - request_serializer=LockOutpointRequest.SerializeToString, - response_deserializer=LockOutpointResponse.FromString, - ) - self.UnlockOutpoint = channel.unary_unary( - '/electrumbridge.ElectrumBridge/UnlockOutpoint', - request_serializer=UnlockOutpointRequest.SerializeToString, - response_deserializer=UnlockOutpointResponse.FromString, - ) - self.ListTransactionDetails = channel.unary_unary( - '/electrumbridge.ElectrumBridge/ListTransactionDetails', - request_serializer=ListTransactionDetailsRequest.SerializeToString, - response_deserializer=ListTransactionDetailsResponse.FromString, - ) - self.SendOutputs = channel.unary_unary( - '/electrumbridge.ElectrumBridge/SendOutputs', - request_serializer=SendOutputsRequest.SerializeToString, - response_deserializer=SendOutputsResponse.FromString, - ) - self.IsSynced = channel.unary_unary( - '/electrumbridge.ElectrumBridge/IsSynced', - request_serializer=IsSyncedRequest.SerializeToString, - response_deserializer=IsSyncedResponse.FromString, - ) - self.SignMessage = channel.unary_unary( - '/electrumbridge.ElectrumBridge/SignMessage', - request_serializer=SignMessageRequest.SerializeToString, - response_deserializer=SignMessageResponse.FromString, - ) - self.DeriveKey = channel.unary_unary( - '/electrumbridge.ElectrumBridge/DeriveKey', - request_serializer=DeriveKeyRequest.SerializeToString, - response_deserializer=DeriveKeyResponse.FromString, - ) - self.DeriveNextKey = channel.unary_unary( - '/electrumbridge.ElectrumBridge/DeriveNextKey', - request_serializer=DeriveNextKeyRequest.SerializeToString, - response_deserializer=DeriveNextKeyResponse.FromString, - ) - self.DerivePrivKey = channel.unary_unary( - '/electrumbridge.ElectrumBridge/DerivePrivKey', - request_serializer=DerivePrivKeyRequest.SerializeToString, - response_deserializer=DerivePrivKeyResponse.FromString, - ) - self.ScalarMult = channel.unary_unary( - '/electrumbridge.ElectrumBridge/ScalarMult', - request_serializer=ScalarMultRequest.SerializeToString, - response_deserializer=ScalarMultResponse.FromString, - ) - - - class ElectrumBridgeServicer(object): - # missing associated documentation comment in .proto file - pass - - def WriteDb(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def NewAddress(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ConfirmedBalance(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListUnspentWitness(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def FetchInputInfo(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ComputeInputScript(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SignOutputRaw(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def PublishTransaction(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def LockOutpoint(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def UnlockOutpoint(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListTransactionDetails(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SendOutputs(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def IsSynced(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SignMessage(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeriveKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeriveNextKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DerivePrivKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ScalarMult(self, request, context): - # missing associated documentation comment in .proto file - pass - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - - def add_ElectrumBridgeServicer_to_server(servicer, server): - rpc_method_handlers = { - 'WriteDb': grpc.unary_unary_rpc_method_handler( - servicer.WriteDb, - request_deserializer=WriteDbRequest.FromString, - response_serializer=WriteDbResponse.SerializeToString, - ), - 'NewAddress': grpc.unary_unary_rpc_method_handler( - servicer.NewAddress, - request_deserializer=NewAddressRequest.FromString, - response_serializer=NewAddressResponse.SerializeToString, - ), - 'ConfirmedBalance': grpc.unary_unary_rpc_method_handler( - servicer.ConfirmedBalance, - request_deserializer=ConfirmedBalanceRequest.FromString, - response_serializer=ConfirmedBalanceResponse.SerializeToString, - ), - 'ListUnspentWitness': grpc.unary_unary_rpc_method_handler( - servicer.ListUnspentWitness, - request_deserializer=ListUnspentWitnessRequest.FromString, - response_serializer=ListUnspentWitnessResponse.SerializeToString, - ), - 'FetchInputInfo': grpc.unary_unary_rpc_method_handler( - servicer.FetchInputInfo, - request_deserializer=FetchInputInfoRequest.FromString, - response_serializer=FetchInputInfoResponse.SerializeToString, - ), - 'ComputeInputScript': grpc.unary_unary_rpc_method_handler( - servicer.ComputeInputScript, - request_deserializer=ComputeInputScriptRequest.FromString, - response_serializer=ComputeInputScriptResponse.SerializeToString, - ), - 'SignOutputRaw': grpc.unary_unary_rpc_method_handler( - servicer.SignOutputRaw, - request_deserializer=SignOutputRawRequest.FromString, - response_serializer=SignOutputRawResponse.SerializeToString, - ), - 'PublishTransaction': grpc.unary_unary_rpc_method_handler( - servicer.PublishTransaction, - request_deserializer=PublishTransactionRequest.FromString, - response_serializer=PublishTransactionResponse.SerializeToString, - ), - 'LockOutpoint': grpc.unary_unary_rpc_method_handler( - servicer.LockOutpoint, - request_deserializer=LockOutpointRequest.FromString, - response_serializer=LockOutpointResponse.SerializeToString, - ), - 'UnlockOutpoint': grpc.unary_unary_rpc_method_handler( - servicer.UnlockOutpoint, - request_deserializer=UnlockOutpointRequest.FromString, - response_serializer=UnlockOutpointResponse.SerializeToString, - ), - 'ListTransactionDetails': grpc.unary_unary_rpc_method_handler( - servicer.ListTransactionDetails, - request_deserializer=ListTransactionDetailsRequest.FromString, - response_serializer=ListTransactionDetailsResponse.SerializeToString, - ), - 'SendOutputs': grpc.unary_unary_rpc_method_handler( - servicer.SendOutputs, - request_deserializer=SendOutputsRequest.FromString, - response_serializer=SendOutputsResponse.SerializeToString, - ), - 'IsSynced': grpc.unary_unary_rpc_method_handler( - servicer.IsSynced, - request_deserializer=IsSyncedRequest.FromString, - response_serializer=IsSyncedResponse.SerializeToString, - ), - 'SignMessage': grpc.unary_unary_rpc_method_handler( - servicer.SignMessage, - request_deserializer=SignMessageRequest.FromString, - response_serializer=SignMessageResponse.SerializeToString, - ), - 'DeriveKey': grpc.unary_unary_rpc_method_handler( - servicer.DeriveKey, - request_deserializer=DeriveKeyRequest.FromString, - response_serializer=DeriveKeyResponse.SerializeToString, - ), - 'DeriveNextKey': grpc.unary_unary_rpc_method_handler( - servicer.DeriveNextKey, - request_deserializer=DeriveNextKeyRequest.FromString, - response_serializer=DeriveNextKeyResponse.SerializeToString, - ), - 'DerivePrivKey': grpc.unary_unary_rpc_method_handler( - servicer.DerivePrivKey, - request_deserializer=DerivePrivKeyRequest.FromString, - response_serializer=DerivePrivKeyResponse.SerializeToString, - ), - 'ScalarMult': grpc.unary_unary_rpc_method_handler( - servicer.ScalarMult, - request_deserializer=ScalarMultRequest.FromString, - response_serializer=ScalarMultResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'electrumbridge.ElectrumBridge', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - class BetaElectrumBridgeServicer(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - # missing associated documentation comment in .proto file - pass - def WriteDb(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def NewAddress(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ConfirmedBalance(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ListUnspentWitness(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def FetchInputInfo(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ComputeInputScript(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def SignOutputRaw(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def PublishTransaction(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def LockOutpoint(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def UnlockOutpoint(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ListTransactionDetails(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def SendOutputs(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def IsSynced(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def SignMessage(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def DeriveKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def DeriveNextKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def DerivePrivKey(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - def ScalarMult(self, request, context): - # missing associated documentation comment in .proto file - pass - context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) - - - class BetaElectrumBridgeStub(object): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This class was generated - only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.""" - # missing associated documentation comment in .proto file - pass - def WriteDb(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - WriteDb.future = None - def NewAddress(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - NewAddress.future = None - def ConfirmedBalance(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - ConfirmedBalance.future = None - def ListUnspentWitness(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - ListUnspentWitness.future = None - def FetchInputInfo(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - FetchInputInfo.future = None - def ComputeInputScript(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - ComputeInputScript.future = None - def SignOutputRaw(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - SignOutputRaw.future = None - def PublishTransaction(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - PublishTransaction.future = None - def LockOutpoint(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - LockOutpoint.future = None - def UnlockOutpoint(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - UnlockOutpoint.future = None - def ListTransactionDetails(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - ListTransactionDetails.future = None - def SendOutputs(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - SendOutputs.future = None - def IsSynced(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - IsSynced.future = None - def SignMessage(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - SignMessage.future = None - def DeriveKey(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - DeriveKey.future = None - def DeriveNextKey(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - DeriveNextKey.future = None - def DerivePrivKey(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - DerivePrivKey.future = None - def ScalarMult(self, request, timeout, metadata=None, with_call=False, protocol_options=None): - # missing associated documentation comment in .proto file - pass - raise NotImplementedError() - ScalarMult.future = None - - - def beta_create_ElectrumBridge_server(servicer, pool=None, pool_size=None, default_timeout=None, maximum_timeout=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_deserializers = { - ('electrumbridge.ElectrumBridge', 'ComputeInputScript'): ComputeInputScriptRequest.FromString, - ('electrumbridge.ElectrumBridge', 'ConfirmedBalance'): ConfirmedBalanceRequest.FromString, - ('electrumbridge.ElectrumBridge', 'DeriveKey'): DeriveKeyRequest.FromString, - ('electrumbridge.ElectrumBridge', 'DeriveNextKey'): DeriveNextKeyRequest.FromString, - ('electrumbridge.ElectrumBridge', 'DerivePrivKey'): DerivePrivKeyRequest.FromString, - ('electrumbridge.ElectrumBridge', 'FetchInputInfo'): FetchInputInfoRequest.FromString, - ('electrumbridge.ElectrumBridge', 'IsSynced'): IsSyncedRequest.FromString, - ('electrumbridge.ElectrumBridge', 'ListTransactionDetails'): ListTransactionDetailsRequest.FromString, - ('electrumbridge.ElectrumBridge', 'ListUnspentWitness'): ListUnspentWitnessRequest.FromString, - ('electrumbridge.ElectrumBridge', 'LockOutpoint'): LockOutpointRequest.FromString, - ('electrumbridge.ElectrumBridge', 'NewAddress'): NewAddressRequest.FromString, - ('electrumbridge.ElectrumBridge', 'PublishTransaction'): PublishTransactionRequest.FromString, - ('electrumbridge.ElectrumBridge', 'ScalarMult'): ScalarMultRequest.FromString, - ('electrumbridge.ElectrumBridge', 'SendOutputs'): SendOutputsRequest.FromString, - ('electrumbridge.ElectrumBridge', 'SignMessage'): SignMessageRequest.FromString, - ('electrumbridge.ElectrumBridge', 'SignOutputRaw'): SignOutputRawRequest.FromString, - ('electrumbridge.ElectrumBridge', 'UnlockOutpoint'): UnlockOutpointRequest.FromString, - ('electrumbridge.ElectrumBridge', 'WriteDb'): WriteDbRequest.FromString, - } - response_serializers = { - ('electrumbridge.ElectrumBridge', 'ComputeInputScript'): ComputeInputScriptResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ConfirmedBalance'): ConfirmedBalanceResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DeriveKey'): DeriveKeyResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DeriveNextKey'): DeriveNextKeyResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DerivePrivKey'): DerivePrivKeyResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'FetchInputInfo'): FetchInputInfoResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'IsSynced'): IsSyncedResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ListTransactionDetails'): ListTransactionDetailsResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ListUnspentWitness'): ListUnspentWitnessResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'LockOutpoint'): LockOutpointResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'NewAddress'): NewAddressResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'PublishTransaction'): PublishTransactionResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ScalarMult'): ScalarMultResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SendOutputs'): SendOutputsResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SignMessage'): SignMessageResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SignOutputRaw'): SignOutputRawResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'UnlockOutpoint'): UnlockOutpointResponse.SerializeToString, - ('electrumbridge.ElectrumBridge', 'WriteDb'): WriteDbResponse.SerializeToString, - } - method_implementations = { - ('electrumbridge.ElectrumBridge', 'ComputeInputScript'): face_utilities.unary_unary_inline(servicer.ComputeInputScript), - ('electrumbridge.ElectrumBridge', 'ConfirmedBalance'): face_utilities.unary_unary_inline(servicer.ConfirmedBalance), - ('electrumbridge.ElectrumBridge', 'DeriveKey'): face_utilities.unary_unary_inline(servicer.DeriveKey), - ('electrumbridge.ElectrumBridge', 'DeriveNextKey'): face_utilities.unary_unary_inline(servicer.DeriveNextKey), - ('electrumbridge.ElectrumBridge', 'DerivePrivKey'): face_utilities.unary_unary_inline(servicer.DerivePrivKey), - ('electrumbridge.ElectrumBridge', 'FetchInputInfo'): face_utilities.unary_unary_inline(servicer.FetchInputInfo), - ('electrumbridge.ElectrumBridge', 'IsSynced'): face_utilities.unary_unary_inline(servicer.IsSynced), - ('electrumbridge.ElectrumBridge', 'ListTransactionDetails'): face_utilities.unary_unary_inline(servicer.ListTransactionDetails), - ('electrumbridge.ElectrumBridge', 'ListUnspentWitness'): face_utilities.unary_unary_inline(servicer.ListUnspentWitness), - ('electrumbridge.ElectrumBridge', 'LockOutpoint'): face_utilities.unary_unary_inline(servicer.LockOutpoint), - ('electrumbridge.ElectrumBridge', 'NewAddress'): face_utilities.unary_unary_inline(servicer.NewAddress), - ('electrumbridge.ElectrumBridge', 'PublishTransaction'): face_utilities.unary_unary_inline(servicer.PublishTransaction), - ('electrumbridge.ElectrumBridge', 'ScalarMult'): face_utilities.unary_unary_inline(servicer.ScalarMult), - ('electrumbridge.ElectrumBridge', 'SendOutputs'): face_utilities.unary_unary_inline(servicer.SendOutputs), - ('electrumbridge.ElectrumBridge', 'SignMessage'): face_utilities.unary_unary_inline(servicer.SignMessage), - ('electrumbridge.ElectrumBridge', 'SignOutputRaw'): face_utilities.unary_unary_inline(servicer.SignOutputRaw), - ('electrumbridge.ElectrumBridge', 'UnlockOutpoint'): face_utilities.unary_unary_inline(servicer.UnlockOutpoint), - ('electrumbridge.ElectrumBridge', 'WriteDb'): face_utilities.unary_unary_inline(servicer.WriteDb), - } - server_options = beta_implementations.server_options(request_deserializers=request_deserializers, response_serializers=response_serializers, thread_pool=pool, thread_pool_size=pool_size, default_timeout=default_timeout, maximum_timeout=maximum_timeout) - return beta_implementations.server(method_implementations, options=server_options) - - - def beta_create_ElectrumBridge_stub(channel, host=None, metadata_transformer=None, pool=None, pool_size=None): - """The Beta API is deprecated for 0.15.0 and later. - - It is recommended to use the GA API (classes and functions in this - file not marked beta) for all further purposes. This function was - generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0""" - request_serializers = { - ('electrumbridge.ElectrumBridge', 'ComputeInputScript'): ComputeInputScriptRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ConfirmedBalance'): ConfirmedBalanceRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DeriveKey'): DeriveKeyRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DeriveNextKey'): DeriveNextKeyRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'DerivePrivKey'): DerivePrivKeyRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'FetchInputInfo'): FetchInputInfoRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'IsSynced'): IsSyncedRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ListTransactionDetails'): ListTransactionDetailsRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ListUnspentWitness'): ListUnspentWitnessRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'LockOutpoint'): LockOutpointRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'NewAddress'): NewAddressRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'PublishTransaction'): PublishTransactionRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'ScalarMult'): ScalarMultRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SendOutputs'): SendOutputsRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SignMessage'): SignMessageRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'SignOutputRaw'): SignOutputRawRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'UnlockOutpoint'): UnlockOutpointRequest.SerializeToString, - ('electrumbridge.ElectrumBridge', 'WriteDb'): WriteDbRequest.SerializeToString, - } - response_deserializers = { - ('electrumbridge.ElectrumBridge', 'ComputeInputScript'): ComputeInputScriptResponse.FromString, - ('electrumbridge.ElectrumBridge', 'ConfirmedBalance'): ConfirmedBalanceResponse.FromString, - ('electrumbridge.ElectrumBridge', 'DeriveKey'): DeriveKeyResponse.FromString, - ('electrumbridge.ElectrumBridge', 'DeriveNextKey'): DeriveNextKeyResponse.FromString, - ('electrumbridge.ElectrumBridge', 'DerivePrivKey'): DerivePrivKeyResponse.FromString, - ('electrumbridge.ElectrumBridge', 'FetchInputInfo'): FetchInputInfoResponse.FromString, - ('electrumbridge.ElectrumBridge', 'IsSynced'): IsSyncedResponse.FromString, - ('electrumbridge.ElectrumBridge', 'ListTransactionDetails'): ListTransactionDetailsResponse.FromString, - ('electrumbridge.ElectrumBridge', 'ListUnspentWitness'): ListUnspentWitnessResponse.FromString, - ('electrumbridge.ElectrumBridge', 'LockOutpoint'): LockOutpointResponse.FromString, - ('electrumbridge.ElectrumBridge', 'NewAddress'): NewAddressResponse.FromString, - ('electrumbridge.ElectrumBridge', 'PublishTransaction'): PublishTransactionResponse.FromString, - ('electrumbridge.ElectrumBridge', 'ScalarMult'): ScalarMultResponse.FromString, - ('electrumbridge.ElectrumBridge', 'SendOutputs'): SendOutputsResponse.FromString, - ('electrumbridge.ElectrumBridge', 'SignMessage'): SignMessageResponse.FromString, - ('electrumbridge.ElectrumBridge', 'SignOutputRaw'): SignOutputRawResponse.FromString, - ('electrumbridge.ElectrumBridge', 'UnlockOutpoint'): UnlockOutpointResponse.FromString, - ('electrumbridge.ElectrumBridge', 'WriteDb'): WriteDbResponse.FromString, - } - cardinalities = { - 'ComputeInputScript': cardinality.Cardinality.UNARY_UNARY, - 'ConfirmedBalance': cardinality.Cardinality.UNARY_UNARY, - 'DeriveKey': cardinality.Cardinality.UNARY_UNARY, - 'DeriveNextKey': cardinality.Cardinality.UNARY_UNARY, - 'DerivePrivKey': cardinality.Cardinality.UNARY_UNARY, - 'FetchInputInfo': cardinality.Cardinality.UNARY_UNARY, - 'IsSynced': cardinality.Cardinality.UNARY_UNARY, - 'ListTransactionDetails': cardinality.Cardinality.UNARY_UNARY, - 'ListUnspentWitness': cardinality.Cardinality.UNARY_UNARY, - 'LockOutpoint': cardinality.Cardinality.UNARY_UNARY, - 'NewAddress': cardinality.Cardinality.UNARY_UNARY, - 'PublishTransaction': cardinality.Cardinality.UNARY_UNARY, - 'ScalarMult': cardinality.Cardinality.UNARY_UNARY, - 'SendOutputs': cardinality.Cardinality.UNARY_UNARY, - 'SignMessage': cardinality.Cardinality.UNARY_UNARY, - 'SignOutputRaw': cardinality.Cardinality.UNARY_UNARY, - 'UnlockOutpoint': cardinality.Cardinality.UNARY_UNARY, - 'WriteDb': cardinality.Cardinality.UNARY_UNARY, - } - stub_options = beta_implementations.stub_options(host=host, metadata_transformer=metadata_transformer, request_serializers=request_serializers, response_deserializers=response_deserializers, thread_pool=pool, thread_pool_size=pool_size) - return beta_implementations.dynamic_stub(channel, 'electrumbridge.ElectrumBridge', cardinalities, options=stub_options) -except ImportError: - pass -# @@protoc_insertion_point(module_scope) diff --git a/lib/lnbase.py b/lib/lnbase.py @@ -569,7 +569,7 @@ def is_synced(network): return synced class Peer(PrintError): - def __init__(self, host, port, pubkey, privkey, request_initial_sync=False, network=None): + def __init__(self, host, port, pubkey, privkey, network, request_initial_sync=False): self.update_add_htlc_event = asyncio.Event() self.channel_update_event = asyncio.Event() self.host = host @@ -648,7 +648,7 @@ class Peer(PrintError): # act 1 self.writer.write(msg) rspns = await self.reader.read(2**10) - assert len(rspns) == 50 + assert len(rspns) == 50, "Lightning handshake act 1 response has bad length, are you sure this is the right pubkey? " + str(bh2u(self.pubkey)) hver, alice_epub, tag = rspns[0], rspns[1:34], rspns[34:] assert bytes([hver]) == hs.handshake_version # act 2 @@ -875,7 +875,7 @@ class Peer(PrintError): print('remote dust limit', remote_config.dust_limit_sat) assert remote_config.dust_limit_sat < 600 assert int.from_bytes(payload['htlc_minimum_msat'], 'big') < 600 * 1000 - assert remote_config.max_htlc_value_in_flight_msat >= 500 * 1000 * 1000, remote_config.max_htlc_value_in_flight_msat + assert remote_config.max_htlc_value_in_flight_msat >= 198 * 1000 * 1000, remote_config.max_htlc_value_in_flight_msat self.print_error('remote delay', remote_config.to_self_delay) self.print_error('funding_txn_minimum_depth', funding_txn_minimum_depth) # create funding tx @@ -1370,32 +1370,69 @@ class Peer(PrintError): channel_id = int.from_bytes(payload["channel_id"], 'big') self.revoke_and_ack[channel_id].set_result(payload) +class ConsoleInterface: + def __init__(self, lnworker): + self.lnworker = lnworker + def __repr__(self): + return str(dir(self)) # replacement for lightningCall class LNWorker: def __init__(self, wallet, network): - self.privkey = H256(b"0123456789") self.wallet = wallet self.network = network + self.privkey = H256(b"0123456789") self.config = network.config self.peers = {} self.channels = {} peer_list = network.config.get('lightning_peers', node_list) + print("Adding", len(peer_list), "peers") for host, port, pubkey in peer_list: self.add_peer(host, port, pubkey) + self.console_interface = ConsoleInterface(self) def add_peer(self, host, port, pubkey): - peer = Peer(host, int(port), binascii.unhexlify(pubkey), self.privkey) + peer = Peer(host, int(port), binascii.unhexlify(pubkey), self.privkey, self.network) self.network.futures.append(asyncio.run_coroutine_threadsafe(peer.main_loop(), asyncio.get_event_loop())) self.peers[pubkey] = peer - def open_channel(self, pubkey, amount, push_msat, password): - keystore = self.wallet.keystore - peer = self.peers.get(pubkey) + def open_channel(self, peer, amount, push_msat, password): coro = peer.channel_establishment_flow(self.wallet, self.config, password, amount, push_msat, temp_channel_id=os.urandom(32)) - fut = asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop) + return asyncio.run_coroutine_threadsafe(coro, self.network.asyncio_loop) + + def open_channel_from_other_thread(self, node_id, local_amt, push_amt, emit_function, get_password): + pw = get_password() + if pw is None: + # user pressed cancel + return + # TODO this could race on peers + peer = self.peers.get(node_id) + if peer is None: + if len(self.peers) != 1: + print("Peer not found, and peer list is empty or has multiple peers.") + return + peer = next(iter(self.peers.values())) + fut = self.open_channel(peer, local_amt, push_amt, None if pw == "" else pw) + chan = fut.result() + # https://api.lightning.community/#listchannels + std_chan = {"chan_id": chan.channel_id} + emit_function({"channels": [std_chan]}) + + def subscribe_payment_received_from_other_thread(self, emit_function): + pass + def subscribe_channel_list_updates_from_other_thread(self, emit_function): + pass + + def subscribe_single_channel_update_from_other_thread(self, emit_function): + pass + + def add_invoice_from_other_thread(self, amt): + pass + + def subscribe_invoice_added_from_other_thread(self, emit_function): + pass class ChannelInfo(PrintError): diff --git a/lib/tests/test_lnbase_online.py b/lib/tests/test_lnbase_online.py @@ -106,7 +106,7 @@ if __name__ == "__main__": privkey = wallet.storage.get("channels_privkey", None) assert privkey is not None privkey = bfh(privkey) - peer = Peer(host, port, pubkey, privkey, request_initial_sync=True, network=network) + peer = Peer(host, port, pubkey, privkey, network, request_initial_sync=True) network.futures.append(asyncio.run_coroutine_threadsafe(peer.main_loop(), network.asyncio_loop)) funding_satoshis = 2000000 diff --git a/protoc_lightning.sh b/protoc_lightning.sh @@ -1,15 +0,0 @@ -#!/bin/sh -ex -if [ ! -d $HOME/go/src/github.com/grpc-ecosystem ]; then - # from readme in https://github.com/grpc-ecosystem/grpc-gateway - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway - go get -u github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger - go get -u github.com/golang/protobuf/protoc-gen-go -fi -if [ ! -d $HOME/go/src/github.com/lightningnetwork/lnd ]; then - echo "You need an lnd with electrum-bridge (ysangkok/lnd maybe?) checked out since we implement the interface from there, and need it to generate code" - exit 1 -fi -mkdir -p lib/ln || true -touch lib/__init__.py -~/go/bin/protoc -I$HOME/include -I$HOME/go/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --python_out=lib/ln $HOME/go/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis/google/api/*.proto -python3 -m grpc_tools.protoc -I $HOME/go/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --proto_path $HOME/go/src/github.com/lightningnetwork/lnd/electrum-bridge --python_out=lib/ln --grpc_python_out=lib/ln ~/go/src/github.com/lightningnetwork/lnd/electrum-bridge/rpc.proto