Updated on 2026-08-14

This commit is contained in:
Tangem 2026-06-22 20:31:03 +05:00
parent 5ef3837bd5
commit 8d3c2b1cd8
23 changed files with 413 additions and 46 deletions

View file

@ -27,6 +27,9 @@ interface ColdMapDerivationsRepository {
derivations: Map<ByteArrayKey, List<DerivationPath>>,
): Pair<UserWallet.Cold, Map<ByteArrayKey, ExtendedPublicKeysMap>>
/** Merges already-derived [keys] into [userWallet]'s stored derivations without deriving on the card. */
fun mergeDerivedKeys(userWallet: UserWallet.Cold, keys: Map<ByteArrayKey, ExtendedPublicKeysMap>): UserWallet.Cold
/** Check if user [userWallet] has missed derivations using map of [Network.ID] with extraDerivationPath */
suspend fun hasMissedDerivations(
userWallet: UserWallet.Cold,

View file

@ -29,6 +29,14 @@ interface DerivationsRepository {
derivations: Map<ByteArrayKey, List<DerivationPath>>,
): Map<ByteArrayKey, ExtendedPublicKeysMap>
/**
* Merges already-derived [derivedKeys] into the wallet's stored derivations and persists it.
* Does NOT derive on the card (no NFC): use it to save a key that was obtained by a dedicated
* card task. Keyed by the seed wallet public key ([ByteArrayKey]).
*/
@Throws
suspend fun storeDerivedKeys(userWalletId: UserWalletId, derivedKeys: Map<ByteArrayKey, ExtendedPublicKeysMap>)
/** Returns already derived extended public keys for the given [seedKey] */
suspend fun getExistingDerivedKeys(userWalletId: UserWalletId, seedKey: ByteArrayKey): ExtendedPublicKeysMap

View file

@ -29,6 +29,9 @@ interface HotMapDerivationsRepository {
derivations: Map<ByteArrayKey, List<DerivationPath>>,
): Pair<UserWallet.Hot, Map<ByteArrayKey, ExtendedPublicKeysMap>>
/** Merges already-derived [keys] into [userWallet]'s stored derivations. */
fun mergeDerivedKeys(userWallet: UserWallet.Hot, keys: Map<ByteArrayKey, ExtendedPublicKeysMap>): UserWallet.Hot
/** Check if user [userWallet] has missed derivations using map of [Network.ID] with extraDerivationPath */
suspend fun hasMissedDerivations(
userWallet: UserWallet.Hot,