@pimlico/mock-paymaster 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_cjs/constants.js +61 -0
  3. package/_cjs/constants.js.map +1 -0
  4. package/_cjs/helpers/abi.js +728 -727
  5. package/_cjs/helpers/abi.js.map +1 -1
  6. package/_cjs/helpers/erc20-utils.js +15 -14
  7. package/_cjs/helpers/erc20-utils.js.map +1 -1
  8. package/_cjs/helpers/schema.js +39 -6
  9. package/_cjs/helpers/schema.js.map +1 -1
  10. package/_cjs/helpers/utils.js +29 -7
  11. package/_cjs/helpers/utils.js.map +1 -1
  12. package/_cjs/index.js +10 -9
  13. package/_cjs/index.js.map +1 -1
  14. package/_cjs/relay.js +92 -100
  15. package/_cjs/relay.js.map +1 -1
  16. package/_cjs/singletonPaymasters.js +161 -207
  17. package/_cjs/singletonPaymasters.js.map +1 -1
  18. package/_esm/constants.js +55 -0
  19. package/_esm/constants.js.map +1 -0
  20. package/_esm/helpers/abi.js +727 -726
  21. package/_esm/helpers/abi.js.map +1 -1
  22. package/_esm/helpers/erc20-utils.js +14 -13
  23. package/_esm/helpers/erc20-utils.js.map +1 -1
  24. package/_esm/helpers/schema.js +39 -6
  25. package/_esm/helpers/schema.js.map +1 -1
  26. package/_esm/helpers/utils.js +29 -8
  27. package/_esm/helpers/utils.js.map +1 -1
  28. package/_esm/index.js +12 -11
  29. package/_esm/index.js.map +1 -1
  30. package/_esm/relay.js +98 -103
  31. package/_esm/relay.js.map +1 -1
  32. package/_esm/singletonPaymasters.js +171 -213
  33. package/_esm/singletonPaymasters.js.map +1 -1
  34. package/_types/constants.d.ts +18 -0
  35. package/_types/constants.d.ts.map +1 -0
  36. package/_types/helpers/abi.d.ts +917 -435
  37. package/_types/helpers/abi.d.ts.map +1 -1
  38. package/_types/helpers/erc20-utils.d.ts +1 -1
  39. package/_types/helpers/erc20-utils.d.ts.map +1 -1
  40. package/_types/helpers/schema.d.ts +1716 -68
  41. package/_types/helpers/schema.d.ts.map +1 -1
  42. package/_types/helpers/utils.d.ts +3 -2
  43. package/_types/helpers/utils.d.ts.map +1 -1
  44. package/_types/index.d.ts.map +1 -1
  45. package/_types/relay.d.ts +38 -27
  46. package/_types/relay.d.ts.map +1 -1
  47. package/_types/singletonPaymasters.d.ts +25 -93259
  48. package/_types/singletonPaymasters.d.ts.map +1 -1
  49. package/constants.ts +84 -0
  50. package/helpers/abi.ts +728 -726
  51. package/helpers/erc20-utils.ts +16 -15
  52. package/helpers/schema.ts +41 -6
  53. package/helpers/utils.ts +38 -13
  54. package/index.ts +11 -24
  55. package/package.json +4 -4
  56. package/relay.ts +164 -192
  57. package/singletonPaymasters.ts +218 -280
@@ -15,33 +15,31 @@ import {
15
15
  } from "viem"
16
16
  import { getAnvilWalletClient, getPublicClient } from "./utils.js"
17
17
 
