@pimlico/mock-paymaster 0.0.4 → 0.0.5

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.
@@ -30,7 +30,8 @@ import {
30
30
  singletonPaymaster07Abi,
31
31
  singletonPaymaster08Abi
32
32
  } from "./helpers/abi.js"
33
- import type { PaymasterMode } from "./helpers/utils.js"
33
+ import { getPaymasterUtilityWallet } from "./helpers/erc20-utils.js"
34
+ import { type PaymasterMode, getPublicClient } from "./helpers/utils.js"
34
35
 
35
36
  export const getDummyPaymasterData = ({
36
37
  is06,
@@ -240,13 +241,14 @@ export const getSignedPaymasterData = async ({
240
241
  }
241
242
 
242
243
  export const deployPaymasters = async ({
243
- walletClient,
244
- publicClient
244
+ anvilRpc,
245
+ paymasterSigner
245
246
  }: {
246
- walletClient: WalletClient<Transport, Chain, Account>
247
- publicClient: PublicClient<Transport, Chain>
247
+ anvilRpc: string
248
+ paymasterSigner: Address
248
249
  }) => {
249
- const owner = walletClient.account.address
250
+ const walletClient = await getPaymasterUtilityWallet(anvilRpc)
251
+ const publicClient = await getPublicClient(anvilRpc)
250
252
 
251
253
  let nonce = await publicClient.getTransactionCount({
252
254
  address: walletClient.account.address
@@ -257,7 +259,7 @@ export const deployPaymasters = async ({
257
259
  to: constants.deterministicDeployer,
258
260
  data: concat([
259
261
  constants.create2Salt,
260
- getSingletonPaymaster06InitCode(walletClient.account.address)
262
+ getSingletonPaymaster06InitCode(paymasterSigner)
261
263
  ]),
262
264
  nonce: nonce++
263
265
  })
@@ -267,7 +269,7 @@ export const deployPaymasters = async ({
267
269
  to: constants.deterministicDeployer,
268
270
  data: concat([
269
271
  constants.create2Salt,
270
- getSingletonPaymaster07InitCode(walletClient.account.address)
272
+ getSingletonPaymaster07InitCode(paymasterSigner)
271
273
  ]),
272
274
  nonce: nonce++
273
275
  })
@@ -277,7 +279,7 @@ export const deployPaymasters = async ({
277
279
  to: constants.deterministicDeployer,
278
280
  data: concat([
279
281
  constants.create2Salt,
280
- getSingletonPaymaster08InitCode(walletClient.account.address)
282
+ getSingletonPaymaster08InitCode(paymasterSigner)
281
283
  ]),
282
284
  nonce: nonce++
283
285
  })
@@ -285,17 +287,17 @@ export const deployPaymasters = async ({
285
287
  // Initialize contract instances.
286
288
  const [singletonPaymaster06, singletonPaymaster07, singletonPaymaster08] = [
287
289
  getContract({
288
- address: getSingletonPaymaster06Address(owner),
290
+ address: getSingletonPaymaster06Address(paymasterSigner),
289
291
  abi: singletonPaymaster06Abi,
290
292
  client: walletClient
291
293
  }),
292
294
  getContract({
293
- address: getSingletonPaymaster07Address(owner),
295
+ address: getSingletonPaymaster07Address(paymasterSigner),
294
296
  abi: singletonPaymaster07Abi,
295
297
  client: walletClient
296
298
  }),
297
299
  getContract({
298
- address: getSingletonPaymaster08Address(owner),
300
+ address: getSingletonPaymaster08Address(paymasterSigner),
299
301
  abi: singletonPaymaster08Abi,
300
302
  client: walletClient
301
303
  })