Beispiel #1
0
 def get_xkeys(self, seed, t, passphrase, derivation):
     assert is_any_2fa_seed_type(t)
     xtype = 'standard' if t == '2fa' else 'p2wsh'
     bip32_seed = Mnemonic.mnemonic_to_seed(seed, passphrase)
     rootnode = BIP32Node.from_rootseed(bip32_seed, xtype=xtype)
     child_node = rootnode.subkey_at_private_derivation(derivation)
     return child_node.to_xprv(), child_node.to_xpub()
Beispiel #2
0
 def initialize_completer(self):
     english_list = Mnemonic('en').wordlist
     old_list = electrum_nyc.old_mnemonic.words
     self.wordlist = english_list + list(
         set(old_list) - set(english_list))  #concat both lists
     self.wordlist.sort()
     self.completer = QCompleter(self.wordlist)
     self.seed_e.set_completer(self.completer)
Beispiel #3
0
 def __init__(self, wizard, **kwargs):
     super(RestoreSeedDialog, self).__init__(wizard, **kwargs)
     self._test = kwargs['test']
     from electrum_nyc.mnemonic import Mnemonic
     from electrum_nyc.old_mnemonic import words as old_wordlist
     self.words = set(Mnemonic('en').wordlist).union(set(old_wordlist))
     self.ids.text_input_seed.text = test_seed if is_test else ''
     self.message = _(
         'Please type your seed phrase using the virtual keyboard.')
     self.title = _('Enter Seed')
     self.ext = False
Beispiel #4
0
 def make_seed(self, seed_type):
     if not is_any_2fa_seed_type(seed_type):
         raise Exception(f'unexpected seed type: {seed_type}')
     return Mnemonic('english').make_seed(seed_type=seed_type, num_bits=128)