@zerodev/sdk 5.3.22 → 5.3.23

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,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimateGasInERC20 = exports.changeSudoValidator = exports.uninstallPlugin = exports.getUserOperationGasPrice = exports.signUserOperation = exports.sponsorUserOperation = void 0;
3
+ exports.sponsorUserOperationEip7677 = exports.estimateGasInERC20 = exports.changeSudoValidator = exports.uninstallPlugin = exports.getUserOperationGasPrice = exports.signUserOperation = exports.sponsorUserOperation = void 0;
4
4
  var sponsorUserOperation_js_1 = require("./paymaster/sponsorUserOperation.js");
5
5
  Object.defineProperty(exports, "sponsorUserOperation", { enumerable: true, get: function () { return sponsorUserOperation_js_1.sponsorUserOperation; } });
6
6
  var signUserOperation_js_1 = require("./account-client/signUserOperation.js");
@@ -13,4 +13,6 @@ var changeSudoValidator_js_1 = require("./account-client/changeSudoValidator.js"
13
13
  Object.defineProperty(exports, "changeSudoValidator", { enumerable: true, get: function () { return changeSudoValidator_js_1.changeSudoValidator; } });
14
14
  var estimateGasInERC20_js_1 = require("./paymaster/estimateGasInERC20.js");
15
15
  Object.defineProperty(exports, "estimateGasInERC20", { enumerable: true, get: function () { return estimateGasInERC20_js_1.estimateGasInERC20; } });
16
+ var sponsorUserOperationEip7677_js_1 = require("./paymaster/sponsorUserOperationEip7677.js");
17
+ Object.defineProperty(exports, "sponsorUserOperationEip7677", { enumerable: true, get: function () { return sponsorUserOperationEip7677_js_1.sponsorUserOperationEip7677; } });
16
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAAA,+EAI4C;AAHxC,+HAAA,oBAAoB,OAAA;AAKxB,8EAI8C;AAH1C,yHAAA,iBAAiB,OAAA;AAKrB,4FAGqD;AAFjD,uIAAA,wBAAwB,OAAA;AAI5B,0EAG4C;AAFxC,qHAAA,eAAe,OAAA;AAInB,kFAGgD;AAF5C,6HAAA,mBAAmB,OAAA;AAIvB,2EAI0C;AAHtC,2HAAA,kBAAkB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":";;;AAAA,+EAI4C;AAHxC,+HAAA,oBAAoB,OAAA;AAKxB,8EAI8C;AAH1C,yHAAA,iBAAiB,OAAA;AAKrB,4FAGqD;AAFjD,uIAAA,wBAAwB,OAAA;AAI5B,0EAG4C;AAFxC,qHAAA,eAAe,OAAA;AAInB,kFAGgD;AAF5C,6HAAA,mBAAmB,OAAA;AAIvB,2EAI0C;AAHtC,2HAAA,kBAAkB,OAAA;AAKtB,6FAImD;AAD/C,6IAAA,2BAA2B,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":";;;AAAA,mDAAqD;AAMrD,gDAAkD;AA0D3C,MAAM,oBAAoB,GAAG,KAAK,EACrC,MAA0C,EAC1C,IAAgD,EACG,EAAE;IACrD,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,mBAAW,EAAC,IAAI,CAAC,aAAa,CAAC;gBACvC,iBAAiB,EAAE,IAAI,CAAC,UAAU;gBAClC,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,IAAI,IAAI;aAC5C;SACJ;KACJ,CAAC,CAAA;IACF,MAAM,iBAAiB,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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,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpE,oBAAoB,EAChB,QAAQ,CAAC,oBAAoB;YAC7B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACE,CAAA;AACnD,CAAC,CAAA;AA7DY,QAAA,oBAAoB,wBA6DhC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sponsorUserOperationEip7677 = void 0;
4
+ const permissionless_1 = require("permissionless");
5
+ const experimental_1 = require("permissionless/experimental");
6
+ const sponsorUserOperationEip7677 = async (client, args, bundlerClient, stateOverrides) => {
7
+ const { entryPoint: entryPointAddress, userOperation } = args;
8
+ const chain = client.chain;
9
+ const paymasterClient = client.extend((0, experimental_1.paymasterActionsEip7677)(entryPointAddress));
10
+ const stubData = await paymasterClient.getPaymasterStubData({
11
+ userOperation: userOperation,
12
+ chain
13
+ });
14
+ const stubUserOperation = {
15
+ ...userOperation,
16
+ ...stubData
17
+ };
18
+ const gas = (await bundlerClient.estimateUserOperationGas({
19
+ userOperation: stubUserOperation
20
+ }, stateOverrides));
21
+ const userOperationWithGas = {
22
+ ...stubUserOperation,
23
+ callGasLimit: gas.callGasLimit,
24
+ verificationGasLimit: gas.verificationGasLimit,
25
+ preVerificationGas: gas.preVerificationGas
26
+ };
27
+ const paymasterData = await paymasterClient.getPaymasterData({
28
+ userOperation: userOperationWithGas,
29
+ chain
30
+ });
31
+ if (entryPointAddress === permissionless_1.ENTRYPOINT_ADDRESS_V06) {
32
+ const paymasterDataV06 = paymasterData;
33
+ return {
34
+ callGasLimit: BigInt(gas.callGasLimit),
35
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
36
+ preVerificationGas: BigInt(gas.preVerificationGas),
37
+ paymasterAndData: paymasterDataV06?.paymasterAndData,
38
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
39
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
40
+ };
41
+ }
42
+ const stubDataV07 = stubData;
43
+ const paymasterDataV07 = paymasterData;
44
+ return {
45
+ callGasLimit: BigInt(gas.callGasLimit),
46
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
47
+ preVerificationGas: BigInt(gas.preVerificationGas),
48
+ paymaster: paymasterDataV07.paymaster,
49
+ paymasterData: paymasterDataV07.paymasterData,
50
+ paymasterVerificationGasLimit: stubDataV07.paymasterVerificationGasLimit &&
51
+ BigInt(stubDataV07.paymasterVerificationGasLimit),
52
+ paymasterPostOpGasLimit: stubDataV07?.paymasterPostOpGasLimit &&
53
+ BigInt(stubDataV07.paymasterPostOpGasLimit),
54
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
55
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
56
+ };
57
+ };
58
+ exports.sponsorUserOperationEip7677 = sponsorUserOperationEip7677;
59
+ //# sourceMappingURL=sponsorUserOperationEip7677.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorUserOperationEip7677.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperationEip7677.ts"],"names":[],"mappings":";;;AAAA,mDAKuB;AACvB,8DAMoC;AA+D7B,MAAM,2BAA2B,GAAG,KAAK,EAG5C,MAA0C,EAC1C,IAAuD,EACvD,aAAwC,EACxC,cAA+B,EAC2B,EAAE;IAC5D,MAAM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AC;SACd,CAAA;IAC1D,CAAC;IACD,MAAM,WAAW,GACb,QAAuE,CAAA;IAC3E,MAAM,gBAAgB,GAClB,aAAwE,CAAA;IAE5E,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;QACtC,oBAAoB,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAClD,SAAS,EAAE,gBAAgB,CAAC,SAAS;QACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa;QAC7C,6BAA6B,EACzB,WAAW,CAAC,6BAA6B;YACzC,MAAM,CAAC,WAAW,CAAC,6BAA6B,CAAC;QACrD,uBAAuB,EACnB,WAAW,EAAE,uBAAuB;YACpC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QAC/C,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;QAChD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC;KACd,CAAA;AAC1D,CAAC,CAAA;AA5EY,QAAA,2BAA2B,+BA4EvC"}
@@ -13,7 +13,8 @@ const zerodevPaymasterActions = (entryPointAddress) => (client) => ({
13
13
  ...args,
14
14
  entryPoint: entryPointAddress
15
15
  }),
16
- estimateGasInERC20: async (args) => (0, estimateGasInERC20_js_1.estimateGasInERC20)(client, args)
16
+ estimateGasInERC20: async (args) => (0, estimateGasInERC20_js_1.estimateGasInERC20)(client, args),
17
+ sponsorUserOperationEip7677: async (args, bundlerClient, stateOverrides) => (0, index_js_1.sponsorUserOperationEip7677)(client, args, bundlerClient, stateOverrides)
17
18
  });
