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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/dist/cjs/plugindefs/multi-owner/config.js +16 -17
  2. package/dist/cjs/plugindefs/multi-owner/config.js.map +1 -1
  3. package/dist/cjs/plugindefs/multisig/config.js +15 -15
  4. package/dist/cjs/plugindefs/multisig/config.js.map +1 -1
  5. package/dist/cjs/plugindefs/session-key/config.js +17 -17
  6. package/dist/cjs/plugindefs/session-key/config.js.map +1 -1
  7. package/dist/cjs/src/index.d.ts +1 -1
  8. package/dist/cjs/src/index.js +4 -3
  9. package/dist/cjs/src/index.js.map +1 -1
  10. package/dist/cjs/src/light-account/accounts/account.d.ts +5 -6
  11. package/dist/cjs/src/light-account/accounts/account.js +3 -2
  12. package/dist/cjs/src/light-account/accounts/account.js.map +1 -1
  13. package/dist/cjs/src/light-account/accounts/base.d.ts +7 -6
  14. package/dist/cjs/src/light-account/accounts/base.js +8 -8
  15. package/dist/cjs/src/light-account/accounts/base.js.map +1 -1
  16. package/dist/cjs/src/light-account/accounts/multiOwner.d.ts +5 -5
  17. package/dist/cjs/src/light-account/accounts/multiOwner.js +3 -2
  18. package/dist/cjs/src/light-account/accounts/multiOwner.js.map +1 -1
  19. package/dist/cjs/src/light-account/clients/alchemyClient.d.ts +1 -1
  20. package/dist/cjs/src/light-account/clients/alchemyClient.js.map +1 -1
  21. package/dist/cjs/src/light-account/clients/client.d.ts +1 -2
  22. package/dist/cjs/src/light-account/clients/client.js +3 -3
  23. package/dist/cjs/src/light-account/clients/client.js.map +1 -1
  24. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  25. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  26. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  27. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js +3 -3
  28. package/dist/cjs/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  29. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
  30. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  31. package/dist/cjs/src/light-account/types.d.ts +23 -31
  32. package/dist/cjs/src/light-account/types.js.map +1 -1
  33. package/dist/cjs/src/light-account/utils.d.ts +7 -10
  34. package/dist/cjs/src/light-account/utils.js +59 -87
  35. package/dist/cjs/src/light-account/utils.js.map +1 -1
  36. package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
  37. package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
  38. package/dist/cjs/src/msca/client/client.d.ts +2 -6
  39. package/dist/cjs/src/msca/client/client.js +6 -6
  40. package/dist/cjs/src/msca/client/client.js.map +1 -1
  41. package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  42. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
  43. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  44. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  45. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  46. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  47. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  48. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  49. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  50. package/dist/cjs/src/msca/utils.js +11 -10
  51. package/dist/cjs/src/msca/utils.js.map +1 -1
  52. package/dist/esm/plugindefs/multi-owner/config.js +1 -2
  53. package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
  54. package/dist/esm/plugindefs/multisig/config.js +1 -1
  55. package/dist/esm/plugindefs/multisig/config.js.map +1 -1
  56. package/dist/esm/plugindefs/session-key/config.js +1 -1
  57. package/dist/esm/plugindefs/session-key/config.js.map +1 -1
  58. package/dist/esm/src/index.d.ts +1 -1
  59. package/dist/esm/src/index.js +1 -1
  60. package/dist/esm/src/index.js.map +1 -1
  61. package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
  62. package/dist/esm/src/light-account/accounts/account.js +3 -2
  63. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  64. package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
  65. package/dist/esm/src/light-account/accounts/base.js +8 -8
  66. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  67. package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
  68. package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
  69. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  70. package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
  71. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  72. package/dist/esm/src/light-account/clients/client.d.ts +1 -2
  73. package/dist/esm/src/light-account/clients/client.js +3 -3
  74. package/dist/esm/src/light-account/clients/client.js.map +1 -1
  75. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  76. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  77. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  78. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js +3 -3
  79. package/dist/esm/src/light-account/clients/multiOwnerLightAccount.js.map +1 -1
  80. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  81. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  82. package/dist/esm/src/light-account/types.d.ts +23 -31
  83. package/dist/esm/src/light-account/types.js.map +1 -1
  84. package/dist/esm/src/light-account/utils.d.ts +7 -10
  85. package/dist/esm/src/light-account/utils.js +57 -84
  86. package/dist/esm/src/light-account/utils.js.map +1 -1
  87. package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
  88. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  89. package/dist/esm/src/msca/client/client.d.ts +2 -6
  90. package/dist/esm/src/msca/client/client.js +6 -6
  91. package/dist/esm/src/msca/client/client.js.map +1 -1
  92. package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  93. package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
  94. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  95. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  96. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  97. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  98. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  99. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  100. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  101. package/dist/esm/src/msca/utils.js +2 -1
  102. package/dist/esm/src/msca/utils.js.map +1 -1
  103. package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
  104. package/dist/types/src/index.d.ts +1 -1
  105. package/dist/types/src/index.d.ts.map +1 -1
  106. package/dist/types/src/light-account/accounts/account.d.ts +5 -6
  107. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  108. package/dist/types/src/light-account/accounts/base.d.ts +7 -6
  109. package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
  110. package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
  111. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  112. package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
  113. package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
  114. package/dist/types/src/light-account/clients/client.d.ts +1 -2
  115. package/dist/types/src/light-account/clients/client.d.ts.map +1 -1
  116. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  117. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
  118. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts +1 -2
  119. package/dist/types/src/light-account/clients/multiOwnerLightAccount.d.ts.map +1 -1
  120. package/dist/types/src/light-account/decorators/lightAccount.d.ts +1 -1
  121. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +1 -1
  122. package/dist/types/src/light-account/types.d.ts +23 -118
  123. package/dist/types/src/light-account/types.d.ts.map +1 -1
  124. package/dist/types/src/light-account/utils.d.ts +19 -48
  125. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  126. package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
  127. package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
  128. package/dist/types/src/msca/client/client.d.ts +2 -6
  129. package/dist/types/src/msca/client/client.d.ts.map +1 -1
  130. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  131. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
  132. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
  133. package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
  134. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
  135. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
  136. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
  137. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  138. package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
  139. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  140. package/dist/types/src/msca/utils.d.ts +6 -6
  141. package/dist/types/src/msca/utils.d.ts.map +1 -1
  142. package/package.json +7 -6
  143. package/plugindefs/multi-owner/config.ts +1 -2
  144. package/plugindefs/multisig/config.ts +1 -1
  145. package/plugindefs/session-key/config.ts +1 -1
  146. package/src/index.ts +2 -1
  147. package/src/light-account/accounts/account.ts +24 -45
  148. package/src/light-account/accounts/base.ts +39 -68
  149. package/src/light-account/accounts/multiOwner.ts +29 -43
  150. package/src/light-account/clients/alchemyClient.ts +2 -2
  151. package/src/light-account/clients/client.ts +8 -13
  152. package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
  153. package/src/light-account/clients/multiOwnerLightAccount.ts +11 -13
  154. package/src/light-account/decorators/lightAccount.ts +1 -1
  155. package/src/light-account/decorators/multiOwnerLightAccount.ts +1 -1
  156. package/src/light-account/types.ts +31 -188
  157. package/src/light-account/utils.ts +91 -246
  158. package/src/msca/client/alchemyClient.ts +2 -2
  159. package/src/msca/client/client.ts +24 -36
  160. package/src/msca/client/multiSigAlchemyClient.ts +5 -5
  161. package/src/msca/plugins/multisig/middleware.ts +6 -6
  162. package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
  163. package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
  164. package/src/msca/plugins/session-key/permissions.ts +147 -1
  165. package/src/msca/plugins/session-key/signer.ts +71 -1
  166. package/src/msca/utils.ts +15 -13
  167. package/dist/cjs/src/light-account/e2e-tests/constants.d.ts +0 -6
  168. package/dist/cjs/src/light-account/e2e-tests/constants.js +0 -10
  169. package/dist/cjs/src/light-account/e2e-tests/constants.js.map +0 -1
  170. package/dist/cjs/src/light-account/schema.d.ts +0 -21
  171. package/dist/cjs/src/light-account/schema.js +0 -30
  172. package/dist/cjs/src/light-account/schema.js.map +0 -1
  173. package/dist/esm/src/light-account/e2e-tests/constants.d.ts +0 -6
  174. package/dist/esm/src/light-account/e2e-tests/constants.js +0 -7
  175. package/dist/esm/src/light-account/e2e-tests/constants.js.map +0 -1
  176. package/dist/esm/src/light-account/schema.d.ts +0 -21
  177. package/dist/esm/src/light-account/schema.js +0 -27
  178. package/dist/esm/src/light-account/schema.js.map +0 -1
  179. package/dist/types/src/light-account/e2e-tests/constants.d.ts +0 -7
  180. package/dist/types/src/light-account/e2e-tests/constants.d.ts.map +0 -1
  181. package/dist/types/src/light-account/schema.d.ts +0 -22
  182. package/dist/types/src/light-account/schema.d.ts.map +0 -1
  183. package/src/light-account/e2e-tests/constants.ts +0 -8
  184. package/src/light-account/schema.ts +0 -39
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,WAAW,CAAC;KAC/C;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginAbi } from \"./abi.js\";\n\nexport const MultiOwnerPluginGenConfig: PluginConfig = {\n name: \"MultiOwnerPlugin\",\n abi: MultiOwnerPluginAbi,\n addresses: {\n [sepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [baseSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygon.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonAmoy.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonMumbai.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimism.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimismSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrum.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrumSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [base.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [baseSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtal.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtalSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zora.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zoraSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [mainnet.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[]\"),\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,WAAW,CAAC;KAC/C;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginAbi } from \"./abi.js\";\n\nexport const MultiOwnerPluginGenConfig: PluginConfig = {\n name: \"MultiOwnerPlugin\",\n abi: MultiOwnerPluginAbi,\n addresses: {\n [sepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [baseSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygon.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonAmoy.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [polygonMumbai.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimism.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [optimismSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrum.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [arbitrumSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [base.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtal.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [fraxtalSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zora.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [zoraSepolia.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n [mainnet.id]: \"0xcE0000007B008F50d762D155002600004cD6c647\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[]\"),\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, zora, zoraSepolia, } from "@aa-sdk/core";
1
+ import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, sepolia, zora, zoraSepolia, } from "@account-kit/infra";
2
2
  import { parseAbiParameters } from "viem";
3
3
  import { MultisigPluginAbi } from "./abi.js";
4
4
  export const MultisigPluginGenConfig = {
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multisig/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,iBAAiB;IACtB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;KACrD;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultisigPluginAbi } from \"./abi.js\";\n\nexport const MultisigPluginGenConfig: PluginConfig = {\n name: \"MultisigPlugin\",\n abi: MultisigPluginAbi,\n addresses: {\n [sepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [baseSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygon.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [mainnet.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygonAmoy.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimism.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimismSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrum.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrumSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [base.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtal.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtalSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zora.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zoraSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[], uint\"),\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multisig/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,CAAC,MAAM,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,iBAAiB;IACtB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAAC,iBAAiB,CAAC;KACrD;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultisigPluginAbi } from \"./abi.js\";\n\nexport const MultisigPluginGenConfig: PluginConfig = {\n name: \"MultisigPlugin\",\n abi: MultisigPluginAbi,\n addresses: {\n [sepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [baseSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygon.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [mainnet.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [polygonAmoy.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimism.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [optimismSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrum.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [arbitrumSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [base.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtal.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [fraxtalSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zora.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n [zoraSepolia.id]: \"0x000000000000A53f64b7bcf4Cd59624943C43Fc7\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\"address[], uint\"),\n },\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "@aa-sdk/core";
1
+ import { arbitrum, arbitrumSepolia, base, baseSepolia, fraxtal, fraxtalSepolia, mainnet, optimism, optimismSepolia, polygon, polygonAmoy, polygonMumbai, sepolia, zora, zoraSepolia, } from "@account-kit/infra";
2
2
  import { parseAbiParameters } from "viem";
3
3
  import { MultiOwnerPluginGenConfig } from "../multi-owner/config.js";
4
4
  import { SessionKeyPluginAbi } from "./abi.js";
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/session-key/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,E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CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@aa-sdk/core\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginGenConfig } from \"../multi-owner/config.js\";\nimport { SessionKeyPluginAbi } from \"./abi.js\";\n\nexport const SessionKeyPluginGenConfig: PluginConfig = {\n name: \"SessionKeyPlugin\",\n abi: SessionKeyPluginAbi,\n addresses: {\n [sepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygon.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonAmoy.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonMumbai.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimism.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimismSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrum.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrumSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [base.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtal.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtalSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zora.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zoraSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [mainnet.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\n \"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions\"\n ),\n dependencies: [\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x0\",\n },\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x1\",\n },\n ],\n },\n};\n"]}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/session-key/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,IAAI,EACJ,WAAW,EACX,OAAO,EACP,cAAc,EACd,OAAO,EACP,QAAQ,EACR,eAAe,EACf,OAAO,EACP,WAAW,EACX,aAAa,EACb,OAAO,EACP,IAAI,EACJ,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,mBAAmB;IACxB,SAAS,EAAE;QACT,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,kBAAkB,CAC/B,qEAAqE,CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,yBAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;SACF;KACF;CACF,CAAC","sourcesContent":["import {\n arbitrum,\n arbitrumSepolia,\n base,\n baseSepolia,\n fraxtal,\n fraxtalSepolia,\n mainnet,\n optimism,\n optimismSepolia,\n polygon,\n polygonAmoy,\n polygonMumbai,\n sepolia,\n zora,\n zoraSepolia,\n} from \"@account-kit/infra\";\nimport type { PluginConfig } from \"@account-kit/plugingen\";\nimport { parseAbiParameters } from \"viem\";\nimport { MultiOwnerPluginGenConfig } from \"../multi-owner/config.js\";\nimport { SessionKeyPluginAbi } from \"./abi.js\";\n\nexport const SessionKeyPluginGenConfig: PluginConfig = {\n name: \"SessionKeyPlugin\",\n abi: SessionKeyPluginAbi,\n addresses: {\n [sepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygon.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonAmoy.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [polygonMumbai.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimism.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [optimismSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrum.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [arbitrumSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [base.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [baseSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtal.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [fraxtalSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zora.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [zoraSepolia.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n [mainnet.id]: \"0x0000003E0000a96de4058e1E02a62FaaeCf23d8d\",\n },\n installConfig: {\n initAbiParams: parseAbiParameters(\n \"address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions\"\n ),\n dependencies: [\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x0\",\n },\n {\n plugin: MultiOwnerPluginGenConfig,\n functionId: \"0x1\",\n },\n ],\n },\n};\n"]}
@@ -7,7 +7,7 @@ export { createMultiOwnerLightAccountAlchemyClient, type AlchemyMultiOwnerLightA
7
7
  export type * from "./light-account/decorators/lightAccount.js";
8
8
  export { lightAccountClientActions } from "./light-account/decorators/lightAccount.js";
9
9
  export type * from "./light-account/types.js";
10
- export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getLightAccountVersionDef, } from "./light-account/utils.js";
10
+ export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getDefaultMultiOwnerLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
11
11
  export type * from "./light-account/accounts/multiOwner.js";
12
12
  export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
13
13
  export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
@@ -4,7 +4,7 @@ export { createLightAccountAlchemyClient, } from "./light-account/clients/alchem
4
4
  export { createLightAccountClient } from "./light-account/clients/client.js";
5
5
  export { createMultiOwnerLightAccountAlchemyClient, } from "./light-account/clients/multiOwnerAlchemyClient.js";
6
6
  export { lightAccountClientActions } from "./light-account/decorators/lightAccount.js";
7
- export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getLightAccountVersionDef, } from "./light-account/utils.js";
7
+ export { AccountVersionRegistry, LightAccountUnsupported1271Factories, LightAccountUnsupported1271Impls, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, getDefaultMultiOwnerLightAccountFactoryAddress, getLightAccountVersionForAccount, } from "./light-account/utils.js";
8
8
  export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
9
9
  export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
10
10
  export { createMultiOwnerLightAccountClient } from "./light-account/clients/multiOwnerLightAccount.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,I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AgC,CAAC;AACxC,OAAO,EACL,oCAAoC,EACpC,kCAAkC,GACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,kCAAkC,GAEnC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,+BAA+B,EAC/B,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,kCAAkC,EAClC,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,wBAAwB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGlF,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACL,gDAAgD,EAChD,8CAA8C,EAC9C,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n getLightAccountVersionDef,\n} from \"./light-account/utils.js\";\n\n//multi-owner-light-account exports\nexport type * from \"./light-account/accounts/multiOwner.js\";\nexport { createMultiOwnerLightAccount } from \"./light-account/accounts/multiOwner.js\";\nexport { updateOwners as updateMultiOwnerLightAccountOwners } from \"./light-account/actions/updateOwners.js\";\nexport { createMultiOwnerLightAccountClient } from \"./light-account/clients/multiOwnerLightAccount.js\";\nexport type * from \"./light-account/decorators/multiOwnerLightAccount.js\";\nexport { multiOwnerLightAccountClientActions } from \"./light-account/decorators/multiOwnerLightAccount.js\";\n\n// msca exports\nexport { IAccountLoupeAbi } from \"./msca/abis/IAccountLoupe.js\";\nexport { IPluginAbi } from \"./msca/abis/IPlugin.js\";\nexport { IPluginManagerAbi } from \"./msca/abis/IPluginManager.js\";\nexport { IStandardExecutorAbi } from \"./msca/abis/IStandardExecutor.js\";\nexport { MultiOwnerModularAccountFactoryAbi } from \"./msca/abis/MultiOwnerModularAccountFactory.js\";\nexport { MultisigModularAccountFactoryAbi } from \"./msca/abis/MultisigModularAccountFactory.js\";\nexport { UpgradeableModularAccountAbi } from \"./msca/abis/UpgradeableModularAccount.js\";\nexport type * from \"./msca/account-loupe/decorator.js\";\nexport { accountLoupeActions } from \"./msca/account-loupe/decorator.js\";\nexport type * from \"./msca/account-loupe/types.js\";\nexport type * from \"./msca/account/multiOwnerAccount.js\";\nexport { createMultiOwnerModularAccount } from \"./msca/account/multiOwnerAccount.js\";\nexport type * from \"./msca/account/multisigAccount.js\";\nexport { createMultisigModularAccount } from \"./msca/account/multisigAccount.js\";\nexport { standardExecutor } from \"./msca/account/standardExecutor.js\";\nexport {\n createModularAccountAlchemyClient,\n type AlchemyModularAccountClientConfig,\n} from \"./msca/client/alchemyClient.js\";\nexport {\n createMultiOwnerModularAccountClient,\n createMultisigModularAccountClient,\n} from \"./msca/client/client.js\";\nexport {\n createMultisigAccountAlchemyClient,\n type AlchemyMultisigAccountClientConfig,\n} from \"./msca/client/multiSigAlchemyClient.js\";\nexport {\n InvalidAggregatedSignatureError,\n InvalidContextSignatureError,\n MultisigAccountExpectedError,\n MultisigMissingSignatureError,\n} from \"./msca/errors.js\";\nexport type * from \"./msca/plugin-manager/decorator.js\";\nexport { pluginManagerActions } from \"./msca/plugin-manager/decorator.js\";\nexport { installPlugin } from \"./msca/plugin-manager/installPlugin.js\";\nexport { multiOwnerPluginActions } from \"./msca/plugins/multi-owner/extension.js\";\nexport type * from \"./msca/plugins/multi-owner/index.js\";\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./msca/plugins/multi-owner/plugin.js\";\nexport type * from \"./msca/plugins/multisig/index.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n multisigPluginActions,\n multisigSignatureMiddleware,\n} from \"./msca/plugins/multisig/index.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./msca/plugins/multisig/utils/index.js\";\nexport { sessionKeyPluginActions } from \"./msca/plugins/session-key/extension.js\";\nexport type * from \"./msca/plugins/session-key/index.js\";\nexport type * from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyAccessListType,\n SessionKeyPermissionsBuilder,\n} from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyPlugin,\n SessionKeyPluginAbi,\n SessionKeyPluginExecutionFunctionAbi,\n} from \"./msca/plugins/session-key/plugin.js\";\nexport { SessionKeySigner } from \"./msca/plugins/session-key/signer.js\";\nexport { buildSessionKeysToRemoveStruct } from \"./msca/plugins/session-key/utils.js\";\nexport type * from \"./msca/plugins/types.js\";\nexport {\n getDefaultMultiOwnerModularAccountFactoryAddress,\n getDefaultMultisigModularAccountFactoryAddress,\n getMAInitializationData,\n getMSCAUpgradeToData,\n} from \"./msca/utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,iBAAiB,IAAI,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAClH,OAAO,EACL,+BAA+B,GAEhC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EACL,yCAAyC,GAE1C,MAAM,oDAAoD,CAAC;AAE5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,gCAAgC,EAChC,0BAA0B,EAC1B,oCAAoC,EACpC,8CAA8C,EAC9C,gCAAgC,GACjC,MAAM,0BAA0B,CAAC;AAIlC,OAAO,EAAE,4BAA4B,EAAE,MAAM,wCAAwC,CAAC;AACtF,OAAO,EAAE,YAAY,IAAI,kCAAkC,EAAE,MAAM,yCAAyC,CAAC;AAC7G,OAAO,EAAE,kCAAkC,EAAE,MAAM,mDAAmD,CAAC;AAEvG,OAAO,EAAE,mCAAmC,EAAE,MAAM,sDAAsD,CAAC;AAG3G,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO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D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAGlF,OAAO,EACL,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,oCAAoC,GACrC,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACL,gDAAgD,EAChD,8CAA8C,EAC9C,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n getDefaultMultiOwnerLightAccountFactoryAddress,\n getLightAccountVersionForAccount,\n} from \"./light-account/utils.js\";\n\n//multi-owner-light-account exports\nexport type * from \"./light-account/accounts/multiOwner.js\";\nexport { createMultiOwnerLightAccount } from \"./light-account/accounts/multiOwner.js\";\nexport { updateOwners as updateMultiOwnerLightAccountOwners } from \"./light-account/actions/updateOwners.js\";\nexport { createMultiOwnerLightAccountClient } from \"./light-account/clients/multiOwnerLightAccount.js\";\nexport type * from \"./light-account/decorators/multiOwnerLightAccount.js\";\nexport { multiOwnerLightAccountClientActions } from \"./light-account/decorators/multiOwnerLightAccount.js\";\n\n// msca exports\nexport { IAccountLoupeAbi } from \"./msca/abis/IAccountLoupe.js\";\nexport { IPluginAbi } from \"./msca/abis/IPlugin.js\";\nexport { IPluginManagerAbi } from \"./msca/abis/IPluginManager.js\";\nexport { IStandardExecutorAbi } from \"./msca/abis/IStandardExecutor.js\";\nexport { MultiOwnerModularAccountFactoryAbi } from \"./msca/abis/MultiOwnerModularAccountFactory.js\";\nexport { MultisigModularAccountFactoryAbi } from \"./msca/abis/MultisigModularAccountFactory.js\";\nexport { UpgradeableModularAccountAbi } from \"./msca/abis/UpgradeableModularAccount.js\";\nexport type * from \"./msca/account-loupe/decorator.js\";\nexport { accountLoupeActions } from \"./msca/account-loupe/decorator.js\";\nexport type * from \"./msca/account-loupe/types.js\";\nexport type * from \"./msca/account/multiOwnerAccount.js\";\nexport { createMultiOwnerModularAccount } from \"./msca/account/multiOwnerAccount.js\";\nexport type * from \"./msca/account/multisigAccount.js\";\nexport { createMultisigModularAccount } from \"./msca/account/multisigAccount.js\";\nexport { standardExecutor } from \"./msca/account/standardExecutor.js\";\nexport {\n createModularAccountAlchemyClient,\n type AlchemyModularAccountClientConfig,\n} from \"./msca/client/alchemyClient.js\";\nexport {\n createMultiOwnerModularAccountClient,\n createMultisigModularAccountClient,\n} from \"./msca/client/client.js\";\nexport {\n createMultisigAccountAlchemyClient,\n type AlchemyMultisigAccountClientConfig,\n} from \"./msca/client/multiSigAlchemyClient.js\";\nexport {\n InvalidAggregatedSignatureError,\n InvalidContextSignatureError,\n MultisigAccountExpectedError,\n MultisigMissingSignatureError,\n} from \"./msca/errors.js\";\nexport type * from \"./msca/plugin-manager/decorator.js\";\nexport { pluginManagerActions } from \"./msca/plugin-manager/decorator.js\";\nexport { installPlugin } from \"./msca/plugin-manager/installPlugin.js\";\nexport { multiOwnerPluginActions } from \"./msca/plugins/multi-owner/extension.js\";\nexport type * from \"./msca/plugins/multi-owner/index.js\";\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./msca/plugins/multi-owner/plugin.js\";\nexport type * from \"./msca/plugins/multisig/index.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n multisigPluginActions,\n multisigSignatureMiddleware,\n} from \"./msca/plugins/multisig/index.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./msca/plugins/multisig/utils/index.js\";\nexport { sessionKeyPluginActions } from \"./msca/plugins/session-key/extension.js\";\nexport type * from \"./msca/plugins/session-key/index.js\";\nexport type * from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyAccessListType,\n SessionKeyPermissionsBuilder,\n} from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyPlugin,\n SessionKeyPluginAbi,\n SessionKeyPluginExecutionFunctionAbi,\n} from \"./msca/plugins/session-key/plugin.js\";\nexport { SessionKeySigner } from \"./msca/plugins/session-key/signer.js\";\nexport { buildSessionKeysToRemoveStruct } from \"./msca/plugins/session-key/utils.js\";\nexport type * from \"./msca/plugins/types.js\";\nexport {\n getDefaultMultiOwnerModularAccountFactoryAddress,\n getDefaultMultisigModularAccountFactoryAddress,\n getMAInitializationData,\n getMSCAUpgradeToData,\n} from \"./msca/utils.js\";\n"]}
@@ -1,18 +1,17 @@
1
1
  import { type Address, type EntryPointDef, type SmartAccountSigner } from "@aa-sdk/core";
2
2
  import { type Chain, type Hex, type Transport } from "viem";
3
- import type { GetEntryPointForLightAccountVersion, GetLightAccountVersion } from "../types.js";
3
+ import type { LightAccountEntryPointVersion, LightAccountVersion } from "../types.js";
4
4
  import { type CreateLightAccountBaseParams, type LightAccountBase } from "./base.js";
5
- export type LightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = GetLightAccountVersion<"LightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>> = LightAccountBase<TSigner, "LightAccount", TLightAccountVersion, TEntryPointVersion> & {
5
+ export type LightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">> = LightAccountBase<TSigner, "LightAccount", TLightAccountVersion> & {
6
6
  encodeTransferOwnership: (newOwner: Address) => Hex;
7
7
  getOwnerAddress: () => Promise<Address>;
8
8
  };
9
- export type CreateLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = GetLightAccountVersion<"LightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>> = Omit<CreateLightAccountBaseParams<TTransport, TSigner, "LightAccount", TLightAccountVersion, TEntryPointVersion>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress"> & {
9
+ export type CreateLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = LightAccountVersion<"LightAccount">> = Omit<CreateLightAccountBaseParams<"LightAccount", TLightAccountVersion, TTransport, TSigner>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress" | "type"> & {
10
10
  salt?: bigint;
11
11
  initCode?: Hex;
12
12
  accountAddress?: Address;
13
13
  factoryAddress?: Address;
14
14
  version?: TLightAccountVersion;
15
- entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;
15
+ entryPoint?: EntryPointDef<LightAccountEntryPointVersion<"LightAccount", TLightAccountVersion>, Chain>;
16
16
  };
17
- export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = "v1.1.0">(config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<LightAccount<TSigner, TLightAccountVersion>>;
18
- export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"LightAccount"> = GetLightAccountVersion<"LightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"LightAccount", TLightAccountVersion>>(config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion, TEntryPointVersion>): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;
17
+ export declare function createLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0">(config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<LightAccount<TSigner, TLightAccountVersion>>;
@@ -6,7 +6,7 @@ import { LightAccountFactoryAbi_v1 } from "../abis/LightAccountFactoryAbi_v1.js"
6
6
  import { LightAccountFactoryAbi_v2 } from "../abis/LightAccountFactoryAbi_v2.js";
7
7
  import { AccountVersionRegistry, LightAccountUnsupported1271Factories, defaultLightAccountVersion, getDefaultLightAccountFactoryAddress, } from "../utils.js";
8
8
  import { createLightAccountBase, } from "./base.js";
9
- export async function createLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion("LightAccount"), entryPoint = getEntryPoint(chain, {
9
+ export async function createLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion(), entryPoint = getEntryPoint(chain, {
10
10
  version: AccountVersionRegistry["LightAccount"][version]
11
11
  .entryPointVersion,
12
12
  }), accountAddress, factoryAddress = getDefaultLightAccountFactoryAddress(chain, version), salt: salt_ = 0n, }) {
@@ -44,7 +44,8 @@ export async function createLightAccount({ transport, chain, signer, initCode, v
44
44
  chain,
45
45
  signer,
46
46
  abi: accountAbi,
47
- version: AccountVersionRegistry["LightAccount"][version],
47
+ type: "LightAccount",
48
+ version,
48
49
  entryPoint,
49
50
  accountAddress: address,
50
51
  getAccountInitCode,
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAId,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,GAInB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAKjF,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AA4FnB,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,CAAC,cAAc,CAAC,EACpD,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;SACrD,iBAAwB;CAC5B,CAAC,EACF,cAAc,EACd,cAAc,GAAG,oCAAoC,CAAC,KAAK,EAAE,OAAO,CAAC,EACrE,IAAI,EAAE,KAAK,GAAG,EAAE,GACS;IACzB,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS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ACL,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,OAAO;aACtB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type Address,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { LightAccountAbi_v1 } from \"../abis/LightAccountAbi_v1.js\";\nimport { LightAccountAbi_v2 } from \"../abis/LightAccountAbi_v2.js\";\nimport { LightAccountFactoryAbi_v1 } from \"../abis/LightAccountFactoryAbi_v1.js\";\nimport { LightAccountFactoryAbi_v2 } from \"../abis/LightAccountFactoryAbi_v2.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type LightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = LightAccountBase<\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeTransferOwnership: (newOwner: Address) => Hex;\n getOwnerAddress: () => Promise<Address>;\n};\n\n// [!region CreateLightAccountParams]\nexport type CreateLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = \"v1.1.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n>(\n config: CreateLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;\n\n/**\n * Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner's address.\n *\n * @example\n * ```ts\n * import { createLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountParams} config The parameters for creating a light account\n * @returns {Promise<LightAccount>} A promise that resolves to a `LightAccount` object containing the created account information and methods\n */\nexport async function createLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"LightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: AccountVersionRegistry[\"LightAccount\"][version]\n .entryPointVersion as any,\n }),\n accountAddress,\n factoryAddress = getDefaultLightAccountFactoryAddress(chain, version),\n salt: salt_ = 0n,\n}: CreateLightAccountParams): Promise<LightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const accountAbi =\n version === \"v2.0.0\" ? LightAccountAbi_v2 : LightAccountAbi_v1;\n const factoryAbi =\n version === \"v2.0.0\"\n ? LightAccountFactoryAbi_v1\n : LightAccountFactoryAbi_v2;\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n const salt = LightAccountUnsupported1271Factories.has(\n factoryAddress.toLowerCase() as Address\n )\n ? 0n\n : salt_;\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: factoryAbi,\n functionName: \"createAccount\",\n args: [await signer.getAddress(), salt],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"LightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n version: AccountVersionRegistry[\"LightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n\n encodeTransferOwnership: (newOwner: Address) => {\n return encodeFunctionData({\n abi: accountAbi,\n functionName: \"transferOwnership\",\n args: [newOwner],\n });\n },\n async getOwnerAddress(): Promise<Address> {\n const callResult = await client.readContract({\n address,\n abi: accountAbi,\n functionName: \"owner\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owner\");\n }\n\n return callResult;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAId,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,GAInB,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAKjF,OAAO,EACL,sBAAsB,EACtB,oCAAoC,EACpC,0BAA0B,EAC1B,oCAAoC,GACrC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AAqEnB,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,EAAE,EACtC,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;SACrD,iBAAwB;CAC5B,CAAC,EACF,cAAc,EACd,cAAc,GAAG,oCAAoC,CAAC,KAAK,EAAE,OAAO,CAAC,EACrE,IAAI,EAAE,KAAK,GAAG,EAAE,GACS;I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;aACjB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,OAAO;aACtB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type Address,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { LightAccountAbi_v1 } from \"../abis/LightAccountAbi_v1.js\";\nimport { LightAccountAbi_v2 } from \"../abis/LightAccountAbi_v2.js\";\nimport { LightAccountFactoryAbi_v1 } from \"../abis/LightAccountFactoryAbi_v1.js\";\nimport { LightAccountFactoryAbi_v2 } from \"../abis/LightAccountFactoryAbi_v2.js\";\nimport type {\n LightAccountEntryPointVersion,\n LightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type LightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = LightAccountBase<TSigner, \"LightAccount\", TLightAccountVersion> & {\n encodeTransferOwnership: (newOwner: Address) => Hex;\n getOwnerAddress: () => Promise<Address>;\n};\n\n// [!region CreateLightAccountParams]\nexport type CreateLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"LightAccount\"> = LightAccountVersion<\"LightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"LightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\"LightAccount\", TLightAccountVersion>,\n Chain\n >;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"LightAccount\"> = \"v2.0.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\n\n/**\n * Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner's address.\n *\n * @example\n * ```ts\n * import { createLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountParams} config The parameters for creating a light account\n * @returns {Promise<LightAccount>} A promise that resolves to a `LightAccount` object containing the created account information and methods\n */\nexport async function createLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(),\n entryPoint = getEntryPoint(chain, {\n version: AccountVersionRegistry[\"LightAccount\"][version]\n .entryPointVersion as any,\n }),\n accountAddress,\n factoryAddress = getDefaultLightAccountFactoryAddress(chain, version),\n salt: salt_ = 0n,\n}: CreateLightAccountParams): Promise<LightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const accountAbi =\n version === \"v2.0.0\" ? LightAccountAbi_v2 : LightAccountAbi_v1;\n const factoryAbi =\n version === \"v2.0.0\"\n ? LightAccountFactoryAbi_v1\n : LightAccountFactoryAbi_v2;\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n const salt = LightAccountUnsupported1271Factories.has(\n factoryAddress.toLowerCase() as Address\n )\n ? 0n\n : salt_;\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: factoryAbi,\n functionName: \"createAccount\",\n args: [await signer.getAddress(), salt],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n \"LightAccount\",\n LightAccountVersion<\"LightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n type: \"LightAccount\",\n version,\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n\n encodeTransferOwnership: (newOwner: Address) => {\n return encodeFunctionData({\n abi: accountAbi,\n functionName: \"transferOwnership\",\n args: [newOwner],\n });\n },\n async getOwnerAddress(): Promise<Address> {\n const callResult = await client.readContract({\n address,\n abi: accountAbi,\n functionName: \"owner\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owner\");\n }\n\n return callResult;\n },\n };\n}\n"]}
@@ -1,14 +1,15 @@
1
1
  import { type Abi, type EntryPointDef, type SmartAccountSigner, type SmartContractAccountWithSigner, type ToSmartContractAccountParams } from "@aa-sdk/core";
2
2
  import { type Address, type Chain, type Transport } from "viem";
3
- import type { GetEntryPointForLightAccountVersion, GetLightAccountVersion, LightAccountType, LightAccountVersionDef } from "../types.js";
4
- export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>, TEntryPointVersion extends GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion> = GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion>> = SmartContractAccountWithSigner<TLightAccountType, TSigner, TEntryPointVersion> & {
3
+ import type { LightAccountEntryPointVersion, LightAccountType, LightAccountVersion } from "../types.js";
4
+ export type LightAccountBase<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>> = SmartContractAccountWithSigner<TLightAccountType, TSigner, LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>> & {
5
5
  getLightAccountVersion: () => TLightAccountVersion;
6
6
  };
7
- export type CreateLightAccountBaseParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>, TEntryPointVersion extends GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion> = GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion>> = Pick<ToSmartContractAccountParams<TLightAccountType, TTransport, Chain, TEntryPointVersion>, "transport" | "chain" | "getAccountInitCode"> & {
7
+ export type CreateLightAccountBaseParams<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner> = Pick<ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>, "transport" | "chain" | "getAccountInitCode"> & {
8
8
  abi: Abi;
9
9
  signer: TSigner;
10
10
  accountAddress: Address;
11
- version: LightAccountVersionDef<TLightAccountType, TLightAccountVersion>;
12
- entryPoint: EntryPointDef<TEntryPointVersion, Chain>;
11
+ type: TLightAccountType;
12
+ version: TLightAccountVersion;
13
+ entryPoint: EntryPointDef<LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>, Chain>;
13
14
  };
14
- export declare function createLightAccountBase<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountType extends LightAccountType = LightAccountType, TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>, TEntryPointVersion extends GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion> = GetEntryPointForLightAccountVersion<TLightAccountType, TLightAccountVersion>>(config: CreateLightAccountBaseParams<TTransport, TSigner, TLightAccountType, TLightAccountVersion, TEntryPointVersion>): Promise<LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion, TEntryPointVersion>>;
15
+ export declare function createLightAccountBase<TLightAccountType extends LightAccountType, TLightAccountVersion extends LightAccountVersion<TLightAccountType>, TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner>({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }: CreateLightAccountBaseParams<TLightAccountType, TLightAccountVersion, TTransport, TSigner>): Promise<LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>>;
@@ -7,7 +7,7 @@ var SignatureType;
7
7
  SignatureType["CONTRACT"] = "0x01";
8
8
  SignatureType["CONTRACT_WITH_ADDR"] = "0x02";
9
9
  })(SignatureType || (SignatureType = {}));
10
- export async function createLightAccountBase({ transport, chain, signer, abi, version: { version, type }, entryPoint, accountAddress, getAccountInitCode, }) {
10
+ export async function createLightAccountBase({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }) {
11
11
  const client = createBundlerClient({
12
12
  transport,
13
13
  chain,
@@ -20,10 +20,10 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
20
20
  if (storage == null) {
21
21
  throw new FailedToGetStorageSlotError("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "Proxy Implementation Address");
22
22
  }
23
- const implementationAddresses = Object.values(AccountVersionRegistry[type]).map((x) => x.address[chain.id].impl);
23
+ const implementationAddresses = Object.values(AccountVersionRegistry[type]).map((x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl);
24
24
  if (fromHex(storage, "number") !== 0 &&
25
25
  !implementationAddresses.some((x) => x === trim(storage))) {
26
- throw new Error(`could not determine if smart account implementation is ${type} ${version}`);
26
+ throw new Error(`could not determine if smart account implementation is ${type} ${String(version)}`);
27
27
  }
28
28
  return encodeFunctionData({
29
29
  abi,
@@ -89,14 +89,14 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
89
89
  case "v1.0.1":
90
90
  return signer.signMessage(message);
91
91
  case "v1.0.2":
92
- throw new Error(`${type} ${version} doesn't support 1271`);
92
+ throw new Error(`${type} ${String(version)} doesn't support 1271`);
93
93
  case "v1.1.0":
94
94
  return signWith1271WrapperV1(hashMessage(message));
95
95
  case "v2.0.0":
96
96
  const signature = await signWith1271WrapperV1(hashMessage(message));
97
97
  return concat([SignatureType.EOA, signature]);
98
98
  default:
99
- throw new Error(`Unknown version ${type} of ${version}`);
99
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
100
100
  }
101
101
  },
102
102
  async signTypedData(params) {
@@ -104,14 +104,14 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
104
104
  case "v1.0.1":
105
105
  return signer.signTypedData(params);
106
106
  case "v1.0.2":
107
- throw new Error(`Version ${version} of LightAccount doesn't support 1271`);
107
+ throw new Error(`Version ${String(version)} of LightAccount doesn't support 1271`);
108
108
  case "v1.1.0":
109
109
  return signWith1271WrapperV1(hashTypedData(params));
110
110
  case "v2.0.0":
111
111
  const signature = await signWith1271WrapperV1(hashTypedData(params));
112
112
  return concat([SignatureType.EOA, signature]);
113
113
  default:
114
- throw new Error(`Unknown version ${version} of LightAccount`);
114
+ throw new Error(`Unknown version ${String(version)} of LightAccount`);
115
115
  }
116
116
  },
117
117
  getDummySignature: () => {
@@ -124,7 +124,7 @@ export async function createLightAccountBase({ transport, chain, signer, abi, ve
124
124
  case "v2.0.0":
125
125
  return concat([SignatureType.EOA, signature]);
126
126
  default:
127
- throw new Error(`Unknown version ${type} of ${version}`);
127
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
128
128
  }
129
129
  },
130
130
  encodeUpgradeToAndCall,
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GAOvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,GAML,MAAM,MAAM,CAAC;AAQd,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAgFD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,EAC3C,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAC1B,UAAU,EACV,cAAc,EACd,kBAAkB,GACW;IAC7B,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,sBAAsB,GAAG,KAAK,EAAE,EACpC,gBAAgB,EAChB,iBAAiB,GACM,EAAgB,EAAE;QACzC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;YACxC,OAAO,EAAE,cAAc;YAEvB,IAAI,EAAE,oEAAoE;SAC3E,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,2BAA2B,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AC,mBAAmB,OAAO,kBAAkB,CAAC,CAAC;YAClE,CAAC;QACH,CAAC;QACD,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,SAAS,GACb,sIAAsI,CAAC;YACzI,QAAQ,OAAiB,EAAE,CAAC;gBAC1B,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,OAAO,OAAO,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;QACD,sBAAsB;KACvB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QACV,MAAM,EAAE,IAAI;QACZ,sBAAsB,EAAE,GAAG,EAAE,CAAC,OAAO;QACrC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n FailedToGetStorageSlotError,\n createBundlerClient,\n toSmartContractAccount,\n type Abi,\n type EntryPointDef,\n type SmartAccountSigner,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n type UpgradeToAndCallParams,\n} from \"@aa-sdk/core\";\nimport {\n concat,\n encodeFunctionData,\n fromHex,\n hashMessage,\n hashTypedData,\n trim,\n type Address,\n type Chain,\n type Hex,\n type SignTypedDataParameters,\n type Transport,\n} from \"viem\";\nimport type {\n AccountVersionDef,\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n LightAccountType,\n LightAccountVersionDef,\n} from \"../types.js\";\nimport { AccountVersionRegistry } from \"../utils.js\";\n\nenum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n CONTRACT_WITH_ADDR = \"0x02\",\n}\n\nexport type LightAccountBase<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n >\n> = SmartContractAccountWithSigner<\n TLightAccountType,\n TSigner,\n TEntryPointVersion\n> & {\n getLightAccountVersion: () => TLightAccountVersion;\n};\n\n//#region CreateLightAccountBaseParams\nexport type CreateLightAccountBaseParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n >\n> = Pick<\n ToSmartContractAccountParams<\n TLightAccountType,\n TTransport,\n Chain,\n TEntryPointVersion\n >,\n \"transport\" | \"chain\" | \"getAccountInitCode\"\n> & {\n abi: Abi;\n signer: TSigner;\n accountAddress: Address;\n version: LightAccountVersionDef<TLightAccountType, TLightAccountVersion>;\n entryPoint: EntryPointDef<TEntryPointVersion, Chain>;\n};\n//#endregion CreateLightAccountBaseParams\n\nexport async function createLightAccountBase<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends GetLightAccountVersion<TLightAccountType> = GetLightAccountVersion<TLightAccountType>,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n TLightAccountType,\n TLightAccountVersion\n >\n>(\n config: CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n TLightAccountType,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<\n LightAccountBase<\n TSigner,\n TLightAccountType,\n TLightAccountVersion,\n TEntryPointVersion\n >\n>;\n\nexport async function createLightAccountBase({\n transport,\n chain,\n signer,\n abi,\n version: { version, type },\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: CreateLightAccountBaseParams): Promise<LightAccountBase> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const encodeUpgradeToAndCall = async ({\n upgradeToAddress,\n upgradeToInitData,\n }: UpgradeToAndCallParams): Promise<Hex> => {\n const storage = await client.getStorageAt({\n address: accountAddress,\n // the slot at which impl addresses are stored by UUPS\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n const implementationAddresses = Object.values(\n AccountVersionRegistry[type]\n ).map((x: AccountVersionDef) => x.address[chain.id].impl);\n\n // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise\n if (\n fromHex(storage, \"number\") !== 0 &&\n !implementationAddresses.some((x) => x === trim(storage))\n ) {\n throw new Error(\n `could not determine if smart account implementation is ${type} ${version}`\n );\n }\n\n return encodeFunctionData({\n abi,\n functionName: \"upgradeToAndCall\",\n args: [upgradeToAddress, upgradeToInitData],\n });\n };\n\n const signWith1271WrapperV1 = async (hashedMessage: Hex): Promise<Hex> => {\n return signer.signTypedData({\n // EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\n // https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L236\n domain: {\n chainId: Number(client.chain.id),\n name: type,\n verifyingContract: accountAddress,\n version: \"1\",\n },\n types: {\n LightAccountMessage: [{ name: \"message\", type: \"bytes\" }],\n },\n message: {\n message: hashedMessage,\n },\n primaryType: \"LightAccountMessage\",\n });\n };\n\n const account = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: type,\n getAccountInitCode,\n encodeExecute: async ({ target, data, value }) => {\n return encodeFunctionData({\n abi,\n functionName: \"execute\",\n args: [target, value ?? 0n, data],\n });\n },\n encodeBatchExecute: async (txs) => {\n const [targets, values, datas] = txs.reduce(\n (accum, curr) => {\n accum[0].push(curr.target);\n accum[1].push(curr.value ?? 0n);\n accum[2].push(curr.data);\n\n return accum;\n },\n [[], [], []] as [Address[], bigint[], Hex[]]\n );\n return encodeFunctionData({\n abi,\n functionName: \"executeBatch\",\n args: [targets, values, datas],\n });\n },\n signUserOperationHash: async (uoHash: Hex) => {\n const signature = await signer.signMessage({ raw: uoHash });\n switch (version) {\n case \"v2.0.0\":\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n return signature;\n }\n },\n async signMessage({ message }) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signMessage(message);\n case \"v1.0.2\":\n throw new Error(`${type} ${version} doesn't support 1271`);\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashMessage(message));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashMessage(message));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${version}`);\n }\n },\n async signTypedData(params) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signTypedData(\n params as unknown as SignTypedDataParameters\n );\n case \"v1.0.2\":\n throw new Error(\n `Version ${version} of LightAccount doesn't support 1271`\n );\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashTypedData(params));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashTypedData(params));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${version} of LightAccount`);\n }\n },\n getDummySignature: (): Hex => {\n const signature =\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n switch (version as string) {\n case \"v1.0.1\":\n case \"v1.0.2\":\n case \"v1.1.0\":\n return signature;\n case \"v2.0.0\":\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${version}`);\n }\n },\n encodeUpgradeToAndCall,\n });\n\n return {\n ...account,\n source: type,\n getLightAccountVersion: () => version,\n getSigner: () => signer,\n };\n}\n"]}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,sBAAsB,GAOvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,aAAa,EACb,IAAI,GAML,MAAM,MAAM,CAAC;AAMd,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAoCD,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAK1C,EACA,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,EACV,cAAc,EACd,kBAAkB,GAMnB;IAGC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,sBAAsB,GAAG,KAAK,EAAE,EACpC,gBAAgB,EAChB,iBAAiB,GACM,EAAgB,EAAE;QACzC,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;YACxC,OAAO,EAAE,cAAc;YAEvB,IAAI,EAAE,oEAAoE;SAC3E,CAAC,CAAC;QAEH,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;YACpB,MAAM,IAAI,2BAA2B,CACnC,oEAAo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AAC;oBAErE,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QACD,iBAAiB,EAAE,GAAQ,EAAE;YAC3B,MAAM,SAAS,GACb,sIAAsI,CAAC;YACzI,QAAQ,OAAiB,EAAE,CAAC;gBAC1B,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ,CAAC;gBACd,KAAK,QAAQ;oBACX,OAAO,SAAS,CAAC;gBACnB,KAAK,QAAQ;oBACX,OAAO,MAAM,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;gBAChD;oBACE,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QACD,sBAAsB;KACvB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QACV,MAAM,EAAE,IAAI;QACZ,sBAAsB,EAAE,GAAG,EAAE,CAAC,OAAO;QACrC,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM;KACxB,CAAC;AACJ,CAAC","sourcesContent":["import {\n FailedToGetStorageSlotError,\n createBundlerClient,\n toSmartContractAccount,\n type Abi,\n type EntryPointDef,\n type SmartAccountSigner,\n type SmartContractAccountWithSigner,\n type ToSmartContractAccountParams,\n type UpgradeToAndCallParams,\n} from \"@aa-sdk/core\";\nimport {\n concat,\n encodeFunctionData,\n fromHex,\n hashMessage,\n hashTypedData,\n trim,\n type Address,\n type Chain,\n type Hex,\n type SignTypedDataParameters,\n type Transport,\n} from \"viem\";\nimport type {\n LightAccountEntryPointVersion,\n LightAccountType,\n LightAccountVersion,\n} from \"../types.js\";\nimport { AccountVersionRegistry } from \"../utils.js\";\n\nenum SignatureType {\n EOA = \"0x00\",\n CONTRACT = \"0x01\",\n CONTRACT_WITH_ADDR = \"0x02\",\n}\n\nexport type LightAccountBase<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountType extends LightAccountType = LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>\n> = SmartContractAccountWithSigner<\n TLightAccountType,\n TSigner,\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>\n> & {\n getLightAccountVersion: () => TLightAccountVersion;\n};\n\n//#region CreateLightAccountBaseParams\nexport type CreateLightAccountBaseParams<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType> = LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Pick<\n ToSmartContractAccountParams<TLightAccountType, TTransport, Chain>,\n \"transport\" | \"chain\" | \"getAccountInitCode\"\n> & {\n abi: Abi;\n signer: TSigner;\n accountAddress: Address;\n type: TLightAccountType;\n version: TLightAccountVersion;\n entryPoint: EntryPointDef<\n LightAccountEntryPointVersion<TLightAccountType, TLightAccountVersion>,\n Chain\n >;\n};\n//#endregion CreateLightAccountBaseParams\n\nexport async function createLightAccountBase<\n TLightAccountType extends LightAccountType,\n TLightAccountVersion extends LightAccountVersion<TLightAccountType>,\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>({\n transport,\n chain,\n signer,\n abi,\n version,\n type,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n}: CreateLightAccountBaseParams<\n TLightAccountType,\n TLightAccountVersion,\n TTransport,\n TSigner\n>): Promise<\n LightAccountBase<TSigner, TLightAccountType, TLightAccountVersion>\n> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const encodeUpgradeToAndCall = async ({\n upgradeToAddress,\n upgradeToInitData,\n }: UpgradeToAndCallParams): Promise<Hex> => {\n const storage = await client.getStorageAt({\n address: accountAddress,\n // the slot at which impl addresses are stored by UUPS\n slot: \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n });\n\n if (storage == null) {\n throw new FailedToGetStorageSlotError(\n \"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc\",\n \"Proxy Implementation Address\"\n );\n }\n\n const implementationAddresses = Object.values(\n AccountVersionRegistry[type]\n ).map(\n (x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl\n );\n\n // only upgrade undeployed accounts (storage 0) or deployed light accounts, error otherwise\n if (\n fromHex(storage, \"number\") !== 0 &&\n !implementationAddresses.some((x) => x === trim(storage))\n ) {\n throw new Error(\n `could not determine if smart account implementation is ${type} ${String(\n version\n )}`\n );\n }\n\n return encodeFunctionData({\n abi,\n functionName: \"upgradeToAndCall\",\n args: [upgradeToAddress, upgradeToInitData],\n });\n };\n\n const signWith1271WrapperV1 = async (hashedMessage: Hex): Promise<Hex> => {\n return signer.signTypedData({\n // EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\n // https://github.com/alchemyplatform/light-account/blob/main/src/LightAccount.sol#L236\n domain: {\n chainId: Number(client.chain.id),\n name: type,\n verifyingContract: accountAddress,\n version: \"1\",\n },\n types: {\n LightAccountMessage: [{ name: \"message\", type: \"bytes\" }],\n },\n message: {\n message: hashedMessage,\n },\n primaryType: \"LightAccountMessage\",\n });\n };\n\n const account = await toSmartContractAccount({\n transport,\n chain,\n entryPoint,\n accountAddress,\n source: type,\n getAccountInitCode,\n encodeExecute: async ({ target, data, value }) => {\n return encodeFunctionData({\n abi,\n functionName: \"execute\",\n args: [target, value ?? 0n, data],\n });\n },\n encodeBatchExecute: async (txs) => {\n const [targets, values, datas] = txs.reduce(\n (accum, curr) => {\n accum[0].push(curr.target);\n accum[1].push(curr.value ?? 0n);\n accum[2].push(curr.data);\n\n return accum;\n },\n [[], [], []] as [Address[], bigint[], Hex[]]\n );\n return encodeFunctionData({\n abi,\n functionName: \"executeBatch\",\n args: [targets, values, datas],\n });\n },\n signUserOperationHash: async (uoHash: Hex) => {\n const signature = await signer.signMessage({ raw: uoHash });\n switch (version) {\n case \"v2.0.0\":\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n return signature;\n }\n },\n async signMessage({ message }) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signMessage(message);\n case \"v1.0.2\":\n throw new Error(`${type} ${String(version)} doesn't support 1271`);\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashMessage(message));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashMessage(message));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n async signTypedData(params) {\n switch (version as string) {\n case \"v1.0.1\":\n return signer.signTypedData(\n params as unknown as SignTypedDataParameters\n );\n case \"v1.0.2\":\n throw new Error(\n `Version ${String(version)} of LightAccount doesn't support 1271`\n );\n case \"v1.1.0\":\n return signWith1271WrapperV1(hashTypedData(params));\n case \"v2.0.0\":\n const signature = await signWith1271WrapperV1(hashTypedData(params));\n // TODO: handle case where signer is an SCA.\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${String(version)} of LightAccount`);\n }\n },\n getDummySignature: (): Hex => {\n const signature =\n \"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c\";\n switch (version as string) {\n case \"v1.0.1\":\n case \"v1.0.2\":\n case \"v1.1.0\":\n return signature;\n case \"v2.0.0\":\n return concat([SignatureType.EOA, signature]);\n default:\n throw new Error(`Unknown version ${type} of ${String(version)}`);\n }\n },\n encodeUpgradeToAndCall,\n });\n\n return {\n ...account,\n source: type,\n getLightAccountVersion: () => version,\n getSigner: () => signer,\n };\n}\n"]}
@@ -1,18 +1,18 @@
1
1
  import { type EntryPointDef, type SmartAccountSigner } from "@aa-sdk/core";
2
2
  import { type Address, type Chain, type Hex, type Transport } from "viem";
3
- import type { GetEntryPointForLightAccountVersion, GetLightAccountVersion } from "../types.js";
3
+ import type { LightAccountEntryPointVersion, LightAccountVersion } from "../types.js";
4
4
  import { type CreateLightAccountBaseParams, type LightAccountBase } from "./base.js";
5
- export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion>> = LightAccountBase<TSigner, "MultiOwnerLightAccount", TLightAccountVersion, TEntryPointVersion> & {
5
+ export type MultiOwnerLightAccount<TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = LightAccountBase<TSigner, "MultiOwnerLightAccount", TLightAccountVersion> & {
6
6
  encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => Hex;
7
7
  getOwnerAddresses: () => Promise<readonly Address[]>;
8
8
  };
9
- export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion>> = Omit<CreateLightAccountBaseParams<TTransport, TSigner, "MultiOwnerLightAccount", TLightAccountVersion, TEntryPointVersion>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress"> & {
9
+ export type CreateMultiOwnerLightAccountParams<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">> = Omit<CreateLightAccountBaseParams<"MultiOwnerLightAccount", TLightAccountVersion, TTransport, TSigner>, "getAccountInitCode" | "entryPoint" | "version" | "abi" | "accountAddress" | "type"> & {
10
10
  salt?: bigint;
11
11
  initCode?: Hex;
12
12
  accountAddress?: Address;
13
13
  factoryAddress?: Address;
14
14
  version?: TLightAccountVersion;
15
- entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;
15
+ entryPoint?: EntryPointDef<LightAccountEntryPointVersion<"MultiOwnerLightAccount", TLightAccountVersion>, Chain>;
16
16
  owners?: Address[];
17
17
  };
18
- export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends GetLightAccountVersion<"MultiOwnerLightAccount"> = GetLightAccountVersion<"MultiOwnerLightAccount">, TEntryPointVersion extends GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion> = GetEntryPointForLightAccountVersion<"MultiOwnerLightAccount", TLightAccountVersion>>(config: CreateMultiOwnerLightAccountParams<TTransport, TSigner, TLightAccountVersion, TEntryPointVersion>): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;
18
+ export declare function createMultiOwnerLightAccount<TTransport extends Transport = Transport, TSigner extends SmartAccountSigner = SmartAccountSigner, TLightAccountVersion extends LightAccountVersion<"MultiOwnerLightAccount"> = LightAccountVersion<"MultiOwnerLightAccount">>(config: CreateMultiOwnerLightAccountParams<TTransport, TSigner, TLightAccountVersion>): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;
@@ -2,9 +2,9 @@ import { createBundlerClient, getAccountAddress, getEntryPoint, } from "@aa-sdk/
2
2
  import { concatHex, encodeFunctionData, hexToBigInt, } from "viem";
3
3
  import { MultiOwnerLightAccountAbi } from "../abis/MultiOwnerLightAccountAbi.js";
4
4
  import { MultiOwnerLightAccountFactoryAbi } from "../abis/MultiOwnerLightAccountFactoryAbi.js";
5
- import { AccountVersionRegistry, defaultLightAccountVersion, getDefaultMultiOwnerLightAccountFactoryAddress, } from "../utils.js";
5
+ import { defaultLightAccountVersion, getDefaultMultiOwnerLightAccountFactoryAddress, } from "../utils.js";
6
6
  import { createLightAccountBase, } from "./base.js";
7
- export async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion("MultiOwnerLightAccount"), entryPoint = getEntryPoint(chain, {
7
+ export async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = defaultLightAccountVersion(), entryPoint = getEntryPoint(chain, {
8
8
  version: "0.7.0",
9
9
  }), accountAddress, factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(chain, version), salt: salt_ = 0n, owners = [], }) {
10
10
  const client = createBundlerClient({
@@ -42,7 +42,8 @@ export async function createMultiOwnerLightAccount({ transport, chain, signer, i
42
42
  chain,
43
43
  signer,
44
44
  abi: MultiOwnerLightAccountAbi,
45
- version: AccountVersionRegistry["MultiOwnerLightAccount"][version],
45
+ version,
46
+ type: "MultiOwnerLightAccount",
46
47
  entryPoint,
47
48
  accountAddress: address,
48
49
  getAccountInitCode,
@@ -1 +1 @@
1
- {"version":3,"file":"multiOwner.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GAKZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAK/F,OAAO,EACL,sBAAsB,EACtB,0BAA0B,EAC1B,8CAA8C,GAC/C,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB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,\n getEntryPoint,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultiOwnerLightAccountAbi } from \"../abis/MultiOwnerLightAccountAbi.js\";\nimport { MultiOwnerLightAccountFactoryAbi } from \"../abis/MultiOwnerLightAccountFactoryAbi.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n defaultLightAccountVersion,\n getDefaultMultiOwnerLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type MultiOwnerLightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeUpdateOwners: (\n ownersToAdd: Address[],\n ownersToRemove: Address[]\n ) => Hex;\n getOwnerAddresses: () => Promise<readonly Address[]>;\n};\n\nexport type CreateMultiOwnerLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"MultiOwnerLightAccount\"> = GetLightAccountVersion<\"MultiOwnerLightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<\n MultiOwnerLightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>\n>;\n\n/**\n * Creates a multi-owner light account using the provided parameters, including transport, chain, signer, initialization code, version, account address, factory address, salt, and owners. Ensures the owners list is deduplicated, ordered, and valid.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountParams} config The parameters for creating a multi-owner light account\n * @returns {Promise<MultiOwnerLightAccount>} A promise that resolves to a `MultiOwnerLightAccount` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"MultiOwnerLightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: \"0.7.0\",\n }),\n accountAddress,\n factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(\n chain,\n version\n ),\n salt: salt_ = 0n,\n owners = [],\n}: CreateMultiOwnerLightAccountParams): Promise<MultiOwnerLightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n // NOTE: the current signer connected will be one of the owners as well\n const ownerAddress = await signer.getAddress();\n // owners need to be dedupe + ordered in ascending order and not == to zero address\n const owners_ = Array.from(new Set([...owners, ownerAddress]))\n .filter((x) => hexToBigInt(x) !== 0n)\n .sort((a, b) => {\n const bigintA = hexToBigInt(a);\n const bigintB = hexToBigInt(b);\n\n return bigintA < bigintB ? -1 : bigintA > bigintB ? 1 : 0;\n });\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: MultiOwnerLightAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [owners_, salt_],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"MultiOwnerLightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version: AccountVersionRegistry[\"MultiOwnerLightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => {\n return encodeFunctionData({\n abi: MultiOwnerLightAccountAbi,\n functionName: \"updateOwners\",\n args: [ownersToAdd, ownersToRemove],\n });\n },\n async getOwnerAddresses(): Promise<readonly Address[]> {\n const callResult = await client.readContract({\n address,\n abi: MultiOwnerLightAccountAbi,\n functionName: \"owners\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owners\");\n }\n\n if (!callResult.includes(await signer.getAddress())) {\n throw new Error(\"on-chain owners does not include the current signer\");\n }\n\n return callResult;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"multiOwner.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/multiOwner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,GAGd,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,WAAW,GAKZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,6CAA6C,CAAC;AAK/F,OAAO,EACL,0BAA0B,EAC1B,8CAA8C,GAC/C,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,sBAAsB,GAGvB,MAAM,WAAW,CAAC;AAkFnB,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EACjD,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,0BAA0B,EAAE,EACtC,UAAU,GAAG,aAAa,CAAC,KAAK,EAAE;IAChC,OAAO,EAAE,OAAO;CACjB,CAAC,EACF,cAAc,EACd,cAAc,GAAG,8CAA8C,CAC7D,KAAK,EACL,OAAO,CACR,EACD,IAAI,EAAE,KAAK,GAAG,EAAE,EAChB,MAAM,GAAG,EAAE,GACwB;IACnC,MAAM,MAAM,GAAG,mBAAmB,CAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAG9B,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;QAE/C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,MAAM,EAAE,YAAY,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AC,iBAAiB;YACrB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,yBAAyB;gBAC9B,YAAY,EAAE,QAAQ;aACvB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACnD,CAAC;YAED,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;gBACpD,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;YACzE,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n hexToBigInt,\n type Address,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { MultiOwnerLightAccountAbi } from \"../abis/MultiOwnerLightAccountAbi.js\";\nimport { MultiOwnerLightAccountFactoryAbi } from \"../abis/MultiOwnerLightAccountFactoryAbi.js\";\nimport type {\n LightAccountEntryPointVersion,\n LightAccountVersion,\n} from \"../types.js\";\nimport {\n defaultLightAccountVersion,\n getDefaultMultiOwnerLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type MultiOwnerLightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = LightAccountBase<\n TSigner,\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n> & {\n encodeUpdateOwners: (\n ownersToAdd: Address[],\n ownersToRemove: Address[]\n ) => Hex;\n getOwnerAddresses: () => Promise<readonly Address[]>;\n};\n\nexport type CreateMultiOwnerLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n> = Omit<\n CreateLightAccountBaseParams<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion,\n TTransport,\n TSigner\n >,\n | \"getAccountInitCode\"\n | \"entryPoint\"\n | \"version\"\n | \"abi\"\n | \"accountAddress\"\n | \"type\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<\n LightAccountEntryPointVersion<\n \"MultiOwnerLightAccount\",\n TLightAccountVersion\n >,\n Chain\n >;\n owners?: Address[];\n};\n\nexport async function createMultiOwnerLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends LightAccountVersion<\"MultiOwnerLightAccount\"> = LightAccountVersion<\"MultiOwnerLightAccount\">\n>(\n config: CreateMultiOwnerLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion\n >\n): Promise<MultiOwnerLightAccount<TSigner, TLightAccountVersion>>;\n\n/**\n * Creates a multi-owner light account using the provided parameters, including transport, chain, signer, initialization code, version, account address, factory address, salt, and owners. Ensures the owners list is deduplicated, ordered, and valid.\n *\n * @example\n * ```ts\n * import { createMultiOwnerLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createMultiOwnerLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateMultiOwnerLightAccountParams} config The parameters for creating a multi-owner light account\n * @returns {Promise<MultiOwnerLightAccount>} A promise that resolves to a `MultiOwnerLightAccount` object containing the created account information and methods\n */\nexport async function createMultiOwnerLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(),\n entryPoint = getEntryPoint(chain, {\n version: \"0.7.0\",\n }),\n accountAddress,\n factoryAddress = getDefaultMultiOwnerLightAccountFactoryAddress(\n chain,\n version\n ),\n salt: salt_ = 0n,\n owners = [],\n}: CreateMultiOwnerLightAccountParams): Promise<MultiOwnerLightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n // NOTE: the current signer connected will be one of the owners as well\n const ownerAddress = await signer.getAddress();\n // owners need to be dedupe + ordered in ascending order and not == to zero address\n const owners_ = Array.from(new Set([...owners, ownerAddress]))\n .filter((x) => hexToBigInt(x) !== 0n)\n .sort((a, b) => {\n const bigintA = hexToBigInt(a);\n const bigintB = hexToBigInt(b);\n\n return bigintA < bigintB ? -1 : bigintA > bigintB ? 1 : 0;\n });\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: MultiOwnerLightAccountFactoryAbi,\n functionName: \"createAccount\",\n args: [owners_, salt_],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n \"MultiOwnerLightAccount\",\n LightAccountVersion<\"MultiOwnerLightAccount\">,\n Transport,\n SmartAccountSigner\n >({\n transport,\n chain,\n signer,\n abi: MultiOwnerLightAccountAbi,\n version,\n type: \"MultiOwnerLightAccount\",\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n encodeUpdateOwners: (ownersToAdd: Address[], ownersToRemove: Address[]) => {\n return encodeFunctionData({\n abi: MultiOwnerLightAccountAbi,\n functionName: \"updateOwners\",\n args: [ownersToAdd, ownersToRemove],\n });\n },\n async getOwnerAddresses(): Promise<readonly Address[]> {\n const callResult = await client.readContract({\n address,\n abi: MultiOwnerLightAccountAbi,\n functionName: \"owners\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owners\");\n }\n\n if (!callResult.includes(await signer.getAddress())) {\n throw new Error(\"on-chain owners does not include the current signer\");\n }\n\n return callResult;\n },\n };\n}\n"]}
@@ -1,6 +1,6 @@
1
+ import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
1
2
  import { type AlchemySmartAccountClient, type AlchemySmartAccountClientConfig } from "@account-kit/infra";
2
3
  import { type CreateLightAccountParams, type LightAccount, type LightAccountClientActions } from "@account-kit/smart-contracts";
3
- import type { HttpTransport, SmartAccountSigner } from "@aa-sdk/core";
4
4
  import { type Chain, type CustomTransport, type Transport } from "viem";
5
5
  export type AlchemyLightAccountClientConfig<TSigner extends SmartAccountSigner = SmartAccountSigner> = Omit<CreateLightAccountParams<HttpTransport, TSigner>, "transport" | "chain"> & Omit<AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>, "account">;
6
6
  export declare function createLightAccountAlchemyClient<TSigner extends SmartAccountSigner = SmartAccountSigner>(params: AlchemyLightAccountClientConfig<TSigner>): Promise<AlchemySmartAccountClient<CustomTransport, Chain | undefined, LightAccount<TSigner>, LightAccountClientActions<TSigner>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2CAA2C,GAG5C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAI1B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAoD,MAAM,MAAM,CAAC;AA8ChF,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,MAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,2BAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,4BAA4B,CAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,2CAA2C,CAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccount,\n lightAccountClientActions,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra/chains\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient(\n config: AlchemyLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(lightAccountClientActions);\n}\n"]}
1
+ {"version":3,"file":"alchemyClient.js","sourceRoot":"","sources":["../../../../../src/light-account/clients/alchemyClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,2CAA2C,GAG5C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAI1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAAoD,MAAM,MAAM,CAAC;AA8ChF,MAAM,CAAC,KAAK,UAAU,+BAA+B,CACnD,MAAuC;IAEvC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,gBAAgB,EAAE,GACxC,2BAA2B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAE5C,MAAM,MAAM,GAAG,4BAA4B,CAAC;QAC1C,KAAK;QACL,gBAAgB;KACjB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,kBAAkB,CAAC;QACvC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC;QACzB,GAAG,MAAM;KACV,CAAC,CAAC;IAEH,OAAO,2CAA2C,CAAC;QACjD,GAAG,MAAM;QACT,MAAM;QACN,OAAO;QACP,IAAI;KACL,CAAC,CAAC,MAAM,CAAC,yBAAyB,CAAC,CAAC;AACvC,CAAC","sourcesContent":["import type { HttpTransport, SmartAccountSigner } from \"@aa-sdk/core\";\nimport {\n AlchemyProviderConfigSchema,\n createAlchemyPublicRpcClient,\n createAlchemySmartAccountClientFromExisting,\n type AlchemySmartAccountClient,\n type AlchemySmartAccountClientConfig,\n} from \"@account-kit/infra\";\nimport {\n createLightAccount,\n lightAccountClientActions,\n type CreateLightAccountParams,\n type LightAccount,\n type LightAccountClientActions,\n} from \"@account-kit/smart-contracts\";\nimport { custom, type Chain, type CustomTransport, type Transport } from \"viem\";\n\nexport type AlchemyLightAccountClientConfig<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n> = Omit<\n CreateLightAccountParams<HttpTransport, TSigner>,\n \"transport\" | \"chain\"\n> &\n Omit<\n AlchemySmartAccountClientConfig<Transport, Chain, LightAccount<TSigner>>,\n \"account\"\n >;\n\nexport async function createLightAccountAlchemyClient<\n TSigner extends SmartAccountSigner = SmartAccountSigner\n>(\n params: AlchemyLightAccountClientConfig<TSigner>\n): Promise<\n AlchemySmartAccountClient<\n CustomTransport,\n Chain | undefined,\n LightAccount<TSigner>,\n LightAccountClientActions<TSigner>\n >\n>;\n\n/**\n * Creates an Alchemy smart account client connected to a Light Account instance.\n *\n * @example\n * ```ts\n * import { createLightAccountAlchemyClient } from \"@account-kit/smart-contracts\";\n * import { sepolia } from \"@account-kit/infra\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { generatePrivateKey } from \"viem\"\n *\n * const lightAccountClient = await createLightAccountAlchemyClient({\n * apiKey: \"your-api-key\",\n * chain: sepolia,\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {AlchemyLightAccountClientConfig} config The configuration for setting up the Alchemy Light Account Client\n * @returns {Promise<AlchemySmartAccountClient>} A promise that resolves to an `AlchemySmartAccountClient` object containing the created client\n */\nexport async function createLightAccountAlchemyClient(\n config: AlchemyLightAccountClientConfig\n): Promise<AlchemySmartAccountClient> {\n const { chain, opts, ...connectionConfig } =\n AlchemyProviderConfigSchema.parse(config);\n\n const client = createAlchemyPublicRpcClient({\n chain,\n connectionConfig,\n });\n\n const account = await createLightAccount({\n transport: custom(client),\n ...config,\n });\n\n return createAlchemySmartAccountClientFromExisting({\n ...config,\n client,\n account,\n opts,\n }).extend(lightAccountClientActions);\n}\n"]}
@@ -5,6 +5,5 @@ import { type LightAccountClientActions } from "../decorators/lightAccount.js";
5
5
  export type CreateLightAccountClientParams<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner> = {
6
6
  transport: CreateLightAccountParams<TTransport, TSigner>["transport"];
7
7
  chain: CreateLightAccountParams<TTransport, TSigner>["chain"];
8
- account: Omit<CreateLightAccountParams<TTransport, TSigner>, "transport" | "chain">;
9
- } & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
8
+ } & Omit<CreateLightAccountParams<TTransport, TSigner>, "transport" | "chain"> & Omit<SmartAccountClientConfig<TTransport, TChain>, "transport" | "account" | "chain">;
10
9
  export declare function createLightAccountClient<TChain extends Chain | undefined = Chain | undefined, TSigner extends SmartAccountSigner = SmartAccountSigner>(args: CreateLightAccountClientParams<Transport, TChain, TSigner>): Promise<SmartAccountClient<CustomTransport, Chain, LightAccount<TSigner>, SmartAccountClientActions<Chain, SmartContractAccount> & LightAccountClientActions<TSigner, LightAccount<TSigner>>>>;
@@ -3,14 +3,14 @@ import {} from "viem";
3
3
  import { createLightAccount, } from "../accounts/account.js";
4
4
  import { lightAccountClientActions, } from "../decorators/lightAccount.js";
5
5
  export async function createLightAccountClient(params) {
6
- const { account, transport, chain, ...clientConfig } = params;
6
+ const { transport, chain } = params;
7
7
  const lightAccount = await createLightAccount({
8
- ...account,
8
+ ...params,
9
9
  transport,
10
10
  chain,
11
11
  });
12
12
  return createSmartAccountClient({
13
- ...clientConfig,
13
+ ...params,
14
14
  transport,
15
15
  chain: chain,
16
16
  account: lightAccount,