@zerodev/sdk 5.2.1-alpha-4 → 5.2.1-alpha-5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/_cjs/actions/account-client/getUserOperationGasPrice.js +15 -0
  2. package/_cjs/actions/account-client/getUserOperationGasPrice.js.map +1 -0
  3. package/_cjs/actions/index.js +3 -1
  4. package/_cjs/actions/index.js.map +1 -1
  5. package/_cjs/clients/decorators/kernel.js +3 -1
  6. package/_cjs/clients/decorators/kernel.js.map +1 -1
  7. package/_cjs/clients/kernelAccountClient.js +14 -1
  8. package/_cjs/clients/kernelAccountClient.js.map +1 -1
  9. package/_cjs/types/index.js.map +1 -1
  10. package/_cjs/types/kernel.js.map +1 -1
  11. package/_esm/actions/account-client/getUserOperationGasPrice.js +11 -0
  12. package/_esm/actions/account-client/getUserOperationGasPrice.js.map +1 -0
  13. package/_esm/actions/index.js +1 -0
  14. package/_esm/actions/index.js.map +1 -1
  15. package/_esm/clients/decorators/kernel.js +3 -1
  16. package/_esm/clients/decorators/kernel.js.map +1 -1
  17. package/_esm/clients/kernelAccountClient.js +14 -1
  18. package/_esm/clients/kernelAccountClient.js.map +1 -1
  19. package/_esm/types/index.js.map +1 -1
  20. package/_esm/types/kernel.js.map +1 -1
  21. package/_types/actions/account-client/getUserOperationGasPrice.d.ts +9 -0
  22. package/_types/actions/account-client/getUserOperationGasPrice.d.ts.map +1 -0
  23. package/_types/actions/index.d.ts +1 -0
  24. package/_types/actions/index.d.ts.map +1 -1
  25. package/_types/clients/decorators/kernel.d.ts +8 -1
  26. package/_types/clients/decorators/kernel.d.ts.map +1 -1
  27. package/_types/clients/kernelAccountClient.d.ts +12 -4
  28. package/_types/clients/kernelAccountClient.d.ts.map +1 -1
  29. package/_types/types/index.d.ts +1 -1
  30. package/_types/types/index.d.ts.map +1 -1
  31. package/_types/types/kernel.d.ts +21 -0
  32. package/_types/types/kernel.d.ts.map +1 -1
  33. package/actions/account-client/getUserOperationGasPrice.ts +26 -0
  34. package/actions/index.ts +5 -0
  35. package/clients/decorators/kernel.ts +15 -2
  36. package/clients/kernelAccountClient.ts +17 -1
  37. package/package.json +1 -1
  38. package/types/index.ts +3 -1
  39. package/types/kernel.ts +23 -0
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUserOperationGasPrice = void 0;
4
+ const getUserOperationGasPrice = async (client) => {
5
+ const gasPrice = await client.request({
6
+ method: "zd_getUserOperationGasPrice",
7
+ params: []
8
+ });
9
+ return {
10
+ maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
11
+ maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
12
+ };
13
+ };
14
+ exports.getUserOperationGasPrice = getUserOperationGasPrice;
15
+ //# sourceMappingURL=getUserOperationGasPrice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/account-client/getUserOperationGasPrice.ts"],"names":[],"mappings":";;;AASO,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAA2E,EACtB,EAAE;IACvD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACvE,CAAA;AACL,CAAC,CAAA;AAhBY,QAAA,wBAAwB,4BAgBpC"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimateGasInERC20 = exports.signUserOperation = exports.sponsorUserOperation = void 0;
3
+ exports.estimateGasInERC20 = 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");
7
7
  Object.defineProperty(exports, "signUserOperation", { enumerable: true, get: function () { return signUserOperation_js_1.signUserOperation; } });
8
+ var getUserOperationGasPrice_js_1 = require("./account-client/getUserOperationGasPrice.js");
9
+ Object.defineProperty(exports, "getUserOperationGasPrice", { enumerable: true, get: function () { return getUserOperationGasPrice_js_1.getUserOperationGasPrice; } });
8
10
  var estimateGasInERC20_js_1 = require("./paymaster/estimateGasInERC20.js");
9
11
  Object.defineProperty(exports, "estimateGasInERC20", { enumerable: true, get: function () { return estimateGasInERC20_js_1.estimateGasInERC20; } });
10
12
  //# 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,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,2EAI0C;AAHtC,2HAAA,kBAAkB,OAAA"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.kernelAccountClientActions = exports.zerodevPaymasterActions = void 0;
4
4
  const permissionless_1 = require("permissionless");
5
+ const getUserOperationGasPrice_js_1 = require("../../actions/account-client/getUserOperationGasPrice.js");
5
6
  const index_js_1 = require("../../actions/index.js");
6
7
  const estimateGasInERC20_js_1 = require("../../actions/paymaster/estimateGasInERC20.js");
7
8
  const sponsorUserOperation_js_1 = require("../../actions/paymaster/sponsorUserOperation.js");
@@ -18,7 +19,8 @@ const kernelAccountClientActions = ({ middleware }) => (client) => ({
18
19
  signUserOperation: (args) => (0, index_js_1.signUserOperation)(client, {
19
20
  ...args,
20
21
  middleware
21
- })
22
+ }),
23
+ getUserOperationGasPrice: async () => (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(client)
22
24
  });
