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

immediately return transaction hash and user operation hash #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
12 changes: 1 addition & 11 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ import {
isVersion06,
isVersion07,
maxBigInt,
parseUserOperationReceipt,
scaleBigIntByPercent,
toUnpackedUserOperation
} from "@alto/utils"
Expand Down Expand Up @@ -1025,16 +1024,7 @@ export class RpcHandler implements IRpcEndpoint {

this.executor.markWalletProcessed(res.value.transactionInfo.executor)

// wait for receipt
const receipt =
await this.config.publicClient.waitForTransactionReceipt({
hash: res.value.transactionInfo.transactionHash,
pollingInterval: 100
})

const userOperationReceipt = parseUserOperationReceipt(opHash, receipt)

return userOperationReceipt
return { transactionHash: res.value.transactionInfo.transactionHash, userOpHash: opHash };
}

async pimlico_sendCompressedUserOperation(
Expand Down
7 changes: 6 additions & 1 deletion src/types/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -578,9 +578,14 @@ const pimlicoSendCompressedUserOperationResponseSchema = z.object({
result: hexData32Schema
})

const userOperationNowResultSchema = z.object({
transactionHash: hexData32Schema,
userOpHash: hexData32Schema
})

const pimlicoSendUserOperationNowResponseSchema = z.object({
method: z.literal("pimlico_sendUserOperationNow"),
result: userOperationReceiptSchema
result: userOperationNowResultSchema
})

const bundlerResponseSchema = z.discriminatedUnion("method", [
Expand Down
6 changes: 0 additions & 6 deletions src/utils/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ export const customSerializer: SerializerFn = (input: AnyObject): AnyObject => {

export const initDebugLogger = (level = "debug"): Logger => {
const l = logger({
transport: {
target: "pino-pretty",
options: {
colorize: true
}
},
formatters: {
level: logLevel,
log: customSerializer
Expand Down
Loading