Skip to content

Commit 5b62b6f

Browse files
authored
Merge pull request #14 from pimlicolabs/feat/add-paymaster-context
add paymaster context to pm_sponsorUserOperation Schema
2 parents 4965389 + 8dd15b8 commit 5b62b6f

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

  • mock-verifying-paymaster/src/helpers

mock-verifying-paymaster/src/helpers/schema.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ export const jsonRpcSchema = z
144144
})
145145
.strict();
146146

147-
export const pmSponsorUserOperationParamsSchema = z.tuple([
148-
z.union([userOperationSchemaPaymasterV6, userOperationSchemaPaymasterV7]),
149-
addressSchema,
150-
]);
151-
152147
const eip7677UserOperationSchemaV6 = z
153148
.object({
154149
sender: addressSchema,
@@ -239,6 +234,22 @@ const paymasterContextSchema = z.union([
239234
z.null(),
240235
]);
241236

237+
export const pmSponsorUserOperationParamsSchema = z
238+
.union([
239+
z.tuple([
240+
z.union([userOperationSchemaPaymasterV6, userOperationSchemaPaymasterV7]),
241+
addressSchema,
242+
]),
243+
z.tuple([
244+
z.union([userOperationSchemaPaymasterV6, userOperationSchemaPaymasterV7]),
245+
addressSchema,
246+
paymasterContextSchema.nullable(),
247+
]),
248+
])
249+
.transform((val) => {
250+
return [val[0], val[1], val[2] ?? null] as const;
251+
});
252+
242253
export const pmGetPaymasterData = z
243254
.union([
244255
z.tuple([

0 commit comments

Comments
 (0)