Updated on 2026-08-14

This commit is contained in:
Tangem 2025-08-18 19:36:50 +05:00
parent 6f047b8607
commit 694c215bb1
14 changed files with 178 additions and 178 deletions

View file

@ -5,8 +5,10 @@ import com.tangem.blockchain.common.transaction.Fee
import com.tangem.blockchain.common.transaction.TransactionFee
import com.tangem.core.analytics.models.AnalyticsParam
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.resourceReference
import com.tangem.domain.appcurrency.model.AppCurrency
import com.tangem.domain.transaction.error.GetFeeError
import com.tangem.features.send.v2.api.R
import com.tangem.features.send.v2.api.entity.FeeItem.*
import kotlinx.collections.immutable.ImmutableList
import java.math.BigDecimal
@ -72,14 +74,37 @@ sealed class FeeNonce {
@Immutable
sealed class FeeItem {
abstract val fee: Fee
abstract val title: TextReference
abstract val iconRes: Int
fun isSameClass(other: FeeItem): Boolean {
return this::class == other::class
}
data class Suggested(val title: TextReference, override val fee: Fee) : FeeItem()
data class Slow(override val fee: Fee) : FeeItem()
data class Market(override val fee: Fee) : FeeItem()
data class Fast(override val fee: Fee) : FeeItem()
data class Custom(override val fee: Fee, val customValues: ImmutableList<CustomFeeFieldUM>) : FeeItem()
data class Suggested(
override val title: TextReference,
override val fee: Fee,
) : FeeItem() {
override val iconRes: Int = R.drawable.ic_star_mini_24
}
data class Slow(override val fee: Fee) : FeeItem() {
override val title: TextReference = resourceReference(R.string.common_fee_selector_option_slow)
override val iconRes: Int = R.drawable.ic_tortoise_24
}
data class Market(override val fee: Fee) : FeeItem() {
override val title: TextReference = resourceReference(R.string.common_fee_selector_option_market)
override val iconRes: Int = R.drawable.ic_bird_24
}
data class Fast(override val fee: Fee) : FeeItem() {
override val title: TextReference = resourceReference(R.string.common_fee_selector_option_fast)
override val iconRes: Int = R.drawable.ic_hare_24
}
data class Custom(override val fee: Fee, val customValues: ImmutableList<CustomFeeFieldUM>) : FeeItem() {
override val title: TextReference = resourceReference(R.string.common_custom)
override val iconRes: Int = R.drawable.ic_edit_v2_24
}
}