23
25
  exports.kernelAccountClientActions = kernelAccountClientActions;
24
26
  //# sourceMappingURL=kernel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":";;;AAAA,mDAA8E;AAS9E,qDAA0D;AAC1D,yFAIsD;AACtD,6FAIwD;AAejD,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,EAAC,MAA4C,EAAE;QAC/D,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CAAC;IACN,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,IAAA,0CAAkB,EACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AAfO,QAAA,uBAAuB,2BAe9B;AA2BC,MAAM,0BAA0B,GACnC,CAAgC,EAAE,UAAU,EAA0B,EAAE,EAAE,CAC1E,CAOI,MAAiD,EACY,EAAE,CAAC,CAAC;IACjE,GAAG,IAAA,oCAAmB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,IAAA,4BAAiB,EACb,MAAM,EACN;QACI,GAAG,IAAI;QACP,UAAU;KAC6C,CAC9D;CACR,CAAC,CAAA;AApBO,QAAA,0BAA0B,8BAoBjC"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":";;;AAAA,mDAA8E;AAK9E,0GAGiE;AAKjE,qDAA0D;AAC1D,yFAIsD;AACtD,6FAIwD;AAejD,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,EAAC,MAA4C,EAAE;QAC/D,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CAAC;IACN,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,IAAA,0CAAkB,EACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AAfO,QAAA,uBAAuB,2BAe9B;AAmCC,MAAM,0BAA0B,GACnC,CAAgC,EAAE,UAAU,EAA0B,EAAE,EAAE,CAC1E,CAOI,MAAiD,EACY,EAAE,CAAC,CAAC;IACjE,GAAG,IAAA,oCAAmB,EAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,IAAA,4BAAiB,EACb,MAAM,EACN;QACI,GAAG,IAAI;QACP,UAAU;KAC6C,CAC9D;IACL,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC;CACzE,CAAC,CAAA;AArBO,QAAA,0BAA0B,8BAqBjC"}
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createKernelAccountClient = void 0;
4
+ const permissionless_1 = require("permissionless");
4
5
  const viem_1 = require("viem");
6
+ const getUserOperationGasPrice_js_1 = require("../actions/account-client/getUserOperationGasPrice.js");
5
7
  const kernel_js_1 = require("./decorators/kernel.js");
6
8
  const createKernelAccountClient = (parameters) => {
7
9
  const { key = "Account", name = "Kernel Account Client", bundlerTransport } = parameters;
@@ -12,8 +14,19 @@ const createKernelAccountClient = (parameters) => {
12
14
  transport: (opts) => bundlerTransport({ ...opts, retryCount: 0 }),
13
15
  type: "kernelAccountClient"
14
16
  });
17
+ let middleware = parameters.middleware;
18
+ if (!middleware ||
19
+ (typeof middleware !== "function" &&
20
+ !middleware.gasPrice &&
21
+ parameters.entryPoint === permissionless_1.ENTRYPOINT_ADDRESS_V07)) {
22
+ const gasPrice = () => (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(client);
23
+ middleware = {
24
+ ...middleware,
25
+ gasPrice
26
+ };
27
+ }
15
28
  return client.extend((0, kernel_js_1.kernelAccountClientActions)({
16
- middleware: parameters.middleware
29
+ middleware
17
30
  }));
18
31
  };
19
32
  exports.createKernelAccountClient = createKernelAccountClient;
