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
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())
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
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
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
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)
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()
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()
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
def synchronize(self): # synchronize existing accounts BIP32_Wallet.synchronize(self)
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)
def __init__(self, storage): BIP32_Wallet.__init__(self, storage) self.wallet_type = '2fa' self.m = 2 self.n = 3
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)