18
- const ERC20_BYTECODE = concat([
18
+ const erc20Bytecode = concat([
19
19
  "0x60a060405234801561001057600080fd5b50604051610ff0380380610ff083398101604081905261002f9161022c565b6040518060400160405280600981526020016805465737445524332360bc1b8152506040518060400160405280600381526020016205432360ec1b815250816003908161007c919061034d565b506004610089828261034d565b5050506100a63369d3c21bcecceda10000006100b160201b60201c565b60ff166080526104a3565b6001600160a01b0382166100e457600060405163ec442f0560e01b81526004016100db9190610430565b60405180910390fd5b6100f0600083836100f4565b5050565b6001600160a01b03831661011f5780600260008282546101149190610454565b9091555061017e9050565b6001600160a01b0383166000908152602081905260409020548181101561015f5783818360405163391434e360e21b81526004016100db9392919061046d565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661019a576002805482900390556101b9565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516101fc9190610495565b60405180910390a3505050565b60ff8116811461021857600080fd5b50565b805161022681610209565b92915050565b60006020828403121561024157610241600080fd5b600061024d848461021b565b949350505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052602260045260246000fd5b60028104600182168061029557607f821691505b6020821081036102a7576102a761026b565b50919050565b60006102266102b98381565b90565b6102c5836102ad565b815460001960089490940293841b1916921b91909117905550565b60006102ed8184846102bc565b505050565b818110156100f0576103056000826102e0565b6001016102f2565b601f8211156102ed576000818152602090206020601f850104810160208510156103345750805b6103466020601f8601048301826102f2565b5050505050565b81516001600160401b0381111561036657610366610255565b6103708254610281565b61037b82828561030d565b6020601f8311600181146103af57600084156103975750858201515b600019600886021c1981166002860217865550610408565b600085815260208120601f198616915b828110156103df57888501518255602094850194600190920191016103bf565b868310156103fb5784890151600019601f89166008021c191682555b6001600288020188555050505b505050505050565b60006001600160a01b038216610226565b61042a81610410565b82525050565b602081016102268284610421565b634e487b7160e01b600052601160045260246000fd5b808201808211156102265761022661043e565b8061042a565b6060810161047b8286610421565b6104886020830185610467565b61024d6040830184610467565b602081016102268284610467565b608051610b326104be60003960006101650152610b326000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c8063313ce56711610081578063a9059cbb1161005b578063a9059cbb146101cf578063dd62ed3e146101e2578063fb4dcefa1461022857600080fd5b8063313ce5671461016357806370a082311461019157806395d89b41146101c757600080fd5b806318160ddd116100b257806318160ddd1461012c57806323b872dd1461013d5780632d688ca81461015057600080fd5b806305ea5c22146100d957806306fdde03146100ee578063095ea7b31461010c575b600080fd5b6100ec6100e7366004610868565b61023b565b005b6100f661024b565b604051610103919061092c565b60405180910390f35b61011f61011a366004610944565b6102dd565b604051610103919061098b565b6002545b604051610103919061099f565b61011f61014b366004610868565b6102f7565b6100ec61015e366004610944565b61031b565b7f000000000000000000000000000000000000000000000000000000000000000060405161010391906109b6565b61013061019f3660046109c4565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b6100f6610329565b61011f6101dd366004610944565b610338565b6101306101f03660046109ed565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260016020908152604080832093909416825291909152205490565b6100ec6102363660046109ed565b610346565b61024683838361037c565b505050565b60606003805461025a90610a4f565b80601f016020809104026020016040519081016040528092919081815260200182805461028690610a4f565b80156102d35780601f106102a8576101008083540402835291602001916102d3565b820191906000526020600020905b8154815290600101906020018083116102b657829003601f168201915b5050505050905090565b6000336102eb81858561037c565b60019150505b92915050565b600033610305858285610389565b610310858585610441565b506001949350505050565b61032582826104ec565b5050565b60606004805461025a90610a4f565b6000336102eb818585610441565b61032582826103778573ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b610441565b6102468383836001610548565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152600160209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461043b578181101561042c578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161042393929190610a84565b60405180910390fd5b61043b84848484036000610548565b50505050565b73ffffffffffffffffffffffffffffffffffffffff83166104915760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016104239190610aac565b73ffffffffffffffffffffffffffffffffffffffff82166104e15760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016104239190610aac565b61024683838361068e565b73ffffffffffffffffffffffffffffffffffffffff821661053c5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016104239190610aac565b6103256000838361068e565b73ffffffffffffffffffffffffffffffffffffffff84166105985760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016104239190610aac565b73ffffffffffffffffffffffffffffffffffffffff83166105e85760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016104239190610aac565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600160209081526040808320938716835292905220829055801561043b578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610680919061099f565b60405180910390a350505050565b73ffffffffffffffffffffffffffffffffffffffff83166106c65780600260008282546106bb9190610ae9565b909155506107589050565b73ffffffffffffffffffffffffffffffffffffffff83166000908152602081905260409020548181101561072c578381836040517fe450d38c00000000000000000000000000000000000000000000000000000000815260040161042393929190610a84565b73ffffffffffffffffffffffffffffffffffffffff841660009081526020819052604090209082900390555b73ffffffffffffffffffffffffffffffffffffffff8216610781576002805482900390556107ad565b73ffffffffffffffffffffffffffffffffffffffff821660009081526020819052604090208054820190555b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161080a919061099f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff82166102f1565b61083e81610817565b811461084957600080fd5b50565b80356102f181610835565b8061083e565b80356102f181610857565b60008060006060848603121561088057610880600080fd5b600061088c868661084c565b935050602061089d8682870161084c565b92505060406108ae8682870161085d565b9150509250925092565b60005b838110156108d35781810151838201526020016108bb565b50506000910152565b60006108e6825190565b8084526020840193506108fd8185602086016108b8565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920192915050565b6020808252810161093d81846108dc565b9392505050565b6000806040838503121561095a5761095a600080fd5b6000610966858561084c565b92505060206109778582860161085d565b9150509250929050565b8015155b82525050565b602081016102f18284610981565b80610985565b602081016102f18284610999565b60ff8116610985565b602081016102f182846109ad565b6000602082840312156109d9576109d9600080fd5b60006109e5848461084c565b949350505050565b60008060408385031215610a0357610a03600080fd5b6000610a0f858561084c565b92505060206109778582860161084c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600281046001821680610a6357607f821691505b602082108103610a7557610a75610a20565b50919050565b61098581610817565b60608101610a928286610a7b565b610a9f6020830185610999565b6109e56040830184610999565b602081016102f18284610a7b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b808201808211156102f1576102f1610aba56fea2646970667358221220d40f68e247510ec8b7876d327ac47b949de248d0626aaf2670151c5e84ee6b4a64736f6c634300081a0033",
20
20
  pad(toHex(18n)) // constructor args (token_decimals)
21
21
  ])
22
22
 
23
+ const create2Salt =
24
+ "0x0000000000000000000000000000000000000000000000000000000000000000"
25
+
23
26
  export const deployErc20Token = async (
24
27
  walletClient: WalletClient<Transport, Chain, Account>,
25
28
  publicClient: PublicClient
26
29
  ) => {
27
- if (
28
- (await publicClient.getCode({ address: ERC20_ADDRESS })) === undefined
29
- ) {
30
+ if ((await publicClient.getCode({ address: erc20Address })) === undefined) {
30
31
  await walletClient.sendTransaction({
31
32
  to: "0x4e59b44847b379578588920ca78fbf26c0b4956c",
32
- data: concat([
33
- "0x0000000000000000000000000000000000000000000000000000000000000000",
34
- ERC20_BYTECODE
35
- ])
33
+ data: concat([create2Salt, erc20Bytecode])
36
34
  })
37
35
  }
38
36
  }
39
37
 
40
38
  export const tokenBalanceOf = async (holder: Address, anvilRpc: string) => {
41
- const publicClient = getPublicClient(anvilRpc)
39
+ const publicClient = await getPublicClient(anvilRpc)
42
40
 
43
41
  const balance = await publicClient.call({
44
- to: ERC20_ADDRESS,
42
+ to: erc20Address,
45
43
  value: 0n,
46
44
  data: encodeFunctionData({
47
45
  abi: parseAbi(["function balanceOf(address)"]),
@@ -61,10 +59,13 @@ export const sudoMintTokens = async ({
61
59
  to: Address
62
60
  anvilRpc: string
63
61
  }) => {
64
- const walletClient = getAnvilWalletClient({ addressIndex: 0, anvilRpc })
62
+ const walletClient = await getAnvilWalletClient({
63
+ addressIndex: 0,
64
+ anvilRpc
65
+ })
65
66
 
66
67
  await walletClient.sendTransaction({
67
- to: ERC20_ADDRESS,
68
+ to: erc20Address,
68
69
  value: 0n,
69
70
  data: encodeFunctionData({
70
71
  abi: parseAbi(["function sudoMint(address, uint256)"]),
@@ -73,8 +74,8 @@ export const sudoMintTokens = async ({
73
74
  })
74
75
  }
75
76
 
76
- export const ERC20_ADDRESS = getCreate2Address({
77
+ export const erc20Address = getCreate2Address({
77
78
  from: "0x4e59b44847b379578588920ca78fbf26c0b4956c",
78
- salt: "0x0000000000000000000000000000000000000000000000000000000000000000",
79
- bytecode: ERC20_BYTECODE
79
+ salt: create2Salt,
80
+ bytecode: erc20Bytecode
80
81
  })
package/helpers/schema.ts CHANGED
@@ -60,6 +60,27 @@ export const hexDataSchema = z
60
60
  .regex(hexDataPattern, { message: "not valid hex data" })
61
61
  .transform((val) => val.toLowerCase() as Hex)
62
62
 
63
+ const signedAuthorizationSchema = z.union([
64
+ z.object({
65
+ contractAddress: addressSchema,
66
+ chainId: hexNumberSchema.transform((val) => Number(val)),
67
+ nonce: hexNumberSchema.transform((val) => Number(val)),
68
+ r: hexDataSchema.transform((val) => val as Hex),
69
+ s: hexDataSchema.transform((val) => val as Hex),
70
+ v: hexNumberSchema.optional(),
71
+ yParity: hexNumberSchema.transform((val) => Number(val))
72
+ }),
73
+ z.object({
74
+ address: addressSchema,
75
+ chainId: hexNumberSchema.transform((val) => Number(val)),
76
+ nonce: hexNumberSchema.transform((val) => Number(val)),
77
+ r: hexDataSchema.transform((val) => val as Hex),
78
+ s: hexDataSchema.transform((val) => val as Hex),
79
+ v: hexNumberSchema.optional(),
80
+ yParity: hexNumberSchema.transform((val) => Number(val))
81
+ })
82
+ ])
83
+
63
84
  const userOperationSchemaPaymasterV6 = z
64
85
  .object({
65
86
  sender: addressSchema,
@@ -80,7 +101,8 @@ const userOperationSchemaPaymasterV6 = z
80
101
  return "0x"
81
102
  }
82
103
  return val
83
- })
104
+ }),
105
+ eip7702Auth: signedAuthorizationSchema.optional().nullable()
84
106
  })
85
107
  .strict()
86
108
  .transform((val) => {
@@ -122,7 +144,8 @@ const userOperationSchemaPaymasterV7 = z
122
144
  return "0x"
123
145
  }
124
146
  return val
125
- })
147
+ }),
148
+ eip7702Auth: signedAuthorizationSchema.optional().nullable()
126
149
  })
127
150
  .strict()
128
151
  .transform((val) => {
@@ -173,7 +196,8 @@ const eip7677UserOperationSchemaV6 = z
173
196
  .optional()
174
197
  .transform((_) => {
175
198
  return "0x" as Hex
176
- })
199
+ }),
200
+ eip7702Auth: signedAuthorizationSchema.optional().nullable()
177
201
  })
178
202
  .strict()
179
203
  .transform((val) => {
@@ -219,7 +243,8 @@ const eip7677UserOperationSchemaV7 = z
219
243
  return "0x"
220
244
  }
221
245
  return val
222
- })
246
+ }),
247
+ eip7702Auth: signedAuthorizationSchema.optional().nullable()
223
248
  })
224
249
  .strict()
225
250
  .transform((val) => {
@@ -231,13 +256,23 @@ const eip7677UserOperationSchema = z.union([
231
256
  eip7677UserOperationSchemaV7
232
257
  ])
233
258
 
259
+ const paymasterContextSchema = z.union([
260
+ z.object({ token: addressSchema }),
261
+ z.object({
262
+ sponsorshipPolicyId: z.string().optional(),
263
+ validForSeconds: z.number().optional(),
264
+ meta: z.record(z.string(), z.string()).optional()
265
+ }),
266
+ z.null()
267
+ ])
268
+
234
269
  export const pmGetPaymasterData = z
235
270
  .union([
236
271
  z.tuple([
237
272
  eip7677UserOperationSchema,
238
273
  addressSchema,
239
274
  hexNumberSchema,
240
- z.union([z.object({ token: addressSchema }), z.null()])
275
+ paymasterContextSchema.nullable()
241
276
  ]),
242
277
  z.tuple([eip7677UserOperationSchema, addressSchema, hexNumberSchema])
243
278
  ])
@@ -251,7 +286,7 @@ export const pmGetPaymasterStubDataParamsSchema = z
251
286
  eip7677UserOperationSchema,
252
287
  addressSchema,
253
288
  hexNumberSchema,
254
- z.union([z.object({ token: addressSchema }), z.null()])
289
+ paymasterContextSchema.nullable()
255
290
  ]),
