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

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 (228) hide show
  1. package/dist/cjs/src/index.d.ts +3 -3
  2. package/dist/cjs/src/index.js +15 -15
  3. package/dist/cjs/src/index.js.map +1 -1
  4. package/dist/cjs/src/light-account/accounts/account.js +1 -1
  5. package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
  6. package/dist/cjs/src/light-account/accounts/multiOwner.js +2 -4
  7. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
  8. package/dist/cjs/src/light-account/actions/transferOwnership.d.ts +1 -1
  9. package/dist/cjs/src/light-account/actions/transferOwnership.js +2 -1
  10. package/dist/cjs/src/light-account/actions/transferOwnership.js.map +1 -1
  11. package/dist/cjs/src/light-account/actions/updateOwners.js.map +1 -1
  12. package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
  13. package/dist/cjs/src/light-account/clients/client.js +2 -1
  14. package/dist/cjs/src/light-account/clients/client.js.map +1 -1
  15. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  16. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +2 -1
  17. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  18. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
  19. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  20. package/dist/cjs/src/light-account/utils.d.ts +3 -2
  21. package/dist/cjs/src/light-account/utils.js +14 -5
  22. package/dist/cjs/src/light-account/utils.js.map +1 -1
  23. package/dist/cjs/src/msca/account/multiOwnerAccount.js +2 -1
  24. package/dist/cjs/src/msca/account/multiOwnerAccount.js.map +1 -1
  25. package/dist/cjs/src/msca/account/multisigAccount.js +4 -3
  26. package/dist/cjs/src/msca/account/multisigAccount.js.map +1 -1
  27. package/dist/cjs/src/msca/account-loupe/decorator.js.map +1 -1
  28. package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
  29. package/dist/cjs/src/msca/client/client.js.map +1 -1
  30. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  31. package/dist/cjs/src/msca/errors.js.map +1 -1
  32. package/dist/cjs/src/msca/plugin-manager/decorator.d.ts +1 -1
  33. package/dist/cjs/src/msca/plugin-manager/decorator.js +6 -4
  34. package/dist/cjs/src/msca/plugin-manager/decorator.js.map +1 -1
  35. package/dist/cjs/src/msca/plugin-manager/installPlugin.js.map +1 -1
  36. package/dist/cjs/src/msca/plugins/multi-owner/extension.js.map +1 -1
  37. package/dist/cjs/src/msca/plugins/multi-owner/index.d.ts +1 -1
  38. package/dist/cjs/src/msca/plugins/multi-owner/index.js +2 -1
  39. package/dist/cjs/src/msca/plugins/multi-owner/index.js.map +1 -1
  40. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js +2 -2
  41. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  42. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
  43. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  44. package/dist/cjs/src/msca/plugins/multisig/extension.js.map +1 -1
  45. package/dist/cjs/src/msca/plugins/multisig/index.d.ts +1 -8
  46. package/dist/cjs/src/msca/plugins/multisig/index.js +1 -16
  47. package/dist/cjs/src/msca/plugins/multisig/index.js.map +1 -1
  48. package/dist/cjs/src/msca/plugins/multisig/middleware.d.ts +1 -1
  49. package/dist/cjs/src/msca/plugins/multisig/middleware.js +1 -1
  50. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  51. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
  52. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
  53. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
  54. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
  55. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  56. package/dist/cjs/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  57. package/dist/cjs/src/msca/plugins/multisig/utils/index.js.map +1 -1
  58. package/dist/cjs/src/msca/plugins/session-key/extension.js.map +1 -1
  59. package/dist/cjs/src/msca/plugins/session-key/index.d.ts +1 -1
  60. package/dist/cjs/src/msca/plugins/session-key/index.js +3 -1
  61. package/dist/cjs/src/msca/plugins/session-key/index.js.map +1 -1
  62. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  63. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  64. package/dist/cjs/src/msca/plugins/session-key/utils.d.ts +4 -2
  65. package/dist/cjs/src/msca/plugins/session-key/utils.js +3 -2
  66. package/dist/cjs/src/msca/plugins/session-key/utils.js.map +1 -1
  67. package/dist/cjs/src/msca/utils.d.ts +6 -4
  68. package/dist/cjs/src/msca/utils.js.map +1 -1
  69. package/dist/esm/src/index.d.ts +3 -3
  70. package/dist/esm/src/index.js +2 -2
  71. package/dist/esm/src/index.js.map +1 -1
  72. package/dist/esm/src/light-account/accounts/account.js +2 -2
  73. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  74. package/dist/esm/src/light-account/accounts/multiOwner.js +3 -5
  75. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  76. package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
  77. package/dist/esm/src/light-account/actions/transferOwnership.js +2 -1
  78. package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
  79. package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
  80. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  81. package/dist/esm/src/light-account/clients/client.js +2 -1
  82. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  83. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  84. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +2 -1
  85. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  86. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  87. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  88. package/dist/esm/src/light-account/utils.d.ts +3 -2
  89. package/dist/esm/src/light-account/utils.js +12 -4
  90. package/dist/esm/src/light-account/utils.js.map +1 -1
  91. package/dist/esm/src/msca/account/multiOwnerAccount.js +2 -1
  92. package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
  93. package/dist/esm/src/msca/account/multisigAccount.js +4 -3
  94. package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
  95. package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
  96. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  97. package/dist/esm/src/msca/client/client.js.map +1 -1
  98. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  99. package/dist/esm/src/msca/errors.js.map +1 -1
  100. package/dist/esm/src/msca/plugin-manager/decorator.d.ts +1 -1
  101. package/dist/esm/src/msca/plugin-manager/decorator.js +6 -4
  102. package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
  103. package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
  104. package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
  105. package/dist/esm/src/msca/plugins/multi-owner/index.d.ts +1 -1
  106. package/dist/esm/src/msca/plugins/multi-owner/index.js +1 -1
  107. package/dist/esm/src/msca/plugins/multi-owner/index.js.map +1 -1
  108. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js +1 -1
  109. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  110. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
  111. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  112. package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
  113. package/dist/esm/src/msca/plugins/multisig/index.d.ts +1 -8
  114. package/dist/esm/src/msca/plugins/multisig/index.js +0 -7
  115. package/dist/esm/src/msca/plugins/multisig/index.js.map +1 -1
  116. package/dist/esm/src/msca/plugins/multisig/middleware.d.ts +1 -1
  117. package/dist/esm/src/msca/plugins/multisig/middleware.js +2 -1
  118. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  119. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
  120. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
  121. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
  122. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
  123. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  124. package/dist/esm/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  125. package/dist/esm/src/msca/plugins/multisig/utils/index.js.map +1 -1
  126. package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
  127. package/dist/esm/src/msca/plugins/session-key/index.d.ts +1 -1
  128. package/dist/esm/src/msca/plugins/session-key/index.js +1 -1
  129. package/dist/esm/src/msca/plugins/session-key/index.js.map +1 -1
  130. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  131. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  132. package/dist/esm/src/msca/plugins/session-key/utils.d.ts +4 -2
  133. package/dist/esm/src/msca/plugins/session-key/utils.js +3 -2
  134. package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
  135. package/dist/esm/src/msca/utils.d.ts +6 -4
  136. package/dist/esm/src/msca/utils.js.map +1 -1
  137. package/dist/types/src/index.d.ts +3 -3
  138. package/dist/types/src/index.d.ts.map +1 -1
  139. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  140. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  141. package/dist/types/src/light-account/actions/transferOwnership.d.ts +26 -1
  142. package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
  143. package/dist/types/src/light-account/actions/updateOwners.d.ts +24 -0
  144. package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
  145. package/dist/types/src/light-account/decorators/lightAccount.d.ts +19 -0
  146. package/dist/types/src/light-account/decorators/lightAccount.d.ts.map +1 -1
  147. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +19 -0
  148. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts.map +1 -1
  149. package/dist/types/src/light-account/utils.d.ts +11 -4
  150. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  151. package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
  152. package/dist/types/src/msca/account-loupe/decorator.d.ts +15 -0
  153. package/dist/types/src/msca/account-loupe/decorator.d.ts.map +1 -1
  154. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  155. package/dist/types/src/msca/errors.d.ts +12 -0
  156. package/dist/types/src/msca/errors.d.ts.map +1 -1
  157. package/dist/types/src/msca/plugin-manager/decorator.d.ts +16 -1
  158. package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
  159. package/dist/types/src/msca/plugin-manager/installPlugin.d.ts +21 -0
  160. package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
  161. package/dist/types/src/msca/plugins/multi-owner/extension.d.ts +15 -0
  162. package/dist/types/src/msca/plugins/multi-owner/extension.d.ts.map +1 -1
  163. package/dist/types/src/msca/plugins/multi-owner/index.d.ts +1 -1
  164. package/dist/types/src/msca/plugins/multi-owner/index.d.ts.map +1 -1
  165. package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
  166. package/dist/types/src/msca/plugins/multisig/actions/signMultisigUserOperation.d.ts.map +1 -1
  167. package/dist/types/src/msca/plugins/multisig/extension.d.ts +13 -0
  168. package/dist/types/src/msca/plugins/multisig/extension.d.ts.map +1 -1
  169. package/dist/types/src/msca/plugins/multisig/index.d.ts +1 -8
  170. package/dist/types/src/msca/plugins/multisig/index.d.ts.map +1 -1
  171. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +1 -1
  172. package/dist/types/src/msca/plugins/multisig/middleware.d.ts.map +1 -1
  173. package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts +28 -2
  174. package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts.map +1 -1
  175. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +21 -2
  176. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
  177. package/dist/types/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  178. package/dist/types/src/msca/plugins/multisig/utils/index.d.ts.map +1 -1
  179. package/dist/types/src/msca/plugins/session-key/extension.d.ts +13 -0
  180. package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
  181. package/dist/types/src/msca/plugins/session-key/index.d.ts +1 -1
  182. package/dist/types/src/msca/plugins/session-key/index.d.ts.map +1 -1
  183. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +3 -0
  184. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  185. package/dist/types/src/msca/plugins/session-key/signer.d.ts +1 -1
  186. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  187. package/dist/types/src/msca/plugins/session-key/utils.d.ts +22 -2
  188. package/dist/types/src/msca/plugins/session-key/utils.d.ts.map +1 -1
  189. package/dist/types/src/msca/utils.d.ts +43 -5
  190. package/dist/types/src/msca/utils.d.ts.map +1 -1
  191. package/package.json +5 -5
  192. package/src/index.ts +2 -3
  193. package/src/light-account/accounts/account.ts +22 -3
  194. package/src/light-account/accounts/multiOwner.ts +26 -5
  195. package/src/light-account/actions/transferOwnership.ts +28 -5
  196. package/src/light-account/actions/updateOwners.ts +24 -0
  197. package/src/light-account/clients/alchemyClient.ts +20 -0
  198. package/src/light-account/clients/client.ts +27 -6
  199. package/src/light-account/clients/multiOwnerAlchemyClient.ts +20 -0
  200. package/src/light-account/clients/multiOwnerLightAccount.ts +27 -6
  201. package/src/light-account/decorators/lightAccount.ts +19 -0
  202. package/src/light-account/decorators/multiOwnerLightAccount.ts +19 -0
  203. package/src/light-account/utils.ts +29 -6
  204. package/src/msca/account/multiOwnerAccount.ts +36 -11
  205. package/src/msca/account/multisigAccount.ts +40 -14
  206. package/src/msca/account-loupe/decorator.ts +15 -0
  207. package/src/msca/client/alchemyClient.ts +20 -0
  208. package/src/msca/client/client.ts +46 -0
  209. package/src/msca/client/multiSigAlchemyClient.ts +22 -0
  210. package/src/msca/errors.ts +12 -0
  211. package/src/msca/plugin-manager/decorator.ts +22 -5
  212. package/src/msca/plugin-manager/installPlugin.ts +21 -0
  213. package/src/msca/plugins/multi-owner/extension.ts +15 -0
  214. package/src/msca/plugins/multi-owner/index.ts +3 -0
  215. package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +1 -1
  216. package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +1 -1
  217. package/src/msca/plugins/multisig/extension.ts +13 -0
  218. package/src/msca/plugins/multisig/index.ts +1 -12
  219. package/src/msca/plugins/multisig/middleware.ts +2 -2
  220. package/src/msca/plugins/multisig/utils/combineSignatures.ts +36 -9
  221. package/src/msca/plugins/multisig/utils/getSignerType.ts +23 -4
  222. package/src/msca/plugins/multisig/utils/index.ts +4 -0
  223. package/src/msca/plugins/session-key/extension.ts +13 -0
  224. package/src/msca/plugins/session-key/index.ts +7 -1
  225. package/src/msca/plugins/session-key/permissions.ts +3 -0
  226. package/src/msca/plugins/session-key/signer.ts +1 -2
  227. package/src/msca/plugins/session-key/utils.ts +33 -12
  228. package/src/msca/utils.ts +64 -9
@@ -36,14 +36,14 @@ export { InvalidAggregatedSignatureError, InvalidContextSignatureError, Multisig
36
36
  export type * from "./msca/plugin-manager/decorator.js";
37
37
  export { pluginManagerActions } from "./msca/plugin-manager/decorator.js";
38
38
  export { installPlugin } from "./msca/plugin-manager/installPlugin.js";
39
+ export { multiOwnerPluginActions } from "./msca/plugins/multi-owner/extension.js";
39
40
  export type * from "./msca/plugins/multi-owner/index.js";
40
- export { multiOwnerPluginActions } from "./msca/plugins/multi-owner/index.js";
41
41
  export { MultiOwnerPlugin, MultiOwnerPluginAbi, MultiOwnerPluginExecutionFunctionAbi, } from "./msca/plugins/multi-owner/plugin.js";
42
42
  export type * from "./msca/plugins/multisig/index.js";
43
- export { MultisigPlugin, MultisigPluginAbi, MultisigPluginExecutionFunctionAbi, multisigPluginActions, multisigSignatureMiddleware, type SignerType, } from "./msca/plugins/multisig/index.js";
43
+ export { MultisigPlugin, MultisigPluginAbi, MultisigPluginExecutionFunctionAbi, multisigPluginActions, multisigSignatureMiddleware, } from "./msca/plugins/multisig/index.js";
44
44
  export { combineSignatures, formatSignatures, getSignerType, splitAggregatedSignature, } from "./msca/plugins/multisig/utils/index.js";
45
+ export { sessionKeyPluginActions } from "./msca/plugins/session-key/extension.js";
45
46
  export type * from "./msca/plugins/session-key/index.js";
46
- export { sessionKeyPluginActions } from "./msca/plugins/session-key/index.js";
47
47
  export type * from "./msca/plugins/session-key/permissions.js";
48
48
  export { SessionKeyAccessListType, SessionKeyPermissionsBuilder, } from "./msca/plugins/session-key/permissions.js";
49
49
  export { SessionKeyPlugin, SessionKeyPluginAbi, SessionKeyPluginExecutionFunctionAbi, } from "./msca/plugins/session-key/plugin.js";
@@ -67,25 +67,25 @@ var decorator_js_2 = require("./msca/plugin-manager/decorator.js");
67
67
  Object.defineProperty(exports, "pluginManagerActions", { enumerable: true, get: function () { return decorator_js_2.pluginManagerActions; } });
68
68
  var installPlugin_js_1 = require("./msca/plugin-manager/installPlugin.js");
69
69
  Object.defineProperty(exports, "installPlugin", { enumerable: true, get: function () { return installPlugin_js_1.installPlugin; } });
70
- var index_js_1 = require("./msca/plugins/multi-owner/index.js");
71
- Object.defineProperty(exports, "multiOwnerPluginActions", { enumerable: true, get: function () { return index_js_1.multiOwnerPluginActions; } });
70
+ var extension_js_1 = require("./msca/plugins/multi-owner/extension.js");
71
+ Object.defineProperty(exports, "multiOwnerPluginActions", { enumerable: true, get: function () { return extension_js_1.multiOwnerPluginActions; } });
72
72
  var plugin_js_1 = require("./msca/plugins/multi-owner/plugin.js");
73
73
  Object.defineProperty(exports, "MultiOwnerPlugin", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPlugin; } });
74
74
  Object.defineProperty(exports, "MultiOwnerPluginAbi", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPluginAbi; } });
75
75
  Object.defineProperty(exports, "MultiOwnerPluginExecutionFunctionAbi", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPluginExecutionFunctionAbi; } });
76
- var index_js_2 = require("./msca/plugins/multisig/index.js");
77
- Object.defineProperty(exports, "MultisigPlugin", { enumerable: true, get: function () { return index_js_2.MultisigPlugin; } });
78
- Object.defineProperty(exports, "MultisigPluginAbi", { enumerable: true, get: function () { return index_js_2.MultisigPluginAbi; } });
79
- Object.defineProperty(exports, "MultisigPluginExecutionFunctionAbi", { enumerable: true, get: function () { return index_js_2.MultisigPluginExecutionFunctionAbi; } });
80
- Object.defineProperty(exports, "multisigPluginActions", { enumerable: true, get: function () { return index_js_2.multisigPluginActions; } });
81
- Object.defineProperty(exports, "multisigSignatureMiddleware", { enumerable: true, get: function () { return index_js_2.multisigSignatureMiddleware; } });
82
- var index_js_3 = require("./msca/plugins/multisig/utils/index.js");
83
- Object.defineProperty(exports, "combineSignatures", { enumerable: true, get: function () { return index_js_3.combineSignatures; } });
84
- Object.defineProperty(exports, "formatSignatures", { enumerable: true, get: function () { return index_js_3.formatSignatures; } });
85
- Object.defineProperty(exports, "getSignerType", { enumerable: true, get: function () { return index_js_3.getSignerType; } });
86
- Object.defineProperty(exports, "splitAggregatedSignature", { enumerable: true, get: function () { return index_js_3.splitAggregatedSignature; } });
87
- var index_js_4 = require("./msca/plugins/session-key/index.js");
88
- Object.defineProperty(exports, "sessionKeyPluginActions", { enumerable: true, get: function () { return index_js_4.sessionKeyPluginActions; } });
76
+ var index_js_1 = require("./msca/plugins/multisig/index.js");
77
+ Object.defineProperty(exports, "MultisigPlugin", { enumerable: true, get: function () { return index_js_1.MultisigPlugin; } });
78
+ Object.defineProperty(exports, "MultisigPluginAbi", { enumerable: true, get: function () { return index_js_1.MultisigPluginAbi; } });
79
+ Object.defineProperty(exports, "MultisigPluginExecutionFunctionAbi", { enumerable: true, get: function () { return index_js_1.MultisigPluginExecutionFunctionAbi; } });
80
+ Object.defineProperty(exports, "multisigPluginActions", { enumerable: true, get: function () { return index_js_1.multisigPluginActions; } });
81
+ Object.defineProperty(exports, "multisigSignatureMiddleware", { enumerable: true, get: function () { return index_js_1.multisigSignatureMiddleware; } });
82
+ var index_js_2 = require("./msca/plugins/multisig/utils/index.js");
83
+ Object.defineProperty(exports, "combineSignatures", { enumerable: true, get: function () { return index_js_2.combineSignatures; } });
84
+ Object.defineProperty(exports, "formatSignatures", { enumerable: true, get: function () { return index_js_2.formatSignatures; } });
85
+ Object.defineProperty(exports, "getSignerType", { enumerable: true, get: function () { return index_js_2.getSignerType; } });
86
+ Object.defineProperty(exports, "splitAggregatedSignature", { enumerable: true, get: function () { return index_js_2.splitAggregatedSignature; } });
87
+ var extension_js_2 = require("./msca/plugins/session-key/extension.js");
88
+ Object.defineProperty(exports, "sessionKeyPluginActions", { enumerable: true, get: function () { return extension_js_2.sessionKeyPluginActions; } });
89
89
  var permissions_js_1 = require("./msca/plugins/session-key/permissions.js");
90
90
  Object.defineProperty(exports, "SessionKeyAccessListType", { enumerable: true, get: function () { return permissions_js_1.SessionKeyAccessListType; } });
91
91
  Object.defineProperty(exports, "SessionKeyPermissionsBuilder", { enumerable: true, get: function () { return permissions_js_1.SessionKeyPermissionsBuilder; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"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A;AAEpC,mFAGgD;AAF9C,8IAAA,kCAAkC,OAAA;AAGpC,8CAK0B;AAJxB,4HAAA,+BAA+B,OAAA;AAC/B,yHAAA,4BAA4B,OAAA;AAC5B,yHAAA,4BAA4B,OAAA;AAC5B,0HAAA,6BAA6B,OAAA;AAG/B,mEAA0E;AAAjE,oHAAA,oBAAoB,OAAA;AAC7B,2EAAuE;AAA9D,iHAAA,aAAa,OAAA;AAEtB,gEAA8E;AAArE,mHAAA,uBAAuB,OAAA;AAChC,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAGtC,6DAO0C;AANxC,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,8HAAA,kCAAkC,OAAA;AAClC,iHAAA,qBAAqB,OAAA;AACrB,uHAAA,2BAA2B,OAAA;AAG7B,mEAKgD;AAJ9C,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,oHAAA,wBAAwB,OAAA;AAG1B,gEAA8E;AAArE,mHAAA,uBAAuB,OAAA;AAEhC,4EAGmD;AAFjD,0HAAA,wBAAwB,OAAA;AACxB,8HAAA,4BAA4B,OAAA;AAE9B,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAEtC,kEAAwE;AAA/D,6GAAA,gBAAgB,OAAA;AACzB,gEAAqF;AAA5E,0HAAA,8BAA8B,OAAA;AAEvC,4CAKyB;AAJvB,4IAAA,gDAAgD,OAAA;AAChD,0IAAA,8CAA8C,OAAA;AAC9C,mHAAA,uBAAuB,OAAA;AACvB,gHAAA,oBAAoB,OAAA","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n getLightAccountVersionDef,\n} from \"./light-account/utils.js\";\n\n//multi-owner-light-account exports\nexport type * from \"./light-account/accounts/multiOwner.js\";\nexport { createMultiOwnerLightAccount } from \"./light-account/accounts/multiOwner.js\";\nexport { updateOwners as updateMultiOwnerLightAccountOwners } from \"./light-account/actions/updateOwners.js\";\nexport { createMultiOwnerLightAccountClient } from \"./light-account/clients/multiOwnerLightAccount.js\";\nexport type * from \"./light-account/decorators/multiOwnerLightAccount.js\";\nexport { multiOwnerLightAccountClientActions } from \"./light-account/decorators/multiOwnerLightAccount.js\";\n\n// msca exports\nexport { IAccountLoupeAbi } from \"./msca/abis/IAccountLoupe.js\";\nexport { IPluginAbi } from \"./msca/abis/IPlugin.js\";\nexport { IPluginManagerAbi } from \"./msca/abis/IPluginManager.js\";\nexport { IStandardExecutorAbi } from \"./msca/abis/IStandardExecutor.js\";\nexport { MultiOwnerModularAccountFactoryAbi } from \"./msca/abis/MultiOwnerModularAccountFactory.js\";\nexport { MultisigModularAccountFactoryAbi } from \"./msca/abis/MultisigModularAccountFactory.js\";\nexport { UpgradeableModularAccountAbi } from \"./msca/abis/UpgradeableModularAccount.js\";\nexport type * from \"./msca/account-loupe/decorator.js\";\nexport { accountLoupeActions } from \"./msca/account-loupe/decorator.js\";\nexport type * from \"./msca/account-loupe/types.js\";\nexport type * from \"./msca/account/multiOwnerAccount.js\";\nexport { createMultiOwnerModularAccount } from \"./msca/account/multiOwnerAccount.js\";\nexport type * from \"./msca/account/multisigAccount.js\";\nexport { createMultisigModularAccount } from \"./msca/account/multisigAccount.js\";\nexport { standardExecutor } from \"./msca/account/standardExecutor.js\";\nexport {\n createModularAccountAlchemyClient,\n type AlchemyModularAccountClientConfig,\n} from \"./msca/client/alchemyClient.js\";\nexport {\n createMultiOwnerModularAccountClient,\n createMultisigModularAccountClient,\n} from \"./msca/client/client.js\";\nexport {\n createMultisigAccountAlchemyClient,\n type AlchemyMultisigAccountClientConfig,\n} from \"./msca/client/multiSigAlchemyClient.js\";\nexport {\n InvalidAggregatedSignatureError,\n InvalidContextSignatureError,\n MultisigAccountExpectedError,\n MultisigMissingSignatureError,\n} from \"./msca/errors.js\";\nexport type * from \"./msca/plugin-manager/decorator.js\";\nexport { pluginManagerActions } from \"./msca/plugin-manager/decorator.js\";\nexport { installPlugin } from \"./msca/plugin-manager/installPlugin.js\";\nexport type * from \"./msca/plugins/multi-owner/index.js\";\nexport { multiOwnerPluginActions } from \"./msca/plugins/multi-owner/index.js\";\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./msca/plugins/multi-owner/plugin.js\";\nexport type * from \"./msca/plugins/multisig/index.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n multisigPluginActions,\n multisigSignatureMiddleware,\n type SignerType,\n} from \"./msca/plugins/multisig/index.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./msca/plugins/multisig/utils/index.js\";\nexport type * from \"./msca/plugins/session-key/index.js\";\nexport { sessionKeyPluginActions } from \"./msca/plugins/session-key/index.js\";\nexport type * from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyAccessListType,\n SessionKeyPermissionsBuilder,\n} from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyPlugin,\n SessionKeyPluginAbi,\n SessionKeyPluginExecutionFunctionAbi,\n} from \"./msca/plugins/session-key/plugin.js\";\nexport { SessionKeySigner } from \"./msca/plugins/session-key/signer.js\";\nexport { buildSessionKeysToRemoveStruct } from \"./msca/plugins/session-key/utils.js\";\nexport type * from \"./msca/plugins/types.js\";\nexport {\n getDefaultMultiOwnerModularAccountFactoryAddress,\n getDefaultMultisigModularAccountFactoryAddress,\n getMAInitializationData,\n getMSCAUpgradeToData,\n} from \"./msca/utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;AAKA,kEAAyE;AAAhE,gHAAA,kBAAkB,OAAA;AAC3B,qFAAkH;AAAzG,qIAAA,iBAAiB,OAAiC;AAC3D,6EAGkD;AAFhD,mIAAA,+BAA+B,OAAA;AAGjC,+DAA6E;AAApE,qHAAA,wBAAwB,OAAA;AACjC,iGAG4D;AAF1D,uJAAA,yCAAyC,OAAA;AAI3C,8EAAuF;AAA9E,4HAAA,yBAAyB,OAAA;AAGlC,qDAOkC;AANhC,kHAAA,sBAAsB,OAAA;AACtB,gIAAA,oCAAoC,OAAA;AACpC,4HAAA,gCAAgC,OAAA;AAChC,sHAAA,0BAA0B,OAAA;AAC1B,gIAAA,oCAAoC,OAAA;AACpC,qHAAA,yBAAyB,OAAA;AAK3B,wEAAsF;AAA7E,6HAAA,4BAA4B,OAAA;AACrC,2EAA6G;AAApG,qIAAA,YAAY,OAAsC;AAC3D,+FAAuG;AAA9F,+IAAA,kCAAkC,OAAA;AAE3C,kGAA2G;AAAlG,gJAAA,mCAAmC,OAAA;AAG5C,iEAAgE;AAAvD,oHAAA,gBAAgB,OAAA;AACzB,qDAAoD;AAA3C,wGAAA,UAAU,OAAA;AACnB,mEAAk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4EAGmD;AAFjD,0HAAA,wBAAwB,OAAA;AACxB,8HAAA,4BAA4B,OAAA;AAE9B,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAEtC,kEAAwE;AAA/D,6GAAA,gBAAgB,OAAA;AACzB,gEAAqF;AAA5E,0HAAA,8BAA8B,OAAA;AAEvC,4CAKyB;AAJvB,4IAAA,gDAAgD,OAAA;AAChD,0IAAA,8CAA8C,OAAA;AAC9C,mHAAA,uBAAuB,OAAA;AACvB,gHAAA,oBAAoB,OAAA","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n getLightAccountVersionDef,\n} from \"./light-account/utils.js\";\n\n//multi-owner-light-account exports\nexport type * from \"./light-account/accounts/multiOwner.js\";\nexport { createMultiOwnerLightAccount } from \"./light-account/accounts/multiOwner.js\";\nexport { updateOwners as updateMultiOwnerLightAccountOwners } from \"./light-account/actions/updateOwners.js\";\nexport { createMultiOwnerLightAccountClient } from \"./light-account/clients/multiOwnerLightAccount.js\";\nexport type * from \"./light-account/decorators/multiOwnerLightAccount.js\";\nexport { multiOwnerLightAccountClientActions } from \"./light-account/decorators/multiOwnerLightAccount.js\";\n\n// msca exports\nexport { IAccountLoupeAbi } from \"./msca/abis/IAccountLoupe.js\";\nexport { IPluginAbi } from \"./msca/abis/IPlugin.js\";\nexport { IPluginManagerAbi } from \"./msca/abis/IPluginManager.js\";\nexport { IStandardExecutorAbi } from \"./msca/abis/IStandardExecutor.js\";\nexport { MultiOwnerModularAccountFactoryAbi } from \"./msca/abis/MultiOwnerModularAccountFactory.js\";\nexport { MultisigModularAccountFactoryAbi } from \"./msca/abis/MultisigModularAccountFactory.js\";\nexport { UpgradeableModularAccountAbi } from \"./msca/abis/UpgradeableModularAccount.js\";\nexport type * from \"./msca/account-loupe/decorator.js\";\nexport { accountLoupeActions } from \"./msca/account-loupe/decorator.js\";\nexport type * from \"./msca/account-loupe/types.js\";\nexport type * from \"./msca/account/multiOwnerAccount.js\";\nexport { createMultiOwnerModularAccount } from \"./msca/account/multiOwnerAccount.js\";\nexport type * from \"./msca/account/multisigAccount.js\";\nexport { createMultisigModularAccount } from \"./msca/account/multisigAccount.js\";\nexport { standardExecutor } from \"./msca/account/standardExecutor.js\";\nexport {\n createModularAccountAlchemyClient,\n type AlchemyModularAccountClientConfig,\n} from \"./msca/client/alchemyClient.js\";\nexport {\n createMultiOwnerModularAccountClient,\n createMultisigModularAccountClient,\n} from \"./msca/client/client.js\";\nexport {\n createMultisigAccountAlchemyClient,\n type AlchemyMultisigAccountClientConfig,\n} from \"./msca/client/multiSigAlchemyClient.js\";\nexport {\n InvalidAggregatedSignatureError,\n InvalidContextSignatureError,\n MultisigAccountExpectedError,\n MultisigMissingSignatureError,\n} from \"./msca/errors.js\";\nexport type * from \"./msca/plugin-manager/decorator.js\";\nexport { pluginManagerActions } from \"./msca/plugin-manager/decorator.js\";\nexport { installPlugin } from \"./msca/plugin-manager/installPlugin.js\";\nexport { multiOwnerPluginActions } from \"./msca/plugins/multi-owner/extension.js\";\nexport type * from \"./msca/plugins/multi-owner/index.js\";\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./msca/plugins/multi-owner/plugin.js\";\nexport type * from \"./msca/plugins/multisig/index.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n multisigPluginActions,\n multisigSignatureMiddleware,\n} from \"./msca/plugins/multisig/index.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./msca/plugins/multisig/utils/index.js\";\nexport { sessionKeyPluginActions } from \"./msca/plugins/session-key/extension.js\";\nexport type * from \"./msca/plugins/session-key/index.js\";\nexport type * from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyAccessListType,\n SessionKeyPermissionsBuilder,\n} from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyPlugin,\n SessionKeyPluginAbi,\n SessionKeyPluginExecutionFunctionAbi,\n} from \"./msca/plugins/session-key/plugin.js\";\nexport { SessionKeySigner } from \"./msca/plugins/session-key/signer.js\";\nexport { buildSessionKeysToRemoveStruct } from \"./msca/plugins/session-key/utils.js\";\nexport type * from \"./msca/plugins/types.js\";\nexport {\n getDefaultMultiOwnerModularAccountFactoryAddress,\n getDefaultMultisigModularAccountFactoryAddress,\n getMAInitializationData,\n getMSCAUpgradeToData,\n} from \"./msca/utils.js\";\n"]}
@@ -12,7 +12,7 @@ const base_js_1 = require("./base.js");
12
12
  async function createLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)("LightAccount"), entryPoint = (0, core_1.getEntryPoint)(chain, {
13
13
  version: utils_js_1.AccountVersionRegistry["LightAccount"][version]
14
14
  .entryPointVersion,
15
- }), accountAddress, factoryAddress = utils_js_1.AccountVersionRegistry["LightAccount"][version].address[chain.id].factory, salt: salt_ = 0n, }) {
15
+ }), accountAddress, factoryAddress = (0, utils_js_1.getDefaultLightAccountFactoryAddress)(chain, version), salt: salt_ = 0n, }) {
16
16
  const client = (0, core_1.createBundlerClient)({
17
17
  transport,
18
18
  chain,
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AACtB,+BAMc;AACd,yEAAmE;AACnE,yEAAmE;AACnE,uFAAiF;AACjF,uFAAiF;AAKjF,0CAIqB;AACrB,uCAImB;AAwEZ,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,IAAA,qCAA0B,EAAC,cAAc,CAAC,EACpD,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE;IAChC,OAAO,EAAE,iCAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;SACrD,iBAAwB;CAC5B,CAAC,EACF,cAAc,EACd,cAAc,GAAG,iCAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CACtE,KAAK,CAAC,EAAE,CACT,CAAC,OAAO,EACT,IAAI,EAAE,KAAK,GAAG,EAAE,GACS;IACzB,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,UAAU,GACd,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,0CAAkB,CAAC,CAAC,CAAC,0CAAkB,CAAC;IACjE,MAAM,UAAU,GACd,OAAO,KAAK,QAAQ;QAClB,CAAC,CAAC,wDAAyB;QAC3B,CAAC,CAAC,wDAAyB,CAAC;IAEhC,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAE9B,MAAM,IAAI,GAAG,+CAAoC,CAAC,GAAG,CACnD,cAAc,CAAC,WAAW,EAAa,CACxC;YACC,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Address,\n getEntryPoint,\n type Address,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { LightAccountAbi_v1 } from \"../abis/LightAccountAbi_v1.js\";\nimport { LightAccountAbi_v2 } from \"../abis/LightAccountAbi_v2.js\";\nimport { LightAccountFactoryAbi_v1 } from \"../abis/LightAccountFactoryAbi_v1.js\";\nimport { LightAccountFactoryAbi_v2 } from \"../abis/LightAccountFactoryAbi_v2.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n defaultLightAccountVersion,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type LightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = LightAccountBase<\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeTransferOwnership: (newOwner: Address) => Hex;\n getOwnerAddress: () => Promise<Address>;\n};\n\n// [!region CreateLightAccountParams]\nexport type CreateLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = \"v1.1.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n>(\n config: CreateLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;\n\nexport async function createLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"LightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: AccountVersionRegistry[\"LightAccount\"][version]\n .entryPointVersion as any,\n }),\n accountAddress,\n factoryAddress = AccountVersionRegistry[\"LightAccount\"][version].address[\n chain.id\n ].factory,\n salt: salt_ = 0n,\n}: CreateLightAccountParams): Promise<LightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const accountAbi =\n version === \"v2.0.0\" ? LightAccountAbi_v2 : LightAccountAbi_v1;\n const factoryAbi =\n version === \"v2.0.0\"\n ? LightAccountFactoryAbi_v1\n : LightAccountFactoryAbi_v2;\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n const salt = LightAccountUnsupported1271Factories.has(\n factoryAddress.toLowerCase() as Address\n )\n ? 0n\n : salt_;\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: factoryAbi,\n functionName: \"createAccount\",\n args: [await signer.getAddress(), salt],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"LightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n version: AccountVersionRegistry[\"LightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n\n encodeTransferOwnership: (newOwner: Address) => {\n return encodeFunctionData({\n abi: accountAbi,\n functionName: \"transferOwnership\",\n args: [newOwner],\n });\n },\n async getOwnerAddress(): Promise<Address> {\n const callResult = await client.readContract({\n address,\n abi: accountAbi,\n functionName: \"owner\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owner\");\n }\n\n return callResult;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AACtB,+BAMc;AACd,yEAAmE;AACnE,yEAAmE;AACnE,uFAAiF;AACjF,uFAAiF;AAKjF,0CAKqB;AACrB,uCAImB;AA4FZ,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,IAAA,qCAA0B,EAAC,cAAc,CAAC,EACpD,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE;IAChC,OAAO,EAAE,iCAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;SACrD,iBAAwB;CAC5B,CAAC,EACF,cAAc,EACd,cAAc,GAAG,IAAA,+CAAoC,EAA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AAE,EAAE;YAC7C,OAAO,IAAA,yBAAkB,EAAC;gBACxB,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,mBAAmB;gBACjC,IAAI,EAAE,CAAC,QAAQ,CAAC;aACjB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,OAAO;aACtB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC;AA3FD,gDA2FC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type Address,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { LightAccountAbi_v1 } from \"../abis/LightAccountAbi_v1.js\";\nimport { LightAccountAbi_v2 } from \"../abis/LightAccountAbi_v2.js\";\nimport { LightAccountFactoryAbi_v1 } from \"../abis/LightAccountFactoryAbi_v1.js\";\nimport { LightAccountFactoryAbi_v2 } from \"../abis/LightAccountFactoryAbi_v2.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type LightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = LightAccountBase<\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeTransferOwnership: (newOwner: Address) => Hex;\n getOwnerAddress: () => Promise<Address>;\n};\n\n// [!region CreateLightAccountParams]\nexport type CreateLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = \"v1.1.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n>(\n config: CreateLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;\n\n/**\n * Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner's address.\n *\n * @example\n * ```ts\n * import { createLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountParams} config The parameters for creating a light account\n * @returns {Promise<LightAccount>} A promise that resolves to a `LightAccount` object containing the created account information and methods\n */\nexport async function createLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"LightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: AccountVersionRegistry[\"LightAccount\"][version]\n .entryPointVersion as any,\n }),\n accountAddress,\n factoryAddress = getDefaultLightAccountFactoryAddress(chain, version),\n salt: salt_ = 0n,\n}: CreateLightAccountParams): Promise<LightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const accountAbi =\n version === \"v2.0.0\" ? LightAccountAbi_v2 : LightAccountAbi_v1;\n const factoryAbi =\n version === \"v2.0.0\"\n ? LightAccountFactoryAbi_v1\n : LightAccountFactoryAbi_v2;\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n const salt = LightAccountUnsupported1271Factories.has(\n factoryAddress.toLowerCase() as Address\n )\n ? 0n\n : salt_;\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: factoryAbi,\n functionName: \"createAccount\",\n args: [await signer.getAddress(), salt],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"LightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n version: AccountVersionRegistry[\"LightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n\n encodeTransferOwnership: (newOwner: Address) => {\n return encodeFunctionData({\n abi: accountAbi,\n functionName: \"transferOwnership\",\n args: [newOwner],\n });\n },\n async getOwnerAddress(): Promise<Address> {\n const callResult = await client.readContract({\n address,\n abi: accountAbi,\n functionName: \"owner\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owner\");\n }\n\n return callResult;\n },\n };\n}\n"]}
@@ -8,10 +8,8 @@ const MultiOwnerLightAccountFactoryAbi_js_1 = require("../abis/MultiOwnerLightAc
8
8
  const utils_js_1 = require("../utils.js");
9
9
  const base_js_1 = require("./base.js");
10
10
  async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)("MultiOwnerLightAccount"), entryPoint = (0, core_1.getEntryPoint)(chain, {
11
- version: utils_js_1.AccountVersionRegistry["MultiOwnerLightAccount"][version]
12
- .entryPointVersion,
13
- }), accountAddress, factoryAddress = utils_js_1.AccountVersionRegistry["MultiOwnerLightAccount"][version]
14
- .address[chain.id].factory, salt: salt_ = 0n, owners = [], }) {
11
+ version: "0.7.0",
12
+ }), accountAddress, factoryAddress = (0, utils_js_1.getDefaultMultiOwnerLightAccountFactoryAddress)(chain, version), salt: salt_ = 0n, owners = [], }) {
15
13
  const client = (0, core_1.createBundlerClient)({
16
14
  transport,
17
15
  chain,
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwner.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AACtB,+BAQc;AACd,uFAAiF;AACjF,qGAA+F;AAK/F,0CAGqB;AACrB,u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AC;gBACpD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC;AAhGD,oEAgGC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultiOwnerLightAccountAbi } from \"../abis/MultiOwnerLightAccountAbi.js\";\nimport { MultiOwnerLightAccountFactoryAbi } from \"../abis/MultiOwnerLightAccountFactoryAbi.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n defaultLightAccountVersion,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type MultiOwnerLightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeUpdateOwners: (\n ownersToAdd: Address[],\n ownersToRemove: Address[]\n ) => Hex;\n getOwnerAddresses: () => Promise<readonly Address[]>;\n};\n\nexport type CreateMultiOwnerLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<\n MultiOwnerLightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>\n>;\n\nexport async function createMultiOwnerLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"MultiOwnerLightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version:\n AccountVersionRegistry[\"MultiOwnerLightAccount\"][version]\n .entryPointVersion,\n }),\n accountAddress,\n factoryAddress = AccountVersionRegistry[\"MultiOwnerLightAccount\"][version]\n .address[chain.id].factory,\n salt: salt_ = 0n,\n owners = [],\n}: CreateMultiOwnerLightAccountParams): Promise<MultiOwnerLightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n // NOTE: the current signer connected will be one of the owners as well\n const ownerAddress = await signer.getAddress();\n // owners need to be dedupe + ordered in ascending order and not == to zero address\n const owners_ = Array.from(new Set([...owners, ownerAddress]))\n .filter((x) => hexToBigInt(x) !== 0n)\n .sort((a, b) => {\n const bigintA = hexToBigInt(a);\n const bigintB = hexToBigInt(b);\n\n return bigintA < bigintB ? -1 : bigintA > bigintB ? 1 : 0;\n });\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: MultiOwnerLightAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [owners_, salt_],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"MultiOwnerLightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version: AccountVersionRegistry[\"MultiOwnerLightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => {\n return encodeFunctionData({\n abi: MultiOwnerLightAccountAbi,\n functionName: \"updateOwners\",\n args: [ownersToAdd, ownersToRemove],\n });\n },\n async getOwnerAddresses(): Promise<readonly Address[]> {\n const callResult = await client.readContract({\n address,\n abi: MultiOwnerLightAccountAbi,\n functionName: \"owners\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owners\");\n }\n\n if (!callResult.includes(await signer.getAddress())) {\n throw new Error(\"on-chain owners does not include the current signer\");\n }\n\n return callResult;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"multiOwner.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AACtB,+BAQc;AACd,uFAAiF;AACjF,qGAA+F;AAK/F,0CAIqB;AACrB,uCAImB;AAiGZ,KA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,oEAgGC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultiOwnerLightAccountAbi } from \"../abis/MultiOwnerLightAccountAbi.js\";\nimport { MultiOwnerLightAccountFactoryAbi } from \"../abis/MultiOwnerLightAccountFactoryAbi.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n defaultLightAccountVersion,\n getDefaultMultiOwnerLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type MultiOwnerLightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeUpdateOwners: (\n ownersToAdd: Address[],\n ownersToRemove: Address[]\n ) => Hex;\n getOwnerAddresses: () => Promise<readonly Address[]>;\n};\n\nexport type CreateMultiOwnerLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<\n MultiOwnerLightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>\n>;\n\n/**\n * 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.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountParams} config The parameters for creating a multi-owner light account\n * @returns {Promise<MultiOwnerLightAccount>} A promise that resolves to a `MultiOwnerLightAccount` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"MultiOwnerLightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: \"0.7.0\",\n }),\n accountAddress,\n factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(\n chain,\n version\n ),\n salt: salt_ = 0n,\n owners = [],\n}: CreateMultiOwnerLightAccountParams): Promise<MultiOwnerLightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n // NOTE: the current signer connected will be one of the owners as well\n const ownerAddress = await signer.getAddress();\n // owners need to be dedupe + ordered in ascending order and not == to zero address\n const owners_ = Array.from(new Set([...owners, ownerAddress]))\n .filter((x) => hexToBigInt(x) !== 0n)\n .sort((a, b) => {\n const bigintA = hexToBigInt(a);\n const bigintB = hexToBigInt(b);\n\n return bigintA < bigintB ? -1 : bigintA > bigintB ? 1 : 0;\n });\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: MultiOwnerLightAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [owners_, salt_],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"MultiOwnerLightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version: AccountVersionRegistry[\"MultiOwnerLightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => {\n return encodeFunctionData({\n abi: MultiOwnerLightAccountAbi,\n functionName: \"updateOwners\",\n args: [ownersToAdd, ownersToRemove],\n });\n },\n async getOwnerAddresses(): Promise<readonly Address[]> {\n const callResult = await client.readContract({\n address,\n abi: MultiOwnerLightAccountAbi,\n functionName: \"owners\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owners\");\n }\n\n if (!callResult.includes(await signer.getAddress())) {\n throw new Error(\"on-chain owners does not include the current signer\");\n }\n\n return callResult;\n },\n };\n}\n"]}
@@ -5,4 +5,4 @@ export type TransferLightAccountOwnershipParams<TSigner extends SmartAccountSign
5
5
  newOwner: TSigner;
6
6
  waitForTxn?: boolean;
7
7
  } & GetAccountParameter<TAccount, LightAccount<TSigner>> & UserOperationOverridesParameter<TEntryPointVersion>;
8
- export declare const transferOwnership: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner, TAccount extends LightAccount<TSigner> | undefined = LightAccount<TSigner> | undefined>(client: Client<TTransport, TChain, TAccount>, args: TransferLightAccountOwnershipParams<TSigner, TAccount>) => Promise<Hex>;
8
+ export declare const transferOwnership: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner<any> = SmartAccountSigner<any>, TAccount extends LightAccount<TSigner> | undefined = LightAccount<TSigner> | undefined>(client: Client<TTransport, TChain, TAccount>, args: TransferLightAccountOwnershipParams<TSigner, TAccount, GetEntryPointFromAccount<TAccount, import("@aa-sdk/core").SmartContractAccount<string, keyof import("@aa-sdk/core").EntryPointRegistryBase<unknown>>>>) => Promise<Hex>;
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transferOwnership = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
- const transferOwnership = async (client, { newOwner, waitForTxn, overrides, account = client.account }) => {
5
+ const transferOwnership = async (client, args) => {
6
+ const { newOwner, waitForTxn, overrides, account = client.account } = args;
6
7
  if (!account) {
7
8
  throw new core_1.AccountNotFoundError();
8
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"transferOwnership.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/transferOwnership.ts"],"names":[],"mappings":";;;AAAA,uCAQsB;AAgBf,MAAM,iBAAiB,GAUV,KAAK,EACvB,MAAM,EACN,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAC7D,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,uBAAuB,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAE1E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC5C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI;SACL;QACD,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC;AA1CW,QAAA,iBAAiB,qBA0C5B","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type SmartAccountSigner,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { LightAccount } from \"../accounts/account\";\n\nexport type TransferLightAccountOwnershipParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n newOwner: TSigner;\n waitForTxn?: boolean;\n} & GetAccountParameter<TAccount, LightAccount<TSigner>> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n\nexport const transferOwnership: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: TransferLightAccountOwnershipParams<TSigner, TAccount>\n) => Promise<Hex> = async (\n client,\n { newOwner, waitForTxn, overrides, account = client.account }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"transferOwnership\",\n client\n );\n }\n\n const data = account.encodeTransferOwnership(await newOwner.getAddress());\n\n const result = await client.sendUserOperation({\n uo: {\n target: account.address,\n data,\n },\n account,\n overrides,\n });\n\n if (waitForTxn) {\n return client.waitForUserOperationTransaction(result);\n }\n\n return result.hash;\n};\n"]}
1
+ {"version":3,"file":"transferOwnership.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/transferOwnership.ts"],"names":[],"mappings":";;;AAAA,uCAQsB;AAyCf,MAAM,iBAAiB,GAAG,KAAK,EAQpC,MAA4C,EAC5C,IAA4D,EAC9C,EAAE;IAChB,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC3E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,uBAAuB,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;IAE1E,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC5C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI;SACL;QACD,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC;AAxCW,QAAA,iBAAiB,qBAwC5B","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type SmartAccountSigner,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { LightAccount } from \"../accounts/account\";\n\nexport type TransferLightAccountOwnershipParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n newOwner: TSigner;\n waitForTxn?: boolean;\n} & GetAccountParameter<TAccount, LightAccount<TSigner>> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n\n/**\n * Transfers the ownership of a light account to a new owner.\n * This function ensures that the client is a compatible smart acccount client and that a Light Account is provided.\n * If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning.\n *\n * @example\n * ```ts\n * import { transferOwnership, createLightAccountClient } from \"@account-kit/smart-contracts\";\n *\n * const lightAccountClient = createLightAccountClient({\n * signer,\n * transport,\n * chain,\n * });\n *\n * const txHash = await transferOwnership(lightAccountClient, {\n * newOwner: newOwnerSigner,\n * waitForTxn: true, // set to false to return a uoHash instead\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The smart account client instance used to execute the transfer\n * @param {TransferLightAccountOwnershipParams<TSigner, TAccount>} args The parameters for transferring ownership\n * @returns {Promise<Hex>} The transaction or UO hash as a Hex string\n */\nexport const transferOwnership = async <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: TransferLightAccountOwnershipParams<TSigner, TAccount>\n): Promise<Hex> => {\n const { newOwner, waitForTxn, overrides, account = client.account } = args;\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"transferOwnership\",\n client\n );\n }\n\n const data = account.encodeTransferOwnership(await newOwner.getAddress());\n\n const result = await client.sendUserOperation({\n uo: {\n target: account.address,\n data,\n },\n account,\n overrides,\n });\n\n if (waitForTxn) {\n return client.waitForUserOperationTransaction(result);\n }\n\n return result.hash;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"updateOwners.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/updateOwners.ts"],"names":[],"mappings":";;;AAAA,uCAQsB;AAiBf,MAAM,YAAY,GAUL,KAAK,EACvB,MAAM,EACN,EACE,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,OAAO,GAAG,MAAM,CAAC,OAAO,GACzB,EACD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,cAAc,EACd,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC5C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI;SACL;QACD,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC;AAhDW,QAAA,YAAY,gBAgDvB","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type SmartAccountSigner,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport type { Address, Chain, Client, Hex, Transport } from \"viem\";\nimport type { MultiOwnerLightAccount } from \"../accounts/multiOwner\";\n\nexport type UpdateMultiOwnerLightAccountOwnersParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n ownersToAdd: Address[];\n ownersToRemove: Address[];\n waitForTxn?: boolean;\n} & GetAccountParameter<TAccount, MultiOwnerLightAccount<TSigner>> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n\nexport const updateOwners: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>\n) => Promise<Hex> = async (\n client,\n {\n ownersToAdd,\n ownersToRemove,\n waitForTxn,\n overrides,\n account = client.account,\n }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"updateOwners\",\n client\n );\n }\n\n const data = account.encodeUpdateOwners(ownersToAdd, ownersToRemove);\n\n const result = await client.sendUserOperation({\n uo: {\n target: account.address,\n data,\n },\n account,\n overrides,\n });\n\n if (waitForTxn) {\n return client.waitForUserOperationTransaction(result);\n }\n\n return result.hash;\n};\n"]}
1
+ {"version":3,"file":"updateOwners.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/updateOwners.ts"],"names":[],"mappings":";;;AAAA,uCAQsB;AAyCf,MAAM,YAAY,GAUL,KAAK,EACvB,MAAM,EACN,EACE,WAAW,EACX,cAAc,EACd,UAAU,EACV,SAAS,EACT,OAAO,GAAG,MAAM,CAAC,OAAO,GACzB,EACD,EAAE;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,cAAc,EACd,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,kBAAkB,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAErE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC5C,EAAE,EAAE;YACF,MAAM,EAAE,OAAO,CAAC,OAAO;YACvB,IAAI;SACL;QACD,OAAO;QACP,SAAS;KACV,CAAC,CAAC;IAEH,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,MAAM,CAAC,+BAA+B,CAAC,MAAM,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC,CAAC;AAhDW,QAAA,YAAY,gBAgDvB","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type SmartAccountSigner,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport type { Address, Chain, Client, Hex, Transport } from \"viem\";\nimport type { MultiOwnerLightAccount } from \"../accounts/multiOwner\";\n\nexport type UpdateMultiOwnerLightAccountOwnersParams<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n ownersToAdd: Address[];\n ownersToRemove: Address[];\n waitForTxn?: boolean;\n} & GetAccountParameter<TAccount, MultiOwnerLightAccount<TSigner>> &\n UserOperationOverridesParameter<TEntryPointVersion>;\n\n/**\n * Updates the owners of a multi-owner light account. This includes adding new owners and removing existing ones.\n *\n * @example\n * ```ts\n * import { updateOwners, createLightAccountClient } from \"@account-kit/smart-contracts\";\n *\n * const lightAccountClient = createLightAccountClient({\n * signer,\n * transport,\n * chain,\n * });\n *\n * const txHash = await updateOwners(lightAccountClient, {\n * ownerstoAdd: [newOwnerAddress], // or empty if you just want to remove owners\n * ownersToRemove: [oldOwnerAddress], // or empty if you just want to add owners\n * waitForTxn: true, // set to false to return a uoHash instead\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance used to interact with the account\n * @param {UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>} args The parameters for updating the account owners\n * @returns {Promise<Hex>} A promise that resolves to the transaction hash or the full transaction result if `waitForTxn` is `true`\n */\nexport const updateOwners: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>\n) => Promise<Hex> = async (\n client,\n {\n ownersToAdd,\n ownersToRemove,\n waitForTxn,\n overrides,\n account = client.account,\n }\n) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"updateOwners\",\n client\n );\n }\n\n const data = account.encodeUpdateOwners(ownersToAdd, ownersToRemove);\n\n const result = await client.sendUserOperation({\n uo: {\n target: account.address,\n data,\n },\n account,\n overrides,\n });\n\n if (waitForTxn) {\n return client.waitForUserOperationTransaction(result);\n }\n\n return result.hash;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAMsC;AAEtC,+BAAgF;AA0BzE,KAAK,UAAU,+BAA+B,CACnD,MAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,oCAAkB,EAAC;QACvC,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,2CAAyB,CAAC,CAAC;AACvC,CAAC;AAtBD,0EAsBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccount,\n lightAccountClientActions,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\nexport async function createLightAccountAlchemyClient(\n config: AlchemyLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(lightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAMsC;AAEtC,+BAAgF;AA8CzE,KAAK,UAAU,+BAA+B,CACnD,MAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,oCAAkB,EAAC;QACvC,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,2CAAyB,CAAC,CAAC;AACvC,CAAC;AAtBD,0EAsBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccount,\n lightAccountClientActions,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient(\n config: AlchemyLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(lightAccountClientActions);\n}\n"]}
@@ -4,7 +4,8 @@ exports.createLightAccountClient = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
5
  const account_js_1 = require("../accounts/account.js");
6
6
  const lightAccount_js_1 = require("../decorators/lightAccount.js");
7
- async function createLightAccountClient({ account, transport, chain, ...clientConfig }) {
7
+ async function createLightAccountClient(params) {
8
+ const { account, transport, chain, ...clientConfig } = params;
8
9
  const lightAccount = await (0, account_js_1.createLightAccount)({
9
10
  ...account,
10
11
  transport,
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,uDAIgC;AAChC,mEAGuC;AAiChC,KAAK,UAAU,wBAAwB,CAAC,EAC7C,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EACgB;IAC/B,MAAM,YAAY,GAAG,MAAM,IAAA,+BAAkB,EAAC;QAC5C,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,2CAAyB,CAAC,CAAC;AACvC,CAAC;AAlBD,4DAkBC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createLightAccount,\n type CreateLightAccountParams,\n type LightAccount,\n} from \"../accounts/account.js\";\nimport {\n lightAccountClientActions,\n type LightAccountClientActions,\n} from \"../decorators/lightAccount.js\";\n\nexport type CreateLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateLightAccountParams<TTransport, TSigner>[\"transport\"];\n chain: CreateLightAccountParams<TTransport, TSigner>[\"chain\"];\n account: Omit<\n CreateLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n>;\n\nexport function createLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n LightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n LightAccountClientActions<TSigner, LightAccount<TSigner>>\n >\n>;\n\nexport async function createLightAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateLightAccountClientParams): Promise<SmartAccountClient> {\n const lightAccount = await createLightAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/client.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,uDAIgC;AAChC,mEAGuC;AAuDhC,KAAK,UAAU,wBAAwB,CAC5C,MAAsC;IAEtC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,YAAY,GAAG,MAAM,IAAA,+BAAkB,EAAC;QAC5C,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,2CAAyB,CAAC,CAAC;AACvC,CAAC;AAjBD,4DAiBC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createLightAccount,\n type CreateLightAccountParams,\n type LightAccount,\n} from \"../accounts/account.js\";\nimport {\n lightAccountClientActions,\n type LightAccountClientActions,\n} from \"../decorators/lightAccount.js\";\n\nexport type CreateLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateLightAccountParams<TTransport, TSigner>[\"transport\"];\n chain: CreateLightAccountParams<TTransport, TSigner>[\"chain\"];\n account: Omit<\n CreateLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n>;\n\nexport function createLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n LightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n LightAccountClientActions<TSigner, LightAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a light account client using the provided parameters, including account information, transport mechanism, blockchain chain, and additional client configurations. This function first creates a light account and then uses it to create a smart account client, extending it with light account client actions.\n *\n * @example\n * ```ts\n * import { createLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * account: {\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * }\n * });\n * ```\n *\n * @param {CreateLightAccountClientParams} params The parameters for creating a light account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` object containing the created account information and methods\n */\nexport async function createLightAccountClient(\n params: CreateLightAccountClientParams\n): Promise<SmartAccountClient> {\n const { account, transport, chain, ...clientConfig } = params;\n\n const lightAccount = await createLightAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(lightAccountClientActions);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAMsC;AAEtC,+BAAgF;AA8BzE,KAAK,UAAU,yCAAyC,CAC7D,MAAiD;IAEjD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,8CAA4B,EAAC;QACjD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,qDAAmC,CAAC,CAAC;AACjD,CAAC;AAtBD,8FAsBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerLightAccount,\n multiOwnerLightAccountClientActions,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyMultiOwnerLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<\n Transport,\n Chain,\n MultiOwnerLightAccount<TSigner>\n >,\n \"account\"\n >;\n\nexport async function createMultiOwnerLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\nexport async function createMultiOwnerLightAccountAlchemyClient(\n config: AlchemyMultiOwnerLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultiOwnerLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"multiOwnerAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerAlchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAMsC;AAEtC,+BAAgF;AAkDzE,KAAK,UAAU,yCAAyC,CAC7D,MAAiD;IAEjD,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,8CAA4B,EAAC;QACjD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,qDAAmC,CAAC,CAAC;AACjD,CAAC;AAtBD,8FAsBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createMultiOwnerLightAccount,\n multiOwnerLightAccountClientActions,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n type MultiOwnerLightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyMultiOwnerLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<\n Transport,\n Chain,\n MultiOwnerLightAccount<TSigner>\n >,\n \"account\"\n >;\n\nexport async function createMultiOwnerLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultiOwnerLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultiOwnerLightAccount<TSigner>,\n MultiOwnerLightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates a multi-owner light account Alchemy client using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createMultiOwnerLightAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyMultiOwnerLightAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccountAlchemyClient(\n config: AlchemyMultiOwnerLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultiOwnerLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
@@ -4,7 +4,8 @@ exports.createMultiOwnerLightAccountClient = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
5
  const multiOwner_js_1 = require("../accounts/multiOwner.js");
6
6
  const multiOwnerLightAccount_js_1 = require("../decorators/multiOwnerLightAccount.js");
7
- async function createMultiOwnerLightAccountClient({ account, transport, chain, ...clientConfig }) {
7
+ async function createMultiOwnerLightAccountClient(params) {
8
+ const { account, transport, chain, ...clientConfig } = params;
8
9
  const lightAccount = await (0, multiOwner_js_1.createMultiOwnerLightAccount)({
9
10
  ...account,
10
11
  transport,
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,6DAImC;AACnC,uFAGiD;AAuC1C,KAAK,UAAU,kCAAkC,CAAC,EACvD,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EAC0B;IACzC,MAAM,YAAY,GAAG,MAAM,IAAA,4CAA4B,EAAC;QACtD,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,+DAAmC,CAAC,CAAC;AACjD,CAAC;AAlBD,gFAkBC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createMultiOwnerLightAccount,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n} from \"../accounts/multiOwner.js\";\nimport {\n multiOwnerLightAccountClientActions,\n type MultiOwnerLightAccountClientActions,\n} from \"../decorators/multiOwnerLightAccount.js\";\n\nexport type CreateMultiOwnerLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner\n >[\"transport\"];\n chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>[\"chain\"];\n account: Omit<\n CreateMultiOwnerLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n>;\n\nexport function createMultiOwnerLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerLightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n MultiOwnerLightAccountClientActions<\n TSigner,\n MultiOwnerLightAccount<TSigner>\n >\n >\n>;\n\nexport async function createMultiOwnerLightAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateMultiOwnerLightAccountClientParams): Promise<SmartAccountClient> {\n const lightAccount = await createMultiOwnerLightAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/multiOwnerLightAccount.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,6DAImC;AACnC,uFAGiD;AA6D1C,KAAK,UAAU,kCAAkC,CACtD,MAAgD;IAEhD,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAG,MAAM,CAAC;IAE9D,MAAM,YAAY,GAAG,MAAM,IAAA,4CAA4B,EAAC;QACtD,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,YAAY;KACtB,CAAC,CAAC,MAAM,CAAC,+DAAmC,CAAC,CAAC;AACjD,CAAC;AAjBD,gFAiBC","sourcesContent":["import {\n createSmartAccountClient,\n type SmartAccountClient,\n type SmartAccountClientActions,\n type SmartAccountClientConfig,\n type SmartAccountSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport {\n createMultiOwnerLightAccount,\n type CreateMultiOwnerLightAccountParams,\n type MultiOwnerLightAccount,\n} from \"../accounts/multiOwner.js\";\nimport {\n multiOwnerLightAccountClientActions,\n type MultiOwnerLightAccountClientActions,\n} from \"../decorators/multiOwnerLightAccount.js\";\n\nexport type CreateMultiOwnerLightAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n transport: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner\n >[\"transport\"];\n chain: CreateMultiOwnerLightAccountParams<TTransport, TSigner>[\"chain\"];\n account: Omit<\n CreateMultiOwnerLightAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n SmartAccountClientConfig<TTransport, TChain>,\n \"transport\" | \"account\" | \"chain\"\n>;\n\nexport function createMultiOwnerLightAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerLightAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerLightAccount<TSigner>,\n SmartAccountClientActions<Chain, SmartContractAccount> &\n MultiOwnerLightAccountClientActions<\n TSigner,\n MultiOwnerLightAccount<TSigner>\n >\n >\n>;\n\n/**\n * Creates a multi-owner light account client using the provided parameters. It first creates a multi-owner light account and then creates a smart account client with the provided configurations.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccountClient } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * account: {\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * }\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountClientParams} params the configuration for creating the multi-owner light account client\n * @returns {Promise<SmartAccountClient>} a promise that resolves to a `SmartAccountClient` containing the created account client and relevant methods\n */\nexport async function createMultiOwnerLightAccountClient(\n params: CreateMultiOwnerLightAccountClientParams\n): Promise<SmartAccountClient> {\n const { account, transport, chain, ...clientConfig } = params;\n\n const lightAccount = await createMultiOwnerLightAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain: chain,\n account: lightAccount,\n }).extend(multiOwnerLightAccountClientActions);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"lightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/decorators/lightAccount.ts"],"names":[],"mappings":";;;AAGA,0EAGyC;AAalC,MAAM,yBAAyB,GASc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/D,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,wCAAiB,EAAC,MAAM,EAAE,IAAI,CAAC;CACnE,CAAC,CAAC;AAXU,QAAA,yBAAyB,6BAWnC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { LightAccount } from \"../accounts/account\";\nimport {\n transferOwnership,\n type TransferLightAccountOwnershipParams,\n} from \"../actions/transferOwnership.js\";\n\nexport type LightAccountClientActions<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n> = {\n transferOwnership: (\n args: TransferLightAccountOwnershipParams<TSigner, TAccount>\n ) => Promise<Hex>;\n};\n\nexport const lightAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => LightAccountClientActions<TSigner, TAccount> = (client) => ({\n transferOwnership: async (args) => transferOwnership(client, args),\n});\n"]}
1
+ {"version":3,"file":"lightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/decorators/lightAccount.ts"],"names":[],"mappings":";;;AAGA,0EAGyC;AAgClC,MAAM,yBAAyB,GASc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAC/D,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,wCAAiB,EAAC,MAAM,EAAE,IAAI,CAAC;CACnE,CAAC,CAAC;AAXU,QAAA,yBAAyB,6BAWnC","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { LightAccount } from \"../accounts/account\";\nimport {\n transferOwnership,\n type TransferLightAccountOwnershipParams,\n} from \"../actions/transferOwnership.js\";\n\nexport type LightAccountClientActions<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n> = {\n transferOwnership: (\n args: TransferLightAccountOwnershipParams<TSigner, TAccount>\n ) => Promise<Hex>;\n};\n\n/**\n * Provides a set of actions for managing a light account client, including transferring ownership.\n *\n * @example\n * ```ts\n * import { lightAccountClientActions, createLightAccount } from \"@account-kit/smart-contracts\";\n * import { createAlchemySmartAccountClient } from \"@account-kit/infra\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n *\n * const smartAccountClient = createAlchemySmartAccountClient({\n * account: await createLightAccount(...),\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * }).extend(lightAccountClientActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance for which to provide the light account actions\n * @returns {LightAccountClientActions<TSigner, TAccount>} An object containing the available light account client actions\n */\nexport const lightAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends LightAccount<TSigner> | undefined =\n | LightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => LightAccountClientActions<TSigner, TAccount> = (client) => ({\n transferOwnership: async (args) => transferOwnership(client, args),\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/decorators/multiOwnerLightAccount.ts"],"names":[],"mappings":";;;AAGA,gEAGoC;AAa7B,MAAM,mCAAmC,GASc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,MAAM,EAAE,IAAI,CAAC;CACzD,CAAC,CAAC;AAXU,QAAA,mCAAmC,uCAW7C","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { MultiOwnerLightAccount } from \"../accounts/multiOwner\";\nimport {\n updateOwners,\n type UpdateMultiOwnerLightAccountOwnersParams,\n} from \"../actions/updateOwners.js\";\n\nexport type MultiOwnerLightAccountClientActions<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n> = {\n updateOwners: (\n args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>\n ) => Promise<Hex>;\n};\n\nexport const multiOwnerLightAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultiOwnerLightAccountClientActions<TSigner, TAccount> = (client) => ({\n updateOwners: async (args) => updateOwners(client, args),\n});\n"]}
1
+ {"version":3,"file":"multiOwnerLightAccount.js","sourceRoot":"","sources":["../../../../../src/light-account/decorators/multiOwnerLightAccount.ts"],"names":[],"mappings":";;;AAGA,gEAGoC;AAgC7B,MAAM,mCAAmC,GASc,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACzE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,IAAA,8BAAY,EAAC,MAAM,EAAE,IAAI,CAAC;CACzD,CAAC,CAAC;AAXU,QAAA,mCAAmC,uCAW7C","sourcesContent":["import type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport type { Chain, Client, Hex, Transport } from \"viem\";\nimport type { MultiOwnerLightAccount } from \"../accounts/multiOwner\";\nimport {\n updateOwners,\n type UpdateMultiOwnerLightAccountOwnersParams,\n} from \"../actions/updateOwners.js\";\n\nexport type MultiOwnerLightAccountClientActions<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n> = {\n updateOwners: (\n args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>\n ) => Promise<Hex>;\n};\n\n/**\n * Generates client actions for a multi-owner light account, including the ability to update owners.\n *\n * @example\n * ```ts\n * import { multiOwnerLightAccountClientActions, createMultiOwnerLightAccount } from \"@account-kit/smart-contracts\";\n * import { createAlchemySmartAccountClient } from \"@account-kit/infra\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n *\n * const smartAccountClient = createAlchemySmartAccountClient({\n * account: await createMultiOwnerLightAccount(...),\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * }).extend(multiOwnerLightAccountClientActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client the client for interacting with the multi-owner light account\n * @returns {MultiOwnerLightAccountClientActions<TSigner, TAccount>} an object containing the client actions specifically for a multi-owner light account\n */\nexport const multiOwnerLightAccountClientActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TAccount extends MultiOwnerLightAccount<TSigner> | undefined =\n | MultiOwnerLightAccount<TSigner>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultiOwnerLightAccountClientActions<TSigner, TAccount> = (client) => ({\n updateOwners: async (args) => updateOwners(client, args),\n});\n"]}
@@ -1,10 +1,11 @@
1
1
  import { type Address, type Chain } from "viem";
2
2
  import type { LightAccountBase } from "./accounts/base";
3
- import type { AccountVersionDef, GetLightAccountType, GetLightAccountVersion, IAccountVersionRegistry, LightAccountVersion, LightAccountVersionDef } from "./types";
3
+ import type { AccountVersionDef, GetLightAccountType, GetLightAccountVersion, IAccountVersionRegistry, LightAccountVersionDef } from "./types";
4
4
  export declare const supportedChains: Chain[];
5
5
  export declare const AccountVersionRegistry: IAccountVersionRegistry;
6
6
  export declare const defaultLightAccountVersion: <TLightAccountType extends keyof IAccountVersionRegistry>(type: TLightAccountType) => keyof IAccountVersionRegistry[TLightAccountType];
7
- export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version?: LightAccountVersion) => Address;
7
+ export declare const getDefaultLightAccountFactoryAddress: (chain: Chain, version: GetLightAccountVersion<"LightAccount">) => Address;
8
+ export declare const getDefaultMultiOwnerLightAccountFactoryAddress: (chain: Chain, version: GetLightAccountVersion<"MultiOwnerLightAccount">) => `0x${string}`;
8
9
  export declare const LightAccountUnsupported1271Impls: (AccountVersionDef<"LightAccount", "v1.0.1", "0.6.0"> | AccountVersionDef<"LightAccount", "v1.0.2", "0.6.0">)[];
9
10
  export declare const LightAccountUnsupported1271Factories: Set<`0x${string}`>;
10
11
  export declare function getLightAccountVersionDef<TAccount extends LightAccountBase, TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>>(account: TAccount, chain: Chain): Promise<LightAccountVersionDef<TLightAccountType, TLightAccountVersion>>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getLightAccountVersion = exports.getLightAccountVersionDef = exports.LightAccountUnsupported1271Factories = exports.LightAccountUnsupported1271Impls = exports.getDefaultLightAccountFactoryAddress = exports.defaultLightAccountVersion = exports.AccountVersionRegistry = exports.supportedChains = void 0;
3
+ exports.getLightAccountVersion = exports.getLightAccountVersionDef = exports.LightAccountUnsupported1271Factories = exports.LightAccountUnsupported1271Impls = exports.getDefaultMultiOwnerLightAccountFactoryAddress = exports.getDefaultLightAccountFactoryAddress = exports.defaultLightAccountVersion = exports.AccountVersionRegistry = exports.supportedChains = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
5
  const viem_1 = require("viem");
6
6
  exports.supportedChains = [
@@ -79,13 +79,22 @@ const defaultLightAccountVersion = (type) => (type === "LightAccount"
79
79
  ? "v1.1.0"
80
80
  : "v2.0.0");
81
81
  exports.defaultLightAccountVersion = defaultLightAccountVersion;
82
- const getDefaultLightAccountFactoryAddress = (chain, version = "v1.1.0") => {
83
- const address = exports.AccountVersionRegistry.LightAccount[version].address[chain.id];
82
+ const getDefaultLightAccountFactoryAddress = (chain, version) => {
83
+ const address = exports.AccountVersionRegistry.LightAccount[version].address[chain.id] ??
84
+ exports.AccountVersionRegistry.LightAccount[version].address[exports.supportedChains[0].id];
84
85
  if (!address)
85
86
  throw new core_1.DefaultFactoryNotDefinedError("LightAccount", chain, "0.6.0");
86
87
  return address.factory;
87
88
  };
88
89
  exports.getDefaultLightAccountFactoryAddress = getDefaultLightAccountFactoryAddress;
90
+ const getDefaultMultiOwnerLightAccountFactoryAddress = (chain, version) => {
91
+ const address = exports.AccountVersionRegistry.LightAccount[version].address[chain.id] ??
92
+ exports.AccountVersionRegistry.LightAccount[version].address[exports.supportedChains[0].id];
93
+ if (!address)
94
+ throw new core_1.DefaultFactoryNotDefinedError("MultiOwnerLightAccount", chain, "0.7.0");
95
+ return address.factory;
96
+ };
97
+ exports.getDefaultMultiOwnerLightAccountFactoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress;
89
98
  exports.LightAccountUnsupported1271Impls = [
90
99
  exports.AccountVersionRegistry.LightAccount["v1.0.1"],
91
100
  exports.AccountVersionRegistry.LightAccount["v1.0.2"],
@@ -100,7 +109,7 @@ async function getLightAccountVersionDef(account, chain) {
100
109
  const [version, def] = pair;
101
110
  return chain.id in def.address
102
111
  ? [def.address[chain.id].impl, version]
103
- : [null, version];
112
+ : [def.address[exports.supportedChains[0].id].impl, version];
104
113
  })
105
114
  .filter(([impl]) => impl !== null));
106
115
  const factoryToVersion = new Map(Object.entries(exports.AccountVersionRegistry[accountType])
@@ -108,7 +117,7 @@ async function getLightAccountVersionDef(account, chain) {
108
117
  const [version, def] = pair;
109
118
  return chain.id in def.address
110
119
  ? [def.address[chain.id].factory, version]
111
- : [null, version];
120
+ : [def.address[exports.supportedChains[0].id].factory, version];
112
121
  })
113
122
  .filter(([impl]) => impl !== null));
114
123
  const version = (0, viem_1.fromHex)(implAddress, "bigint") === 0n
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":";;;AAAA,uCAsBsB;AACtB,+BAAyD;AAiB5C,QAAA,eAAe,GAAY;IACtC,cAAO;IACP,cAAO;IACP,aAAM;IACN,cAAO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,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC;YAC1C,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACtB,CAAC,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAGhC,CACJ,CAAC;IAEF,MAAM,OAAO,GACX,IAAA,cAAO,EAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,EAAE;QACnC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,EAAa,CAAC;QAC/D,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAa,CAAC,CAAC;IAE9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,uBAAuB,OAAO,CAAC,MAAM,sBAAsB,KAAK,CAAC,EAAE,EAAE,CACtE,CAAC;IACJ,CAAC;IAED,OAAO,8BAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC;AApDD,8DAoDC;AA4BM,KAAK,UAAU,sBAAsB,CAC1C,OAAyB,EACzB,QAAe,uBAAe,CAAC,CAAC,CAAC;IAEjC,OAAO,CAAC,MAAM,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AALD,wDAKC","sourcesContent":["import {\n DefaultFactoryNotDefinedError,\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n toRecord,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\nimport { fromHex, type Address, type Chain } from \"viem\";\nimport type { LightAccountBase } from \"./accounts/base\";\nimport type {\n AccountVersionDef,\n GetLightAccountType,\n GetLightAccountVersion,\n GetLightAccountVersionFromAccount,\n IAccountVersionRegistry,\n LightAccountType,\n LightAccountVersion,\n LightAccountVersionDef,\n} from \"./types\";\n\n/**\n * Light account deployed chains\n *\n */\nexport const supportedChains: Chain[] = [\n mainnet,\n sepolia,\n goerli,\n polygon,\n polygonAmoy,\n polygonMumbai,\n optimism,\n optimismGoerli,\n optimismSepolia,\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n zora,\n zoraSepolia,\n];\n\n/**\n * Account version registry interface that defines the light account versions\n * and the version definition for each light account type\n *\n */\nexport const AccountVersionRegistry: IAccountVersionRegistry = {\n LightAccount: {\n \"v1.0.1\": {\n type: \"LightAccount\",\n version: \"v1.0.1\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x000000893A26168158fbeaDD9335Be5bC96592E2\".toLowerCase() as Address,\n impl: \"0xc1b2fc4197c9187853243e6e4eb5a4af8879a1c0\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v1.0.2\": {\n type: \"LightAccount\",\n version: \"v1.0.2\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x00000055C0b4fA41dde26A74435ff03692292FBD\".toLowerCase() as Address,\n impl: \"0x5467b1947F47d0646704EB801E075e72aeAe8113\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v1.1.0\": {\n type: \"LightAccount\",\n version: \"v1.1.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x00004EC70002a32400f8ae005A26081065620D20\".toLowerCase() as Address,\n impl: \"0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v2.0.0\": {\n type: \"LightAccount\",\n version: \"v2.0.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x0000000000400CdFef5E2714E63d8040b700BC24\".toLowerCase() as Address,\n impl: \"0x8E8e658E22B12ada97B402fF0b044D6A325013C7\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.7.0\",\n },\n },\n MultiOwnerLightAccount: {\n \"v2.0.0\": {\n type: \"MultiOwnerLightAccount\",\n version: \"v2.0.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x000000000019d2Ee9F2729A65AfE20bb0020AefC\".toLowerCase() as Address,\n impl: \"0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.7.0\",\n },\n },\n};\n\n/**\n * Get the default light account version for the given light account type\n *\n * @template {LightAccountType} TLightAccountType\n * @param type - the light account type to get the default version for\n * @returns the default version for the given light account type\n */\nexport const defaultLightAccountVersion = <\n TLightAccountType extends LightAccountType\n>(\n type: TLightAccountType\n): GetLightAccountVersion<TLightAccountType> =>\n (type === \"LightAccount\"\n ? \"v1.1.0\"\n : \"v2.0.0\") as GetLightAccountVersion<TLightAccountType>;\n\n/**\n * Utility method returning the default light account factory address given a {@link Chain} object\n *\n * @param chain - a {@link Chain} object\n * @param version - the version of the light account to get the factory address for\n * @returns a {@link Address} for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultLightAccountFactoryAddress = (\n chain: Chain,\n version: LightAccountVersion = \"v1.1.0\"\n): Address => {\n const address =\n AccountVersionRegistry.LightAccount[version].address[chain.id];\n if (!address)\n throw new DefaultFactoryNotDefinedError(\"LightAccount\", chain, \"0.6.0\");\n return address.factory;\n};\n\n/**\n * Can be used to check if the account with one of the following implementation addresses\n * to not support 1271 signing.\n *\n * Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.\n *\n */\nexport const LightAccountUnsupported1271Impls = [\n AccountVersionRegistry.LightAccount[\"v1.0.1\"],\n AccountVersionRegistry.LightAccount[\"v1.0.2\"],\n];\n\n/**\n * Can be used to check if the account with one of the following factory addresses\n * to not support 1271 signing.\n *\n * Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.\n *\n */\nexport const LightAccountUnsupported1271Factories = new Set(\n LightAccountUnsupported1271Impls.map((x) =>\n Object.values(x.address).map((addr) => addr.factory)\n ).flat()\n);\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @template {GetLightAccountType<TAccount>} TLightAccountType\n * @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>,\n TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>\n>(\n account: TAccount,\n chain: Chain\n): Promise<LightAccountVersionDef<TLightAccountType, TLightAccountVersion>>;\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @template {GetLightAccountType<TAccount>} TLightAccountType\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>\n>(\n account: TAccount,\n chain: Chain\n): Promise<\n AccountVersionDef<\n TLightAccountType,\n GetLightAccountVersion<TLightAccountType>\n >\n>;\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase\n>(account: TAccount, chain: Chain): Promise<AccountVersionDef> {\n const accountType = account.source as LightAccountType;\n const factoryAddress = await account.getFactoryAddress();\n const implAddress = await account.getImplementationAddress();\n const implToVersion = new Map(\n Object.entries(AccountVersionRegistry[accountType])\n .map((pair) => {\n const [version, def] = pair as [\n GetLightAccountVersionFromAccount<TAccount>,\n LightAccountVersionDef\n ];\n return chain.id in def.address\n ? [def.address[chain.id].impl, version]\n : [null, version];\n })\n .filter(([impl]) => impl !== null) as [\n Address,\n keyof IAccountVersionRegistry[typeof accountType]\n ][]\n );\n\n const factoryToVersion = new Map(\n Object.entries(AccountVersionRegistry[accountType])\n .map((pair) => {\n const [version, def] = pair as [\n keyof IAccountVersionRegistry[typeof accountType],\n LightAccountVersionDef\n ];\n return chain.id in def.address\n ? [def.address[chain.id].factory, version]\n : [null, version];\n })\n .filter(([impl]) => impl !== null) as [\n Address,\n keyof IAccountVersionRegistry[typeof accountType]\n ][]\n );\n\n const version =\n fromHex(implAddress, \"bigint\") === 0n\n ? factoryToVersion.get(factoryAddress.toLowerCase() as Address)\n : implToVersion.get(implAddress.toLowerCase() as Address);\n\n if (!version) {\n throw new Error(\n `Could not determine ${account.source} version for chain ${chain.id}`\n );\n }\n\n return AccountVersionRegistry[accountType][version];\n}\n\n/**\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n *\n * @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.\n * Migrate to using getLightAccountVersionDef instead\n *\n * @returns the light account version for the given light account and chain\n */\nexport async function getLightAccountVersion<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>\n>(\n account: TAccount,\n chain?: Chain\n): Promise<GetLightAccountVersion<TLightAccountType>>;\n\n/**\n * Get the light account version for the given light account and chain\n *\n * @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.\n *\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version for the given light account and chain\n */\nexport async function getLightAccountVersion(\n account: LightAccountBase,\n chain: Chain = supportedChains[0]\n): Promise<LightAccountVersion> {\n return (await getLightAccountVersionDef(account, chain)).version;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/light-account/utils.ts"],"names":[],"mappings":";;;AAAA,uCAsBsB;AACtB,+BAAyD;AAiB5C,QAAA,eAAe,GAAY;IACtC,cAAO;IACP,cAAO;IACP,aAAM;IACN,cAAO;IACP,kBAAW;IACX,oBAAa;IACb,eAAQ;IACR,qBAAc;IACd,sBAAe;IACf,eAAQ;IACR,qBAAc;IACd,sBAAe;IACf,WAAI;IACJ,iBAAU;IACV,kBAAW;IACX,cAAO;IACP,qBAAc;IACd,WAAI;IACJ,kBAAW;CACZ,CAAC;AAOW,QAAA,sBAAsB,GAA4B;IAC7D,YAAY,EAAE;QACZ,QAAQ,EAAE;YACR,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,IAAA,eAAQ,EACf,uBAAe,EACf,IAAI,EACJ,GAAG,EAAE,CAAC,CAAC;gBACL,OAAO,EACL,4CAA4C,CAAC,WAAW,EAAa;gBACvE,IAAI,EAAE,4CAA4C,CAAC,WAAW,EAAa;aAC5E,CAAC,CACH;YACD,iBAAiB,EAAE,OAAO;SAC3B;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE,IAAA,eAAQ,EACf,uBAAe,EACf,IAAI,EACJ,GAAG,EAAE,CAAC,CAAC;gBACL,OAAO,EACL,4CAA4C,CAAC,WAAW,EAAa;gBACvE,IAAI,EAAE,4CAA4C,CAAC,WAAW,EAAa;aAC5E,CAAC,CACH;YACD,iBAAiB,EAAE,OAAO;SAC3B;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,QAAQ;YACjB,OAAO,EAA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AI,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,IAAI,CAGhC,CACJ,CAAC;IAEF,MAAM,OAAO,GACX,IAAA,cAAO,EAAC,WAAW,EAAE,QAAQ,CAAC,KAAK,EAAE;QACnC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,EAAa,CAAC;QAC/D,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAa,CAAC,CAAC;IAE9D,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,uBAAuB,OAAO,CAAC,MAAM,sBAAsB,KAAK,CAAC,EAAE,EAAE,CACtE,CAAC;IACJ,CAAC;IAED,OAAO,8BAAsB,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC;AACtD,CAAC;AApDD,8DAoDC;AA4BM,KAAK,UAAU,sBAAsB,CAC1C,OAAyB,EACzB,QAAe,uBAAe,CAAC,CAAC,CAAC;IAEjC,OAAO,CAAC,MAAM,yBAAyB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AACnE,CAAC;AALD,wDAKC","sourcesContent":["import {\n DefaultFactoryNotDefinedError,\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n goerli,\n mainnet,\n optimism,\n optimismGoerli,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n toRecord,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\nimport { fromHex, type Address, type Chain } from \"viem\";\nimport type { LightAccountBase } from \"./accounts/base\";\nimport type {\n AccountVersionDef,\n GetLightAccountType,\n GetLightAccountVersion,\n GetLightAccountVersionFromAccount,\n IAccountVersionRegistry,\n LightAccountType,\n LightAccountVersion,\n LightAccountVersionDef,\n} from \"./types\";\n\n/**\n * Light account deployed chains\n *\n */\nexport const supportedChains: Chain[] = [\n mainnet,\n sepolia,\n goerli,\n polygon,\n polygonAmoy,\n polygonMumbai,\n optimism,\n optimismGoerli,\n optimismSepolia,\n arbitrum,\n arbitrumGoerli,\n arbitrumSepolia,\n base,\n baseGoerli,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n zora,\n zoraSepolia,\n];\n\n/**\n * Account version registry interface that defines the light account versions\n * and the version definition for each light account type\n *\n */\nexport const AccountVersionRegistry: IAccountVersionRegistry = {\n LightAccount: {\n \"v1.0.1\": {\n type: \"LightAccount\",\n version: \"v1.0.1\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x000000893A26168158fbeaDD9335Be5bC96592E2\".toLowerCase() as Address,\n impl: \"0xc1b2fc4197c9187853243e6e4eb5a4af8879a1c0\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v1.0.2\": {\n type: \"LightAccount\",\n version: \"v1.0.2\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x00000055C0b4fA41dde26A74435ff03692292FBD\".toLowerCase() as Address,\n impl: \"0x5467b1947F47d0646704EB801E075e72aeAe8113\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v1.1.0\": {\n type: \"LightAccount\",\n version: \"v1.1.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x00004EC70002a32400f8ae005A26081065620D20\".toLowerCase() as Address,\n impl: \"0xae8c656ad28F2B59a196AB61815C16A0AE1c3cba\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.6.0\",\n },\n \"v2.0.0\": {\n type: \"LightAccount\",\n version: \"v2.0.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x0000000000400CdFef5E2714E63d8040b700BC24\".toLowerCase() as Address,\n impl: \"0x8E8e658E22B12ada97B402fF0b044D6A325013C7\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.7.0\",\n },\n },\n MultiOwnerLightAccount: {\n \"v2.0.0\": {\n type: \"MultiOwnerLightAccount\",\n version: \"v2.0.0\",\n address: toRecord<Chain, \"id\", { factory: Address; impl: Address }>(\n supportedChains,\n \"id\",\n () => ({\n factory:\n \"0x000000000019d2Ee9F2729A65AfE20bb0020AefC\".toLowerCase() as Address,\n impl: \"0xd2c27F9eE8E4355f71915ffD5568cB3433b6823D\".toLowerCase() as Address,\n })\n ),\n entryPointVersion: \"0.7.0\",\n },\n },\n};\n\n/**\n * Get the default light account version for the given light account type\n *\n * @template {LightAccountType} TLightAccountType\n * @param type - the light account type to get the default version for\n * @returns the default version for the given light account type\n */\nexport const defaultLightAccountVersion = <\n TLightAccountType extends LightAccountType\n>(\n type: TLightAccountType\n): GetLightAccountVersion<TLightAccountType> =>\n (type === \"LightAccount\"\n ? \"v1.1.0\"\n : \"v2.0.0\") as GetLightAccountVersion<TLightAccountType>;\n\n/**\n * Utility method returning the default light account factory address given a {@link Chain} object\n *\n * @param chain - a {@link Chain} object\n * @param version - the version of the light account to get the factory address for\n * @returns a {@link Address} for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultLightAccountFactoryAddress = (\n chain: Chain,\n version: GetLightAccountVersion<\"LightAccount\">\n): Address => {\n const address =\n AccountVersionRegistry.LightAccount[version].address[chain.id] ??\n AccountVersionRegistry.LightAccount[version].address[supportedChains[0].id];\n if (!address)\n throw new DefaultFactoryNotDefinedError(\"LightAccount\", chain, \"0.6.0\");\n return address.factory;\n};\n\n/**\n * Utility method returning the default multi owner light account factory address given a {@link Chain} object\n *\n * @param chain - a {@link Chain} object\n * @param version - the version of the light account to get the factory address for\n * @returns a {@link Address} for the given chain\n * @throws if the chain doesn't have an address currently deployed\n */\nexport const getDefaultMultiOwnerLightAccountFactoryAddress = (\n chain: Chain,\n version: GetLightAccountVersion<\"MultiOwnerLightAccount\">\n) => {\n const address =\n AccountVersionRegistry.LightAccount[version].address[chain.id] ??\n AccountVersionRegistry.LightAccount[version].address[supportedChains[0].id];\n if (!address)\n throw new DefaultFactoryNotDefinedError(\n \"MultiOwnerLightAccount\",\n chain,\n \"0.7.0\"\n );\n return address.factory;\n};\n\n/**\n * Can be used to check if the account with one of the following implementation addresses\n * to not support 1271 signing.\n *\n * Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.\n */\nexport const LightAccountUnsupported1271Impls = [\n AccountVersionRegistry.LightAccount[\"v1.0.1\"],\n AccountVersionRegistry.LightAccount[\"v1.0.2\"],\n];\n\n/**\n * Can be used to check if the account with one of the following factory addresses\n * to not support 1271 signing.\n *\n * Light accounts with versions v1.0.1 and v1.0.2 do not support 1271 signing.\n */\nexport const LightAccountUnsupported1271Factories = new Set(\n LightAccountUnsupported1271Impls.map((x) =>\n Object.values(x.address).map((addr) => addr.factory)\n ).flat()\n);\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @template {GetLightAccountType<TAccount>} TLightAccountType\n * @template {GetLightAccountVersion<TLightAccountType>} TLightAccountVersion\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>,\n TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>\n>(\n account: TAccount,\n chain: Chain\n): Promise<LightAccountVersionDef<TLightAccountType, TLightAccountVersion>>;\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @template {GetLightAccountType<TAccount>} TLightAccountType\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>\n>(\n account: TAccount,\n chain: Chain\n): Promise<\n AccountVersionDef<\n TLightAccountType,\n GetLightAccountVersion<TLightAccountType>\n >\n>;\n\n/**\n * Get the light account version definition for the given light account and chain\n *\n * @template {LightAccountBase} TAccount\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version definition for the given light account and chain\n */\nexport async function getLightAccountVersionDef<\n TAccount extends LightAccountBase\n>(account: TAccount, chain: Chain): Promise<AccountVersionDef> {\n const accountType = account.source as LightAccountType;\n const factoryAddress = await account.getFactoryAddress();\n const implAddress = await account.getImplementationAddress();\n const implToVersion = new Map(\n Object.entries(AccountVersionRegistry[accountType])\n .map((pair) => {\n const [version, def] = pair as [\n GetLightAccountVersionFromAccount<TAccount>,\n LightAccountVersionDef\n ];\n return chain.id in def.address\n ? [def.address[chain.id].impl, version]\n : [def.address[supportedChains[0].id].impl, version];\n })\n .filter(([impl]) => impl !== null) as [\n Address,\n keyof IAccountVersionRegistry[typeof accountType]\n ][]\n );\n\n const factoryToVersion = new Map(\n Object.entries(AccountVersionRegistry[accountType])\n .map((pair) => {\n const [version, def] = pair as [\n keyof IAccountVersionRegistry[typeof accountType],\n LightAccountVersionDef\n ];\n return chain.id in def.address\n ? [def.address[chain.id].factory, version]\n : [def.address[supportedChains[0].id].factory, version];\n })\n .filter(([impl]) => impl !== null) as [\n Address,\n keyof IAccountVersionRegistry[typeof accountType]\n ][]\n );\n\n const version =\n fromHex(implAddress, \"bigint\") === 0n\n ? factoryToVersion.get(factoryAddress.toLowerCase() as Address)\n : implToVersion.get(implAddress.toLowerCase() as Address);\n\n if (!version) {\n throw new Error(\n `Could not determine ${account.source} version for chain ${chain.id}`\n );\n }\n\n return AccountVersionRegistry[accountType][version];\n}\n\n/**\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n *\n * @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.\n * Migrate to using getLightAccountVersionDef instead\n *\n * @returns the light account version for the given light account and chain\n */\nexport async function getLightAccountVersion<\n TAccount extends LightAccountBase,\n TLightAccountType extends GetLightAccountType<TAccount> = GetLightAccountType<TAccount>\n>(\n account: TAccount,\n chain?: Chain\n): Promise<GetLightAccountVersion<TLightAccountType>>;\n\n/**\n * Get the light account version for the given light account and chain\n *\n * @deprecated don't use this function as this function is replaced with getLightAccountVersionDef.\n *\n * @param account - the light account to get the version for\n * @param chain - the chain to get the version for\n * @returns the light account version for the given light account and chain\n */\nexport async function getLightAccountVersion(\n account: LightAccountBase,\n chain: Chain = supportedChains[0]\n): Promise<LightAccountVersion> {\n return (await getLightAccountVersionDef(account, chain)).version;\n}\n"]}