@zerodev/sdk 5.4.0-beta.2 → 5.4.0

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.
@@ -1,15 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sponsorUserOperation = void 0;
4
+ const viem_1 = require("viem");
5
+ const account_abstraction_1 = require("viem/account-abstraction");
4
6
  const utils_js_1 = require("../../utils.js");
5
7
  const sponsorUserOperation = async (client, args) => {
8
+ const { userOperation: { chainId, entryPointAddress, context, calls, account, ..._userOperation } } = args;
6
9
  const response = await client.request({
7
10
  method: "zd_sponsorUserOperation",
8
11
  params: [
9
12
  {
10
13
  chainId: client.chain?.id,
11
- userOp: (0, utils_js_1.deepHexlify)(args.userOperation),
12
- entryPointAddress: args.entryPoint.address,
14
+ userOp: (0, utils_js_1.deepHexlify)(_userOperation),
15
+ entryPointAddress: entryPointAddress,
13
16
  gasTokenData: args.gasToken && {
14
17
  tokenAddress: args.gasToken
15
18
  },
@@ -18,15 +21,18 @@ const sponsorUserOperation = async (client, args) => {
18
21
  }
19
22
  ]
20
23
  });
21
- if (args.entryPoint.version === "0.6") {
24
+ if ((0, viem_1.isAddressEqual)(entryPointAddress, account_abstraction_1.entryPoint06Address)) {
22
25
  return {
23
26
  paymasterAndData: response.paymasterAndData,
24
27
  preVerificationGas: BigInt(response.preVerificationGas),
25
28
  verificationGasLimit: BigInt(response.verificationGasLimit),
26
29
  callGasLimit: BigInt(response.callGasLimit),
27
- maxFeePerGas: response.maxFeePerGas && BigInt(response.maxFeePerGas),
28
- maxPriorityFeePerGas: response.maxPriorityFeePerGas &&
29
- BigInt(response.maxPriorityFeePerGas)
30
+ maxFeePerGas: response.maxFeePerGas
31
+ ? BigInt(response.maxFeePerGas)
32
+ : args.userOperation.maxFeePerGas,
33
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
34
+ ? BigInt(response.maxPriorityFeePerGas)
35
+ : args.userOperation.maxPriorityFeePerGas
30
36
  };
31
37
  }
32
38
  const responseV07 = response;
@@ -38,9 +44,12 @@ const sponsorUserOperation = async (client, args) => {
38
44
  paymasterVerificationGasLimit: BigInt(responseV07.paymasterVerificationGasLimit),
39
45
  paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
40
46
  paymasterData: responseV07.paymasterData,
41
- maxFeePerGas: response.maxFeePerGas && BigInt(response.maxFeePerGas),
42
- maxPriorityFeePerGas: response.maxPriorityFeePerGas &&
43
- BigInt(response.maxPriorityFeePerGas)
47
+ maxFeePerGas: response.maxFeePerGas
48
+ ? BigInt(response.maxFeePerGas)
49
+ : args.userOperation.maxFeePerGas,
50
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
51
+ ? BigInt(response.maxPriorityFeePerGas)
52
+ : args.userOperation.maxPriorityFeePerGas
44
53
  };
45
54
  };
46
55
  exports.sponsorUserOperation = sponsorUserOperation;
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAKA,6CAA4C;AAwDrC,MAAM,oBAAoB,GAAG,KAAK,EAGrC,MAAiD,EACjD,IAAuD,EACG,EAAE;IAC5D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE,IAAA,sBAAW,EAAC,IAAI,CAAC,aAAa,CAAC;gBACvC,iBAAiB,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO;gBAC1C,YAAY,EAAE,IAAI,CAAC,QAAQ,IAAI;oBAC3B,YAAY,EAAE,IAAI,CAAC,QAAQ;iBAC9B;gBACD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,IAAI,KAAK;gBAClD,aAAa,EAAE,IAAI,CAAC,aAAa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,CAAC,oBAAoB;gBAC/C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;gBACvC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB;SACd,CAAA;IACvC,CAAC;IACD,MAAM,WAAW,GAAG,QAWnB,CAAA;IAED,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC;QAC9C,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,oBAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;QACxC,YAAY,EAAE,QAAQ,CAAC,YAAY;YAC/B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC/B,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY;QACrC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;YAC/C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB;KACd,CAAA;AACvC,CAAC,CAAA;AA7EY,QAAA,oBAAoB,wBA6EhC"}
@@ -11,10 +11,9 @@ const writeContract_js_1 = require("../../actions/account-client/writeContract.j
11
11
  const index_js_1 = require("../../actions/index.js");
12
12
  const estimateGasInERC20_js_1 = require("../../actions/paymaster/estimateGasInERC20.js");
13
13
  const sponsorUserOperation_js_1 = require("../../actions/paymaster/sponsorUserOperation.js");
14
- const zerodevPaymasterActions = (entryPoint) => (client) => ({
14
+ const zerodevPaymasterActions = () => (client) => ({
15
15
  sponsorUserOperation: async (args) => (0, sponsorUserOperation_js_1.sponsorUserOperation)(client, {
16
- ...args,
17
- entryPoint
16
+ ...args
18
17
  }),
19
18
  estimateGasInERC20: async (args) => (0, estimateGasInERC20_js_1.estimateGasInERC20)(client, args)
20
19
  });
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":";;;AAaA,oHAA6G;AAC7G,0GAGiE;AACjE,wFAGwD;AACxD,wFAAiF;AACjF,gFAAyE;AACzE,oFAA6E;AAC7E,oFAA6E;AAM7E,qDAI+B;AAC/B,yFAIsD;AACtD,6FAIwD;AAkBjD,MAAM,uBAAuB,GAChC,CACI,UAA6C,EAC/C,EAAE,CACJ,CAAC,MAAc,EAAoD,EAAE,CAAC,CAAC;IACnE,oBAAoB,EAAE,KAAK,EACvB,IAGC,EACH,EAAE,CACA,IAAA,8CAAoB,EAChB,MAAmD,EACnD;QACI,GAAG,IAAI;QACP,UAAU;KACb,CACJ;IACL,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,IAAA,0CAAkB,EACd,MAAmD,EACnD,IAAI,CACP;CACR,CAAC,CAAA;AAvBO,QAAA,uBAAuB,2BAuB9B;AAuXN,SAAgB,0BAA0B;IACtC,OAAO,CAMH,MAAgD,EACC,EAAE,CAAC,CAAC;QACrD,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC;QAC5D,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAe,EAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,8BAAmB,EAAC,MAAM,EAAE,IAAI,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CA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AAC,IAAA,4BAAiB,EAAC,MAAM,EAAE,IAAI,CAAC;QAC5D,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,0BAAe,EAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,8BAAmB,EAAC,MAAM,EAAE,IAAI,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,oCAAe,EAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,6BAA6B,EAAE,KAAK,IAAI,EAAE,CACtC,IAAA,gEAA6B,EAAC,MAAM,CAAC;QAEzC,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,oCAAe,EAAC,MAAM,EAAE,IAAW,CAAC;QAC/D,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,4BAAW,EAAC,MAAM,EAAE,IAAI,CAAC;QAChD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,MAAM,EAAE,IAAI,CAAC;QACpD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,MAAM,EAAE,IAAI,CAAC;KACvD,CAAC,CAAA;AACN,CAAC;AAtBD,gEAsBC"}
@@ -5,7 +5,7 @@ const viem_1 = require("viem");
5
5
  const account_abstraction_1 = require("viem/account-abstraction");
6
6
  const kernel_js_1 = require("./decorators/kernel.js");
7
7
  const createZeroDevPaymasterClient = (parameters) => {
8
- const { key = "public", name = "ZeroDev Paymaster Client", entryPoint, transport } = parameters;
8
+ const { key = "public", name = "ZeroDev Paymaster Client", transport } = parameters;
9
9
  const client = (0, viem_1.createClient)({
10
10
  ...parameters,
11
11
  transport: (opts) => {
@@ -18,10 +18,7 @@ const createZeroDevPaymasterClient = (parameters) => {
18
18
  name,
19
19
  type: "zerodevPaymasterClient"
20
20
  });
21
- return client.extend(account_abstraction_1.paymasterActions).extend((0, kernel_js_1.zerodevPaymasterActions)({
22
- address: entryPoint?.address ?? account_abstraction_1.entryPoint07Address,
23
- version: entryPoint?.version ?? "0.7"
24
- }));
21
+ return client.extend(account_abstraction_1.paymasterActions).extend((0, kernel_js_1.zerodevPaymasterActions)());
25
22
  };
26
23
  exports.createZeroDevPaymasterClient = createZeroDevPaymasterClient;
27
24
  //# sourceMappingURL=paymasterClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":";;;AAAA,+BASa;AACb,kEAKiC;AAKjC,sDAAgE;AAgEzD,MAAM,4BAA4B,GAAG,CACxC,UAAwC,EAClB,EAAE;IACxB,MAAM,EACF,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,0BAA0B,EACjC,UAAU,EACV,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO,SAAS,CAAC;gBACb,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;QACN,CAAC;QACD,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,sCAAgB,CAAC,CAAC,MAAM,CACzC,IAAA,mCAAuB,EAAC;QACpB,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,yCAAmB;QACnD,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,KAAK;KACxC,CAAC,CACL,CAAA;AACL,CAAC,CAAA;AA3BY,QAAA,4BAA4B,gCA2BxC"}
1
+ {"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":";;;AAAA,+BASa;AACb,kEAIiC;AAEjC,sDAG+B;AA6DxB,MAAM,4BAA4B,GAAG,CACxC,UAAwC,EAClB,EAAE;IACxB,MAAM,EACF,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,0BAA0B,EACjC,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO,SAAS,CAAC;gBACb,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;QACN,CAAC;QACD,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,sCAAgB,CAAC,CAAC,MAAM,CAAC,IAAA,mCAAuB,GAAE,CAAC,CAAA;AAC5E,CAAC,CAAA;AArBY,QAAA,4BAA4B,gCAqBxC"}
@@ -1,15 +1,22 @@
1
+ import { isAddressEqual } from "viem";
2
+ import { entryPoint06Address } from "viem/account-abstraction";
1
3
  import { deepHexlify } from "../../utils.js";
2
4
  /**
3
5
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
4
6
  */
5
7
  export const sponsorUserOperation = async (client, args) => {
8
+ const { userOperation: { chainId, entryPointAddress, context,
9
+ // @ts-ignore
10
+ calls,
11
+ // @ts-ignore
12
+ account, ..._userOperation } } = args;
6
13
  const response = await client.request({
7
14
  method: "zd_sponsorUserOperation",
8
15
  params: [
9
16
  {
10
17
  chainId: client.chain?.id,
11
- userOp: deepHexlify(args.userOperation),
12
- entryPointAddress: args.entryPoint.address,
18
+ userOp: deepHexlify(_userOperation),
19
+ entryPointAddress: entryPointAddress,
13
20
  gasTokenData: args.gasToken && {
14
21
  tokenAddress: args.gasToken
15
22
  },
@@ -18,15 +25,18 @@ export const sponsorUserOperation = async (client, args) => {
18
25
  }
19
26
  ]
20
27
  });
21
- if (args.entryPoint.version === "0.6") {
28
+ if (isAddressEqual(entryPointAddress, entryPoint06Address)) {
22
29
  return {
23
30
  paymasterAndData: response.paymasterAndData,
24
31
  preVerificationGas: BigInt(response.preVerificationGas),
25
32
  verificationGasLimit: BigInt(response.verificationGasLimit),
26
33
  callGasLimit: BigInt(response.callGasLimit),
27
- maxFeePerGas: response.maxFeePerGas && BigInt(response.maxFeePerGas),
28
- maxPriorityFeePerGas: response.maxPriorityFeePerGas &&
29
- BigInt(response.maxPriorityFeePerGas)
34
+ maxFeePerGas: response.maxFeePerGas
35
+ ? BigInt(response.maxFeePerGas)
36
+ : args.userOperation.maxFeePerGas,
37
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
38
+ ? BigInt(response.maxPriorityFeePerGas)
39
+ : args.userOperation.maxPriorityFeePerGas
30
40
  };
31
41
  }
32
42
  const responseV07 = response;
@@ -38,9 +48,12 @@ export const sponsorUserOperation = async (client, args) => {
38
48
  paymasterVerificationGasLimit: BigInt(responseV07.paymasterVerificationGasLimit),
39
49
  paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
40
50
  paymasterData: responseV07.paymasterData,
41
- maxFeePerGas: response.maxFeePerGas && BigInt(response.maxFeePerGas),
42
- maxPriorityFeePerGas: response.maxPriorityFeePerGas &&
43
- BigInt(response.maxPriorityFeePerGas)
51
+ maxFeePerGas: response.maxFeePerGas
52
+ ? BigInt(response.maxFeePerGas)
53
+ : args.userOperation.maxFeePerGas,
54
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
55
+ ? BigInt(response.maxPriorityFeePerGas)
56
+ : args.userOperation.maxPriorityFeePerGas
44
57
  };
45
58
  };
46
59
  //# sourceMappingURL=sponsorUserOperation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,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BAAoB,CAAC;QAC9D,kBAAkB,EAAE,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC;QAC1D,SAAS,EAAE,WAAW,CAAC,SAAS;QAChC,6BAA6B,EAAE,MAAM,CACjC,WAAW,CAAC,6BAA6B,CAC5C;QACD,uBAAuB,EAAE,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QACpE,aAAa,EAAE,WAAW,CAAC,aAAa;QACxC,YAAY,EAAE,QAAQ,CAAC,YAAY,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpE,oBAAoB,EAChB,QAAQ,CAAC,oBAAoB;YAC7B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACS,CAAA;AAC1D,CAAC,CAAA"}
1
+ {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,cAAc,EAAE,MAAM,MAAM,CAAA;AAC5E,OAAO,EAIH,mBAAmB,EACtB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAmB5C;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EAGrC,MAAiD,EACjD,IAAoC,EACG,EAAE;IACzC,MAAM,EACF,aAAa,EAAE,EACX,OAAO,EACP,iBAAiB,EACjB,OAAO;IACP,aAAa;IACb,KAAK;IACL,aAAa;IACb,OAAO,EACP,GAAG,cAAc,EACpB,EACJ,GAAG,IAAI,CAAA;IACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE;YACJ;gBACI,OAAO,EAAE,MAAM,CAAC,KAAK,EAAE,EAAY;gBACnC,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC;gBACnC,iBAAiB,EAAE,iBAAiB;gBACpC,YAAY,EAAE,IAAI,CAAC,QAAQ,IA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,QAAQ,CAAC,YAAY;YAC/B,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC/B,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY;QACrC,oBAAoB,EAAE,QAAQ,CAAC,oBAAoB;YAC/C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;YACvC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,oBAAoB;KACd,CAAA;AACvC,CAAC,CAAA"}
@@ -8,10 +8,9 @@ import { writeContract } from "../../actions/account-client/writeContract.js";
8
8
  import { changeSudoValidator, signUserOperation, uninstallPlugin } from "../../actions/index.js";
9
9
  import { estimateGasInERC20 } from "../../actions/paymaster/estimateGasInERC20.js";
10
10
  import { sponsorUserOperation } from "../../actions/paymaster/sponsorUserOperation.js";
11
- export const zerodevPaymasterActions = (entryPoint) => (client) => ({
11
+ export const zerodevPaymasterActions = () => (client) => ({
12
12
  sponsorUserOperation: async (args) => sponsorUserOperation(client, {
13
- ...args,
14
- entryPoint
13
+ ...args
15
14
  }),
16
15
  estimateGasInERC20: async (args) => estimateGasInERC20(client, args)
17
16
  });
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,6BAA6B,EAAE,MAAM,+DAA+D,CAAA;AAC7G,OAAO,EAEH,wBAAwB,EAC3B,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAEH,eAAe,EAClB,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAA;AAM7E,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EAClB,MAAM,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iB,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC;QAC5D,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC;QAC9D,6BAA6B,EAAE,KAAK,IAAI,EAAE,CACtC,6BAA6B,CAAC,MAAM,CAAC;QACzC,4DAA4D;QAC5D,eAAe,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,IAAW,CAAC;QAC/D,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC;QAChD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;QACpD,aAAa,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC;KACvD,CAAC,CAAA;AACN,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { createClient } from "viem";
2
- import { entryPoint07Address, paymasterActions } from "viem/account-abstraction";
2
+ import { paymasterActions } from "viem/account-abstraction";
3
3
  import { zerodevPaymasterActions } from "./decorators/kernel.js";
4
4
  /**
5
5
  * Creates a ZeroDev-specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
@@ -19,7 +19,7 @@ import { zerodevPaymasterActions } from "./decorators/kernel.js";
19
19
  * })
20
20
  */
21
21
  export const createZeroDevPaymasterClient = (parameters) => {
22
- const { key = "public", name = "ZeroDev Paymaster Client", entryPoint, transport } = parameters;
22
+ const { key = "public", name = "ZeroDev Paymaster Client", transport } = parameters;
23
23
  const client = createClient({
24
24
  ...parameters,
25
25
  transport: (opts) => {
@@ -32,9 +32,6 @@ export const createZeroDevPaymasterClient = (parameters) => {
32
32
  name,
33
33
  type: "zerodevPaymasterClient"
34
34
  });
35
- return client.extend(paymasterActions).extend(zerodevPaymasterActions({
36
- address: entryPoint?.address ?? entryPoint07Address,
37
- version: entryPoint?.version ?? "0.7"
38
- }));
35
+ return client.extend(paymasterActions).extend(zerodevPaymasterActions());
39
36
  };
40
37
  //# sourceMappingURL=paymasterClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAQH,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAGH,mBAAmB,EACnB,gBAAgB,EACnB,MAAM,0BAA0B,CAAA;AAKjC,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AA+ChE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CACxC,UAAwC,EAClB,EAAE;IACxB,MAAM,EACF,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,0BAA0B,EACjC,UAAU,EACV,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO,SAAS,CAAC;gBACb,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;QACN,CAAC;QACD,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,CACzC,uBAAuB,CAAC;QACpB,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,mBAAmB;QACnD,OAAO,EAAE,UAAU,EAAE,OAAO,IAAI,KAAK;KACxC,CAAC,CACL,CAAA;AACL,CAAC,CAAA"}
1
+ {"version":3,"file":"paymasterClient.js","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAQH,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAGH,gBAAgB,EACnB,MAAM,0BAA0B,CAAA;AAEjC,OAAO,EAEH,uBAAuB,EAC1B,MAAM,wBAAwB,CAAA;AA4C/B;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CACxC,UAAwC,EAClB,EAAE;IACxB,MAAM,EACF,GAAG,GAAG,QAAQ,EACd,IAAI,GAAG,0BAA0B,EACjC,SAAS,EACZ,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE;YAChB,OAAO,SAAS,CAAC;gBACb,GAAG,IAAI;gBACP,UAAU,EAAE,CAAC;aAChB,CAAC,CAAA;QACN,CAAC;QACD,GAAG;QACH,IAAI;QACJ,IAAI,EAAE,wBAAwB;KACjC,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,uBAAuB,EAAE,CAAC,CAAA;AAC5E,CAAC,CAAA"}
@@ -291,6 +291,8 @@ export declare const estimateGasInERC20: <entryPointVersion extends EntryPointVe
291
291
  uid: string;
292
292
  getPaymasterData: (parameters: import("viem/account-abstraction").GetPaymasterDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterDataReturnType>;
293
293
  getPaymasterStubData: (parameters: import("viem/account-abstraction").GetPaymasterStubDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterStubDataReturnType>;
294
+ sponsorUserOperation: (args: import("./sponsorUserOperation.js").SponsorUserOperationParameters) => Promise<import("./sponsorUserOperation.js").SponsorUserOperationReturnType>;
295
+ estimateGasInERC20: (args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>;
294
296
  extend: <const client extends {
295
297
  [x: string]: unknown;
296
298
  account?: undefined;
@@ -1064,7 +1066,7 @@ export declare const estimateGasInERC20: <entryPointVersion extends EntryPointVe
1064
1066
  } | undefined) => Promise<bigint>;
1065
1067
  isDeployed: () => Promise<boolean>;
1066
1068
  type: "smart";
1067
- }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1069
+ }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1068
1070
  client: import("viem").Client;
1069
1071
  entryPoint: {
1070
1072
  abi: import("viem").Abi;
@@ -1317,6 +1319,6 @@ export declare const estimateGasInERC20: <entryPointVersion extends EntryPointVe
1317
1319
  } | undefined) => Promise<bigint>;
1318
1320
  isDeployed: () => Promise<boolean>;
1319
1321
  type: "smart";
1320
- }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions>;
1322
+ }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>;
1321
1323
  }, args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>;
1322
1324
  //# sourceMappingURL=estimateGasInERC20.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"estimateGasInERC20.d.ts","sourceRoot":"","sources":["../../../actions/paymaster/estimateGasInERC20.ts"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIrB,4BAA4B,KACnC,QAAQ,4BAA4B,CAyBtC,CAAA"}
@@ -1,16 +1,19 @@
1
- import type { Hex } from "viem";
2
- import type { PartialBy } from "viem";
3
- import type { EntryPointVersion, UserOperation } from "viem/account-abstraction";
1
+ import { type Hex, type Prettify } from "viem";
2
+ import { type EntryPointVersion, type GetPaymasterDataParameters, type GetPaymasterStubDataReturnType } from "viem/account-abstraction";
4
3
  import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js";
5
- import type { EntryPointType, PartialPick } from "../../types/index.js";
6
- export type SponsorUserOperationParameters<entryPointVersion extends EntryPointVersion> = {
7
- userOperation: entryPointVersion extends "0.6" ? PartialBy<UserOperation<"0.6">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : PartialBy<UserOperation<"0.7">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">;
8
- entryPoint: EntryPointType<entryPointVersion>;
4
+ export type SponsorUserOperationParameters = {
5
+ userOperation: GetPaymasterDataParameters;
9
6
  gasToken?: Hex;
10
7
  shouldOverrideFee?: boolean;
11
8
  shouldConsume?: boolean;
12
9
  };
13
- export type SponsorUserOperationReturnType<entryPointVersion extends EntryPointVersion> = entryPointVersion extends "0.6" ? Pick<UserOperation<"0.6">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterAndData"> & PartialPick<UserOperation<"0.6">, "maxFeePerGas" | "maxPriorityFeePerGas"> : Pick<UserOperation<"0.7">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData"> & PartialPick<UserOperation<"0.7">, "maxFeePerGas" | "maxPriorityFeePerGas">;
10
+ export type SponsorUserOperationReturnType = Prettify<GetPaymasterStubDataReturnType & {
11
+ maxFeePerGas?: bigint | undefined;
12
+ maxPriorityFeePerGas?: bigint | undefined;
13
+ callGasLimit?: bigint | undefined;
14
+ verificationGasLimit?: bigint | undefined;
15
+ preVerificationGas?: bigint | undefined;
16
+ }>;
14
17
  /**
15
18
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
16
19
  */
@@ -255,7 +258,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
255
258
  uint248?: undefined;
256
259
  uint256?: undefined;
257
260
  } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
258
- signUserOperation: (parameters: import("viem").UnionPartialBy<UserOperation, "sender"> & {
261
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
259
262
  chainId?: number | undefined;
260
263
  }) => Promise<`0x${string}`>;
261
264
  userOperation?: {
@@ -283,12 +286,14 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
283
286
  key: string;
284
287
  name: string;
285
288
  pollingInterval: number;
286
- request: import("viem").EIP1193RequestFn<import("../../types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>>;
289
+ request: import("viem").EIP1193RequestFn<import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>>;
287
290
  transport: import("viem").TransportConfig<string, import("viem").EIP1193RequestFn> & Record<string, any>;
288
291
  type: string;
289
292
  uid: string;
290
- getPaymasterData: (parameters: import("viem/account-abstraction").GetPaymasterDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterDataReturnType>;
291
- getPaymasterStubData: (parameters: import("viem/account-abstraction").GetPaymasterStubDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterStubDataReturnType>;
293
+ getPaymasterData: (parameters: GetPaymasterDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterDataReturnType>;
294
+ getPaymasterStubData: (parameters: import("viem/account-abstraction").GetPaymasterStubDataParameters) => Promise<GetPaymasterStubDataReturnType>;
295
+ sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
296
+ estimateGasInERC20: (args: import("./estimateGasInERC20.js").EstimateGasInERC20Parameters) => Promise<import("./estimateGasInERC20.js").EstimateGasInERC20ReturnType>;
292
297
  extend: <const client extends {
293
298
  [x: string]: unknown;
294
299
  account?: undefined;
@@ -543,7 +548,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
543
548
  uint248?: undefined;
544
549
  uint256?: undefined;
545
550
  } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
546
- signUserOperation: (parameters: import("viem").UnionPartialBy<UserOperation, "sender"> & {
551
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
547
552
  chainId?: number | undefined;
548
553
  }) => Promise<`0x${string}`>;
549
554
  userOperation?: {
@@ -796,7 +801,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
796
801
  uint248?: undefined;
797
802
  uint256?: undefined;
798
803
  } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
799
- signUserOperation: (parameters: import("viem").UnionPartialBy<UserOperation, "sender"> & {
804
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
800
805
  chainId?: number | undefined;
801
806
  }) => Promise<`0x${string}`>;
802
807
  userOperation?: {
@@ -1049,7 +1054,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
1049
1054
  uint248?: undefined;
1050
1055
  uint256?: undefined;
1051
1056
  } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
1052
- signUserOperation: (parameters: import("viem").UnionPartialBy<UserOperation, "sender"> & {
1057
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
1053
1058
  chainId?: number | undefined;
1054
1059
  }) => Promise<`0x${string}`>;
1055
1060
  userOperation?: {
@@ -1062,7 +1067,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
1062
1067
  } | undefined) => Promise<bigint>;
1063
1068
  isDeployed: () => Promise<boolean>;
1064
1069
  type: "smart";
1065
- }) | undefined, import("../../types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1070
+ }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1066
1071
  client: import("viem").Client;
1067
1072
  entryPoint: {
1068
1073
  abi: import("viem").Abi;
@@ -1302,7 +1307,7 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
1302
1307
  uint248?: undefined;
1303
1308
  uint256?: undefined;
1304
1309
  } | Record<string, unknown>, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
1305
- signUserOperation: (parameters: import("viem").UnionPartialBy<UserOperation, "sender"> & {
1310
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
1306
1311
  chainId?: number | undefined;
1307
1312
  }) => Promise<`0x${string}`>;
1308
1313
  userOperation?: {
@@ -1315,6 +1320,6 @@ export declare const sponsorUserOperation: <entryPointVersion extends EntryPoint
1315
1320
  } | undefined) => Promise<bigint>;
1316
1321
  isDeployed: () => Promise<boolean>;
1317
1322
  type: "smart";
1318
- }) | undefined, import("../../types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions>;
1319
- }, args: SponsorUserOperationParameters<entryPointVersion>) => Promise<SponsorUserOperationReturnType<entryPointVersion>>;
1323
+ }) | undefined, import("../../index.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions & import("../../index.js").ZeroDevPaymasterClientActions>;
1324
+ }, args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
1320
1325
  //# sourceMappingURL=sponsorUserOperation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACrC,OAAO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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAIvB,8BAA8B,KACrC,QAAQ,8BAA8B,CAwExC,CAAA"}
@@ -10,15 +10,14 @@ import type { ChangeSudoValidatorParameters, SignUserOperationReturnType, Uninst
10
10
  import { signUserOperation } from "../../actions/index.js";
11
11
  import { type EstimateGasInERC20Parameters, type EstimateGasInERC20ReturnType } from "../../actions/paymaster/estimateGasInERC20.js";
12
12
  import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/paymaster/sponsorUserOperation.js";
13
- import type { EntryPointType } from "../../types/kernel.js";
14
- export type ZeroDevPaymasterClientActions<entryPointVersion extends EntryPointVersion> = {
13
+ export type ZeroDevPaymasterClientActions = {
15
14
  /**
16
15
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
17
16
  */
18
- sponsorUserOperation: (args: SponsorUserOperationParameters<entryPointVersion>) => Promise<SponsorUserOperationReturnType<entryPointVersion>>;
17
+ sponsorUserOperation: (args: SponsorUserOperationParameters) => Promise<SponsorUserOperationReturnType>;
19
18
  estimateGasInERC20: (args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>;
20
19
  };
21
- export declare const zerodevPaymasterActions: <entryPointVersion extends EntryPointVersion>(entryPoint: EntryPointType<entryPointVersion>) => (client: Client) => ZeroDevPaymasterClientActions<entryPointVersion>;
20
+ export declare const zerodevPaymasterActions: <entryPointVersion extends EntryPointVersion>() => (client: Client) => ZeroDevPaymasterClientActions;
22
21
  export type KernelAccountClientActions<TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount | undefined = SmartAccount | undefined> = {
23
22
  /**
24
23
  * Signs a user operation with the given transport, chain, and smart account.
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,GAAG,EACH,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,oBAAoB,EACpB,IAAI,EACJ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,uBAAuB,EAC1B,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE/E,OAAO,EACH,KAAK,kCAAkC,EAE1C,MAAM,0DAA0D,CAAA;AACjE,OAAO,EACH,KAAK,yBAAyB,EAEjC,MAAM,iDAAiD,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAA;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAA;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAA;AAC7E,OAAO,KAAK,EACR,6BAA6B,EAC7B,2BAA2B,EAC3B,yBAAyB,EAC5B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAEH,iBAAiB,EAEpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAEpC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,iDAAiD,CAAA;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG3D,MAAM,MAAM,6BAA6B,CACrC,iBAAiB,SAAS,iBAAiB,IAC3C;IACA;;OAEG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,8BAA8B,CAAC,iBAAiB,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uHAsBzC"}
@@ -1,10 +1,9 @@
1
1
  import { type Chain, type Client, type ClientConfig, type Prettify, type RpcSchema, type Transport } from "viem";
2
2
  import { type PaymasterActions, type SmartAccount } from "viem/account-abstraction";
3
- import type { EntryPointType, ZeroDevPaymasterRpcSchema } from "../types/kernel.js";
4
- export type ZeroDevPaymasterClient<entryPointVersion extends "0.6" | "0.7" = "0.7", transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...ZeroDevPaymasterRpcSchema<entryPointVersion>, ...rpcSchema] : ZeroDevPaymasterRpcSchema<entryPointVersion>, PaymasterActions>>;
5
- export type ZeroDevPaymasterClientConfig<entryPointVersion extends "0.6" | "0.7" = "0.7" | "0.6", transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<transport, chain, account, rpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema" | "transport">> & {
6
- entryPoint?: EntryPointType<entryPointVersion>;
7
- };
3
+ import type { ZeroDevPaymasterRpcSchema } from "../types/kernel.js";
4
+ import { type ZeroDevPaymasterClientActions } from "./decorators/kernel.js";
5
+ export type ZeroDevPaymasterClient<entryPointVersion extends "0.6" | "0.7" = "0.7", transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, client extends Client | undefined = Client | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Client<transport, chain extends Chain ? chain : client extends Client<any, infer chain> ? chain : undefined, account, rpcSchema extends RpcSchema ? [...ZeroDevPaymasterRpcSchema<entryPointVersion>, ...rpcSchema] : ZeroDevPaymasterRpcSchema<entryPointVersion>, PaymasterActions & ZeroDevPaymasterClientActions>>;
6
+ export type ZeroDevPaymasterClientConfig<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends SmartAccount | undefined = SmartAccount | undefined, rpcSchema extends RpcSchema | undefined = undefined> = Prettify<Pick<ClientConfig<transport, chain, account, rpcSchema>, "account" | "cacheTime" | "chain" | "key" | "name" | "pollingInterval" | "rpcSchema" | "transport">>;
8
7
  /**
9
8
  * Creates a ZeroDev-specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
10
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"paymasterClient.d.ts","sourceRoot":"","sources":["../../clients/paymasterClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,QAAQ,EAEb,KAAK,SAAS,EACd,KAAK,SAAS,EAEjB,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,YAAY,EAGpB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EACR,cAAc,EACd,yBAAyB,EAC5B,MAAM,oBAAoB,CAAA;AAG3B,MAAM,MAAM,sBAAsB,CAC9B,iBAAiB,SAAS,KAAK,GAAG,KAAK,GAAG,KAAK,EAC/C,SAAS,SAAS,SAAS,GAAG,SAAS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GAAG,YAAY,GAAG,SAAS,EACnE,SAAS,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IACnD,QAAQ,CACR,IAAI,CACA,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC,EAChD,SAAS,GACT,WAAW,GACX,OAAO,GACP,KAAK,GACL,MAAM,GACN,iBAAiB,GACjB,WAAW,GACX,WAAW,CAChB,CACJ,CAAA;AACD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,4BAA4B,eACzB,4BAA4B,KACzC,sBAmBF,CAAA"}
package/_types/utils.d.ts CHANGED
@@ -285,6 +285,8 @@ export declare const getERC20PaymasterApproveCall: <entryPointVersion extends En
285
285
  uid: string;
286
286
  getPaymasterData: (parameters: import("viem/account-abstraction").GetPaymasterDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterDataReturnType>;
287
287
  getPaymasterStubData: (parameters: import("viem/account-abstraction").GetPaymasterStubDataParameters) => Promise<import("viem/account-abstraction").GetPaymasterStubDataReturnType>;
288
+ sponsorUserOperation: (args: import("./index.js").SponsorUserOperationParameters) => Promise<import("./index.js").SponsorUserOperationReturnType>;
289
+ estimateGasInERC20: (args: import("./actions/index.js").EstimateGasInERC20Parameters) => Promise<import("./actions/index.js").EstimateGasInERC20ReturnType>;
288
290
  extend: <const client extends {
289
291
  [x: string]: unknown;
290
292
  account?: undefined;
@@ -1058,7 +1060,7 @@ export declare const getERC20PaymasterApproveCall: <entryPointVersion extends En
1058
1060
  } | undefined) => Promise<bigint>;
1059
1061
  isDeployed: () => Promise<boolean>;
1060
1062
  type: "smart";
1061
- }) | undefined, import("./types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1063
+ }) | undefined, import("./types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, import("viem/account-abstraction").PaymasterActions & import("./index.js").ZeroDevPaymasterClientActions>) => client) => import("viem").Client<import("viem").Transport, import("viem").Chain | undefined, (object & {
1062
1064
  client: import("viem").Client;
1063
1065
  entryPoint: {
1064
1066
  abi: import("viem").Abi;
@@ -1311,7 +1313,7 @@ export declare const getERC20PaymasterApproveCall: <entryPointVersion extends En
1311
1313
  } | undefined) => Promise<bigint>;
1312
1314
  isDeployed: () => Promise<boolean>;
1313
1315
  type: "smart";
1314
- }) | undefined, import("./types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions>;
1316
+ }) | undefined, import("./types/kernel.js").ZeroDevPaymasterRpcSchema<entryPointVersion>, { [K in keyof client]: client[K]; } & import("viem/account-abstraction").PaymasterActions & import("./index.js").ZeroDevPaymasterClientActions>;
1315
1317
  }, { gasToken, approveAmount, entryPoint }: {
1316
1318
  gasToken: Address;
1317
1319
  approveAmount: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,GAAG,EASX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzE,oBAAY,eAAe;IACvB,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IACjD,qCAAqC,0CAA0C;CAClF;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAItE,CAAA;AAED,eAAO,MAAM,gBAAgB,YAChB,eAAe,WACf,MAAM,KAChB,OAMF,CAAA;AAED,eAAO,MAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cASvB,OAAO;mBACF,MAAM;;MAG1B,QAAQ;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAmBnD,CAAA;AAED,eAAO,MAAM,aAAa,QAAS,GAAG,KAAG,GAcxC,CAAA;AAED,eAAO,MAAM,WAAW;cAIV,SAAS;cACT,SAAS;MACnB,GAQH,CAAA;AAED,eAAO,MAAM,mCAAmC,mEAGzB,iBAAiB,6DAYvC,CAAA;AAED,eAAO,MAAM,cAAc,YAAa,MAAM,SAAS,MAAM,KAAG,OAE/D,CAAA;AAGD,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CA0BzC"}
@@ -1,60 +1,29 @@
1
- import type { Address, Hex } from "viem"
2
- import type { PartialBy } from "viem"
3
- import type { EntryPointVersion, UserOperation } from "viem/account-abstraction"
1
+ import { type Address, type Hex, type Prettify, isAddressEqual } from "viem"
2
+ import {
3
+ type EntryPointVersion,
4
+ type GetPaymasterDataParameters,
5
+ type GetPaymasterStubDataReturnType,
6
+ entryPoint06Address
7
+ } from "viem/account-abstraction"
4
8
  import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js"
5
- import type { EntryPointType, PartialPick } from "../../types/index.js"
6
9
  import { deepHexlify } from "../../utils.js"
7
10
 
8
- export type SponsorUserOperationParameters<
9
- entryPointVersion extends EntryPointVersion
10
- > = {
11
- userOperation: entryPointVersion extends "0.6"
12
- ? PartialBy<
13
- UserOperation<"0.6">,
14
- "callGasLimit" | "preVerificationGas" | "verificationGasLimit"
15
- >
16
- : PartialBy<
17
- UserOperation<"0.7">,
18
- | "callGasLimit"
19
- | "preVerificationGas"
20
- | "verificationGasLimit"
21
- | "paymasterVerificationGasLimit"
22
- | "paymasterPostOpGasLimit"
23
- >
24
- entryPoint: EntryPointType<entryPointVersion>
11
+ export type SponsorUserOperationParameters = {
12
+ userOperation: GetPaymasterDataParameters
25
13
  gasToken?: Hex
26
14
  shouldOverrideFee?: boolean
27
15
  shouldConsume?: boolean
28
16
  }
29
17
 
30
- export type SponsorUserOperationReturnType<
31
- entryPointVersion extends EntryPointVersion
32
- > = entryPointVersion extends "0.6"
33
- ? Pick<
34
- UserOperation<"0.6">,
35
- | "callGasLimit"
36
- | "verificationGasLimit"
37
- | "preVerificationGas"
38
- | "paymasterAndData"
39
- > &
40
- PartialPick<
41
- UserOperation<"0.6">,
42
- "maxFeePerGas" | "maxPriorityFeePerGas"
43
- >
44
- : Pick<
45
- UserOperation<"0.7">,
46
- | "callGasLimit"
47
- | "verificationGasLimit"
48
- | "preVerificationGas"
49
- | "paymaster"
50
- | "paymasterVerificationGasLimit"
51
- | "paymasterPostOpGasLimit"
52
- | "paymasterData"
53
- > &
54
- PartialPick<
55
- UserOperation<"0.7">,
56
- "maxFeePerGas" | "maxPriorityFeePerGas"
57
- >
18
+ export type SponsorUserOperationReturnType = Prettify<
19
+ GetPaymasterStubDataReturnType & {
20
+ maxFeePerGas?: bigint | undefined
21
+ maxPriorityFeePerGas?: bigint | undefined
22
+ callGasLimit?: bigint | undefined
23
+ verificationGasLimit?: bigint | undefined
24
+ preVerificationGas?: bigint | undefined
25
+ }
26
+ >
58
27
 
59
28
  /**
60
29
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
@@ -63,15 +32,27 @@ export const sponsorUserOperation = async <
63
32
  entryPointVersion extends EntryPointVersion
64
33
  >(
65
34
  client: ZeroDevPaymasterClient<entryPointVersion>,
66
- args: SponsorUserOperationParameters<entryPointVersion>
67
- ): Promise<SponsorUserOperationReturnType<entryPointVersion>> => {
35
+ args: SponsorUserOperationParameters
36
+ ): Promise<SponsorUserOperationReturnType> => {
37
+ const {
38
+ userOperation: {
39
+ chainId,
40
+ entryPointAddress,
41
+ context,
42
+ // @ts-ignore
43
+ calls,
44
+ // @ts-ignore
45
+ account,
46
+ ..._userOperation
47
+ }
48
+ } = args
68
49
  const response = await client.request({
69
50
  method: "zd_sponsorUserOperation",
70
51
  params: [
71
52
  {
72
53
  chainId: client.chain?.id as number,
73
- userOp: deepHexlify(args.userOperation),
74
- entryPointAddress: args.entryPoint.address,
54
+ userOp: deepHexlify(_userOperation),
55
+ entryPointAddress: entryPointAddress,
75
56
  gasTokenData: args.gasToken && {
76
57
  tokenAddress: args.gasToken
77
58
  },
@@ -80,18 +61,19 @@ export const sponsorUserOperation = async <
80
61
  }
81
62
  ]
82
63
  })
83
- if (args.entryPoint.version === "0.6") {
64
+ if (isAddressEqual(entryPointAddress, entryPoint06Address)) {
84
65
  return {
85
66
  paymasterAndData: response.paymasterAndData,
86
67
  preVerificationGas: BigInt(response.preVerificationGas),
87
68
  verificationGasLimit: BigInt(response.verificationGasLimit),
88
69
  callGasLimit: BigInt(response.callGasLimit),
89
- maxFeePerGas:
90
- response.maxFeePerGas && BigInt(response.maxFeePerGas),
91
- maxPriorityFeePerGas:
92
- response.maxPriorityFeePerGas &&
93
- BigInt(response.maxPriorityFeePerGas)
94
- } as SponsorUserOperationReturnType<entryPointVersion>
70
+ maxFeePerGas: response.maxFeePerGas
71
+ ? BigInt(response.maxFeePerGas)
72
+ : args.userOperation.maxFeePerGas,
73
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
74
+ ? BigInt(response.maxPriorityFeePerGas)
75
+ : args.userOperation.maxPriorityFeePerGas
76
+ } as SponsorUserOperationReturnType
95
77
  }
96
78
  const responseV07 = response as {
97
79
  preVerificationGas: Hex
@@ -116,9 +98,11 @@ export const sponsorUserOperation = async <
116
98
  ),
117
99
  paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit),
118
100
  paymasterData: responseV07.paymasterData,
119
- maxFeePerGas: response.maxFeePerGas && BigInt(response.maxFeePerGas),
120
- maxPriorityFeePerGas:
121
- response.maxPriorityFeePerGas &&
122
- BigInt(response.maxPriorityFeePerGas)
123
- } as SponsorUserOperationReturnType<entryPointVersion>
101
+ maxFeePerGas: response.maxFeePerGas
102
+ ? BigInt(response.maxFeePerGas)
103
+ : args.userOperation.maxFeePerGas,
104
+ maxPriorityFeePerGas: response.maxPriorityFeePerGas
105
+ ? BigInt(response.maxPriorityFeePerGas)
106
+ : args.userOperation.maxPriorityFeePerGas
107
+ } as SponsorUserOperationReturnType
124
108
  }
@@ -44,39 +44,28 @@ import {
44
44
  type SponsorUserOperationReturnType,
45
45
  sponsorUserOperation
46
46
  } from "../../actions/paymaster/sponsorUserOperation.js"
47
- import type { EntryPointType } from "../../types/kernel.js"
48
47
  import type { ZeroDevPaymasterClient } from "../paymasterClient.js"
49
48
 
50
- export type ZeroDevPaymasterClientActions<
51
- entryPointVersion extends EntryPointVersion
52
- > = {
49
+ export type ZeroDevPaymasterClientActions = {
53
50
  /**
54
51
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
55
52
  */
56
53
  sponsorUserOperation: (
57
- args: SponsorUserOperationParameters<entryPointVersion>
58
- ) => Promise<SponsorUserOperationReturnType<entryPointVersion>>
54
+ args: SponsorUserOperationParameters
55
+ ) => Promise<SponsorUserOperationReturnType>
59
56
  estimateGasInERC20: (
60
57
  args: EstimateGasInERC20Parameters
61
58
  ) => Promise<EstimateGasInERC20ReturnType>
62
59
  }
63
60
 
64
61
  export const zerodevPaymasterActions =
65
- <entryPointVersion extends EntryPointVersion>(
66
- entryPoint: EntryPointType<entryPointVersion>
67
- ) =>
68
- (client: Client): ZeroDevPaymasterClientActions<entryPointVersion> => ({
69
- sponsorUserOperation: async (
70
- args: Omit<
71
- SponsorUserOperationParameters<entryPointVersion>,
72
- "entryPoint"
73
- >
74
- ) =>
62
+ <entryPointVersion extends EntryPointVersion>() =>
63
+ (client: Client): ZeroDevPaymasterClientActions => ({
64
+ sponsorUserOperation: async (args: SponsorUserOperationParameters) =>
75
65
  sponsorUserOperation(
76
66
  client as ZeroDevPaymasterClient<entryPointVersion>,
77
67
  {
78
- ...args,
79
- entryPoint
68
+ ...args
80
69
  }
81
70
  ),
82
71
  estimateGasInERC20: async (args: EstimateGasInERC20Parameters) =>
@@ -11,14 +11,13 @@ import {
11
11
  import {
12
12
  type PaymasterActions,
13
13
  type SmartAccount,
14
- entryPoint07Address,
15
14
  paymasterActions
16
15
  } from "viem/account-abstraction"
17
- import type {
18
- EntryPointType,
19
- ZeroDevPaymasterRpcSchema
20
- } from "../types/kernel.js"
21
- import { zerodevPaymasterActions } from "./decorators/kernel.js"
16
+ import type { ZeroDevPaymasterRpcSchema } from "../types/kernel.js"
17
+ import {
18
+ type ZeroDevPaymasterClientActions,
19
+ zerodevPaymasterActions
20
+ } from "./decorators/kernel.js"
22
21
 
23
22
  export type ZeroDevPaymasterClient<
24
23
  entryPointVersion extends "0.6" | "0.7" = "0.7",
@@ -40,12 +39,11 @@ export type ZeroDevPaymasterClient<
40
39
  rpcSchema extends RpcSchema
41
40
  ? [...ZeroDevPaymasterRpcSchema<entryPointVersion>, ...rpcSchema]
42
41
  : ZeroDevPaymasterRpcSchema<entryPointVersion>,
43
- PaymasterActions
42
+ PaymasterActions & ZeroDevPaymasterClientActions
44
43
  >
45
44
  >
46
45
 
47
46
  export type ZeroDevPaymasterClientConfig<
48
- entryPointVersion extends "0.6" | "0.7" = "0.7" | "0.6",
49
47
  transport extends Transport = Transport,
50
48
  chain extends Chain | undefined = Chain | undefined,
51
49
  account extends SmartAccount | undefined = SmartAccount | undefined,
@@ -62,9 +60,7 @@ export type ZeroDevPaymasterClientConfig<
62
60
  | "rpcSchema"
63
61
  | "transport"
64
62
  >
65
- > & {
66
- entryPoint?: EntryPointType<entryPointVersion>
67
- }
63
+ >
68
64
  /**
69
65
  * Creates a ZeroDev-specific Paymaster Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
70
66
  *
@@ -88,7 +84,6 @@ export const createZeroDevPaymasterClient = (
88
84
  const {
89
85
  key = "public",
90
86
  name = "ZeroDev Paymaster Client",
91
- entryPoint,
92
87
  transport
93
88
  } = parameters
94
89
  const client = createClient({
@@ -103,10 +98,5 @@ export const createZeroDevPaymasterClient = (
103
98
  name,
104
99
  type: "zerodevPaymasterClient"
105
100
  })
106
- return client.extend(paymasterActions).extend(
107
- zerodevPaymasterActions({
108
- address: entryPoint?.address ?? entryPoint07Address,
109
- version: entryPoint?.version ?? "0.7"
110
- })
111
- )
101
+ return client.extend(paymasterActions).extend(zerodevPaymasterActions())
112
102
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "5.4.0-beta.2",
3
+ "version": "5.4.0",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",