mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-24 06:48:38 +02:00
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:
co-authored by
OmarHatem
parent
2ac81250c2
commit
fff77519d9
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user