@maci-protocol/coordinator 0.0.0-ci.a577366 → 0.0.0-ci.a73cfa9
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/LICENSE +1 -2
- package/README.md +71 -10
- package/build/hardhat.config.cjs +9 -3
- package/build/hardhat.config.cjs.map +1 -1
- package/build/hardhat.config.d.cts +9 -4
- package/build/scripts/generateKeypair.js +2 -2
- package/build/scripts/generateKeypair.js.map +1 -1
- package/build/scripts/generateMaciKeyPair.js +2 -2
- package/build/scripts/generateMaciKeyPair.js.map +1 -1
- package/build/tests/constants.d.ts +3 -4
- package/build/tests/constants.d.ts.map +1 -1
- package/build/tests/constants.js +5 -4
- package/build/tests/constants.js.map +1 -1
- package/build/tests/e2e.deploy.test.js +132 -102
- package/build/tests/e2e.deploy.test.js.map +1 -1
- package/build/tests/e2e.redis.test.d.ts +2 -0
- package/build/tests/e2e.redis.test.d.ts.map +1 -0
- package/build/tests/e2e.redis.test.js +118 -0
- package/build/tests/e2e.redis.test.js.map +1 -0
- package/build/tests/utils.d.ts +7 -1
- package/build/tests/utils.d.ts.map +1 -1
- package/build/tests/utils.js +17 -6
- package/build/tests/utils.js.map +1 -1
- package/build/ts/app.module.d.ts.map +1 -1
- package/build/ts/app.module.js +6 -0
- package/build/ts/app.module.js.map +1 -1
- package/build/ts/common/__tests__/common.test.js +44 -46
- package/build/ts/common/__tests__/common.test.js.map +1 -1
- package/build/ts/common/accountAbstraction.d.ts +7 -24
- package/build/ts/common/accountAbstraction.d.ts.map +1 -1
- package/build/ts/common/accountAbstraction.js +22 -49
- package/build/ts/common/accountAbstraction.js.map +1 -1
- package/build/ts/common/chain.d.ts +22 -0
- package/build/ts/common/chain.d.ts.map +1 -0
- package/build/ts/common/chain.js +37 -0
- package/build/ts/common/chain.js.map +1 -0
- package/build/ts/common/coordinatorKeypair.d.ts +7 -0
- package/build/ts/common/coordinatorKeypair.d.ts.map +1 -0
- package/build/ts/common/coordinatorKeypair.js +14 -0
- package/build/ts/common/coordinatorKeypair.js.map +1 -0
- package/build/ts/common/errors.d.ts +13 -10
- package/build/ts/common/errors.d.ts.map +1 -1
- package/build/ts/common/errors.js +12 -9
- package/build/ts/common/errors.js.map +1 -1
- package/build/ts/common/http.d.ts +6 -0
- package/build/ts/common/http.d.ts.map +1 -0
- package/build/ts/common/http.js +49 -0
- package/build/ts/common/http.js.map +1 -0
- package/build/ts/common/index.d.ts +3 -1
- package/build/ts/common/index.d.ts.map +1 -1
- package/build/ts/common/index.js +3 -1
- package/build/ts/common/index.js.map +1 -1
- package/build/ts/common/networks.d.ts +2 -21
- package/build/ts/common/networks.d.ts.map +1 -1
- package/build/ts/common/networks.js +39 -48
- package/build/ts/common/networks.js.map +1 -1
- package/build/ts/common/types.d.ts +3 -4
- package/build/ts/common/types.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/deployer.controller.test.js +23 -25
- package/build/ts/deployer/__tests__/deployer.controller.test.js.map +1 -1
- package/build/ts/deployer/__tests__/deployer.service.test.js +182 -337
- package/build/ts/deployer/__tests__/deployer.service.test.js.map +1 -1
- package/build/ts/deployer/__tests__/utils.d.ts +31 -6
- package/build/ts/deployer/__tests__/utils.d.ts.map +1 -1
- package/build/ts/deployer/__tests__/utils.js +47 -16
- package/build/ts/deployer/__tests__/utils.js.map +1 -1
- package/build/ts/deployer/deployer.controller.d.ts.map +1 -1
- package/build/ts/deployer/deployer.controller.js +19 -6
- package/build/ts/deployer/deployer.controller.js.map +1 -1
- package/build/ts/deployer/deployer.service.d.ts +26 -53
- package/build/ts/deployer/deployer.service.d.ts.map +1 -1
- package/build/ts/deployer/deployer.service.js +343 -468
- package/build/ts/deployer/deployer.service.js.map +1 -1
- package/build/ts/deployer/dto.d.ts +7 -7
- package/build/ts/deployer/dto.d.ts.map +1 -1
- package/build/ts/deployer/dto.js +14 -6
- package/build/ts/deployer/dto.js.map +1 -1
- package/build/ts/deployer/types.d.ts +83 -46
- package/build/ts/deployer/types.d.ts.map +1 -1
- package/build/ts/file/__tests__/file.service.test.js +12 -11
- package/build/ts/file/__tests__/file.service.test.js.map +1 -1
- package/build/ts/file/file.service.d.ts +4 -3
- package/build/ts/file/file.service.d.ts.map +1 -1
- package/build/ts/file/file.service.js +16 -10
- package/build/ts/file/file.service.js.map +1 -1
- package/build/ts/file/types.d.ts +2 -2
- package/build/ts/file/types.d.ts.map +1 -1
- package/build/ts/health/__tests__/health.controller.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.controller.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.controller.test.js +52 -0
- package/build/ts/health/__tests__/health.controller.test.js.map +1 -0
- package/build/ts/health/__tests__/health.service.test.d.ts +2 -0
- package/build/ts/health/__tests__/health.service.test.d.ts.map +1 -0
- package/build/ts/health/__tests__/health.service.test.js +101 -0
- package/build/ts/health/__tests__/health.service.test.js.map +1 -0
- package/build/ts/health/health.controller.d.ts +16 -0
- package/build/ts/health/health.controller.d.ts.map +1 -0
- package/build/ts/health/health.controller.js +43 -0
- package/build/ts/health/health.controller.js.map +1 -0
- package/build/ts/health/health.module.d.ts +3 -0
- package/build/ts/health/health.module.d.ts.map +1 -0
- package/build/ts/health/health.module.js +22 -0
- package/build/ts/health/health.module.js.map +1 -0
- package/build/ts/health/health.service.d.ts +42 -0
- package/build/ts/health/health.service.d.ts.map +1 -0
- package/build/ts/health/health.service.js +176 -0
- package/build/ts/health/health.service.js.map +1 -0
- package/build/ts/health/types.d.ts +87 -0
- package/build/ts/health/types.d.ts.map +1 -0
- package/build/ts/health/types.js +2 -0
- package/build/ts/health/types.js.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts +11 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.d.ts.map +1 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js +12 -0
- package/build/ts/jest/__mocks__/@openzeppelin/merkle-tree.js.map +1 -0
- package/build/ts/proof/__tests__/proof.controller.test.js +8 -7
- package/build/ts/proof/__tests__/proof.controller.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.gateway.test.js +5 -3
- package/build/ts/proof/__tests__/proof.gateway.test.js.map +1 -1
- package/build/ts/proof/__tests__/proof.service.test.js +31 -75
- package/build/ts/proof/__tests__/proof.service.test.js.map +1 -1
- package/build/ts/proof/dto.d.ts +15 -18
- package/build/ts/proof/dto.d.ts.map +1 -1
- package/build/ts/proof/dto.js +55 -49
- package/build/ts/proof/dto.js.map +1 -1
- package/build/ts/proof/proof.controller.d.ts +3 -2
- package/build/ts/proof/proof.controller.d.ts.map +1 -1
- package/build/ts/proof/proof.controller.js +38 -15
- package/build/ts/proof/proof.controller.js.map +1 -1
- package/build/ts/proof/proof.module.d.ts.map +1 -1
- package/build/ts/proof/proof.module.js +1 -0
- package/build/ts/proof/proof.module.js.map +1 -1
- package/build/ts/proof/proof.service.d.ts +4 -6
- package/build/ts/proof/proof.service.d.ts.map +1 -1
- package/build/ts/proof/proof.service.js +48 -130
- package/build/ts/proof/proof.service.js.map +1 -1
- package/build/ts/proof/types.d.ts +21 -17
- package/build/ts/proof/types.d.ts.map +1 -1
- package/build/ts/proof/types.js.map +1 -1
- package/build/ts/redis/__tests__/redis.service.test.d.ts +2 -0
- package/build/ts/redis/__tests__/redis.service.test.d.ts.map +1 -0
- package/build/ts/redis/__tests__/redis.service.test.js +148 -0
- package/build/ts/redis/__tests__/redis.service.test.js.map +1 -0
- package/build/ts/redis/redis.module.d.ts +3 -0
- package/build/ts/redis/redis.module.d.ts.map +1 -0
- package/build/ts/redis/redis.module.js +18 -0
- package/build/ts/redis/redis.module.js.map +1 -0
- package/build/ts/redis/redis.service.d.ts +53 -0
- package/build/ts/redis/redis.service.d.ts.map +1 -0
- package/build/ts/redis/redis.service.js +99 -0
- package/build/ts/redis/redis.service.js.map +1 -0
- package/build/ts/redis/types.d.ts +66 -0
- package/build/ts/redis/types.d.ts.map +1 -0
- package/build/ts/redis/types.js +2 -0
- package/build/ts/redis/types.js.map +1 -0
- package/build/ts/redis/utils.d.ts +20 -0
- package/build/ts/redis/utils.d.ts.map +1 -0
- package/build/ts/redis/utils.js +27 -0
- package/build/ts/redis/utils.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js +62 -0
- package/build/ts/scheduler/__tests__/scheduler.controller.test.js.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts +2 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.d.ts.map +1 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js +369 -0
- package/build/ts/scheduler/__tests__/scheduler.service.test.js.map +1 -0
- package/build/ts/scheduler/dto.d.ts +41 -0
- package/build/ts/scheduler/dto.d.ts.map +1 -0
- package/build/ts/scheduler/dto.js +115 -0
- package/build/ts/scheduler/dto.js.map +1 -0
- package/build/ts/scheduler/scheduler.controller.d.ts +32 -0
- package/build/ts/scheduler/scheduler.controller.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.controller.js +118 -0
- package/build/ts/scheduler/scheduler.controller.js.map +1 -0
- package/build/ts/scheduler/scheduler.module.d.ts +3 -0
- package/build/ts/scheduler/scheduler.module.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.module.js +24 -0
- package/build/ts/scheduler/scheduler.module.js.map +1 -0
- package/build/ts/scheduler/scheduler.service.d.ts +71 -0
- package/build/ts/scheduler/scheduler.service.d.ts.map +1 -0
- package/build/ts/scheduler/scheduler.service.js +297 -0
- package/build/ts/scheduler/scheduler.service.js.map +1 -0
- package/build/ts/scheduler/types.d.ts +65 -0
- package/build/ts/scheduler/types.d.ts.map +1 -0
- package/build/ts/scheduler/types.js +2 -0
- package/build/ts/scheduler/types.js.map +1 -0
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js +2 -2
- package/build/ts/sessionKeys/__tests__/sessionKeys.controller.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js +34 -19
- package/build/ts/sessionKeys/__tests__/sessionKeys.service.test.js.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts +1 -1
- package/build/ts/sessionKeys/__tests__/utils.d.ts.map +1 -1
- package/build/ts/sessionKeys/__tests__/utils.js +7 -6
- package/build/ts/sessionKeys/__tests__/utils.js.map +1 -1
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts +53 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.d.ts.map +1 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js +105 -0
- package/build/ts/sessionKeys/provider/KernelEIP1193Provider.js.map +1 -0
- package/build/ts/sessionKeys/sessionKeys.service.d.ts +16 -4
- package/build/ts/sessionKeys/sessionKeys.service.d.ts.map +1 -1
- package/build/ts/sessionKeys/sessionKeys.service.js +23 -6
- package/build/ts/sessionKeys/sessionKeys.service.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js +3 -3
- package/build/ts/subgraph/__tests__/subgraph.controller.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js +2 -2
- package/build/ts/subgraph/__tests__/subgraph.gateway.test.js.map +1 -1
- package/build/ts/subgraph/__tests__/subgraph.service.test.js +5 -5
- package/build/ts/subgraph/__tests__/subgraph.service.test.js.map +1 -1
- package/build/ts/subgraph/dto.d.ts +2 -2
- package/build/ts/subgraph/dto.d.ts.map +1 -1
- package/build/ts/subgraph/dto.js +3 -3
- package/build/ts/subgraph/dto.js.map +1 -1
- package/build/ts/subgraph/subgraph.controller.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.controller.js +8 -3
- package/build/ts/subgraph/subgraph.controller.js.map +1 -1
- package/build/ts/subgraph/subgraph.service.d.ts +4 -0
- package/build/ts/subgraph/subgraph.service.d.ts.map +1 -1
- package/build/ts/subgraph/subgraph.service.js +23 -10
- package/build/ts/subgraph/subgraph.service.js.map +1 -1
- package/build/ts/subgraph/types.d.ts +2 -2
- package/build/ts/subgraph/types.d.ts.map +1 -1
- package/build/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +45 -38
- package/build/tests/e2e.aa.test.d.ts +0 -2
- package/build/tests/e2e.aa.test.d.ts.map +0 -1
- package/build/tests/e2e.aa.test.js +0 -103
- package/build/tests/e2e.aa.test.js.map +0 -1
- package/build/ts/deployer/utils.d.ts +0 -8
- package/build/ts/deployer/utils.d.ts.map +0 -1
- package/build/ts/deployer/utils.js +0 -9
- package/build/ts/deployer/utils.js.map +0 -1
package/build/ts/proof/dto.js
CHANGED
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
+
import { ESupportedChains, EMode } from "@maci-protocol/sdk";
|
|
10
11
|
import { ApiProperty } from "@nestjs/swagger";
|
|
11
|
-
import {
|
|
12
|
-
import { ESupportedNetworks } from "../common";
|
|
12
|
+
import { IsEnum, IsEthereumAddress, IsInt, IsOptional, IsString, Max, Min } from "class-validator";
|
|
13
13
|
/**
|
|
14
14
|
* Data transfer object for generate proof
|
|
15
15
|
*/
|
|
@@ -23,17 +23,9 @@ export class GenerateProofDto {
|
|
|
23
23
|
*/
|
|
24
24
|
maciContractAddress;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Voting mode
|
|
27
27
|
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Whether to use Qv or NonQv
|
|
31
|
-
*/
|
|
32
|
-
useQuadraticVoting;
|
|
33
|
-
/**
|
|
34
|
-
* Encrypted coordinator private key with RSA public key (see .env.example)
|
|
35
|
-
*/
|
|
36
|
-
encryptedCoordinatorPrivateKey;
|
|
28
|
+
mode;
|
|
37
29
|
/**
|
|
38
30
|
* Start block for event processing
|
|
39
31
|
*/
|
|
@@ -46,6 +38,12 @@ export class GenerateProofDto {
|
|
|
46
38
|
* Blocks per batch for event processing
|
|
47
39
|
*/
|
|
48
40
|
blocksPerBatch;
|
|
41
|
+
sessionKeyAddress;
|
|
42
|
+
approval;
|
|
43
|
+
/**
|
|
44
|
+
* Chain Name
|
|
45
|
+
*/
|
|
46
|
+
chain;
|
|
49
47
|
}
|
|
50
48
|
__decorate([
|
|
51
49
|
ApiProperty({
|
|
@@ -67,31 +65,12 @@ __decorate([
|
|
|
67
65
|
], GenerateProofDto.prototype, "maciContractAddress", void 0);
|
|
68
66
|
__decorate([
|
|
69
67
|
ApiProperty({
|
|
70
|
-
description: "
|
|
71
|
-
type:
|
|
72
|
-
}),
|
|
73
|
-
IsEthereumAddress(),
|
|
74
|
-
__metadata("design:type", String)
|
|
75
|
-
], GenerateProofDto.prototype, "tallyContractAddress", void 0);
|
|
76
|
-
__decorate([
|
|
77
|
-
ApiProperty({
|
|
78
|
-
description: "Whether to use quadratic voting or not",
|
|
79
|
-
type: Boolean,
|
|
80
|
-
}),
|
|
81
|
-
IsBoolean(),
|
|
82
|
-
__metadata("design:type", Boolean)
|
|
83
|
-
], GenerateProofDto.prototype, "useQuadraticVoting", void 0);
|
|
84
|
-
__decorate([
|
|
85
|
-
ApiProperty({
|
|
86
|
-
description: "Encrypted coordinator private key with RSA public key (see README.md)",
|
|
87
|
-
minimum: 1,
|
|
88
|
-
maximum: 1024,
|
|
89
|
-
type: String,
|
|
68
|
+
description: "Voting mode (qv: 0, non-qv: 1, full: 2)",
|
|
69
|
+
type: Number,
|
|
90
70
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
], GenerateProofDto.prototype, "encryptedCoordinatorPrivateKey", void 0);
|
|
71
|
+
IsEnum(EMode),
|
|
72
|
+
__metadata("design:type", Number)
|
|
73
|
+
], GenerateProofDto.prototype, "mode", void 0);
|
|
95
74
|
__decorate([
|
|
96
75
|
ApiProperty({
|
|
97
76
|
description: "Start block for event parsing",
|
|
@@ -127,6 +106,34 @@ __decorate([
|
|
|
127
106
|
IsOptional(),
|
|
128
107
|
__metadata("design:type", Number)
|
|
129
108
|
], GenerateProofDto.prototype, "blocksPerBatch", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
ApiProperty({
|
|
111
|
+
description: "Session key address",
|
|
112
|
+
type: String,
|
|
113
|
+
required: false,
|
|
114
|
+
}),
|
|
115
|
+
IsOptional(),
|
|
116
|
+
IsEthereumAddress(),
|
|
117
|
+
__metadata("design:type", String)
|
|
118
|
+
], GenerateProofDto.prototype, "sessionKeyAddress", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
ApiProperty({
|
|
121
|
+
description: "Approval",
|
|
122
|
+
type: String,
|
|
123
|
+
required: false,
|
|
124
|
+
}),
|
|
125
|
+
IsOptional(),
|
|
126
|
+
IsString(),
|
|
127
|
+
__metadata("design:type", String)
|
|
128
|
+
], GenerateProofDto.prototype, "approval", void 0);
|
|
129
|
+
__decorate([
|
|
130
|
+
ApiProperty({
|
|
131
|
+
description: "Chain to which to deploy the contract(s)",
|
|
132
|
+
enum: ESupportedChains,
|
|
133
|
+
}),
|
|
134
|
+
IsEnum(ESupportedChains),
|
|
135
|
+
__metadata("design:type", String)
|
|
136
|
+
], GenerateProofDto.prototype, "chain", void 0);
|
|
130
137
|
/**
|
|
131
138
|
* Data transfer object for merge trees
|
|
132
139
|
*/
|
|
@@ -165,7 +172,9 @@ __decorate([
|
|
|
165
172
|
ApiProperty({
|
|
166
173
|
description: "Session key address",
|
|
167
174
|
type: String,
|
|
175
|
+
required: false,
|
|
168
176
|
}),
|
|
177
|
+
IsOptional(),
|
|
169
178
|
IsEthereumAddress(),
|
|
170
179
|
__metadata("design:type", String)
|
|
171
180
|
], MergeTreesDto.prototype, "sessionKeyAddress", void 0);
|
|
@@ -173,16 +182,18 @@ __decorate([
|
|
|
173
182
|
ApiProperty({
|
|
174
183
|
description: "Approval",
|
|
175
184
|
type: String,
|
|
185
|
+
required: false,
|
|
176
186
|
}),
|
|
187
|
+
IsOptional(),
|
|
177
188
|
IsString(),
|
|
178
189
|
__metadata("design:type", String)
|
|
179
190
|
], MergeTreesDto.prototype, "approval", void 0);
|
|
180
191
|
__decorate([
|
|
181
192
|
ApiProperty({
|
|
182
193
|
description: "Chain to which to deploy the contract(s)",
|
|
183
|
-
enum:
|
|
194
|
+
enum: ESupportedChains,
|
|
184
195
|
}),
|
|
185
|
-
IsEnum(
|
|
196
|
+
IsEnum(ESupportedChains),
|
|
186
197
|
__metadata("design:type", String)
|
|
187
198
|
], MergeTreesDto.prototype, "chain", void 0);
|
|
188
199
|
/**
|
|
@@ -194,7 +205,6 @@ export class SubmitProofsDto {
|
|
|
194
205
|
*/
|
|
195
206
|
pollId;
|
|
196
207
|
maciContractAddress;
|
|
197
|
-
tallyContractAddress;
|
|
198
208
|
sessionKeyAddress;
|
|
199
209
|
approval;
|
|
200
210
|
/**
|
|
@@ -220,19 +230,13 @@ __decorate([
|
|
|
220
230
|
IsEthereumAddress(),
|
|
221
231
|
__metadata("design:type", String)
|
|
222
232
|
], SubmitProofsDto.prototype, "maciContractAddress", void 0);
|
|
223
|
-
__decorate([
|
|
224
|
-
ApiProperty({
|
|
225
|
-
description: "Tally contract address",
|
|
226
|
-
type: String,
|
|
227
|
-
}),
|
|
228
|
-
IsEthereumAddress(),
|
|
229
|
-
__metadata("design:type", String)
|
|
230
|
-
], SubmitProofsDto.prototype, "tallyContractAddress", void 0);
|
|
231
233
|
__decorate([
|
|
232
234
|
ApiProperty({
|
|
233
235
|
description: "Session key address",
|
|
234
236
|
type: String,
|
|
237
|
+
required: false,
|
|
235
238
|
}),
|
|
239
|
+
IsOptional(),
|
|
236
240
|
IsEthereumAddress(),
|
|
237
241
|
__metadata("design:type", String)
|
|
238
242
|
], SubmitProofsDto.prototype, "sessionKeyAddress", void 0);
|
|
@@ -240,16 +244,18 @@ __decorate([
|
|
|
240
244
|
ApiProperty({
|
|
241
245
|
description: "Approval",
|
|
242
246
|
type: String,
|
|
247
|
+
required: false,
|
|
243
248
|
}),
|
|
249
|
+
IsOptional(),
|
|
244
250
|
IsString(),
|
|
245
251
|
__metadata("design:type", String)
|
|
246
252
|
], SubmitProofsDto.prototype, "approval", void 0);
|
|
247
253
|
__decorate([
|
|
248
254
|
ApiProperty({
|
|
249
255
|
description: "Chain to which to deploy the contract(s)",
|
|
250
|
-
enum:
|
|
256
|
+
enum: ESupportedChains,
|
|
251
257
|
}),
|
|
252
|
-
IsEnum(
|
|
258
|
+
IsEnum(ESupportedChains),
|
|
253
259
|
__metadata("design:type", String)
|
|
254
260
|
], SubmitProofsDto.prototype, "chain", void 0);
|
|
255
261
|
//# sourceMappingURL=dto.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../ts/proof/dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../../ts/proof/dto.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAInG;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IAQH,IAAI,CAAU;IAEd;;OAEG;IAMH,mBAAmB,CAAU;IAE7B;;OAEG;IAMH,IAAI,CAAS;IAEb;;OAEG;IASH,UAAU,CAAU;IAEpB;;OAEG;IASH,QAAQ,CAAU;IAElB;;OAEG;IAWH,cAAc,CAAU;IASxB,iBAAiB,CAAO;IASxB,QAAQ,CAAU;IAElB;;OAEG;IAMH,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C1B;AApCC;IAPC,WAAW,CAAC;QACX,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE,CAAC;QACV,IAAI,EAAE,MAAM;KACb,CAAC;IACD,KAAK,EAAE;IACP,GAAG,CAAC,CAAC,CAAC;;+CACS;AAOhB;IALC,WAAW,CAAC;QACX,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,MAAM;KACb,CAAC;IACD,iBAAiB,EAAE;;4DACM;AAS1B;IAPC,WAAW,CAAC;QACX,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,UAAU,EAAE;IACZ,iBAAiB,EAAE;;0DACI;AASxB;IAPC,WAAW,CAAC;QACX,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,UAAU,EAAE;IACZ,QAAQ,EAAE;;iDACO;AAUlB;IALC,WAAW,CAAC;QACX,WAAW,EAAE,0CAA0C;QACvD,IAAI,EAAE,gBAAgB;KACvB,CAAC;IACD,MAAM,CAAC,gBAAgB,CAAC;;8CACA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { IGenerateData, IMergeArgs } from "./types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ITallyData } from "@maci-protocol/sdk";
|
|
3
3
|
import { FileService } from "../file/file.service";
|
|
4
|
+
import { IGetPublicKeyData } from "../file/types";
|
|
4
5
|
import { GenerateProofDto, SubmitProofsDto } from "./dto";
|
|
5
6
|
import { ProofGeneratorService } from "./proof.service";
|
|
6
7
|
export declare class ProofController {
|
|
@@ -35,7 +36,7 @@ export declare class ProofController {
|
|
|
35
36
|
* Submit proofs on-chain api method
|
|
36
37
|
* @param args - submit proofs on-chain args
|
|
37
38
|
*/
|
|
38
|
-
submit(args: SubmitProofsDto): Promise<
|
|
39
|
+
submit(args: SubmitProofsDto): Promise<ITallyData>;
|
|
39
40
|
/**
|
|
40
41
|
* Get RSA public key for authorization setup
|
|
41
42
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.controller.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.controller.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"proof.controller.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.controller.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAiB,eAAe,EAAE,MAAM,OAAO,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAExD,qBAGa,eAAe;IAaxB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAb9B;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoC;IAE3D;;;;;OAKG;gBAEgB,qBAAqB,EAAE,qBAAqB,EAC5C,WAAW,EAAE,WAAW;IAG3C;;;;;OAKG;IAcG,QAAQ,CAAS,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC;IAOtE;;;;;OAKG;IAcG,KAAK,CAAS,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAOvD;;;OAGG;IAcG,MAAM,CAAS,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAOhE;;;;OAIG;IAKG,YAAY,IAAI,OAAO,CAAC,iBAAiB,CAAC;CAMjD"}
|
|
@@ -12,9 +12,9 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
12
12
|
};
|
|
13
13
|
var ProofController_1;
|
|
14
14
|
/* eslint-disable @typescript-eslint/no-shadow */
|
|
15
|
-
import { Body, Controller, Get, HttpException, HttpStatus, Logger, Post
|
|
15
|
+
import { Body, Controller, Get, HttpException, HttpStatus, Logger, Post } from "@nestjs/common";
|
|
16
16
|
import { ApiBearerAuth, ApiBody, ApiResponse, ApiTags } from "@nestjs/swagger";
|
|
17
|
-
import {
|
|
17
|
+
import { mapErrorToHttpStatus } from "../common/http";
|
|
18
18
|
import { FileService } from "../file/file.service";
|
|
19
19
|
import { GenerateProofDto, MergeTreesDto, SubmitProofsDto } from "./dto";
|
|
20
20
|
import { ProofGeneratorService } from "./proof.service";
|
|
@@ -44,7 +44,7 @@ let ProofController = ProofController_1 = class ProofController {
|
|
|
44
44
|
async generate(args) {
|
|
45
45
|
return this.proofGeneratorService.generate(args).catch((error) => {
|
|
46
46
|
this.logger.error(`Error:`, error);
|
|
47
|
-
throw new HttpException(error.message,
|
|
47
|
+
throw new HttpException(error.message, mapErrorToHttpStatus(error));
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
@@ -56,7 +56,7 @@ let ProofController = ProofController_1 = class ProofController {
|
|
|
56
56
|
async merge(args) {
|
|
57
57
|
return this.proofGeneratorService.merge(args).catch((error) => {
|
|
58
58
|
this.logger.error(`Error:`, error);
|
|
59
|
-
throw new HttpException(error.message,
|
|
59
|
+
throw new HttpException(error.message, mapErrorToHttpStatus(error));
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
@@ -66,7 +66,7 @@ let ProofController = ProofController_1 = class ProofController {
|
|
|
66
66
|
async submit(args) {
|
|
67
67
|
return this.proofGeneratorService.submit(args).catch((error) => {
|
|
68
68
|
this.logger.error(`Error:`, error);
|
|
69
|
-
throw new HttpException(error.message,
|
|
69
|
+
throw new HttpException(error.message, mapErrorToHttpStatus(error));
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
@@ -77,15 +77,23 @@ let ProofController = ProofController_1 = class ProofController {
|
|
|
77
77
|
async getPublicKey() {
|
|
78
78
|
return this.fileService.getPublicKey().catch((error) => {
|
|
79
79
|
this.logger.error(`Error:`, error);
|
|
80
|
-
throw new HttpException(error.message,
|
|
80
|
+
throw new HttpException(error.message, mapErrorToHttpStatus(error));
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
};
|
|
84
84
|
__decorate([
|
|
85
85
|
ApiBody({ type: GenerateProofDto }),
|
|
86
86
|
ApiResponse({ status: HttpStatus.CREATED, description: "The proofs have been successfully generated" }),
|
|
87
|
-
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "
|
|
88
|
-
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "
|
|
87
|
+
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "Invalid approval signature" }),
|
|
88
|
+
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "Unsupported input (network/policy/voice credit proxy)" }),
|
|
89
|
+
ApiResponse({
|
|
90
|
+
status: HttpStatus.CONFLICT,
|
|
91
|
+
description: "Operation cannot proceed due to state conflict (e.g., poll already tallied or trees not merged)",
|
|
92
|
+
}),
|
|
93
|
+
ApiResponse({
|
|
94
|
+
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
95
|
+
description: "Proof generation failed (encryption/decryption or merge failure)",
|
|
96
|
+
}),
|
|
89
97
|
Post("generate"),
|
|
90
98
|
__param(0, Body()),
|
|
91
99
|
__metadata("design:type", Function),
|
|
@@ -95,8 +103,16 @@ __decorate([
|
|
|
95
103
|
__decorate([
|
|
96
104
|
ApiBody({ type: MergeTreesDto }),
|
|
97
105
|
ApiResponse({ status: HttpStatus.CREATED, description: "The proofs have been successfully merged" }),
|
|
98
|
-
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "
|
|
99
|
-
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "
|
|
106
|
+
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "Invalid approval signature" }),
|
|
107
|
+
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "Invalid input" }),
|
|
108
|
+
ApiResponse({
|
|
109
|
+
status: HttpStatus.CONFLICT,
|
|
110
|
+
description: "Operation cannot proceed due to state conflict (e.g., trees not ready/merged)",
|
|
111
|
+
}),
|
|
112
|
+
ApiResponse({
|
|
113
|
+
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
114
|
+
description: "Merge failed (failed to merge state or message trees)",
|
|
115
|
+
}),
|
|
100
116
|
Post("merge"),
|
|
101
117
|
__param(0, Body()),
|
|
102
118
|
__metadata("design:type", Function),
|
|
@@ -106,8 +122,16 @@ __decorate([
|
|
|
106
122
|
__decorate([
|
|
107
123
|
ApiBody({ type: SubmitProofsDto }),
|
|
108
124
|
ApiResponse({ status: HttpStatus.CREATED, description: "The proofs have been successfully submitted" }),
|
|
109
|
-
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "
|
|
110
|
-
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "
|
|
125
|
+
ApiResponse({ status: HttpStatus.FORBIDDEN, description: "Invalid approval signature" }),
|
|
126
|
+
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "Invalid input" }),
|
|
127
|
+
ApiResponse({
|
|
128
|
+
status: HttpStatus.CONFLICT,
|
|
129
|
+
description: "Operation cannot proceed due to state conflict (e.g., poll already tallied)",
|
|
130
|
+
}),
|
|
131
|
+
ApiResponse({
|
|
132
|
+
status: HttpStatus.INTERNAL_SERVER_ERROR,
|
|
133
|
+
description: "On-chain submission failed (verifying keys/contract interaction errors)",
|
|
134
|
+
}),
|
|
111
135
|
Post("submit"),
|
|
112
136
|
__param(0, Body()),
|
|
113
137
|
__metadata("design:type", Function),
|
|
@@ -116,8 +140,8 @@ __decorate([
|
|
|
116
140
|
], ProofController.prototype, "submit", null);
|
|
117
141
|
__decorate([
|
|
118
142
|
ApiResponse({ status: HttpStatus.OK, description: "Public key was successfully returned" }),
|
|
119
|
-
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "
|
|
120
|
-
|
|
143
|
+
ApiResponse({ status: HttpStatus.BAD_REQUEST, description: "Invalid request" }),
|
|
144
|
+
ApiResponse({ status: HttpStatus.INTERNAL_SERVER_ERROR, description: "Failed to read or generate public key" }),
|
|
121
145
|
Get("publicKey"),
|
|
122
146
|
__metadata("design:type", Function),
|
|
123
147
|
__metadata("design:paramtypes", []),
|
|
@@ -127,7 +151,6 @@ ProofController = ProofController_1 = __decorate([
|
|
|
127
151
|
ApiTags("v1/proof"),
|
|
128
152
|
ApiBearerAuth(),
|
|
129
153
|
Controller("v1/proof"),
|
|
130
|
-
UseGuards(AccountSignatureGuard),
|
|
131
154
|
__metadata("design:paramtypes", [ProofGeneratorService,
|
|
132
155
|
FileService])
|
|
133
156
|
], ProofController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.controller.js","sourceRoot":"","sources":["../../../ts/proof/proof.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAAiD;AACjD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"proof.controller.js","sourceRoot":"","sources":["../../../ts/proof/proof.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAAiD;AACjD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAK/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGnD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CAAC,EAAE,EAAE,WAAW,EAAE,sCAAsC,EAAE,CAAC;IAC3F,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;IAC/E,WAAW,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,qBAAqB,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;IAC/G,GAAG,CAAC,WAAW,CAAC;;;;mDAMhB;AA3GU,eAAe;IAH3B,OAAO,CAAC,UAAU,CAAC;IACnB,aAAa,EAAE;IACf,UAAU,CAAC,UAAU,CAAC;qCAcqB,qBAAqB;QAC/B,WAAW;GAdhC,eAAe,CA4G3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.module.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.module.ts"],"names":[],"mappings":"AAUA,
|
|
1
|
+
{"version":3,"file":"proof.module.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.module.ts"],"names":[],"mappings":"AAUA,qBAMa,WAAW;CAAG"}
|
|
@@ -18,6 +18,7 @@ ProofModule = __decorate([
|
|
|
18
18
|
imports: [FileModule, CryptoModule, SessionKeysModule],
|
|
19
19
|
controllers: [ProofController],
|
|
20
20
|
providers: [ProofGeneratorService, ProofGateway],
|
|
21
|
+
exports: [ProofGeneratorService],
|
|
21
22
|
})
|
|
22
23
|
], ProofModule);
|
|
23
24
|
export { ProofModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.module.js","sourceRoot":"","sources":["../../../ts/proof/proof.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"proof.module.js","sourceRoot":"","sources":["../../../ts/proof/proof.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAQjD,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,WAAW;IANvB,MAAM,CAAC;QACN,OAAO,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,iBAAiB,CAAC;QACtD,WAAW,EAAE,CAAC,eAAe,CAAC;QAC9B,SAAS,EAAE,CAAC,qBAAqB,EAAE,YAAY,CAAC;QAChD,OAAO,EAAE,CAAC,qBAAqB,CAAC;KACjC,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { type IGenerateProofsOptions } from "@maci-protocol/sdk";
|
|
2
|
-
import { IProof } from "@maci-protocol/sdk";
|
|
2
|
+
import { IProof, ITallyData } from "@maci-protocol/sdk";
|
|
3
3
|
import type { IGenerateArgs, IGenerateData, IMergeArgs, ISubmitProofsArgs } from "./types";
|
|
4
|
-
import { CryptoService } from "../crypto/crypto.service";
|
|
5
4
|
import { FileService } from "../file/file.service";
|
|
6
5
|
import { SessionKeysService } from "../sessionKeys/sessionKeys.service";
|
|
7
6
|
/**
|
|
8
7
|
* ProofGeneratorService is responsible for generating message processing and tally proofs.
|
|
9
8
|
*/
|
|
10
9
|
export declare class ProofGeneratorService {
|
|
11
|
-
private readonly cryptoService;
|
|
12
10
|
private readonly fileService;
|
|
13
11
|
private readonly sessionKeysService;
|
|
14
12
|
/**
|
|
@@ -22,7 +20,7 @@ export declare class ProofGeneratorService {
|
|
|
22
20
|
/**
|
|
23
21
|
* Proof generator initialization
|
|
24
22
|
*/
|
|
25
|
-
constructor(
|
|
23
|
+
constructor(fileService: FileService, sessionKeysService: SessionKeysService);
|
|
26
24
|
/**
|
|
27
25
|
* Read and parse proofs
|
|
28
26
|
* @param folder - folder path to read proofs from
|
|
@@ -36,7 +34,7 @@ export declare class ProofGeneratorService {
|
|
|
36
34
|
* @param args - generate proofs arguments
|
|
37
35
|
* @returns - generated proofs for message processing and tally
|
|
38
36
|
*/
|
|
39
|
-
generate({
|
|
37
|
+
generate({ approval, sessionKeyAddress, chain, poll, maciContractAddress, mode, startBlock, endBlock, blocksPerBatch, useWasm, }: IGenerateArgs, options?: IGenerateProofsOptions): Promise<IGenerateData>;
|
|
40
38
|
/**
|
|
41
39
|
* Merge state and message trees
|
|
42
40
|
*
|
|
@@ -49,6 +47,6 @@ export declare class ProofGeneratorService {
|
|
|
49
47
|
*
|
|
50
48
|
* @param args - submit proofs on-chain arguments
|
|
51
49
|
*/
|
|
52
|
-
submit({ maciContractAddress, pollId, chain }: ISubmitProofsArgs): Promise<
|
|
50
|
+
submit({ maciContractAddress, pollId, sessionKeyAddress, approval, chain, }: ISubmitProofsArgs): Promise<ITallyData>;
|
|
53
51
|
}
|
|
54
52
|
//# sourceMappingURL=proof.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proof.service.d.ts","sourceRoot":"","sources":["../../../ts/proof/proof.service.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"proof.service.d.ts","sourceRoot":"","sources":["../../../ts/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