@zerodev/sdk 5.4.28 → 5.4.29

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 (52) hide show
  1. package/_cjs/accounts/kernel/createKernelAccount.js.map +1 -1
  2. package/_cjs/accounts/kernel/v1/createKernelAccountV1.js +1 -1
  3. package/_cjs/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  4. package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js +1 -1
  5. package/_cjs/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  6. package/_cjs/clients/kernelAccountClient.js +2 -8
  7. package/_cjs/clients/kernelAccountClient.js.map +1 -1
  8. package/_cjs/constants.js +6 -5
  9. package/_cjs/constants.js.map +1 -1
  10. package/_cjs/providers/KernelEIP1193Provider.js +5 -1
  11. package/_cjs/providers/KernelEIP1193Provider.js.map +1 -1
  12. package/_esm/accounts/kernel/createKernelAccount.js.map +1 -1
  13. package/_esm/accounts/kernel/v1/createKernelAccountV1.js +1 -1
  14. package/_esm/accounts/kernel/v1/createKernelAccountV1.js.map +1 -1
  15. package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js +1 -1
  16. package/_esm/accounts/kernel/v2/createKernelAccountV0_2.js.map +1 -1
  17. package/_esm/clients/kernelAccountClient.js +2 -8
  18. package/_esm/clients/kernelAccountClient.js.map +1 -1
  19. package/_esm/constants.js +6 -4
  20. package/_esm/constants.js.map +1 -1
  21. package/_esm/providers/KernelEIP1193Provider.js +5 -1
  22. package/_esm/providers/KernelEIP1193Provider.js.map +1 -1
  23. package/_types/accounts/kernel/createKernelAccount.d.ts +3 -2
  24. package/_types/accounts/kernel/createKernelAccount.d.ts.map +1 -1
  25. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts +2 -2
  26. package/_types/accounts/kernel/v1/createKernelAccountV1.d.ts.map +1 -1
  27. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts +3 -3
  28. package/_types/accounts/kernel/v2/createKernelAccountV0_2.d.ts.map +1 -1
  29. package/_types/actions/paymaster/estimateGasInERC20.d.ts +2 -1267
  30. package/_types/actions/paymaster/estimateGasInERC20.d.ts.map +1 -1
  31. package/_types/actions/paymaster/sponsorUserOperation.d.ts +2 -1267
  32. package/_types/actions/paymaster/sponsorUserOperation.d.ts.map +1 -1
  33. package/_types/clients/decorators/kernel.d.ts +1 -507
  34. package/_types/clients/decorators/kernel.d.ts.map +1 -1
  35. package/_types/clients/fallbackKernelAccountClient.d.ts +2 -254
  36. package/_types/clients/fallbackKernelAccountClient.d.ts.map +1 -1
  37. package/_types/clients/kernelAccountClient.d.ts.map +1 -1
  38. package/_types/clients/paymasterClient.d.ts +1 -1
  39. package/_types/clients/paymasterClient.d.ts.map +1 -1
  40. package/_types/constants.d.ts +2 -1
  41. package/_types/constants.d.ts.map +1 -1
  42. package/_types/providers/KernelEIP1193Provider.d.ts.map +1 -1
  43. package/_types/utils.d.ts +2 -1267
  44. package/_types/utils.d.ts.map +1 -1
  45. package/accounts/kernel/createKernelAccount.ts +2 -2
  46. package/accounts/kernel/v1/createKernelAccountV1.ts +2 -3
  47. package/accounts/kernel/v2/createKernelAccountV0_2.ts +2 -3
  48. package/clients/kernelAccountClient.ts +43 -13
  49. package/clients/paymasterClient.ts +1 -1
  50. package/constants.ts +6 -4
  51. package/package.json +2 -2
  52. package/providers/KernelEIP1193Provider.ts +9 -2
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AACA,OAAO,EACH,KAAK,OAAO,EACZ,KAAK,GAAG,EASX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAA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AAK,GAAG,EASX,MAAM,MAAM,CAAA;AACb,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAEzE,oBAAY,eAAe;IACvB,mBAAmB,wBAAwB;IAC3C,sBAAsB,2BAA2B;IACjD,qCAAqC,0CAA0C;IAC/E,kBAAkB,uBAAuB;CAC5C;AAED,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,eAAe,EAAE,MAAM,CAKtE,CAAA;AAED,eAAO,MAAM,gBAAgB,YAChB,eAAe,WACf,MAAM,KAChB,OAMF,CAAA;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cASvB,OAAO;mBACF,MAAM;;MAG1B,QAAQ;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,CAmBnD,CAAA;AAED,eAAO,MAAM,aAAa,QAAS,GAAG,KAAG,GAcxC,CAAA;AAED,eAAO,MAAM,WAAW;cAIV,SAAS;cACT,SAAS;MACnB,GAQH,CAAA;AAED,eAAO,MAAM,mCAAmC,mEAGzB,iBAAiB,6DAYvC,CAAA;AAED,eAAO,MAAM,cAAc,YAAa,MAAM,SAAS,MAAM,KAAG,OAE/D,CAAA;AAGD,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CA0BzC"}
@@ -2,7 +2,6 @@ import {
2
2
  http,
3
3
  type Address,
4
4
  type Assign,
5
- type Client,
6
5
  type EncodeDeployDataParameters,
7
6
  type Hex,
8
7
  type SignableMessage,
@@ -132,6 +131,7 @@ export type CreateKernelAccountParameters<
132
131
  kernelVersion: GetKernelVersion<entryPointVersion>
133
132
  initConfig?: KernelVerion extends "0.3.1" ? Hex[] : never
134
133
  useMetaFactory?: boolean
134
+ eip7702?: boolean
135
135
  eip7702Auth?: SignAuthorizationReturnType
136
136
  eip7702SponsorAccount?: Signer
137
137
  pluginMigrations?: PluginMigrationData[]
@@ -367,7 +367,7 @@ export async function createKernelAccount<
367
367
  entryPointVersion extends EntryPointVersion,
368
368
  KernelVersion extends GetKernelVersion<entryPointVersion>
369
369
  >(
370
- client: Client,
370
+ client: KernelSmartAccountImplementation["client"],
371
371
  {
372
372
  plugins,
373
373
  entryPoint,
@@ -3,7 +3,6 @@ import {
3
3
  type Address,
4
4
  type Assign,
5
5
  type Chain,
6
- type Client,
7
6
  type EIP1193Provider,
8
7
  type Hex,
9
8
  type LocalAccount,
@@ -95,7 +94,7 @@ const KERNEL_V1_ADDRESSES: {
95
94
  }
96
95
 
97
96
  export async function createKernelAccountV1(
98
- client: Client,
97
+ client: KernelSmartAccountV1Implementation["client"],
99
98
  {
100
99
  signer,
101
100
  address,
@@ -222,7 +221,7 @@ export async function createKernelAccountV1(
222
221
  return accountAddress
223
222
  },
224
223
  getFactoryArgs,
225
- client: client,
224
+ client,
226
225
  entryPoint: _entryPoint,
227
226
  async getNonce() {
228
227
  return getAccountNonce(client, {
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  type Address,
3
- type Client,
4
3
  type EncodeDeployDataParameters,
5
4
  type Hex,
6
5
  type TypedDataDefinition,
@@ -107,7 +106,7 @@ const getAccountInitCode = async ({
107
106
  * @param deployedAccountAddress
108
107
  */
109
108
  export async function createKernelAccountV0_2(
110
- client: Client,
109
+ client: KernelSmartAccountImplementation["client"],
111
110
  {
112
111
  plugins,
113
112
  entryPoint,
@@ -230,7 +229,7 @@ export async function createKernelAccountV0_2(
230
229
 
231
230
  return toSmartAccount<KernelSmartAccountImplementation<"0.6">>({
232
231
  kernelVersion: "0.0.2" as GetKernelVersion<"0.6">,
233
- client: client,
232
+ client,
234
233
  entryPoint: _entryPoint,
235
234
  kernelPluginManager,
236
235
  factoryAddress,
@@ -12,8 +12,12 @@ import {
12
12
  import {
13
13
  type BundlerActions,
14
14
  type BundlerClientConfig,
15
+ type DeriveEntryPointVersion,
16
+ type DeriveSmartAccount,
15
17
  type PaymasterActions,
16
18
  type PrepareUserOperationParameters,
19
+ type PrepareUserOperationRequest,
20
+ type PrepareUserOperationReturnType,
17
21
  type SmartAccount,
18
22
  type UserOperationRequest,
19
23
  bundlerActions,
@@ -155,19 +159,45 @@ export function createKernelAccountClient(
155
159
 
156
160
  return client
157
161
  .extend(bundlerActions)
158
- .extend((client) => ({
159
- prepareUserOperation: (
160
- args: PrepareUserOperationParameters
161
- ) => {
162
- return customPrepareUserOp(client, args)
163
- }
164
- }))
165
- .extend(bundlerActions)
166
- .extend((client) => ({
167
- prepareUserOperation: (
168
- args: PrepareUserOperationParameters
169
- ) => {
170
- return customPrepareUserOp(client, args)
162
+ .extend((_client) => ({
163
+ prepareUserOperation: <
164
+ _account extends SmartAccount | undefined,
165
+ const _calls extends readonly unknown[],
166
+ _request extends PrepareUserOperationRequest<
167
+ _account,
168
+ _accountOverride,
169
+ _calls,
170
+ DeriveSmartAccount<_account, _accountOverride>,
171
+ DeriveEntryPointVersion<
172
+ DeriveSmartAccount<_account, _accountOverride>
173
+ >
174
+ >,
175
+ _accountOverride extends
176
+ | SmartAccount
177
+ | undefined = undefined
178
+ >(
179
+ args: PrepareUserOperationParameters<
180
+ _account,
181
+ _accountOverride,
182
+ _calls,
183
+ _request
184
+ >
185
+ ): Promise<
186
+ PrepareUserOperationReturnType<
187
+ _account,
188
+ _accountOverride,
189
+ _calls,
190
+ _request
191
+ >
192
+ > => {
193
+ return customPrepareUserOp(_client, args) as Promise<
194
+ PrepareUserOperationReturnType<
195
+ _account,
196
+ _accountOverride,
197
+ _calls,
198
+ _request
199
+ >
200
+ >
171
201
  }
172
202
  }))
173
203
  .extend(kernelAccountClientActions()) as KernelAccountClient
@@ -20,7 +20,7 @@ import {
20
20
  } from "./decorators/kernel.js"
21
21
 
22
22
  export type ZeroDevPaymasterClient<
23
- entryPointVersion extends "0.6" | "0.7" = "0.7",
23
+ entryPointVersion extends "0.6" | "0.7" | "0.8" = "0.7",
24
24
  transport extends Transport = Transport,
25
25
  chain extends Chain | undefined = Chain | undefined,
26
26
  account extends SmartAccount | undefined = SmartAccount | undefined,
package/constants.ts CHANGED
@@ -88,11 +88,12 @@ export const KernelVersionToAddressesMap: {
88
88
  },
89
89
  "0.3.3": {
90
90
  accountImplementationAddress:
91
- "0xE264dCCc54e4b6906c0D1Fee11D4326c06D33c80",
92
- factoryAddress: "0xE30c76Dc9eCF1c19F6Fec070674E1b4eFfE069FA",
91
+ "0xd6CEDDe84be40893d153Be9d467CD6aD37875b28",
92
+ factoryAddress: "0x2577507b78c2008Ff367261CB6285d44ba5eF2E9",
93
93
  metaFactoryAddress: "0xd703aaE79538628d27099B8c4f621bE4CCd142d5",
94
94
  initCodeHash:
95
- "0x1fefe62c5b9c14c4661af2e04e4a2fa10205066cae5f629d304d483f5fa9e5fc"
95
+ "0xc452397f1e7518f8cea0566ac057e243bb1643f6298aba8eec8cdee78ee3b3dd"
96
+ //"0x1fefe62c5b9c14c4661af2e04e4a2fa10205066cae5f629d304d483f5fa9e5fc"
96
97
  }
97
98
  }
98
99
 
@@ -104,6 +105,7 @@ export const KERNEL_V3_0: KERNEL_V3_VERSION_TYPE = "0.3.0"
104
105
  export const KERNEL_V3_1: KERNEL_V3_VERSION_TYPE = "0.3.1"
105
106
  export const KERNEL_V3_2: KERNEL_V3_VERSION_TYPE = "0.3.2"
106
107
  export const KERNEL_V3_3_BETA: KERNEL_V3_VERSION_TYPE = "0.3.3"
108
+ export const KERNEL_V3_3: KERNEL_V3_VERSION_TYPE = "0.3.3"
107
109
 
108
110
  export const TOKEN_ACTION = "0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1"
109
111
  export const ONLY_ENTRYPOINT_HOOK_ADDRESS =
@@ -167,4 +169,4 @@ export const getEntryPoint = <TEntryPointVersion extends EntryPointVersion>(
167
169
  }
168
170
 
169
171
  export const KERNEL_7702_DELEGATION_ADDRESS =
170
- "0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27"
172
+ "0xd6CEDDe84be40893d153Be9d467CD6aD37875b28"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerodev/sdk",
3
- "version": "5.4.28",
3
+ "version": "5.4.29",
4
4
  "author": "ZeroDev",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
@@ -122,7 +122,7 @@
122
122
  }
123
123
  },
124
124
  "peerDependencies": {
125
- "viem": "^2.23.15"
125
+ "viem": "^2.28.0"
126
126
  },
127
127
  "dependencies": {
128
128
  "semver": "^7.6.0"
@@ -1,8 +1,10 @@
1
1
  import { EventEmitter } from "events"
2
+ import { hexToBigInt } from "viem"
2
3
  import type {
3
4
  EIP1193Parameters,
4
5
  EIP1193RequestFn,
5
6
  Hash,
7
+ Hex,
6
8
  SendTransactionParameters
7
9
  } from "viem"
8
10
  import type { KernelAccountClient } from "../clients/kernelAccountClient.js"
@@ -53,8 +55,13 @@ export class KernelEIP1193Provider extends EventEmitter {
53
55
  }
54
56
 
55
57
  private async handleEthSendTransaction(params: unknown): Promise<Hash> {
56
- const [tx] = params as [SendTransactionParameters]
57
- return this.kernelClient.sendTransaction(tx)
58
+ const [tx] = params as [
59
+ Omit<SendTransactionParameters, "value"> & { value?: Hex }
60
+ ]
61
+ return this.kernelClient.sendTransaction({
62
+ ...tx,
63
+ value: tx.value ? hexToBigInt(tx.value) : undefined
64
+ } as SendTransactionParameters)
58
65
  }
59
66
 
60
67
  private async handleEthSign(params: [string, string]): Promise<string> {