Updated on 2026-08-14
This commit is contained in:
parent
5d9a6c9047
commit
bb3a4df287
1 changed files with 23 additions and 9 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue