Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-08 14:33:06 +05:00
parent 04bcb44f76
commit e599995315
18 changed files with 142 additions and 30 deletions

View file

@ -52,6 +52,9 @@ class DefaultHotWalletAccessor @Inject constructor(
}
}
override fun getContextualUnlock(hotWalletId: HotWalletId): UnlockHotWallet? =
contextualUnlockHotWallet[hotWalletId]
override fun clearContextualUnlock(hotWalletId: HotWalletId) {
contextualUnlockHotWallet[hotWalletId] = null
scope.launch {
@ -59,6 +62,14 @@ class DefaultHotWalletAccessor @Inject constructor(
}
}
override fun clearAllContextualUnlock() {
val hotWalletsIds = contextualUnlockHotWallet.keys.toList()
contextualUnlockHotWallet.clear()
scope.launch {
hotWalletsIds.forEach { tangemHotSdk.clearUnlockContext(it) }
}
}
private suspend fun <T> hotSdkRequest(hotWalletId: HotWalletId, block: suspend (unlock: UnlockHotWallet) -> T): T {
val isAccessCodeRequired = walletsRepository.requireAccessCode()