@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
|
@@ -28,22 +28,40 @@ Platform.getIdentity = {
|
|
|
28
28
|
responseType: platform_pb.GetIdentityResponse
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
Platform.
|
|
32
|
-
methodName: "
|
|
31
|
+
Platform.getIdentityKeys = {
|
|
32
|
+
methodName: "getIdentityKeys",
|
|
33
33
|
service: Platform,
|
|
34
34
|
requestStream: false,
|
|
35
35
|
responseStream: false,
|
|
36
|
-
requestType: platform_pb.
|
|
37
|
-
responseType: platform_pb.
|
|
36
|
+
requestType: platform_pb.GetIdentityKeysRequest,
|
|
37
|
+
responseType: platform_pb.GetIdentityKeysResponse
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
Platform.
|
|
41
|
-
methodName: "
|
|
40
|
+
Platform.getIdentitiesContractKeys = {
|
|
41
|
+
methodName: "getIdentitiesContractKeys",
|
|
42
42
|
service: Platform,
|
|
43
43
|
requestStream: false,
|
|
44
44
|
responseStream: false,
|
|
45
|
-
requestType: platform_pb.
|
|
46
|
-
responseType: platform_pb.
|
|
45
|
+
requestType: platform_pb.GetIdentitiesContractKeysRequest,
|
|
46
|
+
responseType: platform_pb.GetIdentitiesContractKeysResponse
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
Platform.getIdentityNonce = {
|
|
50
|
+
methodName: "getIdentityNonce",
|
|
51
|
+
service: Platform,
|
|
52
|
+
requestStream: false,
|
|
53
|
+
responseStream: false,
|
|
54
|
+
requestType: platform_pb.GetIdentityNonceRequest,
|
|
55
|
+
responseType: platform_pb.GetIdentityNonceResponse
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
Platform.getIdentityContractNonce = {
|
|
59
|
+
methodName: "getIdentityContractNonce",
|
|
60
|
+
service: Platform,
|
|
61
|
+
requestStream: false,
|
|
62
|
+
responseStream: false,
|
|
63
|
+
requestType: platform_pb.GetIdentityContractNonceRequest,
|
|
64
|
+
responseType: platform_pb.GetIdentityContractNonceResponse
|
|
47
65
|
};
|
|
48
66
|
|
|
49
67
|
Platform.getIdentityBalance = {
|
|
@@ -109,15 +127,6 @@ Platform.getDocuments = {
|
|
|
109
127
|
responseType: platform_pb.GetDocumentsResponse
|
|
110
128
|
};
|
|
111
129
|
|
|
112
|
-
Platform.getIdentitiesByPublicKeyHashes = {
|
|
113
|
-
methodName: "getIdentitiesByPublicKeyHashes",
|
|
114
|
-
service: Platform,
|
|
115
|
-
requestStream: false,
|
|
116
|
-
responseStream: false,
|
|
117
|
-
requestType: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
|
|
118
|
-
responseType: platform_pb.GetIdentitiesByPublicKeyHashesResponse
|
|
119
|
-
};
|
|
120
|
-
|
|
121
130
|
Platform.getIdentityByPublicKeyHash = {
|
|
122
131
|
methodName: "getIdentityByPublicKeyHash",
|
|
123
132
|
service: Platform,
|
|
@@ -172,6 +181,69 @@ Platform.getEpochsInfo = {
|
|
|
172
181
|
responseType: platform_pb.GetEpochsInfoResponse
|
|
173
182
|
};
|
|
174
183
|
|
|
184
|
+
Platform.getContestedResources = {
|
|
185
|
+
methodName: "getContestedResources",
|
|
186
|
+
service: Platform,
|
|
187
|
+
requestStream: false,
|
|
188
|
+
responseStream: false,
|
|
189
|
+
requestType: platform_pb.GetContestedResourcesRequest,
|
|
190
|
+
responseType: platform_pb.GetContestedResourcesResponse
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
Platform.getContestedResourceVoteState = {
|
|
194
|
+
methodName: "getContestedResourceVoteState",
|
|
195
|
+
service: Platform,
|
|
196
|
+
requestStream: false,
|
|
197
|
+
responseStream: false,
|
|
198
|
+
requestType: platform_pb.GetContestedResourceVoteStateRequest,
|
|
199
|
+
responseType: platform_pb.GetContestedResourceVoteStateResponse
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
Platform.getContestedResourceVotersForIdentity = {
|
|
203
|
+
methodName: "getContestedResourceVotersForIdentity",
|
|
204
|
+
service: Platform,
|
|
205
|
+
requestStream: false,
|
|
206
|
+
responseStream: false,
|
|
207
|
+
requestType: platform_pb.GetContestedResourceVotersForIdentityRequest,
|
|
208
|
+
responseType: platform_pb.GetContestedResourceVotersForIdentityResponse
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
Platform.getContestedResourceIdentityVotes = {
|
|
212
|
+
methodName: "getContestedResourceIdentityVotes",
|
|
213
|
+
service: Platform,
|
|
214
|
+
requestStream: false,
|
|
215
|
+
responseStream: false,
|
|
216
|
+
requestType: platform_pb.GetContestedResourceIdentityVotesRequest,
|
|
217
|
+
responseType: platform_pb.GetContestedResourceIdentityVotesResponse
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
Platform.getVotePollsByEndDate = {
|
|
221
|
+
methodName: "getVotePollsByEndDate",
|
|
222
|
+
service: Platform,
|
|
223
|
+
requestStream: false,
|
|
224
|
+
responseStream: false,
|
|
225
|
+
requestType: platform_pb.GetVotePollsByEndDateRequest,
|
|
226
|
+
responseType: platform_pb.GetVotePollsByEndDateResponse
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
Platform.getPrefundedSpecializedBalance = {
|
|
230
|
+
methodName: "getPrefundedSpecializedBalance",
|
|
231
|
+
service: Platform,
|
|
232
|
+
requestStream: false,
|
|
233
|
+
responseStream: false,
|
|
234
|
+
requestType: platform_pb.GetPrefundedSpecializedBalanceRequest,
|
|
235
|
+
responseType: platform_pb.GetPrefundedSpecializedBalanceResponse
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
Platform.getPathElements = {
|
|
239
|
+
methodName: "getPathElements",
|
|
240
|
+
service: Platform,
|
|
241
|
+
requestStream: false,
|
|
242
|
+
responseStream: false,
|
|
243
|
+
requestType: platform_pb.GetPathElementsRequest,
|
|
244
|
+
responseType: platform_pb.GetPathElementsResponse
|
|
245
|
+
};
|
|
246
|
+
|
|
175
247
|
exports.Platform = Platform;
|
|
176
248
|
|
|
177
249
|
function PlatformClient(serviceHost, options) {
|
|
@@ -241,11 +313,11 @@ PlatformClient.prototype.getIdentity = function getIdentity(requestMessage, meta
|
|
|
241
313
|
};
|
|
242
314
|
};
|
|
243
315
|
|
|
244
|
-
PlatformClient.prototype.
|
|
316
|
+
PlatformClient.prototype.getIdentityKeys = function getIdentityKeys(requestMessage, metadata, callback) {
|
|
245
317
|
if (arguments.length === 2) {
|
|
246
318
|
callback = arguments[1];
|
|
247
319
|
}
|
|
248
|
-
var client = grpc.unary(Platform.
|
|
320
|
+
var client = grpc.unary(Platform.getIdentityKeys, {
|
|
249
321
|
request: requestMessage,
|
|
250
322
|
host: this.serviceHost,
|
|
251
323
|
metadata: metadata,
|
|
@@ -272,11 +344,73 @@ PlatformClient.prototype.getIdentities = function getIdentities(requestMessage,
|
|
|
272
344
|
};
|
|
273
345
|
};
|
|
274
346
|
|
|
275
|
-
PlatformClient.prototype.
|
|
347
|
+
PlatformClient.prototype.getIdentitiesContractKeys = function getIdentitiesContractKeys(requestMessage, metadata, callback) {
|
|
276
348
|
if (arguments.length === 2) {
|
|
277
349
|
callback = arguments[1];
|
|
278
350
|
}
|
|
279
|
-
var client = grpc.unary(Platform.
|
|
351
|
+
var client = grpc.unary(Platform.getIdentitiesContractKeys, {
|
|
352
|
+
request: requestMessage,
|
|
353
|
+
host: this.serviceHost,
|
|
354
|
+
metadata: metadata,
|
|
355
|
+
transport: this.options.transport,
|
|
356
|
+
debug: this.options.debug,
|
|
357
|
+
onEnd: function (response) {
|
|
358
|
+
if (callback) {
|
|
359
|
+
if (response.status !== grpc.Code.OK) {
|
|
360
|
+
var err = new Error(response.statusMessage);
|
|
361
|
+
err.code = response.status;
|
|
362
|
+
err.metadata = response.trailers;
|
|
363
|
+
callback(err, null);
|
|
364
|
+
} else {
|
|
365
|
+
callback(null, response.message);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
return {
|
|
371
|
+
cancel: function () {
|
|
372
|
+
callback = null;
|
|
373
|
+
client.close();
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
PlatformClient.prototype.getIdentityNonce = function getIdentityNonce(requestMessage, metadata, callback) {
|
|
379
|
+
if (arguments.length === 2) {
|
|
380
|
+
callback = arguments[1];
|
|
381
|
+
}
|
|
382
|
+
var client = grpc.unary(Platform.getIdentityNonce, {
|
|
383
|
+
request: requestMessage,
|
|
384
|
+
host: this.serviceHost,
|
|
385
|
+
metadata: metadata,
|
|
386
|
+
transport: this.options.transport,
|
|
387
|
+
debug: this.options.debug,
|
|
388
|
+
onEnd: function (response) {
|
|
389
|
+
if (callback) {
|
|
390
|
+
if (response.status !== grpc.Code.OK) {
|
|
391
|
+
var err = new Error(response.statusMessage);
|
|
392
|
+
err.code = response.status;
|
|
393
|
+
err.metadata = response.trailers;
|
|
394
|
+
callback(err, null);
|
|
395
|
+
} else {
|
|
396
|
+
callback(null, response.message);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
return {
|
|
402
|
+
cancel: function () {
|
|
403
|
+
callback = null;
|
|
404
|
+
client.close();
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
PlatformClient.prototype.getIdentityContractNonce = function getIdentityContractNonce(requestMessage, metadata, callback) {
|
|
410
|
+
if (arguments.length === 2) {
|
|
411
|
+
callback = arguments[1];
|
|
412
|
+
}
|
|
413
|
+
var client = grpc.unary(Platform.getIdentityContractNonce, {
|
|
280
414
|
request: requestMessage,
|
|
281
415
|
host: this.serviceHost,
|
|
282
416
|
metadata: metadata,
|
|
@@ -520,11 +654,11 @@ PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, me
|
|
|
520
654
|
};
|
|
521
655
|
};
|
|
522
656
|
|
|
523
|
-
PlatformClient.prototype.
|
|
657
|
+
PlatformClient.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(requestMessage, metadata, callback) {
|
|
524
658
|
if (arguments.length === 2) {
|
|
525
659
|
callback = arguments[1];
|
|
526
660
|
}
|
|
527
|
-
var client = grpc.unary(Platform.
|
|
661
|
+
var client = grpc.unary(Platform.getIdentityByPublicKeyHash, {
|
|
528
662
|
request: requestMessage,
|
|
529
663
|
host: this.serviceHost,
|
|
530
664
|
metadata: metadata,
|
|
@@ -551,11 +685,11 @@ PlatformClient.prototype.getIdentitiesByPublicKeyHashes = function getIdentities
|
|
|
551
685
|
};
|
|
552
686
|
};
|
|
553
687
|
|
|
554
|
-
PlatformClient.prototype.
|
|
688
|
+
PlatformClient.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(requestMessage, metadata, callback) {
|
|
555
689
|
if (arguments.length === 2) {
|
|
556
690
|
callback = arguments[1];
|
|
557
691
|
}
|
|
558
|
-
var client = grpc.unary(Platform.
|
|
692
|
+
var client = grpc.unary(Platform.waitForStateTransitionResult, {
|
|
559
693
|
request: requestMessage,
|
|
560
694
|
host: this.serviceHost,
|
|
561
695
|
metadata: metadata,
|
|
@@ -582,11 +716,11 @@ PlatformClient.prototype.getIdentityByPublicKeyHash = function getIdentityByPubl
|
|
|
582
716
|
};
|
|
583
717
|
};
|
|
584
718
|
|
|
585
|
-
PlatformClient.prototype.
|
|
719
|
+
PlatformClient.prototype.getConsensusParams = function getConsensusParams(requestMessage, metadata, callback) {
|
|
586
720
|
if (arguments.length === 2) {
|
|
587
721
|
callback = arguments[1];
|
|
588
722
|
}
|
|
589
|
-
var client = grpc.unary(Platform.
|
|
723
|
+
var client = grpc.unary(Platform.getConsensusParams, {
|
|
590
724
|
request: requestMessage,
|
|
591
725
|
host: this.serviceHost,
|
|
592
726
|
metadata: metadata,
|
|
@@ -613,11 +747,11 @@ PlatformClient.prototype.waitForStateTransitionResult = function waitForStateTra
|
|
|
613
747
|
};
|
|
614
748
|
};
|
|
615
749
|
|
|
616
|
-
PlatformClient.prototype.
|
|
750
|
+
PlatformClient.prototype.getProtocolVersionUpgradeState = function getProtocolVersionUpgradeState(requestMessage, metadata, callback) {
|
|
617
751
|
if (arguments.length === 2) {
|
|
618
752
|
callback = arguments[1];
|
|
619
753
|
}
|
|
620
|
-
var client = grpc.unary(Platform.
|
|
754
|
+
var client = grpc.unary(Platform.getProtocolVersionUpgradeState, {
|
|
621
755
|
request: requestMessage,
|
|
622
756
|
host: this.serviceHost,
|
|
623
757
|
metadata: metadata,
|
|
@@ -644,11 +778,11 @@ PlatformClient.prototype.getConsensusParams = function getConsensusParams(reques
|
|
|
644
778
|
};
|
|
645
779
|
};
|
|
646
780
|
|
|
647
|
-
PlatformClient.prototype.
|
|
781
|
+
PlatformClient.prototype.getProtocolVersionUpgradeVoteStatus = function getProtocolVersionUpgradeVoteStatus(requestMessage, metadata, callback) {
|
|
648
782
|
if (arguments.length === 2) {
|
|
649
783
|
callback = arguments[1];
|
|
650
784
|
}
|
|
651
|
-
var client = grpc.unary(Platform.
|
|
785
|
+
var client = grpc.unary(Platform.getProtocolVersionUpgradeVoteStatus, {
|
|
652
786
|
request: requestMessage,
|
|
653
787
|
host: this.serviceHost,
|
|
654
788
|
metadata: metadata,
|
|
@@ -675,11 +809,11 @@ PlatformClient.prototype.getProtocolVersionUpgradeState = function getProtocolVe
|
|
|
675
809
|
};
|
|
676
810
|
};
|
|
677
811
|
|
|
678
|
-
PlatformClient.prototype.
|
|
812
|
+
PlatformClient.prototype.getEpochsInfo = function getEpochsInfo(requestMessage, metadata, callback) {
|
|
679
813
|
if (arguments.length === 2) {
|
|
680
814
|
callback = arguments[1];
|
|
681
815
|
}
|
|
682
|
-
var client = grpc.unary(Platform.
|
|
816
|
+
var client = grpc.unary(Platform.getEpochsInfo, {
|
|
683
817
|
request: requestMessage,
|
|
684
818
|
host: this.serviceHost,
|
|
685
819
|
metadata: metadata,
|
|
@@ -706,11 +840,197 @@ PlatformClient.prototype.getProtocolVersionUpgradeVoteStatus = function getProto
|
|
|
706
840
|
};
|
|
707
841
|
};
|
|
708
842
|
|
|
709
|
-
PlatformClient.prototype.
|
|
843
|
+
PlatformClient.prototype.getContestedResources = function getContestedResources(requestMessage, metadata, callback) {
|
|
710
844
|
if (arguments.length === 2) {
|
|
711
845
|
callback = arguments[1];
|
|
712
846
|
}
|
|
713
|
-
var client = grpc.unary(Platform.
|
|
847
|
+
var client = grpc.unary(Platform.getContestedResources, {
|
|
848
|
+
request: requestMessage,
|
|
849
|
+
host: this.serviceHost,
|
|
850
|
+
metadata: metadata,
|
|
851
|
+
transport: this.options.transport,
|
|
852
|
+
debug: this.options.debug,
|
|
853
|
+
onEnd: function (response) {
|
|
854
|
+
if (callback) {
|
|
855
|
+
if (response.status !== grpc.Code.OK) {
|
|
856
|
+
var err = new Error(response.statusMessage);
|
|
857
|
+
err.code = response.status;
|
|
858
|
+
err.metadata = response.trailers;
|
|
859
|
+
callback(err, null);
|
|
860
|
+
} else {
|
|
861
|
+
callback(null, response.message);
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
return {
|
|
867
|
+
cancel: function () {
|
|
868
|
+
callback = null;
|
|
869
|
+
client.close();
|
|
870
|
+
}
|
|
871
|
+
};
|
|
872
|
+
};
|
|
873
|
+
|
|
874
|
+
PlatformClient.prototype.getContestedResourceVoteState = function getContestedResourceVoteState(requestMessage, metadata, callback) {
|
|
875
|
+
if (arguments.length === 2) {
|
|
876
|
+
callback = arguments[1];
|
|
877
|
+
}
|
|
878
|
+
var client = grpc.unary(Platform.getContestedResourceVoteState, {
|
|
879
|
+
request: requestMessage,
|
|
880
|
+
host: this.serviceHost,
|
|
881
|
+
metadata: metadata,
|
|
882
|
+
transport: this.options.transport,
|
|
883
|
+
debug: this.options.debug,
|
|
884
|
+
onEnd: function (response) {
|
|
885
|
+
if (callback) {
|
|
886
|
+
if (response.status !== grpc.Code.OK) {
|
|
887
|
+
var err = new Error(response.statusMessage);
|
|
888
|
+
err.code = response.status;
|
|
889
|
+
err.metadata = response.trailers;
|
|
890
|
+
callback(err, null);
|
|
891
|
+
} else {
|
|
892
|
+
callback(null, response.message);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
return {
|
|
898
|
+
cancel: function () {
|
|
899
|
+
callback = null;
|
|
900
|
+
client.close();
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
PlatformClient.prototype.getContestedResourceVotersForIdentity = function getContestedResourceVotersForIdentity(requestMessage, metadata, callback) {
|
|
906
|
+
if (arguments.length === 2) {
|
|
907
|
+
callback = arguments[1];
|
|
908
|
+
}
|
|
909
|
+
var client = grpc.unary(Platform.getContestedResourceVotersForIdentity, {
|
|
910
|
+
request: requestMessage,
|
|
911
|
+
host: this.serviceHost,
|
|
912
|
+
metadata: metadata,
|
|
913
|
+
transport: this.options.transport,
|
|
914
|
+
debug: this.options.debug,
|
|
915
|
+
onEnd: function (response) {
|
|
916
|
+
if (callback) {
|
|
917
|
+
if (response.status !== grpc.Code.OK) {
|
|
918
|
+
var err = new Error(response.statusMessage);
|
|
919
|
+
err.code = response.status;
|
|
920
|
+
err.metadata = response.trailers;
|
|
921
|
+
callback(err, null);
|
|
922
|
+
} else {
|
|
923
|
+
callback(null, response.message);
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
});
|
|
928
|
+
return {
|
|
929
|
+
cancel: function () {
|
|
930
|
+
callback = null;
|
|
931
|
+
client.close();
|
|
932
|
+
}
|
|
933
|
+
};
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
PlatformClient.prototype.getContestedResourceIdentityVotes = function getContestedResourceIdentityVotes(requestMessage, metadata, callback) {
|
|
937
|
+
if (arguments.length === 2) {
|
|
938
|
+
callback = arguments[1];
|
|
939
|
+
}
|
|
940
|
+
var client = grpc.unary(Platform.getContestedResourceIdentityVotes, {
|
|
941
|
+
request: requestMessage,
|
|
942
|
+
host: this.serviceHost,
|
|
943
|
+
metadata: metadata,
|
|
944
|
+
transport: this.options.transport,
|
|
945
|
+
debug: this.options.debug,
|
|
946
|
+
onEnd: function (response) {
|
|
947
|
+
if (callback) {
|
|
948
|
+
if (response.status !== grpc.Code.OK) {
|
|
949
|
+
var err = new Error(response.statusMessage);
|
|
950
|
+
err.code = response.status;
|
|
951
|
+
err.metadata = response.trailers;
|
|
952
|
+
callback(err, null);
|
|
953
|
+
} else {
|
|
954
|
+
callback(null, response.message);
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
});
|
|
959
|
+
return {
|
|
960
|
+
cancel: function () {
|
|
961
|
+
callback = null;
|
|
962
|
+
client.close();
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
};
|
|
966
|
+
|
|
967
|
+
PlatformClient.prototype.getVotePollsByEndDate = function getVotePollsByEndDate(requestMessage, metadata, callback) {
|
|
968
|
+
if (arguments.length === 2) {
|
|
969
|
+
callback = arguments[1];
|
|
970
|
+
}
|
|
971
|
+
var client = grpc.unary(Platform.getVotePollsByEndDate, {
|
|
972
|
+
request: requestMessage,
|
|
973
|
+
host: this.serviceHost,
|
|
974
|
+
metadata: metadata,
|
|
975
|
+
transport: this.options.transport,
|
|
976
|
+
debug: this.options.debug,
|
|
977
|
+
onEnd: function (response) {
|
|
978
|
+
if (callback) {
|
|
979
|
+
if (response.status !== grpc.Code.OK) {
|
|
980
|
+
var err = new Error(response.statusMessage);
|
|
981
|
+
err.code = response.status;
|
|
982
|
+
err.metadata = response.trailers;
|
|
983
|
+
callback(err, null);
|
|
984
|
+
} else {
|
|
985
|
+
callback(null, response.message);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
});
|
|
990
|
+
return {
|
|
991
|
+
cancel: function () {
|
|
992
|
+
callback = null;
|
|
993
|
+
client.close();
|
|
994
|
+
}
|
|
995
|
+
};
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
PlatformClient.prototype.getPrefundedSpecializedBalance = function getPrefundedSpecializedBalance(requestMessage, metadata, callback) {
|
|
999
|
+
if (arguments.length === 2) {
|
|
1000
|
+
callback = arguments[1];
|
|
1001
|
+
}
|
|
1002
|
+
var client = grpc.unary(Platform.getPrefundedSpecializedBalance, {
|
|
1003
|
+
request: requestMessage,
|
|
1004
|
+
host: this.serviceHost,
|
|
1005
|
+
metadata: metadata,
|
|
1006
|
+
transport: this.options.transport,
|
|
1007
|
+
debug: this.options.debug,
|
|
1008
|
+
onEnd: function (response) {
|
|
1009
|
+
if (callback) {
|
|
1010
|
+
if (response.status !== grpc.Code.OK) {
|
|
1011
|
+
var err = new Error(response.statusMessage);
|
|
1012
|
+
err.code = response.status;
|
|
1013
|
+
err.metadata = response.trailers;
|
|
1014
|
+
callback(err, null);
|
|
1015
|
+
} else {
|
|
1016
|
+
callback(null, response.message);
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
});
|
|
1021
|
+
return {
|
|
1022
|
+
cancel: function () {
|
|
1023
|
+
callback = null;
|
|
1024
|
+
client.close();
|
|
1025
|
+
}
|
|
1026
|
+
};
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
PlatformClient.prototype.getPathElements = function getPathElements(requestMessage, metadata, callback) {
|
|
1030
|
+
if (arguments.length === 2) {
|
|
1031
|
+
callback = arguments[1];
|
|
1032
|
+
}
|
|
1033
|
+
var client = grpc.unary(Platform.getPathElements, {
|
|
714
1034
|
request: requestMessage,
|
|
715
1035
|
host: this.serviceHost,
|
|
716
1036
|
metadata: metadata,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dashevo/grpc-common": "0.
|
|
48
|
+
"@dashevo/grpc-common": "1.0.0-beta.2",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -3,20 +3,23 @@ syntax = "proto3";
|
|
|
3
3
|
package org.dash.platform.dapi.v0;
|
|
4
4
|
|
|
5
5
|
service Core {
|
|
6
|
-
rpc
|
|
6
|
+
rpc getBlockchainStatus (GetBlockchainStatusRequest) returns (GetBlockchainStatusResponse);
|
|
7
|
+
rpc getMasternodeStatus (GetMasternodeStatusRequest) returns (GetMasternodeStatusResponse);
|
|
7
8
|
rpc getBlock (GetBlockRequest) returns (GetBlockResponse);
|
|
9
|
+
rpc getBestBlockHeight (GetBestBlockHeightRequest) returns (GetBestBlockHeightResponse);
|
|
8
10
|
rpc broadcastTransaction (BroadcastTransactionRequest) returns (BroadcastTransactionResponse);
|
|
9
11
|
rpc getTransaction (GetTransactionRequest) returns (GetTransactionResponse);
|
|
10
12
|
rpc getEstimatedTransactionFee (GetEstimatedTransactionFeeRequest) returns (GetEstimatedTransactionFeeResponse);
|
|
11
13
|
rpc subscribeToBlockHeadersWithChainLocks (BlockHeadersWithChainLocksRequest) returns (stream BlockHeadersWithChainLocksResponse);
|
|
12
14
|
rpc subscribeToTransactionsWithProofs (TransactionsWithProofsRequest) returns (stream TransactionsWithProofsResponse);
|
|
15
|
+
rpc subscribeToMasternodeList (MasternodeListRequest) returns (stream MasternodeListResponse);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
message
|
|
18
|
+
message GetBlockchainStatusRequest {
|
|
16
19
|
|
|
17
20
|
}
|
|
18
21
|
|
|
19
|
-
message
|
|
22
|
+
message GetBlockchainStatusResponse {
|
|
20
23
|
message Version {
|
|
21
24
|
uint32 protocol = 1;
|
|
22
25
|
uint32 software = 2;
|
|
@@ -47,25 +50,6 @@ message GetStatusResponse {
|
|
|
47
50
|
double sync_progress = 8;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
message Masternode {
|
|
51
|
-
enum Status {
|
|
52
|
-
UNKNOWN = 0;
|
|
53
|
-
WAITING_FOR_PROTX = 1;
|
|
54
|
-
POSE_BANNED = 2;
|
|
55
|
-
REMOVED = 3;
|
|
56
|
-
OPERATOR_KEY_CHANGED = 4;
|
|
57
|
-
PROTX_IP_CHANGED = 5;
|
|
58
|
-
READY = 6;
|
|
59
|
-
ERROR = 7;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
Status status = 1;
|
|
63
|
-
bytes pro_tx_hash = 2;
|
|
64
|
-
uint32 pose_penalty = 3;
|
|
65
|
-
bool is_synced = 4;
|
|
66
|
-
double sync_progress = 5;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
53
|
message NetworkFee {
|
|
70
54
|
double relay = 1;
|
|
71
55
|
double incremental = 2;
|
|
@@ -81,10 +65,32 @@ message GetStatusResponse {
|
|
|
81
65
|
Status status = 3;
|
|
82
66
|
double sync_progress = 4;
|
|
83
67
|
Chain chain = 5;
|
|
84
|
-
Masternode masternode = 6;
|
|
85
68
|
Network network = 7;
|
|
86
69
|
}
|
|
87
70
|
|
|
71
|
+
message GetMasternodeStatusRequest {
|
|
72
|
+
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
message GetMasternodeStatusResponse {
|
|
76
|
+
enum Status {
|
|
77
|
+
UNKNOWN = 0;
|
|
78
|
+
WAITING_FOR_PROTX = 1;
|
|
79
|
+
POSE_BANNED = 2;
|
|
80
|
+
REMOVED = 3;
|
|
81
|
+
OPERATOR_KEY_CHANGED = 4;
|
|
82
|
+
PROTX_IP_CHANGED = 5;
|
|
83
|
+
READY = 6;
|
|
84
|
+
ERROR = 7;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
Status status = 1;
|
|
88
|
+
bytes pro_tx_hash = 2;
|
|
89
|
+
uint32 pose_penalty = 3;
|
|
90
|
+
bool is_synced = 4;
|
|
91
|
+
double sync_progress = 5;
|
|
92
|
+
}
|
|
93
|
+
|
|
88
94
|
message GetBlockRequest {
|
|
89
95
|
oneof block {
|
|
90
96
|
uint32 height = 1;
|
|
@@ -96,6 +102,14 @@ message GetBlockResponse {
|
|
|
96
102
|
bytes block = 1;
|
|
97
103
|
}
|
|
98
104
|
|
|
105
|
+
message GetBestBlockHeightRequest {
|
|
106
|
+
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
message GetBestBlockHeightResponse {
|
|
110
|
+
uint32 height = 1;
|
|
111
|
+
}
|
|
112
|
+
|
|
99
113
|
message BroadcastTransactionRequest {
|
|
100
114
|
bytes transaction = 1;
|
|
101
115
|
bool allow_high_fees = 2;
|
|
@@ -182,3 +196,11 @@ message RawTransactions {
|
|
|
182
196
|
message InstantSendLockMessages {
|
|
183
197
|
repeated bytes messages = 1;
|
|
184
198
|
}
|
|
199
|
+
|
|
200
|
+
message MasternodeListRequest {
|
|
201
|
+
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
message MasternodeListResponse {
|
|
205
|
+
bytes masternode_list_diff = 1;
|
|
206
|
+
}
|