Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Packages + UserOp Confirmation flow updated #479

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"@prisma/client": "5.2.0",
"@sinclair/typebox": "^0.31.28",
"@t3-oss/env-core": "^0.6.0",
"@thirdweb-dev/auth": "^4.1.47",
"@thirdweb-dev/auth": "^4.1.55",
"@thirdweb-dev/chains": "^0.1.77",
"@thirdweb-dev/sdk": "^4.0.49",
"@thirdweb-dev/sdk": "^4.0.59",
"@thirdweb-dev/service-utils": "0.4.17",
"@thirdweb-dev/wallets": "2.4.17",
"@thirdweb-dev/wallets": "^2.4.36-nightly-6961e09a4cec4c276b233285e721dc0505792be5-20240408215531",
"@types/base-64": "^1.0.2",
"base-64": "^1.0.0",
"body-parser": "^1.20.2",
Expand Down
20 changes: 12 additions & 8 deletions src/worker/tasks/updateMinedUserOps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,27 @@ export const updateMinedUserOps = async () => {
});
const signer = sdk.getSigner() as ERC4337EthersSigner;

const txHash = await signer.smartAccountAPI.getUserOpReceipt(
userOp.userOpHash!,
3000,
);
const userOpReceipt =
await signer.smartAccountAPI.getUserOpReceipt(
signer.httpRpcClient,
userOp.userOpHash!,
3000,
);

if (!txHash) {
if (!userOpReceipt) {
// If no receipt was received, return undefined to filter out tx
return undefined;
}
const _sdk = await getSdk({
chainId: parseInt(userOp.chainId!),
});

const tx = await signer.provider!.getTransaction(txHash);
const tx = await signer.provider!.getTransaction(
userOpReceipt.transactionHash,
);
const txReceipt = await _sdk
.getProvider()
.getTransactionReceipt(txHash);
.getTransactionReceipt(tx.hash);
const minedAt = new Date(
(
await getBlock({
Expand All @@ -67,7 +71,7 @@ export const updateMinedUserOps = async () => {
blockNumber: tx.blockNumber!,
minedAt,
onChainTxStatus: txReceipt.status,
transactionHash: txHash,
transactionHash: txReceipt.transactionHash,
transactionType: tx.type,
gasLimit: tx.gasLimit.toString(),
maxFeePerGas: tx.maxFeePerGas?.toString(),
Expand Down
Loading
Loading