From bb3a4df287fd1bdd22e7ab97a31284313ea2dc55 Mon Sep 17 00:00:00 2001 From: Tangem Date: Wed, 8 Oct 2025 18:07:32 +0500 Subject: [PATCH] Updated on 2026-08-14 --- .../DefaultTransactionRepository.kt | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt index 8054cbd5c0..3ac0f16721 100644 --- a/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt +++ b/data/transaction/src/main/java/com/tangem/data/transaction/DefaultTransactionRepository.kt @@ -137,6 +137,12 @@ internal class DefaultTransactionRepository( ): TransactionData.Uncompiled = withContext(dispatchers.io) { val blockchain = network.toBlockchain() + val walletManager = walletManagersFacade.getOrCreateWalletManager( + userWalletId = userWalletId, + blockchain = blockchain, + derivationPath = network.derivationPath.value, + ) ?: error("Wallet manager not found") + val extras = createTransactionDataExtras( callData = SmartContractCallDataProviderFactory.getApprovalCallData( spenderAddress = spenderAddress, @@ -148,15 +154,23 @@ internal class DefaultTransactionRepository( gasLimit = null, ) - return@withContext createTransaction( - amount = amount, - fee = fee, - memo = null, - destination = contractAddress, - userWalletId = userWalletId, - network = network, - txExtras = extras, - ) + return@withContext if (fee != null) { + walletManager.createTransaction( + amount = amount, + fee = fee, + destination = contractAddress, + ).copy( + extras = extras, + ) + } else { + TransactionData.Uncompiled( + amount = amount, + sourceAddress = walletManager.wallet.address, + destinationAddress = contractAddress, + extras = extras, + fee = null, + ) + } } override suspend fun createNFTTransferTransaction(