fix nano sending, update restore page wording, and other minor fixes (#1130)

* fix nano sending, update restore page wording, and other minor fixes

* fix bch address parsing

* minor code enhancement [skip ci]

* Register the main secure storage as the long lived instance of secure storage throughout the app session

---------

Co-authored-by: Serhii <borodenko.sv@gmail.com>
Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
Matthew Fosse
2023-10-17 18:59:41 +03:00
committed by GitHub
co-authored by Serhii OmarHatem
parent 69a77d4f71
commit 98a9edc656
34 changed files with 160 additions and 84 deletions
+12 -17
View File
@@ -185,15 +185,15 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
@computed
bool get hasCoinControl =>
wallet.type == WalletType.bitcoin ||
wallet.type == WalletType.litecoin ||
wallet.type == WalletType.monero ||
wallet.type == WalletType.bitcoinCash;
wallet.type == WalletType.litecoin ||
wallet.type == WalletType.monero ||
wallet.type == WalletType.bitcoinCash;
@computed
bool get isElectrumWallet =>
wallet.type == WalletType.bitcoin ||
wallet.type == WalletType.litecoin ||
wallet.type == WalletType.bitcoinCash;
wallet.type == WalletType.litecoin ||
wallet.type == WalletType.bitcoinCash;
@computed
bool get hasFees => wallet.type != WalletType.nano && wallet.type != WalletType.banano;
@@ -281,7 +281,6 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
List<bool> conditionsList = [];
for (var output in outputs) {
final show = checkThroughChecksToDisplayTOTP(output.extractedAddress);
conditionsList.add(show);
}
@@ -350,31 +349,27 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
Object _credentials() {
final priority = _settingsStore.priority[wallet.type];
if (priority == null) throw Exception('Priority is null for wallet type: ${wallet.type}');
if (priority == null && wallet.type != WalletType.nano) {
throw Exception('Priority is null for wallet type: ${wallet.type}');
}
switch (wallet.type) {
case WalletType.bitcoin:
case WalletType.litecoin:
case WalletType.bitcoinCash:
return bitcoin!.createBitcoinTransactionCredentials(outputs, priority: priority);
return bitcoin!.createBitcoinTransactionCredentials(outputs, priority: priority!);
case WalletType.monero:
return monero!
.createMoneroTransactionCreationCredentials(outputs: outputs, priority: priority);
.createMoneroTransactionCreationCredentials(outputs: outputs, priority: priority!);
case WalletType.haven:
return haven!.createHavenTransactionCreationCredentials(
outputs: outputs, priority: priority, assetType: selectedCryptoCurrency.title);
outputs: outputs, priority: priority!, assetType: selectedCryptoCurrency.title);
case WalletType.ethereum:
final priority = _settingsStore.priority[wallet.type];
if (priority == null) {
throw Exception('Priority is null for wallet type: ${wallet.type}');
}
return ethereum!.createEthereumTransactionCredentials(outputs,
priority: priority, currency: selectedCryptoCurrency);
priority: priority!, currency: selectedCryptoCurrency);
case WalletType.nano:
return nano!.createNanoTransactionCredentials(outputs);
default: