Generic Fixes: Support Errors and others (#1394)

* fix: Crypto amout formatting when calculating fiat amount

* fix: Issue with some token symbols coming up with a dollar sign

* feat: Split transactions to display on history screen token byh token

* fix: Remove restriction on balance length

* fix: error when a particular token is not available

* fix: Remove token transactions when a token is deleted

* fix: Revert previous change

* make added spl tokens enabled by default
fix issue when entering invalid contract address

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
Adegoke David
2024-04-25 03:14:53 +02:00
committed by GitHub
co-authored by OmarHatem
parent 2ac81250c2
commit fff77519d9
10 changed files with 54 additions and 40 deletions
+2
View File
@@ -3,6 +3,8 @@ String calculateFiatAmount({double? price, String? cryptoAmount}) {
return '0.00';
}
cryptoAmount = cryptoAmount.replaceAll(',', '.');
final _amount = double.parse(cryptoAmount);
final _result = price * _amount;
final result = _result < 0 ? _result * -1 : _result;
+4 -2
View File
@@ -142,8 +142,10 @@ class CWEthereum extends Ethereum {
}
wallet as EthereumWallet;
return wallet.erc20Currencies
.firstWhere((element) => transaction.tokenSymbol == element.symbol);
return wallet.erc20Currencies.firstWhere(
(element) => transaction.tokenSymbol == element.symbol,
);
}
@override
+3 -1
View File
@@ -140,8 +140,10 @@ class CWPolygon extends Polygon {
}
wallet as PolygonWallet;
return wallet.erc20Currencies.firstWhere(
(element) => transaction.tokenSymbol.toLowerCase() == element.symbol.toLowerCase());
(element) => transaction.tokenSymbol.toLowerCase() == element.symbol.toLowerCase(),
);
}
@override
+4 -2
View File
@@ -110,8 +110,10 @@ class CWSolana extends Solana {
}
wallet as SolanaWallet;
return wallet.splTokenCurrencies
.firstWhere((element) => transaction.tokenSymbol == element.symbol);
return wallet.splTokenCurrencies.firstWhere(
(element) => transaction.tokenSymbol == element.symbol,
);
}
@override