Updated on 2026-08-14
This commit is contained in:
parent
8564f21d01
commit
7740d6f453
18 changed files with 167 additions and 50 deletions
|
|
@ -1,6 +1,8 @@
|
|||
package com.tangem.features.send.v2.api.entity
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import com.tangem.blockchain.common.Amount
|
||||
import com.tangem.blockchain.common.Blockchain
|
||||
import com.tangem.blockchain.common.transaction.Fee
|
||||
import com.tangem.blockchain.common.transaction.TransactionFee
|
||||
import com.tangem.core.analytics.models.AnalyticsParam
|
||||
|
|
@ -44,7 +46,7 @@ sealed class FeeSelectorUM {
|
|||
is Custom,
|
||||
-> AnalyticsParam.FeeType.Custom
|
||||
is Fast -> AnalyticsParam.FeeType.Max
|
||||
is Market -> AnalyticsParam.FeeType.Normal
|
||||
is Market, is FeeItem.Loading -> AnalyticsParam.FeeType.Normal
|
||||
is Slow -> AnalyticsParam.FeeType.Min
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +86,16 @@ sealed class FeeItem {
|
|||
return this::class == other::class
|
||||
}
|
||||
|
||||
fun isLoading(): Boolean {
|
||||
return this is Loading
|
||||
}
|
||||
|
||||
object Loading : FeeItem() {
|
||||
override val title: TextReference = resourceReference(R.string.common_fee_selector_option_market)
|
||||
override val iconRes: Int = R.drawable.ic_bird_24
|
||||
override val fee: Fee = Fee.Common(Amount(BigDecimal.ZERO, Blockchain.Unknown))
|
||||
}
|
||||
|
||||
data class Suggested(
|
||||
override val title: TextReference,
|
||||
override val fee: Fee,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import com.tangem.features.send.v2.api.entity.FeeSelectorUM
|
|||
sealed class FeeSelectorParams {
|
||||
abstract val state: FeeSelectorUM
|
||||
abstract val userWalletId: UserWalletId
|
||||
abstract val onLoadFeeExtended: (suspend () -> Either<GetFeeError, TransactionFeeExtended>)?
|
||||
abstract val onLoadFeeExtended: (suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>)?
|
||||
abstract val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>
|
||||
abstract val cryptoCurrencyStatus: CryptoCurrencyStatus
|
||||
abstract val feeCryptoCurrencyStatus: CryptoCurrencyStatus
|
||||
|
|
@ -27,7 +27,9 @@ sealed class FeeSelectorParams {
|
|||
data class FeeSelectorBlockParams(
|
||||
override val state: FeeSelectorUM,
|
||||
override val userWalletId: UserWalletId,
|
||||
override val onLoadFeeExtended: (suspend () -> Either<GetFeeError, TransactionFeeExtended>)? = null,
|
||||
override val onLoadFeeExtended: (
|
||||
suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>
|
||||
)? = null,
|
||||
override val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>,
|
||||
override val cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
override val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
|
|
@ -40,7 +42,9 @@ sealed class FeeSelectorParams {
|
|||
data class FeeSelectorDetailsParams(
|
||||
override val state: FeeSelectorUM,
|
||||
override val userWalletId: UserWalletId,
|
||||
override val onLoadFeeExtended: (suspend () -> Either<GetFeeError, TransactionFeeExtended>)? = null,
|
||||
override val onLoadFeeExtended: (
|
||||
suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>
|
||||
)? = null,
|
||||
override val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>,
|
||||
override val cryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
override val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue