コード例 #1
0
ファイル: trustedcoin.py プロジェクト: zeroharbor/electrum
 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
ファイル: trustedcoin.py プロジェクト: phamthaithinh/electrum
 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
ファイル: trustedcoin.py プロジェクト: zeroharbor/electrum
 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
ファイル: trustedcoin.py プロジェクト: phamthaithinh/electrum
 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
ファイル: trustedcoin.py プロジェクト: nmarley/electrum
 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
ファイル: trustedcoin.py プロジェクト: bontaq/electrum
 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
ファイル: installwizard.py プロジェクト: ChainEXS/electrum
 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
ファイル: trustedcoin.py プロジェクト: phamthaithinh/electrum
 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
ファイル: btchipwallet.py プロジェクト: edb1rd/BTC
 def synchronize(self):
     # synchronize existing accounts
     BIP32_Wallet.synchronize(self)
コード例 #14
0
ファイル: base_wizard.py プロジェクト: CeeCeeCee/electrum
 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
ファイル: trustedcoin.py プロジェクト: keepkey/electrum
 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
ファイル: base_wizard.py プロジェクト: maksverver/electrum
 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