Beispiel #1
0
 def get_xpub(self, device_id, derivation, xtype, wizard):
     if xtype not in self.SUPPORTED_XTYPES:
         raise RuntimeError(_('This type of script is not supported with {}.').format(self.device))
     devmgr = self.device_manager()
     client = devmgr.client_by_id(device_id)
     client.handler = wizard
     xpub = client.get_xpub(derivation, xtype)
     client.used()
     return xpub
Beispiel #2
0
 def get_client(self, keystore, force_pair=True):
     devmgr = self.device_manager()
     handler = keystore.handler
     with devmgr.hid_lock:
         client = devmgr.client_for_keystore(self, handler, keystore, force_pair)
     # returns the client for a given keystore. can use xpub
     if client:
         client.used()
     return client
Beispiel #3
0
 def get_xpub(self, device_id, derivation, xtype, wizard):
     if xtype not in self.SUPPORTED_XTYPES:
         raise RuntimeError(
             _('This type of script is not supported with {}.').format(
                 self.device))
     client = self.scan_and_create_client_for_device(device_id=device_id,
                                                     wizard=wizard)
     xpub = client.get_xpub(derivation, xtype)
     client.used()
     return xpub
Beispiel #4
0
 def setup_device(self, device_info, wizard, purpose):
     device_id = device_info.device.id_
     client = self.scan_and_create_client_for_device(device_id=device_id,
                                                     wizard=wizard)
     if not device_info.initialized:
         self.initialize_device(device_id, wizard, client.handler)
     wizard.run_task_without_blocking_gui(
         task=lambda: client.get_xpub("m", 'standard'))
     client.used()
     return client
Beispiel #5
0
 def setup_device(self, device_info, wizard, purpose):
     devmgr = self.device_manager()
     device_id = device_info.device.id_
     client = devmgr.client_by_id(device_id)
     if client is None:
         raise RuntimeError(_('Failed to create a client for this device.') + '\n' +
                            _('Make sure it is in the correct state.'))
     # fixme: we should use: client.handler = wizard
     client.handler = self.create_handler(wizard)
     if not device_info.initialized:
         self.initialize_device(device_id, wizard, client.handler)
     client.get_xpub('m', 'standard')
     client.used()