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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/dist/cjs/src/index.d.ts +3 -3
  2. package/dist/cjs/src/index.js +15 -15
  3. package/dist/cjs/src/index.js.map +1 -1
  4. package/dist/cjs/src/light-account/accounts/account.js +1 -1
  5. package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
  6. package/dist/cjs/src/light-account/accounts/multiOwner.js +2 -4
  7. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
  8. package/dist/cjs/src/light-account/actions/transferOwnership.d.ts +1 -1
  9. package/dist/cjs/src/light-account/actions/transferOwnership.js +2 -1
  10. package/dist/cjs/src/light-account/actions/transferOwnership.js.map +1 -1
  11. package/dist/cjs/src/light-account/actions/updateOwners.js.map +1 -1
  12. package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
  13. package/dist/cjs/src/light-account/clients/client.js +2 -1
  14. package/dist/cjs/src/light-account/clients/client.js.map +1 -1
  15. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  16. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +2 -1
  17. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  18. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
  19. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  20. package/dist/cjs/src/light-account/utils.d.ts +3 -2
  21. package/dist/cjs/src/light-account/utils.js +14 -5
  22. package/dist/cjs/src/light-account/utils.js.map +1 -1
  23. package/dist/cjs/src/msca/account/multiOwnerAccount.js +2 -1
  24. package/dist/cjs/src/msca/account/multiOwnerAccount.js.map +1 -1
  25. package/dist/cjs/src/msca/account/multisigAccount.js +4 -3
  26. package/dist/cjs/src/msca/account/multisigAccount.js.map +1 -1
  27. package/dist/cjs/src/msca/account-loupe/decorator.js.map +1 -1
  28. package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
  29. package/dist/cjs/src/msca/client/client.js.map +1 -1
  30. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  31. package/dist/cjs/src/msca/errors.js.map +1 -1
  32. package/dist/cjs/src/msca/plugin-manager/decorator.d.ts +1 -1
  33. package/dist/cjs/src/msca/plugin-manager/decorator.js +6 -4
  34. package/dist/cjs/src/msca/plugin-manager/decorator.js.map +1 -1
  35. package/dist/cjs/src/msca/plugin-manager/installPlugin.js.map +1 -1
  36. package/dist/cjs/src/msca/plugins/multi-owner/extension.js.map +1 -1
  37. package/dist/cjs/src/msca/plugins/multi-owner/index.d.ts +1 -1
  38. package/dist/cjs/src/msca/plugins/multi-owner/index.js +2 -1
  39. package/dist/cjs/src/msca/plugins/multi-owner/index.js.map +1 -1
  40. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js +2 -2
  41. package/dist/cjs/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  42. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
  43. package/dist/cjs/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  44. package/dist/cjs/src/msca/plugins/multisig/extension.js.map +1 -1
  45. package/dist/cjs/src/msca/plugins/multisig/index.d.ts +1 -8
  46. package/dist/cjs/src/msca/plugins/multisig/index.js +1 -16
  47. package/dist/cjs/src/msca/plugins/multisig/index.js.map +1 -1
  48. package/dist/cjs/src/msca/plugins/multisig/middleware.d.ts +1 -1
  49. package/dist/cjs/src/msca/plugins/multisig/middleware.js +1 -1
  50. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  51. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
  52. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
  53. package/dist/cjs/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
  54. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
  55. package/dist/cjs/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  56. package/dist/cjs/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  57. package/dist/cjs/src/msca/plugins/multisig/utils/index.js.map +1 -1
  58. package/dist/cjs/src/msca/plugins/session-key/extension.js.map +1 -1
  59. package/dist/cjs/src/msca/plugins/session-key/index.d.ts +1 -1
  60. package/dist/cjs/src/msca/plugins/session-key/index.js +3 -1
  61. package/dist/cjs/src/msca/plugins/session-key/index.js.map +1 -1
  62. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  63. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  64. package/dist/cjs/src/msca/plugins/session-key/utils.d.ts +4 -2
  65. package/dist/cjs/src/msca/plugins/session-key/utils.js +3 -2
  66. package/dist/cjs/src/msca/plugins/session-key/utils.js.map +1 -1
  67. package/dist/cjs/src/msca/utils.d.ts +6 -4
  68. package/dist/cjs/src/msca/utils.js.map +1 -1
  69. package/dist/esm/src/index.d.ts +3 -3
  70. package/dist/esm/src/index.js +2 -2
  71. package/dist/esm/src/index.js.map +1 -1
  72. package/dist/esm/src/light-account/accounts/account.js +2 -2
  73. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  74. package/dist/esm/src/light-account/accounts/multiOwner.js +3 -5
  75. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  76. package/dist/esm/src/light-account/actions/transferOwnership.d.ts +1 -1
  77. package/dist/esm/src/light-account/actions/transferOwnership.js +2 -1
  78. package/dist/esm/src/light-account/actions/transferOwnership.js.map +1 -1
  79. package/dist/esm/src/light-account/actions/updateOwners.js.map +1 -1
  80. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  81. package/dist/esm/src/light-account/clients/client.js +2 -1
  82. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  83. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  84. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +2 -1
  85. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  86. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  87. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  88. package/dist/esm/src/light-account/utils.d.ts +3 -2
  89. package/dist/esm/src/light-account/utils.js +12 -4
  90. package/dist/esm/src/light-account/utils.js.map +1 -1
  91. package/dist/esm/src/msca/account/multiOwnerAccount.js +2 -1
  92. package/dist/esm/src/msca/account/multiOwnerAccount.js.map +1 -1
  93. package/dist/esm/src/msca/account/multisigAccount.js +4 -3
  94. package/dist/esm/src/msca/account/multisigAccount.js.map +1 -1
  95. package/dist/esm/src/msca/account-loupe/decorator.js.map +1 -1
  96. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  97. package/dist/esm/src/msca/client/client.js.map +1 -1
  98. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  99. package/dist/esm/src/msca/errors.js.map +1 -1
  100. package/dist/esm/src/msca/plugin-manager/decorator.d.ts +1 -1
  101. package/dist/esm/src/msca/plugin-manager/decorator.js +6 -4
  102. package/dist/esm/src/msca/plugin-manager/decorator.js.map +1 -1
  103. package/dist/esm/src/msca/plugin-manager/installPlugin.js.map +1 -1
  104. package/dist/esm/src/msca/plugins/multi-owner/extension.js.map +1 -1
  105. package/dist/esm/src/msca/plugins/multi-owner/index.d.ts +1 -1
  106. package/dist/esm/src/msca/plugins/multi-owner/index.js +1 -1
  107. package/dist/esm/src/msca/plugins/multi-owner/index.js.map +1 -1
  108. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js +1 -1
  109. package/dist/esm/src/msca/plugins/multisig/actions/proposeUserOperation.js.map +1 -1
  110. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js +1 -1
  111. package/dist/esm/src/msca/plugins/multisig/actions/signMultisigUserOperation.js.map +1 -1
  112. package/dist/esm/src/msca/plugins/multisig/extension.js.map +1 -1
  113. package/dist/esm/src/msca/plugins/multisig/index.d.ts +1 -8
  114. package/dist/esm/src/msca/plugins/multisig/index.js +0 -7
  115. package/dist/esm/src/msca/plugins/multisig/index.js.map +1 -1
  116. package/dist/esm/src/msca/plugins/multisig/middleware.d.ts +1 -1
  117. package/dist/esm/src/msca/plugins/multisig/middleware.js +2 -1
  118. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  119. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.d.ts +3 -2
  120. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js +2 -2
  121. package/dist/esm/src/msca/plugins/multisig/utils/combineSignatures.js.map +1 -1
  122. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.d.ts +2 -2
  123. package/dist/esm/src/msca/plugins/multisig/utils/getSignerType.js.map +1 -1
  124. package/dist/esm/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  125. package/dist/esm/src/msca/plugins/multisig/utils/index.js.map +1 -1
  126. package/dist/esm/src/msca/plugins/session-key/extension.js.map +1 -1
  127. package/dist/esm/src/msca/plugins/session-key/index.d.ts +1 -1
  128. package/dist/esm/src/msca/plugins/session-key/index.js +1 -1
  129. package/dist/esm/src/msca/plugins/session-key/index.js.map +1 -1
  130. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  131. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  132. package/dist/esm/src/msca/plugins/session-key/utils.d.ts +4 -2
  133. package/dist/esm/src/msca/plugins/session-key/utils.js +3 -2
  134. package/dist/esm/src/msca/plugins/session-key/utils.js.map +1 -1
  135. package/dist/esm/src/msca/utils.d.ts +6 -4
  136. package/dist/esm/src/msca/utils.js.map +1 -1
  137. package/dist/types/src/index.d.ts +3 -3
  138. package/dist/types/src/index.d.ts.map +1 -1
  139. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  140. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  141. package/dist/types/src/light-account/actions/transferOwnership.d.ts +26 -1
  142. package/dist/types/src/light-account/actions/transferOwnership.d.ts.map +1 -1
  143. package/dist/types/src/light-account/actions/updateOwners.d.ts +24 -0
  144. package/dist/types/src/light-account/actions/updateOwners.d.ts.map +1 -1
  145. package/dist/types/src/light-account/decorators/lightAccount.d.ts +19 -0
  146. package/dist/types/src/light-account/decorators/lightAccount.d.ts.map +1 -1
  147. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +19 -0
  148. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts.map +1 -1
  149. package/dist/types/src/light-account/utils.d.ts +11 -4
  150. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  151. package/dist/types/src/msca/account/multisigAccount.d.ts.map +1 -1
  152. package/dist/types/src/msca/account-loupe/decorator.d.ts +15 -0
  153. package/dist/types/src/msca/account-loupe/decorator.d.ts.map +1 -1
  154. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  155. package/dist/types/src/msca/errors.d.ts +12 -0
  156. package/dist/types/src/msca/errors.d.ts.map +1 -1
  157. package/dist/types/src/msca/plugin-manager/decorator.d.ts +16 -1
  158. package/dist/types/src/msca/plugin-manager/decorator.d.ts.map +1 -1
  159. package/dist/types/src/msca/plugin-manager/installPlugin.d.ts +21 -0
  160. package/dist/types/src/msca/plugin-manager/installPlugin.d.ts.map +1 -1
  161. package/dist/types/src/msca/plugins/multi-owner/extension.d.ts +15 -0
  162. package/dist/types/src/msca/plugins/multi-owner/extension.d.ts.map +1 -1
  163. package/dist/types/src/msca/plugins/multi-owner/index.d.ts +1 -1
  164. package/dist/types/src/msca/plugins/multi-owner/index.d.ts.map +1 -1
  165. package/dist/types/src/msca/plugins/multisig/actions/proposeUserOperation.d.ts.map +1 -1
  166. package/dist/types/src/msca/plugins/multisig/actions/signMultisigUserOperation.d.ts.map +1 -1
  167. package/dist/types/src/msca/plugins/multisig/extension.d.ts +13 -0
  168. package/dist/types/src/msca/plugins/multisig/extension.d.ts.map +1 -1
  169. package/dist/types/src/msca/plugins/multisig/index.d.ts +1 -8
  170. package/dist/types/src/msca/plugins/multisig/index.d.ts.map +1 -1
  171. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +1 -1
  172. package/dist/types/src/msca/plugins/multisig/middleware.d.ts.map +1 -1
  173. package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts +28 -2
  174. package/dist/types/src/msca/plugins/multisig/utils/combineSignatures.d.ts.map +1 -1
  175. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts +21 -2
  176. package/dist/types/src/msca/plugins/multisig/utils/getSignerType.d.ts.map +1 -1
  177. package/dist/types/src/msca/plugins/multisig/utils/index.d.ts +4 -0
  178. package/dist/types/src/msca/plugins/multisig/utils/index.d.ts.map +1 -1
  179. package/dist/types/src/msca/plugins/session-key/extension.d.ts +13 -0
  180. package/dist/types/src/msca/plugins/session-key/extension.d.ts.map +1 -1
  181. package/dist/types/src/msca/plugins/session-key/index.d.ts +1 -1
  182. package/dist/types/src/msca/plugins/session-key/index.d.ts.map +1 -1
  183. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +3 -0
  184. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  185. package/dist/types/src/msca/plugins/session-key/signer.d.ts +1 -1
  186. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  187. package/dist/types/src/msca/plugins/session-key/utils.d.ts +22 -2
  188. package/dist/types/src/msca/plugins/session-key/utils.d.ts.map +1 -1
  189. package/dist/types/src/msca/utils.d.ts +43 -5
  190. package/dist/types/src/msca/utils.d.ts.map +1 -1
  191. package/package.json +5 -5
  192. package/src/index.ts +2 -3
  193. package/src/light-account/accounts/account.ts +22 -3
  194. package/src/light-account/accounts/multiOwner.ts +26 -5
  195. package/src/light-account/actions/transferOwnership.ts +28 -5
  196. package/src/light-account/actions/updateOwners.ts +24 -0
  197. package/src/light-account/clients/alchemyClient.ts +20 -0
  198. package/src/light-account/clients/client.ts +27 -6
  199. package/src/light-account/clients/multiOwnerAlchemyClient.ts +20 -0
  200. package/src/light-account/clients/multiOwnerLightAccount.ts +27 -6
  201. package/src/light-account/decorators/lightAccount.ts +19 -0
  202. package/src/light-account/decorators/multiOwnerLightAccount.ts +19 -0
  203. package/src/light-account/utils.ts +29 -6
  204. package/src/msca/account/multiOwnerAccount.ts +36 -11
  205. package/src/msca/account/multisigAccount.ts +40 -14
  206. package/src/msca/account-loupe/decorator.ts +15 -0
  207. package/src/msca/client/alchemyClient.ts +20 -0
  208. package/src/msca/client/client.ts +46 -0
  209. package/src/msca/client/multiSigAlchemyClient.ts +22 -0
  210. package/src/msca/errors.ts +12 -0
  211. package/src/msca/plugin-manager/decorator.ts +22 -5
  212. package/src/msca/plugin-manager/installPlugin.ts +21 -0
  213. package/src/msca/plugins/multi-owner/extension.ts +15 -0
  214. package/src/msca/plugins/multi-owner/index.ts +3 -0
  215. package/src/msca/plugins/multisig/actions/proposeUserOperation.ts +1 -1
  216. package/src/msca/plugins/multisig/actions/signMultisigUserOperation.ts +1 -1
  217. package/src/msca/plugins/multisig/extension.ts +13 -0
  218. package/src/msca/plugins/multisig/index.ts +1 -12
  219. package/src/msca/plugins/multisig/middleware.ts +2 -2
  220. package/src/msca/plugins/multisig/utils/combineSignatures.ts +36 -9
  221. package/src/msca/plugins/multisig/utils/getSignerType.ts +23 -4
  222. package/src/msca/plugins/multisig/utils/index.ts +4 -0
  223. package/src/msca/plugins/session-key/extension.ts +13 -0
  224. package/src/msca/plugins/session-key/index.ts +7 -1
  225. package/src/msca/plugins/session-key/permissions.ts +3 -0
  226. package/src/msca/plugins/session-key/signer.ts +1 -2
  227. package/src/msca/plugins/session-key/utils.ts +33 -12
  228. package/src/msca/utils.ts +64 -9
@@ -7,7 +7,8 @@ const MultiOwnerModularAccountFactory_js_1 = require("../abis/MultiOwnerModularA
7
7
  const signer_js_1 = require("../plugins/multi-owner/signer.js");
8
8
  const utils_js_1 = require("../utils.js");
9
9
  const standardExecutor_js_1 = require("./standardExecutor.js");
10
- async function createMultiOwnerModularAccount({ transport, chain, signer, accountAddress, initCode, entryPoint = (0, core_1.getEntryPoint)(chain, { version: "0.6.0" }), factoryAddress = (0, utils_js_1.getDefaultMultiOwnerModularAccountFactoryAddress)(chain), owners = [], salt = 0n, }) {
10
+ async function createMultiOwnerModularAccount(config) {
11
+ const { transport, chain, signer, accountAddress, initCode, entryPoint = (0, core_1.getEntryPoint)(chain, { version: "0.6.0" }), factoryAddress = (0, utils_js_1.getDefaultMultiOwnerModularAccountFactoryAddress)(chain), owners = [], salt = 0n, } = config;
11
12
  const client = (0, core_1.createBundlerClient)({
12
13
  transport,
13
14
  chain,
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwnerAccount.js","sourceRoot":"","sources":["../../../../../src/msca/account/multiOwnerAccount.ts"],"names":[],"mappings":";;;AAMA,uCAKsB;AACtB,+BAQc;AACd,mGAAgG;AAChG,gEAA2E;AAC3E,0CAA+E;AAC/E,+DAAyD;AAwClD,KAAK,UAAU,8BAA8B,CAAC,EACnD,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACvD,cAAc,GAAG,IAAA,2DAAgD,EAAC,KAAK,CAAC,EACxE,MAAM,GAAG,EAAE,EACX,IAAI,GAAG,EAAE,GAC4B;IACrC,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAGD,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,YAAY,CAAC,CAAC,CAAC;aAC3D,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAW,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAE/B,OAAO,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEL,OAAO,IAAA,gBAAS,EAAC;YACf,cAAc;YACd,IAAA,yBAAkB,EAAC;gBACjB,GAAG,EAAE,uEAAkC;gBACvC,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;aACtB,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,MAAM,IAAA,wBAAiB,EAAC;QAC9C,MAAM;QACN,UAAU;QACV,cAAc;QACd,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAsB,EAAC;QAC/C,SAAS;QACT,KAAK;QACL,UAAU;QACV,cAAc,EAAE,eAAe;QAC/B,MAAM,EAAE,0BAA0B;QAClC,kBAAkB;QAClB,GAAG,sCAAgB;QACnB,GAAG,IAAA,mCAAuB,EAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC;KAClE,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,WAAW;QACd,SAAS,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE;QACpC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAlED,wEAkEC","sourcesContent":["import type {\n EntryPointParameter,\n SmartAccountSigner,\n SmartContractAccountWithSigner,\n ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n toSmartContractAccount,\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 { MultiOwnerModularAccountFactoryAbi } from \"../abis/MultiOwnerModularAccountFactory.js\";\nimport { multiOwnerMessageSigner } from \"../plugins/multi-owner/signer.js\";\nimport { getDefaultMultiOwnerModularAccountFactoryAddress } from \"../utils.js\";\nimport { standardExecutor } from \"./standardExecutor.js\";\n\nexport type MultiOwnerModularAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = SmartContractAccountWithSigner<\n \"MultiOwnerModularAccount\",\n TSigner,\n \"0.6.0\"\n>;\n\n// [!region CreateMultiOwnerModularAccountParams]\nexport type CreateMultiOwnerModularAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends \"0.6.0\" = \"0.6.0\"\n> = Pick<\n ToSmartContractAccountParams<\n \"MultiOwnerModularAccount\",\n TTransport,\n Chain,\n TEntryPointVersion\n >,\n \"transport\" | \"chain\"\n> & {\n signer: TSigner;\n salt?: bigint;\n factoryAddress?: Address;\n initCode?: Hex;\n owners?: Address[];\n accountAddress?: Address;\n} & EntryPointParameter<TEntryPointVersion, Chain>;\n// [!endregion CreateMultiOwnerModularAccountParams]\n\nexport async function createMultiOwnerModularAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n config: CreateMultiOwnerModularAccountParams<TTransport, TSigner>\n): Promise<MultiOwnerModularAccount<TSigner>>;\n\nexport async function createMultiOwnerModularAccount({\n transport,\n chain,\n signer,\n accountAddress,\n initCode,\n entryPoint = getEntryPoint(chain, { version: \"0.6.0\" }),\n factoryAddress = getDefaultMultiOwnerModularAccountFactoryAddress(chain),\n owners = [],\n salt = 0n,\n}: CreateMultiOwnerModularAccountParams): Promise<MultiOwnerModularAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) {\n return initCode;\n }\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: MultiOwnerModularAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [salt, owners_],\n }),\n ]);\n };\n\n const _accountAddress = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const baseAccount = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress: _accountAddress,\n source: `MultiOwnerModularAccount`,\n getAccountInitCode,\n ...standardExecutor,\n ...multiOwnerMessageSigner(client, _accountAddress, () => signer),\n });\n\n return {\n ...baseAccount,\n publicKey: await signer.getAddress(),\n getSigner: () => signer,\n };\n}\n"]}
1
+ {"version":3,"file":"multiOwnerAccount.js","sourceRoot":"","sources":["../../../../../src/msca/account/multiOwnerAccount.ts"],"names":[],"mappings":";;;AAMA,uCAKsB;AACtB,+BAQc;AACd,mGAAgG;AAChG,gEAA2E;AAC3E,0CAA+E;AAC/E,+DAAyD;AA6DlD,KAAK,UAAU,8BAA8B,CAClD,MAA4C;IAE5C,MAAM,EACJ,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACvD,cAAc,GAAG,IAAA,2DAAgD,EAAC,KAAK,CAAC,EACxE,MAAM,GAAG,EAAE,EACX,IAAI,GAAG,EAAE,GACV,GAAG,MAAM,CAAC;IAEX,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAGD,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,YAAY,CAAC,CAAC,CAAC;aAC3D,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAW,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAE/B,OAAO,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEL,OAAO,IAAA,gBAAS,EAAC;YACf,cAAc;YACd,IAAA,yBAAkB,EAAC;gBACjB,GAAG,EAAE,uEAAkC;gBACvC,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;aACtB,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,eAAe,GAAG,MAAM,IAAA,wBAAiB,EAAC;QAC9C,MAAM;QACN,UAAU;QACV,cAAc;QACd,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAsB,EAAC;QAC/C,SAAS;QACT,KAAK;QACL,UAAU;QACV,cAAc,EAAE,eAAe;QAC/B,MAAM,EAAE,0BAA0B;QAClC,kBAAkB;QAClB,GAAG,sCAAgB;QACnB,GAAG,IAAA,mCAAuB,EAAC,MAAM,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC;KAClE,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,WAAW;QACd,SAAS,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE;QACpC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAtED,wEAsEC","sourcesContent":["import type {\n EntryPointParameter,\n SmartAccountSigner,\n SmartContractAccountWithSigner,\n ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n toSmartContractAccount,\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 { MultiOwnerModularAccountFactoryAbi } from \"../abis/MultiOwnerModularAccountFactory.js\";\nimport { multiOwnerMessageSigner } from \"../plugins/multi-owner/signer.js\";\nimport { getDefaultMultiOwnerModularAccountFactoryAddress } from \"../utils.js\";\nimport { standardExecutor } from \"./standardExecutor.js\";\n\nexport type MultiOwnerModularAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = SmartContractAccountWithSigner<\n \"MultiOwnerModularAccount\",\n TSigner,\n \"0.6.0\"\n>;\n\n// [!region CreateMultiOwnerModularAccountParams]\nexport type CreateMultiOwnerModularAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends \"0.6.0\" = \"0.6.0\"\n> = Pick<\n ToSmartContractAccountParams<\n \"MultiOwnerModularAccount\",\n TTransport,\n Chain,\n TEntryPointVersion\n >,\n \"transport\" | \"chain\"\n> & {\n signer: TSigner;\n salt?: bigint;\n factoryAddress?: Address;\n initCode?: Hex;\n owners?: Address[];\n accountAddress?: Address;\n} & EntryPointParameter<TEntryPointVersion, Chain>;\n// [!endregion CreateMultiOwnerModularAccountParams]\n\nexport async function createMultiOwnerModularAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n config: CreateMultiOwnerModularAccountParams<TTransport, TSigner>\n): Promise<MultiOwnerModularAccount<TSigner>>;\n\n/**\n * Creates a multi-owner modular account with the given parameters, including transport, chain, signer, account address, initialization code, entry point, factory address, owners, and salt.\n * Ensures that the owners are unique, ordered, and non-zero.\n *\n * @example\n * ```ts\n * import { createMultiOwnerModularAccount } 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 createMultiOwnerModularAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerModularAccountParams} config Configuration parameters for creating a multi-owner modular account\n * @returns {Promise<MultiOwnerModularAccount>} A promise that resolves to a `MultiOwnerModularAccount` object containing the created account information and methods\n */\nexport async function createMultiOwnerModularAccount(\n config: CreateMultiOwnerModularAccountParams\n): Promise<MultiOwnerModularAccount> {\n const {\n transport,\n chain,\n signer,\n accountAddress,\n initCode,\n entryPoint = getEntryPoint(chain, { version: \"0.6.0\" }),\n factoryAddress = getDefaultMultiOwnerModularAccountFactoryAddress(chain),\n owners = [],\n salt = 0n,\n } = config;\n\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) {\n return initCode;\n }\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: MultiOwnerModularAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [salt, owners_],\n }),\n ]);\n };\n\n const _accountAddress = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const baseAccount = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress: _accountAddress,\n source: `MultiOwnerModularAccount`,\n getAccountInitCode,\n ...standardExecutor,\n ...multiOwnerMessageSigner(client, _accountAddress, () => signer),\n });\n\n return {\n ...baseAccount,\n publicKey: await signer.getAddress(),\n getSigner: () => signer,\n };\n}\n"]}
@@ -8,7 +8,8 @@ const signer_js_1 = require("../plugins/multisig/signer.js");
8
8
  const utils_js_1 = require("../utils.js");
9
9
  const standardExecutor_js_1 = require("./standardExecutor.js");
10
10
  exports.MULTISIG_ACCOUNT_SOURCE = "MultisigModularAccount";
11
- async function createMultisigModularAccount({ transport, chain, signer, accountAddress, initCode, entryPoint = (0, core_1.getEntryPoint)(chain, { version: "0.6.0" }), factoryAddress = (0, utils_js_1.getDefaultMultisigModularAccountFactoryAddress)(chain), owners = [], salt = 0n, threshold, }) {
11
+ async function createMultisigModularAccount(config) {
12
+ const { transport, chain, signer, accountAddress: accountAddress_, initCode, entryPoint = (0, core_1.getEntryPoint)(chain, { version: "0.6.0" }), factoryAddress = (0, utils_js_1.getDefaultMultisigModularAccountFactoryAddress)(chain), owners = [], salt = 0n, threshold, } = config;
12
13
  const client = (0, core_1.createBundlerClient)({
13
14
  transport,
14
15
  chain,
@@ -34,10 +35,10 @@ async function createMultisigModularAccount({ transport, chain, signer, accountA
34
35
  }),
35
36
  ]);
36
37
  };
37
- accountAddress = await (0, core_1.getAccountAddress)({
38
+ const accountAddress = await (0, core_1.getAccountAddress)({
38
39
  client,
39
40
  entryPoint,
40
- accountAddress: accountAddress,
41
+ accountAddress: accountAddress_,
41
42
  getAccountInitCode,
42
43
  });
43
44
  const baseAccount = await (0, core_1.toSmartContractAccount)({
@@ -1 +1 @@
1
- {"version":3,"file":"multisigAccount.js","sourceRoot":"","sources":["../../../../../src/msca/account/multisigAccount.ts"],"names":[],"mappings":";;;AAAA,uCAWsB;AACtB,+BAOc;AACd,+FAA4F;AAC5F,6DAAoE;AACpE,0CAA6E;AAC7E,+DAAyD;AAE5C,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AAyCzD,KAAK,UAAU,4BAA4B,CAAC,EACjD,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACvD,cAAc,GAAG,IAAA,yDAA8C,EAAC,KAAK,CAAC,EACtE,MAAM,GAAG,EAAE,EACX,IAAI,GAAG,EAAE,EACT,SAAS,GAC0B;IACnC,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAGD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAE7C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;aACvD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAW,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAE/B,OAAO,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEL,OAAO,IAAA,gBAAS,EAAC;YACf,cAAc;YACd,IAAA,yBAAkB,EAAC;gBACjB,GAAG,EAAE,mEAAgC;gBACrC,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC;aAC/B,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,cAAc,GAAG,MAAM,IAAA,wBAAiB,EAAC;QACvC,MAAM;QACN,UAAU;QACV,cAAc,EAAE,cAAc;QAC9B,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAsB,EAAC;QAC/C,SAAS;QACT,KAAK;QACL,UAAU;QACV,cAAc;QACd,MAAM,EAAE,+BAAuB;QAC/B,kBAAkB;QAClB,GAAG,sCAAgB;QACnB,GAAG,IAAA,+BAAmB,EAAC;YACrB,MAAM;YACN,cAAc;YACd,SAAS;YACT,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM;SACrB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,WAAW;QACd,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS;QAClC,SAAS,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE;QACpC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AAzED,oEAyEC;AAEM,MAAM,wBAAwB,GAAG,CACtC,IAA0B,EACM,EAAE;IAClC,OAAO,IAAI,CAAC,MAAM,KAAK,+BAAuB,CAAC;AACjD,CAAC,CAAC;AAJW,QAAA,wBAAwB,4BAInC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n toSmartContractAccount,\n type Address,\n type EntryPointParameter,\n type SmartAccountSigner,\n type SmartContractAccount,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultisigModularAccountFactoryAbi } from \"../abis/MultisigModularAccountFactory.js\";\nimport { multisigSignMethods } from \"../plugins/multisig/signer.js\";\nimport { getDefaultMultisigModularAccountFactoryAddress } from \"../utils.js\";\nimport { standardExecutor } from \"./standardExecutor.js\";\n\nexport const MULTISIG_ACCOUNT_SOURCE = \"MultisigModularAccount\";\n\nexport type MultisigModularAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = SmartContractAccountWithSigner<\n typeof MULTISIG_ACCOUNT_SOURCE,\n TSigner,\n \"0.6.0\"\n> & {\n getLocalThreshold: () => bigint;\n};\n\nexport type CreateMultisigModularAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends \"0.6.0\" = \"0.6.0\"\n> = Pick<\n ToSmartContractAccountParams<\n \"MultisigModularAccount\",\n TTransport,\n Chain,\n TEntryPointVersion\n >,\n \"transport\" | \"chain\"\n> & {\n signer: TSigner;\n salt?: bigint;\n factoryAddress?: Address;\n initCode?: Hex;\n threshold: bigint;\n owners?: Address[];\n accountAddress?: Address;\n} & EntryPointParameter<TEntryPointVersion, Chain>;\n\nexport async function createMultisigModularAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n config: CreateMultisigModularAccountParams<TTransport, TSigner>\n): Promise<MultisigModularAccount<TSigner>>;\n\nexport async function createMultisigModularAccount({\n transport,\n chain,\n signer,\n accountAddress,\n initCode,\n entryPoint = getEntryPoint(chain, { version: \"0.6.0\" }),\n factoryAddress = getDefaultMultisigModularAccountFactoryAddress(chain),\n owners = [],\n salt = 0n,\n threshold,\n}: CreateMultisigModularAccountParams): Promise<MultisigModularAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) {\n return initCode;\n }\n\n // NOTE: the current signer connected will be one of the sigs as well\n const sigAddress = await signer.getAddress();\n // sigs need to be deduped + ordered in ascending order and !== to zero address\n const sigs_ = Array.from(new Set([...owners, sigAddress]))\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: MultisigModularAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [salt, sigs_, threshold],\n }),\n ]);\n };\n\n accountAddress = await getAccountAddress({\n client,\n entryPoint,\n accountAddress: accountAddress,\n getAccountInitCode,\n });\n\n const baseAccount = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: MULTISIG_ACCOUNT_SOURCE,\n getAccountInitCode,\n ...standardExecutor,\n ...multisigSignMethods({\n client,\n accountAddress,\n threshold,\n signer: () => signer,\n }),\n });\n\n return {\n ...baseAccount,\n getLocalThreshold: () => threshold,\n publicKey: await signer.getAddress(),\n getSigner: () => signer,\n };\n}\n\nexport const isMultisigModularAccount = (\n acct: SmartContractAccount\n): acct is MultisigModularAccount => {\n return acct.source === MULTISIG_ACCOUNT_SOURCE;\n};\n"]}
1
+ {"version":3,"file":"multisigAccount.js","sourceRoot":"","sources":["../../../../../src/msca/account/multisigAccount.ts"],"names":[],"mappings":";;;AAAA,uCAWsB;AACtB,+BAOc;AACd,+FAA4F;AAC5F,6DAAoE;AACpE,0CAA6E;AAC7E,+DAAyD;AAE5C,QAAA,uBAAuB,GAAG,wBAAwB,CAAC;AA+DzD,KAAK,UAAU,4BAA4B,CAChD,MAA0C;IAE1C,MAAM,EACJ,SAAS,EACT,KAAK,EACL,MAAM,EACN,cAAc,EAAE,eAAe,EAC/B,QAAQ,EACR,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACvD,cAAc,GAAG,IAAA,yDAA8C,EAAC,KAAK,CAAC,EACtE,MAAM,GAAG,EAAE,EACX,IAAI,GAAG,EAAE,EACT,SAAS,GACV,GAAG,MAAM,CAAC;IAEX,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QAGD,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAE7C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC;aACvD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,kBAAW,EAAC,CAAC,CAAC,KAAK,EAAE,CAAC;aACpC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACb,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,OAAO,GAAG,IAAA,kBAAW,EAAC,CAAC,CAAC,CAAC;YAE/B,OAAO,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEL,OAAO,IAAA,gBAAS,EAAC;YACf,cAAc;YACd,IAAA,yBAAkB,EAAC;gBACjB,GAAG,EAAE,mEAAgC;gBACrC,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC;aAC/B,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,cAAc,GAAG,MAAM,IAAA,wBAAiB,EAAC;QAC7C,MAAM;QACN,UAAU;QACV,cAAc,EAAE,eAAe;QAC/B,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,IAAA,6BAAsB,EAAC;QAC/C,SAAS;QACT,KAAK;QACL,UAAU;QACV,cAAc;QACd,MAAM,EAAE,+BAAuB;QAC/B,kBAAkB;QAClB,GAAG,sCAAgB;QACnB,GAAG,IAAA,+BAAmB,EAAC;YACrB,MAAM;YACN,cAAc;YACd,SAAS;YACT,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM;SACrB,CAAC;KACH,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,WAAW;QACd,iBAAiB,EAAE,GAAG,EAAE,CAAC,SAAS;QAClC,SAAS,EAAE,MAAM,MAAM,CAAC,UAAU,EAAE;QACpC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC;AA7ED,oEA6EC;AAEM,MAAM,wBAAwB,GAAG,CACtC,IAA0B,EACM,EAAE;IAClC,OAAO,IAAI,CAAC,MAAM,KAAK,+BAAuB,CAAC;AACjD,CAAC,CAAC;AAJW,QAAA,wBAAwB,4BAInC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n toSmartContractAccount,\n type Address,\n type EntryPointParameter,\n type SmartAccountSigner,\n type SmartContractAccount,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultisigModularAccountFactoryAbi } from \"../abis/MultisigModularAccountFactory.js\";\nimport { multisigSignMethods } from \"../plugins/multisig/signer.js\";\nimport { getDefaultMultisigModularAccountFactoryAddress } from \"../utils.js\";\nimport { standardExecutor } from \"./standardExecutor.js\";\n\nexport const MULTISIG_ACCOUNT_SOURCE = \"MultisigModularAccount\";\n\nexport type MultisigModularAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = SmartContractAccountWithSigner<\n typeof MULTISIG_ACCOUNT_SOURCE,\n TSigner,\n \"0.6.0\"\n> & {\n getLocalThreshold: () => bigint;\n};\n\nexport type CreateMultisigModularAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TEntryPointVersion extends \"0.6.0\" = \"0.6.0\"\n> = Pick<\n ToSmartContractAccountParams<\n \"MultisigModularAccount\",\n TTransport,\n Chain,\n TEntryPointVersion\n >,\n \"transport\" | \"chain\"\n> & {\n signer: TSigner;\n salt?: bigint;\n factoryAddress?: Address;\n initCode?: Hex;\n threshold: bigint;\n owners?: Address[];\n accountAddress?: Address;\n} & EntryPointParameter<TEntryPointVersion, Chain>;\n\nexport async function createMultisigModularAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n config: CreateMultisigModularAccountParams<TTransport, TSigner>\n): Promise<MultisigModularAccount<TSigner>>;\n\n/**\n * Creates a multisig modular account using the provided parameters, including transport, chain, signer, account address, and other account settings. It configures the account with multiple owners and the specified threshold.\n *\n * @example\n * ```ts\n * import { createMultisigModularAccount } 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 createMultisigModularAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [...], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n *\n * @param {CreateMultisigModularAccountParams} config The parameters for creating a multisig modular account.\n * @returns {Promise<MultisigModularAccount>} A promise that resolves to a `MultisigModularAccount` object containing the created account information and methods.\n */\nexport async function createMultisigModularAccount(\n config: CreateMultisigModularAccountParams\n): Promise<MultisigModularAccount> {\n const {\n transport,\n chain,\n signer,\n accountAddress: accountAddress_,\n initCode,\n entryPoint = getEntryPoint(chain, { version: \"0.6.0\" }),\n factoryAddress = getDefaultMultisigModularAccountFactoryAddress(chain),\n owners = [],\n salt = 0n,\n threshold,\n } = config;\n\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) {\n return initCode;\n }\n\n // NOTE: the current signer connected will be one of the sigs as well\n const sigAddress = await signer.getAddress();\n // sigs need to be deduped + ordered in ascending order and !== to zero address\n const sigs_ = Array.from(new Set([...owners, sigAddress]))\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: MultisigModularAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [salt, sigs_, threshold],\n }),\n ]);\n };\n\n const accountAddress = await getAccountAddress({\n client,\n entryPoint,\n accountAddress: accountAddress_,\n getAccountInitCode,\n });\n\n const baseAccount = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: MULTISIG_ACCOUNT_SOURCE,\n getAccountInitCode,\n ...standardExecutor,\n ...multisigSignMethods({\n client,\n accountAddress,\n threshold,\n signer: () => signer,\n }),\n });\n\n return {\n ...baseAccount,\n getLocalThreshold: () => threshold,\n publicKey: await signer.getAddress(),\n getSigner: () => signer,\n };\n}\n\nexport const isMultisigModularAccount = (\n acct: SmartContractAccount\n): acct is MultisigModularAccount => {\n return acct.source === MULTISIG_ACCOUNT_SOURCE;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../../src/msca/account-loupe/decorator.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AAEtB,+DAA4D;AA6CrD,MAAM,mBAAmB,GAQK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChD,0BAA0B,EAAE,KAAK,EAAE,EACjC,QAAQ,EACR,OAAO,GAAG,MAAM,CAAC,OAAO,GACzB,EAAE,EAAE;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,4BAA4B,EAC5B,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,4BAA4B;YAC1C,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QAClE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,mBAAmB;YACjC,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,uBAAuB;YACrC,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,EAAE,KAAK,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QAC1D,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM;aACV,YAAY,CAAC;YACZ,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,qBAAqB;SACpC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACF,CAAC,CAAC;AAhGU,QAAA,mBAAmB,uBAgG7B","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Address, Chain, Client, Hash, Transport } from \"viem\";\nimport { IAccountLoupeAbi } from \"../abis/IAccountLoupe.js\";\nimport type {\n ExecutionFunctionConfig,\n ExecutionHooks,\n FunctionReference,\n PreValidationHooks,\n} from \"./types.js\";\n\nexport type AccountLoupeActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = {\n /// @notice Gets the validation functions and plugin address for a selector\n /// @dev If the selector is a native function, the plugin address will be the address of the account\n /// @param selector The selector to get the configuration for\n /// @return The configuration for this selector\n getExecutionFunctionConfig(\n args: { selector: FunctionReference } & GetAccountParameter<TAccount>\n ): Promise<ExecutionFunctionConfig>;\n\n /// @notice Gets the pre and post execution hooks for a selector\n /// @param selector The selector to get the hooks for\n /// @return The pre and post execution hooks for this selector\n getExecutionHooks(\n args: {\n selector: FunctionReference;\n } & GetAccountParameter<TAccount>\n ): Promise<ReadonlyArray<ExecutionHooks>>;\n\n /// @notice Gets the pre user op and runtime validation hooks associated with a selector\n /// @param selector The selector to get the hooks for\n /// @return preUserOpValidationHooks The pre user op validation hooks for this selector\n /// @return preRuntimeValidationHooks The pre runtime validation hooks for this selector\n getPreValidationHooks(\n args: { selector: Hash } & GetAccountParameter<TAccount>\n ): Promise<Readonly<PreValidationHooks>>;\n\n /// @notice Gets an array of all installed plugins\n /// @return The addresses of all installed plugins\n getInstalledPlugins(\n args: GetAccountParameter<TAccount>\n ): Promise<ReadonlyArray<Address>>;\n};\n\nexport const accountLoupeActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => AccountLoupeActions<TAccount> = (client) => ({\n getExecutionFunctionConfig: async ({\n selector,\n account = client.account,\n }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getExecutionFunctionConfig\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getExecutionFunctionConfig\",\n args: [selector],\n });\n },\n\n getExecutionHooks: async ({ selector, account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getExecutionHooks\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getExecutionHooks\",\n args: [selector],\n });\n },\n\n getPreValidationHooks: async ({ selector, account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getPreValidationHooks\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getPreValidationHooks\",\n args: [selector],\n });\n },\n\n getInstalledPlugins: async ({ account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getInstalledPlugins\",\n client\n );\n }\n\n return client\n .readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getInstalledPlugins\",\n })\n .catch(() => []);\n },\n});\n"]}
1
+ {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../../src/msca/account-loupe/decorator.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AAEtB,+DAA4D;AA4DrD,MAAM,mBAAmB,GAQK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAChD,0BAA0B,EAAE,KAAK,EAAE,EACjC,QAAQ,EACR,OAAO,GAAG,MAAM,CAAC,OAAO,GACzB,EAAE,EAAE;QACH,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,4BAA4B,EAC5B,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,4BAA4B;YAC1C,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QAClE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,mBAAmB,EACnB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,mBAAmB;YACjC,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,qBAAqB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,uBAAuB,EACvB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC,YAAY,CAAC;YACzB,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,uBAAuB;YACrC,IAAI,EAAE,CAAC,QAAQ,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IAED,mBAAmB,EAAE,KAAK,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE;QAC1D,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;YAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,qBAAqB,EACrB,MAAM,CACP,CAAC;QACJ,CAAC;QAED,OAAO,MAAM;aACV,YAAY,CAAC;YACZ,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,GAAG,EAAE,mCAAgB;YACrB,YAAY,EAAE,qBAAqB;SACpC,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;CACF,CAAC,CAAC;AAhGU,QAAA,mBAAmB,uBAgG7B","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Address, Chain, Client, Hash, Transport } from \"viem\";\nimport { IAccountLoupeAbi } from \"../abis/IAccountLoupe.js\";\nimport type {\n ExecutionFunctionConfig,\n ExecutionHooks,\n FunctionReference,\n PreValidationHooks,\n} from \"./types.js\";\n\nexport type AccountLoupeActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = {\n /// @notice Gets the validation functions and plugin address for a selector\n /// @dev If the selector is a native function, the plugin address will be the address of the account\n /// @param selector The selector to get the configuration for\n /// @return The configuration for this selector\n getExecutionFunctionConfig(\n args: { selector: FunctionReference } & GetAccountParameter<TAccount>\n ): Promise<ExecutionFunctionConfig>;\n\n /// @notice Gets the pre and post execution hooks for a selector\n /// @param selector The selector to get the hooks for\n /// @return The pre and post execution hooks for this selector\n getExecutionHooks(\n args: {\n selector: FunctionReference;\n } & GetAccountParameter<TAccount>\n ): Promise<ReadonlyArray<ExecutionHooks>>;\n\n /// @notice Gets the pre user op and runtime validation hooks associated with a selector\n /// @param selector The selector to get the hooks for\n /// @return preUserOpValidationHooks The pre user op validation hooks for this selector\n /// @return preRuntimeValidationHooks The pre runtime validation hooks for this selector\n getPreValidationHooks(\n args: { selector: Hash } & GetAccountParameter<TAccount>\n ): Promise<Readonly<PreValidationHooks>>;\n\n /// @notice Gets an array of all installed plugins\n /// @return The addresses of all installed plugins\n getInstalledPlugins(\n args: GetAccountParameter<TAccount>\n ): Promise<ReadonlyArray<Address>>;\n};\n\n/**\n * Provides a set of actions for account loupe operations using the specified client.\n * NOTE: this is already added to the client when using any of the Modular Account Clients.\n *\n * @example\n * ```ts\n * import { accountLoupeActions } from \"@account-kit/smart-contracts\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const client = createSmartAccountClient(...).extend(accountLoupeActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client the client to be used for executing the account loupe actions\n * @returns {AccountLoupeActions<TAccount>} an object containing account loupe actions like `getExecutionFunctionConfig`, `getExecutionHooks`, `getPreValidationHooks`, and `getInstalledPlugins`\n */\nexport const accountLoupeActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => AccountLoupeActions<TAccount> = (client) => ({\n getExecutionFunctionConfig: async ({\n selector,\n account = client.account,\n }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getExecutionFunctionConfig\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getExecutionFunctionConfig\",\n args: [selector],\n });\n },\n\n getExecutionHooks: async ({ selector, account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getExecutionHooks\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getExecutionHooks\",\n args: [selector],\n });\n },\n\n getPreValidationHooks: async ({ selector, account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getPreValidationHooks\",\n client\n );\n }\n\n return client.readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getPreValidationHooks\",\n args: [selector],\n });\n },\n\n getInstalledPlugins: async ({ account = client.account }) => {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"getInstalledPlugins\",\n client\n );\n }\n\n return client\n .readContract({\n address: account.address,\n abi: IAccountLoupeAbi,\n functionName: \"getInstalledPlugins\",\n })\n .catch(() => []);\n },\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAWsC;AAEtC,+BAMc;AA4BP,KAAK,UAAU,iCAAiC,CACrD,MAAyC;IAEzC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,gDAA8B,EAAC;QACnD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC;SACC,MAAM,CAAC,yCAAuB,CAAC;SAC/B,MAAM,CAAC,sCAAoB,CAAC;SAC5B,MAAM,CAAC,qCAAmB,CAAC,CAAC;AACjC,CAAC;AAzBD,8EAyBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n accountLoupeActions,\n createMultiOwnerModularAccount,\n multiOwnerPluginActions,\n pluginManagerActions,\n type AccountLoupeActions,\n type CreateMultiOwnerModularAccountParams,\n type LightAccount,\n type MultiOwnerModularAccount,\n type MultiOwnerPluginActions,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n custom,\n type Chain,\n type CustomTransport,\n type HttpTransport,\n type Transport,\n} from \"viem\";\n\nexport type AlchemyModularAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerModularAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport function createModularAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyModularAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\nexport async function createModularAccountAlchemyClient(\n config: AlchemyModularAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultiOwnerModularAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n })\n .extend(multiOwnerPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n}\n"]}
1
+ {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/alchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAWsC;AAEtC,+BAMc;AAgDP,KAAK,UAAU,iCAAiC,CACrD,MAAyC;IAEzC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,gDAA8B,EAAC;QACnD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC;SACC,MAAM,CAAC,yCAAuB,CAAC;SAC/B,MAAM,CAAC,sCAAoB,CAAC;SAC5B,MAAM,CAAC,qCAAmB,CAAC,CAAC;AACjC,CAAC;AAzBD,8EAyBC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n accountLoupeActions,\n createMultiOwnerModularAccount,\n multiOwnerPluginActions,\n pluginManagerActions,\n type AccountLoupeActions,\n type CreateMultiOwnerModularAccountParams,\n type LightAccount,\n type MultiOwnerModularAccount,\n type MultiOwnerPluginActions,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport type { SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n custom,\n type Chain,\n type CustomTransport,\n type HttpTransport,\n type Transport,\n} from \"viem\";\n\nexport type AlchemyModularAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultiOwnerModularAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport function createModularAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyModularAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a modular account Alchemy client with the provided configuration.\n *\n * @example\n * ```ts\n * import { createModularAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const alchemyAccountClient = await createModularAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyModularAccountClientConfig} config The configuration for creating the Alchemy client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` configured with the desired plugins and actions\n */\nexport async function createModularAccountAlchemyClient(\n config: AlchemyModularAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultiOwnerModularAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n })\n .extend(multiOwnerPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/msca/client/client.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AAGtB,gEAGuC;AACvC,0EAIyC;AACzC,sEAIuC;AACvC,iEAGwC;AACxC,8DAGyC;AACzC,2DAIsC;AACtC,qEAAgF;AA8CzE,KAAK,UAAU,oCAAoC,CAAC,EACzD,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EAC4B;IAC3C,MAAM,cAAc,GAAG,MAAM,IAAA,qDAA8B,EAAC;QAC1D,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;KACxB,CAAC;SACC,MAAM,CAAC,mCAAoB,CAAC;SAC5B,MAAM,CAAC,kCAAuB,CAAC;SAC/B,MAAM,CAAC,kCAAmB,CAAC,CAAC;AACjC,CAAC;AArBD,oFAqBC;AAoBM,KAAK,UAAU,kCAAkC,CAAC,EACvD,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EAC0B;IAUzC,MAAM,cAAc,GAAG,MAAM,IAAA,iDAA4B,EAAC;QACxD,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,+BAAwB,EAAC;QACtC,GAAG,YAAY;QACf,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;QACvB,iBAAiB,EAAE,2CAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,gCAAyB,CAAC;SACjC,MAAM,CAAC,mCAAoB,CAAC;SAC5B,MAAM,CAAC,gCAAqB,CAAC;SAC7B,MAAM,CAAC,kCAAmB,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AAChB,CAAC;AAlCD,gFAkCC","sourcesContent":["import {\n createSmartAccountClient,\n smartAccountClientActions,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport type { CreateLightAccountClientParams } from \"../../light-account/clients/client.js\";\nimport {\n accountLoupeActions,\n type AccountLoupeActions,\n} from \"../account-loupe/decorator.js\";\nimport {\n createMultiOwnerModularAccount,\n type CreateMultiOwnerModularAccountParams,\n type MultiOwnerModularAccount,\n} from \"../account/multiOwnerAccount.js\";\nimport {\n createMultisigModularAccount,\n type CreateMultisigModularAccountParams,\n type MultisigModularAccount,\n} from \"../account/multisigAccount.js\";\nimport {\n pluginManagerActions,\n type PluginManagerActions,\n} from \"../plugin-manager/decorator.js\";\nimport {\n multiOwnerPluginActions,\n type MultiOwnerPluginActions,\n} from \"../plugins/multi-owner/index.js\";\nimport {\n multisigPluginActions,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n} from \"../plugins/multisig/index.js\";\nimport { multisigSignatureMiddleware } from \"../plugins/multisig/middleware.js\";\n\nexport type CreateMultiOwnerModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n account: Omit<\n CreateMultiOwnerModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n CreateLightAccountClientParams<TTransport, TChain, TSigner>,\n \"account\"\n>;\n\nexport type CreateMultisigModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n account: Omit<\n CreateMultisigModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n CreateLightAccountClientParams<TTransport, TChain, TSigner>,\n \"account\"\n>;\n\nexport function createMultiOwnerModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\nexport async function createMultiOwnerModularAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateMultiOwnerModularAccountClientParams): Promise<SmartAccountClient> {\n const modularAccount = await createMultiOwnerModularAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain,\n account: modularAccount,\n })\n .extend(pluginManagerActions)\n .extend(multiOwnerPluginActions)\n .extend(accountLoupeActions);\n}\n\nexport function createMultisigModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultisigModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n>;\n\nexport async function createMultisigModularAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateMultisigModularAccountClientParams): Promise<\n SmartAccountClient<\n Transport,\n Chain,\n MultisigModularAccount<SmartAccountSigner>,\n {},\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n> {\n const modularAccount = await createMultisigModularAccount({\n ...account,\n transport,\n chain,\n });\n\n const client = createSmartAccountClient({\n ...clientConfig,\n transport,\n chain,\n account: modularAccount,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(pluginManagerActions)\n .extend(multisigPluginActions)\n .extend(accountLoupeActions);\n\n return client;\n}\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/msca/client/client.ts"],"names":[],"mappings":";;;AAAA,uCAMsB;AAGtB,gEAGuC;AACvC,0EAIyC;AACzC,sEAIuC;AACvC,iEAGwC;AACxC,8DAGyC;AACzC,2DAIsC;AACtC,qEAAgF;AAoEzE,KAAK,UAAU,oCAAoC,CAAC,EACzD,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EAC4B;IAC3C,MAAM,cAAc,GAAG,MAAM,IAAA,qDAA8B,EAAC;QAC1D,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,OAAO,IAAA,+BAAwB,EAAC;QAC9B,GAAG,YAAY;QACf,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;KACxB,CAAC;SACC,MAAM,CAAC,mCAAoB,CAAC;SAC5B,MAAM,CAAC,kCAAuB,CAAC;SAC/B,MAAM,CAAC,kCAAmB,CAAC,CAAC;AACjC,CAAC;AArBD,oFAqBC;AA4CM,KAAK,UAAU,kCAAkC,CAAC,EACvD,OAAO,EACP,SAAS,EACT,KAAK,EACL,GAAG,YAAY,EAC0B;IAUzC,MAAM,cAAc,GAAG,MAAM,IAAA,iDAA4B,EAAC;QACxD,GAAG,OAAO;QACV,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAA,+BAAwB,EAAC;QACtC,GAAG,YAAY;QACf,SAAS;QACT,KAAK;QACL,OAAO,EAAE,cAAc;QACvB,iBAAiB,EAAE,2CAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,gCAAyB,CAAC;SACjC,MAAM,CAAC,mCAAoB,CAAC;SAC5B,MAAM,CAAC,gCAAqB,CAAC;SAC7B,MAAM,CAAC,kCAAmB,CAAC,CAAC;IAE/B,OAAO,MAAM,CAAC;AAChB,CAAC;AAlCD,gFAkCC","sourcesContent":["import {\n createSmartAccountClient,\n smartAccountClientActions,\n type SmartAccountClient,\n type SmartAccountClientRpcSchema,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport { type Chain, type CustomTransport, type Transport } from \"viem\";\nimport type { CreateLightAccountClientParams } from \"../../light-account/clients/client.js\";\nimport {\n accountLoupeActions,\n type AccountLoupeActions,\n} from \"../account-loupe/decorator.js\";\nimport {\n createMultiOwnerModularAccount,\n type CreateMultiOwnerModularAccountParams,\n type MultiOwnerModularAccount,\n} from \"../account/multiOwnerAccount.js\";\nimport {\n createMultisigModularAccount,\n type CreateMultisigModularAccountParams,\n type MultisigModularAccount,\n} from \"../account/multisigAccount.js\";\nimport {\n pluginManagerActions,\n type PluginManagerActions,\n} from \"../plugin-manager/decorator.js\";\nimport {\n multiOwnerPluginActions,\n type MultiOwnerPluginActions,\n} from \"../plugins/multi-owner/index.js\";\nimport {\n multisigPluginActions,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n} from \"../plugins/multisig/index.js\";\nimport { multisigSignatureMiddleware } from \"../plugins/multisig/middleware.js\";\n\nexport type CreateMultiOwnerModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n account: Omit<\n CreateMultiOwnerModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n CreateLightAccountClientParams<TTransport, TChain, TSigner>,\n \"account\"\n>;\n\nexport type CreateMultisigModularAccountClientParams<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = {\n account: Omit<\n CreateMultisigModularAccountParams<TTransport, TSigner>,\n \"transport\" | \"chain\"\n >;\n} & Omit<\n CreateLightAccountClientParams<TTransport, TChain, TSigner>,\n \"account\"\n>;\n\nexport function createMultiOwnerModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultiOwnerModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultiOwnerModularAccount<TSigner>,\n MultiOwnerPluginActions<MultiOwnerModularAccount<TSigner>> &\n PluginManagerActions<MultiOwnerModularAccount<TSigner>> &\n AccountLoupeActions<MultiOwnerModularAccount<TSigner>>\n >\n>;\n\n/**\n * Creates a multi-owner modular account client with the provided parameters including account, transport, chain, and additional client configuration. This function uses a modular account and extends it with various plugin actions.\n *\n * @example\n * ```ts\n * import { createMultiOwnerModularAccountClient } 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 accountClient = await createMultiOwnerModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * account: {\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * }\n * });\n * ```\n *\n * @param {CreateMultiOwnerModularAccountClientParams} config The parameters for creating the multi-owner modular account client\n * @returns {Promise<SmartAccountClient>} A promise that resolves to a `SmartAccountClient` instance with extended plugin actions\n */\nexport async function createMultiOwnerModularAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateMultiOwnerModularAccountClientParams): Promise<SmartAccountClient> {\n const modularAccount = await createMultiOwnerModularAccount({\n ...account,\n transport,\n chain,\n });\n\n return createSmartAccountClient({\n ...clientConfig,\n transport,\n chain,\n account: modularAccount,\n })\n .extend(pluginManagerActions)\n .extend(multiOwnerPluginActions)\n .extend(accountLoupeActions);\n}\n\nexport function createMultisigModularAccountClient<\n TChain extends Chain | undefined = Chain | undefined,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n args: CreateMultisigModularAccountClientParams<Transport, TChain, TSigner>\n): Promise<\n SmartAccountClient<\n CustomTransport,\n Chain,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n>;\n\n/**\n * Creates a multisig modular account client using the provided parameters including account details, transport, chain, and additional client configuration. This function constructs the multisig modular account and extends it with various actions to create a comprehensive client.\n *\n * @example\n * ```ts\n * import { createMultisigModularAccountClient } 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 accountClient = await createMultisigModularAccountClient({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * account: {\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [...], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * }\n * });\n * ```\n *\n * @param {CreateMultisigModularAccountClientParams} config the parameters for configuring the multisig modular account client\n * @returns {Promise<SmartAccountClient<Transport, Chain, MultisigModularAccount<SmartAccountSigner>, {}, SmartAccountClientRpcSchema, MultisigUserOperationContext>>} a promise that resolves to a `SmartAccountClient` object extended with the multisig modular account and additional actions\n */\nexport async function createMultisigModularAccountClient({\n account,\n transport,\n chain,\n ...clientConfig\n}: CreateMultisigModularAccountClientParams): Promise<\n SmartAccountClient<\n Transport,\n Chain,\n MultisigModularAccount<SmartAccountSigner>,\n {},\n SmartAccountClientRpcSchema,\n MultisigUserOperationContext\n >\n> {\n const modularAccount = await createMultisigModularAccount({\n ...account,\n transport,\n chain,\n });\n\n const client = createSmartAccountClient({\n ...clientConfig,\n transport,\n chain,\n account: modularAccount,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(pluginManagerActions)\n .extend(multisigPluginActions)\n .extend(accountLoupeActions);\n\n return client;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"multiSigAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAasC;AACtC,uCAGsB;AACtB,+BAMc;AAoCP,KAAK,UAAU,kCAAkC,CACtD,MAA0C;IAY1C,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,8CAA4B,EAAC;QACjD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAIhD;QACA,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;QACJ,iBAAiB,EAAE,6CAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,gCAAyB,CAAC;SACjC,MAAM,CAAC,uCAAqB,CAAC;SAC7B,MAAM,CAAC,sCAAoB,CAAC;SAC5B,MAAM,CAAC,qCAAmB,CAAC,CAAC;AACjC,CAAC;AAzCD,gFAyCC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n accountLoupeActions,\n createMultisigModularAccount,\n multisigPluginActions,\n multisigSignatureMiddleware,\n pluginManagerActions,\n type AccountLoupeActions,\n type CreateMultisigModularAccountParams,\n type LightAccount,\n type MultisigModularAccount,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport {\n smartAccountClientActions,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n custom,\n type Chain,\n type CustomTransport,\n type HttpTransport,\n type Transport,\n} from \"viem\";\n\n// todo: this file seems somewhat duplicated with ./modularAccountClient.ts, but that file has some multi-owner specific fields. Is there a way to refactor these two to de-dupe?\n\nexport type AlchemyMultisigAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultisigModularAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<\n Transport,\n Chain,\n LightAccount<TSigner>,\n MultisigUserOperationContext\n >,\n \"account\"\n >;\n\nexport function createMultisigAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultisigAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n MultisigUserOperationContext\n >\n>;\n\nexport async function createMultisigAccountAlchemyClient(\n config: AlchemyMultisigAccountClientConfig\n): Promise<\n AlchemySmartAccountClient<\n Transport,\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> &\n PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> &\n AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>,\n MultisigUserOperationContext\n >\n> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultisigModularAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting<\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigUserOperationContext\n >({\n ...config,\n client,\n account,\n opts,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(multisigPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n}\n"]}
1
+ {"version":3,"file":"multiSigAlchemyClient.js","sourceRoot":"","sources":["../../../../../src/msca/client/multiSigAlchemyClient.ts"],"names":[],"mappings":";;;AAAA,8CAM4B;AAC5B,kEAasC;AACtC,uCAGsB;AACtB,+BAMc;AA0DP,KAAK,UAAU,kCAAkC,CACtD,MAA0C;IAY1C,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,mCAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,8CAA4B,EAAC;QACjD,SAAS,EAAE,IAAA,aAAM,EAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,IAAA,mDAA2C,EAIhD;QACA,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;QACJ,iBAAiB,EAAE,6CAA2B;KAC/C,CAAC;SACC,MAAM,CAAC,gCAAyB,CAAC;SACjC,MAAM,CAAC,uCAAqB,CAAC;SAC7B,MAAM,CAAC,sCAAoB,CAAC;SAC5B,MAAM,CAAC,qCAAmB,CAAC,CAAC;AACjC,CAAC;AAzCD,gFAyCC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n accountLoupeActions,\n createMultisigModularAccount,\n multisigPluginActions,\n multisigSignatureMiddleware,\n pluginManagerActions,\n type AccountLoupeActions,\n type CreateMultisigModularAccountParams,\n type LightAccount,\n type MultisigModularAccount,\n type MultisigPluginActions,\n type MultisigUserOperationContext,\n type PluginManagerActions,\n} from \"@account-kit/smart-contracts\";\nimport {\n smartAccountClientActions,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n custom,\n type Chain,\n type CustomTransport,\n type HttpTransport,\n type Transport,\n} from \"viem\";\n\n// todo: this file seems somewhat duplicated with ./modularAccountClient.ts, but that file has some multi-owner specific fields. Is there a way to refactor these two to de-dupe?\n\nexport type AlchemyMultisigAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateMultisigModularAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<\n Transport,\n Chain,\n LightAccount<TSigner>,\n MultisigUserOperationContext\n >,\n \"account\"\n >;\n\nexport function createMultisigAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyMultisigAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n MultisigModularAccount<TSigner>,\n MultisigPluginActions<MultisigModularAccount<TSigner>> &\n PluginManagerActions<MultisigModularAccount<TSigner>> &\n AccountLoupeActions<MultisigModularAccount<TSigner>>,\n MultisigUserOperationContext\n >\n>;\n\n/**\n * Creates an Alchemy client for a multisig account using the provided configuration.\n *\n * @example\n * ```ts\n * import { createMultisigAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const alchemyAccountClient = await createMultisigAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey()),\n * owners: [...], // other owners on the account\n * threshold: 2, // 2 of N signatures\n * });\n * ```\n *\n * @param {AlchemyMultisigAccountClientConfig} config The configuration for the Alchemy multisig account client\n * @returns {Promise<AlchemySmartAccountClient<Transport, Chain | undefined, MultisigModularAccount<SmartAccountSigner>, MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> & PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> & AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>, MultisigUserOperationContext>>} A promise that resolves to an Alchemy Smart Account Client for multisig accounts with extended functionalities.\n */\nexport async function createMultisigAccountAlchemyClient(\n config: AlchemyMultisigAccountClientConfig\n): Promise<\n AlchemySmartAccountClient<\n Transport,\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigPluginActions<MultisigModularAccount<SmartAccountSigner>> &\n PluginManagerActions<MultisigModularAccount<SmartAccountSigner>> &\n AccountLoupeActions<MultisigModularAccount<SmartAccountSigner>>,\n MultisigUserOperationContext\n >\n> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createMultisigModularAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting<\n Chain | undefined,\n MultisigModularAccount<SmartAccountSigner>,\n MultisigUserOperationContext\n >({\n ...config,\n client,\n account,\n opts,\n signUserOperation: multisigSignatureMiddleware,\n })\n .extend(smartAccountClientActions)\n .extend(multisigPluginActions)\n .extend(pluginManagerActions)\n .extend(accountLoupeActions);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/msca/errors.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAEzC,MAAa,+BAAgC,SAAQ,gBAAS;IAE5D;QACE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAF/B;;;;mBAAO,iCAAiC;WAAC;IAGlD,CAAC;CACF;AALD,0EAKC;AAED,MAAa,4BAA6B,SAAQ,gBAAS;IAEzD;QACE,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAFhD;;;;mBAAO,8BAA8B;WAAC;IAG/C,CAAC;CACF;AALD,oEAKC;AAED,MAAa,4BAA6B,SAAQ,gBAAS;IAEzD;QACE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAFpD;;;;mBAAO,8BAA8B;WAAC;IAG/C,CAAC;CACF;AALD,oEAKC;AAED,MAAa,6BAA8B,SAAQ,gBAAS;IAE1D;QACE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAFlD;;;;mBAAO,+BAA+B;WAAC;IAGhD,CAAC;CACF;AALD,sEAKC","sourcesContent":["import { BaseError } from \"@aa-sdk/core\";\n\nexport class InvalidAggregatedSignatureError extends BaseError {\n override name = \"InvalidAggregatedSignatureError\";\n constructor() {\n super(\"Invalid aggregated signature\");\n }\n}\n\nexport class InvalidContextSignatureError extends BaseError {\n override name = \"InvalidContextSignatureError\";\n constructor() {\n super(\"Expected context.signature to be a hex string\");\n }\n}\n\nexport class MultisigAccountExpectedError extends BaseError {\n override name = \"MultisigAccountExpectedError\";\n constructor() {\n super(\"Expected account to be a multisig modular account\");\n }\n}\n\nexport class MultisigMissingSignatureError extends BaseError {\n override name = \"MultisigMissingSignatureError\";\n constructor() {\n super(\"UserOp must have at least one signature already\");\n }\n}\n"]}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/msca/errors.ts"],"names":[],"mappings":";;;AAAA,uCAAyC;AAKzC,MAAa,+BAAgC,SAAQ,gBAAS;IAE5D;QACE,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAF/B;;;;mBAAO,iCAAiC;WAAC;IAGlD,CAAC;CACF;AALD,0EAKC;AAKD,MAAa,4BAA6B,SAAQ,gBAAS;IAEzD;QACE,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAFhD;;;;mBAAO,8BAA8B;WAAC;IAG/C,CAAC;CACF;AALD,oEAKC;AAKD,MAAa,4BAA6B,SAAQ,gBAAS;IAEzD;QACE,KAAK,CAAC,mDAAmD,CAAC,CAAC;QAFpD;;;;mBAAO,8BAA8B;WAAC;IAG/C,CAAC;CACF;AALD,oEAKC;AAKD,MAAa,6BAA8B,SAAQ,gBAAS;IAE1D;QACE,KAAK,CAAC,iDAAiD,CAAC,CAAC;QAFlD;;;;mBAAO,+BAA+B;WAAC;IAGhD,CAAC;CACF;AALD,sEAKC","sourcesContent":["import { BaseError } from \"@aa-sdk/core\";\n\n/**\n * Error thrown when the aggregated signature is invalid\n */\nexport class InvalidAggregatedSignatureError extends BaseError {\n override name = \"InvalidAggregatedSignatureError\";\n constructor() {\n super(\"Invalid aggregated signature\");\n }\n}\n\n/**\n * Error thrown when the context signature is invalid\n */\nexport class InvalidContextSignatureError extends BaseError {\n override name = \"InvalidContextSignatureError\";\n constructor() {\n super(\"Expected context.signature to be a hex string\");\n }\n}\n\n/**\n * Error thrown when the expected account is not a multisig modular account\n */\nexport class MultisigAccountExpectedError extends BaseError {\n override name = \"MultisigAccountExpectedError\";\n constructor() {\n super(\"Expected account to be a multisig modular account\");\n }\n}\n\n/**\n * Error thrown when a multisig user op is missing a signature\n */\nexport class MultisigMissingSignatureError extends BaseError {\n override name = \"MultisigMissingSignatureError\";\n constructor() {\n super(\"UserOp must have at least one signature already\");\n }\n}\n"]}
@@ -8,4 +8,4 @@ export type PluginManagerActions<TAccount extends SmartContractAccount | undefin
8
8
  installPlugin: (params: InstallPluginParams<TAccount>) => Promise<SendUserOperationResult<TEntryPointVersion>>;
9
9
  uninstallPlugin: (params: UninstallPluginParams<TAccount>) => Promise<SendUserOperationResult<TEntryPointVersion>>;
10
10
  };
11
- export declare const pluginManagerActions: <TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<TTransport, TChain, TAccount>) => PluginManagerActions<TAccount>;
11
+ export declare function pluginManagerActions<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>(client: Client<TTransport, TChain, TAccount>): PluginManagerActions<TAccount>;
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pluginManagerActions = void 0;
4
4
  const installPlugin_js_1 = require("./installPlugin.js");
5
5
  const uninstallPlugin_js_1 = require("./uninstallPlugin.js");
6
- const pluginManagerActions = (client) => ({
7
- installPlugin: async (params) => (0, installPlugin_js_1.installPlugin)(client, params),
8
- uninstallPlugin: async (params) => (0, uninstallPlugin_js_1.uninstallPlugin)(client, params),
9
- });
6
+ function pluginManagerActions(client) {
7
+ return {
8
+ installPlugin: async (params) => (0, installPlugin_js_1.installPlugin)(client, params),
9
+ uninstallPlugin: async (params) => (0, uninstallPlugin_js_1.uninstallPlugin)(client, params),
10
+ };
11
+ }
10
12
  exports.pluginManagerActions = pluginManagerActions;
11
13
  //# sourceMappingURL=decorator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../../src/msca/plugin-manager/decorator.ts"],"names":[],"mappings":";;;AAMA,yDAA6E;AAC7E,6DAG8B;AAmBvB,MAAM,oBAAoB,GAQK,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACjD,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,MAAM,EAAE,MAAM,CAAC;IAC9D,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,oCAAe,EAAC,MAAM,EAAE,MAAM,CAAC;CACnE,CAAC,CAAC;AAXU,QAAA,oBAAoB,wBAW9B","sourcesContent":["import type {\n GetEntryPointFromAccount,\n SendUserOperationResult,\n SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { installPlugin, type InstallPluginParams } from \"./installPlugin.js\";\nimport {\n uninstallPlugin,\n type UninstallPluginParams,\n} from \"./uninstallPlugin.js\";\n\nexport { type InstallPluginParams } from \"./installPlugin.js\";\nexport { type UninstallPluginParams } from \"./uninstallPlugin.js\";\n\nexport type PluginManagerActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n installPlugin: (\n params: InstallPluginParams<TAccount>\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n uninstallPlugin: (\n params: UninstallPluginParams<TAccount>\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n};\n\nexport const pluginManagerActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => PluginManagerActions<TAccount> = (client) => ({\n installPlugin: async (params) => installPlugin(client, params),\n uninstallPlugin: async (params) => uninstallPlugin(client, params),\n});\n"]}
1
+ {"version":3,"file":"decorator.js","sourceRoot":"","sources":["../../../../../src/msca/plugin-manager/decorator.ts"],"names":[],"mappings":";;;AAMA,yDAA6E;AAC7E,6DAG8B;AAkC9B,SAAgB,oBAAoB,CAOlC,MAA4C;IAE5C,OAAO;QACL,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,gCAAa,EAAC,MAAM,EAAE,MAAM,CAAC;QAC9D,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,oCAAe,EAAC,MAAM,EAAE,MAAM,CAAC;KACnE,CAAC;AACJ,CAAC;AAbD,oDAaC","sourcesContent":["import type {\n GetEntryPointFromAccount,\n SendUserOperationResult,\n SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport type { Chain, Client, Transport } from \"viem\";\nimport { installPlugin, type InstallPluginParams } from \"./installPlugin.js\";\nimport {\n uninstallPlugin,\n type UninstallPluginParams,\n} from \"./uninstallPlugin.js\";\n\nexport { type InstallPluginParams } from \"./installPlugin.js\";\nexport { type UninstallPluginParams } from \"./uninstallPlugin.js\";\n\nexport type PluginManagerActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n installPlugin: (\n params: InstallPluginParams<TAccount>\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n uninstallPlugin: (\n params: UninstallPluginParams<TAccount>\n ) => Promise<SendUserOperationResult<TEntryPointVersion>>;\n};\n\n/**\n * Provides actions for managing plugins on a given client, including installing and uninstalling plugins.\n * NOTE: this is provided by default when using a modular account client\n *\n * @example\n * ```ts\n * import { pluginManagerActions } from \"@account-kit/smart-contracts\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const client = createSmartAccountClient(...).extend(pluginManagerActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance on which to manage plugins\n * @returns {PluginManagerActions<TAccount>} An object containing functions to install and uninstall plugins\n */\nexport function pluginManagerActions<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n): PluginManagerActions<TAccount> {\n return {\n installPlugin: async (params) => installPlugin(client, params),\n uninstallPlugin: async (params) => uninstallPlugin(client, params),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"installPlugin.js","sourceRoot":"","sources":["../../../../../src/msca/plugin-manager/installPlugin.ts"],"names":[],"mappings":";;;AAAA,uCAUsB;AACtB,+BASc;AACd,mDAAgD;AAChD,iEAA8D;AAoBvD,KAAK,UAAU,aAAa,CAUjC,MAA4C,EAC5C,EACE,SAAS,EACT,OAAO,EACP,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,GAAG,MAAM,EAC+B;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,eAAe,EACf,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,gCAAgC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC,iBAAiB,CAAC;QAC9B,EAAE,EAAE,QAAQ;QACZ,SAAS;QACT,OAAO;QACP,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAtCD,sCAsCC;AAEM,KAAK,UAAU,gCAAgC,CAOpD,MAAwD,EACxD,MAAsE;IAEtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;QAC/C,GAAG,EAAE,uBAAU;QACf,OAAO,EAAE,MAAM,CAAC,aAAa;QAC7B,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;IAEH,MAAM,YAAY,GAChB,MAAM,CAAC,YAAY;QACnB,IAAA,gBAAS,EACP,IAAA,2BAAoB,EAAC;YACnB,GAAG,EAAE,uBAAU;YACf,YAAY,EAAE,gBAAgB;YAC9B,MAAM,EAAE,cAAc;SACvB,CAAC,CACH,CAAC;IACJ,OAAO,IAAA,yBAAkB,EAAC;QACxB,GAAG,EAAE,qCAAiB;QACtB,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE;YACJ,MAAM,CAAC,aAAa;YACpB,YAAY;YACZ,MAAM,CAAC,cAAc,IAAI,IAAI;YAC7B,MAAM,CAAC,YAAY,IAAI,EAAE;SAC1B;KACF,CAAC,CAAC;AACL,CAAC;AAnCD,4EAmCC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetContextParameter,\n type GetEntryPointFromAccount,\n type SmartAccountClient,\n type SmartContractAccount,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport {\n encodeFunctionData,\n encodeFunctionResult,\n keccak256,\n type Address,\n type Chain,\n type Client,\n type Hash,\n type Transport,\n} from \"viem\";\nimport { IPluginAbi } from \"../abis/IPlugin.js\";\nimport { IPluginManagerAbi } from \"../abis/IPluginManager.js\";\nimport type { FunctionReference } from \"../account-loupe/types.js\";\n\nexport type InstallPluginParams<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends Record<string, unknown> | undefined =\n | Record<string, unknown>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n pluginAddress: Address;\n manifestHash?: Hash;\n pluginInitData?: Hash;\n dependencies?: FunctionReference[];\n} & UserOperationOverridesParameter<TEntryPointVersion> &\n GetAccountParameter<TAccount> &\n GetContextParameter<TContext>;\n\nexport async function installPlugin<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends Record<string, unknown> | undefined =\n | Record<string, unknown>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n {\n overrides,\n context,\n account = client.account,\n ...params\n }: InstallPluginParams<TAccount, TContext>\n) {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"installPlugin\",\n client\n );\n }\n\n const callData = await encodeInstallPluginUserOperation(client, params);\n\n return client.sendUserOperation({\n uo: callData,\n overrides,\n account,\n context,\n });\n}\n\nexport async function encodeInstallPluginUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: SmartAccountClient<TTransport, TChain, TAccount>,\n params: Omit<InstallPluginParams, \"overrides\" | \"account\" | \"context\">\n) {\n const pluginManifest = await client.readContract({\n abi: IPluginAbi,\n address: params.pluginAddress,\n functionName: \"pluginManifest\",\n });\n // use the manifest hash passed in or get it from the plugin\n const manifestHash: Hash =\n params.manifestHash ??\n keccak256(\n encodeFunctionResult({\n abi: IPluginAbi,\n functionName: \"pluginManifest\",\n result: pluginManifest,\n })\n );\n return encodeFunctionData({\n abi: IPluginManagerAbi,\n functionName: \"installPlugin\",\n args: [\n params.pluginAddress,\n manifestHash,\n params.pluginInitData ?? \"0x\",\n params.dependencies ?? [],\n ],\n });\n}\n"]}
1
+ {"version":3,"file":"installPlugin.js","sourceRoot":"","sources":["../../../../../src/msca/plugin-manager/installPlugin.ts"],"names":[],"mappings":";;;AAAA,uCAUsB;AACtB,+BASc;AACd,mDAAgD;AAChD,iEAA8D;AAyCvD,KAAK,UAAU,aAAa,CAUjC,MAA4C,EAC5C,EACE,SAAS,EACT,OAAO,EACP,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,GAAG,MAAM,EAC+B;IAE1C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,eAAe,EACf,MAAM,CACP,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,gCAAgC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC,iBAAiB,CAAC;QAC9B,EAAE,EAAE,QAAQ;QACZ,SAAS;QACT,OAAO;QACP,OAAO;KACR,CAAC,CAAC;AACL,CAAC;AAtCD,sCAsCC;AAEM,KAAK,UAAU,gCAAgC,CAOpD,MAAwD,EACxD,MAAsE;IAEtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;QAC/C,GAAG,EAAE,uBAAU;QACf,OAAO,EAAE,MAAM,CAAC,aAAa;QAC7B,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;IAEH,MAAM,YAAY,GAChB,MAAM,CAAC,YAAY;QACnB,IAAA,gBAAS,EACP,IAAA,2BAAoB,EAAC;YACnB,GAAG,EAAE,uBAAU;YACf,YAAY,EAAE,gBAAgB;YAC9B,MAAM,EAAE,cAAc;SACvB,CAAC,CACH,CAAC;IACJ,OAAO,IAAA,yBAAkB,EAAC;QACxB,GAAG,EAAE,qCAAiB;QACtB,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE;YACJ,MAAM,CAAC,aAAa;YACpB,YAAY;YACZ,MAAM,CAAC,cAAc,IAAI,IAAI;YAC7B,MAAM,CAAC,YAAY,IAAI,EAAE;SAC1B;KACF,CAAC,CAAC;AACL,CAAC;AAnCD,4EAmCC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n type GetAccountParameter,\n type GetContextParameter,\n type GetEntryPointFromAccount,\n type SmartAccountClient,\n type SmartContractAccount,\n type UserOperationOverridesParameter,\n} from \"@aa-sdk/core\";\nimport {\n encodeFunctionData,\n encodeFunctionResult,\n keccak256,\n type Address,\n type Chain,\n type Client,\n type Hash,\n type Transport,\n} from \"viem\";\nimport { IPluginAbi } from \"../abis/IPlugin.js\";\nimport { IPluginManagerAbi } from \"../abis/IPluginManager.js\";\nimport type { FunctionReference } from \"../account-loupe/types.js\";\n\nexport type InstallPluginParams<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends Record<string, unknown> | undefined =\n | Record<string, unknown>\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n> = {\n pluginAddress: Address;\n manifestHash?: Hash;\n pluginInitData?: Hash;\n dependencies?: FunctionReference[];\n} & UserOperationOverridesParameter<TEntryPointVersion> &\n GetAccountParameter<TAccount> &\n GetContextParameter<TContext>;\n\n/**\n * Installs a plugin on a smart account via the client, sending the user operation with the appropriate parameters.\n * NOTE: it's recommended to just use the installPlugin action returned from generated plugins\n *\n * @example\n * ```ts\n * import { installPlugin, createModularAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n *\n * const client = createModularAccountAlchemyClient(...);\n *\n * const hash = await installPlugin(client, {\n * pluginAddress: \"0x...\",\n * manifestHash: \"0x...\",\n * dependencies: [], // this is defined by the plugin you're installing\n * });\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client configured to the smart account on which the plugin will be installed\n * @param {InstallPluginParams<TAccount, TContext>} params The parameters required to install the plugin, including overrides, context, and account information\n * @returns {Promise<any>} A promise that resolves once the plugin installation operation is sent\n */\nexport async function installPlugin<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TContext extends Record<string, unknown> | undefined =\n | Record<string, unknown>\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n {\n overrides,\n context,\n account = client.account,\n ...params\n }: InstallPluginParams<TAccount, TContext>\n) {\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"installPlugin\",\n client\n );\n }\n\n const callData = await encodeInstallPluginUserOperation(client, params);\n\n return client.sendUserOperation({\n uo: callData,\n overrides,\n account,\n context,\n });\n}\n\nexport async function encodeInstallPluginUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: SmartAccountClient<TTransport, TChain, TAccount>,\n params: Omit<InstallPluginParams, \"overrides\" | \"account\" | \"context\">\n) {\n const pluginManifest = await client.readContract({\n abi: IPluginAbi,\n address: params.pluginAddress,\n functionName: \"pluginManifest\",\n });\n // use the manifest hash passed in or get it from the plugin\n const manifestHash: Hash =\n params.manifestHash ??\n keccak256(\n encodeFunctionResult({\n abi: IPluginAbi,\n functionName: \"pluginManifest\",\n result: pluginManifest,\n })\n );\n return encodeFunctionData({\n abi: IPluginManagerAbi,\n functionName: \"installPlugin\",\n args: [\n params.pluginAddress,\n manifestHash,\n params.pluginInitData ?? \"0x\",\n params.dependencies ?? [],\n ],\n });\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multi-owner/extension.ts"],"names":[],"mappings":";;;AAAA,uCAKsB;AAGtB,2CAIqB;AAuBd,MAAM,uBAAuB,GAQK,CAOvC,MAA4C,EAC5C,EAAE,CAAC,CAAC;IACJ,GAAG,IAAA,mCAAwB,EAAC,MAAM,CAAC;IACnC,KAAK,CAAC,UAAU,CACd,IAA+D;QAE/D,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;QAChD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAGD,MAAM,QAAQ,GAAG,4BAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QAC3E,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,SAAS,CACb,IAC+B;QAE/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAGD,MAAM,QAAQ,GAAG,4BAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,CAAC;CACF,CAAC,CAAC;AA5CU,QAAA,uBAAuB,2BA4CjC","sourcesContent":["import {\n AccountNotFoundError,\n type GetAccountParameter,\n type IsUndefined,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Address, type Chain, type Client, type Transport } from \"viem\";\nimport type { GetPluginAddressParameter } from \"../types.js\";\nimport {\n MultiOwnerPlugin,\n multiOwnerPluginActions as multiOwnerPluginActions_,\n type MultiOwnerPluginActions as MultiOwnerPluginActions_,\n} from \"./plugin.js\";\n\nexport type MultiOwnerPluginActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = MultiOwnerPluginActions_<TAccount, undefined> & {\n readOwners: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n\n isOwnerOf: (\n params: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => Promise<boolean>;\n} & (IsUndefined<TAccount> extends false\n ? {\n readOwners: (\n params?: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n }\n : {});\n\nexport const multiOwnerPluginActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultiOwnerPluginActions<TAccount> = <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => ({\n ...multiOwnerPluginActions_(client),\n async readOwners(\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) {\n const account = args?.account ?? client.account;\n if (!account) {\n throw new AccountNotFoundError();\n }\n // TODO: check if the account actually has the plugin installed\n // either via account loupe or checking if the supports interface call passes on the account\n const contract = MultiOwnerPlugin.getContract(client, args?.pluginAddress);\n return contract.read.ownersOf([account.address]);\n },\n\n async isOwnerOf(\n args: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) {\n const account = args.account ?? client.account;\n if (!account) {\n throw new AccountNotFoundError();\n }\n // TODO: check if the account actually has the plugin installed\n // either via account loupe or checking if the supports interface call passes on the account\n const contract = MultiOwnerPlugin.getContract(client, args.pluginAddress);\n return contract.read.isOwnerOf([account.address, args.address]);\n },\n});\n"]}
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multi-owner/extension.ts"],"names":[],"mappings":";;;AAAA,uCAKsB;AAGtB,2CAIqB;AAsCd,MAAM,uBAAuB,GAQK,CAOvC,MAA4C,EAC5C,EAAE,CAAC,CAAC;IACJ,GAAG,IAAA,mCAAwB,EAAC,MAAM,CAAC;IACnC,KAAK,CAAC,UAAU,CACd,IAA+D;QAE/D,MAAM,OAAO,GAAG,IAAI,EAAE,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;QAChD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAGD,MAAM,QAAQ,GAAG,4BAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;QAC3E,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,SAAS,CACb,IAC+B;QAE/B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC;QAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;QACnC,CAAC;QAGD,MAAM,QAAQ,GAAG,4BAAgB,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAC1E,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IAClE,CAAC;CACF,CAAC,CAAC;AA5CU,QAAA,uBAAuB,2BA4CjC","sourcesContent":["import {\n AccountNotFoundError,\n type GetAccountParameter,\n type IsUndefined,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Address, type Chain, type Client, type Transport } from \"viem\";\nimport type { GetPluginAddressParameter } from \"../types.js\";\nimport {\n MultiOwnerPlugin,\n multiOwnerPluginActions as multiOwnerPluginActions_,\n type MultiOwnerPluginActions as MultiOwnerPluginActions_,\n} from \"./plugin.js\";\n\nexport type MultiOwnerPluginActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = MultiOwnerPluginActions_<TAccount, undefined> & {\n readOwners: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n\n isOwnerOf: (\n params: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => Promise<boolean>;\n} & (IsUndefined<TAccount> extends false\n ? {\n readOwners: (\n params?: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n }\n : {});\n\n/**\n * Creates actions for the MultiOwner plugin, including reading owners and checking ownership.\n * NOTE: this is already added to the client returned from createMultiOwnerModularAccountClient\n *\n * @example\n * ```ts\n * import { multiOwnerPluginActions } from \"@account-kit/smart-contracts\";\n * import { createSmartAccountClient } from \"@aa-sdk/core\";\n *\n * const client = createSmartAccountClient(...).extend(multiOwnerPluginActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client the client instance containing the transport, chain, and account information\n * @returns {MultiOwnerPluginActions<TAccount>} an object containing the actions for the MultiOwner plugin, such as `readOwners` and `isOwnerOf`\n */\nexport const multiOwnerPluginActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultiOwnerPluginActions<TAccount> = <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => ({\n ...multiOwnerPluginActions_(client),\n async readOwners(\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) {\n const account = args?.account ?? client.account;\n if (!account) {\n throw new AccountNotFoundError();\n }\n // TODO: check if the account actually has the plugin installed\n // either via account loupe or checking if the supports interface call passes on the account\n const contract = MultiOwnerPlugin.getContract(client, args?.pluginAddress);\n return contract.read.ownersOf([account.address]);\n },\n\n async isOwnerOf(\n args: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) {\n const account = args.account ?? client.account;\n if (!account) {\n throw new AccountNotFoundError();\n }\n // TODO: check if the account actually has the plugin installed\n // either via account loupe or checking if the supports interface call passes on the account\n const contract = MultiOwnerPlugin.getContract(client, args.pluginAddress);\n return contract.read.isOwnerOf([account.address, args.address]);\n },\n});\n"]}
@@ -1,3 +1,3 @@
1
1
  export type * from "./extension.js";
2
2
  export { multiOwnerPluginActions } from "./extension.js";
3
- export { MultiOwnerPluginAbi, MultiOwnerPluginExecutionFunctionAbi, } from "./plugin.js";
3
+ export { MultiOwnerPlugin, MultiOwnerPluginAbi, MultiOwnerPluginExecutionFunctionAbi, type InstallMultiOwnerPluginParams, } from "./plugin.js";
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MultiOwnerPluginExecutionFunctionAbi = exports.MultiOwnerPluginAbi = exports.multiOwnerPluginActions = void 0;
3
+ exports.MultiOwnerPluginExecutionFunctionAbi = exports.MultiOwnerPluginAbi = exports.MultiOwnerPlugin = exports.multiOwnerPluginActions = void 0;
4
4
  var extension_js_1 = require("./extension.js");
5
5
  Object.defineProperty(exports, "multiOwnerPluginActions", { enumerable: true, get: function () { return extension_js_1.multiOwnerPluginActions; } });
6
6
  var plugin_js_1 = require("./plugin.js");
7
+ Object.defineProperty(exports, "MultiOwnerPlugin", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPlugin; } });
7
8
  Object.defineProperty(exports, "MultiOwnerPluginAbi", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPluginAbi; } });
8
9
  Object.defineProperty(exports, "MultiOwnerPluginExecutionFunctionAbi", { enumerable: true, get: function () { return plugin_js_1.MultiOwnerPluginExecutionFunctionAbi; } });
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multi-owner/index.ts"],"names":[],"mappings":";;;AACA,+CAAyD;AAAhD,uHAAA,uBAAuB,OAAA;AAChC,yCAGqB;AAFnB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA","sourcesContent":["export type * from \"./extension.js\";\nexport { multiOwnerPluginActions } from \"./extension.js\";\nexport {\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./plugin.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multi-owner/index.ts"],"names":[],"mappings":";;;AACA,+CAAyD;AAAhD,uHAAA,uBAAuB,OAAA;AAEhC,yCAKqB;AAJnB,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA","sourcesContent":["export type * from \"./extension.js\";\nexport { multiOwnerPluginActions } from \"./extension.js\";\n\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n type InstallMultiOwnerPluginParams,\n} from \"./plugin.js\";\n"]}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.proposeUserOperation = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
- const index_js_1 = require("../index.js");
5
+ const splitAggregatedSignature_js_1 = require("../utils/splitAggregatedSignature.js");
6
6
  async function proposeUserOperation(client, { uo, account = client.account, overrides: overrides_, }) {
7
7
  const overrides = {
8
8
  maxFeePerGas: { multiplier: 3 },
@@ -31,7 +31,7 @@ async function proposeUserOperation(client, { uo, account = client.account, over
31
31
  userOpSignatureType: "UPPERLIMIT",
32
32
  },
33
33
  });
34
- const splitSignatures = await (0, index_js_1.splitAggregatedSignature)({
34
+ const splitSignatures = await (0, splitAggregatedSignature_js_1.splitAggregatedSignature)({
35
35
  request,
36
36
  aggregatedSignature: request.signature,
37
37
  account,
@@ -1 +1 @@
1
- {"version":3,"file":"proposeUserOperation.js","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/actions/proposeUserOperation.ts"],"names":[],"mappings":";;;AAAA,uCAUsB;AAEtB,0CAAuD;AAGhD,KAAK,UAAU,oBAAoB,CAQxC,MAA4C,EAC5C,EACE,EAAE,EACF,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,EAAE,UAAU,GAC4B;IAGnD,MAAM,SAAS,GAAG;QAChB,YAAY,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE;QAC/B,oBAAoB,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE;QACvC,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;QACxC,GAAG,UAAU;KACgC,CAAC;IAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAA,+BAAwB,EAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,0CAAmC,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9C,OAAO;QACP,EAAE;QACF,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC7C,QAAQ,EAAE,OAAO;QACjB,OAAO;QACP,OAAO,EAAE;YACP,mBAAmB,EAAE,YAAY;SAClC;KACF,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,IAAA,mCAAwB,EAAC;QACrD,OAAO;QACP,mBAAmB,EAAE,OAAO,CAAC,SAAS;QACtC,OAAO;QAEP,SAAS,EAAE,CAAC;KACb,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3C,mBAAmB,EAAE,OAAO,CAAC,SAAS;KACvC,CAAC;AACJ,CAAC;AAlED,oDAkEC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n isSmartAccountWithSigner,\n SmartAccountWithSignerRequiredError,\n type GetEntryPointFromAccount,\n type SendUserOperationParameters,\n type SmartContractAccount,\n type UserOperationOverrides,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Client, type Transport } from \"viem\";\nimport { splitAggregatedSignature } from \"../index.js\";\nimport { type ProposeUserOperationResult } from \"../types.js\";\n\nexport async function proposeUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n>(\n client: Client<TTransport, TChain, TAccount>,\n {\n uo,\n account = client.account,\n overrides: overrides_,\n }: SendUserOperationParameters<TAccount, undefined>\n): Promise<ProposeUserOperationResult> {\n // these overrides allow us to set a high max fee and PVG upper bound\n const overrides = {\n maxFeePerGas: { multiplier: 3 },\n maxPriorityFeePerGas: { multiplier: 2 },\n preVerificationGas: { multiplier: 1000 },\n ...overrides_,\n } as UserOperationOverrides<TEntryPointVersion>;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"proposeUserOperation\",\n client\n );\n }\n\n if (!isSmartAccountWithSigner(account)) {\n throw new SmartAccountWithSignerRequiredError();\n }\n\n const builtUo = await client.buildUserOperation({\n account,\n uo,\n overrides,\n });\n\n const request = await client.signUserOperation({\n uoStruct: builtUo,\n account,\n context: {\n userOpSignatureType: \"UPPERLIMIT\",\n },\n });\n\n const splitSignatures = await splitAggregatedSignature({\n request,\n aggregatedSignature: request.signature,\n account,\n // split works on the assumption that we have t - 1 signatures\n threshold: 2,\n });\n\n return {\n request,\n signatureObj: splitSignatures.signatures[0],\n aggregatedSignature: request.signature,\n };\n}\n"]}
1
+ {"version":3,"file":"proposeUserOperation.js","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/actions/proposeUserOperation.ts"],"names":[],"mappings":";;;AAAA,uCAUsB;AAGtB,sFAAgF;AAEzE,KAAK,UAAU,oBAAoB,CAQxC,MAA4C,EAC5C,EACE,EAAE,EACF,OAAO,GAAG,MAAM,CAAC,OAAO,EACxB,SAAS,EAAE,UAAU,GAC4B;IAGnD,MAAM,SAAS,GAAG;QAChB,YAAY,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE;QAC/B,oBAAoB,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE;QACvC,kBAAkB,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;QACxC,GAAG,UAAU;KACgC,CAAC;IAEhD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,sBAAsB,EACtB,MAAM,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAA,+BAAwB,EAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,0CAAmC,EAAE,CAAC;IAClD,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC;QAC9C,OAAO;QACP,EAAE;QACF,SAAS;KACV,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QAC7C,QAAQ,EAAE,OAAO;QACjB,OAAO;QACP,OAAO,EAAE;YACP,mBAAmB,EAAE,YAAY;SAClC;KACF,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,IAAA,sDAAwB,EAAC;QACrD,OAAO;QACP,mBAAmB,EAAE,OAAO,CAAC,SAAS;QACtC,OAAO;QAEP,SAAS,EAAE,CAAC;KACb,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,YAAY,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3C,mBAAmB,EAAE,OAAO,CAAC,SAAS;KACvC,CAAC;AACJ,CAAC;AAlED,oDAkEC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n isSmartAccountClient,\n isSmartAccountWithSigner,\n SmartAccountWithSignerRequiredError,\n type GetEntryPointFromAccount,\n type SendUserOperationParameters,\n type SmartContractAccount,\n type UserOperationOverrides,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Client, type Transport } from \"viem\";\nimport { type ProposeUserOperationResult } from \"../types.js\";\nimport { splitAggregatedSignature } from \"../utils/splitAggregatedSignature.js\";\n\nexport async function proposeUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined,\n TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>\n>(\n client: Client<TTransport, TChain, TAccount>,\n {\n uo,\n account = client.account,\n overrides: overrides_,\n }: SendUserOperationParameters<TAccount, undefined>\n): Promise<ProposeUserOperationResult> {\n // these overrides allow us to set a high max fee and PVG upper bound\n const overrides = {\n maxFeePerGas: { multiplier: 3 },\n maxPriorityFeePerGas: { multiplier: 2 },\n preVerificationGas: { multiplier: 1000 },\n ...overrides_,\n } as UserOperationOverrides<TEntryPointVersion>;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"proposeUserOperation\",\n client\n );\n }\n\n if (!isSmartAccountWithSigner(account)) {\n throw new SmartAccountWithSignerRequiredError();\n }\n\n const builtUo = await client.buildUserOperation({\n account,\n uo,\n overrides,\n });\n\n const request = await client.signUserOperation({\n uoStruct: builtUo,\n account,\n context: {\n userOpSignatureType: \"UPPERLIMIT\",\n },\n });\n\n const splitSignatures = await splitAggregatedSignature({\n request,\n aggregatedSignature: request.signature,\n account,\n // split works on the assumption that we have t - 1 signatures\n threshold: 2,\n });\n\n return {\n request,\n signatureObj: splitSignatures.signatures[0],\n aggregatedSignature: request.signature,\n };\n}\n"]}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.signMultisigUserOperation = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
5
  const errors_js_1 = require("../../../errors.js");
6
- const index_js_1 = require("../index.js");
6
+ const index_js_1 = require("../utils/index.js");
7
7
  async function signMultisigUserOperation(client, params) {
8
8
  const { account = client.account, signatures, userOperationRequest } = params;
9
9
  if (!account) {
@@ -1 +1 @@
1
- {"version":3,"file":"signMultisigUserOperation.js","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/actions/signMultisigUserOperation.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,kDAAmE;AACnE,0CAA0E;AAMnE,KAAK,UAAU,yBAAyB,CAO7C,MAA4C,EAC5C,MAAiD;IAEjD,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;IAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,2BAA2B,EAC3B,MAAM,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAA,+BAAwB,EAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,0CAAmC,EAAE,CAAC;IAClD,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,yCAA6B,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;IAE7D,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QACnD,OAAO;QACP,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EAAE;YACP,mBAAmB,EAAE,IAAA,4BAAiB,EAAC;gBACrC,UAAU;gBACV,sBAAsB,EAAE,oBAAoB,CAAC,YAAY;gBACzD,8BAA8B,EAC5B,oBAAoB,CAAC,oBAAoB;gBAC3C,aAAa,EAAE,oBAAoB,CAAC,kBAAkB;gBACtD,cAAc,EAAE,KAAK;aACtB,CAAC;YACF,UAAU;YACV,mBAAmB,EAAE,YAAY;SAClC;KACF,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,IAAA,mCAAwB,EAAC;QACrD,OAAO;QACP,OAAO,EAAE,aAAa;QACtB,mBAAmB,EAAE,aAAa,CAAC,SAAS;QAG5C,SAAS,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;KACjC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAClD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,aAAa,CAClC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE,CAAC;QAElB,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY;QACZ,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,mBAAmB,EAAE,aAAa,CAAC,SAAS;KAC7C,CAAC;AACJ,CAAC;AA5ED,8DA4EC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n SmartAccountWithSignerRequiredError,\n isSmartAccountClient,\n isSmartAccountWithSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Client, type Transport } from \"viem\";\nimport { MultisigMissingSignatureError } from \"../../../errors.js\";\nimport { combineSignatures, splitAggregatedSignature } from \"../index.js\";\nimport {\n type SignMultisigUserOperationParams,\n type SignMultisigUserOperationResult,\n} from \"../types.js\";\n\nexport async function signMultisigUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n params: SignMultisigUserOperationParams<TAccount>\n): Promise<SignMultisigUserOperationResult> {\n const { account = client.account, signatures, userOperationRequest } = params;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"signMultisigUserOperation\",\n client\n );\n }\n\n if (!isSmartAccountWithSigner(account)) {\n throw new SmartAccountWithSignerRequiredError();\n }\n\n if (!signatures.length) {\n throw new MultisigMissingSignatureError();\n }\n\n const signerAddress = await account.getSigner().getAddress();\n\n const signedRequest = await client.signUserOperation({\n account,\n uoStruct: userOperationRequest,\n context: {\n aggregatedSignature: combineSignatures({\n signatures,\n upperLimitMaxFeePerGas: userOperationRequest.maxFeePerGas,\n upperLimitMaxPriorityFeePerGas:\n userOperationRequest.maxPriorityFeePerGas,\n upperLimitPvg: userOperationRequest.preVerificationGas,\n usingMaxValues: false,\n }),\n signatures,\n userOpSignatureType: \"UPPERLIMIT\",\n },\n });\n\n const splitSignatures = await splitAggregatedSignature({\n account,\n request: signedRequest,\n aggregatedSignature: signedRequest.signature,\n // split works on the assumption that we have t - 1 signatures\n // we have signatures.length + 1 signatures now, so we need sl + 1 + 1\n threshold: signatures.length + 2,\n });\n\n const signatureObj = splitSignatures.signatures.find(\n (x) => x.signer === signerAddress\n );\n\n if (!signatureObj) {\n // TODO: strongly type this\n throw new Error(\n \"INTERNAL ERROR: signature not found in split signatures, this is an internal bug please report\"\n );\n }\n\n return {\n signatureObj,\n signature: signatureObj.signature,\n aggregatedSignature: signedRequest.signature,\n };\n}\n"]}
1
+ {"version":3,"file":"signMultisigUserOperation.js","sourceRoot":"","sources":["../../../../../../../src/msca/plugins/multisig/actions/signMultisigUserOperation.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AAEtB,kDAAmE;AAKnE,gDAAgF;AAEzE,KAAK,UAAU,yBAAyB,CAO7C,MAA4C,EAC5C,MAAiD;IAEjD,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,GAAG,MAAM,CAAC;IAE9E,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,2BAAoB,EAAE,CAAC;IACnC,CAAC;IAED,IAAI,CAAC,IAAA,2BAAoB,EAAC,MAAM,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,8BAAuB,CAC/B,oBAAoB,EACpB,2BAA2B,EAC3B,MAAM,CACP,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAA,+BAAwB,EAAC,OAAO,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,0CAAmC,EAAE,CAAC;IAClD,CAAC;IAED,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACvB,MAAM,IAAI,yCAA6B,EAAE,CAAC;IAC5C,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,OAAO,CAAC,SAAS,EAAE,CAAC,UAAU,EAAE,CAAC;IAE7D,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC;QACnD,OAAO;QACP,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EAAE;YACP,mBAAmB,EAAE,IAAA,4BAAiB,EAAC;gBACrC,UAAU;gBACV,sBAAsB,EAAE,oBAAoB,CAAC,YAAY;gBACzD,8BAA8B,EAC5B,oBAAoB,CAAC,oBAAoB;gBAC3C,aAAa,EAAE,oBAAoB,CAAC,kBAAkB;gBACtD,cAAc,EAAE,KAAK;aACtB,CAAC;YACF,UAAU;YACV,mBAAmB,EAAE,YAAY;SAClC;KACF,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,IAAA,mCAAwB,EAAC;QACrD,OAAO;QACP,OAAO,EAAE,aAAa;QACtB,mBAAmB,EAAE,aAAa,CAAC,SAAS;QAG5C,SAAS,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;KACjC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC,IAAI,CAClD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,aAAa,CAClC,CAAC;IAEF,IAAI,CAAC,YAAY,EAAE,CAAC;QAElB,MAAM,IAAI,KAAK,CACb,gGAAgG,CACjG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,YAAY;QACZ,SAAS,EAAE,YAAY,CAAC,SAAS;QACjC,mBAAmB,EAAE,aAAa,CAAC,SAAS;KAC7C,CAAC;AACJ,CAAC;AA5ED,8DA4EC","sourcesContent":["import {\n AccountNotFoundError,\n IncompatibleClientError,\n SmartAccountWithSignerRequiredError,\n isSmartAccountClient,\n isSmartAccountWithSigner,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Chain, type Client, type Transport } from \"viem\";\nimport { MultisigMissingSignatureError } from \"../../../errors.js\";\nimport {\n type SignMultisigUserOperationParams,\n type SignMultisigUserOperationResult,\n} from \"../types.js\";\nimport { combineSignatures, splitAggregatedSignature } from \"../utils/index.js\";\n\nexport async function signMultisigUserOperation<\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>,\n params: SignMultisigUserOperationParams<TAccount>\n): Promise<SignMultisigUserOperationResult> {\n const { account = client.account, signatures, userOperationRequest } = params;\n\n if (!account) {\n throw new AccountNotFoundError();\n }\n\n if (!isSmartAccountClient(client)) {\n throw new IncompatibleClientError(\n \"SmartAccountClient\",\n \"signMultisigUserOperation\",\n client\n );\n }\n\n if (!isSmartAccountWithSigner(account)) {\n throw new SmartAccountWithSignerRequiredError();\n }\n\n if (!signatures.length) {\n throw new MultisigMissingSignatureError();\n }\n\n const signerAddress = await account.getSigner().getAddress();\n\n const signedRequest = await client.signUserOperation({\n account,\n uoStruct: userOperationRequest,\n context: {\n aggregatedSignature: combineSignatures({\n signatures,\n upperLimitMaxFeePerGas: userOperationRequest.maxFeePerGas,\n upperLimitMaxPriorityFeePerGas:\n userOperationRequest.maxPriorityFeePerGas,\n upperLimitPvg: userOperationRequest.preVerificationGas,\n usingMaxValues: false,\n }),\n signatures,\n userOpSignatureType: \"UPPERLIMIT\",\n },\n });\n\n const splitSignatures = await splitAggregatedSignature({\n account,\n request: signedRequest,\n aggregatedSignature: signedRequest.signature,\n // split works on the assumption that we have t - 1 signatures\n // we have signatures.length + 1 signatures now, so we need sl + 1 + 1\n threshold: signatures.length + 2,\n });\n\n const signatureObj = splitSignatures.signatures.find(\n (x) => x.signer === signerAddress\n );\n\n if (!signatureObj) {\n // TODO: strongly type this\n throw new Error(\n \"INTERNAL ERROR: signature not found in split signatures, this is an internal bug please report\"\n );\n }\n\n return {\n signatureObj,\n signature: signatureObj.signature,\n aggregatedSignature: signedRequest.signature,\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multisig/extension.ts"],"names":[],"mappings":";;;AASA,+DAAyD;AACzD,yDAAmD;AACnD,+EAAyE;AACzE,2DAAqD;AACrD,yFAAmF;AACnF,2CAGqB;AA2Cd,MAAM,qBAAqB,GAQK,CAOrC,MAA4C,EAC5C,EAAE,CAAC,CAAC;IACJ,GAAG,IAAA,iCAAsB,EAAC,MAAM,CAAC;IACjC,UAAU,EAAE,CACV,IAA+D,EAC/D,EAAE,CAAC,IAAA,0BAAU,EAAC,MAAM,EAAE,IAAI,CAAC;IAE7B,SAAS,EAAE,CACT,IAC+B,EAC/B,EAAE,CAAC,IAAA,wBAAS,EAAC,MAAM,EAAE,IAAI,CAAC;IAE5B,YAAY,EAAE,CACZ,IAA+D,EAC/D,EAAE,CAAC,IAAA,8BAAY,EAAC,MAAM,EAAE,IAAI,CAAC;IAE/B,oBAAoB,EAAE,CACpB,IAAsD,EACtD,EAAE,CAAC,IAAA,8CAAoB,EAAC,MAAM,EAAE,IAAI,CAAC;IAEvC,yBAAyB,EAAE,CACzB,MAAiD,EACP,EAAE,CAC5C,IAAA,wDAAyB,EAAC,MAAM,EAAE,MAAM,CAAC;CAC5C,CAAC,CAAC;AAvCU,QAAA,qBAAqB,yBAuC/B","sourcesContent":["import {\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type IsUndefined,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Address, type Chain, type Client, type Transport } from \"viem\";\nimport type { GetPluginAddressParameter } from \"../types.js\";\nimport { getThreshold } from \"./actions/getThreshold.js\";\nimport { isOwnerOf } from \"./actions/isOwnerOf.js\";\nimport { proposeUserOperation } from \"./actions/proposeUserOperation.js\";\nimport { readOwners } from \"./actions/readOwners.js\";\nimport { signMultisigUserOperation } from \"./actions/signMultisigUserOperation.js\";\nimport {\n multisigPluginActions as multisigPluginActions_,\n type MultisigPluginActions as MultisigPluginActions_,\n} from \"./plugin.js\";\nimport {\n type MultisigUserOperationContext,\n type ProposeUserOperationResult,\n type SignMultisigUserOperationParams,\n type SignMultisigUserOperationResult,\n} from \"./types.js\";\n\nexport type MultisigPluginActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = MultisigPluginActions_<TAccount, MultisigUserOperationContext> & {\n readOwners: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n\n isOwnerOf: (\n params: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => Promise<boolean>;\n\n getThreshold: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<bigint>;\n\n proposeUserOperation: (\n params: SendUserOperationParameters<TAccount, undefined>\n ) => Promise<\n ProposeUserOperationResult<TAccount, GetEntryPointFromAccount<TAccount>>\n >;\n\n signMultisigUserOperation: (\n params: SignMultisigUserOperationParams<TAccount>\n ) => Promise<SignMultisigUserOperationResult>;\n} & (IsUndefined<TAccount> extends false\n ? {\n readOwners: (\n params?: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n }\n : {});\n\nexport const multisigPluginActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultisigPluginActions<TAccount> = <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => ({\n ...multisigPluginActions_(client),\n readOwners: (\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => readOwners(client, args),\n\n isOwnerOf: (\n args: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => isOwnerOf(client, args),\n\n getThreshold: (\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => getThreshold(client, args),\n\n proposeUserOperation: (\n args: SendUserOperationParameters<TAccount, undefined>\n ) => proposeUserOperation(client, args),\n\n signMultisigUserOperation: (\n params: SignMultisigUserOperationParams<TAccount>\n ): Promise<SignMultisigUserOperationResult> =>\n signMultisigUserOperation(client, params),\n});\n"]}
1
+ {"version":3,"file":"extension.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multisig/extension.ts"],"names":[],"mappings":";;;AASA,+DAAyD;AACzD,yDAAmD;AACnD,+EAAyE;AACzE,2DAAqD;AACrD,yFAAmF;AACnF,2CAGqB;AAwDd,MAAM,qBAAqB,GAQK,CAOrC,MAA4C,EAC5C,EAAE,CAAC,CAAC;IACJ,GAAG,IAAA,iCAAsB,EAAC,MAAM,CAAC;IACjC,UAAU,EAAE,CACV,IAA+D,EAC/D,EAAE,CAAC,IAAA,0BAAU,EAAC,MAAM,EAAE,IAAI,CAAC;IAE7B,SAAS,EAAE,CACT,IAC+B,EAC/B,EAAE,CAAC,IAAA,wBAAS,EAAC,MAAM,EAAE,IAAI,CAAC;IAE5B,YAAY,EAAE,CACZ,IAA+D,EAC/D,EAAE,CAAC,IAAA,8BAAY,EAAC,MAAM,EAAE,IAAI,CAAC;IAE/B,oBAAoB,EAAE,CACpB,IAAsD,EACtD,EAAE,CAAC,IAAA,8CAAoB,EAAC,MAAM,EAAE,IAAI,CAAC;IAEvC,yBAAyB,EAAE,CACzB,MAAiD,EACP,EAAE,CAC5C,IAAA,wDAAyB,EAAC,MAAM,EAAE,MAAM,CAAC;CAC5C,CAAC,CAAC;AAvCU,QAAA,qBAAqB,yBAuC/B","sourcesContent":["import {\n type GetAccountParameter,\n type GetEntryPointFromAccount,\n type IsUndefined,\n type SendUserOperationParameters,\n type SmartContractAccount,\n} from \"@aa-sdk/core\";\nimport { type Address, type Chain, type Client, type Transport } from \"viem\";\nimport type { GetPluginAddressParameter } from \"../types.js\";\nimport { getThreshold } from \"./actions/getThreshold.js\";\nimport { isOwnerOf } from \"./actions/isOwnerOf.js\";\nimport { proposeUserOperation } from \"./actions/proposeUserOperation.js\";\nimport { readOwners } from \"./actions/readOwners.js\";\nimport { signMultisigUserOperation } from \"./actions/signMultisigUserOperation.js\";\nimport {\n multisigPluginActions as multisigPluginActions_,\n type MultisigPluginActions as MultisigPluginActions_,\n} from \"./plugin.js\";\nimport {\n type MultisigUserOperationContext,\n type ProposeUserOperationResult,\n type SignMultisigUserOperationParams,\n type SignMultisigUserOperationResult,\n} from \"./types.js\";\n\nexport type MultisigPluginActions<\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n> = MultisigPluginActions_<TAccount, MultisigUserOperationContext> & {\n readOwners: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n\n isOwnerOf: (\n params: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => Promise<boolean>;\n\n getThreshold: (\n params: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<bigint>;\n\n proposeUserOperation: (\n params: SendUserOperationParameters<TAccount, undefined>\n ) => Promise<\n ProposeUserOperationResult<TAccount, GetEntryPointFromAccount<TAccount>>\n >;\n\n signMultisigUserOperation: (\n params: SignMultisigUserOperationParams<TAccount>\n ) => Promise<SignMultisigUserOperationResult>;\n} & (IsUndefined<TAccount> extends false\n ? {\n readOwners: (\n params?: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => Promise<ReadonlyArray<Address>>;\n }\n : {});\n\n/**\n * Provides actions for managing a multisig plugin within the specified client, including reading owners, checking ownership, getting the threshold, proposing user operations, and signing multisig user operations.\n *\n * @example\n * ```ts\n * import { createModularAccountAlchemyClient, multisigPluginActions } from \"@account-kit/smart-contracts\";\n *\n * const client = createModularAccountAlchemyClient(...).extend(multisigPluginActions);\n * ```\n *\n * @param {Client<TTransport, TChain, TAccount>} client The client instance configured with transport, chain, and account information\n * @returns {MultisigPluginActions<TAccount>} An object containing methods to perform actions related to the multisig plugin\n */\nexport const multisigPluginActions: <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => MultisigPluginActions<TAccount> = <\n TTransport extends Transport = Transport,\n TChain extends Chain | undefined = Chain | undefined,\n TAccount extends SmartContractAccount | undefined =\n | SmartContractAccount\n | undefined\n>(\n client: Client<TTransport, TChain, TAccount>\n) => ({\n ...multisigPluginActions_(client),\n readOwners: (\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => readOwners(client, args),\n\n isOwnerOf: (\n args: { address: Address } & GetPluginAddressParameter &\n GetAccountParameter<TAccount>\n ) => isOwnerOf(client, args),\n\n getThreshold: (\n args: GetPluginAddressParameter & GetAccountParameter<TAccount>\n ) => getThreshold(client, args),\n\n proposeUserOperation: (\n args: SendUserOperationParameters<TAccount, undefined>\n ) => proposeUserOperation(client, args),\n\n signMultisigUserOperation: (\n params: SignMultisigUserOperationParams<TAccount>\n ): Promise<SignMultisigUserOperationResult> =>\n signMultisigUserOperation(client, params),\n});\n"]}
@@ -1,12 +1,5 @@
1
- export { getThreshold } from "./actions/getThreshold.js";
2
- export { isOwnerOf } from "./actions/isOwnerOf.js";
3
- export { proposeUserOperation } from "./actions/proposeUserOperation.js";
4
- export { readOwners } from "./actions/readOwners.js";
5
- export { signMultisigUserOperation } from "./actions/signMultisigUserOperation.js";
6
1
  export type * from "./extension.js";
7
2
  export { multisigPluginActions } from "./extension.js";
8
3
  export { multisigSignatureMiddleware } from "./middleware.js";
9
- export { MultisigPlugin, MultisigPluginAbi, MultisigPluginExecutionFunctionAbi, } from "./plugin.js";
4
+ export { MultisigPlugin, MultisigPluginAbi, MultisigPluginExecutionFunctionAbi, type InstallMultisigPluginParams, } from "./plugin.js";
10
5
  export type * from "./types.js";
11
- export { type SignerType } from "./types.js";
12
- export { combineSignatures, formatSignatures, getSignerType, splitAggregatedSignature, } from "./utils/index.js";
@@ -1,16 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitAggregatedSignature = exports.getSignerType = exports.formatSignatures = exports.combineSignatures = exports.MultisigPluginExecutionFunctionAbi = exports.MultisigPluginAbi = exports.MultisigPlugin = exports.multisigSignatureMiddleware = exports.multisigPluginActions = exports.signMultisigUserOperation = exports.readOwners = exports.proposeUserOperation = exports.isOwnerOf = exports.getThreshold = void 0;
4
- var getThreshold_js_1 = require("./actions/getThreshold.js");
5
- Object.defineProperty(exports, "getThreshold", { enumerable: true, get: function () { return getThreshold_js_1.getThreshold; } });
6
- var isOwnerOf_js_1 = require("./actions/isOwnerOf.js");
7
- Object.defineProperty(exports, "isOwnerOf", { enumerable: true, get: function () { return isOwnerOf_js_1.isOwnerOf; } });
8
- var proposeUserOperation_js_1 = require("./actions/proposeUserOperation.js");
9
- Object.defineProperty(exports, "proposeUserOperation", { enumerable: true, get: function () { return proposeUserOperation_js_1.proposeUserOperation; } });
10
- var readOwners_js_1 = require("./actions/readOwners.js");
11
- Object.defineProperty(exports, "readOwners", { enumerable: true, get: function () { return readOwners_js_1.readOwners; } });
12
- var signMultisigUserOperation_js_1 = require("./actions/signMultisigUserOperation.js");
13
- Object.defineProperty(exports, "signMultisigUserOperation", { enumerable: true, get: function () { return signMultisigUserOperation_js_1.signMultisigUserOperation; } });
3
+ exports.MultisigPluginExecutionFunctionAbi = exports.MultisigPluginAbi = exports.MultisigPlugin = exports.multisigSignatureMiddleware = exports.multisigPluginActions = void 0;
14
4
  var extension_js_1 = require("./extension.js");
15
5
  Object.defineProperty(exports, "multisigPluginActions", { enumerable: true, get: function () { return extension_js_1.multisigPluginActions; } });
16
6
  var middleware_js_1 = require("./middleware.js");
@@ -19,9 +9,4 @@ var plugin_js_1 = require("./plugin.js");
19
9
  Object.defineProperty(exports, "MultisigPlugin", { enumerable: true, get: function () { return plugin_js_1.MultisigPlugin; } });
20
10
  Object.defineProperty(exports, "MultisigPluginAbi", { enumerable: true, get: function () { return plugin_js_1.MultisigPluginAbi; } });
21
11
  Object.defineProperty(exports, "MultisigPluginExecutionFunctionAbi", { enumerable: true, get: function () { return plugin_js_1.MultisigPluginExecutionFunctionAbi; } });
22
- var index_js_1 = require("./utils/index.js");
23
- Object.defineProperty(exports, "combineSignatures", { enumerable: true, get: function () { return index_js_1.combineSignatures; } });
24
- Object.defineProperty(exports, "formatSignatures", { enumerable: true, get: function () { return index_js_1.formatSignatures; } });
25
- Object.defineProperty(exports, "getSignerType", { enumerable: true, get: function () { return index_js_1.getSignerType; } });
26
- Object.defineProperty(exports, "splitAggregatedSignature", { enumerable: true, get: function () { return index_js_1.splitAggregatedSignature; } });
27
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multisig/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AAAhD,+GAAA,YAAY,OAAA;AACrB,uDAAmD;AAA1C,yGAAA,SAAS,OAAA;AAClB,6EAAyE;AAAhE,+HAAA,oBAAoB,OAAA;AAC7B,yDAAqD;AAA5C,2GAAA,UAAU,OAAA;AACnB,uFAAmF;AAA1E,yIAAA,yBAAyB,OAAA;AAElC,+CAAuD;AAA9C,qHAAA,qBAAqB,OAAA;AAC9B,iDAA8D;AAArD,4HAAA,2BAA2B,OAAA;AACpC,yCAIqB;AAHnB,2GAAA,cAAc,OAAA;AACd,8GAAA,iBAAiB,OAAA;AACjB,+HAAA,kCAAkC,OAAA;AAIpC,6CAK0B;AAJxB,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,oHAAA,wBAAwB,OAAA","sourcesContent":["export { getThreshold } from \"./actions/getThreshold.js\";\nexport { isOwnerOf } from \"./actions/isOwnerOf.js\";\nexport { proposeUserOperation } from \"./actions/proposeUserOperation.js\";\nexport { readOwners } from \"./actions/readOwners.js\";\nexport { signMultisigUserOperation } from \"./actions/signMultisigUserOperation.js\";\nexport type * from \"./extension.js\";\nexport { multisigPluginActions } from \"./extension.js\";\nexport { multisigSignatureMiddleware } from \"./middleware.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n} from \"./plugin.js\";\nexport type * from \"./types.js\";\nexport { type SignerType } from \"./types.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./utils/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/msca/plugins/multisig/index.ts"],"names":[],"mappings":";;;AACA,+CAAuD;AAA9C,qHAAA,qBAAqB,OAAA;AAC9B,iDAA8D;AAArD,4HAAA,2BAA2B,OAAA;AACpC,yCAKqB;AAJnB,2GAAA,cAAc,OAAA;AACd,8GAAA,iBAAiB,OAAA;AACjB,+HAAA,kCAAkC,OAAA","sourcesContent":["export type * from \"./extension.js\";\nexport { multisigPluginActions } from \"./extension.js\";\nexport { multisigSignatureMiddleware } from \"./middleware.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n type InstallMultisigPluginParams,\n} from \"./plugin.js\";\nexport type * from \"./types.js\";\n"]}
@@ -1,3 +1,3 @@
1
1
  import { type ClientMiddlewareFn } from "@aa-sdk/core";
2
- import { type MultisigUserOperationContext } from "./index.js";
2
+ import { type MultisigUserOperationContext } from "./types.js";
3
3
  export declare const multisigSignatureMiddleware: ClientMiddlewareFn<MultisigUserOperationContext>;
@@ -4,7 +4,7 @@ exports.multisigSignatureMiddleware = void 0;
4
4
  const core_1 = require("@aa-sdk/core");
5
5
  const multisigAccount_js_1 = require("../../account/multisigAccount.js");
6
6
  const errors_js_1 = require("../../errors.js");
7
- const index_js_1 = require("./index.js");
7
+ const index_js_1 = require("./utils/index.js");
8
8
  const multisigSignatureMiddleware = async (struct, { account, client, context }) => {
9
9
  if (!context ||
10
10
  (context.userOpSignatureType === "ACTUAL" &&