Updated on 2026-08-14
This commit is contained in:
parent
74c8c030c5
commit
d5736553f9
2 changed files with 15 additions and 3 deletions
|
|
@ -18,6 +18,7 @@ import com.tangem.domain.transaction.error.SendTransactionError
|
|||
class PrepareAndSignUseCase(
|
||||
private val transactionRepository: TransactionRepository,
|
||||
private val cardSdkConfigRepository: CardSdkConfigRepository,
|
||||
private val getHotTransactionSigner: (UserWallet.Hot) -> TransactionSigner,
|
||||
) {
|
||||
|
||||
suspend operator fun invoke(
|
||||
|
|
@ -56,8 +57,14 @@ class PrepareAndSignUseCase(
|
|||
}
|
||||
}
|
||||
|
||||
private fun createSigner(userWallet: UserWallet): TransactionSigner {
|
||||
userWallet.requireColdWallet() // TODO [REDACTED_TASK_KEY]
|
||||
private fun createSigner(userWallet: UserWallet) : TransactionSigner {
|
||||
return when(userWallet) {
|
||||
is UserWallet.Hot -> getHotTransactionSigner(userWallet)
|
||||
is UserWallet.Cold -> createColdSigner(userWallet)
|
||||
}
|
||||
}
|
||||
|
||||
private fun createColdSigner(userWallet: UserWallet.Cold): TransactionSigner {
|
||||
val card = userWallet.scanResponse.card
|
||||
val isCardNotBackedUp = card.backupStatus?.isActive != true && !card.isTangemTwins
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue