From 9ac3ae9ae07ae87194ab966243005363eef2d305 Mon Sep 17 00:00:00 2001 From: fosse Date: Mon, 21 Aug 2023 09:26:45 -0400 Subject: [PATCH] fixes --- cw_nano/lib/nano_wallet.dart | 5 --- lib/buy/onramper/onramper_buy_provider.dart | 2 + .../wallet_restore_choose_derivation.dart | 43 ++++++++++++------- .../transaction_details_view_model.dart | 17 ++++++++ .../wallet_list/wallet_list_view_model.dart | 24 +++++------ tool/configure.dart | 8 ++-- 6 files changed, 62 insertions(+), 37 deletions(-) diff --git a/cw_nano/lib/nano_wallet.dart b/cw_nano/lib/nano_wallet.dart index b1b583ff2..f20a79d13 100644 --- a/cw_nano/lib/nano_wallet.dart +++ b/cw_nano/lib/nano_wallet.dart @@ -28,7 +28,6 @@ import 'dart:async'; import 'package:cw_nano/nano_wallet_addresses.dart'; import 'package:cw_core/wallet_base.dart'; import 'package:nanodart/nanodart.dart'; -import 'package:web3dart/web3dart.dart'; import 'package:bip39/bip39.dart' as bip39; part 'nano_wallet.g.dart'; @@ -410,10 +409,6 @@ abstract class NanoWalletBase Future? updateBalance() async => await _updateBalance(); - void _onNewTransaction(FilterEvent event) { - throw UnimplementedError(); - } - @override Future renameWalletFiles(String newWalletName) async { final currentWalletPath = await pathForWallet(name: walletInfo.name, type: type); diff --git a/lib/buy/onramper/onramper_buy_provider.dart b/lib/buy/onramper/onramper_buy_provider.dart index 68be59f4e..e8c9cacea 100644 --- a/lib/buy/onramper/onramper_buy_provider.dart +++ b/lib/buy/onramper/onramper_buy_provider.dart @@ -22,6 +22,8 @@ class OnRamperBuyProvider { return "LTC_LITECOIN"; case CryptoCurrency.xmr: return "XMR_MONERO"; + case CryptoCurrency.nano: + return "XNO_NANO"; default: return _wallet.currency.title; } diff --git a/lib/src/screens/restore/wallet_restore_choose_derivation.dart b/lib/src/screens/restore/wallet_restore_choose_derivation.dart index 735d4400b..f89c1e01d 100644 --- a/lib/src/screens/restore/wallet_restore_choose_derivation.dart +++ b/lib/src/screens/restore/wallet_restore_choose_derivation.dart @@ -1,6 +1,7 @@ import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/store/settings_store.dart'; +import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/view_model/wallet_restore_choose_derivation_view_model.dart'; import 'package:cw_core/wallet_info.dart'; @@ -62,10 +63,11 @@ class WalletRestoreChooseDerivationPage extends BasePage { title: Center( child: Text( "${derivation.derivationType.toString().split('.').last}", - style: Theme.of(context) - .primaryTextTheme - .labelMedium! - .copyWith(fontSize: 18), + style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith( + fontSize: 18, + fontWeight: FontWeight.w800, + color: Theme.of(context).extension()!.titleColor, + ), ), ), subtitle: Column( @@ -73,24 +75,33 @@ class WalletRestoreChooseDerivationPage extends BasePage { children: [ Text( derivation.address, - style: Theme.of(context) - .primaryTextTheme - .labelMedium! - .copyWith(fontSize: 16), + style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme.of(context) + .extension()! + .secondaryTextColor, + ), ), Text( "${S.current.confirmed}: ${derivation.balance}", - style: Theme.of(context) - .primaryTextTheme - .labelMedium! - .copyWith(fontSize: 16), + style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme.of(context) + .extension()! + .secondaryTextColor, + ), ), Text( "${S.current.transactions}: ${derivation.height}", - style: Theme.of(context) - .primaryTextTheme - .labelMedium! - .copyWith(fontSize: 16), + style: Theme.of(context).primaryTextTheme.labelMedium!.copyWith( + fontSize: 16, + fontWeight: FontWeight.w500, + color: Theme.of(context) + .extension()! + .secondaryTextColor, + ), ), ], ), diff --git a/lib/view_model/transaction_details_view_model.dart b/lib/view_model/transaction_details_view_model.dart index 5492a6707..2c0b0540d 100644 --- a/lib/view_model/transaction_details_view_model.dart +++ b/lib/view_model/transaction_details_view_model.dart @@ -47,6 +47,9 @@ abstract class TransactionDetailsViewModelBase with Store { case WalletType.ethereum: _addEthereumListItems(tx, dateFormat); break; + case WalletType.nano: + _addNanoListItems(tx, dateFormat); + break; default: break; } @@ -227,4 +230,18 @@ abstract class TransactionDetailsViewModelBase with Store { items.addAll(_items); } + + + void _addNanoListItems(TransactionInfo tx, DateFormat dateFormat) { + final _items = [ + StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id), + StandartListItem( + title: S.current.transaction_details_date, value: dateFormat.format(tx.date)), + // StandartListItem(title: S.current.confirmed, value: (tx.confirmations > 0).toString()), + StandartListItem(title: S.current.transaction_details_height, value: '${tx.height}'), + StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()), + ]; + + items.addAll(_items); + } } diff --git a/lib/view_model/wallet_list/wallet_list_view_model.dart b/lib/view_model/wallet_list/wallet_list_view_model.dart index 0abebba15..b9498690d 100644 --- a/lib/view_model/wallet_list/wallet_list_view_model.dart +++ b/lib/view_model/wallet_list/wallet_list_view_model.dart @@ -51,18 +51,18 @@ abstract class WalletListViewModelBase with Store { @action void updateList() { wallets.clear(); - wallets.addAll( - _walletInfoSource.values.map( - (info) => WalletListItem( - name: info.name, - type: info.type, - key: info.key, - isCurrent: info.name == _appStore.wallet?.name && - info.type == _appStore.wallet?.type, - isEnabled: availableWalletTypes.contains(info.type), - ), - ), - ); + // wallets.addAll( + // _walletInfoSource.values.map( + // (info) => WalletListItem( + // name: info.name, + // type: info.type, + // key: info.key, + // isCurrent: info.name == _appStore.wallet?.name && + // info.type == _appStore.wallet?.type, + // isEnabled: availableWalletTypes.contains(info.type), + // ), + // ), + // ); } bool checkIfAuthRequired() { diff --git a/tool/configure.dart b/tool/configure.dart index 29140897c..a0cdc7612 100644 --- a/tool/configure.dart +++ b/tool/configure.dart @@ -780,10 +780,6 @@ Future generateWalletTypes({ outputContent += '\tWalletType.litecoin,\n'; } - if (hasHaven) { - outputContent += '\tWalletType.haven,\n'; - } - if (hasNano) { outputContent += '\tWalletType.nano,\n'; } @@ -792,6 +788,10 @@ Future generateWalletTypes({ outputContent += '\tWalletType.banano,\n'; } + if (hasHaven) { + outputContent += '\tWalletType.haven,\n'; + } + outputContent += '];\n'; await walletTypesFile.writeAsString(outputContent); }