Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-02 19:19:33 +05:00
parent 26bba893ff
commit 51e650c360
47 changed files with 1628 additions and 73 deletions

View file

@ -46,6 +46,9 @@ interface TangemTechApi {
@GET("v1/geo")
suspend fun getUserCountryCode(): GeoResponse
@GET("v1/application/versions")
suspend fun getApplicationVersions(): ApiResponse<ApplicationVersionsResponse>
@PUT("/v1/wallets/{walletId}/tokens")
suspend fun saveTokens(
@Path(value = "walletId") userId: String,

View file

@ -0,0 +1,31 @@
package com.tangem.datasource.api.tangemTech.models
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
/**
* Response of `GET v1/application/versions`. All fields are nullable the backend may omit any, in
* which case the corresponding check is skipped.
*
* @property minSupportedVersion app version threshold for a mandatory update: if
* `installedVersion <= minSupportedVersion` the app must force-update (or show "update your OS"
* when [minSupportedOSVersion] is not met). Inclusive. E.g. "5.30".
* @property minSupportedOSVersion minimal device OS version required to install the update for the
* [minSupportedVersion] case: if `deviceOsVersion < minSupportedOSVersion` the device can't update
* and the "OS too old" screen is shown. Exclusive.
* @property criticalVersion app version threshold for a critical mandatory update: if
* `installedVersion <= criticalVersion` the app must force-update (or permanently "brick" when
* [criticalOSVersion] is not met). Inclusive.
* @property criticalOSVersion minimal device OS version required to install the critical update:
* if `deviceOsVersion < criticalOSVersion` the app is bricked (update impossible). Exclusive.
* @property latestVersion latest available app version: if `installedVersion < latestVersion`
* an optional update is offered. Exclusive. E.g. "5.40".
*/
@JsonClass(generateAdapter = true)
data class ApplicationVersionsResponse(
@Json(name = "minSupportedVersion") val minSupportedVersion: String?,
@Json(name = "minSupportedOSVersion") val minSupportedOSVersion: String?,
@Json(name = "criticalVersion") val criticalVersion: String?,
@Json(name = "criticalOSVersion") val criticalOSVersion: String?,
@Json(name = "latestVersion") val latestVersion: String?,
)

View file

@ -33,6 +33,16 @@ object PreferencesKeys {
val APP_LAUNCH_COUNT_KEY by lazy { intPreferencesKey(name = "launchCount") }
val LAST_OPTIONAL_UPDATE_SHOWN_VERSION_KEY by lazy {
stringPreferencesKey(name = "lastOptionalUpdateShownVersion")
}
val LAST_OPTIONAL_UPDATE_SHOWN_AT_KEY by lazy { longPreferencesKey(name = "lastOptionalUpdateShownAt") }
val CACHED_APP_VERSIONS_KEY by lazy { stringPreferencesKey(name = "cachedApplicationVersions") }
val CACHED_APP_VERSIONS_AT_KEY by lazy { longPreferencesKey(name = "cachedApplicationVersionsAt") }
val SHOW_RATING_DIALOG_AT_LAUNCH_COUNT_KEY by lazy { intPreferencesKey(name = "showRatingDialogAtLaunchCount") }
val FUNDS_FOUND_DATE_KEY by lazy { longPreferencesKey(name = "fundsFoundDate") }