CW-647-Birdpay-Trc20 (#1469)

* fix: Desktop resize bug * fix: Birdpay working for trc20 and adjust transaction fee currency * fix: Filter logic * fix: Solana token balance not fully displaying * fix: Minor enhancements

Adegoke David committed May 28, 2024 at 14:32 UTC 24f6541fa696c756c12aa2d9afa94d13aff6a0a8
3 files changed +16 -5
cw_core/lib/crypto_currency.dart
+1 -1
@@ -253,7 +253,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> implemen
253 static CryptoCurrency fromString(String name, {CryptoCurrency? walletCurrency}) {
254 try {
255 return CryptoCurrency.all.firstWhere((element) =>
256 - element.title.toLowerCase() == name &&
256 + element.title.toLowerCase() == name.toLowerCase() &&
257 (element.tag == null ||
258 element.tag == walletCurrency?.title ||
259 element.tag == walletCurrency?.tag));
cw_solana/lib/solana_balance.dart
+2 -2
@@ -15,8 +15,8 @@ class SolanaBalance extends Balance {
15
16 String _balanceFormatted() {
17 String stringBalance = balance.toString();
18 - if (stringBalance.toString().length >= 6) {
19 - stringBalance = stringBalance.substring(0, 6);
18 + if (stringBalance.toString().length >= 12) {
19 + stringBalance = stringBalance.substring(0, 12);
20 }
21 return stringBalance;
22 }
lib/view_model/send/send_view_model.dart
+13 -2
@@ -139,8 +139,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
139 String get pendingTransactionFeeFiatAmount {
140 try {
141 if (pendingTransaction != null) {
142 - final currency =
143 - isEVMCompatibleChain(walletType) ? wallet.currency : selectedCryptoCurrency;
142 + final currency = pendingTransactionFeeCurrency(walletType);
143 final fiat = calculateFiatAmount(
144 price: _fiatConversationStore.prices[currency]!,
145 cryptoAmount: pendingTransaction!.feeFormatted);
@@ -153,6 +152,18 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
152 }
153 }
154
155 + CryptoCurrency pendingTransactionFeeCurrency(WalletType type) {
156 + switch (type) {
157 + case WalletType.ethereum:
158 + case WalletType.polygon:
159 + case WalletType.tron:
160 + case WalletType.solana:
161 + return wallet.currency;
162 + default:
163 + return selectedCryptoCurrency;
164 + }
165 + }
166 +
167 FiatCurrency get fiat => _settingsStore.fiatCurrency;
168
169 TransactionPriority get transactionPriority {