@dashevo/dapi-grpc 0.25.8 → 0.25.9

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 CHANGED
@@ -10,6 +10,7 @@ authors = [
10
10
  "Ivan Shumkov <shumkov@dash.org>",
11
11
  ]
12
12
  edition = "2021"
13
+ rust-version = "1.73"
13
14
  license = "MIT"
14
15
 
15
16
  [dependencies]
@@ -40,6 +40,12 @@ const {
40
40
  WaitForStateTransitionResultResponse: PBJSWaitForStateTransitionResultResponse,
41
41
  GetConsensusParamsRequest: PBJSGetConsensusParamsRequest,
42
42
  GetConsensusParamsResponse: PBJSGetConsensusParamsResponse,
43
+ GetEpochsInfoRequest: PBJSGetEpochsInfoRequest,
44
+ GetEpochsInfoResponse: PBJSGetEpochsInfoResponse,
45
+ GetVersionUpgradeVoteStatusRequest: PBJSGetVersionUpgradeVoteStatusRequest,
46
+ GetVersionUpgradeVoteStatusResponse: PBJSGetVersionUpgradeVoteStatusResponse,
47
+ GetVersionUpgradeStateRequest: PBJSGetVersionUpgradeStateRequest,
48
+ GetVersionUpgradeStateResponse: PBJSGetVersionUpgradeStateResponse,
43
49
  },
44
50
  },
45
51
  },
@@ -56,6 +62,9 @@ const {
56
62
  GetIdentitiesByPublicKeyHashesResponse: ProtocGetIdentitiesByPublicKeyHashesResponse,
57
63
  WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
58
64
  GetConsensusParamsResponse: ProtocGetConsensusParamsResponse,
65
+ GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
66
+ GetVersionUpgradeVoteStatusResponse: ProtocGetVersionUpgradeVoteStatusResponse,
67
+ GetVersionUpgradeStateResponse: ProtocGetVersionUpgradeStateResponse,
59
68
  } = require('./platform_protoc');
60
69
 
61
70
  const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
@@ -114,6 +123,18 @@ class PlatformPromiseClient {
114
123
  this.client.getConsensusParams.bind(this.client),
115
124
  );
116
125
 
126
+ this.client.getEpochsInfo = promisify(
127
+ this.client.getEpochsInfo.bind(this.client),
128
+ );
129
+
130
+ this.client.getVersionUpgradeVoteStatus = promisify(
131
+ this.client.getVersionUpgradeVoteStatus.bind(this.client),
132
+ );
133
+
134
+ this.client.getVersionUpgradeState = promisify(
135
+ this.client.getVersionUpgradeState.bind(this.client),
136
+ );
137
+
117
138
  this.protocolVersion = undefined;
118
139
  }
119
140
 
@@ -374,6 +395,99 @@ class PlatformPromiseClient {
374
395
  );
375
396
  }
376
397
 
398
+ /**
399
+ * @param {!GetEpochsInfoRequest} getEpochsInfoRequest
400
+ * @param {?Object<string, string>} metadata
401
+ * @param {CallOptions} [options={}]
402
+ * @return {Promise<!GetEpochsInfoResponse>}
403
+ */
404
+ getEpochsInfo(getEpochsInfoRequest, metadata = {}, options = {}) {
405
+ if (!isObject(metadata)) {
406
+ throw new Error('metadata must be an object');
407
+ }
408
+
409
+ return this.client.getEpochsInfo(
410
+ getEpochsInfoRequest,
411
+ convertObjectToMetadata(metadata),
412
+ {
413
+ interceptors: [
414
+ jsonToProtobufInterceptorFactory(
415
+ jsonToProtobufFactory(
416
+ ProtocGetEpochsInfoResponse,
417
+ PBJSGetEpochsInfoResponse,
418
+ ),
419
+ protobufToJsonFactory(
420
+ PBJSGetEpochsInfoRequest,
421
+ ),
422
+ ),
423
+ ],
424
+ ...options,
425
+ },
426
+ );
427
+ }
428
+
429
+ /**
430
+ * @param {!GetVersionUpgradeVoteStatusRequest} getVersionUpgradeVoteStatusRequest
431
+ * @param {?Object<string, string>} metadata
432
+ * @param {CallOptions} [options={}]
433
+ * @return {Promise<!GetVersionUpgradeVoteStatusResponse>}
434
+ */
435
+ getVersionUpgradeVoteStatus(getVersionUpgradeVoteStatusRequest, metadata = {}, options = {}) {
436
+ if (!isObject(metadata)) {
437
+ throw new Error('metadata must be an object');
438
+ }
439
+
440
+ return this.client.getVersionUpgradeVoteStatus(
441
+ getVersionUpgradeVoteStatusRequest,
442
+ convertObjectToMetadata(metadata),
443
+ {
444
+ interceptors: [
445
+ jsonToProtobufInterceptorFactory(
446
+ jsonToProtobufFactory(
447
+ ProtocGetVersionUpgradeVoteStatusResponse,
448
+ PBJSGetVersionUpgradeVoteStatusResponse,
449
+ ),
450
+ protobufToJsonFactory(
451
+ PBJSGetVersionUpgradeVoteStatusRequest,
452
+ ),
453
+ ),
454
+ ],
455
+ ...options,
456
+ },
457
+ );
458
+ }
459
+
460
+ /**
461
+ * @param {!GetVersionUpgradeStateRequest} getVersionUpgradeStateRequest
462
+ * @param {?Object<string, string>} metadata
463
+ * @param {CallOptions} [options={}]
464
+ * @return {Promise<!GetVersionUpgradeStateResponse>}
465
+ */
466
+ getVersionUpgradeState(getVersionUpgradeStateRequest, metadata = {}, options = {}) {
467
+ if (!isObject(metadata)) {
468
+ throw new Error('metadata must be an object');
469
+ }
470
+
471
+ return this.client.getVersionUpgradeState(
472
+ getVersionUpgradeStateRequest,
473
+ convertObjectToMetadata(metadata),
474
+ {
475
+ interceptors: [
476
+ jsonToProtobufInterceptorFactory(
477
+ jsonToProtobufFactory(
478
+ ProtocGetVersionUpgradeStateResponse,
479
+ PBJSGetVersionUpgradeStateResponse,
480
+ ),
481
+ protobufToJsonFactory(
482
+ PBJSGetVersionUpgradeStateRequest,
483
+ ),
484
+ ),
485
+ ],
486
+ ...options,
487
+ },
488
+ );
489
+ }
490
+
377
491
  /**
378
492
  * @param {string} protocolVersion
379
493
  */