@dashevo/dapi-grpc 1.2.0-rc.1 → 1.3.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.
@@ -67,6 +67,15 @@ type PlatformgetIdentityBalance = {
67
67
  readonly responseType: typeof platform_pb.GetIdentityBalanceResponse;
68
68
  };
69
69
 
70
+ type PlatformgetIdentitiesBalances = {
71
+ readonly methodName: string;
72
+ readonly service: typeof Platform;
73
+ readonly requestStream: false;
74
+ readonly responseStream: false;
75
+ readonly requestType: typeof platform_pb.GetIdentitiesBalancesRequest;
76
+ readonly responseType: typeof platform_pb.GetIdentitiesBalancesResponse;
77
+ };
78
+
70
79
  type PlatformgetIdentityBalanceAndRevision = {
71
80
  readonly methodName: string;
72
81
  readonly service: typeof Platform;
@@ -76,6 +85,24 @@ type PlatformgetIdentityBalanceAndRevision = {
76
85
  readonly responseType: typeof platform_pb.GetIdentityBalanceAndRevisionResponse;
77
86
  };
78
87
 
88
+ type PlatformgetEvonodesProposedEpochBlocksByIds = {
89
+ readonly methodName: string;
90
+ readonly service: typeof Platform;
91
+ readonly requestStream: false;
92
+ readonly responseStream: false;
93
+ readonly requestType: typeof platform_pb.GetEvonodesProposedEpochBlocksByIdsRequest;
94
+ readonly responseType: typeof platform_pb.GetEvonodesProposedEpochBlocksResponse;
95
+ };
96
+
97
+ type PlatformgetEvonodesProposedEpochBlocksByRange = {
98
+ readonly methodName: string;
99
+ readonly service: typeof Platform;
100
+ readonly requestStream: false;
101
+ readonly responseStream: false;
102
+ readonly requestType: typeof platform_pb.GetEvonodesProposedEpochBlocksByRangeRequest;
103
+ readonly responseType: typeof platform_pb.GetEvonodesProposedEpochBlocksResponse;
104
+ };
105
+
79
106
  type PlatformgetProofs = {
80
107
  readonly methodName: string;
81
108
  readonly service: typeof Platform;
@@ -265,7 +292,10 @@ export class Platform {
265
292
  static readonly getIdentityNonce: PlatformgetIdentityNonce;
266
293
  static readonly getIdentityContractNonce: PlatformgetIdentityContractNonce;
267
294
  static readonly getIdentityBalance: PlatformgetIdentityBalance;
295
+ static readonly getIdentitiesBalances: PlatformgetIdentitiesBalances;
268
296
  static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision;
297
+ static readonly getEvonodesProposedEpochBlocksByIds: PlatformgetEvonodesProposedEpochBlocksByIds;
298
+ static readonly getEvonodesProposedEpochBlocksByRange: PlatformgetEvonodesProposedEpochBlocksByRange;
269
299
  static readonly getProofs: PlatformgetProofs;
270
300
  static readonly getDataContract: PlatformgetDataContract;
271
301
  static readonly getDataContractHistory: PlatformgetDataContractHistory;
@@ -383,6 +413,15 @@ export class PlatformClient {
383
413
  requestMessage: platform_pb.GetIdentityBalanceRequest,
384
414
  callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void
385
415
  ): UnaryResponse;
416
+ getIdentitiesBalances(
417
+ requestMessage: platform_pb.GetIdentitiesBalancesRequest,
418
+ metadata: grpc.Metadata,
419
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesBalancesResponse|null) => void
420
+ ): UnaryResponse;
421
+ getIdentitiesBalances(
422
+ requestMessage: platform_pb.GetIdentitiesBalancesRequest,
423
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesBalancesResponse|null) => void
424
+ ): UnaryResponse;
386
425
  getIdentityBalanceAndRevision(
387
426
  requestMessage: platform_pb.GetIdentityBalanceAndRevisionRequest,
388
427
  metadata: grpc.Metadata,
@@ -392,6 +431,24 @@ export class PlatformClient {
392
431
  requestMessage: platform_pb.GetIdentityBalanceAndRevisionRequest,
393
432
  callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void
394
433
  ): UnaryResponse;
434
+ getEvonodesProposedEpochBlocksByIds(
435
+ requestMessage: platform_pb.GetEvonodesProposedEpochBlocksByIdsRequest,
436
+ metadata: grpc.Metadata,
437
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetEvonodesProposedEpochBlocksResponse|null) => void
438
+ ): UnaryResponse;
439
+ getEvonodesProposedEpochBlocksByIds(
440
+ requestMessage: platform_pb.GetEvonodesProposedEpochBlocksByIdsRequest,
441
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetEvonodesProposedEpochBlocksResponse|null) => void
442
+ ): UnaryResponse;
443
+ getEvonodesProposedEpochBlocksByRange(
444
+ requestMessage: platform_pb.GetEvonodesProposedEpochBlocksByRangeRequest,
445
+ metadata: grpc.Metadata,
446
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetEvonodesProposedEpochBlocksResponse|null) => void
447
+ ): UnaryResponse;
448
+ getEvonodesProposedEpochBlocksByRange(
449
+ requestMessage: platform_pb.GetEvonodesProposedEpochBlocksByRangeRequest,
450
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetEvonodesProposedEpochBlocksResponse|null) => void
451
+ ): UnaryResponse;
395
452
  getProofs(
396
453
  requestMessage: platform_pb.GetProofsRequest,
397
454
  metadata: grpc.Metadata,
@@ -73,6 +73,15 @@ Platform.getIdentityBalance = {
73
73
  responseType: platform_pb.GetIdentityBalanceResponse
74
74
  };
75
75
 
76
+ Platform.getIdentitiesBalances = {
77
+ methodName: "getIdentitiesBalances",
78
+ service: Platform,
79
+ requestStream: false,
80
+ responseStream: false,
81
+ requestType: platform_pb.GetIdentitiesBalancesRequest,
82
+ responseType: platform_pb.GetIdentitiesBalancesResponse
83
+ };
84
+
76
85
  Platform.getIdentityBalanceAndRevision = {
77
86
  methodName: "getIdentityBalanceAndRevision",
78
87
  service: Platform,
@@ -82,6 +91,24 @@ Platform.getIdentityBalanceAndRevision = {
82
91
  responseType: platform_pb.GetIdentityBalanceAndRevisionResponse
83
92
  };
84
93
 
94
+ Platform.getEvonodesProposedEpochBlocksByIds = {
95
+ methodName: "getEvonodesProposedEpochBlocksByIds",
96
+ service: Platform,
97
+ requestStream: false,
98
+ responseStream: false,
99
+ requestType: platform_pb.GetEvonodesProposedEpochBlocksByIdsRequest,
100
+ responseType: platform_pb.GetEvonodesProposedEpochBlocksResponse
101
+ };
102
+
103
+ Platform.getEvonodesProposedEpochBlocksByRange = {
104
+ methodName: "getEvonodesProposedEpochBlocksByRange",
105
+ service: Platform,
106
+ requestStream: false,
107
+ responseStream: false,
108
+ requestType: platform_pb.GetEvonodesProposedEpochBlocksByRangeRequest,
109
+ responseType: platform_pb.GetEvonodesProposedEpochBlocksResponse
110
+ };
111
+
85
112
  Platform.getProofs = {
86
113
  methodName: "getProofs",
87
114
  service: Platform,
@@ -486,6 +513,37 @@ PlatformClient.prototype.getIdentityBalance = function getIdentityBalance(reques
486
513
  };
487
514
  };
488
515
 
516
+ PlatformClient.prototype.getIdentitiesBalances = function getIdentitiesBalances(requestMessage, metadata, callback) {
517
+ if (arguments.length === 2) {
518
+ callback = arguments[1];
519
+ }
520
+ var client = grpc.unary(Platform.getIdentitiesBalances, {
521
+ request: requestMessage,
522
+ host: this.serviceHost,
523
+ metadata: metadata,
524
+ transport: this.options.transport,
525
+ debug: this.options.debug,
526
+ onEnd: function (response) {
527
+ if (callback) {
528
+ if (response.status !== grpc.Code.OK) {
529
+ var err = new Error(response.statusMessage);
530
+ err.code = response.status;
531
+ err.metadata = response.trailers;
532
+ callback(err, null);
533
+ } else {
534
+ callback(null, response.message);
535
+ }
536
+ }
537
+ }
538
+ });
539
+ return {
540
+ cancel: function () {
541
+ callback = null;
542
+ client.close();
543
+ }
544
+ };
545
+ };
546
+
489
547
  PlatformClient.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(requestMessage, metadata, callback) {
490
548
  if (arguments.length === 2) {
491
549
  callback = arguments[1];
@@ -517,6 +575,68 @@ PlatformClient.prototype.getIdentityBalanceAndRevision = function getIdentityBal
517
575
  };
518
576
  };
519
577
 
578
+ PlatformClient.prototype.getEvonodesProposedEpochBlocksByIds = function getEvonodesProposedEpochBlocksByIds(requestMessage, metadata, callback) {
579
+ if (arguments.length === 2) {
580
+ callback = arguments[1];
581
+ }
582
+ var client = grpc.unary(Platform.getEvonodesProposedEpochBlocksByIds, {
583
+ request: requestMessage,
584
+ host: this.serviceHost,
585
+ metadata: metadata,
586
+ transport: this.options.transport,
587
+ debug: this.options.debug,
588
+ onEnd: function (response) {
589
+ if (callback) {
590
+ if (response.status !== grpc.Code.OK) {
591
+ var err = new Error(response.statusMessage);
592
+ err.code = response.status;
593
+ err.metadata = response.trailers;
594
+ callback(err, null);
595
+ } else {
596
+ callback(null, response.message);
597
+ }
598
+ }
599
+ }
600
+ });
601
+ return {
602
+ cancel: function () {
603
+ callback = null;
604
+ client.close();
605
+ }
606
+ };
607
+ };
608
+
609
+ PlatformClient.prototype.getEvonodesProposedEpochBlocksByRange = function getEvonodesProposedEpochBlocksByRange(requestMessage, metadata, callback) {
610
+ if (arguments.length === 2) {
611
+ callback = arguments[1];
612
+ }
613
+ var client = grpc.unary(Platform.getEvonodesProposedEpochBlocksByRange, {
614
+ request: requestMessage,
615
+ host: this.serviceHost,
616
+ metadata: metadata,
617
+ transport: this.options.transport,
618
+ debug: this.options.debug,
619
+ onEnd: function (response) {
620
+ if (callback) {
621
+ if (response.status !== grpc.Code.OK) {
622
+ var err = new Error(response.statusMessage);
623
+ err.code = response.status;
624
+ err.metadata = response.trailers;
625
+ callback(err, null);
626
+ } else {
627
+ callback(null, response.message);
628
+ }
629
+ }
630
+ }
631
+ });
632
+ return {
633
+ cancel: function () {
634
+ callback = null;
635
+ client.close();
636
+ }
637
+ };
638
+ };
639
+
520
640
  PlatformClient.prototype.getProofs = function getProofs(requestMessage, metadata, callback) {
521
641
  if (arguments.length === 2) {
522
642
  callback = arguments[1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-grpc",
3
- "version": "1.2.0-rc.1",
3
+ "version": "1.3.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.2.0-rc.1",
48
+ "@dashevo/grpc-common": "1.3.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",
@@ -16,8 +16,14 @@ service Platform {
16
16
  rpc getIdentityContractNonce(GetIdentityContractNonceRequest) returns (GetIdentityContractNonceResponse);
17
17
  rpc getIdentityBalance(GetIdentityBalanceRequest)
18
18
  returns (GetIdentityBalanceResponse);
19
+ rpc getIdentitiesBalances(GetIdentitiesBalancesRequest)
20
+ returns (GetIdentitiesBalancesResponse);
19
21
  rpc getIdentityBalanceAndRevision(GetIdentityBalanceAndRevisionRequest)
20
22
  returns (GetIdentityBalanceAndRevisionResponse);
23
+ rpc getEvonodesProposedEpochBlocksByIds(GetEvonodesProposedEpochBlocksByIdsRequest)
24
+ returns (GetEvonodesProposedEpochBlocksResponse);
25
+ rpc getEvonodesProposedEpochBlocksByRange(GetEvonodesProposedEpochBlocksByRangeRequest)
26
+ returns (GetEvonodesProposedEpochBlocksResponse);
21
27
  rpc getProofs(GetProofsRequest) returns (GetProofsResponse);
22
28
  rpc getDataContract(GetDataContractRequest) returns (GetDataContractResponse);
23
29
  rpc getDataContractHistory(GetDataContractHistoryRequest)
@@ -307,6 +313,88 @@ message GetIdentitiesContractKeysResponse {
307
313
  oneof version { GetIdentitiesContractKeysResponseV0 v0 = 1; }
308
314
  }
309
315
 
316
+ message GetEvonodesProposedEpochBlocksByIdsRequest {
317
+
318
+ message GetEvonodesProposedEpochBlocksByIdsRequestV0 {
319
+ optional uint32 epoch = 1; // The epoch we are querying for, if none is set, get current epoch
320
+ repeated bytes ids = 2; // IDs of the evonodes for which we want to get their proposed blocks
321
+ bool prove = 3; // Flag to request a proof as the response
322
+ }
323
+
324
+ oneof version { GetEvonodesProposedEpochBlocksByIdsRequestV0 v0 = 1; }
325
+ }
326
+
327
+ message GetEvonodesProposedEpochBlocksResponse {
328
+
329
+ message GetEvonodesProposedEpochBlocksResponseV0 {
330
+ message EvonodeProposedBlocks {
331
+ bytes pro_tx_hash = 1;
332
+ uint64 count = 2;
333
+ }
334
+
335
+ message EvonodesProposedBlocks {
336
+ repeated EvonodeProposedBlocks evonodes_proposed_block_counts = 1;
337
+ }
338
+
339
+ oneof result {
340
+ EvonodesProposedBlocks evonodes_proposed_block_counts_info = 1; // The actual result
341
+ Proof proof = 2; // Proof of the keys data, if requested
342
+ }
343
+ ResponseMetadata metadata = 3; // Metadata about the blockchain state
344
+ }
345
+ oneof version { GetEvonodesProposedEpochBlocksResponseV0 v0 = 1; }
346
+ }
347
+
348
+ message GetEvonodesProposedEpochBlocksByRangeRequest {
349
+
350
+ message GetEvonodesProposedEpochBlocksByRangeRequestV0 {
351
+ optional uint32 epoch = 1; // The epoch we are querying for, if none is set, get current epoch
352
+ optional uint32 limit = 2; // Maximum number of evonodes proposed epoch blocks to return
353
+ oneof start {
354
+ bytes start_after = 3; // Start retrieval after this document
355
+ bytes start_at = 4; // Start retrieval at this document
356
+ }
357
+ bool prove = 5; // Flag to request a proof as the response
358
+ }
359
+
360
+ oneof version { GetEvonodesProposedEpochBlocksByRangeRequestV0 v0 = 1; }
361
+ }
362
+
363
+ message GetIdentitiesBalancesRequest {
364
+ message GetIdentitiesBalancesRequestV0 {
365
+ message GetIdentitiesBalancesByKnownIdentityIds {
366
+ repeated bytes identities_ids = 1;
367
+ }
368
+ GetIdentitiesBalancesByKnownIdentityIds identities_ids = 1;
369
+ bool prove = 2;
370
+ }
371
+
372
+ oneof version {
373
+ GetIdentitiesBalancesRequestV0 v0 = 1;
374
+ }
375
+ }
376
+
377
+ message GetIdentitiesBalancesResponse {
378
+ message GetIdentitiesBalancesResponseV0 {
379
+ message IdentityBalance {
380
+ bytes identity_id = 1;
381
+ optional uint64 balance = 2;
382
+ }
383
+
384
+ message IdentitiesBalances {
385
+ repeated IdentityBalance entries = 1;
386
+ };
387
+
388
+ oneof result {
389
+ IdentitiesBalances identities_balances = 1;
390
+ Proof proof = 2;
391
+ }
392
+ ResponseMetadata metadata = 3;
393
+ }
394
+
395
+ oneof version { GetIdentitiesBalancesResponseV0 v0 = 1; }
396
+ }
397
+
310
398
  message GetProofsRequest {
311
399
  message GetProofsRequestV0 {
312
400
  // DocumentRequest specifies a request for a document proof