@@ -1 +1 @@
1
- {"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":";;;AAIA,+BAMa;AAEb,sDAG+B;AAsCxB,MAAM,yBAAyB,GAAG,CAQrC,UAKC,EACiE,EAAE;IACpE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,uBAAuB,EAC9B,gBAAgB,EACnB,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACjE,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,sCAA0B,EAAC;QACvB,UAAU,EAAE,UAAU,CAAC,UAAU;KACpC,CAAC,CACiE,CAAA;AAC3E,CAAC,CAAA;AAjCY,QAAA,yBAAyB,6BAiCrC"}
1
+ {"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":";;;AAAA,mDAAuD;AAKvD,+BAMa;AAEb,uGAAgG;AAChG,sDAG+B;AAsCxB,MAAM,yBAAyB,GAAG,CAQrC,UAKC,EACiE,EAAE;IACpE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,uBAAuB,EAC9B,gBAAgB,EACnB,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,IAAA,mBAAY,EAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACjE,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAEF,IAAI,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;IAEtC,IACI,CAAC,UAAU;QACX,CAAC,OAAO,UAAU,KAAK,UAAU;YAC7B,CAAC,UAAU,CAAC,QAAQ;YACpB,UAAU,CAAC,UAAU,KAAK,uCAAsB,CAAC,EACvD,CAAC;QACC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,IAAA,sDAAwB,EAAC,MAAM,CAAC,CAAA;QACvD,UAAU,GAAG;YACT,GAAG,UAAU;YACb,QAAQ;SACX,CAAA;IACL,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAChB,IAAA,sCAA0B,EAAC;QACvB,UAAU;KACb,CAAC,CACiE,CAAA;AAC3E,CAAC,CAAA;AA/CY,QAAA,yBAAyB,6BA+CrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";;;AAWA,yCAA2C;AAAlC,0GAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":";;;AAaA,yCAA2C;AAAlC,0GAAA,aAAa,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":";;;AAwJA,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACzB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":";;;AA+KA,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACzB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
@@ -0,0 +1,11 @@
1
+ export const getUserOperationGasPrice = async (client) => {
2
+ const gasPrice = await client.request({
3
+ method: "zd_getUserOperationGasPrice",
4
+ params: []
5
+ });
6
+ return {
7
+ maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
8
+ maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
9
+ };
10
+ };
11
+ //# sourceMappingURL=getUserOperationGasPrice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationGasPrice.js","sourceRoot":"","sources":["../../../actions/account-client/getUserOperationGasPrice.ts"],"names":[],"mappings":"AASA,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,EAKzC,MAA2E,EACtB,EAAE;IACvD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;QAClC,MAAM,EAAE,6BAA6B;QACrC,MAAM,EAAE,EAAE;KACb,CAAC,CAAA;IAEF,OAAO;QACH,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,YAAY,CAAC;QACpD,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,oBAAoB,CAAC;KACvE,CAAA;AACL,CAAC,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export { sponsorUserOperation } from "./paymaster/sponsorUserOperation.js";
2
2
  export { signUserOperation } from "./account-client/signUserOperation.js";
3
+ export { getUserOperationGasPrice } from "./account-client/getUserOperationGasPrice.js";
3
4
  export { estimateGasInERC20 } from "./paymaster/estimateGasInERC20.js";
4
5
  //# 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,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,kBAAkB,EAGrB,MAAM,mCAAmC,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { smartAccountActions } from "permissionless";
2
2
  import {} from "permissionless/actions/smartAccount";
3
+ import { getUserOperationGasPrice } from "../../actions/account-client/getUserOperationGasPrice.js";
3
4
  import { signUserOperation } from "../../actions/index.js";
4
5
  import { estimateGasInERC20 } from "../../actions/paymaster/estimateGasInERC20.js";
5
6
  import { sponsorUserOperation } from "../../actions/paymaster/sponsorUserOperation.js";
@@ -15,6 +16,7 @@ export const kernelAccountClientActions = ({ middleware }) => (client) => ({
15
16
  signUserOperation: (args) => signUserOperation(client, {
16
17
  ...args,
17
18
  middleware
18
- })
19
+ }),
20
+ getUserOperationGasPrice: async () => getUserOperationGasPrice(client)
19
21
  });
20
22
  //# sourceMappingURL=kernel.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EAAmB,MAAM,qCAAqC,CAAA;AAOrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,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,CAAC,MAA4C,EAAE;QAC/D,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CAAC;IACN,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,kBAAkB,CACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AA2BN,MAAM,CAAC,MAAM,0BAA0B,GACnC,CAAgC,EAAE,UAAU,EAA0B,EAAE,EAAE,CAC1E,CAOI,MAAiD,EACY,EAAE,CAAC,CAAC;IACjE,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,iBAAiB,CACb,MAAM,EACN;QACI,GAAG,IAAI;QACP,UAAU;KAC6C,CAC9D;CACR,CAAC,CAAA"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../../clients/decorators/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAE9E,OAAO,EAAmB,MAAM,qCAAqC,CAAA;AAGrE,OAAO,EAEH,wBAAwB,EAC3B,MAAM,0DAA0D,CAAA;AAKjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,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,CAAC,MAA4C,EAAE;QAC/D,GAAG,IAAI;QACP,UAAU,EAAE,iBAAiB;KAChC,CAAC;IACN,kBAAkB,EAAE,KAAK,EAAE,IAAkC,EAAE,EAAE,CAC7D,kBAAkB,CACd,MAA4C,EAC5C,IAAI,CACP;CACR,CAAC,CAAA;AAmCN,MAAM,CAAC,MAAM,0BAA0B,GACnC,CAAgC,EAAE,UAAU,EAA0B,EAAE,EAAE,CAC1E,CAOI,MAAiD,EACY,EAAE,CAAC,CAAC;IACjE,GAAG,mBAAmB,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;IAC9C,iBAAiB,EAAE,CAAC,IAAI,EAAE,EAAE,CACxB,iBAAiB,CACb,MAAM,EACN;QACI,GAAG,IAAI;QACP,UAAU;KAC6C,CAC9D;IACL,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC;CACzE,CAAC,CAAA"}
@@ -1,5 +1,7 @@
1
+ import { ENTRYPOINT_ADDRESS_V07 } from "permissionless";
1
2
  import { createClient } from "viem";
2
3
  import {} from "../accounts/index.js";
4
+ import { getUserOperationGasPrice } from "../actions/account-client/getUserOperationGasPrice.js";
3
5
  import { kernelAccountClientActions } from "./decorators/kernel.js";
4
6
  export const createKernelAccountClient = (parameters) => {
5
7
  const { key = "Account", name = "Kernel Account Client", bundlerTransport } = parameters;
@@ -10,8 +12,19 @@ export const createKernelAccountClient = (parameters) => {
10
12
  transport: (opts) => bundlerTransport({ ...opts, retryCount: 0 }),
11
13
  type: "kernelAccountClient"
12
14
  });
15
+ let middleware = parameters.middleware;
16
+ if (!middleware ||
17
+ (typeof middleware !== "function" &&
18
+ !middleware.gasPrice &&
19
+ parameters.entryPoint === ENTRYPOINT_ADDRESS_V07)) {
20
+ const gasPrice = () => getUserOperationGasPrice(client);
21
+ middleware = {
22
+ ...middleware,
23
+ gasPrice
24
+ };
25
+ }
13
26
  return client.extend(kernelAccountClientActions({
14
- middleware: parameters.middleware
27
+ middleware
15
28
  }));
