@dashevo/dapi-grpc 1.3.1 → 1.4.0-dev.1

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.
@@ -283,6 +283,15 @@ type PlatformgetStatus = {
283
283
  readonly responseType: typeof platform_pb.GetStatusResponse;
284
284
  };
285
285
 
286
+ type PlatformgetCurrentQuorumsInfo = {
287
+ readonly methodName: string;
288
+ readonly service: typeof Platform;
289
+ readonly requestStream: false;
290
+ readonly responseStream: false;
291
+ readonly requestType: typeof platform_pb.GetCurrentQuorumsInfoRequest;
292
+ readonly responseType: typeof platform_pb.GetCurrentQuorumsInfoResponse;
293
+ };
294
+
286
295
  export class Platform {
287
296
  static readonly serviceName: string;
288
297
  static readonly broadcastStateTransition: PlatformbroadcastStateTransition;
@@ -316,6 +325,7 @@ export class Platform {
316
325
  static readonly getTotalCreditsInPlatform: PlatformgetTotalCreditsInPlatform;
317
326
  static readonly getPathElements: PlatformgetPathElements;
318
327
  static readonly getStatus: PlatformgetStatus;
328
+ static readonly getCurrentQuorumsInfo: PlatformgetCurrentQuorumsInfo;
319
329
  }
320
330
 
321
331
  export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
@@ -629,5 +639,14 @@ export class PlatformClient {
629
639
  requestMessage: platform_pb.GetStatusRequest,
630
640
  callback: (error: ServiceError|null, responseMessage: platform_pb.GetStatusResponse|null) => void
631
641
  ): UnaryResponse;
642
+ getCurrentQuorumsInfo(
643
+ requestMessage: platform_pb.GetCurrentQuorumsInfoRequest,
644
+ metadata: grpc.Metadata,
645
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetCurrentQuorumsInfoResponse|null) => void
646
+ ): UnaryResponse;
647
+ getCurrentQuorumsInfo(
648
+ requestMessage: platform_pb.GetCurrentQuorumsInfoRequest,
649
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetCurrentQuorumsInfoResponse|null) => void
650
+ ): UnaryResponse;
632
651
  }
633
652
 
@@ -289,6 +289,15 @@ Platform.getStatus = {
289
289
  responseType: platform_pb.GetStatusResponse
290
290
  };
291
291
 
292
+ Platform.getCurrentQuorumsInfo = {
293
+ methodName: "getCurrentQuorumsInfo",
294
+ service: Platform,
295
+ requestStream: false,
296
+ responseStream: false,
297
+ requestType: platform_pb.GetCurrentQuorumsInfoRequest,
298
+ responseType: platform_pb.GetCurrentQuorumsInfoResponse
299
+ };
300
+
292
301
  exports.Platform = Platform;
293
302
 
294
303
  function PlatformClient(serviceHost, options) {
@@ -1257,5 +1266,36 @@ PlatformClient.prototype.getStatus = function getStatus(requestMessage, metadata
1257
1266
  };
1258
1267
  };
1259
1268
 
1269
+ PlatformClient.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(requestMessage, metadata, callback) {
1270
+ if (arguments.length === 2) {
1271
+ callback = arguments[1];
1272
+ }
1273
+ var client = grpc.unary(Platform.getCurrentQuorumsInfo, {
1274
+ request: requestMessage,
1275
+ host: this.serviceHost,
1276
+ metadata: metadata,
1277
+ transport: this.options.transport,
1278
+ debug: this.options.debug,
1279
+ onEnd: function (response) {
1280
+ if (callback) {
1281
+ if (response.status !== grpc.Code.OK) {
1282
+ var err = new Error(response.statusMessage);
1283
+ err.code = response.status;
1284
+ err.metadata = response.trailers;
1285
+ callback(err, null);
1286
+ } else {
1287
+ callback(null, response.message);
1288
+ }
1289
+ }
1290
+ }
1291
+ });
1292
+ return {
1293
+ cancel: function () {
1294
+ callback = null;
1295
+ client.close();
1296
+ }
1297
+ };
1298
+ };
1299
+
1260
1300
  exports.PlatformClient = PlatformClient;
1261
1301
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-grpc",
3
- "version": "1.3.1",
3
+ "version": "1.4.0-dev.1",
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": "1.3.1",
48
+ "@dashevo/grpc-common": "1.4.0-dev.1",
49
49
  "@dashevo/protobufjs": "6.10.5",
50
50
  "@grpc/grpc-js": "1.4.4",
51
51
  "@improbable-eng/grpc-web": "^0.15.0",
@@ -54,6 +54,7 @@ service Platform {
54
54
  rpc getTotalCreditsInPlatform(GetTotalCreditsInPlatformRequest) returns (GetTotalCreditsInPlatformResponse);
55
55
  rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse);
56
56
  rpc getStatus(GetStatusRequest) returns (GetStatusResponse);
57
+ rpc getCurrentQuorumsInfo(GetCurrentQuorumsInfoRequest) returns (GetCurrentQuorumsInfoResponse);
57
58
  }
58
59
 
59
60
  // Proof message includes cryptographic proofs for validating responses
@@ -1184,3 +1185,33 @@ message GetStatusResponse {
1184
1185
 
1185
1186
  oneof version { GetStatusResponseV0 v0 = 1; }
1186
1187
  }
1188
+
1189
+ message GetCurrentQuorumsInfoRequest {
1190
+ message GetCurrentQuorumsInfoRequestV0 {
1191
+ }
1192
+
1193
+ oneof version { GetCurrentQuorumsInfoRequestV0 v0 = 1; }
1194
+ }
1195
+
1196
+ message GetCurrentQuorumsInfoResponse {
1197
+ message ValidatorV0 {
1198
+ bytes pro_tx_hash = 1;
1199
+ string node_ip = 2;
1200
+ bool is_banned = 3;
1201
+ }
1202
+ message ValidatorSetV0 {
1203
+ bytes quorum_hash = 1;
1204
+ uint32 core_height = 2;
1205
+ repeated ValidatorV0 members = 3;
1206
+ bytes threshold_public_key = 4;
1207
+ }
1208
+
1209
+ message GetCurrentQuorumsInfoResponseV0 {
1210
+ repeated bytes quorum_hashes = 1;
1211
+ bytes current_quorum_hash = 2;
1212
+ repeated ValidatorSetV0 validator_sets = 3;
1213
+ bytes last_block_proposer = 4;
1214
+ ResponseMetadata metadata = 5;
1215
+ }
1216
+ oneof version { GetCurrentQuorumsInfoResponseV0 v0 = 1; }
1217
+ }