diff --git a/ponder.schema.ts b/ponder.schema.ts index ded83d0..a809135 100644 --- a/ponder.schema.ts +++ b/ponder.schema.ts @@ -1,4 +1,4 @@ -import { createSchema } from "@ponder/core"; +import { createSchema } from '@ponder/core'; export default createSchema((p) => ({ UserOp: p.createTable({ @@ -14,4 +14,15 @@ export default createSchema((p) => ({ success: p.boolean(), entryPoint: p.hex(), }), + AccountDeployed: p.createTable({ + id: p.string(), + hash: p.hex(), + chainId: p.int(), + txHash: p.hex(), + factory: p.hex(), + paymaster: p.hex(), + sender: p.hex(), + userOpHash: p.hex(), + entryPoint: p.hex(), + }), })); diff --git a/src/entryPoint_0_6.ts b/src/entryPoint_0_6.ts index f45cad1..40d1d2e 100644 --- a/src/entryPoint_0_6.ts +++ b/src/entryPoint_0_6.ts @@ -20,4 +20,20 @@ if (isIndexing0_6) { }, }); }); + + ponder.on('EntryPoint0.6:AccountDeployed', async ({ event, context }) => { + await context.db.AccountDeployed.create({ + id: `${context.network.chainId}-${event.args.userOpHash}`, + data: { + hash: event.transaction.hash, + chainId: context.network.chainId, + txHash: event.transaction.hash, + factory: event.args.factory, + paymaster: event.args.paymaster, + sender: event.args.sender, + userOpHash: event.args.userOpHash, + entryPoint: event.log.address, + }, + }); + }); } diff --git a/src/entryPoint_0_7.ts b/src/entryPoint_0_7.ts index c9739c0..95a97d2 100644 --- a/src/entryPoint_0_7.ts +++ b/src/entryPoint_0_7.ts @@ -20,4 +20,20 @@ if (isIndexing0_7) { }, }); }); + + ponder.on('EntryPoint0.7:AccountDeployed', async ({ event, context }) => { + await context.db.AccountDeployed.create({ + id: `${context.network.chainId}-${event.args.userOpHash}`, + data: { + hash: event.transaction.hash, + chainId: context.network.chainId, + txHash: event.transaction.hash, + factory: event.args.factory, + paymaster: event.args.paymaster, + sender: event.args.sender, + userOpHash: event.args.userOpHash, + entryPoint: event.log.address, + }, + }); + }); }