@zerodev/sdk 5.1.13 → 5.1.15
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/index.js +7 -1
- package/_cjs/accounts/index.js.map +1 -1
- package/_cjs/accounts/kernel/createKernelAccount.js +29 -4
- package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js +1 -1
- package/_cjs/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_cjs/accounts/kernel/v2/abi/KernelAccountV2Abi.js +377 -0
- package/_cjs/accounts/kernel/v2/abi/KernelAccountV2Abi.js.map +1 -0
- package/_cjs/accounts/kernel/v2/abi/KernelFactoryV2Abi.js +115 -0
- package/_cjs/accounts/kernel/v2/abi/KernelFactoryV2Abi.js.map +1 -0
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js +216 -0
- package/_cjs/accounts/kernel/v2/createKernelV2Account.js.map +1 -0
- package/_cjs/accounts/utils/multisend.js.map +1 -0
- package/_cjs/accounts/utils/toKernelPluginManager.js +5 -4
- package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_cjs/index.js +2 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/types/kernel.js.map +1 -1
- package/_esm/accounts/index.js +3 -0
- package/_esm/accounts/index.js.map +1 -1
- package/_esm/accounts/kernel/createKernelAccount.js +32 -5
- package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
- package/_esm/accounts/kernel/v1/createKernelV1Account.js +1 -1
- package/_esm/accounts/kernel/v1/createKernelV1Account.js.map +1 -1
- package/_esm/accounts/kernel/v2/abi/KernelAccountV2Abi.js +374 -0
- package/_esm/accounts/kernel/v2/abi/KernelAccountV2Abi.js.map +1 -0
- package/_esm/accounts/kernel/v2/abi/KernelFactoryV2Abi.js +112 -0
- package/_esm/accounts/kernel/v2/abi/KernelFactoryV2Abi.js.map +1 -0
- package/_esm/accounts/kernel/v2/createKernelV2Account.js +254 -0
- package/_esm/accounts/kernel/v2/createKernelV2Account.js.map +1 -0
- package/_esm/accounts/{kernel/v1 → utils}/multisend.js +1 -1
- package/_esm/accounts/utils/multisend.js.map +1 -0
- package/_esm/accounts/utils/toKernelPluginManager.js +5 -4
- package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/types/kernel.js.map +1 -1
- package/_types/accounts/index.d.ts +3 -0
- package/_types/accounts/index.d.ts.map +1 -1
- package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
- package/_types/accounts/kernel/v1/createKernelV1Account.d.ts.map +1 -1
- package/_types/accounts/kernel/v2/abi/KernelAccountV2Abi.d.ts +447 -0
- package/_types/accounts/kernel/v2/abi/KernelAccountV2Abi.d.ts.map +1 -0
- package/_types/accounts/kernel/v2/abi/KernelFactoryV2Abi.d.ts +109 -0
- package/_types/accounts/kernel/v2/abi/KernelFactoryV2Abi.d.ts.map +1 -0
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts +33 -0
- package/_types/accounts/kernel/v2/createKernelV2Account.d.ts.map +1 -0
- package/_types/accounts/{kernel/v1 → utils}/multisend.d.ts +1 -1
- package/_types/accounts/utils/multisend.d.ts.map +1 -0
- 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 +1 -0
- package/_types/types/kernel.d.ts.map +1 -1
- package/accounts/index.ts +3 -0
- package/accounts/kernel/createKernelAccount.ts +32 -4
- package/accounts/kernel/v1/createKernelV1Account.ts +2 -2
- package/accounts/kernel/v2/abi/KernelAccountV2Abi.ts +373 -0
- package/accounts/kernel/v2/abi/KernelFactoryV2Abi.ts +111 -0
- package/accounts/kernel/v2/createKernelV2Account.ts +369 -0
- package/accounts/{kernel/v1 → utils}/multisend.ts +1 -1
- package/accounts/utils/toKernelPluginManager.ts +7 -4
- package/index.ts +1 -0
- package/package.json +1 -1
- package/types/kernel.ts +1 -0
- package/_cjs/accounts/kernel/v1/multisend.js.map +0 -1
- package/_esm/accounts/kernel/v1/multisend.js.map +0 -1
- package/_types/accounts/kernel/v1/multisend.d.ts.map +0 -1
- /package/_cjs/accounts/{kernel/v1 → utils}/multisend.js +0 -0
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { getAccountNonce, getSenderAddress } from "permissionless"
|
|
2
|
+
import {
|
|
3
|
+
SignTransactionNotSupportedBySmartAccount,
|
|
4
|
+
type SmartAccount
|
|
5
|
+
} from "permissionless/accounts"
|
|
6
|
+
import {
|
|
7
|
+
type Address,
|
|
8
|
+
type Chain,
|
|
9
|
+
type Client,
|
|
10
|
+
type EncodeDeployDataParameters,
|
|
11
|
+
type Hash,
|
|
12
|
+
type Hex,
|
|
13
|
+
type Transport,
|
|
14
|
+
type TypedDataDefinition,
|
|
15
|
+
concatHex,
|
|
16
|
+
encodeDeployData,
|
|
17
|
+
encodeFunctionData,
|
|
18
|
+
getTypesForEIP712Domain,
|
|
19
|
+
hashMessage,
|
|
20
|
+
hashTypedData,
|
|
21
|
+
parseAbi,
|
|
22
|
+
validateTypedData
|
|
23
|
+
} from "viem"
|
|
24
|
+
import { toAccount } from "viem/accounts"
|
|
25
|
+
import { getBytecode } from "viem/actions"
|
|
26
|
+
import type {
|
|
27
|
+
KernelEncodeCallDataArgs,
|
|
28
|
+
KernelPluginManager,
|
|
29
|
+
KernelPluginManagerParams
|
|
30
|
+
} from "../../../types/kernel.js"
|
|
31
|
+
import { wrapSignatureWith6492 } from "../../utils/6492.js"
|
|
32
|
+
import { parseFactoryAddressAndCallDataFromAccountInitCode } from "../../utils/index.js"
|
|
33
|
+
import {
|
|
34
|
+
MULTISEND_ADDRESS,
|
|
35
|
+
encodeMultiSend,
|
|
36
|
+
multiSendAbi
|
|
37
|
+
} from "../../utils/multisend.js"
|
|
38
|
+
import {
|
|
39
|
+
isKernelPluginManager,
|
|
40
|
+
toKernelPluginManager
|
|
41
|
+
} from "../../utils/toKernelPluginManager.js"
|
|
42
|
+
import { KernelAccountV2Abi } from "./abi/KernelAccountV2Abi.js"
|
|
43
|
+
import { KernelFactoryV2Abi } from "./abi/KernelFactoryV2Abi.js"
|
|
44
|
+
|
|
45
|
+
export type KernelSmartAccount<
|
|
46
|
+
transport extends Transport = Transport,
|
|
47
|
+
chain extends Chain | undefined = Chain | undefined
|
|
48
|
+
> = SmartAccount<"kernelSmartAccount", transport, chain> & {
|
|
49
|
+
kernelPluginManager: KernelPluginManager
|
|
50
|
+
generateInitCode: () => Promise<Hex>
|
|
51
|
+
encodeCallData: (args: KernelEncodeCallDataArgs) => Promise<Hex>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Safe's library for create and create2: https://github.com/safe-global/safe-contracts/blob/0acdd35a203299585438f53885df630f9d486a86/contracts/libraries/CreateCall.sol
|
|
55
|
+
// Address was found here: https://github.com/safe-global/safe-deployments/blob/926ec6bbe2ebcac3aa2c2c6c0aff74aa590cbc6a/src/assets/v1.4.1/create_call.json
|
|
56
|
+
const createCallAddress = "0x9b35Af71d77eaf8d7e40252370304687390A1A52"
|
|
57
|
+
|
|
58
|
+
const createCallAbi = parseAbi([
|
|
59
|
+
"function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)",
|
|
60
|
+
"function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"
|
|
61
|
+
])
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Default addresses for kernel smart account
|
|
65
|
+
*/
|
|
66
|
+
export const KERNEL_ADDRESSES: {
|
|
67
|
+
FACTORY_ADDRESS: Address
|
|
68
|
+
ENTRYPOINT_V0_6: Address
|
|
69
|
+
} = {
|
|
70
|
+
FACTORY_ADDRESS: "0xaee9762ce625e0a8f7b184670fb57c37bfe1d0f1",
|
|
71
|
+
ENTRYPOINT_V0_6: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Get the account initialization code for a kernel smart account
|
|
76
|
+
* @param index
|
|
77
|
+
* @param factoryAddress
|
|
78
|
+
* @param ecdsaValidatorAddress
|
|
79
|
+
*/
|
|
80
|
+
const getAccountInitCode = async ({
|
|
81
|
+
index,
|
|
82
|
+
factoryAddress,
|
|
83
|
+
validatorAddress,
|
|
84
|
+
enableData
|
|
85
|
+
}: {
|
|
86
|
+
index: bigint
|
|
87
|
+
factoryAddress: Address
|
|
88
|
+
validatorAddress: Address
|
|
89
|
+
enableData: Hex
|
|
90
|
+
}): Promise<Hex> => {
|
|
91
|
+
// Build the account init code
|
|
92
|
+
return concatHex([
|
|
93
|
+
factoryAddress,
|
|
94
|
+
encodeFunctionData({
|
|
95
|
+
abi: KernelFactoryV2Abi,
|
|
96
|
+
functionName: "createAccount",
|
|
97
|
+
args: [validatorAddress, enableData, index]
|
|
98
|
+
}) as Hex
|
|
99
|
+
])
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Check the validity of an existing account address, or fetch the pre-deterministic account address for a kernel smart wallet
|
|
104
|
+
* @param client
|
|
105
|
+
* @param entryPoint
|
|
106
|
+
* @param initCodeProvider
|
|
107
|
+
*/
|
|
108
|
+
const getAccountAddress = async <
|
|
109
|
+
TTransport extends Transport = Transport,
|
|
110
|
+
TChain extends Chain | undefined = Chain | undefined
|
|
111
|
+
>({
|
|
112
|
+
client,
|
|
113
|
+
entryPoint,
|
|
114
|
+
initCodeProvider
|
|
115
|
+
}: {
|
|
116
|
+
client: Client<TTransport, TChain, undefined>
|
|
117
|
+
initCodeProvider: () => Promise<Hex>
|
|
118
|
+
entryPoint: Address
|
|
119
|
+
}): Promise<Address> => {
|
|
120
|
+
// Find the init code for this account
|
|
121
|
+
const initCode = await initCodeProvider()
|
|
122
|
+
|
|
123
|
+
// Get the sender address based on the init code
|
|
124
|
+
return getSenderAddress(client, {
|
|
125
|
+
initCode,
|
|
126
|
+
entryPoint
|
|
127
|
+
})
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Build a kernel smart account from a private key, that use the ECDSA signer behind the scene
|
|
132
|
+
* @param client
|
|
133
|
+
* @param privateKey
|
|
134
|
+
* @param entryPoint
|
|
135
|
+
* @param index
|
|
136
|
+
* @param factoryAddress
|
|
137
|
+
* @param ecdsaValidatorAddress
|
|
138
|
+
* @param deployedAccountAddress
|
|
139
|
+
*/
|
|
140
|
+
export async function createKernelV2Account<
|
|
141
|
+
TTransport extends Transport = Transport,
|
|
142
|
+
TChain extends Chain | undefined = Chain | undefined
|
|
143
|
+
>(
|
|
144
|
+
client: Client<TTransport, TChain, undefined>,
|
|
145
|
+
{
|
|
146
|
+
plugins,
|
|
147
|
+
entryPoint = KERNEL_ADDRESSES.ENTRYPOINT_V0_6,
|
|
148
|
+
index = 0n,
|
|
149
|
+
factoryAddress = KERNEL_ADDRESSES.FACTORY_ADDRESS,
|
|
150
|
+
deployedAccountAddress
|
|
151
|
+
}: {
|
|
152
|
+
plugins: KernelPluginManagerParams | KernelPluginManager
|
|
153
|
+
entryPoint?: Address
|
|
154
|
+
index?: bigint
|
|
155
|
+
factoryAddress?: Address
|
|
156
|
+
deployedAccountAddress?: Address
|
|
157
|
+
}
|
|
158
|
+
): Promise<KernelSmartAccount<TTransport, TChain>> {
|
|
159
|
+
const kernelPluginManager = isKernelPluginManager(plugins)
|
|
160
|
+
? plugins
|
|
161
|
+
: await toKernelPluginManager(client, {
|
|
162
|
+
sudo: plugins.sudo,
|
|
163
|
+
regular: plugins.regular,
|
|
164
|
+
executorData: plugins.executorData,
|
|
165
|
+
pluginEnableSignature: plugins.pluginEnableSignature,
|
|
166
|
+
kernelVersion: "0.0.2" ?? plugins.kernelVersion
|
|
167
|
+
})
|
|
168
|
+
// Helper to generate the init code for the smart account
|
|
169
|
+
const generateInitCode = async () => {
|
|
170
|
+
const validatorInitData =
|
|
171
|
+
await kernelPluginManager.getValidatorInitData()
|
|
172
|
+
return getAccountInitCode({
|
|
173
|
+
index,
|
|
174
|
+
factoryAddress,
|
|
175
|
+
validatorAddress: validatorInitData.validatorAddress,
|
|
176
|
+
enableData: validatorInitData.enableData
|
|
177
|
+
})
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Fetch account address and chain id
|
|
181
|
+
const accountAddress =
|
|
182
|
+
deployedAccountAddress ??
|
|
183
|
+
(await getAccountAddress<TTransport, TChain>({
|
|
184
|
+
client,
|
|
185
|
+
entryPoint,
|
|
186
|
+
initCodeProvider: generateInitCode
|
|
187
|
+
}))
|
|
188
|
+
|
|
189
|
+
if (!accountAddress) throw new Error("Account address not found")
|
|
190
|
+
|
|
191
|
+
// Build the EOA Signer
|
|
192
|
+
const account = toAccount({
|
|
193
|
+
address: accountAddress,
|
|
194
|
+
async signMessage({ message }) {
|
|
195
|
+
const messageHash = hashMessage(message)
|
|
196
|
+
const [isDeployed, signature] = await Promise.all([
|
|
197
|
+
isAccountDeployed(),
|
|
198
|
+
kernelPluginManager.signMessage({
|
|
199
|
+
message: {
|
|
200
|
+
raw: messageHash
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
])
|
|
204
|
+
return create6492Signature(isDeployed, signature)
|
|
205
|
+
},
|
|
206
|
+
async signTransaction(_, __) {
|
|
207
|
+
throw new SignTransactionNotSupportedBySmartAccount()
|
|
208
|
+
},
|
|
209
|
+
async signTypedData(typedData) {
|
|
210
|
+
const types = {
|
|
211
|
+
EIP712Domain: getTypesForEIP712Domain({
|
|
212
|
+
domain: typedData.domain
|
|
213
|
+
}),
|
|
214
|
+
...typedData.types
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc
|
|
218
|
+
// as we can't statically check this with TypeScript.
|
|
219
|
+
validateTypedData({
|
|
220
|
+
domain: typedData.domain,
|
|
221
|
+
message: typedData.message,
|
|
222
|
+
primaryType: typedData.primaryType,
|
|
223
|
+
types: types
|
|
224
|
+
} as TypedDataDefinition)
|
|
225
|
+
|
|
226
|
+
const typedHash = hashTypedData(typedData)
|
|
227
|
+
const [isDeployed, signature] = await Promise.all([
|
|
228
|
+
isAccountDeployed(),
|
|
229
|
+
kernelPluginManager.signMessage({
|
|
230
|
+
message: {
|
|
231
|
+
raw: typedHash
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
])
|
|
235
|
+
return create6492Signature(isDeployed, signature)
|
|
236
|
+
}
|
|
237
|
+
})
|
|
238
|
+
|
|
239
|
+
const isAccountDeployed = async (): Promise<boolean> => {
|
|
240
|
+
const contractCode = await getBytecode(client, {
|
|
241
|
+
address: accountAddress
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
return (contractCode?.length ?? 0) > 2
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const create6492Signature = async (
|
|
248
|
+
isDeployed: boolean,
|
|
249
|
+
signature: Hash
|
|
250
|
+
): Promise<Hash> => {
|
|
251
|
+
if (isDeployed) {
|
|
252
|
+
return signature
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
const [factoryAddress, factoryCalldata] =
|
|
256
|
+
parseFactoryAddressAndCallDataFromAccountInitCode(
|
|
257
|
+
await generateInitCode()
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
return wrapSignatureWith6492({
|
|
261
|
+
factoryAddress,
|
|
262
|
+
factoryCalldata,
|
|
263
|
+
signature
|
|
264
|
+
})
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return {
|
|
268
|
+
...account,
|
|
269
|
+
client: client,
|
|
270
|
+
publicKey: accountAddress,
|
|
271
|
+
entryPoint: entryPoint,
|
|
272
|
+
source: "kernelSmartAccount",
|
|
273
|
+
kernelPluginManager,
|
|
274
|
+
generateInitCode,
|
|
275
|
+
|
|
276
|
+
// Get the nonce of the smart account
|
|
277
|
+
async getNonce() {
|
|
278
|
+
const key = await kernelPluginManager.getNonceKey()
|
|
279
|
+
return getAccountNonce(client, {
|
|
280
|
+
sender: accountAddress,
|
|
281
|
+
entryPoint: entryPoint,
|
|
282
|
+
key
|
|
283
|
+
})
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
// Sign a user operation
|
|
287
|
+
async signUserOperation(userOperation) {
|
|
288
|
+
return kernelPluginManager.signUserOperation(userOperation)
|
|
289
|
+
},
|
|
290
|
+
|
|
291
|
+
// Encode the init code
|
|
292
|
+
async getInitCode() {
|
|
293
|
+
if (await isAccountDeployed()) {
|
|
294
|
+
return "0x"
|
|
295
|
+
} else {
|
|
296
|
+
return generateInitCode()
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
|
|
300
|
+
// Encode the deploy call data
|
|
301
|
+
async encodeDeployCallData(_tx) {
|
|
302
|
+
return encodeFunctionData({
|
|
303
|
+
abi: KernelAccountV2Abi,
|
|
304
|
+
functionName: "execute",
|
|
305
|
+
args: [
|
|
306
|
+
createCallAddress,
|
|
307
|
+
0n,
|
|
308
|
+
encodeFunctionData({
|
|
309
|
+
abi: createCallAbi,
|
|
310
|
+
functionName: "performCreate",
|
|
311
|
+
args: [
|
|
312
|
+
0n,
|
|
313
|
+
encodeDeployData({
|
|
314
|
+
abi: _tx.abi,
|
|
315
|
+
bytecode: _tx.bytecode,
|
|
316
|
+
args: _tx.args
|
|
317
|
+
} as EncodeDeployDataParameters)
|
|
318
|
+
]
|
|
319
|
+
}),
|
|
320
|
+
1 // Delegate call
|
|
321
|
+
]
|
|
322
|
+
})
|
|
323
|
+
},
|
|
324
|
+
|
|
325
|
+
// Encode a call
|
|
326
|
+
async encodeCallData(_tx) {
|
|
327
|
+
const tx = _tx as KernelEncodeCallDataArgs
|
|
328
|
+
if (Array.isArray(tx)) {
|
|
329
|
+
const multiSendCallData = encodeFunctionData({
|
|
330
|
+
abi: multiSendAbi,
|
|
331
|
+
functionName: "multiSend",
|
|
332
|
+
args: [encodeMultiSend(tx)]
|
|
333
|
+
})
|
|
334
|
+
return encodeFunctionData({
|
|
335
|
+
abi: KernelAccountV2Abi,
|
|
336
|
+
functionName: "execute",
|
|
337
|
+
args: [MULTISEND_ADDRESS, 0n, multiSendCallData, 1]
|
|
338
|
+
})
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
// Default to `call`
|
|
342
|
+
if (!tx.callType || tx.callType === "call") {
|
|
343
|
+
if (tx.to.toLowerCase() === accountAddress.toLowerCase()) {
|
|
344
|
+
return tx.data
|
|
345
|
+
}
|
|
346
|
+
return encodeFunctionData({
|
|
347
|
+
abi: KernelAccountV2Abi,
|
|
348
|
+
functionName: "execute",
|
|
349
|
+
args: [tx.to, tx.value, tx.data, 0]
|
|
350
|
+
})
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if (tx.callType === "delegatecall") {
|
|
354
|
+
return encodeFunctionData({
|
|
355
|
+
abi: KernelAccountV2Abi,
|
|
356
|
+
functionName: "execute",
|
|
357
|
+
args: [tx.to, 0n, tx.data, 1]
|
|
358
|
+
})
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
throw new Error("Invalid call type")
|
|
362
|
+
},
|
|
363
|
+
|
|
364
|
+
// Get simple dummy signature
|
|
365
|
+
async getDummySignature(userOperation) {
|
|
366
|
+
return kernelPluginManager.getDummySignature(userOperation)
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
@@ -2,7 +2,7 @@ import { type Address, type Hex, encodePacked, toBytes } from "viem"
|
|
|
2
2
|
import {
|
|
3
3
|
type CallType,
|
|
4
4
|
type KernelEncodeCallDataArgs
|
|
5
|
-
} from "
|
|
5
|
+
} from "../../types/index.js"
|
|
6
6
|
|
|
7
7
|
export const MULTISEND_ADDRESS = "0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c"
|
|
8
8
|
|
|
@@ -46,7 +46,8 @@ export async function toKernelPluginManager<
|
|
|
46
46
|
)
|
|
47
47
|
},
|
|
48
48
|
validAfter = 0,
|
|
49
|
-
validUntil = 0
|
|
49
|
+
validUntil = 0,
|
|
50
|
+
kernelVersion
|
|
50
51
|
}: KernelPluginManagerParams
|
|
51
52
|
): Promise<KernelPluginManager> {
|
|
52
53
|
const chainId = await getChainId(client)
|
|
@@ -106,9 +107,11 @@ export async function toKernelPluginManager<
|
|
|
106
107
|
const ownerSig = await sudo.signTypedData({
|
|
107
108
|
domain: {
|
|
108
109
|
name: "Kernel",
|
|
109
|
-
version:
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
version:
|
|
111
|
+
kernelVersion ??
|
|
112
|
+
(kernelImplAddr
|
|
113
|
+
? getKernelVersion(kernelImplAddr)
|
|
114
|
+
: LATEST_KERNEL_VERSION),
|
|
112
115
|
chainId,
|
|
113
116
|
verifyingContract: accountAddress
|
|
114
117
|
},
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/types/kernel.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"multisend.js","sourceRoot":"","sources":["../../../../accounts/kernel/v1/multisend.ts"],"names":[],"mappings":";;;AAAA,+BAAoE;AAMvD,QAAA,iBAAiB,GAAG,4CAA4C,CAAA;AAEhE,QAAA,YAAY,GAAG;IACxB;QACI,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;KACpD;CACJ,CAAA;AAED,MAAM,UAAU,GAAG,CAAC,IAKnB,EAAU,EAAE;IACT,MAAM,IAAI,GAAG,IAAA,cAAO,EAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/B,MAAM,OAAO,GAAG,IAAA,mBAAY,EACxB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EACnD;QACI,IAAI,CAAC,QAAQ,KAAK,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,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