@zerodev/permissions 5.4.10 → 5.5.0-beta.0
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/deserializePermissionAccount.js +8 -11
- package/_cjs/deserializePermissionAccount.js.map +1 -1
- package/_cjs/serializeMultiChainPermissionAccounts.js.map +1 -1
- package/_cjs/serializePermissionAccount.js.map +1 -1
- package/_cjs/signers/toECDSASigner.js +4 -5
- package/_cjs/signers/toECDSASigner.js.map +1 -1
- package/_cjs/signers/toWebAuthnSigner.js +3 -4
- package/_cjs/signers/toWebAuthnSigner.js.map +1 -1
- package/_cjs/toPermissionValidator.js +11 -8
- package/_cjs/toPermissionValidator.js.map +1 -1
- package/_cjs/utils.js.map +1 -1
- package/_esm/deserializePermissionAccount.js +8 -11
- package/_esm/deserializePermissionAccount.js.map +1 -1
- package/_esm/serializeMultiChainPermissionAccounts.js.map +1 -1
- package/_esm/serializePermissionAccount.js.map +1 -1
- package/_esm/signers/toECDSASigner.js +2 -3
- package/_esm/signers/toECDSASigner.js.map +1 -1
- package/_esm/signers/toWebAuthnSigner.js +1 -2
- package/_esm/signers/toWebAuthnSigner.js.map +1 -1
- package/_esm/toPermissionValidator.js +10 -7
- package/_esm/toPermissionValidator.js.map +1 -1
- package/_esm/utils.js.map +1 -1
- package/_types/deserializePermissionAccount.d.ts +264 -3
- package/_types/deserializePermissionAccount.d.ts.map +1 -1
- package/_types/serializeMultiChainPermissionAccounts.d.ts +5 -5
- package/_types/serializeMultiChainPermissionAccounts.d.ts.map +1 -1
- package/_types/serializePermissionAccount.d.ts +3 -3
- package/_types/serializePermissionAccount.d.ts.map +1 -1
- package/_types/signers/toECDSASigner.d.ts +4 -5
- package/_types/signers/toECDSASigner.d.ts.map +1 -1
- package/_types/signers/toWebAuthnSigner.d.ts.map +1 -1
- package/_types/toPermissionValidator.d.ts +3 -3
- package/_types/toPermissionValidator.d.ts.map +1 -1
- package/_types/types.d.ts +8 -5
- package/_types/types.d.ts.map +1 -1
- package/_types/utils.d.ts +1 -2
- package/_types/utils.d.ts.map +1 -1
- package/deserializePermissionAccount.ts +14 -36
- package/package.json +4 -5
- package/serializeMultiChainPermissionAccounts.ts +9 -12
- package/serializePermissionAccount.ts +4 -4
- package/signers/toECDSASigner.ts +11 -17
- package/signers/toWebAuthnSigner.ts +3 -2
- package/toPermissionValidator.ts +18 -16
- package/types.ts +7 -8
- package/utils.ts +2 -3
|
@@ -1,9 +1,270 @@
|
|
|
1
1
|
import type { GetKernelVersion, KERNEL_VERSION_TYPE, ValidatorInitData } from "@zerodev/sdk/types";
|
|
2
|
-
import type {
|
|
3
|
-
import type { Chain, Client, Hex, PublicActions, PublicRpcSchema, Transport } from "viem";
|
|
2
|
+
import type { Address, Client, Hex } from "viem";
|
|
4
3
|
import type { Policy } from "./types.js";
|
|
5
4
|
import type { ModularSigner } from "./types.js";
|
|
6
|
-
|
|
5
|
+
import type { EntryPointVersion } from "viem/account-abstraction";
|
|
6
|
+
export declare const deserializePermissionAccount: <entryPointVersion extends EntryPointVersion>(client: Client, entryPoint: {
|
|
7
|
+
address: Address;
|
|
8
|
+
version: entryPointVersion;
|
|
9
|
+
}, kernelVersion: GetKernelVersion<entryPointVersion>, modularPermissionAccountParams: string, modularSigner?: ModularSigner) => Promise<object & {
|
|
10
|
+
client: Client;
|
|
11
|
+
entryPoint: {
|
|
12
|
+
abi: import("@zerodev/sdk/_types/types/kernel.js").GetEntryPointAbi<entryPointVersion>;
|
|
13
|
+
address: `0x${string}`;
|
|
14
|
+
version: entryPointVersion;
|
|
15
|
+
};
|
|
16
|
+
extend?: object | undefined;
|
|
17
|
+
getAddress: () => Promise<`0x${string}`>;
|
|
18
|
+
decodeCalls?: ((data: `0x${string}`) => Promise<readonly {
|
|
19
|
+
to: `0x${string}`;
|
|
20
|
+
data?: `0x${string}` | undefined;
|
|
21
|
+
value?: bigint | undefined;
|
|
22
|
+
}[]>) | undefined;
|
|
23
|
+
encodeCalls: (calls: readonly {
|
|
24
|
+
to: `0x${string}`;
|
|
25
|
+
data?: `0x${string}` | undefined;
|
|
26
|
+
value?: bigint | undefined;
|
|
27
|
+
}[], callType?: import("@zerodev/sdk/types").CallType | undefined) => Promise<`0x${string}`>;
|
|
28
|
+
getFactoryArgs: () => Promise<{
|
|
29
|
+
factory?: `0x${string}` | undefined;
|
|
30
|
+
factoryData?: `0x${string}` | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
getNonce?: ((parameters?: {
|
|
33
|
+
key?: bigint | undefined;
|
|
34
|
+
} | undefined) => Promise<bigint>) | undefined;
|
|
35
|
+
getStubSignature: (parameters?: import("viem/account-abstraction").UserOperationRequest | undefined) => Promise<`0x${string}`>;
|
|
36
|
+
nonceKeyManager?: import("viem").NonceManager | undefined;
|
|
37
|
+
sign: (parameters: {
|
|
38
|
+
hash: `0x${string}`;
|
|
39
|
+
}) => Promise<`0x${string}`>;
|
|
40
|
+
signMessage: (parameters: {
|
|
41
|
+
message: import("viem").SignableMessage;
|
|
42
|
+
}) => Promise<`0x${string}`>;
|
|
43
|
+
signTypedData: <const typedData extends Record<string, unknown> | {
|
|
44
|
+
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
45
|
+
[x: `string[${string}]`]: undefined;
|
|
46
|
+
[x: `function[${string}]`]: undefined;
|
|
47
|
+
[x: `uint128[${string}]`]: undefined;
|
|
48
|
+
[x: `bool[${string}]`]: undefined;
|
|
49
|
+
[x: `address[${string}]`]: undefined;
|
|
50
|
+
[x: `bytes[${string}]`]: undefined;
|
|
51
|
+
[x: `bytes3[${string}]`]: undefined;
|
|
52
|
+
[x: `bytes1[${string}]`]: undefined;
|
|
53
|
+
[x: `bytes2[${string}]`]: undefined;
|
|
54
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
55
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
56
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
57
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
58
|
+
[x: `bytes8[${string}]`]: undefined;
|
|
59
|
+
[x: `bytes9[${string}]`]: undefined;
|
|
60
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
61
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
62
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
63
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
64
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
65
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
66
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
67
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
68
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
69
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
70
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
71
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
72
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
73
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
74
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
75
|
+
[x: `bytes25[${string}]`]: undefined;
|
|
76
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
77
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
78
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
79
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
80
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
81
|
+
[x: `bytes31[${string}]`]: undefined;
|
|
82
|
+
[x: `bytes32[${string}]`]: undefined;
|
|
83
|
+
[x: `int[${string}]`]: undefined;
|
|
84
|
+
[x: `int8[${string}]`]: undefined;
|
|
85
|
+
[x: `int16[${string}]`]: undefined;
|
|
86
|
+
[x: `int24[${string}]`]: undefined;
|
|
87
|
+
[x: `int32[${string}]`]: undefined;
|
|
88
|
+
[x: `int40[${string}]`]: undefined;
|
|
89
|
+
[x: `int48[${string}]`]: undefined;
|
|
90
|
+
[x: `int56[${string}]`]: undefined;
|
|
91
|
+
[x: `int64[${string}]`]: undefined;
|
|
92
|
+
[x: `int72[${string}]`]: undefined;
|
|
93
|
+
[x: `int80[${string}]`]: undefined;
|
|
94
|
+
[x: `int88[${string}]`]: undefined;
|
|
95
|
+
[x: `int96[${string}]`]: undefined;
|
|
96
|
+
[x: `int104[${string}]`]: undefined;
|
|
97
|
+
[x: `int112[${string}]`]: undefined;
|
|
98
|
+
[x: `int120[${string}]`]: undefined;
|
|
99
|
+
[x: `int128[${string}]`]: undefined;
|
|
100
|
+
[x: `int136[${string}]`]: undefined;
|
|
101
|
+
[x: `int144[${string}]`]: undefined;
|
|
102
|
+
[x: `int152[${string}]`]: undefined;
|
|
103
|
+
[x: `int160[${string}]`]: undefined;
|
|
104
|
+
[x: `int168[${string}]`]: undefined;
|
|
105
|
+
[x: `int176[${string}]`]: undefined;
|
|
106
|
+
[x: `int184[${string}]`]: undefined;
|
|
107
|
+
[x: `int192[${string}]`]: undefined;
|
|
108
|
+
[x: `int200[${string}]`]: undefined;
|
|
109
|
+
[x: `int208[${string}]`]: undefined;
|
|
110
|
+
[x: `int216[${string}]`]: undefined;
|
|
111
|
+
[x: `int224[${string}]`]: undefined;
|
|
112
|
+
[x: `int232[${string}]`]: undefined;
|
|
113
|
+
[x: `int240[${string}]`]: undefined;
|
|
114
|
+
[x: `int248[${string}]`]: undefined;
|
|
115
|
+
[x: `int256[${string}]`]: undefined;
|
|
116
|
+
[x: `uint[${string}]`]: undefined;
|
|
117
|
+
[x: `uint8[${string}]`]: undefined;
|
|
118
|
+
[x: `uint16[${string}]`]: undefined;
|
|
119
|
+
[x: `uint24[${string}]`]: undefined;
|
|
120
|
+
[x: `uint32[${string}]`]: undefined;
|
|
121
|
+
[x: `uint40[${string}]`]: undefined;
|
|
122
|
+
[x: `uint48[${string}]`]: undefined;
|
|
123
|
+
[x: `uint56[${string}]`]: undefined;
|
|
124
|
+
[x: `uint64[${string}]`]: undefined;
|
|
125
|
+
[x: `uint72[${string}]`]: undefined;
|
|
126
|
+
[x: `uint80[${string}]`]: undefined;
|
|
127
|
+
[x: `uint88[${string}]`]: undefined;
|
|
128
|
+
[x: `uint96[${string}]`]: undefined;
|
|
129
|
+
[x: `uint104[${string}]`]: undefined;
|
|
130
|
+
[x: `uint112[${string}]`]: undefined;
|
|
131
|
+
[x: `uint120[${string}]`]: undefined;
|
|
132
|
+
[x: `uint136[${string}]`]: undefined;
|
|
133
|
+
[x: `uint144[${string}]`]: undefined;
|
|
134
|
+
[x: `uint152[${string}]`]: undefined;
|
|
135
|
+
[x: `uint160[${string}]`]: undefined;
|
|
136
|
+
[x: `uint168[${string}]`]: undefined;
|
|
137
|
+
[x: `uint176[${string}]`]: undefined;
|
|
138
|
+
[x: `uint184[${string}]`]: undefined;
|
|
139
|
+
[x: `uint192[${string}]`]: undefined;
|
|
140
|
+
[x: `uint200[${string}]`]: undefined;
|
|
141
|
+
[x: `uint208[${string}]`]: undefined;
|
|
142
|
+
[x: `uint216[${string}]`]: undefined;
|
|
143
|
+
[x: `uint224[${string}]`]: undefined;
|
|
144
|
+
[x: `uint232[${string}]`]: undefined;
|
|
145
|
+
[x: `uint240[${string}]`]: undefined;
|
|
146
|
+
[x: `uint248[${string}]`]: undefined;
|
|
147
|
+
[x: `uint256[${string}]`]: undefined;
|
|
148
|
+
string?: undefined;
|
|
149
|
+
uint128?: undefined;
|
|
150
|
+
bool?: undefined;
|
|
151
|
+
address?: undefined;
|
|
152
|
+
bytes?: undefined;
|
|
153
|
+
bytes3?: undefined;
|
|
154
|
+
bytes1?: undefined;
|
|
155
|
+
bytes2?: undefined;
|
|
156
|
+
bytes4?: undefined;
|
|
157
|
+
bytes5?: undefined;
|
|
158
|
+
bytes6?: undefined;
|
|
159
|
+
bytes7?: undefined;
|
|
160
|
+
bytes8?: undefined;
|
|
161
|
+
bytes9?: undefined;
|
|
162
|
+
bytes10?: undefined;
|
|
163
|
+
bytes11?: undefined;
|
|
164
|
+
bytes12?: undefined;
|
|
165
|
+
bytes13?: undefined;
|
|
166
|
+
bytes14?: undefined;
|
|
167
|
+
bytes15?: undefined;
|
|
168
|
+
bytes16?: undefined;
|
|
169
|
+
bytes17?: undefined;
|
|
170
|
+
bytes18?: undefined;
|
|
171
|
+
bytes19?: undefined;
|
|
172
|
+
bytes20?: undefined;
|
|
173
|
+
bytes21?: undefined;
|
|
174
|
+
bytes22?: undefined;
|
|
175
|
+
bytes23?: undefined;
|
|
176
|
+
bytes24?: undefined;
|
|
177
|
+
bytes25?: undefined;
|
|
178
|
+
bytes26?: undefined;
|
|
179
|
+
bytes27?: undefined;
|
|
180
|
+
bytes28?: undefined;
|
|
181
|
+
bytes29?: undefined;
|
|
182
|
+
bytes30?: undefined;
|
|
183
|
+
bytes31?: undefined;
|
|
184
|
+
bytes32?: undefined;
|
|
185
|
+
int8?: undefined;
|
|
186
|
+
int16?: undefined;
|
|
187
|
+
int24?: undefined;
|
|
188
|
+
int32?: undefined;
|
|
189
|
+
int40?: undefined;
|
|
190
|
+
int48?: undefined;
|
|
191
|
+
int56?: undefined;
|
|
192
|
+
int64?: undefined;
|
|
193
|
+
int72?: undefined;
|
|
194
|
+
int80?: undefined;
|
|
195
|
+
int88?: undefined;
|
|
196
|
+
int96?: undefined;
|
|
197
|
+
int104?: undefined;
|
|
198
|
+
int112?: undefined;
|
|
199
|
+
int120?: undefined;
|
|
200
|
+
int128?: undefined;
|
|
201
|
+
int136?: undefined;
|
|
202
|
+
int144?: undefined;
|
|
203
|
+
int152?: undefined;
|
|
204
|
+
int160?: undefined;
|
|
205
|
+
int168?: undefined;
|
|
206
|
+
int176?: undefined;
|
|
207
|
+
int184?: undefined;
|
|
208
|
+
int192?: undefined;
|
|
209
|
+
int200?: undefined;
|
|
210
|
+
int208?: undefined;
|
|
211
|
+
int216?: undefined;
|
|
212
|
+
int224?: undefined;
|
|
213
|
+
int232?: undefined;
|
|
214
|
+
int240?: undefined;
|
|
215
|
+
int248?: undefined;
|
|
216
|
+
int256?: undefined;
|
|
217
|
+
uint8?: undefined;
|
|
218
|
+
uint16?: undefined;
|
|
219
|
+
uint24?: undefined;
|
|
220
|
+
uint32?: undefined;
|
|
221
|
+
uint40?: undefined;
|
|
222
|
+
uint48?: undefined;
|
|
223
|
+
uint56?: undefined;
|
|
224
|
+
uint64?: undefined;
|
|
225
|
+
uint72?: undefined;
|
|
226
|
+
uint80?: undefined;
|
|
227
|
+
uint88?: undefined;
|
|
228
|
+
uint96?: undefined;
|
|
229
|
+
uint104?: undefined;
|
|
230
|
+
uint112?: undefined;
|
|
231
|
+
uint120?: undefined;
|
|
232
|
+
uint136?: undefined;
|
|
233
|
+
uint144?: undefined;
|
|
234
|
+
uint152?: undefined;
|
|
235
|
+
uint160?: undefined;
|
|
236
|
+
uint168?: undefined;
|
|
237
|
+
uint176?: undefined;
|
|
238
|
+
uint184?: undefined;
|
|
239
|
+
uint192?: undefined;
|
|
240
|
+
uint200?: undefined;
|
|
241
|
+
uint208?: undefined;
|
|
242
|
+
uint216?: undefined;
|
|
243
|
+
uint224?: undefined;
|
|
244
|
+
uint232?: undefined;
|
|
245
|
+
uint240?: undefined;
|
|
246
|
+
uint248?: undefined;
|
|
247
|
+
uint256?: undefined;
|
|
248
|
+
}, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
|
|
249
|
+
signUserOperation: (parameters: import("viem").UnionPartialBy<import("viem/account-abstraction").UserOperation, "sender"> & {
|
|
250
|
+
chainId?: number | undefined;
|
|
251
|
+
}) => Promise<`0x${string}`>;
|
|
252
|
+
userOperation?: {
|
|
253
|
+
estimateGas?: ((userOperation: import("viem/account-abstraction").UserOperationRequest) => Promise<import("viem").ExactPartial<import("viem/_types/account-abstraction/types/userOperation.js").EstimateUserOperationGasReturnType> | undefined>) | undefined;
|
|
254
|
+
} | undefined;
|
|
255
|
+
kernelVersion: GetKernelVersion<entryPointVersion>;
|
|
256
|
+
kernelPluginManager: import("@zerodev/sdk").KernelPluginManager<entryPointVersion>;
|
|
257
|
+
generateInitCode: () => Promise<`0x${string}`>;
|
|
258
|
+
encodeModuleInstallCallData: () => Promise<`0x${string}`>;
|
|
259
|
+
encodeDeployCallData: ({ abi, args, bytecode }: import("viem").EncodeDeployDataParameters) => Promise<`0x${string}`>;
|
|
260
|
+
} & {
|
|
261
|
+
address: `0x${string}`;
|
|
262
|
+
getNonce: (parameters?: {
|
|
263
|
+
key?: bigint | undefined;
|
|
264
|
+
} | undefined) => Promise<bigint>;
|
|
265
|
+
isDeployed: () => Promise<boolean>;
|
|
266
|
+
type: "smart";
|
|
267
|
+
}>;
|
|
7
268
|
export declare const createPolicyFromParams: (policy: Policy) => Promise<Policy>;
|
|
8
269
|
export declare const decodeParamsFromInitCode: (initCode: Hex, kernelVersion: KERNEL_VERSION_TYPE) => {
|
|
9
270
|
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;
|
|
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;AAC3B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAchD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,eAAO,MAAM,4BAA4B,wDAG7B,MAAM;aACS,OAAO;;uFAEE,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";
|
|
3
1
|
import { type Hex } from "viem";
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { SmartAccount } from "viem/account-abstraction";
|
|
3
|
+
import type { KernelSmartAccountImplementation } from "@zerodev/sdk";
|
|
4
|
+
export type MultiChainPermissionAccountsParams = {
|
|
5
|
+
account: SmartAccount<KernelSmartAccountImplementation>;
|
|
6
6
|
privateKey?: Hex;
|
|
7
7
|
};
|
|
8
|
-
export declare const serializeMultiChainPermissionAccounts:
|
|
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":"
|
|
1
|
+
{"version":3,"file":"serializeMultiChainPermissionAccounts.d.ts","sourceRoot":"","sources":["../serializeMultiChainPermissionAccounts.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,GAAG,EAMX,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAA;AAEpE,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";
|
|
3
1
|
import type { Hex } from "viem";
|
|
4
|
-
|
|
2
|
+
import type { SmartAccount } from "viem/account-abstraction";
|
|
3
|
+
import type { KernelSmartAccountImplementation } from "@zerodev/sdk";
|
|
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,
|
|
1
|
+
{"version":3,"file":"serializePermissionAccount.d.ts","sourceRoot":"","sources":["../serializePermissionAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAA;AAK/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,cAAc,CAAA;AAEpE,eAAO,MAAM,0BAA0B,YAC1B,aAAa,gCAAgC,CAAC,eAC1C,GAAG,oBACE,GAAG,KACtB,QAAQ,MAAM,CA2BhB,CAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { Address } from "viem";
|
|
1
|
+
import type { LocalAccount } from "viem";
|
|
3
2
|
import type { ModularSigner, ModularSignerParams } from "../types.js";
|
|
4
|
-
export type ECDSAModularSignerParams
|
|
5
|
-
signer:
|
|
3
|
+
export type ECDSAModularSignerParams = ModularSignerParams & {
|
|
4
|
+
signer: LocalAccount;
|
|
6
5
|
};
|
|
7
|
-
export declare function toECDSASigner
|
|
6
|
+
export declare function toECDSASigner({ signer, signerContractAddress }: ECDSAModularSignerParams): 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,
|
|
1
|
+
{"version":3,"file":"toECDSASigner.d.ts","sourceRoot":"","sources":["../../signers/toECDSASigner.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,MAAM,CAAA;AAG7D,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAErE,MAAM,MAAM,wBAAwB,GAAG,mBAAmB,GAAG;IACzD,MAAM,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC1B,MAAM,EACN,qBAA6C,EAChD,EAAE,wBAAwB,GAAG,aAAa,CAwC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toWebAuthnSigner.d.ts","sourceRoot":"","sources":["../../signers/toWebAuthnSigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"toWebAuthnSigner.d.ts","sourceRoot":"","sources":["../../signers/toWebAuthnSigner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAWxD,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,MAAM,EAGX,KAAK,SAAS,EAKjB,MAAM,MAAM,CAAA;AAQb,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAErE,oBAAY,qBAAqB;IAC7B,MAAM,UAAU;IAChB,MAAM,UAAU;CACnB;AAED,MAAM,MAAM,2BAA2B,GAAG,mBAAmB,GAAG;IAC5D,WAAW,EAAE,WAAW,CAAA;IACxB,qBAAqB,EAAE,qBAAqB,CAAA;CAC/C,CAAA;AAiFD,eAAO,MAAM,wBAAwB,0BACV,qBAAqB,0BACpB,OAAO,KAChC,OAQF,CAAA;AAED,eAAO,MAAM,gBAAgB,iNAStB,2BAA2B,KAC/B,QAAQ,aAAa,CAyFvB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type Chain, type Client, type Transport } from "viem";
|
|
1
|
+
import { type Client } from "viem";
|
|
3
2
|
import type { PermissionPlugin, PermissionPluginParams } from "./types.js";
|
|
4
|
-
|
|
3
|
+
import { type EntryPointVersion } from "viem/account-abstraction";
|
|
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":"
|
|
1
|
+
{"version":3,"file":"toPermissionValidator.d.ts","sourceRoot":"","sources":["../toPermissionValidator.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,KAAK,MAAM,EAOd,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EAER,gBAAgB,EAChB,sBAAsB,EACzB,MAAM,YAAY,CAAA;AACnB,OAAO,EAGH,KAAK,iBAAiB,EACzB,MAAM,0BAA0B,CAAA;AAEjC,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
2
|
import type { Action, GetKernelVersion, PluginValidityData } from "@zerodev/sdk/types";
|
|
3
|
-
import type { EntryPoint } from "permissionless/types/entrypoint";
|
|
4
3
|
import type { Abi, Address, Hex, LocalAccount } from "viem";
|
|
5
4
|
import type { PolicyFlags } from "./constants.js";
|
|
6
5
|
import type { CallPolicyParams, GasPolicyParams, RateLimitPolicyParams, SignatureCallerPolicyParams, SudoPolicyParams, TimestampPolicyParams } from "./policies/index.js";
|
|
7
|
-
|
|
6
|
+
import type { EntryPointVersion } from "viem/account-abstraction";
|
|
7
|
+
export type PermissionPlugin = KernelValidator<"PermissionValidator"> & {
|
|
8
8
|
getPluginSerializationParams: () => PermissionData;
|
|
9
9
|
};
|
|
10
10
|
export type ModularSignerParams = {
|
|
@@ -37,11 +37,14 @@ export type Policy = {
|
|
|
37
37
|
type: "timestamp";
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
export type PermissionPluginParams<
|
|
40
|
+
export type PermissionPluginParams<entryPointVersion extends EntryPointVersion> = {
|
|
41
41
|
signer: ModularSigner;
|
|
42
42
|
policies: Policy[];
|
|
43
|
-
entryPoint:
|
|
44
|
-
|
|
43
|
+
entryPoint: {
|
|
44
|
+
address: Address;
|
|
45
|
+
version: entryPointVersion;
|
|
46
|
+
};
|
|
47
|
+
kernelVersion: GetKernelVersion<entryPointVersion>;
|
|
45
48
|
flag?: PolicyFlags;
|
|
46
49
|
};
|
|
47
50
|
export interface PermissionData {
|
package/_types/types.d.ts.map
CHANGED
|
@@ -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,
|
|
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,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;AAC5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,MAAM,MAAM,gBAAgB,GAAG,eAAe,CAAC,qBAAqB,CAAC,GAAG;IACpE,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,GAAG,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACjB,aAAa,EAAE,MAAM,GAAG,CAAA;IACxB,oBAAoB,EAAE,MAAM,GAAG,CAAA;IAE/B,YAAY,EACN,CAAC,gBAAgB,CAAC,GAAG,GAAG,SAAS,OAAO,EAAE,EAAE,MAAM,CAAC,GAAG;QAClD,IAAI,EAAE,MAAM,CAAA;KACf,CAAC,GACF,CAAC,eAAe,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC,GACnC,CAAC,qBAAqB,GAAG;QAAE,IAAI,EAAE,YAAY,CAAA;KAAE,CAAC,GAChD,CAAC,2BAA2B,GAAG;QAAE,IAAI,EAAE,kBAAkB,CAAA;KAAE,CAAC,GAC5D,CAAC,gBAAgB,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,GACrC,CAAC,qBAAqB,GAAG;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CAAA;CACxD,CAAA;AAED,MAAM,MAAM,sBAAsB,CAC9B,iBAAiB,SAAS,iBAAiB,IAC3C;IACA,MAAM,EAAE,aAAa,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,UAAU,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,iBAAiB,CAAA;KAAE,CAAA;IAC5D,aAAa,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAA;IAClD,IAAI,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AAED,MAAM,WAAW,cAAc;IAC3B,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACtB;AAED,MAAM,MAAM,6BAA6B,GAAG;IACxC,QAAQ,EAAE,GAAG,CAAA;IACb,cAAc,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IAClC,gBAAgB,EAAE,cAAc,CAAA;IAChC,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,kBAAkB,CAAA;IAChC,aAAa,EAAE,6BAA6B,CAAA;IAC5C,eAAe,CAAC,EAAE,GAAG,CAAA;IACrB,UAAU,CAAC,EAAE,GAAG,CAAA;CACnB,CAAA"}
|
package/_types/utils.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { EntryPoint } 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
|
|
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
|
package/_types/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
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"}
|
|
@@ -11,17 +11,7 @@ import type {
|
|
|
11
11
|
KERNEL_VERSION_TYPE,
|
|
12
12
|
ValidatorInitData
|
|
13
13
|
} from "@zerodev/sdk/types"
|
|
14
|
-
import {
|
|
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"
|
|
14
|
+
import type { Address, Client, Hex } from "viem"
|
|
25
15
|
import { decodeFunctionData } from "viem"
|
|
26
16
|
import { privateKeyToAccount } from "viem/accounts"
|
|
27
17
|
import type { DecodeFunctionDataReturnType } from "viem/utils"
|
|
@@ -38,27 +28,18 @@ import { toPermissionValidator } from "./toPermissionValidator.js"
|
|
|
38
28
|
import type { Policy } from "./types.js"
|
|
39
29
|
import type { ModularSigner } from "./types.js"
|
|
40
30
|
import { deserializePermissionAccountParams } from "./utils.js"
|
|
31
|
+
import type { EntryPointVersion } from "viem/account-abstraction"
|
|
41
32
|
|
|
42
33
|
export const deserializePermissionAccount = async <
|
|
43
|
-
|
|
44
|
-
TTransport extends Transport = Transport,
|
|
45
|
-
TChain extends Chain | undefined = Chain | undefined
|
|
34
|
+
entryPointVersion extends EntryPointVersion
|
|
46
35
|
>(
|
|
47
|
-
client: Client
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
undefined,
|
|
51
|
-
PublicRpcSchema,
|
|
52
|
-
PublicActions<TTransport, TChain>
|
|
53
|
-
>,
|
|
54
|
-
entryPointAddress: entryPoint,
|
|
55
|
-
kernelVersion: GetKernelVersion<entryPoint>,
|
|
36
|
+
client: Client,
|
|
37
|
+
entryPoint: { address: Address; version: entryPointVersion },
|
|
38
|
+
kernelVersion: GetKernelVersion<entryPointVersion>,
|
|
56
39
|
modularPermissionAccountParams: string,
|
|
57
40
|
modularSigner?: ModularSigner
|
|
58
41
|
) => {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
if (entryPointVersion !== "v0.7") {
|
|
42
|
+
if (entryPoint.version !== "0.7") {
|
|
62
43
|
throw new Error("Only EntryPoint 0.7 is supported")
|
|
63
44
|
}
|
|
64
45
|
const params = deserializePermissionAccountParams(
|
|
@@ -67,9 +48,7 @@ export const deserializePermissionAccount = async <
|
|
|
67
48
|
let signer: ModularSigner
|
|
68
49
|
if (params.privateKey)
|
|
69
50
|
signer = toECDSASigner({
|
|
70
|
-
signer: privateKeyToAccount(
|
|
71
|
-
params.privateKey
|
|
72
|
-
) as SmartAccountSigner<"privateKey", `0x${string}`>
|
|
51
|
+
signer: privateKeyToAccount(params.privateKey)
|
|
73
52
|
})
|
|
74
53
|
else if (modularSigner) signer = modularSigner
|
|
75
54
|
else throw new Error("No signer or serialized sessionKey provided")
|
|
@@ -81,7 +60,7 @@ export const deserializePermissionAccount = async <
|
|
|
81
60
|
createPolicyFromParams(policy)
|
|
82
61
|
) || []
|
|
83
62
|
),
|
|
84
|
-
entryPoint
|
|
63
|
+
entryPoint,
|
|
85
64
|
kernelVersion
|
|
86
65
|
})
|
|
87
66
|
|
|
@@ -93,17 +72,17 @@ export const deserializePermissionAccount = async <
|
|
|
93
72
|
pluginEnableSignature: params.enableSignature,
|
|
94
73
|
validatorInitData,
|
|
95
74
|
action: params.action,
|
|
96
|
-
entryPoint
|
|
75
|
+
entryPoint,
|
|
97
76
|
kernelVersion,
|
|
98
77
|
...params.validityData
|
|
99
78
|
})
|
|
100
79
|
|
|
101
80
|
return createKernelAccount(client, {
|
|
102
|
-
entryPoint
|
|
81
|
+
entryPoint,
|
|
103
82
|
kernelVersion,
|
|
104
83
|
plugins: kernelPluginManager,
|
|
105
84
|
index,
|
|
106
|
-
|
|
85
|
+
address: params.accountParams.accountAddress,
|
|
107
86
|
useMetaFactory
|
|
108
87
|
})
|
|
109
88
|
}
|
|
@@ -133,7 +112,6 @@ export const decodeParamsFromInitCode = (
|
|
|
133
112
|
) => {
|
|
134
113
|
let index: bigint | undefined
|
|
135
114
|
let validatorInitData: ValidatorInitData | undefined
|
|
136
|
-
const initCodeWithoutFactoryAddress: Hex = `0x${initCode.slice(42)}`
|
|
137
115
|
let deployWithFactoryFunctionData:
|
|
138
116
|
| DecodeFunctionDataReturnType<typeof KernelFactoryStakerAbi>
|
|
139
117
|
| DecodeFunctionDataReturnType<typeof KernelV3FactoryAbi>
|
|
@@ -141,12 +119,12 @@ export const decodeParamsFromInitCode = (
|
|
|
141
119
|
try {
|
|
142
120
|
deployWithFactoryFunctionData = decodeFunctionData({
|
|
143
121
|
abi: KernelFactoryStakerAbi,
|
|
144
|
-
data:
|
|
122
|
+
data: initCode
|
|
145
123
|
})
|
|
146
124
|
} catch (error) {
|
|
147
125
|
deployWithFactoryFunctionData = decodeFunctionData({
|
|
148
126
|
abi: KernelV3FactoryAbi,
|
|
149
|
-
data:
|
|
127
|
+
data: initCode
|
|
150
128
|
})
|
|
151
129
|
useMetaFactory = false
|
|
152
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerodev/permissions",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0-beta.0",
|
|
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": "
|
|
60
|
-
"@zerodev/sdk": "^5.
|
|
61
|
-
"@zerodev/webauthn-key": "^5.
|
|
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,4 @@
|
|
|
1
|
-
import type { KernelSmartAccount } from "@zerodev/sdk"
|
|
2
1
|
import { MerkleTree } from "merkletreejs"
|
|
3
|
-
import type { EntryPoint } from "permissionless/types"
|
|
4
2
|
import {
|
|
5
3
|
type Hex,
|
|
6
4
|
concatHex,
|
|
@@ -14,17 +12,16 @@ import {
|
|
|
14
12
|
isPermissionValidatorPlugin,
|
|
15
13
|
serializePermissionAccountParams
|
|
16
14
|
} from "./utils.js"
|
|
15
|
+
import type { SmartAccount } from "viem/account-abstraction"
|
|
16
|
+
import type { KernelSmartAccountImplementation } from "@zerodev/sdk"
|
|
17
17
|
|
|
18
|
-
export type MultiChainPermissionAccountsParams
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
18
|
+
export type MultiChainPermissionAccountsParams = {
|
|
19
|
+
account: SmartAccount<KernelSmartAccountImplementation>
|
|
20
|
+
privateKey?: Hex
|
|
21
|
+
}
|
|
23
22
|
|
|
24
|
-
export const serializeMultiChainPermissionAccounts = async
|
|
25
|
-
|
|
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
|
|
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"
|
|
3
1
|
import type { Hex } from "viem"
|
|
4
2
|
import {
|
|
5
3
|
isPermissionValidatorPlugin,
|
|
6
4
|
serializePermissionAccountParams
|
|
7
5
|
} from "./utils.js"
|
|
6
|
+
import type { SmartAccount } from "viem/account-abstraction"
|
|
7
|
+
import type { KernelSmartAccountImplementation } from "@zerodev/sdk"
|
|
8
8
|
|
|
9
|
-
export const serializePermissionAccount = async
|
|
10
|
-
account:
|
|
9
|
+
export const serializePermissionAccount = async (
|
|
10
|
+
account: SmartAccount<KernelSmartAccountImplementation>,
|
|
11
11
|
privateKey?: Hex,
|
|
12
12
|
enableSignature?: Hex
|
|
13
13
|
): Promise<string> => {
|