Updated on 2026-08-14
This commit is contained in:
parent
700731a408
commit
c500f45307
59 changed files with 1338 additions and 278 deletions
|
|
@ -18,4 +18,5 @@ dependencies {
|
|||
|
||||
implementation(deps.kotlin.serialization)
|
||||
implementation(projects.domain.tokens.models)
|
||||
implementation(projects.core.utils)
|
||||
}
|
||||
|
|
@ -11,29 +11,29 @@ data class TokenMarketInfo(
|
|||
val networks: List<Network>?,
|
||||
val shortDescription: String?,
|
||||
val fullDescription: String?,
|
||||
val insights: List<Insight>?,
|
||||
val insights: Insights?,
|
||||
val metrics: Metrics?,
|
||||
val links: Links?,
|
||||
val pricePerformance: PricePerformance?,
|
||||
) {
|
||||
data class PriceChangePercentage(
|
||||
val day: Int?,
|
||||
val week: Int?,
|
||||
val month: Int?,
|
||||
val threeMonths: Int?,
|
||||
val sixMonths: Int?,
|
||||
val year: Int?,
|
||||
val allTime: Int?,
|
||||
val day: BigDecimal?,
|
||||
val week: BigDecimal?,
|
||||
val month: BigDecimal?,
|
||||
val threeMonths: BigDecimal?,
|
||||
val sixMonths: BigDecimal?,
|
||||
val year: BigDecimal?,
|
||||
val allTime: BigDecimal?,
|
||||
)
|
||||
|
||||
data class Network(
|
||||
val networkId: String,
|
||||
val exchangeable: Boolean,
|
||||
val contractAddress: String,
|
||||
val decimalCount: Int,
|
||||
val contractAddress: String?,
|
||||
val decimalCount: Int?,
|
||||
)
|
||||
|
||||
data class Insight(
|
||||
data class Insights(
|
||||
val holdersChange: Change?,
|
||||
val liquidityChange: Change?,
|
||||
val buyPressureChange: Change?,
|
||||
|
|
@ -41,9 +41,9 @@ data class TokenMarketInfo(
|
|||
)
|
||||
|
||||
data class Change(
|
||||
val day: Int?,
|
||||
val week: Int?,
|
||||
val month: Int?,
|
||||
val day: BigDecimal?,
|
||||
val week: BigDecimal?,
|
||||
val month: BigDecimal?,
|
||||
)
|
||||
|
||||
data class Metrics(
|
||||
|
|
@ -75,7 +75,7 @@ data class TokenMarketInfo(
|
|||
)
|
||||
|
||||
data class Range(
|
||||
val low: Int?,
|
||||
val high: Int?,
|
||||
val low: BigDecimal?,
|
||||
val high: BigDecimal?,
|
||||
)
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.tangem.domain.markets
|
|||
import arrow.core.Either
|
||||
import com.tangem.domain.appcurrency.model.AppCurrency
|
||||
import com.tangem.domain.markets.repositories.MarketsTokenRepository
|
||||
import com.tangem.utils.SupportedLanguages
|
||||
|
||||
class GetTokenMarketInfoUseCase(
|
||||
private val marketsTokenRepository: MarketsTokenRepository,
|
||||
|
|
@ -13,6 +14,7 @@ class GetTokenMarketInfoUseCase(
|
|||
marketsTokenRepository.getTokenInfo(
|
||||
fiatCurrencyCode = appCurrency.code,
|
||||
tokenId = tokenId,
|
||||
languageCode = SupportedLanguages.getCurrentSupportedLanguageCode(),
|
||||
)
|
||||
}.mapLeft {}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,5 +12,5 @@ interface MarketsTokenRepository {
|
|||
|
||||
suspend fun getChart(fiatCurrencyCode: String, interval: PriceChangeInterval, tokenId: String): TokenChart
|
||||
|
||||
suspend fun getTokenInfo(fiatCurrencyCode: String, tokenId: String): TokenMarketInfo
|
||||
suspend fun getTokenInfo(fiatCurrencyCode: String, tokenId: String, languageCode: String): TokenMarketInfo
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue