@zerodev/permissions 5.4.9 → 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/index.js.map +1 -1
- package/_cjs/serializeMultiChainPermissionAccounts.js.map +1 -1
- package/_cjs/serializePermissionAccount.js +4 -3
- 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/index.js.map +1 -1
- package/_esm/serializeMultiChainPermissionAccounts.js.map +1 -1
- package/_esm/serializePermissionAccount.js +4 -3
- 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/index.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 +16 -40
- package/index.ts +4 -1
- package/package.json +4 -5
- package/serializeMultiChainPermissionAccounts.ts +9 -12
- package/serializePermissionAccount.ts +11 -9
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toPermissionValidator.js","sourceRoot":"","sources":["../toPermissionValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"toPermissionValidator.js","sourceRoot":"","sources":["../toPermissionValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAIH,MAAM,EACN,mBAAmB,EACnB,SAAS,EACT,KAAK,EACL,WAAW,EACd,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAM/C,OAAO,EACH,oBAAoB,EAGvB,MAAM,0BAA0B,CAAA;AAEjC,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAGvC,MAAc,EACd,EACI,MAAM,EACN,QAAQ,EACR,UAAU,EACV,aAA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H,QAAQ;aACX,CAAA;QACL,CAAC;QACD,SAAS,EAAE,KAAK,EACZ,oBAA6B,EAC7B,SAAc,EACE,EAAE;YAClB,IAAI,CAAC;gBACD,MAAM,gBAAgB,GAAG,MAAM,SAAS,CACpC,MAAM,EACN,YAAY,EACZ,cAAc,CACjB,CAAC;oBACE,GAAG,EAAE,kBAAkB;oBACvB,OAAO,EAAE,oBAAoB;oBAC7B,YAAY,EAAE,kBAAkB;oBAChC,IAAI,EAAE,CAAC,eAAe,EAAE,CAAC;iBAC5B,CAAC,CAAA;gBACF,OAAO,gBAAgB,CAAC,MAAM,KAAK,MAAM,CAAC,qBAAqB,CAAA;YACnE,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,KAAK,CAAA;YAChB,CAAC;QACL,CAAC;KACJ,CAAA;AACL,CAAC"}
|
package/_esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,aAAa,CAAC,MAAc;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;IAC9B,OAAO,UAAU,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAW,CAAC,CAAA;AACxE,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAiB;IAC3C,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC5E,OAAO,IAAI,CAAC,SAAS,CAAC,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,2BAA2B;AACvC,4DAA4D;AAC5D,MAAW;IAEX,OAAO,MAAM,EAAE,4BAA4B,KAAK,SAAS,CAAA;AAC7D,CAAC;AAED,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC5C,MAA+B,EACjC,EAAE;IACA,4DAA4D;IAC5D,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,KAAU,EAAE,EAAE;QACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAA;QAC3B,CAAC;QACD,OAAO,KAAK,CAAA;IAChB,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IACnD,MAAM,UAAU,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IACvD,MAAM,YAAY,GAAG,aAAa,CAAC,UAAU,CAAC,CAAA;IAC9C,OAAO,YAAY,CAAA;AACvB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,MAAc,EAAE,EAAE;IACjE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;IACxC,MAAM,UAAU,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IACvD,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAA4B,CAAA;AAC5D,CAAC,CAAA"}
|
|
@@ -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"}
|
package/_types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EACH,KAAK,kCAAkC,EACvC,qCAAqC,EACxC,MAAM,4CAA4C,CAAA;AACnD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EACH,KAAK,kCAAkC,EACvC,qCAAqC,EACxC,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACH,4BAA4B,EAC5B,wBAAwB,EAC3B,MAAM,mCAAmC,CAAA;AAC1C,cAAc,gBAAgB,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,C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ED,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,31 +60,29 @@ export const deserializePermissionAccount = async <
|
|
|
81
60
|
createPolicyFromParams(policy)
|
|
82
61
|
) || []
|
|
83
62
|
),
|
|
84
|
-
entryPoint
|
|
63
|
+
entryPoint,
|
|
85
64
|
kernelVersion
|
|
86
65
|
})
|
|
87
66
|
|
|
88
|
-
const { index, validatorInitData, useMetaFactory } =
|
|
89
|
-
params.accountParams.initCode,
|
|
90
|
-
kernelVersion
|
|
91
|
-
)
|
|
67
|
+
const { index, validatorInitData, useMetaFactory } =
|
|
68
|
+
decodeParamsFromInitCode(params.accountParams.initCode, kernelVersion)
|
|
92
69
|
|
|
93
70
|
const kernelPluginManager = await toKernelPluginManager(client, {
|
|
94
71
|
regular: modularPermissionPlugin,
|
|
95
72
|
pluginEnableSignature: params.enableSignature,
|
|
96
73
|
validatorInitData,
|
|
97
74
|
action: params.action,
|
|
98
|
-
entryPoint
|
|
75
|
+
entryPoint,
|
|
99
76
|
kernelVersion,
|
|
100
77
|
...params.validityData
|
|
101
78
|
})
|
|
102
79
|
|
|
103
80
|
return createKernelAccount(client, {
|
|
104
|
-
entryPoint
|
|
81
|
+
entryPoint,
|
|
105
82
|
kernelVersion,
|
|
106
83
|
plugins: kernelPluginManager,
|
|
107
84
|
index,
|
|
108
|
-
|
|
85
|
+
address: params.accountParams.accountAddress,
|
|
109
86
|
useMetaFactory
|
|
110
87
|
})
|
|
111
88
|
}
|
|
@@ -135,7 +112,6 @@ export const decodeParamsFromInitCode = (
|
|
|
135
112
|
) => {
|
|
136
113
|
let index: bigint | undefined
|
|
137
114
|
let validatorInitData: ValidatorInitData | undefined
|
|
138
|
-
const initCodeWithoutFactoryAddress: Hex = `0x${initCode.slice(42)}`
|
|
139
115
|
let deployWithFactoryFunctionData:
|
|
140
116
|
| DecodeFunctionDataReturnType<typeof KernelFactoryStakerAbi>
|
|
141
117
|
| DecodeFunctionDataReturnType<typeof KernelV3FactoryAbi>
|
|
@@ -143,12 +119,12 @@ export const decodeParamsFromInitCode = (
|
|
|
143
119
|
try {
|
|
144
120
|
deployWithFactoryFunctionData = decodeFunctionData({
|
|
145
121
|
abi: KernelFactoryStakerAbi,
|
|
146
|
-
data:
|
|
122
|
+
data: initCode
|
|
147
123
|
})
|
|
148
124
|
} catch (error) {
|
|
149
125
|
deployWithFactoryFunctionData = decodeFunctionData({
|
|
150
126
|
abi: KernelV3FactoryAbi,
|
|
151
|
-
data:
|
|
127
|
+
data: initCode
|
|
152
128
|
})
|
|
153
129
|
useMetaFactory = false
|
|
154
130
|
}
|
package/index.ts
CHANGED
|
@@ -5,5 +5,8 @@ export {
|
|
|
5
5
|
type MultiChainPermissionAccountsParams,
|
|
6
6
|
serializeMultiChainPermissionAccounts
|
|
7
7
|
} from "./serializeMultiChainPermissionAccounts.js"
|
|
8
|
-
export {
|
|
8
|
+
export {
|
|
9
|
+
deserializePermissionAccount,
|
|
10
|
+
decodeParamsFromInitCode
|
|
11
|
+
} from "./deserializePermissionAccount.js"
|
|
9
12
|
export * from "./constants.js"
|
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
|
}
|