@zerodev/sdk 5.2.16 → 5.2.18-alpha-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/accounts/kernel/createKernelAccount.js +25 -5
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js +4 -4
- package/_cjs/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +12 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.js +2 -2
- package/_cjs/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +3 -3
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +3 -3
- package/_cjs/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_cjs/accounts/utils/toKernelPluginManager.js +6 -2
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +27 -5
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js +4 -4
- package/_esm/accounts/kernel/utils/account/ep0_7/encodeCallData.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js +17 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.js +2 -2
- package/_esm/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js +3 -3
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.js.map +1 -1
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js +3 -3
- package/_esm/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js.map +1 -1
- package/_esm/accounts/utils/toKernelPluginManager.js +6 -2
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/types/kernel.js.map +1 -1
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts +2 -2
- package/_types/accounts/kernel/utils/account/ep0_7/encodeCallData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.d.ts +1 -1
- package/_types/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.d.ts +3 -2
- package/_types/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.d.ts.map +1 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts +3 -1
- package/_types/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.d.ts.map +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts +1 -1
- package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
- package/_types/index.d.ts +1 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/types/kernel.d.ts +6 -0
- package/_types/types/kernel.d.ts.map +1 -1
- package/accounts/kernel/createKernelAccount.ts +36 -5
- package/accounts/kernel/utils/account/ep0_7/encodeCallData.ts +19 -9
- package/accounts/kernel/utils/ep0_7/encodeExecuteBatchCall.ts +4 -2
- package/accounts/kernel/utils/ep0_7/encodeExecuteCall.ts +30 -2
- package/accounts/kernel/utils/ep0_7/encodeExecuteDelegateCall.ts +10 -5
- package/accounts/kernel/utils/ep0_7/encodeExecuteSingleCall.ts +10 -5
- package/accounts/kernel/utils/plugins/ep0_7/getEncodedPluginsData.ts +9 -4
- package/accounts/kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.ts +5 -2
- package/accounts/utils/toKernelPluginManager.ts +18 -9
- package/index.ts +1 -0
- package/package.json +32 -10
- package/types/kernel.ts +7 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EntryPoint } from "permissionless/types
|
|
1
|
+
import type { EntryPoint } from "permissionless/types"
|
|
2
2
|
import { EXEC_TYPE } from "../../../../../constants.js"
|
|
3
3
|
import type { KernelSmartAccount } from "../../../createKernelAccount.js"
|
|
4
4
|
import { encodeExecuteBatchCall } from "../../ep0_7/encodeExecuteBatchCall.js"
|
|
@@ -8,23 +8,32 @@ import { encodeExecuteSingleCall } from "../../ep0_7/encodeExecuteSingleCall.js"
|
|
|
8
8
|
export const encodeCallData = async <
|
|
9
9
|
entryPoint extends EntryPoint = EntryPoint
|
|
10
10
|
>(
|
|
11
|
-
tx: Parameters<KernelSmartAccount<entryPoint>["encodeCallData"]>[0]
|
|
11
|
+
tx: Parameters<KernelSmartAccount<entryPoint>["encodeCallData"]>[0],
|
|
12
|
+
includeHooks?: boolean
|
|
12
13
|
) => {
|
|
13
14
|
if (Array.isArray(tx)) {
|
|
14
15
|
if (tx.some((t) => t.callType === "delegatecall")) {
|
|
15
16
|
throw new Error("Cannot batch delegatecall")
|
|
16
17
|
}
|
|
17
18
|
// Encode a batched call
|
|
18
|
-
return encodeExecuteBatchCall(
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
return encodeExecuteBatchCall(
|
|
20
|
+
tx,
|
|
21
|
+
{
|
|
22
|
+
execType: EXEC_TYPE.DEFAULT
|
|
23
|
+
},
|
|
24
|
+
includeHooks
|
|
25
|
+
)
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
// Default to `call`
|
|
24
29
|
if (!tx.callType || tx.callType === "call") {
|
|
25
|
-
return encodeExecuteSingleCall(
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
return encodeExecuteSingleCall(
|
|
31
|
+
tx,
|
|
32
|
+
{
|
|
33
|
+
execType: EXEC_TYPE.DEFAULT
|
|
34
|
+
},
|
|
35
|
+
includeHooks
|
|
36
|
+
)
|
|
28
37
|
}
|
|
29
38
|
|
|
30
39
|
if (tx.callType === "delegatecall") {
|
|
@@ -32,7 +41,8 @@ export const encodeCallData = async <
|
|
|
32
41
|
{ to: tx.to, data: tx.data },
|
|
33
42
|
{
|
|
34
43
|
execType: EXEC_TYPE.DEFAULT
|
|
35
|
-
}
|
|
44
|
+
},
|
|
45
|
+
includeHooks
|
|
36
46
|
)
|
|
37
47
|
}
|
|
38
48
|
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
|
|
9
9
|
export const encodeExecuteBatchCall = (
|
|
10
10
|
args: CallArgs[],
|
|
11
|
-
options: Omit<EncodeExecuteOptions, "callType"
|
|
11
|
+
options: Omit<EncodeExecuteOptions, "callType">,
|
|
12
|
+
includeHooks?: boolean
|
|
12
13
|
) => {
|
|
13
14
|
const calldata = encodeAbiParameters(
|
|
14
15
|
[
|
|
@@ -46,6 +47,7 @@ export const encodeExecuteBatchCall = (
|
|
|
46
47
|
{
|
|
47
48
|
callType: CALL_TYPE.BATCH,
|
|
48
49
|
execType: options.execType
|
|
49
|
-
}
|
|
50
|
+
},
|
|
51
|
+
includeHooks
|
|
50
52
|
)
|
|
51
53
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type Hex,
|
|
3
|
+
concatHex,
|
|
4
|
+
encodeFunctionData,
|
|
5
|
+
getAbiItem,
|
|
6
|
+
toFunctionSelector,
|
|
7
|
+
toHex
|
|
8
|
+
} from "viem"
|
|
2
9
|
import { CALL_TYPE } from "../../../../constants.js"
|
|
3
10
|
import { getExecMode } from "../../../../utils.js"
|
|
4
11
|
import { KernelV3ExecuteAbi } from "../../abi/kernel_v_3_0_0/KernelAccountAbi.js"
|
|
@@ -16,7 +23,8 @@ type EncodeExecuteCallArgs<TOptions> =
|
|
|
16
23
|
|
|
17
24
|
export const encodeExecuteCall = <TOptions extends EncodeExecuteOptions>(
|
|
18
25
|
args: EncodeExecuteCallArgs<TOptions>,
|
|
19
|
-
options: TOptions
|
|
26
|
+
options: TOptions,
|
|
27
|
+
includeHooks = false
|
|
20
28
|
) => {
|
|
21
29
|
let calldata: Hex
|
|
22
30
|
if ("calldata" in args) {
|
|
@@ -30,6 +38,26 @@ export const encodeExecuteCall = <TOptions extends EncodeExecuteOptions>(
|
|
|
30
38
|
args.data
|
|
31
39
|
])
|
|
32
40
|
}
|
|
41
|
+
|
|
42
|
+
const executeUserOpSig = toFunctionSelector(
|
|
43
|
+
getAbiItem({ abi: KernelV3ExecuteAbi, name: "executeUserOp" })
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
// The calldata using hook plugin should be as follows:
|
|
47
|
+
// [0:4] - `executeUserOp` function signature
|
|
48
|
+
// [4:8] - `execute` function signature
|
|
49
|
+
// [8:] - `execute` function arguments
|
|
50
|
+
if (includeHooks) {
|
|
51
|
+
return concatHex([
|
|
52
|
+
executeUserOpSig,
|
|
53
|
+
encodeFunctionData({
|
|
54
|
+
abi: KernelV3ExecuteAbi,
|
|
55
|
+
functionName: "execute",
|
|
56
|
+
args: [getExecMode(options), calldata]
|
|
57
|
+
})
|
|
58
|
+
])
|
|
59
|
+
}
|
|
60
|
+
|
|
33
61
|
return encodeFunctionData({
|
|
34
62
|
abi: KernelV3ExecuteAbi,
|
|
35
63
|
functionName: "execute",
|
|
@@ -7,10 +7,15 @@ import {
|
|
|
7
7
|
|
|
8
8
|
export const encodeExecuteDelegateCall = (
|
|
9
9
|
args: DelegateCallArgs,
|
|
10
|
-
options: Omit<EncodeExecuteOptions, "callType"
|
|
10
|
+
options: Omit<EncodeExecuteOptions, "callType">,
|
|
11
|
+
includeHooks?: boolean
|
|
11
12
|
) => {
|
|
12
|
-
return encodeExecuteCall(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return encodeExecuteCall(
|
|
14
|
+
args,
|
|
15
|
+
{
|
|
16
|
+
callType: CALL_TYPE.DELEGATE_CALL,
|
|
17
|
+
execType: options.execType
|
|
18
|
+
},
|
|
19
|
+
includeHooks
|
|
20
|
+
)
|
|
16
21
|
}
|
|
@@ -7,10 +7,15 @@ import {
|
|
|
7
7
|
|
|
8
8
|
export const encodeExecuteSingleCall = (
|
|
9
9
|
args: CallArgs,
|
|
10
|
-
options: Omit<EncodeExecuteOptions, "callType"
|
|
10
|
+
options: Omit<EncodeExecuteOptions, "callType">,
|
|
11
|
+
includeHooks?: boolean
|
|
11
12
|
) => {
|
|
12
|
-
return encodeExecuteCall(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return encodeExecuteCall(
|
|
14
|
+
args,
|
|
15
|
+
{
|
|
16
|
+
callType: CALL_TYPE.SINGLE,
|
|
17
|
+
execType: options.execType
|
|
18
|
+
},
|
|
19
|
+
includeHooks
|
|
20
|
+
)
|
|
16
21
|
}
|
|
@@ -6,28 +6,33 @@ import {
|
|
|
6
6
|
zeroAddress
|
|
7
7
|
} from "viem"
|
|
8
8
|
import { CALL_TYPE } from "../../../../../constants.js"
|
|
9
|
-
import type {
|
|
9
|
+
import type {
|
|
10
|
+
Action,
|
|
11
|
+
KernelValidatorHook
|
|
12
|
+
} from "../../../../../types/kernel.js"
|
|
10
13
|
|
|
11
14
|
export const getEncodedPluginsData = async ({
|
|
12
15
|
enableSignature,
|
|
13
16
|
userOpSignature,
|
|
14
17
|
action,
|
|
15
|
-
enableData
|
|
18
|
+
enableData,
|
|
19
|
+
hook
|
|
16
20
|
}: {
|
|
17
21
|
enableSignature: Hex
|
|
18
22
|
userOpSignature: Hex
|
|
19
23
|
action: Action
|
|
20
24
|
enableData: Hex
|
|
25
|
+
hook?: KernelValidatorHook
|
|
21
26
|
}) => {
|
|
22
27
|
return concat([
|
|
23
|
-
zeroAddress, // hook address 20 bytes
|
|
28
|
+
hook?.getIdentifier() ?? zeroAddress, // hook address 20 bytes
|
|
24
29
|
encodeAbiParameters(
|
|
25
30
|
parseAbiParameters(
|
|
26
31
|
"bytes validatorData, bytes hookData, bytes selectorData, bytes enableSig, bytes userOpSig"
|
|
27
32
|
),
|
|
28
33
|
[
|
|
29
34
|
enableData,
|
|
30
|
-
"0x",
|
|
35
|
+
(await hook?.getEnableData()) ?? "0x",
|
|
31
36
|
concat([
|
|
32
37
|
action.selector,
|
|
33
38
|
action.address,
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
zeroAddress
|
|
13
13
|
} from "viem"
|
|
14
14
|
import { CALL_TYPE, VALIDATOR_TYPE } from "../../../../../constants.js"
|
|
15
|
+
import type { KernelValidatorHook } from "../../../../../types/kernel.js"
|
|
15
16
|
import type { Kernel2_0_plugins } from "../ep0_6/getPluginsEnableTypedData.js"
|
|
16
17
|
|
|
17
18
|
export const getPluginsEnableTypedData = async <
|
|
@@ -21,6 +22,7 @@ export const getPluginsEnableTypedData = async <
|
|
|
21
22
|
chainId,
|
|
22
23
|
kernelVersion,
|
|
23
24
|
action,
|
|
25
|
+
hook,
|
|
24
26
|
validator,
|
|
25
27
|
validatorNonce
|
|
26
28
|
}: {
|
|
@@ -28,6 +30,7 @@ export const getPluginsEnableTypedData = async <
|
|
|
28
30
|
chainId: number
|
|
29
31
|
kernelVersion: string
|
|
30
32
|
validatorNonce: number
|
|
33
|
+
hook?: KernelValidatorHook
|
|
31
34
|
} & Kernel2_0_plugins<entryPoint>): Promise<
|
|
32
35
|
Parameters<CustomSource["signTypedData"]>[0]
|
|
33
36
|
> => {
|
|
@@ -54,9 +57,9 @@ export const getPluginsEnableTypedData = async <
|
|
|
54
57
|
pad(validator.getIdentifier(), { size: 20, dir: "right" })
|
|
55
58
|
]),
|
|
56
59
|
nonce: validatorNonce,
|
|
57
|
-
hook: zeroAddress,
|
|
60
|
+
hook: hook?.getIdentifier() ?? zeroAddress,
|
|
58
61
|
validatorData: await validator.getEnableData(accountAddress),
|
|
59
|
-
hookData: "0x",
|
|
62
|
+
hookData: (await hook?.getEnableData(accountAddress)) ?? "0x",
|
|
60
63
|
selectorData: concat([
|
|
61
64
|
action.selector,
|
|
62
65
|
action.address,
|
|
@@ -51,6 +51,7 @@ export async function toKernelPluginManager<
|
|
|
51
51
|
{
|
|
52
52
|
sudo,
|
|
53
53
|
regular,
|
|
54
|
+
hook,
|
|
54
55
|
pluginEnableSignature,
|
|
55
56
|
validatorInitData,
|
|
56
57
|
action,
|
|
@@ -99,8 +100,9 @@ export async function toKernelPluginManager<
|
|
|
99
100
|
return ValidatorMode.plugin
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
const enableSignature =
|
|
103
|
-
|
|
103
|
+
const enableSignature = await getPluginEnableSignature(
|
|
104
|
+
accountAddress
|
|
105
|
+
)
|
|
104
106
|
if (!enableSignature) {
|
|
105
107
|
throw new Error("Enable signature not set")
|
|
106
108
|
}
|
|
@@ -124,13 +126,15 @@ export async function toKernelPluginManager<
|
|
|
124
126
|
if (await isPluginEnabled(accountAddress, action.selector)) {
|
|
125
127
|
return userOpSignature
|
|
126
128
|
}
|
|
127
|
-
const enableSignature =
|
|
128
|
-
|
|
129
|
+
const enableSignature = await getPluginEnableSignature(
|
|
130
|
+
accountAddress
|
|
131
|
+
)
|
|
129
132
|
return getEncodedPluginsDataV2({
|
|
130
133
|
enableSignature,
|
|
131
134
|
userOpSignature,
|
|
132
135
|
action,
|
|
133
|
-
enableData: await regular.getEnableData(accountAddress)
|
|
136
|
+
enableData: await regular.getEnableData(accountAddress),
|
|
137
|
+
hook
|
|
134
138
|
})
|
|
135
139
|
} else if (sudo) {
|
|
136
140
|
return userOpSignature
|
|
@@ -190,10 +194,12 @@ export async function toKernelPluginManager<
|
|
|
190
194
|
chainId,
|
|
191
195
|
kernelVersion: version,
|
|
192
196
|
action,
|
|
197
|
+
hook,
|
|
193
198
|
validator: regular,
|
|
194
199
|
validatorNonce
|
|
195
200
|
})
|
|
196
201
|
ownerSig = await sudo.signTypedData(typedData)
|
|
202
|
+
pluginEnableSignature = ownerSig
|
|
197
203
|
|
|
198
204
|
return ownerSig
|
|
199
205
|
}
|
|
@@ -238,6 +244,7 @@ export async function toKernelPluginManager<
|
|
|
238
244
|
return {
|
|
239
245
|
sudoValidator: sudo,
|
|
240
246
|
...activeValidator,
|
|
247
|
+
hook,
|
|
241
248
|
getIdentifier,
|
|
242
249
|
encodeModuleInstallCallData: async (accountAddress: Address) => {
|
|
243
250
|
if (!action) {
|
|
@@ -258,8 +265,9 @@ export async function toKernelPluginManager<
|
|
|
258
265
|
throw new Error("EntryPoint v0.7 not supported yet")
|
|
259
266
|
},
|
|
260
267
|
signUserOperation: async (userOperation) => {
|
|
261
|
-
const userOpSig =
|
|
262
|
-
|
|
268
|
+
const userOpSig = await activeValidator.signUserOperation(
|
|
269
|
+
userOperation
|
|
270
|
+
)
|
|
263
271
|
if (entryPointVersion === "v0.6") {
|
|
264
272
|
return concatHex([
|
|
265
273
|
await getSignatureData(
|
|
@@ -286,8 +294,9 @@ export async function toKernelPluginManager<
|
|
|
286
294
|
validUntil
|
|
287
295
|
}),
|
|
288
296
|
getDummySignature: async (userOperation) => {
|
|
289
|
-
const userOpSig =
|
|
290
|
-
|
|
297
|
+
const userOpSig = await activeValidator.getDummySignature(
|
|
298
|
+
userOperation
|
|
299
|
+
)
|
|
291
300
|
if (entryPointVersion === "v0.6") {
|
|
292
301
|
return concatHex([
|
|
293
302
|
await getSignatureData(
|
package/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerodev/sdk",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.18-alpha-0",
|
|
4
4
|
"author": "ZeroDev",
|
|
5
5
|
"main": "./_cjs/index.js",
|
|
6
6
|
"module": "./_esm/index.js",
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"description": "A utility library for working with ERC-4337",
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"ethereum",
|
|
14
|
+
"erc-4337",
|
|
15
|
+
"eip-4337",
|
|
16
|
+
"paymaster",
|
|
17
|
+
"bundler"
|
|
18
|
+
],
|
|
13
19
|
"license": "MIT",
|
|
14
20
|
"files": [
|
|
15
21
|
"_esm",
|
|
@@ -85,14 +91,30 @@
|
|
|
85
91
|
},
|
|
86
92
|
"typesVersions": {
|
|
87
93
|
"*": {
|
|
88
|
-
"accounts": [
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
"
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
94
|
+
"accounts": [
|
|
95
|
+
"./_types/accounts/index.d.ts"
|
|
96
|
+
],
|
|
97
|
+
"plugins": [
|
|
98
|
+
"./_types/plugins/index.d.ts"
|
|
99
|
+
],
|
|
100
|
+
"actions": [
|
|
101
|
+
"./_types/actions/index.d.ts"
|
|
102
|
+
],
|
|
103
|
+
"types": [
|
|
104
|
+
"./_types/types/index.d.ts"
|
|
105
|
+
],
|
|
106
|
+
"actions/kernel": [
|
|
107
|
+
"./_types/actions/kernel/index.d.ts"
|
|
108
|
+
],
|
|
109
|
+
"clients": [
|
|
110
|
+
"./_types/clients/index.d.ts"
|
|
111
|
+
],
|
|
112
|
+
"clients/kernel": [
|
|
113
|
+
"./_types/clients/kernel/index.d.ts"
|
|
114
|
+
],
|
|
115
|
+
"providers": [
|
|
116
|
+
"./_types/providers/index.d.ts"
|
|
117
|
+
]
|
|
96
118
|
}
|
|
97
119
|
},
|
|
98
120
|
"peerDependencies": {
|
package/types/kernel.ts
CHANGED
|
@@ -143,6 +143,11 @@ export type KernelValidator<
|
|
|
143
143
|
getIdentifier: () => Hex
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
export type KernelValidatorHook = {
|
|
147
|
+
getEnableData(accountAddress?: Address): Promise<Hex>
|
|
148
|
+
getIdentifier: () => Hex
|
|
149
|
+
}
|
|
150
|
+
|
|
146
151
|
export type ValidatorInitData = {
|
|
147
152
|
validatorAddress: Address
|
|
148
153
|
enableData: Hex
|
|
@@ -152,6 +157,7 @@ export type ValidatorInitData = {
|
|
|
152
157
|
export type KernelPluginManager<entryPoint extends EntryPoint> =
|
|
153
158
|
KernelValidator<entryPoint> & {
|
|
154
159
|
sudoValidator?: KernelValidator<entryPoint>
|
|
160
|
+
hook?: KernelValidatorHook
|
|
155
161
|
getPluginEnableSignature(accountAddress: Address): Promise<Hex>
|
|
156
162
|
getValidatorInitData(): Promise<ValidatorInitData>
|
|
157
163
|
getAction(): Action
|
|
@@ -182,6 +188,7 @@ export type PluginInstallData<entryPoint extends EntryPoint> =
|
|
|
182
188
|
export type KernelPluginManagerParams<entryPoint extends EntryPoint> = {
|
|
183
189
|
sudo?: KernelValidator<entryPoint>
|
|
184
190
|
regular?: KernelValidator<entryPoint>
|
|
191
|
+
hook?: KernelValidatorHook
|
|
185
192
|
pluginEnableSignature?: Hex
|
|
186
193
|
validatorInitData?: ValidatorInitData
|
|
187
194
|
action?: Action
|