16
29
  };
17
30
  //# sourceMappingURL=kernelAccountClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAKH,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAA2B,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAEH,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAsC/B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAQrC,UAKC,EACiE,EAAE;IACpE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,uBAAuB,EAC9B,gBAAgB,EACnB,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACjE,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,MAAM,CAChB,0BAA0B,CAAC;QACvB,UAAU,EAAE,UAAU,CAAC,UAAU;KACpC,CAAC,CACiE,CAAA;AAC3E,CAAC,CAAA"}
1
+ {"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAA;AAKvD,OAAO,EAKH,YAAY,EACf,MAAM,MAAM,CAAA;AACb,OAAO,EAA2B,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uDAAuD,CAAA;AAChG,OAAO,EAEH,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAsC/B,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAQrC,UAKC,EACiE,EAAE;IACpE,MAAM,EACF,GAAG,GAAG,SAAS,EACf,IAAI,GAAG,uBAAuB,EAC9B,gBAAgB,EACnB,GAAG,UAAU,CAAA;IACd,MAAM,MAAM,GAAG,YAAY,CAAC;QACxB,GAAG,UAAU;QACb,GAAG;QACH,IAAI;QACJ,SAAS,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,gBAAgB,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACjE,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAEF,IAAI,UAAU,GAAG,UAAU,CAAC,UAAU,CAAA;IAEtC,IACI,CAAC,UAAU;QACX,CAAC,OAAO,UAAU,KAAK,UAAU;YAC7B,CAAC,UAAU,CAAC,QAAQ;YACpB,UAAU,CAAC,UAAU,KAAK,sBAAsB,CAAC,EACvD,CAAC;QACC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAA;QACvD,UAAU,GAAG;YACT,GAAG,UAAU;YACb,QAAQ;SACX,CAAA;IACL,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAChB,0BAA0B,CAAC;QACvB,UAAU;KACb,CAAC,CACiE,CAAA;AAC3E,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6C,MAAM,MAAM,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAgJhD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACzB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
1
+ {"version":3,"file":"kernel.js","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6C,MAAM,MAAM,CAAA;AAEhE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAuKhD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;AACzB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
@@ -0,0 +1,9 @@
1
+ import type { Account, Chain, Client, Transport } from "viem";
2
+ import type { Prettify } from "viem/chains";
3
+ import type { ZeroDevAccountClientRpcSchema } from "../../types/kernel.js";
4
+ export type GetUserOperationGasPriceReturnType = {
5
+ maxFeePerGas: bigint;
6
+ maxPriorityFeePerGas: bigint;
7
+ };
8
+ export declare const getUserOperationGasPrice: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined>(client: Client<TTransport, TChain, TAccount, ZeroDevAccountClientRpcSchema>) => Promise<Prettify<GetUserOperationGasPriceReturnType>>;
9
+ //# sourceMappingURL=getUserOperationGasPrice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserOperationGasPrice.d.ts","sourceRoot":"","sources":["../../../actions/account-client/getUserOperationGasPrice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AAC7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAA;AAE1E,MAAM,MAAM,kCAAkC,GAAG;IAC7C,YAAY,EAAE,MAAM,CAAA;IACpB,oBAAoB,EAAE,MAAM,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,wBAAwB,+OAMlC,QAAQ,SAAS,kCAAkC,CAAC,CAUtD,CAAA"}
@@ -1,4 +1,5 @@
1
1
  export { sponsorUserOperation, type SponsorUserOperationParameters, type SponsorUserOperationReturnType } from "./paymaster/sponsorUserOperation.js";
2
2
  export { signUserOperation, type SignUserOperationParameters, type SignUserOperationReturnType } from "./account-client/signUserOperation.js";
3
+ export { getUserOperationGasPrice, type GetUserOperationGasPriceReturnType } from "./account-client/getUserOperationGasPrice.js";
3
4
  export { estimateGasInERC20, type EstimateGasInERC20Parameters, type EstimateGasInERC20ReturnType } from "./paymaster/estimateGasInERC20.js";
4
5
  //# 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,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,kBAAkB,EAClB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EACpC,MAAM,mCAAmC,CAAA"}
@@ -1,8 +1,9 @@
1
1
  import { type SmartAccountActions } from "permissionless";
2
2
  import type { SmartAccount } from "permissionless/accounts/types";
3
3
  import { type Middleware } from "permissionless/actions/smartAccount";
4
- import type { EntryPoint } from "permissionless/types";
4
+ import type { EntryPoint, Prettify } from "permissionless/types";
5
5
  import type { Chain, Client, Transport } from "viem";
6
+ import { type GetUserOperationGasPriceReturnType } from "../../actions/account-client/getUserOperationGasPrice.js";
6
7
  import type { SignUserOperationReturnType } from "../../actions/index.js";
7
8
  import { signUserOperation } from "../../actions/index.js";
8
9
  import { type EstimateGasInERC20Parameters, type EstimateGasInERC20ReturnType } from "../../actions/paymaster/estimateGasInERC20.js";
@@ -23,6 +24,12 @@ export type KernelAccountClientActions<entryPoint extends EntryPoint, TChain ext
23
24
  * @returns A promise that resolves to the result of the signUserOperation function
24
25
  */
25
26
  signUserOperation: <TTransport extends Transport>(args: Parameters<typeof signUserOperation<entryPoint, TTransport, TChain, TSmartAccount>>[1]) => Promise<SignUserOperationReturnType>;
27
+ /**
28
+ * Returns the live gas prices that you can use to send a user operation.
29
+ *
30
+ * @returns maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
31
+ */
32
+ getUserOperationGasPrice: () => Promise<Prettify<GetUserOperationGasPriceReturnType>>;
26
33
  };
27
34
  export declare const kernelAccountClientActions: <entryPoint extends EntryPoint>({ middleware }: Middleware<entryPoint>) => <TTransport extends Transport, TChain extends Chain | undefined = Chain | undefined, TSmartAccount extends SmartAccount<entryPoint> | undefined = SmartAccount<entryPoint> | undefined>(client: Client<TTransport, TChain, TSmartAccount>) => KernelAccountClientActions<entryPoint, TChain, TSmartAccount>;
28
35
  //# sourceMappingURL=kernel.d.ts.map
@@ -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,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACpD,OAAO,KAAK,EAER,2BAA2B,EAC9B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EACH,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAEpC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,iDAAiD,CAAA;AAGxD,MAAM,MAAM,6BAA6B,CAAC,UAAU,SAAS,UAAU,IAAI;IACvE;;OAEG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,8BAA8B,CAAC,UAAU,CAAC,KAC/C,OAAO,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,kBAAkB,EAAE,CAChB,IAAI,EAAE,4BAA4B,KACjC,OAAO,CAAC,4BAA4B,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KAAK,4BAA4B,EAEpC,MAAM,+CAA+C,CAAA;AACtD,OAAO,EACH,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EAEtC,MAAM,iDAAiD,CAAA;AAGxD,MAAM,MAAM,6BAA6B,CAAC,UAAU,SAAS,UAAU,IAAI;IACvE;;OAEG;IACH,oBAAoB,EAAE,CAClB,IAAI,EAAE,8BAA8B,CAAC,UAAU,CAAC,KAC/C,OAAO,CAAC,8BAA8B,CAAC,UAAU,CAAC,CAAC,CAAA;IACxD,kBAAkB,EAAE,CAChB,IAAI,EAAE,4BAA4B,KACjC,OAAO,CAAC,4BAA4B,CAAC,CAAA;CAC7C,CAAA;AAED,eAAO,MAAM,uBAAuB,6EAEvB,MAAM,8CAab,CAAA;AAEN,MAAM,MAAM,0BAA0B,CAClC,UAAU,SAAS,UAAU,EAC7B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,aAAa,SAAS,YAAY,CAAC,UAAU,CAAC,GAAG,SAAS,GACpD,YAAY,CAAC,UAAU,CAAC,GACxB,SAAS,IACf,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG;IACzD;;;;;OAKG;IACH,iBAAiB,EAAE,CAAC,UAAU,SAAS,SAAS,EAC5C,IAAI,EAAE,UAAU,CACZ,OAAO,iBAAiB,CACpB,UAAU,EACV,UAAU,EACV,MAAM,EACN,aAAa,CAChB,CACJ,CAAC,CAAC,CAAC,KACH,OAAO,CAAC,2BAA2B,CAAC,CAAA;IACzC;;;;OAIG;IACH,wBAAwB,EAAE,MAAM,OAAO,CACnC,QAAQ,CAAC,kCAAkC,CAAC,CAC/C,CAAA;CACJ,CAAA;AAED,eAAO,MAAM,0BAA0B,wXAqBjC,CAAA"}
@@ -26,7 +26,7 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
26
26
  maxPriorityFeePerGas: bigint;
27
27
  }>) | undefined;
