Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-10 20:26:26 +03:00
commit 28c593bd60
137 changed files with 1098 additions and 607 deletions

View file

@ -89,6 +89,8 @@ class DerivationManagerImpl(
}
scope.launch {
val selectedWallet = appStateHolder.userWalletsListManager?.selectedUserWalletSync
val result = appStateHolder.tangemSdkManager?.derivePublicKeys(
scanResponse.card.cardId,
derivations,
@ -108,6 +110,14 @@ class DerivationManagerImpl(
val updatedScanResponse = scanResponse.copy(
derivedKeys = updatedDerivedKeys,
)
if (selectedWallet != null) {
val userWallet = selectedWallet.copy(
scanResponse = updatedScanResponse,
)
appStateHolder.userWalletsListManager?.save(userWallet, canOverride = true)
appStateHolder.walletStoresManager?.fetch(userWallet, true)
}
appStateHolder.mainStore?.dispatchOnMain(GlobalAction.SaveScanResponse(updatedScanResponse))
delay(DELAY_SDK_DIALOG_CLOSE)
onSuccess(updatedScanResponse)
@ -115,8 +125,7 @@ class DerivationManagerImpl(
is CompletionResult.Failure -> {
appStateHolder.mainStore?.dispatchDebugErrorNotification(
TapError.CustomError(
"Error adding " +
"tokens",
"Error derivation",
),
)
}