Updated on 2026-08-14

This commit is contained in:
Tangem 2022-07-12 14:27:49 +04:00
commit 005126d1bb
48 changed files with 854 additions and 554 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() }
}