28
28
  sponsorUserOperation?: ((args: {
29
- userOperation: import("permissionless/types").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
29
+ userOperation: import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
30
30
  entryPoint: entryPoint;
31
31
  }) => Promise<entryPoint extends "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" ? Pick<{
32
32
  sender: `0x${string}`;
@@ -66,9 +66,9 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
66
66
  paymasterAndData?: undefined;
67
67
  }, "callGasLimit" | "verificationGasLimit" | "preVerificationGas" | "paymaster" | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData">>) | undefined;
68
68
  } | ((args: {
69
- userOperation: import("permissionless/types").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
69
+ userOperation: import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
70
70
  entryPoint: entryPoint;
71
- }) => Promise<import("permissionless/types").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>>) | undefined;
71
+ }) => Promise<import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>>) | undefined;
72
72
  entryPoint: entryPoint;
73
73
  }) => {
74
74
  account: TSmartAccount;
@@ -299,7 +299,7 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
299
299
  }, TPrimaryType extends string>(args: import("viem").SignTypedDataParameters<TTypedData, TPrimaryType, TSmartAccount>) => Promise<`0x${string}`>;
300
300
  deployContract: <const TAbi extends readonly unknown[] | import("viem").Abi, TChainOverride_1 extends Chain | undefined = undefined>(args: import("viem").DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride_1> extends infer T ? { [K in keyof T]: import("viem").DeployContractParameters<TAbi, TChain, TSmartAccount, TChainOverride_1>[K]; } : never) => Promise<`0x${string}`>;
