def show_address(self, wallet: Abstract_Wallet, address: Address) -> None: if not self.is_mobile_paired(): return keystore = cast(Hardware_KeyStore, wallet.get_keystore()) change, index = wallet.get_address_index(address) keypath = '%s/%d/%d' % (keystore.derivation, change, index) xpub = self.get_client(keystore)._get_xpub(keypath) verify_request_payload = { "type": 'p2pkh', "echo": xpub['echo'], } self.comserver_post_notification(verify_request_payload)
def get_tx_status(wallet: Abstract_Wallet, tx_hash: str, height: int, conf: int, timestamp: Union[bool, int]) -> TxStatus: if not wallet.have_transaction_data(tx_hash): return TxStatus.MISSING if wallet.is_coinbase_transaction(tx_hash): if height + COINBASE_MATURITY > wallet.get_local_height(): return TxStatus.UNMATURED elif conf == 0: if height > 0: return TxStatus.UNVERIFIED return TxStatus.UNCONFIRMED return TxStatus.FINAL
def _create_window_for_wallet(self, wallet: Abstract_Wallet): if wallet.is_hardware_wallet(): dialogs.show_named('hardware-wallet-quality') w = ElectrumWindow(wallet) self.windows.append(w) self._build_tray_menu() self.window_opened_signal.emit(w) return w
def show_button(self, wallet: Abstract_Wallet, tx: Transaction) -> bool: if tx.is_complete() or wallet.can_sign(tx): return False return any(self.is_theirs(wallet, item, tx) for item in self.items)