@maci-protocol/sdk 0.0.0-ci.4c6d4e8 → 0.0.0-ci.4d0e3a3
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.
- package/CHANGELOG.md +155 -0
- package/LICENSE +1 -2
- package/build/package.json +18 -10
- package/build/ts/browser/index.d.ts +4 -2
- package/build/ts/browser/index.d.ts.map +1 -1
- package/build/ts/browser/index.js +7 -1
- package/build/ts/browser/index.js.map +1 -1
- package/build/ts/browser/joinPoll.d.ts +4 -2
- package/build/ts/browser/joinPoll.d.ts.map +1 -1
- package/build/ts/browser/joinPoll.js +21 -17
- package/build/ts/browser/joinPoll.js.map +1 -1
- package/build/ts/browser/utils.d.ts +2 -2
- package/build/ts/browser/utils.d.ts.map +1 -1
- package/build/ts/browser/utils.js +3 -3
- package/build/ts/browser/utils.js.map +1 -1
- package/build/ts/deploy/index.d.ts +2 -2
- package/build/ts/deploy/index.d.ts.map +1 -1
- package/build/ts/deploy/index.js +3 -3
- package/build/ts/deploy/index.js.map +1 -1
- package/build/ts/deploy/maci.d.ts +1 -1
- package/build/ts/deploy/maci.d.ts.map +1 -1
- package/build/ts/deploy/maci.js +18 -8
- package/build/ts/deploy/maci.js.map +1 -1
- package/build/ts/deploy/poll.d.ts +1 -1
- package/build/ts/deploy/poll.d.ts.map +1 -1
- package/build/ts/deploy/poll.js +9 -11
- package/build/ts/deploy/poll.js.map +1 -1
- package/build/ts/deploy/types.d.ts +25 -16
- package/build/ts/deploy/types.d.ts.map +1 -1
- package/build/ts/deploy/utils.js +1 -1
- package/build/ts/deploy/utils.js.map +1 -1
- package/build/ts/deploy/verifyingKeysRegistry.d.ts +7 -0
- package/build/ts/deploy/verifyingKeysRegistry.d.ts.map +1 -0
- package/build/ts/deploy/verifyingKeysRegistry.js +14 -0
- package/build/ts/deploy/verifyingKeysRegistry.js.map +1 -0
- package/build/ts/index.d.ts +3 -2
- package/build/ts/index.d.ts.map +1 -1
- package/build/ts/index.js +16 -9
- package/build/ts/index.js.map +1 -1
- package/build/ts/maci/state.d.ts +1 -1
- package/build/ts/maci/state.js +8 -8
- package/build/ts/maci/state.js.map +1 -1
- package/build/ts/maci/types.d.ts +1 -1
- package/build/ts/maciKeys/__tests__/keypair.test.js +7 -7
- package/build/ts/maciKeys/__tests__/keypair.test.js.map +1 -1
- package/build/ts/maciKeys/__tests__/publicKeys.test.js +7 -7
- package/build/ts/maciKeys/__tests__/publicKeys.test.js.map +1 -1
- package/build/ts/maciKeys/keypair.d.ts.map +1 -1
- package/build/ts/maciKeys/keypair.js +4 -3
- package/build/ts/maciKeys/keypair.js.map +1 -1
- package/build/ts/maciKeys/publicKeys.d.ts +2 -2
- package/build/ts/maciKeys/publicKeys.d.ts.map +1 -1
- package/build/ts/maciKeys/publicKeys.js +6 -6
- package/build/ts/maciKeys/publicKeys.js.map +1 -1
- package/build/ts/maciKeys/types.d.ts +5 -0
- package/build/ts/maciKeys/types.d.ts.map +1 -1
- package/build/ts/poll/poll.d.ts.map +1 -1
- package/build/ts/poll/poll.js +16 -10
- package/build/ts/poll/poll.js.map +1 -1
- package/build/ts/poll/types.d.ts +10 -6
- package/build/ts/poll/types.d.ts.map +1 -1
- package/build/ts/proof/__tests__/download.test.js +8 -5
- package/build/ts/proof/__tests__/download.test.js.map +1 -1
- package/build/ts/proof/download.d.ts +3 -3
- package/build/ts/proof/download.d.ts.map +1 -1
- package/build/ts/proof/download.js +5 -7
- package/build/ts/proof/download.js.map +1 -1
- package/build/ts/proof/generate.d.ts +2 -2
- package/build/ts/proof/generate.d.ts.map +1 -1
- package/build/ts/proof/generate.js +29 -23
- package/build/ts/proof/generate.js.map +1 -1
- package/build/ts/proof/prove.d.ts +1 -1
- package/build/ts/proof/prove.d.ts.map +1 -1
- package/build/ts/proof/prove.js +26 -16
- package/build/ts/proof/prove.js.map +1 -1
- package/build/ts/proof/types.d.ts +44 -14
- package/build/ts/proof/types.d.ts.map +1 -1
- package/build/ts/proof/utils.d.ts +10 -0
- package/build/ts/proof/utils.d.ts.map +1 -0
- package/build/ts/proof/utils.js +24 -0
- package/build/ts/proof/utils.js.map +1 -0
- package/build/ts/relayer/__tests__/messages.test.js +1 -1
- package/build/ts/relayer/__tests__/messages.test.js.map +1 -1
- package/build/ts/relayer/__tests__/utils.test.js +3 -3
- package/build/ts/relayer/__tests__/utils.test.js.map +1 -1
- package/build/ts/relayer/messages.js +1 -1
- package/build/ts/relayer/utils.js +1 -1
- package/build/ts/relayer/utils.js.map +1 -1
- package/build/ts/subgraph/index.d.ts +3 -0
- package/build/ts/subgraph/index.d.ts.map +1 -0
- package/build/ts/subgraph/index.js +18 -0
- package/build/ts/subgraph/index.js.map +1 -0
- package/build/ts/subgraph/maciSubgraph.d.ts +28 -0
- package/build/ts/subgraph/maciSubgraph.d.ts.map +1 -0
- package/build/ts/subgraph/maciSubgraph.js +64 -0
- package/build/ts/subgraph/maciSubgraph.js.map +1 -0
- package/build/ts/subgraph/types.d.ts +20 -0
- package/build/ts/subgraph/types.d.ts.map +1 -0
- package/build/ts/subgraph/types.js +3 -0
- package/build/ts/subgraph/types.js.map +1 -0
- package/build/ts/tally/commitments.d.ts.map +1 -1
- package/build/ts/tally/commitments.js +8 -7
- package/build/ts/tally/commitments.js.map +1 -1
- package/build/ts/tally/index.d.ts +2 -1
- package/build/ts/tally/index.d.ts.map +1 -1
- package/build/ts/tally/index.js +5 -1
- package/build/ts/tally/index.js.map +1 -1
- package/build/ts/tally/results.d.ts +20 -0
- package/build/ts/tally/results.d.ts.map +1 -0
- package/build/ts/tally/results.js +49 -0
- package/build/ts/tally/results.js.map +1 -0
- package/build/ts/tally/types.d.ts +55 -15
- package/build/ts/tally/types.d.ts.map +1 -1
- package/build/ts/tally/utils.d.ts +3 -3
- package/build/ts/tally/utils.d.ts.map +1 -1
- package/build/ts/tally/utils.js +10 -10
- package/build/ts/tally/utils.js.map +1 -1
- package/build/ts/tally/verification.d.ts +1 -1
- package/build/ts/tally/verification.d.ts.map +1 -1
- package/build/ts/tally/verification.js +10 -10
- package/build/ts/tally/verification.js.map +1 -1
- package/build/ts/trees/index.d.ts +2 -2
- package/build/ts/trees/index.d.ts.map +1 -1
- package/build/ts/trees/index.js +3 -1
- package/build/ts/trees/index.js.map +1 -1
- package/build/ts/trees/stateTree.d.ts +23 -1
- package/build/ts/trees/stateTree.d.ts.map +1 -1
- package/build/ts/trees/stateTree.js +74 -13
- package/build/ts/trees/stateTree.js.map +1 -1
- package/build/ts/trees/types.d.ts +11 -2
- package/build/ts/trees/types.d.ts.map +1 -1
- package/build/ts/user/index.d.ts +2 -2
- package/build/ts/user/index.d.ts.map +1 -1
- package/build/ts/user/index.js +5 -1
- package/build/ts/user/index.js.map +1 -1
- package/build/ts/user/joinPoll.d.ts +1 -1
- package/build/ts/user/joinPoll.d.ts.map +1 -1
- package/build/ts/user/joinPoll.js +11 -11
- package/build/ts/user/joinPoll.js.map +1 -1
- package/build/ts/user/signup.d.ts +3 -3
- package/build/ts/user/signup.d.ts.map +1 -1
- package/build/ts/user/signup.js +26 -21
- package/build/ts/user/signup.js.map +1 -1
- package/build/ts/user/types.d.ts +65 -21
- package/build/ts/user/types.d.ts.map +1 -1
- package/build/ts/user/utils.d.ts +34 -14
- package/build/ts/user/utils.d.ts.map +1 -1
- package/build/ts/user/utils.js +91 -57
- package/build/ts/user/utils.js.map +1 -1
- package/build/ts/utils/index.d.ts +1 -1
- package/build/ts/utils/index.d.ts.map +1 -1
- package/build/ts/utils/index.js +2 -1
- package/build/ts/utils/index.js.map +1 -1
- package/build/ts/utils/params.d.ts +1 -1
- package/build/ts/utils/params.d.ts.map +1 -1
- package/build/ts/utils/params.js +3 -3
- package/build/ts/utils/params.js.map +1 -1
- package/build/ts/utils/proofs.d.ts +2 -2
- package/build/ts/utils/proofs.d.ts.map +1 -1
- package/build/ts/utils/proofs.js +4 -4
- package/build/ts/utils/proofs.js.map +1 -1
- package/build/ts/utils/types.d.ts +2 -2
- package/build/ts/utils/types.d.ts.map +1 -1
- package/build/ts/utils/utils.d.ts +5 -0
- package/build/ts/utils/utils.d.ts.map +1 -1
- package/build/ts/utils/utils.js +13 -1
- package/build/ts/utils/utils.js.map +1 -1
- package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts +1 -1
- package/build/ts/verifyingKeys/checkVerifyingKeys.d.ts.map +1 -1
- package/build/ts/verifyingKeys/checkVerifyingKeys.js +18 -19
- package/build/ts/verifyingKeys/checkVerifyingKeys.js.map +1 -1
- package/build/ts/verifyingKeys/index.d.ts +2 -2
- package/build/ts/verifyingKeys/index.d.ts.map +1 -1
- package/build/ts/verifyingKeys/index.js +5 -5
- package/build/ts/verifyingKeys/index.js.map +1 -1
- package/build/ts/verifyingKeys/setVerifyingKeys.d.ts +1 -1
- package/build/ts/verifyingKeys/setVerifyingKeys.d.ts.map +1 -1
- package/build/ts/verifyingKeys/setVerifyingKeys.js +70 -47
- package/build/ts/verifyingKeys/setVerifyingKeys.js.map +1 -1
- package/build/ts/verifyingKeys/types.d.ts +52 -48
- package/build/ts/verifyingKeys/types.d.ts.map +1 -1
- package/build/ts/verifyingKeys/utils.d.ts +10 -10
- package/build/ts/verifyingKeys/utils.d.ts.map +1 -1
- package/build/ts/verifyingKeys/utils.js +75 -60
- package/build/ts/verifyingKeys/utils.js.map +1 -1
- package/build/ts/vote/generate.d.ts +1 -1
- package/build/ts/vote/generate.d.ts.map +1 -1
- package/build/ts/vote/generate.js +4 -4
- package/build/ts/vote/generate.js.map +1 -1
- package/build/ts/vote/index.d.ts +2 -1
- package/build/ts/vote/index.d.ts.map +1 -1
- package/build/ts/vote/index.js +4 -2
- package/build/ts/vote/index.js.map +1 -1
- package/build/ts/vote/invalidate.js +4 -4
- package/build/ts/vote/invalidate.js.map +1 -1
- package/build/ts/vote/publish.d.ts +1 -1
- package/build/ts/vote/publish.d.ts.map +1 -1
- package/build/ts/vote/publish.js +19 -19
- package/build/ts/vote/publish.js.map +1 -1
- package/build/ts/vote/submit.js +2 -2
- package/build/ts/vote/submit.js.map +1 -1
- package/build/ts/vote/types.d.ts +6 -6
- package/build/ts/vote/types.d.ts.map +1 -1
- package/build/ts/vote/utils.d.ts +2 -2
- package/build/ts/vote/utils.d.ts.map +1 -1
- package/build/ts/vote/utils.js +5 -5
- package/build/ts/vote/utils.js.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +23 -15
- package/build/ts/deploy/vkRegistry.d.ts +0 -7
- package/build/ts/deploy/vkRegistry.d.ts.map +0 -1
- package/build/ts/deploy/vkRegistry.js +0 -14
- package/build/ts/deploy/vkRegistry.js.map +0 -1
- package/build/ts/proof/constants.d.ts +0 -17
- package/build/ts/proof/constants.d.ts.map +0 -1
- package/build/ts/proof/constants.js +0 -20
- package/build/ts/proof/constants.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,161 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 3.0.0 (2026-06-12)
|
|
7
|
+
|
|
8
|
+
* chore: add logger for contract helpers ([a688400](https://github.com/privacy-scaling-explorations/maci/commit/a688400))
|
|
9
|
+
* chore: add more exports from contracts ([91d946d](https://github.com/privacy-scaling-explorations/maci/commit/91d946d))
|
|
10
|
+
* chore: add publishConfig (#2308) ([26f28d6](https://github.com/privacy-scaling-explorations/maci/commit/26f28d6)), closes [#2308](https://github.com/privacy-scaling-explorations/maci/issues/2308)
|
|
11
|
+
* chore: change assert import ([bf59c7a](https://github.com/privacy-scaling-explorations/maci/commit/bf59c7a))
|
|
12
|
+
* chore: explicity define packages as not private ([1736fec](https://github.com/privacy-scaling-explorations/maci/commit/1736fec))
|
|
13
|
+
* chore: expose sdk function invalidateVotes ([eeab56a](https://github.com/privacy-scaling-explorations/maci/commit/eeab56a))
|
|
14
|
+
* chore: fix multiformat version for sdk ([b765391](https://github.com/privacy-scaling-explorations/maci/commit/b765391))
|
|
15
|
+
* chore: move packages to @maci org (#2286) ([7275509](https://github.com/privacy-scaling-explorations/maci/commit/7275509)), closes [#2286](https://github.com/privacy-scaling-explorations/maci/issues/2286)
|
|
16
|
+
* chore: use type imports ([9da523a](https://github.com/privacy-scaling-explorations/maci/commit/9da523a))
|
|
17
|
+
* chore(deps-dev): bump @types/jest from 29.5.14 to 30.0.0 ([16f466f](https://github.com/privacy-scaling-explorations/maci/commit/16f466f))
|
|
18
|
+
* chore(deps-dev): bump @types/node from 20.17.19 to 22.13.9 ([aa7c356](https://github.com/privacy-scaling-explorations/maci/commit/aa7c356))
|
|
19
|
+
* chore(deps-dev): bump @types/node from 22.10.7 to 22.12.0 (#2073) ([1dcb28e](https://github.com/privacy-scaling-explorations/maci/commit/1dcb28e)), closes [#2073](https://github.com/privacy-scaling-explorations/maci/issues/2073)
|
|
20
|
+
* chore(deps-dev): bump @types/node from 22.12.0 to 22.13.1 ([5f06af0](https://github.com/privacy-scaling-explorations/maci/commit/5f06af0))
|
|
21
|
+
* chore(deps-dev): bump @types/node from 22.13.1 to 22.13.4 ([dba94f4](https://github.com/privacy-scaling-explorations/maci/commit/dba94f4))
|
|
22
|
+
* chore(deps-dev): bump @types/node from 22.13.17 to 22.14.0 ([3434168](https://github.com/privacy-scaling-explorations/maci/commit/3434168))
|
|
23
|
+
* chore(deps-dev): bump @types/node from 22.13.9 to 22.13.10 (#2241) ([3f50bb6](https://github.com/privacy-scaling-explorations/maci/commit/3f50bb6)), closes [#2241](https://github.com/privacy-scaling-explorations/maci/issues/2241)
|
|
24
|
+
* chore(deps-dev): bump @types/node from 22.14.0 to 22.14.1 ([38f0947](https://github.com/privacy-scaling-explorations/maci/commit/38f0947))
|
|
25
|
+
* chore(deps-dev): bump @types/node from 22.14.1 to 22.15.3 ([430d214](https://github.com/privacy-scaling-explorations/maci/commit/430d214))
|
|
26
|
+
* chore(deps-dev): bump @types/node from 22.15.17 to 24.0.1 ([33485a5](https://github.com/privacy-scaling-explorations/maci/commit/33485a5))
|
|
27
|
+
* chore(deps-dev): bump @types/node from 22.15.8 to 22.15.17 ([b144ca2](https://github.com/privacy-scaling-explorations/maci/commit/b144ca2))
|
|
28
|
+
* chore(deps-dev): bump @types/node from 24.0.1 to 24.0.3 ([834943a](https://github.com/privacy-scaling-explorations/maci/commit/834943a))
|
|
29
|
+
* chore(deps-dev): bump @types/node from 24.0.12 to 24.0.13 ([f85b4b1](https://github.com/privacy-scaling-explorations/maci/commit/f85b4b1))
|
|
30
|
+
* chore(deps-dev): bump @types/node from 24.0.13 to 24.2.0 (#2697) ([35e2fb7](https://github.com/privacy-scaling-explorations/maci/commit/35e2fb7)), closes [#2697](https://github.com/privacy-scaling-explorations/maci/issues/2697)
|
|
31
|
+
* chore(deps-dev): bump @types/node from 24.0.3 to 24.0.4 ([a00ce55](https://github.com/privacy-scaling-explorations/maci/commit/a00ce55))
|
|
32
|
+
* chore(deps-dev): bump @types/node from 24.0.4 to 24.0.7 ([fbbe0a7](https://github.com/privacy-scaling-explorations/maci/commit/fbbe0a7))
|
|
33
|
+
* chore(deps-dev): bump @types/node from 24.0.7 to 24.0.12 (#2626) ([5975ca0](https://github.com/privacy-scaling-explorations/maci/commit/5975ca0)), closes [#2626](https://github.com/privacy-scaling-explorations/maci/issues/2626)
|
|
34
|
+
* chore(deps-dev): bump jest from 29.7.0 to 30.0.0 ([7fd6037](https://github.com/privacy-scaling-explorations/maci/commit/7fd6037))
|
|
35
|
+
* chore(deps-dev): bump jest from 30.0.0 to 30.0.3 ([cfc7238](https://github.com/privacy-scaling-explorations/maci/commit/cfc7238))
|
|
36
|
+
* chore(deps-dev): bump jest from 30.0.3 to 30.0.4 (#2615) ([e94886c](https://github.com/privacy-scaling-explorations/maci/commit/e94886c)), closes [#2615](https://github.com/privacy-scaling-explorations/maci/issues/2615)
|
|
37
|
+
* chore(deps-dev): bump jest from 30.0.4 to 30.2.0 ([b020e46](https://github.com/privacy-scaling-explorations/maci/commit/b020e46))
|
|
38
|
+
* chore(deps-dev): bump mocha from 10.8.2 to 11.1.0 ([f524a07](https://github.com/privacy-scaling-explorations/maci/commit/f524a07))
|
|
39
|
+
* chore(deps-dev): bump mocha from 11.1.0 to 11.2.2 ([044ad2e](https://github.com/privacy-scaling-explorations/maci/commit/044ad2e))
|
|
40
|
+
* chore(deps-dev): bump mocha from 11.2.2 to 11.4.0 ([09929d2](https://github.com/privacy-scaling-explorations/maci/commit/09929d2))
|
|
41
|
+
* chore(deps-dev): bump mocha from 11.4.0 to 11.6.0 (#2546) ([54823d2](https://github.com/privacy-scaling-explorations/maci/commit/54823d2)), closes [#2546](https://github.com/privacy-scaling-explorations/maci/issues/2546)
|
|
42
|
+
* chore(deps-dev): bump mocha from 11.6.0 to 11.7.0 ([739b4e5](https://github.com/privacy-scaling-explorations/maci/commit/739b4e5))
|
|
43
|
+
* chore(deps-dev): bump mocha from 11.7.1 to 11.7.2 ([5646026](https://github.com/privacy-scaling-explorations/maci/commit/5646026))
|
|
44
|
+
* chore(deps-dev): bump ts-jest from 29.2.5 to 29.2.6 ([aaf7978](https://github.com/privacy-scaling-explorations/maci/commit/aaf7978))
|
|
45
|
+
* chore(deps-dev): bump ts-jest from 29.2.6 to 29.3.0 (#2293) ([d24dcc5](https://github.com/privacy-scaling-explorations/maci/commit/d24dcc5)), closes [#2293](https://github.com/privacy-scaling-explorations/maci/issues/2293)
|
|
46
|
+
* chore(deps-dev): bump ts-jest from 29.3.1 to 29.3.2 ([2e4cf7e](https://github.com/privacy-scaling-explorations/maci/commit/2e4cf7e))
|
|
47
|
+
* chore(deps-dev): bump ts-jest from 29.3.2 to 29.3.4 ([ff66a03](https://github.com/privacy-scaling-explorations/maci/commit/ff66a03))
|
|
48
|
+
* chore(deps-dev): bump ts-jest from 29.3.4 to 29.4.0 ([0bf8810](https://github.com/privacy-scaling-explorations/maci/commit/0bf8810))
|
|
49
|
+
* chore(deps-dev): bump ts-jest from 29.4.0 to 29.4.1 ([7ce80f9](https://github.com/privacy-scaling-explorations/maci/commit/7ce80f9))
|
|
50
|
+
* chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 ([e37f1bf](https://github.com/privacy-scaling-explorations/maci/commit/e37f1bf))
|
|
51
|
+
* chore(deps-dev): bump typescript from 5.8.2 to 5.8.3 ([048cefc](https://github.com/privacy-scaling-explorations/maci/commit/048cefc))
|
|
52
|
+
* chore(deps-dev): bump typescript from 5.8.3 to 5.9.2 ([17e4a70](https://github.com/privacy-scaling-explorations/maci/commit/17e4a70))
|
|
53
|
+
* chore(deps): bump @types/node to 24.11.0 ([36f727b](https://github.com/privacy-scaling-explorations/maci/commit/36f727b))
|
|
54
|
+
* chore(deps): bump @zk-kit/lean-imt from 2.2.2 to 2.2.3 ([a269d5c](https://github.com/privacy-scaling-explorations/maci/commit/a269d5c))
|
|
55
|
+
* chore(deps): bump @zk-kit/lean-imt from 2.2.3 to 2.2.4 ([cccd882](https://github.com/privacy-scaling-explorations/maci/commit/cccd882))
|
|
56
|
+
* chore(deps): bump ethers from 6.13.5 to 6.13.7 ([ea37135](https://github.com/privacy-scaling-explorations/maci/commit/ea37135))
|
|
57
|
+
* chore(deps): bump ethers from 6.13.7 to 6.14.0 ([e806553](https://github.com/privacy-scaling-explorations/maci/commit/e806553))
|
|
58
|
+
* chore(deps): bump ethers from 6.14.0 to 6.14.3 ([05118f4](https://github.com/privacy-scaling-explorations/maci/commit/05118f4))
|
|
59
|
+
* chore(deps): bump ethers from 6.14.3 to 6.14.4 ([00bccaa](https://github.com/privacy-scaling-explorations/maci/commit/00bccaa))
|
|
60
|
+
* chore(deps): bump ethers from 6.14.4 to 6.15.0 ([525ff51](https://github.com/privacy-scaling-explorations/maci/commit/525ff51))
|
|
61
|
+
* chore(deps): bump multiformats from 9.9.0 to 13.3.2 ([4a9853f](https://github.com/privacy-scaling-explorations/maci/commit/4a9853f))
|
|
62
|
+
* chore(sdk): sort out types for browser export ([0d04a73](https://github.com/privacy-scaling-explorations/maci/commit/0d04a73))
|
|
63
|
+
* feat(sdk,cli): add isOpen status to poll data and improve CLI output ([409e410](https://github.com/privacy-scaling-explorations/maci/commit/409e410))
|
|
64
|
+
* fix: add export without deploy functions (#2284) ([2252806](https://github.com/privacy-scaling-explorations/maci/commit/2252806)), closes [#2284](https://github.com/privacy-scaling-explorations/maci/issues/2284)
|
|
65
|
+
* fix: ensure browser sdk does not import maci-contracts ([c4dc113](https://github.com/privacy-scaling-explorations/maci/commit/c4dc113))
|
|
66
|
+
* fix: ensure invalidVotes uses the correct nonce ([30df559](https://github.com/privacy-scaling-explorations/maci/commit/30df559))
|
|
67
|
+
* fix: ensure is-tallied and totalSignups are correct (#2503) ([6380833](https://github.com/privacy-scaling-explorations/maci/commit/6380833)), closes [#2503](https://github.com/privacy-scaling-explorations/maci/issues/2503)
|
|
68
|
+
* fix: nightly workflows ([0729bfd](https://github.com/privacy-scaling-explorations/maci/commit/0729bfd))
|
|
69
|
+
* fix: nightly workflows ([66a1261](https://github.com/privacy-scaling-explorations/maci/commit/66a1261))
|
|
70
|
+
* fix: under-constrained bug in BinaryMerkleRoot ([4fe3cec](https://github.com/privacy-scaling-explorations/maci/commit/4fe3cec))
|
|
71
|
+
* fix(contracts): poll finalization ([0bd1c78](https://github.com/privacy-scaling-explorations/maci/commit/0bd1c78))
|
|
72
|
+
* fix(sdk): add padKey to array of retrieved MACI public keys ([ffa7055](https://github.com/privacy-scaling-explorations/maci/commit/ffa7055))
|
|
73
|
+
* fix(sdk): remove stateIndex from joinPoll + verify in ETH sepolia ([c48f9f6](https://github.com/privacy-scaling-explorations/maci/commit/c48f9f6))
|
|
74
|
+
* fix(sdk): sort users by creation date in subgraph query (#2664) ([dc8c564](https://github.com/privacy-scaling-explorations/maci/commit/dc8c564)), closes [#2664](https://github.com/privacy-scaling-explorations/maci/issues/2664)
|
|
75
|
+
* fix(sdk): start block before fetching events ([01af3e3](https://github.com/privacy-scaling-explorations/maci/commit/01af3e3))
|
|
76
|
+
* fix(sdk): use full import paths ([d87fb50](https://github.com/privacy-scaling-explorations/maci/commit/d87fb50))
|
|
77
|
+
* fix(sdk): use full path import for sdk users functions (#2354) ([e3476db](https://github.com/privacy-scaling-explorations/maci/commit/e3476db)), closes [#2354](https://github.com/privacy-scaling-explorations/maci/issues/2354)
|
|
78
|
+
* refactor: circuit structure (#2485) ([2cf83db](https://github.com/privacy-scaling-explorations/maci/commit/2cf83db)), closes [#2485](https://github.com/privacy-scaling-explorations/maci/issues/2485)
|
|
79
|
+
* refactor: contract imports and proofs (#2074) ([66dfab7](https://github.com/privacy-scaling-explorations/maci/commit/66dfab7)), closes [#2074](https://github.com/privacy-scaling-explorations/maci/issues/2074)
|
|
80
|
+
* refactor: deploy maci command ([3eb6915](https://github.com/privacy-scaling-explorations/maci/commit/3eb6915))
|
|
81
|
+
* refactor: expand shorthand variables to full names ([75547c0](https://github.com/privacy-scaling-explorations/maci/commit/75547c0))
|
|
82
|
+
* refactor: gen proofs ([7bba1c5](https://github.com/privacy-scaling-explorations/maci/commit/7bba1c5))
|
|
83
|
+
* refactor: join poll sdk ([52607a7](https://github.com/privacy-scaling-explorations/maci/commit/52607a7))
|
|
84
|
+
* refactor: make separate testing package (#2229) ([bd07a7f](https://github.com/privacy-scaling-explorations/maci/commit/bd07a7f)), closes [#2229](https://github.com/privacy-scaling-explorations/maci/issues/2229)
|
|
85
|
+
* refactor: poll deploy sdk (#2189) ([da1b785](https://github.com/privacy-scaling-explorations/maci/commit/da1b785)), closes [#2189](https://github.com/privacy-scaling-explorations/maci/issues/2189)
|
|
86
|
+
* refactor: remove redundant param (#2161) ([2cc986f](https://github.com/privacy-scaling-explorations/maci/commit/2cc986f)), closes [#2161](https://github.com/privacy-scaling-explorations/maci/issues/2161)
|
|
87
|
+
* refactor: rename from short to full names ([120cffa](https://github.com/privacy-scaling-explorations/maci/commit/120cffa))
|
|
88
|
+
* refactor: setVerifyingKeys ([8ce195b](https://github.com/privacy-scaling-explorations/maci/commit/8ce195b))
|
|
89
|
+
* refactor: test suite cleanup (#2233) (#2232) ([0d42bb0](https://github.com/privacy-scaling-explorations/maci/commit/0d42bb0)), closes [#2233](https://github.com/privacy-scaling-explorations/maci/issues/2233) [#2232](https://github.com/privacy-scaling-explorations/maci/issues/2232)
|
|
90
|
+
* refactor: user sdk (#2064) ([aac1ce7](https://github.com/privacy-scaling-explorations/maci/commit/aac1ce7)), closes [#2064](https://github.com/privacy-scaling-explorations/maci/issues/2064)
|
|
91
|
+
* refactor: verifying keys sdk (#2070) ([44c9e1e](https://github.com/privacy-scaling-explorations/maci/commit/44c9e1e)), closes [#2070](https://github.com/privacy-scaling-explorations/maci/issues/2070)
|
|
92
|
+
* refactor: vote sdk (#2089) ([fed0e25](https://github.com/privacy-scaling-explorations/maci/commit/fed0e25)), closes [#2089](https://github.com/privacy-scaling-explorations/maci/issues/2089)
|
|
93
|
+
* refactor: vote submission ([a66da9e](https://github.com/privacy-scaling-explorations/maci/commit/a66da9e))
|
|
94
|
+
* refactor(circuits): rename circuits signal inputs and move templates ([c2f4e36](https://github.com/privacy-scaling-explorations/maci/commit/c2f4e36))
|
|
95
|
+
* refactor(cli): cleanup signup command ([601269c](https://github.com/privacy-scaling-explorations/maci/commit/601269c))
|
|
96
|
+
* refactor(cli): move deploy vk registry and testing commands to sdk ([bcd8d12](https://github.com/privacy-scaling-explorations/maci/commit/bcd8d12))
|
|
97
|
+
* refactor(cli): move key generation commands to sdk ([08634a1](https://github.com/privacy-scaling-explorations/maci/commit/08634a1))
|
|
98
|
+
* refactor(cli): move maci state generation to sdk ([f922298](https://github.com/privacy-scaling-explorations/maci/commit/f922298))
|
|
99
|
+
* refactor(cli): move proof generation and poll deploy to sdk ([31922b2](https://github.com/privacy-scaling-explorations/maci/commit/31922b2))
|
|
100
|
+
* refactor(cli): move prove onchain to sdk ([452a68a](https://github.com/privacy-scaling-explorations/maci/commit/452a68a))
|
|
101
|
+
* refactor(cli): move publish commands to sdk ([aa16343](https://github.com/privacy-scaling-explorations/maci/commit/aa16343))
|
|
102
|
+
* refactor(cli): move signups merging to sdk ([36a8d6d](https://github.com/privacy-scaling-explorations/maci/commit/36a8d6d))
|
|
103
|
+
* refactor(cli): move vk commands to sdk ([1f2a81e](https://github.com/privacy-scaling-explorations/maci/commit/1f2a81e))
|
|
104
|
+
* refactor(cli): use contract storage for cli ([b417ee7](https://github.com/privacy-scaling-explorations/maci/commit/b417ee7))
|
|
105
|
+
* refactor(sdk): change sdk package structure ([3255909](https://github.com/privacy-scaling-explorations/maci/commit/3255909))
|
|
106
|
+
* refactor(sdk): rename pollWasm param to pollJoiningZkey for consistency ([d4aae1f](https://github.com/privacy-scaling-explorations/maci/commit/d4aae1f)), closes [#2568](https://github.com/privacy-scaling-explorations/maci/issues/2568)
|
|
107
|
+
* refactor(sdk): separate keys functions ([e22cb16](https://github.com/privacy-scaling-explorations/maci/commit/e22cb16))
|
|
108
|
+
* refactor(user): get signUp data from contract call instead of events (#2464) ([063ef62](https://github.com/privacy-scaling-explorations/maci/commit/063ef62)), closes [#2464](https://github.com/privacy-scaling-explorations/maci/issues/2464)
|
|
109
|
+
* feat: add invalidate votes function (#2219) ([6531fee](https://github.com/privacy-scaling-explorations/maci/commit/6531fee)), closes [#2219](https://github.com/privacy-scaling-explorations/maci/issues/2219)
|
|
110
|
+
* feat: add logs output option for debugging and auditing ([d638fb6](https://github.com/privacy-scaling-explorations/maci/commit/d638fb6))
|
|
111
|
+
* feat: add message processor for full voice credits mode ([d7f4240](https://github.com/privacy-scaling-explorations/maci/commit/d7f4240))
|
|
112
|
+
* feat: add poll state tree depth ([3d74d4b](https://github.com/privacy-scaling-explorations/maci/commit/3d74d4b))
|
|
113
|
+
* feat: add start and end timestmap for poll ([cf67b53](https://github.com/privacy-scaling-explorations/maci/commit/cf67b53))
|
|
114
|
+
* feat: allow to download artifacts on browser ([58a163f](https://github.com/privacy-scaling-explorations/maci/commit/58a163f))
|
|
115
|
+
* feat: check if a user is registered (#2278) ([6c0a2d9](https://github.com/privacy-scaling-explorations/maci/commit/6c0a2d9)), closes [#2278](https://github.com/privacy-scaling-explorations/maci/issues/2278)
|
|
116
|
+
* feat: deploy initial voice credit proxy factory with maci tasks ([3b5aa65](https://github.com/privacy-scaling-explorations/maci/commit/3b5aa65))
|
|
117
|
+
* feat: make ESupportedChains exportable so apps can use it ([b474a0c](https://github.com/privacy-scaling-explorations/maci/commit/b474a0c))
|
|
118
|
+
* feat: use excubiae policies instead of gatekeepers ([a2319b1](https://github.com/privacy-scaling-explorations/maci/commit/a2319b1))
|
|
119
|
+
* feat(circuits): add partial support for full spent voting mode ([8c06abb](https://github.com/privacy-scaling-explorations/maci/commit/8c06abb))
|
|
120
|
+
* feat(circuits): remove timestamp from state leaf ([831e00d](https://github.com/privacy-scaling-explorations/maci/commit/831e00d))
|
|
121
|
+
* feat(circuits): reuse tally non-qv for full spent mode (#2437) ([ae1d978](https://github.com/privacy-scaling-explorations/maci/commit/ae1d978)), closes [#2437](https://github.com/privacy-scaling-explorations/maci/issues/2437)
|
|
122
|
+
* feat(contracts): add anon aadhaar gatekeeper checker ([13f14b0](https://github.com/privacy-scaling-explorations/maci/commit/13f14b0))
|
|
123
|
+
* feat(contracts): add checker and deployment for proxy gatekeepers ([87f6d3b](https://github.com/privacy-scaling-explorations/maci/commit/87f6d3b))
|
|
124
|
+
* feat(contracts): add eas gatekeeper checker ([6e90591](https://github.com/privacy-scaling-explorations/maci/commit/6e90591))
|
|
125
|
+
* feat(contracts): add hats gatekeeper checker ([8ba97ae](https://github.com/privacy-scaling-explorations/maci/commit/8ba97ae))
|
|
126
|
+
* feat(contracts): add merkle proof gatekeeper checker ([e386f91](https://github.com/privacy-scaling-explorations/maci/commit/e386f91))
|
|
127
|
+
* feat(contracts): add proxy clone for initial voice credit proxy ([52d5c0d](https://github.com/privacy-scaling-explorations/maci/commit/52d5c0d))
|
|
128
|
+
* feat(contracts): add semaphore gatekeeper checker ([b7419c9](https://github.com/privacy-scaling-explorations/maci/commit/b7419c9))
|
|
129
|
+
* feat(contracts): add zupass gatekeeper checker ([d69702b](https://github.com/privacy-scaling-explorations/maci/commit/d69702b))
|
|
130
|
+
* feat(contracts): enhance ITally interface as per Tally.sol, remove mockTally.sol ([ba940a7](https://github.com/privacy-scaling-explorations/maci/commit/ba940a7))
|
|
131
|
+
* feat(contracts): integrate erc20 policy ([28d7bfc](https://github.com/privacy-scaling-explorations/maci/commit/28d7bfc))
|
|
132
|
+
* feat(contracts): integrate excubiae for gatekeepers ([fae260b](https://github.com/privacy-scaling-explorations/maci/commit/fae260b))
|
|
133
|
+
* feat(contracts): reuse policy proxies factories for deployment ([ed918ea](https://github.com/privacy-scaling-explorations/maci/commit/ed918ea))
|
|
134
|
+
* feat(contracts): store verifier and verifying keys in maci contract ([f3de633](https://github.com/privacy-scaling-explorations/maci/commit/f3de633))
|
|
135
|
+
* feat(contracts): support etherscan v2 ([b419b9b](https://github.com/privacy-scaling-explorations/maci/commit/b419b9b))
|
|
136
|
+
* feat(contracts): update excubiae package ([321b9bb](https://github.com/privacy-scaling-explorations/maci/commit/321b9bb))
|
|
137
|
+
* feat(coordinator): changes to use it with Aragon UI ([15a0b9e](https://github.com/privacy-scaling-explorations/maci/commit/15a0b9e))
|
|
138
|
+
* feat(coordinator): submit on chain using SDK ([a8fac26](https://github.com/privacy-scaling-explorations/maci/commit/a8fac26))
|
|
139
|
+
* feat(coordinator): workflow + fixed tests + reuse factories ([0b0bd93](https://github.com/privacy-scaling-explorations/maci/commit/0b0bd93))
|
|
140
|
+
* feat(sdk): add relayer functions ([6273ef8](https://github.com/privacy-scaling-explorations/maci/commit/6273ef8))
|
|
141
|
+
* feat(sdk): add set flag to tally result ([6afe368](https://github.com/privacy-scaling-explorations/maci/commit/6afe368))
|
|
142
|
+
* feat(sdk): add stateTreeDepth param to download client artifacts (#2419) ([45905e9](https://github.com/privacy-scaling-explorations/maci/commit/45905e9)), closes [#2419](https://github.com/privacy-scaling-explorations/maci/issues/2419)
|
|
143
|
+
* feat(sdk): allow to reuse inclusion proof for joinPoll ([be08c2c](https://github.com/privacy-scaling-explorations/maci/commit/be08c2c))
|
|
144
|
+
* feat(sdk): export EMode + user types ([5048c01](https://github.com/privacy-scaling-explorations/maci/commit/5048c01))
|
|
145
|
+
* feat(sdk): get results from tally contract (#2415) ([df71430](https://github.com/privacy-scaling-explorations/maci/commit/df71430)), closes [#2415](https://github.com/privacy-scaling-explorations/maci/issues/2415)
|
|
146
|
+
* feat(sdk): implement Subgraph fetcher for signup tree (#2479) ([f6c2b7f](https://github.com/privacy-scaling-explorations/maci/commit/f6c2b7f)), closes [#2479](https://github.com/privacy-scaling-explorations/maci/issues/2479)
|
|
147
|
+
* feat(sdk): return processProofs, tallyProofs and tallyData in generateProofs (#2193) ([dfbc410](https://github.com/privacy-scaling-explorations/maci/commit/dfbc410)), closes [#2193](https://github.com/privacy-scaling-explorations/maci/issues/2193)
|
|
148
|
+
* feat(sdk): setVerifyingKeys for multiple modes ([cd55263](https://github.com/privacy-scaling-explorations/maci/commit/cd55263))
|
|
149
|
+
* test: add stress tests for all the modes ([f7e8c46](https://github.com/privacy-scaling-explorations/maci/commit/f7e8c46))
|
|
150
|
+
* test: move tests over to testing package ([fad40c3](https://github.com/privacy-scaling-explorations/maci/commit/fad40c3))
|
|
151
|
+
* test(coordinator): use mocks and run unit tests locally ([a699a4b](https://github.com/privacy-scaling-explorations/maci/commit/a699a4b))
|
|
152
|
+
* test(relayer): add checks for onchain publishing ([a25f4bd](https://github.com/privacy-scaling-explorations/maci/commit/a25f4bd))
|
|
153
|
+
* test(relayer): add more e2e tests ([0cbfc40](https://github.com/privacy-scaling-explorations/maci/commit/0cbfc40))
|
|
154
|
+
* docs: add full credits information ([e65476e](https://github.com/privacy-scaling-explorations/maci/commit/e65476e))
|
|
155
|
+
* docs: update the readme (#2242) ([ffdceee](https://github.com/privacy-scaling-explorations/maci/commit/ffdceee)), closes [#2242](https://github.com/privacy-scaling-explorations/maci/issues/2242)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
6
161
|
## [3.0.0](https://github.com/privacy-scaling-explorations/maci/compare/v2.5.0...v3.0.0) (2025-03-28)
|
|
7
162
|
|
|
8
163
|
|
package/LICENSE
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
4
|
-
Cory Dickson, Han Jian, Chih-Cheng Liang, and Koh Wei Jie
|
|
3
|
+
Copyright (c) 2025 Ethereum Foundation
|
|
5
4
|
|
|
6
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/build/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maci-protocol/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "MACI's SDK",
|
|
6
6
|
"main": "build/ts/index.js",
|
|
7
|
+
"types": "build/ts/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./build/ts/index.d.ts",
|
|
@@ -14,6 +15,13 @@
|
|
|
14
15
|
"default": "./build/ts/browser/index.js"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
18
|
+
"typesVersions": {
|
|
19
|
+
"*": {
|
|
20
|
+
"browser": [
|
|
21
|
+
"./build/ts/browser/index.d.ts"
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
},
|
|
17
25
|
"bin": {
|
|
18
26
|
"maci-sdk": "./build/ts/index.js"
|
|
19
27
|
},
|
|
@@ -28,30 +36,30 @@
|
|
|
28
36
|
"scripts": {
|
|
29
37
|
"watch": "tsc --watch",
|
|
30
38
|
"build": "tsc -p tsconfig.build.json",
|
|
31
|
-
"postbuild": "cp package.json ./build
|
|
39
|
+
"postbuild": "cp package.json ./build",
|
|
32
40
|
"types": "tsc -p tsconfig.json --noEmit",
|
|
33
41
|
"test": "jest",
|
|
34
42
|
"test:coverage": "pnpm run test --coverage",
|
|
35
43
|
"docs": "typedoc --plugin typedoc-plugin-markdown --options ./typedoc.json"
|
|
36
44
|
},
|
|
37
45
|
"dependencies": {
|
|
38
|
-
"@zk-kit/lean-imt": "^2.2.3",
|
|
39
|
-
"ethers": "^6.13.4",
|
|
40
46
|
"@maci-protocol/contracts": "^3.0.0",
|
|
41
47
|
"@maci-protocol/core": "^3.0.0",
|
|
42
48
|
"@maci-protocol/crypto": "^3.0.0",
|
|
43
49
|
"@maci-protocol/domainobjs": "^3.0.0",
|
|
50
|
+
"@zk-kit/lean-imt": "^2.2.4",
|
|
51
|
+
"ethers": "^6.15.0",
|
|
44
52
|
"multiformats": "9.9.0",
|
|
45
53
|
"snarkjs": "^0.7.5"
|
|
46
54
|
},
|
|
47
55
|
"devDependencies": {
|
|
48
|
-
"@types/jest": "^
|
|
49
|
-
"@types/node": "^
|
|
56
|
+
"@types/jest": "^30.0.0",
|
|
57
|
+
"@types/node": "^24.11.0",
|
|
50
58
|
"@types/snarkjs": "^0.7.9",
|
|
51
|
-
"jest": "^
|
|
52
|
-
"mocha": "^11.
|
|
59
|
+
"jest": "^30.2.0",
|
|
60
|
+
"mocha": "^11.7.2",
|
|
53
61
|
"nyc": "^17.1.0",
|
|
54
|
-
"ts-jest": "^29.
|
|
55
|
-
"typescript": "^5.
|
|
62
|
+
"ts-jest": "^29.4.1",
|
|
63
|
+
"typescript": "^5.9.2"
|
|
56
64
|
}
|
|
57
65
|
}
|
|
@@ -5,9 +5,11 @@ export * from "../tally";
|
|
|
5
5
|
export * from "../trees";
|
|
6
6
|
export * from "../vote";
|
|
7
7
|
export * from "../maciKeys";
|
|
8
|
+
export * from "../subgraph";
|
|
9
|
+
export * from "../user/types";
|
|
8
10
|
export { getSignedupUserData, signup, hasUserSignedUp } from "../user/signup";
|
|
9
|
-
export { getJoinedUserData, hasUserJoinedPoll } from "../user/utils";
|
|
11
|
+
export { getJoinedUserData, hasUserJoinedPoll, generateMaciStateTree, getPollJoiningCircuitEvents, joiningCircuitInputs, generateMaciStateTreeWithEndKey, } from "../user/utils";
|
|
10
12
|
export * from "./joinPoll";
|
|
11
|
-
export type { FullProveResult, IDeployParams, IMergeParams, IProveParams, IVerifyingKeyStruct, SnarkProof, IIpfsMessage, } from "@maci-protocol/contracts";
|
|
13
|
+
export type { EMode, FullProveResult, IDeployParams, IMergeParams, IProveParams, IVerifyingKeyStruct, SnarkProof, IIpfsMessage, } from "@maci-protocol/contracts";
|
|
12
14
|
export * from "@maci-protocol/contracts/typechain-types";
|
|
13
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/browser/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,+BAA+B,GAChC,MAAM,eAAe,CAAC;AAEvB,cAAc,YAAY,CAAC;AAE3B,YAAY,EACV,KAAK,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,YAAY,GACb,MAAM,0BAA0B,CAAC;AAElC,cAAc,0CAA0C,CAAC"}
|
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.hasUserJoinedPoll = exports.getJoinedUserData = exports.hasUserSignedUp = exports.signup = exports.getSignedupUserData = void 0;
|
|
17
|
+
exports.generateMaciStateTreeWithEndKey = exports.joiningCircuitInputs = exports.getPollJoiningCircuitEvents = exports.generateMaciStateTree = exports.hasUserJoinedPoll = exports.getJoinedUserData = exports.hasUserSignedUp = exports.signup = exports.getSignedupUserData = void 0;
|
|
18
18
|
__exportStar(require("../poll"), exports);
|
|
19
19
|
__exportStar(require("../proof/download"), exports);
|
|
20
20
|
__exportStar(require("../proof/types"), exports);
|
|
@@ -22,6 +22,8 @@ __exportStar(require("../tally"), exports);
|
|
|
22
22
|
__exportStar(require("../trees"), exports);
|
|
23
23
|
__exportStar(require("../vote"), exports);
|
|
24
24
|
__exportStar(require("../maciKeys"), exports);
|
|
25
|
+
__exportStar(require("../subgraph"), exports);
|
|
26
|
+
__exportStar(require("../user/types"), exports);
|
|
25
27
|
var signup_1 = require("../user/signup");
|
|
26
28
|
Object.defineProperty(exports, "getSignedupUserData", { enumerable: true, get: function () { return signup_1.getSignedupUserData; } });
|
|
27
29
|
Object.defineProperty(exports, "signup", { enumerable: true, get: function () { return signup_1.signup; } });
|
|
@@ -29,6 +31,10 @@ Object.defineProperty(exports, "hasUserSignedUp", { enumerable: true, get: funct
|
|
|
29
31
|
var utils_1 = require("../user/utils");
|
|
30
32
|
Object.defineProperty(exports, "getJoinedUserData", { enumerable: true, get: function () { return utils_1.getJoinedUserData; } });
|
|
31
33
|
Object.defineProperty(exports, "hasUserJoinedPoll", { enumerable: true, get: function () { return utils_1.hasUserJoinedPoll; } });
|
|
34
|
+
Object.defineProperty(exports, "generateMaciStateTree", { enumerable: true, get: function () { return utils_1.generateMaciStateTree; } });
|
|
35
|
+
Object.defineProperty(exports, "getPollJoiningCircuitEvents", { enumerable: true, get: function () { return utils_1.getPollJoiningCircuitEvents; } });
|
|
36
|
+
Object.defineProperty(exports, "joiningCircuitInputs", { enumerable: true, get: function () { return utils_1.joiningCircuitInputs; } });
|
|
37
|
+
Object.defineProperty(exports, "generateMaciStateTreeWithEndKey", { enumerable: true, get: function () { return utils_1.generateMaciStateTreeWithEndKey; } });
|
|
32
38
|
__exportStar(require("./joinPoll"), exports);
|
|
33
39
|
__exportStar(require("@maci-protocol/contracts/typechain-types"), exports);
|
|
34
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/browser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,oDAAkC;AAClC,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,yCAA8E;AAArE,6GAAA,mBAAmB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,yGAAA,eAAe,OAAA;AACrD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/browser/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,oDAAkC;AAClC,iDAA+B;AAC/B,2CAAyB;AACzB,2CAAyB;AACzB,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAC5B,gDAA8B;AAC9B,yCAA8E;AAArE,6GAAA,mBAAmB,OAAA;AAAE,gGAAA,MAAM,OAAA;AAAE,yGAAA,eAAe,OAAA;AACrD,uCAOuB;AANrB,0GAAA,iBAAiB,OAAA;AACjB,0GAAA,iBAAiB,OAAA;AACjB,8GAAA,qBAAqB,OAAA;AACrB,oHAAA,2BAA2B,OAAA;AAC3B,6GAAA,oBAAoB,OAAA;AACpB,wHAAA,+BAA+B,OAAA;AAGjC,6CAA2B;AAa3B,2EAAyD"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IJoinPollBrowserArgs, IJoinPollData } from "../user/types";
|
|
2
2
|
/**
|
|
3
3
|
* Join Poll user to the Poll contract
|
|
4
|
+
* @dev This version is optimised to work on browsers
|
|
5
|
+
* @dev It uses WASM + accepts already created inclusion proofs
|
|
4
6
|
* @param {IJoinPollArgs} args - The arguments for the join poll command
|
|
5
7
|
* @returns {IJoinPollData} The poll state index of the joined user and transaction hash
|
|
6
8
|
*/
|
|
7
|
-
export declare const joinPoll: ({ maciAddress, privateKey,
|
|
9
|
+
export declare const joinPoll: ({ maciAddress, privateKey, pollId, signer, startBlock, endBlock, blocksPerBatch, pollJoiningZkey, pollJoiningWasm, sgDataArg, ivcpDataArg, inclusionProof, useLatestStateIndex, }: IJoinPollBrowserArgs) => Promise<IJoinPollData>;
|
|
8
10
|
//# sourceMappingURL=joinPoll.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinPoll.d.ts","sourceRoot":"","sources":["../../../ts/browser/joinPoll.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"joinPoll.d.ts","sourceRoot":"","sources":["../../../ts/browser/joinPoll.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQzE;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAU,mLAc5B,oBAAoB,KAAG,OAAO,CAAC,aAAa,CA+F9C,CAAC"}
|
|
@@ -10,23 +10,25 @@ const contracts_1 = require("../utils/contracts");
|
|
|
10
10
|
const utils_2 = require("./utils");
|
|
11
11
|
/**
|
|
12
12
|
* Join Poll user to the Poll contract
|
|
13
|
+
* @dev This version is optimised to work on browsers
|
|
14
|
+
* @dev It uses WASM + accepts already created inclusion proofs
|
|
13
15
|
* @param {IJoinPollArgs} args - The arguments for the join poll command
|
|
14
16
|
* @returns {IJoinPollData} The poll state index of the joined user and transaction hash
|
|
15
17
|
*/
|
|
16
|
-
const joinPoll = async ({ maciAddress, privateKey,
|
|
18
|
+
const joinPoll = async ({ maciAddress, privateKey, pollId, signer, startBlock, endBlock, blocksPerBatch, pollJoiningZkey, pollJoiningWasm, sgDataArg, ivcpDataArg, inclusionProof, useLatestStateIndex, }) => {
|
|
17
19
|
const validContract = await (0, contracts_1.contractExists)(signer.provider, maciAddress);
|
|
18
20
|
if (!validContract) {
|
|
19
21
|
throw new Error("MACI contract does not exist");
|
|
20
22
|
}
|
|
21
|
-
if (!domainobjs_1.
|
|
23
|
+
if (!domainobjs_1.PrivateKey.isValidSerialized(privateKey)) {
|
|
22
24
|
throw new Error("Invalid MACI private key");
|
|
23
25
|
}
|
|
24
26
|
if (pollId < 0) {
|
|
25
27
|
throw new Error("Invalid poll id");
|
|
26
28
|
}
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const nullifier = (0, crypto_1.poseidon)([BigInt(
|
|
29
|
+
const userMaciPrivateKey = domainobjs_1.PrivateKey.deserialize(privateKey);
|
|
30
|
+
const userMaciPublicKey = new domainobjs_1.Keypair(userMaciPrivateKey).publicKey;
|
|
31
|
+
const nullifier = (0, crypto_1.poseidon)([BigInt(userMaciPrivateKey.asCircuitInputs()), pollId]);
|
|
30
32
|
// check if the user has already joined the poll based on the nullifier
|
|
31
33
|
const hasUserJoinedAlready = await (0, utils_1.hasUserJoinedPoll)({
|
|
32
34
|
maciAddress,
|
|
@@ -41,33 +43,35 @@ const joinPoll = async ({ maciAddress, privateKey, stateFile, pollId, signer, st
|
|
|
41
43
|
const pollContracts = await maciContract.getPoll(pollId);
|
|
42
44
|
const pollContract = typechain_types_1.Poll__factory.connect(pollContracts.poll, signer);
|
|
43
45
|
// get the state index from the MACI contract
|
|
44
|
-
const stateIndex = await maciContract.getStateIndex(
|
|
46
|
+
const stateIndex = await maciContract.getStateIndex(userMaciPublicKey.hash()).catch(() => -1n);
|
|
47
|
+
const stateTreeDepth = await maciContract.stateTreeDepth();
|
|
45
48
|
let circuitInputs;
|
|
46
|
-
if (
|
|
47
|
-
circuitInputs =
|
|
48
|
-
stateFile,
|
|
49
|
-
pollId,
|
|
50
|
-
stateIndex,
|
|
51
|
-
userMaciPrivKey,
|
|
52
|
-
});
|
|
49
|
+
if (inclusionProof) {
|
|
50
|
+
circuitInputs = (0, utils_1.joiningCircuitInputs)(inclusionProof, stateTreeDepth, userMaciPrivateKey, userMaciPublicKey, pollId);
|
|
53
51
|
}
|
|
54
52
|
else {
|
|
55
53
|
circuitInputs = await (0, utils_1.getPollJoiningCircuitEvents)({
|
|
56
54
|
maciContract,
|
|
57
55
|
stateIndex,
|
|
58
56
|
pollId,
|
|
59
|
-
|
|
57
|
+
userMaciPrivateKey,
|
|
60
58
|
signer,
|
|
61
59
|
startBlock,
|
|
62
60
|
endBlock,
|
|
63
61
|
blocksPerBatch,
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
|
-
const
|
|
64
|
+
const stateRootIndex = useLatestStateIndex
|
|
65
|
+
? Number.parseInt((await maciContract.totalSignups()).toString(), 10) - 1
|
|
66
|
+
: stateIndex;
|
|
67
67
|
// generate the proof for this batch
|
|
68
|
-
const { proof } = await (0, utils_2.
|
|
68
|
+
const { proof } = await (0, utils_2.generateProofSnarkjs)({
|
|
69
|
+
inputs: circuitInputs,
|
|
70
|
+
zkeyPath: pollJoiningZkey,
|
|
71
|
+
wasmPath: pollJoiningWasm,
|
|
72
|
+
});
|
|
69
73
|
// submit the message onchain as well as the encryption public key
|
|
70
|
-
const tx = await pollContract.joinPoll(nullifier,
|
|
74
|
+
const tx = await pollContract.joinPoll(nullifier, userMaciPublicKey.asContractParam(), stateRootIndex, (0, utils_2.formatProofForVerifierContract)(proof), sgDataArg, ivcpDataArg);
|
|
71
75
|
const receipt = await tx.wait();
|
|
72
76
|
if (receipt?.status !== 1) {
|
|
73
77
|
throw new Error("Transaction failed");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"joinPoll.js","sourceRoot":"","sources":["../../../ts/browser/joinPoll.ts"],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC,8EAAsH;AACtH,kDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"joinPoll.js","sourceRoot":"","sources":["../../../ts/browser/joinPoll.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Groth16Proof } from "snarkjs";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IGenerateProofOptions, FullProveResult, SnarkProof } from "@maci-protocol/contracts";
|
|
3
3
|
/**
|
|
4
4
|
* Format a SnarkProof type to an array of strings
|
|
5
5
|
* which can be passed to the Groth16 verifier contract.
|
|
@@ -14,5 +14,5 @@ export declare const formatProofForVerifierContract: (proof: SnarkProof | Groth1
|
|
|
14
14
|
* @param wasmPath - the path to the wasm witness
|
|
15
15
|
* @returns the zk-SNARK proof and public signals
|
|
16
16
|
*/
|
|
17
|
-
export declare const
|
|
17
|
+
export declare const generateProofSnarkjs: ({ inputs, zkeyPath, wasmPath, }: IGenerateProofOptions) => Promise<FullProveResult>;
|
|
18
18
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/browser/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../ts/browser/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEnG;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,GAAI,OAAO,UAAU,GAAG,YAAY,KAAG,MAAM,EAY5D,CAAC;AAE7B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAU,iCAIxC,qBAAqB,KAAG,OAAO,CAAC,eAAe,CAOjD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.generateProofSnarkjs = exports.formatProofForVerifierContract = void 0;
|
|
4
4
|
const snarkjs_1 = require("snarkjs");
|
|
5
5
|
/**
|
|
6
6
|
* Format a SnarkProof type to an array of strings
|
|
@@ -26,12 +26,12 @@ exports.formatProofForVerifierContract = formatProofForVerifierContract;
|
|
|
26
26
|
* @param wasmPath - the path to the wasm witness
|
|
27
27
|
* @returns the zk-SNARK proof and public signals
|
|
28
28
|
*/
|
|
29
|
-
const
|
|
29
|
+
const generateProofSnarkjs = async ({ inputs, zkeyPath, wasmPath, }) => {
|
|
30
30
|
if (!wasmPath) {
|
|
31
31
|
throw new Error("wasmPath must be specified");
|
|
32
32
|
}
|
|
33
33
|
const { proof, publicSignals } = await snarkjs_1.groth16.fullProve(inputs, wasmPath, zkeyPath);
|
|
34
34
|
return { proof, publicSignals };
|
|
35
35
|
};
|
|
36
|
-
exports.
|
|
36
|
+
exports.generateProofSnarkjs = generateProofSnarkjs;
|
|
37
37
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/browser/utils.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAIrD;;;;;GAKG;AACI,MAAM,8BAA8B,GAAG,CAAC,KAAgC,EAAY,EAAE,CAC3F;IACE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;CACd,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAZhB,QAAA,8BAA8B,kCAYd;AAE7B;;;;;;GAMG;AACI,MAAM,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../ts/browser/utils.ts"],"names":[],"mappings":";;;AAAA,qCAAqD;AAIrD;;;;;GAKG;AACI,MAAM,8BAA8B,GAAG,CAAC,KAAgC,EAAY,EAAE,CAC3F;IACE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAEb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhB,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACb,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;CACd,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAZhB,QAAA,8BAA8B,kCAYd;AAE7B;;;;;;GAMG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,EACzC,MAAM,EACN,QAAQ,EACR,QAAQ,GACc,EAA4B,EAAE;IACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,MAAM,iBAAO,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACrF,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;AAClC,CAAC,CAAC;AAXW,QAAA,oBAAoB,wBAW/B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { deployPoll } from "./poll";
|
|
2
|
-
export {
|
|
2
|
+
export { deployVerifyingKeysRegistryContract } from "./verifyingKeysRegistry";
|
|
3
3
|
export { deployMaci } from "./maci";
|
|
4
4
|
export { deployFactoryWithLinkedLibraries } from "./utils";
|
|
5
|
-
export type { IDeployPollArgs, IPollContractsData, IDeployMaciArgs, IMaciContracts,
|
|
5
|
+
export type { IDeployPollArgs, IPollContractsData, IDeployMaciArgs, IMaciContracts, IDeployVerifyingKeyRegistryArgs, } from "./types";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/deploy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../ts/deploy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAE3D,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,+BAA+B,GAChC,MAAM,SAAS,CAAC"}
|
package/build/ts/deploy/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deployFactoryWithLinkedLibraries = exports.deployMaci = exports.
|
|
3
|
+
exports.deployFactoryWithLinkedLibraries = exports.deployMaci = exports.deployVerifyingKeysRegistryContract = exports.deployPoll = void 0;
|
|
4
4
|
var poll_1 = require("./poll");
|
|
5
5
|
Object.defineProperty(exports, "deployPoll", { enumerable: true, get: function () { return poll_1.deployPoll; } });
|
|
6
|
-
var
|
|
7
|
-
Object.defineProperty(exports, "
|
|
6
|
+
var verifyingKeysRegistry_1 = require("./verifyingKeysRegistry");
|
|
7
|
+
Object.defineProperty(exports, "deployVerifyingKeysRegistryContract", { enumerable: true, get: function () { return verifyingKeysRegistry_1.deployVerifyingKeysRegistryContract; } });
|
|
8
8
|
var maci_1 = require("./maci");
|
|
9
9
|
Object.defineProperty(exports, "deployMaci", { enumerable: true, get: function () { return maci_1.deployMaci; } });
|
|
10
10
|
var utils_1 = require("./utils");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/deploy/index.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../ts/deploy/index.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,iEAA8E;AAArE,4IAAA,mCAAmC,OAAA;AAC5C,+BAAoC;AAA3B,kGAAA,UAAU,OAAA;AACnB,iCAA2D;AAAlD,yHAAA,gCAAgC,OAAA"}
|
|
@@ -4,5 +4,5 @@ import type { IDeployMaciArgs, IMaciContracts } from "./types";
|
|
|
4
4
|
* @param args - The arguments for the MACI contracts deployment
|
|
5
5
|
* @returns The deployed MACI contracts
|
|
6
6
|
*/
|
|
7
|
-
export declare const deployMaci: ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddress, messageProcessorFactoryAddress, tallyFactoryAddress, signer, poseidonAddresses, }: IDeployMaciArgs) => Promise<IMaciContracts>;
|
|
7
|
+
export declare const deployMaci: ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddress, messageProcessorFactoryAddress, tallyFactoryAddress, signer, poseidonAddresses, verifier, }: IDeployMaciArgs) => Promise<IMaciContracts>;
|
|
8
8
|
//# sourceMappingURL=maci.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maci.d.ts","sourceRoot":"","sources":["../../../ts/deploy/maci.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maci.d.ts","sourceRoot":"","sources":["../../../ts/deploy/maci.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK/D;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAU,wJAS9B,eAAe,KAAG,OAAO,CAAC,cAAc,CA8F1C,CAAC"}
|
package/build/ts/deploy/maci.js
CHANGED
|
@@ -3,13 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deployMaci = void 0;
|
|
4
4
|
const contracts_1 = require("@maci-protocol/contracts");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
|
+
const verifyingKeysRegistry_1 = require("./verifyingKeysRegistry");
|
|
6
7
|
/**
|
|
7
8
|
* Deploy the MACI contracts
|
|
8
9
|
* @param args - The arguments for the MACI contracts deployment
|
|
9
10
|
* @returns The deployed MACI contracts
|
|
10
11
|
*/
|
|
11
|
-
const deployMaci = async ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddress, messageProcessorFactoryAddress, tallyFactoryAddress, signer, poseidonAddresses, }) => {
|
|
12
|
-
const emptyBallotRoots = (0, contracts_1.
|
|
12
|
+
const deployMaci = async ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddress, messageProcessorFactoryAddress, tallyFactoryAddress, signer, poseidonAddresses, verifier, }) => {
|
|
13
|
+
const emptyBallotRoots = (0, contracts_1.generateEmptyBallotRoots)(stateTreeDepth);
|
|
13
14
|
const { PoseidonT3Contract, PoseidonT4Contract, PoseidonT5Contract, PoseidonT6Contract } = await (0, contracts_1.deployPoseidonContracts)(signer, poseidonAddresses, true);
|
|
14
15
|
const poseidonAddrs = await Promise.all([
|
|
15
16
|
PoseidonT3Contract.getAddress(),
|
|
@@ -55,6 +56,9 @@ const deployMaci = async ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddr
|
|
|
55
56
|
}),
|
|
56
57
|
signer,
|
|
57
58
|
});
|
|
59
|
+
const verifierContract = verifier || (await (0, contracts_1.deployVerifier)(signer, true));
|
|
60
|
+
const verifierContractAddress = await verifierContract.getAddress();
|
|
61
|
+
const verifyingKeysRegistryContractAddress = await (0, verifyingKeysRegistry_1.deployVerifyingKeysRegistryContract)({ signer });
|
|
58
62
|
const maciContractAddress = await (0, utils_1.deployFactoryWithLinkedLibraries)({
|
|
59
63
|
abi: contracts_1.MACI__factory.abi,
|
|
60
64
|
bytecode: contracts_1.MACI__factory.linkBytecode({
|
|
@@ -65,12 +69,16 @@ const deployMaci = async ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddr
|
|
|
65
69
|
}),
|
|
66
70
|
signer,
|
|
67
71
|
args: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
{
|
|
73
|
+
pollFactory: pollFactoryContractAddress,
|
|
74
|
+
messageProcessorFactory: messageProcessorFactoryContractAddress,
|
|
75
|
+
tallyFactory: tallyFactoryContractAddress,
|
|
76
|
+
signUpPolicy: signupPolicyAddress,
|
|
77
|
+
verifier: verifierContractAddress,
|
|
78
|
+
verifyingKeysRegistry: verifyingKeysRegistryContractAddress,
|
|
79
|
+
stateTreeDepth,
|
|
80
|
+
emptyBallotRoots,
|
|
81
|
+
},
|
|
74
82
|
],
|
|
75
83
|
});
|
|
76
84
|
const policy = contracts_1.IBasePolicy__factory.connect(signupPolicyAddress, signer);
|
|
@@ -81,6 +89,8 @@ const deployMaci = async ({ stateTreeDepth, signupPolicyAddress, pollFactoryAddr
|
|
|
81
89
|
messageProcessorFactoryContractAddress,
|
|
82
90
|
tallyFactoryContractAddress,
|
|
83
91
|
poseidonAddresses: poseidonAddrs,
|
|
92
|
+
verifierContractAddress,
|
|
93
|
+
verifyingKeysRegistryContractAddress,
|
|
84
94
|
};
|
|
85
95
|
};
|
|
86
96
|
exports.deployMaci = deployMaci;
|