Updated on 2026-08-14
This commit is contained in:
parent
fa55c16871
commit
85b00c4c65
18 changed files with 269 additions and 16 deletions
|
|
@ -65,14 +65,15 @@ class AssociateAssetUseCase(
|
|||
private fun createSigner(userWallet: UserWallet): TransactionSigner {
|
||||
return when (userWallet) {
|
||||
is UserWallet.Hot -> getHotTransactionSigner(userWallet)
|
||||
is UserWallet.Cold -> getColdSigner()
|
||||
is UserWallet.Cold -> getColdSigner(userWallet)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getColdSigner(): TransactionSigner {
|
||||
private fun getColdSigner(userWallet: UserWallet.Cold): TransactionSigner {
|
||||
return cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = null,
|
||||
twinKey = null, // use null here because no assets support for Twin cards
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,14 +62,15 @@ class OpenTrustlineUseCase(
|
|||
private fun createSigner(userWallet: UserWallet): TransactionSigner {
|
||||
return when (userWallet) {
|
||||
is UserWallet.Hot -> getHotTransactionSigner(userWallet)
|
||||
is UserWallet.Cold -> getColdSigner()
|
||||
is UserWallet.Cold -> getColdSigner(userWallet)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getColdSigner(): TransactionSigner {
|
||||
private fun getColdSigner(userWallet: UserWallet.Cold): TransactionSigner {
|
||||
return cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = null,
|
||||
twinKey = null, // use null here because no assets support for Twin cards
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -70,6 +70,7 @@ class PrepareAndSignUseCase(
|
|||
val signer = cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
return signer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@ class PrepareForSendUseCase(
|
|||
val signer = cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
return signer
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,14 +58,15 @@ class RetryIncompleteTransactionUseCase(
|
|||
private fun createSigner(userWallet: UserWallet): TransactionSigner {
|
||||
return when (userWallet) {
|
||||
is UserWallet.Hot -> getHotTransactionSigner(userWallet)
|
||||
is UserWallet.Cold -> getColdSigner()
|
||||
is UserWallet.Cold -> getColdSigner(userWallet)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getColdSigner(): TransactionSigner {
|
||||
private fun getColdSigner(userWallet: UserWallet.Cold): TransactionSigner {
|
||||
return cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = null,
|
||||
twinKey = null, // use null here because no assets support for Twin cards
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,7 @@ class SendLargeSolanaTransactionUseCase(
|
|||
val signer = cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
|
||||
val walletManager = walletManagersFacade
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ class SendTransactionUseCase(
|
|||
val coldSigner = cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
|
||||
coldSigner
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ class SignCloreMessageUseCase(
|
|||
cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = null,
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
is UserWallet.Hot -> getHotWalletSigner(userWallet)
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ class SignUseCase(
|
|||
return cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
@ -235,6 +235,7 @@ class CreateAndSendGaslessTransactionUseCase(
|
|||
cardSdkConfigRepository.getCommonSigner(
|
||||
cardId = card.cardId.takeIf { isCardNotBackedUp },
|
||||
twinKey = TwinKey.getOrNull(scanResponse = userWallet.scanResponse),
|
||||
userWalletId = userWallet.walletId,
|
||||
)
|
||||
}
|
||||
is UserWallet.Hot -> getHotWalletSigner(userWallet)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue