Updated on 2026-08-14

This commit is contained in:
Tangem 2025-10-08 18:07:32 +05:00
parent 5d9a6c9047
commit bb3a4df287

View file

@ -137,6 +137,12 @@ internal class DefaultTransactionRepository(
): TransactionData.Uncompiled = withContext(dispatchers.io) { ): TransactionData.Uncompiled = withContext(dispatchers.io) {
val blockchain = network.toBlockchain() val blockchain = network.toBlockchain()
val walletManager = walletManagersFacade.getOrCreateWalletManager(
userWalletId = userWalletId,
blockchain = blockchain,
derivationPath = network.derivationPath.value,
) ?: error("Wallet manager not found")
val extras = createTransactionDataExtras( val extras = createTransactionDataExtras(
callData = SmartContractCallDataProviderFactory.getApprovalCallData( callData = SmartContractCallDataProviderFactory.getApprovalCallData(
spenderAddress = spenderAddress, spenderAddress = spenderAddress,
@ -148,15 +154,23 @@ internal class DefaultTransactionRepository(
gasLimit = null, gasLimit = null,
) )
return@withContext createTransaction( return@withContext if (fee != null) {
amount = amount, walletManager.createTransaction(
fee = fee, amount = amount,
memo = null, fee = fee,
destination = contractAddress, destination = contractAddress,
userWalletId = userWalletId, ).copy(
network = network, extras = extras,
txExtras = extras, )
) } else {
TransactionData.Uncompiled(
amount = amount,
sourceAddress = walletManager.wallet.address,
destinationAddress = contractAddress,
extras = extras,
fee = null,
)
}
} }
override suspend fun createNFTTransferTransaction( override suspend fun createNFTTransferTransaction(