Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-15 11:56:24 +03:00
parent d77875be51
commit e45d91b15e
15 changed files with 389 additions and 67 deletions

View file

@ -4,10 +4,15 @@ import com.tangem.datasource.api.tangemTech.models.CardInfoBody
import com.tangem.datasource.api.tangemTech.models.WalletIdBody
import com.tangem.datasource.api.tangemTech.models.WalletType
import com.tangem.domain.models.wallet.UserWallet
import com.tangem.domain.wallets.models.AppsFlyerConversionData
object WalletIdBodyConverter {
fun convert(userWallet: UserWallet, publicKeys: Map<String, String>? = null): WalletIdBody {
fun convert(
userWallet: UserWallet,
conversionData: AppsFlyerConversionData? = null,
publicKeys: Map<String, String>? = null,
): WalletIdBody {
return WalletIdBody(
walletId = userWallet.walletId.stringValue,
name = userWallet.name,

View file

@ -17,6 +17,8 @@ data class UserTokensResponse(
@Json(name = "notifyStatus") val notifyStatus: Boolean? = null,
@Json(name = "name") val walletName: String? = null,
@Json(name = "type") val walletType: WalletType? = null,
@Json(name = "ref") val refcode: String? = null,
@Json(name = "campaign") val campaign: String? = null,
) {
@JsonClass(generateAdapter = true)

View file

@ -9,4 +9,6 @@ data class WalletIdBody(
@Json(name = "name") val name: String,
@Json(name = "type") val walletType: WalletType? = null,
@Json(name = "cards") val cards: List<CardInfoBody>? = null,
@Json(name = "ref") val refcode: String? = null,
@Json(name = "campaign") val campaign: String? = null,
)

View file

@ -30,7 +30,11 @@ class WalletIdBodyConverterTest {
)
// WHEN
val result = WalletIdBodyConverter.convert(userWallet, publicKeys)
val result = WalletIdBodyConverter.convert(
userWallet = userWallet,
conversionData = null,
publicKeys = publicKeys,
)
// THEN
assertThat(result).isEqualTo(
@ -68,7 +72,11 @@ class WalletIdBodyConverterTest {
val publicKeys = emptyMap<String, String>()
// WHEN
val result = WalletIdBodyConverter.convert(userWallet, publicKeys)
val result = WalletIdBodyConverter.convert(
userWallet = userWallet,
conversionData = null,
publicKeys = publicKeys,
)
// THEN
assertThat(result).isEqualTo(