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

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 (386) hide show
  1. package/dist/esm/plugindefs/multi-owner/config.js +2 -2
  2. package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
  3. package/dist/esm/plugindefs/multisig/config.js +2 -2
  4. package/dist/esm/plugindefs/multisig/config.js.map +1 -1
  5. package/dist/esm/plugindefs/session-key/config.js +2 -3
  6. package/dist/esm/plugindefs/session-key/config.js.map +1 -1
  7. package/dist/esm/src/index.d.ts +1 -1
  8. package/dist/esm/src/index.js +4 -1
  9. package/dist/esm/src/index.js.map +1 -1
  10. package/dist/esm/src/light-account/accounts/account.js +20 -0
  11. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  12. package/dist/esm/src/light-account/accounts/base.js +8 -0
  13. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  14. package/dist/esm/src/light-account/accounts/multiOwner.js +22 -0
  15. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  16. package/dist/esm/src/light-account/actions/transferOwnership.d.ts +25 -0
  17. package/dist/esm/src/light-account/actions/transferOwnership.js +25 -0
  18. package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
  19. package/dist/esm/src/light-account/actions/updateOwners.d.ts +24 -0
  20. package/dist/esm/src/light-account/actions/updateOwners.js +24 -0
  21. package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
  22. package/dist/esm/src/light-account/clients/alchemyClient.js +20 -0
  23. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  24. package/dist/esm/src/light-account/clients/client.d.ts +1 -2
  25. package/dist/esm/src/light-account/clients/client.js +23 -3
  26. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  27. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js +20 -0
  28. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  29. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  30. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +23 -3
  31. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  32. package/dist/esm/src/light-account/decorators/lightAccount.d.ts +19 -0
  33. package/dist/esm/src/light-account/decorators/lightAccount.js +19 -0
  34. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  35. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.d.ts +19 -0
  36. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js +19 -0
  37. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  38. package/dist/esm/src/light-account/types.d.ts +4 -0
  39. package/dist/esm/src/light-account/utils.d.ts +46 -0
  40. package/dist/esm/src/light-account/utils.js +46 -0
  41. package/dist/esm/src/light-account/utils.js.map +1 -1
  42. package/dist/esm/src/msca/account/multiOwnerAccount.js +23 -0
  43. package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
  44. package/dist/esm/src/msca/account/multisigAccount.js +24 -0
  45. package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
  46. package/dist/esm/src/msca/account-loupe/decorator.d.ts +15 -0
  47. package/dist/esm/src/msca/account-loupe/decorator.js +15 -0
  48. package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
  49. package/dist/esm/src/msca/client/alchemyClient.js +20 -0
  50. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  51. package/dist/esm/src/msca/client/client.d.ts +2 -6
  52. package/dist/esm/src/msca/client/client.js +50 -6
  53. package/dist/esm/src/msca/client/client.js.map +1 -1
  54. package/dist/esm/src/msca/client/multiSigAlchemyClient.js +22 -0
  55. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  56. package/dist/esm/src/msca/errors.d.ts +12 -0
  57. package/dist/esm/src/msca/errors.js +12 -0
  58. package/dist/esm/src/msca/errors.js.map +1 -1
  59. package/dist/esm/src/msca/plugin-manager/decorator.d.ts +15 -0
  60. package/dist/esm/src/msca/plugin-manager/decorator.js +15 -0
  61. package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
  62. package/dist/esm/src/msca/plugin-manager/installPlugin.d.ts +21 -0
  63. package/dist/esm/src/msca/plugin-manager/installPlugin.js +22 -0
  64. package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
  65. package/dist/esm/src/msca/plugins/multi-owner/extension.d.ts +15 -0
  66. package/dist/esm/src/msca/plugins/multi-owner/extension.js +19 -0
  67. package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
  68. package/dist/esm/src/msca/plugins/multi-owner/plugin.js.map +1 -1
  69. package/dist/esm/src/msca/plugins/multisig/actions/isOwnerOf.js +2 -0
  70. package/dist/esm/src/msca/plugins/multisig/actions/isOwnerOf.js.map +1 -1
  71. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js +2 -0
  72. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  73. package/dist/esm/src/msca/plugins/multisig/actions/readOwners.js +2 -0
  74. package/dist/esm/src/msca/plugins/multisig/actions/readOwners.js.map +1 -1
  75. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +3 -0
  76. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  77. package/dist/esm/src/msca/plugins/multisig/extension.d.ts +13 -0
  78. package/dist/esm/src/msca/plugins/multisig/extension.js +13 -0
  79. package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
  80. package/dist/esm/src/msca/plugins/multisig/middleware.d.ts +12 -0
  81. package/dist/esm/src/msca/plugins/multisig/middleware.js +15 -0
  82. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  83. package/dist/esm/src/msca/plugins/multisig/plugin.js.map +1 -1
  84. package/dist/esm/src/msca/plugins/multisig/signer.js +2 -0
  85. package/dist/esm/src/msca/plugins/multisig/signer.js.map +1 -1
  86. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.d.ts +25 -0
  87. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js +25 -0
  88. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
  89. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.d.ts +10 -0
  90. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js +11 -0
  91. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  92. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +19 -0
  93. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js +19 -0
  94. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  95. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +10 -0
  96. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js +20 -0
  97. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  98. package/dist/esm/src/msca/plugins/session-key/debug-session-key-bytecode.d.ts +7 -0
  99. package/dist/esm/src/msca/plugins/session-key/debug-session-key-bytecode.js +7 -0
  100. package/dist/esm/src/msca/plugins/session-key/debug-session-key-bytecode.js.map +1 -1
  101. package/dist/esm/src/msca/plugins/session-key/extension.d.ts +13 -0
  102. package/dist/esm/src/msca/plugins/session-key/extension.js +23 -0
  103. package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
  104. package/dist/esm/src/msca/plugins/session-key/permissions.d.ts +150 -1
  105. package/dist/esm/src/msca/plugins/session-key/permissions.js +150 -1
  106. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  107. package/dist/esm/src/msca/plugins/session-key/plugin.js.map +1 -1
  108. package/dist/esm/src/msca/plugins/session-key/signer.d.ts +80 -0
  109. package/dist/esm/src/msca/plugins/session-key/signer.js +80 -0
  110. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  111. package/dist/esm/src/msca/plugins/session-key/utils.d.ts +18 -0
  112. package/dist/esm/src/msca/plugins/session-key/utils.js +18 -0
  113. package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
  114. package/dist/esm/src/msca/utils.d.ts +50 -0
  115. package/dist/esm/src/msca/utils.js +50 -0
  116. package/dist/esm/src/msca/utils.js.map +1 -1
  117. package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
  118. package/dist/types/plugindefs/multisig/config.d.ts.map +1 -1
  119. package/dist/types/plugindefs/session-key/config.d.ts.map +1 -1
  120. package/dist/types/src/index.d.ts +1 -1
  121. package/dist/types/src/index.d.ts.map +1 -1
  122. package/dist/types/src/light-account/clients/client.d.ts +1 -2
  123. package/dist/types/src/light-account/clients/client.d.ts.map +1 -1
  124. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  125. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts.map +1 -1
  126. package/dist/types/src/msca/client/client.d.ts +2 -6
  127. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  128. package/dist/types/src/msca/plugins/multi-owner/plugin.d.ts.map +1 -1
  129. package/dist/types/src/msca/plugins/multisig/plugin.d.ts.map +1 -1
  130. package/dist/types/src/msca/plugins/session-key/plugin.d.ts.map +1 -1
  131. package/package.json +13 -14
  132. package/plugindefs/multi-owner/config.ts +4 -5
  133. package/plugindefs/multisig/config.ts +4 -5
  134. package/plugindefs/session-key/config.ts +4 -6
  135. package/src/index.ts +1 -0
  136. package/src/light-account/clients/client.ts +8 -13
  137. package/src/light-account/clients/multiOwnerLightAccount.ts +11 -13
  138. package/src/msca/client/client.ts +24 -36
  139. package/src/msca/plugins/multi-owner/plugin.ts +5 -1
  140. package/src/msca/plugins/multisig/plugin.ts +5 -1
  141. package/src/msca/plugins/session-key/plugin.ts +5 -1
  142. package/dist/cjs/package.json +0 -1
  143. package/dist/cjs/plugindefs/index.d.ts +0 -3
  144. package/dist/cjs/plugindefs/index.js +0 -10
  145. package/dist/cjs/plugindefs/index.js.map +0 -1
  146. package/dist/cjs/plugindefs/multi-owner/abi.d.ts +0 -698
  147. package/dist/cjs/plugindefs/multi-owner/abi.js +0 -612
  148. package/dist/cjs/plugindefs/multi-owner/abi.js.map +0 -1
  149. package/dist/cjs/plugindefs/multi-owner/config.d.ts +0 -2
  150. package/dist/cjs/plugindefs/multi-owner/config.js +0 -31
  151. package/dist/cjs/plugindefs/multi-owner/config.js.map +0 -1
  152. package/dist/cjs/plugindefs/multisig/abi.d.ts +0 -791
  153. package/dist/cjs/plugindefs/multisig/abi.js +0 -1031
  154. package/dist/cjs/plugindefs/multisig/abi.js.map +0 -1
  155. package/dist/cjs/plugindefs/multisig/config.d.ts +0 -2
  156. package/dist/cjs/plugindefs/multisig/config.js +0 -30
  157. package/dist/cjs/plugindefs/multisig/config.js.map +0 -1
  158. package/dist/cjs/plugindefs/session-key/abi.d.ts +0 -1061
  159. package/dist/cjs/plugindefs/session-key/abi.js +0 -916
  160. package/dist/cjs/plugindefs/session-key/abi.js.map +0 -1
  161. package/dist/cjs/plugindefs/session-key/config.d.ts +0 -2
  162. package/dist/cjs/plugindefs/session-key/config.js +0 -43
  163. package/dist/cjs/plugindefs/session-key/config.js.map +0 -1
  164. package/dist/cjs/plugindefs/types.d.ts +0 -15
  165. package/dist/cjs/plugindefs/types.js +0 -3
  166. package/dist/cjs/plugindefs/types.js.map +0 -1
  167. package/dist/cjs/src/index.d.ts +0 -53
  168. package/dist/cjs/src/index.js +0 -105
  169. package/dist/cjs/src/index.js.map +0 -1
  170. package/dist/cjs/src/light-account/abis/LightAccountAbi_v1.d.ts +0 -532
  171. package/dist/cjs/src/light-account/abis/LightAccountAbi_v1.js +0 -382
  172. package/dist/cjs/src/light-account/abis/LightAccountAbi_v1.js.map +0 -1
  173. package/dist/cjs/src/light-account/abis/LightAccountAbi_v2.d.ts +0 -491
  174. package/dist/cjs/src/light-account/abis/LightAccountAbi_v2.js +0 -358
  175. package/dist/cjs/src/light-account/abis/LightAccountAbi_v2.js.map +0 -1
  176. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v1.d.ts +0 -55
  177. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v1.js +0 -78
  178. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v1.js.map +0 -1
  179. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v2.d.ts +0 -256
  180. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v2.js +0 -213
  181. package/dist/cjs/src/light-account/abis/LightAccountFactoryAbi_v2.js.map +0 -1
  182. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountAbi.d.ts +0 -507
  183. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountAbi.js +0 -375
  184. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountAbi.js.map +0 -1
  185. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.d.ts +0 -286
  186. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.js +0 -232
  187. package/dist/cjs/src/light-account/abis/MultiOwnerLightAccountFactoryAbi.js.map +0 -1
  188. package/dist/cjs/src/light-account/accounts/account.d.ts +0 -17
  189. package/dist/cjs/src/light-account/accounts/account.js +0 -79
  190. package/dist/cjs/src/light-account/accounts/account.js.map +0 -1
  191. package/dist/cjs/src/light-account/accounts/base.d.ts +0 -15
  192. package/dist/cjs/src/light-account/accounts/base.js +0 -143
  193. package/dist/cjs/src/light-account/accounts/base.js.map +0 -1
  194. package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +0 -18
  195. package/dist/cjs/src/light-account/accounts/multiOwner.js +0 -80
  196. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +0 -1
  197. package/dist/cjs/src/light-account/actions/transferOwnership.d.ts +0 -8
  198. package/dist/cjs/src/light-account/actions/transferOwnership.js +0 -28
  199. package/dist/cjs/src/light-account/actions/transferOwnership.js.map +0 -1
  200. package/dist/cjs/src/light-account/actions/updateOwners.d.ts +0 -9
  201. package/dist/cjs/src/light-account/actions/updateOwners.js +0 -27
  202. package/dist/cjs/src/light-account/actions/updateOwners.js.map +0 -1
  203. package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +0 -6
  204. package/dist/cjs/src/light-account/clients/alchemyClient.js +0 -25
  205. package/dist/cjs/src/light-account/clients/alchemyClient.js.map +0 -1
  206. package/dist/cjs/src/light-account/clients/client.d.ts +0 -10
  207. package/dist/cjs/src/light-account/clients/client.js +0 -22
  208. package/dist/cjs/src/light-account/clients/client.js.map +0 -1
  209. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +0 -6
  210. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js +0 -25
  211. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +0 -1
  212. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.d.ts +0 -10
  213. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +0 -22
  214. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +0 -1
  215. package/dist/cjs/src/light-account/decorators/lightAccount.d.ts +0 -8
  216. package/dist/cjs/src/light-account/decorators/lightAccount.js +0 -9
  217. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +0 -1
  218. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.d.ts +0 -8
  219. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js +0 -9
  220. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +0 -1
  221. package/dist/cjs/src/light-account/e2e-tests/constants.d.ts +0 -6
  222. package/dist/cjs/src/light-account/e2e-tests/constants.js +0 -10
  223. package/dist/cjs/src/light-account/e2e-tests/constants.js.map +0 -1
  224. package/dist/cjs/src/light-account/types.d.ts +0 -31
  225. package/dist/cjs/src/light-account/types.js +0 -3
  226. package/dist/cjs/src/light-account/types.js.map +0 -1
  227. package/dist/cjs/src/light-account/utils.d.ts +0 -10
  228. package/dist/cjs/src/light-account/utils.js +0 -108
  229. package/dist/cjs/src/light-account/utils.js.map +0 -1
  230. package/dist/cjs/src/msca/abis/IAccountLoupe.d.ts +0 -79
  231. package/dist/cjs/src/msca/abis/IAccountLoupe.js +0 -82
  232. package/dist/cjs/src/msca/abis/IAccountLoupe.js.map +0 -1
  233. package/dist/cjs/src/msca/abis/IPlugin.d.ts +0 -474
  234. package/dist/cjs/src/msca/abis/IPlugin.js +0 -400
  235. package/dist/cjs/src/msca/abis/IPlugin.js.map +0 -1
  236. package/dist/cjs/src/msca/abis/IPluginManager.d.ts +0 -101
  237. package/dist/cjs/src/msca/abis/IPluginManager.js +0 -109
  238. package/dist/cjs/src/msca/abis/IPluginManager.js.map +0 -1
  239. package/dist/cjs/src/msca/abis/IStandardExecutor.d.ts +0 -50
  240. package/dist/cjs/src/msca/abis/IStandardExecutor.js +0 -35
  241. package/dist/cjs/src/msca/abis/IStandardExecutor.js.map +0 -1
  242. package/dist/cjs/src/msca/abis/MultiOwnerModularAccountFactory.d.ts +0 -234
  243. package/dist/cjs/src/msca/abis/MultiOwnerModularAccountFactory.js +0 -194
  244. package/dist/cjs/src/msca/abis/MultiOwnerModularAccountFactory.js.map +0 -1
  245. package/dist/cjs/src/msca/abis/MultisigModularAccountFactory.d.ts +0 -246
  246. package/dist/cjs/src/msca/abis/MultisigModularAccountFactory.js +0 -320
  247. package/dist/cjs/src/msca/abis/MultisigModularAccountFactory.js.map +0 -1
  248. package/dist/cjs/src/msca/abis/UpgradeableModularAccount.d.ts +0 -880
  249. package/dist/cjs/src/msca/abis/UpgradeableModularAccount.js +0 -649
  250. package/dist/cjs/src/msca/abis/UpgradeableModularAccount.js.map +0 -1
  251. package/dist/cjs/src/msca/account/multiOwnerAccount.d.ts +0 -12
  252. package/dist/cjs/src/msca/account/multiOwnerAccount.js +0 -60
  253. package/dist/cjs/src/msca/account/multiOwnerAccount.js.map +0 -1
  254. package/dist/cjs/src/msca/account/multisigAccount.d.ts +0 -17
  255. package/dist/cjs/src/msca/account/multisigAccount.js +0 -71
  256. package/dist/cjs/src/msca/account/multisigAccount.js.map +0 -1
  257. package/dist/cjs/src/msca/account/standardExecutor.d.ts +0 -2
  258. package/dist/cjs/src/msca/account/standardExecutor.js +0 -28
  259. package/dist/cjs/src/msca/account/standardExecutor.js.map +0 -1
  260. package/dist/cjs/src/msca/account-loupe/decorator.d.ts +0 -16
  261. package/dist/cjs/src/msca/account-loupe/decorator.js +0 -66
  262. package/dist/cjs/src/msca/account-loupe/decorator.js.map +0 -1
  263. package/dist/cjs/src/msca/account-loupe/types.d.ts +0 -16
  264. package/dist/cjs/src/msca/account-loupe/types.js +0 -3
  265. package/dist/cjs/src/msca/account-loupe/types.js.map +0 -1
  266. package/dist/cjs/src/msca/client/alchemyClient.d.ts +0 -6
  267. package/dist/cjs/src/msca/client/alchemyClient.js +0 -28
  268. package/dist/cjs/src/msca/client/alchemyClient.js.map +0 -1
  269. package/dist/cjs/src/msca/client/client.d.ts +0 -17
  270. package/dist/cjs/src/msca/client/client.js +0 -49
  271. package/dist/cjs/src/msca/client/client.js.map +0 -1
  272. package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +0 -6
  273. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +0 -31
  274. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +0 -1
  275. package/dist/cjs/src/msca/e2e-tests/constants.d.ts +0 -3
  276. package/dist/cjs/src/msca/e2e-tests/constants.js +0 -7
  277. package/dist/cjs/src/msca/e2e-tests/constants.js.map +0 -1
  278. package/dist/cjs/src/msca/errors.d.ts +0 -17
  279. package/dist/cjs/src/msca/errors.js +0 -53
  280. package/dist/cjs/src/msca/errors.js.map +0 -1
  281. package/dist/cjs/src/msca/plugin-manager/decorator.d.ts +0 -11
  282. package/dist/cjs/src/msca/plugin-manager/decorator.js +0 -13
  283. package/dist/cjs/src/msca/plugin-manager/decorator.js.map +0 -1
  284. package/dist/cjs/src/msca/plugin-manager/installPlugin.d.ts +0 -11
  285. package/dist/cjs/src/msca/plugin-manager/installPlugin.js +0 -48
  286. package/dist/cjs/src/msca/plugin-manager/installPlugin.js.map +0 -1
  287. package/dist/cjs/src/msca/plugin-manager/uninstallPlugin.d.ts +0 -9
  288. package/dist/cjs/src/msca/plugin-manager/uninstallPlugin.js +0 -35
  289. package/dist/cjs/src/msca/plugin-manager/uninstallPlugin.js.map +0 -1
  290. package/dist/cjs/src/msca/plugins/multi-owner/extension.d.ts +0 -13
  291. package/dist/cjs/src/msca/plugins/multi-owner/extension.js +0 -26
  292. package/dist/cjs/src/msca/plugins/multi-owner/extension.js.map +0 -1
  293. package/dist/cjs/src/msca/plugins/multi-owner/index.d.ts +0 -3
  294. package/dist/cjs/src/msca/plugins/multi-owner/index.js +0 -10
  295. package/dist/cjs/src/msca/plugins/multi-owner/index.js.map +0 -1
  296. package/dist/cjs/src/msca/plugins/multi-owner/plugin.d.ts +0 -793
  297. package/dist/cjs/src/msca/plugins/multi-owner/plugin.js +0 -695
  298. package/dist/cjs/src/msca/plugins/multi-owner/plugin.js.map +0 -1
  299. package/dist/cjs/src/msca/plugins/multi-owner/signer.d.ts +0 -215
  300. package/dist/cjs/src/msca/plugins/multi-owner/signer.js +0 -47
  301. package/dist/cjs/src/msca/plugins/multi-owner/signer.js.map +0 -1
  302. package/dist/cjs/src/msca/plugins/multisig/actions/getThreshold.d.ts +0 -4
  303. package/dist/cjs/src/msca/plugins/multisig/actions/getThreshold.js +0 -20
  304. package/dist/cjs/src/msca/plugins/multisig/actions/getThreshold.js.map +0 -1
  305. package/dist/cjs/src/msca/plugins/multisig/actions/isOwnerOf.d.ts +0 -6
  306. package/dist/cjs/src/msca/plugins/multisig/actions/isOwnerOf.js +0 -15
  307. package/dist/cjs/src/msca/plugins/multisig/actions/isOwnerOf.js.map +0 -1
  308. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts +0 -4
  309. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js +0 -47
  310. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +0 -1
  311. package/dist/cjs/src/msca/plugins/multisig/actions/readOwners.d.ts +0 -4
  312. package/dist/cjs/src/msca/plugins/multisig/actions/readOwners.js +0 -15
  313. package/dist/cjs/src/msca/plugins/multisig/actions/readOwners.js.map +0 -1
  314. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.d.ts +0 -4
  315. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +0 -54
  316. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +0 -1
  317. package/dist/cjs/src/msca/plugins/multisig/extension.d.ts +0 -17
  318. package/dist/cjs/src/msca/plugins/multisig/extension.js +0 -19
  319. package/dist/cjs/src/msca/plugins/multisig/extension.js.map +0 -1
  320. package/dist/cjs/src/msca/plugins/multisig/index.d.ts +0 -5
  321. package/dist/cjs/src/msca/plugins/multisig/index.js +0 -12
  322. package/dist/cjs/src/msca/plugins/multisig/index.js.map +0 -1
  323. package/dist/cjs/src/msca/plugins/multisig/middleware.d.ts +0 -3
  324. package/dist/cjs/src/msca/plugins/multisig/middleware.js +0 -97
  325. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +0 -1
  326. package/dist/cjs/src/msca/plugins/multisig/plugin.d.ts +0 -892
  327. package/dist/cjs/src/msca/plugins/multisig/plugin.js +0 -740
  328. package/dist/cjs/src/msca/plugins/multisig/plugin.js.map +0 -1
  329. package/dist/cjs/src/msca/plugins/multisig/signer.d.ts +0 -223
  330. package/dist/cjs/src/msca/plugins/multisig/signer.js +0 -57
  331. package/dist/cjs/src/msca/plugins/multisig/signer.js.map +0 -1
  332. package/dist/cjs/src/msca/plugins/multisig/types.d.ts +0 -34
  333. package/dist/cjs/src/msca/plugins/multisig/types.js +0 -3
  334. package/dist/cjs/src/msca/plugins/multisig/types.js.map +0 -1
  335. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.d.ts +0 -10
  336. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js +0 -15
  337. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js.map +0 -1
  338. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.d.ts +0 -2
  339. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js +0 -42
  340. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +0 -1
  341. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.d.ts +0 -10
  342. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js +0 -13
  343. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js.map +0 -1
  344. package/dist/cjs/src/msca/plugins/multisig/utils/index.d.ts +0 -8
  345. package/dist/cjs/src/msca/plugins/multisig/utils/index.js +0 -12
  346. package/dist/cjs/src/msca/plugins/multisig/utils/index.js.map +0 -1
  347. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +0 -16
  348. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js +0 -74
  349. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +0 -1
  350. package/dist/cjs/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.d.ts +0 -117
  351. package/dist/cjs/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.js +0 -115
  352. package/dist/cjs/src/msca/plugins/session-key/SessionKeyPermissionsUpdatesAbi.js.map +0 -1
  353. package/dist/cjs/src/msca/plugins/session-key/debug-session-key-bytecode.d.ts +0 -1
  354. package/dist/cjs/src/msca/plugins/session-key/debug-session-key-bytecode.js +0 -5
  355. package/dist/cjs/src/msca/plugins/session-key/debug-session-key-bytecode.js.map +0 -1
  356. package/dist/cjs/src/msca/plugins/session-key/extension.d.ts +0 -30
  357. package/dist/cjs/src/msca/plugins/session-key/extension.js +0 -156
  358. package/dist/cjs/src/msca/plugins/session-key/extension.js.map +0 -1
  359. package/dist/cjs/src/msca/plugins/session-key/index.d.ts +0 -3
  360. package/dist/cjs/src/msca/plugins/session-key/index.js +0 -10
  361. package/dist/cjs/src/msca/plugins/session-key/index.js.map +0 -1
  362. package/dist/cjs/src/msca/plugins/session-key/permissions.d.ts +0 -53
  363. package/dist/cjs/src/msca/plugins/session-key/permissions.js +0 -153
  364. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +0 -1
  365. package/dist/cjs/src/msca/plugins/session-key/plugin.d.ts +0 -1200
  366. package/dist/cjs/src/msca/plugins/session-key/plugin.js +0 -1044
  367. package/dist/cjs/src/msca/plugins/session-key/plugin.js.map +0 -1
  368. package/dist/cjs/src/msca/plugins/session-key/signer.d.ts +0 -233
  369. package/dist/cjs/src/msca/plugins/session-key/signer.js +0 -101
  370. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +0 -1
  371. package/dist/cjs/src/msca/plugins/session-key/utils.d.ts +0 -11
  372. package/dist/cjs/src/msca/plugins/session-key/utils.js +0 -22
  373. package/dist/cjs/src/msca/plugins/session-key/utils.js.map +0 -1
  374. package/dist/cjs/src/msca/plugins/types.d.ts +0 -12
  375. package/dist/cjs/src/msca/plugins/types.js +0 -3
  376. package/dist/cjs/src/msca/plugins/types.js.map +0 -1
  377. package/dist/cjs/src/msca/utils.d.ts +0 -17
  378. package/dist/cjs/src/msca/utils.js +0 -99
  379. package/dist/cjs/src/msca/utils.js.map +0 -1
  380. package/dist/esm/package.json +0 -1
  381. package/dist/esm/src/light-account/e2e-tests/constants.d.ts +0 -6
  382. package/dist/esm/src/light-account/e2e-tests/constants.js +0 -7
  383. package/dist/esm/src/light-account/e2e-tests/constants.js.map +0 -1
  384. package/dist/types/src/light-account/e2e-tests/constants.d.ts +0 -7
  385. package/dist/types/src/light-account/e2e-tests/constants.d.ts.map +0 -1
  386. package/src/light-account/e2e-tests/constants.ts +0 -8
@@ -1,5 +1,5 @@
1
- import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "@account-kit/infra";
2
1
  import { parseAbiParameters } from "viem";
2
+ import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "viem/chains";
3
3
  import { MultiOwnerPluginAbi } from "./abi.js";
4
4
  export const MultiOwnerPluginGenConfig = {
5
5
  name: "MultiOwnerPlugin",
@@ -16,7 +16,7 @@ export const MultiOwnerPluginGenConfig = {
16
16
  [arbitrumSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
17
17
  [base.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
18
18
  [fraxtal.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
19
- [fraxtalSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
19
+ 2523: "0xcE0000007B008F50d762D155002600004cD6c647",
20
20
  [zora.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
21
21
  [zoraSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
22
22
  [mainnet.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,WAAW,CAAC;KAC/C;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginAbi } from \"./abi.js\";\n\nexport const MultiOwnerPluginGenConfig: PluginConfig = {\n name: \"MultiOwnerPlugin\",\n abi: MultiOwnerPluginAbi,\n addresses: {\n [sepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [baseSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygon.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonAmoy.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonMumbai.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimism.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimismSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrum.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrumSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [base.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtal.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtalSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zora.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zoraSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [mainnet.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[]\"),\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,IAAI,EAAE,4CAA4C;QAClD,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,WAAW,CAAC;KAC/C;CACF,CAAC","sourcesContent":["import type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"viem/chains\";\nimport { MultiOwnerPluginAbi } from \"./abi.js\";\n\nexport const MultiOwnerPluginGenConfig: PluginConfig = {\n name: \"MultiOwnerPlugin\",\n abi: MultiOwnerPluginAbi,\n addresses: {\n [sepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [baseSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygon.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonAmoy.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonMumbai.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimism.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimismSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrum.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrumSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [base.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtal.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n 2523: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zora.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zoraSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [mainnet.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[]\"),\n },\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, zora, zoraSepolia, } from "@account-kit/infra";
2
1
  import { parseAbiParameters } from "viem";
2
+ import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, zora, zoraSepolia, } from "viem/chains";
3
3
  import { MultisigPluginAbi } from "./abi.js";
4
4
  export const MultisigPluginGenConfig = {
5
5
  name: "MultisigPlugin",
@@ -16,7 +16,7 @@ export const MultisigPluginGenConfig = {
16
16
  [arbitrumSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
17
17
  [base.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
18
18
  [fraxtal.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
19
- [fraxtalSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
19
+ 2523: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
20
20
  [zora.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
21
21
  [zoraSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
22
22
  },
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multisig/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,iBAAiB;IACtB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;KACrD;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultisigPluginAbi } from \"./abi.js\";\n\nexport const MultisigPluginGenConfig: PluginConfig = {\n name: \"MultisigPlugin\",\n abi: MultisigPluginAbi,\n addresses: {\n [sepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [baseSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygon.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [mainnet.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygonAmoy.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimism.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimismSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrum.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrumSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [base.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtal.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtalSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zora.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zoraSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[], uint\"),\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multisig/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,iBAAiB;IACtB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,IAAI,EAAE,4CAA4C;QAClD,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;KACrD;CACF,CAAC","sourcesContent":["import type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n zora,\n zoraSepolia,\n} from \"viem/chains\";\nimport { MultisigPluginAbi } from \"./abi.js\";\n\nexport const MultisigPluginGenConfig: PluginConfig = {\n name: \"MultisigPlugin\",\n abi: MultisigPluginAbi,\n addresses: {\n [sepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [baseSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygon.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [mainnet.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygonAmoy.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimism.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimismSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrum.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrumSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [base.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtal.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n 2523: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zora.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zoraSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[], uint\"),\n },\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "@account-kit/infra";
2
1
  import { parseAbiParameters } from "viem";
2
+ import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "viem/chains";
3
3
  import { MultiOwnerPluginGenConfig } from "../multi-owner/config.js";
4
4
  import { SessionKeyPluginAbi } from "./abi.js";
5
5
  export const SessionKeyPluginGenConfig = {
@@ -16,9 +16,8 @@ export const SessionKeyPluginGenConfig = {
16
16
  [arbitrum.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
17
17
  [arbitrumSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
18
18
  [base.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
19
- [baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
20
19
  [fraxtal.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
21
- [fraxtalSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
20
+ 2523: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
22
21
  [zora.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
23
22
  [zoraSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
24
23
  [mainnet.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["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vD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAC/B,qEAAqE,CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginGenConfig } from \"../multi-owner/config.js\";\nimport { SessionKeyPluginAbi } from \"./abi.js\";\n\nexport const SessionKeyPluginGenConfig: PluginConfig = {\n name: \"SessionKeyPlugin\",\n abi: SessionKeyPluginAbi,\n addresses: {\n [sepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygon.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonAmoy.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonMumbai.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimism.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimismSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrum.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrumSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [base.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtal.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtalSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zora.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zoraSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [mainnet.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\n \"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions\"\n ),\n dependencies: [\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x0\",\n },\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x1\",\n },\n ],\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/session-key/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,IAAI,EAAE,4CAA4C;QAClD,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAC/B,qEAAqE,CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["import type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"viem/chains\";\nimport { MultiOwnerPluginGenConfig } from \"../multi-owner/config.js\";\nimport { SessionKeyPluginAbi } from \"./abi.js\";\n\nexport const SessionKeyPluginGenConfig: PluginConfig = {\n name: \"SessionKeyPlugin\",\n abi: SessionKeyPluginAbi,\n addresses: {\n [sepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygon.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonAmoy.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonMumbai.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimism.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimismSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrum.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrumSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [base.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtal.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n 2523: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zora.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zoraSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [mainnet.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\n \"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions\"\n ),\n dependencies: [\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x0\",\n },\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x1\",\n },\n ],\n },\n};\n"]}
@@ -7,7 +7,7 @@ export { createMultiOwnerLightAccountAlchemyClient, type AlchemyMultiOwnerLightA
7
7
  export type * from "./light-account/decorators/lightAccount.js";
8
8
  export { lightAccountClientActions } from "./light-account/decorators/lightAccount.js";
9
9
  export type * from "./light-account/types.js";
10
- export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
10
+ export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getDefaultMultiOwnerLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
11
11
  export type * from "./light-account/accounts/multiOwner.js";
12
12
  export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
13
13
  export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
@@ -1,14 +1,17 @@
1
+ // Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them
2
+ // Don't use wildcard exports, instead use named exports
1
3
  export { createLightAccount } from "./light-account/accounts/account.js";
2
4
  export { transferOwnership as transferLightAccountOwnership } from "./light-account/actions/transferOwnership.js";
3
5
  export { createLightAccountAlchemyClient, } from "./light-account/clients/alchemyClient.js";
4
6
  export { createLightAccountClient } from "./light-account/clients/client.js";
5
7
  export { createMultiOwnerLightAccountAlchemyClient, } from "./light-account/clients/multiOwnerAlchemyClient.js";
6
8
  export { lightAccountClientActions } from "./light-account/decorators/lightAccount.js";
7
- export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
9
+ export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getDefaultMultiOwnerLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
8
10
  export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
9
11
  export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
10
12
  export { createMultiOwnerLightAccountClient } from "./light-account/clients/multiOwnerLightAccount.js";
11
13
  export { multiOwnerLightAccountClientActions } from "./light-account/decorators/multiOwnerLightAccount.js";
14
+ // msca exports
12
15
  export { IAccountLoupeAbi } from "./msca/abis/IAccountLoupe.js";
13
16
  export { IPluginAbi } from "./msca/abis/IPlugin.js";
14
17
  export { IPluginManagerAbi } from "./msca/abis/IPluginManager.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,IAAI,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClH,OAAO,EACL,+BAA+B,GAEhC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACL,yCAAyC,GAE1C,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,gCAAgC,EAChC,0BAA0B,EAC1B,oCAAoC,EACpC,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,YAAY,IAAI,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7G,OAAO,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAEvG,OAAO,EAAE,mCAAmC,EAAE,MAAM,sDAAsD,CAAC;AAG3G,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,kCAAkC,EAAE,MAAM,gD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AAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACL,gDAAgD,EAChD,8CAA8C,EAC9C,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC","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 getLightAccountVersionForAccount,\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,uHAAuH;AACvH,wDAAwD;AAIxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,IAAI,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClH,OAAO,EACL,+BAA+B,GAEhC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACL,yCAAyC,GAE1C,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF,OAAO,EACL,sBAAsB,EACt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AAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kCAAkC,EAClC,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGlF,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACL,gDAAgD,EAChD,8CAA8C,EAC9C,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC","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 getDefaultMultiOwnerLightAccountFactoryAddress,\n getLightAccountVersionForAccount,\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"]}
@@ -6,6 +6,26 @@ import { LightAccountFactoryAbi_v1 } from "../abis/LightAccountFactoryAbi_v1.js"
6
6
  import { LightAccountFactoryAbi_v2 } from "../abis/LightAccountFactoryAbi_v2.js";
7
7
  import { AccountVersionRegistry, LightAccountUnsupported1271Factories, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, } from "../utils.js";
8
8
  import { createLightAccountBase, } from "./base.js";
9
+ /**
10
+ * 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.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { createLightAccount } from "@account-kit/smart-contracts";
15
+ * import { LocalAccountSigner } from "@aa-sdk/core";
16
+ * import { sepolia } from "viem/chains";
17
+ * import { http, generatePrivateKey } from "viem"
18
+ *
19
+ * const account = await createLightAccount({
20
+ * chain: sepolia,
21
+ * transport: http("RPC_URL"),
22
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
23
+ * });
24
+ * ```
25
+ *
26
+ * @param {CreateLightAccountParams} config The parameters for creating a light account
27
+ * @returns {Promise<LightAccount>} A promise that resolves to a `LightAccount` object containing the created account information and methods
28
+ */
9
29
  export async function createLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion(), entryPoint = getEntryPoint(chain, {
10
30
  version: AccountVersionRegistry["LightAccount"][version]
11
31
  .entryPointVersion,
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAId,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,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,EAAE;YACJ,CAAC,CAAC,KAAK,CAAC;QAEV,OAAO,SAAS,CAAC;YACf,cAAc;YACd,kBAAkB,CAAC;gBACjB,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC;aACxC,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,iBAAiB,CAAC;QACtC,MAAM;QACN,UAAU;QACV,cAAc;QACd,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,sBAAsB,CAK1C;QACA,SAAS;QACT,KAAK;QACL,MAAM;QACN,GAAG,EAAE,UAAU;QACf,IAAI,EAAE,cAAc;QACpB,OAAO;QACP,UAAU;QACV,cAAc,EAAE,OAAO;QACvB,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QAEV,uBAAuB,EAAE,CAAC,QAAiB,EAAE,EAAE;YAC7C,OAAO,kBAAkB,CAAC;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","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 LightAccountEntryPointVersion,\n LightAccountVersion,\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 LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = LightAccountBase<TSigner, \"LightAccount\", TLightAccountVersion> & {\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 LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"LightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\"LightAccount\", TLightAccountVersion>,\n Chain\n >;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"LightAccount\"> = \"v2.0.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\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(),\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 \"LightAccount\",\n LightAccountVersion<\"LightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n type: \"LightAccount\",\n 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,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAId,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,GAInB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAKjF,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AAiDnB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,EAAE,EACtC,UAAU,G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AO;QACvB,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QAEV,uBAAuB,EAAE,CAAC,QAAiB,EAAE,EAAE;YAC7C,OAAO,kBAAkB,CAAC;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","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 LightAccountEntryPointVersion,\n LightAccountVersion,\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 LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = LightAccountBase<TSigner, \"LightAccount\", TLightAccountVersion> & {\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 LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"LightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\"LightAccount\", TLightAccountVersion>,\n Chain\n >;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"LightAccount\"> = \"v2.0.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\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(),\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 \"LightAccount\",\n LightAccountVersion<\"LightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n type: \"LightAccount\",\n 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"]}
@@ -7,6 +7,7 @@ var SignatureType;
7
7
  SignatureType["CONTRACT"] = "0x01";
8
8
  SignatureType["CONTRACT_WITH_ADDR"] = "0x02";
9
9
  })(SignatureType || (SignatureType = {}));
10
+ //#endregion CreateLightAccountBaseParams
10
11
  export async function createLightAccountBase({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }) {
11
12
  const client = createBundlerClient({
12
13
  transport,
@@ -15,12 +16,14 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
15
16
  const encodeUpgradeToAndCall = async ({ upgradeToAddress, upgradeToInitData, }) => {
16
17
  const storage = await client.getStorageAt({
17
18
  address: accountAddress,
19
+ // the slot at which impl addresses are stored by UUPS
18
20
  slot: "0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc",
19
21
  });
20
22
  if (storage == null) {
21
23
  throw new FailedToGetStorageSlotError("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "Proxy Implementation Address");
22
24
  }
23
25
  const implementationAddresses = Object.values(AccountVersionRegistry[type]).map((x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl);
26
+ // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise
24
27
  if (fromHex(storage, "number") !== 0 &&
25
28
  !implementationAddresses.some((x) => x === trim(storage))) {
26
29
  throw new Error(`could not determine if smart account implementation is ${type} ${String(version)}`);
@@ -33,6 +36,8 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
33
36
  };
34
37
  const signWith1271WrapperV1 = async (hashedMessage) => {
35
38
  return signer.signTypedData({
39
+ // EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)
40
+ // https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L236
36
41
  domain: {
37
42
  chainId: Number(client.chain.id),
38
43
  name: type,
@@ -79,6 +84,7 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
79
84
  const signature = await signer.signMessage({ raw: uoHash });
80
85
  switch (version) {
81
86
  case "v2.0.0":
87
+ // TODO: handle case where signer is an SCA.
82
88
  return concat([SignatureType.EOA, signature]);
83
89
  default:
84
90
  return signature;
@@ -94,6 +100,7 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
94
100
  return signWith1271WrapperV1(hashMessage(message));
95
101
  case "v2.0.0":
96
102
  const signature = await signWith1271WrapperV1(hashMessage(message));
103
+ // TODO: handle case where signer is an SCA.
97
104
  return concat([SignatureType.EOA, signature]);
98
105
  default:
99
106
  throw new Error(`Unknown version ${type} of ${String(version)}`);
@@ -109,6 +116,7 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
109
116
  return signWith1271WrapperV1(hashTypedData(params));
110
117
  case "v2.0.0":
111
118
  const signature = await signWith1271WrapperV1(hashTypedData(params));
119
+ // TODO: handle case where signer is an SCA.
112
120
  return concat([SignatureType.EOA, signature]);
113
121
  default:
114
122
  throw new Error(`Unknown version ${String(version)} of LightAccount`);
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GAOvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,GAML,MAAM,MAAM,CAAC;AAMd,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAoCD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAK1C,EACA,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,cAAc,EACd,kBAAkB,GAMnB;IAGC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;K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,CACzB,MAA4C,CAC7C,CAAC;gBACJ,KAAK,QAAQ;oBACX,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,CAAC,OAAO,CAAC,uCAAuC,CAClE,CAAC;gBACJ,KAAK,QAAQ;oBACX,OAAO,qBAAqB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;gBACtD,KAAK,QAAQ;oBACX,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBAErE,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QACD,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,SAAS,GACb,sIAAsI,CAAC;YACzI,QAAQ,OAAiB,EAAE,CAAC;gBAC1B,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QACD,sBAAsB;KACvB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QACV,MAAM,EAAE,IAAI;QACZ,sBAAsB,EAAE,GAAG,EAAE,CAAC,OAAO;QACrC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n FailedToGetStorageSlotError,\n createBundlerClient,\n toSmartContractAccount,\n type Abi,\n type EntryPointDef,\n type SmartAccountSigner,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n type UpgradeToAndCallParams,\n} from \"@aa-sdk/core\";\nimport {\n concat,\n encodeFunctionData,\n fromHex,\n hashMessage,\n hashTypedData,\n trim,\n type Address,\n type Chain,\n type Hex,\n type SignTypedDataParameters,\n type Transport,\n} from \"viem\";\nimport type {\n LightAccountEntryPointVersion,\n LightAccountType,\n LightAccountVersion,\n} from \"../types.js\";\nimport { AccountVersionRegistry } from \"../utils.js\";\n\nenum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n CONTRACT_WITH_ADDR = \"0x02\",\n}\n\nexport type LightAccountBase<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>\n> = SmartContractAccountWithSigner<\n TLightAccountType,\n TSigner,\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>\n> & {\n getLightAccountVersion: () => TLightAccountVersion;\n};\n\n//#region CreateLightAccountBaseParams\nexport type CreateLightAccountBaseParams<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Pick<\n ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>,\n \"transport\" | \"chain\" | \"getAccountInitCode\"\n> & {\n abi: Abi;\n signer: TSigner;\n accountAddress: Address;\n type: TLightAccountType;\n version: TLightAccountVersion;\n entryPoint: EntryPointDef<\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>,\n Chain\n >;\n};\n//#endregion CreateLightAccountBaseParams\n\nexport async function createLightAccountBase<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>({\n transport,\n chain,\n signer,\n abi,\n version,\n type,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: CreateLightAccountBaseParams<\n TLightAccountType,\n TLightAccountVersion,\n TTransport,\n TSigner\n>): Promise<\n LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>\n> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const encodeUpgradeToAndCall = async ({\n upgradeToAddress,\n upgradeToInitData,\n }: UpgradeToAndCallParams): Promise<Hex> => {\n const storage = await client.getStorageAt({\n address: accountAddress,\n // the slot at which impl addresses are stored by UUPS\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n const implementationAddresses = Object.values(\n AccountVersionRegistry[type]\n ).map(\n (x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl\n );\n\n // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise\n if (\n fromHex(storage, \"number\") !== 0 &&\n !implementationAddresses.some((x) => x === trim(storage))\n ) {\n throw new Error(\n `could not determine if smart account implementation is ${type} ${String(\n version\n )}`\n );\n }\n\n return encodeFunctionData({\n abi,\n functionName: \"upgradeToAndCall\",\n args: [upgradeToAddress, upgradeToInitData],\n });\n };\n\n const signWith1271WrapperV1 = async (hashedMessage: Hex): Promise<Hex> => {\n return signer.signTypedData({\n // EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\n // https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L236\n domain: {\n chainId: Number(client.chain.id),\n name: type,\n verifyingContract: accountAddress,\n version: \"1\",\n },\n types: {\n LightAccountMessage: [{ name: \"message\", type: \"bytes\" }],\n },\n message: {\n message: hashedMessage,\n },\n primaryType: \"LightAccountMessage\",\n });\n };\n\n const account = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: type,\n getAccountInitCode,\n encodeExecute: async ({ target, data, value }) => {\n return encodeFunctionData({\n abi,\n functionName: \"execute\",\n args: [target, value ?? 0n, data],\n });\n },\n encodeBatchExecute: async (txs) => {\n const [targets, values, datas] = txs.reduce(\n (accum, curr) => {\n accum[0].push(curr.target);\n accum[1].push(curr.value ?? 0n);\n accum[2].push(curr.data);\n\n return accum;\n },\n [[], [], []] as [Address[], bigint[], Hex[]]\n );\n return encodeFunctionData({\n abi,\n functionName: \"executeBatch\",\n args: [targets, values, datas],\n });\n },\n signUserOperationHash: async (uoHash: Hex) => {\n const signature = await signer.signMessage({ raw: uoHash });\n switch (version) {\n case \"v2.0.0\":\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n return signature;\n }\n },\n async signMessage({ message }) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signMessage(message);\n case \"v1.0.2\":\n throw new Error(`${type} ${String(version)} doesn't support 1271`);\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashMessage(message));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashMessage(message));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n async signTypedData(params) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signTypedData(\n params as unknown as SignTypedDataParameters\n );\n case \"v1.0.2\":\n throw new Error(\n `Version ${String(version)} of LightAccount doesn't support 1271`\n );\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashTypedData(params));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashTypedData(params));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${String(version)} of LightAccount`);\n }\n },\n getDummySignature: (): Hex => {\n const signature =\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n switch (version as string) {\n case \"v1.0.1\":\n case \"v1.0.2\":\n case \"v1.1.0\":\n return signature;\n case \"v2.0.0\":\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n encodeUpgradeToAndCall,\n });\n\n return {\n ...account,\n source: type,\n getLightAccountVersion: () => version,\n getSigner: () => signer,\n };\n}\n"]}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GAOvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,GAML,MAAM,MAAM,CAAC;AAMd,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAkCD,yCAAyC;AAEzC,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAK1C,EACA,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,cAAc,EACd,kBAAkB,GAMnB;IAGC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,sBAAsB,GAAG,KAAK,EAAE,EACpC,gBAAgB,EAChB,iBAAiB,GACM,EAAgB,EAAE;QACzC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;YACxC,OAAO,EAAE,cAAc;YACvB,sDAAsD;YACtD,IAAI,EAAE,oEAAoE;SAC3E,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MA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AC,CAAC;gBACtD,KAAK,QAAQ;oBACX,MAAM,SAAS,GAAG,MAAM,qBAAqB,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;oBACrE,4CAA4C;oBAC5C,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QACD,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,SAAS,GACb,sIAAsI,CAAC;YACzI,QAAQ,OAAiB,EAAE,CAAC;gBAC1B,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QACD,sBAAsB;KACvB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QACV,MAAM,EAAE,IAAI;QACZ,sBAAsB,EAAE,GAAG,EAAE,CAAC,OAAO;QACrC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n FailedToGetStorageSlotError,\n createBundlerClient,\n toSmartContractAccount,\n type Abi,\n type EntryPointDef,\n type SmartAccountSigner,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n type UpgradeToAndCallParams,\n} from \"@aa-sdk/core\";\nimport {\n concat,\n encodeFunctionData,\n fromHex,\n hashMessage,\n hashTypedData,\n trim,\n type Address,\n type Chain,\n type Hex,\n type SignTypedDataParameters,\n type Transport,\n} from \"viem\";\nimport type {\n LightAccountEntryPointVersion,\n LightAccountType,\n LightAccountVersion,\n} from \"../types.js\";\nimport { AccountVersionRegistry } from \"../utils.js\";\n\nenum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n CONTRACT_WITH_ADDR = \"0x02\",\n}\n\nexport type LightAccountBase<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>\n> = SmartContractAccountWithSigner<\n TLightAccountType,\n TSigner,\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>\n> & {\n getLightAccountVersion: () => TLightAccountVersion;\n};\n\n//#region CreateLightAccountBaseParams\nexport type CreateLightAccountBaseParams<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Pick<\n ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>,\n \"transport\" | \"chain\" | \"getAccountInitCode\"\n> & {\n abi: Abi;\n signer: TSigner;\n accountAddress: Address;\n type: TLightAccountType;\n version: TLightAccountVersion;\n entryPoint: EntryPointDef<\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>,\n Chain\n >;\n};\n//#endregion CreateLightAccountBaseParams\n\nexport async function createLightAccountBase<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>({\n transport,\n chain,\n signer,\n abi,\n version,\n type,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: CreateLightAccountBaseParams<\n TLightAccountType,\n TLightAccountVersion,\n TTransport,\n TSigner\n>): Promise<\n LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>\n> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const encodeUpgradeToAndCall = async ({\n upgradeToAddress,\n upgradeToInitData,\n }: UpgradeToAndCallParams): Promise<Hex> => {\n const storage = await client.getStorageAt({\n address: accountAddress,\n // the slot at which impl addresses are stored by UUPS\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n const implementationAddresses = Object.values(\n AccountVersionRegistry[type]\n ).map(\n (x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl\n );\n\n // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise\n if (\n fromHex(storage, \"number\") !== 0 &&\n !implementationAddresses.some((x) => x === trim(storage))\n ) {\n throw new Error(\n `could not determine if smart account implementation is ${type} ${String(\n version\n )}`\n );\n }\n\n return encodeFunctionData({\n abi,\n functionName: \"upgradeToAndCall\",\n args: [upgradeToAddress, upgradeToInitData],\n });\n };\n\n const signWith1271WrapperV1 = async (hashedMessage: Hex): Promise<Hex> => {\n return signer.signTypedData({\n // EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\n // https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L236\n domain: {\n chainId: Number(client.chain.id),\n name: type,\n verifyingContract: accountAddress,\n version: \"1\",\n },\n types: {\n LightAccountMessage: [{ name: \"message\", type: \"bytes\" }],\n },\n message: {\n message: hashedMessage,\n },\n primaryType: \"LightAccountMessage\",\n });\n };\n\n const account = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: type,\n getAccountInitCode,\n encodeExecute: async ({ target, data, value }) => {\n return encodeFunctionData({\n abi,\n functionName: \"execute\",\n args: [target, value ?? 0n, data],\n });\n },\n encodeBatchExecute: async (txs) => {\n const [targets, values, datas] = txs.reduce(\n (accum, curr) => {\n accum[0].push(curr.target);\n accum[1].push(curr.value ?? 0n);\n accum[2].push(curr.data);\n\n return accum;\n },\n [[], [], []] as [Address[], bigint[], Hex[]]\n );\n return encodeFunctionData({\n abi,\n functionName: \"executeBatch\",\n args: [targets, values, datas],\n });\n },\n signUserOperationHash: async (uoHash: Hex) => {\n const signature = await signer.signMessage({ raw: uoHash });\n switch (version) {\n case \"v2.0.0\":\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n return signature;\n }\n },\n async signMessage({ message }) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signMessage(message);\n case \"v1.0.2\":\n throw new Error(`${type} ${String(version)} doesn't support 1271`);\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashMessage(message));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashMessage(message));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n async signTypedData(params) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signTypedData(\n params as unknown as SignTypedDataParameters\n );\n case \"v1.0.2\":\n throw new Error(\n `Version ${String(version)} of LightAccount doesn't support 1271`\n );\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashTypedData(params));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashTypedData(params));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${String(version)} of LightAccount`);\n }\n },\n getDummySignature: (): Hex => {\n const signature =\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n switch (version as string) {\n case \"v1.0.1\":\n case \"v1.0.2\":\n case \"v1.1.0\":\n return signature;\n case \"v2.0.0\":\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n encodeUpgradeToAndCall,\n });\n\n return {\n ...account,\n source: type,\n getLightAccountVersion: () => version,\n getSigner: () => signer,\n };\n}\n"]}
@@ -4,6 +4,26 @@ import { MultiOwnerLightAccountAbi } from "../abis/MultiOwnerLightAccountAbi.js"
4
4
  import { MultiOwnerLightAccountFactoryAbi } from "../abis/MultiOwnerLightAccountFactoryAbi.js";
5
5
  import { defaultLightAccountVersion, getDefaultMultiOwnerLightAccountFactoryAddress, } from "../utils.js";
6
6
  import { createLightAccountBase, } from "./base.js";
7
+ /**
8
+ * 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.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * import { createMultiOwnerLightAccount } from "@account-kit/smart-contracts";
13
+ * import { LocalAccountSigner } from "@aa-sdk/core";
14
+ * import { sepolia } from "viem/chains";
15
+ * import { http, generatePrivateKey } from "viem"
16
+ *
17
+ * const account = await createMultiOwnerLightAccount({
18
+ * chain: sepolia,
19
+ * transport: http("RPC_URL"),
20
+ * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())
21
+ * });
22
+ * ```
23
+ *
24
+ * @param {CreateMultiOwnerLightAccountParams} config The parameters for creating a multi-owner light account
25
+ * @returns {Promise<MultiOwnerLightAccount>} A promise that resolves to a `MultiOwnerLightAccount` object containing the created account information and methods
26
+ */
7
27
  export async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion(), entryPoint = getEntryPoint(chain, {
8
28
  version: "0.7.0",
9
29
  }), accountAddress, factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(chain, version), salt: salt_ = 0n, owners = [], }) {
@@ -14,7 +34,9 @@ export async function createMultiOwnerLightAccount({ transport, chain, signer, i
14
34
  const getAccountInitCode = async () => {
15
35
  if (initCode)
16
36
  return initCode;
37
+ // NOTE: the current signer connected will be one of the owners as well
17
38
  const ownerAddress = await signer.getAddress();
39
+ // owners need to be dedupe + ordered in ascending order and not == to zero address
18
40
  const owners_ = Array.from(new Set([...owners, ownerAddress]))
19
41
  .filter((x) => hexToBigInt(x) !== 0n)
20
42
  .sort((a, b) => {
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwner.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GAKZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAK/F,OAAO,EACL,0BAA0B,EAC1B,8CAA8C,GAC/C,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AAkFnB,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,EAAE,EACtC,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,OAAO;CACjB,CAAC,EACF,cAAc,EACd,cAAc,GAAG,8CAA8C,CAC7D,KAAK,EACL,OAAO,CACR,EACD,IAAI,EAAE,KAAK,GAAG,EAAE,EAChB,MAAM,GAAG,EAAE,GACwB;IACnC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAG9B,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAE/C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,YA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,CAAC,iBAAiB;YACrB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,yBAAyB;gBAC9B,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,CAAC;YAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","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 LightAccountEntryPointVersion,\n LightAccountVersion,\n} from \"../types.js\";\nimport {\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 LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\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 LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >,\n Chain\n >;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion\n >\n): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;\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(),\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 \"MultiOwnerLightAccount\",\n LightAccountVersion<\"MultiOwnerLightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version,\n type: \"MultiOwnerLightAccount\",\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,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GAKZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAK/F,OAAO,EACL,0BAA0B,EAC1B,8CAA8C,GAC/C,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AA8DnB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,EAAE,EACtC,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,OAAO;CACjB,CAAC,EACF,cAAc,EACd,cAAc,GAAG,8CAA8C,CAC7D,KAAK,EACL,OAAO,CACR,EACD,IAAI,EAAE,KAAK,GAAG,EAAE,EAChB,MAAM,GAAG,EAAE,GACwB;IACnC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAE9B,uEAAuE;QACvE,MAAM,YAAY,GAAG,MAAM,M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,GAAG,EAAE,yBAAyB;gBAC9B,YAAY,EAAE,cAAc;gBAC5B,IAAI,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC;aACpC,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,iBAAiB;YACrB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,yBAAyB;gBAC9B,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,CAAC;YAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","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 LightAccountEntryPointVersion,\n LightAccountVersion,\n} from \"../types.js\";\nimport {\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 LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\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 LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >,\n Chain\n >;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion\n >\n): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;\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(),\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 \"MultiOwnerLightAccount\",\n LightAccountVersion<\"MultiOwnerLightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version,\n type: \"MultiOwnerLightAccount\",\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,29 @@ export type TransferLightAccountOwnershipParams<TSigner extends SmartAccountSign
5
5
  newOwner: TSigner;
6
6
  waitForTxn?: boolean;
7
7
  } & GetAccountParameter<TAccount, LightAccount<TSigner>> & UserOperationOverridesParameter<TEntryPointVersion>;
8
+ /**
9
+ * Transfers the ownership of a light account to a new owner.
10
+ * This function ensures that the client is a compatible smart acccount client and that a Light Account is provided.
11
+ * If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { transferOwnership, createLightAccountClient } from "@account-kit/smart-contracts";
16
+ *
17
+ * const lightAccountClient = createLightAccountClient({
18
+ * signer,
19
+ * transport,
20
+ * chain,
21
+ * });
22
+ *
23
+ * const txHash = await transferOwnership(lightAccountClient, {
24
+ * newOwner: newOwnerSigner,
25
+ * waitForTxn: true, // set to false to return a uoHash instead
26
+ * });
27
+ * ```
28
+ *
29
+ * @param {Client<TTransport, TChain, TAccount>} client The smart account client instance used to execute the transfer
30
+ * @param {TransferLightAccountOwnershipParams<TSigner, TAccount>} args The parameters for transferring ownership
31
+ * @returns {Promise<Hex>} The transaction or UO hash as a Hex string
32
+ */
8
33
  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>;
@@ -1,4 +1,29 @@
1
1
  import { AccountNotFoundError, IncompatibleClientError, isSmartAccountClient, } from "@aa-sdk/core";
2
+ /**
3
+ * Transfers the ownership of a light account to a new owner.
4
+ * This function ensures that the client is a compatible smart acccount client and that a Light Account is provided.
5
+ * If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning.
6
+ *
7
+ * @example
8
+ * ```ts
9
+ * import { transferOwnership, createLightAccountClient } from "@account-kit/smart-contracts";
10
+ *
11
+ * const lightAccountClient = createLightAccountClient({
12
+ * signer,
13
+ * transport,
14
+ * chain,
15
+ * });
16
+ *
17
+ * const txHash = await transferOwnership(lightAccountClient, {
18
+ * newOwner: newOwnerSigner,
19
+ * waitForTxn: true, // set to false to return a uoHash instead
20
+ * });
21
+ * ```
22
+ *
23
+ * @param {Client<TTransport, TChain, TAccount>} client The smart account client instance used to execute the transfer
24
+ * @param {TransferLightAccountOwnershipParams<TSigner, TAccount>} args The parameters for transferring ownership
25
+ * @returns {Promise<Hex>} The transaction or UO hash as a Hex string
26
+ */
2
27
  export const transferOwnership = async (client, args) => {
3
28
  const { newOwner, waitForTxn, overrides, account = client.account } = args;
4
29
  if (!account) {
@@ -1 +1 @@
1
- {"version":3,"file":"transferOwnership.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/transferOwnership.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GAKrB,MAAM,cAAc,CAAC;AAyCtB,MAAM,CAAC,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,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,uBAAuB,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","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
+ {"version":3,"file":"transferOwnership.js","sourceRoot":"","sources":["../../../../../src/light-account/actions/transferOwnership.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,GAKrB,MAAM,cAAc,CAAC;AAgBtB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,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,oBAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,uBAAuB,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","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"]}
@@ -6,4 +6,28 @@ export type UpdateMultiOwnerLightAccountOwnersParams<TSigner extends SmartAccoun
6
6
  ownersToRemove: Address[];
7
7
  waitForTxn?: boolean;
8
8
  } & GetAccountParameter<TAccount, MultiOwnerLightAccount<TSigner>> & UserOperationOverridesParameter<TEntryPointVersion>;
9
+ /**
10
+ * Updates the owners of a multi-owner light account. This includes adding new owners and removing existing ones.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * import { updateOwners, createLightAccountClient } from "@account-kit/smart-contracts";
15
+ *
16
+ * const lightAccountClient = createLightAccountClient({
17
+ * signer,
18
+ * transport,
19
+ * chain,
20
+ * });
21
+ *
22
+ * const txHash = await updateOwners(lightAccountClient, {
23
+ * ownerstoAdd: [newOwnerAddress], // or empty if you just want to remove owners
24
+ * ownersToRemove: [oldOwnerAddress], // or empty if you just want to add owners
25
+ * waitForTxn: true, // set to false to return a uoHash instead
26
+ * });
27
+ * ```
28
+ *
29
+ * @param {Client<TTransport, TChain, TAccount>} client The client instance used to interact with the account
30
+ * @param {UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>} args The parameters for updating the account owners
31
+ * @returns {Promise<Hex>} A promise that resolves to the transaction hash or the full transaction result if `waitForTxn` is `true`
32
+ */
9
33
  export declare const updateOwners: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner, TAccount extends MultiOwnerLightAccount<TSigner> | undefined = MultiOwnerLightAccount<TSigner> | undefined>(client: Client<TTransport, TChain, TAccount>, args: UpdateMultiOwnerLightAccountOwnersParams<TSigner, TAccount>) => Promise<Hex>;