18
19
  exports.zerodevPaymasterActions = zerodevPaymasterActions;
19
20
  function kernelAccountClientActions({ middleware }) {
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":";;;AAAA,mDAA8E;AAK9E,oHAGsE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KAAK,EAAE,IAAI,EAAE,EAAE,CAC1C,IAAA,gEAA6B,EAAC,MAAM,EAAE;YAClC,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;KACT,CAAC,CAAA;AACN,CAAC;AAjFD,gEAiFC"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":";;;AAAA,mDAIuB;AAMvB,oHAGsE;AACtE,0GAGiE;AACjE,wFAGwD;AASxD,qDAK+B;AAC/B,yFAIsD;AACtD,6FAIwD;AAoBjD,MAAM,uBAAuB,GAChC,CAAgC,iBAA6B,EAAE,EAAE,CACjE,CAAC,MAAc,EAA6C,EAAE,CAAC,CAAC;IAC5D,oBAAoB,EAAE,KAAK,EACvB,IAAoE,EACtE,EAAE,CACA,IAAA,8CAAoB,EAChB,MAA4C,EAC5C;QACI,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CACJ;IACL,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,IAAA,0CAAkB,EACd,MAA4C,EAC5C,IAAI,CACP;IACL,2BAA2B,EAAE,KAAK,EAC9B,IAAuD,EACvD,aAAwC,EACxC,cAA+B,EACjC,EAAE,CACA,IAAA,sCAA2B,EACvB,MAA4C,EAC5C,IAAI,EACJ,aAAa,EACb,cAAc,CACjB;CACR,CAAC,CAAA;AA7BO,QAAA,uBAAuB,2BA6B9B;AA4GN,SAAgB,0BAA0B,CAAgC,EACtE,UAAU,EACW;IACrB,OAAO,CASH,MAAiD,EAMnD,EAAE,CAAC,CAAC;QACF,GAAG,IAAA,oCAAmB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,IAAA,4BAAiB,EACb,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,IAAA,0BAAe,EACX,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAChC,IAAA,8BAAmB,EACf,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,IAAA,oCAAe,EAAC,MAAM,EAAE;YACpB,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;QACN,6BAA6B,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC1C,IAAA,gEAA6B,EAAC,MAAM,EAAE;YAClC,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;KACT,CAAC,CAAA;AACN,CAAC;AAjFD,gEAiFC"}
@@ -4,4 +4,5 @@ export { getUserOperationGasPrice } from "./account-client/getUserOperationGasPr
4
4
  export { uninstallPlugin } from "./account-client/uninstallPlugin.js";
