def on_verify_restore_ok(self, wallet, _dlg, btn, restore=False):
        if btn in (_dlg.ids.back, _dlg.ids.but_close) :
            _dlg.close()
            Factory.CreateRestoreDialog(
                on_release=self.on_creatrestore_complete).open()
            return

        seed = self.get_seed_text(_dlg.ids.text_input_seed)
        if not seed:
            return app.show_error(_("No seed!"), duration=.5)

        _dlg.close()

        if Wallet.is_seed(seed):
            return self.password_dialog(wallet=wallet, mode='restore',
                                        seed=seed)
        elif Wallet.is_mpk(seed):
            wallet = Wallet.from_mpk(seed, self.storage)
        elif Wallet.is_address(seed):
            wallet = Wallet.from_address(seed, self.storage)
        elif Wallet.is_private_key(seed):
            wallet = Wallet.from_private_key(seed, self.storage)
        else:
            return app.show_error(_('Not a valid seed. App will now exit'),
                                  exit=True, modal=True, duration=.5)
        return
Пример #2
0
    def on_verify_restore_ok(self, wallet, _dlg, btn, restore=False):
        if btn in (_dlg.ids.back, _dlg.ids.but_close):
            _dlg.close()
            Factory.CreateRestoreDialog(
                on_release=self.on_creatrestore_complete).open()
            return

        seed = self.get_seed_text(_dlg.ids.text_input_seed)
        if not seed:
            return app.show_error(_("No seed!"), duration=.5)

        _dlg.close()

        if Wallet.is_seed(seed):
            return self.password_dialog(wallet=wallet,
                                        mode='restore',
                                        seed=seed)
        elif Wallet.is_mpk(seed):
            wallet = Wallet.from_mpk(seed, self.storage)
        elif Wallet.is_address(seed):
            wallet = Wallet.from_address(seed, self.storage)
        elif Wallet.is_private_key(seed):
            wallet = Wallet.from_private_key(seed, self.storage)
        else:
            return app.show_error(_('Not a valid seed. App will now exit'),
                                  exit=True,
                                  modal=True,
                                  duration=.5)
        return
 def is_any(self, seed_e):
     text = self.get_seed_text(seed_e)
     return (Wallet.is_seed(text) or
             Wallet.is_mpk(text) or
             Wallet.is_address(text) or
             Wallet.is_private_key(text))
Пример #4
0
 def is_any(self, seed_e):
     text = self.get_seed_text(seed_e)
     return (Wallet.is_seed(text) or Wallet.is_mpk(text)
             or Wallet.is_address(text) or Wallet.is_private_key(text))