Skip to content

Commit 3516f61

Browse files
authored
Updated Packages + UserOp Confirmation flow updated (#479)
* Updated Packages + UserOp Confirmation flow updated * wallets sdk updated
1 parent f8acd66 commit 3516f61

File tree

3 files changed

+432
-447
lines changed

3 files changed

+432
-447
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
"@prisma/client": "5.2.0",
4040
"@sinclair/typebox": "^0.31.28",
4141
"@t3-oss/env-core": "^0.6.0",
42-
"@thirdweb-dev/auth": "^4.1.47",
42+
"@thirdweb-dev/auth": "^4.1.55",
4343
"@thirdweb-dev/chains": "^0.1.77",
44-
"@thirdweb-dev/sdk": "^4.0.49",
44+
"@thirdweb-dev/sdk": "^4.0.59",
4545
"@thirdweb-dev/service-utils": "0.4.17",
46-
"@thirdweb-dev/wallets": "2.4.17",
46+
"@thirdweb-dev/wallets": "^2.4.36-nightly-6961e09a4cec4c276b233285e721dc0505792be5-20240408215531",
4747
"@types/base-64": "^1.0.2",
4848
"base-64": "^1.0.0",
4949
"body-parser": "^1.20.2",

src/worker/tasks/updateMinedUserOps.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,27 @@ export const updateMinedUserOps = async () => {
3636
});
3737
const signer = sdk.getSigner() as ERC4337EthersSigner;
3838

39-
const txHash = await signer.smartAccountAPI.getUserOpReceipt(
40-
userOp.userOpHash!,
41-
3000,
42-
);
39+
const userOpReceipt =
40+
await signer.smartAccountAPI.getUserOpReceipt(
41+
signer.httpRpcClient,
42+
userOp.userOpHash!,
43+
3000,
44+
);
4345

44-
if (!txHash) {
46+
if (!userOpReceipt) {
4547
// If no receipt was received, return undefined to filter out tx
4648
return undefined;
4749
}
4850
const _sdk = await getSdk({
4951
chainId: parseInt(userOp.chainId!),
5052
});
5153

52-
const tx = await signer.provider!.getTransaction(txHash);
54+
const tx = await signer.provider!.getTransaction(
55+
userOpReceipt.transactionHash,
56+
);
5357
const txReceipt = await _sdk
5458
.getProvider()
55-
.getTransactionReceipt(txHash);
59+
.getTransactionReceipt(tx.hash);
5660
const minedAt = new Date(
5761
(
5862
await getBlock({
@@ -67,7 +71,7 @@ export const updateMinedUserOps = async () => {
6771
blockNumber: tx.blockNumber!,
6872
minedAt,
6973
onChainTxStatus: txReceipt.status,
70-
transactionHash: txHash,
74+
transactionHash: txReceipt.transactionHash,
7175
transactionType: tx.type,
7276
gasLimit: tx.gasLimit.toString(),
7377
maxFeePerGas: tx.maxFeePerGas?.toString(),

0 commit comments

Comments
 (0)