Updated on 2026-08-14
This commit is contained in:
parent
8adc179449
commit
d5f9410905
35 changed files with 892 additions and 324 deletions
|
|
@ -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,
|
||||
)
|
||||
|
|
@ -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?>
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue