diff --git a/cw_bitcoin/lib/pending_bitcoin_transaction.dart b/cw_bitcoin/lib/pending_bitcoin_transaction.dart index 6930524eb..bd68e2bda 100644 --- a/cw_bitcoin/lib/pending_bitcoin_transaction.dart +++ b/cw_bitcoin/lib/pending_bitcoin_transaction.dart @@ -59,7 +59,10 @@ class PendingBitcoinTransaction with PendingTransaction { String get amountFormatted => bitcoinAmountToString(amount: amount); @override - String get feeFormatted => bitcoinAmountToString(amount: fee); + String get feeFormatted => "$feeFormattedValue BTC"; + + @override + String get feeFormattedValue => bitcoinAmountToString(amount: fee); @override int? get outputCount => _tx.outputs.length; diff --git a/cw_bitcoin_cash/lib/src/pending_bitcoin_cash_transaction.dart b/cw_bitcoin_cash/lib/src/pending_bitcoin_cash_transaction.dart index 05483ce54..6f1b6a6f7 100644 --- a/cw_bitcoin_cash/lib/src/pending_bitcoin_cash_transaction.dart +++ b/cw_bitcoin_cash/lib/src/pending_bitcoin_cash_transaction.dart @@ -34,7 +34,10 @@ class PendingBitcoinCashTransaction with PendingTransaction { String get amountFormatted => bitcoinAmountToString(amount: amount); @override - String get feeFormatted => bitcoinAmountToString(amount: fee); + String get feeFormatted => "$feeFormattedValue BCH"; + + @override + String get feeFormattedValue => bitcoinAmountToString(amount: fee); final List _listeners; diff --git a/cw_core/lib/pending_transaction.dart b/cw_core/lib/pending_transaction.dart index 78eba68a3..a06ddfcc8 100644 --- a/cw_core/lib/pending_transaction.dart +++ b/cw_core/lib/pending_transaction.dart @@ -9,6 +9,7 @@ mixin PendingTransaction { String get id; String get amountFormatted; String get feeFormatted; + String get feeFormattedValue; String? feeRate; String get hex; int? get outputCount => null; diff --git a/cw_decred/lib/pending_transaction.dart b/cw_decred/lib/pending_transaction.dart index 63162bf40..53699b60d 100644 --- a/cw_decred/lib/pending_transaction.dart +++ b/cw_decred/lib/pending_transaction.dart @@ -22,7 +22,10 @@ class DecredPendingTransaction with PendingTransaction { String get amountFormatted => decredAmountToString(amount: amount); @override - String get feeFormatted => decredAmountToString(amount: fee); + String get feeFormatted => "$feeFormattedValue DCR"; + + @override + String get feeFormattedValue => decredAmountToString(amount: fee); @override String get hex => rawHex; diff --git a/cw_evm/lib/pending_evm_chain_transaction.dart b/cw_evm/lib/pending_evm_chain_transaction.dart index 892d858ef..bed214940 100644 --- a/cw_evm/lib/pending_evm_chain_transaction.dart +++ b/cw_evm/lib/pending_evm_chain_transaction.dart @@ -36,8 +36,13 @@ class PendingEVMChainTransaction with PendingTransaction { @override String get feeFormatted { + return "$feeFormattedValue $feeCurrency"; + } + + @override + String get feeFormattedValue { final _fee = (fee / BigInt.from(pow(10, 18))).toString(); - return "${_fee.substring(0, min(10, _fee.length))} $feeCurrency"; + return _fee.substring(0, min(10, _fee.length)); } @override diff --git a/cw_monero/lib/pending_monero_transaction.dart b/cw_monero/lib/pending_monero_transaction.dart index 9909a3021..760c6baa4 100644 --- a/cw_monero/lib/pending_monero_transaction.dart +++ b/cw_monero/lib/pending_monero_transaction.dart @@ -36,7 +36,10 @@ class PendingMoneroTransaction with PendingTransaction { CryptoCurrency.xmr, pendingTransactionDescription.amount); @override - String get feeFormatted => AmountConverter.amountIntToString( + String get feeFormatted => "$feeFormattedValue XMR"; + + @override + String get feeFormattedValue => AmountConverter.amountIntToString( CryptoCurrency.xmr, pendingTransactionDescription.fee); bool shouldCommitUR() => isViewOnly; diff --git a/cw_nano/lib/pending_nano_transaction.dart b/cw_nano/lib/pending_nano_transaction.dart index 51a4ef6c1..1530dcea4 100644 --- a/cw_nano/lib/pending_nano_transaction.dart +++ b/cw_nano/lib/pending_nano_transaction.dart @@ -29,7 +29,10 @@ class PendingNanoTransaction with PendingTransaction { } @override - String get feeFormatted => "0"; + String get feeFormatted => "$feeFormattedValue XNO"; + + @override + String get feeFormattedValue => "0"; @override Future commit() async { diff --git a/cw_solana/lib/pending_solana_transaction.dart b/cw_solana/lib/pending_solana_transaction.dart index 5102ea51f..e21b00e86 100644 --- a/cw_solana/lib/pending_solana_transaction.dart +++ b/cw_solana/lib/pending_solana_transaction.dart @@ -32,7 +32,10 @@ class PendingSolanaTransaction with PendingTransaction { } @override - String get feeFormatted => fee.toString(); + String get feeFormatted => "$feeFormattedValue SOL"; + + @override + String get feeFormattedValue => fee.toString(); @override String get hex => serializedTransaction; diff --git a/cw_tron/lib/pending_tron_transaction.dart b/cw_tron/lib/pending_tron_transaction.dart index 2420f083b..c1061db38 100644 --- a/cw_tron/lib/pending_tron_transaction.dart +++ b/cw_tron/lib/pending_tron_transaction.dart @@ -23,7 +23,10 @@ class PendingTronTransaction with PendingTransaction { Future commit() async => await sendTransaction(); @override - String get feeFormatted => fee; + String get feeFormatted => "$feeFormattedValue TRX"; + + @override + String get feeFormattedValue => fee; @override String get hex => bytesToHex(signedTransaction); diff --git a/cw_wownero/lib/pending_wownero_transaction.dart b/cw_wownero/lib/pending_wownero_transaction.dart index 967f63756..e908e6e2c 100644 --- a/cw_wownero/lib/pending_wownero_transaction.dart +++ b/cw_wownero/lib/pending_wownero_transaction.dart @@ -32,7 +32,10 @@ class PendingWowneroTransaction with PendingTransaction { AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.amount); @override - String get feeFormatted => + String get feeFormatted => "$feeFormattedValue WOW"; + + @override + String get feeFormattedValue => AmountConverter.amountIntToString(CryptoCurrency.wow, pendingTransactionDescription.fee); @override diff --git a/cw_zano/lib/model/pending_zano_transaction.dart b/cw_zano/lib/model/pending_zano_transaction.dart index 719c370a1..fd2ab45fe 100644 --- a/cw_zano/lib/model/pending_zano_transaction.dart +++ b/cw_zano/lib/model/pending_zano_transaction.dart @@ -35,7 +35,10 @@ class PendingZanoTransaction with PendingTransaction { String get amountFormatted => ZanoFormatter.bigIntAmountToString(amount, decimalPoint); @override - String get feeFormatted => ZanoFormatter.bigIntAmountToString(fee); + String get feeFormatted => "$feeFormattedValue ZANO"; + + @override + String get feeFormattedValue => ZanoFormatter.bigIntAmountToString(fee); TransferResult? transferResult; diff --git a/lib/view_model/integrations/deuro_view_model.dart b/lib/view_model/integrations/deuro_view_model.dart index 2462db1a6..5d989233a 100644 --- a/lib/view_model/integrations/deuro_view_model.dart +++ b/lib/view_model/integrations/deuro_view_model.dart @@ -64,10 +64,9 @@ abstract class DEuroViewModelBase with Store { if (transaction != null) { final currency = CryptoCurrency.eth; return calculateFiatAmount( - price: _fiatConversationStore.prices[currency]!, - cryptoAmount: - transaction!.feeFormatted.substring(0, transaction!.feeFormatted.indexOf(" ")), - ); + price: _fiatConversationStore.prices[currency]!, + cryptoAmount: transaction!.feeFormattedValue, + ); } else { return '0.00'; } diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 07d695430..7800ceca6 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -183,7 +183,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor final currency = pendingTransactionFeeCurrency(walletType); final fiat = calculateFiatAmount( price: _fiatConversationStore.prices[currency]!, - cryptoAmount: pendingTransaction!.feeFormatted.substring(0, pendingTransaction!.feeFormatted.indexOf(" ")), + cryptoAmount: pendingTransaction!.feeFormattedValue, ); return fiat; } else {