@dashevo/dapi-grpc 1.1.0-pr.1713.2 → 1.1.0-pr.2012.4

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
@@ -1,7 +1,7 @@
1
1
  [package]
2
2
  name = "dapi-grpc"
3
3
  description = "GRPC client for Dash Platform"
4
- version = "1.1.0-pr.1713.2"
4
+ version = "1.1.0-dev.1"
5
5
  authors = [
6
6
  "Samuel Westrich <sam@dash.org>",
7
7
  "Igor Markin <igor.markin@dash.org>",
package/build.rs CHANGED
@@ -47,7 +47,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
47
47
  // Derive features for versioned messages
48
48
  //
49
49
  // "GetConsensusParamsRequest" is excluded as this message does not support proofs
50
- const VERSIONED_REQUESTS: [&str; 25] = [
50
+ const VERSIONED_REQUESTS: [&str; 26] = [
51
51
  "GetDataContractHistoryRequest",
52
52
  "GetDataContractRequest",
53
53
  "GetDataContractsRequest",
@@ -73,10 +73,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
73
73
  "GetContestedResourceVotersForIdentityRequest",
74
74
  "GetContestedResourceIdentityVotesRequest",
75
75
  "GetVotePollsByEndDateRequest",
76
+ "GetTotalCreditsInPlatformRequest",
76
77
  ];
77
78
 
78
79
  // "GetConsensusParamsResponse" is excluded as this message does not support proofs
79
- const VERSIONED_RESPONSES: [&str; 26] = [
80
+ const VERSIONED_RESPONSES: [&str; 27] = [
80
81
  "GetDataContractHistoryResponse",
81
82
  "GetDataContractResponse",
82
83
  "GetDataContractsResponse",
@@ -103,6 +104,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
103
104
  "GetContestedResourceVotersForIdentityResponse",
104
105
  "GetContestedResourceIdentityVotesResponse",
105
106
  "GetVotePollsByEndDateResponse",
107
+ "GetTotalCreditsInPlatformResponse",
106
108
  ];
107
109
 
108
110
  check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
@@ -58,6 +58,8 @@ const {
58
58
  GetIdentityNonceResponse: PBJSGetIdentityNonceResponse,
59
59
  GetIdentityKeysRequest: PBJSGetIdentityKeysRequest,
60
60
  GetIdentityKeysResponse: PBJSGetIdentityKeysResponse,
61
+ GetTotalCreditsInPlatformRequest: PBJSGetTotalCreditsInPlatformRequest,
62
+ GetTotalCreditsInPlatformResponse: PBJSGetTotalCreditsInPlatformResponse,
61
63
  },
62
64
  },
63
65
  },
@@ -82,6 +84,7 @@ const {
82
84
  GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
83
85
  GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
84
86
  GetIdentityKeysResponse: ProtocGetIdentityKeysResponse,
87
+ GetTotalCreditsInPlatformResponse: ProtocGetTotalCreditsInPlatformResponse,
85
88
  } = require('./platform_protoc');
86
89
 
87
90
  const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
@@ -172,6 +175,10 @@ class PlatformPromiseClient {
172
175
  this.client.getIdentityKeys.bind(this.client),
173
176
  );
174
177
 
178
+ this.client.getTotalCreditsInPlatform = promisify(
179
+ this.client.getTotalCreditsInPlatform.bind(this.client),
180
+ );
181
+
175
182
  this.protocolVersion = undefined;
176
183
  }
177
184
 
@@ -690,6 +697,35 @@ class PlatformPromiseClient {
690
697
  );
691
698
  }
692
699
 
700
+ getTotalCreditsInPlatform(
701
+ getTotalCreditsInPlatformRequest,
702
+ metadata = {},
703
+ options = {},
704
+ ) {
705
+ if (!isObject(metadata)) {
706
+ throw new Error('metadata must be an object');
707
+ }
708
+
709
+ return this.client.getTotalCreditsInPlatform(
710
+ getTotalCreditsInPlatformRequest,
711
+ convertObjectToMetadata(metadata),
712
+ {
713
+ interceptors: [
714
+ jsonToProtobufInterceptorFactory(
715
+ jsonToProtobufFactory(
716
+ ProtocGetTotalCreditsInPlatformResponse,
717
+ PBJSGetTotalCreditsInPlatformResponse,
718
+ ),
719
+ protobufToJsonFactory(
720
+ PBJSGetTotalCreditsInPlatformRequest,
721
+ ),
722
+ ),
723
+ ],
724
+ ...options,
725
+ },
726
+ );
727
+ }
728
+
693
729
  /**
694
730
  * @param {string} protocolVersion
695
731
  */