Updated on 2026-08-14
This commit is contained in:
parent
787c336265
commit
50c3fe85b6
11 changed files with 59 additions and 11 deletions
|
|
@ -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
|
||||
|
|
@ -27,4 +27,6 @@ interface TangemTechApi {
|
|||
@GET("currencies")
|
||||
suspend fun currencies(): CurrenciesResponse
|
||||
|
||||
@GET("geo")
|
||||
suspend fun geo(): GeoResponse
|
||||
}
|
||||
|
|
@ -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() }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue