@zerodev/permissions 5.4.10 → 5.5.0-beta.1

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 (46) hide show
  1. package/_cjs/deserializePermissionAccount.js +9 -12
  2. package/_cjs/deserializePermissionAccount.js.map +1 -1
  3. package/_cjs/serializeMultiChainPermissionAccounts.js.map +1 -1
  4. package/_cjs/serializePermissionAccount.js.map +1 -1
  5. package/_cjs/signers/toECDSASigner.js +5 -11
  6. package/_cjs/signers/toECDSASigner.js.map +1 -1
  7. package/_cjs/signers/toWebAuthnSigner.js +3 -4
  8. package/_cjs/signers/toWebAuthnSigner.js.map +1 -1
  9. package/_cjs/toPermissionValidator.js +11 -8
  10. package/_cjs/toPermissionValidator.js.map +1 -1
  11. package/_cjs/utils.js.map +1 -1
  12. package/_esm/deserializePermissionAccount.js +9 -12
  13. package/_esm/deserializePermissionAccount.js.map +1 -1
  14. package/_esm/serializeMultiChainPermissionAccounts.js.map +1 -1
  15. package/_esm/serializePermissionAccount.js.map +1 -1
  16. package/_esm/signers/toECDSASigner.js +4 -10
  17. package/_esm/signers/toECDSASigner.js.map +1 -1
  18. package/_esm/signers/toWebAuthnSigner.js +1 -2
  19. package/_esm/signers/toWebAuthnSigner.js.map +1 -1
  20. package/_esm/toPermissionValidator.js +10 -7
  21. package/_esm/toPermissionValidator.js.map +1 -1
  22. package/_esm/utils.js.map +1 -1
  23. package/_types/deserializePermissionAccount.d.ts +262 -4
  24. package/_types/deserializePermissionAccount.d.ts.map +1 -1
  25. package/_types/serializeMultiChainPermissionAccounts.d.ts +5 -5
  26. package/_types/serializeMultiChainPermissionAccounts.d.ts.map +1 -1
  27. package/_types/serializePermissionAccount.d.ts +3 -3
  28. package/_types/serializePermissionAccount.d.ts.map +1 -1
  29. package/_types/signers/toECDSASigner.d.ts +4 -5
  30. package/_types/signers/toECDSASigner.d.ts.map +1 -1
  31. package/_types/signers/toWebAuthnSigner.d.ts.map +1 -1
  32. package/_types/toPermissionValidator.d.ts +3 -3
  33. package/_types/toPermissionValidator.d.ts.map +1 -1
  34. package/_types/types.d.ts +6 -6
  35. package/_types/types.d.ts.map +1 -1
  36. package/_types/utils.d.ts +1 -2
  37. package/_types/utils.d.ts.map +1 -1
  38. package/deserializePermissionAccount.ts +16 -37
  39. package/package.json +4 -5
  40. package/serializeMultiChainPermissionAccounts.ts +9 -12
  41. package/serializePermissionAccount.ts +4 -4
  42. package/signers/toECDSASigner.ts +11 -23
  43. package/signers/toWebAuthnSigner.ts +3 -2
  44. package/toPermissionValidator.ts +18 -16
  45. package/types.ts +8 -8
  46. package/utils.ts +2 -3
@@ -1,9 +1,267 @@
1
- import type { GetKernelVersion, KERNEL_VERSION_TYPE, ValidatorInitData } from "@zerodev/sdk/types";
2
- import type { EntryPoint } from "permissionless/types";
3
- import type { Chain, Client, Hex, PublicActions, PublicRpcSchema, Transport } from "viem";
1
+ import type { EntryPointType, GetKernelVersion, KERNEL_VERSION_TYPE, ValidatorInitData } from "@zerodev/sdk/types";
2
+ import type { Client, Hex } from "viem";
3
+ import type { EntryPointVersion } from "viem/account-abstraction";
4
4
  import type { Policy } from "./types.js";
5
5
  import type { ModularSigner } from "./types.js";
6
- export declare const deserializePermissionAccount: <entryPoint extends EntryPoint, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain, undefined, PublicRpcSchema, PublicActions<TTransport, TChain>>, entryPointAddress: entryPoint, kernelVersion: GetKernelVersion<entryPoint>, modularPermissionAccountParams: string, modularSigner?: ModularSigner) => Promise<import("@zerodev/sdk").KernelSmartAccount<entryPoint, TTransport, TChain>>;
6
+ export declare const deserializePermissionAccount: <entryPointVersion extends EntryPointVersion>(client: Client, entryPoint: EntryPointType<entryPointVersion>, kernelVersion: GetKernelVersion<entryPointVersion>, modularPermissionAccountParams: string, modularSigner?: ModularSigner) => Promise<object & {
7
+ client: Client;
8
+ entryPoint: {
9
+ abi: import("@zerodev/sdk/types").GetEntryPointAbi<entryPointVersion>;
10
+ address: `0x${string}`;
11
+ version: entryPointVersion;
12
+ };
13
+ extend?: object | undefined;
14
+ getAddress: () => Promise<`0x${string}`>;
15
+ decodeCalls?: ((data: `0x${string}`) => Promise<readonly {
16
+ to: `0x${string}`;
17
+ data?: `0x${string}` | undefined;
18
+ value?: bigint | undefined;
19
+ }[]>) | undefined;
20
+ encodeCalls: (calls: readonly {
21
+ to: `0x${string}`;
22
+ data?: `0x${string}` | undefined;
23
+ value?: bigint | undefined;
24
+ }[], callType?: import("@zerodev/sdk/types").CallType | undefined) => Promise<`0x${string}`>;
25
+ getFactoryArgs: () => Promise<{
26
+ factory?: `0x${string}` | undefined;
27
+ factoryData?: `0x${string}` | undefined;
28
+ }>;
29
+ getNonce?: ((parameters?: {
30
+ key?: bigint | undefined;
31
+ } | undefined) => Promise<bigint>) | undefined;
32
+ getStubSignature: (parameters?: import("viem/account-abstraction").UserOperationRequest | undefined) => Promise<`0x${string}`>;
33
+ nonceKeyManager?: import("viem").NonceManager | undefined;
34
+ sign: (parameters: {
35
+ hash: `0x${string}`;
36
+ }) => Promise<`0x${string}`>;
37
+ signMessage: (parameters: {
38
+ message: import("viem").SignableMessage;
39
+ }) => Promise<`0x${string}`>;
40
+ signTypedData: <const typedData extends Record<string, unknown> | {
41
+ [x: string]: readonly import("viem").TypedDataParameter[];
42
+ [x: `string[${string}]`]: undefined;
43
+ [x: `function[${string}]`]: undefined;
44
+ [x: `uint128[${string}]`]: undefined;
45
+ [x: `bool[${string}]`]: undefined;
46
+ [x: `address[${string}]`]: undefined;
47
+ [x: `bytes[${string}]`]: undefined;
48
+ [x: `bytes3[${string}]`]: undefined;
49
+ [x: `bytes1[${string}]`]: undefined;
50
+ [x: `bytes2[${string}]`]: undefined;
51
+ [x: `bytes4[${string}]`]: undefined;
52
+ [x: `bytes5[${string}]`]: undefined;
53
+ [x: `bytes6[${string}]`]: undefined;
54
+ [x: `bytes7[${string}]`]: undefined;
55
+ [x: `bytes8[${string}]`]: undefined;
56
+ [x: `bytes9[${string}]`]: undefined;
57
+ [x: `bytes10[${string}]`]: undefined;
58
+ [x: `bytes11[${string}]`]: undefined;
59
+ [x: `bytes12[${string}]`]: undefined;
60
+ [x: `bytes13[${string}]`]: undefined;
61
+ [x: `bytes14[${string}]`]: undefined;
62
+ [x: `bytes15[${string}]`]: undefined;
63
+ [x: `bytes16[${string}]`]: undefined;
64
+ [x: `bytes17[${string}]`]: undefined;
65
+ [x: `bytes18[${string}]`]: undefined;
66
+ [x: `bytes19[${string}]`]: undefined;
67
+ [x: `bytes20[${string}]`]: undefined;
68
+ [x: `bytes21[${string}]`]: undefined;
69
+ [x: `bytes22[${string}]`]: undefined;
70
+ [x: `bytes23[${string}]`]: undefined;
71
+ [x: `bytes24[${string}]`]: undefined;
72
+ [x: `bytes25[${string}]`]: undefined;
73
+ [x: `bytes26[${string}]`]: undefined;
74
+ [x: `bytes27[${string}]`]: undefined;
75
+ [x: `bytes28[${string}]`]: undefined;
76
+ [x: `bytes29[${string}]`]: undefined;
77
+ [x: `bytes30[${string}]`]: undefined;
78
+ [x: `bytes31[${string}]`]: undefined;
79
+ [x: `bytes32[${string}]`]: undefined;
80
+ [x: `int[${string}]`]: undefined;
81
+ [x: `int8[${string}]`]: undefined;
82
+ [x: `int16[${string}]`]: undefined;
83
+ [x: `int24[${string}]`]: undefined;
84
+ [x: `int32[${string}]`]: undefined;
85
+ [x: `int40[${string}]`]: undefined;
86
+ [x: `int48[${string}]`]: undefined;
87
+ [x: `int56[${string}]`]: undefined;
88
+ [x: `int64[${string}]`]: undefined;
89
+ [x: `int72[${string}]`]: undefined;
90
+ [x: `int80[${string}]`]: undefined;
91
+ [x: `int88[${string}]`]: undefined;
92
+ [x: `int96[${string}]`]: undefined;
93
+ [x: `int104[${string}]`]: undefined;
94
+ [x: `int112[${string}]`]: undefined;
95
+ [x: `int120[${string}]`]: undefined;
96
+ [x: `int128[${string}]`]: undefined;
97
+ [x: `int136[${string}]`]: undefined;
98
+ [x: `int144[${string}]`]: undefined;
99
+ [x: `int152[${string}]`]: undefined;
100
+ [x: `int160[${string}]`]: undefined;
101
+ [x: `int168[${string}]`]: undefined;
102
+ [x: `int176[${string}]`]: undefined;
103
+ [x: `int184[${string}]`]: undefined;
104
+ [x: `int192[${string}]`]: undefined;
105
+ [x: `int200[${string}]`]: undefined;
106
+ [x: `int208[${string}]`]: undefined;
107
+ [x: `int216[${string}]`]: undefined;
108
+ [x: `int224[${string}]`]: undefined;
109
+ [x: `int232[${string}]`]: undefined;
110
+ [x: `int240[${string}]`]: undefined;
111
+ [x: `int248[${string}]`]: undefined;
112
+ [x: `int256[${string}]`]: undefined;
113
+ [x: `uint[${string}]`]: undefined;
114
+ [x: `uint8[${string}]`]: undefined;
115
+ [x: `uint16[${string}]`]: undefined;
116
+ [x: `uint24[${string}]`]: undefined;
117
+ [x: `uint32[${string}]`]: undefined;
118
+ [x: `uint40[${string}]`]: undefined;
119
+ [x: `uint48[${string}]`]: undefined;
120
+ [x: `uint56[${string}]`]: undefined;
121
+ [x: `uint64[${string}]`]: undefined;
122
+ [x: `uint72[${string}]`]: undefined;
123
+ [x: `uint80[${string}]`]: undefined;
124
+ [x: `uint88[${string}]`]: undefined;
125
+ [x: `uint96[${string}]`]: undefined;
126
+ [x: `uint104[${string}]`]: undefined;
127
+ [x: `uint112[${string}]`]: undefined;
128
+ [x: `uint120[${string}]`]: undefined;
129
+ [x: `uint136[${string}]`]: undefined;
130
+ [x: `uint144[${string}]`]: undefined;
131
+ [x: `uint152[${string}]`]: undefined;
132
+ [x: `uint160[${string}]`]: undefined;
133
+ [x: `uint168[${string}]`]: undefined;
134
+ [x: `uint176[${string}]`]: undefined;
135
+ [x: `uint184[${string}]`]: undefined;
136
+ [x: `uint192[${string}]`]: undefined;
137
+ [x: `uint200[${string}]`]: undefined;
138
+ [x: `uint208[${string}]`]: undefined;
139
+ [x: `uint216[${string}]`]: undefined;
140
+ [x: `uint224[${string}]`]: undefined;
141
+ [x: `uint232[${string}]`]: undefined;
142
+ [x: `uint240[${string}]`]: undefined;
143
+ [x: `uint248[${string}]`]: undefined;
144
+ [x: `uint256[${string}]`]: undefined;
145
+ string?: undefined;
146
+ uint128?: undefined;
147
+ bool?: undefined;
148
+ address?: undefined;
149
+ bytes?: undefined;
150
+ bytes3?: undefined;
151
+ bytes1?: undefined;
152
+ bytes2?: undefined;
153
+ bytes4?: undefined;
154
+ bytes5?: undefined;
155
+ bytes6?: undefined;
156
+ bytes7?: undefined;
157
+ bytes8?: undefined;
158
+ bytes9?: undefined;
159
+ bytes10?: undefined;
160
+ bytes11?: undefined;
161
+ bytes12?: undefined;
162
+ bytes13?: undefined;
163
+ bytes14?: undefined;
164
+ bytes15?: undefined;
165
+ bytes16?: undefined;
166
+ bytes17?: undefined;
167
+ bytes18?: undefined;
168
+ bytes19?: undefined;
169
+ bytes20?: undefined;
170
+ bytes21?: undefined;
171
+ bytes22?: undefined;
172
+ bytes23?: undefined;
173
+ bytes24?: undefined;
174
+ bytes25?: undefined;
175
+ bytes26?: undefined;
176
+ bytes27?: undefined;
177
+ bytes28?: undefined;
178
+ bytes29?: undefined;
179
+ bytes30?: undefined;
180
+ bytes31?: undefined;
181
+ bytes32?: undefined;
182
+ int8?: undefined;
183
+ int16?: undefined;
184
+ int24?: undefined;
185
+ int32?: undefined;
186
+ int40?: undefined;
187
+ int48?: undefined;
188
+ int56?: undefined;
189
+ int64?: undefined;
190
+ int72?: undefined;
191
+ int80?: undefined;
192
+ int88?: undefined;
193
+ int96?: undefined;
194
+ int104?: undefined;
195
+ int112?: undefined;
196
+ int120?: undefined;
197
+ int128?: undefined;
198
+ int136?: undefined;
199
+ int144?: undefined;
200
+ int152?: undefined;
201
+ int160?: undefined;
202
+ int168?: undefined;
203
+ int176?: undefined;
204
+ int184?: undefined;
205
+ int192?: undefined;
206
+ int200?: undefined;
207
+ int208?: undefined;
208
+ int216?: undefined;
209
+ int224?: undefined;
210
+ int232?: undefined;
211
+ int240?: undefined;
212
+ int248?: undefined;
213
+ int256?: undefined;
214
+ uint8?: undefined;
215
+ uint16?: undefined;
216
+ uint24?: undefined;
217
+ uint32?: undefined;
218
+ uint40?: undefined;
219
+ uint48?: undefined;
220
+ uint56?: undefined;
221
+ uint64?: undefined;
222
+ uint72?: undefined;
223
+ uint80?: undefined;
224
+ uint88?: undefined;
225
+ uint96?: undefined;
226
+ uint104?: undefined;
227
+ uint112?: undefined;
228
+ uint120?: undefined;
229
+ uint136?: undefined;
230
+ uint144?: undefined;
231
+ uint152?: undefined;
232
+ uint160?: undefined;
233
+ uint168?: undefined;
234
+ uint176?: undefined;
235
+ uint184?: undefined;
236
+ uint192?: undefined;
237
+ uint200?: undefined;
238
+ uint208?: undefined;
239
+ uint216?: undefined;
240
+ uint224?: undefined;
241
+ uint232?: undefined;
242
+ uint240?: undefined;
243
+ uint248?: undefined;
244
+ uint256?: undefined;
245
+ }, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
246
+ signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
247
+ chainId?: number | undefined;
248
+ }) => Promise<`0x${string}`>;
249
+ userOperation?: {
250
+ estimateGas?: ((userOperation: import("viem/account-abstraction").UserOperationRequest) => Promise<import("viem").ExactPartial<import("viem/_types/account-abstraction/types/userOperation.js").EstimateUserOperationGasReturnType> | undefined>) | undefined;
251
+ } | undefined;
252
+ kernelVersion: GetKernelVersion<entryPointVersion>;
253
+ kernelPluginManager: import("@zerodev/sdk").KernelPluginManager<entryPointVersion>;
254
+ generateInitCode: () => Promise<`0x${string}`>;
255
+ encodeModuleInstallCallData: () => Promise<`0x${string}`>;
256
+ encodeDeployCallData: ({ abi, args, bytecode }: import("viem").EncodeDeployDataParameters) => Promise<`0x${string}`>;
257
+ } & {
258
+ address: `0x${string}`;
259
+ getNonce: (parameters?: {
260
+ key?: bigint | undefined;
261
+ } | undefined) => Promise<bigint>;
262
+ isDeployed: () => Promise<boolean>;
263
+ type: "smart";
264
+ }>;
7
265
  export declare const createPolicyFromParams: (policy: Policy) => Promise<Policy>;
