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

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 (148) 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 +2 -2
  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/multiOwnerAlchemyClient.d.ts +2 -2
  22. package/dist/cjs/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  23. package/dist/cjs/src/light-account/decorators/lightAccount.js.map +1 -1
  24. package/dist/cjs/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  25. package/dist/cjs/src/light-account/types.d.ts +23 -31
  26. package/dist/cjs/src/light-account/types.js.map +1 -1
  27. package/dist/cjs/src/light-account/utils.d.ts +7 -10
  28. package/dist/cjs/src/light-account/utils.js +59 -87
  29. package/dist/cjs/src/light-account/utils.js.map +1 -1
  30. package/dist/cjs/src/msca/client/alchemyClient.d.ts +1 -1
  31. package/dist/cjs/src/msca/client/alchemyClient.js.map +1 -1
  32. package/dist/cjs/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  33. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js +1 -1
  34. package/dist/cjs/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  35. package/dist/cjs/src/msca/plugins/multisig/middleware.js.map +1 -1
  36. package/dist/cjs/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  37. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  38. package/dist/cjs/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  39. package/dist/cjs/src/msca/plugins/session-key/permissions.js.map +1 -1
  40. package/dist/cjs/src/msca/plugins/session-key/signer.js.map +1 -1
  41. package/dist/cjs/src/msca/utils.js +11 -10
  42. package/dist/cjs/src/msca/utils.js.map +1 -1
  43. package/dist/esm/plugindefs/multi-owner/config.js +1 -2
  44. package/dist/esm/plugindefs/multi-owner/config.js.map +1 -1
  45. package/dist/esm/plugindefs/multisig/config.js +1 -1
  46. package/dist/esm/plugindefs/multisig/config.js.map +1 -1
  47. package/dist/esm/plugindefs/session-key/config.js +1 -1
  48. package/dist/esm/plugindefs/session-key/config.js.map +1 -1
  49. package/dist/esm/src/index.d.ts +1 -1
  50. package/dist/esm/src/index.js +1 -1
  51. package/dist/esm/src/index.js.map +1 -1
  52. package/dist/esm/src/light-account/accounts/account.d.ts +5 -6
  53. package/dist/esm/src/light-account/accounts/account.js +3 -2
  54. package/dist/esm/src/light-account/accounts/account.js.map +1 -1
  55. package/dist/esm/src/light-account/accounts/base.d.ts +7 -6
  56. package/dist/esm/src/light-account/accounts/base.js +8 -8
  57. package/dist/esm/src/light-account/accounts/base.js.map +1 -1
  58. package/dist/esm/src/light-account/accounts/multiOwner.d.ts +5 -5
  59. package/dist/esm/src/light-account/accounts/multiOwner.js +4 -3
  60. package/dist/esm/src/light-account/accounts/multiOwner.js.map +1 -1
  61. package/dist/esm/src/light-account/clients/alchemyClient.d.ts +1 -1
  62. package/dist/esm/src/light-account/clients/alchemyClient.js.map +1 -1
  63. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  64. package/dist/esm/src/light-account/clients/multiOwnerAlchemyClient.js.map +1 -1
  65. package/dist/esm/src/light-account/decorators/lightAccount.js.map +1 -1
  66. package/dist/esm/src/light-account/decorators/multiOwnerLightAccount.js.map +1 -1
  67. package/dist/esm/src/light-account/types.d.ts +23 -31
  68. package/dist/esm/src/light-account/types.js.map +1 -1
  69. package/dist/esm/src/light-account/utils.d.ts +7 -10
  70. package/dist/esm/src/light-account/utils.js +57 -84
  71. package/dist/esm/src/light-account/utils.js.map +1 -1
  72. package/dist/esm/src/msca/client/alchemyClient.d.ts +1 -1
  73. package/dist/esm/src/msca/client/alchemyClient.js.map +1 -1
  74. package/dist/esm/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  75. package/dist/esm/src/msca/client/multiSigAlchemyClient.js +1 -1
  76. package/dist/esm/src/msca/client/multiSigAlchemyClient.js.map +1 -1
  77. package/dist/esm/src/msca/plugins/multisig/middleware.js.map +1 -1
  78. package/dist/esm/src/msca/plugins/multisig/utils/formatSignatures.js.map +1 -1
  79. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +3 -2
  80. package/dist/esm/src/msca/plugins/multisig/utils/splitAggregatedSignature.js.map +1 -1
  81. package/dist/esm/src/msca/plugins/session-key/permissions.js.map +1 -1
  82. package/dist/esm/src/msca/plugins/session-key/signer.js.map +1 -1
  83. package/dist/esm/src/msca/utils.js +2 -1
  84. package/dist/esm/src/msca/utils.js.map +1 -1
  85. package/dist/types/plugindefs/multi-owner/config.d.ts.map +1 -1
  86. package/dist/types/src/index.d.ts +1 -1
  87. package/dist/types/src/index.d.ts.map +1 -1
  88. package/dist/types/src/light-account/accounts/account.d.ts +5 -6
  89. package/dist/types/src/light-account/accounts/account.d.ts.map +1 -1
  90. package/dist/types/src/light-account/accounts/base.d.ts +7 -6
  91. package/dist/types/src/light-account/accounts/base.d.ts.map +1 -1
  92. package/dist/types/src/light-account/accounts/multiOwner.d.ts +5 -5
  93. package/dist/types/src/light-account/accounts/multiOwner.d.ts.map +1 -1
  94. package/dist/types/src/light-account/clients/alchemyClient.d.ts +1 -1
  95. package/dist/types/src/light-account/clients/alchemyClient.d.ts.map +1 -1
  96. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts +2 -2
  97. package/dist/types/src/light-account/clients/multiOwnerAlchemyClient.d.ts.map +1 -1
  98. package/dist/types/src/light-account/decorators/lightAccount.d.ts +1 -1
  99. package/dist/types/src/light-account/decorators/multiOwnerLightAccount.d.ts +1 -1
  100. package/dist/types/src/light-account/types.d.ts +23 -118
  101. package/dist/types/src/light-account/types.d.ts.map +1 -1
  102. package/dist/types/src/light-account/utils.d.ts +19 -48
  103. package/dist/types/src/light-account/utils.d.ts.map +1 -1
  104. package/dist/types/src/msca/client/alchemyClient.d.ts +1 -1
  105. package/dist/types/src/msca/client/alchemyClient.d.ts.map +1 -1
  106. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts +1 -1
  107. package/dist/types/src/msca/client/multiSigAlchemyClient.d.ts.map +1 -1
  108. package/dist/types/src/msca/plugins/multisig/middleware.d.ts +6 -6
  109. package/dist/types/src/msca/plugins/multisig/utils/formatSignatures.d.ts +3 -3
  110. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts +13 -12
  111. package/dist/types/src/msca/plugins/multisig/utils/splitAggregatedSignature.d.ts.map +1 -1
  112. package/dist/types/src/msca/plugins/session-key/permissions.d.ts +147 -1
  113. package/dist/types/src/msca/plugins/session-key/permissions.d.ts.map +1 -1
  114. package/dist/types/src/msca/plugins/session-key/signer.d.ts +71 -1
  115. package/dist/types/src/msca/plugins/session-key/signer.d.ts.map +1 -1
  116. package/dist/types/src/msca/utils.d.ts +6 -6
  117. package/dist/types/src/msca/utils.d.ts.map +1 -1
  118. package/package.json +7 -6
  119. package/plugindefs/multi-owner/config.ts +1 -2
  120. package/plugindefs/multisig/config.ts +1 -1
  121. package/plugindefs/session-key/config.ts +1 -1
  122. package/src/index.ts +1 -1
  123. package/src/light-account/accounts/account.ts +24 -45
  124. package/src/light-account/accounts/base.ts +39 -68
  125. package/src/light-account/accounts/multiOwner.ts +29 -43
  126. package/src/light-account/clients/alchemyClient.ts +2 -2
  127. package/src/light-account/clients/multiOwnerAlchemyClient.ts +3 -3
  128. package/src/light-account/decorators/lightAccount.ts +1 -1
  129. package/src/light-account/decorators/multiOwnerLightAccount.ts +1 -1
  130. package/src/light-account/types.ts +31 -188
  131. package/src/light-account/utils.ts +91 -246
  132. package/src/msca/client/alchemyClient.ts +2 -2
  133. package/src/msca/client/multiSigAlchemyClient.ts +5 -5
  134. package/src/msca/plugins/multisig/middleware.ts +6 -6
  135. package/src/msca/plugins/multisig/utils/formatSignatures.ts +3 -3
  136. package/src/msca/plugins/multisig/utils/splitAggregatedSignature.ts +15 -12
  137. package/src/msca/plugins/session-key/permissions.ts +147 -1
  138. package/src/msca/plugins/session-key/signer.ts +71 -1
  139. package/src/msca/utils.ts +15 -13
  140. package/dist/cjs/src/light-account/schema.d.ts +0 -21
  141. package/dist/cjs/src/light-account/schema.js +0 -30
  142. package/dist/cjs/src/light-account/schema.js.map +0 -1
  143. package/dist/esm/src/light-account/schema.d.ts +0 -21
  144. package/dist/esm/src/light-account/schema.js +0 -27
  145. package/dist/esm/src/light-account/schema.js.map +0 -1
  146. package/dist/types/src/light-account/schema.d.ts +0 -22
  147. package/dist/types/src/light-account/schema.d.ts.map +0 -1
  148. package/src/light-account/schema.ts +0 -39
@@ -1,29 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MultiOwnerPluginGenConfig = void 0;
4
- const core_1 = require("@aa-sdk/core");
4
+ const infra_1 = require("@account-kit/infra");
5
5
  const viem_1 = require("viem");
6
6
  const abi_js_1 = require("./abi.js");
7
7
  exports.MultiOwnerPluginGenConfig = {
8
8
  name: "MultiOwnerPlugin",
9
9
  abi: abi_js_1.MultiOwnerPluginAbi,
10
10
  addresses: {
11
- [core_1.sepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
12
- [core_1.baseSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
13
- [core_1.polygon.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
14
- [core_1.polygonAmoy.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
15
- [core_1.polygonMumbai.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
16
- [core_1.optimism.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
17
- [core_1.optimismSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
18
- [core_1.arbitrum.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
19
- [core_1.arbitrumSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
20
- [core_1.base.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
21
- [core_1.baseSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
22
- [core_1.fraxtal.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
23
- [core_1.fraxtalSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
24
- [core_1.zora.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
25
- [core_1.zoraSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
26
- [core_1.mainnet.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
11
+ [infra_1.sepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
12
+ [infra_1.baseSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
13
+ [infra_1.polygon.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
14
+ [infra_1.polygonAmoy.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
15
+ [infra_1.polygonMumbai.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
16
+ [infra_1.optimism.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
17
+ [infra_1.optimismSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
18
+ [infra_1.arbitrum.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
19
+ [infra_1.arbitrumSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
20
+ [infra_1.base.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
21
+ [infra_1.fraxtal.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
22
+ [infra_1.fraxtalSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
23
+ [infra_1.zora.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
24
+ [infra_1.zoraSepolia.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
25
+ [infra_1.mainnet.id]: "0xcE0000007B008F50d762D155002600004cD6c647",
27
26
  },
28
27
  installConfig: {
29
28
  initAbiParams: (0, viem_1.parseAbiParameters)("address[]"),
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multi-owner/config.ts"],"names":[],"mappings":";;;AAAA,uCAgBsB;AAEtB,+BAA0C;AAC1C,qCAA+C;AAElC,QAAA,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,4BAAmB;IACxB,SAAS,EAAE;QACT,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,oBAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAAC,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,8CAgB4B;AAE5B,+BAA0C;AAC1C,qCAA+C;AAElC,QAAA,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,4BAAmB;IACxB,SAAS,EAAE;QACT,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,qBAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAAC,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,27 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MultisigPluginGenConfig = void 0;
4
- const core_1 = require("@aa-sdk/core");
4
+ const infra_1 = require("@account-kit/infra");
5
5
  const viem_1 = require("viem");
6
6
  const abi_js_1 = require("./abi.js");
7
7
  exports.MultisigPluginGenConfig = {
8
8
  name: "MultisigPlugin",
9
9
  abi: abi_js_1.MultisigPluginAbi,
10
10
  addresses: {
11
- [core_1.sepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
12
- [core_1.baseSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
13
- [core_1.polygon.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
14
- [core_1.mainnet.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
15
- [core_1.polygonAmoy.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
16
- [core_1.optimism.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
17
- [core_1.optimismSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
18
- [core_1.arbitrum.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
19
- [core_1.arbitrumSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
20
- [core_1.base.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
21
- [core_1.fraxtal.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
22
- [core_1.fraxtalSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
23
- [core_1.zora.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
24
- [core_1.zoraSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
11
+ [infra_1.sepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
12
+ [infra_1.baseSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
13
+ [infra_1.polygon.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
14
+ [infra_1.mainnet.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
15
+ [infra_1.polygonAmoy.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
16
+ [infra_1.optimism.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
17
+ [infra_1.optimismSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
18
+ [infra_1.arbitrum.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
19
+ [infra_1.arbitrumSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
20
+ [infra_1.base.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
21
+ [infra_1.fraxtal.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
22
+ [infra_1.fraxtalSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
23
+ [infra_1.zora.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
24
+ [infra_1.zoraSepolia.id]: "0x000000000000A53f64b7bcf4Cd59624943C43Fc7",
25
25
  },
26
26
  installConfig: {
27
27
  initAbiParams: (0, viem_1.parseAbiParameters)("address[], uint"),
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/multisig/config.ts"],"names":[],"mappings":";;;AAAA,uCAesB;AAEtB,+BAA0C;AAC1C,qCAA6C;AAEhC,QAAA,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,0BAAiB;IACtB,SAAS,EAAE;QACT,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAAC,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,8CAe4B;AAE5B,+BAA0C;AAC1C,qCAA6C;AAEhC,QAAA,uBAAuB,GAAiB;IACnD,IAAI,EAAE,gBAAgB;IACtB,GAAG,EAAE,0BAAiB;IACtB,SAAS,EAAE;QACT,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC/D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAAC,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,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SessionKeyPluginGenConfig = void 0;
4
- const core_1 = require("@aa-sdk/core");
4
+ const infra_1 = require("@account-kit/infra");
5
5
  const viem_1 = require("viem");
6
6
  const config_js_1 = require("../multi-owner/config.js");
7
7
  const abi_js_1 = require("./abi.js");
@@ -9,22 +9,22 @@ exports.SessionKeyPluginGenConfig = {
9
9
  name: "SessionKeyPlugin",
10
10
  abi: abi_js_1.SessionKeyPluginAbi,
11
11
  addresses: {
12
- [core_1.sepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
13
- [core_1.baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
14
- [core_1.polygon.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
15
- [core_1.polygonAmoy.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
16
- [core_1.polygonMumbai.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
17
- [core_1.optimism.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
18
- [core_1.optimismSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
19
- [core_1.arbitrum.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
20
- [core_1.arbitrumSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
21
- [core_1.base.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
22
- [core_1.baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
23
- [core_1.fraxtal.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
24
- [core_1.fraxtalSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
25
- [core_1.zora.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
26
- [core_1.zoraSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
27
- [core_1.mainnet.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
12
+ [infra_1.sepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
13
+ [infra_1.baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
14
+ [infra_1.polygon.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
15
+ [infra_1.polygonAmoy.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
16
+ [infra_1.polygonMumbai.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
17
+ [infra_1.optimism.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
18
+ [infra_1.optimismSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
19
+ [infra_1.arbitrum.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
20
+ [infra_1.arbitrumSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
21
+ [infra_1.base.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
22
+ [infra_1.baseSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
23
+ [infra_1.fraxtal.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
24
+ [infra_1.fraxtalSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
25
+ [infra_1.zora.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
26
+ [infra_1.zoraSepolia.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
27
+ [infra_1.mainnet.id]: "0x0000003E0000a96de4058e1E02a62FaaeCf23d8d",
28
28
  },
29
29
  installConfig: {
30
30
  initAbiParams: (0, viem_1.parseAbiParameters)("address[] initialKeys, bytes32[] tags, bytes[][] initialPermissions"),
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../plugindefs/session-key/config.ts"],"names":[],"mappings":";;;AAAA,uCAgBsB;AAEtB,+BAA0C;AAC1C,wDAAqE;AACrE,qCAA+C;AAElC,QAAA,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,4BAAmB;IACxB,SAAS,EAAE;QACT,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,oBAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,eAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,sBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,qBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,WAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,kBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,cAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAC/B,qEAAqE,CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,qCAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,qCAAyB;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,8CAgB4B;AAE5B,+BAA0C;AAC1C,wDAAqE;AACrE,qCAA+C;AAElC,QAAA,yBAAyB,GAAiB;IACrD,IAAI,EAAE,kBAAkB;IACxB,GAAG,EAAE,4BAAmB;IACxB,SAAS,EAAE;QACT,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,qBAAa,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAChE,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,gBAAQ,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC3D,CAAC,uBAAe,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAClE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC1D,CAAC,sBAAc,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACjE,CAAC,YAAI,CAAC,EAAE,CAAC,EAAE,4CAA4C;QACvD,CAAC,mBAAW,CAAC,EAAE,CAAC,EAAE,4CAA4C;QAC9D,CAAC,eAAO,CAAC,EAAE,CAAC,EAAE,4CAA4C;KAC3D;IACD,aAAa,EAAE;QACb,aAAa,EAAE,IAAA,yBAAkB,EAC/B,qEAAqE,CACtE;QACD,YAAY,EAAE;YACZ;gBACE,MAAM,EAAE,qCAAyB;gBACjC,UAAU,EAAE,KAAK;aAClB;YACD;gBACE,MAAM,EAAE,qCAAyB;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, getLightAccountVersionForAccount, } from "./light-account/utils.js";
11
11
  export type * from "./light-account/accounts/multiOwner.js";
12
12
  export { createMultiOwnerLightAccount } from "./light-account/accounts/multiOwner.js";
13
13
  export { updateOwners as updateMultiOwnerLightAccountOwners } from "./light-account/actions/updateOwners.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitAggregatedSignature = exports.getSignerType = exports.formatSignatures = exports.combineSignatures = exports.multisigSignatureMiddleware = exports.multisigPluginActions = exports.MultisigPluginExecutionFunctionAbi = exports.MultisigPluginAbi = exports.MultisigPlugin = exports.MultiOwnerPluginExecutionFunctionAbi = exports.MultiOwnerPluginAbi = exports.MultiOwnerPlugin = exports.multiOwnerPluginActions = exports.installPlugin = exports.pluginManagerActions = exports.MultisigMissingSignatureError = exports.MultisigAccountExpectedError = exports.InvalidContextSignatureError = exports.InvalidAggregatedSignatureError = exports.createMultisigAccountAlchemyClient = exports.createMultisigModularAccountClient = exports.createMultiOwnerModularAccountClient = exports.createModularAccountAlchemyClient = exports.standardExecutor = exports.createMultisigModularAccount = exports.createMultiOwnerModularAccount = exports.accountLoupeActions = exports.UpgradeableModularAccountAbi = exports.MultisigModularAccountFactoryAbi = exports.MultiOwnerModularAccountFactoryAbi = exports.IStandardExecutorAbi = exports.IPluginManagerAbi = exports.IPluginAbi = exports.IAccountLoupeAbi = exports.multiOwnerLightAccountClientActions = exports.createMultiOwnerLightAccountClient = exports.updateMultiOwnerLightAccountOwners = exports.createMultiOwnerLightAccount = exports.getLightAccountVersionDef = exports.getDefaultLightAccountFactoryAddress = exports.defaultLightAccountVersion = exports.LightAccountUnsupported1271Impls = exports.LightAccountUnsupported1271Factories = exports.AccountVersionRegistry = exports.lightAccountClientActions = exports.createMultiOwnerLightAccountAlchemyClient = exports.createLightAccountClient = exports.createLightAccountAlchemyClient = exports.transferLightAccountOwnership = exports.createLightAccount = void 0;
3
+ exports.splitAggregatedSignature = exports.getSignerType = exports.formatSignatures = exports.combineSignatures = exports.multisigSignatureMiddleware = exports.multisigPluginActions = exports.MultisigPluginExecutionFunctionAbi = exports.MultisigPluginAbi = exports.MultisigPlugin = exports.MultiOwnerPluginExecutionFunctionAbi = exports.MultiOwnerPluginAbi = exports.MultiOwnerPlugin = exports.multiOwnerPluginActions = exports.installPlugin = exports.pluginManagerActions = exports.MultisigMissingSignatureError = exports.MultisigAccountExpectedError = exports.InvalidContextSignatureError = exports.InvalidAggregatedSignatureError = exports.createMultisigAccountAlchemyClient = exports.createMultisigModularAccountClient = exports.createMultiOwnerModularAccountClient = exports.createModularAccountAlchemyClient = exports.standardExecutor = exports.createMultisigModularAccount = exports.createMultiOwnerModularAccount = exports.accountLoupeActions = exports.UpgradeableModularAccountAbi = exports.MultisigModularAccountFactoryAbi = exports.MultiOwnerModularAccountFactoryAbi = exports.IStandardExecutorAbi = exports.IPluginManagerAbi = exports.IPluginAbi = exports.IAccountLoupeAbi = exports.multiOwnerLightAccountClientActions = exports.createMultiOwnerLightAccountClient = exports.updateMultiOwnerLightAccountOwners = exports.createMultiOwnerLightAccount = exports.getLightAccountVersionForAccount = exports.getDefaultLightAccountFactoryAddress = exports.defaultLightAccountVersion = exports.LightAccountUnsupported1271Impls = exports.LightAccountUnsupported1271Factories = exports.AccountVersionRegistry = exports.lightAccountClientActions = exports.createMultiOwnerLightAccountAlchemyClient = exports.createLightAccountClient = exports.createLightAccountAlchemyClient = exports.transferLightAccountOwnership = exports.createLightAccount = void 0;
4
4
  exports.getMSCAUpgradeToData = exports.getMAInitializationData = exports.getDefaultMultisigModularAccountFactoryAddress = exports.getDefaultMultiOwnerModularAccountFactoryAddress = exports.buildSessionKeysToRemoveStruct = exports.SessionKeySigner = exports.SessionKeyPluginExecutionFunctionAbi = exports.SessionKeyPluginAbi = exports.SessionKeyPlugin = exports.SessionKeyPermissionsBuilder = exports.SessionKeyAccessListType = exports.sessionKeyPluginActions = void 0;
5
5
  var account_js_1 = require("./light-account/accounts/account.js");
6
6
  Object.defineProperty(exports, "createLightAccount", { enumerable: true, get: function () { return account_js_1.createLightAccount; } });
@@ -20,7 +20,7 @@ Object.defineProperty(exports, "LightAccountUnsupported1271Factories", { enumera
20
20
  Object.defineProperty(exports, "LightAccountUnsupported1271Impls", { enumerable: true, get: function () { return utils_js_1.LightAccountUnsupported1271Impls; } });
21
21
  Object.defineProperty(exports, "defaultLightAccountVersion", { enumerable: true, get: function () { return utils_js_1.defaultLightAccountVersion; } });
22
22
  Object.defineProperty(exports, "getDefaultLightAccountFactoryAddress", { enumerable: true, get: function () { return utils_js_1.getDefaultLightAccountFactoryAddress; } });
23
- Object.defineProperty(exports, "getLightAccountVersionDef", { enumerable: true, get: function () { return utils_js_1.getLightAccountVersionDef; } });
23
+ Object.defineProperty(exports, "getLightAccountVersionForAccount", { enumerable: true, get: function () { return utils_js_1.getLightAccountVersionForAccount; } });
24
24
  var multiOwner_js_1 = require("./light-account/accounts/multiOwner.js");
25
25
  Object.defineProperty(exports, "createMultiOwnerLightAccount", { enumerable: true, get: function () { return multiOwner_js_1.createMultiOwnerLightAccount; } });
26
26
  var updateOwners_js_1 = require("./light-account/actions/updateOwners.js");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;AAKA,kEAAyE;AAAhE,gHAAA,kBAAkB,OAAA;AAC3B,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xB,4HAAA,+BAA+B,OAAA;AAC/B,yHAAA,4BAA4B,OAAA;AAC5B,yHAAA,4BAA4B,OAAA;AAC5B,0HAAA,6BAA6B,OAAA;AAG/B,mEAA0E;AAAjE,oHAAA,oBAAoB,OAAA;AAC7B,2EAAuE;AAA9D,iHAAA,aAAa,OAAA;AACtB,wEAAkF;AAAzE,uHAAA,uBAAuB,OAAA;AAEhC,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAGtC,6DAM0C;AALxC,0GAAA,cAAc,OAAA;AACd,6GAAA,iBAAiB,OAAA;AACjB,8HAAA,kCAAkC,OAAA;AAClC,iHAAA,qBAAqB,OAAA;AACrB,uHAAA,2BAA2B,OAAA;AAE7B,mEAKgD;AAJ9C,6GAAA,iBAAiB,OAAA;AACjB,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,oHAAA,wBAAwB,OAAA;AAE1B,wEAAkF;AAAzE,uHAAA,uBAAuB,OAAA;AAGhC,4EAGmD;AAFjD,0HAAA,wBAAwB,OAAA;AACxB,8HAAA,4BAA4B,OAAA;AAE9B,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAEtC,kEAAwE;AAA/D,6GAAA,gBAAgB,OAAA;AACzB,gEAAqF;AAA5E,0HAAA,8BAA8B,OAAA;AAEvC,4CAKyB;AAJvB,4IAAA,gDAAgD,OAAA;AAChD,0IAAA,8CAA8C,OAAA;AAC9C,mHAAA,uBAAuB,OAAA;AACvB,gHAAA,oBAAoB,OAAA","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n getLightAccountVersionDef,\n} from \"./light-account/utils.js\";\n\n//multi-owner-light-account exports\nexport type * from \"./light-account/accounts/multiOwner.js\";\nexport { createMultiOwnerLightAccount } from \"./light-account/accounts/multiOwner.js\";\nexport { updateOwners as updateMultiOwnerLightAccountOwners } from \"./light-account/actions/updateOwners.js\";\nexport { createMultiOwnerLightAccountClient } from \"./light-account/clients/multiOwnerLightAccount.js\";\nexport type * from \"./light-account/decorators/multiOwnerLightAccount.js\";\nexport { multiOwnerLightAccountClientActions } from \"./light-account/decorators/multiOwnerLightAccount.js\";\n\n// msca exports\nexport { IAccountLoupeAbi } from \"./msca/abis/IAccountLoupe.js\";\nexport { IPluginAbi } from \"./msca/abis/IPlugin.js\";\nexport { IPluginManagerAbi } from \"./msca/abis/IPluginManager.js\";\nexport { IStandardExecutorAbi } from \"./msca/abis/IStandardExecutor.js\";\nexport { MultiOwnerModularAccountFactoryAbi } from \"./msca/abis/MultiOwnerModularAccountFactory.js\";\nexport { MultisigModularAccountFactoryAbi } from \"./msca/abis/MultisigModularAccountFactory.js\";\nexport { UpgradeableModularAccountAbi } from \"./msca/abis/UpgradeableModularAccount.js\";\nexport type * from \"./msca/account-loupe/decorator.js\";\nexport { accountLoupeActions } from \"./msca/account-loupe/decorator.js\";\nexport type * from \"./msca/account-loupe/types.js\";\nexport type * from \"./msca/account/multiOwnerAccount.js\";\nexport { createMultiOwnerModularAccount } from \"./msca/account/multiOwnerAccount.js\";\nexport type * from \"./msca/account/multisigAccount.js\";\nexport { createMultisigModularAccount } from \"./msca/account/multisigAccount.js\";\nexport { standardExecutor } from \"./msca/account/standardExecutor.js\";\nexport {\n createModularAccountAlchemyClient,\n type AlchemyModularAccountClientConfig,\n} from \"./msca/client/alchemyClient.js\";\nexport {\n createMultiOwnerModularAccountClient,\n createMultisigModularAccountClient,\n} from \"./msca/client/client.js\";\nexport {\n createMultisigAccountAlchemyClient,\n type AlchemyMultisigAccountClientConfig,\n} from \"./msca/client/multiSigAlchemyClient.js\";\nexport {\n InvalidAggregatedSignatureError,\n InvalidContextSignatureError,\n MultisigAccountExpectedError,\n MultisigMissingSignatureError,\n} from \"./msca/errors.js\";\nexport type * from \"./msca/plugin-manager/decorator.js\";\nexport { pluginManagerActions } from \"./msca/plugin-manager/decorator.js\";\nexport { installPlugin } from \"./msca/plugin-manager/installPlugin.js\";\nexport { multiOwnerPluginActions } from \"./msca/plugins/multi-owner/extension.js\";\nexport type * from \"./msca/plugins/multi-owner/index.js\";\nexport {\n MultiOwnerPlugin,\n MultiOwnerPluginAbi,\n MultiOwnerPluginExecutionFunctionAbi,\n} from \"./msca/plugins/multi-owner/plugin.js\";\nexport type * from \"./msca/plugins/multisig/index.js\";\nexport {\n MultisigPlugin,\n MultisigPluginAbi,\n MultisigPluginExecutionFunctionAbi,\n multisigPluginActions,\n multisigSignatureMiddleware,\n} from \"./msca/plugins/multisig/index.js\";\nexport {\n combineSignatures,\n formatSignatures,\n getSignerType,\n splitAggregatedSignature,\n} from \"./msca/plugins/multisig/utils/index.js\";\nexport { sessionKeyPluginActions } from \"./msca/plugins/session-key/extension.js\";\nexport type * from \"./msca/plugins/session-key/index.js\";\nexport type * from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyAccessListType,\n SessionKeyPermissionsBuilder,\n} from \"./msca/plugins/session-key/permissions.js\";\nexport {\n SessionKeyPlugin,\n SessionKeyPluginAbi,\n SessionKeyPluginExecutionFunctionAbi,\n} from \"./msca/plugins/session-key/plugin.js\";\nexport { SessionKeySigner } from \"./msca/plugins/session-key/signer.js\";\nexport { buildSessionKeysToRemoveStruct } from \"./msca/plugins/session-key/utils.js\";\nexport type * from \"./msca/plugins/types.js\";\nexport {\n getDefaultMultiOwnerModularAccountFactoryAddress,\n getDefaultMultisigModularAccountFactoryAddress,\n getMAInitializationData,\n getMSCAUpgradeToData,\n} from \"./msca/utils.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;;AAKA,kEAAyE;AAAhE,gHAAA,kBAAkB,OAAA;AAC3B,qFAAkH;AAAzG,qIAAA,iBAAiB,OAAiC;AAC3D,6EAGkD;AAFhD,mIAAA,+BAA+B,OAAA;AAGjC,+DAA6E;AAApE,qHAAA,wBAAwB,OAAA;AACjC,iGAG4D;AAF1D,uJAAA,yCAAyC,OAAA;AAI3C,8EAAuF;AAA9E,4HAAA,yBAAyB,OAAA;AAGlC,qDAOkC;AANhC,kHAAA,sBAAsB,OAAA;AACtB,gIAAA,oCAAoC,OAAA;AACpC,4HAAA,gCAAgC,OAAA;AAChC,sHAAA,0BAA0B,OAAA;AAC1B,gIAAA,oCAAoC,OAAA;AACpC,4HAAA,gCAAgC,OAAA;AAKlC,wEAAsF;AAA7E,6HAAA,4BAA4B,OAAA;AACrC,2EAA6G;AAApG,qIAAA,YAAY,OAAsC;AAC3D,+FAAuG;AAA9F,+IAAA,kCAAkC,OAAA;AAE3C,kGAA2G;AAAlG,gJAAA,mCAAmC,OAAA;AAG5C,iEAAgE;AAAvD,oHAAA,gBAAgB,OAAA;AACzB,qDAAoD;AAA3C,wGAAA,UAAU,OAAA;AACnB,mEAAkE;AAAzD,sHAAA,iBAAiB,OAAA;AAC1B,yEAAwE;AAA/D,4HAAA,oBAAoB,O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,kEAI8C;AAH5C,6GAAA,gBAAgB,OAAA;AAChB,gHAAA,mBAAmB,OAAA;AACnB,iIAAA,oCAAoC,OAAA;AAEtC,kEAAwE;AAA/D,6GAAA,gBAAgB,OAAA;AACzB,gEAAqF;AAA5E,0HAAA,8BAA8B,OAAA;AAEvC,4CAKyB;AAJvB,4IAAA,gDAAgD,OAAA;AAChD,0IAAA,8CAA8C,OAAA;AAC9C,mHAAA,uBAAuB,OAAA;AACvB,gHAAA,oBAAoB,OAAA","sourcesContent":["// Add you exports here, make sure to export types separately from impls and use the `type` keyword when exporting them\n// Don't use wildcard exports, instead use named exports\n\n//light-account exports\nexport type * from \"./light-account/accounts/account.js\";\nexport { createLightAccount } from \"./light-account/accounts/account.js\";\nexport { transferOwnership as transferLightAccountOwnership } from \"./light-account/actions/transferOwnership.js\";\nexport {\n createLightAccountAlchemyClient,\n type AlchemyLightAccountClientConfig,\n} from \"./light-account/clients/alchemyClient.js\";\nexport { createLightAccountClient } from \"./light-account/clients/client.js\";\nexport {\n createMultiOwnerLightAccountAlchemyClient,\n type AlchemyMultiOwnerLightAccountClientConfig,\n} from \"./light-account/clients/multiOwnerAlchemyClient.js\";\nexport type * from \"./light-account/decorators/lightAccount.js\";\nexport { lightAccountClientActions } from \"./light-account/decorators/lightAccount.js\";\nexport type * from \"./light-account/types.js\";\n\nexport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n LightAccountUnsupported1271Impls,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n 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>>;
@@ -9,7 +9,7 @@ const LightAccountFactoryAbi_v1_js_1 = require("../abis/LightAccountFactoryAbi_v
9
9
  const LightAccountFactoryAbi_v2_js_1 = require("../abis/LightAccountFactoryAbi_v2.js");
10
10
  const utils_js_1 = require("../utils.js");
11
11
  const base_js_1 = require("./base.js");
12
- async function createLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)("LightAccount"), entryPoint = (0, core_1.getEntryPoint)(chain, {
12
+ async function createLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)(), entryPoint = (0, core_1.getEntryPoint)(chain, {
13
13
  version: utils_js_1.AccountVersionRegistry["LightAccount"][version]
14
14
  .entryPointVersion,
15
15
  }), accountAddress, factoryAddress = (0, utils_js_1.getDefaultLightAccountFactoryAddress)(chain, version), salt: salt_ = 0n, }) {
@@ -47,7 +47,8 @@ async function createLightAccount({ transport, chain, signer, initCode, version
47
47
  chain,
48
48
  signer,
49
49
  abi: accountAbi,
50
- version: utils_js_1.AccountVersionRegistry["LightAccount"][version],
50
+ type: "LightAccount",
51
+ version,
51
52
  entryPoint,
52
53
  accountAddress: address,
53
54
  getAccountInitCode,
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AACtB,+BAMc;AACd,yEAAmE;AACnE,yEAAmE;AACnE,uFAAiF;AACjF,uFAAiF;AAKjF,0CAKqB;AACrB,uCAImB;AA4FZ,KAAK,UAAU,kBAAkB,CAAC,EACvC,SAAS,EACT,KAAK,EACL,MAAM,EACN,QAAQ,EACR,OAAO,GAAG,IAAA,qCAA0B,EAAC,cAAc,CAAC,EACpD,UAAU,GAAG,IAAA,oBAAa,EAAC,KAAK,EAAE;IAChC,OAAO,EAAE,iCAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;SACrD,iBAAwB;CAC5B,CAAC,EACF,cAAc,EACd,cAAc,GAAG,IAAA,+CAAoC,EAAC,KAAK,EAAE,OAAO,CAAC,EACrE,IAAI,EAAE,KAAK,GAAG,EAAE,GACS;IACzB,MAAM,MAAM,GAAG,IAAA,0BAAmB,EAAC;QACjC,SAAS;QACT,KAAK;KACN,CAAC,CAAC;IAEH,MAAM,UAAU,GACd,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,0CAAkB,CAAC,CAAC,CAAC,0CAAkB,CAAC;IACjE,MAAM,UAAU,GACd,OAAO,KAAK,QAAQ;QAClB,CAAC,CAAC,wDAAyB;QAC3B,CAAC,CAAC,wDAAyB,CAAC;IAEhC,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,QAAQ;YAAE,OAAO,QAAQ,CAAC;QAE9B,MAAM,IAAI,GAAG,+CAAoC,CAAC,GAAG,CACnD,cAAc,CAAC,WAAW,EAAa,CACxC;YACC,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,KAAK,CAAC;QAEV,OAAO,IAAA,gBAAS,EAAC;YACf,cAAc;YACd,IAAA,yBAAkB,EAAC;gBACjB,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,eAAe;gBAC7B,IAAI,EAAE,CAAC,MAAM,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC;aACxC,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,MAAM,IAAA,wBAAiB,EAAC;QACtC,MAAM;QACN,UAAU;QACV,cAAc;QACd,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,gCAAsB,EAI1C;QACA,SAAS;QACT,KAAK;QACL,MAAM;QACN,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,iCAAsB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;QACxD,UAAU;QACV,cAAc,EAAE,OAAO;QACvB,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QAEV,uBAAuB,EAAE,CAAC,QAAiB,EAAE,EAAE;YAC7C,OAAO,IAAA,yBAAkB,EAAC;gBACxB,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,mBAAmB;gBACjC,IAAI,EAAE,CAAC,QAAQ,CAAC;aACjB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,OAAO;aACtB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC;AA3FD,gDA2FC","sourcesContent":["import {\n createBundlerClient,\n getAccountAddress,\n getEntryPoint,\n type Address,\n type EntryPointDef,\n type SmartAccountSigner,\n} from \"@aa-sdk/core\";\nimport {\n concatHex,\n encodeFunctionData,\n type Chain,\n type Hex,\n type Transport,\n} from \"viem\";\nimport { LightAccountAbi_v1 } from \"../abis/LightAccountAbi_v1.js\";\nimport { LightAccountAbi_v2 } from \"../abis/LightAccountAbi_v2.js\";\nimport { LightAccountFactoryAbi_v1 } from \"../abis/LightAccountFactoryAbi_v1.js\";\nimport { LightAccountFactoryAbi_v2 } from \"../abis/LightAccountFactoryAbi_v2.js\";\nimport type {\n GetEntryPointForLightAccountVersion,\n GetLightAccountVersion,\n} from \"../types.js\";\nimport {\n AccountVersionRegistry,\n LightAccountUnsupported1271Factories,\n defaultLightAccountVersion,\n getDefaultLightAccountFactoryAddress,\n} from \"../utils.js\";\nimport {\n createLightAccountBase,\n type CreateLightAccountBaseParams,\n type LightAccountBase,\n} from \"./base.js\";\n\nexport type LightAccount<\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = LightAccountBase<\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n> & {\n encodeTransferOwnership: (newOwner: Address) => Hex;\n getOwnerAddress: () => Promise<Address>;\n};\n\n// [!region CreateLightAccountParams]\nexport type CreateLightAccountParams<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n> = Omit<\n CreateLightAccountBaseParams<\n TTransport,\n TSigner,\n \"LightAccount\",\n TLightAccountVersion,\n TEntryPointVersion\n >,\n \"getAccountInitCode\" | \"entryPoint\" | \"version\" | \"abi\" | \"accountAddress\"\n> & {\n salt?: bigint;\n initCode?: Hex;\n accountAddress?: Address;\n factoryAddress?: Address;\n version?: TLightAccountVersion;\n entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;\n};\n// [!endregion CreateLightAccountParams]\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = \"v1.1.0\"\n>(\n config: CreateLightAccountParams<TTransport, TSigner, TLightAccountVersion>\n): Promise<LightAccount<TSigner, TLightAccountVersion>>;\n\nexport async function createLightAccount<\n TTransport extends Transport = Transport,\n TSigner extends SmartAccountSigner = SmartAccountSigner,\n TLightAccountVersion extends GetLightAccountVersion<\"LightAccount\"> = GetLightAccountVersion<\"LightAccount\">,\n TEntryPointVersion extends GetEntryPointForLightAccountVersion<\n \"LightAccount\",\n TLightAccountVersion\n > = GetEntryPointForLightAccountVersion<\"LightAccount\", TLightAccountVersion>\n>(\n config: CreateLightAccountParams<\n TTransport,\n TSigner,\n TLightAccountVersion,\n TEntryPointVersion\n >\n): Promise<LightAccount<TSigner, TLightAccountVersion, TEntryPointVersion>>;\n\n/**\n * Creates a light account based on the provided parameters such as transport, chain, signer, init code, and more. Ensures that an account is configured and returned with various capabilities, such as transferring ownership and retrieving the owner's address.\n *\n * @example\n * ```ts\n * import { createLightAccount } from \"@account-kit/smart-contracts\";\n * import { LocalAccountSigner } from \"@aa-sdk/core\";\n * import { sepolia } from \"viem/chains\";\n * import { http, generatePrivateKey } from \"viem\"\n *\n * const account = await createLightAccount({\n * chain: sepolia,\n * transport: http(\"RPC_URL\"),\n * signer: LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey())\n * });\n * ```\n *\n * @param {CreateLightAccountParams} config The parameters for creating a light account\n * @returns {Promise<LightAccount>} A promise that resolves to a `LightAccount` object containing the created account information and methods\n */\nexport async function createLightAccount({\n transport,\n chain,\n signer,\n initCode,\n version = defaultLightAccountVersion(\"LightAccount\"),\n entryPoint = getEntryPoint(chain, {\n version: AccountVersionRegistry[\"LightAccount\"][version]\n .entryPointVersion as any,\n }),\n accountAddress,\n factoryAddress = getDefaultLightAccountFactoryAddress(chain, version),\n salt: salt_ = 0n,\n}: CreateLightAccountParams): Promise<LightAccount> {\n const client = createBundlerClient({\n transport,\n chain,\n });\n\n const accountAbi =\n version === \"v2.0.0\" ? LightAccountAbi_v2 : LightAccountAbi_v1;\n const factoryAbi =\n version === \"v2.0.0\"\n ? LightAccountFactoryAbi_v1\n : LightAccountFactoryAbi_v2;\n\n const getAccountInitCode = async () => {\n if (initCode) return initCode;\n\n const salt = LightAccountUnsupported1271Factories.has(\n factoryAddress.toLowerCase() as Address\n )\n ? 0n\n : salt_;\n\n return concatHex([\n factoryAddress,\n encodeFunctionData({\n abi: factoryAbi,\n functionName: \"createAccount\",\n args: [await signer.getAddress(), salt],\n }),\n ]);\n };\n\n const address = await getAccountAddress({\n client,\n entryPoint,\n accountAddress,\n getAccountInitCode,\n });\n\n const account = await createLightAccountBase<\n Transport,\n SmartAccountSigner,\n \"LightAccount\"\n >({\n transport,\n chain,\n signer,\n abi: accountAbi,\n version: AccountVersionRegistry[\"LightAccount\"][version],\n entryPoint,\n accountAddress: address,\n getAccountInitCode,\n });\n\n return {\n ...account,\n\n encodeTransferOwnership: (newOwner: Address) => {\n return encodeFunctionData({\n abi: accountAbi,\n functionName: \"transferOwnership\",\n args: [newOwner],\n });\n },\n async getOwnerAddress(): Promise<Address> {\n const callResult = await client.readContract({\n address,\n abi: accountAbi,\n functionName: \"owner\",\n });\n\n if (callResult == null) {\n throw new Error(\"could not get on-chain owner\");\n }\n\n return callResult;\n },\n };\n}\n"]}
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/account.ts"],"names":[],"mappings":";;;AAAA,uCAOsB;AACtB,+BAMc;AACd,yEAAmE;AACnE,yEAA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QACtC,MAAM;QACN,UAAU;QACV,cAAc;QACd,kBAAkB;KACnB,CAAC,CAAC;IAEH,MAAM,OAAO,GAAG,MAAM,IAAA,gCAAsB,EAK1C;QACA,SAAS;QACT,KAAK;QACL,MAAM;QACN,GAAG,EAAE,UAAU;QACf,IAAI,EAAE,cAAc;QACpB,OAAO;QACP,UAAU;QACV,cAAc,EAAE,OAAO;QACvB,kBAAkB;KACnB,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,OAAO;QAEV,uBAAuB,EAAE,CAAC,QAAiB,EAAE,EAAE;YAC7C,OAAO,IAAA,yBAAkB,EAAC;gBACxB,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,mBAAmB;gBACjC,IAAI,EAAE,CAAC,QAAQ,CAAC;aACjB,CAAC,CAAC;QACL,CAAC;QACD,KAAK,CAAC,eAAe;YACnB,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC;gBAC3C,OAAO;gBACP,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,OAAO;aACtB,CAAC,CAAC;YAEH,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;YAClD,CAAC;YAED,OAAO,UAAU,CAAC;QACpB,CAAC;KACF,CAAC;AACJ,CAAC;AA7FD,gDA6FC","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>>;
@@ -10,7 +10,7 @@ var SignatureType;
10
10
  SignatureType["CONTRACT"] = "0x01";
11
11
  SignatureType["CONTRACT_WITH_ADDR"] = "0x02";
12
12
  })(SignatureType || (SignatureType = {}));
13
- async function createLightAccountBase({ transport, chain, signer, abi, version: { version, type }, entryPoint, accountAddress, getAccountInitCode, }) {
13
+ async function createLightAccountBase({ transport, chain, signer, abi, version, type, entryPoint, accountAddress, getAccountInitCode, }) {
14
14
  const client = (0, core_1.createBundlerClient)({
15
15
  transport,
16
16
  chain,
@@ -23,10 +23,10 @@ async function createLightAccountBase({ transport, chain, signer, abi, version:
23
23
  if (storage == null) {
24
24
  throw new core_1.FailedToGetStorageSlotError("0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc", "Proxy Implementation Address");
25
25
  }
26
- const implementationAddresses = Object.values(utils_js_1.AccountVersionRegistry[type]).map((x) => x.address[chain.id].impl);
26
+ const implementationAddresses = Object.values(utils_js_1.AccountVersionRegistry[type]).map((x) => x.addresses.overrides?.[chain.id]?.impl ?? x.addresses.default.impl);
27
27
  if ((0, viem_1.fromHex)(storage, "number") !== 0 &&
28
28
  !implementationAddresses.some((x) => x === (0, viem_1.trim)(storage))) {
29
- throw new Error(`could not determine if smart account implementation is ${type} ${version}`);
29
+ throw new Error(`could not determine if smart account implementation is ${type} ${String(version)}`);
30
30
  }
31
31
  return (0, viem_1.encodeFunctionData)({
32
32
  abi,
@@ -92,14 +92,14 @@ async function createLightAccountBase({ transport, chain, signer, abi, version:
92
92
  case "v1.0.1":
93
93
  return signer.signMessage(message);
94
94
  case "v1.0.2":
95
- throw new Error(`${type} ${version} doesn't support 1271`);
95
+ throw new Error(`${type} ${String(version)} doesn't support 1271`);
96
96
  case "v1.1.0":
97
97
  return signWith1271WrapperV1((0, viem_1.hashMessage)(message));
98
98
  case "v2.0.0":
99
99
  const signature = await signWith1271WrapperV1((0, viem_1.hashMessage)(message));
100
100
  return (0, viem_1.concat)([SignatureType.EOA, signature]);
101
101
  default:
102
- throw new Error(`Unknown version ${type} of ${version}`);
102
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
103
103
  }
104
104
  },
105
105
  async signTypedData(params) {
@@ -107,14 +107,14 @@ async function createLightAccountBase({ transport, chain, signer, abi, version:
107
107
  case "v1.0.1":
108
108
  return signer.signTypedData(params);
109
109
  case "v1.0.2":
110
- throw new Error(`Version ${version} of LightAccount doesn't support 1271`);
110
+ throw new Error(`Version ${String(version)} of LightAccount doesn't support 1271`);
111
111
  case "v1.1.0":
112
112
  return signWith1271WrapperV1((0, viem_1.hashTypedData)(params));
113
113
  case "v2.0.0":
114
114
  const signature = await signWith1271WrapperV1((0, viem_1.hashTypedData)(params));
115
115
  return (0, viem_1.concat)([SignatureType.EOA, signature]);
116
116
  default:
117
- throw new Error(`Unknown version ${version} of LightAccount`);
117
+ throw new Error(`Unknown version ${String(version)} of LightAccount`);
118
118
  }
119
119
  },
120
120
  getDummySignature: () => {
@@ -127,7 +127,7 @@ async function createLightAccountBase({ transport, chain, signer, abi, version:
127
127
  case "v2.0.0":
128
128
  return (0, viem_1.concat)([SignatureType.EOA, signature]);
129
129
  default:
130
- throw new Error(`Unknown version ${type} of ${version}`);
130
+ throw new Error(`Unknown version ${type} of ${String(version)}`);
131
131
  }
132
132
  },
133
133
  encodeUpgradeToAndCall,
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/light-account/accounts/base.ts"],"names":[],"mappings":";;;AAAA,uCAUsB;AACtB,+BAYc;AAQd,0CAAqD;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAgFM,KAAK,UAAU,sBAAsB,CAAC,EAC3C,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,OAAO,EAAE,EAAE,OAAO,EAAE,I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ContractAccount,\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,uCAUsB;AACtB,+BAYc;AAMd,0CAAqD;AAErD,IAAK,aAIJ;AAJD,WAAK,aAAa;IAChB,6BAAY,CAAA;IACZ,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;AAC7B,CAAC,EAJI,aAAa,KAAb,aAAa,QAIjB;AAoCM,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,IAAA,0BAAmB,EAAC;QACjC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LD,wDA8LC","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>>;
@@ -7,7 +7,7 @@ const MultiOwnerLightAccountAbi_js_1 = require("../abis/MultiOwnerLightAccountAb
7
7
  const MultiOwnerLightAccountFactoryAbi_js_1 = require("../abis/MultiOwnerLightAccountFactoryAbi.js");
8
8
  const utils_js_1 = require("../utils.js");
9
9
  const base_js_1 = require("./base.js");
10
- async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)("MultiOwnerLightAccount"), entryPoint = (0, core_1.getEntryPoint)(chain, {
10
+ async function createMultiOwnerLightAccount({ transport, chain, signer, initCode, version = (0, utils_js_1.defaultLightAccountVersion)(), entryPoint = (0, core_1.getEntryPoint)(chain, {
11
11
  version: "0.7.0",
12
12
  }), accountAddress, factoryAddress = (0, utils_js_1.getDefaultMultiOwnerLightAccountFactoryAddress)(chain, version), salt: salt_ = 0n, owners = [], }) {
13
13
  const client = (0, core_1.createBundlerClient)({
@@ -45,7 +45,8 @@ async function createMultiOwnerLightAccount({ transport, chain, signer, initCode
45
45
  chain,
46
46
  signer,
47
47
  abi: MultiOwnerLightAccountAbi_js_1.MultiOwnerLightAccountAbi,
48
- version: utils_js_1.AccountVersionRegistry["MultiOwnerLightAccount"][version],
48
+ version,
49
+ type: "MultiOwnerLightAccount",
49
50
  entryPoint,
50
51
  accountAddress: address,
51
52
  getAccountInitCode,