本文整理汇总了Python中electrum_ltc.Wallet.from_text方法的典型用法代码示例。如果您正苦于以下问题:Python Wallet.from_text方法的具体用法?Python Wallet.from_text怎么用?Python Wallet.from_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类electrum_ltc.Wallet
的用法示例。
在下文中一共展示了Wallet.from_text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: restore
# 需要导入模块: from electrum_ltc import Wallet [as 别名]
# 或者: from electrum_ltc.Wallet import from_text [as 别名]
def restore(self, t):
if t == 'standard':
text = self.enter_seed_dialog(MSG_ENTER_ANYTHING, None)
if not text:
return
password = self.password_dialog() if Wallet.is_seed(text) or Wallet.is_xprv(text) or Wallet.is_private_key(text) else None
wallet = Wallet.from_text(text, password, self.storage)
elif re.match('(\d+)of(\d+)', t):
n = int(re.match('(\d+)of(\d+)', t).group(2))
key_list = self.multi_seed_dialog(n - 1)
if not key_list:
return
password = self.password_dialog() if any(map(lambda x: Wallet.is_seed(x) or Wallet.is_xprv(x), key_list)) else None
wallet = Wallet.from_multisig(key_list, password, self.storage, t)
else:
self.storage.put('wallet_type', t, False)
# call the constructor to load the plugin (side effect)
Wallet(self.storage)
wallet = always_hook('installwizard_restore', self, self.storage)
if not wallet:
util.print_error("no wallet")
return
# create first keys offline
self.waiting_dialog(wallet.synchronize)
return wallet
示例2: task
# 需要导入模块: from electrum_ltc import Wallet [as 别名]
# 或者: from electrum_ltc.Wallet import from_text [as 别名]
def task():
if Wallet.is_seed(text):
self.wallet.add_seed(text, password)
self.wallet.create_master_keys(password)
else:
self.wallet = Wallet.from_text(text, None, self.storage)
self.wallet.create_main_account()
self.wallet.synchronize()