Updated on 2026-08-14
This commit is contained in:
parent
b517fe39dd
commit
bad7b92f65
7 changed files with 154 additions and 37 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.domain.swap.models
|
||||
|
||||
import com.tangem.domain.express.models.ExpressProvider
|
||||
import com.tangem.domain.express.models.ExpressRateType
|
||||
import com.tangem.domain.models.currency.CryptoCurrencyStatus
|
||||
|
||||
/**
|
||||
|
|
@ -50,4 +51,16 @@ data class SwapCurrenciesGroup(
|
|||
data class SwapCryptoCurrency(
|
||||
val currencyStatus: CryptoCurrencyStatus,
|
||||
val providers: List<ExpressProvider>,
|
||||
)
|
||||
)
|
||||
|
||||
/**
|
||||
* Get initial rate type based on available providers
|
||||
*/
|
||||
fun List<ExpressProvider>.getInitialRateType(): ExpressRateType {
|
||||
val availableRateTypes = this.flatMap { it.rateTypes }.toSet()
|
||||
return if (availableRateTypes.contains(ExpressRateType.Fixed)) {
|
||||
ExpressRateType.Fixed
|
||||
} else {
|
||||
ExpressRateType.Float
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue