@dashevo/dapi-grpc 1.0.0-pr.1825.3 → 1.0.0-pr.1825.5

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.0.0-pr.1825.3"
4
+ version = "1.0.0-pr.1825.5"
5
5
  authors = [
6
6
  "Samuel Westrich <sam@dash.org>",
7
7
  "Igor Markin <igor.markin@dash.org>",
@@ -28,6 +28,7 @@ client = [
28
28
  "tonic/transport",
29
29
  "tonic/tls",
30
30
  "tonic/tls-roots",
31
+ "tonic/tls-webpki-roots",
31
32
  "platform",
32
33
  ]
33
34
  server = ["tonic/channel", "tonic/transport", "platform"]
@@ -24,8 +24,10 @@ const {
24
24
  platform: {
25
25
  dapi: {
26
26
  v0: {
27
- GetStatusRequest: PBJSGetStatusRequest,
28
- GetStatusResponse: PBJSGetStatusResponse,
27
+ GetBlockchainStatusRequest: PBJSGetBlockchainStatusRequest,
28
+ GetBlockchainStatusResponse: PBJSGetBlockchainStatusResponse,
29
+ GetMasternodeStatusRequest: PBJSGetMasternodeStatusRequest,
30
+ GetMasternodeStatusResponse: PBJSGetMasternodeStatusResponse,
29
31
  GetBlockRequest: PBJSGetBlockRequest,
30
32
  GetBlockResponse: PBJSGetBlockResponse,
31
33
  BroadcastTransactionRequest: PBJSBroadcastTransactionRequest,
@@ -46,7 +48,8 @@ const {
46
48
  } = require('./core_pbjs');
47
49
 
48
50
  const {
49
- GetStatusResponse: ProtocGetStatusResponse,
51
+ GetBlockchainStatusResponse: ProtocGetBlockchainStatusResponse,
52
+ GetMasternodeStatusResponse: ProtocGetMasternodeStatusResponse,
50
53
  GetBlockResponse: ProtocGetBlockResponse,
51
54
  BroadcastTransactionResponse: ProtocBroadcastTransactionResponse,
52
55
  GetTransactionResponse: ProtocGetTransactionResponse,
@@ -79,8 +82,12 @@ class CorePromiseClient {
79
82
 
80
83
  this.client = new CoreNodeJSClient(strippedHostname, credentials, options);
81
84
 
82
- this.client.getStatus = promisify(
83
- this.client.getStatus.bind(this.client),
85
+ this.client.getBlockchainStatus = promisify(
86
+ this.client.getBlockchainStatus.bind(this.client),
87
+ );
88
+
89
+ this.client.getMasternodeStatus = promisify(
90
+ this.client.getMasternodeStatus.bind(this.client),
84
91
  );
85
92
 
86
93
  this.client.getBlock = promisify(
@@ -101,28 +108,28 @@ class CorePromiseClient {
101
108
  }
102
109
 
103
110
  /**
104
- * @param {!GetStatusRequest} getStatusRequest
111
+ * @param {!GetBlockchainStatusRequest} getBlockchainStatusRequest
105
112
  * @param {?Object<string, string>} metadata
106
113
  * @param {CallOptions} [options={}]
107
- * @return {Promise<!GetStatusResponse>}
114
+ * @return {Promise<!GetBlockchainStatusResponse>}
108
115
  */
109
- getStatus(getStatusRequest, metadata = {}, options = {}) {
116
+ getBlockchainStatus(getBlockchainStatusRequest, metadata = {}, options = {}) {
110
117
  if (!isObject(metadata)) {
111
118
  throw new Error('metadata must be an object');
112
119
  }
113
120
 
114
- return this.client.getStatus(
115
- getStatusRequest,
121
+ return this.client.getBlockchainStatus(
122
+ getBlockchainStatusRequest,
116
123
  convertObjectToMetadata(metadata),
117
124
  {
118
125
  interceptors: [
119
126
  jsonToProtobufInterceptorFactory(
120
127
  jsonToProtobufFactory(
121
- ProtocGetStatusResponse,
122
- PBJSGetStatusResponse,
128
+ ProtocGetBlockchainStatusResponse,
129
+ PBJSGetBlockchainStatusResponse,
123
130
  ),
124
131
  protobufToJsonFactory(
125
- PBJSGetStatusRequest,
132
+ PBJSGetBlockchainStatusRequest,
126
133
  ),
127
134
  ),
128
135
  ],
@@ -162,6 +169,37 @@ class CorePromiseClient {
162
169
  );
163
170
  }
164
171
 
172
+ /**
173
+ * @param {!GetMasternodeStatusRequest} getMasternodeStatusRequest
174
+ * @param {?Object<string, string>} metadata
175
+ * @param {CallOptions} [options={}]
176
+ * @return {Promise<!GetMasternodeStatusResponse>}
177
+ */
178
+ getMasternodeStatus(getMasternodeStatusRequest, metadata = {}, options = {}) {
179
+ if (!isObject(metadata)) {
180
+ throw new Error('metadata must be an object');
181
+ }
182
+
183
+ return this.client.getMasternodeStatus(
184
+ getMasternodeStatusRequest,
185
+ convertObjectToMetadata(metadata),
186
+ {
187
+ interceptors: [
188
+ jsonToProtobufInterceptorFactory(
189
+ jsonToProtobufFactory(
190
+ ProtocGetMasternodeStatusResponse,
191
+ PBJSGetMasternodeStatusResponse,
192
+ ),
193
+ protobufToJsonFactory(
194
+ PBJSGetMasternodeStatusRequest,
195
+ ),
196
+ ),
197
+ ],
198
+ ...options,
199
+ },
200
+ );
201
+ }
202
+
165
203
  /**
166
204
  * @param {!BroadcastTransactionRequest} broadcastTransactionRequest
167
205
  * @param {?Object<string, string>} metadata