256
291
  z.tuple([eip7677UserOperationSchema, addressSchema, hexNumberSchema])
257
292
  ])
package/helpers/utils.ts CHANGED
@@ -7,11 +7,11 @@ import {
7
7
  type Transport,
8
8
  type WalletClient,
9
9
  createPublicClient,
10
- createWalletClient
10
+ createWalletClient,
11
+ defineChain
11
12
  } from "viem"
12
13
  import { mnemonicToAccount } from "viem/accounts"
13
- import { foundry } from "viem/chains"
14
- import { ERC20_ADDRESS } from "./erc20-utils.js"
14
+ import { erc20Address } from "./erc20-utils.js"
15
15
  import { RpcError, ValidationErrors } from "./schema.js"
16
16
 
17
17
  /// Returns the bigger of two BigInts.
@@ -19,9 +19,32 @@ export const maxBigInt = (a: bigint, b: bigint) => {
19
19
  return a > b ? a : b
20
20
  }
21
21
 
22
- export const getPublicClient = (
22
+ export const getChain = async (rpcUrl: string): Promise<Chain> => {
23
+ const tempClient = createPublicClient({
24
+ transport: http(rpcUrl)
25
+ })
26
+
27
+ const chainId = await tempClient.getChainId()
28
+
29
+ return defineChain({
30
+ id: chainId,
31
+ name: `Chain ${chainId}`,
32
+ nativeCurrency: {
33
+ name: "ETH",
34
+ symbol: "ETH",
35
+ decimals: 18
36
+ },
37
+ rpcUrls: {
38
+ default: {
39
+ http: [rpcUrl]
40
+ }
41
+ }
42
+ })
43
+ }
44
+
45
+ export const getPublicClient = async (
23
46
  anvilRpc: string
24
- ): PublicClient<Transport, Chain> => {
47
+ ): Promise<PublicClient<Transport, Chain>> => {
25
48
  const transport = http(anvilRpc, {
26
49
  // onFetchRequest: async (req) => {
27
50
  // console.log(await req.json(), "request")
@@ -31,21 +54,23 @@ export const getPublicClient = (
31
54
  //}
32
55
  })
33
56
 
57
+ const chain = await getChain(anvilRpc)
58
+
34
59
  return createPublicClient({
35
- chain: foundry,
60
+ chain,
36
61
  transport: transport,
37
62
  pollingInterval: 100
38
63
  })
39
64
  }
40
65
 
41
- export const getAnvilWalletClient = ({
66
+ export const getAnvilWalletClient = async ({
42
67
  addressIndex,
43
68
  anvilRpc
44
- }: { addressIndex: number; anvilRpc: string }): WalletClient<
45
- Transport,
46
- Chain,
47
- Account
69
+ }: { addressIndex: number; anvilRpc: string }): Promise<
70
+ WalletClient<Transport, Chain, Account>
48
71
  > => {
72
+ const chain = await getChain(anvilRpc)
73
+
49
74
  return createWalletClient({
50
75
  account: mnemonicToAccount(
51
76
  "test test test test test test test test test test test junk",
@@ -53,13 +78,13 @@ export const getAnvilWalletClient = ({
53
78
  addressIndex
54
79
  }
55
80
  ),
56
- chain: foundry,
81
+ chain,
57
82
  transport: http(anvilRpc)
58
83
  })
59
84
  }
60
85
 
61
86
  export const isTokenSupported = async (token: Address) => {
62
- if (token !== ERC20_ADDRESS) {
87
+ if (token !== erc20Address) {
63
88
  throw new RpcError(
64
89
  "Token is not supported",
65
90
  ValidationErrors.InvalidFields
package/index.ts CHANGED
@@ -3,14 +3,10 @@ import Fastify from "fastify"
3
3
  import { defineInstance } from "prool"
4
4
  import { http, createPublicClient } from "viem"
5
5
  import { createBundlerClient } from "viem/account-abstraction"
6
- import { foundry } from "viem/chains"
7
6
  import { deployErc20Token } from "./helpers/erc20-utils.js"
8
- import { getAnvilWalletClient } from "./helpers/utils.js"
7
+ import { getAnvilWalletClient, getChain } from "./helpers/utils.js"
9
8
  import { createRpcHandler } from "./relay.js"
10
- import {
11
- SingletonPaymasterV06,
12
- SingletonPaymasterV07
13
- } from "./singletonPaymasters.js"
9
+ import { deployPaymasters } from "./singletonPaymasters.js"
14
10
 
15
11
  export const paymaster = defineInstance(
16
12
  ({
@@ -26,30 +22,21 @@ export const paymaster = defineInstance(
26
22
  port: _port,
27
23
  name: "mock-paymaster",
28
24
  start: async ({ port = _port }) => {
29
- const walletClient = getAnvilWalletClient({
25
+ const chain = await getChain(anvilRpc)
26
+ const walletClient = await getAnvilWalletClient({
30
27
  anvilRpc,
31
28
  addressIndex: 1
32
29
  })
33
30
  const publicClient = createPublicClient({
34
31
  transport: http(anvilRpc),
35
- chain: foundry
32
+ chain
36
33
  })
37
34
  const bundler = createBundlerClient({
38
- chain: foundry,
35
+ chain,
39
36
  transport: http(altoRpc)
40
37
  })
41
38
 
42
- const singletonPaymasterV07 = new SingletonPaymasterV07(
43
- walletClient,
44
- anvilRpc
45
- )
46
- const singletonPaymasterV06 = new SingletonPaymasterV06(
47
- walletClient,
48
- anvilRpc
49
- )
50
-
51
- await singletonPaymasterV06.setup()
52
- await singletonPaymasterV07.setup()
39
+ await deployPaymasters({ walletClient, publicClient })
53
40
  await deployErc20Token(walletClient, publicClient)
54
41
 
55
42
  app.register(cors, {
@@ -57,11 +44,11 @@ export const paymaster = defineInstance(
57
44
  methods: ["POST", "GET", "OPTIONS"]
58
45
  })
59
46
 
60
- const rpcHandler = createRpcHandler(
47
+ const rpcHandler = createRpcHandler({
61
48
  bundler,
62
- singletonPaymasterV07,
63
- singletonPaymasterV06
64
- )
49
+ publicClient,
50
+ paymasterSigner: walletClient
51
+ })
65
52
  app.post("/", {}, rpcHandler)
66
53
 
67
54
  app.get("/ping", async (_request, reply) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pimlico/mock-paymaster",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "author": "Pimlico",
5
5
  "homepage": "https://docs.pimlico.io/permissionless",
6
6
  "repository": "github:pimlicolabs/permissionless.js",
@@ -27,12 +27,12 @@
27
27
  }
28
28
  },
29
29
  "peerDependencies": {
30
- "viem": "^2.23.2",
30
+ "viem": "^2.28.1",
31
31
  "prool": "^0.0.23"
32
32
  },
33
33
  "dependencies": {
34
- "@fastify/cors": "^11.0.0",
35
- "fastify": "^5.2.1",
34
+ "@fastify/cors": "^8.5.0",
35
+ "fastify": "^4.28.1",
36
36
  "zod": "^3.24.2"
37
37
  }
38
38
  }