diff --git a/cw_core/lib/crypto_currency.dart b/cw_core/lib/crypto_currency.dart index fabc84051..fb702eca1 100644 --- a/cw_core/lib/crypto_currency.dart +++ b/cw_core/lib/crypto_currency.dart @@ -253,7 +253,7 @@ class CryptoCurrency extends EnumerableItem with Serializable implemen static CryptoCurrency fromString(String name, {CryptoCurrency? walletCurrency}) { try { return CryptoCurrency.all.firstWhere((element) => - element.title.toLowerCase() == name && + element.title.toLowerCase() == name.toLowerCase() && (element.tag == null || element.tag == walletCurrency?.title || element.tag == walletCurrency?.tag)); diff --git a/cw_solana/lib/solana_balance.dart b/cw_solana/lib/solana_balance.dart index b1f0ef153..e88a510dd 100644 --- a/cw_solana/lib/solana_balance.dart +++ b/cw_solana/lib/solana_balance.dart @@ -15,8 +15,8 @@ class SolanaBalance extends Balance { String _balanceFormatted() { String stringBalance = balance.toString(); - if (stringBalance.toString().length >= 6) { - stringBalance = stringBalance.substring(0, 6); + if (stringBalance.toString().length >= 12) { + stringBalance = stringBalance.substring(0, 12); } return stringBalance; } diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 4b30ecef3..534e501dd 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -139,8 +139,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor String get pendingTransactionFeeFiatAmount { try { if (pendingTransaction != null) { - final currency = - isEVMCompatibleChain(walletType) ? wallet.currency : selectedCryptoCurrency; + final currency = pendingTransactionFeeCurrency(walletType); final fiat = calculateFiatAmount( price: _fiatConversationStore.prices[currency]!, cryptoAmount: pendingTransaction!.feeFormatted); @@ -153,6 +152,18 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor } } + CryptoCurrency pendingTransactionFeeCurrency(WalletType type) { + switch (type) { + case WalletType.ethereum: + case WalletType.polygon: + case WalletType.tron: + case WalletType.solana: + return wallet.currency; + default: + return selectedCryptoCurrency; + } + } + FiatCurrency get fiat => _settingsStore.fiatCurrency; TransactionPriority get transactionPriority {