@vocdoni/proto 1.15.2 → 1.15.4
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/build/js/client-store/index.d.ts +3 -0
- package/build/js/client-store/index.js +2904 -0
- package/build/js/client-store/index.mjs +2891 -0
- package/build/js/entity-e8dfcd83.d.ts +1804 -0
- package/build/js/index-05df597a.d.ts +1972 -0
- package/build/js/index-5d7943a4.d.ts +10656 -0
- package/build/js/index-d457aeb5.d.ts +1924 -0
- package/build/js/index.d.ts +5 -0
- package/build/js/index.js +406 -588
- package/build/js/index.mjs +10682 -0
- package/build/js/metadata/index.d.ts +3 -0
- package/build/js/metadata/index.js +4314 -0
- package/build/js/metadata/index.mjs +4271 -0
- package/build/js/vochain/index.d.ts +2 -0
- package/build/js/vochain/index.js +6489 -0
- package/build/js/vochain/index.mjs +6414 -0
- package/package.json +7 -3
- package/.github/workflows/on-release.yml +0 -19
- package/.github/workflows/post-merge.yml +0 -30
- package/AUTHORS +0 -7
- package/DEVELOPING.md +0 -86
- package/Makefile +0 -140
- package/bin/protoc +0 -0
- package/code-of-conduct.md +0 -77
- package/go.mod +0 -8
- package/go.sum +0 -69
- package/include/google/protobuf/any.proto +0 -158
- package/include/google/protobuf/api.proto +0 -208
- package/include/google/protobuf/compiler/plugin.proto +0 -183
- package/include/google/protobuf/descriptor.proto +0 -909
- package/include/google/protobuf/duration.proto +0 -116
- package/include/google/protobuf/empty.proto +0 -52
- package/include/google/protobuf/field_mask.proto +0 -245
- package/include/google/protobuf/source_context.proto +0 -48
- package/include/google/protobuf/struct.proto +0 -95
- package/include/google/protobuf/timestamp.proto +0 -147
- package/include/google/protobuf/type.proto +0 -187
- package/include/google/protobuf/wrappers.proto +0 -123
- package/src/client-store/account.proto +0 -54
- package/src/client-store/backup.proto +0 -65
- package/src/client-store/gateway.proto +0 -35
- package/src/client-store/wallet.proto +0 -19
- package/src/ipfsSync/ipfssync.proto +0 -26
- package/src/metadata/entity.proto +0 -75
- package/src/metadata/feed.proto +0 -51
- package/src/metadata/process.proto +0 -38
- package/src/vocdoni-node/statedb.proto +0 -35
- package/src/vochain/vochain.proto +0 -493
- package/tsconfig.json +0 -15
- package/tsup.config.ts +0 -15
|
@@ -1,75 +0,0 @@
|
|
|
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
|
-
}
|
package/src/metadata/feed.proto
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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
|
-
// encryptionKeyIndexes stores the indexes of the encryption keys used to encrypt the vote
|
|
30
|
-
repeated uint32 encryptionKeyIndexes = 7;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message ProcessIdList {
|
|
34
|
-
repeated bytes processIds = 1;
|
|
35
|
-
}
|
|
@@ -1,493 +0,0 @@
|
|
|
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 availableWeight = 3;
|
|
113
|
-
KeyType keyType = 4;
|
|
114
|
-
bytes voteWeight = 5;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Groth16 zkSNARK proof + public inputs
|
|
118
|
-
message ProofZkSNARK {
|
|
119
|
-
// circuitParametersIndex defines the index of the parameter set of the
|
|
120
|
-
// circuit. Each process has defined a set of available parameters for
|
|
121
|
-
// the same circuit, the 'parametersIndex' defines the index of the set
|
|
122
|
-
// for which the ProofZkSNARK belongs for the circuit used in that
|
|
123
|
-
// process.
|
|
124
|
-
int32 circuitParametersIndex = 1;
|
|
125
|
-
// a represents a G1 point in Affine coordinates
|
|
126
|
-
repeated string a = 2;
|
|
127
|
-
// b represents a G2 point in Affine coordinates, represented by an
|
|
128
|
-
// array of arrays: []string => [2][2]bigint).
|
|
129
|
-
// [w, x, y, z] => [[w, x], [y, z]]
|
|
130
|
-
repeated string b = 3;
|
|
131
|
-
// c represents a G1 point in Affine coordinates
|
|
132
|
-
repeated string c = 4;
|
|
133
|
-
repeated string publicInputs = 5;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Account represents an entity with an amount of tokens, usually attached to an address.
|
|
137
|
-
message Account {
|
|
138
|
-
uint64 balance = 1;
|
|
139
|
-
uint32 nonce = 2;
|
|
140
|
-
string infoURI = 3;
|
|
141
|
-
repeated bytes delegateAddrs = 4;
|
|
142
|
-
uint32 processIndex = 5;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
message Treasurer {
|
|
146
|
-
bytes address = 1;
|
|
147
|
-
uint32 nonce = 2;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
enum TxType {
|
|
151
|
-
TX_UNKNOWN = 0;
|
|
152
|
-
NEW_PROCESS = 1;
|
|
153
|
-
SET_PROCESS_STATUS = 2;
|
|
154
|
-
SET_PROCESS_CENSUS = 3;
|
|
155
|
-
SET_PROCESS_QUESTION_INDEX = 4;
|
|
156
|
-
ADD_PROCESS_KEYS = 5;
|
|
157
|
-
REVEAL_PROCESS_KEYS = 6;
|
|
158
|
-
ADD_ORACLE = 7;
|
|
159
|
-
REMOVE_ORACLE = 8;
|
|
160
|
-
ADD_VALIDATOR = 9;
|
|
161
|
-
REMOVE_VALIDATOR = 10;
|
|
162
|
-
VOTE = 11;
|
|
163
|
-
SET_PROCESS_RESULTS = 12;
|
|
164
|
-
REGISTER_VOTER_KEY = 13;
|
|
165
|
-
MINT_TOKENS = 14;
|
|
166
|
-
SEND_TOKENS = 15;
|
|
167
|
-
SET_TRANSACTION_COSTS = 16;
|
|
168
|
-
SET_ACCOUNT_INFO_URI = 17;
|
|
169
|
-
ADD_DELEGATE_FOR_ACCOUNT = 18;
|
|
170
|
-
DEL_DELEGATE_FOR_ACCOUNT = 19;
|
|
171
|
-
COLLECT_FAUCET = 20;
|
|
172
|
-
ADD_KEYKEEPER = 21;
|
|
173
|
-
DELETE_KEYKEEPER = 22;
|
|
174
|
-
CREATE_ACCOUNT = 23;
|
|
175
|
-
SET_ACCOUNT_SIK = 24;
|
|
176
|
-
DEL_ACCOUNT_SIK = 25;
|
|
177
|
-
REGISTER_SIK = 26;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
message Tx {
|
|
181
|
-
oneof payload {
|
|
182
|
-
VoteEnvelope vote = 1;
|
|
183
|
-
NewProcessTx newProcess = 2;
|
|
184
|
-
AdminTx admin = 3;
|
|
185
|
-
SetProcessTx setProcess = 4;
|
|
186
|
-
RegisterKeyTx registerKey = 5;
|
|
187
|
-
MintTokensTx mintTokens = 6;
|
|
188
|
-
SendTokensTx sendTokens = 7;
|
|
189
|
-
SetTransactionCostsTx setTransactionCosts = 8;
|
|
190
|
-
SetAccountTx setAccount = 9;
|
|
191
|
-
CollectFaucetTx collectFaucet = 10;
|
|
192
|
-
SetKeykeeperTx setKeykeeper = 11;
|
|
193
|
-
SIKTx setSIK = 12;
|
|
194
|
-
SIKTx delSIK = 13;
|
|
195
|
-
RegisterSIKTx registerSIK = 14;
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
message SignedTx {
|
|
200
|
-
// The bytes produced by Marshaling a Tx{} message
|
|
201
|
-
bytes tx = 1;
|
|
202
|
-
// The signature for the tx bytes.
|
|
203
|
-
// signature is only required in those transactions that actually need signature.
|
|
204
|
-
// I.e zk-Snarks based transactions won't needed, however the transaction should use
|
|
205
|
-
// this message type in order to preserve consistency on the Vochain
|
|
206
|
-
optional bytes signature = 2;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
message NewProcessTx {
|
|
210
|
-
TxType txtype = 1;
|
|
211
|
-
uint32 nonce = 2;
|
|
212
|
-
Process process = 3;
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
message SetProcessTx {
|
|
216
|
-
TxType txtype = 1;
|
|
217
|
-
uint32 nonce = 2;
|
|
218
|
-
bytes processId = 3;
|
|
219
|
-
optional ProcessStatus status = 4;
|
|
220
|
-
optional uint32 questionIndex = 5;
|
|
221
|
-
optional bytes censusRoot = 6;
|
|
222
|
-
optional string censusURI = 7;
|
|
223
|
-
optional Proof proof = 8;
|
|
224
|
-
optional ProcessResult results = 9;
|
|
225
|
-
// tempSIKs flag decides if when the process has finished, the SIKs related
|
|
226
|
-
// to it will be removed or not
|
|
227
|
-
optional bool tempSIKs = 10;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
message AdminTx {
|
|
231
|
-
TxType txtype = 1;
|
|
232
|
-
bytes processId = 2;
|
|
233
|
-
optional bytes address = 3;
|
|
234
|
-
optional bytes encryptionPrivateKey = 5;
|
|
235
|
-
optional bytes encryptionPublicKey = 6;
|
|
236
|
-
optional uint32 keyIndex = 7;
|
|
237
|
-
optional uint64 power = 8;
|
|
238
|
-
optional bytes publicKey = 9;
|
|
239
|
-
uint32 nonce = 11;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
message RegisterKeyTx {
|
|
243
|
-
uint32 nonce = 1; // Unique number per vote attempt, so that replay attacks can't reuse this payload
|
|
244
|
-
bytes processId = 2; // The process for which the vote is casted
|
|
245
|
-
Proof proof = 3; // Franchise proof
|
|
246
|
-
bytes newKey = 4; // New key to register
|
|
247
|
-
string weight = 5; // Weight to delegate to newKey
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
message MintTokensTx {
|
|
251
|
-
TxType txtype = 1;
|
|
252
|
-
uint32 nonce = 2;
|
|
253
|
-
bytes to = 3;
|
|
254
|
-
uint64 value = 4;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
message SendTokensTx {
|
|
258
|
-
TxType txtype = 1;
|
|
259
|
-
uint32 nonce = 2;
|
|
260
|
-
bytes from = 3;
|
|
261
|
-
bytes to = 4;
|
|
262
|
-
uint64 value = 5;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
message SetTransactionCostsTx {
|
|
266
|
-
TxType txtype = 1;
|
|
267
|
-
uint32 nonce = 2;
|
|
268
|
-
uint64 value = 3;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
message SetAccountTx {
|
|
272
|
-
TxType txtype = 1;
|
|
273
|
-
optional uint32 nonce = 2;
|
|
274
|
-
optional string infoURI = 3;
|
|
275
|
-
optional bytes account = 4;
|
|
276
|
-
optional FaucetPackage faucetPackage = 5;
|
|
277
|
-
repeated bytes delegates = 6;
|
|
278
|
-
optional bytes SIK = 7;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
message SIKTx {
|
|
282
|
-
TxType txtype = 1;
|
|
283
|
-
optional bytes SIK = 3;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
message RegisterSIKTx {
|
|
287
|
-
bytes electionId = 1;
|
|
288
|
-
Proof censusProof = 2;
|
|
289
|
-
bytes SIK = 3;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
message CollectFaucetTx {
|
|
293
|
-
TxType txType = 1;
|
|
294
|
-
FaucetPackage faucetPackage = 2;
|
|
295
|
-
uint32 nonce = 3;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
message FaucetPayload {
|
|
299
|
-
uint64 identifier = 1;
|
|
300
|
-
bytes to = 2;
|
|
301
|
-
uint64 amount = 3;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
message FaucetPackage {
|
|
305
|
-
bytes payload = 1;
|
|
306
|
-
bytes signature = 2;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
message SetKeykeeperTx {
|
|
310
|
-
TxType txtype = 1;
|
|
311
|
-
uint32 nonce = 2;
|
|
312
|
-
bytes keykeeper = 3;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
message Process {
|
|
316
|
-
bytes processId = 1;
|
|
317
|
-
// EntityId identifies unequivocally an entity
|
|
318
|
-
bytes entityId = 2;
|
|
319
|
-
// StartBlock represents the tendermint block where the process goes from scheduled to active
|
|
320
|
-
uint32 startBlock = 3;
|
|
321
|
-
// BlockCount represents the amount of tendermint blocks that the process will last
|
|
322
|
-
uint32 blockCount = 4;
|
|
323
|
-
// CensusRoot merkle root of all the census in the process
|
|
324
|
-
bytes censusRoot = 5;
|
|
325
|
-
// CensusURI where to find the census
|
|
326
|
-
optional string censusURI = 6;
|
|
327
|
-
// EncryptionPrivateKeys are the keys required to decrypt the votes
|
|
328
|
-
repeated string encryptionPrivateKeys = 8;
|
|
329
|
-
// EncryptionPublicKeys are the keys required to encrypt the votes
|
|
330
|
-
repeated string encryptionPublicKeys = 9;
|
|
331
|
-
optional uint32 keyIndex = 11;
|
|
332
|
-
ProcessStatus status = 12;
|
|
333
|
-
optional bytes paramsSignature = 13;
|
|
334
|
-
uint32 namespace = 14;
|
|
335
|
-
EnvelopeType envelopeType = 15;
|
|
336
|
-
ProcessMode mode = 16;
|
|
337
|
-
optional uint32 questionIndex = 17;
|
|
338
|
-
optional uint32 questionCount = 18;
|
|
339
|
-
ProcessVoteOptions voteOptions = 19;
|
|
340
|
-
CensusOrigin censusOrigin = 20;
|
|
341
|
-
ProcessResult results = 21;
|
|
342
|
-
optional uint32 ethIndexSlot = 23;
|
|
343
|
-
// SourceBlockHeight is the block height of the origin blockchain (if any)
|
|
344
|
-
optional uint64 sourceBlockHeight = 24;
|
|
345
|
-
// Owner is the creator of a process (if any) otherwise is assumed the creator is the entityId
|
|
346
|
-
optional bytes owner = 25;
|
|
347
|
-
// Metadata is the content hashed URI of the JSON meta data (See Data Origins)
|
|
348
|
-
optional string metadata = 26;
|
|
349
|
-
// SourceNetworkId is the identifier of the network origin (where the process have been created)
|
|
350
|
-
SourceNetworkId sourceNetworkId = 27;
|
|
351
|
-
// MaxCensusSize is set by the Process creator, indicates the maximum number of votes that will be allowed.
|
|
352
|
-
uint64 maxCensusSize = 28;
|
|
353
|
-
// RollingCensusRoot merkle root of the rolling census. Set by the
|
|
354
|
-
// vocdoni-node when Mode.Process = true
|
|
355
|
-
optional bytes rollingCensusRoot = 29;
|
|
356
|
-
// RollingCensusSize is set by the vocdoni-node when Mode.PreRegister =
|
|
357
|
-
// true and the StartBlock has been reached.
|
|
358
|
-
optional uint64 rollingCensusSize = 30;
|
|
359
|
-
// NullifiersRoot is the root of the pre-census nullifiers merkle tree.
|
|
360
|
-
// Used when Mode.PreRegister = true.
|
|
361
|
-
optional bytes nullifiersRoot = 31;
|
|
362
|
-
// sourceNetworkContractAddr is used for EVM token based voting and it is
|
|
363
|
-
// the contract address of the token that is going to define the census
|
|
364
|
-
optional bytes sourceNetworkContractAddr = 32;
|
|
365
|
-
// tokenDecimals represents the number of decimals of the token (i.e ERC20) used for voting.
|
|
366
|
-
// It is normally used for processes with on-chain census
|
|
367
|
-
optional uint32 tokenDecimals = 33;
|
|
368
|
-
// tempSIKs flag decides if when the process has finished, the SIKs related
|
|
369
|
-
// to it will be removed or not
|
|
370
|
-
optional bool tempSIKs = 34;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
enum ProcessStatus {
|
|
374
|
-
PROCESS_UNKNOWN = 0;
|
|
375
|
-
READY = 1;
|
|
376
|
-
ENDED = 2;
|
|
377
|
-
CANCELED = 3;
|
|
378
|
-
PAUSED = 4;
|
|
379
|
-
RESULTS = 5;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
enum SourceNetworkId {
|
|
383
|
-
UNKNOWN = 0;
|
|
384
|
-
ETH_MAINNET = 1;
|
|
385
|
-
ETH_RINKEBY = 2;
|
|
386
|
-
ETH_GOERLI = 3;
|
|
387
|
-
POA_XDAI = 4;
|
|
388
|
-
POA_SOKOL = 5;
|
|
389
|
-
POLYGON = 6;
|
|
390
|
-
BSC = 7;
|
|
391
|
-
ETH_MAINNET_SIGNALING = 8;
|
|
392
|
-
ETH_RINKEBY_SIGNALING = 9;
|
|
393
|
-
AVAX_FUJI = 10;
|
|
394
|
-
AVAX = 11;
|
|
395
|
-
POLYGON_MUMBAI = 12;
|
|
396
|
-
OPTIMISM = 13;
|
|
397
|
-
ARBITRUM = 14;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
enum CensusOrigin {
|
|
401
|
-
CENSUS_UNKNOWN = 0;
|
|
402
|
-
OFF_CHAIN_TREE = 1;
|
|
403
|
-
OFF_CHAIN_TREE_WEIGHTED = 2;
|
|
404
|
-
OFF_CHAIN_CA = 3;
|
|
405
|
-
ERC20 = 11;
|
|
406
|
-
ERC721 = 12;
|
|
407
|
-
ERC1155 = 13;
|
|
408
|
-
ERC777 = 14;
|
|
409
|
-
MINI_ME = 15;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
message EnvelopeType {
|
|
413
|
-
bool serial = 1;
|
|
414
|
-
bool anonymous = 2;
|
|
415
|
-
bool encryptedVotes = 3;
|
|
416
|
-
bool uniqueValues = 4;
|
|
417
|
-
bool costFromWeight = 5;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
message ProcessMode {
|
|
421
|
-
bool autoStart = 1;
|
|
422
|
-
bool interruptible = 2;
|
|
423
|
-
bool dynamicCensus = 3;
|
|
424
|
-
bool encryptedMetaData = 4;
|
|
425
|
-
bool preRegister = 5;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
message ProcessVoteOptions {
|
|
429
|
-
uint32 maxCount = 1;
|
|
430
|
-
uint32 maxValue = 2;
|
|
431
|
-
uint32 maxVoteOverwrites = 3;
|
|
432
|
-
uint32 maxTotalCost = 4;
|
|
433
|
-
uint32 costExponent = 5;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
message OracleList {
|
|
437
|
-
repeated bytes oracles = 1;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
message ValidatorList {
|
|
441
|
-
repeated Validator validators = 1;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
message Validator {
|
|
445
|
-
bytes address = 1;
|
|
446
|
-
bytes pubKey = 2;
|
|
447
|
-
uint64 power = 3;
|
|
448
|
-
string name = 4;
|
|
449
|
-
uint32 keyIndex = 5;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
message TendermintHeader {
|
|
453
|
-
// basic block info
|
|
454
|
-
string chain_id = 2 ;
|
|
455
|
-
int64 height = 3;
|
|
456
|
-
int64 timestamp = 4 ;
|
|
457
|
-
|
|
458
|
-
// prev block info
|
|
459
|
-
bytes blockID = 5;
|
|
460
|
-
|
|
461
|
-
// hashes of block data
|
|
462
|
-
bytes last_commit_hash = 6; // commit from validators from the last block
|
|
463
|
-
bytes data_hash = 7; // transactions
|
|
464
|
-
|
|
465
|
-
// hashes from the app output from the prev block
|
|
466
|
-
bytes validators_hash = 8; // validators for the current block
|
|
467
|
-
bytes next_validators_hash = 9; // validators for the next block
|
|
468
|
-
bytes consensus_hash = 10; // consensus params for current block
|
|
469
|
-
bytes app_hash = 11; // state after txs from the previous block
|
|
470
|
-
bytes last_results_hash = 12; // root hash of all results from the txs from the previous block
|
|
471
|
-
|
|
472
|
-
// consensus info
|
|
473
|
-
bytes evidence_hash = 13; // evidence included in the block
|
|
474
|
-
bytes proposer_address = 14; // original proposer of the block
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
message ProcessResult {
|
|
479
|
-
repeated QuestionResult votes = 1;
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
message QuestionResult {
|
|
483
|
-
repeated bytes question = 1;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
message ProcessEndingList {
|
|
487
|
-
repeated bytes processList = 1;
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
// KeyKeeper
|
|
491
|
-
message StoredKeys {
|
|
492
|
-
repeated bytes pids = 1;
|
|
493
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|