301
301
  writeContract: <const TAbi_1 extends readonly unknown[] | import("viem").Abi, TFunctionName extends import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable"> = import("viem").ContractFunctionName<TAbi_1, "nonpayable" | "payable">, TArgs extends import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName> = import("viem").ContractFunctionArgs<TAbi_1, "nonpayable" | "payable", TFunctionName>, TChainOverride_2 extends Chain | undefined = undefined>(args: import("viem").WriteContractParameters<TAbi_1, TFunctionName, TArgs, TChain, TSmartAccount, TChainOverride_2>) => Promise<`0x${string}`>;
302
- prepareUserOperationRequest: <TTransport_1 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_3 ? { [K_2 in keyof T_3]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never) extends infer T_1 ? { [K_1 in keyof T_1]: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_2 ? { [K_2 in keyof T_2]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never)[K_1]; } : never, stateOverrides?: import("permissionless/_types/types/bundler.js").StateOverrides | undefined) => Promise<import("permissionless/types").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>> extends infer T_4 ? { [K_3 in keyof T_4]: import("permissionless/types").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>>[K_3]; } : never>;
302
+ prepareUserOperationRequest: <TTransport_1 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_3 ? { [K_2 in keyof T_3]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never) extends infer T_1 ? { [K_1 in keyof T_1]: (import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount> extends infer T_2 ? { [K_2 in keyof T_2]: import("permissionless/_types/actions/smartAccount.js").PrepareUserOperationRequestParameters<entryPoint, TSmartAccount>[K_2]; } : never)[K_1]; } : never, stateOverrides?: import("permissionless/_types/types/bundler.js").StateOverrides | undefined) => Promise<import("permissionless").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>> extends infer T_4 ? { [K_3 in keyof T_4]: import("permissionless").UserOperation<import("permissionless/types").GetEntryPointVersion<entryPoint>>[K_3]; } : never>;
303
303
  sendUserOperation: <TTransport_2 extends Transport>(args: (import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount> extends infer T_7 ? { [K_5 in keyof T_7]: import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount>[K_5]; } : never) extends infer T_5 ? { [K_4 in keyof T_5]: (import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount> extends infer T_6 ? { [K_5 in keyof T_6]: import("permissionless/_types/actions/smartAccount.js").SendUserOperationParameters<entryPoint, TSmartAccount>[K_5]; } : never)[K_4]; } : never) => Promise<`0x${string}`>;
304
304
  sendTransactions: (args: import("permissionless/_types/actions/smartAccount.js").SendTransactionsWithPaymasterParameters<entryPoint, TSmartAccount> extends infer T_8 ? { [K_6 in keyof T_8]: import("permissionless/_types/actions/smartAccount.js").SendTransactionsWithPaymasterParameters<entryPoint, TSmartAccount>[K_6]; } : never) => Promise<`0x${string}`>;
305
305
  signUserOperation: <TTransport_3 extends Transport>(args: import("../actions/index.js").SignUserOperationParameters<entryPoint, TSmartAccount> extends infer T_9 ? { [K_7 in keyof T_9]: import("../actions/index.js").SignUserOperationParameters<entryPoint, TSmartAccount>[K_7]; } : never) => Promise<{
@@ -321,6 +321,10 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
321
321
  paymasterPostOpGasLimit?: undefined;
322
322
  paymasterData?: undefined;
323
323
  }>;
324
+ getUserOperationGasPrice: () => Promise<{
325
+ maxFeePerGas: bigint;
326
+ maxPriorityFeePerGas: bigint;
327
+ }>;
324
328
  extend: <const client extends {
325
329
  [x: string]: unknown;
326
330
  account?: undefined;
@@ -354,6 +358,10 @@ export declare const createKernelAccountClient: <entryPoint extends EntryPoint,
354
358
  paymasterPostOpGasLimit?: undefined;
355
359
  paymasterData?: undefined;
356
360
  }>;
361
+ getUserOperationGasPrice: () => Promise<{
362
+ maxFeePerGas: bigint;
363
+ maxPriorityFeePerGas: bigint;
364
+ }>;
357
365
  }>;
358
366
  };
359
367
  //# sourceMappingURL=kernelAccountClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kernelAccountClient.d.ts","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EACH,KAAK,KAAK,EACV,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EAEjB,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,EACH,KAAK,0BAA0B,EAElC,MAAM,wBAAwB,CAAA;AAE/B,MAAM,MAAM,mBAAmB,CAC3B,UAAU,SAAS,UAAU,EAC7B,SAAS,SAAS,SAAS,GAAG,SAAS,EACvC,KAAK,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACnD,OAAO,SAAS,kBAAkB,CAAC,UAAU,CAAC,GAAG,SAAS,GACpD,kBAAkB,CAAC,UAAU,CAAC,GAC9B,SAAS,IACf,QAAQ,CACR,MAAM,CACF,SAAS,EAC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AAG,MAAM,GAAG,iBAAiB,CAC7D,GAAG;IACA,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,gBAAgB,EAAE,SAAS,CAAA;CAC9B,GAAG,UAAU,CAAC,UAAU,CAAC,GAAG;IACrB,UAAU,EAAE,UAAU,CAAA;CACzB,CACR,CAAA;AAED,eAAO,MAAM,yBAAyB;;;;;;;sBANZ,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDlC,CAAA"}
