@maci-protocol/sdk 0.0.0-ci.a1bedc5 → 0.0.0-ci.a45d012

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 (183) hide show
  1. package/LICENSE +1 -2
  2. package/build/package.json +12 -4
  3. package/build/ts/browser/index.d.ts +2 -1
  4. package/build/ts/browser/index.d.ts.map +1 -1
  5. package/build/ts/browser/index.js +6 -1
  6. package/build/ts/browser/index.js.map +1 -1
  7. package/build/ts/browser/joinPoll.d.ts +4 -2
  8. package/build/ts/browser/joinPoll.d.ts.map +1 -1
  9. package/build/ts/browser/joinPoll.js +21 -17
  10. package/build/ts/browser/joinPoll.js.map +1 -1
  11. package/build/ts/browser/utils.d.ts +2 -2
  12. package/build/ts/browser/utils.d.ts.map +1 -1
  13. package/build/ts/browser/utils.js +3 -3
  14. package/build/ts/browser/utils.js.map +1 -1
  15. package/build/ts/deploy/index.d.ts +2 -2
  16. package/build/ts/deploy/index.d.ts.map +1 -1
  17. package/build/ts/deploy/index.js +3 -3
  18. package/build/ts/deploy/index.js.map +1 -1
  19. package/build/ts/deploy/maci.js +1 -1
  20. package/build/ts/deploy/maci.js.map +1 -1
  21. package/build/ts/deploy/poll.d.ts +1 -1
  22. package/build/ts/deploy/poll.d.ts.map +1 -1
  23. package/build/ts/deploy/poll.js +7 -7
  24. package/build/ts/deploy/poll.js.map +1 -1
  25. package/build/ts/deploy/types.d.ts +7 -6
  26. package/build/ts/deploy/types.d.ts.map +1 -1
  27. package/build/ts/deploy/utils.js +1 -1
  28. package/build/ts/deploy/utils.js.map +1 -1
  29. package/build/ts/deploy/verifyingKeysRegistry.d.ts +7 -0
  30. package/build/ts/deploy/verifyingKeysRegistry.d.ts.map +1 -0
  31. package/build/ts/deploy/verifyingKeysRegistry.js +14 -0
  32. package/build/ts/deploy/verifyingKeysRegistry.js.map +1 -0
  33. package/build/ts/index.d.ts +2 -1
  34. package/build/ts/index.d.ts.map +1 -1
  35. package/build/ts/index.js +12 -7
  36. package/build/ts/index.js.map +1 -1
  37. package/build/ts/maci/state.d.ts +1 -1
  38. package/build/ts/maci/state.js +8 -8
  39. package/build/ts/maci/state.js.map +1 -1
  40. package/build/ts/maci/types.d.ts +1 -1
  41. package/build/ts/maciKeys/__tests__/keypair.test.js +3 -3
  42. package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -1
  43. package/build/ts/maciKeys/__tests__/publicKeys.test.js +5 -5
  44. package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -1
  45. package/build/ts/maciKeys/publicKeys.js +2 -2
  46. package/build/ts/maciKeys/publicKeys.js.map +1 -1
  47. package/build/ts/poll/poll.js +7 -7
  48. package/build/ts/poll/poll.js.map +1 -1
  49. package/build/ts/poll/types.d.ts +3 -3
  50. package/build/ts/poll/types.d.ts.map +1 -1
  51. package/build/ts/proof/__tests__/download.test.js +5 -2
  52. package/build/ts/proof/__tests__/download.test.js.map +1 -1
  53. package/build/ts/proof/download.d.ts +3 -3
  54. package/build/ts/proof/download.d.ts.map +1 -1
  55. package/build/ts/proof/download.js +5 -7
  56. package/build/ts/proof/download.js.map +1 -1
  57. package/build/ts/proof/generate.d.ts +2 -2
  58. package/build/ts/proof/generate.d.ts.map +1 -1
  59. package/build/ts/proof/generate.js +28 -22
  60. package/build/ts/proof/generate.js.map +1 -1
  61. package/build/ts/proof/prove.js +13 -13
  62. package/build/ts/proof/prove.js.map +1 -1
  63. package/build/ts/proof/types.d.ts +40 -14
  64. package/build/ts/proof/types.d.ts.map +1 -1
  65. package/build/ts/proof/utils.d.ts +10 -0
  66. package/build/ts/proof/utils.d.ts.map +1 -0
  67. package/build/ts/proof/utils.js +24 -0
  68. package/build/ts/proof/utils.js.map +1 -0
  69. package/build/ts/relayer/messages.js +1 -1
  70. package/build/ts/subgraph/index.d.ts +3 -0
  71. package/build/ts/subgraph/index.d.ts.map +1 -0
  72. package/build/ts/subgraph/index.js +18 -0
  73. package/build/ts/subgraph/index.js.map +1 -0
  74. package/build/ts/subgraph/maciSubgraph.d.ts +28 -0
  75. package/build/ts/subgraph/maciSubgraph.d.ts.map +1 -0
  76. package/build/ts/subgraph/maciSubgraph.js +62 -0
  77. package/build/ts/subgraph/maciSubgraph.js.map +1 -0
  78. package/build/ts/subgraph/types.d.ts +20 -0
  79. package/build/ts/subgraph/types.d.ts.map +1 -0
  80. package/build/ts/subgraph/types.js +3 -0
  81. package/build/ts/subgraph/types.js.map +1 -0
  82. package/build/ts/tally/commitments.d.ts.map +1 -1
  83. package/build/ts/tally/commitments.js +8 -7
  84. package/build/ts/tally/commitments.js.map +1 -1
  85. package/build/ts/tally/index.d.ts +2 -1
  86. package/build/ts/tally/index.d.ts.map +1 -1
  87. package/build/ts/tally/index.js +4 -1
  88. package/build/ts/tally/index.js.map +1 -1
  89. package/build/ts/tally/results.d.ts +14 -0
  90. package/build/ts/tally/results.d.ts.map +1 -0
  91. package/build/ts/tally/results.js +44 -0
  92. package/build/ts/tally/results.js.map +1 -0
  93. package/build/ts/tally/types.d.ts +42 -15
  94. package/build/ts/tally/types.d.ts.map +1 -1
  95. package/build/ts/tally/utils.d.ts +3 -3
  96. package/build/ts/tally/utils.d.ts.map +1 -1
  97. package/build/ts/tally/utils.js +10 -10
  98. package/build/ts/tally/utils.js.map +1 -1
  99. package/build/ts/tally/verification.d.ts +1 -1
  100. package/build/ts/tally/verification.d.ts.map +1 -1
  101. package/build/ts/tally/verification.js +10 -10
  102. package/build/ts/tally/verification.js.map +1 -1
  103. package/build/ts/trees/index.d.ts +2 -2
  104. package/build/ts/trees/index.d.ts.map +1 -1
  105. package/build/ts/trees/index.js +3 -1
  106. package/build/ts/trees/index.js.map +1 -1
  107. package/build/ts/trees/stateTree.d.ts +23 -1
  108. package/build/ts/trees/stateTree.d.ts.map +1 -1
  109. package/build/ts/trees/stateTree.js +74 -13
  110. package/build/ts/trees/stateTree.js.map +1 -1
  111. package/build/ts/trees/types.d.ts +10 -1
  112. package/build/ts/trees/types.d.ts.map +1 -1
  113. package/build/ts/user/index.d.ts +2 -2
  114. package/build/ts/user/index.d.ts.map +1 -1
  115. package/build/ts/user/index.js +5 -1
  116. package/build/ts/user/index.js.map +1 -1
  117. package/build/ts/user/joinPoll.d.ts +1 -1
  118. package/build/ts/user/joinPoll.d.ts.map +1 -1
  119. package/build/ts/user/joinPoll.js +11 -11
  120. package/build/ts/user/joinPoll.js.map +1 -1
  121. package/build/ts/user/signup.d.ts +1 -1
  122. package/build/ts/user/signup.d.ts.map +1 -1
  123. package/build/ts/user/signup.js +22 -17
  124. package/build/ts/user/signup.js.map +1 -1
  125. package/build/ts/user/types.d.ts +53 -9
  126. package/build/ts/user/types.d.ts.map +1 -1
  127. package/build/ts/user/utils.d.ts +23 -11
  128. package/build/ts/user/utils.d.ts.map +1 -1
  129. package/build/ts/user/utils.js +72 -43
  130. package/build/ts/user/utils.js.map +1 -1
  131. package/build/ts/utils/params.d.ts +1 -1
  132. package/build/ts/utils/params.d.ts.map +1 -1
  133. package/build/ts/utils/params.js +3 -3
  134. package/build/ts/utils/params.js.map +1 -1
  135. package/build/ts/utils/proofs.d.ts +2 -2
  136. package/build/ts/utils/proofs.d.ts.map +1 -1
  137. package/build/ts/utils/proofs.js +4 -4
  138. package/build/ts/utils/proofs.js.map +1 -1
  139. package/build/ts/utils/types.d.ts +2 -2
  140. package/build/ts/utils/types.d.ts.map +1 -1
  141. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +1 -1
  142. package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -1
  143. package/build/ts/verifyingKeys/checkVerifyingKeys.js +18 -19
  144. package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -1
  145. package/build/ts/verifyingKeys/index.d.ts +2 -2
  146. package/build/ts/verifyingKeys/index.d.ts.map +1 -1
  147. package/build/ts/verifyingKeys/index.js +5 -5
  148. package/build/ts/verifyingKeys/index.js.map +1 -1
  149. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +1 -1
  150. package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -1
  151. package/build/ts/verifyingKeys/setVerifyingKeys.js +39 -40
  152. package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -1
  153. package/build/ts/verifyingKeys/types.d.ts +50 -46
  154. package/build/ts/verifyingKeys/types.d.ts.map +1 -1
  155. package/build/ts/verifyingKeys/utils.d.ts +10 -10
  156. package/build/ts/verifyingKeys/utils.d.ts.map +1 -1
  157. package/build/ts/verifyingKeys/utils.js +75 -60
  158. package/build/ts/verifyingKeys/utils.js.map +1 -1
  159. package/build/ts/vote/generate.d.ts.map +1 -1
  160. package/build/ts/vote/generate.js +3 -3
  161. package/build/ts/vote/generate.js.map +1 -1
  162. package/build/ts/vote/index.d.ts +1 -1
  163. package/build/ts/vote/index.d.ts.map +1 -1
  164. package/build/ts/vote/index.js +2 -2
  165. package/build/ts/vote/index.js.map +1 -1
  166. package/build/ts/vote/invalidate.js +2 -2
  167. package/build/ts/vote/invalidate.js.map +1 -1
  168. package/build/ts/vote/publish.js +12 -12
  169. package/build/ts/vote/publish.js.map +1 -1
  170. package/build/ts/vote/utils.d.ts +1 -1
  171. package/build/ts/vote/utils.d.ts.map +1 -1
  172. package/build/ts/vote/utils.js +3 -3
  173. package/build/ts/vote/utils.js.map +1 -1
  174. package/build/tsconfig.build.tsbuildinfo +1 -1
  175. package/package.json +18 -10
  176. package/build/ts/deploy/vkRegistry.d.ts +0 -7
  177. package/build/ts/deploy/vkRegistry.d.ts.map +0 -1
  178. package/build/ts/deploy/vkRegistry.js +0 -14
  179. package/build/ts/deploy/vkRegistry.js.map +0 -1
  180. package/build/ts/proof/constants.d.ts +0 -17
  181. package/build/ts/proof/constants.d.ts.map +0 -1
  182. package/build/ts/proof/constants.js +0 -20
  183. package/build/ts/proof/constants.js.map +0 -1
@@ -17,22 +17,22 @@ const contracts_2 = require("../utils/contracts");
17
17
  const proveOnChain = async ({ pollId, proofDir, maciAddress, tallyFile, signer, }) => {
18
18
  const deployment = contracts_1.Deployment.getInstance();
19
19
  deployment.setContractNames(contracts_1.EContracts);
20
- const { maci: maciContract, poll: pollContract, messageProcessor: mpContract, tally: tallyContract, } = await (0, utils_1.getPollContracts)({ maciAddress, pollId, signer });
21
- const vkRegistryContractAddress = await tallyContract.vkRegistry();
22
- const [isStateAqMerged, isVkRegistryExists] = await Promise.all([
20
+ const { maci: maciContract, poll: pollContract, messageProcessor: messageProcessorContract, tally: tallyContract, } = await (0, utils_1.getPollContracts)({ maciAddress, pollId, signer });
21
+ const verifyingKeysRegistryContractAddress = await tallyContract.verifyingKeysRegistry();
22
+ const [isStateAqMerged, isVerifyingKeyRegistryExists] = await Promise.all([
23
23
  pollContract.stateMerged(),
24
- (0, contracts_2.contractExists)(signer.provider, vkRegistryContractAddress),
24
+ (0, contracts_2.contractExists)(signer.provider, verifyingKeysRegistryContractAddress),
25
25
  ]);
26
- if (!isVkRegistryExists) {
27
- throw new Error("There is no VkRegistry contract linked to the specified MACI contract.");
26
+ if (!isVerifyingKeyRegistryExists) {
27
+ throw new Error("There is no VerifyingKeysRegistry contract linked to the specified MACI contract.");
28
28
  }
29
- const vkRegistryContract = await deployment.getContract({
30
- name: contracts_1.EContracts.VkRegistry,
31
- address: vkRegistryContractAddress,
32
- abi: typechain_types_1.VkRegistry__factory.abi,
29
+ const verifyingKeysRegistryContract = await deployment.getContract({
30
+ name: contracts_1.EContracts.VerifyingKeysRegistry,
31
+ address: verifyingKeysRegistryContractAddress,
32
+ abi: typechain_types_1.VerifyingKeysRegistry__factory.abi,
33
33
  signer,
34
34
  });
35
- const verifierContractAddress = await mpContract.verifier();
35
+ const verifierContractAddress = await messageProcessorContract.verifier();
36
36
  const isVerifierExists = await (0, contracts_2.contractExists)(signer.provider, verifierContractAddress);
37
37
  if (!isVerifierExists) {
38
38
  throw new Error("There is no Verifier contract linked to the specified MACI contract.");
@@ -59,9 +59,9 @@ const proveOnChain = async ({ pollId, proofDir, maciAddress, tallyFile, signer,
59
59
  data.tallyProofs = await (0, contracts_1.readProofs)({ files, folder: proofDir, type: "tally" });
60
60
  const prover = new contracts_1.Prover({
61
61
  maciContract,
62
- mpContract,
62
+ messageProcessorContract,
63
63
  pollContract,
64
- vkRegistryContract,
64
+ verifyingKeysRegistryContract,
65
65
  verifierContract,
66
66
  tallyContract,
67
67
  });
@@ -1 +1 @@
1
- {"version":3,"file":"prove.js","sourceRoot":"","sources":["../../../ts/proof/prove.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAqC;AACrC,wDAAsF;AACtF,8EAKkD;AAElD,4CAAoB;AAKpB,yCAAiD;AACjD,kDAAoD;AAEpD;;;GAGG;AACI,MAAM,YAAY,GAAG,KAAK,EAAE,EACjC,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,GACY,EAAmC,EAAE;IACvD,MAAM,UAAU,GAAG,sBAAU,CAAC,WAAW,EAAE,CAAC;IAC5C,UAAU,CAAC,gBAAgB,CAAC,sBAAU,CAAC,CAAC;IAExC,MAAM,EACJ,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,YAAY,EAClB,gBAAgB,EAAE,UAAU,EAC5B,KAAK,EAAE,aAAa,GACrB,GAAG,MAAM,IAAA,wBAAgB,EAAC,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAE5D,MAAM,yBAAyB,GAAG,MAAM,aAAa,CAAC,UAAU,EAAE,CAAC;IACnE,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC9D,YAAY,CAAC,WAAW,EAAE;QAC1B,IAAA,0BAAc,EAAC,MAAM,CAAC,QAAS,EAAE,yBAAyB,CAAC;KAC5D,CAAC,CAAC;IAEH,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;IAC5F,CAAC;IAED,MAAM,kBAAkB,GAAG,MAAM,UAAU,CAAC,WAAW,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,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAEnF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAzFW,QAAA,YAAY,gBAyFvB"}
@@ -1,6 +1,6 @@
1
1
  import type { ITallyData } from "../tally/types";
2
2
  import type { Groth16Proof, SnarkProof } from "@maci-protocol/contracts";
3
- import type { CircuitInputs } from "@maci-protocol/core";
3
+ import type { EMode, TCircuitInputs } from "@maci-protocol/core";
4
4
  import type { BigNumberish, Signer } from "ethers";
5
5
  import type { PublicSignals } from "snarkjs";
6
6
  /**
@@ -39,14 +39,14 @@ export interface IProof {
39
39
  /**
40
40
  * Circuit inputs
41
41
  */
42
- circuitInputs: CircuitInputs;
42
+ circuitInputs: TCircuitInputs;
43
43
  /**
44
44
  * Public signals
45
45
  */
46
46
  publicInputs: PublicSignals;
47
47
  }
48
48
  /**
49
- * Arguments for the genProofs function
49
+ * Arguments for the generateProofs function
50
50
  */
51
51
  export interface IGenerateProofsArgs {
52
52
  /**
@@ -100,15 +100,15 @@ export interface IGenerateProofsArgs {
100
100
  /**
101
101
  * The path to the process dat file
102
102
  */
103
- processDatFile?: string;
103
+ messageProcessorWitnessDatFile?: string;
104
104
  /**
105
105
  * The path to the tally dat file
106
106
  */
107
- tallyDatFile?: string;
107
+ voteTallyWitnessDatFile?: string;
108
108
  /**
109
109
  * The use quadratic voting
110
110
  */
111
- useQuadraticVoting: boolean;
111
+ mode: EMode;
112
112
  /**
113
113
  * Whether to use wasm or rapidsnark
114
114
  */
@@ -116,27 +116,27 @@ export interface IGenerateProofsArgs {
116
116
  /**
117
117
  * The tally zkey
118
118
  */
119
- tallyZkey: string;
119
+ voteTallyZkey: string;
120
120
  /**
121
- * The tally witgen
121
+ * The tally witness generator
122
122
  */
123
- tallyWitgen?: string;
123
+ voteTallyWitnessGenerator?: string;
124
124
  /**
125
125
  * The tally wasm
126
126
  */
127
- tallyWasm?: string;
127
+ voteTallyWasm?: string;
128
128
  /**
129
129
  * The process zkey
130
130
  */
131
- processZkey: string;
131
+ messageProcessorZkey: string;
132
132
  /**
133
- * The process witgen
133
+ * The process witness generator
134
134
  */
135
- processWitgen?: string;
135
+ messageProcessorWitnessGenerator?: string;
136
136
  /**
137
137
  * The process wasm
138
138
  */
139
- processWasm?: string;
139
+ messageProcessorWasm?: string;
140
140
  /**
141
141
  * The tally file
142
142
  */
@@ -172,4 +172,30 @@ export interface IPollJoiningArtifacts {
172
172
  */
173
173
  wasm: Uint8Array;
174
174
  }
175
+ /**
176
+ * The url of the poll joining artifacts
177
+ */
178
+ export interface IPollJoiningArtifactsUrl {
179
+ /**
180
+ * The url of the poll joining zkey
181
+ */
182
+ zKeyUrl: string;
183
+ /**
184
+ * The url of the poll joining wasm
185
+ */
186
+ wasmUrl: string;
187
+ }
188
+ /**
189
+ * The arguments to download the poll joining artifacts for the browser
190
+ */
191
+ export interface IDownloadPollJoiningArtifactsBrowserArgs {
192
+ /**
193
+ * The depth of the state tree
194
+ */
195
+ stateTreeDepth: number;
196
+ /**
197
+ * Whether to download the testing artifacts
198
+ */
199
+ testing?: boolean;
200
+ }
175
201
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/proof/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QA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E,MAAM,CAAC;IAE9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE,CAAC;IAExB;;OAEG;IACH,WAAW,EAAE,MAAM,EAAE,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,UAAU,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;IAEjB;;OAEG;IACH,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,wCAAwC;IACvD;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,10 @@
1
+ import type { IPollJoiningArtifactsUrl } from "./types";
2
+ /**
3
+ * Get the url of the poll joining artifacts
4
+ *
5
+ * @param testing - Whether to get the testing artifacts
6
+ * @param stateTreeDepth - The depth of the state tree
7
+ * @returns The url of the poll joining artifacts
8
+ */
9
+ export declare const getPollJoiningArtifactsUrl: (testing: boolean, stateTreeDepth: number) => IPollJoiningArtifactsUrl;
10
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/proof/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GAAI,SAAS,OAAO,EAAE,gBAAgB,MAAM,KAAG,wBAYrF,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPollJoiningArtifactsUrl = void 0;
4
+ /**
5
+ * Get the url of the poll joining artifacts
6
+ *
7
+ * @param testing - Whether to get the testing artifacts
8
+ * @param stateTreeDepth - The depth of the state tree
9
+ * @returns The url of the poll joining artifacts
10
+ */
11
+ const getPollJoiningArtifactsUrl = (testing, stateTreeDepth) => {
12
+ if (testing) {
13
+ return {
14
+ zKeyUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/testing/PollJoining_${stateTreeDepth}_test.0.zkey`,
15
+ wasmUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/testing/PollJoining_${stateTreeDepth}_test.wasm`,
16
+ };
17
+ }
18
+ return {
19
+ zKeyUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/production/PollJoining_${stateTreeDepth}.0.zkey`,
20
+ wasmUrl: `https://maci-develop-fra.s3.eu-central-1.amazonaws.com/v3.0.0/browser-poll-join/production/PollJoining_${stateTreeDepth}.wasm`,
21
+ };
22
+ };
23
+ exports.getPollJoiningArtifactsUrl = getPollJoiningArtifactsUrl;
24
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/proof/utils.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACI,MAAM,0BAA0B,GAAG,CAAC,OAAgB,EAAE,cAAsB,EAA4B,EAAE;IAC/G,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO;YACL,OAAO,EAAE,uGAAuG,cAAc,cAAc;YAC5I,OAAO,EAAE,uGAAuG,cAAc,YAAY;SAC3I,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,0GAA0G,cAAc,SAAS;QAC1I,OAAO,EAAE,0GAA0G,cAAc,OAAO;KACzI,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,0BAA0B,8BAYrC"}
@@ -56,7 +56,7 @@ exports.getMessageBatches = getMessageBatches;
56
56
  */
57
57
  const relayMessages = async ({ maciAddress, pollId, ipfsHash, messages, signer, provider, }) => {
58
58
  const { poll: pollContract } = await (0, utils_1.getPollContracts)({ maciAddress, pollId, signer, provider });
59
- const messageHashes = await Promise.all(messages.map(({ data, publicKey }) => pollContract.hashMessageAndEncPubKey({ data }, { x: publicKey[0], y: publicKey[1] })));
59
+ const messageHashes = await Promise.all(messages.map(({ data, publicKey }) => pollContract.hashMessageAndPublicKey({ data }, { x: publicKey[0], y: publicKey[1] })));
60
60
  const receipt = await pollContract.relayMessagesBatch(messageHashes, ipfsHash).then((tx) => tx.wait());
61
61
  return {
62
62
  hash: receipt?.hash,
@@ -0,0 +1,3 @@
1
+ export * from "./maciSubgraph";
2
+ export type { GraphQLResponse } from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/subgraph/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,18 @@
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
+ __exportStar(require("./maciSubgraph"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/subgraph/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B"}
@@ -0,0 +1,28 @@
1
+ import { PublicKey } from "@maci-protocol/domainobjs";
2
+ /**
3
+ * A class that can be used to interact with MACI's subgraph
4
+ * @dev refer to apps/subgraph for subgraph deployment and configuration
5
+ */
6
+ export declare class MaciSubgraph {
7
+ /**
8
+ * The URL of the subgraph
9
+ */
10
+ private url;
11
+ /**
12
+ * The query to get all MACIs public keys signed up
13
+ */
14
+ private userQuery;
15
+ /**
16
+ * Create a new instance of the MaciSubgraph class
17
+ *
18
+ * @param url - The URL of the subgraph
19
+ */
20
+ constructor(url: string);
21
+ /**
22
+ * Get the public keys of all MACIs signed up
23
+ *
24
+ * @returns Array of public keys
25
+ */
26
+ getKeys(): Promise<PublicKey[]>;
27
+ }
28
+ //# sourceMappingURL=maciSubgraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maciSubgraph.d.ts","sourceRoot":"","sources":["../../../ts/subgraph/maciSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAItD;;;GAGG;AACH,qBAAa,YAAY;IACvB;;OAEG;IACH,OAAO,CAAC,GAAG,CAAS;IAEpB;;OAEG;IACH,OAAO,CAAC,SAAS,CAMb;IAEJ;;;;OAIG;gBACS,GAAG,EAAE,MAAM;IAIvB;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;CAgCtC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaciSubgraph = void 0;
4
+ const domainobjs_1 = require("@maci-protocol/domainobjs");
5
+ /**
6
+ * A class that can be used to interact with MACI's subgraph
7
+ * @dev refer to apps/subgraph for subgraph deployment and configuration
8
+ */
9
+ class MaciSubgraph {
10
+ /**
11
+ * Create a new instance of the MaciSubgraph class
12
+ *
13
+ * @param url - The URL of the subgraph
14
+ */
15
+ constructor(url) {
16
+ /**
17
+ * The query to get all MACIs public keys signed up
18
+ */
19
+ this.userQuery = `
20
+ query {
21
+ users {
22
+ id
23
+ }
24
+ }
25
+ `;
26
+ this.url = url;
27
+ }
28
+ /**
29
+ * Get the public keys of all MACIs signed up
30
+ *
31
+ * @returns Array of public keys
32
+ */
33
+ async getKeys() {
34
+ const res = await fetch(this.url, {
35
+ method: "POST",
36
+ body: JSON.stringify({
37
+ query: this.userQuery,
38
+ }),
39
+ headers: {
40
+ "Content-Type": "application/json",
41
+ Accept: "application/json",
42
+ },
43
+ });
44
+ if (!res.ok) {
45
+ throw new Error(`GraphQL query failed: ${res.statusText}`);
46
+ }
47
+ const json = (await res.json());
48
+ if (json.errors) {
49
+ throw new Error(`GraphQL errors: ${JSON.stringify(json.errors)}`);
50
+ }
51
+ if (!json.data?.users) {
52
+ throw new Error("No users data in response");
53
+ }
54
+ return json.data.users.map((user) => {
55
+ // Split the id into x and y coordinates and convert to BigInt
56
+ const [x, y] = user.id.split(" ");
57
+ return new domainobjs_1.PublicKey([BigInt(x), BigInt(y)]);
58
+ });
59
+ }
60
+ }
61
+ exports.MaciSubgraph = MaciSubgraph;
62
+ //# sourceMappingURL=maciSubgraph.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maciSubgraph.js","sourceRoot":"","sources":["../../../ts/subgraph/maciSubgraph.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAItD;;;GAGG;AACH,MAAa,YAAY;IAiBvB;;;;OAIG;IACH,YAAY,GAAW;QAhBvB;;WAEG;QACK,cAAS,GAAG;;;;;;KAMjB,CAAC;QAQF,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACjB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YAChC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,KAAK,EAAE,IAAI,CAAC,SAAS;aACtB,CAAC;YACF,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAoB,CAAC;QAEnD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,mBAAmB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YAClC,8DAA8D;YAC9D,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClC,OAAO,IAAI,sBAAS,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/DD,oCA+DC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * The response from the GraphQL query
3
+ */
4
+ export interface GraphQLResponse {
5
+ /**
6
+ * The data from the query
7
+ */
8
+ data?: {
9
+ users: {
10
+ id: string;
11
+ }[];
12
+ };
13
+ /**
14
+ * The errors from the query
15
+ */
16
+ errors?: {
17
+ message: string;
18
+ }[];
19
+ }
20
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../ts/subgraph/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,IAAI,CAAC,EAAE;QACL,KAAK,EAAE;YACL,EAAE,EAAE,MAAM,CAAC;SACZ,EAAE,CAAC;KACL,CAAC;IACF;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL"}
@@ -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/subgraph/types.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"commitments.d.ts","sourceRoot":"","sources":["../../../ts/tally/commitments.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,qCAGtC,6BAA6B,KAAG,iBAyClC,CAAC"}
1
+ {"version":3,"file":"commitments.d.ts","sourceRoot":"","sources":["../../../ts/tally/commitments.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,GAAI,qCAGtC,6BAA6B,KAAG,iBAyClC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateTallyCommitments = void 0;
4
+ const core_1 = require("@maci-protocol/core");
4
5
  const crypto_1 = require("@maci-protocol/crypto");
5
6
  /**
6
7
  * Generate the tally commitments for this current batch of proving
@@ -10,22 +11,22 @@ const crypto_1 = require("@maci-protocol/crypto");
10
11
  */
11
12
  const generateTallyCommitments = ({ tallyData, voteOptionTreeDepth, }) => {
12
13
  // compute newResultsCommitment
13
- const newResultsCommitment = (0, crypto_1.genTreeCommitment)(tallyData.results.tally.map((x) => BigInt(x)), BigInt(tallyData.results.salt), voteOptionTreeDepth);
14
+ const newResultsCommitment = (0, crypto_1.generateTreeCommitment)(tallyData.results.tally.map((x) => BigInt(x)), BigInt(tallyData.results.salt), voteOptionTreeDepth);
14
15
  // compute newSpentVoiceCreditsCommitment
15
16
  const newSpentVoiceCreditsCommitment = (0, crypto_1.hash2)([
16
17
  BigInt(tallyData.totalSpentVoiceCredits.spent),
17
18
  BigInt(tallyData.totalSpentVoiceCredits.salt),
18
19
  ]);
19
20
  let newTallyCommitment;
20
- let newPerVOSpentVoiceCreditsCommitment;
21
- if (tallyData.isQuadratic) {
22
- // compute newPerVOSpentVoiceCreditsCommitment
23
- newPerVOSpentVoiceCreditsCommitment = (0, crypto_1.genTreeCommitment)(tallyData.perVOSpentVoiceCredits.tally.map((x) => BigInt(x)), BigInt(tallyData.perVOSpentVoiceCredits.salt), voteOptionTreeDepth);
21
+ let newPerVoteOptionSpentVoiceCreditsCommitment;
22
+ if (tallyData.mode === core_1.EMode.QV) {
23
+ // compute newPerVoteOptionSpentVoiceCreditsCommitment
24
+ newPerVoteOptionSpentVoiceCreditsCommitment = (0, crypto_1.generateTreeCommitment)(tallyData.perVoteOptionSpentVoiceCredits.tally.map((x) => BigInt(x)), BigInt(tallyData.perVoteOptionSpentVoiceCredits.salt), voteOptionTreeDepth);
24
25
  // compute newTallyCommitment
25
26
  newTallyCommitment = (0, crypto_1.hash3)([
26
27
  newResultsCommitment,
27
28
  newSpentVoiceCreditsCommitment,
28
- newPerVOSpentVoiceCreditsCommitment,
29
+ newPerVoteOptionSpentVoiceCreditsCommitment,
29
30
  ]);
30
31
  }
31
32
  else {
@@ -34,7 +35,7 @@ const generateTallyCommitments = ({ tallyData, voteOptionTreeDepth, }) => {
34
35
  return {
35
36
  newTallyCommitment,
36
37
  newSpentVoiceCreditsCommitment,
37
- newPerVOSpentVoiceCreditsCommitment,
38
+ newPerVoteOptionSpentVoiceCreditsCommitment,
38
39
  newResultsCommitment,
39
40
  };
40
41
  };
@@ -1 +1 @@
1
- {"version":3,"file":"commitments.js","sourceRoot":"","sources":["../../../ts/tally/commitments.ts"],"names":[],"mappings":";;;AAAA,kDAAuF;AAIvF;;;;;GAKG;AACI,MAAM,wBAAwB,GAAG,CAAC,EACvC,SAAS,EACT,mBAAmB,GACW,EAAqB,EAAE;IACrD,+BAA+B;IAC/B,MAAM,oBAAoB,GAAG,IAAA,0BAAiB,EAC5C,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC7C,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAC9B,mBAAmB,CACpB,CAAC;IAEF,yCAAyC;IACzC,MAAM,8BAA8B,GAAG,IAAA,cAAK,EAAC;QAC3C,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,KAAK,CAAC;QAC9C,MAAM,CAAC,SAAS,CAAC,sBAAsB,CAAC,IAAI,CAAC;KAC9C,CAAC,CAAC;IAEH,IAAI,kBAA0B,CAAC;IAC/B,IAAI,mCAAuD,CAAC;IAE5D,IAAI,SAAS,CAAC,WAAW,EAAE,CAAC;QAC1B,8CAA8C;QAC9C,mCAAmC,GAAG,IAAA,0BAAiB,EACrD,SAAS,CAAC,sBAAuB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAC7D,MAAM,CAAC,SAAS,CAAC,sBAAuB,CAAC,IAAI,CAAC,EAC9C,mBA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AAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EACrE,MAAM,CAAC,SAAS,CAAC,8BAA+B,CAAC,IAAI,CAAC,EACtD,mBAAmB,CACpB,CAAC;QAEF,6BAA6B;QAC7B,kBAAkB,GAAG,IAAA,cAAK,EAAC;YACzB,oBAAoB;YACpB,8BAA8B;YAC9B,2CAA2C;SAC5C,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,kBAAkB,GAAG,IAAA,sBAAa,EAAC,oBAAoB,EAAE,8BAA8B,CAAC,CAAC;IAC3F,CAAC;IAED,OAAO;QACL,kBAAkB;QAClB,8BAA8B;QAC9B,2CAA2C;QAC3C,oBAAoB;KACrB,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,wBAAwB,4BA4CnC"}
@@ -1,4 +1,5 @@
1
1
  export { generateTallyCommitments } from "./commitments";
2
2
  export { verify } from "./verification";
3
- export type { ITallyData, IVerifyArgs, IGenerateTallyCommitmentsArgs, ITallyCommitments, ITallyVotesInputs, } from "./types";
3
+ export type { ITallyData, IVerifyArgs, IGenerateTallyCommitmentsArgs, ITallyCommitments, IVoteTallyInputs, IGetResultPerOptionArgs, IGetResultsArgs, } from "./types";
4
+ export { getResultPerOption, getResults } from "./results";
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/tally/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EACV,UAAU,EACV,WAAW,EACX,6BAA6B,EAC7B,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/tally/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,YAAY,EACV,UAAU,EACV,WAAW,EACX,6BAA6B,EAC7B,iBAAiB,EACjB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC"}
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verify = exports.generateTallyCommitments = void 0;
3
+ exports.getResults = exports.getResultPerOption = exports.verify = exports.generateTallyCommitments = void 0;
4
4
  var commitments_1 = require("./commitments");
5
5
  Object.defineProperty(exports, "generateTallyCommitments", { enumerable: true, get: function () { return commitments_1.generateTallyCommitments; } });
6
6
  var verification_1 = require("./verification");
7
7
  Object.defineProperty(exports, "verify", { enumerable: true, get: function () { return verification_1.verify; } });
8
+ var results_1 = require("./results");
9
+ Object.defineProperty(exports, "getResultPerOption", { enumerable: true, get: function () { return results_1.getResultPerOption; } });
10
+ Object.defineProperty(exports, "getResults", { enumerable: true, get: function () { return results_1.getResults; } });
8
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/tally/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAAhD,uHAAA,wBAAwB,OAAA;AACjC,+CAAwC;AAA/B,sGAAA,MAAM,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/tally/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyD;AAAhD,uHAAA,wBAAwB,OAAA;AACjC,+CAAwC;AAA/B,sGAAA,MAAM,OAAA;AAUf,qCAA2D;AAAlD,6GAAA,kBAAkB,OAAA;AAAE,qGAAA,UAAU,OAAA"}
@@ -0,0 +1,14 @@
1
+ import type { IGetResultPerOptionArgs, IGetResultsArgs } from "./types";
2
+ /**
3
+ * Get result per option
4
+ * @param {IGetResultPerOptionsArgs} - The arguments to get result per option
5
+ * @returns The result per option
6
+ */
7
+ export declare const getResultPerOption: ({ maciAddress, pollId, index, signer, }: IGetResultPerOptionArgs) => Promise<bigint>;
8
+ /**
9
+ * Get all results from the Tally contract
10
+ * @param {IGetResultsArgs} - The arguments to get all the results
11
+ * @returns The results array (The final result of vote option n is in index n-1)
12
+ */
13
+ export declare const getResults: ({ maciAddress, pollId, signer }: IGetResultsArgs) => Promise<bigint[]>;
14
+ //# sourceMappingURL=results.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../ts/tally/results.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAExE;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAU,yCAKtC,uBAAuB,KAAG,OAAO,CAAC,MAAM,CAc1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAU,iCAAiC,eAAe,KAAG,OAAO,CAAC,MAAM,EAAE,CAwBnG,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getResults = exports.getResultPerOption = void 0;
4
+ const typechain_types_1 = require("@maci-protocol/contracts/typechain-types");
5
+ /**
6
+ * Get result per option
7
+ * @param {IGetResultPerOptionsArgs} - The arguments to get result per option
8
+ * @returns The result per option
9
+ */
10
+ const getResultPerOption = async ({ maciAddress, pollId, index, signer, }) => {
11
+ const maciContract = typechain_types_1.MACI__factory.connect(maciAddress, signer);
12
+ const pollContracts = await maciContract.getPoll(pollId);
13
+ const tallyContract = typechain_types_1.Tally__factory.connect(pollContracts.tally, signer);
14
+ const result = await tallyContract.tallyResults(index);
15
+ if (!result.flag) {
16
+ throw new Error("Tally result is not set");
17
+ }
18
+ return result.value;
19
+ };
20
+ exports.getResultPerOption = getResultPerOption;
21
+ /**
22
+ * Get all results from the Tally contract
23
+ * @param {IGetResultsArgs} - The arguments to get all the results
24
+ * @returns The results array (The final result of vote option n is in index n-1)
25
+ */
26
+ const getResults = async ({ maciAddress, pollId, signer }) => {
27
+ const maciContract = typechain_types_1.MACI__factory.connect(maciAddress, signer);
28
+ const pollContracts = await maciContract.getPoll(pollId);
29
+ const pollContract = typechain_types_1.Poll__factory.connect(pollContracts.poll, signer);
30
+ const numberOfVoteOptions = await pollContract.voteOptions();
31
+ const tallyContract = typechain_types_1.Tally__factory.connect(pollContracts.tally, signer);
32
+ const results = [];
33
+ for (let i = 0; i < numberOfVoteOptions; i += 1) {
34
+ // eslint-disable-next-line no-await-in-loop
35
+ const result = await tallyContract.tallyResults(i);
36
+ if (!result.flag) {
37
+ throw new Error(`Tally result for option ${i} is not set`);
38
+ }
39
+ results.push(result.value);
40
+ }
41
+ return results;
42
+ };
43
+ exports.getResults = getResults;
44
+ //# sourceMappingURL=results.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"results.js","sourceRoot":"","sources":["../../../ts/tally/results.ts"],"names":[],"mappings":";;;AAAA,8EAIkD;AAIlD;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,KAAK,EAAE,EACvC,WAAW,EACX,MAAM,EACN,KAAK,EACL,MAAM,GACkB,EAAmB,EAAE;IAC7C,MAAM,YAAY,GAAG,+BAAW,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAE9D,MAAM,aAAa,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAEzD,MAAM,aAAa,GAAG,gCAAY,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAEvD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,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