Updated on 2026-08-14
This commit is contained in:
parent
53b02cfb10
commit
2be7445212
81 changed files with 4444 additions and 3434 deletions
|
|
@ -2,6 +2,7 @@ package com.tangem.domain.express.models
|
|||
|
||||
import java.math.BigDecimal
|
||||
|
||||
@Suppress("MagicNumber")
|
||||
sealed class ExpressError : Throwable() {
|
||||
|
||||
abstract val code: Int
|
||||
|
|
@ -61,4 +62,12 @@ sealed class ExpressError : Throwable() {
|
|||
data object UnknownError : ExpressError() {
|
||||
override val code: Int = -1
|
||||
}
|
||||
|
||||
data class TooLargeSolanaTransactionError(override val code: Int = -2) : ExpressError() {
|
||||
override val message: String = "tooLargeSolanaTransaction"
|
||||
}
|
||||
|
||||
data class DexActiveSupplyError(override val code: Int = -3) : ExpressError() {
|
||||
override val message: String = "dexActiveSupplyError"
|
||||
}
|
||||
}
|
||||
|
|
@ -23,14 +23,18 @@ enum class ExpressProviderType(val typeName: String) {
|
|||
ONRAMP(typeName = "ONRAMP"),
|
||||
;
|
||||
|
||||
fun shouldStoreSwapTransaction() = when (this) {
|
||||
CEX,
|
||||
DEX_BRIDGE,
|
||||
DEX,
|
||||
-> true
|
||||
ONRAMP,
|
||||
-> false
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun ExpressProviderType.shouldStoreSwapTransaction() = when (this) {
|
||||
CEX,
|
||||
DEX_BRIDGE,
|
||||
DEX,
|
||||
-> true
|
||||
ONRAMP,
|
||||
-> false
|
||||
fun getSwapProviderTypes(): List<ExpressProviderType> {
|
||||
return listOf(CEX, DEX, DEX_BRIDGE)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue