1
0

update ledger plugin

This commit is contained in:
ThomasV
2016-08-21 22:44:42 +02:00
parent eb60e0d2e0
commit 9c7fd44b58
3 changed files with 70 additions and 65 deletions

View File

@@ -25,12 +25,21 @@ class Plugin(LedgerPlugin):
window.show_error(_("Ledger device not detected.\nContinuing in watching-only mode."))
wallet.force_watching_only = True
def on_create_wallet(self, keystore, wizard):
assert type(keystore) == self.keystore_class
keystore.handler = BTChipQTHandler(wizard)
keystore.init_xpub()
print keystore.xpub
wizard.create_wallet(keystore, None)
def create_keystore(self, hw_type, derivation, wizard):
from electrum.keystore import hardware_keystore
# create keystore
handler = BTChipQTHandler(wizard)
client = self.get_client()
xpub = self.get_public_key(derivation)
d = {
'xpub': self.xpub,
'type': 'hardware',
'hw_type': hw_type,
'derivation': derivation
}
k = hardware_keystore(hw_type, d)
return k
class BTChipQTHandler(QtHandlerBase):