Updated on 2026-08-14
This commit is contained in:
parent
4aa6a9666b
commit
c3bfe301a5
11 changed files with 133 additions and 24 deletions
|
|
@ -6,6 +6,7 @@ import com.tangem.domain.models.network.NetworkAddress
|
|||
import com.tangem.domain.models.network.TxInfo
|
||||
import com.tangem.domain.models.serialization.SerializedBigDecimal
|
||||
import com.tangem.domain.models.staking.YieldBalance
|
||||
import com.tangem.domain.models.yield.supply.YieldSupplyStatus
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +59,12 @@ data class CryptoCurrencyStatus(
|
|||
/** Staking yield balance */
|
||||
val yieldBalance: YieldBalance? get() = null
|
||||
|
||||
/**
|
||||
* !!! DO NOT CONFUSE with STAKING YIELD BALANCE
|
||||
* Yield supply status
|
||||
*/
|
||||
val yieldSupplyStatus: YieldSupplyStatus? get() = null
|
||||
|
||||
/** Sources */
|
||||
val sources: Sources get() = Sources()
|
||||
}
|
||||
|
|
@ -157,6 +164,7 @@ data class CryptoCurrencyStatus(
|
|||
override val fiatRate: SerializedBigDecimal,
|
||||
override val priceChange: SerializedBigDecimal,
|
||||
override val yieldBalance: YieldBalance?,
|
||||
override val yieldSupplyStatus: YieldSupplyStatus?,
|
||||
override val hasCurrentNetworkTransactions: Boolean,
|
||||
override val pendingTransactions: Set<TxInfo>,
|
||||
override val networkAddress: NetworkAddress,
|
||||
|
|
@ -184,6 +192,7 @@ data class CryptoCurrencyStatus(
|
|||
override val fiatRate: SerializedBigDecimal?,
|
||||
override val priceChange: SerializedBigDecimal?,
|
||||
override val yieldBalance: YieldBalance?,
|
||||
override val yieldSupplyStatus: YieldSupplyStatus?,
|
||||
override val hasCurrentNetworkTransactions: Boolean,
|
||||
override val pendingTransactions: Set<TxInfo>,
|
||||
override val networkAddress: NetworkAddress,
|
||||
|
|
@ -205,6 +214,7 @@ data class CryptoCurrencyStatus(
|
|||
data class NoQuote(
|
||||
override val amount: SerializedBigDecimal,
|
||||
override val yieldBalance: YieldBalance?,
|
||||
override val yieldSupplyStatus: YieldSupplyStatus?,
|
||||
override val hasCurrentNetworkTransactions: Boolean,
|
||||
override val pendingTransactions: Set<TxInfo>,
|
||||
override val networkAddress: NetworkAddress,
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.tangem.domain.models.network
|
|||
|
||||
import com.tangem.domain.models.StatusSource
|
||||
import com.tangem.domain.models.currency.CryptoCurrency
|
||||
import com.tangem.domain.models.yield.supply.YieldSupplyStatus
|
||||
import java.math.BigDecimal
|
||||
|
||||
/**
|
||||
|
|
@ -58,6 +59,7 @@ data class NetworkStatus(val network: Network, val value: Value) {
|
|||
val address: NetworkAddress,
|
||||
val amounts: Map<CryptoCurrency.ID, Amount>,
|
||||
val pendingTransactions: Map<CryptoCurrency.ID, Set<TxInfo>>,
|
||||
val yieldSupplyStatuses: Map<CryptoCurrency.ID, YieldSupplyStatus?>,
|
||||
override val source: StatusSource,
|
||||
) : Value()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.tangem.domain.models.yield.supply
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
/**
|
||||
* Represents the status of yield supply for a cryptocurrency asset.
|
||||
*
|
||||
* This data class encapsulates the current state of yield supply, including whether it is active,
|
||||
* initialized, and allowed to spend.
|
||||
*
|
||||
* @property isActive Indicates if the yield token is currently active.
|
||||
* @property isInitialized Indicates if the yield token has been initialized.
|
||||
* @property isAllowedToSpend Indicates if spending from the yield module is permitted.
|
||||
*/
|
||||
@Serializable
|
||||
data class YieldSupplyStatus(
|
||||
val isActive: Boolean,
|
||||
val isInitialized: Boolean,
|
||||
val isAllowedToSpend: Boolean,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue