Пример #1
0
    def _on_account_change(self, new_account_id: int, new_account: AbstractAccount) -> None:
        self._account_id = new_account_id
        self._account = new_account

        script_type = new_account.get_default_script_type()

        # Hardware wallets will not sign OP_FALSE OP_RETURN.
        self._direct_splitting_enabled = self._account.is_deterministic() and \
            new_account.can_spend() and \
            not new_account.involves_hardware_wallet()
        # The faucet requires an address to send to. There are only P2PKH addresses.
        self._faucet_splitting_enabled = self._account.is_deterministic() and \
          script_type == ScriptType.P2PKH
        self.update_layout()
Пример #2
0
 def _can_view_secured_data(self, account: AbstractAccount) -> None:
     return not account.is_watching_only() and not isinstance(account, MultisigAccount) \
         and not account.involves_hardware_wallet() \
         and account.type() != AccountType.IMPORTED_PRIVATE_KEY