Updated on 2026-08-14

This commit is contained in:
Tangem 2026-02-10 11:23:37 +01:00
parent 8adc179449
commit d5f9410905
35 changed files with 892 additions and 324 deletions

View file

@ -6,12 +6,12 @@ import kotlinx.serialization.Serializable
* Config of request earn tokens.
*
* @param type of Earn (ex: yield, staking).
* @param network networkId.
* @param networks list of networkId.
* @param isForEarn flag to load mostly used tokens.
*/
@Serializable
data class EarnTokensListConfig(
val type: String,
val network: String,
val type: String?,
val networks: List<String>?,
val isForEarn: Boolean,
)

View file

@ -13,7 +13,7 @@ interface EarnRepository {
/**
* Load all networks for Earn and store it in data store.
*/
suspend fun fetchEarnNetworks(type: String)
suspend fun fetchEarnNetworks()
fun observeEarnNetworks(): Flow<EarnNetworks?>

View file

@ -7,9 +7,9 @@ class FetchEarnNetworksUseCase(
private val repository: EarnRepository,
) {
suspend operator fun invoke(type: String): Either<Throwable, Unit> {
suspend operator fun invoke(): Either<Throwable, Unit> {
return Either.catch {
repository.fetchEarnNetworks(type = type)
repository.fetchEarnNetworks()
}
}
}