@maci-protocol/coordinator 0.0.0-ci.533e19d

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 (257) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +22 -0
  3. package/README.md +42 -0
  4. package/build/hardhat.config.cjs +31 -0
  5. package/build/hardhat.config.cjs.map +1 -0
  6. package/build/hardhat.config.d.cts +24 -0
  7. package/build/hardhat.config.d.cts.map +1 -0
  8. package/build/scripts/generateKeypair.d.ts +2 -0
  9. package/build/scripts/generateKeypair.d.ts.map +1 -0
  10. package/build/scripts/generateKeypair.js +25 -0
  11. package/build/scripts/generateKeypair.js.map +1 -0
  12. package/build/scripts/generateMaciKeyPair.d.ts +2 -0
  13. package/build/scripts/generateMaciKeyPair.d.ts.map +1 -0
  14. package/build/scripts/generateMaciKeyPair.js +3 -0
  15. package/build/scripts/generateMaciKeyPair.js.map +1 -0
  16. package/build/scripts/getAuthHeader.d.ts +2 -0
  17. package/build/scripts/getAuthHeader.d.ts.map +1 -0
  18. package/build/scripts/getAuthHeader.js +31 -0
  19. package/build/scripts/getAuthHeader.js.map +1 -0
  20. package/build/tests/constants.d.ts +8 -0
  21. package/build/tests/constants.d.ts.map +1 -0
  22. package/build/tests/constants.js +10 -0
  23. package/build/tests/constants.js.map +1 -0
  24. package/build/tests/e2e.aa.test.d.ts +2 -0
  25. package/build/tests/e2e.aa.test.d.ts.map +1 -0
  26. package/build/tests/e2e.aa.test.js +103 -0
  27. package/build/tests/e2e.aa.test.js.map +1 -0
  28. package/build/tests/e2e.deploy.test.d.ts +2 -0
  29. package/build/tests/e2e.deploy.test.d.ts.map +1 -0
  30. package/build/tests/e2e.deploy.test.js +234 -0
  31. package/build/tests/e2e.deploy.test.js.map +1 -0
  32. package/build/tests/utils.d.ts +14 -0
  33. package/build/tests/utils.d.ts.map +1 -0
  34. package/build/tests/utils.js +44 -0
  35. package/build/tests/utils.js.map +1 -0
  36. package/build/ts/app.module.d.ts +3 -0
  37. package/build/ts/app.module.d.ts.map +1 -0
  38. package/build/ts/app.module.js +36 -0
  39. package/build/ts/app.module.js.map +1 -0
  40. package/build/ts/auth/AccountSignatureGuard.service.d.ts +44 -0
  41. package/build/ts/auth/AccountSignatureGuard.service.d.ts.map +1 -0
  42. package/build/ts/auth/AccountSignatureGuard.service.js +96 -0
  43. package/build/ts/auth/AccountSignatureGuard.service.js.map +1 -0
  44. package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts +2 -0
  45. package/build/ts/auth/__tests__/AccountSignatureGuard.test.d.ts.map +1 -0
  46. package/build/ts/auth/__tests__/AccountSignatureGuard.test.js +113 -0
  47. package/build/ts/auth/__tests__/AccountSignatureGuard.test.js.map +1 -0
  48. package/build/ts/common/__tests__/common.test.d.ts +2 -0
  49. package/build/ts/common/__tests__/common.test.d.ts.map +1 -0
  50. package/build/ts/common/__tests__/common.test.js +79 -0
  51. package/build/ts/common/__tests__/common.test.js.map +1 -0
  52. package/build/ts/common/accountAbstraction.d.ts +55 -0
  53. package/build/ts/common/accountAbstraction.d.ts.map +1 -0
  54. package/build/ts/common/accountAbstraction.js +110 -0
  55. package/build/ts/common/accountAbstraction.js.map +1 -0
  56. package/build/ts/common/errors.d.ts +33 -0
  57. package/build/ts/common/errors.d.ts.map +1 -0
  58. package/build/ts/common/errors.js +34 -0
  59. package/build/ts/common/errors.js.map +1 -0
  60. package/build/ts/common/index.d.ts +4 -0
  61. package/build/ts/common/index.d.ts.map +1 -0
  62. package/build/ts/common/index.js +4 -0
  63. package/build/ts/common/index.js.map +1 -0
  64. package/build/ts/common/networks.d.ts +29 -0
  65. package/build/ts/common/networks.d.ts.map +1 -0
  66. package/build/ts/common/networks.js +70 -0
  67. package/build/ts/common/networks.js.map +1 -0
  68. package/build/ts/common/types.d.ts +9 -0
  69. package/build/ts/common/types.d.ts.map +1 -0
  70. package/build/ts/common/types.js +2 -0
  71. package/build/ts/common/types.js.map +1 -0
  72. package/build/ts/crypto/__tests__/crypto.service.test.d.ts +2 -0
  73. package/build/ts/crypto/__tests__/crypto.service.test.d.ts.map +1 -0
  74. package/build/ts/crypto/__tests__/crypto.service.test.js +26 -0
  75. package/build/ts/crypto/__tests__/crypto.service.test.js.map +1 -0
  76. package/build/ts/crypto/crypto.module.d.ts +3 -0
  77. package/build/ts/crypto/crypto.module.d.ts.map +1 -0
  78. package/build/ts/crypto/crypto.module.js +18 -0
  79. package/build/ts/crypto/crypto.module.js.map +1 -0
  80. package/build/ts/crypto/crypto.service.d.ts +31 -0
  81. package/build/ts/crypto/crypto.service.d.ts.map +1 -0
  82. package/build/ts/crypto/crypto.service.js +68 -0
  83. package/build/ts/crypto/crypto.service.js.map +1 -0
  84. package/build/ts/deployer/__tests__/deployer.controller.test.d.ts +2 -0
  85. package/build/ts/deployer/__tests__/deployer.controller.test.d.ts.map +1 -0
  86. package/build/ts/deployer/__tests__/deployer.controller.test.js +84 -0
  87. package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -0
  88. package/build/ts/deployer/__tests__/deployer.service.test.d.ts +2 -0
  89. package/build/ts/deployer/__tests__/deployer.service.test.d.ts.map +1 -0
  90. package/build/ts/deployer/__tests__/deployer.service.test.js +425 -0
  91. package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -0
  92. package/build/ts/deployer/__tests__/utils.d.ts +36 -0
  93. package/build/ts/deployer/__tests__/utils.d.ts.map +1 -0
  94. package/build/ts/deployer/__tests__/utils.js +96 -0
  95. package/build/ts/deployer/__tests__/utils.js.map +1 -0
  96. package/build/ts/deployer/constants.d.ts +13 -0
  97. package/build/ts/deployer/constants.d.ts.map +1 -0
  98. package/build/ts/deployer/constants.js +13 -0
  99. package/build/ts/deployer/constants.js.map +1 -0
  100. package/build/ts/deployer/deployer.controller.d.ts +34 -0
  101. package/build/ts/deployer/deployer.controller.d.ts.map +1 -0
  102. package/build/ts/deployer/deployer.controller.js +89 -0
  103. package/build/ts/deployer/deployer.controller.js.map +1 -0
  104. package/build/ts/deployer/deployer.module.d.ts +3 -0
  105. package/build/ts/deployer/deployer.module.d.ts.map +1 -0
  106. package/build/ts/deployer/deployer.module.js +23 -0
  107. package/build/ts/deployer/deployer.module.js.map +1 -0
  108. package/build/ts/deployer/deployer.service.d.ts +112 -0
  109. package/build/ts/deployer/deployer.service.d.ts.map +1 -0
  110. package/build/ts/deployer/deployer.service.js +614 -0
  111. package/build/ts/deployer/deployer.service.js.map +1 -0
  112. package/build/ts/deployer/dto.d.ts +46 -0
  113. package/build/ts/deployer/dto.d.ts.map +1 -0
  114. package/build/ts/deployer/dto.js +117 -0
  115. package/build/ts/deployer/dto.js.map +1 -0
  116. package/build/ts/deployer/types.d.ts +293 -0
  117. package/build/ts/deployer/types.d.ts.map +1 -0
  118. package/build/ts/deployer/types.js +2 -0
  119. package/build/ts/deployer/types.js.map +1 -0
  120. package/build/ts/deployer/utils.d.ts +8 -0
  121. package/build/ts/deployer/utils.d.ts.map +1 -0
  122. package/build/ts/deployer/utils.js +9 -0
  123. package/build/ts/deployer/utils.js.map +1 -0
  124. package/build/ts/file/__tests__/file.service.test.d.ts +2 -0
  125. package/build/ts/file/__tests__/file.service.test.d.ts.map +1 -0
  126. package/build/ts/file/__tests__/file.service.test.js +76 -0
  127. package/build/ts/file/__tests__/file.service.test.js.map +1 -0
  128. package/build/ts/file/file.module.d.ts +3 -0
  129. package/build/ts/file/file.module.d.ts.map +1 -0
  130. package/build/ts/file/file.module.js +18 -0
  131. package/build/ts/file/file.module.js.map +1 -0
  132. package/build/ts/file/file.service.d.ts +62 -0
  133. package/build/ts/file/file.service.d.ts.map +1 -0
  134. package/build/ts/file/file.service.js +115 -0
  135. package/build/ts/file/file.service.js.map +1 -0
  136. package/build/ts/file/types.d.ts +36 -0
  137. package/build/ts/file/types.d.ts.map +1 -0
  138. package/build/ts/file/types.js +2 -0
  139. package/build/ts/file/types.js.map +1 -0
  140. package/build/ts/jest/setup.d.ts +8 -0
  141. package/build/ts/jest/setup.d.ts.map +1 -0
  142. package/build/ts/jest/setup.js +2 -0
  143. package/build/ts/jest/setup.js.map +1 -0
  144. package/build/ts/jest/transform.d.ts +8 -0
  145. package/build/ts/jest/transform.d.ts.map +1 -0
  146. package/build/ts/jest/transform.js +10 -0
  147. package/build/ts/jest/transform.js.map +1 -0
  148. package/build/ts/main.d.ts +2 -0
  149. package/build/ts/main.d.ts.map +1 -0
  150. package/build/ts/main.js +46 -0
  151. package/build/ts/main.js.map +1 -0
  152. package/build/ts/proof/__tests__/proof.controller.test.d.ts +2 -0
  153. package/build/ts/proof/__tests__/proof.controller.test.d.ts.map +1 -0
  154. package/build/ts/proof/__tests__/proof.controller.test.js +89 -0
  155. package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -0
  156. package/build/ts/proof/__tests__/proof.gateway.test.d.ts +2 -0
  157. package/build/ts/proof/__tests__/proof.gateway.test.d.ts.map +1 -0
  158. package/build/ts/proof/__tests__/proof.gateway.test.js +61 -0
  159. package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -0
  160. package/build/ts/proof/__tests__/proof.service.test.d.ts +2 -0
  161. package/build/ts/proof/__tests__/proof.service.test.d.ts.map +1 -0
  162. package/build/ts/proof/__tests__/proof.service.test.js +128 -0
  163. package/build/ts/proof/__tests__/proof.service.test.js.map +1 -0
  164. package/build/ts/proof/dto.d.ts +73 -0
  165. package/build/ts/proof/dto.d.ts.map +1 -0
  166. package/build/ts/proof/dto.js +255 -0
  167. package/build/ts/proof/dto.js.map +1 -0
  168. package/build/ts/proof/proof.controller.d.ts +46 -0
  169. package/build/ts/proof/proof.controller.d.ts.map +1 -0
  170. package/build/ts/proof/proof.controller.js +135 -0
  171. package/build/ts/proof/proof.controller.js.map +1 -0
  172. package/build/ts/proof/proof.gateway.d.ts +35 -0
  173. package/build/ts/proof/proof.gateway.d.ts.map +1 -0
  174. package/build/ts/proof/proof.gateway.js +93 -0
  175. package/build/ts/proof/proof.gateway.js.map +1 -0
  176. package/build/ts/proof/proof.module.d.ts +3 -0
  177. package/build/ts/proof/proof.module.d.ts.map +1 -0
  178. package/build/ts/proof/proof.module.js +24 -0
  179. package/build/ts/proof/proof.module.js.map +1 -0
  180. package/build/ts/proof/proof.service.d.ts +54 -0
  181. package/build/ts/proof/proof.service.d.ts.map +1 -0
  182. package/build/ts/proof/proof.service.js +246 -0
  183. package/build/ts/proof/proof.service.js.map +1 -0
  184. package/build/ts/proof/types.d.ts +140 -0
  185. package/build/ts/proof/types.d.ts.map +1 -0
  186. package/build/ts/proof/types.js +11 -0
  187. package/build/ts/proof/types.js.map +1 -0
  188. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts +2 -0
  189. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.d.ts.map +1 -0
  190. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +44 -0
  191. package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -0
  192. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts +2 -0
  193. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.d.ts.map +1 -0
  194. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +61 -0
  195. package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -0
  196. package/build/ts/sessionKeys/__tests__/utils.d.ts +25 -0
  197. package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -0
  198. package/build/ts/sessionKeys/__tests__/utils.js +64 -0
  199. package/build/ts/sessionKeys/__tests__/utils.js.map +1 -0
  200. package/build/ts/sessionKeys/dto.d.ts +11 -0
  201. package/build/ts/sessionKeys/dto.d.ts.map +1 -0
  202. package/build/ts/sessionKeys/dto.js +29 -0
  203. package/build/ts/sessionKeys/dto.js.map +1 -0
  204. package/build/ts/sessionKeys/sessionKeys.controller.d.ts +26 -0
  205. package/build/ts/sessionKeys/sessionKeys.controller.d.ts.map +1 -0
  206. package/build/ts/sessionKeys/sessionKeys.controller.js +74 -0
  207. package/build/ts/sessionKeys/sessionKeys.controller.js.map +1 -0
  208. package/build/ts/sessionKeys/sessionKeys.module.d.ts +3 -0
  209. package/build/ts/sessionKeys/sessionKeys.module.d.ts.map +1 -0
  210. package/build/ts/sessionKeys/sessionKeys.module.js +23 -0
  211. package/build/ts/sessionKeys/sessionKeys.module.js.map +1 -0
  212. package/build/ts/sessionKeys/sessionKeys.service.d.ts +50 -0
  213. package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -0
  214. package/build/ts/sessionKeys/sessionKeys.service.js +104 -0
  215. package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -0
  216. package/build/ts/sessionKeys/types.d.ts +11 -0
  217. package/build/ts/sessionKeys/types.d.ts.map +1 -0
  218. package/build/ts/sessionKeys/types.js +2 -0
  219. package/build/ts/sessionKeys/types.js.map +1 -0
  220. package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts +2 -0
  221. package/build/ts/subgraph/__tests__/subgraph.controller.test.d.ts.map +1 -0
  222. package/build/ts/subgraph/__tests__/subgraph.controller.test.js +50 -0
  223. package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -0
  224. package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts +2 -0
  225. package/build/ts/subgraph/__tests__/subgraph.gateway.test.d.ts.map +1 -0
  226. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +83 -0
  227. package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -0
  228. package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts +2 -0
  229. package/build/ts/subgraph/__tests__/subgraph.service.test.d.ts.map +1 -0
  230. package/build/ts/subgraph/__tests__/subgraph.service.test.js +58 -0
  231. package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -0
  232. package/build/ts/subgraph/dto.d.ts +27 -0
  233. package/build/ts/subgraph/dto.d.ts.map +1 -0
  234. package/build/ts/subgraph/dto.js +83 -0
  235. package/build/ts/subgraph/dto.js.map +1 -0
  236. package/build/ts/subgraph/subgraph.controller.d.ts +24 -0
  237. package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -0
  238. package/build/ts/subgraph/subgraph.controller.js +66 -0
  239. package/build/ts/subgraph/subgraph.controller.js.map +1 -0
  240. package/build/ts/subgraph/subgraph.gateway.d.ts +35 -0
  241. package/build/ts/subgraph/subgraph.gateway.d.ts.map +1 -0
  242. package/build/ts/subgraph/subgraph.gateway.js +93 -0
  243. package/build/ts/subgraph/subgraph.gateway.js.map +1 -0
  244. package/build/ts/subgraph/subgraph.module.d.ts +3 -0
  245. package/build/ts/subgraph/subgraph.module.d.ts.map +1 -0
  246. package/build/ts/subgraph/subgraph.module.js +23 -0
  247. package/build/ts/subgraph/subgraph.module.js.map +1 -0
  248. package/build/ts/subgraph/subgraph.service.d.ts +20 -0
  249. package/build/ts/subgraph/subgraph.service.d.ts.map +1 -0
  250. package/build/ts/subgraph/subgraph.service.js +106 -0
  251. package/build/ts/subgraph/subgraph.service.js.map +1 -0
  252. package/build/ts/subgraph/types.d.ts +93 -0
  253. package/build/ts/subgraph/types.d.ts.map +1 -0
  254. package/build/ts/subgraph/types.js +24 -0
  255. package/build/ts/subgraph/types.js.map +1 -0
  256. package/build/tsconfig.build.tsbuildinfo +1 -0
  257. package/package.json +124 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,51 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ## [3.0.0](https://github.com/privacy-scaling-explorations/maci/compare/v2.5.0...v3.0.0) (2025-03-28)
7
+
8
+
9
+ ### Features
10
+
11
+ * **contracts:** add checker and deployment for proxy gatekeepers ([87f6d3b](https://github.com/privacy-scaling-explorations/maci/commit/87f6d3b7f32bf8dddcbf99b855dbe4b7b6c2a58e))
12
+ * **contracts:** add eas gatekeeper checker ([6e90591](https://github.com/privacy-scaling-explorations/maci/commit/6e90591923f8104c06558a8c8a4a5f26d16e63c1))
13
+ * **contracts:** add hats gatekeeper checker ([8ba97ae](https://github.com/privacy-scaling-explorations/maci/commit/8ba97ae09de1cc738df04a7b868d97c74027de3c))
14
+ * **contracts:** integrate excubiae for gatekeepers ([fae260b](https://github.com/privacy-scaling-explorations/maci/commit/fae260bbdd4d6b7a8749f61c0310526448a6c030))
15
+ * **deployer:** add service in maci repo ([3cbf167](https://github.com/privacy-scaling-explorations/maci/commit/3cbf167c31714d98a56ed4806225323c86b69240))
16
+ * use excubiae policies instead of gatekeepers ([a2319b1](https://github.com/privacy-scaling-explorations/maci/commit/a2319b19e473e683a301bd79b3ab2b06e83f9452))
17
+
18
+
19
+ ### Code Refactoring
20
+
21
+ * test suite cleanup ([#2233](https://github.com/privacy-scaling-explorations/maci/issues/2233)) ([#2232](https://github.com/privacy-scaling-explorations/maci/issues/2232)) ([0d42bb0](https://github.com/privacy-scaling-explorations/maci/commit/0d42bb09da9025d0481c45def982d155fda79b76))
22
+
23
+
24
+ ### Miscellaneous
25
+
26
+ * **deps-dev:** bump @nestjs/cli from 11.0.4 to 11.0.5 ([159c4d3](https://github.com/privacy-scaling-explorations/maci/commit/159c4d3fa06228710317cc416a3dd8d10cce2f42))
27
+ * **deps-dev:** bump @nestjs/schematics from 11.0.1 to 11.0.2 ([25d7e15](https://github.com/privacy-scaling-explorations/maci/commit/25d7e15b635b2df67c4db6985fffc483e20f80ef))
28
+ * **deps-dev:** bump @nestjs/testing from 10.4.15 to 11.0.11 ([63bb589](https://github.com/privacy-scaling-explorations/maci/commit/63bb5898a9f66c07c32874b532fa9cbdb4ca29de))
29
+ * **deps-dev:** bump @types/express from 4.17.21 to 5.0.0 ([8b2d43a](https://github.com/privacy-scaling-explorations/maci/commit/8b2d43a30e6aa118367aee2f6d32113a38639f50))
30
+ * **deps-dev:** bump @types/node from 20.17.19 to 22.13.9 ([aa7c356](https://github.com/privacy-scaling-explorations/maci/commit/aa7c356469592547f3d60c05077268267d7ea186))
31
+ * **deps-dev:** bump @types/node from 22.13.9 to 22.13.10 ([#2241](https://github.com/privacy-scaling-explorations/maci/issues/2241)) ([3f50bb6](https://github.com/privacy-scaling-explorations/maci/commit/3f50bb65db4cd83b5ebe9d4fb1b7a6d650bb1c51))
32
+ * **deps-dev:** bump fast-check from 3.23.2 to 4.0.0 ([266738d](https://github.com/privacy-scaling-explorations/maci/commit/266738ddf289c22f7e16ceba5a2fb09b836d7323))
33
+ * **deps-dev:** bump ts-jest from 29.2.5 to 29.2.6 ([aaf7978](https://github.com/privacy-scaling-explorations/maci/commit/aaf797861177b92cb1395048e32898367cd65bd5))
34
+ * **deps-dev:** bump typescript from 5.7.3 to 5.8.2 ([e37f1bf](https://github.com/privacy-scaling-explorations/maci/commit/e37f1bffd8193de316e748d0406cfb606455cb46))
35
+ * **deps:** bump @graphprotocol/graph-cli from 0.79.2 to 0.96.0 ([b782da5](https://github.com/privacy-scaling-explorations/maci/commit/b782da5f9171d65f3bd5b4579fdec0895cce0254))
36
+ * **deps:** bump @nestjs/common from 10.4.15 to 11.0.11 ([1a1256d](https://github.com/privacy-scaling-explorations/maci/commit/1a1256de14fb14ae527eb17ad428cdaa9b11cfee))
37
+ * **deps:** bump @nestjs/core from 10.4.15 to 11.0.11 ([061c778](https://github.com/privacy-scaling-explorations/maci/commit/061c77839f88712f816dfe467e848b52f1d0c566))
38
+ * **deps:** bump @nestjs/platform-express from 10.4.15 to 11.0.11 ([12fb1d4](https://github.com/privacy-scaling-explorations/maci/commit/12fb1d425ba5f141c2d8bbf4d14d11a9d6add000))
39
+ * **deps:** bump @nestjs/platform-socket.io from 10.4.15 to 11.0.11 ([23ff1f2](https://github.com/privacy-scaling-explorations/maci/commit/23ff1f23374090d83a221d964149b274dd021e2d))
40
+ * **deps:** bump @nestjs/swagger from 8.1.1 to 11.0.6 ([4e8aca9](https://github.com/privacy-scaling-explorations/maci/commit/4e8aca9fe1b19f299119d070d0de27090652d58e))
41
+ * **deps:** bump @vercel/blob from 0.27.1 to 0.27.2 ([67a6ab8](https://github.com/privacy-scaling-explorations/maci/commit/67a6ab822cac004cf43f04adf29dbd434f070ec1))
42
+ * **deps:** bump @zerodev/permissions from 5.5.2 to 5.5.3 ([bff258f](https://github.com/privacy-scaling-explorations/maci/commit/bff258faef093766511e7602bbf2e72d2cd12b15))
43
+ * **deps:** bump hardhat from 2.22.18 to 2.22.19 ([49af291](https://github.com/privacy-scaling-explorations/maci/commit/49af2919e353d322808c12ca0d5a77575c73e044))
44
+ * **deps:** bump helmet from 8.0.0 to 8.1.0 ([9e544e2](https://github.com/privacy-scaling-explorations/maci/commit/9e544e2eec454fd0423d517ef8358e7edd9ae3fd))
45
+ * **deps:** bump rxjs from 7.8.1 to 7.8.2 ([e683e9e](https://github.com/privacy-scaling-explorations/maci/commit/e683e9ef81afe88c215c1767f4f34f7364a558b0))
46
+ * **deps:** bump viem from 2.23.2 to 2.23.5 ([d19cb50](https://github.com/privacy-scaling-explorations/maci/commit/d19cb50dadf9de791852c67ecbf15ae8d28f0634))
47
+ * **deps:** bump viem from 2.23.5 to 2.23.6 ([63d15a0](https://github.com/privacy-scaling-explorations/maci/commit/63d15a0ee2d97c99513cf0b782434f85e29028c9))
48
+ * **deps:** bump viem from 2.23.6 to 2.23.9 ([#2239](https://github.com/privacy-scaling-explorations/maci/issues/2239)) ([64eb1e0](https://github.com/privacy-scaling-explorations/maci/commit/64eb1e07112e52fd7caf486a70ccebe6222614c7))
49
+ * **deps:** bump viem from 2.23.9 to 2.23.12 ([d055307](https://github.com/privacy-scaling-explorations/maci/commit/d0553074c92a7d8703ccb14ce7a54e509f412578))
50
+ * sync nestjs dependencies versions ([9c66b33](https://github.com/privacy-scaling-explorations/maci/commit/9c66b330664598cf9c0377d2078a946e34ad0004))
51
+ * update the readme ([#2242](https://github.com/privacy-scaling-explorations/maci/issues/2242)) ([ffdceee](https://github.com/privacy-scaling-explorations/maci/commit/ffdceee3074446f81deae5ef4e3df67f98aaada7))
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Barry WhiteHat, Kendrick Tan, Kobi Gurkan, Kirill Goncharov
4
+ Cory Dickson, Han Jian, Chih-Cheng Liang, and Koh Wei Jie
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # Coordinator service
2
+
3
+ Please refer to [Offchain relayer service documentation](https://maci.pse.dev/docs/category/offchain-relayer) for more information.
4
+
5
+ ## Instructions
6
+
7
+ 1. Add `.env` file (see `.env.example`).
8
+ 2. Generate RSA key pair with `pnpm run generate-keypair`.
9
+ 3. Download zkey files using `pnpm run download-zkeys:{type}` (only test type is available for now).
10
+ 4. Make sure you copied RSA public key to your application. This will be needed for encrypting `Authorization` header and coordinator private key for proof generation. Also it can be accessed through API method `GET v1/proof/publicKey`.
11
+ 5. Run `pnpm run start` to run the service.
12
+ 6. All API calls must be called with `Authorization` header, where the value is encrypted with RSA public key you generated before. Header value contains message signature and message digest created by `COORDINATOR_ADDRESSES`. The format is `publicEncrypt({signature}:{digest})`.
13
+ Make sure you set `COORDINATOR_ADDRESSES` env variable and sign any message with the addresses from your application (see [AccountSignatureGuard](./ts/auth/AccountSignatureGuard.service.ts)).
14
+ 7. Proofs can be generated with `POST v1/proof/generate` API method or with Websockets (see [dto spec](./ts/proof/dto.ts), [controller](./ts/app.controller.ts) and [wsgateway](./ts/events/events.gateway.ts)).
15
+
16
+ ## Subgraph deployment
17
+
18
+ It is possible to deploy subgraph using coordinator service.
19
+
20
+ First, you need to setup subgraph and create a project. [Subgraph dashboard](https://thegraph.com/studio/).
21
+
22
+ Then, set env variables:
23
+
24
+ ```
25
+ # Subgraph name
26
+ SUBGRAPH_NAME="maci-subgraph"
27
+
28
+ # Subgraph provider url
29
+ SUBGRAPH_PROVIDER_URL=https://api.studio.thegraph.com/deploy/
30
+
31
+ # Subgraph deploy key
32
+ SUBGRAPH_DEPLOY_KEY=*******
33
+
34
+ # Subgraph project folder
35
+ SUBGRAPH_FOLDER=../subgraph
36
+ ```
37
+
38
+ After deployment, subgraph url will be available in studio dashboard and you can use this type of url to get latest deployed version in your application:
39
+
40
+ ```
41
+ https://api.studio.thegraph.com/.../{SUBGRAPH_NAME}/version/latest
42
+ ```
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-var-requires */
3
+ require("@nomicfoundation/hardhat-toolbox");
4
+ const dotenv = require("dotenv");
5
+ const path = require("path");
6
+ dotenv.config();
7
+ const parentDir = __dirname.includes("build") ? ".." : "";
8
+ const TEST_MNEMONIC = "test test test test test test test test test test test junk";
9
+ module.exports = {
10
+ defaultNetwork: "sepolia",
11
+ networks: {
12
+ sepolia: {
13
+ url: process.env.COORDINATOR_RPC_URL || "http://localhost:8545",
14
+ accounts: {
15
+ mnemonic: TEST_MNEMONIC,
16
+ path: "m/44'/60'/0'/0",
17
+ initialIndex: 0,
18
+ count: 20,
19
+ },
20
+ loggingEnabled: false,
21
+ },
22
+ hardhat: {
23
+ loggingEnabled: false,
24
+ },
25
+ },
26
+ paths: {
27
+ sources: path.resolve(__dirname, parentDir, "./node_modules/@maci-protocol/sdk/node_modules/@maci-protocol/contracts/contracts"),
28
+ artifacts: path.resolve(__dirname, parentDir, "./node_modules/@maci-protocol/sdk/node_modules/@maci-protocol/contracts/artifacts"),
29
+ },
30
+ };
31
+ //# sourceMappingURL=hardhat.config.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hardhat.config.cjs","sourceRoot":"","sources":["../hardhat.config.cjs"],"names":[],"mappings":";AAAA,uDAAuD;AACvD,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEjC,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAE7B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,SAAS,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1D,MAAM,aAAa,GAAG,6DAA6D,CAAC;AAEpF,MAAM,CAAC,OAAO,GAAG;IACf,cAAc,EAAE,SAAS;IACzB,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,uBAAuB;YAC/D,QAAQ,EAAE;gBACR,QAAQ,EAAE,aAAa;gBACvB,IAAI,EAAE,gBAAgB;gBACtB,YAAY,EAAE,CAAC;gBACf,KAAK,EAAE,EAAE;aACV;YACD,cAAc,EAAE,KAAK;SACtB;QACD,OAAO,EAAE;YACP,cAAc,EAAE,KAAK;SACtB;KACF;IACD,KAAK,EAAE;QACL,OAAO,EAAE,IAAI,CAAC,OAAO,CACnB,SAAS,EACT,SAAS,EACT,mFAAmF,CACpF;QACD,SAAS,EAAE,IAAI,CAAC,OAAO,CACrB,SAAS,EACT,SAAS,EACT,mFAAmF,CACpF;KACF;CACF,CAAC"}
@@ -0,0 +1,24 @@
1
+ declare const TEST_MNEMONIC: "test test test test test test test test test test test junk";
2
+ export let defaultNetwork: string;
3
+ export namespace networks {
4
+ namespace sepolia {
5
+ let url: string;
6
+ namespace accounts {
7
+ export { TEST_MNEMONIC as mnemonic };
8
+ export let path: string;
9
+ export let initialIndex: number;
10
+ export let count: number;
11
+ }
12
+ let loggingEnabled: boolean;
13
+ }
14
+ namespace hardhat {
15
+ let loggingEnabled_1: boolean;
16
+ export { loggingEnabled_1 as loggingEnabled };
17
+ }
18
+ }
19
+ export namespace paths {
20
+ let sources: string;
21
+ let artifacts: string;
22
+ }
23
+ export {};
24
+ //# sourceMappingURL=hardhat.config.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hardhat.config.d.cts","sourceRoot":"","sources":["../hardhat.config.cjs"],"names":[],"mappings":"AASA,6BAAsB,6DAA6D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function generateRsaKeypair(): Promise<void>;
2
+ //# sourceMappingURL=generateKeypair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateKeypair.d.ts","sourceRoot":"","sources":["../../scripts/generateKeypair.ts"],"names":[],"mappings":"AAiBA,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYxD"}
@@ -0,0 +1,25 @@
1
+ import dotenv from "dotenv";
2
+ import { generateKeyPairSync } from "crypto";
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import url from "url";
6
+ /* eslint-disable no-underscore-dangle */
7
+ /* eslint-disable @typescript-eslint/no-shadow */
8
+ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
9
+ /* eslint-enable no-underscore-dangle */
10
+ /* eslint-enable @typescript-eslint/no-shadow */
11
+ dotenv.config({ path: [path.resolve(__dirname, "../.env"), path.resolve(__dirname, "../.env.example")] });
12
+ const MODULUS_LENGTH = 4096;
13
+ export async function generateRsaKeypair() {
14
+ const keypair = generateKeyPairSync("rsa", {
15
+ modulusLength: MODULUS_LENGTH,
16
+ });
17
+ const publicKey = keypair.publicKey.export({ type: "pkcs1", format: "pem" });
18
+ const privateKey = keypair.privateKey.export({ type: "pkcs1", format: "pem" });
19
+ await Promise.all([
20
+ fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PUBLIC_KEY_PATH), publicKey),
21
+ fs.promises.writeFile(path.resolve(process.env.COORDINATOR_PRIVATE_KEY_PATH), privateKey),
22
+ ]);
23
+ }
24
+ generateRsaKeypair();
25
+ //# sourceMappingURL=generateKeypair.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateKeypair.js","sourceRoot":"","sources":["../../scripts/generateKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,yCAAyC;AACzC,iDAAiD;AACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,wCAAwC;AACxC,gDAAgD;AAEhD,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;AAE1G,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,EAAE;QACzC,aAAa,EAAE,cAAc;KAC9B,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;IAE/E,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,2BAA4B,CAAC,EAAE,SAAS,CAAC;QACxF,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,4BAA6B,CAAC,EAAE,UAAU,CAAC;KAC3F,CAAC,CAAC;AACL,CAAC;AAED,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generateMaciKeyPair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateMaciKeyPair.d.ts","sourceRoot":"","sources":["../../scripts/generateMaciKeyPair.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { genKeypair } from "@maci-protocol/crypto";
2
+ genKeypair();
3
+ //# sourceMappingURL=generateMaciKeyPair.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateMaciKeyPair.js","sourceRoot":"","sources":["../../scripts/generateMaciKeyPair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,UAAU,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getAuthHeader(): Promise<void>;
2
+ //# sourceMappingURL=getAuthHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAuthHeader.d.ts","sourceRoot":"","sources":["../../scripts/getAuthHeader.ts"],"names":[],"mappings":"AAiBA,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAkBnD"}
@@ -0,0 +1,31 @@
1
+ import dotenv from "dotenv";
2
+ import { Wallet } from "ethers";
3
+ import path from "path";
4
+ import * as readline from "readline";
5
+ import url from "url";
6
+ import { getAuthorizationHeader } from "../tests/utils";
7
+ /* eslint-disable no-underscore-dangle */
8
+ /* eslint-disable @typescript-eslint/no-shadow */
9
+ const __dirname = path.dirname(url.fileURLToPath(import.meta.url));
10
+ /* eslint-enable no-underscore-dangle */
11
+ /* eslint-enable @typescript-eslint/no-shadow */
12
+ dotenv.config({ path: [path.resolve(__dirname, "../.env"), path.resolve(__dirname, "../.env.example")] });
13
+ export async function getAuthHeader() {
14
+ const rl = readline.createInterface({
15
+ input: process.stdin,
16
+ output: process.stdout,
17
+ });
18
+ const askPrivateKey = () => new Promise((resolve) => {
19
+ rl.question("Enter your private key to sign (only test keys): ", (answer) => {
20
+ resolve(answer);
21
+ });
22
+ });
23
+ const privateKey = await askPrivateKey();
24
+ const wallet = new Wallet(privateKey);
25
+ rl.close();
26
+ const token = await getAuthorizationHeader(wallet);
27
+ // eslint-disable-next-line no-console
28
+ console.log(token);
29
+ }
30
+ getAuthHeader();
31
+ //# sourceMappingURL=getAuthHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAuthHeader.js","sourceRoot":"","sources":["../../scripts/getAuthHeader.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,GAAG,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD,yCAAyC;AACzC,iDAAiD;AACjD,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,wCAAwC;AACxC,gDAAgD;AAEhD,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;AAE1G,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;QAClC,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,MAAM,aAAa,GAAG,GAAG,EAAE,CACzB,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QAC9B,EAAE,CAAC,QAAQ,CAAC,mDAAmD,EAAE,CAAC,MAAM,EAAE,EAAE;YAC1E,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACL,MAAM,UAAU,GAAG,MAAM,aAAa,EAAE,CAAC;IACzC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,UAAU,CAAC,CAAC;IACtC,EAAE,CAAC,KAAK,EAAE,CAAC;IAEX,MAAM,KAAK,GAAG,MAAM,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACnD,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACrB,CAAC;AAED,aAAa,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const pollJoiningTestZkeyPath = "./zkeys/PollJoining_10_test/PollJoining_10_test.0.zkey";
2
+ export declare const testPollJoiningWasmPath = "./zkeys/PollJoining_10_test/PollJoining_10_test_js/PollJoining_10_test.wasm";
3
+ export declare const testPollJoiningWitnessPath = "./zkeys/PollJoining_10_test/PollJoining_10_test_cpp/PollJoining_10_test";
4
+ export declare const testRapidsnarkPath: string;
5
+ export declare const zeroUint256Encoded: string;
6
+ export declare const oneUint256Encoded: string;
7
+ export declare const pollDuration = 10;
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,uBAAuB,2DAA2D,CAAC;AAChG,eAAO,MAAM,uBAAuB,gFAAgF,CAAC;AACrH,eAAO,MAAM,0BAA0B,4EAA4E,CAAC;AACpH,eAAO,MAAM,kBAAkB,QAAyC,CAAC;AAEzE,eAAO,MAAM,kBAAkB,QAAsD,CAAC;AACtF,eAAO,MAAM,iBAAiB,QAAsD,CAAC;AAErF,eAAO,MAAM,YAAY,KAAK,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { AbiCoder } from "ethers";
2
+ import { homedir } from "os";
3
+ export const pollJoiningTestZkeyPath = "./zkeys/PollJoining_10_test/PollJoining_10_test.0.zkey";
4
+ export const testPollJoiningWasmPath = "./zkeys/PollJoining_10_test/PollJoining_10_test_js/PollJoining_10_test.wasm";
5
+ export const testPollJoiningWitnessPath = "./zkeys/PollJoining_10_test/PollJoining_10_test_cpp/PollJoining_10_test";
6
+ export const testRapidsnarkPath = `${homedir()}/rapidsnark/build/prover`;
7
+ export const zeroUint256Encoded = AbiCoder.defaultAbiCoder().encode(["uint256"], [0]);
8
+ export const oneUint256Encoded = AbiCoder.defaultAbiCoder().encode(["uint256"], [1]);
9
+ export const pollDuration = 10; // 100 seconds (added to unix timestamp of start date)
10
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../tests/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAE7B,MAAM,CAAC,MAAM,uBAAuB,GAAG,wDAAwD,CAAC;AAChG,MAAM,CAAC,MAAM,uBAAuB,GAAG,6EAA6E,CAAC;AACrH,MAAM,CAAC,MAAM,0BAA0B,GAAG,yEAAyE,CAAC;AACpH,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,OAAO,EAAE,0BAA0B,CAAC;AAEzE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAErF,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAC,CAAC,sDAAsD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=e2e.aa.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.aa.test.d.ts","sourceRoot":"","sources":["../../tests/e2e.aa.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,103 @@
1
+ import { zeroAddress } from "viem";
2
+ import { ErrorCodes, ESupportedNetworks } from "../ts/common";
3
+ import { CryptoService } from "../ts/crypto/crypto.service";
4
+ import { testMaciDeploymentConfig, testPollDeploymentConfig } from "../ts/deployer/__tests__/utils";
5
+ import { DeployerService } from "../ts/deployer/deployer.service";
6
+ import { FileService } from "../ts/file/file.service";
7
+ import { ProofGeneratorService } from "../ts/proof/proof.service";
8
+ import { ENTRY_POINT, generateApproval, KERNEL_VERSION } from "../ts/sessionKeys/__tests__/utils";
9
+ import { SessionKeysService } from "../ts/sessionKeys/sessionKeys.service";
10
+ describe("E2E Account Abstraction Tests", () => {
11
+ const fileService = new FileService();
12
+ const sessionKeyService = new SessionKeysService(fileService);
13
+ const cryptoService = new CryptoService();
14
+ const proofService = new ProofGeneratorService(cryptoService, fileService, sessionKeyService);
15
+ const deployerService = new DeployerService(sessionKeyService, fileService);
16
+ // using an already deployed maci contract
17
+ const maciContract = "0xf281870519822f302B13c07252d0f6A71E8D023e";
18
+ const pollId = 2;
19
+ let approval;
20
+ let sessionKeyAddress;
21
+ beforeAll(async () => {
22
+ approval = await generateApproval(sessionKeyAddress);
23
+ sessionKeyAddress = (await sessionKeyService.generateSessionKey()).sessionKeyAddress;
24
+ });
25
+ describe("deploy", () => {
26
+ describe("deployMaci", () => {
27
+ it("should deploy all maci related contracts", async () => {
28
+ const { address: maciAddress } = await deployerService.deployMaci({
29
+ approval,
30
+ sessionKeyAddress,
31
+ chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
32
+ config: testMaciDeploymentConfig,
33
+ });
34
+ expect(maciAddress).not.toBe(zeroAddress);
35
+ });
36
+ });
37
+ describe("deployPoll", () => {
38
+ it("should deploy a poll", async () => {
39
+ // Serialize the config with the custom serializer
40
+ const serializedConfig = JSON.stringify(testPollDeploymentConfig);
41
+ const pollConfig = JSON.parse(serializedConfig);
42
+ const { pollId: poll } = await deployerService.deployPoll({
43
+ approval,
44
+ sessionKeyAddress,
45
+ chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
46
+ config: pollConfig,
47
+ });
48
+ expect(poll).toBeDefined();
49
+ });
50
+ });
51
+ });
52
+ describe("merge", () => {
53
+ test("should return true when there are no errors", async () => {
54
+ const { sessionKeyAddress: sessionKey } = await sessionKeyService.generateSessionKey();
55
+ const generatedApproval = await generateApproval(sessionKey);
56
+ const merged = await proofService.merge({
57
+ maciContractAddress: maciContract,
58
+ pollId,
59
+ sessionKeyAddress: sessionKey,
60
+ approval: generatedApproval,
61
+ chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
62
+ });
63
+ expect(merged).toBe(true);
64
+ });
65
+ test("should throw when given an invalid pollId", async () => {
66
+ const { sessionKeyAddress: sessionKey } = await sessionKeyService.generateSessionKey();
67
+ const generatedApproval = await generateApproval(sessionKey);
68
+ await expect(proofService.merge({
69
+ maciContractAddress: maciContract,
70
+ pollId: 50000,
71
+ sessionKeyAddress: sessionKey,
72
+ approval: generatedApproval,
73
+ chain: ESupportedNetworks.OPTIMISM_SEPOLIA,
74
+ })).rejects.toThrow(ErrorCodes.POLL_NOT_FOUND.toString());
75
+ });
76
+ });
77
+ describe("sessionKeys", () => {
78
+ it("should create a client from a session key and an approval", async () => {
79
+ const client = await sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA);
80
+ expect(client).toBeDefined();
81
+ expect(client.transport.key).toBe("http");
82
+ expect(client.key).toBe("Account");
83
+ expect(client.account.address).not.toBe(zeroAddress);
84
+ expect(client.account.kernelVersion).toBe(KERNEL_VERSION);
85
+ expect(client.account.entryPoint).toBe(ENTRY_POINT);
86
+ // this is an account with limited permissions so no sudo validator
87
+ expect(client.account.kernelPluginManager.address).toBe(zeroAddress);
88
+ expect(client.account.kernelPluginManager.sudoValidator).toBe(undefined);
89
+ // send a transaction
90
+ const tx = await client.sendTransaction({
91
+ to: zeroAddress,
92
+ value: 0n,
93
+ data: "0x",
94
+ });
95
+ expect(tx.length).toBeGreaterThan(0);
96
+ });
97
+ it("should not allow to create a client after the session key has been deactivated", async () => {
98
+ sessionKeyService.deactivateSessionKey(sessionKeyAddress);
99
+ await expect(sessionKeyService.generateClientFromSessionKey(sessionKeyAddress, approval, ESupportedNetworks.OPTIMISM_SEPOLIA)).rejects.toThrow(ErrorCodes.SESSION_KEY_NOT_FOUND.toString());
100
+ });
101
+ });
102
+ });
103
+ //# sourceMappingURL=e2e.aa.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"e2e.aa.test.js","sourceRoot":"","sources":["../../tests/e2e.aa.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,WAAW,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,wBA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