@dashevo/dapi-grpc 0.25.22 → 1.0.0-beta.2
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/Cargo.toml +35 -16
- package/build.rs +139 -56
- package/clients/core/v0/nodejs/CorePromiseClient.js +124 -13
- package/clients/core/v0/nodejs/core_pbjs.js +1922 -987
- package/clients/core/v0/nodejs/core_protoc.js +1291 -645
- package/clients/core/v0/rust/core_example.rs +1 -1
- package/clients/core/v0/web/CorePromiseClient.js +49 -5
- package/clients/core/v0/web/core_pb.d.ts +173 -89
- package/clients/core/v0/web/core_pb.js +1291 -645
- package/clients/core/v0/web/core_pb_service.d.ts +59 -10
- package/clients/core/v0/web/core_pb_service.js +134 -6
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +208 -14
- package/clients/platform/v0/nodejs/platform_pbjs.js +22951 -9938
- package/clients/platform/v0/nodejs/platform_protoc.js +22332 -9091
- package/clients/platform/v0/rust/platform_example.rs +1 -1
- package/clients/platform/v0/web/PlatformPromiseClient.js +64 -8
- package/clients/platform/v0/web/platform_pb.d.ts +2057 -302
- package/clients/platform/v0/web/platform_pb.js +22332 -9091
- package/clients/platform/v0/web/platform_pb_service.d.ts +187 -35
- package/clients/platform/v0/web/platform_pb_service.js +355 -35
- package/package.json +2 -2
- package/protos/core/v0/core.proto +45 -23
- package/protos/platform/v0/platform.proto +429 -50
- package/src/lib.rs +26 -2
- package/src/mock/serde_mockable.rs +105 -0
- package/src/mock.rs +130 -0
- package/test/unit/clients/core/v0/nodejs/CorePromiseClient.spec.js +27 -6
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +55 -1
- package/test/unit/getCoreDefinition.spec.js +5 -2
- package/src/core/proto/org.dash.platform.dapi.v0.rs +0 -666
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +0 -2481
|
@@ -10,8 +10,10 @@ service Platform {
|
|
|
10
10
|
rpc broadcastStateTransition(BroadcastStateTransitionRequest)
|
|
11
11
|
returns (BroadcastStateTransitionResponse);
|
|
12
12
|
rpc getIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
|
13
|
-
rpc getIdentities(GetIdentitiesRequest) returns (GetIdentitiesResponse);
|
|
14
13
|
rpc getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse);
|
|
14
|
+
rpc getIdentitiesContractKeys(GetIdentitiesContractKeysRequest) returns (GetIdentitiesContractKeysResponse);
|
|
15
|
+
rpc getIdentityNonce(GetIdentityNonceRequest) returns (GetIdentityNonceResponse);
|
|
16
|
+
rpc getIdentityContractNonce(GetIdentityContractNonceRequest) returns (GetIdentityContractNonceResponse);
|
|
15
17
|
rpc getIdentityBalance(GetIdentityBalanceRequest)
|
|
16
18
|
returns (GetIdentityBalanceResponse);
|
|
17
19
|
rpc getIdentityBalanceAndRevision(GetIdentityBalanceAndRevisionRequest)
|
|
@@ -23,8 +25,6 @@ service Platform {
|
|
|
23
25
|
rpc getDataContracts(GetDataContractsRequest)
|
|
24
26
|
returns (GetDataContractsResponse);
|
|
25
27
|
rpc getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
|
|
26
|
-
rpc getIdentitiesByPublicKeyHashes(GetIdentitiesByPublicKeyHashesRequest)
|
|
27
|
-
returns (GetIdentitiesByPublicKeyHashesResponse);
|
|
28
28
|
rpc getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest)
|
|
29
29
|
returns (GetIdentityByPublicKeyHashResponse);
|
|
30
30
|
rpc waitForStateTransitionResult(WaitForStateTransitionResultRequest)
|
|
@@ -34,6 +34,18 @@ service Platform {
|
|
|
34
34
|
rpc getProtocolVersionUpgradeState(GetProtocolVersionUpgradeStateRequest) returns (GetProtocolVersionUpgradeStateResponse);
|
|
35
35
|
rpc getProtocolVersionUpgradeVoteStatus(GetProtocolVersionUpgradeVoteStatusRequest) returns (GetProtocolVersionUpgradeVoteStatusResponse);
|
|
36
36
|
rpc getEpochsInfo(GetEpochsInfoRequest) returns (GetEpochsInfoResponse);
|
|
37
|
+
// What votes are currently happening for a specific contested index
|
|
38
|
+
rpc getContestedResources(GetContestedResourcesRequest) returns (GetContestedResourcesResponse);
|
|
39
|
+
// What's the state of a contested resource vote? (ie who is winning?)
|
|
40
|
+
rpc getContestedResourceVoteState(GetContestedResourceVoteStateRequest) returns (GetContestedResourceVoteStateResponse);
|
|
41
|
+
// Who voted for a contested resource to go to a specific identity?
|
|
42
|
+
rpc getContestedResourceVotersForIdentity(GetContestedResourceVotersForIdentityRequest) returns (GetContestedResourceVotersForIdentityResponse);
|
|
43
|
+
// How did an identity vote?
|
|
44
|
+
rpc getContestedResourceIdentityVotes(GetContestedResourceIdentityVotesRequest) returns (GetContestedResourceIdentityVotesResponse);
|
|
45
|
+
// What vote polls will end soon?
|
|
46
|
+
rpc getVotePollsByEndDate(GetVotePollsByEndDateRequest) returns (GetVotePollsByEndDateResponse);
|
|
47
|
+
rpc getPrefundedSpecializedBalance(GetPrefundedSpecializedBalanceRequest) returns (GetPrefundedSpecializedBalanceResponse);
|
|
48
|
+
rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse);
|
|
37
49
|
}
|
|
38
50
|
|
|
39
51
|
message Proof {
|
|
@@ -60,6 +72,14 @@ message StateTransitionBroadcastError {
|
|
|
60
72
|
bytes data = 3;
|
|
61
73
|
}
|
|
62
74
|
|
|
75
|
+
enum KeyPurpose {
|
|
76
|
+
AUTHENTICATION = 0;
|
|
77
|
+
ENCRYPTION = 1;
|
|
78
|
+
DECRYPTION = 2;
|
|
79
|
+
TRANSFER = 3;
|
|
80
|
+
VOTING = 5;
|
|
81
|
+
}
|
|
82
|
+
|
|
63
83
|
message BroadcastStateTransitionRequest { bytes state_transition = 1; }
|
|
64
84
|
|
|
65
85
|
message BroadcastStateTransitionResponse {}
|
|
@@ -74,6 +94,28 @@ message GetIdentityRequest {
|
|
|
74
94
|
oneof version { GetIdentityRequestV0 v0 = 1; }
|
|
75
95
|
}
|
|
76
96
|
|
|
97
|
+
message GetIdentityNonceRequest {
|
|
98
|
+
|
|
99
|
+
message GetIdentityNonceRequestV0 {
|
|
100
|
+
bytes identity_id = 1;
|
|
101
|
+
bool prove = 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
oneof version { GetIdentityNonceRequestV0 v0 = 1; }
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
message GetIdentityContractNonceRequest {
|
|
109
|
+
|
|
110
|
+
message GetIdentityContractNonceRequestV0 {
|
|
111
|
+
bytes identity_id = 1;
|
|
112
|
+
bytes contract_id = 2;
|
|
113
|
+
bool prove = 3;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
oneof version { GetIdentityContractNonceRequestV0 v0 = 1; }
|
|
117
|
+
}
|
|
118
|
+
|
|
77
119
|
message GetIdentityBalanceRequest {
|
|
78
120
|
|
|
79
121
|
message GetIdentityBalanceRequestV0 {
|
|
@@ -107,36 +149,30 @@ message GetIdentityResponse {
|
|
|
107
149
|
oneof version { GetIdentityResponseV0 v0 = 1; }
|
|
108
150
|
}
|
|
109
151
|
|
|
110
|
-
message
|
|
152
|
+
message GetIdentityNonceResponse {
|
|
111
153
|
|
|
112
|
-
message
|
|
113
|
-
|
|
114
|
-
|
|
154
|
+
message GetIdentityNonceResponseV0 {
|
|
155
|
+
oneof result {
|
|
156
|
+
uint64 identity_nonce = 1;
|
|
157
|
+
Proof proof = 2;
|
|
158
|
+
}
|
|
159
|
+
ResponseMetadata metadata = 3;
|
|
115
160
|
}
|
|
116
161
|
|
|
117
|
-
oneof version {
|
|
162
|
+
oneof version { GetIdentityNonceResponseV0 v0 = 1; }
|
|
118
163
|
}
|
|
119
164
|
|
|
120
|
-
message
|
|
165
|
+
message GetIdentityContractNonceResponse {
|
|
121
166
|
|
|
122
|
-
message
|
|
123
|
-
|
|
124
|
-
message IdentityEntry {
|
|
125
|
-
bytes key = 1;
|
|
126
|
-
IdentityValue value = 2;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
message Identities { repeated IdentityEntry identity_entries = 1; }
|
|
130
|
-
|
|
131
|
-
message GetIdentitiesResponseV0 {
|
|
167
|
+
message GetIdentityContractNonceResponseV0 {
|
|
132
168
|
oneof result {
|
|
133
|
-
|
|
169
|
+
uint64 identity_contract_nonce = 1;
|
|
134
170
|
Proof proof = 2;
|
|
135
171
|
}
|
|
136
172
|
ResponseMetadata metadata = 3;
|
|
137
173
|
}
|
|
138
174
|
|
|
139
|
-
oneof version {
|
|
175
|
+
oneof version { GetIdentityContractNonceResponseV0 v0 = 1; }
|
|
140
176
|
}
|
|
141
177
|
|
|
142
178
|
message GetIdentityBalanceResponse {
|
|
@@ -220,13 +256,59 @@ message GetIdentityKeysResponse {
|
|
|
220
256
|
oneof version { GetIdentityKeysResponseV0 v0 = 1; }
|
|
221
257
|
}
|
|
222
258
|
|
|
259
|
+
message GetIdentitiesContractKeysRequest {
|
|
260
|
+
message GetIdentitiesContractKeysRequestV0 {
|
|
261
|
+
repeated bytes identities_ids = 1;
|
|
262
|
+
bytes contract_id = 2;
|
|
263
|
+
optional string document_type_name = 3;
|
|
264
|
+
repeated KeyPurpose purposes = 4;
|
|
265
|
+
bool prove = 5;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
oneof version {
|
|
269
|
+
GetIdentitiesContractKeysRequestV0 v0 = 1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
message GetIdentitiesContractKeysResponse {
|
|
274
|
+
message GetIdentitiesContractKeysResponseV0 {
|
|
275
|
+
message PurposeKeys {
|
|
276
|
+
KeyPurpose purpose = 1;
|
|
277
|
+
repeated bytes keys_bytes = 2;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
message IdentityKeys {
|
|
281
|
+
bytes identity_id = 1;
|
|
282
|
+
repeated PurposeKeys keys = 2;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
message IdentitiesKeys {
|
|
286
|
+
repeated IdentityKeys entries = 1;
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
oneof result {
|
|
290
|
+
IdentitiesKeys identities_keys = 1;
|
|
291
|
+
Proof proof = 2;
|
|
292
|
+
}
|
|
293
|
+
ResponseMetadata metadata = 3;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
oneof version { GetIdentitiesContractKeysResponseV0 v0 = 1; }
|
|
297
|
+
}
|
|
298
|
+
|
|
223
299
|
message GetProofsRequest {
|
|
224
300
|
message GetProofsRequestV0 {
|
|
225
301
|
message DocumentRequest {
|
|
302
|
+
enum DocumentContestedStatus {
|
|
303
|
+
NOT_CONTESTED = 0;
|
|
304
|
+
MAYBE_CONTESTED = 1;
|
|
305
|
+
CONTESTED = 2;
|
|
306
|
+
}
|
|
226
307
|
bytes contract_id = 1;
|
|
227
308
|
string document_type = 2;
|
|
228
309
|
bool document_type_keeps_history = 3;
|
|
229
310
|
bytes document_id = 4;
|
|
311
|
+
DocumentContestedStatus document_contested_status = 5;
|
|
230
312
|
}
|
|
231
313
|
|
|
232
314
|
message IdentityRequest {
|
|
@@ -234,6 +316,7 @@ message GetProofsRequest {
|
|
|
234
316
|
FULL_IDENTITY = 0;
|
|
235
317
|
BALANCE = 1;
|
|
236
318
|
KEYS = 2;
|
|
319
|
+
REVISION = 3;
|
|
237
320
|
}
|
|
238
321
|
bytes identity_id = 1;
|
|
239
322
|
Type request_type = 2;
|
|
@@ -241,9 +324,22 @@ message GetProofsRequest {
|
|
|
241
324
|
|
|
242
325
|
message ContractRequest { bytes contract_id = 1; }
|
|
243
326
|
|
|
327
|
+
message VoteStatusRequest {
|
|
328
|
+
message ContestedResourceVoteStatusRequest {
|
|
329
|
+
bytes contract_id = 1;
|
|
330
|
+
string document_type_name = 2;
|
|
331
|
+
string index_name = 3;
|
|
332
|
+
repeated bytes index_values = 4;
|
|
333
|
+
bytes voter_identifier = 5;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
oneof request_type { ContestedResourceVoteStatusRequest contested_resource_vote_status_request = 1; }
|
|
337
|
+
}
|
|
338
|
+
|
|
244
339
|
repeated IdentityRequest identities = 1;
|
|
245
340
|
repeated ContractRequest contracts = 2;
|
|
246
341
|
repeated DocumentRequest documents = 3;
|
|
342
|
+
repeated VoteStatusRequest votes = 4;
|
|
247
343
|
}
|
|
248
344
|
|
|
249
345
|
oneof version { GetProofsRequestV0 v0 = 1; }
|
|
@@ -365,35 +461,6 @@ message GetDocumentsResponse {
|
|
|
365
461
|
oneof version { GetDocumentsResponseV0 v0 = 1; }
|
|
366
462
|
}
|
|
367
463
|
|
|
368
|
-
message GetIdentitiesByPublicKeyHashesRequest {
|
|
369
|
-
message GetIdentitiesByPublicKeyHashesRequestV0 {
|
|
370
|
-
repeated bytes public_key_hashes = 1;
|
|
371
|
-
bool prove = 2;
|
|
372
|
-
}
|
|
373
|
-
oneof version { GetIdentitiesByPublicKeyHashesRequestV0 v0 = 1; }
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
message GetIdentitiesByPublicKeyHashesResponse {
|
|
377
|
-
message PublicKeyHashIdentityEntry {
|
|
378
|
-
bytes public_key_hash = 1;
|
|
379
|
-
google.protobuf.BytesValue value = 2;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
message IdentitiesByPublicKeyHashes {
|
|
383
|
-
repeated PublicKeyHashIdentityEntry identity_entries = 1;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
message GetIdentitiesByPublicKeyHashesResponseV0 {
|
|
387
|
-
oneof result {
|
|
388
|
-
IdentitiesByPublicKeyHashes identities = 1;
|
|
389
|
-
Proof proof = 2;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
ResponseMetadata metadata = 3;
|
|
393
|
-
}
|
|
394
|
-
oneof version { GetIdentitiesByPublicKeyHashesResponseV0 v0 = 1; }
|
|
395
|
-
}
|
|
396
|
-
|
|
397
464
|
message GetIdentityByPublicKeyHashRequest {
|
|
398
465
|
message GetIdentityByPublicKeyHashRequestV0 {
|
|
399
466
|
bytes public_key_hash = 1;
|
|
@@ -555,6 +622,7 @@ message GetEpochsInfoResponse {
|
|
|
555
622
|
uint32 first_core_block_height = 3;
|
|
556
623
|
uint64 start_time = 4;
|
|
557
624
|
double fee_multiplier = 5;
|
|
625
|
+
uint32 protocol_version = 6;
|
|
558
626
|
}
|
|
559
627
|
|
|
560
628
|
oneof result {
|
|
@@ -568,3 +636,314 @@ message GetEpochsInfoResponse {
|
|
|
568
636
|
GetEpochsInfoResponseV0 v0 = 1;
|
|
569
637
|
}
|
|
570
638
|
}
|
|
639
|
+
|
|
640
|
+
message GetContestedResourcesRequest {
|
|
641
|
+
message GetContestedResourcesRequestV0 {
|
|
642
|
+
message StartAtValueInfo {
|
|
643
|
+
bytes start_value = 1;
|
|
644
|
+
bool start_value_included = 2;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
bytes contract_id = 1;
|
|
648
|
+
string document_type_name = 2;
|
|
649
|
+
string index_name = 3;
|
|
650
|
+
repeated bytes start_index_values = 4;
|
|
651
|
+
repeated bytes end_index_values = 5;
|
|
652
|
+
optional StartAtValueInfo start_at_value_info = 6;
|
|
653
|
+
optional uint32 count = 7;
|
|
654
|
+
bool order_ascending = 8;
|
|
655
|
+
bool prove = 9;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
oneof version {
|
|
659
|
+
GetContestedResourcesRequestV0 v0 = 1;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
message GetContestedResourcesResponse {
|
|
664
|
+
message GetContestedResourcesResponseV0 {
|
|
665
|
+
message ContestedResourceValues {
|
|
666
|
+
repeated bytes contested_resource_values = 1;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
oneof result {
|
|
670
|
+
ContestedResourceValues contested_resource_values = 1;
|
|
671
|
+
Proof proof = 2;
|
|
672
|
+
}
|
|
673
|
+
ResponseMetadata metadata = 3;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
oneof version {
|
|
677
|
+
GetContestedResourcesResponseV0 v0 = 1;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
message GetVotePollsByEndDateRequest {
|
|
682
|
+
message GetVotePollsByEndDateRequestV0 {
|
|
683
|
+
message StartAtTimeInfo {
|
|
684
|
+
uint64 start_time_ms = 1;
|
|
685
|
+
bool start_time_included = 2;
|
|
686
|
+
}
|
|
687
|
+
message EndAtTimeInfo {
|
|
688
|
+
uint64 end_time_ms = 1;
|
|
689
|
+
bool end_time_included = 2;
|
|
690
|
+
}
|
|
691
|
+
optional StartAtTimeInfo start_time_info = 1;
|
|
692
|
+
optional EndAtTimeInfo end_time_info = 2;
|
|
693
|
+
optional uint32 limit = 3;
|
|
694
|
+
optional uint32 offset = 4;
|
|
695
|
+
bool ascending = 5;
|
|
696
|
+
bool prove = 6;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
oneof version {
|
|
700
|
+
GetVotePollsByEndDateRequestV0 v0 = 1;
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
message GetVotePollsByEndDateResponse {
|
|
705
|
+
message GetVotePollsByEndDateResponseV0 {
|
|
706
|
+
message SerializedVotePollsByTimestamp {
|
|
707
|
+
uint64 timestamp = 1;
|
|
708
|
+
repeated bytes serialized_vote_polls = 2;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
message SerializedVotePollsByTimestamps {
|
|
712
|
+
repeated SerializedVotePollsByTimestamp vote_polls_by_timestamps = 1;
|
|
713
|
+
bool finished_results = 2;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
oneof result {
|
|
717
|
+
SerializedVotePollsByTimestamps vote_polls_by_timestamps = 1;
|
|
718
|
+
Proof proof = 2;
|
|
719
|
+
}
|
|
720
|
+
ResponseMetadata metadata = 3;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
oneof version {
|
|
724
|
+
GetVotePollsByEndDateResponseV0 v0 = 1;
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
// What's the state of a contested resource vote? (ie who is winning?)
|
|
729
|
+
message GetContestedResourceVoteStateRequest {
|
|
730
|
+
message GetContestedResourceVoteStateRequestV0 {
|
|
731
|
+
message StartAtIdentifierInfo {
|
|
732
|
+
bytes start_identifier = 1;
|
|
733
|
+
bool start_identifier_included = 2;
|
|
734
|
+
}
|
|
735
|
+
enum ResultType {
|
|
736
|
+
DOCUMENTS = 0;
|
|
737
|
+
VOTE_TALLY = 1;
|
|
738
|
+
DOCUMENTS_AND_VOTE_TALLY = 2;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
bytes contract_id = 1;
|
|
742
|
+
string document_type_name = 2;
|
|
743
|
+
string index_name = 3;
|
|
744
|
+
repeated bytes index_values = 4;
|
|
745
|
+
ResultType result_type = 5;
|
|
746
|
+
bool allow_include_locked_and_abstaining_vote_tally = 6;
|
|
747
|
+
optional StartAtIdentifierInfo start_at_identifier_info = 7;
|
|
748
|
+
optional uint32 count = 8;
|
|
749
|
+
bool prove = 9;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
oneof version {
|
|
753
|
+
GetContestedResourceVoteStateRequestV0 v0 = 1;
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
message GetContestedResourceVoteStateResponse {
|
|
758
|
+
message GetContestedResourceVoteStateResponseV0 {
|
|
759
|
+
message FinishedVoteInfo {
|
|
760
|
+
enum FinishedVoteOutcome {
|
|
761
|
+
TOWARDS_IDENTITY = 0;
|
|
762
|
+
LOCKED = 1;
|
|
763
|
+
NO_PREVIOUS_WINNER = 2;
|
|
764
|
+
}
|
|
765
|
+
FinishedVoteOutcome finished_vote_outcome = 1;
|
|
766
|
+
optional bytes won_by_identity_id = 2; // Only used when vote_choice_type is TOWARDS_IDENTITY
|
|
767
|
+
uint64 finished_at_block_height = 3;
|
|
768
|
+
uint32 finished_at_core_block_height = 4;
|
|
769
|
+
uint64 finished_at_block_time_ms = 5;
|
|
770
|
+
uint32 finished_at_epoch = 6;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
message ContestedResourceContenders {
|
|
774
|
+
repeated Contender contenders = 1;
|
|
775
|
+
optional uint32 abstain_vote_tally = 2;
|
|
776
|
+
optional uint32 lock_vote_tally = 3;
|
|
777
|
+
optional FinishedVoteInfo finished_vote_info = 4;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
message Contender {
|
|
781
|
+
bytes identifier = 1;
|
|
782
|
+
optional uint32 vote_count = 2;
|
|
783
|
+
optional bytes document = 3;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
oneof result {
|
|
787
|
+
ContestedResourceContenders contested_resource_contenders = 1;
|
|
788
|
+
Proof proof = 2;
|
|
789
|
+
}
|
|
790
|
+
ResponseMetadata metadata = 3;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
oneof version {
|
|
794
|
+
GetContestedResourceVoteStateResponseV0 v0 = 1;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// Who voted for a contested resource to go to a specific identity?
|
|
799
|
+
message GetContestedResourceVotersForIdentityRequest {
|
|
800
|
+
message GetContestedResourceVotersForIdentityRequestV0 {
|
|
801
|
+
message StartAtIdentifierInfo {
|
|
802
|
+
bytes start_identifier = 1;
|
|
803
|
+
bool start_identifier_included = 2;
|
|
804
|
+
}
|
|
805
|
+
bytes contract_id = 1;
|
|
806
|
+
string document_type_name = 2;
|
|
807
|
+
string index_name = 3;
|
|
808
|
+
repeated bytes index_values = 4;
|
|
809
|
+
bytes contestant_id = 5;
|
|
810
|
+
optional StartAtIdentifierInfo start_at_identifier_info = 6;
|
|
811
|
+
optional uint32 count = 7;
|
|
812
|
+
bool order_ascending = 8;
|
|
813
|
+
bool prove = 9;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
oneof version {
|
|
817
|
+
GetContestedResourceVotersForIdentityRequestV0 v0 = 1;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
message GetContestedResourceVotersForIdentityResponse {
|
|
822
|
+
message GetContestedResourceVotersForIdentityResponseV0 {
|
|
823
|
+
message ContestedResourceVoters {
|
|
824
|
+
repeated bytes voters = 1;
|
|
825
|
+
bool finished_results = 2;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
oneof result {
|
|
829
|
+
ContestedResourceVoters contested_resource_voters = 1;
|
|
830
|
+
Proof proof = 2;
|
|
831
|
+
}
|
|
832
|
+
ResponseMetadata metadata = 3;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
oneof version {
|
|
836
|
+
GetContestedResourceVotersForIdentityResponseV0 v0 = 1;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// How did an identity vote?
|
|
841
|
+
message GetContestedResourceIdentityVotesRequest {
|
|
842
|
+
message GetContestedResourceIdentityVotesRequestV0 {
|
|
843
|
+
message StartAtVotePollIdInfo {
|
|
844
|
+
bytes start_at_poll_identifier = 1;
|
|
845
|
+
bool start_poll_identifier_included = 2;
|
|
846
|
+
}
|
|
847
|
+
bytes identity_id = 1;
|
|
848
|
+
google.protobuf.UInt32Value limit = 2;
|
|
849
|
+
google.protobuf.UInt32Value offset = 3;
|
|
850
|
+
bool order_ascending = 4;
|
|
851
|
+
optional StartAtVotePollIdInfo start_at_vote_poll_id_info = 5;
|
|
852
|
+
bool prove = 6;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
oneof version {
|
|
856
|
+
GetContestedResourceIdentityVotesRequestV0 v0 = 1;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
message GetContestedResourceIdentityVotesResponse {
|
|
861
|
+
message GetContestedResourceIdentityVotesResponseV0 {
|
|
862
|
+
message ContestedResourceIdentityVotes {
|
|
863
|
+
repeated ContestedResourceIdentityVote contested_resource_identity_votes = 1;
|
|
864
|
+
bool finished_results = 2;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
message ResourceVoteChoice {
|
|
868
|
+
enum VoteChoiceType {
|
|
869
|
+
TOWARDS_IDENTITY = 0;
|
|
870
|
+
ABSTAIN = 1;
|
|
871
|
+
LOCK = 2;
|
|
872
|
+
}
|
|
873
|
+
VoteChoiceType vote_choice_type = 1;
|
|
874
|
+
optional bytes identity_id = 2; // Only used when vote_choice_type is TOWARDS_IDENTITY
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
message ContestedResourceIdentityVote {
|
|
878
|
+
bytes contract_id = 1;
|
|
879
|
+
string document_type_name = 2;
|
|
880
|
+
repeated bytes serialized_index_storage_values = 3;
|
|
881
|
+
ResourceVoteChoice vote_choice = 4;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
oneof result {
|
|
885
|
+
ContestedResourceIdentityVotes votes = 1;
|
|
886
|
+
Proof proof = 2;
|
|
887
|
+
}
|
|
888
|
+
ResponseMetadata metadata = 3;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
oneof version {
|
|
892
|
+
GetContestedResourceIdentityVotesResponseV0 v0 = 1;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
message GetPrefundedSpecializedBalanceRequest {
|
|
897
|
+
|
|
898
|
+
message GetPrefundedSpecializedBalanceRequestV0 {
|
|
899
|
+
bytes id = 1;
|
|
900
|
+
bool prove = 2;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
oneof version { GetPrefundedSpecializedBalanceRequestV0 v0 = 1; }
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
message GetPrefundedSpecializedBalanceResponse {
|
|
907
|
+
|
|
908
|
+
message GetPrefundedSpecializedBalanceResponseV0 {
|
|
909
|
+
oneof result {
|
|
910
|
+
uint64 balance = 1;
|
|
911
|
+
Proof proof = 2;
|
|
912
|
+
}
|
|
913
|
+
ResponseMetadata metadata = 3;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
oneof version { GetPrefundedSpecializedBalanceResponseV0 v0 = 1; }
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
message GetPathElementsRequest {
|
|
921
|
+
message GetPathElementsRequestV0 {
|
|
922
|
+
repeated bytes path = 1;
|
|
923
|
+
repeated bytes keys = 2;
|
|
924
|
+
bool prove = 3;
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
oneof version {
|
|
928
|
+
GetPathElementsRequestV0 v0 = 1;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
message GetPathElementsResponse {
|
|
933
|
+
message GetPathElementsResponseV0 {
|
|
934
|
+
message Elements {
|
|
935
|
+
repeated bytes elements = 1;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
oneof result {
|
|
939
|
+
Elements elements = 1;
|
|
940
|
+
|
|
941
|
+
Proof proof = 2;
|
|
942
|
+
}
|
|
943
|
+
ResponseMetadata metadata = 3;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
oneof version {
|
|
947
|
+
GetPathElementsResponseV0 v0 = 1;
|
|
948
|
+
}
|
|
949
|
+
}
|
package/src/lib.rs
CHANGED
|
@@ -2,23 +2,47 @@ pub use prost::Message;
|
|
|
2
2
|
|
|
3
3
|
#[cfg(feature = "core")]
|
|
4
4
|
pub mod core {
|
|
5
|
+
#![allow(non_camel_case_types)]
|
|
5
6
|
pub mod v0 {
|
|
6
|
-
|
|
7
|
+
#[cfg(all(feature = "server", not(feature = "client")))]
|
|
8
|
+
include!("core/server/org.dash.platform.dapi.v0.rs");
|
|
9
|
+
|
|
10
|
+
#[cfg(all(feature = "client", not(feature = "server")))]
|
|
11
|
+
include!("core/client/org.dash.platform.dapi.v0.rs");
|
|
12
|
+
|
|
13
|
+
#[cfg(all(feature = "server", feature = "client"))]
|
|
14
|
+
include!("core/client_server/org.dash.platform.dapi.v0.rs");
|
|
7
15
|
}
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
#[cfg(feature = "platform")]
|
|
11
19
|
pub mod platform {
|
|
12
20
|
pub mod v0 {
|
|
13
|
-
|
|
21
|
+
#[cfg(all(feature = "server", not(feature = "client")))]
|
|
22
|
+
include!("platform/server/org.dash.platform.dapi.v0.rs");
|
|
23
|
+
|
|
24
|
+
#[cfg(all(feature = "client", not(feature = "server")))]
|
|
25
|
+
include!("platform/client/org.dash.platform.dapi.v0.rs");
|
|
26
|
+
|
|
27
|
+
#[cfg(all(feature = "server", feature = "client"))]
|
|
28
|
+
include!("platform/client_server/org.dash.platform.dapi.v0.rs");
|
|
14
29
|
}
|
|
30
|
+
|
|
15
31
|
#[cfg(feature = "tenderdash-proto")]
|
|
16
32
|
pub use tenderdash_proto as proto;
|
|
17
33
|
|
|
34
|
+
#[cfg(any(feature = "server", feature = "client"))]
|
|
18
35
|
mod versioning;
|
|
36
|
+
#[cfg(any(feature = "server", feature = "client"))]
|
|
19
37
|
pub use versioning::{VersionedGrpcMessage, VersionedGrpcResponse};
|
|
20
38
|
}
|
|
21
39
|
|
|
22
40
|
#[cfg(feature = "serde")]
|
|
23
41
|
// Serde deserialization logic
|
|
24
42
|
pub mod deserialization;
|
|
43
|
+
|
|
44
|
+
// We need mock module even if the feature is disabled
|
|
45
|
+
pub mod mock;
|
|
46
|
+
|
|
47
|
+
// Re-export tonic to ensure everyone uses the same version
|
|
48
|
+
pub use tonic;
|