@vocdoni/proto 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.github/workflows/on-release.yml +19 -0
  2. package/.github/workflows/post-merge.yml +32 -0
  3. package/AUTHORS +7 -0
  4. package/LICENSE +661 -0
  5. package/Makefile +134 -0
  6. package/README.md +112 -0
  7. package/bin/protoc +0 -0
  8. package/code-of-conduct.md +77 -0
  9. package/dist/client-store/index.d.ts +3 -0
  10. package/dist/client-store/index.js +2689 -0
  11. package/dist/client-store/index.mjs +2676 -0
  12. package/dist/entity-35513b52.d.ts +1804 -0
  13. package/dist/index-45e93762.d.ts +1924 -0
  14. package/dist/index-7dfc19fc.d.ts +1972 -0
  15. package/dist/index-85137ec5.d.ts +9976 -0
  16. package/dist/index.d.ts +5 -0
  17. package/dist/index.js +9077 -0
  18. package/dist/index.mjs +9065 -0
  19. package/dist/metadata/index.d.ts +3 -0
  20. package/dist/metadata/index.js +3751 -0
  21. package/dist/metadata/index.mjs +3708 -0
  22. package/dist/vochain/index.d.ts +2 -0
  23. package/dist/vochain/index.js +5541 -0
  24. package/dist/vochain/index.mjs +5464 -0
  25. package/go.mod +8 -0
  26. package/go.sum +69 -0
  27. package/include/google/protobuf/any.proto +158 -0
  28. package/include/google/protobuf/api.proto +208 -0
  29. package/include/google/protobuf/compiler/plugin.proto +183 -0
  30. package/include/google/protobuf/descriptor.proto +909 -0
  31. package/include/google/protobuf/duration.proto +116 -0
  32. package/include/google/protobuf/empty.proto +52 -0
  33. package/include/google/protobuf/field_mask.proto +245 -0
  34. package/include/google/protobuf/source_context.proto +48 -0
  35. package/include/google/protobuf/struct.proto +95 -0
  36. package/include/google/protobuf/timestamp.proto +147 -0
  37. package/include/google/protobuf/type.proto +187 -0
  38. package/include/google/protobuf/wrappers.proto +123 -0
  39. package/package.json +44 -0
  40. package/src/client-store/account.proto +54 -0
  41. package/src/client-store/backup.proto +65 -0
  42. package/src/client-store/gateway.proto +35 -0
  43. package/src/client-store/wallet.proto +19 -0
  44. package/src/ipfsSync/ipfssync.proto +26 -0
  45. package/src/metadata/entity.proto +75 -0
  46. package/src/metadata/feed.proto +51 -0
  47. package/src/metadata/process.proto +38 -0
  48. package/src/vocdoni-node/statedb.proto +33 -0
  49. package/src/vochain/vochain.proto +473 -0
  50. package/tsconfig.json +15 -0
  51. package/tsup.config.ts +15 -0
@@ -0,0 +1,26 @@
1
+ syntax = "proto3";
2
+
3
+ package dvote.types.v1;
4
+
5
+ option go_package = "go.vocdoni.io/proto/build/go/models";
6
+
7
+ message IpfsSync {
8
+ enum Type {
9
+ UNKNOWN = 0;
10
+ HELLO = 1;
11
+ UPDATE = 2;
12
+ FETCH = 3;
13
+ FETCHREPLY = 4;
14
+ }
15
+
16
+ Type msgtype = 1;
17
+ string address = 2;
18
+ string multiaddress = 3;
19
+ bytes hash = 4;
20
+ repeated IpfsPin pinList = 5;
21
+ uint32 timestamp = 6;
22
+ }
23
+
24
+ message IpfsPin {
25
+ string uri = 1;
26
+ }
@@ -0,0 +1,75 @@
1
+ /// Type: Protocol model
2
+ /// Info: https://vocdoni.io/docs/#/architecture/components/entity?id=json-schema
3
+
4
+ syntax = "proto3";
5
+ package dvote.types.v1;
6
+
7
+ // Helper to serialize and store all cached data
8
+ message EntityMetadataStore {
9
+ repeated EntityMetadata items = 1;
10
+ }
11
+
12
+ // The metadata of an entity
13
+ // https://vocdoni.io/docs/#/architecture/components/entity?id=json-schema
14
+ message EntityMetadata {
15
+ // OWN FIELDS
16
+ string version = 1;
17
+
18
+ repeated string languages = 2;
19
+ map<string, string> name = 3; // locale-aware value
20
+ map<string, string> description = 4; // locale-aware value
21
+
22
+ message VotingProcesses {
23
+ repeated string active = 1;
24
+ repeated string ended = 2;
25
+ }
26
+ VotingProcesses votingProcesses = 5;
27
+
28
+ map<string, string> newsFeed = 6; // locale-aware value
29
+
30
+ message Media {
31
+ string avatar = 1;
32
+ string header = 2;
33
+ }
34
+ Media media = 7;
35
+
36
+ // See entity actions definition
37
+ // https://vocdoni.io/docs/#/architecture/components/entity?id=entity-actions
38
+ message Action {
39
+ string type = 1;
40
+ string actionKey = 7;
41
+ map<string, string> name = 2; // locale-aware value
42
+ string visible = 3; // A URL or "true"
43
+
44
+ // type = register / browser / submitMedia
45
+ string url = 4;
46
+
47
+ // type = submitMedia
48
+ message ImageSource {
49
+ string type = 1;
50
+ string name = 2;
51
+ string orientation = 3;
52
+ string overlay = 4;
53
+ map<string, string> caption = 5; // locale-aware value
54
+ }
55
+ repeated ImageSource imageSources = 5;
56
+ }
57
+ repeated Action actions = 8;
58
+
59
+ repeated EntityReference bootEntities = 9;
60
+ repeated EntityReference fallbackBootNodeEntities = 10;
61
+ repeated EntityReference trustedEntities = 11;
62
+ repeated EntityReference censusServiceManagedEntities = 12;
63
+
64
+ // EXTERNAL FIELDS
65
+ // Allow to use arbitrary key/values so that
66
+ // entities can be organized by custom values.
67
+ map<string, string> meta = 100;
68
+ }
69
+
70
+
71
+ // Pointer to the place where the metadata of an Entity can be fetched
72
+ message EntityReference {
73
+ string entityId = 1;
74
+ repeated string entryPoints = 2; // Web3
75
+ }
@@ -0,0 +1,51 @@
1
+ /// Type: Client side helper model
2
+
3
+ syntax = "proto3";
4
+ package dvote.types.v1;
5
+
6
+ // The following models implement the structure of a JSON Feed
7
+ // https://jsonfeed.org/version/1
8
+
9
+ // Helper to serialize and store all cached posts from all entities
10
+ message FeedStore {
11
+ repeated Feed items = 1;
12
+ }
13
+
14
+ // A JSON Feed, containing a collection of posts
15
+ message Feed {
16
+ // OWN FIELDS
17
+ string version = 1;
18
+ string title = 2;
19
+ string home_page_url = 3;
20
+ string description = 4;
21
+ string feed_url = 5;
22
+ string icon = 6;
23
+ string favicon = 7;
24
+ bool expired = 8;
25
+
26
+ repeated FeedPost items = 9;
27
+
28
+ // EXTERNAL FIELDS
29
+ // Allow to use arbitrary key/values so that
30
+ // feeds can be organized by entity, language, etc.
31
+ map<string, string> meta = 100;
32
+ }
33
+
34
+ message FeedPost {
35
+ string id = 1; // or guid
36
+ string title = 2;
37
+ string summary = 3;
38
+ string content_text = 4;
39
+ string content_html = 5;
40
+ string url = 6;
41
+ string image = 7;
42
+ repeated string tags = 8;
43
+ string date_published = 9;
44
+ string date_modified = 10;
45
+
46
+ message Author {
47
+ string name = 1;
48
+ string url = 2;
49
+ }
50
+ Author author = 11;
51
+ }
@@ -0,0 +1,38 @@
1
+ /// Type: Client side helper model
2
+
3
+ syntax = "proto3";
4
+ package dvote.types.v1;
5
+
6
+ // Helper to serialize and store all cached data
7
+ message ProcessMetadataStore {
8
+ repeated ProcessMetadata items = 1;
9
+ }
10
+
11
+ message ProcessMetadata {
12
+ string version = 1;
13
+ map<string, string> title = 2;
14
+ map<string, string> description = 3;
15
+ map<string, string> media = 4;
16
+ message Question {
17
+ map<string, string> title = 1;
18
+ map<string, string> description = 2;
19
+
20
+ message VoteOption {
21
+ map<string, string> title = 1; // locale-aware value
22
+ int32 value = 2;
23
+ }
24
+ repeated VoteOption choices = 3;
25
+ }
26
+ repeated Question questions = 5;
27
+
28
+ message Results {
29
+ string aggregation = 1;
30
+ string display = 2;
31
+ }
32
+ Results results = 6;
33
+
34
+ // EXTERNAL FIELDS
35
+ // Allow to use arbitrary key/values so that
36
+ // processes can be tagged and organized by custom values.
37
+ map<string, string> meta = 100;
38
+ }
@@ -0,0 +1,33 @@
1
+ syntax = "proto3";
2
+
3
+ package dvote.types.v1;
4
+
5
+ import "vochain/vochain.proto";
6
+
7
+ option go_package = "go.vocdoni.io/proto/build/go/models";
8
+
9
+ // Process as it is stored in the Arbo-based StateDB
10
+ message StateDBProcess {
11
+ // vochain Process
12
+ Process process = 1;
13
+ // root of the StateDB SubTree that contains the proces' votes
14
+ bytes votesRoot = 2;
15
+ }
16
+
17
+ // Vote as it is stored in the Arbo-based StateDB
18
+ message StateDBVote {
19
+ // hash of the protobuf-marshalled Vote
20
+ bytes voteHash = 1;
21
+ // nullifier identifies the vote
22
+ bytes nullifier = 3;
23
+ // votePackage contains the choices for the vote
24
+ bytes votePackage = 4;
25
+ // weight of the vote
26
+ bytes Weight = 5;
27
+ // overwriteCount stores the number of times this vote has been overwritten
28
+ optional uint32 overwriteCount = 6;
29
+ }
30
+
31
+ message ProcessIdList {
32
+ repeated bytes processIds = 1;
33
+ }
@@ -0,0 +1,473 @@
1
+ syntax = "proto3";
2
+
3
+ package dvote.types.v1;
4
+
5
+ option go_package = "go.vocdoni.io/proto/build/go/models";
6
+
7
+ message VoteEnvelope {
8
+ // Unique number per vote attempt, so that replay attacks can't reuse this payload
9
+ bytes nonce = 1;
10
+ // The process for which the vote is casted
11
+ bytes processId = 2;
12
+ // Franchise proof
13
+ Proof proof = 3;
14
+ // JSON string of the Vote Package (potentially encrypted), encoded as bytes.
15
+ bytes votePackage = 4;
16
+ // Hash of the private key + processId
17
+ bytes nullifier = 5;
18
+ // On encrypted votes, contains the (sorted) indexes of the keys used to encrypt
19
+ repeated uint32 encryptionKeyIndexes = 6;
20
+ }
21
+
22
+ message Census {
23
+ enum Type {
24
+ UNKNOWN = 0;
25
+ ARBO_BLAKE2B = 1;
26
+ ARBO_POSEIDON = 2;
27
+ ETHEREUMSTORAGE = 3;
28
+ ETHEREUMACCOUNT = 4;
29
+ CA = 5;
30
+ GRAVITON = 1001;
31
+ IDEN3 = 1002;
32
+ }
33
+ }
34
+
35
+ message Proof {
36
+ oneof payload {
37
+ // Proof used for signed envelopes
38
+ ProofGraviton graviton = 1;
39
+ // Proof used for anonymous votes
40
+ ProofIden3 iden3 = 2;
41
+ // Proof used on EVM census based processes
42
+ ProofEthereumStorage ethereumStorage = 3;
43
+ // Proof used by oracles to update the census of EVM processes
44
+ ProofEthereumAccount ethereumAccount = 4;
45
+ // Proof Certification Authority
46
+ ProofCA ca = 5;
47
+ // Proof used for census using arbo
48
+ ProofArbo arbo = 6;
49
+ // zkSnark proof
50
+ ProofZkSNARK zkSnark = 7;
51
+ // Proof used in Minime token based census
52
+ ProofMinime minimeStorage = 8;
53
+ }
54
+ }
55
+
56
+ message ProofGraviton {
57
+ bytes siblings = 1;
58
+ }
59
+
60
+ message ProofIden3 {
61
+ bytes siblings = 1;
62
+ }
63
+
64
+ message ProofEthereumStorage {
65
+ bytes key = 1;
66
+ bytes value = 2;
67
+ repeated bytes siblings = 3;
68
+ }
69
+
70
+ message ProofEthereumAccount {
71
+ bytes nonce = 1;
72
+ bytes balance = 2; // Big Int encoded as bytes
73
+ bytes storageHash = 3;
74
+ bytes codeHash = 4;
75
+ repeated bytes siblings = 5;
76
+ }
77
+
78
+ message ProofMinime {
79
+ ProofEthereumStorage proofPrevBlock = 1;
80
+ ProofEthereumStorage proofNextBlock = 2;
81
+ }
82
+
83
+ message ProofCA {
84
+ enum Type {
85
+ UNKNOWN = 0;
86
+ ECDSA = 1;
87
+ ECDSA_PIDSALTED = 2;
88
+ ECDSA_BLIND = 3;
89
+ ECDSA_BLIND_PIDSALTED = 4;
90
+ }
91
+ Type type = 1;
92
+ CAbundle bundle = 2;
93
+ bytes signature = 3;
94
+ }
95
+
96
+ message CAbundle {
97
+ bytes processId = 1;
98
+ bytes address = 2;
99
+ }
100
+
101
+ message ProofArbo {
102
+ enum Type {
103
+ BLAKE2B = 0;
104
+ POSEIDON = 1;
105
+ }
106
+ enum KeyType {
107
+ PUBKEY = 0;
108
+ ADDRESS = 1;
109
+ }
110
+ Type type = 1;
111
+ bytes siblings = 2;
112
+ bytes value = 3;
113
+ KeyType keyType = 4;
114
+ }
115
+
116
+ // Groth16 zkSNARK proof + public inputs
117
+ message ProofZkSNARK {
118
+ // circuitParametersIndex defines the index of the parameter set of the
119
+ // circuit. Each process has defined a set of available parameters for
120
+ // the same circuit, the 'parametersIndex' defines the index of the set
121
+ // for which the ProofZkSNARK belongs for the circuit used in that
122
+ // process.
123
+ int32 circuitParametersIndex = 1;
124
+ // a represents a G1 point in Affine coordinates
125
+ repeated string a = 2;
126
+ // b represents a G2 point in Affine coordinates, represented by an
127
+ // array of arrays: []string => [2][2]bigint).
128
+ // [w, x, y, z] => [[w, x], [y, z]]
129
+ repeated string b = 3;
130
+ // c represents a G1 point in Affine coordinates
131
+ repeated string c = 4;
132
+ repeated string publicInputs = 5;
133
+ }
134
+
135
+ // Account represents an entity with an amount of tokens, usually attached to an address.
136
+ message Account {
137
+ uint64 balance = 1;
138
+ uint32 nonce = 2;
139
+ string infoURI = 3;
140
+ repeated bytes delegateAddrs = 4;
141
+ uint32 processIndex = 5;
142
+ }
143
+
144
+ message Treasurer {
145
+ bytes address = 1;
146
+ uint32 nonce = 2;
147
+ }
148
+
149
+ enum TxType {
150
+ TX_UNKNOWN = 0;
151
+ NEW_PROCESS = 1;
152
+ SET_PROCESS_STATUS = 2;
153
+ SET_PROCESS_CENSUS = 3;
154
+ SET_PROCESS_QUESTION_INDEX = 4;
155
+ ADD_PROCESS_KEYS = 5;
156
+ REVEAL_PROCESS_KEYS = 6;
157
+ ADD_ORACLE = 7;
158
+ REMOVE_ORACLE = 8;
159
+ ADD_VALIDATOR = 9;
160
+ REMOVE_VALIDATOR = 10;
161
+ VOTE = 11;
162
+ SET_PROCESS_RESULTS = 12;
163
+ REGISTER_VOTER_KEY = 13;
164
+ MINT_TOKENS = 14;
165
+ SEND_TOKENS = 15;
166
+ SET_TRANSACTION_COSTS = 16;
167
+ SET_ACCOUNT_INFO_URI = 17;
168
+ ADD_DELEGATE_FOR_ACCOUNT = 18;
169
+ DEL_DELEGATE_FOR_ACCOUNT = 19;
170
+ COLLECT_FAUCET = 20;
171
+ ADD_KEYKEEPER = 21;
172
+ DELETE_KEYKEEPER = 22;
173
+ CREATE_ACCOUNT = 23;
174
+ }
175
+
176
+ message Tx {
177
+ oneof payload {
178
+ VoteEnvelope vote = 1;
179
+ NewProcessTx newProcess = 2;
180
+ AdminTx admin = 3;
181
+ SetProcessTx setProcess = 4;
182
+ RegisterKeyTx registerKey = 5;
183
+ MintTokensTx mintTokens = 6;
184
+ SendTokensTx sendTokens = 7;
185
+ SetTransactionCostsTx setTransactionCosts = 8;
186
+ SetAccountTx setAccount = 9;
187
+ CollectFaucetTx collectFaucet = 10;
188
+ SetKeykeeperTx setKeykeeper = 11;
189
+ }
190
+ }
191
+
192
+ message SignedTx {
193
+ // The bytes produced by Marshaling a Tx{} message
194
+ bytes tx = 1;
195
+ // The signature for the tx bytes.
196
+ // signature is only required in those transactions that actually need signature.
197
+ // I.e zk-Snarks based transactions won't needed, however the transaction should use
198
+ // this message type in order to preserve consistency on the Vochain
199
+ optional bytes signature = 2;
200
+ }
201
+
202
+ message NewProcessTx {
203
+ TxType txtype = 1;
204
+ uint32 nonce = 2;
205
+ Process process = 3;
206
+ }
207
+
208
+ message SetProcessTx {
209
+ TxType txtype = 1;
210
+ uint32 nonce = 2;
211
+ bytes processId = 3;
212
+ optional ProcessStatus status = 4;
213
+ optional uint32 questionIndex = 5;
214
+ optional bytes censusRoot = 6;
215
+ optional string censusURI = 7;
216
+ optional Proof proof = 8;
217
+ optional ProcessResult results = 9;
218
+ }
219
+
220
+ message AdminTx {
221
+ TxType txtype = 1;
222
+ bytes processId = 2;
223
+ optional bytes address = 3;
224
+ optional bytes encryptionPrivateKey = 5;
225
+ optional bytes encryptionPublicKey = 6;
226
+ optional uint32 keyIndex = 7;
227
+ optional uint64 power = 8;
228
+ optional bytes publicKey = 9;
229
+ uint32 nonce = 11;
230
+ }
231
+
232
+ message RegisterKeyTx {
233
+ uint32 nonce = 1; // Unique number per vote attempt, so that replay attacks can't reuse this payload
234
+ bytes processId = 2; // The process for which the vote is casted
235
+ Proof proof = 3; // Franchise proof
236
+ bytes newKey = 4; // New key to register
237
+ string weight = 5; // Weight to delegate to newKey
238
+ }
239
+
240
+ message MintTokensTx {
241
+ TxType txtype = 1;
242
+ uint32 nonce = 2;
243
+ bytes to = 3;
244
+ uint64 value = 4;
245
+ }
246
+
247
+ message SendTokensTx {
248
+ TxType txtype = 1;
249
+ uint32 nonce = 2;
250
+ bytes from = 3;
251
+ bytes to = 4;
252
+ uint64 value = 5;
253
+ }
254
+
255
+ message SetTransactionCostsTx {
256
+ TxType txtype = 1;
257
+ uint32 nonce = 2;
258
+ uint64 value = 3;
259
+ }
260
+
261
+ message SetAccountTx {
262
+ TxType txtype = 1;
263
+ optional uint32 nonce = 2;
264
+ optional string infoURI = 3;
265
+ optional bytes account = 4;
266
+ optional FaucetPackage faucetPackage = 5;
267
+ repeated bytes delegates = 6;
268
+ }
269
+
270
+ message CollectFaucetTx {
271
+ TxType txType = 1;
272
+ FaucetPackage faucetPackage = 2;
273
+ uint32 nonce = 3;
274
+ }
275
+
276
+ message FaucetPayload {
277
+ uint64 identifier = 1;
278
+ bytes to = 2;
279
+ uint64 amount = 3;
280
+ }
281
+
282
+ message FaucetPackage {
283
+ bytes payload = 1;
284
+ bytes signature = 2;
285
+ }
286
+
287
+ message SetKeykeeperTx {
288
+ TxType txtype = 1;
289
+ uint32 nonce = 2;
290
+ bytes keykeeper = 3;
291
+ }
292
+
293
+ message Process {
294
+ bytes processId = 1;
295
+ // EntityId identifies unequivocally an entity
296
+ bytes entityId = 2;
297
+ // StartBlock represents the tendermint block where the process goes from scheduled to active
298
+ uint32 startBlock = 3;
299
+ // BlockCount represents the amount of tendermint blocks that the process will last
300
+ uint32 blockCount = 4;
301
+ // CensusRoot merkle root of all the census in the process
302
+ bytes censusRoot = 5;
303
+ // CensusURI where to find the census
304
+ optional string censusURI = 6;
305
+ // EncryptionPrivateKeys are the keys required to decrypt the votes
306
+ repeated string encryptionPrivateKeys = 8;
307
+ // EncryptionPublicKeys are the keys required to encrypt the votes
308
+ repeated string encryptionPublicKeys = 9;
309
+ optional uint32 keyIndex = 11;
310
+ ProcessStatus status = 12;
311
+ optional bytes paramsSignature = 13;
312
+ uint32 namespace = 14;
313
+ EnvelopeType envelopeType = 15;
314
+ ProcessMode mode = 16;
315
+ optional uint32 questionIndex = 17;
316
+ optional uint32 questionCount = 18;
317
+ ProcessVoteOptions voteOptions = 19;
318
+ CensusOrigin censusOrigin = 20;
319
+ repeated ProcessResult results = 21;
320
+ repeated bytes resultsSignatures = 22;
321
+ optional uint32 ethIndexSlot = 23;
322
+ // SourceBlockHeight is the block height of the origin blockchain (if any)
323
+ optional uint64 sourceBlockHeight = 24;
324
+ // Owner is the creator of a process (if any) otherwise is assumed the creator is the entityId
325
+ optional bytes owner = 25;
326
+ // Metadata is the content hashed URI of the JSON meta data (See Data Origins)
327
+ optional string metadata = 26;
328
+ // SourceNetworkId is the identifier of the network origin (where the process have been created)
329
+ SourceNetworkId sourceNetworkId = 27;
330
+ // MaxCensusSize is set by the Process creator.
331
+ optional uint64 maxCensusSize = 28;
332
+ // RollingCensusRoot merkle root of the rolling census. Set by the
333
+ // vocdoni-node when Mode.Process = true
334
+ optional bytes rollingCensusRoot = 29;
335
+ // RollingCensusSize is set by the vocdoni-node when Mode.PreRegister =
336
+ // true and the StartBlock has been reached.
337
+ optional uint64 rollingCensusSize = 30;
338
+ // NullifiersRoot is the root of the pre-census nullifiers merkle tree.
339
+ // Used when Mode.PreRegister = true.
340
+ optional bytes nullifiersRoot = 31;
341
+ // sourceNetworkContractAddr is used for EVM token based voting and it is
342
+ // the contract address of the token that is going to define the census
343
+ optional bytes sourceNetworkContractAddr = 32;
344
+ // tokenDecimals represents the number of decimals of the token (i.e ERC20) used for voting.
345
+ // It is normally used for processes with on-chain census
346
+ optional uint32 tokenDecimals = 33;
347
+ }
348
+
349
+ enum ProcessStatus {
350
+ PROCESS_UNKNOWN = 0;
351
+ READY = 1;
352
+ ENDED = 2;
353
+ CANCELED = 3;
354
+ PAUSED = 4;
355
+ RESULTS = 5;
356
+ }
357
+
358
+ enum SourceNetworkId {
359
+ UNKNOWN = 0;
360
+ ETH_MAINNET = 1;
361
+ ETH_RINKEBY = 2;
362
+ ETH_GOERLI = 3;
363
+ POA_XDAI = 4;
364
+ POA_SOKOL = 5;
365
+ POLYGON = 6;
366
+ BSC = 7;
367
+ ETH_MAINNET_SIGNALING = 8;
368
+ ETH_RINKEBY_SIGNALING = 9;
369
+ AVAX_FUJI = 10;
370
+ AVAX = 11;
371
+ POLYGON_MUMBAI = 12;
372
+ OPTIMISM = 13;
373
+ ARBITRUM = 14;
374
+ }
375
+
376
+ enum CensusOrigin {
377
+ CENSUS_UNKNOWN = 0;
378
+ OFF_CHAIN_TREE = 1;
379
+ OFF_CHAIN_TREE_WEIGHTED = 2;
380
+ OFF_CHAIN_CA = 3;
381
+ ERC20 = 11;
382
+ ERC721 = 12;
383
+ ERC1155 = 13;
384
+ ERC777 = 14;
385
+ MINI_ME = 15;
386
+ }
387
+
388
+ message EnvelopeType {
389
+ bool serial = 1;
390
+ bool anonymous = 2;
391
+ bool encryptedVotes = 3;
392
+ bool uniqueValues = 4;
393
+ bool costFromWeight = 5;
394
+ }
395
+
396
+ message ProcessMode {
397
+ bool autoStart = 1;
398
+ bool interruptible = 2;
399
+ bool dynamicCensus = 3;
400
+ bool encryptedMetaData = 4;
401
+ bool preRegister = 5;
402
+ }
403
+
404
+ message ProcessVoteOptions {
405
+ uint32 maxCount = 1;
406
+ uint32 maxValue = 2;
407
+ uint32 maxVoteOverwrites = 3;
408
+ uint32 maxTotalCost = 4;
409
+ uint32 costExponent = 5;
410
+ }
411
+
412
+ message OracleList {
413
+ repeated bytes oracles = 1;
414
+ }
415
+
416
+ message ValidatorList {
417
+ repeated Validator validators = 1;
418
+ }
419
+
420
+ message Validator {
421
+ bytes address = 1;
422
+ bytes pubKey = 2;
423
+ uint64 power = 3;
424
+ string name = 4;
425
+ }
426
+
427
+ message TendermintHeader {
428
+ // basic block info
429
+ string chain_id = 2 ;
430
+ int64 height = 3;
431
+ int64 timestamp = 4 ;
432
+
433
+ // prev block info
434
+ bytes blockID = 5;
435
+
436
+ // hashes of block data
437
+ bytes last_commit_hash = 6; // commit from validators from the last block
438
+ bytes data_hash = 7; // transactions
439
+
440
+ // hashes from the app output from the prev block
441
+ bytes validators_hash = 8; // validators for the current block
442
+ bytes next_validators_hash = 9; // validators for the next block
443
+ bytes consensus_hash = 10; // consensus params for current block
444
+ bytes app_hash = 11; // state after txs from the previous block
445
+ bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
446
+
447
+ // consensus info
448
+ bytes evidence_hash = 13; // evidence included in the block
449
+ bytes proposer_address = 14; // original proposer of the block
450
+ }
451
+
452
+
453
+ // Scrutinizer
454
+ message ProcessResult {
455
+ repeated QuestionResult votes = 1;
456
+ optional bytes processId = 2;
457
+ optional bytes entityId = 3;
458
+ optional bytes oracleAddress = 4;
459
+ optional bytes signature = 5;
460
+ }
461
+
462
+ message QuestionResult {
463
+ repeated bytes question = 1;
464
+ }
465
+
466
+ message ProcessEndingList {
467
+ repeated bytes processList = 1;
468
+ }
469
+
470
+ // KeyKeeper
471
+ message StoredKeys {
472
+ repeated bytes pids = 1;
473
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "esnext",
4
+ "module": "esnext",
5
+ "esModuleInterop": true,
6
+ "forceConsistentCasingInFileNames": true,
7
+ "strict": true,
8
+ "moduleResolution": "node",
9
+ "skipLibCheck": true
10
+ },
11
+ "exclude": [
12
+ "example",
13
+ "typescript"
14
+ ]
15
+ }