5
5
  export { changeSudoValidator } from "./account-client/changeSudoValidator.js";
6
6
  export { estimateGasInERC20 } from "./paymaster/estimateGasInERC20.js";
7
+ export { sponsorUserOperationEip7677 } from "./paymaster/sponsorUserOperationEip7677.js";
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EAE3B,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EAElB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,mBAAmB,EAEtB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EAGvB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EAGpB,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EAE3B,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EAElB,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,mBAAmB,EAEtB,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EAGH,2BAA2B,EAC9B,MAAM,4CAA4C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAMrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAuDlD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,EACrC,MAA0C,EAC1C,IAAgD,EACG,EAAE;IACrD,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,IAAI,CAAC,aAAa,CAAC;gBACvC,iBAAiB,EAAE,IAAI,CAAC,UAAU;gBAClC,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,IAAI,IAAI;aAC5C;SACJ;KACJ,CAAC,CAAA;I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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,IAAI,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpE,oBAAoB,EAChB,QAAQ,CAAC,oBAAoB;YAC7B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACE,CAAA;AACnD,CAAC,CAAA"}
@@ -0,0 +1,58 @@
1
+ import { ENTRYPOINT_ADDRESS_V06 } from "permissionless";
2
+ import { paymasterActionsEip7677 } from "permissionless/experimental";
3
+ /**
4
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
5
+ */
6
+ export const sponsorUserOperationEip7677 = async (client, args, bundlerClient, stateOverrides) => {
7
+ const { entryPoint: entryPointAddress, userOperation } = args;
8
+ const chain = client.chain;
9
+ const paymasterClient = client.extend(paymasterActionsEip7677(entryPointAddress));
10
+ const stubData = await paymasterClient.getPaymasterStubData({
11
+ userOperation: userOperation,
12
+ chain
13
+ });
14
+ const stubUserOperation = {
15
+ ...userOperation,
16
+ ...stubData
17
+ };
18
+ const gas = (await bundlerClient.estimateUserOperationGas({
19
+ userOperation: stubUserOperation
20
+ }, stateOverrides));
21
+ const userOperationWithGas = {
22
+ ...stubUserOperation,
23
+ callGasLimit: gas.callGasLimit,
24
+ verificationGasLimit: gas.verificationGasLimit,
25
+ preVerificationGas: gas.preVerificationGas
26
+ };
27
+ const paymasterData = await paymasterClient.getPaymasterData({
28
+ userOperation: userOperationWithGas,
29
+ chain
30
+ });
31
+ if (entryPointAddress === ENTRYPOINT_ADDRESS_V06) {
32
+ const paymasterDataV06 = paymasterData;
33
+ return {
34
+ callGasLimit: BigInt(gas.callGasLimit),
35
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
36
+ preVerificationGas: BigInt(gas.preVerificationGas),
37
+ paymasterAndData: paymasterDataV06?.paymasterAndData,
38
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
39
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
40
+ };
41
+ }
42
+ const stubDataV07 = stubData;
43
+ const paymasterDataV07 = paymasterData;
44
+ return {
45
+ callGasLimit: BigInt(gas.callGasLimit),
46
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
47
+ preVerificationGas: BigInt(gas.preVerificationGas),
48
+ paymaster: paymasterDataV07.paymaster,
49
+ paymasterData: paymasterDataV07.paymasterData,
50
+ paymasterVerificationGasLimit: stubDataV07.paymasterVerificationGasLimit &&
51
+ BigInt(stubDataV07.paymasterVerificationGasLimit),
52
+ paymasterPostOpGasLimit: stubDataV07?.paymasterPostOpGasLimit &&
53
+ BigInt(stubDataV07.paymasterPostOpGasLimit),
54
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
55
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
56
+ };
57
+ };
58
+ //# sourceMappingURL=sponsorUserOperationEip7677.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorUserOperationEip7677.js","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperationEip7677.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,sBAAsB,EAGzB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAKH,uBAAuB,EAC1B,MAAM,6BAA6B,CAAA;AA4DpC;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,KAAK,EAG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AC,YAAY,CAAC;YAChD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC;SACd,CAAA;IAC1D,CAAC;IACD,MAAM,WAAW,GACb,QAAuE,CAAA;IAC3E,MAAM,gBAAgB,GAClB,aAAwE,CAAA;IAE5E,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC;QACtC,oBAAoB,EAAE,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC;QACtD,kBAAkB,EAAE,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC;QAClD,SAAS,EAAE,gBAAgB,CAAC,SAAS;QACrC,aAAa,EAAE,gBAAgB,CAAC,aAAa;QAC7C,6BAA6B,EACzB,WAAW,CAAC,6BAA6B;YACzC,MAAM,CAAC,WAAW,CAAC,6BAA6B,CAAC;QACrD,uBAAuB,EACnB,WAAW,EAAE,uBAAuB;YACpC,MAAM,CAAC,WAAW,CAAC,uBAAuB,CAAC;QAC/C,YAAY,EAAE,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC;QAChD,oBAAoB,EAAE,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC;KACd,CAAA;AAC1D,CAAC,CAAA"}
@@ -2,7 +2,7 @@ import { smartAccountActions } from "permissionless";
2
2
  import { getKernelV3ModuleCurrentNonce } from "../../actions/account-client/getKernelV3ModuleCurrentNonce.js";
3
3
  import { getUserOperationGasPrice } from "../../actions/account-client/getUserOperationGasPrice.js";
4
4
  import { invalidateNonce } from "../../actions/account-client/invalidateNonce.js";
5
- import { changeSudoValidator, signUserOperation, uninstallPlugin } from "../../actions/index.js";
5
+ import { changeSudoValidator, signUserOperation, sponsorUserOperationEip7677, uninstallPlugin } from "../../actions/index.js";
6
6
  import { estimateGasInERC20 } from "../../actions/paymaster/estimateGasInERC20.js";
7
7
  import { sponsorUserOperation } from "../../actions/paymaster/sponsorUserOperation.js";
8
8
  export const zerodevPaymasterActions = (entryPointAddress) => (client) => ({
@@ -10,7 +10,8 @@ export const zerodevPaymasterActions = (entryPointAddress) => (client) => ({
10
10
  ...args,
11
11
  entryPoint: entryPointAddress
12
12
  }),
13
- estimateGasInERC20: async (args) => estimateGasInERC20(client, args)
13
+ estimateGasInERC20: async (args) => estimateGasInERC20(client, args),
14
+ sponsorUserOperationEip7677: async (args, bundlerClient, stateOverrides) => sponsorUserOperationEip7677(client, args, bundlerClient, stateOverrides)
14
15
  });
15
16
  export function kernelAccountClientActions({ middleware }) {
16
17
  return (client) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAK9E,OAAO,EAEH,6BAA6B,EAChC,MAAM,+DAA+D,CAAA;AACtE,OAAO,EAEH,wBAAwB,EAC3B,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAEH,eAAe,EAClB,MAAM,iDAAiD,CAAA;AAOxD,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EAClB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGH,kBAAkB,EACrB,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAGH,oBAAoB,EACvB,MAAM,iDAAiD,CAAA;AAexD,MAAM,CAAC,MAAM,uBAAuB,GAChC,CAAgC,iBAA6B,EAAE,EAAE,CACjE,CAAC,MAAc,EAA6C,EAAE,CAAC,CAAC;IAC5D,oBAAoB,EAAE,KAAK,EACvB,IAAoE,EACtE,EAAE,CACA,oBAAoB,CAChB,MAA4C,EAC5C;QACI,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CACJ;IACL,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,kBAAkB,CACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AA4GN,MAAM,UAAU,0BAA0B,CAAgC,EACtE,UAAU,EACW;IACrB,OAAO,CASH,MAAiD,EAMnD,EAAE,CAAC,CAAC;QACF,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;QAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,iBAAiB,CACb,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC;QACtE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,eAAe,CACX,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,mBAAmB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAChC,mBAAmB,CACf,MAAM,EACN;YACI,GAAG,IAAI;YACP,UAAU;SAMb,CACJ;QACL,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC5B,eAAe,CAAC,MAAM,EAAE;YACpB,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;QACN,6BAA6B,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC1C,6BAA6B,CAAC,MAAM,EAAE;YAClC,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;KACT,CAAC,CAAA;AACN,CAAC"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,mBAAmB,EACtB,MAAM,gBAAgB,CAAA;AAMvB,OAAO,EAEH,6BAA6B,EAChC,MAAM,+DAA+D,CAAA;AACtE,OAAO,EAEH,wBAAwB,EAC3B,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAEH,eAAe,EAClB,MAAM,iDAAiD,CAAA;AASxD,OAAO,EACH,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,eAAe,EAClB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGH,kBAAkB,EACrB,MAAM,+CAA+C,CAAA;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;YACpB,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;QACN,6BAA6B,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAC1C,6BAA6B,CAAC,MAAM,EAAE;YAClC,GAAG,IAAI;YACP,UAAU;SAMb,CAAC;KACT,CAAC,CAAA;AACN,CAAC"}
@@ -4,4 +4,5 @@ export { getUserOperationGasPrice, type GetUserOperationGasPriceReturnType } fro
4
4
  export { uninstallPlugin, type UninstallPluginParameters } from "./account-client/uninstallPlugin.js";
5
5
  export { changeSudoValidator, type ChangeSudoValidatorParameters } from "./account-client/changeSudoValidator.js";
6
6
  export { estimateGasInERC20, type EstimateGasInERC20Parameters, type EstimateGasInERC20ReturnType } from "./paymaster/estimateGasInERC20.js";
7
+ export { type SponsorUserOperationEip7677Parameters, type SponsorUserOperationEip7677ReturnType, sponsorUserOperationEip7677 } from "./paymaster/sponsorUserOperationEip7677.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACtC,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EACjB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACnC,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EACxB,KAAK,kCAAkC,EAC1C,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EACf,KAAK,yBAAyB,EACjC,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EACrC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACpC,MAAM,mCAAmC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,oBAAoB,EACpB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACtC,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,iBAAiB,EACjB,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EACnC,MAAM,uCAAuC,CAAA;AAE9C,OAAO,EACH,wBAAwB,EACxB,KAAK,kCAAkC,EAC1C,MAAM,8CAA8C,CAAA;AAErD,OAAO,EACH,eAAe,EACf,KAAK,yBAAyB,EACjC,MAAM,qCAAqC,CAAA;AAE5C,OAAO,EACH,mBAAmB,EACnB,KAAK,6BAA6B,EACrC,MAAM,yCAAyC,CAAA;AAEhD,OAAO,EACH,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACpC,MAAM,mCAAmC,CAAA;AAE1C,OAAO,EACH,KAAK,qCAAqC,EAC1C,KAAK,qCAAqC,EAC1C,2BAA2B,EAC9B,MAAM,4CAA4C,CAAA"}
@@ -1,3 +1,4 @@
1
+ import type { PartialPick } from "permissionless/types";
1
2
  import type { ENTRYPOINT_ADDRESS_V06_TYPE, EntryPoint } from "permissionless/types/entrypoint";
