Updated on 2026-08-14

This commit is contained in:
Tangem 2022-07-06 15:10:06 +03:00
parent 787c336265
commit 50c3fe85b6
11 changed files with 59 additions and 11 deletions

View file

@ -43,4 +43,8 @@ data class CurrenciesResponse(val currencies: List<Currency>) {
val unit: String, // $, €, ₽
val type: String,
) : TangemTechResponse
}
}
data class GeoResponse(
val code: String
) : TangemTechResponse

View file

@ -27,4 +27,6 @@ interface TangemTechApi {
@GET("currencies")
suspend fun currencies(): CurrenciesResponse
@GET("geo")
suspend fun geo(): GeoResponse
}

View file

@ -47,6 +47,10 @@ class TangemTechService {
}
}
suspend fun userCountry(): Result<GeoResponse> = withContext(Dispatchers.IO) {
performRequest { api.geo() }
}
suspend fun currencies(): Result<CurrenciesResponse> = withContext(Dispatchers.IO) {
performRequest { api.currencies() }
}