Updated on 2026-08-14

This commit is contained in:
Tangem 2024-09-30 16:56:10 +04:00
parent 3a4ba6dd5a
commit 3920719b01
6 changed files with 123 additions and 0 deletions

View file

@ -34,6 +34,9 @@ interface TangemTechMarketsApi {
@Query("interval") interval: String,
): ApiResponse<TokenMarketChartResponse>
@GET("coins/{coin_id}/exchanges")
suspend fun getCoinExchanges(@Path("coin_id") coinId: String): ApiResponse<TokenMarketExchangesResponse>
@GET("coins/history_preview")
suspend fun getCoinsListCharts(
@Query("coin_ids") coinIds: String,

View file

@ -0,0 +1,38 @@
package com.tangem.datasource.api.markets.models.response
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.math.BigDecimal
/**
* Token market exchanges response
*
* @property exchanges list of exchanges
*
[REDACTED_AUTHOR]
*/
@JsonClass(generateAdapter = true)
data class TokenMarketExchangesResponse(
@Json(name = "exchanges") val exchanges: List<Exchange>,
) {
/**
* Exchange
*
* @property id id
* @property name name
* @property imageUrl image url
* @property isCentralized CEX (true), DEX (false)
* @property volumeInUsd aggregated volume in USD
* @property trustScore trust score
*/
@JsonClass(generateAdapter = true)
data class Exchange(
@Json(name = "exchange_id") val id: String,
@Json(name = "name") val name: String,
@Json(name = "image") val imageUrl: String?,
@Json(name = "centralized") val isCentralized: Boolean,
@Json(name = "volume_usd") val volumeInUsd: BigDecimal,
@Json(name = "trust_score") val trustScore: Int?,
)
}