2
3
  import type { UserOperation } from "permissionless/types/userOperation.js";
3
4
  import type { Hex } from "viem";
@@ -10,7 +11,6 @@ export type SponsorUserOperationParameters<entryPoint extends EntryPoint> = {
10
11
  shouldOverrideFee?: boolean;
11
12
  shouldConsume?: boolean;
12
13
  };
13
- export type PartialPick<T, K extends keyof T> = Partial<Pick<T, K>>;
14
14
  export type SponsorUserOperationReturnType<entryPoint extends EntryPoint> = entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? Pick<UserOperation<"v0.6">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterAndData"> & PartialPick<UserOperation<"v0.6">, "maxFeePerGas" | "maxPriorityFeePerGas"> : Pick<UserOperation<"v0.7">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData"> & PartialPick<UserOperation<"v0.7">, "maxFeePerGas" | "maxPriorityFeePerGas">;
15
15
  /**
16
16
  * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
@@ -1 +1 @@
1
- {"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACR,2BAA2B,EAC3B,UAAU,EACb,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAE1E,OAAO,KAAK,EAAW,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAE9E,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IAAI;IACxE,aAAa,EAAE,UAAU,SAAS,2BAA2B,GACvD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE,GACD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;IACP,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAEnE,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IACpE,UAAU,SAAS,2BAA2B,GACxC,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,kBAAkB,CACvB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,GACL,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,WAAW,GACX,+BAA+B,GAC/B,yBAAyB,GACzB,eAAe,CACpB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,CAAA;AAEf;;GAEG;AACH,eAAO,MAAM,oBAAoB,sLA6DhC,CAAA"}
1
+ {"version":3,"file":"sponsorUserOperation.d.ts","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EACR,2BAA2B,EAC3B,UAAU,EACb,MAAM,iCAAiC,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAE1E,OAAO,KAAK,EAAW,GAAG,EAAE,MAAM,MAAM,CAAA;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAE9E,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IAAI;IACxE,aAAa,EAAE,UAAU,SAAS,2BAA2B,GACvD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE,GACD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;IACP,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,CAAC,EAAE,GAAG,CAAA;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,8BAA8B,CAAC,UAAU,SAAS,UAAU,IACpE,UAAU,SAAS,2BAA2B,GACxC,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,kBAAkB,CACvB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,GACL,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,WAAW,GACX,+BAA+B,GAC/B,yBAAyB,GACzB,eAAe,CACpB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,CAAA;AAEf;;GAEG;AACH,eAAO,MAAM,oBAAoB,sLA6DhC,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { type BundlerClient } from "permissionless";
2
+ import type { ENTRYPOINT_ADDRESS_V06_TYPE, EntryPoint, PartialPick } from "permissionless/types";
3
+ import type { StateOverrides } from "permissionless/types/bundler";
4
+ import type { UserOperation } from "permissionless/types/userOperation.js";
5
+ import type { PartialBy } from "viem/types/utils";
6
+ import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js";
7
+ export type SponsorUserOperationEip7677Parameters<entryPoint extends EntryPoint> = {
8
+ userOperation: entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? PartialBy<UserOperation<"v0.6">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit"> : PartialBy<UserOperation<"v0.7">, "callGasLimit" | "preVerificationGas" | "verificationGasLimit" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit">;
9
+ entryPoint: entryPoint;
10
+ };
11
+ export type SponsorUserOperationEip7677ReturnType<entryPoint extends EntryPoint> = entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? Pick<UserOperation<"v0.6">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymasterAndData"> & PartialPick<UserOperation<"v0.6">, "maxFeePerGas" | "maxPriorityFeePerGas"> : Pick<UserOperation<"v0.7">, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData"> & PartialPick<UserOperation<"v0.7">, "maxFeePerGas" | "maxPriorityFeePerGas">;
12
+ /**
13
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
14
+ */
15
+ export declare const sponsorUserOperationEip7677: <entryPoint extends EntryPoint>(client: ZeroDevPaymasterClient<entryPoint>, args: SponsorUserOperationEip7677Parameters<entryPoint>, bundlerClient: BundlerClient<entryPoint>, stateOverrides?: StateOverrides) => Promise<SponsorUserOperationEip7677ReturnType<entryPoint>>;
16
+ //# sourceMappingURL=sponsorUserOperationEip7677.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorUserOperationEip7677.d.ts","sourceRoot":"","sources":["../../../actions/paymaster/sponsorUserOperationEip7677.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,aAAa,EAIrB,MAAM,gBAAgB,CAAA;AAQvB,OAAO,KAAK,EACR,2BAA2B,EAE3B,UAAU,EACV,WAAW,EACd,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAE9E,MAAM,MAAM,qCAAqC,CAC7C,UAAU,SAAS,UAAU,IAC7B;IACA,aAAa,EAAE,UAAU,SAAS,2BAA2B,GACvD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CACjE,GACD,SAAS,CACL,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;IACP,UAAU,EAAE,UAAU,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qCAAqC,CAC7C,UAAU,SAAS,UAAU,IAC7B,UAAU,SAAS,2BAA2B,GAC5C,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,kBAAkB,CACvB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,GACL,IAAI,CACA,aAAa,CAAC,MAAM,CAAC,EACnB,cAAc,GACd,sBAAsB,GACtB,oBAAoB,GACpB,WAAW,GACX,+BAA+B,GAC/B,yBAAyB,GACzB,eAAe,CACpB,GACG,WAAW,CACP,aAAa,CAAC,MAAM,CAAC,EACrB,cAAc,GAAG,sBAAsB,CAC1C,CAAA;AAEX;;GAEG;AACH,eAAO,MAAM,2BAA2B,kMAMnB,cAAc,+DAsElC,CAAA"}
@@ -1,12 +1,13 @@
1
- import { type SmartAccountActions } from "permissionless";
1
+ import { type BundlerClient, type SmartAccountActions } from "permissionless";
2
2
  import type { Middleware } from "permissionless/actions/smartAccount";