8
266
  export declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VERSION_TYPE) => {
9
267
  index: bigint;
@@ -1 +1 @@
1
- {"version":3,"file":"deserializePermissionAccount.d.ts","sourceRoot":"","sources":["../deserializePermissionAccount.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACpB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACN,GAAG,EACH,aAAa,EACb,eAAe,EACf,SAAS,EACZ,MAAM,MAAM,CAAA;AAcb,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,eAAO,MAAM,4BAA4B,iVAcL,MAAM,kBACtB,aAAa,uFAoDhC,CAAA;AAED,eAAO,MAAM,sBAAsB,WAAkB,MAAM,oBAiB1D,CAAA;AAED,eAAO,MAAM,wBAAwB,aACvB,GAAG,iBACE,mBAAmB;;;;CAoFrC,CAAA"}
1
+ {"version":3,"file":"deserializePermissionAccount.d.ts","sourceRoot":"","sources":["../deserializePermissionAccount.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACR,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAEvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAajE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,eAAO,MAAM,4BAA4B,wDAG7B,MAAM,qIAGkB,MAAM,kBACtB,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgDhC,CAAA;AAED,eAAO,MAAM,sBAAsB,WAAkB,MAAM,oBAiB1D,CAAA;AAED,eAAO,MAAM,wBAAwB,aACvB,GAAG,iBACE,mBAAmB;;;;CAmFrC,CAAA"}
@@ -1,9 +1,9 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk";
2
- import type { EntryPoint } from "permissionless/types";
1
+ import type { KernelSmartAccountImplementation } from "@zerodev/sdk";
3
2
  import { type Hex } from "viem";
4
- export type MultiChainPermissionAccountsParams<entryPoint extends EntryPoint> = {
5
- account: KernelSmartAccount<entryPoint>;
3
+ import type { SmartAccount } from "viem/account-abstraction";
4
+ export type MultiChainPermissionAccountsParams = {
5
+ account: SmartAccount<KernelSmartAccountImplementation>;
6
6
  privateKey?: Hex;
7
7
  };
8
- export declare const serializeMultiChainPermissionAccounts: <entryPoint extends EntryPoint>(params: MultiChainPermissionAccountsParams<entryPoint>[]) => Promise<string[]>;
8
+ export declare const serializeMultiChainPermissionAccounts: (params: MultiChainPermissionAccountsParams[]) => Promise<string[]>;
9
9
  //# sourceMappingURL=serializeMultiChainPermissionAccounts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializeMultiChainPermissionAccounts.d.ts","sourceRoot":"","sources":["../serializeMultiChainPermissionAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACH,KAAK,GAAG,EAMX,MAAM,MAAM,CAAA;AAOb,MAAM,MAAM,kCAAkC,CAAC,UAAU,SAAS,UAAU,IACxE;IACI,OAAO,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAA;IACvC,UAAU,CAAC,EAAE,GAAG,CAAA;CACnB,CAAA;AAEL,eAAO,MAAM,qCAAqC,+FAI/C,QAAQ,MAAM,EAAE,CAoIlB,CAAA"}
1
+ {"version":3,"file":"serializeMultiChainPermissionAccounts.d.ts","sourceRoot":"","sources":["../serializeMultiChainPermissionAccounts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAA;AAEpE,OAAO,EACH,KAAK,GAAG,EAMX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAO5D,MAAM,MAAM,kCAAkC,GAAG;IAC7C,OAAO,EAAE,YAAY,CAAC,gCAAgC,CAAC,CAAA;IACvD,UAAU,CAAC,EAAE,GAAG,CAAA;CACnB,CAAA;AAED,eAAO,MAAM,qCAAqC,WACtC,kCAAkC,EAAE,KAC7C,QAAQ,MAAM,EAAE,CAoIlB,CAAA"}
@@ -1,5 +1,5 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk";
2
- import type { EntryPoint } from "permissionless/types";
1
+ import type { KernelSmartAccountImplementation } from "@zerodev/sdk";
3
2
  import type { Hex } from "viem";
4
- export declare const serializePermissionAccount: <entryPoint extends EntryPoint>(account: KernelSmartAccount<entryPoint>, privateKey?: Hex, enableSignature?: Hex) => Promise<string>;
3
+ import type { SmartAccount } from "viem/account-abstraction";
4
+ export declare const serializePermissionAccount: (account: SmartAccount<KernelSmartAccountImplementation>, privateKey?: Hex, enableSignature?: Hex) => Promise<string>;
5
5
  //# sourceMappingURL=serializePermissionAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializePermissionAccount.d.ts","sourceRoot":"","sources":["../serializePermissionAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAM/B,eAAO,MAAM,0BAA0B,wFAEtB,GAAG,oBACE,GAAG,KACtB,QAAQ,MAAM,CA2BhB,CAAA"}
1
+ {"version":3,"file":"serializePermissionAccount.d.ts","sourceRoot":"","sources":["../serializePermissionAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAM5D,eAAO,MAAM,0BAA0B,YAC1B,aAAa,gCAAgC,CAAC,eAC1C,GAAG,oBACE,GAAG,KACtB,QAAQ,MAAM,CA2BhB,CAAA"}
@@ -1,8 +1,7 @@
1
- import { type SmartAccountSigner } from "permissionless/accounts";
2
- import type { Address } from "viem";
1
+ import type { Signer } from "@zerodev/sdk/types";
3
2
  import type { ModularSigner, ModularSignerParams } from "../types.js";
4
- export type ECDSAModularSignerParams<TSource extends string = "custom", TAddress extends Address = Address> = ModularSignerParams & {
5
- signer: SmartAccountSigner<TSource, TAddress>;
3
+ export type ECDSAModularSignerParams = ModularSignerParams & {
4
+ signer: Signer;
6
5
  };
7
- export declare function toECDSASigner<TSource extends string = "custom", TAddress extends Address = Address>({ signer, signerContractAddress }: ECDSAModularSignerParams<TSource, TAddress>): ModularSigner;
6
+ export declare function toECDSASigner({ signer, signerContractAddress }: ECDSAModularSignerParams): Promise<ModularSigner>;
8
7
  //# sourceMappingURL=toECDSASigner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toECDSASigner.d.ts","sourceRoot":"","sources":["../../signers/toECDSASigner.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,KAAK,kBAAkB,EAC1B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,MAAM,CAAA;AAGtE,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,MAAM,wBAAwB,CAChC,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,IAClC,mBAAmB,GAAG;IACtB,MAAM,EAAE,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;CAChD,CAAA;AAED,wBAAgB,aAAa,CACzB,OAAO,SAAS,MAAM,GAAG,QAAQ,EACjC,QAAQ,SAAS,OAAO,GAAG,OAAO,EACpC,EACE,MAAM,EACN,qBAA6C,EAChD,EAAE,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,aAAa,CAoC7D"}
1
+ {"version":3,"file":"toECDSASigner.d.ts","sourceRoot":"","sources":["../../signers/toECDSASigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAKhD,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IACzD,MAAM,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,wBAAsB,aAAa,CAAC,EAChC,MAAM,EACN,qBAA6C,EAChD,EAAE,wBAAwB,GAAG,OAAO,CAAC,aAAa,CAAC,CAiCnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"toWebAuthnSigner.d.ts","sourceRoot":"","sources":["../../signers/toWebAuthnSigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA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@@
1
- import type { EntryPoint } from "permissionless/types/entrypoint";
2
- import { type Chain, type Client, type Transport } from "viem";
1
+ import { type Client } from "viem";
2
+ import { type EntryPointVersion } from "viem/account-abstraction";
3
3
  import type { PermissionPlugin, PermissionPluginParams } from "./types.js";
4
- export declare function toPermissionValidator<entryPoint extends EntryPoint, TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined>(client: Client<TTransport, TChain, undefined>, { signer, policies, entryPoint: entryPointAddress, kernelVersion, flag }: PermissionPluginParams<entryPoint>): Promise<PermissionPlugin<entryPoint>>;
4
+ export declare function toPermissionValidator<entryPointVersion extends EntryPointVersion>(client: Client, { signer, policies, entryPoint, kernelVersion, flag }: PermissionPluginParams<entryPointVersion>): Promise<PermissionPlugin>;
5
5
  //# sourceMappingURL=toPermissionValidator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"toPermissionValidator.d.ts","sourceRoot":"","sources":["../toPermissionValidator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,EAEH,KAAK,KAAK,EACV,KAAK,MAAM,EAEX,KAAK,SAAS,EAMjB,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EAER,gBAAgB,EAChB,sBAAsB,EACzB,MAAM,YAAY,CAAA;AAEnB,wBAAsB,qBAAqB,CACvC,UAAU,SAAS,UAAU,EAC7B,UAAU,SAAS,SAAS,GAAG,SAAS,EACxC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EAEpD,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAC7C,EACI,MAAM,EACN,QAAQ,EACR,UAAU,EAAE,iBAAiB,EAC7B,aAAgB,EAChB,IAAqC,EACxC,EAAE,sBAAsB,CAAC,UAAU,CAAC,GACtC,OAAO,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CA+GvC"}
1
+ {"version":3,"file":"toPermissionValidator.d.ts","sourceRoot":"","sources":["../toPermissionValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,MAAM,EAOd,MAAM,MAAM,CAAA;AACb,OAAO,EACH,KAAK,iBAAiB,EAGzB,MAAM,0BAA0B,CAAA;AAMjC,OAAO,KAAK,EAER,gBAAgB,EAChB,sBAAsB,EACzB,MAAM,YAAY,CAAA;AAEnB,wBAAsB,qBAAqB,CACvC,iBAAiB,SAAS,iBAAiB,EAE3C,MAAM,EAAE,MAAM,EACd,EACI,MAAM,EACN,QAAQ,EACR,UAAU,EACV,aAAgB,EAChB,IAAqC,EACxC,EAAE,sBAAsB,CAAC,iBAAiB,CAAC,GAC7C,OAAO,CAAC,gBAAgB,CAAC,CAkH3B"}
package/_types/types.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { KernelValidator } from "@zerodev/sdk";
2
- import type { Action, GetKernelVersion, PluginValidityData } from "@zerodev/sdk/types";
3
- import type { EntryPoint } from "permissionless/types/entrypoint";
2
+ import type { Action, EntryPointType, GetKernelVersion, PluginValidityData } from "@zerodev/sdk/types";
4
3
  import type { Abi, Address, Hex, LocalAccount } from "viem";
4
+ import type { EntryPointVersion } from "viem/account-abstraction";
5
5
  import type { PolicyFlags } from "./constants.js";
6
6
  import type { CallPolicyParams, GasPolicyParams, RateLimitPolicyParams, SignatureCallerPolicyParams, SudoPolicyParams, TimestampPolicyParams } from "./policies/index.js";
7
- export type PermissionPlugin<entryPoint extends EntryPoint> = KernelValidator<entryPoint, "PermissionValidator"> & {
7
+ export type PermissionPlugin = KernelValidator<"PermissionValidator"> & {
8
8
  getPluginSerializationParams: () => PermissionData;
9
9
  };
10
10
  export type ModularSignerParams = {
@@ -37,11 +37,11 @@ export type Policy = {
37
37
  type: "timestamp";
38
38
  });
39
39
  };
40
- export type PermissionPluginParams<entryPoint extends EntryPoint> = {
40
+ export type PermissionPluginParams<entryPointVersion extends EntryPointVersion> = {
41
41
  signer: ModularSigner;
42
42
  policies: Policy[];
43
- entryPoint: entryPoint;
44
- kernelVersion: GetKernelVersion<entryPoint>;
43
+ entryPoint: EntryPointType<entryPointVersion>;
44
+ kernelVersion: GetKernelVersion<entryPointVersion>;
45
45
  flag?: PolicyFlags;
46
46
  };
47
47
  export interface PermissionData {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AACnD,OAAO,KAAK,EACR,MAAM,EACN,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EACR,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,2BAA2B,EAC3B,gBAAgB,EAChB,qBAAqB,EACxB,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,gBAAgB,CAAC,UAAU,SAAS,UAAU,IAAI,eAAe,CACzE,UAAU,EACV,qBAAqB,CACxB,GAAG;IACA,4BAA4B,EAAE,MAAM,cAAc,CAAA;CACrD,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAC9B,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAClC,CAAA;AACD,MAAM,MAAM,YAAY,GAAG;IACvB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,WAAW,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,YAAY,CAAA;IACrB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,aAAa,EAAE,MAAM,GAAG,CAAA;IACxB,iBAAiB,EAAE,MAAM,GAA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from "permissionless/types";
2
1
  import type { PermissionAccountParams, PermissionPlugin } from "./types.js";
3
2
  export declare function base64ToBytes(base64: string): Uint8Array;
4
3
  export declare function bytesToBase64(bytes: Uint8Array): string;
5
- export declare function isPermissionValidatorPlugin<entryPoint extends EntryPoint>(plugin: any): plugin is PermissionPlugin<entryPoint>;
4
+ export declare function isPermissionValidatorPlugin(plugin: any): plugin is PermissionPlugin;
6
5
  export declare const serializePermissionAccountParams: (params: PermissionAccountParams) => string;
7
6
  export declare const deserializePermissionAccountParams: (params: string) => PermissionAccountParams;
8
7
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE3E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,cAG3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,UAG9C;AAED,wBAAgB,2BAA2B,CAAC,UAAU,SAAS,UAAU,EAErE,MAAM,EAAE,GAAG,GACZ,MAAM,IAAI,gBAAgB,CAAC,UAAU,CAAC,CAExC;AAED,eAAO,MAAM,gCAAgC,WACjC,uBAAuB,WAclC,CAAA;AAED,eAAO,MAAM,kCAAkC,WAAY,MAAM,4BAIhE,CAAA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE3E,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,cAG3C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,UAAU,UAG9C;AAED,wBAAgB,2BAA2B,CAEvC,MAAM,EAAE,GAAG,GACZ,MAAM,IAAI,gBAAgB,CAE5B;AAED,eAAO,MAAM,gCAAgC,WACjC,uBAAuB,WAclC,CAAA;AAED,eAAO,MAAM,kCAAkC,WAAY,MAAM,4BAIhE,CAAA"}
@@ -7,22 +7,14 @@ import {
7
7
  } from "@zerodev/sdk"
8
8
  import { toKernelPluginManager } from "@zerodev/sdk/accounts"
9
9
  import type {
10
+ EntryPointType,
10
11
  GetKernelVersion,
11
12
  KERNEL_VERSION_TYPE,
12
13
  ValidatorInitData
13
14
  } from "@zerodev/sdk/types"
14
- import { getEntryPointVersion } from "permissionless"
15
- import type { SmartAccountSigner } from "permissionless/accounts"
16
- import type { EntryPoint } from "permissionless/types"
17
- import type {
18
- Chain,
19
- Client,
20
- Hex,
21
- PublicActions,
22
- PublicRpcSchema,
23
- Transport
24
- } from "viem"
15
+ import type { Client, Hex } from "viem"
25
16
  import { decodeFunctionData } from "viem"
17
+ import type { EntryPointVersion } from "viem/account-abstraction"
26
18
  import { privateKeyToAccount } from "viem/accounts"
27
19
  import type { DecodeFunctionDataReturnType } from "viem/utils"
28
20
  import {
@@ -40,25 +32,15 @@ import type { ModularSigner } from "./types.js"
40
32
  import { deserializePermissionAccountParams } from "./utils.js"
41
33
 
42
34
  export const deserializePermissionAccount = async <
43
- entryPoint extends EntryPoint,
44
- TTransport extends Transport = Transport,
45
- TChain extends Chain | undefined = Chain | undefined
35
+ entryPointVersion extends EntryPointVersion
46
36
  >(
47
- client: Client<
48
- TTransport,
49
- TChain,
50
- undefined,
51
- PublicRpcSchema,
52
- PublicActions<TTransport, TChain>
53
- >,
54
- entryPointAddress: entryPoint,
55
- kernelVersion: GetKernelVersion<entryPoint>,
37
+ client: Client,
38
+ entryPoint: EntryPointType<entryPointVersion>,
39
+ kernelVersion: GetKernelVersion<entryPointVersion>,
56
40
  modularPermissionAccountParams: string,
57
41
  modularSigner?: ModularSigner
58
42
  ) => {
59
- const entryPointVersion = getEntryPointVersion(entryPointAddress)
60
-
61
- if (entryPointVersion !== "v0.7") {
43
+ if (entryPoint.version !== "0.7") {
62
44
  throw new Error("Only EntryPoint 0.7 is supported")
63
45
  }
64
46
  const params = deserializePermissionAccountParams(
@@ -66,10 +48,8 @@ export const deserializePermissionAccount = async <
66
48
  )
67
49
  let signer: ModularSigner
68
50
  if (params.privateKey)
69
- signer = toECDSASigner({
70
- signer: privateKeyToAccount(
71
- params.privateKey
72
- ) as SmartAccountSigner<"privateKey", `0x${string}`>
51
+ signer = await toECDSASigner({
52
+ signer: privateKeyToAccount(params.privateKey)
73
53
  })
74
54
  else if (modularSigner) signer = modularSigner
75
55
  else throw new Error("No signer or serialized sessionKey provided")
@@ -81,7 +61,7 @@ export const deserializePermissionAccount = async <
81
61
  createPolicyFromParams(policy)
82
62
  ) || []
83
63
  ),
84
- entryPoint: entryPointAddress,
64
+ entryPoint,
85
65
  kernelVersion
86
66
  })
87
67
 
@@ -93,17 +73,17 @@ export const deserializePermissionAccount = async <
93
73
  pluginEnableSignature: params.enableSignature,
94
74
  validatorInitData,
95
75
  action: params.action,
96
- entryPoint: entryPointAddress,
76
+ entryPoint,
97
77
  kernelVersion,
98
78
  ...params.validityData
99
79
  })
100
80
 
101
81
  return createKernelAccount(client, {
102
- entryPoint: entryPointAddress,
82
+ entryPoint,
103
83
  kernelVersion,
104
84
  plugins: kernelPluginManager,
105
85
  index,
106
- deployedAccountAddress: params.accountParams.accountAddress,
86
+ address: params.accountParams.accountAddress,
107
87
  useMetaFactory
108
88
  })
109
89
  }
@@ -133,7 +113,6 @@ export const decodeParamsFromInitCode = (
133
113
  ) => {
134
114
  let index: bigint | undefined
135
115
  let validatorInitData: ValidatorInitData | undefined
136
- const initCodeWithoutFactoryAddress: Hex = `0x${initCode.slice(42)}`
137
116
  let deployWithFactoryFunctionData:
138
117
  | DecodeFunctionDataReturnType<typeof KernelFactoryStakerAbi>
139
118
  | DecodeFunctionDataReturnType<typeof KernelV3FactoryAbi>
@@ -141,12 +120,12 @@ export const decodeParamsFromInitCode = (
141
120
  try {
142
121
  deployWithFactoryFunctionData = decodeFunctionData({
143
122
  abi: KernelFactoryStakerAbi,
144
- data: initCodeWithoutFactoryAddress
123
+ data: initCode
145
124
  })
146
125
  } catch (error) {
147
126
  deployWithFactoryFunctionData = decodeFunctionData({
148
127
  abi: KernelV3FactoryAbi,
149
- data: initCodeWithoutFactoryAddress
128
+ data: initCode
150
129
  })
151
130
  useMetaFactory = false
152
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/permissions",
3
- "version": "5.4.10",
3
+ "version": "5.5.0-beta.1",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -56,9 +56,8 @@
56
56
  "@simplewebauthn/browser": "^9.0.1"
57
57
  },
58
58
  "peerDependencies": {
59
- "viem": ">=2.16.3 <2.18.0",
60
- "@zerodev/sdk": "^5.2.13",
61
- "@zerodev/webauthn-key": "^5.3.0",
62
- "permissionless": ">=0.1.44 <=0.1.45"
59
+ "viem": "^2.21.40",
60
+ "@zerodev/sdk": "^5.4.0-beta.0",
61
+ "@zerodev/webauthn-key": "^5.4.0-beta.0"
63
62
  }
64
63
  }
@@ -1,6 +1,5 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk"
1
+ import type { KernelSmartAccountImplementation } from "@zerodev/sdk"
2
2
  import { MerkleTree } from "merkletreejs"
3
- import type { EntryPoint } from "permissionless/types"
4
3
  import {
5
4
  type Hex,
6
5
  concatHex,
@@ -9,22 +8,20 @@ import {
9
8
  hashTypedData,
10
9
  keccak256
11
10
  } from "viem"
11
+ import type { SmartAccount } from "viem/account-abstraction"
12
12
  import type { PermissionPlugin } from "./types.js"
13
13
  import {
14
14
  isPermissionValidatorPlugin,
15
15
  serializePermissionAccountParams
16
16
  } from "./utils.js"
17
17
 
18
- export type MultiChainPermissionAccountsParams<entryPoint extends EntryPoint> =
19
- {
20
- account: KernelSmartAccount<entryPoint>
21
- privateKey?: Hex
22
- }
18
+ export type MultiChainPermissionAccountsParams = {
19
+ account: SmartAccount<KernelSmartAccountImplementation>
20
+ privateKey?: Hex
21
+ }
23
22
 
24
- export const serializeMultiChainPermissionAccounts = async <
25
- entryPoint extends EntryPoint
26
- >(
27
- params: MultiChainPermissionAccountsParams<entryPoint>[]
23
+ export const serializeMultiChainPermissionAccounts = async (
24
+ params: MultiChainPermissionAccountsParams[]
28
25
  ): Promise<string[]> => {
29
26
  if (params.length === 0) return []
30
27
 
@@ -33,7 +30,7 @@ export const serializeMultiChainPermissionAccounts = async <
33
30
  throw new Error("Account plugin is not a permission validator")
34
31
  }
35
32
  return (
36
- param.account.kernelPluginManager as PermissionPlugin<entryPoint>
33
+ param.account.kernelPluginManager as PermissionPlugin
37
34
  ).getPluginSerializationParams()
38
35
  })
39
36
 
@@ -1,13 +1,13 @@
1
- import type { KernelSmartAccount } from "@zerodev/sdk"
2
- import type { EntryPoint } from "permissionless/types"
1
+ import type { KernelSmartAccountImplementation } from "@zerodev/sdk"
3
2
  import type { Hex } from "viem"
3
+ import type { SmartAccount } from "viem/account-abstraction"
4
4
  import {
5
5
  isPermissionValidatorPlugin,
6
6
  serializePermissionAccountParams
7
7
  } from "./utils.js"
8
8
 
9
- export const serializePermissionAccount = async <entryPoint extends EntryPoint>(
10
- account: KernelSmartAccount<entryPoint>,
9
+ export const serializePermissionAccount = async (
10
+ account: SmartAccount<KernelSmartAccountImplementation>,
11
11
  privateKey?: Hex,
12
12
  enableSignature?: Hex
13
13
  ): Promise<string> => {