Updated on 2026-08-14
This commit is contained in:
parent
4a47c5ab3a
commit
ad0a6c81bf
11 changed files with 79 additions and 26 deletions
|
|
@ -34,10 +34,6 @@ data class CoinsResponse(
|
|||
//rates.keys = networkId's
|
||||
data class RatesResponse(val rates: Map<String, Double>) : TangemTechResponse
|
||||
|
||||
data class GeoResponse(
|
||||
val code: String,
|
||||
) : TangemTechResponse
|
||||
|
||||
data class UserTokensResponse(
|
||||
val version: Int = 0,
|
||||
val group: String? = null,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.datasource.api.tangemTech
|
||||
|
||||
import com.tangem.datasource.api.tangemTech.models.CurrenciesResponse
|
||||
import com.tangem.datasource.api.tangemTech.models.GeoResponse
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.PUT
|
||||
|
|
@ -33,7 +34,7 @@ interface TangemTechApi {
|
|||
suspend fun getCurrencyList(): CurrenciesResponse
|
||||
|
||||
@GET("geo")
|
||||
suspend fun geo(): GeoResponse
|
||||
suspend fun getUserCountryCode(): GeoResponse
|
||||
|
||||
@GET("user-tokens/{user-id}")
|
||||
suspend fun getUserTokens(@Path(value = "user-id") userId: String): UserTokensResponse
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@ class TangemTechService(
|
|||
}
|
||||
}
|
||||
|
||||
suspend fun userCountry(): Result<GeoResponse> = withContext(Dispatchers.IO) {
|
||||
performRequest { api.geo() }
|
||||
}
|
||||
|
||||
suspend fun getUserTokens(userId: String): Result<UserTokensResponse> = withContext(Dispatchers.IO) {
|
||||
performRequest { api.getUserTokens(userId) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
|
||||
data class GeoResponse(
|
||||
@Json(name = "code") val code: String,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue