Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-22 17:05:04 +03:00
commit 21ae19f625
938 changed files with 40685 additions and 7487 deletions

View file

@ -1,3 +1,5 @@
package com.tangem.features.send.v2.api
interface SendFeatureToggles
interface SendFeatureToggles {
val isGaslessTransactionsEnabled: Boolean
}

View file

@ -28,7 +28,6 @@ interface SendNotificationsComponent {
val analyticsCategoryName: String,
val userWalletId: UserWalletId,
val cryptoCurrencyStatus: CryptoCurrencyStatus,
val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
val appCurrency: AppCurrency,
val notificationData: NotificationData,
val callback: ModelCallback,
@ -41,6 +40,7 @@ interface SendNotificationsComponent {
val isIgnoreReduce: Boolean,
val fee: Fee?,
val feeError: GetFeeError?,
val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
)
}

View file

@ -187,6 +187,7 @@ sealed class CommonSendAnalyticEvents(
enum class CommonSendSource(val analyticsName: String) {
Send("Send"),
Swap("Swap"),
SendWithSwap("Send&Swap"),
WalletConnect("WalletConnect"),
NFT("NFT"),

View file

@ -1,13 +1,17 @@
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
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.models.currency.CryptoCurrencyStatus
import com.tangem.domain.transaction.error.GetFeeError
import com.tangem.domain.transaction.models.TransactionFeeExtended
import com.tangem.features.send.v2.api.R
import com.tangem.features.send.v2.api.entity.FeeItem.*
import kotlinx.collections.immutable.ImmutableList
@ -23,7 +27,10 @@ sealed class FeeSelectorUM {
override val isPrimaryButtonEnabled = false
}
data class Error(val error: GetFeeError) : FeeSelectorUM() {
data class Error(
val error: GetFeeError,
val isHidden: Boolean = false,
) : FeeSelectorUM() {
override val isPrimaryButtonEnabled = false
}
@ -43,7 +50,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
}
}
@ -61,6 +68,10 @@ data class FeeExtraInfo(
val isFeeApproximate: Boolean,
val isFeeConvertibleToFiat: Boolean,
val isTronToken: Boolean,
val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
val availableFeeCurrencies: ImmutableList<CryptoCurrencyStatus>? = null,
val transactionFeeExtended: TransactionFeeExtended? = null,
val isNotEnoughFunds: Boolean = false,
)
sealed class FeeNonce {
@ -81,6 +92,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,

View file

@ -5,13 +5,17 @@ import com.tangem.blockchain.common.transaction.Fee
import com.tangem.blockchain.common.transaction.TransactionFee
import com.tangem.core.ui.extensions.TextReference
import com.tangem.domain.models.currency.CryptoCurrencyStatus
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.transaction.error.GetFeeError
import com.tangem.domain.transaction.models.TransactionFeeExtended
import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents
import com.tangem.features.send.v2.api.callbacks.FeeSelectorModelCallback
import com.tangem.features.send.v2.api.entity.FeeSelectorUM
sealed class FeeSelectorParams {
abstract val state: FeeSelectorUM
abstract val userWalletId: UserWalletId
abstract val onLoadFeeExtended: (suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>)?
abstract val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>
abstract val cryptoCurrencyStatus: CryptoCurrencyStatus
abstract val feeCryptoCurrencyStatus: CryptoCurrencyStatus
@ -22,6 +26,10 @@ sealed class FeeSelectorParams {
data class FeeSelectorBlockParams(
override val state: FeeSelectorUM,
override val userWalletId: UserWalletId,
override val onLoadFeeExtended: (
suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>
)? = null,
override val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>,
override val cryptoCurrencyStatus: CryptoCurrencyStatus,
override val feeCryptoCurrencyStatus: CryptoCurrencyStatus,
@ -29,10 +37,15 @@ sealed class FeeSelectorParams {
override val feeDisplaySource: FeeDisplaySource,
override val analyticsCategoryName: String,
override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource,
val bottomSheetShown: (Boolean) -> Unit = {},
) : FeeSelectorParams()
data class FeeSelectorDetailsParams(
override val state: FeeSelectorUM,
override val userWalletId: UserWalletId,
override val onLoadFeeExtended: (
suspend (CryptoCurrencyStatus?) -> Either<GetFeeError, TransactionFeeExtended>
)? = null,
override val onLoadFee: suspend () -> Either<GetFeeError, TransactionFee>,
override val cryptoCurrencyStatus: CryptoCurrencyStatus,
override val feeCryptoCurrencyStatus: CryptoCurrencyStatus,