Updated on 2026-08-14
This commit is contained in:
parent
ec9bd02e35
commit
5863b5af2a
112 changed files with 919 additions and 282 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import java.util.Properties
|
||||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.application)
|
||||
|
|
@ -254,6 +255,10 @@ dependencies {
|
|||
implementation(deps.decompose.ext.compose)
|
||||
implementation(deps.moshi.adapters)
|
||||
|
||||
implementation(deps.moshi.kotlin)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
|
||||
/** Testing libraries */
|
||||
testImplementation(deps.test.coroutine)
|
||||
testImplementation(deps.test.junit)
|
||||
|
|
@ -271,6 +276,7 @@ dependencies {
|
|||
|
||||
/** Chucker */
|
||||
debugImplementation(deps.chucker)
|
||||
debugPGImplementation(deps.chucker)
|
||||
mockedImplementation(deps.chuckerStub)
|
||||
externalImplementation(deps.chuckerStub)
|
||||
internalImplementation(deps.chuckerStub)
|
||||
|
|
@ -292,5 +298,4 @@ dependencies {
|
|||
// excludes version 9999.0-empty-to-avoid-conflict-with-guava
|
||||
exclude(group = "com.google.guava", module = "listenablefuture")
|
||||
}
|
||||
|
||||
}
|
||||
223
app/proguard-rules.pro
vendored
223
app/proguard-rules.pro
vendored
|
|
@ -1,21 +1,208 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
-dontusemixedcaseclassnames
|
||||
-flattenpackagehierarchy
|
||||
-adaptclassstrings
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
# firebase
|
||||
-keep public class com.google.firebase.** { *; }
|
||||
-keep class com.google.android.gms.internal.** { *; }
|
||||
-keepclasseswithmembers class com.google.firebase.FirebaseException
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
# hedera sdk
|
||||
-keep class com.hedera.hashgraph.sdk.** { *; }
|
||||
-keep interface com.hedera.hashgraph.sdk.** { *; }
|
||||
-dontwarn com.esaulpaugh.headlong.**
|
||||
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
|
||||
-dontwarn io.grpc.stub.**
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
# trustwallet sdk
|
||||
-keep class wallet.core.jni.** { *; }
|
||||
|
||||
# solana
|
||||
-keep class org.p2p.solanaj.** { *; }
|
||||
-keep class com.tangem.blockchain.blockchains.solana.solanaj.model.** { *; }
|
||||
|
||||
# binance
|
||||
-keep class com.tangem.blockchain.blockchains.binance.client.** { *; }
|
||||
|
||||
# shadow gson
|
||||
-keep,allowobfuscation,allowshrinking class shadow.com.google.gson.reflect.TypeToken
|
||||
-keep,allowobfuscation,allowshrinking class * extends shadow.com.google.gson.reflect.TypeToken
|
||||
|
||||
# polkadot
|
||||
-keep class io.emeraldpay.polkaj.api.RpcRequest { *; }
|
||||
-keep class io.emeraldpay.polkaj.api.RpcResponse { *; }
|
||||
-keep class io.emeraldpay.polkaj.api.RpcResponseError { *; }
|
||||
|
||||
# kethereum
|
||||
-keep class org.kethereum.bip32.model.ExtendedKey**
|
||||
-keepclassmembers class org.kethereum.bip32.model.ExtendedKey** { *; }
|
||||
|
||||
# some crypto
|
||||
-dontwarn net.i2p.crypto.**
|
||||
-dontwarn java.net.http.**
|
||||
-dontwarn lombok.**
|
||||
|
||||
-keep class org.spongycastle.** { *; }
|
||||
|
||||
-dontwarn org.apache.hc.core5.**
|
||||
-dontwarn org.apache.hc.client5.**
|
||||
-dontwarn org.apache.log4j.config.**
|
||||
|
||||
-dontwarn javax.naming.**
|
||||
-dontwarn javax.xml.stream.**
|
||||
-dontwarn javax.script.**
|
||||
|
||||
-dontwarn org.java_websocket.client.WebSocketClient
|
||||
-dontwarn org.java_websocket.handshake.ServerHandshake
|
||||
|
||||
-dontwarn aQute.bnd.annotation.spi.ServiceProvider
|
||||
|
||||
-dontwarn org.threeten.bp.**
|
||||
-keep class org.threeten.bp.*
|
||||
-keepclassmembers class org.threeten.bp.** { *; }
|
||||
|
||||
# joda time
|
||||
# These aren't necessary if including joda-convert
|
||||
-dontwarn org.joda.convert.FromString
|
||||
-dontwarn org.joda.convert.ToString
|
||||
|
||||
-keepnames class org.joda.** implements java.io.Serializable
|
||||
-keepclassmembers class org.joda.** implements java.io.Serializable {
|
||||
static final long serialVersionUID;
|
||||
private static final java.io.ObjectStreamField[] serialPersistentFields;
|
||||
!static !transient <fields>;
|
||||
private void writeObject(java.io.ObjectOutputStream);
|
||||
private void readObject(java.io.ObjectInputStream);
|
||||
java.lang.Object writeReplace();
|
||||
java.lang.Object readResolve();
|
||||
}
|
||||
# joda time
|
||||
|
||||
# The name of @JsonClass types is used to look up the generated adapter.
|
||||
-keepnames @com.squareup.moshi.JsonClass class *
|
||||
|
||||
-keepclassmembers class * {
|
||||
@com.squareup.moshi.FromJson <methods>;
|
||||
@com.squareup.moshi.ToJson <methods>;
|
||||
}
|
||||
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
-keep class kotlin.Metadata { *; }
|
||||
-keepclassmembers class kotlin.Metadata {
|
||||
public <methods>;
|
||||
}
|
||||
|
||||
# Proguard configuration for Jackson 2.x
|
||||
-keep class com.fasterxml.** { *; }
|
||||
-keep class com.fasterxml.jackson.databind.ObjectMapper {
|
||||
public <methods>;
|
||||
protected <methods>;
|
||||
}
|
||||
-keep class com.fasterxml.jackson.databind.ObjectWriter {
|
||||
public ** writeValueAsString(**);
|
||||
}
|
||||
-keepnames class com.fasterxml.jackson.** { *; }
|
||||
-dontwarn com.fasterxml.jackson.databind.**
|
||||
-keep class * implements com.fasterxml.jackson.core.type.TypeReference
|
||||
|
||||
-keep class kotlin.reflect.**
|
||||
-keep public class kotlin.reflect.jvm.internal.impl.** { public *; }
|
||||
|
||||
# Kotlin serialization looks up the generated serializer classes through a function on companion
|
||||
# objects. The companions are looked up reflectively so we need to explicitly keep these functions.
|
||||
-keepclasseswithmembers class **.*$Companion {
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
# If a companion has the serializer function, keep the companion field on the original type so that
|
||||
# the reflective lookup succeeds.
|
||||
-if class **.*$Companion {
|
||||
kotlinx.serialization.KSerializer serializer(...);
|
||||
}
|
||||
-keepclassmembers class <1>.<2> {
|
||||
<1>.<2>$Companion Companion;
|
||||
}
|
||||
|
||||
-keepnames class * implements android.os.Parcelable {
|
||||
public static final ** CREATOR;
|
||||
}
|
||||
-keep class * implements android.os.Parcelable {
|
||||
public static final android.os.Parcelable$Creator *;
|
||||
}
|
||||
|
||||
-dontwarn okhttp3.**
|
||||
-dontwarn okio.**
|
||||
|
||||
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
|
||||
# EnclosingMethod is required to use InnerClasses.
|
||||
-keepattributes Signature, InnerClasses, EnclosingMethod, *Annotation*, Exceptions
|
||||
|
||||
# Retrofit does reflection on method and parameter annotations.
|
||||
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
|
||||
|
||||
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
|
||||
-keepattributes AnnotationDefault
|
||||
|
||||
# Retain service method parameters when optimizing.
|
||||
-keepclassmembers,allowshrinking,allowobfuscation interface * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
|
||||
-keepclasseswithmembers class * {
|
||||
@retrofit2.http.* <methods>;
|
||||
}
|
||||
-keepclassmembernames interface * {
|
||||
@retrofit.http.* <methods>;
|
||||
}
|
||||
|
||||
# Ignore annotation used for build tooling.
|
||||
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
||||
|
||||
# Ignore JSR 305 annotations for embedding nullability information.
|
||||
-dontwarn javax.annotation.**
|
||||
|
||||
# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
|
||||
-dontwarn kotlin.Unit
|
||||
|
||||
# Top-level functions that can only be used by Kotlin.
|
||||
-dontwarn retrofit2.KotlinExtensions
|
||||
-dontwarn retrofit2.KotlinExtensions.*
|
||||
|
||||
# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy
|
||||
# and replaces all potential values with null. Explicitly keeping the interfaces prevents this.
|
||||
-if interface * { @retrofit2.http.* <methods>; }
|
||||
-keep,allowobfuscation interface <1>
|
||||
|
||||
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
|
||||
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
|
||||
-keep,allowobfuscation,allowshrinking class retrofit2.Response
|
||||
|
||||
# With R8 full mode generic signatures are stripped for classes that are not
|
||||
# kept. Suspend functions are wrapped in continuations where the type argument
|
||||
# is used.
|
||||
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
|
||||
|
||||
# public tangem android sdk
|
||||
-keep class com.tangem.operations.** { *; }
|
||||
-keep class com.tangem.crypto.** { *; }
|
||||
-keep class com.tangem.common.card.** { *; }
|
||||
|
||||
# TODO remove (easy to fix in sdk)
|
||||
-keep class com.tangem.common.json.** { *; }
|
||||
-keep class com.tangem.common.SuccessResponse { *; }
|
||||
-keep class com.tangem.common.UserCode { *; }
|
||||
-keep class com.tangem.common.UserCodeType { *; }
|
||||
|
||||
# non-sensitive enums
|
||||
-keep enum com.tangem.domain.apptheme.model.AppThemeMode { *; }
|
||||
|
||||
-keep class com.reown.walletkit.client.Wallet$Model { *; }
|
||||
-keep class com.reown.walletkit.client.Wallet { *; }
|
||||
|
||||
-keep class **.R
|
||||
-keep class **.R$* {
|
||||
<fields>;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.tap.domain.userWalletList.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.domain.models.scan.CardDTO
|
||||
import com.tangem.domain.models.scan.ScanResponse
|
||||
|
|
@ -7,16 +8,24 @@ import com.tangem.domain.wallets.models.UserWalletId
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class UserWalletSensitiveInformation(
|
||||
@Json(name = "wallets")
|
||||
val wallets: List<CardDTO.Wallet>,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class UserWalletPublicInformation(
|
||||
@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 = "scanResponse")
|
||||
val scanResponse: ScanResponse,
|
||||
@Json(name = "isMultiCurrency")
|
||||
val isMultiCurrency: Boolean,
|
||||
@Json(name = "hasBackupError")
|
||||
val hasBackupError: Boolean = false,
|
||||
)
|
||||
|
|
@ -52,6 +52,8 @@ data class WcSignMessage(
|
|||
@Json(name = "type")
|
||||
val type: WCSignType,
|
||||
) : WcRequestData {
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class WCSignType {
|
||||
MESSAGE, PERSONAL_MESSAGE, TYPED_MESSAGE, SOLANA_MESSAGE,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,16 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain.models
|
||||
|
||||
data class Account(val chainId: String, val walletAddress: String, val derivationPath: String?)
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Account(
|
||||
@Json(name = "chainId")
|
||||
val chainId: String,
|
||||
|
||||
@Json(name = "walletAddress")
|
||||
val walletAddress: String,
|
||||
|
||||
@Json(name = "derivationPath")
|
||||
val derivationPath: String?,
|
||||
)
|
||||
|
|
@ -1,6 +1,13 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Session(
|
||||
@Json(name = "topic")
|
||||
val topic: String,
|
||||
|
||||
@Json(name = "accounts")
|
||||
val accounts: List<Account>,
|
||||
)
|
||||
|
|
@ -2,29 +2,34 @@ package com.tangem.tap.domain.walletconnect2.domain.models.binance
|
|||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.tap.domain.walletconnect2.domain.WcRequestData
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@JsonClass(generateAdapter = true)
|
||||
class WcBinanceCancelOrder(
|
||||
data class WcBinanceCancelOrder(
|
||||
@Json(name = "account_number")
|
||||
accountNumber: String,
|
||||
val accountNumber: String,
|
||||
@Json(name = "chain_id")
|
||||
chainId: String,
|
||||
val chainId: String,
|
||||
@Json(name = "data")
|
||||
data: String?,
|
||||
val data: String?,
|
||||
@Json(name = "memo")
|
||||
memo: String?,
|
||||
val memo: String?,
|
||||
@Json(name = "sequence")
|
||||
sequence: String,
|
||||
val sequence: String,
|
||||
@Json(name = "source")
|
||||
source: String,
|
||||
val source: String,
|
||||
@Json(name = "msgs")
|
||||
msgs: List<Message>,
|
||||
) : WcBinanceOrder<WcBinanceCancelOrder.Message>(accountNumber, chainId, data, memo, sequence, source, msgs) {
|
||||
val msgs: List<Message>,
|
||||
) : WcRequestData {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Message(
|
||||
@Json(name = "refid")
|
||||
val refid: String,
|
||||
@Json(name = "sender")
|
||||
val sender: String,
|
||||
@Json(name = "symbol")
|
||||
val symbol: String,
|
||||
)
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain.models.binance
|
||||
|
||||
import com.tangem.tap.domain.walletconnect2.domain.WcRequestData
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
open class WcBinanceOrder<T>(
|
||||
val accountNumber: String,
|
||||
val chainId: String,
|
||||
val data: String?,
|
||||
val memo: String?,
|
||||
val sequence: String,
|
||||
val source: String,
|
||||
val msgs: List<T>,
|
||||
) : WcRequestData
|
||||
|
||||
data class WcBinanceTxConfirmParam(
|
||||
val ok: Boolean,
|
||||
val errorMsg: String?,
|
||||
) : WcRequestData
|
||||
|
|
@ -4,21 +4,28 @@ import com.github.salomonbrys.kotson.jsonSerializer
|
|||
import com.google.gson.JsonObject
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.tap.domain.walletconnect2.domain.WcRequestData
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@JsonClass(generateAdapter = true)
|
||||
class WcBinanceTradeOrder(
|
||||
data class WcBinanceTradeOrder(
|
||||
@Json(name = "account_number")
|
||||
accountNumber: String,
|
||||
val accountNumber: String,
|
||||
@Json(name = "chain_id")
|
||||
chainId: String,
|
||||
data: String?,
|
||||
memo: String?,
|
||||
sequence: String,
|
||||
source: String,
|
||||
msgs: List<Message>,
|
||||
) : WcBinanceOrder<WcBinanceTradeOrder.Message>(accountNumber, chainId, data, memo, sequence, source, msgs) {
|
||||
val chainId: String,
|
||||
@Json(name = "data")
|
||||
val data: String?,
|
||||
@Json(name = "memo")
|
||||
val memo: String?,
|
||||
@Json(name = "sequence")
|
||||
val sequence: String,
|
||||
@Json(name = "source")
|
||||
val source: String,
|
||||
@Json(name = "msgs")
|
||||
val msgs: List<Message>,
|
||||
) : WcRequestData {
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class MessageKey(val key: String) {
|
||||
ID("id"),
|
||||
ORDER_TYPE("ordertype"),
|
||||
|
|
@ -30,14 +37,23 @@ class WcBinanceTradeOrder(
|
|||
TIME_INFORCE("timeinforce"),
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Message(
|
||||
@Json(name = "id")
|
||||
val id: String,
|
||||
@Json(name = "orderType")
|
||||
val orderType: Int,
|
||||
@Json(name = "price")
|
||||
val price: Long,
|
||||
@Json(name = "quantity")
|
||||
val quantity: Long,
|
||||
@Json(name = "sender")
|
||||
val sender: String,
|
||||
@Json(name = "side")
|
||||
val side: Int,
|
||||
@Json(name = "symbol")
|
||||
val symbol: String,
|
||||
@Json(name = "timeInforce")
|
||||
val timeInforce: Int,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,33 +2,48 @@ package com.tangem.tap.domain.walletconnect2.domain.models.binance
|
|||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.tap.domain.walletconnect2.domain.WcRequestData
|
||||
|
||||
@Suppress("LongParameterList")
|
||||
@JsonClass(generateAdapter = true)
|
||||
class WcBinanceTransferOrder(
|
||||
data class WcBinanceTransferOrder(
|
||||
@Json(name = "account_number")
|
||||
accountNumber: String,
|
||||
val accountNumber: String,
|
||||
@Json(name = "chain_id")
|
||||
chainId: String,
|
||||
data: String?,
|
||||
memo: String?,
|
||||
sequence: String,
|
||||
source: String,
|
||||
msgs: List<Message>,
|
||||
) : WcBinanceOrder<WcBinanceTransferOrder.Message>(accountNumber, chainId, data, memo, sequence, source, msgs) {
|
||||
val chainId: String,
|
||||
@Json(name = "data")
|
||||
val data: String?,
|
||||
@Json(name = "memo")
|
||||
val memo: String?,
|
||||
@Json(name = "sequence")
|
||||
val sequence: String,
|
||||
@Json(name = "source")
|
||||
val source: String,
|
||||
@Json(name = "msgs")
|
||||
val msgs: List<Message>,
|
||||
) : WcRequestData {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Message(
|
||||
@Json(name = "inputs")
|
||||
val inputs: List<Item>,
|
||||
@Json(name = "outputs")
|
||||
val outputs: List<Item>,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Item(
|
||||
@Json(name = "address")
|
||||
val address: String,
|
||||
@Json(name = "coins")
|
||||
val coins: List<Coin>,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Coin(
|
||||
@Json(name = "amount")
|
||||
val amount: Long,
|
||||
@Json(name = "denom")
|
||||
val denom: String,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.tangem.tap.domain.walletconnect2.domain.models.binance
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.tap.domain.walletconnect2.domain.WcRequestData
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class WcBinanceTxConfirmParam(
|
||||
@Json(name = "ok")
|
||||
val ok: Boolean,
|
||||
@Json(name = "errorMsg")
|
||||
val errorMsg: String?,
|
||||
) : WcRequestData
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.tap.network.exchangeServices.mercuryo
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import retrofit2.http.GET
|
||||
import retrofit2.http.Path
|
||||
|
||||
|
|
@ -11,21 +12,25 @@ interface MercuryoApi {
|
|||
suspend fun currencies(@Path("apiVersion") apiVersion: String): MercuryoCurrenciesResponse
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MercuryoCurrenciesResponse(
|
||||
val status: Int,
|
||||
val data: Data,
|
||||
@Json(name = "status") val status: Int,
|
||||
@Json(name = "data") val data: Data,
|
||||
) {
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Data(
|
||||
val fiat: List<String>,
|
||||
val crypto: List<String>,
|
||||
val config: Config,
|
||||
@Json(name = "fiat") val fiat: List<String>,
|
||||
@Json(name = "crypto") val crypto: List<String>,
|
||||
@Json(name = "config") val config: Config,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Config(
|
||||
@Json(name = "crypto_currencies")
|
||||
val cryptoCurrencies: List<MercuryoCryptoCurrency>,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MercuryoCryptoCurrency(
|
||||
@Json(name = "currency")
|
||||
val currencySymbol: String,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ interface MoonPayApi {
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MoonPayUserStatus(
|
||||
@Json(name = "isBuyAllowed")
|
||||
val isBuyAllowed: Boolean,
|
||||
@Json(name = "isSellAllowed")
|
||||
val isSellAllowed: Boolean,
|
||||
@Json(name = "isAllowed")
|
||||
val isMoonpayAllowed: Boolean,
|
||||
|
|
@ -34,18 +36,18 @@ data class MoonPayUserStatus(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MoonPayCurrencies(
|
||||
val type: String,
|
||||
val code: String,
|
||||
val supportsLiveMode: Boolean = false,
|
||||
val isSuspended: Boolean = true,
|
||||
val isSupportedInUS: Boolean = false,
|
||||
val isSellSupported: Boolean = false,
|
||||
val notAllowedUSStates: List<String> = emptyList(),
|
||||
val metadata: MoonPayCurrenciesMetadata? = null,
|
||||
@Json(name = "type") val type: String,
|
||||
@Json(name = "code") val code: String,
|
||||
@Json(name = "supportsLiveMode") val supportsLiveMode: Boolean = false,
|
||||
@Json(name = "isSuspended") val isSuspended: Boolean = true,
|
||||
@Json(name = "isSupportedInUS") val isSupportedInUS: Boolean = false,
|
||||
@Json(name = "isSellSupported") val isSellSupported: Boolean = false,
|
||||
@Json(name = "notAllowedUSStates") val notAllowedUSStates: List<String> = emptyList(),
|
||||
@Json(name = "metadata") val metadata: MoonPayCurrenciesMetadata? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MoonPayCurrenciesMetadata(
|
||||
val contractAddress: String?,
|
||||
val networkCode: String?,
|
||||
@Json(name = "contractAddress") val contractAddress: String?,
|
||||
@Json(name = "networkCode") val networkCode: String?,
|
||||
)
|
||||
|
|
@ -15,7 +15,6 @@ import com.patrykandpatrick.vico.core.cartesian.marker.CartesianMarkerValueForma
|
|||
import com.patrykandpatrick.vico.core.cartesian.marker.DefaultCartesianMarker
|
||||
import com.patrykandpatrick.vico.core.common.Dimensions
|
||||
import com.patrykandpatrick.vico.core.common.LayeredComponent
|
||||
import com.patrykandpatrick.vico.core.common.component.Component
|
||||
import com.patrykandpatrick.vico.core.common.component.TextComponent
|
||||
import com.patrykandpatrick.vico.core.common.shape.Shape
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
|
@ -39,7 +38,28 @@ internal fun rememberTangemChartMarker(color: Color): CartesianMarker {
|
|||
|
||||
object : DefaultCartesianMarker(
|
||||
label = TextComponent(textSizeSp = 0f),
|
||||
indicator = ::indicator,
|
||||
indicator = { color ->
|
||||
val composeColor = Color(color)
|
||||
|
||||
LayeredComponent(
|
||||
rear = shapeComponent(
|
||||
color = composeColor.copy(alpha = INDICATOR_REAR_COLOR_ALPHA),
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
front = LayeredComponent(
|
||||
rear = shapeComponent(
|
||||
color = composeColor,
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
front = shapeComponent(
|
||||
color = Color.White,
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
padding = indicatorPadding,
|
||||
),
|
||||
padding = indicatorPadding,
|
||||
)
|
||||
},
|
||||
indicatorSizeDp = INDICATOR_SIZE_DP,
|
||||
guideline = guideline,
|
||||
valueFormatter = object : CartesianMarkerValueFormatter {
|
||||
|
|
@ -81,29 +101,6 @@ internal fun rememberTangemChartMarker(color: Color): CartesianMarker {
|
|||
}
|
||||
}
|
||||
|
||||
private fun indicator(color: Int): Component {
|
||||
val composeColor = Color(color)
|
||||
|
||||
return LayeredComponent(
|
||||
rear = shapeComponent(
|
||||
color = composeColor.copy(alpha = INDICATOR_REAR_COLOR_ALPHA),
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
front = LayeredComponent(
|
||||
rear = shapeComponent(
|
||||
color = composeColor,
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
front = shapeComponent(
|
||||
color = Color.White,
|
||||
shape = Shape.Pill,
|
||||
),
|
||||
padding = indicatorPadding,
|
||||
),
|
||||
padding = indicatorPadding,
|
||||
)
|
||||
}
|
||||
|
||||
private val indicatorPadding = Dimensions.of(3.dp)
|
||||
private const val LABEL_BACKGROUND_SHADOW_RADIUS_DP = 4f
|
||||
private const val LABEL_BACKGROUND_SHADOW_DY_DP = 2f
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -11,7 +13,6 @@ android {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
/** DI */
|
||||
implementation(deps.hilt.android)
|
||||
kapt(deps.hilt.kapt)
|
||||
|
|
@ -23,6 +24,7 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
|
||||
/** Core modules */
|
||||
implementation(projects.core.datasource)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -53,6 +55,8 @@ dependencies {
|
|||
implementation(deps.okHttp.prettyLogging)
|
||||
implementation(deps.retrofit)
|
||||
implementation(deps.retrofit.moshi)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
|
||||
/** Time */
|
||||
implementation(deps.jodatime)
|
||||
|
|
@ -62,6 +66,7 @@ dependencies {
|
|||
|
||||
/** Chucker */
|
||||
debugImplementation(deps.chucker)
|
||||
debugPGImplementation(deps.chucker)
|
||||
mockedImplementation(deps.chuckerStub)
|
||||
externalImplementation(deps.chuckerStub)
|
||||
internalImplementation(deps.chuckerStub)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ sealed class ApiConfig {
|
|||
|
||||
companion object {
|
||||
internal const val DEBUG_BUILD_TYPE = "debug"
|
||||
internal const val DEBUG_PG_BUILD_TYPE = "debugPG"
|
||||
internal const val INTERNAL_BUILD_TYPE = "internal"
|
||||
internal const val MOCKED_BUILD_TYPE = "mocked"
|
||||
internal const val EXTERNAL_BUILD_TYPE = "external"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,21 @@
|
|||
package com.tangem.datasource.api.common.config
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Api environment
|
||||
*
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ApiEnvironment {
|
||||
DEV, STAGE, PROD
|
||||
@Json(name = "DEV")
|
||||
DEV,
|
||||
|
||||
@Json(name = "STAGE")
|
||||
STAGE,
|
||||
|
||||
@Json(name = "PROD")
|
||||
PROD,
|
||||
}
|
||||
|
|
@ -68,7 +68,9 @@ internal class Express(
|
|||
|
||||
fun getInitialEnvironment(): ApiEnvironment {
|
||||
return when (BuildConfig.BUILD_TYPE) {
|
||||
DEBUG_BUILD_TYPE -> ApiEnvironment.DEV
|
||||
DEBUG_BUILD_TYPE,
|
||||
DEBUG_PG_BUILD_TYPE,
|
||||
-> ApiEnvironment.DEV
|
||||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> ApiEnvironment.STAGE
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AssetsRequestBody(
|
||||
@Json(name = "tokensList") val tokensList: List<LeastTokenInfo>?,
|
||||
)
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeSentRequestBody(
|
||||
@Json(name = "txId")
|
||||
val txId: String,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class LeastTokenInfo(
|
||||
@Json(name = "contractAddress")
|
||||
val contractAddress: String,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PairsRequestBody(
|
||||
@Json(name = "from")
|
||||
val from: List<LeastTokenInfo>,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Asset(
|
||||
@Json(name = "contractAddress")
|
||||
val contractAddress: String,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,17 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeDataResponseWithTxDetails(
|
||||
@Json(name = "dataResponse")
|
||||
val dataResponse: ExchangeDataResponse,
|
||||
@Json(name = "txDetails")
|
||||
val txDetails: TxDetails,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeDataResponse(
|
||||
@Json(name = "fromAmount")
|
||||
val fromAmount: String,
|
||||
|
|
@ -29,6 +35,7 @@ data class ExchangeDataResponse(
|
|||
val signature: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class TxDetails(
|
||||
@Json(name = "payoutAddress")
|
||||
val payoutAddress: String,
|
||||
|
|
@ -70,6 +77,7 @@ data class TxDetails(
|
|||
val gas: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class TxType {
|
||||
@Json(name = "send")
|
||||
SEND,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeProvider(
|
||||
@Json(name = "id")
|
||||
val id: String,
|
||||
|
|
@ -32,6 +34,7 @@ data class ExchangeProvider(
|
|||
val slippage: BigDecimal?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ExchangeProviderType {
|
||||
@Json(name = "dex")
|
||||
DEX,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeQuoteResponse(
|
||||
|
||||
@Json(name = "fromAmount")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeSentResponseBody(
|
||||
@Json(name = "txId")
|
||||
val txId: String,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeStatusResponse(
|
||||
|
||||
@Json(name = "providerId")
|
||||
|
|
@ -26,6 +28,7 @@ data class ExchangeStatusResponse(
|
|||
val refundContractAddress: String? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ExchangeStatus {
|
||||
|
||||
@Json(name = "new")
|
||||
|
|
@ -71,6 +74,7 @@ enum class ExchangeStatus {
|
|||
Unknown,
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeStatusError(
|
||||
@Json(name = "code")
|
||||
val code: Int,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExpressErrorResponse(
|
||||
@Json(name = "error")
|
||||
val error: ExpressError,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExpressError(
|
||||
@Json(name = "code")
|
||||
val code: Int,
|
||||
|
|
@ -19,6 +22,7 @@ data class ExpressError(
|
|||
val value: ExpressErrorValue?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExpressErrorValue(
|
||||
@Json(name = "minAmount")
|
||||
val minAmount: String?,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.express.models.response
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.datasource.api.express.models.request.LeastTokenInfo
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SwapPair(
|
||||
@Json(name = "from")
|
||||
val from: LeastTokenInfo,
|
||||
|
|
@ -15,6 +17,7 @@ data class SwapPair(
|
|||
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SwapPairProvider(
|
||||
@Json(name = "providerId")
|
||||
val providerId: String,
|
||||
|
|
@ -23,6 +26,7 @@ data class SwapPairProvider(
|
|||
val rateTypes: List<RateType>,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class RateType {
|
||||
@Json(name = "float")
|
||||
FLOAT,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@ package com.tangem.datasource.api.onramp.models.response
|
|||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class OnrampDataResponseWithTxDetails(
|
||||
@Json(name = "dataResponse")
|
||||
val dataResponse: OnrampDataResponse,
|
||||
@Json(name = "txDetails")
|
||||
val txDetails: OnrampTxDetails,
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ data class OnrampStatusResponse(
|
|||
val countryCode: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class Status {
|
||||
@Json(name = "created")
|
||||
Created,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.datasource.api.stakekit.models.request.ConstructTransactionRequestBody.GasArgs
|
||||
import com.tangem.datasource.api.stakekit.models.response.model.BalanceDTO
|
||||
import com.tangem.datasource.api.stakekit.models.response.model.TokenDTO
|
||||
import com.tangem.domain.staking.model.stakekit.action.StakingActionType
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class PendingActionRequestBody(
|
||||
@Json(name = "type")
|
||||
val type: StakingActionType,
|
||||
|
|
@ -19,6 +21,7 @@ data class PendingActionRequestBody(
|
|||
val gasArgs: GasArgs? = null, // used only in estimate_gas request
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ActionRequestBody(
|
||||
@Json(name = "integrationId")
|
||||
val integrationId: String,
|
||||
|
|
@ -32,6 +35,7 @@ data class ActionRequestBody(
|
|||
val gasArgs: GasArgs? = null, // used only in estimate_gas request
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ActionRequestBodyArgs(
|
||||
@Json(name = "amount")
|
||||
val amount: String,
|
||||
|
|
@ -55,6 +59,7 @@ data class ActionRequestBodyArgs(
|
|||
val inputToken: TokenDTO? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SignatureVerification(
|
||||
@Json(name = "message")
|
||||
val message: String,
|
||||
|
|
@ -62,6 +67,7 @@ data class SignatureVerification(
|
|||
val signed: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class TronResource {
|
||||
@Json(name = "ENERGY")
|
||||
ENERGY,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Address(
|
||||
@Json(name = "address")
|
||||
val address: String,
|
||||
|
|
@ -11,6 +13,7 @@ data class Address(
|
|||
val explorerUrl: String? = null,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AdditionalAddresses(
|
||||
// cosmos-specific
|
||||
@Json(name = "cosmosPubKey")
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ConstructTransactionRequestBody(
|
||||
@Json(name = "gasArgs")
|
||||
val gasArgs: GasArgs? = null,
|
||||
@Json(name = "ledgerWalletAPICompatible")
|
||||
val ledgerWalletAPICompatible: Boolean? = null,
|
||||
) {
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class GasArgs(
|
||||
// cosmos-specific
|
||||
@Json(name = "gasPrice")
|
||||
|
|
|
|||
|
|
@ -1,19 +1,23 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MultipleYieldBalancesRequestBody(
|
||||
@Json(name = "addresses") val addresses: Address,
|
||||
@Json(name = "args") val args: MultipleYieldBalancesRequestArgs,
|
||||
@Json(name = "integrationId") val integrationId: String,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Address(
|
||||
@Json(name = "address") val address: String,
|
||||
@Json(name = "additionalAddresses") val additionalAddresses: AdditionalAddresses? = null,
|
||||
@Json(name = "explorerUrl") val explorerUrl: String,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AdditionalAddresses(
|
||||
@Json(name = "cosmosPubKey") val cosmosPubKey: String? = null,
|
||||
@Json(name = "binanceBeaconAddress") val binanceBeaconAddress: String? = null,
|
||||
|
|
@ -25,6 +29,7 @@ data class MultipleYieldBalancesRequestBody(
|
|||
)
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class MultipleYieldBalancesRequestArgs(
|
||||
@Json(name = "validatorAddresses") val validatorAddresses: List<String>,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class RevenueOption(val value: String) {
|
||||
SUPPORTS_FEE("supportsFee"),
|
||||
SUPPORTS_REV_SHARE("supportsRevShare"),
|
||||
@Json(name = "SUPPORTS_FEE") SUPPORTS_FEE("supportsFee"),
|
||||
|
||||
@Json(name = "SUPPORTS_REV_SHARE") SUPPORTS_REV_SHARE("supportsRevShare"),
|
||||
;
|
||||
|
||||
override fun toString(): String {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SubmitTransactionHashRequestBody(
|
||||
@Json(name = "hash")
|
||||
val hash: String,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.tangem.datasource.api.stakekit.models.request
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class YieldBalanceRequestBody(
|
||||
@Json(name = "addresses") val addresses: Address,
|
||||
@Json(name = "args") val args: YieldBalanceRequestArgs,
|
||||
@Json(name = "integrationId") val integrationId: String,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class YieldBalanceRequestArgs(
|
||||
@Json(name = "validatorAddresses") val validatorAddresses: List<String>,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class NetworkTypeDTO {
|
||||
@Json(name = "avalanche-c")
|
||||
AVALANCHE_C,
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ data class BalanceDTO(
|
|||
val providerId: String?,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class BalanceTypeDTO {
|
||||
@Json(name = "available")
|
||||
AVAILABLE,
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ data class YieldDTO(
|
|||
@Json(name = "preferred")
|
||||
val preferred: Boolean?,
|
||||
) {
|
||||
@JsonClass(generateAdapter = true)
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ValidatorStatusDTO {
|
||||
@Json(name = "active")
|
||||
ACTIVE,
|
||||
|
|
@ -153,6 +153,7 @@ data class YieldDTO(
|
|||
val enabled: Boolean?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class RewardScheduleDTO {
|
||||
@Json(name = "block")
|
||||
BLOCK,
|
||||
|
|
@ -178,6 +179,7 @@ data class YieldDTO(
|
|||
UNKNOWN,
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class RewardClaimingDTO {
|
||||
@Json(name = "auto")
|
||||
AUTO,
|
||||
|
|
@ -189,6 +191,7 @@ data class YieldDTO(
|
|||
}
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class RewardTypeDTO {
|
||||
@Json(name = "apy")
|
||||
APY, // compound rate
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model.action
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class StakingActionStatusDTO {
|
||||
@Json(name = "CANCELED")
|
||||
CANCELED,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model.action
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class StakingActionTypeDTO {
|
||||
@Json(name = "STAKE")
|
||||
STAKE,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model.error
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
class StakeKitErrorResponse(
|
||||
@Json(name = "message")
|
||||
val message: String? = null,
|
||||
|
|
@ -26,6 +28,7 @@ class StakeKitErrorResponse(
|
|||
val tags: List<String>? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class StakeKitErrorDetailsDTO(
|
||||
@Json(name = "arguments")
|
||||
val arguments: String? = null,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model.transaction
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class StakingTransactionStatusDTO {
|
||||
@Json(name = "NOT_FOUND")
|
||||
NOT_FOUND,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.stakekit.models.response.model.transaction
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class StakingTransactionTypeDTO {
|
||||
@Json(name = "SWAP")
|
||||
SWAP,
|
||||
|
|
|
|||
|
|
@ -1,14 +1,17 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CoinsResponse(
|
||||
@Json(name = "imageHost") val imageHost: String?,
|
||||
@Json(name = "coins") val coins: List<Coin>,
|
||||
@Json(name = "total") val total: Int,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Coin(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "name") val name: String,
|
||||
|
|
@ -17,6 +20,7 @@ data class CoinsResponse(
|
|||
@Json(name = "networks") val networks: List<Network> = listOf(),
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Network(
|
||||
@Json(name = "networkId") val networkId: String,
|
||||
@Json(name = "contractAddress") val contractAddress: String? = null,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CreateUserTokensAccountBody(
|
||||
@Json(name = "accountId")
|
||||
val id: Int,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ data class CurrenciesResponse(
|
|||
@Json(name = "rateBTC") val rateBTC: String,
|
||||
@Json(name = "unit") val unit: String, // $, €, ₽
|
||||
@Json(name = "type") val type: String,
|
||||
val iconSmallUrl: String? = null,
|
||||
val iconMediumUrl: String? = null,
|
||||
@Json(name = "iconSmallUrl") val iconSmallUrl: String? = null,
|
||||
@Json(name = "iconMediumUrl") val iconMediumUrl: String? = null,
|
||||
)
|
||||
}
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class FeaturesResponse(
|
||||
@Json(name = "send") val isNewSendEnabled: Boolean,
|
||||
)
|
||||
|
|
@ -1,13 +1,16 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import java.math.BigDecimal
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class QuotesResponse(
|
||||
@Json(name = "quotes")
|
||||
val quotes: Map<String, Quote>,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Quote(
|
||||
@Json(name = "price")
|
||||
val price: BigDecimal?,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
// rates.keys = networkId's
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class RatesResponse(
|
||||
@Json(name = "rates") val rates: Map<String, Double>,
|
||||
)
|
||||
|
|
@ -1,30 +1,36 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import org.joda.time.LocalDate
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ReferralResponse(
|
||||
@Json(name = "conditions") val conditions: Conditions,
|
||||
@Json(name = "referral") val referral: Referral?,
|
||||
@Json(name = "expectedAwards") val expectedAwards: ExpectedAwards?,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Conditions(
|
||||
@Json(name = "discount") val discount: Discount,
|
||||
@Json(name = "awards") val awards: List<Award>,
|
||||
@Json(name = "tosLink") val tosLink: String,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Discount(
|
||||
@Json(name = "amount") val amount: Int,
|
||||
@Json(name = "type") val discountType: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Award(
|
||||
@Json(name = "amount") val amount: Int,
|
||||
@Json(name = "token") val token: Token,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Token(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "name") val name: String,
|
||||
|
|
@ -36,6 +42,7 @@ data class ReferralResponse(
|
|||
}
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Referral(
|
||||
@Json(name = "shareLink") val shareLink: String,
|
||||
@Json(name = "address") val address: String,
|
||||
|
|
@ -44,11 +51,13 @@ data class ReferralResponse(
|
|||
@Json(name = "termsAcceptedAt") val termsAcceptedAt: String?,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExpectedAwards(
|
||||
@Json(name = "numberOfWallets") val numberOfWallets: Int,
|
||||
@Json(name = "list") val list: List<AwardItem>,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class AwardItem(
|
||||
@Json(name = "currency") val currency: String,
|
||||
@Json(name = "paymentDate") val paymentDate: LocalDate,
|
||||
|
|
|
|||
|
|
@ -1,10 +1,12 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Sales response
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SalesResponse(
|
||||
@Json(name = "sales") val sales: List<Sales>,
|
||||
)
|
||||
|
|
@ -17,6 +19,7 @@ data class SalesResponse(
|
|||
* @property product product that is sales
|
||||
* @property notification optional notification for product
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Sales(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "state") val state: String,
|
||||
|
|
@ -31,12 +34,14 @@ data class Sales(
|
|||
* @property code code that shows what product it is
|
||||
* @property name product name
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Product(
|
||||
@Json(name = "id") val id: String,
|
||||
@Json(name = "code") val code: String,
|
||||
@Json(name = "name") val name: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Notification(
|
||||
@Json(name = "type") val type: String,
|
||||
@Json(name = "title") val title: String,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/**
|
||||
* Shop response
|
||||
|
|
@ -9,6 +10,7 @@ import com.squareup.moshi.Json
|
|||
*
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ShopResponse(
|
||||
@Json(name = "canOrder") val isOrderingAvailable: Boolean,
|
||||
)
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/** Body for make user referral */
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class StartReferralBody(
|
||||
@Json(name = "walletId") val walletId: String,
|
||||
@Json(name = "networkId") val networkId: String,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UpdateUserTokensAccountBody(
|
||||
@Json(name = "accountTitle")
|
||||
val title: String,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserTokensAccountResponse(
|
||||
@Json(name = "accountId")
|
||||
val id: Int,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.common.extensions.calculateHashCode
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserTokensResponse(
|
||||
@Json(name = "version") val version: Int = 0,
|
||||
@Json(name = "group") val group: GroupType,
|
||||
|
|
@ -10,6 +12,7 @@ data class UserTokensResponse(
|
|||
@Json(name = "tokens") val tokens: List<Token> = emptyList(),
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Token(
|
||||
@Json(name = "id") val id: String? = null,
|
||||
@Json(name = "networkId") val networkId: String,
|
||||
|
|
@ -36,6 +39,7 @@ data class UserTokensResponse(
|
|||
)
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class GroupType {
|
||||
@Json(name = "none")
|
||||
NONE,
|
||||
|
|
@ -47,6 +51,7 @@ data class UserTokensResponse(
|
|||
NETWORK,
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class SortType {
|
||||
@Json(name = "balance")
|
||||
BALANCE,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.datasource.api.tangemTech.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserTokensSettingsResponse(
|
||||
@Json(name = "group")
|
||||
val group: UserTokensResponse.GroupType,
|
||||
|
|
|
|||
|
|
@ -1,13 +1,16 @@
|
|||
package com.tangem.datasource.api.tangemTech.models.v2
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.datasource.api.tangemTech.models.UserTokensResponse
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserTokensResponseV2(
|
||||
@Json(name = "accounts")
|
||||
val accounts: List<TokensAccount>,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class TokensAccount(
|
||||
@Json(name = "id")
|
||||
val id: Int,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,16 @@
|
|||
package com.tangem.datasource.local.card
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UsedCardInfo(
|
||||
@Json(name = "cardId")
|
||||
val cardId: String,
|
||||
@Json(name = "isScanned")
|
||||
val isScanned: Boolean = false,
|
||||
@Json(name = "isActivationStarted")
|
||||
val isActivationStarted: Boolean = false,
|
||||
@Json(name = "isActivationFinished")
|
||||
val isActivationFinished: Boolean = false,
|
||||
)
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.datasource.local.config.providers.models
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
/** Config provider model */
|
||||
sealed class ProviderModel {
|
||||
|
|
@ -12,6 +13,7 @@ sealed class ProviderModel {
|
|||
* "url": "https://example.com"
|
||||
* }
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Public(
|
||||
@Json(name = "url") val url: String,
|
||||
) : ProviderModel()
|
||||
|
|
@ -23,6 +25,7 @@ sealed class ProviderModel {
|
|||
* "name": "nownodes"
|
||||
* }
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Private(
|
||||
@Json(name = "name") val name: String,
|
||||
) : ProviderModel()
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.tangem.datasource.BuildConfig
|
|||
import com.tangem.datasource.api.common.AuthProvider
|
||||
import com.tangem.datasource.api.common.config.*
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.DEBUG_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.DEBUG_PG_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.EXTERNAL_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.INTERNAL_BUILD_TYPE
|
||||
import com.tangem.datasource.api.common.config.ApiConfig.Companion.MOCKED_BUILD_TYPE
|
||||
|
|
@ -95,7 +96,9 @@ internal class ProdApiConfigsManagerTest(private val model: Model) {
|
|||
|
||||
private fun createExpressModel(): Model {
|
||||
val environment = when (BuildConfig.BUILD_TYPE) {
|
||||
DEBUG_BUILD_TYPE -> ApiEnvironment.DEV
|
||||
DEBUG_BUILD_TYPE,
|
||||
DEBUG_PG_BUILD_TYPE,
|
||||
-> ApiEnvironment.DEV
|
||||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> ApiEnvironment.STAGE
|
||||
|
|
@ -110,7 +113,9 @@ internal class ProdApiConfigsManagerTest(private val model: Model) {
|
|||
expected = ApiEnvironmentConfig(
|
||||
environment = environment,
|
||||
baseUrl = when (BuildConfig.BUILD_TYPE) {
|
||||
DEBUG_BUILD_TYPE -> "[REDACTED_ENV_URL]"
|
||||
DEBUG_BUILD_TYPE,
|
||||
DEBUG_PG_BUILD_TYPE,
|
||||
-> "[REDACTED_ENV_URL]"
|
||||
INTERNAL_BUILD_TYPE,
|
||||
MOCKED_BUILD_TYPE,
|
||||
-> "[REDACTED_ENV_URL]"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -44,4 +46,6 @@ dependencies {
|
|||
/** Other */
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -39,5 +41,7 @@ dependencies {
|
|||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
implementation(deps.tangem.blockchain)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
// endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -41,6 +43,10 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
implementation(deps.kotlin.serialization)
|
||||
|
||||
|
||||
implementation(projects.libs.blockchainSdk)
|
||||
implementation(projects.libs.crypto)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -31,5 +33,7 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
// endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -45,6 +47,8 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
|
||||
implementation(projects.libs.blockchainSdk)
|
||||
implementation(projects.libs.crypto)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -48,4 +50,6 @@ dependencies {
|
|||
implementation(deps.timber)
|
||||
implementation(deps.retrofit) // For HttpException
|
||||
implementation(deps.androidx.paging.runtime)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -37,6 +39,8 @@ dependencies {
|
|||
implementation(deps.timber)
|
||||
implementation(deps.androidx.paging.runtime)
|
||||
implementation(deps.moshi.kotlin)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
|
||||
/** Libs - Tangem */
|
||||
implementation(deps.tangem.blockchain)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.tangem.data.visa.config
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
internal data class VisaConfig(
|
||||
@Json(name = "testnet")
|
||||
val testnet: Addresses,
|
||||
|
|
@ -11,6 +13,7 @@ internal data class VisaConfig(
|
|||
val header: Header,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Addresses(
|
||||
@Json(name = "paymentAccountRegistry")
|
||||
val paymentAccountRegistry: String,
|
||||
|
|
@ -18,6 +21,7 @@ internal data class VisaConfig(
|
|||
val bridgeProcessor: String,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Header(
|
||||
@Json(name = "x-asn")
|
||||
val xAsn: String,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -9,4 +10,6 @@ dependencies {
|
|||
implementation(projects.core.utils)
|
||||
implementation(projects.domain.core)
|
||||
implementation(projects.domain.wallets.models)
|
||||
implementation(deps.moshi.kotlin)
|
||||
kapt(deps.moshi.kotlin.codegen)
|
||||
}
|
||||
|
|
@ -1,5 +1,13 @@
|
|||
package com.tangem.domain.analytics.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class WalletBalanceState {
|
||||
ToppedUp, Empty, Error,
|
||||
@Json(name = "ToppedUp") ToppedUp,
|
||||
|
||||
@Json(name = "Empty") Empty,
|
||||
|
||||
@Json(name = "Error") Error,
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ import kotlinx.serialization.encoding.Decoder
|
|||
import kotlinx.serialization.encoding.Encoder
|
||||
import java.math.BigDecimal
|
||||
|
||||
internal object BigDecimalSerializer : KSerializer<BigDecimal> {
|
||||
object BigDecimalSerializer : KSerializer<BigDecimal> {
|
||||
|
||||
override val descriptor = PrimitiveSerialDescriptor(serialName = "BigDecimal", PrimitiveKind.STRING)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -38,6 +41,7 @@ dependencies {
|
|||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.reKotlin)
|
||||
implementation(deps.timber)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
|
||||
/** Testing libraries */
|
||||
testImplementation(deps.test.junit)
|
||||
|
|
|
|||
21
domain/legacy/proguard-rules.pro
vendored
21
domain/legacy/proguard-rules.pro
vendored
|
|
@ -1,21 +0,0 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.kts.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.domain.common
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchain.common.Token
|
||||
|
|
@ -8,8 +9,11 @@ import com.tangem.common.extensions.calculateHashCode
|
|||
@JsonClass(generateAdapter = true)
|
||||
@Deprecated("Use Network model")
|
||||
data class BlockchainNetwork(
|
||||
@Json(name = "blockchain")
|
||||
val blockchain: Blockchain,
|
||||
@Json(name = "derivationPath")
|
||||
val derivationPath: String?,
|
||||
@Json(name = "tokens")
|
||||
val tokens: List<Token>,
|
||||
) {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.kotlin.serialization)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -11,4 +14,5 @@ dependencies {
|
|||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.moshi.adapters)
|
||||
implementation(deps.kotlin.serialization)
|
||||
kapt(deps.moshi.kotlin.codegen)
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.tangem.domain.models.scan
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.common.card.Card
|
||||
import com.tangem.common.card.CardWallet
|
||||
|
|
@ -17,20 +18,35 @@ import com.tangem.common.card.FirmwareVersion as SdkFirmwareVersion
|
|||
* */
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class CardDTO(
|
||||
@Json(name = "cardId")
|
||||
val cardId: String,
|
||||
@Json(name = "batchId")
|
||||
val batchId: String,
|
||||
@Json(name = "cardPublicKey")
|
||||
val cardPublicKey: ByteArray,
|
||||
@Json(name = "firmwareVersion")
|
||||
val firmwareVersion: FirmwareVersion,
|
||||
@Json(name = "manufacturer")
|
||||
val manufacturer: Manufacturer,
|
||||
@Json(name = "issuer")
|
||||
val issuer: Issuer,
|
||||
@Json(name = "settings")
|
||||
val settings: Settings,
|
||||
@Json(name = "userSettings")
|
||||
val userSettings: UserSettings?,
|
||||
@Json(name = "linkedTerminalStatus")
|
||||
val linkedTerminalStatus: LinkedTerminalStatus,
|
||||
@Json(name = "isAccessCodeSet")
|
||||
val isAccessCodeSet: Boolean,
|
||||
@Json(name = "isPasscodeSet")
|
||||
val isPasscodeSet: Boolean?,
|
||||
@Json(name = "supportedCurves")
|
||||
val supportedCurves: List<EllipticCurve>,
|
||||
@Json(name = "wallets")
|
||||
val wallets: List<Wallet>,
|
||||
@Json(name = "attestation")
|
||||
val attestation: Attestation,
|
||||
@Json(name = "backupStatus")
|
||||
val backupStatus: BackupStatus?,
|
||||
) {
|
||||
constructor(card: Card) : this(
|
||||
|
|
@ -92,16 +108,27 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Settings(
|
||||
@Json(name = "securityDelay")
|
||||
val securityDelay: Int,
|
||||
@Json(name = "maxWalletsCount")
|
||||
val maxWalletsCount: Int,
|
||||
@Json(name = "isSettingAccessCodeAllowed")
|
||||
val isSettingAccessCodeAllowed: Boolean,
|
||||
@Json(name = "isSettingPasscodeAllowed")
|
||||
val isSettingPasscodeAllowed: Boolean,
|
||||
@Json(name = "isResettingUserCodesAllowed")
|
||||
val isResettingUserCodesAllowed: Boolean,
|
||||
@Json(name = "isLinkedTerminalEnabled")
|
||||
val isLinkedTerminalEnabled: Boolean,
|
||||
@Json(name = "isBackupAllowed")
|
||||
val isBackupAllowed: Boolean,
|
||||
@Json(name = "supportedEncryptionModes")
|
||||
val supportedEncryptionModes: List<EncryptionMode>,
|
||||
@Json(name = "isFilesAllowed")
|
||||
val isFilesAllowed: Boolean,
|
||||
@Json(name = "isHDWalletAllowed")
|
||||
val isHDWalletAllowed: Boolean,
|
||||
@Json(name = "isKeysImportAllowed")
|
||||
val isKeysImportAllowed: Boolean = false,
|
||||
) {
|
||||
constructor(settings: Card.Settings) : this(
|
||||
|
|
@ -121,6 +148,7 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UserSettings(
|
||||
@Json(name = "isUserCodeRecoveryAllowed")
|
||||
val isUserCodeRecoveryAllowed: Boolean,
|
||||
) {
|
||||
constructor(userSettings: com.tangem.common.card.UserSettings) : this(
|
||||
|
|
@ -130,9 +158,13 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class FirmwareVersion(
|
||||
@Json(name = "major")
|
||||
val major: Int,
|
||||
@Json(name = "minor")
|
||||
val minor: Int,
|
||||
@Json(name = "patch")
|
||||
val patch: Int,
|
||||
@Json(name = "type")
|
||||
val type: SdkFirmwareVersion.FirmwareType,
|
||||
) : Comparable<SdkFirmwareVersion> {
|
||||
val stringValue: String
|
||||
|
|
@ -161,8 +193,11 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Manufacturer(
|
||||
@Json(name = "name")
|
||||
val name: String,
|
||||
@Json(name = "manufactureDate")
|
||||
val manufactureDate: Date,
|
||||
@Json(name = "signature")
|
||||
val signature: ByteArray?,
|
||||
) {
|
||||
constructor(manufacturer: Card.Manufacturer) : this(
|
||||
|
|
@ -195,7 +230,9 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Issuer(
|
||||
@Json(name = "name")
|
||||
val name: String,
|
||||
@Json(name = "publicKey")
|
||||
val publicKey: ByteArray,
|
||||
) {
|
||||
constructor(issuer: Card.Issuer) : this(
|
||||
|
|
@ -220,16 +257,27 @@ data class CardDTO(
|
|||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class Wallet(
|
||||
@Json(name = "publicKey")
|
||||
val publicKey: ByteArray,
|
||||
@Json(name = "chainCode")
|
||||
val chainCode: ByteArray?,
|
||||
@Json(name = "curve")
|
||||
val curve: EllipticCurve,
|
||||
@Json(name = "settings")
|
||||
val settings: CardWallet.Settings,
|
||||
@Json(name = "totalSignedHashes")
|
||||
val totalSignedHashes: Int?,
|
||||
@Json(name = "remainingSignatures")
|
||||
val remainingSignatures: Int?,
|
||||
@Json(name = "index")
|
||||
val index: Int,
|
||||
@Json(name = "hasBackup")
|
||||
val hasBackup: Boolean,
|
||||
@Json(name = "derivedKeys")
|
||||
val derivedKeys: Map<DerivationPath, ExtendedPublicKey>,
|
||||
@Json(name = "extendedPublicKey")
|
||||
val extendedPublicKey: ExtendedPublicKey?,
|
||||
@Json(name = "isImported")
|
||||
val isImported: Boolean = false,
|
||||
) {
|
||||
constructor(wallet: CardWallet) : this(
|
||||
|
|
@ -281,9 +329,15 @@ data class CardDTO(
|
|||
}
|
||||
}
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class LinkedTerminalStatus {
|
||||
@Json(name = "Current")
|
||||
Current,
|
||||
|
||||
@Json(name = "Other")
|
||||
Other,
|
||||
|
||||
@Json(name = "None")
|
||||
None,
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,26 @@ data class ScanResponse(
|
|||
|
||||
typealias KeyWalletPublicKey = ByteArrayKey
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ProductType {
|
||||
Note, Twins, Wallet, Start2Coin, Wallet2, Ring, Visa,
|
||||
@Json(name = "Note")
|
||||
Note,
|
||||
|
||||
@Json(name = "Twins")
|
||||
Twins,
|
||||
|
||||
@Json(name = "Wallet")
|
||||
Wallet,
|
||||
|
||||
@Json(name = "Start2Coin")
|
||||
Start2Coin,
|
||||
|
||||
@Json(name = "Wallet2")
|
||||
Wallet2,
|
||||
|
||||
@Json(name = "Ring")
|
||||
Ring,
|
||||
|
||||
@Json(name = "Visa")
|
||||
Visa,
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.kotlin.serialization)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -9,6 +10,8 @@ dependencies {
|
|||
implementation(projects.domain.tokens.models)
|
||||
implementation(projects.domain.wallets.models)
|
||||
|
||||
implementation(deps.moshi.kotlin)
|
||||
kapt(deps.moshi.kotlin.codegen)
|
||||
implementation(deps.kotlin.serialization)
|
||||
implementation(deps.jodatime)
|
||||
}
|
||||
|
|
@ -1,12 +1,20 @@
|
|||
package com.tangem.domain.onramp.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class OnrampCurrency(
|
||||
@Json(name = "name")
|
||||
val name: String,
|
||||
@Json(name = "code")
|
||||
val code: String,
|
||||
@Json(name = "image")
|
||||
val image: String?,
|
||||
@Json(name = "precision")
|
||||
val precision: Int,
|
||||
@Json(name = "unit")
|
||||
val unit: String,
|
||||
)
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.tangem.domain.onramp.model.cache
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.domain.core.serialization.SerializedBigDecimal
|
||||
import com.tangem.domain.onramp.model.OnrampCurrency
|
||||
import com.tangem.domain.onramp.model.OnrampStatus
|
||||
|
|
@ -24,21 +26,38 @@ import com.tangem.domain.wallets.models.UserWalletId
|
|||
* @property paymentMethod Transaction payment method
|
||||
* @property paymentMethod Residency country
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class OnrampTransaction(
|
||||
@Json(name = "txId")
|
||||
val txId: String,
|
||||
@Json(name = "userWalletId")
|
||||
val userWalletId: UserWalletId,
|
||||
@Json(name = "fromAmount")
|
||||
val fromAmount: SerializedBigDecimal,
|
||||
@Json(name = "fromCurrency")
|
||||
val fromCurrency: OnrampCurrency,
|
||||
@Json(name = "toAmount")
|
||||
val toAmount: SerializedBigDecimal,
|
||||
@Json(name = "toCurrencyId")
|
||||
val toCurrencyId: String,
|
||||
@Json(name = "status")
|
||||
val status: OnrampStatus.Status,
|
||||
@Json(name = "externalTxUrl")
|
||||
val externalTxUrl: String?,
|
||||
@Json(name = "externalTxId")
|
||||
val externalTxId: String?,
|
||||
@Json(name = "timestamp")
|
||||
val timestamp: Long,
|
||||
@Json(name = "providerName")
|
||||
val providerName: String, // todo onramp fix after SwapProvider moved to own module
|
||||
@Json(name = "providerImageUrl")
|
||||
val providerImageUrl: String, // todo onramp fix after SwapProvider moved to own module
|
||||
@Json(name = "providerType")
|
||||
val providerType: String, // todo onramp fix after SwapProvider moved to own module
|
||||
@Json(name = "redirectUrl")
|
||||
val redirectUrl: String,
|
||||
@Json(name = "paymentMethod")
|
||||
val paymentMethod: String,
|
||||
@Json(name = "residency")
|
||||
val residency: String,
|
||||
)
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.kotlin.jvm)
|
||||
alias(deps.plugins.kotlin.serialization)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
|
|
@ -9,4 +12,7 @@ dependencies {
|
|||
|
||||
implementation(deps.kotlin.serialization)
|
||||
implementation(deps.jodatime)
|
||||
|
||||
implementation(deps.moshi)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
}
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
package com.tangem.domain.staking.model
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class UnsubmittedTransactionMetadata(
|
||||
@Json(name = "transactionHash")
|
||||
val transactionHash: String,
|
||||
@Json(name = "transactionId")
|
||||
val transactionId: String,
|
||||
)
|
||||
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
21
features/qr-scanning/impl/proguard-rules.pro
vendored
21
features/qr-scanning/impl/proguard-rules.pro
vendored
|
|
@ -1,21 +0,0 @@
|
|||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -27,6 +29,8 @@ dependencies {
|
|||
implementation(deps.moshi)
|
||||
implementation(deps.moshi.kotlin)
|
||||
implementation(deps.arrow.core)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
kaptForObfuscatingVariants(deps.retrofit.response.type.keeper)
|
||||
|
||||
/** Domain */
|
||||
implementation(projects.domain.tokens.models)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -51,4 +53,5 @@ dependencies {
|
|||
implementation(deps.tangem.blockchain)
|
||||
implementation(deps.tangem.card.core)
|
||||
implementation(deps.moshi)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import com.tangem.plugin.configuration.configurations.extension.kaptForObfuscatingVariants
|
||||
|
||||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
|
|
@ -21,5 +23,7 @@ dependencies {
|
|||
/** Other Libraries **/
|
||||
implementation(deps.kotlin.serialization)
|
||||
implementation(deps.arrow.core)
|
||||
implementation(deps.moshi.kotlin)
|
||||
kaptForObfuscatingVariants(deps.moshi.kotlin.codegen)
|
||||
|
||||
}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
package com.tangem.feature.swap.domain.models.domain
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class Currency {
|
||||
abstract val id: String
|
||||
abstract val name: String
|
||||
abstract val symbol: String
|
||||
abstract val networkId: String
|
||||
abstract val logoUrl: String
|
||||
|
||||
@Serializable
|
||||
data class NativeToken(
|
||||
override val id: String,
|
||||
override val name: String,
|
||||
override val symbol: String,
|
||||
override val networkId: String,
|
||||
override val logoUrl: String,
|
||||
) : Currency()
|
||||
|
||||
@Serializable
|
||||
data class NonNativeToken(
|
||||
override val id: String,
|
||||
override val name: String,
|
||||
override val symbol: String,
|
||||
override val networkId: String,
|
||||
override val logoUrl: String,
|
||||
val contractAddress: String,
|
||||
val decimalCount: Int,
|
||||
) : Currency()
|
||||
}
|
||||
|
||||
fun Currency.isNonNative(): Boolean {
|
||||
return this is Currency.NonNativeToken
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
package com.tangem.feature.swap.domain.models.domain
|
||||
|
||||
data class ExchangeQuote(
|
||||
val toAmount: String,
|
||||
val allowanceContract: String?,
|
||||
)
|
||||
|
|
@ -1,28 +1,67 @@
|
|||
package com.tangem.feature.swap.domain.models.domain
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class ExchangeStatusModel(
|
||||
@Json(name = "providerId")
|
||||
val providerId: String,
|
||||
@Json(name = "status")
|
||||
val status: ExchangeStatus? = null,
|
||||
@Json(name = "txId")
|
||||
val txId: String? = null,
|
||||
@Json(name = "txExternalUrl")
|
||||
val txExternalUrl: String? = null,
|
||||
@Json(name = "txExternalId")
|
||||
val txExternalId: String? = null,
|
||||
@Json(name = "refundNetwork")
|
||||
val refundNetwork: String? = null,
|
||||
@Json(name = "refundContractAddress")
|
||||
val refundContractAddress: String? = null,
|
||||
)
|
||||
|
||||
@JsonClass(generateAdapter = false)
|
||||
enum class ExchangeStatus {
|
||||
@Json(name = "New")
|
||||
New,
|
||||
|
||||
@Json(name = "Waiting")
|
||||
Waiting,
|
||||
|
||||
@Json(name = "WaitingTxHash")
|
||||
WaitingTxHash,
|
||||
|
||||
@Json(name = "Confirming")
|
||||
Confirming,
|
||||
|
||||
@Json(name = "Verifying")
|
||||
Verifying,
|
||||
|
||||
@Json(name = "Exchanging")
|
||||
Exchanging,
|
||||
|
||||
@Json(name = "Failed")
|
||||
Failed,
|
||||
|
||||
@Json(name = "Sending")
|
||||
Sending,
|
||||
|
||||
@Json(name = "Finished")
|
||||
Finished,
|
||||
|
||||
@Json(name = "Refunded")
|
||||
Refunded,
|
||||
|
||||
@Json(name = "Cancelled")
|
||||
Cancelled,
|
||||
|
||||
@Json(name = "TxFailed")
|
||||
TxFailed,
|
||||
|
||||
@Json(name = "Unknown")
|
||||
Unknown,
|
||||
|
||||
@Json(name = "Paused")
|
||||
Paused,
|
||||
}
|
||||
|
|
@ -1,6 +1,12 @@
|
|||
package com.tangem.feature.swap.domain.models.domain
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SavedLastSwappedCryptoCurrency(
|
||||
@Json(name = "userWalletId")
|
||||
val userWalletId: String,
|
||||
@Json(name = "cryptoCurrencyId")
|
||||
val cryptoCurrencyId: String,
|
||||
)
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
package com.tangem.feature.swap.domain.models.domain
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
import com.squareup.moshi.JsonClass
|
||||
import com.tangem.datasource.api.tangemTech.models.UserTokensResponse
|
||||
import com.tangem.domain.tokens.model.CryptoCurrency
|
||||
import java.math.BigDecimal
|
||||
|
|
@ -17,21 +19,35 @@ data class SavedSwapTransactionListModel(
|
|||
* IMPORTANT !!!
|
||||
* This is internal model for storing swap tx. It should not be used outside.
|
||||
*/
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SavedSwapTransactionListModelInner(
|
||||
@Json(name = "userWalletId")
|
||||
val userWalletId: String,
|
||||
@Json(name = "fromCryptoCurrencyId")
|
||||
val fromCryptoCurrencyId: String,
|
||||
@Json(name = "toCryptoCurrencyId")
|
||||
val toCryptoCurrencyId: String,
|
||||
@Json(name = "fromTokensResponse")
|
||||
val fromTokensResponse: UserTokensResponse.Token? = null,
|
||||
@Json(name = "toTokensResponse")
|
||||
val toTokensResponse: UserTokensResponse.Token? = null,
|
||||
@Json(name = "transactions")
|
||||
val transactions: List<SavedSwapTransactionModel>,
|
||||
)
|
||||
|
||||
// TODO refactor to use separate models to store
|
||||
@JsonClass(generateAdapter = true)
|
||||
data class SavedSwapTransactionModel(
|
||||
@Json(name = "txId")
|
||||
val txId: String,
|
||||
@Json(name = "timestamp")
|
||||
val timestamp: Long,
|
||||
@Json(name = "fromCryptoAmount")
|
||||
val fromCryptoAmount: BigDecimal,
|
||||
@Json(name = "toCryptoAmount")
|
||||
val toCryptoAmount: BigDecimal,
|
||||
@Json(name = "provider")
|
||||
val provider: SwapProvider,
|
||||
@Json(name = "status")
|
||||
val status: ExchangeStatusModel? = null,
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue