Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-30 16:48:26 +03:00
parent acf110dbcc
commit 6910f74fd9
242 changed files with 866 additions and 732 deletions

View file

@ -36,12 +36,12 @@ fun SwapCurrencies.getGroupWithDirection(swapDirection: SwapDirection): SwapCurr
*
* @param available list of available currencies to swap
* @param available list of unavailable currencies to swap
* @param afterSearch flag indicates whether user searched token
* @param isAfterSearch flag indicates whether user searched token
*/
data class SwapCurrenciesGroup(
val available: List<SwapCryptoCurrency>,
val unavailable: List<SwapCryptoCurrency>,
val afterSearch: Boolean,
val isAfterSearch: Boolean,
)
/**

View file

@ -81,7 +81,7 @@ class GetSwapPairsUseCase(
return SwapCurrenciesGroup(
available = availableCryptoCurrencies,
unavailable = unavailableCryptoCurrencies.map { pair -> SwapCryptoCurrency(pair, emptyList()) },
afterSearch = false,
isAfterSearch = false,
)
}
}

View file

@ -87,7 +87,7 @@ class GetSwapSupportedPairsUseCase(
emptyList(),
)
},
afterSearch = false,
isAfterSearch = false,
)
}
}

View file

@ -43,8 +43,8 @@ class SelectInitialPairUseCase(
swapCurrenciesGroup: SwapCurrenciesGroup,
): CryptoCurrencyStatus? {
return secondaryCryptoCurrency?.let {
swapCurrenciesGroup.available.firstOrNull {
secondaryCryptoCurrency.id == it.currencyStatus.currency.id
swapCurrenciesGroup.available.firstOrNull { currency ->
secondaryCryptoCurrency.id == currency.currencyStatus.currency.id
}?.currencyStatus
}
}