Minor nano fixes + abstract nano utils out into package (#1250)

* fixes

* refactors

* fixes

* more fixes

* fixes for monero.com

* update confirmed balance to receivable balance

* fix balance display bug

* remove print statements

* prevent unnecessary writes

* review fixes

* forgot to add pubspec changes

* fix

* fix sync status desyncing on rpc fail

* fix

* update translations + txDetails fixes

* squash balance bug

* add source address on tx info

* fix
This commit is contained in:
Matthew Fosse
2024-01-12 01:00:41 +02:00
committed by GitHub
parent 8d973cf919
commit fe2e26f146
42 changed files with 306 additions and 518 deletions
@@ -125,6 +125,8 @@ abstract class BalanceViewModelBase with Store {
case WalletType.haven:
case WalletType.ethereum:
case WalletType.polygon:
case WalletType.nano:
case WalletType.banano:
return S.current.xmr_available_balance;
default:
return S.current.confirmed;
@@ -139,6 +141,9 @@ abstract class BalanceViewModelBase with Store {
case WalletType.ethereum:
case WalletType.polygon:
return S.current.xmr_full_balance;
case WalletType.nano:
case WalletType.banano:
return S.current.receivable_balance;
default:
return S.current.unconfirmed;
}
@@ -101,7 +101,7 @@ class TransactionListItem extends ActionListItem with Keyable {
break;
case WalletType.nano:
amount = calculateFiatAmountRaw(
cryptoAmount: double.parse(nanoUtil!.getRawAsDecimalString(
cryptoAmount: double.parse(nanoUtil!.getRawAsUsableString(
nano!.getTransactionAmountRaw(transaction).toString(), nanoUtil!.rawPerNano)),
price: price);
break;
@@ -247,11 +247,15 @@ abstract class TransactionDetailsViewModelBase with Store {
void _addNanoListItems(TransactionInfo tx, DateFormat dateFormat) {
final _items = [
StandartListItem(title: S.current.transaction_details_transaction_id, value: tx.id),
if (showRecipientAddress && tx.to != null)
StandartListItem(title: S.current.transaction_details_recipient_address, value: tx.to!),
if (showRecipientAddress && tx.from != null)
StandartListItem(title: S.current.transaction_details_source_address, value: tx.from!),
StandartListItem(title: S.current.transaction_details_amount, value: tx.amountFormatted()),
StandartListItem(
title: S.current.transaction_details_date, value: dateFormat.format(tx.date)),
StandartListItem(title: S.current.confirmations, value: (tx.confirmations > 0).toString()),
StandartListItem(title: S.current.confirmed_tx, 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);