@zerodev/sdk 5.2.1-alpha-7 → 5.2.1-alpha-8
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.
- package/_cjs/clients/kernelAccountClient.js +2 -4
- package/_cjs/clients/kernelAccountClient.js.map +1 -1
- package/_esm/clients/kernelAccountClient.js +2 -4
- package/_esm/clients/kernelAccountClient.js.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +4 -4
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/clients/kernelAccountClient.ts +2 -4
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createKernelAccountClient = void 0;
|
|
4
|
-
const permissionless_1 = require("permissionless");
|
|
5
4
|
const viem_1 = require("viem");
|
|
6
5
|
const getUserOperationGasPrice_js_1 = require("../actions/account-client/getUserOperationGasPrice.js");
|
|
7
6
|
const kernel_js_1 = require("./decorators/kernel.js");
|
|
@@ -15,9 +14,8 @@ const createKernelAccountClient = (parameters) => {
|
|
|
15
14
|
type: "kernelAccountClient"
|
|
16
15
|
});
|
|
17
16
|
let middleware = parameters.middleware;
|
|
18
|
-
if (
|
|
19
|
-
(typeof middleware !== "function" && !middleware.gasPrice))
|
|
20
|
-
parameters.entryPoint === permissionless_1.ENTRYPOINT_ADDRESS_V07) {
|
|
17
|
+
if (!middleware ||
|
|
18
|
+
(typeof middleware !== "function" && !middleware.gasPrice)) {
|
|
21
19
|
const gasPrice = () => (0, getUserOperationGasPrice_js_1.getUserOperationGasPrice)(client);
|
|
22
20
|
middleware = {
|
|
23
21
|
...middleware,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":";;;AAIA,+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,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAC5D,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;AA7CY,QAAA,yBAAyB,6BA6CrC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ENTRYPOINT_ADDRESS_V07 } from "permissionless";
|
|
2
1
|
import { createClient } from "viem";
|
|
3
2
|
import {} from "../accounts/index.js";
|
|
4
3
|
import { getUserOperationGasPrice } from "../actions/account-client/getUserOperationGasPrice.js";
|
|
@@ -13,9 +12,8 @@ export const createKernelAccountClient = (parameters) => {
|
|
|
13
12
|
type: "kernelAccountClient"
|
|
14
13
|
});
|
|
15
14
|
let middleware = parameters.middleware;
|
|
16
|
-
if (
|
|
17
|
-
(typeof middleware !== "function" && !middleware.gasPrice))
|
|
18
|
-
parameters.entryPoint === ENTRYPOINT_ADDRESS_V07) {
|
|
15
|
+
if (!middleware ||
|
|
16
|
+
(typeof middleware !== "function" && !middleware.gasPrice)) {
|
|
19
17
|
const gasPrice = () => getUserOperationGasPrice(client);
|
|
20
18
|
middleware = {
|
|
21
19
|
...middleware,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelAccountClient.js","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"
|
|
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,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,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAC5D,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"}
|
|
@@ -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").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
|
|
29
|
+
userOperation: import("permissionless/types").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").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
|
|
69
|
+
userOperation: import("permissionless/types").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>;
|
|
70
70
|
entryPoint: entryPoint;
|
|
71
|
-
}) => Promise<import("permissionless").UserOperation<import("permissionless/types/entrypoint.js").GetEntryPointVersion<entryPoint>>>) | undefined;
|
|
71
|
+
}) => Promise<import("permissionless/types").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").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>;
|
|
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>;
|
|
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<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernelAccountClient.d.ts","sourceRoot":"","sources":["../../clients/kernelAccountClient.ts"],"names":[],"mappings":"
|
|
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;AAE9D,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,G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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDlC,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ENTRYPOINT_ADDRESS_V07 } from "permissionless"
|
|
2
1
|
import type { SmartAccount } from "permissionless/accounts/types"
|
|
3
2
|
import type { Middleware } from "permissionless/actions/smartAccount"
|
|
4
3
|
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
@@ -84,9 +83,8 @@ export const createKernelAccountClient = <
|
|
|
84
83
|
let middleware = parameters.middleware
|
|
85
84
|
|
|
86
85
|
if (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
parameters.entryPoint === ENTRYPOINT_ADDRESS_V07
|
|
86
|
+
!middleware ||
|
|
87
|
+
(typeof middleware !== "function" && !middleware.gasPrice)
|
|
90
88
|
) {
|
|
91
89
|
const gasPrice = () => getUserOperationGasPrice(client)
|
|
92
90
|
middleware = {
|