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) {
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(