Updated on 2026-08-14
This commit is contained in:
parent
4578bb824e
commit
0979d1b71b
22 changed files with 565 additions and 0 deletions
|
|
@ -50,6 +50,17 @@ interface TangemTechApi {
|
|||
@Body userTokens: UserTokensResponse,
|
||||
): ApiResponse<Unit>
|
||||
|
||||
@GET("/v1/wallets/{wallet_id}/notification-preferences")
|
||||
suspend fun getPushNotificationPreferences(
|
||||
@Path("wallet_id") walletId: String,
|
||||
): ApiResponse<PushNotificationPreferencesResponse>
|
||||
|
||||
@PUT("/v1/wallets/{wallet_id}/notification-preferences")
|
||||
suspend fun updatePushNotificationPreferences(
|
||||
@Path("wallet_id") walletId: String,
|
||||
@Body body: PushNotificationPreferencesBody,
|
||||
): ApiResponse<Unit>
|
||||
|
||||
// region Referral
|
||||
/** Returns referral status by [walletId] */
|
||||
@GET("v1/referral/{walletId}")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferenceState(
|
||||
@Json(name = "isEnabled") val isEnabled: Boolean,
|
||||
@Json(name = "isVisible") val isVisible: Boolean,
|
||||
)
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferencesBody(
|
||||
@Json(name = "transactionAlerts")
|
||||
val areTransactionAlertsEnabled: Boolean,
|
||||
@Json(name = "offersUpdates")
|
||||
val areOffersUpdatesEnabled: Boolean,
|
||||
@Json(name = "priceAlerts")
|
||||
val arePriceAlertsEnabled: Boolean,
|
||||
)
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PushNotificationPreferencesResponse(
|
||||
@Json(name = "transactionAlerts") val transactionAlerts: PushNotificationPreferenceState,
|
||||
@Json(name = "offersUpdates") val offersUpdates: PushNotificationPreferenceState,
|
||||
@Json(name = "priceAlerts") val priceAlerts: PushNotificationPreferenceState,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue