@zerodev/sdk 5.3.12 → 5.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/_cjs/accounts/kernel/createKernelAccount.js +7 -6
  2. package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
  3. package/_cjs/accounts/kernel/utils/common/accountMetadata.js +5 -4
  4. package/_cjs/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
  5. package/_cjs/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  6. package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  7. package/_cjs/accounts/utils/toKernelPluginManager.js +16 -6
  8. package/_cjs/accounts/utils/toKernelPluginManager.js.map +1 -1
  9. package/_cjs/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
  10. package/_cjs/actions/account-client/invalidateNonce.js.map +1 -1
  11. package/_cjs/actions/account-client/signUserOperation.js +1 -1
  12. package/_cjs/actions/account-client/signUserOperation.js.map +1 -1
  13. package/_cjs/actions/account-client/uninstallPlugin.js.map +1 -1
  14. package/_cjs/clients/decorators/kernel.js.map +1 -1
  15. package/_cjs/clients/fallbackKernelAccountClient.js.map +1 -1
  16. package/_cjs/clients/index.js.map +1 -1
  17. package/_cjs/clients/kernelAccountClient.js.map +1 -1
  18. package/_cjs/types/kernel.js.map +1 -1
  19. package/_esm/accounts/kernel/createKernelAccount.js +7 -6
  20. package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
  21. package/_esm/accounts/kernel/utils/common/accountMetadata.js +5 -4
  22. package/_esm/accounts/kernel/utils/common/accountMetadata.js.map +1 -1
  23. package/_esm/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  24. package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  25. package/_esm/accounts/utils/toKernelPluginManager.js +16 -6
  26. package/_esm/accounts/utils/toKernelPluginManager.js.map +1 -1
  27. package/_esm/actions/account-client/getKernelV3ModuleCurrentNonce.js.map +1 -1
  28. package/_esm/actions/account-client/invalidateNonce.js.map +1 -1
  29. package/_esm/actions/account-client/signUserOperation.js +1 -1
  30. package/_esm/actions/account-client/signUserOperation.js.map +1 -1
  31. package/_esm/actions/account-client/uninstallPlugin.js.map +1 -1
  32. package/_esm/clients/decorators/kernel.js.map +1 -1
  33. package/_esm/clients/fallbackKernelAccountClient.js.map +1 -1
  34. package/_esm/clients/index.js.map +1 -1
  35. package/_esm/clients/kernelAccountClient.js.map +1 -1
  36. package/_esm/types/kernel.js.map +1 -1
  37. package/_types/accounts/kernel/createKernelAccount.d.ts +3 -2
  38. package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
  39. package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts +1 -1
  40. package/_types/accounts/kernel/utils/account/ep0_6/encodeCallData.d.ts.map +1 -1
  41. package/_types/accounts/kernel/utils/common/accountMetadata.d.ts +2 -3
  42. package/_types/accounts/kernel/utils/common/accountMetadata.d.ts.map +1 -1
  43. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts +3 -3
  44. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts.map +1 -1
  45. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts +3 -3
  46. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts.map +1 -1
  47. package/_types/accounts/utils/toKernelPluginManager.d.ts +1 -1
  48. package/_types/accounts/utils/toKernelPluginManager.d.ts.map +1 -1
  49. package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts +2 -2
  50. package/_types/actions/account-client/getKernelV3ModuleCurrentNonce.d.ts.map +1 -1
  51. package/_types/actions/account-client/invalidateNonce.d.ts +2 -2
  52. package/_types/actions/account-client/invalidateNonce.d.ts.map +1 -1
  53. package/_types/actions/account-client/signUserOperation.d.ts +4 -4
  54. package/_types/actions/account-client/signUserOperation.d.ts.map +1 -1
  55. package/_types/actions/account-client/uninstallPlugin.d.ts +2 -2
  56. package/_types/actions/account-client/uninstallPlugin.d.ts.map +1 -1
  57. package/_types/clients/decorators/kernel.d.ts +5 -5
  58. package/_types/clients/decorators/kernel.d.ts.map +1 -1
  59. package/_types/clients/fallbackKernelAccountClient.d.ts +1 -1
  60. package/_types/clients/fallbackKernelAccountClient.d.ts.map +1 -1
  61. package/_types/clients/index.d.ts +1 -1
  62. package/_types/clients/index.d.ts.map +1 -1
  63. package/_types/clients/kernelAccountClient.d.ts +4 -4
  64. package/_types/clients/kernelAccountClient.d.ts.map +1 -1
  65. package/_types/types/kernel.d.ts +1 -0
  66. package/_types/types/kernel.d.ts.map +1 -1
  67. package/accounts/kernel/createKernelAccount.ts +32 -11
  68. package/accounts/kernel/utils/account/ep0_6/encodeCallData.ts +1 -1
  69. package/accounts/kernel/utils/common/accountMetadata.ts +9 -5
  70. package/accounts/kernel/v1/createKernelAccountV1.ts +10 -2
  71. package/accounts/kernel/v2/createKernelAccountV0_2.ts +10 -2
  72. package/accounts/utils/toKernelPluginManager.ts +16 -6
  73. package/actions/account-client/getKernelV3ModuleCurrentNonce.ts +11 -4
  74. package/actions/account-client/invalidateNonce.ts +24 -6
  75. package/actions/account-client/signUserOperation.ts +33 -10
  76. package/actions/account-client/uninstallPlugin.ts +24 -6
  77. package/clients/decorators/kernel.ts +33 -8
  78. package/clients/fallbackKernelAccountClient.ts +3 -1
  79. package/clients/index.ts +2 -1
  80. package/clients/kernelAccountClient.ts +18 -14
  81. package/package.json +3 -3
  82. package/types/kernel.ts +1 -0
