Skip to content

Commit

Permalink
Package Upsates (#497)
Browse files Browse the repository at this point in the history
* Package Updates

* added @google-cloud/kms
  • Loading branch information
farhanW3 authored Apr 12, 2024
1 parent c16b97b commit 28103be
Show file tree
Hide file tree
Showing 3 changed files with 608 additions and 209 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
"@fastify/swagger": "^8.9.0",
"@fastify/type-provider-typebox": "^3.2.0",
"@fastify/websocket": "^8.2.0",
"@google-cloud/kms": "^4.0.0",
"@google-cloud/kms": "^4.2.0",
"@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/chains": "^0.1.77",
"@thirdweb-dev/sdk": "^4.0.49",
"@thirdweb-dev/service-utils": "0.4.17",
"@thirdweb-dev/wallets": "2.4.17",
"@thirdweb-dev/wallets": "^2.5.2",
"@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 @@ -34,23 +34,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 @@ -65,7 +69,7 @@ export const updateMinedUserOps = async () => {
blockNumber: tx.blockNumber!,
minedAt,
onChainTxStatus: txReceipt.status,
transactionHash: txHash,
transactionHash: tx.hash,
transactionType: tx.type,
gasLimit: tx.gasLimit.toString(),
maxFeePerGas: tx.maxFeePerGas?.toString(),
Expand Down
Loading

0 comments on commit 28103be

Please sign in to comment.