Skip to content

Commit

Permalink
rename endpoint to pimlico_sendUserOperationNow
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Sep 24, 2024
1 parent cd0b5d8 commit e9fbfdc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/cli/config/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export const bundlerOptions: CliCommandOptions<IBundlerArgsInput> = {
},
"enable-instant-bundling-endpoint": {
description:
"Should the bundler enable the pimlico_sendInstantUserOperation endpoint",
"Should the bundler enable the pimlico_sendUserOperationNow endpoint",
type: "boolean",
default: false
}
Expand Down
8 changes: 4 additions & 4 deletions src/rpc/rpcHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,10 +307,10 @@ export class RpcHandler implements IRpcEndpoint {
...request.params
)
}
case "pimlico_sendInstantUserOperation":
case "pimlico_sendUserOperationNow":
return {
method,
result: await this.pimlico_sendInstantUserOperation(
result: await this.pimlico_sendUserOperationNow(
apiVersion,
...request.params
)
Expand Down Expand Up @@ -936,14 +936,14 @@ export class RpcHandler implements IRpcEndpoint {
return "queued"
}

async pimlico_sendInstantUserOperation(
async pimlico_sendUserOperationNow(
apiVersion: ApiVersion,
userOperation: UserOperation,
entryPoint: Address
) {
if (!this.enableInstantBundlingEndpoint) {
throw new RpcError(
"pimlico_sendInstantUserOperation endpoint is not enabled",
"pimlico_sendUserOperationNow endpoint is not enabled",
ValidationErrors.InvalidFields
)
}
Expand Down
12 changes: 6 additions & 6 deletions src/types/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ const pimlicoSendCompressedUserOperationRequestSchema = z.object({
params: z.tuple([hexDataSchema, addressSchema, addressSchema])
})

const pimlicoSendInstantBundleRequestSchema = z.object({
method: z.literal("pimlico_sendInstantUserOperation"),
const pimlicoSendUserOperationNowRequestSchema = z.object({
method: z.literal("pimlico_sendUserOperationNow"),
params: z.tuple([userOperationSchema, addressSchema])
})

Expand All @@ -369,7 +369,7 @@ const bundlerRequestSchema = z.discriminatedUnion("method", [
pimlicoGetUserOperationStatusRequestSchema,
pimlicoGetUserOperationGasPriceRequestSchema,
pimlicoSendCompressedUserOperationRequestSchema,
pimlicoSendInstantBundleRequestSchema
pimlicoSendUserOperationNowRequestSchema
])

const chainIdResponseSchema = z.object({
Expand Down Expand Up @@ -578,8 +578,8 @@ const pimlicoSendCompressedUserOperationResponseSchema = z.object({
result: hexData32Schema
})

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

Expand All @@ -601,7 +601,7 @@ const bundlerResponseSchema = z.discriminatedUnion("method", [
pimlicoGetUserOperationStatusResponseSchema,
pimlicoGetUserOperationGasPriceResponseSchema,
pimlicoSendCompressedUserOperationResponseSchema,
pimlicoSendInstantBundleResponseSchema
pimlicoSendUserOperationNowResponseSchema
])

export type BundlingMode = z.infer<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe.each([
entryPointVersion: "0.7" as EntryPointVersion
}
])(
"$entryPointVersion supports pimlico_sendInstantUserOperation",
"$entryPointVersion supports pimlico_sendUserOperationNow",
({ entryPoint, entryPointVersion }) => {
beforeEach(async () => {
await beforeEachCleanUp()
Expand Down Expand Up @@ -50,7 +50,7 @@ describe.each([

const receipt = (await bundlerClient.request({
// @ts-ignore
method: "pimlico_sendInstantUserOperation",
method: "pimlico_sendUserOperationNow",
params: [deepHexlify(op), entryPoint]
})) as UserOperationReceipt

Expand Down

0 comments on commit e9fbfdc

Please sign in to comment.