mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-02 12:14:09 +01:00
feat: Load default tokens in available swap currencies (#2926)
This commit is contained in:
@@ -1126,12 +1126,11 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
|
||||
@action
|
||||
Future<void> _injectUserEthTokensIntoCurrencyLists() async {
|
||||
final userTokens = await TokenUtilities.loadAllUniqueEvmTokens();
|
||||
|
||||
final tokens = await TokenUtilities.loadEvmTokensForSwap();
|
||||
final toAddReceive = <CryptoCurrency>[];
|
||||
final toAddDeposit = <CryptoCurrency>[];
|
||||
|
||||
for (final token in userTokens) {
|
||||
for (final token in tokens) {
|
||||
if (!_listContainsToken(receiveCurrencies, token)) toAddReceive.add(token);
|
||||
if (!_listContainsToken(depositCurrencies, token)) toAddDeposit.add(token);
|
||||
}
|
||||
@@ -1164,12 +1163,11 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
|
||||
@action
|
||||
Future<void> _injectUserSplTokensIntoCurrencyLists() async {
|
||||
final userTokens = await TokenUtilities.loadAllUniqueSolTokens();
|
||||
|
||||
final tokens = await TokenUtilities.loadSolTokensForSwap();
|
||||
final toAddReceive = <CryptoCurrency>[];
|
||||
final toAddDeposit = <CryptoCurrency>[];
|
||||
|
||||
for (final token in userTokens) {
|
||||
for (final token in tokens) {
|
||||
if (!_listContainsSplToken(receiveCurrencies, token)) toAddReceive.add(token);
|
||||
if (!_listContainsSplToken(depositCurrencies, token)) toAddDeposit.add(token);
|
||||
}
|
||||
@@ -1192,12 +1190,11 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
|
||||
@action
|
||||
Future<void> _injectUserTronTokensIntoCurrencyLists() async {
|
||||
final userTokens = await TokenUtilities.loadAllUniqueTronTokens();
|
||||
|
||||
final tokens = await TokenUtilities.loadTronTokensForSwap();
|
||||
final toAddReceive = <CryptoCurrency>[];
|
||||
final toAddDeposit = <CryptoCurrency>[];
|
||||
|
||||
for (final token in userTokens) {
|
||||
for (final token in tokens) {
|
||||
if (!_listContainsTronToken(receiveCurrencies, token)) toAddReceive.add(token);
|
||||
if (!_listContainsTronToken(depositCurrencies, token)) toAddDeposit.add(token);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user