@@ -67,11 +67,14 @@ export const zerodevPaymasterActions =
67
67
 
68
68
  export type KernelAccountClientActions<
69
69
  entryPoint extends EntryPoint,
70
+ TTransport extends Transport = Transport,
70
71
  TChain extends Chain | undefined = Chain | undefined,
71
- TSmartAccount extends KernelSmartAccount<entryPoint> | undefined =
72
- | KernelSmartAccount<entryPoint>
72
+ TSmartAccount extends
73
+ | KernelSmartAccount<entryPoint, TTransport, TChain>
74
+ | undefined =
75
+ | KernelSmartAccount<entryPoint, TTransport, TChain>
73
76
  | undefined
74
- > = SmartAccountActions<entryPoint, TChain, TSmartAccount> & {
77
+ > = SmartAccountActions<entryPoint, TTransport, TChain, TSmartAccount> & {
75
78
  /**
76
79
  * Signs a user operation with the given transport, chain, and smart account.
77
80
  *
@@ -109,6 +112,7 @@ export type KernelAccountClientActions<
109
112
  >(
110
113
  args: UninstallPluginParameters<
111
114
  entryPoint,
115
+ TTransport,
112
116
  TChain,
113
117
  TSmartAccount,
114
118
  TChainOverride
@@ -127,6 +131,7 @@ export type KernelAccountClientActions<
127
131
  >(
128
132
  args: InvalidateNonceParameters<
129
133
  entryPoint,
134
+ TTransport,
130
135
  TChain,
131
136
  TSmartAccount,
132
137
  TChainOverride
@@ -145,6 +150,7 @@ export type KernelAccountClientActions<
145
150
  >(
146
151
  args: GetKernelV3ModuleCurrentNonceParameters<
147
152
  entryPoint,
153
+ TTransport,
148
154
  TChain,
149
155
  TSmartAccount,
150
156
  TChainOverride
@@ -158,12 +164,19 @@ export function kernelAccountClientActions<entryPoint extends EntryPoint>({
158
164
  return <
159
165
  TTransport extends Transport,
160
166
  TChain extends Chain | undefined = Chain | undefined,
161
- TSmartAccount extends KernelSmartAccount<entryPoint> | undefined =
162
- | KernelSmartAccount<entryPoint>
167
+ TSmartAccount extends
168
+ | KernelSmartAccount<entryPoint, TTransport, TChain>
169
+ | undefined =
170
+ | KernelSmartAccount<entryPoint, TTransport, TChain>
163
171
  | undefined
164
172
  >(
165
173
  client: Client<TTransport, TChain, TSmartAccount>
166
- ): KernelAccountClientActions<entryPoint, TChain, TSmartAccount> => ({
174
+ ): KernelAccountClientActions<
175
+ entryPoint,
176
+ TTransport,
177
+ TChain,
178
+ TSmartAccount
179
+ > => ({
167
180
  ...smartAccountActions({ middleware })(client),
168
181
  signUserOperation: (args) =>
169
182
  signUserOperation<entryPoint, TTransport, TChain, TSmartAccount>(
@@ -171,7 +184,12 @@ export function kernelAccountClientActions<entryPoint extends EntryPoint>({
171
184
  {
172
185
  ...args,
173
186
  middleware
174
- } as SignUserOperationParameters<entryPoint, TSmartAccount>
187
+ } as SignUserOperationParameters<
188
+ entryPoint,
189
+ TTransport,
190
+ TChain,
191
+ TSmartAccount
192
+ >
175
193
  ),
176
194
  getUserOperationGasPrice: async () => getUserOperationGasPrice(client),
177
195
  uninstallPlugin: async (args) =>
@@ -182,6 +200,7 @@ export function kernelAccountClientActions<entryPoint extends EntryPoint>({
182
200
  middleware
183
201
  } as UninstallPluginParameters<
184
202
  entryPoint,
203
+ TTransport,
185
204
  TChain,
186
205
  TSmartAccount
187
206
  >
@@ -190,13 +209,19 @@ export function kernelAccountClientActions<entryPoint extends EntryPoint>({
190
209
  invalidateNonce(client, {
191
210
  ...args,
192
211
  middleware
193
- } as InvalidateNonceParameters<entryPoint, TChain, TSmartAccount>),
212
+ } as InvalidateNonceParameters<
213
+ entryPoint,
214
+ TTransport,
215
+ TChain,
216
+ TSmartAccount
217
+ >),
194
218
  getKernelV3ModuleCurrentNonce: async (args) =>
195
219
  getKernelV3ModuleCurrentNonce(client, {
196
220
  ...args,
197
221
  middleware
198
222
  } as GetKernelV3ModuleCurrentNonceParameters<
199
223
  entryPoint,
224
+ TTransport,
200
225
  TChain,
201
226
  TSmartAccount
202
227
  >)
@@ -7,7 +7,9 @@ export const createFallbackKernelAccountClient = <
7
7
  TEntryPoint extends EntryPoint,
8
8
  TTransport extends Transport,
9
9
  TChain extends Chain | undefined,
10
- TSmartAccount extends KernelSmartAccount<TEntryPoint> | undefined
10
+ TSmartAccount extends
11
+ | KernelSmartAccount<TEntryPoint, TTransport, TChain>
12
+ | undefined
11
13
  >(
12
14
  clients: Array<
13
15
  KernelAccountClient<TEntryPoint, TTransport, TChain, TSmartAccount>
package/clients/index.ts CHANGED
@@ -5,7 +5,8 @@ export {
5
5
 
6
6
  export {
7
7
  createKernelAccountClient,
8
- type KernelAccountClient
8
+ type KernelAccountClient,
9
+ type SmartAccountClientConfig
9
10
  } from "./kernelAccountClient.js"
10
11
 
11
12
  export { createFallbackKernelAccountClient } from "./fallbackKernelAccountClient.js"
@@ -1,5 +1,5 @@
1
1
  import { getEntryPointVersion } from "permissionless"
2
- import type { SmartAccount } from "permissionless/accounts/types"
2
+ import type { SmartAccount } from "permissionless/accounts"
3
3
  import type { Middleware } from "permissionless/actions/smartAccount"
4
4
  import type { EntryPoint, Prettify } from "permissionless/types"
5
5
  import type { BundlerRpcSchema } from "permissionless/types/bundler"
@@ -23,23 +23,27 @@ export type KernelAccountClient<
23
23
  entryPoint extends EntryPoint,
24
24
  transport extends Transport = Transport,
25
25
  chain extends Chain | undefined = Chain | undefined,
26
- account extends KernelSmartAccount<entryPoint> | undefined =
27
- | KernelSmartAccount<entryPoint>
26
+ account extends
27
+ | KernelSmartAccount<entryPoint, transport, chain>
28
+ | undefined =
29
+ | KernelSmartAccount<entryPoint, transport, chain>
28
30
  | undefined
29
31
  > = Client<
30
32
  transport,
31
33
  chain,
32
34
  account,
33
35
  BundlerRpcSchema<entryPoint>,
34
- KernelAccountClientActions<entryPoint, chain, account>
36
+ KernelAccountClientActions<entryPoint, transport, chain, account>
35
37
  >
36
38
 
37
39
  export type SmartAccountClientConfig<
38
40
  entryPoint extends EntryPoint,
39
41
  transport extends Transport = Transport,
40
42
  chain extends Chain | undefined = Chain | undefined,
41
- account extends SmartAccount<entryPoint> | undefined =
42
- | SmartAccount<entryPoint>
43
+ account extends
44
+ | SmartAccount<entryPoint, string, transport, chain>
45
+ | undefined =
46
+ | SmartAccount<entryPoint, string, transport, chain>
43
47
  | undefined
44
48
  > = Prettify<
45
49
  Pick<
@@ -54,14 +58,14 @@ export type SmartAccountClientConfig<
54
58
  >
55
59
 
56
60
  export const createKernelAccountClient = <
57
- TSmartAccount extends KernelSmartAccount<TEntryPoint> | undefined,
58
- TTransport extends Transport = Transport,
59
- TChain extends Chain | undefined = undefined,
60
- TEntryPoint extends EntryPoint = TSmartAccount extends KernelSmartAccount<
61
- infer U
62
- >
63
- ? U
64
- : never
61
+ TTransport extends Transport,
62
+ TChain extends Chain | undefined,
63
+ TEntryPoint extends EntryPoint,
64
+ TSmartAccount extends
65
+ | KernelSmartAccount<TEntryPoint, TTransport, TChain>
66
+ | undefined =
67
+ | KernelSmartAccount<TEntryPoint, TTransport, TChain>
68
+ | undefined
65
69
  >(
66
70
  parameters: SmartAccountClientConfig<
67
71
  TEntryPoint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "5.3.12",
3
+ "version": "5.3.14",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -123,8 +123,8 @@
123
123
  }
124
124
  },
125
125
  "peerDependencies": {
126
- "viem": "^2.16.3",
127
- "permissionless": ">=0.1.18 <=0.1.29"
126
+ "viem": ">=2.16.3 <2.18.0",
127
+ "permissionless": ">=0.1.44 <=0.1.45"
128
128
  },
129
129
  "dependencies": {
130
130
  "semver": "^7.6.0"
package/types/kernel.ts CHANGED
@@ -197,6 +197,7 @@ export type KernelPluginManagerParams<entryPoint extends EntryPoint> = {
197
197
  action?: Action
198
198
  entryPoint: entryPoint
199
199
  kernelVersion: KERNEL_VERSION_TYPE
200
+ chainId?: number
200
201
  } & Partial<PluginValidityData>
201
202
 
202
203
  export type Hook = {