add Zcash code to plugins exclud. ledger/treror
This commit is contained in:
parent
de2ef374c9
commit
8483acc9d5
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = _('Audio MODEM')
|
fullname = _('Audio MODEM')
|
||||||
description = _('Provides support for air-gapped transaction signing.')
|
description = _('Provides support for air-gapped transaction signing.')
|
||||||
|
|
|
@ -5,10 +5,10 @@ from io import BytesIO
|
||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog
|
from electrum_zcash_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog
|
||||||
from electrum.util import print_msg, print_error
|
from electrum_zcash.util import print_msg, print_error
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
fullname = _('Cosigner Pool')
|
fullname = _('Cosigner Pool')
|
||||||
description = ' '.join([
|
description = ' '.join([
|
||||||
_("This plugin facilitates the use of multi-signatures wallets."),
|
_("This plugin facilitates the use of multi-signatures wallets."),
|
||||||
|
|
|
@ -30,14 +30,14 @@ from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import QPushButton
|
from PyQt5.QtWidgets import QPushButton
|
||||||
|
|
||||||
from electrum import bitcoin, util
|
from electrum_zcash import bitcoin, util
|
||||||
from electrum import transaction
|
from electrum_zcash import transaction
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.wallet import Multisig_Wallet
|
from electrum_zcash.wallet import Multisig_Wallet
|
||||||
from electrum.util import bh2u, bfh
|
from electrum_zcash.util import bh2u, bfh
|
||||||
|
|
||||||
from electrum_gui.qt.transaction_dialog import show_transaction
|
from electrum_zcash_gui.qt.transaction_dialog import show_transaction
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -162,7 +162,7 @@ class Plugin(BasePlugin):
|
||||||
d.cosigner_send_button.hide()
|
d.cosigner_send_button.hide()
|
||||||
|
|
||||||
def cosigner_can_sign(self, tx, cosigner_xpub):
|
def cosigner_can_sign(self, tx, cosigner_xpub):
|
||||||
from electrum.keystore import is_xpubkey, parse_xpubkey
|
from electrum_zcash.keystore import is_xpubkey, parse_xpubkey
|
||||||
xpub_set = set([])
|
xpub_set = set([])
|
||||||
for txin in tx.inputs():
|
for txin in tx.inputs():
|
||||||
for x_pubkey in txin['x_pubkeys']:
|
for x_pubkey in txin['x_pubkeys']:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = 'Digital Bitbox'
|
fullname = 'Digital Bitbox'
|
||||||
description = _('Provides support for Digital Bitbox hardware wallet')
|
description = _('Provides support for Digital Bitbox hardware wallet')
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
from .digitalbitbox import DigitalBitboxPlugin
|
from .digitalbitbox import DigitalBitboxPlugin
|
||||||
from ..hw_wallet import CmdLineHandler
|
from ..hw_wallet import CmdLineHandler
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import electrum
|
import electrum_zcash
|
||||||
from electrum.bitcoin import TYPE_ADDRESS, push_script, var_int, msg_magic, Hash, verify_message, pubkey_from_signature, point_to_ser, public_key_to_p2pkh, EncodeAES, DecodeAES, MyVerifyingKey
|
from electrum_zcash.bitcoin import TYPE_ADDRESS, push_script, var_int, msg_magic, Hash, verify_message, pubkey_from_signature, point_to_ser, public_key_to_p2pkh, EncodeAES, DecodeAES, MyVerifyingKey
|
||||||
from electrum.bitcoin import serialize_xpub, deserialize_xpub
|
from electrum_zcash.bitcoin import serialize_xpub, deserialize_xpub
|
||||||
from electrum.transaction import Transaction
|
from electrum_zcash.transaction import Transaction
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.keystore import Hardware_KeyStore
|
from electrum_zcash.keystore import Hardware_KeyStore
|
||||||
from ..hw_wallet import HW_PluginBase
|
from ..hw_wallet import HW_PluginBase
|
||||||
from electrum.util import print_error, to_string, UserCancelled
|
from electrum_zcash.util import print_error, to_string, UserCancelled
|
||||||
|
|
||||||
import time
|
import time
|
||||||
import hid
|
import hid
|
||||||
|
@ -270,8 +270,8 @@ class DigitalBitbox_Client():
|
||||||
|
|
||||||
def dbb_generate_wallet(self):
|
def dbb_generate_wallet(self):
|
||||||
key = self.stretch_key(self.password)
|
key = self.stretch_key(self.password)
|
||||||
filename = ("Electrum-" + time.strftime("%Y-%m-%d-%H-%M-%S") + ".pdf").encode('utf8')
|
filename = ("Electrum-Zcash-" + time.strftime("%Y-%m-%d-%H-%M-%S") + ".pdf").encode('utf8')
|
||||||
msg = b'{"seed":{"source": "create", "key": "%s", "filename": "%s", "entropy": "%s"}}' % (key, filename, b'Digital Bitbox Electrum Plugin')
|
msg = b'{"seed":{"source": "create", "key": "%s", "filename": "%s", "entropy": "%s"}}' % (key, filename, b'Digital Bitbox Electrum-Zcash Plugin')
|
||||||
reply = self.hid_send_encrypt(msg)
|
reply = self.hid_send_encrypt(msg)
|
||||||
if 'error' in reply:
|
if 'error' in reply:
|
||||||
raise Exception(reply['error']['message'])
|
raise Exception(reply['error']['message'])
|
||||||
|
@ -675,7 +675,7 @@ class DigitalBitboxPlugin(HW_PluginBase):
|
||||||
client = devmgr.client_by_id(device_id)
|
client = devmgr.client_by_id(device_id)
|
||||||
client.handler = self.create_handler(wizard)
|
client.handler = self.create_handler(wizard)
|
||||||
client.setupRunning = True
|
client.setupRunning = True
|
||||||
client.get_xpub("m/44'/0'", 'standard')
|
client.get_xpub("m/44'/133'", 'standard')
|
||||||
|
|
||||||
|
|
||||||
def is_mobile_paired(self):
|
def is_mobile_paired(self):
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||||
from .digitalbitbox import DigitalBitboxPlugin
|
from .digitalbitbox import DigitalBitboxPlugin
|
||||||
|
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
from electrum.wallet import Standard_Wallet
|
from electrum_zcash.wallet import Standard_Wallet
|
||||||
|
|
||||||
|
|
||||||
class Plugin(DigitalBitboxPlugin, QtPluginBase):
|
class Plugin(DigitalBitboxPlugin, QtPluginBase):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = _('Email')
|
fullname = _('Email')
|
||||||
description = _("Send and receive payment request with an email account")
|
description = _("Send and receive payment request with an email account")
|
||||||
|
|
|
@ -40,11 +40,11 @@ from PyQt5.QtCore import *
|
||||||
import PyQt5.QtGui as QtGui
|
import PyQt5.QtGui as QtGui
|
||||||
from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QLineEdit)
|
from PyQt5.QtWidgets import (QVBoxLayout, QLabel, QGridLayout, QLineEdit)
|
||||||
|
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum.paymentrequest import PaymentRequest
|
from electrum_zcash.paymentrequest import PaymentRequest
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum_gui.qt.util import EnterButton, Buttons, CloseButton
|
from electrum_zcash_gui.qt.util import EnterButton, Buttons, CloseButton
|
||||||
from electrum_gui.qt.util import OkButton, WindowModalDialog
|
from electrum_zcash_gui.qt.util import OkButton, WindowModalDialog
|
||||||
|
|
||||||
|
|
||||||
class Processor(threading.Thread):
|
class Processor(threading.Thread):
|
||||||
|
@ -72,7 +72,7 @@ class Processor(threading.Thread):
|
||||||
p = [p]
|
p = [p]
|
||||||
continue
|
continue
|
||||||
for item in p:
|
for item in p:
|
||||||
if item.get_content_type() == "application/bitcoin-paymentrequest":
|
if item.get_content_type() == "application/zcash-paymentrequest":
|
||||||
pr_str = item.get_payload()
|
pr_str = item.get_payload()
|
||||||
pr_str = base64.b64decode(pr_str)
|
pr_str = base64.b64decode(pr_str)
|
||||||
self.on_receive(pr_str)
|
self.on_receive(pr_str)
|
||||||
|
@ -91,10 +91,10 @@ class Processor(threading.Thread):
|
||||||
msg['Subject'] = message
|
msg['Subject'] = message
|
||||||
msg['To'] = recipient
|
msg['To'] = recipient
|
||||||
msg['From'] = self.username
|
msg['From'] = self.username
|
||||||
part = MIMEBase('application', "bitcoin-paymentrequest")
|
part = MIMEBase('application', "zcash-paymentrequest")
|
||||||
part.set_payload(payment_request)
|
part.set_payload(payment_request)
|
||||||
encode_base64(part)
|
encode_base64(part)
|
||||||
part.add_header('Content-Disposition', 'attachment; filename="payreq.btc"')
|
part.add_header('Content-Disposition', 'attachment; filename="payreq.zec"')
|
||||||
msg.attach(part)
|
msg.attach(part)
|
||||||
s = smtplib.SMTP_SSL(self.imap_server, timeout=2)
|
s = smtplib.SMTP_SSL(self.imap_server, timeout=2)
|
||||||
s.login(self.username, self.password)
|
s.login(self.username, self.password)
|
||||||
|
@ -143,7 +143,7 @@ class Plugin(BasePlugin):
|
||||||
menu.addAction(_("Send via e-mail"), lambda: self.send(window, addr))
|
menu.addAction(_("Send via e-mail"), lambda: self.send(window, addr))
|
||||||
|
|
||||||
def send(self, window, addr):
|
def send(self, window, addr):
|
||||||
from electrum import paymentrequest
|
from electrum_zcash import paymentrequest
|
||||||
r = window.wallet.receive_requests.get(addr)
|
r = window.wallet.receive_requests.get(addr)
|
||||||
message = r.get('memo', '')
|
message = r.get('memo', '')
|
||||||
if r.get('signature'):
|
if r.get('signature'):
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
from electrum.i18n import _
|
|
||||||
|
|
||||||
fullname = 'GreenAddress instant'
|
|
||||||
description = _("Allows validating if your transactions have instant confirmations by GreenAddress")
|
|
||||||
available_for = ['qt']
|
|
|
@ -1,102 +0,0 @@
|
||||||
#!/usr/bin/env python
|
|
||||||
#
|
|
||||||
# Electrum - lightweight Bitcoin client
|
|
||||||
# Copyright (C) 2014 Thomas Voegtlin
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person
|
|
||||||
# obtaining a copy of this software and associated documentation files
|
|
||||||
# (the "Software"), to deal in the Software without restriction,
|
|
||||||
# including without limitation the rights to use, copy, modify, merge,
|
|
||||||
# publish, distribute, sublicense, and/or sell copies of the Software,
|
|
||||||
# and to permit persons to whom the Software is furnished to do so,
|
|
||||||
# subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be
|
|
||||||
# included in all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
||||||
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
||||||
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
# SOFTWARE.
|
|
||||||
|
|
||||||
import base64
|
|
||||||
import urllib.parse
|
|
||||||
import sys
|
|
||||||
import requests
|
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QApplication, QPushButton
|
|
||||||
|
|
||||||
from electrum.plugins import BasePlugin, hook
|
|
||||||
from electrum.i18n import _
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Plugin(BasePlugin):
|
|
||||||
|
|
||||||
button_label = _("Verify GA instant")
|
|
||||||
|
|
||||||
@hook
|
|
||||||
def transaction_dialog(self, d):
|
|
||||||
d.verify_button = QPushButton(self.button_label)
|
|
||||||
d.verify_button.clicked.connect(lambda: self.do_verify(d))
|
|
||||||
d.buttons.insert(0, d.verify_button)
|
|
||||||
self.transaction_dialog_update(d)
|
|
||||||
|
|
||||||
def get_my_addr(self, d):
|
|
||||||
"""Returns the address for given tx which can be used to request
|
|
||||||
instant confirmation verification from GreenAddress"""
|
|
||||||
for addr, _ in d.tx.get_outputs():
|
|
||||||
if d.wallet.is_mine(addr):
|
|
||||||
return addr
|
|
||||||
return None
|
|
||||||
|
|
||||||
@hook
|
|
||||||
def transaction_dialog_update(self, d):
|
|
||||||
if d.tx.is_complete() and self.get_my_addr(d):
|
|
||||||
d.verify_button.show()
|
|
||||||
else:
|
|
||||||
d.verify_button.hide()
|
|
||||||
|
|
||||||
def do_verify(self, d):
|
|
||||||
tx = d.tx
|
|
||||||
wallet = d.wallet
|
|
||||||
window = d.main_window
|
|
||||||
# 1. get the password and sign the verification request
|
|
||||||
password = None
|
|
||||||
if wallet.has_password():
|
|
||||||
msg = _('GreenAddress requires your signature \n'
|
|
||||||
'to verify that transaction is instant.\n'
|
|
||||||
'Please enter your password to sign a\n'
|
|
||||||
'verification request.')
|
|
||||||
password = window.password_dialog(msg, parent=d)
|
|
||||||
if not password:
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
d.verify_button.setText(_('Verifying...'))
|
|
||||||
QApplication.processEvents() # update the button label
|
|
||||||
|
|
||||||
addr = self.get_my_addr(d)
|
|
||||||
message = "Please verify if %s is GreenAddress instant confirmed" % tx.txid()
|
|
||||||
sig = wallet.sign_message(addr, message, password)
|
|
||||||
sig = base64.b64encode(sig).decode('ascii')
|
|
||||||
|
|
||||||
# 2. send the request
|
|
||||||
response = requests.request("GET", ("https://greenaddress.it/verify/?signature=%s&txhash=%s" % (urllib.parse.quote(sig), tx.txid())),
|
|
||||||
headers = {'User-Agent': 'Electrum'})
|
|
||||||
response = response.json()
|
|
||||||
|
|
||||||
# 3. display the result
|
|
||||||
if response.get('verified'):
|
|
||||||
d.show_message(_('%s is covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification successful!'))
|
|
||||||
else:
|
|
||||||
d.show_critical(_('%s is not covered by GreenAddress instant confirmation') % (tx.txid()), title=_('Verification failed!'))
|
|
||||||
except BaseException as e:
|
|
||||||
import traceback
|
|
||||||
traceback.print_exc(file=sys.stdout)
|
|
||||||
d.show_error(str(e))
|
|
||||||
finally:
|
|
||||||
d.verify_button.setText(self.button_label)
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.util import print_msg, print_error, raw_input
|
from electrum_zcash.util import print_msg, print_error, raw_input
|
||||||
|
|
||||||
class CmdLineHandler:
|
class CmdLineHandler:
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
|
|
||||||
class HW_PluginBase(BasePlugin):
|
class HW_PluginBase(BasePlugin):
|
||||||
|
|
|
@ -27,11 +27,11 @@
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from PyQt5.Qt import QVBoxLayout, QLabel
|
from PyQt5.Qt import QVBoxLayout, QLabel
|
||||||
from electrum_gui.qt.password_dialog import PasswordDialog, PW_PASSPHRASE
|
from electrum_zcash_gui.qt.password_dialog import PasswordDialog, PW_PASSPHRASE
|
||||||
from electrum_gui.qt.util import *
|
from electrum_zcash_gui.qt.util import *
|
||||||
|
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.util import PrintError
|
from electrum_zcash.util import PrintError
|
||||||
|
|
||||||
# The trickiest thing about this handler was getting windows properly
|
# The trickiest thing about this handler was getting windows properly
|
||||||
# parented on MacOSX.
|
# parented on MacOSX.
|
||||||
|
@ -171,9 +171,9 @@ class QtHandlerBase(QObject, PrintError):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
from electrum.util import UserCancelled
|
from electrum_zcash.util import UserCancelled
|
||||||
from electrum_gui.qt.main_window import StatusBarButton
|
from electrum_zcash_gui.qt.main_window import StatusBarButton
|
||||||
|
|
||||||
class QtPluginBase(object):
|
class QtPluginBase(object):
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = 'KeepKey'
|
fullname = 'KeepKey'
|
||||||
description = _('Provides support for KeepKey hardware wallet')
|
description = _('Provides support for KeepKey hardware wallet')
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import time
|
import time
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.util import PrintError, UserCancelled
|
from electrum_zcash.util import PrintError, UserCancelled
|
||||||
from electrum.keystore import bip39_normalize_passphrase
|
from electrum_zcash.keystore import bip39_normalize_passphrase
|
||||||
from electrum.bitcoin import serialize_xpub
|
from electrum_zcash.bitcoin import serialize_xpub
|
||||||
|
|
||||||
|
|
||||||
class GuiMixin(object):
|
class GuiMixin(object):
|
||||||
|
@ -59,7 +59,7 @@ class GuiMixin(object):
|
||||||
msg = _("Enter a passphrase to generate this wallet. Each time "
|
msg = _("Enter a passphrase to generate this wallet. Each time "
|
||||||
"you use this wallet your %s will prompt you for the "
|
"you use this wallet your %s will prompt you for the "
|
||||||
"passphrase. If you forget the passphrase you cannot "
|
"passphrase. If you forget the passphrase you cannot "
|
||||||
"access the bitcoins in the wallet.") % self.device
|
"access the Zcash coins in the wallet.") % self.device
|
||||||
else:
|
else:
|
||||||
msg = _("Enter the passphrase to unlock this wallet:")
|
msg = _("Enter the passphrase to unlock this wallet:")
|
||||||
passphrase = self.handler.get_passphrase(msg, self.creating_wallet)
|
passphrase = self.handler.get_passphrase(msg, self.creating_wallet)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
from .keepkey import KeepKeyPlugin
|
from .keepkey import KeepKeyPlugin
|
||||||
from ..hw_wallet import CmdLineHandler
|
from ..hw_wallet import CmdLineHandler
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@ import threading
|
||||||
|
|
||||||
from binascii import hexlify, unhexlify
|
from binascii import hexlify, unhexlify
|
||||||
|
|
||||||
from electrum.util import bfh, bh2u
|
from electrum_zcash.util import bfh, bh2u
|
||||||
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
|
from electrum_zcash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
|
||||||
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
|
TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants)
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.plugins import BasePlugin
|
from electrum_zcash.plugins import BasePlugin
|
||||||
from electrum.transaction import deserialize
|
from electrum_zcash.transaction import deserialize
|
||||||
from electrum.keystore import Hardware_KeyStore, is_xpubkey, parse_xpubkey
|
from electrum_zcash.keystore import Hardware_KeyStore, is_xpubkey, parse_xpubkey
|
||||||
|
|
||||||
from ..hw_wallet import HW_PluginBase
|
from ..hw_wallet import HW_PluginBase
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ class KeepKeyCompatiblePlugin(HW_PluginBase):
|
||||||
return client
|
return client
|
||||||
|
|
||||||
def get_coin_name(self):
|
def get_coin_name(self):
|
||||||
return "Testnet" if NetworkConstants.TESTNET else "Bitcoin"
|
return "Zcash Testnet" if NetworkConstants.TESTNET else "Zcash"
|
||||||
|
|
||||||
def initialize_device(self, device_id, wizard, handler):
|
def initialize_device(self, device_id, wizard, handler):
|
||||||
# Initialization method
|
# Initialization method
|
||||||
|
|
|
@ -4,29 +4,29 @@ import threading
|
||||||
from PyQt5.Qt import Qt
|
from PyQt5.Qt import Qt
|
||||||
from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton
|
from PyQt5.Qt import QGridLayout, QInputDialog, QPushButton
|
||||||
from PyQt5.Qt import QVBoxLayout, QLabel
|
from PyQt5.Qt import QVBoxLayout, QLabel
|
||||||
from electrum_gui.qt.util import *
|
from electrum_zcash_gui.qt.util import *
|
||||||
from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
|
from .plugin import TIM_NEW, TIM_RECOVER, TIM_MNEMONIC
|
||||||
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
from ..hw_wallet.qt import QtHandlerBase, QtPluginBase
|
||||||
|
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum.plugins import hook, DeviceMgr
|
from electrum_zcash.plugins import hook, DeviceMgr
|
||||||
from electrum.util import PrintError, UserCancelled, bh2u
|
from electrum_zcash.util import PrintError, UserCancelled, bh2u
|
||||||
from electrum.wallet import Wallet, Standard_Wallet
|
from electrum_zcash.wallet import Wallet, Standard_Wallet
|
||||||
|
|
||||||
PASSPHRASE_HELP_SHORT =_(
|
PASSPHRASE_HELP_SHORT =_(
|
||||||
"Passphrases allow you to access new wallets, each "
|
"Passphrases allow you to access new wallets, each "
|
||||||
"hidden behind a particular case-sensitive passphrase.")
|
"hidden behind a particular case-sensitive passphrase.")
|
||||||
PASSPHRASE_HELP = PASSPHRASE_HELP_SHORT + " " + _(
|
PASSPHRASE_HELP = PASSPHRASE_HELP_SHORT + " " + _(
|
||||||
"You need to create a separate Electrum wallet for each passphrase "
|
"You need to create a separate Electrum-Zcash wallet for each passphrase "
|
||||||
"you use as they each generate different addresses. Changing "
|
"you use as they each generate different addresses. Changing "
|
||||||
"your passphrase does not lose other wallets, each is still "
|
"your passphrase does not lose other wallets, each is still "
|
||||||
"accessible behind its own passphrase.")
|
"accessible behind its own passphrase.")
|
||||||
RECOMMEND_PIN = _(
|
RECOMMEND_PIN = _(
|
||||||
"You should enable PIN protection. Your PIN is the only protection "
|
"You should enable PIN protection. Your PIN is the only protection "
|
||||||
"for your bitcoins if your device is lost or stolen.")
|
"for your Zcash coins if your device is lost or stolen.")
|
||||||
PASSPHRASE_NOT_PIN = _(
|
PASSPHRASE_NOT_PIN = _(
|
||||||
"If you forget a passphrase you will be unable to access any "
|
"If you forget a passphrase you will be unable to access any "
|
||||||
"bitcoins in the wallet behind it. A passphrase is not a PIN. "
|
"Zcash coins in the wallet behind it. A passphrase is not a PIN. "
|
||||||
"Only change this if you are sure you understand it.")
|
"Only change this if you are sure you understand it.")
|
||||||
CHARACTER_RECOVERY = (
|
CHARACTER_RECOVERY = (
|
||||||
"Use the recovery cipher shown on your device to input your seed words. "
|
"Use the recovery cipher shown on your device to input your seed words. "
|
||||||
|
@ -242,7 +242,7 @@ class QtPlugin(QtPluginBase):
|
||||||
else:
|
else:
|
||||||
msg = _("Enter the master private key beginning with xprv:")
|
msg = _("Enter the master private key beginning with xprv:")
|
||||||
def set_enabled():
|
def set_enabled():
|
||||||
from electrum.keystore import is_xprv
|
from electrum_zcash.keystore import is_xprv
|
||||||
wizard.next_button.setEnabled(is_xprv(clean_text(text)))
|
wizard.next_button.setEnabled(is_xprv(clean_text(text)))
|
||||||
text.textChanged.connect(set_enabled)
|
text.textChanged.connect(set_enabled)
|
||||||
next_enabled = False
|
next_enabled = False
|
||||||
|
@ -359,13 +359,13 @@ class SettingsDialog(WindowModalDialog):
|
||||||
currently_enabled = self.features.passphrase_protection
|
currently_enabled = self.features.passphrase_protection
|
||||||
if currently_enabled:
|
if currently_enabled:
|
||||||
msg = _("After disabling passphrases, you can only pair this "
|
msg = _("After disabling passphrases, you can only pair this "
|
||||||
"Electrum wallet if it had an empty passphrase. "
|
"Electrum-Zcash wallet if it had an empty passphrase. "
|
||||||
"If its passphrase was not empty, you will need to "
|
"If its passphrase was not empty, you will need to "
|
||||||
"create a new wallet with the install wizard. You "
|
"create a new wallet with the install wizard. You "
|
||||||
"can use this wallet again at any time by re-enabling "
|
"can use this wallet again at any time by re-enabling "
|
||||||
"passphrases and entering its passphrase.")
|
"passphrases and entering its passphrase.")
|
||||||
else:
|
else:
|
||||||
msg = _("Your current Electrum wallet can only be used with "
|
msg = _("Your current Electrum-Zcash wallet can only be used with "
|
||||||
"an empty passphrase. You must create a separate "
|
"an empty passphrase. You must create a separate "
|
||||||
"wallet with the install wizard for other passphrases "
|
"wallet with the install wizard for other passphrases "
|
||||||
"as each one generates a new set of addresses.")
|
"as each one generates a new set of addresses.")
|
||||||
|
@ -406,7 +406,7 @@ class SettingsDialog(WindowModalDialog):
|
||||||
if wallet and sum(wallet.get_balance()):
|
if wallet and sum(wallet.get_balance()):
|
||||||
title = _("Confirm Device Wipe")
|
title = _("Confirm Device Wipe")
|
||||||
msg = _("Are you SURE you want to wipe the device?\n"
|
msg = _("Are you SURE you want to wipe the device?\n"
|
||||||
"Your wallet still has bitcoins in it!")
|
"Your wallet still has Zcash coins in it!")
|
||||||
if not self.question(msg, title=title,
|
if not self.question(msg, title=title,
|
||||||
icon=QMessageBox.Critical):
|
icon=QMessageBox.Critical):
|
||||||
return
|
return
|
||||||
|
@ -481,7 +481,7 @@ class SettingsDialog(WindowModalDialog):
|
||||||
settings_glayout.addWidget(pin_button, 2, 1)
|
settings_glayout.addWidget(pin_button, 2, 1)
|
||||||
pin_msg = QLabel(_("PIN protection is strongly recommended. "
|
pin_msg = QLabel(_("PIN protection is strongly recommended. "
|
||||||
"A PIN is your only protection against someone "
|
"A PIN is your only protection against someone "
|
||||||
"stealing your bitcoins if they obtain physical "
|
"stealing your Zcash coins if they obtain physical "
|
||||||
"access to your %s.") % plugin.device)
|
"access to your %s.") % plugin.device)
|
||||||
pin_msg.setWordWrap(True)
|
pin_msg.setWordWrap(True)
|
||||||
pin_msg.setStyleSheet("color: red")
|
pin_msg.setStyleSheet("color: red")
|
||||||
|
@ -541,7 +541,7 @@ class SettingsDialog(WindowModalDialog):
|
||||||
clear_pin_button.clicked.connect(clear_pin)
|
clear_pin_button.clicked.connect(clear_pin)
|
||||||
clear_pin_warning = QLabel(
|
clear_pin_warning = QLabel(
|
||||||
_("If you disable your PIN, anyone with physical access to your "
|
_("If you disable your PIN, anyone with physical access to your "
|
||||||
"%s device can spend your bitcoins.") % plugin.device)
|
"%s device can spend your Zcash coins.") % plugin.device)
|
||||||
clear_pin_warning.setWordWrap(True)
|
clear_pin_warning.setWordWrap(True)
|
||||||
clear_pin_warning.setStyleSheet("color: red")
|
clear_pin_warning.setStyleSheet("color: red")
|
||||||
advanced_glayout.addWidget(clear_pin_button, 0, 2)
|
advanced_glayout.addWidget(clear_pin_button, 0, 2)
|
||||||
|
@ -566,7 +566,7 @@ class SettingsDialog(WindowModalDialog):
|
||||||
wipe_device_msg.setWordWrap(True)
|
wipe_device_msg.setWordWrap(True)
|
||||||
wipe_device_warning = QLabel(
|
wipe_device_warning = QLabel(
|
||||||
_("Only wipe a device if you have the recovery seed written down "
|
_("Only wipe a device if you have the recovery seed written down "
|
||||||
"and the device wallet(s) are empty, otherwise the bitcoins "
|
"and the device wallet(s) are empty, otherwise the Zcash coins "
|
||||||
"will be lost forever."))
|
"will be lost forever."))
|
||||||
wipe_device_warning.setWordWrap(True)
|
wipe_device_warning.setWordWrap(True)
|
||||||
wipe_device_warning.setStyleSheet("color: red")
|
wipe_device_warning.setStyleSheet("color: red")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = _('LabelSync')
|
fullname = _('LabelSync')
|
||||||
description = ' '.join([
|
description = ' '.join([
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from .labels import LabelsPlugin
|
from .labels import LabelsPlugin
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
|
|
||||||
class Plugin(LabelsPlugin):
|
class Plugin(LabelsPlugin):
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ import traceback
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
import electrum
|
import electrum_zcash
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
|
|
||||||
class LabelsPlugin(BasePlugin):
|
class LabelsPlugin(BasePlugin):
|
||||||
|
@ -21,14 +21,14 @@ class LabelsPlugin(BasePlugin):
|
||||||
|
|
||||||
def encode(self, wallet, msg):
|
def encode(self, wallet, msg):
|
||||||
password, iv, wallet_id = self.wallets[wallet]
|
password, iv, wallet_id = self.wallets[wallet]
|
||||||
encrypted = electrum.bitcoin.aes_encrypt_with_iv(password, iv,
|
encrypted = electrum_zcash.bitcoin.aes_encrypt_with_iv(password, iv,
|
||||||
msg.encode('utf8'))
|
msg.encode('utf8'))
|
||||||
return base64.b64encode(encrypted).decode()
|
return base64.b64encode(encrypted).decode()
|
||||||
|
|
||||||
def decode(self, wallet, message):
|
def decode(self, wallet, message):
|
||||||
password, iv, wallet_id = self.wallets[wallet]
|
password, iv, wallet_id = self.wallets[wallet]
|
||||||
decoded = base64.b64decode(message)
|
decoded = base64.b64decode(message)
|
||||||
decrypted = electrum.bitcoin.aes_decrypt_with_iv(password, iv, decoded)
|
decrypted = electrum_zcash.bitcoin.aes_decrypt_with_iv(password, iv, decoded)
|
||||||
return decrypted.decode('utf8')
|
return decrypted.decode('utf8')
|
||||||
|
|
||||||
def get_nonce(self, wallet):
|
def get_nonce(self, wallet):
|
||||||
|
|
|
@ -4,11 +4,11 @@ from PyQt5.QtGui import *
|
||||||
from PyQt5.QtCore import *
|
from PyQt5.QtCore import *
|
||||||
from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout)
|
from PyQt5.QtWidgets import (QHBoxLayout, QLabel, QVBoxLayout)
|
||||||
|
|
||||||
from electrum.plugins import hook
|
from electrum_zcash.plugins import hook
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
from electrum_gui.qt import EnterButton
|
from electrum_zcash_gui.qt import EnterButton
|
||||||
from electrum_gui.qt.util import ThreadedButton, Buttons
|
from electrum_zcash_gui.qt.util import ThreadedButton, Buttons
|
||||||
from electrum_gui.qt.util import WindowModalDialog, OkButton
|
from electrum_zcash_gui.qt.util import WindowModalDialog, OkButton
|
||||||
|
|
||||||
from .labels import LabelsPlugin
|
from .labels import LabelsPlugin
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
|
|
||||||
fullname = 'Virtual Keyboard'
|
fullname = 'Virtual Keyboard'
|
||||||
description = '%s\n%s' % (_("Add an optional virtual keyboard to the password dialog."), _("Warning: do not use this if it makes you pick a weaker password."))
|
description = '%s\n%s' % (_("Add an optional virtual keyboard to the password dialog."), _("Warning: do not use this if it makes you pick a weaker password."))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from PyQt5.QtGui import *
|
from PyQt5.QtGui import *
|
||||||
from PyQt5.QtWidgets import (QVBoxLayout, QGridLayout, QPushButton)
|
from PyQt5.QtWidgets import (QVBoxLayout, QGridLayout, QPushButton)
|
||||||
from electrum.plugins import BasePlugin, hook
|
from electrum_zcash.plugins import BasePlugin, hook
|
||||||
from electrum.i18n import _
|
from electrum_zcash.i18n import _
|
||||||
import random
|
import random
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue