@maci-protocol/sdk 0.0.0-ci.2653bc0

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 (298) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/LICENSE +22 -0
  3. package/README.md +12 -0
  4. package/build/package.json +56 -0
  5. package/build/ts/browser/index.d.ts +15 -0
  6. package/build/ts/browser/index.d.ts.map +1 -0
  7. package/build/ts/browser/index.js +43 -0
  8. package/build/ts/browser/index.js.map +1 -0
  9. package/build/ts/deploy/index.d.ts +5 -0
  10. package/build/ts/deploy/index.d.ts.map +1 -0
  11. package/build/ts/deploy/index.js +10 -0
  12. package/build/ts/deploy/index.js.map +1 -0
  13. package/build/ts/deploy/maci.d.ts +8 -0
  14. package/build/ts/deploy/maci.d.ts.map +1 -0
  15. package/build/ts/deploy/maci.js +87 -0
  16. package/build/ts/deploy/maci.js.map +1 -0
  17. package/build/ts/deploy/poll.d.ts +8 -0
  18. package/build/ts/deploy/poll.d.ts.map +1 -0
  19. package/build/ts/deploy/poll.js +107 -0
  20. package/build/ts/deploy/poll.js.map +1 -0
  21. package/build/ts/deploy/types.d.ts +204 -0
  22. package/build/ts/deploy/types.d.ts.map +1 -0
  23. package/build/ts/deploy/types.js +3 -0
  24. package/build/ts/deploy/types.js.map +1 -0
  25. package/build/ts/deploy/utils.d.ts +11 -0
  26. package/build/ts/deploy/utils.d.ts.map +1 -0
  27. package/build/ts/deploy/utils.js +22 -0
  28. package/build/ts/deploy/utils.js.map +1 -0
  29. package/build/ts/deploy/vkRegistry.d.ts +7 -0
  30. package/build/ts/deploy/vkRegistry.d.ts.map +1 -0
  31. package/build/ts/deploy/vkRegistry.js +14 -0
  32. package/build/ts/deploy/vkRegistry.js.map +1 -0
  33. package/build/ts/index.d.ts +16 -0
  34. package/build/ts/index.d.ts.map +1 -0
  35. package/build/ts/index.js +69 -0
  36. package/build/ts/index.js.map +1 -0
  37. package/build/ts/maci/index.d.ts +6 -0
  38. package/build/ts/maci/index.d.ts.map +1 -0
  39. package/build/ts/maci/index.js +17 -0
  40. package/build/ts/maci/index.js.map +1 -0
  41. package/build/ts/maci/merge.d.ts +9 -0
  42. package/build/ts/maci/merge.d.ts.map +1 -0
  43. package/build/ts/maci/merge.js +29 -0
  44. package/build/ts/maci/merge.js.map +1 -0
  45. package/build/ts/maci/policy.d.ts +41 -0
  46. package/build/ts/maci/policy.d.ts.map +1 -0
  47. package/build/ts/maci/policy.js +127 -0
  48. package/build/ts/maci/policy.js.map +1 -0
  49. package/build/ts/maci/state.d.ts +8 -0
  50. package/build/ts/maci/state.d.ts.map +1 -0
  51. package/build/ts/maci/state.js +82 -0
  52. package/build/ts/maci/state.js.map +1 -0
  53. package/build/ts/maci/types.d.ts +176 -0
  54. package/build/ts/maci/types.d.ts.map +1 -0
  55. package/build/ts/maci/types.js +18 -0
  56. package/build/ts/maci/types.js.map +1 -0
  57. package/build/ts/maciKeys/__tests__/keypair.test.d.ts +2 -0
  58. package/build/ts/maciKeys/__tests__/keypair.test.d.ts.map +1 -0
  59. package/build/ts/maciKeys/__tests__/keypair.test.js +24 -0
  60. package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -0
  61. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts +2 -0
  62. package/build/ts/maciKeys/__tests__/publicKeys.test.d.ts.map +1 -0
  63. package/build/ts/maciKeys/__tests__/publicKeys.test.js +22 -0
  64. package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -0
  65. package/build/ts/maciKeys/index.d.ts +4 -0
  66. package/build/ts/maciKeys/index.d.ts.map +1 -0
  67. package/build/ts/maciKeys/index.js +8 -0
  68. package/build/ts/maciKeys/index.js.map +1 -0
  69. package/build/ts/maciKeys/keypair.d.ts +9 -0
  70. package/build/ts/maciKeys/keypair.d.ts.map +1 -0
  71. package/build/ts/maciKeys/keypair.js +20 -0
  72. package/build/ts/maciKeys/keypair.js.map +1 -0
  73. package/build/ts/maciKeys/publicKeys.d.ts +8 -0
  74. package/build/ts/maciKeys/publicKeys.d.ts.map +1 -0
  75. package/build/ts/maciKeys/publicKeys.js +23 -0
  76. package/build/ts/maciKeys/publicKeys.js.map +1 -0
  77. package/build/ts/maciKeys/types.d.ts +23 -0
  78. package/build/ts/maciKeys/types.d.ts.map +1 -0
  79. package/build/ts/maciKeys/types.js +3 -0
  80. package/build/ts/maciKeys/types.js.map +1 -0
  81. package/build/ts/poll/index.d.ts +4 -0
  82. package/build/ts/poll/index.d.ts.map +1 -0
  83. package/build/ts/poll/index.js +9 -0
  84. package/build/ts/poll/index.js.map +1 -0
  85. package/build/ts/poll/poll.d.ts +14 -0
  86. package/build/ts/poll/poll.d.ts.map +1 -0
  87. package/build/ts/poll/poll.js +62 -0
  88. package/build/ts/poll/poll.js.map +1 -0
  89. package/build/ts/poll/types.d.ts +152 -0
  90. package/build/ts/poll/types.d.ts.map +1 -0
  91. package/build/ts/poll/types.js +3 -0
  92. package/build/ts/poll/types.js.map +1 -0
  93. package/build/ts/poll/utils.d.ts +9 -0
  94. package/build/ts/poll/utils.d.ts.map +1 -0
  95. package/build/ts/poll/utils.js +43 -0
  96. package/build/ts/poll/utils.js.map +1 -0
  97. package/build/ts/proof/__tests__/download.test.d.ts +2 -0
  98. package/build/ts/proof/__tests__/download.test.d.ts.map +1 -0
  99. package/build/ts/proof/__tests__/download.test.js +50 -0
  100. package/build/ts/proof/__tests__/download.test.js.map +1 -0
  101. package/build/ts/proof/constants.d.ts +17 -0
  102. package/build/ts/proof/constants.d.ts.map +1 -0
  103. package/build/ts/proof/constants.js +20 -0
  104. package/build/ts/proof/constants.js.map +1 -0
  105. package/build/ts/proof/download.d.ts +9 -0
  106. package/build/ts/proof/download.d.ts.map +1 -0
  107. package/build/ts/proof/download.js +49 -0
  108. package/build/ts/proof/download.js.map +1 -0
  109. package/build/ts/proof/generate.d.ts +8 -0
  110. package/build/ts/proof/generate.d.ts.map +1 -0
  111. package/build/ts/proof/generate.js +127 -0
  112. package/build/ts/proof/generate.js.map +1 -0
  113. package/build/ts/proof/index.d.ts +4 -0
  114. package/build/ts/proof/index.d.ts.map +1 -0
  115. package/build/ts/proof/index.js +8 -0
  116. package/build/ts/proof/index.js.map +1 -0
  117. package/build/ts/proof/prove.d.ts +8 -0
  118. package/build/ts/proof/prove.d.ts.map +1 -0
  119. package/build/ts/proof/prove.js +81 -0
  120. package/build/ts/proof/prove.js.map +1 -0
  121. package/build/ts/proof/types.d.ts +175 -0
  122. package/build/ts/proof/types.d.ts.map +1 -0
  123. package/build/ts/proof/types.js +3 -0
  124. package/build/ts/proof/types.js.map +1 -0
  125. package/build/ts/relayer/__tests__/messages.test.d.ts +2 -0
  126. package/build/ts/relayer/__tests__/messages.test.d.ts.map +1 -0
  127. package/build/ts/relayer/__tests__/messages.test.js +76 -0
  128. package/build/ts/relayer/__tests__/messages.test.js.map +1 -0
  129. package/build/ts/relayer/__tests__/utils.test.d.ts +2 -0
  130. package/build/ts/relayer/__tests__/utils.test.d.ts.map +1 -0
  131. package/build/ts/relayer/__tests__/utils.test.js +73 -0
  132. package/build/ts/relayer/__tests__/utils.test.js.map +1 -0
  133. package/build/ts/relayer/index.d.ts +3 -0
  134. package/build/ts/relayer/index.d.ts.map +1 -0
  135. package/build/ts/relayer/index.js +8 -0
  136. package/build/ts/relayer/index.js.map +1 -0
  137. package/build/ts/relayer/messages.d.ts +23 -0
  138. package/build/ts/relayer/messages.d.ts.map +1 -0
  139. package/build/ts/relayer/messages.js +66 -0
  140. package/build/ts/relayer/messages.js.map +1 -0
  141. package/build/ts/relayer/types.d.ts +168 -0
  142. package/build/ts/relayer/types.d.ts.map +1 -0
  143. package/build/ts/relayer/types.js +3 -0
  144. package/build/ts/relayer/types.js.map +1 -0
  145. package/build/ts/relayer/utils.d.ts +12 -0
  146. package/build/ts/relayer/utils.d.ts.map +1 -0
  147. package/build/ts/relayer/utils.js +37 -0
  148. package/build/ts/relayer/utils.js.map +1 -0
  149. package/build/ts/tally/commitments.d.ts +9 -0
  150. package/build/ts/tally/commitments.d.ts.map +1 -0
  151. package/build/ts/tally/commitments.js +42 -0
  152. package/build/ts/tally/commitments.js.map +1 -0
  153. package/build/ts/tally/index.d.ts +4 -0
  154. package/build/ts/tally/index.d.ts.map +1 -0
  155. package/build/ts/tally/index.js +8 -0
  156. package/build/ts/tally/index.js.map +1 -0
  157. package/build/ts/tally/types.d.ts +179 -0
  158. package/build/ts/tally/types.d.ts.map +1 -0
  159. package/build/ts/tally/types.js +3 -0
  160. package/build/ts/tally/types.js.map +1 -0
  161. package/build/ts/tally/utils.d.ts +24 -0
  162. package/build/ts/tally/utils.d.ts.map +1 -0
  163. package/build/ts/tally/utils.js +50 -0
  164. package/build/ts/tally/utils.js.map +1 -0
  165. package/build/ts/tally/verification.d.ts +7 -0
  166. package/build/ts/tally/verification.d.ts.map +1 -0
  167. package/build/ts/tally/verification.js +62 -0
  168. package/build/ts/tally/verification.js.map +1 -0
  169. package/build/ts/trees/index.d.ts +3 -0
  170. package/build/ts/trees/index.d.ts.map +1 -0
  171. package/build/ts/trees/index.js +6 -0
  172. package/build/ts/trees/index.js.map +1 -0
  173. package/build/ts/trees/stateTree.d.ts +13 -0
  174. package/build/ts/trees/stateTree.d.ts.map +1 -0
  175. package/build/ts/trees/stateTree.js +53 -0
  176. package/build/ts/trees/stateTree.js.map +1 -0
  177. package/build/ts/trees/types.d.ts +46 -0
  178. package/build/ts/trees/types.d.ts.map +1 -0
  179. package/build/ts/trees/types.js +3 -0
  180. package/build/ts/trees/types.js.map +1 -0
  181. package/build/ts/user/index.d.ts +3 -0
  182. package/build/ts/user/index.d.ts.map +1 -0
  183. package/build/ts/user/index.js +11 -0
  184. package/build/ts/user/index.js.map +1 -0
  185. package/build/ts/user/types.d.ts +424 -0
  186. package/build/ts/user/types.d.ts.map +1 -0
  187. package/build/ts/user/types.js +3 -0
  188. package/build/ts/user/types.js.map +1 -0
  189. package/build/ts/user/user.d.ts +42 -0
  190. package/build/ts/user/user.d.ts.map +1 -0
  191. package/build/ts/user/user.js +192 -0
  192. package/build/ts/user/user.js.map +1 -0
  193. package/build/ts/user/utils.d.ts +52 -0
  194. package/build/ts/user/utils.d.ts.map +1 -0
  195. package/build/ts/user/utils.js +186 -0
  196. package/build/ts/user/utils.js.map +1 -0
  197. package/build/ts/utils/cid.d.ts +23 -0
  198. package/build/ts/utils/cid.d.ts.map +1 -0
  199. package/build/ts/utils/cid.js +72 -0
  200. package/build/ts/utils/cid.js.map +1 -0
  201. package/build/ts/utils/constants.d.ts +2 -0
  202. package/build/ts/utils/constants.d.ts.map +1 -0
  203. package/build/ts/utils/constants.js +5 -0
  204. package/build/ts/utils/constants.js.map +1 -0
  205. package/build/ts/utils/contracts.d.ts +15 -0
  206. package/build/ts/utils/contracts.d.ts.map +1 -0
  207. package/build/ts/utils/contracts.js +26 -0
  208. package/build/ts/utils/contracts.js.map +1 -0
  209. package/build/ts/utils/files.d.ts +9 -0
  210. package/build/ts/utils/files.d.ts.map +1 -0
  211. package/build/ts/utils/files.js +20 -0
  212. package/build/ts/utils/files.js.map +1 -0
  213. package/build/ts/utils/formatting.d.ts +8 -0
  214. package/build/ts/utils/formatting.d.ts.map +1 -0
  215. package/build/ts/utils/formatting.js +11 -0
  216. package/build/ts/utils/formatting.js.map +1 -0
  217. package/build/ts/utils/fundWallet.d.ts +7 -0
  218. package/build/ts/utils/fundWallet.d.ts.map +1 -0
  219. package/build/ts/utils/fundWallet.js +20 -0
  220. package/build/ts/utils/fundWallet.js.map +1 -0
  221. package/build/ts/utils/index.d.ts +12 -0
  222. package/build/ts/utils/index.d.ts.map +1 -0
  223. package/build/ts/utils/index.js +28 -0
  224. package/build/ts/utils/index.js.map +1 -0
  225. package/build/ts/utils/params.d.ts +7 -0
  226. package/build/ts/utils/params.d.ts.map +1 -0
  227. package/build/ts/utils/params.js +19 -0
  228. package/build/ts/utils/params.js.map +1 -0
  229. package/build/ts/utils/proofs.d.ts +13 -0
  230. package/build/ts/utils/proofs.d.ts.map +1 -0
  231. package/build/ts/utils/proofs.js +41 -0
  232. package/build/ts/utils/proofs.js.map +1 -0
  233. package/build/ts/utils/timeTravel.d.ts +7 -0
  234. package/build/ts/utils/timeTravel.d.ts.map +1 -0
  235. package/build/ts/utils/timeTravel.js +14 -0
  236. package/build/ts/utils/timeTravel.js.map +1 -0
  237. package/build/ts/utils/trees.d.ts +13 -0
  238. package/build/ts/utils/trees.d.ts.map +1 -0
  239. package/build/ts/utils/trees.js +30 -0
  240. package/build/ts/utils/trees.js.map +1 -0
  241. package/build/ts/utils/types.d.ts +71 -0
  242. package/build/ts/utils/types.d.ts.map +1 -0
  243. package/build/ts/utils/types.js +3 -0
  244. package/build/ts/utils/types.js.map +1 -0
  245. package/build/ts/utils/utils.d.ts +16 -0
  246. package/build/ts/utils/utils.d.ts.map +1 -0
  247. package/build/ts/utils/utils.js +36 -0
  248. package/build/ts/utils/utils.js.map +1 -0
  249. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +10 -0
  250. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -0
  251. package/build/ts/verifyingKeys/checkVerifyingKeys.js +67 -0
  252. package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -0
  253. package/build/ts/verifyingKeys/index.d.ts +5 -0
  254. package/build/ts/verifyingKeys/index.d.ts.map +1 -0
  255. package/build/ts/verifyingKeys/index.js +13 -0
  256. package/build/ts/verifyingKeys/index.js.map +1 -0
  257. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +7 -0
  258. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -0
  259. package/build/ts/verifyingKeys/setVerifyingKeys.js +73 -0
  260. package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -0
  261. package/build/ts/verifyingKeys/types.d.ts +231 -0
  262. package/build/ts/verifyingKeys/types.d.ts.map +1 -0
  263. package/build/ts/verifyingKeys/types.js +3 -0
  264. package/build/ts/verifyingKeys/types.js.map +1 -0
  265. package/build/ts/verifyingKeys/utils.d.ts +29 -0
  266. package/build/ts/verifyingKeys/utils.d.ts.map +1 -0
  267. package/build/ts/verifyingKeys/utils.js +102 -0
  268. package/build/ts/verifyingKeys/utils.js.map +1 -0
  269. package/build/ts/vote/generate.d.ts +8 -0
  270. package/build/ts/vote/generate.d.ts.map +1 -0
  271. package/build/ts/vote/generate.js +46 -0
  272. package/build/ts/vote/generate.js.map +1 -0
  273. package/build/ts/vote/index.d.ts +6 -0
  274. package/build/ts/vote/index.d.ts.map +1 -0
  275. package/build/ts/vote/index.js +15 -0
  276. package/build/ts/vote/index.js.map +1 -0
  277. package/build/ts/vote/invalidate.d.ts +13 -0
  278. package/build/ts/vote/invalidate.d.ts.map +1 -0
  279. package/build/ts/vote/invalidate.js +44 -0
  280. package/build/ts/vote/invalidate.js.map +1 -0
  281. package/build/ts/vote/publish.d.ts +14 -0
  282. package/build/ts/vote/publish.d.ts.map +1 -0
  283. package/build/ts/vote/publish.js +88 -0
  284. package/build/ts/vote/publish.js.map +1 -0
  285. package/build/ts/vote/submit.d.ts +13 -0
  286. package/build/ts/vote/submit.d.ts.map +1 -0
  287. package/build/ts/vote/submit.js +36 -0
  288. package/build/ts/vote/submit.js.map +1 -0
  289. package/build/ts/vote/types.d.ts +238 -0
  290. package/build/ts/vote/types.d.ts.map +1 -0
  291. package/build/ts/vote/types.js +3 -0
  292. package/build/ts/vote/types.js.map +1 -0
  293. package/build/ts/vote/utils.d.ts +16 -0
  294. package/build/ts/vote/utils.d.ts.map +1 -0
  295. package/build/ts/vote/utils.js +26 -0
  296. package/build/ts/vote/utils.js.map +1 -0
  297. package/build/tsconfig.build.tsbuildinfo +1 -0
  298. package/package.json +57 -0
@@ -0,0 +1,204 @@
1
+ import { EMode, TAbi } from "@maci-protocol/contracts";
2
+ import { PubKey } from "@maci-protocol/domainobjs";
3
+ import type { Signer } from "ethers";
4
+ /**
5
+ * The arguments for the deploy poll command
6
+ */
7
+ export interface IDeployPollArgs {
8
+ /**
9
+ * The address of the MACI contract
10
+ */
11
+ maciAddress: string;
12
+ /**
13
+ * The start timestamp of the poll
14
+ */
15
+ pollStartTimestamp: number;
16
+ /**
17
+ * The end timestamp of the poll
18
+ */
19
+ pollEndTimestamp: number;
20
+ /**
21
+ * The depth of the integer state tree
22
+ */
23
+ intStateTreeDepth: number;
24
+ /**
25
+ * The depth of the vote option tree
26
+ */
27
+ voteOptionTreeDepth: number;
28
+ /**
29
+ * The batch size of the messages
30
+ */
31
+ messageBatchSize: number;
32
+ /**
33
+ * The coordinator public key
34
+ */
35
+ coordinatorPubKey: PubKey;
36
+ /**
37
+ * The address of the verifier contract
38
+ */
39
+ verifierContractAddress: string;
40
+ /**
41
+ * The address of the VK registry contract
42
+ */
43
+ vkRegistryContractAddress: string;
44
+ /**
45
+ * The mode of the poll
46
+ */
47
+ mode: EMode;
48
+ /**
49
+ * The address of the policy contract
50
+ */
51
+ policyContractAddress: string;
52
+ /**
53
+ * The address of the initial voice credit proxy contract
54
+ */
55
+ initialVoiceCreditProxyContractAddress?: string;
56
+ /**
57
+ * The addresses of the relayers
58
+ */
59
+ relayers: string[];
60
+ /**
61
+ * The number of vote options
62
+ */
63
+ voteOptions: number;
64
+ /**
65
+ * The initial voice credits to be minted
66
+ */
67
+ initialVoiceCredits?: number;
68
+ /**
69
+ * The signer
70
+ */
71
+ signer: Signer;
72
+ }
73
+ /**
74
+ * The addresses of the deployed poll contracts
75
+ */
76
+ export interface IPollContractsData {
77
+ /**
78
+ * The address of the poll contract
79
+ */
80
+ pollContractAddress: string;
81
+ /**
82
+ * The address of the message processor contract
83
+ */
84
+ messageProcessorContractAddress: string;
85
+ /**
86
+ * The address of the tally contract
87
+ */
88
+ tallyContractAddress: string;
89
+ /**
90
+ * The poll id
91
+ */
92
+ pollId: bigint;
93
+ /**
94
+ * The address of the policy contract
95
+ */
96
+ policyContractAddress: string;
97
+ /**
98
+ * The address of the initial voice credit proxy contract
99
+ */
100
+ initialVoiceCreditProxyContractAddress: string;
101
+ }
102
+ /**
103
+ * An interface that represents the arguments for MACI contracts deployment.
104
+ */
105
+ export interface IDeployMaciArgs {
106
+ /**
107
+ * The depth of the state tree
108
+ */
109
+ stateTreeDepth: number;
110
+ /**
111
+ * The address of the policy contract
112
+ */
113
+ signupPolicyAddress: string;
114
+ /**
115
+ * The signer to use to deploy the contract
116
+ */
117
+ signer: Signer;
118
+ /**
119
+ * The address of the PollFactory contract
120
+ */
121
+ pollFactoryAddress?: string;
122
+ /**
123
+ * The address of the MessageProcessorFactory contract
124
+ */
125
+ messageProcessorFactoryAddress?: string;
126
+ /**
127
+ * The address of the TallyFactory contract
128
+ */
129
+ tallyFactoryAddress?: string;
130
+ /**
131
+ * Poseidon contract addresses (if not provided, they will be deployed automatically)
132
+ */
133
+ poseidonAddresses?: Partial<{
134
+ poseidonT3: string;
135
+ poseidonT4: string;
136
+ poseidonT5: string;
137
+ poseidonT6: string;
138
+ }>;
139
+ }
140
+ /**
141
+ * An interface that represents the deployed MACI contracts.
142
+ */
143
+ export interface IMaciContracts {
144
+ /**
145
+ * The address of the MACI contract
146
+ */
147
+ maciContractAddress: string;
148
+ /**
149
+ * The address of the PollFactory contract
150
+ */
151
+ pollFactoryContractAddress: string;
152
+ /**
153
+ * The address of the MessageProcessorFactory contract
154
+ */
155
+ messageProcessorFactoryContractAddress: string;
156
+ /**
157
+ * The address of the TallyFactory contract
158
+ */
159
+ tallyFactoryContractAddress: string;
160
+ /**
161
+ * The addresses of the Poseidon contracts
162
+ */
163
+ poseidonAddresses: {
164
+ poseidonT3: string;
165
+ poseidonT4: string;
166
+ poseidonT5: string;
167
+ poseidonT6: string;
168
+ };
169
+ }
170
+ /**
171
+ * Interface for the arguments to the DeployVkRegistry command
172
+ */
173
+ export interface IDeployVkRegistryArgs {
174
+ /**
175
+ * A signer object
176
+ */
177
+ signer: Signer;
178
+ }
179
+ /**
180
+ * Arguments for deploying a factory
181
+ */
182
+ export interface IDeployFactoryArgs {
183
+ /**
184
+ * The abi of the factory
185
+ */
186
+ abi: TAbi;
187
+ /**
188
+ * The bytecode of the factory
189
+ */
190
+ bytecode: string;
191
+ /**
192
+ * The signer to use
193
+ */
194
+ signer: Signer;
195
+ /**
196
+ * The arguments
197
+ */
198
+ args?: unknown[];
199
+ /**
200
+ * The address of the factory
201
+ */
202
+ address?: string;
203
+ }
204
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/deploy/types.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../ts/deploy/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { IDeployFactoryArgs } from "./types";
2
+ export declare const DEFAULT_INITIAL_VOICE_CREDITS = 100;
3
+ /**
4
+ * Deploy a factory
5
+ * @param factory - Factory to deploy
6
+ * @param signer - Signer to use
7
+ * @param args - Arguments to pass to the factory
8
+ * @returns Deployed factory
9
+ */
10
+ export declare const deployFactoryWithLinkedLibraries: ({ abi, bytecode, signer, args, address, }: IDeployFactoryArgs) => Promise<string>;
11
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/deploy/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,GAAU,2CAMpD,kBAAkB,KAAG,OAAO,CAAC,MAAM,CASrC,CAAC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployFactoryWithLinkedLibraries = exports.DEFAULT_INITIAL_VOICE_CREDITS = void 0;
4
+ const contracts_1 = require("@maci-protocol/contracts");
5
+ exports.DEFAULT_INITIAL_VOICE_CREDITS = 100;
6
+ /**
7
+ * Deploy a factory
8
+ * @param factory - Factory to deploy
9
+ * @param signer - Signer to use
10
+ * @param args - Arguments to pass to the factory
11
+ * @returns Deployed factory
12
+ */
13
+ const deployFactoryWithLinkedLibraries = async ({ abi, bytecode, signer, args, address, }) => {
14
+ if (address) {
15
+ return address;
16
+ }
17
+ const contractFactory = await (0, contracts_1.createContractFactory)(abi, bytecode, signer);
18
+ const contractFactoryContract = await (0, contracts_1.deployContractWithLinkedLibraries)(contractFactory, ...(args ?? []));
19
+ return contractFactoryContract.getAddress();
20
+ };
21
+ exports.deployFactoryWithLinkedLibraries = deployFactoryWithLinkedLibraries;
22
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/deploy/utils.ts"],"names":[],"mappings":";;;AAAA,wDAAoG;AAIvF,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEjD;;;;;;GAMG;AACI,MAAM,gCAAgC,GAAG,KAAK,EAAE,EACrD,GAAG,EACH,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,OAAO,GACY,EAAmB,EAAE;IACxC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAqB,EAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE3E,MAAM,uBAAuB,GAAG,MAAM,IAAA,6CAAiC,EAAC,eAAe,EAAE,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1G,OAAO,uBAAuB,CAAC,UAAU,EAAE,CAAC;AAC9C,CAAC,CAAC;AAfW,QAAA,gCAAgC,oCAe3C"}
@@ -0,0 +1,7 @@
1
+ import type { IDeployVkRegistryArgs } from "./types";
2
+ /**
3
+ * Deploy the vkRegistry contract
4
+ * @param args deploy VkRegistry arguments
5
+ */
6
+ export declare const deployVkRegistryContract: ({ signer }: IDeployVkRegistryArgs) => Promise<string>;
7
+ //# sourceMappingURL=vkRegistry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vkRegistry.d.ts","sourceRoot":"","sources":["../../../ts/deploy/vkRegistry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAU,YAAY,qBAAqB,KAAG,OAAO,CAAC,MAAM,CAIhG,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployVkRegistryContract = void 0;
4
+ const contracts_1 = require("@maci-protocol/contracts");
5
+ /**
6
+ * Deploy the vkRegistry contract
7
+ * @param args deploy VkRegistry arguments
8
+ */
9
+ const deployVkRegistryContract = async ({ signer }) => {
10
+ const vkRegistry = await (0, contracts_1.deployVkRegistry)(signer, true);
11
+ return vkRegistry.getAddress();
12
+ };
13
+ exports.deployVkRegistryContract = deployVkRegistryContract;
14
+ //# sourceMappingURL=vkRegistry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vkRegistry.js","sourceRoot":"","sources":["../../../ts/deploy/vkRegistry.ts"],"names":[],"mappings":";;;AAAA,wDAA4D;AAI5D;;;GAGG;AACI,MAAM,wBAAwB,GAAG,KAAK,EAAE,EAAE,MAAM,EAAyB,EAAmB,EAAE;IACnG,MAAM,UAAU,GAAG,MAAM,IAAA,4BAAgB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAExD,OAAO,UAAU,CAAC,UAAU,EAAE,CAAC;AACjC,CAAC,CAAC;AAJW,QAAA,wBAAwB,4BAInC"}
@@ -0,0 +1,16 @@
1
+ export * from "./verifyingKeys";
2
+ export * from "./maci";
3
+ export * from "./relayer";
4
+ export * from "./poll";
5
+ export * from "./proof";
6
+ export * from "./tally";
7
+ export * from "./trees";
8
+ export * from "./vote";
9
+ export * from "./utils";
10
+ export * from "./user";
11
+ export * from "./deploy";
12
+ export * from "./maciKeys";
13
+ export { EMode, EContracts, EPolicies, EInitialVoiceCreditProxies, EDeploySteps, Deployment, ContractStorage, ProofGenerator, TreeMerger, Prover, extractVk, genProofRapidSnark, genProofSnarkjs, formatProofForVerifierContract, verifyProof, linkPoseidonLibraries, deployConstantInitialVoiceCreditProxy, deployFreeForAllSignUpPolicy, deployMockVerifier, deployVkRegistry, deployVerifier, genMaciStateFromContract, getDefaultSigner, cleanThreads, unlinkFile, getBlockTimestamp, logGreen, logMagenta, logRed, logYellow, info, success, warning, error, genEmptyBallotRoots, getProxyContract, deployProxyClone, } from "@maci-protocol/contracts";
14
+ export type { FullProveResult, IGenerateProofsOptions, IGenerateProofsBatchData, IDeployParams, IMergeParams, IProveParams, IVerifyingKeyStruct, SnarkProof, IIpfsMessage, IDeployCloneArgs, IGetProxyContractArgs, } from "@maci-protocol/contracts";
15
+ export * from "@maci-protocol/contracts/typechain-types";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../ts/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,OAAO,EACL,KAAK,EACL,UAAU,EACV,SAAS,EACT,0BAA0B,EAC1B,YAAY,EACZ,UAAU,EACV,eAAe,EACf,cAAc,EACd,UAAU,EACV,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,8BAA8B,EAC9B,WAAW,EACX,qBAAqB,EACrB,qCAAqC,EACrC,4BAA4B,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,UAAU,EACV,MAAM,EACN,SAAS,EACT,IAAI,EACJ,OAAO,EACP,OAAO,EACP,KAAK,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,0BAA0B,CAAC;AAElC,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,0BAA0B,CAAC;AAElC,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.deployProxyClone = exports.getProxyContract = exports.genEmptyBallotRoots = exports.error = exports.warning = exports.success = exports.info = exports.logYellow = exports.logRed = exports.logMagenta = exports.logGreen = exports.getBlockTimestamp = exports.unlinkFile = exports.cleanThreads = exports.getDefaultSigner = exports.genMaciStateFromContract = exports.deployVerifier = exports.deployVkRegistry = exports.deployMockVerifier = exports.deployFreeForAllSignUpPolicy = exports.deployConstantInitialVoiceCreditProxy = exports.linkPoseidonLibraries = exports.verifyProof = exports.formatProofForVerifierContract = exports.genProofSnarkjs = exports.genProofRapidSnark = exports.extractVk = exports.Prover = exports.TreeMerger = exports.ProofGenerator = exports.ContractStorage = exports.Deployment = exports.EDeploySteps = exports.EInitialVoiceCreditProxies = exports.EPolicies = exports.EContracts = exports.EMode = void 0;
18
+ __exportStar(require("./verifyingKeys"), exports);
19
+ __exportStar(require("./maci"), exports);
20
+ __exportStar(require("./relayer"), exports);
21
+ __exportStar(require("./poll"), exports);
22
+ __exportStar(require("./proof"), exports);
23
+ __exportStar(require("./tally"), exports);
24
+ __exportStar(require("./trees"), exports);
25
+ __exportStar(require("./vote"), exports);
26
+ __exportStar(require("./utils"), exports);
27
+ __exportStar(require("./user"), exports);
28
+ __exportStar(require("./deploy"), exports);
29
+ __exportStar(require("./maciKeys"), exports);
30
+ var contracts_1 = require("@maci-protocol/contracts");
31
+ Object.defineProperty(exports, "EMode", { enumerable: true, get: function () { return contracts_1.EMode; } });
32
+ Object.defineProperty(exports, "EContracts", { enumerable: true, get: function () { return contracts_1.EContracts; } });
33
+ Object.defineProperty(exports, "EPolicies", { enumerable: true, get: function () { return contracts_1.EPolicies; } });
34
+ Object.defineProperty(exports, "EInitialVoiceCreditProxies", { enumerable: true, get: function () { return contracts_1.EInitialVoiceCreditProxies; } });
35
+ Object.defineProperty(exports, "EDeploySteps", { enumerable: true, get: function () { return contracts_1.EDeploySteps; } });
36
+ Object.defineProperty(exports, "Deployment", { enumerable: true, get: function () { return contracts_1.Deployment; } });
37
+ Object.defineProperty(exports, "ContractStorage", { enumerable: true, get: function () { return contracts_1.ContractStorage; } });
38
+ Object.defineProperty(exports, "ProofGenerator", { enumerable: true, get: function () { return contracts_1.ProofGenerator; } });
39
+ Object.defineProperty(exports, "TreeMerger", { enumerable: true, get: function () { return contracts_1.TreeMerger; } });
40
+ Object.defineProperty(exports, "Prover", { enumerable: true, get: function () { return contracts_1.Prover; } });
41
+ Object.defineProperty(exports, "extractVk", { enumerable: true, get: function () { return contracts_1.extractVk; } });
42
+ Object.defineProperty(exports, "genProofRapidSnark", { enumerable: true, get: function () { return contracts_1.genProofRapidSnark; } });
43
+ Object.defineProperty(exports, "genProofSnarkjs", { enumerable: true, get: function () { return contracts_1.genProofSnarkjs; } });
44
+ Object.defineProperty(exports, "formatProofForVerifierContract", { enumerable: true, get: function () { return contracts_1.formatProofForVerifierContract; } });
45
+ Object.defineProperty(exports, "verifyProof", { enumerable: true, get: function () { return contracts_1.verifyProof; } });
46
+ Object.defineProperty(exports, "linkPoseidonLibraries", { enumerable: true, get: function () { return contracts_1.linkPoseidonLibraries; } });
47
+ Object.defineProperty(exports, "deployConstantInitialVoiceCreditProxy", { enumerable: true, get: function () { return contracts_1.deployConstantInitialVoiceCreditProxy; } });
48
+ Object.defineProperty(exports, "deployFreeForAllSignUpPolicy", { enumerable: true, get: function () { return contracts_1.deployFreeForAllSignUpPolicy; } });
49
+ Object.defineProperty(exports, "deployMockVerifier", { enumerable: true, get: function () { return contracts_1.deployMockVerifier; } });
50
+ Object.defineProperty(exports, "deployVkRegistry", { enumerable: true, get: function () { return contracts_1.deployVkRegistry; } });
51
+ Object.defineProperty(exports, "deployVerifier", { enumerable: true, get: function () { return contracts_1.deployVerifier; } });
52
+ Object.defineProperty(exports, "genMaciStateFromContract", { enumerable: true, get: function () { return contracts_1.genMaciStateFromContract; } });
53
+ Object.defineProperty(exports, "getDefaultSigner", { enumerable: true, get: function () { return contracts_1.getDefaultSigner; } });
54
+ Object.defineProperty(exports, "cleanThreads", { enumerable: true, get: function () { return contracts_1.cleanThreads; } });
55
+ Object.defineProperty(exports, "unlinkFile", { enumerable: true, get: function () { return contracts_1.unlinkFile; } });
56
+ Object.defineProperty(exports, "getBlockTimestamp", { enumerable: true, get: function () { return contracts_1.getBlockTimestamp; } });
57
+ Object.defineProperty(exports, "logGreen", { enumerable: true, get: function () { return contracts_1.logGreen; } });
58
+ Object.defineProperty(exports, "logMagenta", { enumerable: true, get: function () { return contracts_1.logMagenta; } });
59
+ Object.defineProperty(exports, "logRed", { enumerable: true, get: function () { return contracts_1.logRed; } });
60
+ Object.defineProperty(exports, "logYellow", { enumerable: true, get: function () { return contracts_1.logYellow; } });
61
+ Object.defineProperty(exports, "info", { enumerable: true, get: function () { return contracts_1.info; } });
62
+ Object.defineProperty(exports, "success", { enumerable: true, get: function () { return contracts_1.success; } });
63
+ Object.defineProperty(exports, "warning", { enumerable: true, get: function () { return contracts_1.warning; } });
64
+ Object.defineProperty(exports, "error", { enumerable: true, get: function () { return contracts_1.error; } });
65
+ Object.defineProperty(exports, "genEmptyBallotRoots", { enumerable: true, get: function () { return contracts_1.genEmptyBallotRoots; } });
66
+ Object.defineProperty(exports, "getProxyContract", { enumerable: true, get: function () { return contracts_1.getProxyContract; } });
67
+ Object.defineProperty(exports, "deployProxyClone", { enumerable: true, get: function () { return contracts_1.deployProxyClone; } });
68
+ __exportStar(require("@maci-protocol/contracts/typechain-types"), exports);
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../ts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,yCAAuB;AACvB,4CAA0B;AAC1B,yCAAuB;AACvB,0CAAwB;AACxB,0CAAwB;AACxB,0CAAwB;AACxB,yCAAuB;AACvB,0CAAwB;AACxB,yCAAuB;AACvB,2CAAyB;AACzB,6CAA2B;AAC3B,sDAsCkC;AArChC,kGAAA,KAAK,OAAA;AACL,uGAAA,UAAU,OAAA;AACV,sGAAA,SAAS,OAAA;AACT,uHAAA,0BAA0B,OAAA;AAC1B,yGAAA,YAAY,OAAA;AACZ,uGAAA,UAAU,OAAA;AACV,4GAAA,eAAe,OAAA;AACf,2GAAA,cAAc,OAAA;AACd,uGAAA,UAAU,OAAA;AACV,mGAAA,MAAM,OAAA;AACN,sGAAA,SAAS,OAAA;AACT,+GAAA,kBAAkB,OAAA;AAClB,4GAAA,eAAe,OAAA;AACf,2HAAA,8BAA8B,OAAA;AAC9B,wGAAA,WAAW,OAAA;AACX,kHAAA,qBAAqB,OAAA;AACrB,kIAAA,qCAAqC,OAAA;AACrC,yHAAA,4BAA4B,OAAA;AAC5B,+GAAA,kBAAkB,OAAA;AAClB,6GAAA,gBAAgB,OAAA;AAChB,2GAAA,cAAc,OAAA;AACd,qHAAA,wBAAwB,OAAA;AACxB,6GAAA,gBAAgB,OAAA;AAChB,yGAAA,YAAY,OAAA;AACZ,uGAAA,UAAU,OAAA;AACV,8GAAA,iBAAiB,OAAA;AACjB,qGAAA,QAAQ,OAAA;AACR,uGAAA,UAAU,OAAA;AACV,mGAAA,MAAM,OAAA;AACN,sGAAA,SAAS,OAAA;AACT,iGAAA,IAAI,OAAA;AACJ,oGAAA,OAAO,OAAA;AACP,oGAAA,OAAO,OAAA;AACP,kGAAA,KAAK,OAAA;AACL,gHAAA,mBAAmB,OAAA;AACnB,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAiBlB,2EAAyD"}
@@ -0,0 +1,6 @@
1
+ export { getPolicyTrait, getPolicyContractNamesByTrait, getSemaphorePolicyData, getZupassPolicyData, getEASPolicyData, getMerkleProofPolicyData, } from "./policy";
2
+ export { mergeSignups } from "./merge";
3
+ export { generateMaciState } from "./state";
4
+ export { EPolicyTrait } from "./types";
5
+ export type { IGetPolicyTraitArgs, IGetPolicyDataArgs, ISemaphorePolicyData, IZupassPolicyData, IEASPolicyData, IMerkleProofPolicyData, IMergeSignupsArgs, IGenerateMaciStateArgs, } from "./types";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/maci/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,6BAA6B,EAC7B,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPolicyTrait = exports.generateMaciState = exports.mergeSignups = exports.getMerkleProofPolicyData = exports.getEASPolicyData = exports.getZupassPolicyData = exports.getSemaphorePolicyData = exports.getPolicyContractNamesByTrait = exports.getPolicyTrait = void 0;
4
+ var policy_1 = require("./policy");
5
+ Object.defineProperty(exports, "getPolicyTrait", { enumerable: true, get: function () { return policy_1.getPolicyTrait; } });
6
+ Object.defineProperty(exports, "getPolicyContractNamesByTrait", { enumerable: true, get: function () { return policy_1.getPolicyContractNamesByTrait; } });
7
+ Object.defineProperty(exports, "getSemaphorePolicyData", { enumerable: true, get: function () { return policy_1.getSemaphorePolicyData; } });
8
+ Object.defineProperty(exports, "getZupassPolicyData", { enumerable: true, get: function () { return policy_1.getZupassPolicyData; } });
9
+ Object.defineProperty(exports, "getEASPolicyData", { enumerable: true, get: function () { return policy_1.getEASPolicyData; } });
10
+ Object.defineProperty(exports, "getMerkleProofPolicyData", { enumerable: true, get: function () { return policy_1.getMerkleProofPolicyData; } });
11
+ var merge_1 = require("./merge");
12
+ Object.defineProperty(exports, "mergeSignups", { enumerable: true, get: function () { return merge_1.mergeSignups; } });
13
+ var state_1 = require("./state");
14
+ Object.defineProperty(exports, "generateMaciState", { enumerable: true, get: function () { return state_1.generateMaciState; } });
15
+ var types_1 = require("./types");
16
+ Object.defineProperty(exports, "EPolicyTrait", { enumerable: true, get: function () { return types_1.EPolicyTrait; } });
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/maci/index.ts"],"names":[],"mappings":";;;AAAA,mCAOkB;AANhB,wGAAA,cAAc,OAAA;AACd,uHAAA,6BAA6B,OAAA;AAC7B,gHAAA,sBAAsB,OAAA;AACtB,6GAAA,mBAAmB,OAAA;AACnB,0GAAA,gBAAgB,OAAA;AAChB,kHAAA,wBAAwB,OAAA;AAE1B,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAC1B,iCAAuC;AAA9B,qGAAA,YAAY,OAAA"}
@@ -0,0 +1,9 @@
1
+ import type { IMergeSignupsArgs } from "./types";
2
+ import type { TransactionReceipt } from "ethers";
3
+ /**
4
+ * Command to merge the signups of a MACI contract
5
+ * @param args the arguments for the mergeSignups command
6
+ * @return transaction receipt
7
+ */
8
+ export declare const mergeSignups: ({ pollId, maciAddress, signer }: IMergeSignupsArgs) => Promise<TransactionReceipt>;
9
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../ts/maci/merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAKjD;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAU,iCAAiC,iBAAiB,KAAG,OAAO,CAAC,kBAAkB,CAuBjH,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mergeSignups = void 0;
4
+ const poll_1 = require("../poll");
5
+ const contracts_1 = require("../utils/contracts");
6
+ /**
7
+ * Command to merge the signups of a MACI contract
8
+ * @param args the arguments for the mergeSignups command
9
+ * @return transaction receipt
10
+ */
11
+ const mergeSignups = async ({ pollId, maciAddress, signer }) => {
12
+ const { poll: pollContract } = await (0, poll_1.getPollContracts)({ maciAddress, pollId, signer });
13
+ // check if it's time to merge the signups
14
+ const [endDate, now] = await Promise.all([pollContract.endDate(), (0, contracts_1.currentBlockTimestamp)(signer.provider)]);
15
+ if (now < endDate) {
16
+ throw new Error("Voting period is not over");
17
+ }
18
+ const isMerged = await pollContract.stateMerged();
19
+ if (isMerged) {
20
+ throw new Error("The state tree has already been merged");
21
+ }
22
+ const receipt = await pollContract.mergeState().then((tx) => tx.wait());
23
+ if (receipt?.status !== 1) {
24
+ throw new Error("Error merging state subroots");
25
+ }
26
+ return receipt;
27
+ };
28
+ exports.mergeSignups = mergeSignups;
29
+ //# sourceMappingURL=merge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../ts/maci/merge.ts"],"names":[],"mappings":";;;AAGA,kCAA2C;AAC3C,kDAA2D;AAE3D;;;;GAIG;AACI,MAAM,YAAY,GAAG,KAAK,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAqB,EAA+B,EAAE;IACpH,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,uBAAgB,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAEvF,0CAA0C;IAC1C,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,IAAA,iCAAqB,EAAC,MAAM,CAAC,QAAS,CAAC,CAAC,CAAC,CAAC;IAE5G,IAAI,GAAG,GAAG,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,WAAW,EAAE,CAAC;IAElD,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC;IAExE,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAvBW,QAAA,YAAY,gBAuBvB"}
@@ -0,0 +1,41 @@
1
+ import { EPolicies } from "@maci-protocol/contracts";
2
+ import type { IGetPolicyTraitArgs, IGetPolicyDataArgs, ISemaphorePolicyData, IZupassPolicyData, IEASPolicyData, IMerkleProofPolicyData } from "./types";
3
+ import { EPolicyTrait } from "./types";
4
+ /**
5
+ * Get the policy type of the MACI contract
6
+ * @param IGetPolicyTraitArgs - The arguments for the get policy type command
7
+ * @returns The policy type
8
+ */
9
+ export declare const getPolicyTrait: ({ maciAddress, signer }: IGetPolicyTraitArgs) => Promise<EPolicyTrait>;
10
+ /**
11
+ * Get policy contract names associated with the trait provided.
12
+ *
13
+ * @param trait the policy trait
14
+ * @returns the policy contract names
15
+ */
16
+ export declare const getPolicyContractNamesByTrait: (trait: EPolicyTrait) => EPolicies;
17
+ /**
18
+ * Get the semaphore policy data
19
+ * @param IGetSemaphorePolicyDataArgs - The arguments for the get semaphore policy data command
20
+ * @returns The semaphore policy data
21
+ */
22
+ export declare const getSemaphorePolicyData: ({ maciAddress, signer, }: IGetPolicyDataArgs) => Promise<ISemaphorePolicyData>;
23
+ /**
24
+ * Get the zupass policy data
25
+ * @param IGetPolicyDataArgs - The arguments for the get zupass policy data command
26
+ * @returns The zupass policy data
27
+ */
28
+ export declare const getZupassPolicyData: ({ maciAddress, signer }: IGetPolicyDataArgs) => Promise<IZupassPolicyData>;
29
+ /**
30
+ * Get the EAS policy data
31
+ * @param IGetPolicyDataArgs - The arguments for the get eas policy data command
32
+ * @returns The eas policy data
33
+ */
34
+ export declare const getEASPolicyData: ({ maciAddress, signer }: IGetPolicyDataArgs) => Promise<IEASPolicyData>;
35
+ /**
36
+ * Get the merkleproof policy data
37
+ * @param IGetPolicyDataArgs - The arguments for the get merkleproof policy data command
38
+ * @returns The merkleproof policy data
39
+ */
40
+ export declare const getMerkleProofPolicyData: ({ maciAddress, signer, }: IGetPolicyDataArgs) => Promise<IMerkleProofPolicyData>;
41
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../../ts/maci/policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA4D,MAAM,0BAA0B,CAAC;AAa/G,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAU,yBAAyB,mBAAmB,KAAG,OAAO,CAAC,YAAY,CAWvG,CAAC;AAaF;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,GAAI,OAAO,YAAY,KAAG,SAAkD,CAAC;AAEvH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAU,0BAG1C,kBAAkB,KAAG,OAAO,CAAC,oBAAoB,CAoBnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAAU,yBAAyB,kBAAkB,KAAG,OAAO,CAAC,iBAAiB,CAqBhH,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAU,yBAAyB,kBAAkB,KAAG,OAAO,CAAC,cAAc,CAoB1G,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAU,0BAG5C,kBAAkB,KAAG,OAAO,CAAC,sBAAsB,CAerD,CAAC"}