3
3
  import type { EntryPoint, Prettify } from "permissionless/types";
4
+ import type { StateOverrides } from "permissionless/types/bundler";
4
5
  import type { Chain, Client, Hash, Transport } from "viem";
5
6
  import type { KernelSmartAccount } from "../../accounts/index.js";
6
7
  import { type GetKernelV3ModuleCurrentNonceParameters } from "../../actions/account-client/getKernelV3ModuleCurrentNonce.js";
7
8
  import { type GetUserOperationGasPriceReturnType } from "../../actions/account-client/getUserOperationGasPrice.js";
8
9
  import { type InvalidateNonceParameters } from "../../actions/account-client/invalidateNonce.js";
9
- import type { ChangeSudoValidatorParameters, SignUserOperationReturnType, UninstallPluginParameters } from "../../actions/index.js";
10
+ import type { ChangeSudoValidatorParameters, SignUserOperationReturnType, SponsorUserOperationEip7677Parameters, SponsorUserOperationEip7677ReturnType, UninstallPluginParameters } from "../../actions/index.js";
10
11
  import { signUserOperation } from "../../actions/index.js";
11
12
  import { type EstimateGasInERC20Parameters, type EstimateGasInERC20ReturnType } from "../../actions/paymaster/estimateGasInERC20.js";
12
13
  import { type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "../../actions/paymaster/sponsorUserOperation.js";
@@ -16,6 +17,7 @@ export type ZeroDevPaymasterClientActions<entryPoint extends EntryPoint> = {
16
17
  */
17
18
  sponsorUserOperation: (args: SponsorUserOperationParameters<entryPoint>) => Promise<SponsorUserOperationReturnType<entryPoint>>;
18
19
  estimateGasInERC20: (args: EstimateGasInERC20Parameters) => Promise<EstimateGasInERC20ReturnType>;
20
+ sponsorUserOperationEip7677: (args: SponsorUserOperationEip7677Parameters<entryPoint>, bundlerClient: BundlerClient<entryPoint>, stateOverrides?: StateOverrides) => Promise<SponsorUserOperationEip7677ReturnType<entryPoint>>;
19
21
  };
20
22
  export declare const zerodevPaymasterActions: <entryPoint extends EntryPoint>(entryPointAddress: entryPoint) => (client: Client) => ZeroDevPaymasterClientActions<entryPoint>;
21
23
  export type KernelAccountClientActions<entryPoint extends EntryPoint, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends KernelSmartAccount<entryPoint, TTransport, TChain> | undefined = KernelSmartAccount<entryPoint, TTransport, TChain> | undefined> = SmartAccountActions<entryPoint, TTransport, TChain, TSmartAccount> & {
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAuB,MAAM,gBAAgB,CAAA;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,K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AAe,EAAE,CACb,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAE5D,IAAI,EAAE,yBAAyB,CAC3B,UAAU,EACV,UAAU,EACV,MAAM,EACN,aAAa,EACb,cAAc,CACjB,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;OAGG;IACH,mBAAmB,EAAE,CACjB,IAAI,EAAE,6BAA6B,CAC/B,UAAU,EACV,UAAU,EACV,MAAM,EACN,aAAa,CAChB,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAElB;;;;;;;OAOG;IACH,eAAe,EAAE,CACb,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAE5D,IAAI,EAAE,yBAAyB,CAC3B,UAAU,EACV,UAAU,EACV,MAAM,EACN,aAAa,EACb,cAAc,CACjB,KACA,OAAO,CAAC,IAAI,CAAC,CAAA;IAClB;;;;;;;OAOG;IACH,6BAA6B,EAAE,CAC3B,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAE5D,IAAI,EAAE,uCAAuC,CACzC,UAAU,EACV,UAAU,EACV,MAAM,EACN,aAAa,EACb,cAAc,CACjB,KACA,OAAO,CAAC,MAAM,CAAC,CAAA;CACvB,CAAA;AAED,wBAAgB,0BAA0B,CAAC,UAAU,SAAS,UAAU,EAAE,EACtE,UAAU,EACb,EAAE,UAAU,CAAC,UAAU,CAAC,+WA+ExB"}
package/actions/index.ts CHANGED
@@ -30,3 +30,9 @@ export {
30
30
  type EstimateGasInERC20Parameters,
31
31
  type EstimateGasInERC20ReturnType
32
32
  } from "./paymaster/estimateGasInERC20.js"
33
+
34
+ export {
35
+ type SponsorUserOperationEip7677Parameters,
36
+ type SponsorUserOperationEip7677ReturnType,
37
+ sponsorUserOperationEip7677
38
+ } from "./paymaster/sponsorUserOperationEip7677.js"
@@ -1,4 +1,5 @@
1
1
  import { getEntryPointVersion } from "permissionless"
2
+ import type { PartialPick } from "permissionless/types"
2
3
  import type {
3
4
  ENTRYPOINT_ADDRESS_V06_TYPE,
4
5
  EntryPoint
@@ -29,8 +30,6 @@ export type SponsorUserOperationParameters<entryPoint extends EntryPoint> = {
29
30
  shouldConsume?: boolean
30
31
  }
31
32
 
32
- export type PartialPick<T, K extends keyof T> = Partial<Pick<T, K>>
33
-
34
33
  export type SponsorUserOperationReturnType<entryPoint extends EntryPoint> =
35
34
  entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
36
35
  ? Pick<
@@ -0,0 +1,152 @@
1
+ import {
2
+ type BundlerClient,
3
+ ENTRYPOINT_ADDRESS_V06,
4
+ type EstimateUserOperationGasParameters,
5
+ type EstimateUserOperationGasReturnType
6
+ } from "permissionless"
7
+ import {
8
+ type GetPaymasterDataParameters,
9
+ type GetPaymasterDataReturnType,
10
+ type GetPaymasterStubDataParameters,
11
+ type GetPaymasterStubDataReturnType,
12
+ paymasterActionsEip7677
13
+ } from "permissionless/experimental"
14
+ import type {
15
+ ENTRYPOINT_ADDRESS_V06_TYPE,
16
+ ENTRYPOINT_ADDRESS_V07_TYPE,
17
+ EntryPoint,
18
+ PartialPick
19
+ } from "permissionless/types"
20
+ import type { StateOverrides } from "permissionless/types/bundler"
21
+ import type { UserOperation } from "permissionless/types/userOperation.js"
22
+ import type { PartialBy } from "viem/types/utils"
23
+ import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js"
24
+
25
+ export type SponsorUserOperationEip7677Parameters<
26
+ entryPoint extends EntryPoint
27
+ > = {
28
+ userOperation: entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
29
+ ? PartialBy<
30
+ UserOperation<"v0.6">,
31
+ "callGasLimit" | "preVerificationGas" | "verificationGasLimit"
32
+ >
33
+ : PartialBy<
34
+ UserOperation<"v0.7">,
35
+ | "callGasLimit"
36
+ | "preVerificationGas"
37
+ | "verificationGasLimit"
38
+ | "paymasterVerificationGasLimit"
39
+ | "paymasterPostOpGasLimit"
40
+ >
41
+ entryPoint: entryPoint
42
+ }
43
+
44
+ export type SponsorUserOperationEip7677ReturnType<
45
+ entryPoint extends EntryPoint
46
+ > = entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE
47
+ ? Pick<
48
+ UserOperation<"v0.6">,
49
+ | "callGasLimit"
50
+ | "verificationGasLimit"
51
+ | "preVerificationGas"
52
+ | "paymasterAndData"
53
+ > &
54
+ PartialPick<
55
+ UserOperation<"v0.6">,
56
+ "maxFeePerGas" | "maxPriorityFeePerGas"
57
+ >
58
+ : Pick<
59
+ UserOperation<"v0.7">,
60
+ | "callGasLimit"
61
+ | "verificationGasLimit"
62
+ | "preVerificationGas"
63
+ | "paymaster"
64
+ | "paymasterVerificationGasLimit"
65
+ | "paymasterPostOpGasLimit"
66
+ | "paymasterData"
67
+ > &
68
+ PartialPick<
69
+ UserOperation<"v0.7">,
70
+ "maxFeePerGas" | "maxPriorityFeePerGas"
71
+ >
72
+
73
+ /**
74
+ * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation.
75
+ */
76
+ export const sponsorUserOperationEip7677 = async <
77
+ entryPoint extends EntryPoint
78
+ >(
79
+ client: ZeroDevPaymasterClient<entryPoint>,
80
+ args: SponsorUserOperationEip7677Parameters<entryPoint>,
81
+ bundlerClient: BundlerClient<entryPoint>,
82
+ stateOverrides?: StateOverrides
83
+ ): Promise<SponsorUserOperationEip7677ReturnType<entryPoint>> => {
84
+ const { entryPoint: entryPointAddress, userOperation } = args
85
+ const chain = client.chain
86
+ const paymasterClient = client.extend(
87
+ paymasterActionsEip7677(entryPointAddress)
88
+ )
89
+ const stubData = await paymasterClient.getPaymasterStubData({
90
+ userOperation: userOperation as GetPaymasterStubDataParameters<
91
+ entryPoint,
92
+ typeof chain
93
+ >["userOperation"],
94
+ chain
95
+ })
96
+ const stubUserOperation = {
97
+ ...userOperation,
98
+ ...stubData
99
+ }
100
+
101
+ const gas = (await bundlerClient.estimateUserOperationGas(
102
+ {
103
+ userOperation:
104
+ stubUserOperation as EstimateUserOperationGasParameters<entryPoint>["userOperation"]
105
+ },
106
+ stateOverrides
107
+ )) as EstimateUserOperationGasReturnType<entryPoint>
108
+ const userOperationWithGas = {
109
+ ...stubUserOperation,
110
+ callGasLimit: gas.callGasLimit,
111
+ verificationGasLimit: gas.verificationGasLimit,
112
+ preVerificationGas: gas.preVerificationGas
113
+ } as GetPaymasterDataParameters<entryPoint>["userOperation"]
114
+
115
+ const paymasterData = await paymasterClient.getPaymasterData({
116
+ userOperation: userOperationWithGas,
117
+ chain
118
+ })
119
+
120
+ if (entryPointAddress === ENTRYPOINT_ADDRESS_V06) {
121
+ const paymasterDataV06 =
122
+ paymasterData as GetPaymasterDataReturnType<ENTRYPOINT_ADDRESS_V06_TYPE>
123
+ return {
124
+ callGasLimit: BigInt(gas.callGasLimit),
125
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
126
+ preVerificationGas: BigInt(gas.preVerificationGas),
127
+ paymasterAndData: paymasterDataV06?.paymasterAndData,
128
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
129
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
130
+ } as SponsorUserOperationEip7677ReturnType<entryPoint>
131
+ }
132
+ const stubDataV07 =
133
+ stubData as GetPaymasterStubDataReturnType<ENTRYPOINT_ADDRESS_V07_TYPE>
134
+ const paymasterDataV07 =
135
+ paymasterData as GetPaymasterDataReturnType<ENTRYPOINT_ADDRESS_V07_TYPE>
136
+
137
+ return {
138
+ callGasLimit: BigInt(gas.callGasLimit),
139
+ verificationGasLimit: BigInt(gas.verificationGasLimit),
140
+ preVerificationGas: BigInt(gas.preVerificationGas),
141
+ paymaster: paymasterDataV07.paymaster,
142
+ paymasterData: paymasterDataV07.paymasterData,
143
+ paymasterVerificationGasLimit:
144
+ stubDataV07.paymasterVerificationGasLimit &&
145
+ BigInt(stubDataV07.paymasterVerificationGasLimit),
146
+ paymasterPostOpGasLimit:
147
+ stubDataV07?.paymasterPostOpGasLimit &&
148
+ BigInt(stubDataV07.paymasterPostOpGasLimit),
149
+ maxFeePerGas: BigInt(userOperation.maxFeePerGas),
150
+ maxPriorityFeePerGas: BigInt(userOperation.maxPriorityFeePerGas)
151
+ } as SponsorUserOperationEip7677ReturnType<entryPoint>
152
+ }
@@ -1,6 +1,11 @@
1
- import { type SmartAccountActions, smartAccountActions } from "permissionless"
1
+ import {
2
+ type BundlerClient,
3
+ type SmartAccountActions,
4
+ smartAccountActions
5
+ } from "permissionless"
2
6
  import type { Middleware } from "permissionless/actions/smartAccount"
3
7
  import type { EntryPoint, Prettify } from "permissionless/types"
8
+ import type { StateOverrides } from "permissionless/types/bundler"
4
9
  import type { Chain, Client, Hash, Transport } from "viem"
5
10
  import type { KernelSmartAccount } from "../../accounts/index.js"
6
11
  import {
@@ -19,11 +24,14 @@ import type {
19
24
  ChangeSudoValidatorParameters,
20
25
  SignUserOperationParameters,
21
26
  SignUserOperationReturnType,
27
+ SponsorUserOperationEip7677Parameters,
28
+ SponsorUserOperationEip7677ReturnType,
22
29
  UninstallPluginParameters
23
30
  } from "../../actions/index.js"
24
31
  import {
25
32
  changeSudoValidator,
26
33
  signUserOperation,
34
+ sponsorUserOperationEip7677,
27
35
  uninstallPlugin
28
36
  } from "../../actions/index.js"
29
37
  import {
@@ -48,6 +56,11 @@ export type ZeroDevPaymasterClientActions<entryPoint extends EntryPoint> = {
48
56
  estimateGasInERC20: (
49
57
  args: EstimateGasInERC20Parameters
50
58
  ) => Promise<EstimateGasInERC20ReturnType>
59
+ sponsorUserOperationEip7677: (
60
+ args: SponsorUserOperationEip7677Parameters<entryPoint>,
61
+ bundlerClient: BundlerClient<entryPoint>,
62
+ stateOverrides?: StateOverrides
63
+ ) => Promise<SponsorUserOperationEip7677ReturnType<entryPoint>>
51
64
  }
52
65
 
53
66
  export const zerodevPaymasterActions =
@@ -67,6 +80,17 @@ export const zerodevPaymasterActions =
67
80
  estimateGasInERC20(
68
81
  client as ZeroDevPaymasterClient<entryPoint>,
69
82
  args
83
+ ),
84
+ sponsorUserOperationEip7677: async (
85
+ args: SponsorUserOperationEip7677Parameters<entryPoint>,
86
+ bundlerClient: BundlerClient<entryPoint>,
87
+ stateOverrides?: StateOverrides
88
+ ) =>
89
+ sponsorUserOperationEip7677(
90
+ client as ZeroDevPaymasterClient<entryPoint>,
91
+ args,
92
+ bundlerClient,
93
+ stateOverrides
70
94
  )
71
95
  })
72
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "5.3.22",
3
+ "version": "5.3.23",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",