Updated on 2026-08-14
This commit is contained in:
parent
b73c5486d3
commit
e80ade9558
13 changed files with 470 additions and 10 deletions
|
|
@ -0,0 +1,47 @@
|
|||
package com.tangem.domain.swap.models
|
||||
|
||||
import java.math.BigDecimal
|
||||
import java.math.BigInteger
|
||||
|
||||
data class SwapDataModel(
|
||||
val toTokenAmount: BigDecimal,
|
||||
val transaction: SwapDataTransactionModel,
|
||||
)
|
||||
|
||||
sealed class SwapDataTransactionModel {
|
||||
|
||||
abstract val fromAmount: BigDecimal
|
||||
abstract val toAmount: BigDecimal
|
||||
abstract val txValue: String
|
||||
abstract val txId: String
|
||||
abstract val txTo: String
|
||||
abstract val txExtraId: String?
|
||||
|
||||
/**
|
||||
* @param txValue amount for tx, should use native coin decimals, this value will send as native amount in tx
|
||||
*/
|
||||
data class DEX(
|
||||
override val fromAmount: BigDecimal,
|
||||
override val toAmount: BigDecimal,
|
||||
override val txValue: String,
|
||||
override val txId: String,
|
||||
override val txTo: String,
|
||||
override val txExtraId: String?,
|
||||
val txFrom: String,
|
||||
val txData: String,
|
||||
val otherNativeFeeWei: BigDecimal?,
|
||||
val gas: BigInteger,
|
||||
) : SwapDataTransactionModel()
|
||||
|
||||
data class CEX(
|
||||
override val fromAmount: BigDecimal,
|
||||
override val toAmount: BigDecimal,
|
||||
override val txValue: String,
|
||||
override val txId: String,
|
||||
override val txTo: String,
|
||||
override val txExtraId: String?,
|
||||
val externalTxId: String,
|
||||
val externalTxUrl: String,
|
||||
val txExtraIdName: String?,
|
||||
) : SwapDataTransactionModel()
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.tangem.domain.swap.models
|
||||
|
||||
/**
|
||||
* Refund data
|
||||
*
|
||||
* @param refundAddress address refund send to
|
||||
* @param refundExtraId refund token id
|
||||
*/
|
||||
data class SwapRefundData(
|
||||
val refundAddress: String? = null,
|
||||
val refundExtraId: String? = null,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue