This commit is contained in:
fosse 2023-08-21 09:26:45 -04:00
parent ea2b6dbdb1
commit 9ac3ae9ae0
6 changed files with 62 additions and 37 deletions

View file

@ -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<void>? updateBalance() async => await _updateBalance();
void _onNewTransaction(FilterEvent event) {
throw UnimplementedError();
}
@override
Future<void> renameWalletFiles(String newWalletName) async {
final currentWalletPath = await pathForWallet(name: walletInfo.name, type: type);

View file

@ -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;
}

View file

@ -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<CakeTextTheme>()!.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<CakeTextTheme>()!
.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<CakeTextTheme>()!
.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<CakeTextTheme>()!
.secondaryTextColor,
),
),
],
),

View file

@ -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);
}
}

View file

@ -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() {

View file

@ -780,10 +780,6 @@ Future<void> generateWalletTypes({
outputContent += '\tWalletType.litecoin,\n';
}
if (hasHaven) {
outputContent += '\tWalletType.haven,\n';
}
if (hasNano) {
outputContent += '\tWalletType.nano,\n';
}
@ -792,6 +788,10 @@ Future<void> generateWalletTypes({
outputContent += '\tWalletType.banano,\n';
}
if (hasHaven) {
outputContent += '\tWalletType.haven,\n';
}
outputContent += '];\n';
await walletTypesFile.writeAsString(outputContent);
}