diff --git a/lib/models/node_model.dart b/lib/models/node_model.dart index a07c9a2dd..a945a5eb7 100644 --- a/lib/models/node_model.dart +++ b/lib/models/node_model.dart @@ -9,6 +9,7 @@ */ import 'package:hive/hive.dart'; + import '../utilities/default_nodes.dart'; import '../utilities/flutter_secure_storage_interface.dart'; @@ -38,6 +39,10 @@ class NodeModel { final bool isDown; // @HiveField(10) final bool? trusted; + // @HiveField(11) + final bool torEnabled; + // @HiveField(12) + final bool plainEnabled; NodeModel({ required this.host, @@ -49,6 +54,8 @@ class NodeModel { required this.coinName, required this.isFailover, required this.isDown, + required this.torEnabled, + required this.plainEnabled, this.loginName, this.trusted, }); @@ -64,6 +71,8 @@ class NodeModel { bool? isFailover, bool? isDown, bool? trusted, + bool? torEnabled, + bool? plainEnabled, }) { return NodeModel( host: host ?? this.host, @@ -77,6 +86,8 @@ class NodeModel { isFailover: isFailover ?? this.isFailover, isDown: isDown ?? this.isDown, trusted: trusted ?? this.trusted, + torEnabled: torEnabled ?? this.torEnabled, + plainEnabled: plainEnabled ?? this.plainEnabled, ); } @@ -98,6 +109,8 @@ class NodeModel { map['isFailover'] = isFailover; map['isDown'] = isDown; map['trusted'] = trusted; + map['torEnabled'] = torEnabled; + map['plainEnabled'] = plainEnabled; return map; } diff --git a/lib/models/type_adaptors/node_model.g.dart b/lib/models/type_adaptors/node_model.g.dart index 597468c56..cc771ba09 100644 --- a/lib/models/type_adaptors/node_model.g.dart +++ b/lib/models/type_adaptors/node_model.g.dart @@ -28,13 +28,15 @@ class NodeModelAdapter extends TypeAdapter { isFailover: fields[8] as bool, isDown: fields[9] as bool, trusted: fields[10] as bool?, + torEnabled: fields[11] as bool? ?? true, + plainEnabled: fields[12] as bool? ?? true, ); } @override void write(BinaryWriter writer, NodeModel obj) { writer - ..writeByte(11) + ..writeByte(13) ..writeByte(0) ..write(obj.id) ..writeByte(1) @@ -56,7 +58,11 @@ class NodeModelAdapter extends TypeAdapter { ..writeByte(9) ..write(obj.isDown) ..writeByte(10) - ..write(obj.trusted); + ..write(obj.trusted) + ..writeByte(11) + ..write(obj.torEnabled) + ..writeByte(12) + ..write(obj.plainEnabled); } @override diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart index 6d99938b3..6846686ab 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart @@ -1272,6 +1272,8 @@ abstract class SWB { loginName: node['loginName'] as String?, isFailover: node['isFailover'] as bool, isDown: node['isDown'] as bool, + torEnabled: node['torEnabled'] as bool? ?? true, + plainEnabled: node['plainEnabled'] as bool? ?? true, ), node["password"] as String?, true, diff --git a/lib/services/node_service.dart b/lib/services/node_service.dart index f2e640a67..306cb5d6a 100644 --- a/lib/services/node_service.dart +++ b/lib/services/node_service.dart @@ -12,6 +12,7 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:http/http.dart'; + import '../app_config.dart'; import '../db/hive/db.dart'; import '../models/node_model.dart'; @@ -253,7 +254,9 @@ class NodeService extends ChangeNotifier { enabled: true, coinName: coin.identifier, isFailover: true, + torEnabled: nodeMap["torEnabled"] == "true", isDown: nodeMap["isDown"] == "true", + plainEnabled: nodeMap["plainEnabled"] == "true", ); final currentNode = getNodeById(id: nodeMap["id"] as String); if (currentNode != null) { diff --git a/lib/wallets/crypto_currency/coins/banano.dart b/lib/wallets/crypto_currency/coins/banano.dart index 4bb5184d2..c32adb8f4 100644 --- a/lib/wallets/crypto_currency/coins/banano.dart +++ b/lib/wallets/crypto_currency/coins/banano.dart @@ -77,6 +77,8 @@ class Banano extends NanoCurrency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/bitcoin.dart b/lib/wallets/crypto_currency/coins/bitcoin.dart index 3b75e2186..c3dfa4bb8 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin.dart @@ -239,6 +239,8 @@ class Bitcoin extends Bip39HDCurrency coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -252,6 +254,8 @@ class Bitcoin extends Bip39HDCurrency coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test4: @@ -265,6 +269,8 @@ class Bitcoin extends Bip39HDCurrency coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/bitcoin_frost.dart b/lib/wallets/crypto_currency/coins/bitcoin_frost.dart index 64c90a719..4c75a17b6 100644 --- a/lib/wallets/crypto_currency/coins/bitcoin_frost.dart +++ b/lib/wallets/crypto_currency/coins/bitcoin_frost.dart @@ -73,6 +73,8 @@ class BitcoinFrost extends FrostCurrency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -86,6 +88,8 @@ class BitcoinFrost extends FrostCurrency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test4: @@ -99,6 +103,8 @@ class BitcoinFrost extends FrostCurrency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/bitcoincash.dart b/lib/wallets/crypto_currency/coins/bitcoincash.dart index 9d9a291a8..0d60de787 100644 --- a/lib/wallets/crypto_currency/coins/bitcoincash.dart +++ b/lib/wallets/crypto_currency/coins/bitcoincash.dart @@ -298,6 +298,8 @@ class Bitcoincash extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -311,6 +313,8 @@ class Bitcoincash extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/cardano.dart b/lib/wallets/crypto_currency/coins/cardano.dart index e9cf17c65..1f8fac465 100644 --- a/lib/wallets/crypto_currency/coins/cardano.dart +++ b/lib/wallets/crypto_currency/coins/cardano.dart @@ -77,6 +77,8 @@ class Cardano extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: @@ -91,7 +93,8 @@ class Cardano extends Bip39Currency { int get fractionDigits => 6; @override - String get genesisHash => "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f"; + String get genesisHash => + "f0f7892b5c333cffc4b3c4344de48af4cc63f55e44936196f365a9ef2244134f"; @override bool get hasBuySupport => false; diff --git a/lib/wallets/crypto_currency/coins/dash.dart b/lib/wallets/crypto_currency/coins/dash.dart index 366bbbcc8..dc508c4cc 100644 --- a/lib/wallets/crypto_currency/coins/dash.dart +++ b/lib/wallets/crypto_currency/coins/dash.dart @@ -189,6 +189,8 @@ class Dash extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/dogecoin.dart b/lib/wallets/crypto_currency/coins/dogecoin.dart index 1de949edc..ad1899fb6 100644 --- a/lib/wallets/crypto_currency/coins/dogecoin.dart +++ b/lib/wallets/crypto_currency/coins/dogecoin.dart @@ -189,6 +189,8 @@ class Dogecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -202,6 +204,8 @@ class Dogecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/ecash.dart b/lib/wallets/crypto_currency/coins/ecash.dart index ad1ec4f6c..84ae7bfb8 100644 --- a/lib/wallets/crypto_currency/coins/ecash.dart +++ b/lib/wallets/crypto_currency/coins/ecash.dart @@ -289,6 +289,8 @@ class Ecash extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/epiccash.dart b/lib/wallets/crypto_currency/coins/epiccash.dart index 6e47eb411..2c3dbd437 100644 --- a/lib/wallets/crypto_currency/coins/epiccash.dart +++ b/lib/wallets/crypto_currency/coins/epiccash.dart @@ -80,6 +80,8 @@ class Epiccash extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/ethereum.dart b/lib/wallets/crypto_currency/coins/ethereum.dart index 5c0f5b06d..32eb754e6 100644 --- a/lib/wallets/crypto_currency/coins/ethereum.dart +++ b/lib/wallets/crypto_currency/coins/ethereum.dart @@ -57,6 +57,8 @@ class Ethereum extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); @override diff --git a/lib/wallets/crypto_currency/coins/firo.dart b/lib/wallets/crypto_currency/coins/firo.dart index d8a6381b2..bbe83e526 100644 --- a/lib/wallets/crypto_currency/coins/firo.dart +++ b/lib/wallets/crypto_currency/coins/firo.dart @@ -231,6 +231,8 @@ class Firo extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -257,6 +259,8 @@ class Firo extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/litecoin.dart b/lib/wallets/crypto_currency/coins/litecoin.dart index 1c09a0c2a..46cd1d3ee 100644 --- a/lib/wallets/crypto_currency/coins/litecoin.dart +++ b/lib/wallets/crypto_currency/coins/litecoin.dart @@ -220,6 +220,8 @@ class Litecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -233,6 +235,8 @@ class Litecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/monero.dart b/lib/wallets/crypto_currency/coins/monero.dart index fba0e1701..ec3d9bae1 100644 --- a/lib/wallets/crypto_currency/coins/monero.dart +++ b/lib/wallets/crypto_currency/coins/monero.dart @@ -72,6 +72,8 @@ class Monero extends CryptonoteCurrency { isFailover: true, isDown: false, trusted: true, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/namecoin.dart b/lib/wallets/crypto_currency/coins/namecoin.dart index 9f0134b9a..aab17df11 100644 --- a/lib/wallets/crypto_currency/coins/namecoin.dart +++ b/lib/wallets/crypto_currency/coins/namecoin.dart @@ -102,6 +102,8 @@ class Namecoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet support. diff --git a/lib/wallets/crypto_currency/coins/nano.dart b/lib/wallets/crypto_currency/coins/nano.dart index 32f49cbec..c5d9c9446 100644 --- a/lib/wallets/crypto_currency/coins/nano.dart +++ b/lib/wallets/crypto_currency/coins/nano.dart @@ -77,6 +77,8 @@ class Nano extends NanoCurrency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/particl.dart b/lib/wallets/crypto_currency/coins/particl.dart index e83eaf4ed..80d6104c3 100644 --- a/lib/wallets/crypto_currency/coins/particl.dart +++ b/lib/wallets/crypto_currency/coins/particl.dart @@ -97,6 +97,8 @@ class Particl extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); // case CryptoCurrencyNetwork.test: // TODO: [prio=low] Add testnet. diff --git a/lib/wallets/crypto_currency/coins/peercoin.dart b/lib/wallets/crypto_currency/coins/peercoin.dart index ba291cc14..6074d093c 100644 --- a/lib/wallets/crypto_currency/coins/peercoin.dart +++ b/lib/wallets/crypto_currency/coins/peercoin.dart @@ -103,6 +103,8 @@ class Peercoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -116,6 +118,8 @@ class Peercoin extends Bip39HDCurrency with ElectrumXCurrencyInterface { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/solana.dart b/lib/wallets/crypto_currency/coins/solana.dart index 6cfc185e1..3bf00c358 100644 --- a/lib/wallets/crypto_currency/coins/solana.dart +++ b/lib/wallets/crypto_currency/coins/solana.dart @@ -55,6 +55,8 @@ class Solana extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: throw Exception("Unsupported network: $network"); diff --git a/lib/wallets/crypto_currency/coins/stellar.dart b/lib/wallets/crypto_currency/coins/stellar.dart index f0606f1f0..75fceb211 100644 --- a/lib/wallets/crypto_currency/coins/stellar.dart +++ b/lib/wallets/crypto_currency/coins/stellar.dart @@ -68,6 +68,8 @@ class Stellar extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); case CryptoCurrencyNetwork.test: @@ -81,6 +83,8 @@ class Stellar extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/tezos.dart b/lib/wallets/crypto_currency/coins/tezos.dart index e99831ca5..ff9b167c9 100644 --- a/lib/wallets/crypto_currency/coins/tezos.dart +++ b/lib/wallets/crypto_currency/coins/tezos.dart @@ -118,6 +118,8 @@ class Tezos extends Bip39Currency { coinName: identifier, isFailover: true, isDown: false, + torEnabled: true, + plainEnabled: true, ); default: diff --git a/lib/wallets/crypto_currency/coins/wownero.dart b/lib/wallets/crypto_currency/coins/wownero.dart index ed3f18c3d..595966db4 100644 --- a/lib/wallets/crypto_currency/coins/wownero.dart +++ b/lib/wallets/crypto_currency/coins/wownero.dart @@ -72,6 +72,8 @@ class Wownero extends CryptonoteCurrency { isFailover: true, isDown: false, trusted: true, + torEnabled: true, + plainEnabled: true, ); default: