@zerodev/sdk 5.2.7 → 5.2.9
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/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +2 -2
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +2 -2
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/accounts/utils/multisend.js.map +1 -1
- package/_cjs/accounts/utils/toKernelPluginManager.js +8 -0
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/clients/decorators/kernel.js.map +1 -1
- package/_cjs/clients/fallbackKernelAccountClient.js +37 -0
- package/_cjs/clients/fallbackKernelAccountClient.js.map +1 -0
- package/_cjs/clients/index.js +3 -1
- package/_cjs/clients/index.js.map +1 -1
- package/_cjs/constants.js +2 -1
- package/_cjs/constants.js.map +1 -1
- package/_cjs/index.js +3 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js +0 -1
- package/_esm/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js +0 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +2 -2
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +2 -2
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/accounts/kernel/v1/createKernelV1Account.js +0 -2
- package/_esm/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_esm/accounts/kernel/v2/createKernelV2Account.js +0 -1
- package/_esm/accounts/kernel/v2/createKernelV2Account.js.map +1 -1
- package/_esm/accounts/utils/multisend.js +0 -1
- package/_esm/accounts/utils/multisend.js.map +1 -1
- package/_esm/accounts/utils/toKernelPluginManager.js +9 -1
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/clients/decorators/kernel.js +0 -2
- package/_esm/clients/decorators/kernel.js.map +1 -1
- package/_esm/clients/fallbackKernelAccountClient.js +38 -0
- package/_esm/clients/fallbackKernelAccountClient.js.map +1 -0
- package/_esm/clients/index.js +1 -0
- package/_esm/clients/index.js.map +1 -1
- package/_esm/clients/kernelAccountClient.js +0 -1
- package/_esm/clients/kernelAccountClient.js.map +1 -1
- package/_esm/constants.js +1 -1
- package/_esm/constants.js.map +1 -1
- package/_esm/index.js +1 -0
- package/_esm/index.js.map +1 -1
- package/_esm/providers/KernelEIP1193Provider.js +0 -2
- package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
- package/_esm/types/kernel.js +0 -2
- package/_esm/types/kernel.js.map +1 -1
- package/_esm/utils.js +1 -1
- package/_esm/utils.js.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts +1 -1
- package/_types/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts +1 -1
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts.map +1 -1
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts +1 -1
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts.map +1 -1
- package/_types/accounts/utils/multisend.d.ts +1 -1
- package/_types/accounts/utils/multisend.d.ts.map +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
- package/_types/clients/decorators/kernel.d.ts +2 -2
- package/_types/clients/decorators/kernel.d.ts.map +1 -1
- package/_types/clients/fallbackKernelAccountClient.d.ts +600 -0
- package/_types/clients/fallbackKernelAccountClient.d.ts.map +1 -0
- package/_types/clients/index.d.ts +1 -0
- package/_types/clients/index.d.ts.map +1 -1
- package/_types/clients/kernelAccountClient.d.ts +1 -1
- package/_types/clients/kernelAccountClient.d.ts.map +1 -1
- package/_types/constants.d.ts +2 -1
- package/_types/constants.d.ts.map +1 -1
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/providers/KernelEIP1193Provider.d.ts +2 -2
- package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +6 -2
- package/_types/types/kernel.d.ts.map +1 -1
- package/_types/utils.d.ts +1 -1
- package/_types/utils.d.ts.map +1 -1
- package/accounts/kernel/utils/account/ep0_6/encodeDeployCallData.ts +1 -1
- package/accounts/kernel/utils/account/ep0_7/encodeDeployCallData.ts +1 -1
- package/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.ts +2 -2
- package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +2 -2
- package/accounts/kernel/v1/createKernelV1Account.ts +2 -2
- package/accounts/kernel/v2/createKernelV2Account.ts +1 -1
- package/accounts/utils/multisend.ts +1 -4
- package/accounts/utils/toKernelPluginManager.ts +16 -1
- package/clients/decorators/kernel.ts +2 -2
- package/clients/fallbackKernelAccountClient.ts +62 -0
- package/clients/index.ts +2 -0
- package/clients/kernelAccountClient.ts +1 -1
- package/constants.ts +3 -1
- package/index.ts +1 -0
- package/package.json +2 -8
- package/providers/KernelEIP1193Provider.ts +6 -6
- package/types/kernel.ts +7 -2
- package/utils.ts +2 -2
package/_types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { sponsorUserOperation, type SponsorUserOperationParameters, type Sponsor
|
|
|
3
3
|
export { zerodevPaymasterActions, type ZeroDevPaymasterClientActions, kernelAccountClientActions, type KernelAccountClientActions } from "./clients/decorators/kernel.js";
|
|
4
4
|
export { createZeroDevPaymasterClient, type ZeroDevPaymasterClient } from "./clients/paymasterClient.js";
|
|
5
5
|
export { createKernelAccountClient, type KernelAccountClient } from "./clients/kernelAccountClient.js";
|
|
6
|
+
export { createFallbackKernelAccountClient } from "./clients/fallbackKernelAccountClient.js";
|
|
6
7
|
export { type KernelValidator, type ZeroDevPaymasterRpcSchema, type KernelPluginManager } from "./types/kernel.js";
|
|
7
8
|
export { KernelAccountAbi } from "./accounts/kernel/abi/KernelAccountAbi.js";
|
|
8
9
|
export { KernelFactoryAbi } from "./accounts/kernel/abi/KernelFactoryAbi.js";
|
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACb,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACH,oBAAoB,EACpB,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACtC,MAAM,6CAA6C,CAAA;AACpD,OAAO,EACH,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,0BAA0B,EAC1B,KAAK,0BAA0B,EAClC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EACH,4BAA4B,EAC5B,KAAK,sBAAsB,EAC9B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACH,yBAAyB,EACzB,KAAK,mBAAmB,EAC3B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5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AAmB,EAC3B,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EACH,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAClB,MAAM,0DAA0D,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAA;AAC7F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAA;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAC3C,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAChF,OAAO,EACH,sBAAsB,EACtB,2BAA2B,EAC9B,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from "events";
|
|
3
|
-
import {
|
|
3
|
+
import type { KernelAccountClient } from "@zerodev/sdk";
|
|
4
4
|
import type { EntryPoint } from "permissionless/types";
|
|
5
|
-
import {
|
|
5
|
+
import type { EIP1193Parameters, EIP1193RequestFn } from "viem";
|
|
6
6
|
export declare class KernelEIP1193Provider<entryPoint extends EntryPoint> extends EventEmitter {
|
|
7
7
|
private kernelClient;
|
|
8
8
|
constructor(kernelClient: KernelAccountClient<entryPoint>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KernelEIP1193Provider.d.ts","sourceRoot":"","sources":["../../providers/KernelEIP1193Provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"KernelEIP1193Provider.d.ts","sourceRoot":"","sources":["../../providers/KernelEIP1193Provider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EACR,iBAAiB,EACjB,gBAAgB,EAGnB,MAAM,MAAM,CAAA;AAEb,qBAAa,qBAAqB,CAC9B,UAAU,SAAS,UAAU,CAC/B,SAAQ,YAAY;IAClB,OAAO,CAAC,YAAY,CAAiC;gBAEzC,YAAY,EAAE,mBAAmB,CAAC,UAAU,CAAC;IAKnD,OAAO,CAAC,EACV,MAAM,EACN,MAAW,EACd,EAAE,iBAAiB,GAAG,UAAU,CAAC,gBAAgB,CAAC;YAoBrC,wBAAwB;YAOxB,iBAAiB;YAOjB,wBAAwB;YAKxB,aAAa;YAoBb,kBAAkB;YAsBlB,wBAAwB;CAyBzC"}
|
package/_types/types/kernel.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ENTRYPOINT_ADDRESS_V06_TYPE, EntryPoint } from "permissionless/types";
|
|
2
2
|
import type { GetEntryPointVersion } from "permissionless/types/entrypoint";
|
|
3
3
|
import type { UserOperation, UserOperationWithBigIntAsHex } from "permissionless/types/userOperation";
|
|
4
|
-
import {
|
|
4
|
+
import type { Address, Hex, LocalAccount } from "viem";
|
|
5
5
|
import type { PartialBy } from "viem/types/utils";
|
|
6
|
-
import { VALIDATOR_TYPE } from "../constants.js";
|
|
6
|
+
import type { VALIDATOR_TYPE } from "../constants.js";
|
|
7
7
|
export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
|
|
8
8
|
{
|
|
9
9
|
Method: "zd_sponsorUserOperation";
|
|
@@ -131,9 +131,13 @@ export type KernelPluginManagerParams<entryPoint extends EntryPoint> = {
|
|
|
131
131
|
entryPoint: entryPoint;
|
|
132
132
|
kernelVersion?: string;
|
|
133
133
|
} & Partial<PluginValidityData>;
|
|
134
|
+
export type Hook = {
|
|
135
|
+
address: Address;
|
|
136
|
+
};
|
|
134
137
|
export type Action = {
|
|
135
138
|
address: Address;
|
|
136
139
|
selector: Hex;
|
|
140
|
+
hook?: Hook;
|
|
137
141
|
};
|
|
138
142
|
export type PluginValidityData = {
|
|
139
143
|
validUntil: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,2BAA2B,EAC3B,UAAU,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACR,aAAa,EACb,4BAA4B,EAC/B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"kernel.d.ts","sourceRoot":"","sources":["../../types/kernel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,2BAA2B,EAC3B,UAAU,EACb,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAA;AAC3E,OAAO,KAAK,EACR,aAAa,EACb,4BAA4B,EAC/B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AACrD,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,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E,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"}
|
package/_types/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EntryPoint } from "permissionless/types/entrypoint";
|
|
2
2
|
import { type Address, type Hex } from "viem";
|
|
3
3
|
import type { ZeroDevPaymasterClient } from "./clients/paymasterClient.js";
|
|
4
|
-
import { CALL_TYPE, EXEC_TYPE } from "./constants.js";
|
|
4
|
+
import { type CALL_TYPE, type EXEC_TYPE } from "./constants.js";
|
|
5
5
|
export declare const getKernelVersion: <entryPoint extends EntryPoint>(entryPointAddress: entryPoint, kernelImpl?: Address) => string;
|
|
6
6
|
export declare enum KERNEL_FEATURES {
|
|
7
7
|
ERC1271_SIG_WRAPPER = "ERC1271_SIG_WRAPPER",
|
package/_types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,GAAG,EASX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EACH,SAAS,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,GAAG,EASX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,EACH,KAAK,SAAS,EACd,KAAK,SAAS,EAGjB,MAAM,gBAAgB,CAAA;AAEvB,eAAO,MAAM,gBAAgB,8EAEZ,OAAO,KACrB,MAQF,CAAA;AAED,oBAAY,eAAe;IACvB,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IACjD,qCAAqC,0CAA0C;CAClF;AAQD,eAAO,MAAM,gBAAgB,YAChB,eAAe,WACf,MAAM,KAChB,OAMF,CAAA;AAED,eAAO,MAAM,4BAA4B;cAQvB,OAAO;mBACF,MAAM;MAE1B,QAAQ;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAmBnD,CAAA;AAED,eAAO,MAAM,aAAa,QAAS,GAAG,KAAG,GAcxC,CAAA;AAED,eAAO,MAAM,WAAW;cAIV,SAAS;cACT,SAAS;MACnB,GAQH,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toSmartAccount } from "permissionless/accounts"
|
|
1
|
+
import type { toSmartAccount } from "permissionless/accounts"
|
|
2
2
|
import { encodeDeployData } from "viem"
|
|
3
3
|
import { safeCreateCallAddress } from "../../../../../constants.js"
|
|
4
4
|
import { encodeSafeCreateCall } from "../../common/encodeSafeCreateCall.js"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toSmartAccount } from "permissionless/accounts"
|
|
1
|
+
import type { toSmartAccount } from "permissionless/accounts"
|
|
2
2
|
import { encodeDeployData } from "viem"
|
|
3
3
|
import { EXEC_TYPE, safeCreateCallAddress } from "../../../../../constants.js"
|
|
4
4
|
import { encodeSafeCreateCall } from "../../common/encodeSafeCreateCall.js"
|
|
@@ -39,13 +39,13 @@ export const getEncodedPluginsData = async <
|
|
|
39
39
|
concat([
|
|
40
40
|
action.selector,
|
|
41
41
|
action.address,
|
|
42
|
-
zeroAddress,
|
|
42
|
+
action.hook?.address ?? zeroAddress,
|
|
43
43
|
encodeAbiParameters(
|
|
44
44
|
parseAbiParameters(
|
|
45
45
|
"bytes selectorInitData, bytes hookInitData"
|
|
46
46
|
),
|
|
47
47
|
// [TODO]: Add support for other call_type
|
|
48
|
-
[CALL_TYPE.DELEGATE_CALL, "
|
|
48
|
+
[CALL_TYPE.DELEGATE_CALL, "0x0000"]
|
|
49
49
|
)
|
|
50
50
|
]),
|
|
51
51
|
enableSignature,
|
|
@@ -60,12 +60,12 @@ export const getPluginsEnableTypedData = async <
|
|
|
60
60
|
selectorData: concat([
|
|
61
61
|
action.selector,
|
|
62
62
|
action.address,
|
|
63
|
-
zeroAddress,
|
|
63
|
+
action.hook?.address ?? zeroAddress,
|
|
64
64
|
encodeAbiParameters(
|
|
65
65
|
parseAbiParameters(
|
|
66
66
|
"bytes selectorInitData, bytes hookInitData"
|
|
67
67
|
),
|
|
68
|
-
[CALL_TYPE.DELEGATE_CALL, "
|
|
68
|
+
[CALL_TYPE.DELEGATE_CALL, "0x0000"]
|
|
69
69
|
)
|
|
70
70
|
])
|
|
71
71
|
},
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from "viem"
|
|
30
30
|
import { toAccount } from "viem/accounts"
|
|
31
31
|
import { getChainId, signMessage, signTypedData } from "viem/actions"
|
|
32
|
-
import {
|
|
32
|
+
import type { KernelEncodeCallDataArgs } from "../../../types/kernel.js"
|
|
33
33
|
import { wrapSignatureWith6492 } from "../../utils/6492.js"
|
|
34
34
|
import { parseFactoryAddressAndCallDataFromAccountInitCode } from "../../utils/index.js"
|
|
35
35
|
import {
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
encodeMultiSend,
|
|
38
38
|
multiSendAbi
|
|
39
39
|
} from "../../utils/multisend.js"
|
|
40
|
-
import {
|
|
40
|
+
import type { KernelSmartAccount } from "../createKernelAccount.js"
|
|
41
41
|
|
|
42
42
|
export type KernelV1SmartAccount<
|
|
43
43
|
entryPoint extends EntryPoint,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
isKernelPluginManager,
|
|
45
45
|
toKernelPluginManager
|
|
46
46
|
} from "../../utils/toKernelPluginManager.js"
|
|
47
|
-
import {
|
|
47
|
+
import type { KernelSmartAccount } from "../createKernelAccount.js"
|
|
48
48
|
import { KernelAccountV2Abi } from "./abi/KernelAccountV2Abi.js"
|
|
49
49
|
import { KernelFactoryV2Abi } from "./abi/KernelFactoryV2Abi.js"
|
|
50
50
|
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { type Address, type Hex, encodePacked, toBytes } from "viem"
|
|
2
|
-
import {
|
|
3
|
-
type CallType,
|
|
4
|
-
type KernelEncodeCallDataArgs
|
|
5
|
-
} from "../../types/index.js"
|
|
2
|
+
import type { CallType, KernelEncodeCallDataArgs } from "../../types/index.js"
|
|
6
3
|
|
|
7
4
|
export const MULTISEND_ADDRESS = "0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c"
|
|
8
5
|
|
|
@@ -16,7 +16,11 @@ import {
|
|
|
16
16
|
} from "viem"
|
|
17
17
|
import { getChainId } from "viem/actions"
|
|
18
18
|
import { encodeModuleInstallCallData as encodeModuleInstallCallDataEpV06 } from "../../accounts/kernel/utils/account/ep0_6/encodeModuleInstallCallData.js"
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
ONLY_ENTRYPOINT_HOOK_ADDRESS,
|
|
21
|
+
VALIDATOR_MODE,
|
|
22
|
+
VALIDATOR_TYPE
|
|
23
|
+
} from "../../constants.js"
|
|
20
24
|
import {
|
|
21
25
|
type KernelPluginManager,
|
|
22
26
|
type KernelPluginManagerParams,
|
|
@@ -66,6 +70,17 @@ export async function toKernelPluginManager<
|
|
|
66
70
|
selector: action?.selector ?? getActionSelector(entryPointVersion),
|
|
67
71
|
address: action?.address ?? zeroAddress
|
|
68
72
|
}
|
|
73
|
+
if (
|
|
74
|
+
entryPointVersion === "v0.7" &&
|
|
75
|
+
(action.address.toLowerCase() !== zeroAddress.toLowerCase() ||
|
|
76
|
+
action.selector.toLowerCase() !==
|
|
77
|
+
getActionSelector(entryPointVersion).toLowerCase())
|
|
78
|
+
) {
|
|
79
|
+
action.hook = {
|
|
80
|
+
address: action.hook?.address ?? ONLY_ENTRYPOINT_HOOK_ADDRESS
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
69
84
|
if (!action) {
|
|
70
85
|
throw new Error("Action data must be set")
|
|
71
86
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type SmartAccountActions, smartAccountActions } from "permissionless"
|
|
2
|
-
import {
|
|
2
|
+
import type { Middleware } from "permissionless/actions/smartAccount"
|
|
3
3
|
import type { EntryPoint, Prettify } from "permissionless/types"
|
|
4
4
|
import type { Chain, Client, Transport } from "viem"
|
|
5
|
+
import type { KernelSmartAccount } from "../../accounts/index.js"
|
|
5
6
|
import {
|
|
6
7
|
type GetUserOperationGasPriceReturnType,
|
|
7
8
|
getUserOperationGasPrice
|
|
@@ -22,7 +23,6 @@ import {
|
|
|
22
23
|
sponsorUserOperation
|
|
23
24
|
} from "../../actions/paymaster/sponsorUserOperation.js"
|
|
24
25
|
import type { ZeroDevPaymasterClient } from "../paymasterClient.js"
|
|
25
|
-
import { type KernelSmartAccount } from "../../accounts/index.js";
|
|
26
26
|
|
|
27
27
|
export type ZeroDevPaymasterClientActions<entryPoint extends EntryPoint> = {
|
|
28
28
|
/**
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { EntryPoint } from "permissionless/types"
|
|
2
|
+
import type { Chain, Transport } from "viem"
|
|
3
|
+
import type { KernelSmartAccount } from "../accounts/index.js"
|
|
4
|
+
import type { KernelAccountClient } from "./kernelAccountClient.js"
|
|
5
|
+
|
|
6
|
+
export const createFallbackKernelAccountClient = <
|
|
7
|
+
TEntryPoint extends EntryPoint,
|
|
8
|
+
TTransport extends Transport,
|
|
9
|
+
TChain extends Chain | undefined,
|
|
10
|
+
TSmartAccount extends KernelSmartAccount<TEntryPoint> | undefined
|
|
11
|
+
>(
|
|
12
|
+
clients: Array<
|
|
13
|
+
KernelAccountClient<TEntryPoint, TTransport, TChain, TSmartAccount>
|
|
14
|
+
>
|
|
15
|
+
): KernelAccountClient<TEntryPoint, TTransport, TChain, TSmartAccount> => {
|
|
16
|
+
const proxyClient = new Proxy(clients[0], {
|
|
17
|
+
get(_target, prop, receiver) {
|
|
18
|
+
for (const client of clients) {
|
|
19
|
+
const value = Reflect.get(client, prop, receiver)
|
|
20
|
+
if (value !== undefined) {
|
|
21
|
+
// If the property is a function, wrap it to add fallback logic
|
|
22
|
+
if (typeof value === "function") {
|
|
23
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
24
|
+
return async (...args: any[]) => {
|
|
25
|
+
for (let i = 0; i < clients.length; i++) {
|
|
26
|
+
try {
|
|
27
|
+
const method = Reflect.get(
|
|
28
|
+
clients[i],
|
|
29
|
+
prop,
|
|
30
|
+
receiver
|
|
31
|
+
)
|
|
32
|
+
if (typeof method === "function") {
|
|
33
|
+
// Attempt to call the function on the current client
|
|
34
|
+
return await method(...args)
|
|
35
|
+
}
|
|
36
|
+
} catch (error) {
|
|
37
|
+
console.error(
|
|
38
|
+
`Action ${String(
|
|
39
|
+
prop
|
|
40
|
+
)} failed with client ${
|
|
41
|
+
client.transport.url
|
|
42
|
+
}, trying next if available.`,
|
|
43
|
+
error
|
|
44
|
+
)
|
|
45
|
+
if (i === clients.length - 1) {
|
|
46
|
+
throw error
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// For non-function properties, return the first defined value found
|
|
53
|
+
return value
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// If no clients have a defined value for the property, return undefined
|
|
57
|
+
return undefined
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
return proxyClient
|
|
62
|
+
}
|
package/clients/index.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type Transport,
|
|
12
12
|
createClient
|
|
13
13
|
} from "viem"
|
|
14
|
-
import {
|
|
14
|
+
import type { KernelSmartAccount } from "../accounts/index.js"
|
|
15
15
|
import { getUserOperationGasPrice } from "../actions/account-client/getUserOperationGasPrice.js"
|
|
16
16
|
import {
|
|
17
17
|
type KernelAccountClientActions,
|
package/constants.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EntryPointVersion } from "permissionless/types/entrypoint"
|
|
2
|
-
import {
|
|
2
|
+
import type { Address, Hex } from "viem"
|
|
3
3
|
|
|
4
4
|
export const DUMMY_ECDSA_SIG =
|
|
5
5
|
"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"
|
|
@@ -13,6 +13,8 @@ export const KernelImplToVersionMap: { [key: Address]: string } = {
|
|
|
13
13
|
"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27": "0.3.0-beta"
|
|
14
14
|
}
|
|
15
15
|
export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1"
|
|
16
|
+
export const ONLY_ENTRYPOINT_HOOK_ADDRESS =
|
|
17
|
+
"0xb230f0A1C7C95fa11001647383c8C7a8F316b900"
|
|
16
18
|
export const KERNEL_NAME = "Kernel"
|
|
17
19
|
export const LATEST_KERNEL_VERSION: { [key in EntryPointVersion]: string } = {
|
|
18
20
|
"v0.6": "0.2.4",
|
package/index.ts
CHANGED
|
@@ -26,6 +26,7 @@ export {
|
|
|
26
26
|
createKernelAccountClient,
|
|
27
27
|
type KernelAccountClient
|
|
28
28
|
} from "./clients/kernelAccountClient.js"
|
|
29
|
+
export { createFallbackKernelAccountClient } from "./clients/fallbackKernelAccountClient.js"
|
|
29
30
|
export {
|
|
30
31
|
type KernelValidator,
|
|
31
32
|
type ZeroDevPaymasterRpcSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerodev/sdk",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.9",
|
|
4
4
|
"author": "ZeroDev",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -9,13 +9,7 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"description": "A utility library for working with ERC-4337",
|
|
12
|
-
"keywords": [
|
|
13
|
-
"ethereum",
|
|
14
|
-
"erc-4337",
|
|
15
|
-
"eip-4337",
|
|
16
|
-
"paymaster",
|
|
17
|
-
"bundler"
|
|
18
|
-
],
|
|
12
|
+
"keywords": ["ethereum", "erc-4337", "eip-4337", "paymaster", "bundler"],
|
|
19
13
|
"license": "MIT",
|
|
20
14
|
"files": [
|
|
21
15
|
"_esm",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { EventEmitter } from "events"
|
|
2
|
-
import {
|
|
2
|
+
import type { KernelAccountClient } from "@zerodev/sdk"
|
|
3
3
|
import type { EntryPoint } from "permissionless/types"
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import type {
|
|
5
|
+
EIP1193Parameters,
|
|
6
|
+
EIP1193RequestFn,
|
|
7
|
+
Hash,
|
|
8
|
+
SendTransactionParameters
|
|
9
9
|
} from "viem"
|
|
10
10
|
|
|
11
11
|
export class KernelEIP1193Provider<
|
package/types/kernel.ts
CHANGED
|
@@ -7,9 +7,9 @@ import type {
|
|
|
7
7
|
UserOperation,
|
|
8
8
|
UserOperationWithBigIntAsHex
|
|
9
9
|
} from "permissionless/types/userOperation"
|
|
10
|
-
import {
|
|
10
|
+
import type { Address, Hex, LocalAccount } from "viem"
|
|
11
11
|
import type { PartialBy } from "viem/types/utils"
|
|
12
|
-
import { VALIDATOR_TYPE } from "../constants.js"
|
|
12
|
+
import type { VALIDATOR_TYPE } from "../constants.js"
|
|
13
13
|
export type ZeroDevPaymasterRpcSchema<entryPoint extends EntryPoint> = [
|
|
14
14
|
{
|
|
15
15
|
Method: "zd_sponsorUserOperation"
|
|
@@ -182,9 +182,14 @@ export type KernelPluginManagerParams<entryPoint extends EntryPoint> = {
|
|
|
182
182
|
kernelVersion?: string
|
|
183
183
|
} & Partial<PluginValidityData>
|
|
184
184
|
|
|
185
|
+
export type Hook = {
|
|
186
|
+
address: Address
|
|
187
|
+
}
|
|
188
|
+
|
|
185
189
|
export type Action = {
|
|
186
190
|
address: Address
|
|
187
191
|
selector: Hex
|
|
192
|
+
hook?: Hook
|
|
188
193
|
}
|
|
189
194
|
|
|
190
195
|
export type PluginValidityData = {
|
package/utils.ts
CHANGED
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
} from "viem"
|
|
16
16
|
import type { ZeroDevPaymasterClient } from "./clients/paymasterClient.js"
|
|
17
17
|
import {
|
|
18
|
-
CALL_TYPE,
|
|
19
|
-
EXEC_TYPE,
|
|
18
|
+
type CALL_TYPE,
|
|
19
|
+
type EXEC_TYPE,
|
|
20
20
|
KernelImplToVersionMap,
|
|
21
21
|
LATEST_KERNEL_VERSION
|
|
22
22
|
} from "./constants.js"
|