@@ -1,4 +1,4 @@
1
- export type { KernelValidator, ZeroDevPaymasterRpcSchema, Action, KernelPluginManager, ValidatorInitData, CallType, KernelEncodeCallDataArgs, PluginValidityData } from "./kernel.js";
1
+ export type { KernelValidator, ZeroDevPaymasterRpcSchema, Action, KernelPluginManager, ValidatorInitData, CallType, KernelEncodeCallDataArgs, PluginValidityData, ZeroDevAccountClientRpcSchema, ZeroDevUserOperationGasPriceWithBigIntAsHex } from "./kernel.js";
2
2
  export { ValidatorMode } from "./kernel.js";
3
3
  export type WithRequired<T, K extends keyof T> = Required<Pick<T, K>>;
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,eAAe,EACf,yBAAyB,EACzB,MAAM,EACN,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,wBAAwB,EACxB,kBAAkB,EACrB,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,eAAe,EACf,yBAAyB,EACzB,MAAM,EACN,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,2CAA2C,EAC9C,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA"}
@@ -68,6 +68,27 @@ export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
68
68
  };
69
69
  }
70
70
  ];
71
+ export type ZeroDevUserOperationGasPriceWithBigIntAsHex = {
72
+ slow: {
73
+ maxFeePerGas: Hex;
74
+ maxPriorityFeePerGas: Hex;
75
+ };
76
+ standard: {
77
+ maxFeePerGas: Hex;
78
+ maxPriorityFeePerGas: Hex;
79
+ };
80
+ fast: {
81
+ maxFeePerGas: Hex;
82
+ maxPriorityFeePerGas: Hex;
83
+ };
84
+ };
85
+ export type ZeroDevAccountClientRpcSchema = [
86
+ {
87
+ Method: "zd_getUserOperationGasPrice";
88
+ Parameters: [];
89
+ ReturnType: ZeroDevUserOperationGasPriceWithBigIntAsHex;
90
+ }
91
+ ];
71
92
  export type ValidatorType = Extract<keyof typeof VALIDATOR_TYPE, "PERMISSION" | "SECONDARY">;
72
93
  export type KernelValidator<entryPoint extends EntryPoint, Name extends string = string> = LocalAccount<Name> & {
73
94
  validatorType: ValidatorType;
@@ -1 +1 @@
1
- {"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACR,aAAa,EACb,4BAA4B,EAC/B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,YAAY,EAAE,MAAM,MAAM,CAAA;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,MAAM,MAAM,yBAAyB,CAAC,UAAU,SAAS,UAAU,IAAI;IACnE;QACI,MAAM,EAAE,yBAAyB,CAAA;QACjC,UAAU,EAAE;YACR;gBACI,OAAO,EAAE,MAAM,CAAA;gBACf,MAAM,EAAE,oBAAoB,CAAC,UAAU,CAAC,SAAS,MAAM,GACjD,SAAS,CACL,4BAA4B,CAAC,MAAM,CAAC,EAClC,cAAc,GACd,oBAAoB,GACpB,sBAAsB,CAC3B,GACD,SAAS,CACL,4BAA4B,CAAC,MAAM,CAAC,EAClC,cAAc,GACd,oBAAoB,GACpB,sBAAsB,GACtB,+BAA+B,GAC/B,yBAAyB,CAC9B,CAAA;gBACP,iBAAiB,EAAE,OAAO,CAAA;gBAC1B,YAAY,CAAC,EAAE;oBACX,YAAY,EAAE,GAAG,CAAA;iBACpB,CAAA;gBACD,iBAAiB,CAAC,EAAE,OAAO,CAAA;gBAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAA;gBAC7B,aAAa,CAAC,EAAE,OAAO,CAAA;aAC1B;SACJ,CAAA;QACD,UAAU,EAAE,oBAAoB,CAAC,UAAU,CAA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M,MAAM,wBAAwB,GAC9B;IACI,EAAE,EAAE,OAAO,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAA;IACT,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;CACjC,GACD;IACI,EAAE,EAAE,OAAO,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,GAAG,CAAA;IACT,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAA;CACjC,EAAE,CAAA;AAET,MAAM,MAAM,SAAS,GAAG;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,GAAG,CAAA;CAChB,CAAA"}
@@ -0,0 +1,26 @@
1
+ import type { Account, Chain, Client, Transport } from "viem"
2
+ import type { Prettify } from "viem/chains"
3
+ import type { ZeroDevAccountClientRpcSchema } from "../../types/kernel.js"
4
+
5
+ export type GetUserOperationGasPriceReturnType = {
6
+ maxFeePerGas: bigint
7
+ maxPriorityFeePerGas: bigint
8
+ }
9
+
10
+ export const getUserOperationGasPrice = async <
11
+ TTransport extends Transport = Transport,
12
+ TChain extends Chain | undefined = Chain | undefined,
13
+ TAccount extends Account | undefined = Account | undefined
14
+ >(
15
+ client: Client<TTransport, TChain, TAccount, ZeroDevAccountClientRpcSchema>
16
+ ): Promise<Prettify<GetUserOperationGasPriceReturnType>> => {
17
+ const gasPrice = await client.request({
18
+ method: "zd_getUserOperationGasPrice",
19
+ params: []
20
+ })
21
+
22
+ return {
23
+ maxFeePerGas: BigInt(gasPrice.standard.maxFeePerGas),
24
+ maxPriorityFeePerGas: BigInt(gasPrice.standard.maxPriorityFeePerGas)
25
+ }
26
+ }
package/actions/index.ts CHANGED
@@ -10,6 +10,11 @@ export {
10
10
  type SignUserOperationReturnType
11
11
  } from "./account-client/signUserOperation.js"
12
12
 
13
+ export {
14
+ getUserOperationGasPrice,
15
+ type GetUserOperationGasPriceReturnType
16
+ } from "./account-client/getUserOperationGasPrice.js"
17
+
13
18
  export {
14
19
  estimateGasInERC20,
15
20
  type EstimateGasInERC20Parameters,
@@ -1,8 +1,12 @@
1
1
  import { type SmartAccountActions, smartAccountActions } from "permissionless"
2
2
  import type { SmartAccount } from "permissionless/accounts/types"
3
3
  import { type Middleware } from "permissionless/actions/smartAccount"
4
- import type { EntryPoint } from "permissionless/types"
4
+ import type { EntryPoint, Prettify } from "permissionless/types"
5
5
  import type { Chain, Client, Transport } from "viem"
6
+ import {
7
+ type GetUserOperationGasPriceReturnType,
8
+ getUserOperationGasPrice
9
+ } from "../../actions/account-client/getUserOperationGasPrice.js"
6
10
  import type {
7
11
  SignUserOperationParameters,
8
12
  SignUserOperationReturnType
@@ -72,6 +76,14 @@ export type KernelAccountClientActions<
72
76
  >
73
77
  >[1]
74
78
  ) => Promise<SignUserOperationReturnType>
79
+ /**
80
+ * Returns the live gas prices that you can use to send a user operation.
81
+ *
82
+ * @returns maxFeePerGas & maxPriorityFeePerGas {@link GetUserOperationGasPriceReturnType}
83
+ */
84
+ getUserOperationGasPrice: () => Promise<
85
+ Prettify<GetUserOperationGasPriceReturnType>
86
+ >
75
87
  }
76
88
 
77
89
  export const kernelAccountClientActions =
@@ -93,5 +105,6 @@ export const kernelAccountClientActions =
93
105
  ...args,
94
106
  middleware
95
107
  } as SignUserOperationParameters<entryPoint, TSmartAccount>
96
- )
108
+ ),
109
+ getUserOperationGasPrice: async () => getUserOperationGasPrice(client)
97
110
  })
@@ -1,3 +1,4 @@
1
+ import { ENTRYPOINT_ADDRESS_V07 } from "permissionless"
1
2
  import type { SmartAccount } from "permissionless/accounts/types"
2
3
  import type { Middleware } from "permissionless/actions/smartAccount"
3
4
  import type { EntryPoint, Prettify } from "permissionless/types"
@@ -10,6 +11,7 @@ import {
10
11
  createClient
11
12
  } from "viem"
12
13
  import { type KernelSmartAccount } from "../accounts/index.js"
14
+ import { getUserOperationGasPrice } from "../actions/account-client/getUserOperationGasPrice.js"
13
15
  import {
14
16
  type KernelAccountClientActions,
15
17
  kernelAccountClientActions
@@ -79,9 +81,23 @@ export const createKernelAccountClient = <
79
81
  type: "kernelAccountClient"
80
82
  })
81
83
 
84
+ let middleware = parameters.middleware
85
+
86
+ if (
87
+ !middleware ||
88
+ (typeof middleware !== "function" &&
89
+ !middleware.gasPrice &&
90
+ parameters.entryPoint === ENTRYPOINT_ADDRESS_V07)
91
+ ) {
92
+ const gasPrice = () => getUserOperationGasPrice(client)
93
+ middleware = {
94
+ ...middleware,
95
+ gasPrice
96
+ }
97
+ }
82
98
  return client.extend(
83
99
  kernelAccountClientActions({
84
- middleware: parameters.middleware
100
+ middleware
85
101
  })
86
102
  ) as KernelAccountClient<entryPoint, TTransport, TChain, TSmartAccount>
87
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "5.2.1-alpha-4",
3
+ "version": "5.2.1-alpha-5",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
package/types/index.ts CHANGED
@@ -6,7 +6,9 @@ export type {
6
6
  ValidatorInitData,
7
7
  CallType,
8
8
  KernelEncodeCallDataArgs,
9
- PluginValidityData
9
+ PluginValidityData,
10
+ ZeroDevAccountClientRpcSchema,
11
+ ZeroDevUserOperationGasPriceWithBigIntAsHex
10
12
  } from "./kernel.js"
11
13
 
12
14
  export { ValidatorMode } from "./kernel.js"
package/types/kernel.ts CHANGED
@@ -88,6 +88,29 @@ export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
88
88
  }
89
89
  ]
90
90
 
91
+ export type ZeroDevUserOperationGasPriceWithBigIntAsHex = {
92
+ slow: {
93
+ maxFeePerGas: Hex
94
+ maxPriorityFeePerGas: Hex
95
+ }
96
+ standard: {
97
+ maxFeePerGas: Hex
98
+ maxPriorityFeePerGas: Hex
99
+ }
100
+ fast: {
101
+ maxFeePerGas: Hex
102
+ maxPriorityFeePerGas: Hex
103
+ }
104
+ }
105
+
106
+ export type ZeroDevAccountClientRpcSchema = [
107
+ {
108
+ Method: "zd_getUserOperationGasPrice"
109
+ Parameters: []
110
+ ReturnType: ZeroDevUserOperationGasPriceWithBigIntAsHex
111
+ }
112
+ ]
113
+
91
114
  export type ValidatorType = Extract<
92
115
  keyof typeof VALIDATOR_TYPE,
93
116
  "PERMISSION" | "SECONDARY"