add card for when monero wallet is in broken state (#1578)

This commit is contained in:
cyan
2024-08-07 14:40:31 +03:00
committed by GitHub
parent 5e944a8bf7
commit e58d87e94c
2 changed files with 31 additions and 0 deletions
@@ -335,6 +335,23 @@ abstract class DashboardViewModelBase with Store {
wallet.type == WalletType.wownero ||
wallet.type == WalletType.haven;
@computed
List<String> get isMoneroWalletBrokenReasons {
if (wallet.type != WalletType.monero) return [];
final keys = monero!.getKeys(wallet);
List<String> errors = [
if (keys['privateSpendKey'] == List.generate(64, (index) => "0").join("")) "Private spend key is 0",
if (keys['privateViewKey'] == List.generate(64, (index) => "0").join("")) "private view key is 0",
if (keys['publicSpendKey'] == List.generate(64, (index) => "0").join("")) "public spend key is 0",
if (keys['publicViewKey'] == List.generate(64, (index) => "0").join("")) "private view key is 0",
if (wallet.seed == null) "wallet seed is null",
if (wallet.seed == "") "wallet seed is empty",
if (monero!.getSubaddressList(wallet).getAll(wallet)[0].address == "41d7FXjswpK1111111111111111111111111111111111111111111111111111111111111111111111111111112KhNi4")
"primary address is invalid, you won't be able to receive / spend funds",
];
return errors;
}
@computed
bool get hasSilentPayments => wallet.type == WalletType.bitcoin && !wallet.isHardwareWallet;