Пример #1
0
 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
0
 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
Пример #3
0
 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())
Пример #4
0
 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())
Пример #5
0
 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
Пример #6
0
 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
Пример #7
0
 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
Пример #8
0
 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)
Пример #9
0
 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()
Пример #10
0
    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()
Пример #11
0
 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
Пример #12
0
 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
Пример #13
0
 def synchronize(self):
     # synchronize existing accounts
     BIP32_Wallet.synchronize(self)
Пример #14
0
 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)
Пример #15
0
 def synchronize(self):
     # synchronize existing accounts
     BIP32_Wallet.synchronize(self)
Пример #16
0
 def __init__(self, storage):
     BIP32_Wallet.__init__(self, storage)
     self.wallet_type = '2fa'
     self.m = 2
     self.n = 3
Пример #17
0
 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)
Пример #18
0
 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)
Пример #19
0
 def __init__(self, storage):
     BIP32_Wallet.__init__(self, storage)
     self.wallet_type = '2fa'
     self.m = 2
     self.n = 3