From e01a65011b8134aaf77887e5f9dc3846f625f6a7 Mon Sep 17 00:00:00 2001 From: Tangem Date: Mon, 29 Sep 2025 19:36:43 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../api/analytics/CommonSendAnalyticEvents.kt | 43 +++++++++++++++++-- .../send/v2/api/params/FeeSelectorParams.kt | 4 ++ .../CommonSendAmountAnalyticEvents.kt | 4 ++ .../SendDestinationComponentParams.kt | 4 ++ .../analytics/CommonSendFeeAnalyticEvents.kt | 9 +++- .../DefaultFeeSelectorBlockComponent.kt | 1 + .../v2/feeselector/model/FeeSelectorModel.kt | 6 ++- .../send/v2/send/DefaultSendComponent.kt | 21 +++++++-- .../v2/send/confirm/SendConfirmComponent.kt | 6 +++ .../features/send/v2/send/model/SendModel.kt | 1 + .../v2/sendnft/DefaultNFTSendComponent.kt | 20 +++++++-- .../confirm/NFTSendConfirmComponent.kt | 5 +++ .../success/NFTSendSuccessComponent.kt | 3 ++ .../amount/SendAmountComponentParams.kt | 4 ++ .../amount/model/SendAmountModel.kt | 1 + .../SendDestinationAnalyticEvents.kt | 7 ++- .../destination/model/SendDestinationModel.kt | 3 +- .../fee/SendFeeComponentParams.kt | 4 ++ .../subcomponents/fee/model/SendFeeModel.kt | 1 + .../impl/amount/SwapAmountComponentParams.kt | 4 ++ .../v2/impl/amount/model/SwapAmountModel.kt | 1 + .../DefaultSendWithSwapComponent.kt | 14 +++++- .../confirm/SendWithSwapConfirmComponent.kt | 5 +++ .../sendviaswap/model/SendWithSwapModel.kt | 1 + .../components/common/WcNavigationUtils.kt | 2 + .../send/WcSendTransactionComponent.kt | 2 + 26 files changed, 159 insertions(+), 17 deletions(-) diff --git a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/analytics/CommonSendAnalyticEvents.kt b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/analytics/CommonSendAnalyticEvents.kt index 00230df78d..799c657659 100644 --- a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/analytics/CommonSendAnalyticEvents.kt +++ b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/analytics/CommonSendAnalyticEvents.kt @@ -18,22 +18,50 @@ sealed class CommonSendAnalyticEvents( /** Recipient address screen opened */ data class AddressScreenOpened( val categoryName: String, - ) : CommonSendAnalyticEvents(category = categoryName, event = "Address Screen Opened") + val source: CommonSendSource, + ) : CommonSendAnalyticEvents( + category = categoryName, + event = "Address Screen Opened", + params = mapOf( + SOURCE to source.analyticsName, + ), + ) /** Amount screen opened */ data class AmountScreenOpened( val categoryName: String, - ) : CommonSendAnalyticEvents(category = categoryName, event = "Amount Screen Opened") + val source: CommonSendSource, + ) : CommonSendAnalyticEvents( + category = categoryName, + event = "Amount Screen Opened", + params = mapOf( + SOURCE to source.analyticsName, + ), + ) /** Fee screen opened */ data class FeeScreenOpened( val categoryName: String, - ) : CommonSendAnalyticEvents(category = categoryName, event = "Fee Screen Opened") + val source: CommonSendSource, + ) : CommonSendAnalyticEvents( + category = categoryName, + event = "Fee Screen Opened", + params = mapOf( + SOURCE to source.analyticsName, + ), + ) /** Confirmation screen opened */ data class ConfirmationScreenOpened( val categoryName: String, - ) : CommonSendAnalyticEvents(category = categoryName, event = "Confirm Screen Opened") + val source: CommonSendSource, + ) : CommonSendAnalyticEvents( + category = categoryName, + event = "Confirm Screen Opened", + params = mapOf( + SOURCE to source.analyticsName, + ), + ) /** If transaction delays notification is present */ data class NoticeTransactionDelays( @@ -142,4 +170,11 @@ sealed class CommonSendAnalyticEvents( Fee, Confirm, } + + enum class CommonSendSource(val analyticsName: String) { + Send("Send"), + SendWithSwap("Send&Swap"), + WalletConnect("WalletConnect"), + NFT("NFT"), + } } \ No newline at end of file diff --git a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/params/FeeSelectorParams.kt b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/params/FeeSelectorParams.kt index 80914b0ce9..2c1ae24ec6 100644 --- a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/params/FeeSelectorParams.kt +++ b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/params/FeeSelectorParams.kt @@ -6,6 +6,7 @@ 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.transaction.error.GetFeeError +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 @@ -17,6 +18,7 @@ sealed class FeeSelectorParams { abstract val feeStateConfiguration: FeeStateConfiguration abstract val feeDisplaySource: FeeDisplaySource abstract val analyticsCategoryName: String + abstract val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource data class FeeSelectorBlockParams( override val state: FeeSelectorUM, @@ -26,6 +28,7 @@ sealed class FeeSelectorParams { override val feeStateConfiguration: FeeStateConfiguration, override val feeDisplaySource: FeeDisplaySource, override val analyticsCategoryName: String, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, ) : FeeSelectorParams() data class FeeSelectorDetailsParams( @@ -36,6 +39,7 @@ sealed class FeeSelectorParams { override val feeStateConfiguration: FeeStateConfiguration, override val feeDisplaySource: FeeDisplaySource, override val analyticsCategoryName: String, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val callback: FeeSelectorModelCallback, ) : FeeSelectorParams() diff --git a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/amount/analytics/CommonSendAmountAnalyticEvents.kt b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/amount/analytics/CommonSendAmountAnalyticEvents.kt index b3dbf385fb..5cc038b0cb 100644 --- a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/amount/analytics/CommonSendAmountAnalyticEvents.kt +++ b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/amount/analytics/CommonSendAmountAnalyticEvents.kt @@ -2,8 +2,10 @@ package com.tangem.features.send.v2.api.subcomponents.amount.analytics import com.tangem.core.analytics.models.AnalyticsEvent import com.tangem.core.analytics.models.AnalyticsParam.Key.BLOCKCHAIN +import com.tangem.core.analytics.models.AnalyticsParam.Key.SOURCE import com.tangem.core.analytics.models.AnalyticsParam.Key.TOKEN_PARAM import com.tangem.core.analytics.models.AnalyticsParam.Key.TYPE +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents sealed class CommonSendAmountAnalyticEvents( category: String, @@ -26,12 +28,14 @@ sealed class CommonSendAmountAnalyticEvents( val categoryName: String, val token: String, val blockchain: String, + val source: CommonSendAnalyticEvents.CommonSendSource, ) : CommonSendAmountAnalyticEvents( category = categoryName, event = "Max Amount Taped", params = mapOf( TOKEN_PARAM to token, BLOCKCHAIN to blockchain, + SOURCE to source.analyticsName, ), ) diff --git a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/destination/SendDestinationComponentParams.kt b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/destination/SendDestinationComponentParams.kt index d87ee8379f..267b5c896f 100644 --- a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/destination/SendDestinationComponentParams.kt +++ b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/destination/SendDestinationComponentParams.kt @@ -3,6 +3,7 @@ package com.tangem.features.send.v2.api.subcomponents.destination import com.tangem.core.ui.extensions.TextReference import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.subcomponents.destination.entity.DestinationUM import kotlinx.coroutines.flow.Flow @@ -12,12 +13,14 @@ sealed class SendDestinationComponentParams { abstract val state: DestinationUM abstract val analyticsCategoryName: String + abstract val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource abstract val userWalletId: UserWalletId abstract val cryptoCurrency: CryptoCurrency data class DestinationParams( override val state: DestinationUM, override val analyticsCategoryName: String, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, override val cryptoCurrency: CryptoCurrency, override val userWalletId: UserWalletId, val title: TextReference, @@ -29,6 +32,7 @@ sealed class SendDestinationComponentParams { data class DestinationBlockParams( override val state: DestinationUM, override val analyticsCategoryName: String, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, override val userWalletId: UserWalletId, override val cryptoCurrency: CryptoCurrency, val blockClickEnableFlow: StateFlow, diff --git a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/feeSelector/analytics/CommonSendFeeAnalyticEvents.kt b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/feeSelector/analytics/CommonSendFeeAnalyticEvents.kt index 579c005570..500e8b4f69 100644 --- a/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/feeSelector/analytics/CommonSendFeeAnalyticEvents.kt +++ b/features/send-v2/api/src/main/java/com/tangem/features/send/v2/api/subcomponents/feeSelector/analytics/CommonSendFeeAnalyticEvents.kt @@ -2,6 +2,9 @@ package com.tangem.features.send.v2.api.subcomponents.feeSelector.analytics import com.tangem.core.analytics.models.AnalyticsEvent import com.tangem.core.analytics.models.AnalyticsParam +import com.tangem.core.analytics.models.AnalyticsParam.Key.FEE_TYPE +import com.tangem.core.analytics.models.AnalyticsParam.Key.SOURCE +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents.CommonSendSource sealed class CommonSendFeeAnalyticEvents( category: String, @@ -15,10 +18,14 @@ sealed class CommonSendFeeAnalyticEvents( data class SelectedFee( override val categoryName: String, val feeType: AnalyticsParam.FeeType, + val source: CommonSendSource, ) : CommonSendFeeAnalyticEvents( category = categoryName, event = "Fee Selected", - params = mapOf("Fee Type" to feeType.value), + params = mapOf( + FEE_TYPE to feeType.value, + SOURCE to source.analyticsName, + ), ) /** Custom fee selected */ diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/DefaultFeeSelectorBlockComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/DefaultFeeSelectorBlockComponent.kt index 5cb0f113e0..dd4e3c17dd 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/DefaultFeeSelectorBlockComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/DefaultFeeSelectorBlockComponent.kt @@ -51,6 +51,7 @@ internal class DefaultFeeSelectorBlockComponent @AssistedInject constructor( feeStateConfiguration = params.feeStateConfiguration, feeDisplaySource = FeeSelectorParams.FeeDisplaySource.Screen, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, ), onDismiss = { model.feeSelectorBottomSheet.dismiss() diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/model/FeeSelectorModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/model/FeeSelectorModel.kt index 1b389809c0..664d23a834 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/model/FeeSelectorModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/feeselector/model/FeeSelectorModel.kt @@ -150,6 +150,7 @@ internal class FeeSelectorModel @Inject constructor( CommonSendFeeAnalyticEvents.SelectedFee( categoryName = params.analyticsCategoryName, feeType = feeSelectorUM.toAnalyticType(), + source = params.analyticsSendSource, ), ) val isCustomFeeEdited = feeSelectorUM.selectedFeeItem.fee.amount.value != feeSelectorUM.fees.normal.amount.value @@ -176,7 +177,10 @@ internal class FeeSelectorModel @Inject constructor( fun showFeeSelector() { analyticsEventHandler.send( - CommonSendAnalyticEvents.FeeScreenOpened(categoryName = params.analyticsCategoryName), + CommonSendAnalyticEvents.FeeScreenOpened( + categoryName = params.analyticsCategoryName, + source = params.analyticsSendSource, + ), ) analyticsEventHandler.send( CommonSendAnalyticEvents.ScreenReopened( diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/DefaultSendComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/DefaultSendComponent.kt index c1fc30f253..32902cbc72 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/DefaultSendComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/DefaultSendComponent.kt @@ -93,6 +93,7 @@ internal class DefaultSendComponent @AssistedInject constructor( analyticsEventHandler.send( CommonSendAnalyticEvents.ConfirmationScreenOpened( categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, ), ) if (model.currentRoute.value.isEditMode) { @@ -101,19 +102,28 @@ internal class DefaultSendComponent @AssistedInject constructor( } is SendAmountComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.AmountScreenOpened(categoryName = model.analyticCategoryName), + CommonSendAnalyticEvents.AmountScreenOpened( + categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, + ), ) activeComponent.updateState(model.uiState.value.amountUM) } is DefaultSendDestinationComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.AddressScreenOpened(categoryName = model.analyticCategoryName), + CommonSendAnalyticEvents.AddressScreenOpened( + categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, + ), ) activeComponent.updateState(model.uiState.value.destinationUM) } is SendFeeComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.FeeScreenOpened(categoryName = model.analyticCategoryName), + CommonSendAnalyticEvents.FeeScreenOpened( + categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, + ), ) } } @@ -155,6 +165,7 @@ internal class DefaultSendComponent @AssistedInject constructor( currentRoute = model.currentRoute.filterIsInstance(), isBalanceHidingFlow = model.isBalanceHiddenFlow, analyticsCategoryName = model.analyticCategoryName, + analyticsSendSource = model.analyticsSendSource, title = resourceReference(R.string.common_address), userWalletId = params.userWalletId, cryptoCurrency = params.currency, @@ -177,6 +188,7 @@ internal class DefaultSendComponent @AssistedInject constructor( callback = model, predefinedValues = model.predefinedValues, isRedesignEnabled = model.uiState.value.isRedesignEnabled, + analyticsSendSource = model.analyticsSendSource, ), ) } @@ -204,6 +216,7 @@ internal class DefaultSendComponent @AssistedInject constructor( sendAmount = sendAmount, destinationAddress = destinationAddress, callback = model, + analyticsSendSource = model.analyticsSendSource, ), ) } else { @@ -238,6 +251,7 @@ internal class DefaultSendComponent @AssistedInject constructor( onSendTransaction = { innerRouter.replaceAll(CommonSendRoute.ConfirmSuccess) }, + analyticsSendSource = model.analyticsSendSource, ), feeSelectorComponentFactory = feeSelectorComponentFactory, ) @@ -268,6 +282,7 @@ internal class DefaultSendComponent @AssistedInject constructor( params = SendDestinationComponentParams.DestinationBlockParams( state = model.uiState.value.destinationUM, analyticsCategoryName = model.analyticCategoryName, + analyticsSendSource = model.analyticsSendSource, userWalletId = model.userWallet.walletId, cryptoCurrency = cryptoCurrencyStatus.currency, blockClickEnableFlow = MutableStateFlow(true), diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt index cd417bc2f5..50bdfc4a9c 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/confirm/SendConfirmComponent.kt @@ -17,6 +17,7 @@ import com.tangem.domain.transaction.error.GetFeeError import com.tangem.features.send.v2.api.FeeSelectorBlockComponent import com.tangem.features.send.v2.api.SendNotificationsComponent import com.tangem.features.send.v2.api.SendNotificationsComponent.Params.NotificationData +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.params.FeeSelectorParams import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams.DestinationBlockParams @@ -50,6 +51,7 @@ internal class SendConfirmComponent( params = DestinationBlockParams( state = model.uiState.value.destinationUM, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, userWalletId = params.userWallet.walletId, cryptoCurrency = params.cryptoCurrencyStatus.currency, blockClickEnableFlow = blockClickEnableFlow.asStateFlow(), @@ -73,6 +75,7 @@ internal class SendConfirmComponent( cryptoCurrency = params.cryptoCurrencyStatus.currency, cryptoCurrencyStatusFlow = params.cryptoCurrencyStatusFlow, isBalanceHidingFlow = params.isBalanceHidingFlow, + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onAmountResult, onClick = model::showEditAmount, @@ -90,6 +93,7 @@ internal class SendConfirmComponent( sendAmount = model.confirmData.enteredAmount.orZero(), destinationAddress = model.confirmData.enteredDestination.orEmpty(), blockClickEnableFlow = blockClickEnableFlow.asStateFlow(), + analyticsSendSource = params.analyticsSendSource, onLoadFee = params.onLoadFee, ), onResult = model::onFeeResult, @@ -106,6 +110,7 @@ internal class SendConfirmComponent( feeStateConfiguration = model.feeStateConfiguration, feeDisplaySource = FeeSelectorParams.FeeDisplaySource.Screen, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onFeeResult, ) @@ -165,6 +170,7 @@ internal class SendConfirmComponent( data class Params( val state: SendUM, val analyticsCategoryName: String, + val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val userWallet: UserWallet, val cryptoCurrencyStatus: CryptoCurrencyStatus, val feeCryptoCurrencyStatus: CryptoCurrencyStatus, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/model/SendModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/model/SendModel.kt index 2d73a41573..eda48bfc01 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/model/SendModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/send/model/SendModel.kt @@ -104,6 +104,7 @@ internal class SendModel @Inject constructor( private val cryptoCurrency = params.currency val analyticCategoryName = CommonSendAnalyticEvents.SEND_CATEGORY + val analyticsSendSource = CommonSendAnalyticEvents.CommonSendSource.Send val uiState: StateFlow field = MutableStateFlow(initialState()) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/DefaultNFTSendComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/DefaultNFTSendComponent.kt index f12e8292a3..0c61f6221e 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/DefaultNFTSendComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/DefaultNFTSendComponent.kt @@ -49,6 +49,7 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( private val stackNavigation = StackNavigation() private val analyticsCategoryName = CommonSendAnalyticEvents.NFT_SEND_CATEGORY + private val analyticsSendSource = CommonSendAnalyticEvents.CommonSendSource.NFT private val innerRouter = InnerRouter( stackNavigation = stackNavigation, @@ -83,7 +84,10 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( when (val activeComponent = stack.active.instance) { is NFTSendConfirmComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.ConfirmationScreenOpened(categoryName = analyticsCategoryName), + CommonSendAnalyticEvents.ConfirmationScreenOpened( + categoryName = analyticsCategoryName, + source = analyticsSendSource, + ), ) if (model.currentRouteFlow.value.isEditMode) { activeComponent.updateState(model.uiState.value) @@ -91,13 +95,19 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( } is DefaultSendDestinationComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.AddressScreenOpened(categoryName = analyticsCategoryName), + CommonSendAnalyticEvents.AddressScreenOpened( + categoryName = analyticsCategoryName, + source = analyticsSendSource, + ), ) activeComponent.updateState(model.uiState.value.destinationUM) } is SendFeeComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.FeeScreenOpened(categoryName = analyticsCategoryName), + CommonSendAnalyticEvents.FeeScreenOpened( + categoryName = analyticsCategoryName, + source = analyticsSendSource, + ), ) } } @@ -135,6 +145,7 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( isBalanceHidingFlow = model.isBalanceHiddenFlow, title = resourceReference(R.string.nft_send), analyticsCategoryName = analyticsCategoryName, + analyticsSendSource = analyticsSendSource, userWalletId = params.userWalletId, cryptoCurrency = model.cryptoCurrency, callback = model, @@ -159,6 +170,7 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( onLoadFee = model::loadFee, destinationAddress = destinationAddress, callback = model, + analyticsSendSource = analyticsSendSource, ), ) } else { @@ -181,6 +193,7 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( currentRoute = model.currentRouteFlow.filterIsInstance(), isBalanceHidingFlow = model.isBalanceHiddenFlow, onLoadFee = model::loadFee, + analyticsSendSource = analyticsSendSource, onSendTransaction = { innerRouter.replaceAll(CommonSendRoute.ConfirmSuccess) }, ), ) @@ -198,6 +211,7 @@ internal class DefaultNFTSendComponent @AssistedInject constructor( params = NFTSendSuccessComponent.Params( nftSendUMFlow = model.uiState, analyticsCategoryName = analyticsCategoryName, + analyticsSendSource = analyticsSendSource, userWallet = model.userWallet, cryptoCurrencyStatus = model.cryptoCurrencyStatus, nftAsset = params.nftAsset, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/NFTSendConfirmComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/NFTSendConfirmComponent.kt index d2fd5670b1..6df0e252bd 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/NFTSendConfirmComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/confirm/NFTSendConfirmComponent.kt @@ -20,6 +20,7 @@ import com.tangem.domain.transaction.error.GetFeeError import com.tangem.features.nft.component.NFTDetailsBlockComponent import com.tangem.features.send.v2.api.FeeSelectorBlockComponent import com.tangem.features.send.v2.api.SendNotificationsComponent +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.params.FeeSelectorParams import com.tangem.features.send.v2.api.params.FeeSelectorParams.FeeStateConfiguration @@ -57,6 +58,7 @@ internal class NFTSendConfirmComponent @AssistedInject constructor( params = DestinationBlockParams( state = model.uiState.value.destinationUM, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, userWalletId = params.userWallet.walletId, cryptoCurrency = params.cryptoCurrencyStatus.currency, blockClickEnableFlow = blockClickEnableFlow.asStateFlow(), @@ -79,6 +81,7 @@ internal class NFTSendConfirmComponent @AssistedInject constructor( onLoadFee = params.onLoadFee, destinationAddress = model.confirmData.enteredDestination.orEmpty(), blockClickEnableFlow = blockClickEnableFlow.asStateFlow(), + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onFeeResult, onClick = model::showEditFee, @@ -94,6 +97,7 @@ internal class NFTSendConfirmComponent @AssistedInject constructor( feeStateConfiguration = FeeStateConfiguration.None, feeDisplaySource = FeeSelectorParams.FeeDisplaySource.Screen, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onFeeResult, ) @@ -162,6 +166,7 @@ internal class NFTSendConfirmComponent @AssistedInject constructor( data class Params( val state: NFTSendUM, val analyticsCategoryName: String, + val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val userWallet: UserWallet, val appCurrency: AppCurrency, val nftAsset: NFTAsset, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/NFTSendSuccessComponent.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/NFTSendSuccessComponent.kt index e651f4f298..a1647cd8b5 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/NFTSendSuccessComponent.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/sendnft/success/NFTSendSuccessComponent.kt @@ -14,6 +14,7 @@ import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.nft.models.NFTAsset import com.tangem.features.nft.component.NFTDetailsBlockComponent +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationBlockComponent import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationComponentParams.DestinationBlockParams @@ -54,6 +55,7 @@ internal class NFTSendSuccessComponent @AssistedInject constructor( params = DestinationBlockParams( state = model.uiState.value.destinationUM, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, userWalletId = params.userWallet.walletId, cryptoCurrency = params.cryptoCurrencyStatus.currency, blockClickEnableFlow = MutableStateFlow(false), @@ -77,6 +79,7 @@ internal class NFTSendSuccessComponent @AssistedInject constructor( data class Params( val nftSendUMFlow: StateFlow, val analyticsCategoryName: String, + val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val currentRoute: Flow, val cryptoCurrencyStatus: CryptoCurrencyStatus, val userWallet: UserWallet, diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt index 14a25b17b7..3d2ad1283a 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/SendAmountComponentParams.kt @@ -6,6 +6,7 @@ import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWalletId +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.common.CommonSendRoute import com.tangem.features.send.v2.subcomponents.amount.SendAmountComponent.ModelCallback @@ -15,6 +16,7 @@ internal sealed class SendAmountComponentParams { abstract val state: AmountState abstract val analyticsCategoryName: String + abstract val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource abstract val userWalletId: UserWalletId abstract val appCurrency: AppCurrency abstract val predefinedValues: PredefinedValues @@ -33,6 +35,7 @@ internal sealed class SendAmountComponentParams { override val cryptoCurrency: CryptoCurrency, override val cryptoCurrencyStatusFlow: StateFlow, override val isBalanceHidingFlow: StateFlow, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val callback: ModelCallback, val currentRoute: StateFlow, ) : SendAmountComponentParams() @@ -47,6 +50,7 @@ internal sealed class SendAmountComponentParams { override val cryptoCurrency: CryptoCurrency, override val cryptoCurrencyStatusFlow: StateFlow, override val isBalanceHidingFlow: StateFlow, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val userWallet: UserWallet, val blockClickEnableFlow: StateFlow, ) : SendAmountComponentParams() diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt index b4456a6a90..3f472e9cb6 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/amount/model/SendAmountModel.kt @@ -246,6 +246,7 @@ internal class SendAmountModel @Inject constructor( categoryName = analyticsCategoryName, token = params.cryptoCurrency.symbol, blockchain = params.cryptoCurrency.network.name, + source = params.analyticsSendSource, ), ) } diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/analytics/SendDestinationAnalyticEvents.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/analytics/SendDestinationAnalyticEvents.kt index 84c52b4907..39191837d0 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/analytics/SendDestinationAnalyticEvents.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/analytics/SendDestinationAnalyticEvents.kt @@ -3,6 +3,7 @@ package com.tangem.features.send.v2.subcomponents.destination.analytics import com.tangem.core.analytics.models.AnalyticsEvent import com.tangem.core.analytics.models.AnalyticsParam.Key.SOURCE import com.tangem.core.analytics.models.AnalyticsParam.Key.VALIDATION +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents internal sealed class SendDestinationAnalyticEvents( category: String, @@ -15,13 +16,15 @@ internal sealed class SendDestinationAnalyticEvents( /** Address to send entered */ data class AddressEntered( override val categoryName: String, - val source: EnterAddressSource, + val method: EnterAddressSource, val isValid: Boolean, + val source: CommonSendAnalyticEvents.CommonSendSource, ) : SendDestinationAnalyticEvents( category = categoryName, event = "Address Entered", params = mapOf( - SOURCE to source.name, + SOURCE to source.analyticsName, + "Method" to method.name, VALIDATION to if (isValid) "Success" else "Fail", ), ) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt index c4385c59d6..a36a82f05b 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/destination/model/SendDestinationModel.kt @@ -275,7 +275,8 @@ internal class SendDestinationModel @Inject constructor( analyticsEventHandler.send( SendDestinationAnalyticEvents.AddressEntered( categoryName = analyticsCategoryName, - source = it, + source = params.analyticsSendSource, + method = it, isValid = addressValidationResult.isRight(), ), ) diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/SendFeeComponentParams.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/SendFeeComponentParams.kt index dcd8c7ca34..2046bad1ce 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/SendFeeComponentParams.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/SendFeeComponentParams.kt @@ -6,6 +6,7 @@ import com.tangem.domain.appcurrency.model.AppCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.transaction.error.GetFeeError +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.common.CommonSendRoute import com.tangem.features.send.v2.subcomponents.fee.ui.state.FeeUM import kotlinx.coroutines.flow.Flow @@ -23,6 +24,7 @@ internal sealed class SendFeeComponentParams { abstract val sendAmount: BigDecimal abstract val destinationAddress: String abstract val onLoadFee: suspend () -> Either + abstract val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource data class FeeParams( override val state: FeeUM, @@ -34,6 +36,7 @@ internal sealed class SendFeeComponentParams { override val sendAmount: BigDecimal, override val destinationAddress: String, override val onLoadFee: suspend () -> Either, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val currentRoute: Flow, val callback: SendFeeComponent.ModelCallback, ) : SendFeeComponentParams() @@ -48,6 +51,7 @@ internal sealed class SendFeeComponentParams { override val sendAmount: BigDecimal, override val destinationAddress: String, override val onLoadFee: suspend () -> Either, + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val blockClickEnableFlow: StateFlow, ) : SendFeeComponentParams() } \ No newline at end of file diff --git a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/model/SendFeeModel.kt b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/model/SendFeeModel.kt index d54150ffad..48d427737c 100644 --- a/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/model/SendFeeModel.kt +++ b/features/send-v2/impl/src/main/java/com/tangem/features/send/v2/subcomponents/fee/model/SendFeeModel.kt @@ -156,6 +156,7 @@ internal class SendFeeModel @Inject constructor( CommonSendFeeAnalyticEvents.SelectedFee( categoryName = analyticsCategoryName, feeType = feeSelectorUM.selectedType.toAnalyticType(feeSelectorUM), + source = params.analyticsSendSource, ), ) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/SwapAmountComponentParams.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/SwapAmountComponentParams.kt index 2eca8f1a8e..ee40d193e5 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/SwapAmountComponentParams.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/SwapAmountComponentParams.kt @@ -6,6 +6,7 @@ import com.tangem.domain.models.currency.CryptoCurrency import com.tangem.domain.models.currency.CryptoCurrencyStatus import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.swap.models.SwapDirection +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.swap.v2.impl.amount.entity.SwapAmountUM import com.tangem.features.swap.v2.impl.sendviaswap.SendWithSwapRoute import kotlinx.coroutines.flow.Flow @@ -15,6 +16,7 @@ internal sealed class SwapAmountComponentParams { abstract val amountUM: SwapAmountUM abstract val analyticsCategoryName: String + abstract val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource abstract val userWallet: UserWallet abstract val swapDirection: SwapDirection abstract val isBalanceHidingFlow: StateFlow @@ -31,6 +33,7 @@ internal sealed class SwapAmountComponentParams { override val primaryCryptoCurrencyStatusFlow: StateFlow, override val secondaryCryptoCurrency: CryptoCurrency?, override val filterProviderTypes: List = emptyList(), + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val title: TextReference, val callback: SwapAmountComponent.ModelCallback, val currentRoute: Flow, @@ -45,6 +48,7 @@ internal sealed class SwapAmountComponentParams { override val primaryCryptoCurrencyStatusFlow: StateFlow, override val secondaryCryptoCurrency: CryptoCurrency?, override val filterProviderTypes: List = emptyList(), + override val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val blockClickEnableFlow: StateFlow, ) : SwapAmountComponentParams() } \ No newline at end of file diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt index 837fcc57f9..58a07429d8 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/amount/model/SwapAmountModel.kt @@ -224,6 +224,7 @@ internal class SwapAmountModel @Inject constructor( categoryName = params.analyticsCategoryName, token = primaryCryptoCurrency.symbol, blockchain = primaryCryptoCurrency.network.name, + source = params.analyticsSendSource, ), ) uiState.transformerUpdate( diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/DefaultSendWithSwapComponent.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/DefaultSendWithSwapComponent.kt index 99f038db3f..2dd841f3ff 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/DefaultSendWithSwapComponent.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/DefaultSendWithSwapComponent.kt @@ -84,13 +84,19 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor( when (val activeComponent = stack.active.instance) { is SwapAmountComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.AmountScreenOpened(categoryName = model.analyticCategoryName), + CommonSendAnalyticEvents.AmountScreenOpened( + categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, + ), ) activeComponent.updateState(model.uiState.value.amountUM) } is SendDestinationComponent -> { analyticsEventHandler.send( - CommonSendAnalyticEvents.AddressScreenOpened(categoryName = model.analyticCategoryName), + CommonSendAnalyticEvents.AddressScreenOpened( + categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, + ), ) activeComponent.updateState(model.uiState.value.destinationUM) } @@ -98,6 +104,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor( analyticsEventHandler.send( CommonSendAnalyticEvents.ConfirmationScreenOpened( categoryName = model.analyticCategoryName, + source = model.analyticsSendSource, ), ) if (model.currentRoute.value.isEditMode) { @@ -145,6 +152,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor( callback = model, userWallet = model.userWallet, filterProviderTypes = SEND_WITH_SWAP_PROVIDER_TYPES, + analyticsSendSource = model.analyticsSendSource, ), ) } @@ -162,6 +170,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor( currentRoute = model.currentRoute.filterIsInstance(), isBalanceHidingFlow = model.isBalanceHiddenFlow, analyticsCategoryName = model.analyticCategoryName, + analyticsSendSource = model.analyticsSendSource, title = resourceReference(R.string.common_address), userWalletId = params.userWalletId, cryptoCurrency = secondaryCryptoCurrency, @@ -183,6 +192,7 @@ internal class DefaultSendWithSwapComponent @AssistedInject constructor( analyticsCategoryName = model.analyticCategoryName, primaryCryptoCurrencyStatusFlow = model.primaryCryptoCurrencyStatusFlow, primaryFeePaidCurrencyStatusFlow = model.primaryFeePaidCurrencyStatusFlow, + analyticsSendSource = model.analyticsSendSource, swapDirection = SwapDirection.Direct, ), ) diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt index b0cfea80d2..e3cd40b91d 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/confirm/SendWithSwapConfirmComponent.kt @@ -17,6 +17,7 @@ import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.swap.models.SwapDirection import com.tangem.features.send.v2.api.FeeSelectorBlockComponent import com.tangem.features.send.v2.api.SendNotificationsComponent +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.PredefinedValues import com.tangem.features.send.v2.api.params.FeeSelectorParams.* import com.tangem.features.send.v2.api.subcomponents.destination.SendDestinationBlockComponent @@ -62,6 +63,7 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( isBalanceHidingFlow = params.isBalanceHidingFlow, swapDirection = params.swapDirection, filterProviderTypes = SEND_WITH_SWAP_PROVIDER_TYPES, + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onAmountResult, onClick = model::showEditAmount, @@ -72,6 +74,7 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( params = SendDestinationComponentParams.DestinationBlockParams( state = model.uiState.value.destinationUM, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, userWalletId = params.userWallet.walletId, blockClickEnableFlow = blockClickEnableFlow.asStateFlow(), cryptoCurrency = model.secondaryCurrency, @@ -91,6 +94,7 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( feeStateConfiguration = FeeStateConfiguration.ExcludeLow, feeDisplaySource = FeeDisplaySource.Screen, analyticsCategoryName = params.analyticsCategoryName, + analyticsSendSource = params.analyticsSendSource, ), onResult = model::onFeeResult, ) @@ -166,6 +170,7 @@ internal class SendWithSwapConfirmComponent @AssistedInject constructor( data class Params( val sendWithSwapUM: SendWithSwapUM, val analyticsCategoryName: String, + val analyticsSendSource: CommonSendAnalyticEvents.CommonSendSource, val userWallet: UserWallet, val appCurrency: AppCurrency, val currentRoute: Flow, diff --git a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt index 6b342ab0ba..811d403eac 100644 --- a/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt +++ b/features/swap-v2/impl/src/main/java/com/tangem/features/swap/v2/impl/sendviaswap/model/SendWithSwapModel.kt @@ -60,6 +60,7 @@ internal class SendWithSwapModel @Inject constructor( private val params: SendWithSwapComponent.Params = paramsContainer.require() val analyticCategoryName = CommonSendAnalyticEvents.SEND_CATEGORY + val analyticsSendSource = CommonSendAnalyticEvents.CommonSendSource.SendWithSwap val initialRoute = SendWithSwapRoute.Amount(false) val currentRoute = MutableStateFlow(initialRoute) diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/common/WcNavigationUtils.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/common/WcNavigationUtils.kt index 5be85fef22..dd7da71fa0 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/common/WcNavigationUtils.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/common/WcNavigationUtils.kt @@ -4,6 +4,7 @@ import com.tangem.core.decompose.context.AppComponentContext import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.domain.walletconnect.WcAnalyticEvents import com.tangem.features.send.v2.api.FeeSelectorComponent +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.params.FeeSelectorParams.FeeDisplaySource import com.tangem.features.send.v2.api.params.FeeSelectorParams.FeeSelectorDetailsParams import com.tangem.features.walletconnect.connections.components.AlertsComponentV2 @@ -55,6 +56,7 @@ internal fun getWcCommonScreen( feeStateConfiguration = model.feeStateConfiguration, feeDisplaySource = FeeDisplaySource.BottomSheet, analyticsCategoryName = WcAnalyticEvents.WC_CATEGORY_NAME, + analyticsSendSource = CommonSendAnalyticEvents.CommonSendSource.WalletConnect, ), ) } diff --git a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/send/WcSendTransactionComponent.kt b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/send/WcSendTransactionComponent.kt index c5b943b9b4..abb3dcce53 100644 --- a/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/send/WcSendTransactionComponent.kt +++ b/features/walletconnect/impl/src/main/kotlin/com/tangem/features/walletconnect/transaction/components/send/WcSendTransactionComponent.kt @@ -8,6 +8,7 @@ import com.tangem.core.decompose.context.AppComponentContext import com.tangem.core.ui.decompose.ComposableBottomSheetComponent import com.tangem.domain.walletconnect.WcAnalyticEvents import com.tangem.features.send.v2.api.FeeSelectorBlockComponent +import com.tangem.features.send.v2.api.analytics.CommonSendAnalyticEvents import com.tangem.features.send.v2.api.entity.FeeSelectorUM import com.tangem.features.send.v2.api.params.FeeSelectorParams import com.tangem.features.walletconnect.transaction.entity.common.WcTransactionFeeState @@ -74,6 +75,7 @@ internal class WcSendTransactionComponent( feeStateConfiguration = model.feeStateConfiguration, feeDisplaySource = FeeSelectorParams.FeeDisplaySource.BottomSheet, analyticsCategoryName = WcAnalyticEvents.WC_CATEGORY_NAME, + analyticsSendSource = CommonSendAnalyticEvents.CommonSendSource.WalletConnect, ), onResult = model::updateFee, )