def initialize_completer(self): english_list = Mnemonic('en').wordlist old_list = electrum_ltc.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)
def __init__(self, wizard, **kwargs): super(RestoreSeedDialog, self).__init__(wizard, **kwargs) self._test = kwargs['test'] from electrum_ltc.mnemonic import Mnemonic from electrum_ltc.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
def initialize_completer(self): bip39_english_list = Mnemonic('en').wordlist old_list = old_mnemonic.wordlist only_old_list = set(old_list) - set(bip39_english_list) self.wordlist = list(bip39_english_list) + list(only_old_list) # concat both lists self.wordlist.sort() class CompleterDelegate(QStyledItemDelegate): def initStyleOption(self, option, index): super().initStyleOption(option, index) # Some people complained that due to merging the two word lists, # it is difficult to restore from a metal backup, as they planned # to rely on the "4 letter prefixes are unique in bip39 word list" property. # So we color words that are only in old list. if option.text in only_old_list: # yellow bg looks ~ok on both light/dark theme, regardless if (un)selected option.backgroundBrush = ColorScheme.YELLOW.as_color(background=True) self.completer = QCompleter(self.wordlist) delegate = CompleterDelegate(self.seed_e) self.completer.popup().setItemDelegate(delegate) self.seed_e.set_completer(self.completer)
def __init__(self, **kwargs): super(RestoreSeedDialog, self).__init__(**kwargs) self._test = kwargs['test'] from electrum_ltc.mnemonic import Mnemonic from electrum_ltc.old_mnemonic import words as old_wordlist self.words = set(Mnemonic('en').wordlist).union(set(old_wordlist))
def derive_bip32_seed(self, seed, passphrase): self.bip32_seed= Mnemonic('en').mnemonic_to_seed(seed, passphrase)
def create_seed(self, wizard): wizard.seed_type = 'standard' wizard.opt_bip39 = False seed = Mnemonic('en').make_seed(wizard.seed_type) f = lambda x: self.request_passphrase(wizard, seed, x) wizard.show_seed_dialog(run_next=f, seed_text=seed)
def create_seed(self): from electrum_ltc.mnemonic import Mnemonic seed = Mnemonic('en').make_seed() self.opt_bip39 = False f = lambda x: self.request_passphrase(seed, x) self.show_seed_dialog(run_next=f, seed_text=seed)