Updated on 2026-08-14
This commit is contained in:
parent
669d540b2a
commit
d862133d70
4 changed files with 22 additions and 10 deletions
|
|
@ -5,5 +5,6 @@ import com.tangem.domain.wallets.models.UserWalletId
|
|||
|
||||
interface DerivationsRepository {
|
||||
|
||||
@Throws
|
||||
suspend fun derivePublicKeys(userWalletId: UserWalletId, currencies: List<CryptoCurrency>)
|
||||
}
|
||||
|
|
@ -70,6 +70,7 @@ dependencies {
|
|||
|
||||
//TODO: Create api/impl modules for onboarding [REDACTED_JIRA]
|
||||
implementation(projects.features.onboarding)
|
||||
implementation(projects.features.tester.api)
|
||||
|
||||
/** Feature Apis */
|
||||
implementation(projects.features.wallet.api)
|
||||
|
|
|
|||
|
|
@ -316,7 +316,6 @@ internal class WalletViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
@Deprecated("Use DerivePublicKeysUseCase instead")
|
||||
// FIXME: Migration: [REDACTED_JIRA]
|
||||
private fun deriveMissingCurrencies(
|
||||
scanResponse: ScanResponse,
|
||||
currencyList: List<CryptoCurrency>,
|
||||
|
|
|
|||
|
|
@ -35,10 +35,12 @@ import com.tangem.feature.wallet.presentation.wallet.state.WalletEvent
|
|||
import com.tangem.feature.wallet.presentation.wallet.state2.WalletStateController
|
||||
import com.tangem.feature.wallet.presentation.wallet.state2.transformers.CloseBottomSheetTransformer
|
||||
import com.tangem.feature.wallet.presentation.wallet.state2.utils.WalletEventSender
|
||||
import com.tangem.features.tester.api.TesterFeatureToggles
|
||||
import com.tangem.operations.derivation.ExtendedPublicKeysMap
|
||||
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
|
||||
import dagger.hilt.android.scopes.ViewModelScoped
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
|
||||
internal interface WalletWarningsClickIntents {
|
||||
|
|
@ -78,6 +80,7 @@ internal class WalletWarningsClickIntentsImplementer @Inject constructor(
|
|||
private val remindToRateAppLaterUseCase: RemindToRateAppLaterUseCase,
|
||||
private val analyticsEventHandler: AnalyticsEventHandler,
|
||||
private val reduxStateHolder: ReduxStateHolder,
|
||||
private val testerFeatureToggles: TesterFeatureToggles,
|
||||
private val dispatchers: CoroutineDispatcherProvider,
|
||||
) : BaseWalletClickIntents(), WalletWarningsClickIntents {
|
||||
|
||||
|
|
@ -107,8 +110,6 @@ internal class WalletWarningsClickIntentsImplementer @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated("Use DerivePublicKeysUseCase instead")
|
||||
// FIXME: Migration: [REDACTED_JIRA]
|
||||
override fun onGenerateMissedAddressesClick(missedAddressCurrencies: List<CryptoCurrency>) {
|
||||
val userWallet = getSelectedWalletSyncUseCase.unwrap() ?: return
|
||||
|
||||
|
|
@ -116,15 +117,25 @@ internal class WalletWarningsClickIntentsImplementer @Inject constructor(
|
|||
analyticsEventHandler.send(MainScreen.NoticeScanYourCardTapped)
|
||||
|
||||
viewModelScope.launch(dispatchers.main) {
|
||||
deriveMissingCurrencies(
|
||||
scanResponse = userWallet.scanResponse,
|
||||
currencyList = missedAddressCurrencies,
|
||||
) { scannedCardResponse ->
|
||||
updateWalletUseCase(
|
||||
if (testerFeatureToggles.isDerivePublicKeysRefactoringEnabled) {
|
||||
derivePublicKeysUseCase(
|
||||
userWalletId = userWallet.walletId,
|
||||
update = { it.copy(scanResponse = scannedCardResponse) },
|
||||
currencies = missedAddressCurrencies,
|
||||
)
|
||||
.onRight { fetchTokenListUseCase(userWalletId = it.walletId) }
|
||||
.onRight { fetchTokenListUseCase(userWalletId = userWallet.walletId) }
|
||||
.onLeft { Timber.e("Failed to derive public keys: $it") }
|
||||
} else {
|
||||
// TODO: delete [REDACTED_JIRA]
|
||||
deriveMissingCurrencies(
|
||||
scanResponse = userWallet.scanResponse,
|
||||
currencyList = missedAddressCurrencies,
|
||||
) { scannedCardResponse ->
|
||||
updateWalletUseCase(
|
||||
userWalletId = userWallet.walletId,
|
||||
update = { it.copy(scanResponse = scannedCardResponse) },
|
||||
)
|
||||
.onRight { fetchTokenListUseCase(userWalletId = it.walletId) }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue