diff --git a/apps/web/src/hooks/useAccountAdapter.ts b/apps/web/src/hooks/useAccountAdapter.ts index f2cfd77..c2b5813 100644 --- a/apps/web/src/hooks/useAccountAdapter.ts +++ b/apps/web/src/hooks/useAccountAdapter.ts @@ -45,7 +45,7 @@ export const useAccountAdapter = () => { txs }: { txs: EthereumTransactionTypeExtended[]; - }) => { + }): Promise<`0x${string}`> => { if (smartAccountWallet && address) throw new Error('Cannot have EOA and SCA both connected'); @@ -59,11 +59,13 @@ export const useAccountAdapter = () => { }); console.log('sendTxResult', sendTxResult); + //TODO: we don't need this as the receipt is already awaited in the function above + return sendTxResult[0]; } else { if (isSponsoredTx) { - await sendSponsoredERC20AaveBatchTransactions({ txs }); + return await sendSponsoredERC20AaveBatchTransactions({ txs }); } else { - await sendAaveBatchTransactions({ txs }); + return await sendAaveBatchTransactions({ txs }); } } }; diff --git a/packages/lfgho-sdk/src/hooks/useTransactions.ts b/packages/lfgho-sdk/src/hooks/useTransactions.ts index 9977595..102037c 100644 --- a/packages/lfgho-sdk/src/hooks/useTransactions.ts +++ b/packages/lfgho-sdk/src/hooks/useTransactions.ts @@ -408,6 +408,7 @@ export const useTransactions = () => { }); const txHash = receipt.receipt.transactionHash; console.log(`Transaction hash: ${txHash}`); + return txHash; }; const sendAaveBatchTransactions = async ({ @@ -490,6 +491,7 @@ export const useTransactions = () => { }); const txHash = receipt.receipt.transactionHash; console.log(`Transaction hash: ${txHash}`); + return txHash; }; const sendSponsoredERC20AaveBatchTransactions = async ({ @@ -524,7 +526,7 @@ export const useTransactions = () => { initCode: '0x', callData, bundlerClient: pimlicoBundler, - publicClient: viemPublicClient, + publicClient: viemPublicClient })) as UserOperation; console.log('Built userOperation:', userOperation); @@ -569,6 +571,7 @@ export const useTransactions = () => { }); const txHash = receipt.receipt.transactionHash; console.log(`Transaction hash: ${txHash}`); + return txHash; }; return {