Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-25 22:45:58 +04:00
parent 84af4950a1
commit ff2559df3e
27 changed files with 904 additions and 20 deletions

View file

@ -42,6 +42,7 @@ import com.tangem.features.pushnotifications.api.PushNotificationsBottomSheetCom
import com.tangem.features.pushnotifications.api.PushNotificationsParams
import com.tangem.features.send.v2.api.NetworkSelectionComponent
import com.tangem.features.tangempay.component.TangemPayMainBlockComponent
import com.tangem.features.tangempay.components.TangemPayTransactionBottomSheetComponent
import com.tangem.features.tokenreceive.TokenReceiveComponent
import com.tangem.features.yield.supply.api.YieldSupplyDepositedWarningComponent
import dagger.assisted.Assisted
@ -56,6 +57,7 @@ internal class WalletComponent @AssistedInject constructor(
@Assisted navigate: (WalletRoute) -> Unit,
feedEntryComponentFactory: FeedEntryComponent.Factory,
tangemPayMainBlockComponentFactory: TangemPayMainBlockComponent.Factory,
private val tangemPayTransactionBottomSheetComponentFactory: TangemPayTransactionBottomSheetComponent.Factory,
private val renameWalletComponentFactory: RenameWalletComponent.Factory,
private val askBiometryComponentFactory: AskBiometryComponent.Factory,
private val pushNotificationsBottomSheetComponent: PushNotificationsBottomSheetComponent.Factory,
@ -242,6 +244,18 @@ internal class WalletComponent @AssistedInject constructor(
),
)
}
is WalletDialogConfig.TangemPayTransactionDetails -> {
tangemPayTransactionBottomSheetComponentFactory.create(
context = childByContext(componentContext),
params = TangemPayTransactionBottomSheetComponent.Params(
isBalanceHidden = dialogConfig.isBalanceHidden,
transaction = dialogConfig.transaction,
userWalletId = dialogConfig.walletId,
customerId = dialogConfig.customerId,
onDismiss = model.innerWalletRouter.dialogNavigation::dismiss,
),
)
}
}
},
)

View file

@ -158,6 +158,7 @@ internal class WalletModel @Inject constructor(
subscribeToScreenBackgroundState()
subscribeOnPushNotificationsPermission()
subscribeTangemPayOnWalletState()
subscribeToTangemPayTransactionDeepLink()
subscribeToMainScreenQrScanning()
enableNotificationsIfNeeded()
applyPendingAssetsDiscovery()
@ -780,6 +781,21 @@ internal class WalletModel @Inject constructor(
.launchIn(modelScope)
}
private fun subscribeToTangemPayTransactionDeepLink() {
walletDeepLinkActionListener.showTangemPayTransactionFlow
.onEach { data ->
innerWalletRouter.dialogNavigation.activate(
WalletDialogConfig.TangemPayTransactionDetails(
isBalanceHidden = stateHolder.value.isHidingMode,
transaction = data.transaction,
walletId = stateHolder.getSelectedWalletId(),
customerId = data.customerId,
),
)
}
.launchIn(modelScope)
}
private suspend fun handleQrResult(qrCode: String, resultSource: QrResultSource) {
val target = resolveQrSendTargetsUseCase(qrCode)
handleQrTarget(target, resultSource)

View file

@ -1,6 +1,8 @@
package com.tangem.feature.wallet.deeplink
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.visa.model.TangemPayTxHistoryItem
import com.tangem.features.wallet.deeplink.TangemPayTransactionDeepLinkData
import com.tangem.features.wallet.deeplink.WalletDeepLinkActionListener
import com.tangem.features.wallet.deeplink.WalletDeepLinkActionTrigger
import kotlinx.coroutines.channels.Channel
@ -18,7 +20,15 @@ internal class DefaultWalletDeepLinkActionTrigger @Inject constructor() :
override val selectWalletFlow: Flow<UserWalletId>
get() = _selectWalletFlow.receiveAsFlow()
private val _showTangemPayTransactionFlow = Channel<TangemPayTransactionDeepLinkData>()
override val showTangemPayTransactionFlow: Flow<TangemPayTransactionDeepLinkData>
get() = _showTangemPayTransactionFlow.receiveAsFlow()
override fun selectWallet(userWalletId: UserWalletId) {
_selectWalletFlow.trySend(userWalletId)
}
override fun showTangemPayTransaction(transaction: TangemPayTxHistoryItem, customerId: String) {
_showTangemPayTransactionFlow.trySend(TangemPayTransactionDeepLinkData(transaction, customerId))
}
}

View file

@ -8,6 +8,7 @@ import com.tangem.domain.models.currency.CryptoCurrency
import com.tangem.domain.models.serialization.BigDecimalSerializer
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.tokens.model.details.TokenAction
import com.tangem.domain.visa.model.TangemPayTxHistoryItem
import kotlinx.collections.immutable.ImmutableList
import kotlinx.serialization.Serializable
import java.math.BigDecimal
@ -53,6 +54,14 @@ internal sealed interface WalletDialogConfig {
@Serializable
data class AddAndManage(val userWalletId: UserWalletId) : WalletDialogConfig
@Serializable
data class TangemPayTransactionDetails(
val isBalanceHidden: Boolean,
val transaction: TangemPayTxHistoryItem,
val walletId: UserWalletId,
val customerId: String,
) : WalletDialogConfig
@Serializable
data class OrganizeTokens(val userWalletId: UserWalletId) : WalletDialogConfig