@dashevo/dapi-grpc 0.22.16 → 0.23.0-dev.10

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # DAPI GRPC
2
2
 
3
- [![Build Status](https://github.com/dashevo/dapi-grpc/actions/workflows/test_and_release.yml/badge.svg)](https://github.com/dashevo/dapi-grpc/actions/workflows/test_and_release.yml)
3
+ [![Build Status](https://github.com/dashevo/platform/actions/workflows/release.yml/badge.svg)](https://github.com/dashevo/platform/actions/workflows/release.yml)
4
4
  [![NPM version](https://img.shields.io/npm/v/@dashevo/dapi-grpc.svg)](https://npmjs.org/package/@dashevo/dapi-grpc)
5
- [![Release Date](https://img.shields.io/github/release-date/dashevo/dapi-grpc)](https://github.com/dashevo/dapi-grpc/releases/latest)
5
+ [![Release Date](https://img.shields.io/github/release-date/dashevo/platform)](https://github.com/dashevo/platform/releases/latest)
6
6
  [![license](https://img.shields.io/github/license/dashevo/dapi-grpc.svg)](LICENSE)
7
7
 
8
8
  Decentralized API GRPC definition files and generated clients
@@ -125,7 +125,6 @@ Available methods :
125
125
  - getDataContract
126
126
  - getDocuments
127
127
  - getIdentitiesByPublicKeyHashes
128
- - getIdentityIdsByPublicKeyHashes
129
128
  - waitForStateTransitionResult
130
129
  - getConsensusParams
131
130
  - setProtocolVersion
@@ -13,7 +13,13 @@
13
13
 
14
14
  var jspb = require('google-protobuf');
15
15
  var goog = jspb;
16
- var global = Function('return this')();
16
+ var global = (function() {
17
+ if (this) { return this; }
18
+ if (typeof window !== 'undefined') { return window; }
19
+ if (typeof global !== 'undefined') { return global; }
20
+ if (typeof self !== 'undefined') { return self; }
21
+ return Function('return this')();
22
+ }.call(null));
17
23
 
18
24
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.BlockHeaders', null, global);
19
25
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest', null, global);
@@ -25,7 +25,7 @@ proto.org.dash.platform.dapi.v0 = require('./core_pb.js');
25
25
  /**
26
26
  * @param {string} hostname
27
27
  * @param {?Object} credentials
28
- * @param {?Object} options
28
+ * @param {?grpc.web.ClientOptions} options
29
29
  * @constructor
30
30
  * @struct
31
31
  * @final
@@ -33,7 +33,7 @@ proto.org.dash.platform.dapi.v0 = require('./core_pb.js');
33
33
  proto.org.dash.platform.dapi.v0.CoreClient =
34
34
  function(hostname, credentials, options) {
35
35
  if (!options) options = {};
36
- options['format'] = 'text';
36
+ options.format = 'text';
37
37
 
38
38
  /**
39
39
  * @private @const {!grpc.web.GrpcWebClientBase} The client
@@ -51,7 +51,7 @@ proto.org.dash.platform.dapi.v0.CoreClient =
51
51
  /**
52
52
  * @param {string} hostname
53
53
  * @param {?Object} credentials
54
- * @param {?Object} options
54
+ * @param {?grpc.web.ClientOptions} options
55
55
  * @constructor
56
56
  * @struct
57
57
  * @final
@@ -59,7 +59,7 @@ proto.org.dash.platform.dapi.v0.CoreClient =
59
59
  proto.org.dash.platform.dapi.v0.CorePromiseClient =
60
60
  function(hostname, credentials, options) {
61
61
  if (!options) options = {};
62
- options['format'] = 'text';
62
+ options.format = 'text';
63
63
 
64
64
  /**
65
65
  * @private @const {!grpc.web.GrpcWebClientBase} The client
@@ -96,31 +96,12 @@ const methodDescriptor_Core_getStatus = new grpc.web.MethodDescriptor(
96
96
  );
97
97
 
98
98
 
99
- /**
100
- * @const
101
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
102
- * !proto.org.dash.platform.dapi.v0.GetStatusRequest,
103
- * !proto.org.dash.platform.dapi.v0.GetStatusResponse>}
104
- */
105
- const methodInfo_Core_getStatus = new grpc.web.AbstractClientBase.MethodInfo(
106
- proto.org.dash.platform.dapi.v0.GetStatusResponse,
107
- /**
108
- * @param {!proto.org.dash.platform.dapi.v0.GetStatusRequest} request
109
- * @return {!Uint8Array}
110
- */
111
- function(request) {
112
- return request.serializeBinary();
113
- },
114
- proto.org.dash.platform.dapi.v0.GetStatusResponse.deserializeBinary
115
- );
116
-
117
-
118
99
  /**
119
100
  * @param {!proto.org.dash.platform.dapi.v0.GetStatusRequest} request The
120
101
  * request proto
121
102
  * @param {?Object<string, string>} metadata User defined
122
103
  * call metadata
123
- * @param {function(?grpc.web.Error, ?proto.org.dash.platform.dapi.v0.GetStatusResponse)}
104
+ * @param {function(?grpc.web.RpcError, ?proto.org.dash.platform.dapi.v0.GetStatusResponse)}
124
105
  * callback The callback function(error, response)
125
106
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.GetStatusResponse>|undefined}
126
107
  * The XHR Node Readable Stream
@@ -139,7 +120,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.getStatus =
139
120
  /**
140
121
  * @param {!proto.org.dash.platform.dapi.v0.GetStatusRequest} request The
141
122
  * request proto
142
- * @param {?Object<string, string>} metadata User defined
123
+ * @param {?Object<string, string>=} metadata User defined
143
124
  * call metadata
144
125
  * @return {!Promise<!proto.org.dash.platform.dapi.v0.GetStatusResponse>}
145
126
  * Promise that resolves to the response
@@ -176,31 +157,12 @@ const methodDescriptor_Core_getBlock = new grpc.web.MethodDescriptor(
176
157
  );
177
158
 
178
159
 
179
- /**
180
- * @const
181
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
182
- * !proto.org.dash.platform.dapi.v0.GetBlockRequest,
183
- * !proto.org.dash.platform.dapi.v0.GetBlockResponse>}
184
- */
185
- const methodInfo_Core_getBlock = new grpc.web.AbstractClientBase.MethodInfo(
186
- proto.org.dash.platform.dapi.v0.GetBlockResponse,
187
- /**
188
- * @param {!proto.org.dash.platform.dapi.v0.GetBlockRequest} request
189
- * @return {!Uint8Array}
190
- */
191
- function(request) {
192
- return request.serializeBinary();
193
- },
194
- proto.org.dash.platform.dapi.v0.GetBlockResponse.deserializeBinary
195
- );
196
-
197
-
198
160
  /**
199
161
  * @param {!proto.org.dash.platform.dapi.v0.GetBlockRequest} request The
200
162
  * request proto
201
163
  * @param {?Object<string, string>} metadata User defined
202
164
  * call metadata
203
- * @param {function(?grpc.web.Error, ?proto.org.dash.platform.dapi.v0.GetBlockResponse)}
165
+ * @param {function(?grpc.web.RpcError, ?proto.org.dash.platform.dapi.v0.GetBlockResponse)}
204
166
  * callback The callback function(error, response)
205
167
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.GetBlockResponse>|undefined}
206
168
  * The XHR Node Readable Stream
@@ -219,7 +181,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.getBlock =
219
181
  /**
220
182
  * @param {!proto.org.dash.platform.dapi.v0.GetBlockRequest} request The
221
183
  * request proto
222
- * @param {?Object<string, string>} metadata User defined
184
+ * @param {?Object<string, string>=} metadata User defined
223
185
  * call metadata
224
186
  * @return {!Promise<!proto.org.dash.platform.dapi.v0.GetBlockResponse>}
225
187
  * Promise that resolves to the response
@@ -256,31 +218,12 @@ const methodDescriptor_Core_broadcastTransaction = new grpc.web.MethodDescriptor
256
218
  );
257
219
 
258
220
 
259
- /**
260
- * @const
261
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
262
- * !proto.org.dash.platform.dapi.v0.BroadcastTransactionRequest,
263
- * !proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse>}
264
- */
265
- const methodInfo_Core_broadcastTransaction = new grpc.web.AbstractClientBase.MethodInfo(
266
- proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse,
267
- /**
268
- * @param {!proto.org.dash.platform.dapi.v0.BroadcastTransactionRequest} request
269
- * @return {!Uint8Array}
270
- */
271
- function(request) {
272
- return request.serializeBinary();
273
- },
274
- proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse.deserializeBinary
275
- );
276
-
277
-
278
221
  /**
279
222
  * @param {!proto.org.dash.platform.dapi.v0.BroadcastTransactionRequest} request The
280
223
  * request proto
281
224
  * @param {?Object<string, string>} metadata User defined
282
225
  * call metadata
283
- * @param {function(?grpc.web.Error, ?proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse)}
226
+ * @param {function(?grpc.web.RpcError, ?proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse)}
284
227
  * callback The callback function(error, response)
285
228
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse>|undefined}
286
229
  * The XHR Node Readable Stream
@@ -299,7 +242,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.broadcastTransaction =
299
242
  /**
300
243
  * @param {!proto.org.dash.platform.dapi.v0.BroadcastTransactionRequest} request The
301
244
  * request proto
302
- * @param {?Object<string, string>} metadata User defined
245
+ * @param {?Object<string, string>=} metadata User defined
303
246
  * call metadata
304
247
  * @return {!Promise<!proto.org.dash.platform.dapi.v0.BroadcastTransactionResponse>}
305
248
  * Promise that resolves to the response
@@ -336,31 +279,12 @@ const methodDescriptor_Core_getTransaction = new grpc.web.MethodDescriptor(
336
279
  );
337
280
 
338
281
 
339
- /**
340
- * @const
341
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
342
- * !proto.org.dash.platform.dapi.v0.GetTransactionRequest,
343
- * !proto.org.dash.platform.dapi.v0.GetTransactionResponse>}
344
- */
345
- const methodInfo_Core_getTransaction = new grpc.web.AbstractClientBase.MethodInfo(
346
- proto.org.dash.platform.dapi.v0.GetTransactionResponse,
347
- /**
348
- * @param {!proto.org.dash.platform.dapi.v0.GetTransactionRequest} request
349
- * @return {!Uint8Array}
350
- */
351
- function(request) {
352
- return request.serializeBinary();
353
- },
354
- proto.org.dash.platform.dapi.v0.GetTransactionResponse.deserializeBinary
355
- );
356
-
357
-
358
282
  /**
359
283
  * @param {!proto.org.dash.platform.dapi.v0.GetTransactionRequest} request The
360
284
  * request proto
361
285
  * @param {?Object<string, string>} metadata User defined
362
286
  * call metadata
363
- * @param {function(?grpc.web.Error, ?proto.org.dash.platform.dapi.v0.GetTransactionResponse)}
287
+ * @param {function(?grpc.web.RpcError, ?proto.org.dash.platform.dapi.v0.GetTransactionResponse)}
364
288
  * callback The callback function(error, response)
365
289
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.GetTransactionResponse>|undefined}
366
290
  * The XHR Node Readable Stream
@@ -379,7 +303,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.getTransaction =
379
303
  /**
380
304
  * @param {!proto.org.dash.platform.dapi.v0.GetTransactionRequest} request The
381
305
  * request proto
382
- * @param {?Object<string, string>} metadata User defined
306
+ * @param {?Object<string, string>=} metadata User defined
383
307
  * call metadata
384
308
  * @return {!Promise<!proto.org.dash.platform.dapi.v0.GetTransactionResponse>}
385
309
  * Promise that resolves to the response
@@ -416,31 +340,12 @@ const methodDescriptor_Core_getEstimatedTransactionFee = new grpc.web.MethodDesc
416
340
  );
417
341
 
418
342
 
419
- /**
420
- * @const
421
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
422
- * !proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest,
423
- * !proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse>}
424
- */
425
- const methodInfo_Core_getEstimatedTransactionFee = new grpc.web.AbstractClientBase.MethodInfo(
426
- proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse,
427
- /**
428
- * @param {!proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} request
429
- * @return {!Uint8Array}
430
- */
431
- function(request) {
432
- return request.serializeBinary();
433
- },
434
- proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse.deserializeBinary
435
- );
436
-
437
-
438
343
  /**
439
344
  * @param {!proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} request The
440
345
  * request proto
441
346
  * @param {?Object<string, string>} metadata User defined
442
347
  * call metadata
443
- * @param {function(?grpc.web.Error, ?proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse)}
348
+ * @param {function(?grpc.web.RpcError, ?proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse)}
444
349
  * callback The callback function(error, response)
445
350
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse>|undefined}
446
351
  * The XHR Node Readable Stream
@@ -459,7 +364,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.getEstimatedTransactionFee
459
364
  /**
460
365
  * @param {!proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeRequest} request The
461
366
  * request proto
462
- * @param {?Object<string, string>} metadata User defined
367
+ * @param {?Object<string, string>=} metadata User defined
463
368
  * call metadata
464
369
  * @return {!Promise<!proto.org.dash.platform.dapi.v0.GetEstimatedTransactionFeeResponse>}
465
370
  * Promise that resolves to the response
@@ -496,28 +401,9 @@ const methodDescriptor_Core_subscribeToBlockHeadersWithChainLocks = new grpc.web
496
401
  );
497
402
 
498
403
 
499
- /**
500
- * @const
501
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
502
- * !proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest,
503
- * !proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse>}
504
- */
505
- const methodInfo_Core_subscribeToBlockHeadersWithChainLocks = new grpc.web.AbstractClientBase.MethodInfo(
506
- proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse,
507
- /**
508
- * @param {!proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} request
509
- * @return {!Uint8Array}
510
- */
511
- function(request) {
512
- return request.serializeBinary();
513
- },
514
- proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse.deserializeBinary
515
- );
516
-
517
-
518
404
  /**
519
405
  * @param {!proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} request The request proto
520
- * @param {?Object<string, string>} metadata User defined
406
+ * @param {?Object<string, string>=} metadata User defined
521
407
  * call metadata
522
408
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse>}
523
409
  * The XHR Node Readable Stream
@@ -534,7 +420,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.subscribeToBlockHeadersWith
534
420
 
535
421
  /**
536
422
  * @param {!proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest} request The request proto
537
- * @param {?Object<string, string>} metadata User defined
423
+ * @param {?Object<string, string>=} metadata User defined
538
424
  * call metadata
539
425
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksResponse>}
540
426
  * The XHR Node Readable Stream
@@ -571,28 +457,9 @@ const methodDescriptor_Core_subscribeToTransactionsWithProofs = new grpc.web.Met
571
457
  );
572
458
 
573
459
 
574
- /**
575
- * @const
576
- * @type {!grpc.web.AbstractClientBase.MethodInfo<
577
- * !proto.org.dash.platform.dapi.v0.TransactionsWithProofsRequest,
578
- * !proto.org.dash.platform.dapi.v0.TransactionsWithProofsResponse>}
579
- */
580
- const methodInfo_Core_subscribeToTransactionsWithProofs = new grpc.web.AbstractClientBase.MethodInfo(
581
- proto.org.dash.platform.dapi.v0.TransactionsWithProofsResponse,
582
- /**
583
- * @param {!proto.org.dash.platform.dapi.v0.TransactionsWithProofsRequest} request
584
- * @return {!Uint8Array}
585
- */
586
- function(request) {
587
- return request.serializeBinary();
588
- },
589
- proto.org.dash.platform.dapi.v0.TransactionsWithProofsResponse.deserializeBinary
590
- );
591
-
592
-
593
460
  /**
594
461
  * @param {!proto.org.dash.platform.dapi.v0.TransactionsWithProofsRequest} request The request proto
595
- * @param {?Object<string, string>} metadata User defined
462
+ * @param {?Object<string, string>=} metadata User defined
596
463
  * call metadata
597
464
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.TransactionsWithProofsResponse>}
598
465
  * The XHR Node Readable Stream
@@ -609,7 +476,7 @@ proto.org.dash.platform.dapi.v0.CoreClient.prototype.subscribeToTransactionsWith
609
476
 
610
477
  /**
611
478
  * @param {!proto.org.dash.platform.dapi.v0.TransactionsWithProofsRequest} request The request proto
612
- * @param {?Object<string, string>} metadata User defined
479
+ * @param {?Object<string, string>=} metadata User defined
613
480
  * call metadata
614
481
  * @return {!grpc.web.ClientReadableStream<!proto.org.dash.platform.dapi.v0.TransactionsWithProofsResponse>}
615
482
  * The XHR Node Readable Stream
@@ -13,7 +13,13 @@
13
13
 
14
14
  var jspb = require('google-protobuf');
15
15
  var goog = jspb;
16
- var global = Function('return this')();
16
+ var global = (function() {
17
+ if (this) { return this; }
18
+ if (typeof window !== 'undefined') { return window; }
19
+ if (typeof global !== 'undefined') { return global; }
20
+ if (typeof self !== 'undefined') { return self; }
21
+ return Function('return this')();
22
+ }.call(null));
17
23
 
18
24
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.BlockHeaders', null, global);
19
25
  goog.exportSymbol('proto.org.dash.platform.dapi.v0.BlockHeadersWithChainLocksRequest', null, global);
@@ -33,8 +33,6 @@ const {
33
33
  GetDocumentsResponse: PBJSGetDocumentsResponse,
34
34
  GetIdentitiesByPublicKeyHashesRequest: PBJSGetIdentitiesByPublicKeyHashesRequest,
35
35
  GetIdentitiesByPublicKeyHashesResponse: PBJSGetIdentitiesByPublicKeyHashesResponse,
36
- GetIdentityIdsByPublicKeyHashesRequest: PBJSGetIdentityIdsByPublicKeyHashesRequest,
37
- GetIdentityIdsByPublicKeyHashesResponse: PBJSGetIdentityIdsByPublicKeyHashesResponse,
38
36
  WaitForStateTransitionResultRequest: PBJSWaitForStateTransitionResultRequest,
39
37
  WaitForStateTransitionResultResponse: PBJSWaitForStateTransitionResultResponse,
40
38
  GetConsensusParamsRequest: PBJSGetConsensusParamsRequest,
@@ -52,7 +50,6 @@ const {
52
50
  GetDataContractResponse: ProtocGetDataContractResponse,
53
51
  GetDocumentsResponse: ProtocGetDocumentsResponse,
54
52
  GetIdentitiesByPublicKeyHashesResponse: ProtocGetIdentitiesByPublicKeyHashesResponse,
55
- GetIdentityIdsByPublicKeyHashesResponse: ProtocGetIdentityIdsByPublicKeyHashesResponse,
56
53
  WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
57
54
  GetConsensusParamsResponse: ProtocGetConsensusParamsResponse,
58
55
  } = require('./platform_protoc');
@@ -93,10 +90,6 @@ class PlatformPromiseClient {
93
90
  this.client.getIdentitiesByPublicKeyHashes.bind(this.client),
94
91
  );
95
92
 
96
- this.client.getIdentityIdsByPublicKeyHashes = promisify(
97
- this.client.getIdentityIdsByPublicKeyHashes.bind(this.client),
98
- );
99
-
100
93
  this.client.waitForStateTransitionResult = promisify(
101
94
  this.client.waitForStateTransitionResult.bind(this.client),
102
95
  );
@@ -267,39 +260,6 @@ class PlatformPromiseClient {
267
260
  );
268
261
  }
269
262
 
270
- /**
271
- * @param {!GetIdentityIdsByPublicKeyHashesRequest} getIdentityIdsByPublicKeyHashesRequest
272
- * @param {?Object<string, string>} metadata
273
- * @param {CallOptions} [options={}]
274
- * @returns {Promise<!GetIdentityIdsByPublicKeyHashesResponse>}
275
- */
276
- getIdentityIdsByPublicKeyHashes(
277
- getIdentityIdsByPublicKeyHashesRequest, metadata = {}, options = {},
278
- ) {
279
- if (!isObject(metadata)) {
280
- throw new Error('metadata must be an object');
281
- }
282
-
283
- return this.client.getIdentityIdsByPublicKeyHashes(
284
- getIdentityIdsByPublicKeyHashesRequest,
285
- convertObjectToMetadata(metadata),
286
- {
287
- interceptors: [
288
- jsonToProtobufInterceptorFactory(
289
- jsonToProtobufFactory(
290
- ProtocGetIdentityIdsByPublicKeyHashesResponse,
291
- PBJSGetIdentityIdsByPublicKeyHashesResponse,
292
- ),
293
- protobufToJsonFactory(
294
- PBJSGetIdentityIdsByPublicKeyHashesRequest,
295
- ),
296
- ),
297
- ],
298
- ...options,
299
- },
300
- );
301
- }
302
-
303
263
  /**
304
264
  * @param {!WaitForStateTransitionResultRequest} waitForStateTransitionResultRequest
305
265
  * @param {?Object<string, string>} metadata