当前位置: 首页>>代码示例>>Python>>正文


Python Wallet.add_cold_seed方法代码示例

本文整理汇总了Python中electrum_ltc.Wallet.add_cold_seed方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.add_cold_seed方法的具体用法?Python Wallet.add_cold_seed怎么用?Python Wallet.add_cold_seed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在electrum_ltc.Wallet的用法示例。


在下文中一共展示了Wallet.add_cold_seed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from electrum_ltc import Wallet [as 别名]
# 或者: from electrum_ltc.Wallet import add_cold_seed [as 别名]

#.........这里部分代码省略.........
                text = self.enter_seed_dialog(MSG_ENTER_ANYTHING, None)
                if not text:
                    return
                if Wallet.is_seed(text):
                    password = self.password_dialog()
                    wallet = Wallet.from_seed(text, self.storage)
                    wallet.add_seed(text, password)
                    wallet.create_accounts(password)
                elif Wallet.is_mpk(text):
                    wallet = Wallet.from_mpk(text, self.storage)
                elif Wallet.is_address(text):
                    wallet = Wallet.from_address(text, self.storage)
                elif Wallet.is_private_key(text):
                    wallet = Wallet.from_private_key(text, self.storage)
                else:
                    raise

            elif t in ['2fa', '2of2']:
                r = self.multi_seed_dialog(1)
                if not r: 
                    return
                text1, text2 = r
                password = self.password_dialog()
                if t == '2of2':
                    wallet = Wallet_2of2(self.storage)
                elif t == '2of3':
                    wallet = Wallet_2of3(self.storage)
                elif t == '2fa':
                    wallet = Wallet_2of3(self.storage)

                if Wallet.is_seed(text1):
                    wallet.add_seed(text1, password)
                    if Wallet.is_seed(text2):
                        wallet.add_cold_seed(text2, password)
                    else:
                        wallet.add_master_public_key("cold/", text2)

                elif Wallet.is_mpk(text1):
                    if Wallet.is_seed(text2):
                        wallet.add_seed(text2, password)
                        wallet.add_master_public_key("cold/", text1)
                    else:
                        wallet.add_master_public_key("m/", text1)
                        wallet.add_master_public_key("cold/", text2)

                if t == '2fa':
                    run_hook('restore_third_key', wallet, self)

                wallet.create_account()

            elif t in ['2of3']:
                r = self.multi_seed_dialog(2)
                if not r: 
                    return
                text1, text2, text3 = r
                password = self.password_dialog()
                wallet = Wallet_2of3(self.storage)

                if Wallet.is_seed(text1):
                    wallet.add_seed(text1, password)
                    if Wallet.is_seed(text2):
                        wallet.add_cold_seed(text2, password)
                    else:
                        wallet.add_master_public_key("cold/", text2)

                elif Wallet.is_mpk(text1):
开发者ID:mariogrip,项目名称:electrum-ltc,代码行数:70,代码来源:installwizard.py

示例2: run

# 需要导入模块: from electrum_ltc import Wallet [as 别名]
# 或者: from electrum_ltc.Wallet import add_cold_seed [as 别名]
    def run(self, action = None):

        if action is None:
            action = self.restore_or_create()

        if action is None: 
            return

        if action == 'create':            
            t = self.choose_wallet_type()
            if not t:
                return 

            if t == '2of3':
                run_hook('create_cold_seed', self.storage, self)
                return


        if action in ['create', 'create2of3']:

            wallet = Wallet(self.storage)
            seed = wallet.make_seed()
            sid = 'hot' if action == 'create2of3' else None
            if not self.show_seed(seed, sid):
                return
            if not self.verify_seed(seed, sid):
                return
            password = self.password_dialog()
            wallet.save_seed(seed, password)

            if action == 'create2of3':
                run_hook('create_third_key', wallet, self)
                if not wallet.master_public_keys.get("remote/"):
                    return

            wallet.create_accounts(password)
            # generate first addresses offline
            self.waiting_dialog(wallet.synchronize)

        elif action == 'restore':
            t = self.choose_wallet_type()
            if not t: 
                return

            if t == 'standard':
                text = self.enter_seed_dialog(True, None)
                if Wallet.is_seed(text):
                    password = self.password_dialog()
                    wallet = Wallet.from_seed(text, self.storage)
                    wallet.save_seed(text, password)
                    wallet.create_accounts(password)
                elif Wallet.is_mpk(text):
                    wallet = Wallet.from_mpk(text, self.storage)
                else:
                    raise

            elif t in ['2of2', '2of3']:
                r = self.double_seed_dialog()
                if not r: 
                    return
                text1, text2 = r
                password = self.password_dialog()
                wallet = Wallet_2of3(self.storage)

                if Wallet.is_seed(text1):
                    wallet.add_seed(text1, password)
                    if Wallet.is_seed(text2):
                        wallet.add_cold_seed(text2, password)
                    else:
                        wallet.add_master_public_key("cold/", text2)

                elif Wallet.is_mpk(text1):
                    if Wallet.is_seed(text2):
                        wallet.add_seed(text2, password)
                        wallet.add_master_public_key("cold/", text1)
                    else:
                        wallet.add_master_public_key("m/", text1)
                        wallet.add_master_public_key("cold/", text2)

                run_hook('restore_third_key', wallet, self)

                wallet.create_accounts(None)

            else:
                raise




        else: raise
                
        #if not self.config.get('server'):
        if self.network:
            if self.network.interfaces:
                self.network_dialog()
            else:
                QMessageBox.information(None, _('Warning'), _('You are offline'), _('OK'))
                self.network.stop()
                self.network = None

#.........这里部分代码省略.........
开发者ID:RagnarDanneskjold,项目名称:electrum-ltc,代码行数:103,代码来源:installwizard.py


注:本文中的electrum_ltc.Wallet.add_cold_seed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。