本文整理汇总了Python中electrum.wallet.BIP32_Wallet类的典型用法代码示例。如果您正苦于以下问题:Python BIP32_Wallet类的具体用法?Python BIP32_Wallet怎么用?Python BIP32_Wallet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BIP32_Wallet类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, storage):
BIP32_Wallet.__init__(self, storage)
self.wallet_type = '2fa'
self.m = 2
self.n = 3
self.is_billing = False
self.billing_info = None
示例2: sign_transaction
def sign_transaction(self, tx, password):
BIP32_Wallet.sign_transaction(self, tx, password)
if tx.is_complete():
return
if not self.auth_code:
self.print_error("sign_transaction: no auth code")
return
long_user_id, short_id = self.get_user_id()
tx_dict = tx.as_dict()
raw_tx = tx_dict["hex"]
r = server.sign(short_id, raw_tx, self.auth_code)
if r:
raw_tx = r.get('transaction')
tx.update(raw_tx)
self.print_error("twofactor: is complete", tx.is_complete())
示例3: make_unsigned_transaction
def make_unsigned_transaction(self, *args):
tx = BIP32_Wallet.make_unsigned_transaction(self, *args)
fee = self.extra_fee(tx)
if fee:
address = self.billing_info["billing_address"]
tx.outputs.append(("address", address, fee))
return tx
示例4: make_unsigned_transaction
def make_unsigned_transaction(self, coins, outputs, config,
fixed_fee=None, change_addr=None):
tx = BIP32_Wallet.make_unsigned_transaction(
self, coins, outputs, config, fixed_fee, change_addr)
# Plain TX was good. Now add trustedcoin fee.
fee = self.extra_fee()
if fee:
address = self.billing_info['billing_address']
outputs = outputs + [(TYPE_ADDRESS, address, fee)]
try:
return BIP32_Wallet.make_unsigned_transaction(
self, coins, outputs, config, fixed_fee, change_addr)
except NotEnoughFunds:
# trustedcoin won't charge if the total inputs is
# lower than their fee
if tx.input_value() >= fee:
raise
return tx
示例5: create
def create(self):
from electrum.wallet import BIP32_Wallet
seed = BIP32_Wallet.make_seed()
msg = _("If you forget your PIN or lose your device, your seed phrase will be the "
"only way to recover your funds.")
def on_ok(_dlg, _btn):
_dlg.close()
if _btn == _dlg.ids.confirm:
self.run('confirm_seed', (seed,))
else:
self.run('new')
ShowSeedDialog(message=msg, seed_text=seed, on_release=on_ok).open()
示例6: make_unsigned_transaction
def make_unsigned_transaction(self, coins, outputs, config,
fixed_fee=None, change_addr=None):
mk_tx = lambda o: BIP32_Wallet.make_unsigned_transaction(
self, coins, o, config, fixed_fee, change_addr)
fee = self.extra_fee()
if fee:
address = self.billing_info['billing_address']
fee_output = (TYPE_ADDRESS, address, fee)
try:
tx = mk_tx(outputs + [fee_output])
except NotEnoughFunds:
# trustedcoin won't charge if the total inputs is
# lower than their fee
tx = mk_tx(outputs)
if tx.input_value() >= fee:
raise
self.print_error("not charging for this tx")
else:
tx = mk_tx(outputs)
return tx
示例7: synchronize
def synchronize(self):
# synchronize existing accounts
BIP32_Wallet.synchronize(self)
示例8: __init__
def __init__(self, storage):
BIP32_Wallet.__init__(self, storage)
self.wallet_type = '2fa'
self.m = 2
self.n = 3
示例9: create_seed
def create_seed(self):
from electrum.wallet import BIP32_Wallet
seed = BIP32_Wallet.make_seed()
self.show_seed_dialog(run_next=self.confirm_seed, seed_text=seed)
示例10: create_seed
def create_seed(self):
from electrum.wallet import BIP32_Wallet
seed = BIP32_Wallet.make_seed()
msg = _("If you forget your PIN or lose your device, your seed phrase will be the "
"only way to recover your funds.")
self.show_seed_dialog(run_prev=self.new, run_next=self.confirm_seed, message=msg, seed_text=seed)