Updated on 2026-08-14
This commit is contained in:
parent
ec9bd02e35
commit
5863b5af2a
112 changed files with 919 additions and 282 deletions
|
|
@ -1,6 +1,7 @@
|
|||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.kotlin.serialization)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -15,5 +16,8 @@ dependencies {
|
|||
|
||||
// region Other libraries
|
||||
implementation(deps.kotlin.serialization)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kapt(deps.moshi.kotlin.codegen)
|
||||
// endregion
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.tangem.domain.wallets.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.domain.models.scan.CardDTO
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
|
||||
|
|
@ -14,13 +16,21 @@ import com.tangem.domain.models.scan.ScanResponse
|
|||
* @property isMultiCurrency Indicates whether this user wallet can work with more than one currency
|
||||
* @property scanResponse [ScanResponse] of primary user's wallet card.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserWallet(
|
||||
@Json(name = "name")
|
||||
val name: String,
|
||||
@Json(name = "walletId")
|
||||
val walletId: UserWalletId,
|
||||
@Json(name = "artworkUrl")
|
||||
val artworkUrl: String,
|
||||
@Json(name = "cardsInWallet")
|
||||
val cardsInWallet: Set<String>,
|
||||
@Json(name = "isMultiCurrency")
|
||||
val isMultiCurrency: Boolean,
|
||||
@Json(name = "hasBackupError")
|
||||
val hasBackupError: Boolean,
|
||||
@Json(name = "scanResponse")
|
||||
val scanResponse: ScanResponse, // TODO: Replace with [com.tangem.domain.models.scan.CardDTO]
|
||||
) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
package com.tangem.domain.wallets.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.common.extensions.hexToBytes
|
||||
import com.tangem.common.extensions.toHexString
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class UserWalletId(val stringValue: String) {
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserWalletId(
|
||||
@Json(name = "stringValue")
|
||||
val stringValue: String,
|
||||
) {
|
||||
|
||||
val value = stringValue.hexToBytes()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue