@account-kit/smart-contracts 4.0.0-alpha.4 → 4.0.0-alpha.6

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 (98) hide show
  1. package/dist/cjs/src/index.d.ts +1 -1
  2. package/dist/cjs/src/index.js +2 -2
  3. package/dist/cjs/src/index.js.map +1 -1
  4. package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
  5. package/dist/cjs/src/light-account/accounts/account.js +3 -2
  6. package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
  7. package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
  8. package/dist/cjs/src/light-account/accounts/base.js +8 -8
  9. package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
  10. package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
  11. package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
  12. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
  13. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
  14. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  15. package/dist/cjs/src/light-account/types.d.ts +23 -31
  16. package/dist/cjs/src/light-account/types.js.map +1 -1
  17. package/dist/cjs/src/light-account/utils.d.ts +7 -10
  18. package/dist/cjs/src/light-account/utils.js +59 -88
  19. package/dist/cjs/src/light-account/utils.js.map +1 -1
  20. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  21. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  22. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  23. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  24. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  25. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  26. package/dist/cjs/src/msca/utils.js.map +1 -1
  27. package/dist/esm/src/index.d.ts +1 -1
  28. package/dist/esm/src/index.js +1 -1
  29. package/dist/esm/src/index.js.map +1 -1
  30. package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
  31. package/dist/esm/src/light-account/accounts/account.js +3 -2
  32. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  33. package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
  34. package/dist/esm/src/light-account/accounts/base.js +8 -8
  35. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  36. package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
  37. package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
  38. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  39. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
  40. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  41. package/dist/esm/src/light-account/types.d.ts +23 -31
  42. package/dist/esm/src/light-account/types.js.map +1 -1
  43. package/dist/esm/src/light-account/utils.d.ts +7 -10
  44. package/dist/esm/src/light-account/utils.js +57 -85
  45. package/dist/esm/src/light-account/utils.js.map +1 -1
  46. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  47. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  48. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  49. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  50. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  51. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  52. package/dist/esm/src/msca/utils.js.map +1 -1
  53. package/dist/types/src/index.d.ts +1 -1
  54. package/dist/types/src/index.d.ts.map +1 -1
  55. package/dist/types/src/light-account/accounts/account.d.ts +5 -6
  56. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  57. package/dist/types/src/light-account/accounts/base.d.ts +7 -6
  58. package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
  59. package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
  60. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  61. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +1 -1
  62. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
  63. package/dist/types/src/light-account/types.d.ts +23 -118
  64. package/dist/types/src/light-account/types.d.ts.map +1 -1
  65. package/dist/types/src/light-account/utils.d.ts +19 -48
  66. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  67. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
  68. package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
  69. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
  70. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
  71. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
  72. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  73. package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
  74. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  75. package/dist/types/src/msca/utils.d.ts +6 -6
  76. package/package.json +6 -5
  77. package/src/index.ts +1 -1
  78. package/src/light-account/accounts/account.ts +24 -45
  79. package/src/light-account/accounts/base.ts +39 -68
  80. package/src/light-account/accounts/multiOwner.ts +29 -43
  81. package/src/light-account/clients/multiOwnerAlchemyClient.ts +1 -1
  82. package/src/light-account/types.ts +31 -188
  83. package/src/light-account/utils.ts +91 -245
  84. package/src/msca/plugins/multisig/middleware.ts +6 -6
  85. package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
  86. package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
  87. package/src/msca/plugins/session-key/permissions.ts +147 -1
  88. package/src/msca/plugins/session-key/signer.ts +71 -1
  89. package/src/msca/utils.ts +6 -6
  90. package/dist/cjs/src/light-account/schema.d.ts +0 -21
  91. package/dist/cjs/src/light-account/schema.js +0 -30
  92. package/dist/cjs/src/light-account/schema.js.map +0 -1
  93. package/dist/esm/src/light-account/schema.d.ts +0 -21
  94. package/dist/esm/src/light-account/schema.js +0 -27
  95. package/dist/esm/src/light-account/schema.js.map +0 -1
  96. package/dist/types/src/light-account/schema.d.ts +0 -22
  97. package/dist/types/src/light-account/schema.d.ts.map +0 -1
  98. package/src/light-account/schema.ts +0 -39
@@ -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,
@@ -19,7 +19,7 @@ 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<
@@ -1,10 +1,4 @@
1
- import {
2
- type EntryPointVersion,
3
- type GetAccountParameter,
4
- type OneOf,
5
- type SmartAccountSigner,
6
- type SmartContractAccount,
7
- } from "@aa-sdk/core";
1
+ import { type EntryPointVersion } from "@aa-sdk/core";
8
2
  import { type Address, type Chain } from "viem";
9
3
  import type { LightAccountBase } from "./accounts/base";
10
4
 
@@ -12,199 +6,48 @@ import type { LightAccountBase } from "./accounts/base";
12
6
  * Light account types supported: LightAccount, MultiOwnerLightAccount
13
7
  *
14
8
  */
15
- export type LightAccountType = keyof IAccountVersionRegistry;
9
+ export type LightAccountType = "LightAccount" | "MultiOwnerLightAccount";
16
10
 
17
- /**
18
- * Account version definition, which is the base type defining the LightAccountVersionDef interface
19
- *
20
- * @template {LightAccountType} TLightAccountType type
21
- * @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion version
22
- * @template {EntryPointVersion} TEntryPointVersion entryPointVersion
23
- */
24
- export type AccountVersionDef<
25
- TLightAccountType extends LightAccountType = LightAccountType,
26
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,
11
+ export type LightAccountVersionConfig<
27
12
  TEntryPointVersion extends EntryPointVersion = EntryPointVersion
28
13
  > = {
29
- type: TLightAccountType;
30
- version: TLightAccountVersion;
31
14
  entryPointVersion: TEntryPointVersion;
32
- address: Record<
33
- Chain["id"],
34
- {
15
+ addresses: {
16
+ default: {
35
17
  factory: Address;
36
18
  impl: Address;
37
- }
38
- >;
19
+ };
20
+ overrides?: Record<
21
+ Chain["id"],
22
+ {
23
+ factory: Address;
24
+ impl: Address;
25
+ }
26
+ >;
27
+ };
39
28
  };
40
29
 
41
- /**
42
- * Light account version type defs for tightly coupled types for smart accounts
43
- *
44
- */
45
- export type LightAccountVersion =
46
- | keyof IAccountVersionRegistry["LightAccount"]
47
- | keyof IAccountVersionRegistry["MultiOwnerLightAccount"];
48
-
49
- /**
50
- * Get the light account versions available for the given light account type
51
- *
52
- * @template {LightAccountType} TLightAccountType
53
- */
54
- export type GetLightAccountVersion<
55
- TLightAccountType extends LightAccountType = LightAccountType
56
- > = keyof IAccountVersionRegistry[TLightAccountType];
57
-
58
- /**
59
- * Light account version definition type based on the light account type and version
60
- *
61
- * @template {LightAccountType} TLightAccountType
62
- * @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
63
- */
64
- export type LightAccountVersionDef<
65
- TLightAccountType extends LightAccountType = LightAccountType,
66
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>
67
- > = IAccountVersionRegistry[TLightAccountType][TLightAccountVersion];
68
-
69
- /**
70
- * Light account version registry interface defining the supported light account versions
71
- *
72
- */
73
- export interface IAccountVersionRegistry {
30
+ export type LightAccountVersionConfigs = {
74
31
  LightAccount: {
75
- /** @deprecated This version does not support 1271 signature validation */
76
- "v1.0.1": AccountVersionDef<"LightAccount", "v1.0.1", "0.6.0">;
77
- /** @deprecated This version has a known issue with 1271 validation */
78
- "v1.0.2": AccountVersionDef<"LightAccount", "v1.0.2", "0.6.0">;
79
- "v1.1.0": AccountVersionDef<"LightAccount", "v1.1.0", "0.6.0">;
80
- /**
81
- * LightAccount v2 Changelog.
82
- * It is recommended to use v2.0.0
83
- * https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
84
- */
85
- "v2.0.0": AccountVersionDef<"LightAccount", "v2.0.0", "0.7.0">;
32
+ "v1.0.1": LightAccountVersionConfig<"0.6.0">;
33
+ "v1.0.2": LightAccountVersionConfig<"0.6.0">;
34
+ "v1.1.0": LightAccountVersionConfig<"0.6.0">;
35
+ "v2.0.0": LightAccountVersionConfig<"0.7.0">;
86
36
  };
87
37
  MultiOwnerLightAccount: {
88
- /**
89
- * MultiOwnerLightAccount v2 Changelog
90
- * It is recommended to use v2.0.0
91
- * https://alchemotion.notion.site/External-Light-Account-v2-Changelog-725b306ab1e04eb0a3e596521dd8f0bd
92
- */
93
- "v2.0.0": AccountVersionDef<"MultiOwnerLightAccount", "v2.0.0", "0.7.0">;
38
+ "v2.0.0": LightAccountVersionConfig<"0.7.0">;
94
39
  };
95
- }
96
-
97
- /**
98
- * Get the light account version definitions available for the given light account type
99
- *
100
- * @template {LightAccountType} TLightAccountType
101
- *
102
- * @example
103
- * type T1 = GetLightAccountVersionsForType<"LightAccount">;
104
- * const t1: T1 = AccountVersionRegistry.LightAccount["v1.0.2"];
105
- */
106
- export type GetLightAccountVersionDefsForType<TType extends LightAccountType> =
107
- Extract<
108
- IAccountVersionRegistry[TType][keyof IAccountVersionRegistry[TType]],
109
- { type: TType }
110
- >;
111
-
112
- /**
113
- * Get the light account version definition for the given light account type and version
114
- *
115
- * @template {LightAccountType} TType
116
- * @template {GetLightAccountVersion<TType>} TLightAccountVersion
117
- */
118
- export type GetLightAccountVersionDef<
119
- TType extends LightAccountType,
120
- TLightAccountVersion extends GetLightAccountVersion<TType>
121
- > = IAccountVersionRegistry[TType][TLightAccountVersion];
122
-
123
- /**
124
- * @example
125
- * type T = GetLightAccountVersionDefsForEntryPoint<"LightAccount", "0.6.0">;
126
- * const t_1: T = AccountVersionRegistry.LightAccount["v1.0.2"]; // compiles
127
- * const t_2: T = AccountVersionRegistry.LightAccount["v2.0.0"]; // errors
128
- */
129
- export type GetLightAccountVersionDefsForEntryPoint<
130
- TType extends LightAccountType,
131
- TEntryPointVersion extends EntryPointVersion
132
- > = Extract<
133
- GetLightAccountVersionDefsForType<TType>,
134
- { entryPointVersion: TEntryPointVersion }
135
- >;
136
-
137
- /**
138
- * Get the light account type for the given light account by inferring from its type definition
139
- *
140
- * @template {SmartContractAccount | undefined} TAccount
141
- * @template {SmartContractAccount} TAccountOverride
142
- */
143
- export type GetLightAccountType<
144
- TAccount extends SmartContractAccount | undefined,
145
- TAccountOverride extends SmartContractAccount = SmartContractAccount
146
- > = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<
147
- SmartAccountSigner,
148
- infer TLightAccountType
149
- >
150
- ? OneOf<TLightAccountType, LightAccountType>
151
- : LightAccountType;
152
-
153
- /**
154
- * Get the light account version for the given light account by inferring from its type definition
155
- *
156
- * @template {LightAccountBase | undefined} TAccount
157
- * @template {LightAccountBase} TAccountOverride
158
- */
159
- export type GetLightAccountVersionFromAccount<
160
- TAccount extends LightAccountBase | undefined,
161
- TAccountOverride extends LightAccountBase = LightAccountBase
162
- > = GetAccountParameter<TAccount, TAccountOverride> extends LightAccountBase<
163
- SmartAccountSigner,
164
- LightAccountType,
165
- infer TLightAccountVersion
166
- >
167
- ? OneOf<TLightAccountVersion, LightAccountVersion>
168
- : LightAccountVersion;
40
+ };
169
41
 
170
- /**
171
- * Get the entry point version supported for the given light account type and version
172
- *
173
- * @template {LightAccountType} TLightAccountType
174
- * @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion
175
- */
176
- export type GetEntryPointForLightAccountVersion<
177
- TLightAccountType extends LightAccountType = LightAccountType,
178
- TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>
179
- > = GetLightAccountVersionDef<
180
- TLightAccountType,
181
- TLightAccountVersion
182
- > extends AccountVersionDef<
183
- TLightAccountType,
184
- TLightAccountVersion,
185
- infer TEntryPointVersion
186
- >
187
- ? TEntryPointVersion
188
- : EntryPointVersion;
42
+ export type LightAccountVersion<TAccountType extends LightAccountType> =
43
+ keyof LightAccountVersionConfigs[TAccountType];
189
44
 
190
- /**
191
- * Get the light account type for the given light account version by inferring from its type definition
192
- *
193
- * @template {LightAccountVersion} TLightAccountVersion
194
- */
195
- export type GetLightAccountTypesForVersion<
196
- TLightAccountVersion extends LightAccountVersion = LightAccountVersion
197
- > = TLightAccountVersion extends GetLightAccountVersion<infer TLightAccountType>
198
- ? TLightAccountType
199
- : LightAccountType;
45
+ export type GetLightAccountType<TAccount extends LightAccountBase> =
46
+ TAccount["source"] extends LightAccountType ? TAccount["source"] : never;
200
47
 
201
- /**
202
- * Get default light account version for the given light account type
203
- *
204
- * @template {LightAccountType} TLightAccountType
205
- */
206
- export type GetDefaultLightAccountVersion<
207
- TLightAccountType extends LightAccountType = LightAccountType
208
- > = TLightAccountType extends "MultiOwnerLightAccount"
209
- ? "v2.0.0" & LightAccountVersion
210
- : "v1.1.0" & LightAccountVersion;
48
+ export type LightAccountEntryPointVersion<
49
+ TLightAccountType extends LightAccountType,
50
+ TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>
51
+ > = LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion] extends LightAccountVersionConfig
52
+ ? LightAccountVersionConfigs[TLightAccountType][TLightAccountVersion]["entryPointVersion"]
53
+ : never;