@account-kit/smart-contracts 4.0.0-alpha.1 → 4.0.0-alpha.11

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 (184) hide show
  1. package/dist/cjs/plugindefs/multi-owner/config.js +16 -17
  2. package/dist/cjs/plugindefs/multi-owner/config.js.map +1 -1
  3. package/dist/cjs/plugindefs/multisig/config.js +15 -15
  4. package/dist/cjs/plugindefs/multisig/config.js.map +1 -1
  5. package/dist/cjs/plugindefs/session-key/config.js +17 -17
  6. package/dist/cjs/plugindefs/session-key/config.js.map +1 -1
  7. package/dist/cjs/src/index.d.ts +1 -1
  8. package/dist/cjs/src/index.js +4 -3
  9. package/dist/cjs/src/index.js.map +1 -1
  10. package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
  11. package/dist/cjs/src/light-account/accounts/account.js +3 -2
  12. package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
  13. package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
  14. package/dist/cjs/src/light-account/accounts/base.js +8 -8
  15. package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
  16. package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
  17. package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
  18. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
  19. package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +1 -1
  20. package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
  21. package/dist/cjs/src/light-account/clients/client.d.ts +1 -2
  22. package/dist/cjs/src/light-account/clients/client.js +3 -3
  23. package/dist/cjs/src/light-account/clients/client.js.map +1 -1
  24. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  25. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  26. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  27. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +3 -3
  28. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  29. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
  30. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  31. package/dist/cjs/src/light-account/types.d.ts +23 -31
  32. package/dist/cjs/src/light-account/types.js.map +1 -1
  33. package/dist/cjs/src/light-account/utils.d.ts +7 -10
  34. package/dist/cjs/src/light-account/utils.js +59 -87
  35. package/dist/cjs/src/light-account/utils.js.map +1 -1
  36. package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
  37. package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
  38. package/dist/cjs/src/msca/client/client.d.ts +2 -6
  39. package/dist/cjs/src/msca/client/client.js +6 -6
  40. package/dist/cjs/src/msca/client/client.js.map +1 -1
  41. package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  42. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
  43. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  44. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  45. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  46. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  47. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  48. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  49. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  50. package/dist/cjs/src/msca/utils.js +11 -10
  51. package/dist/cjs/src/msca/utils.js.map +1 -1
  52. package/dist/esm/plugindefs/multi-owner/config.js +1 -2
  53. package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
  54. package/dist/esm/plugindefs/multisig/config.js +1 -1
  55. package/dist/esm/plugindefs/multisig/config.js.map +1 -1
  56. package/dist/esm/plugindefs/session-key/config.js +1 -1
  57. package/dist/esm/plugindefs/session-key/config.js.map +1 -1
  58. package/dist/esm/src/index.d.ts +1 -1
  59. package/dist/esm/src/index.js +1 -1
  60. package/dist/esm/src/index.js.map +1 -1
  61. package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
  62. package/dist/esm/src/light-account/accounts/account.js +3 -2
  63. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  64. package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
  65. package/dist/esm/src/light-account/accounts/base.js +8 -8
  66. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  67. package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
  68. package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
  69. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  70. package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
  71. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  72. package/dist/esm/src/light-account/clients/client.d.ts +1 -2
  73. package/dist/esm/src/light-account/clients/client.js +3 -3
  74. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  75. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  76. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  77. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  78. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +3 -3
  79. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  80. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  81. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  82. package/dist/esm/src/light-account/types.d.ts +23 -31
  83. package/dist/esm/src/light-account/types.js.map +1 -1
  84. package/dist/esm/src/light-account/utils.d.ts +7 -10
  85. package/dist/esm/src/light-account/utils.js +57 -84
  86. package/dist/esm/src/light-account/utils.js.map +1 -1
  87. package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
  88. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  89. package/dist/esm/src/msca/client/client.d.ts +2 -6
  90. package/dist/esm/src/msca/client/client.js +6 -6
  91. package/dist/esm/src/msca/client/client.js.map +1 -1
  92. package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  93. package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
  94. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  95. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  96. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  97. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  98. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  99. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  100. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  101. package/dist/esm/src/msca/utils.js +2 -1
  102. package/dist/esm/src/msca/utils.js.map +1 -1
  103. package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
  104. package/dist/types/src/index.d.ts +1 -1
  105. package/dist/types/src/index.d.ts.map +1 -1
  106. package/dist/types/src/light-account/accounts/account.d.ts +5 -6
  107. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  108. package/dist/types/src/light-account/accounts/base.d.ts +7 -6
  109. package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
  110. package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
  111. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  112. package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
  113. package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
  114. package/dist/types/src/light-account/clients/client.d.ts +1 -2
  115. package/dist/types/src/light-account/clients/client.d.ts.map +1 -1
  116. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  117. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
  118. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  119. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts.map +1 -1
  120. package/dist/types/src/light-account/decorators/lightAccount.d.ts +1 -1
  121. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +1 -1
  122. package/dist/types/src/light-account/types.d.ts +23 -118
  123. package/dist/types/src/light-account/types.d.ts.map +1 -1
  124. package/dist/types/src/light-account/utils.d.ts +19 -48
  125. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  126. package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
  127. package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
  128. package/dist/types/src/msca/client/client.d.ts +2 -6
  129. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  130. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  131. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
  132. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
  133. package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
  134. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
  135. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
  136. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
  137. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  138. package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
  139. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  140. package/dist/types/src/msca/utils.d.ts +6 -6
  141. package/dist/types/src/msca/utils.d.ts.map +1 -1
  142. package/package.json +7 -6
  143. package/plugindefs/multi-owner/config.ts +1 -2
  144. package/plugindefs/multisig/config.ts +1 -1
  145. package/plugindefs/session-key/config.ts +1 -1
  146. package/src/index.ts +2 -1
  147. package/src/light-account/accounts/account.ts +24 -45
  148. package/src/light-account/accounts/base.ts +39 -68
  149. package/src/light-account/accounts/multiOwner.ts +29 -43
  150. package/src/light-account/clients/alchemyClient.ts +2 -2
  151. package/src/light-account/clients/client.ts +8 -13
  152. package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
  153. package/src/light-account/clients/multiOwnerLightAccount.ts +11 -13
  154. package/src/light-account/decorators/lightAccount.ts +1 -1
  155. package/src/light-account/decorators/multiOwnerLightAccount.ts +1 -1
  156. package/src/light-account/types.ts +31 -188
  157. package/src/light-account/utils.ts +91 -246
  158. package/src/msca/client/alchemyClient.ts +2 -2
  159. package/src/msca/client/client.ts +24 -36
  160. package/src/msca/client/multiSigAlchemyClient.ts +5 -5
  161. package/src/msca/plugins/multisig/middleware.ts +6 -6
  162. package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
  163. package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
  164. package/src/msca/plugins/session-key/permissions.ts +147 -1
  165. package/src/msca/plugins/session-key/signer.ts +71 -1
  166. package/src/msca/utils.ts +15 -13
  167. package/dist/cjs/src/light-account/e2e-tests/constants.d.ts +0 -6
  168. package/dist/cjs/src/light-account/e2e-tests/constants.js +0 -10
  169. package/dist/cjs/src/light-account/e2e-tests/constants.js.map +0 -1
  170. package/dist/cjs/src/light-account/schema.d.ts +0 -21
  171. package/dist/cjs/src/light-account/schema.js +0 -30
  172. package/dist/cjs/src/light-account/schema.js.map +0 -1
  173. package/dist/esm/src/light-account/e2e-tests/constants.d.ts +0 -6
  174. package/dist/esm/src/light-account/e2e-tests/constants.js +0 -7
  175. package/dist/esm/src/light-account/e2e-tests/constants.js.map +0 -1
  176. package/dist/esm/src/light-account/schema.d.ts +0 -21
  177. package/dist/esm/src/light-account/schema.js +0 -27
  178. package/dist/esm/src/light-account/schema.js.map +0 -1
  179. package/dist/types/src/light-account/e2e-tests/constants.d.ts +0 -7
  180. package/dist/types/src/light-account/e2e-tests/constants.d.ts.map +0 -1
  181. package/dist/types/src/light-account/schema.d.ts +0 -22
  182. package/dist/types/src/light-account/schema.d.ts.map +0 -1
  183. package/src/light-account/e2e-tests/constants.ts +0 -8
  184. package/src/light-account/schema.ts +0 -39
@@ -23,11 +23,9 @@ import {
23
23
  type Transport,
24
24
  } from "viem";
25
25
  import type {
26
- AccountVersionDef,
27
- GetEntryPointForLightAccountVersion,
28
- GetLightAccountVersion,
26
+ LightAccountEntryPointVersion,
29
27
  LightAccountType,
30
- LightAccountVersionDef,
28
+ LightAccountVersion,
31
29
  } from "../types.js";
32
30
  import { AccountVersionRegistry } from "../utils.js";
33
31
 
@@ -40,91 +38,60 @@ enum SignatureType {
40
38
  export type LightAccountBase<
41
39
  TSigner extends SmartAccountSigner = SmartAccountSigner,
42
40
  TLightAccountType extends LightAccountType = LightAccountType,
43
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,
44
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
45
- TLightAccountType,
46
- TLightAccountVersion
47
- > = GetEntryPointForLightAccountVersion<
48
- TLightAccountType,
49
- TLightAccountVersion
50
- >
41
+ TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>
51
42
  > = SmartContractAccountWithSigner<
52
43
  TLightAccountType,
53
44
  TSigner,
54
- TEntryPointVersion
45
+ LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>
55
46
  > & {
56
47
  getLightAccountVersion: () => TLightAccountVersion;
57
48
  };
58
49
 
59
50
  //#region CreateLightAccountBaseParams
60
51
  export type CreateLightAccountBaseParams<
52
+ TLightAccountType extends LightAccountType,
53
+ TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,
61
54
  TTransport extends Transport = Transport,
62
- TSigner extends SmartAccountSigner = SmartAccountSigner,
63
- TLightAccountType extends LightAccountType = LightAccountType,
64
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,
65
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
66
- TLightAccountType,
67
- TLightAccountVersion
68
- > = GetEntryPointForLightAccountVersion<
69
- TLightAccountType,
70
- TLightAccountVersion
71
- >
55
+ TSigner extends SmartAccountSigner = SmartAccountSigner
72
56
  > = Pick<
73
- ToSmartContractAccountParams<
74
- TLightAccountType,
75
- TTransport,
76
- Chain,
77
- TEntryPointVersion
78
- >,
57
+ ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>,
79
58
  "transport" | "chain" | "getAccountInitCode"
80
59
  > & {
81
60
  abi: Abi;
82
61
  signer: TSigner;
83
62
  accountAddress: Address;
84
- version: LightAccountVersionDef<TLightAccountType, TLightAccountVersion>;
85
- entryPoint: EntryPointDef<TEntryPointVersion, Chain>;
63
+ type: TLightAccountType;
64
+ version: TLightAccountVersion;
65
+ entryPoint: EntryPointDef<
66
+ LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>,
67
+ Chain
68
+ >;
86
69
  };
87
70
  //#endregion CreateLightAccountBaseParams
88
71
 
89
72
  export async function createLightAccountBase<
73
+ TLightAccountType extends LightAccountType,
74
+ TLightAccountVersion extends LightAccountVersion<TLightAccountType>,
90
75
  TTransport extends Transport = Transport,
91
- TSigner extends SmartAccountSigner = SmartAccountSigner,
92
- TLightAccountType extends LightAccountType = LightAccountType,
93
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,
94
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
95
- TLightAccountType,
96
- TLightAccountVersion
97
- > = GetEntryPointForLightAccountVersion<
98
- TLightAccountType,
99
- TLightAccountVersion
100
- >
101
- >(
102
- config: CreateLightAccountBaseParams<
103
- TTransport,
104
- TSigner,
105
- TLightAccountType,
106
- TLightAccountVersion,
107
- TEntryPointVersion
108
- >
109
- ): Promise<
110
- LightAccountBase<
111
- TSigner,
112
- TLightAccountType,
113
- TLightAccountVersion,
114
- TEntryPointVersion
115
- >
116
- >;
117
-
118
- export async function createLightAccountBase({
76
+ TSigner extends SmartAccountSigner = SmartAccountSigner
77
+ >({
119
78
  transport,
120
79
  chain,
121
80
  signer,
122
81
  abi,
123
- version: { version, type },
82
+ version,
83
+ type,
124
84
  entryPoint,
125
85
  accountAddress,
126
86
  getAccountInitCode,
127
- }: CreateLightAccountBaseParams): Promise<LightAccountBase> {
87
+ }: CreateLightAccountBaseParams<
88
+ TLightAccountType,
89
+ TLightAccountVersion,
90
+ TTransport,
91
+ TSigner
92
+ >): Promise<
93
+ LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>
94
+ > {
128
95
  const client = createBundlerClient({
129
96
  transport,
130
97
  chain,
@@ -149,7 +116,9 @@ export async function createLightAccountBase({
149
116
 
150
117
  const implementationAddresses = Object.values(
151
118
  AccountVersionRegistry[type]
152
- ).map((x: AccountVersionDef) => x.address[chain.id].impl);
119
+ ).map(
120
+ (x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl
121
+ );
153
122
 
154
123
  // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise
155
124
  if (
@@ -157,7 +126,9 @@ export async function createLightAccountBase({
157
126
  !implementationAddresses.some((x) => x === trim(storage))
158
127
  ) {
159
128
  throw new Error(
160
- `could not determine if smart account implementation is ${type} ${version}`
129
+ `could not determine if smart account implementation is ${type} ${String(
130
+ version
131
+ )}`
161
132
  );
162
133
  }
163
134
 
@@ -234,7 +205,7 @@ export async function createLightAccountBase({
234
205
  case "v1.0.1":
235
206
  return signer.signMessage(message);
236
207
  case "v1.0.2":
237
- throw new Error(`${type} ${version} doesn't support 1271`);
208
+ throw new Error(`${type} ${String(version)} doesn't support 1271`);
238
209
  case "v1.1.0":
239
210
  return signWith1271WrapperV1(hashMessage(message));
240
211
  case "v2.0.0":
@@ -242,7 +213,7 @@ export async function createLightAccountBase({
242
213
  // TODO: handle case where signer is an SCA.
243
214
  return concat([SignatureType.EOA, signature]);
244
215
  default:
245
- throw new Error(`Unknown version ${type} of ${version}`);
216
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
246
217
  }
247
218
  },
248
219
  async signTypedData(params) {
@@ -253,7 +224,7 @@ export async function createLightAccountBase({
253
224
  );
254
225
  case "v1.0.2":
255
226
  throw new Error(
256
- `Version ${version} of LightAccount doesn't support 1271`
227
+ `Version ${String(version)} of LightAccount doesn't support 1271`
257
228
  );
258
229
  case "v1.1.0":
259
230
  return signWith1271WrapperV1(hashTypedData(params));
@@ -262,7 +233,7 @@ export async function createLightAccountBase({
262
233
  // TODO: handle case where signer is an SCA.
263
234
  return concat([SignatureType.EOA, signature]);
264
235
  default:
265
- throw new Error(`Unknown version ${version} of LightAccount`);
236
+ throw new Error(`Unknown version ${String(version)} of LightAccount`);
266
237
  }
267
238
  },
268
239
  getDummySignature: (): Hex => {
@@ -276,7 +247,7 @@ export async function createLightAccountBase({
276
247
  case "v2.0.0":
277
248
  return concat([SignatureType.EOA, signature]);
278
249
  default:
279
- throw new Error(`Unknown version ${type} of ${version}`);
250
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
280
251
  }
281
252
  },
282
253
  encodeUpgradeToAndCall,
@@ -17,11 +17,10 @@ import {
17
17
  import { MultiOwnerLightAccountAbi } from "../abis/MultiOwnerLightAccountAbi.js";
18
18
  import { MultiOwnerLightAccountFactoryAbi } from "../abis/MultiOwnerLightAccountFactoryAbi.js";
19
19
  import type {
20
- GetEntryPointForLightAccountVersion,
21
- GetLightAccountVersion,
20
+ LightAccountEntryPointVersion,
21
+ LightAccountVersion,
22
22
  } from "../types.js";
23
23
  import {
24
- AccountVersionRegistry,
25
24
  defaultLightAccountVersion,
26
25
  getDefaultMultiOwnerLightAccountFactoryAddress,
27
26
  } from "../utils.js";
@@ -33,19 +32,11 @@ import {
33
32
 
34
33
  export type MultiOwnerLightAccount<
35
34
  TSigner extends SmartAccountSigner = SmartAccountSigner,
36
- TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">,
37
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
38
- "MultiOwnerLightAccount",
39
- TLightAccountVersion
40
- > = GetEntryPointForLightAccountVersion<
41
- "MultiOwnerLightAccount",
42
- TLightAccountVersion
43
- >
35
+ TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">
44
36
  > = LightAccountBase<
45
37
  TSigner,
46
38
  "MultiOwnerLightAccount",
47
- TLightAccountVersion,
48
- TEntryPointVersion
39
+ TLightAccountVersion
49
40
  > & {
50
41
  encodeUpdateOwners: (
51
42
  ownersToAdd: Address[],
@@ -57,54 +48,47 @@ export type MultiOwnerLightAccount<
57
48
  export type CreateMultiOwnerLightAccountParams<
58
49
  TTransport extends Transport = Transport,
59
50
  TSigner extends SmartAccountSigner = SmartAccountSigner,
60
- TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">,
61
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
62
- "MultiOwnerLightAccount",
63
- TLightAccountVersion
64
- > = GetEntryPointForLightAccountVersion<
65
- "MultiOwnerLightAccount",
66
- TLightAccountVersion
67
- >
51
+ TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">
68
52
  > = Omit<
69
53
  CreateLightAccountBaseParams<
70
- TTransport,
71
- TSigner,
72
54
  "MultiOwnerLightAccount",
73
55
  TLightAccountVersion,
74
- TEntryPointVersion
56
+ TTransport,
57
+ TSigner
75
58
  >,
76
- "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress"
59
+ | "getAccountInitCode"
60
+ | "entryPoint"
61
+ | "version"
62
+ | "abi"
63
+ | "accountAddress"
64
+ | "type"
77
65
  > & {
78
66
  salt?: bigint;
79
67
  initCode?: Hex;
80
68
  accountAddress?: Address;
81
69
  factoryAddress?: Address;
82
70
  version?: TLightAccountVersion;
83
- entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;
71
+ entryPoint?: EntryPointDef<
72
+ LightAccountEntryPointVersion<
73
+ "MultiOwnerLightAccount",
74
+ TLightAccountVersion
75
+ >,
76
+ Chain
77
+ >;
84
78
  owners?: Address[];
85
79
  };
86
80
 
87
81
  export async function createMultiOwnerLightAccount<
88
82
  TTransport extends Transport = Transport,
89
83
  TSigner extends SmartAccountSigner = SmartAccountSigner,
90
- TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">,
91
- TEntryPointVersion extends GetEntryPointForLightAccountVersion<
92
- "MultiOwnerLightAccount",
93
- TLightAccountVersion
94
- > = GetEntryPointForLightAccountVersion<
95
- "MultiOwnerLightAccount",
96
- TLightAccountVersion
97
- >
84
+ TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">
98
85
  >(
99
86
  config: CreateMultiOwnerLightAccountParams<
100
87
  TTransport,
101
88
  TSigner,
102
- TLightAccountVersion,
103
- TEntryPointVersion
89
+ TLightAccountVersion
104
90
  >
105
- ): Promise<
106
- MultiOwnerLightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>
107
- >;
91
+ ): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;
108
92
 
109
93
  /**
110
94
  * Creates a multi-owner light account using the provided parameters, including transport, chain, signer, initialization code, version, account address, factory address, salt, and owners. Ensures the owners list is deduplicated, ordered, and valid.
@@ -131,7 +115,7 @@ export async function createMultiOwnerLightAccount({
131
115
  chain,
132
116
  signer,
133
117
  initCode,
134
- version = defaultLightAccountVersion("MultiOwnerLightAccount"),
118
+ version = defaultLightAccountVersion(),
135
119
  entryPoint = getEntryPoint(chain, {
136
120
  version: "0.7.0",
137
121
  }),
@@ -181,15 +165,17 @@ export async function createMultiOwnerLightAccount({
181
165
  });
182
166
 
183
167
  const account = await createLightAccountBase<
168
+ "MultiOwnerLightAccount",
169
+ LightAccountVersion<"MultiOwnerLightAccount">,
184
170
  Transport,
185
- SmartAccountSigner,
186
- "MultiOwnerLightAccount"
171
+ SmartAccountSigner
187
172
  >({
188
173
  transport,
189
174
  chain,
190
175
  signer,
191
176
  abi: MultiOwnerLightAccountAbi,
192
- version: AccountVersionRegistry["MultiOwnerLightAccount"][version],
177
+ version,
178
+ type: "MultiOwnerLightAccount",
193
179
  entryPoint,
194
180
  accountAddress: address,
195
181
  getAccountInitCode,
@@ -1,3 +1,4 @@
1
+ import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
1
2
  import {
2
3
  AlchemyProviderConfigSchema,
3
4
  createAlchemyPublicRpcClient,
@@ -12,7 +13,6 @@ import {
12
13
  type LightAccount,
13
14
  type LightAccountClientActions,
14
15
  } from "@account-kit/smart-contracts";
15
- import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
16
16
  import { custom, type Chain, type CustomTransport, type Transport } from "viem";
17
17
 
18
18
  export type AlchemyLightAccountClientConfig<
@@ -45,7 +45,7 @@ export async function createLightAccountAlchemyClient<
45
45
  * @example
46
46
  * ```ts
47
47
  * import { createLightAccountAlchemyClient } from "@account-kit/smart-contracts";
48
- * import { sepolia } from "@account-kit/infra/chains";
48
+ * import { sepolia } from "@account-kit/infra";
49
49
  * import { LocalAccountSigner } from "@aa-sdk/core";
50
50
  * import { generatePrivateKey } from "viem"
51
51
  *
@@ -24,14 +24,11 @@ export type CreateLightAccountClientParams<
24
24
  > = {
25
25
  transport: CreateLightAccountParams<TTransport, TSigner>["transport"];
26
26
  chain: CreateLightAccountParams<TTransport, TSigner>["chain"];
27
- account: Omit<
28
- CreateLightAccountParams<TTransport, TSigner>,
29
- "transport" | "chain"
27
+ } & Omit<CreateLightAccountParams<TTransport, TSigner>, "transport" | "chain"> &
28
+ Omit<
29
+ SmartAccountClientConfig<TTransport, TChain>,
30
+ "transport" | "account" | "chain"
30
31
  >;
31
- } & Omit<
32
- SmartAccountClientConfig<TTransport, TChain>,
33
- "transport" | "account" | "chain"
34
- >;
35
32
 
36
33
  export function createLightAccountClient<
37
34
  TChain extends Chain | undefined = Chain | undefined,
@@ -61,9 +58,7 @@ export function createLightAccountClient<
61
58
  * const account = await createLightAccountClient({
62
59
  * chain: sepolia,
63
60
  * transport: http("RPC_URL"),
64
- * account: {
65
- * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
66
- * }
61
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
67
62
  * });
68
63
  * ```
69
64
  *
@@ -73,16 +68,16 @@ export function createLightAccountClient<
73
68
  export async function createLightAccountClient(
74
69
  params: CreateLightAccountClientParams
75
70
  ): Promise<SmartAccountClient> {
76
- const { account, transport, chain, ...clientConfig } = params;
71
+ const { transport, chain } = params;
77
72
 
78
73
  const lightAccount = await createLightAccount({
79
- ...account,
74
+ ...params,
80
75
  transport,
81
76
  chain,
82
77
  });
83
78
 
84
79
  return createSmartAccountClient({
85
- ...clientConfig,
80
+ ...params,
86
81
  transport,
87
82
  chain: chain,
88
83
  account: lightAccount,
@@ -1,3 +1,4 @@
1
+ import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
1
2
  import {
2
3
  AlchemyProviderConfigSchema,
3
4
  createAlchemyPublicRpcClient,
@@ -12,14 +13,13 @@ import {
12
13
  type MultiOwnerLightAccount,
13
14
  type MultiOwnerLightAccountClientActions,
14
15
  } from "@account-kit/smart-contracts";
15
- import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
16
16
  import { custom, type Chain, type CustomTransport, type Transport } from "viem";
17
17
 
18
18
  export type AlchemyMultiOwnerLightAccountClientConfig<
19
19
  TSigner extends SmartAccountSigner = SmartAccountSigner
20
20
  > = Omit<
21
21
  CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,
22
- "transport" | "chain"
22
+ "transport" | "chain" | "type"
23
23
  > &
24
24
  Omit<
25
25
  AlchemySmartAccountClientConfig<
@@ -49,7 +49,7 @@ export async function createMultiOwnerLightAccountAlchemyClient<
49
49
  * @example
50
50
  * ```ts
51
51
  * import { createMultiOwnerLightAccountAlchemyClient } from "@account-kit/smart-contracts";
52
- * import { sepolia } from "@account-kit/infra/chains";
52
+ * import { sepolia } from "@account-kit/infra";
53
53
  * import { LocalAccountSigner } from "@aa-sdk/core";
54
54
  * import { generatePrivateKey } from "viem"
55
55
  *
@@ -27,14 +27,14 @@ export type CreateMultiOwnerLightAccountClientParams<
27
27
  TSigner
28
28
  >["transport"];
29
29
  chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>["chain"];
30
- account: Omit<
31
- CreateMultiOwnerLightAccountParams<TTransport, TSigner>,
32
- "transport" | "chain"
33
- >;
34
30
  } & Omit<
35
- SmartAccountClientConfig<TTransport, TChain>,
36
- "transport" | "account" | "chain"
37
- >;
31
+ CreateMultiOwnerLightAccountParams<TTransport, TSigner>,
32
+ "transport" | "chain"
33
+ > &
34
+ Omit<
35
+ SmartAccountClientConfig<TTransport, TChain>,
36
+ "transport" | "account" | "chain"
37
+ >;
38
38
 
39
39
  export function createMultiOwnerLightAccountClient<
40
40
  TChain extends Chain | undefined = Chain | undefined,
@@ -67,9 +67,7 @@ export function createMultiOwnerLightAccountClient<
67
67
  * const account = await createMultiOwnerLightAccountClient({
68
68
  * chain: sepolia,
69
69
  * transport: http("RPC_URL"),
70
- * account: {
71
- * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
72
- * }
70
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
73
71
  * });
74
72
  * ```
75
73
  *
@@ -79,16 +77,16 @@ export function createMultiOwnerLightAccountClient<
79
77
  export async function createMultiOwnerLightAccountClient(
80
78
  params: CreateMultiOwnerLightAccountClientParams
81
79
  ): Promise<SmartAccountClient> {
82
- const { account, transport, chain, ...clientConfig } = params;
80
+ const { transport, chain } = params;
83
81
 
84
82
  const lightAccount = await createMultiOwnerLightAccount({
85
- ...account,
83
+ ...params,
86
84
  transport,
87
85
  chain,
88
86
  });
89
87
 
90
88
  return createSmartAccountClient({
91
- ...clientConfig,
89
+ ...params,
92
90
  transport,
93
91
  chain: chain,
94
92
  account: lightAccount,
@@ -24,7 +24,7 @@ export type LightAccountClientActions<
24
24
  * ```ts
25
25
  * import { lightAccountClientActions, createLightAccount } from "@account-kit/smart-contracts";
26
26
  * import { createAlchemySmartAccountClient } from "@account-kit/infra";
27
- * import { sepolia } from "@account-kit/infra/chains";
27
+ * import { sepolia } from "@account-kit/infra";
28
28
  *
29
29
  * const smartAccountClient = createAlchemySmartAccountClient({
30
30
  * account: await createLightAccount(...),
@@ -24,7 +24,7 @@ export type MultiOwnerLightAccountClientActions<
24
24
  * ```ts
25
25
  * import { multiOwnerLightAccountClientActions, createMultiOwnerLightAccount } from "@account-kit/smart-contracts";
26
26
  * import { createAlchemySmartAccountClient } from "@account-kit/infra";
27
- * import { sepolia } from "@account-kit/infra/chains";
27
+ * import { sepolia } from "@account-kit/infra";
28
28
  *
29
29
  * const smartAccountClient = createAlchemySmartAccountClient({
30
30
  * account: await createMultiOwnerLightAccount(...),