mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
fix height and amount for btcln tx details (#3201)
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:cake_wallet/store/app_store.dart';
|
||||
import 'package:cake_wallet/core/address_validator.dart';
|
||||
import 'package:cake_wallet/tron/tron.dart';
|
||||
import 'package:cake_wallet/zano/zano.dart';
|
||||
import 'package:cw_core/crypto_amount_format.dart';
|
||||
import 'package:cw_core/crypto_currency.dart';
|
||||
import 'package:cw_core/currency_for_wallet_type.dart';
|
||||
import 'package:cw_core/utils/print_verbose.dart';
|
||||
@@ -69,7 +70,7 @@ class TxDetailRowDefinition {
|
||||
TxDetailRowDefinition(
|
||||
keyString: "standard_list_item_transaction_details_height_key",
|
||||
title: S.current.transaction_details_height,
|
||||
valueGetter: (vm) => vm.transactionInfo.height.toString(),
|
||||
valueGetter: (vm) => vm.transactionInfo.height?.toString() ?? "",
|
||||
applicable: (vm) => !([WalletType.solana, WalletType.tron].contains(vm.wallet.type) &&
|
||||
!isLightning(vm.transactionInfo))),
|
||||
|
||||
@@ -587,6 +588,20 @@ abstract class TransactionDetailsViewModelBase with Store {
|
||||
return bitcoin!.formatterBitcoinAmountToString(amount: newFee);
|
||||
}
|
||||
|
||||
String get formattedCryptoAmount {
|
||||
if (wallet.type == WalletType.bitcoin) {
|
||||
final crypto = isLightning(transactionInfo) ? CryptoCurrency.btcln : CryptoCurrency.btc;
|
||||
final amount = _appStore.amountParsingProxy
|
||||
.getDisplayCryptoString(transactionInfo.amount, crypto)
|
||||
.withMaxDecimals(8)
|
||||
.withLocalSeperator(_appStore.settingsStore.languageCode);
|
||||
|
||||
return '$amount ${_appStore.amountParsingProxy.getCryptoSymbol(crypto)}';
|
||||
}
|
||||
|
||||
return transactionInfo.amountFormatted();
|
||||
}
|
||||
|
||||
void replaceByFee(String newFee) => sendViewModel.replaceByFee(transactionInfo, newFee);
|
||||
|
||||
@computed
|
||||
|
||||
Reference in New Issue
Block a user