@dashevo/dapi-grpc 1.8.0 → 2.0.0-rc.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.
- package/.eslintrc +3 -0
- package/Cargo.toml +35 -15
- package/build.rs +117 -22
- package/clients/drive/v0/nodejs/DrivePromiseClient.js +111 -0
- package/clients/drive/v0/nodejs/drive_pbjs.js +72524 -0
- package/clients/drive/v0/nodejs/drive_protoc.js +420 -0
- package/clients/drive/v0/web/drive_pb.d.ts +56 -0
- package/clients/drive/v0/web/drive_pb.js +420 -0
- package/clients/drive/v0/web/drive_pb_service.d.ts +63 -0
- package/clients/drive/v0/web/drive_pb_service.js +61 -0
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +0 -39
- package/clients/platform/v0/nodejs/platform_pbjs.js +30162 -7538
- package/clients/platform/v0/nodejs/platform_protoc.js +38679 -16741
- package/clients/platform/v0/web/platform_pb.d.ts +3337 -461
- package/clients/platform/v0/web/platform_pb.js +38679 -16741
- package/clients/platform/v0/web/platform_pb_service.d.ts +247 -19
- package/clients/platform/v0/web/platform_pb_service.js +501 -21
- package/lib/getDriveDefinition.js +18 -0
- package/node.js +19 -0
- package/package.json +3 -3
- package/protos/drive/v0/drive.proto +18 -0
- package/protos/platform/v0/platform.proto +888 -334
- package/scripts/build.sh +55 -0
- package/scripts/patch-protobuf-js.sh +3 -2
- package/src/lib.rs +42 -10
|
@@ -109,15 +109,6 @@ Platform.getEvonodesProposedEpochBlocksByRange = {
|
|
|
109
109
|
responseType: platform_pb.GetEvonodesProposedEpochBlocksResponse
|
|
110
110
|
};
|
|
111
111
|
|
|
112
|
-
Platform.getProofs = {
|
|
113
|
-
methodName: "getProofs",
|
|
114
|
-
service: Platform,
|
|
115
|
-
requestStream: false,
|
|
116
|
-
responseStream: false,
|
|
117
|
-
requestType: platform_pb.GetProofsRequest,
|
|
118
|
-
responseType: platform_pb.GetProofsResponse
|
|
119
|
-
};
|
|
120
|
-
|
|
121
112
|
Platform.getDataContract = {
|
|
122
113
|
methodName: "getDataContract",
|
|
123
114
|
service: Platform,
|
|
@@ -163,6 +154,15 @@ Platform.getIdentityByPublicKeyHash = {
|
|
|
163
154
|
responseType: platform_pb.GetIdentityByPublicKeyHashResponse
|
|
164
155
|
};
|
|
165
156
|
|
|
157
|
+
Platform.getIdentityByNonUniquePublicKeyHash = {
|
|
158
|
+
methodName: "getIdentityByNonUniquePublicKeyHash",
|
|
159
|
+
service: Platform,
|
|
160
|
+
requestStream: false,
|
|
161
|
+
responseStream: false,
|
|
162
|
+
requestType: platform_pb.GetIdentityByNonUniquePublicKeyHashRequest,
|
|
163
|
+
responseType: platform_pb.GetIdentityByNonUniquePublicKeyHashResponse
|
|
164
|
+
};
|
|
165
|
+
|
|
166
166
|
Platform.waitForStateTransitionResult = {
|
|
167
167
|
methodName: "waitForStateTransitionResult",
|
|
168
168
|
service: Platform,
|
|
@@ -298,6 +298,114 @@ Platform.getCurrentQuorumsInfo = {
|
|
|
298
298
|
responseType: platform_pb.GetCurrentQuorumsInfoResponse
|
|
299
299
|
};
|
|
300
300
|
|
|
301
|
+
Platform.getIdentityTokenBalances = {
|
|
302
|
+
methodName: "getIdentityTokenBalances",
|
|
303
|
+
service: Platform,
|
|
304
|
+
requestStream: false,
|
|
305
|
+
responseStream: false,
|
|
306
|
+
requestType: platform_pb.GetIdentityTokenBalancesRequest,
|
|
307
|
+
responseType: platform_pb.GetIdentityTokenBalancesResponse
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
Platform.getIdentitiesTokenBalances = {
|
|
311
|
+
methodName: "getIdentitiesTokenBalances",
|
|
312
|
+
service: Platform,
|
|
313
|
+
requestStream: false,
|
|
314
|
+
responseStream: false,
|
|
315
|
+
requestType: platform_pb.GetIdentitiesTokenBalancesRequest,
|
|
316
|
+
responseType: platform_pb.GetIdentitiesTokenBalancesResponse
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
Platform.getIdentityTokenInfos = {
|
|
320
|
+
methodName: "getIdentityTokenInfos",
|
|
321
|
+
service: Platform,
|
|
322
|
+
requestStream: false,
|
|
323
|
+
responseStream: false,
|
|
324
|
+
requestType: platform_pb.GetIdentityTokenInfosRequest,
|
|
325
|
+
responseType: platform_pb.GetIdentityTokenInfosResponse
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
Platform.getIdentitiesTokenInfos = {
|
|
329
|
+
methodName: "getIdentitiesTokenInfos",
|
|
330
|
+
service: Platform,
|
|
331
|
+
requestStream: false,
|
|
332
|
+
responseStream: false,
|
|
333
|
+
requestType: platform_pb.GetIdentitiesTokenInfosRequest,
|
|
334
|
+
responseType: platform_pb.GetIdentitiesTokenInfosResponse
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
Platform.getTokenStatuses = {
|
|
338
|
+
methodName: "getTokenStatuses",
|
|
339
|
+
service: Platform,
|
|
340
|
+
requestStream: false,
|
|
341
|
+
responseStream: false,
|
|
342
|
+
requestType: platform_pb.GetTokenStatusesRequest,
|
|
343
|
+
responseType: platform_pb.GetTokenStatusesResponse
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
Platform.getTokenDirectPurchasePrices = {
|
|
347
|
+
methodName: "getTokenDirectPurchasePrices",
|
|
348
|
+
service: Platform,
|
|
349
|
+
requestStream: false,
|
|
350
|
+
responseStream: false,
|
|
351
|
+
requestType: platform_pb.GetTokenDirectPurchasePricesRequest,
|
|
352
|
+
responseType: platform_pb.GetTokenDirectPurchasePricesResponse
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
Platform.getTokenPreProgrammedDistributions = {
|
|
356
|
+
methodName: "getTokenPreProgrammedDistributions",
|
|
357
|
+
service: Platform,
|
|
358
|
+
requestStream: false,
|
|
359
|
+
responseStream: false,
|
|
360
|
+
requestType: platform_pb.GetTokenPreProgrammedDistributionsRequest,
|
|
361
|
+
responseType: platform_pb.GetTokenPreProgrammedDistributionsResponse
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
Platform.getTokenTotalSupply = {
|
|
365
|
+
methodName: "getTokenTotalSupply",
|
|
366
|
+
service: Platform,
|
|
367
|
+
requestStream: false,
|
|
368
|
+
responseStream: false,
|
|
369
|
+
requestType: platform_pb.GetTokenTotalSupplyRequest,
|
|
370
|
+
responseType: platform_pb.GetTokenTotalSupplyResponse
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
Platform.getGroupInfo = {
|
|
374
|
+
methodName: "getGroupInfo",
|
|
375
|
+
service: Platform,
|
|
376
|
+
requestStream: false,
|
|
377
|
+
responseStream: false,
|
|
378
|
+
requestType: platform_pb.GetGroupInfoRequest,
|
|
379
|
+
responseType: platform_pb.GetGroupInfoResponse
|
|
380
|
+
};
|
|
381
|
+
|
|
382
|
+
Platform.getGroupInfos = {
|
|
383
|
+
methodName: "getGroupInfos",
|
|
384
|
+
service: Platform,
|
|
385
|
+
requestStream: false,
|
|
386
|
+
responseStream: false,
|
|
387
|
+
requestType: platform_pb.GetGroupInfosRequest,
|
|
388
|
+
responseType: platform_pb.GetGroupInfosResponse
|
|
389
|
+
};
|
|
390
|
+
|
|
391
|
+
Platform.getGroupActions = {
|
|
392
|
+
methodName: "getGroupActions",
|
|
393
|
+
service: Platform,
|
|
394
|
+
requestStream: false,
|
|
395
|
+
responseStream: false,
|
|
396
|
+
requestType: platform_pb.GetGroupActionsRequest,
|
|
397
|
+
responseType: platform_pb.GetGroupActionsResponse
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
Platform.getGroupActionSigners = {
|
|
401
|
+
methodName: "getGroupActionSigners",
|
|
402
|
+
service: Platform,
|
|
403
|
+
requestStream: false,
|
|
404
|
+
responseStream: false,
|
|
405
|
+
requestType: platform_pb.GetGroupActionSignersRequest,
|
|
406
|
+
responseType: platform_pb.GetGroupActionSignersResponse
|
|
407
|
+
};
|
|
408
|
+
|
|
301
409
|
exports.Platform = Platform;
|
|
302
410
|
|
|
303
411
|
function PlatformClient(serviceHost, options) {
|
|
@@ -646,11 +754,11 @@ PlatformClient.prototype.getEvonodesProposedEpochBlocksByRange = function getEvo
|
|
|
646
754
|
};
|
|
647
755
|
};
|
|
648
756
|
|
|
649
|
-
PlatformClient.prototype.
|
|
757
|
+
PlatformClient.prototype.getDataContract = function getDataContract(requestMessage, metadata, callback) {
|
|
650
758
|
if (arguments.length === 2) {
|
|
651
759
|
callback = arguments[1];
|
|
652
760
|
}
|
|
653
|
-
var client = grpc.unary(Platform.
|
|
761
|
+
var client = grpc.unary(Platform.getDataContract, {
|
|
654
762
|
request: requestMessage,
|
|
655
763
|
host: this.serviceHost,
|
|
656
764
|
metadata: metadata,
|
|
@@ -677,11 +785,11 @@ PlatformClient.prototype.getProofs = function getProofs(requestMessage, metadata
|
|
|
677
785
|
};
|
|
678
786
|
};
|
|
679
787
|
|
|
680
|
-
PlatformClient.prototype.
|
|
788
|
+
PlatformClient.prototype.getDataContractHistory = function getDataContractHistory(requestMessage, metadata, callback) {
|
|
681
789
|
if (arguments.length === 2) {
|
|
682
790
|
callback = arguments[1];
|
|
683
791
|
}
|
|
684
|
-
var client = grpc.unary(Platform.
|
|
792
|
+
var client = grpc.unary(Platform.getDataContractHistory, {
|
|
685
793
|
request: requestMessage,
|
|
686
794
|
host: this.serviceHost,
|
|
687
795
|
metadata: metadata,
|
|
@@ -708,11 +816,11 @@ PlatformClient.prototype.getDataContract = function getDataContract(requestMessa
|
|
|
708
816
|
};
|
|
709
817
|
};
|
|
710
818
|
|
|
711
|
-
PlatformClient.prototype.
|
|
819
|
+
PlatformClient.prototype.getDataContracts = function getDataContracts(requestMessage, metadata, callback) {
|
|
712
820
|
if (arguments.length === 2) {
|
|
713
821
|
callback = arguments[1];
|
|
714
822
|
}
|
|
715
|
-
var client = grpc.unary(Platform.
|
|
823
|
+
var client = grpc.unary(Platform.getDataContracts, {
|
|
716
824
|
request: requestMessage,
|
|
717
825
|
host: this.serviceHost,
|
|
718
826
|
metadata: metadata,
|
|
@@ -739,11 +847,11 @@ PlatformClient.prototype.getDataContractHistory = function getDataContractHistor
|
|
|
739
847
|
};
|
|
740
848
|
};
|
|
741
849
|
|
|
742
|
-
PlatformClient.prototype.
|
|
850
|
+
PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, metadata, callback) {
|
|
743
851
|
if (arguments.length === 2) {
|
|
744
852
|
callback = arguments[1];
|
|
745
853
|
}
|
|
746
|
-
var client = grpc.unary(Platform.
|
|
854
|
+
var client = grpc.unary(Platform.getDocuments, {
|
|
747
855
|
request: requestMessage,
|
|
748
856
|
host: this.serviceHost,
|
|
749
857
|
metadata: metadata,
|
|
@@ -770,11 +878,11 @@ PlatformClient.prototype.getDataContracts = function getDataContracts(requestMes
|
|
|
770
878
|
};
|
|
771
879
|
};
|
|
772
880
|
|
|
773
|
-
PlatformClient.prototype.
|
|
881
|
+
PlatformClient.prototype.getIdentityByPublicKeyHash = function getIdentityByPublicKeyHash(requestMessage, metadata, callback) {
|
|
774
882
|
if (arguments.length === 2) {
|
|
775
883
|
callback = arguments[1];
|
|
776
884
|
}
|
|
777
|
-
var client = grpc.unary(Platform.
|
|
885
|
+
var client = grpc.unary(Platform.getIdentityByPublicKeyHash, {
|
|
778
886
|
request: requestMessage,
|
|
779
887
|
host: this.serviceHost,
|
|
780
888
|
metadata: metadata,
|
|
@@ -801,11 +909,11 @@ PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, me
|
|
|
801
909
|
};
|
|
802
910
|
};
|
|
803
911
|
|
|
804
|
-
PlatformClient.prototype.
|
|
912
|
+
PlatformClient.prototype.getIdentityByNonUniquePublicKeyHash = function getIdentityByNonUniquePublicKeyHash(requestMessage, metadata, callback) {
|
|
805
913
|
if (arguments.length === 2) {
|
|
806
914
|
callback = arguments[1];
|
|
807
915
|
}
|
|
808
|
-
var client = grpc.unary(Platform.
|
|
916
|
+
var client = grpc.unary(Platform.getIdentityByNonUniquePublicKeyHash, {
|
|
809
917
|
request: requestMessage,
|
|
810
918
|
host: this.serviceHost,
|
|
811
919
|
metadata: metadata,
|
|
@@ -1297,5 +1405,377 @@ PlatformClient.prototype.getCurrentQuorumsInfo = function getCurrentQuorumsInfo(
|
|
|
1297
1405
|
};
|
|
1298
1406
|
};
|
|
1299
1407
|
|
|
1408
|
+
PlatformClient.prototype.getIdentityTokenBalances = function getIdentityTokenBalances(requestMessage, metadata, callback) {
|
|
1409
|
+
if (arguments.length === 2) {
|
|
1410
|
+
callback = arguments[1];
|
|
1411
|
+
}
|
|
1412
|
+
var client = grpc.unary(Platform.getIdentityTokenBalances, {
|
|
1413
|
+
request: requestMessage,
|
|
1414
|
+
host: this.serviceHost,
|
|
1415
|
+
metadata: metadata,
|
|
1416
|
+
transport: this.options.transport,
|
|
1417
|
+
debug: this.options.debug,
|
|
1418
|
+
onEnd: function (response) {
|
|
1419
|
+
if (callback) {
|
|
1420
|
+
if (response.status !== grpc.Code.OK) {
|
|
1421
|
+
var err = new Error(response.statusMessage);
|
|
1422
|
+
err.code = response.status;
|
|
1423
|
+
err.metadata = response.trailers;
|
|
1424
|
+
callback(err, null);
|
|
1425
|
+
} else {
|
|
1426
|
+
callback(null, response.message);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1430
|
+
});
|
|
1431
|
+
return {
|
|
1432
|
+
cancel: function () {
|
|
1433
|
+
callback = null;
|
|
1434
|
+
client.close();
|
|
1435
|
+
}
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
PlatformClient.prototype.getIdentitiesTokenBalances = function getIdentitiesTokenBalances(requestMessage, metadata, callback) {
|
|
1440
|
+
if (arguments.length === 2) {
|
|
1441
|
+
callback = arguments[1];
|
|
1442
|
+
}
|
|
1443
|
+
var client = grpc.unary(Platform.getIdentitiesTokenBalances, {
|
|
1444
|
+
request: requestMessage,
|
|
1445
|
+
host: this.serviceHost,
|
|
1446
|
+
metadata: metadata,
|
|
1447
|
+
transport: this.options.transport,
|
|
1448
|
+
debug: this.options.debug,
|
|
1449
|
+
onEnd: function (response) {
|
|
1450
|
+
if (callback) {
|
|
1451
|
+
if (response.status !== grpc.Code.OK) {
|
|
1452
|
+
var err = new Error(response.statusMessage);
|
|
1453
|
+
err.code = response.status;
|
|
1454
|
+
err.metadata = response.trailers;
|
|
1455
|
+
callback(err, null);
|
|
1456
|
+
} else {
|
|
1457
|
+
callback(null, response.message);
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
return {
|
|
1463
|
+
cancel: function () {
|
|
1464
|
+
callback = null;
|
|
1465
|
+
client.close();
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
};
|
|
1469
|
+
|
|
1470
|
+
PlatformClient.prototype.getIdentityTokenInfos = function getIdentityTokenInfos(requestMessage, metadata, callback) {
|
|
1471
|
+
if (arguments.length === 2) {
|
|
1472
|
+
callback = arguments[1];
|
|
1473
|
+
}
|
|
1474
|
+
var client = grpc.unary(Platform.getIdentityTokenInfos, {
|
|
1475
|
+
request: requestMessage,
|
|
1476
|
+
host: this.serviceHost,
|
|
1477
|
+
metadata: metadata,
|
|
1478
|
+
transport: this.options.transport,
|
|
1479
|
+
debug: this.options.debug,
|
|
1480
|
+
onEnd: function (response) {
|
|
1481
|
+
if (callback) {
|
|
1482
|
+
if (response.status !== grpc.Code.OK) {
|
|
1483
|
+
var err = new Error(response.statusMessage);
|
|
1484
|
+
err.code = response.status;
|
|
1485
|
+
err.metadata = response.trailers;
|
|
1486
|
+
callback(err, null);
|
|
1487
|
+
} else {
|
|
1488
|
+
callback(null, response.message);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
return {
|
|
1494
|
+
cancel: function () {
|
|
1495
|
+
callback = null;
|
|
1496
|
+
client.close();
|
|
1497
|
+
}
|
|
1498
|
+
};
|
|
1499
|
+
};
|
|
1500
|
+
|
|
1501
|
+
PlatformClient.prototype.getIdentitiesTokenInfos = function getIdentitiesTokenInfos(requestMessage, metadata, callback) {
|
|
1502
|
+
if (arguments.length === 2) {
|
|
1503
|
+
callback = arguments[1];
|
|
1504
|
+
}
|
|
1505
|
+
var client = grpc.unary(Platform.getIdentitiesTokenInfos, {
|
|
1506
|
+
request: requestMessage,
|
|
1507
|
+
host: this.serviceHost,
|
|
1508
|
+
metadata: metadata,
|
|
1509
|
+
transport: this.options.transport,
|
|
1510
|
+
debug: this.options.debug,
|
|
1511
|
+
onEnd: function (response) {
|
|
1512
|
+
if (callback) {
|
|
1513
|
+
if (response.status !== grpc.Code.OK) {
|
|
1514
|
+
var err = new Error(response.statusMessage);
|
|
1515
|
+
err.code = response.status;
|
|
1516
|
+
err.metadata = response.trailers;
|
|
1517
|
+
callback(err, null);
|
|
1518
|
+
} else {
|
|
1519
|
+
callback(null, response.message);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
});
|
|
1524
|
+
return {
|
|
1525
|
+
cancel: function () {
|
|
1526
|
+
callback = null;
|
|
1527
|
+
client.close();
|
|
1528
|
+
}
|
|
1529
|
+
};
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
PlatformClient.prototype.getTokenStatuses = function getTokenStatuses(requestMessage, metadata, callback) {
|
|
1533
|
+
if (arguments.length === 2) {
|
|
1534
|
+
callback = arguments[1];
|
|
1535
|
+
}
|
|
1536
|
+
var client = grpc.unary(Platform.getTokenStatuses, {
|
|
1537
|
+
request: requestMessage,
|
|
1538
|
+
host: this.serviceHost,
|
|
1539
|
+
metadata: metadata,
|
|
1540
|
+
transport: this.options.transport,
|
|
1541
|
+
debug: this.options.debug,
|
|
1542
|
+
onEnd: function (response) {
|
|
1543
|
+
if (callback) {
|
|
1544
|
+
if (response.status !== grpc.Code.OK) {
|
|
1545
|
+
var err = new Error(response.statusMessage);
|
|
1546
|
+
err.code = response.status;
|
|
1547
|
+
err.metadata = response.trailers;
|
|
1548
|
+
callback(err, null);
|
|
1549
|
+
} else {
|
|
1550
|
+
callback(null, response.message);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
});
|
|
1555
|
+
return {
|
|
1556
|
+
cancel: function () {
|
|
1557
|
+
callback = null;
|
|
1558
|
+
client.close();
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1563
|
+
PlatformClient.prototype.getTokenDirectPurchasePrices = function getTokenDirectPurchasePrices(requestMessage, metadata, callback) {
|
|
1564
|
+
if (arguments.length === 2) {
|
|
1565
|
+
callback = arguments[1];
|
|
1566
|
+
}
|
|
1567
|
+
var client = grpc.unary(Platform.getTokenDirectPurchasePrices, {
|
|
1568
|
+
request: requestMessage,
|
|
1569
|
+
host: this.serviceHost,
|
|
1570
|
+
metadata: metadata,
|
|
1571
|
+
transport: this.options.transport,
|
|
1572
|
+
debug: this.options.debug,
|
|
1573
|
+
onEnd: function (response) {
|
|
1574
|
+
if (callback) {
|
|
1575
|
+
if (response.status !== grpc.Code.OK) {
|
|
1576
|
+
var err = new Error(response.statusMessage);
|
|
1577
|
+
err.code = response.status;
|
|
1578
|
+
err.metadata = response.trailers;
|
|
1579
|
+
callback(err, null);
|
|
1580
|
+
} else {
|
|
1581
|
+
callback(null, response.message);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
return {
|
|
1587
|
+
cancel: function () {
|
|
1588
|
+
callback = null;
|
|
1589
|
+
client.close();
|
|
1590
|
+
}
|
|
1591
|
+
};
|
|
1592
|
+
};
|
|
1593
|
+
|
|
1594
|
+
PlatformClient.prototype.getTokenPreProgrammedDistributions = function getTokenPreProgrammedDistributions(requestMessage, metadata, callback) {
|
|
1595
|
+
if (arguments.length === 2) {
|
|
1596
|
+
callback = arguments[1];
|
|
1597
|
+
}
|
|
1598
|
+
var client = grpc.unary(Platform.getTokenPreProgrammedDistributions, {
|
|
1599
|
+
request: requestMessage,
|
|
1600
|
+
host: this.serviceHost,
|
|
1601
|
+
metadata: metadata,
|
|
1602
|
+
transport: this.options.transport,
|
|
1603
|
+
debug: this.options.debug,
|
|
1604
|
+
onEnd: function (response) {
|
|
1605
|
+
if (callback) {
|
|
1606
|
+
if (response.status !== grpc.Code.OK) {
|
|
1607
|
+
var err = new Error(response.statusMessage);
|
|
1608
|
+
err.code = response.status;
|
|
1609
|
+
err.metadata = response.trailers;
|
|
1610
|
+
callback(err, null);
|
|
1611
|
+
} else {
|
|
1612
|
+
callback(null, response.message);
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
return {
|
|
1618
|
+
cancel: function () {
|
|
1619
|
+
callback = null;
|
|
1620
|
+
client.close();
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
};
|
|
1624
|
+
|
|
1625
|
+
PlatformClient.prototype.getTokenTotalSupply = function getTokenTotalSupply(requestMessage, metadata, callback) {
|
|
1626
|
+
if (arguments.length === 2) {
|
|
1627
|
+
callback = arguments[1];
|
|
1628
|
+
}
|
|
1629
|
+
var client = grpc.unary(Platform.getTokenTotalSupply, {
|
|
1630
|
+
request: requestMessage,
|
|
1631
|
+
host: this.serviceHost,
|
|
1632
|
+
metadata: metadata,
|
|
1633
|
+
transport: this.options.transport,
|
|
1634
|
+
debug: this.options.debug,
|
|
1635
|
+
onEnd: function (response) {
|
|
1636
|
+
if (callback) {
|
|
1637
|
+
if (response.status !== grpc.Code.OK) {
|
|
1638
|
+
var err = new Error(response.statusMessage);
|
|
1639
|
+
err.code = response.status;
|
|
1640
|
+
err.metadata = response.trailers;
|
|
1641
|
+
callback(err, null);
|
|
1642
|
+
} else {
|
|
1643
|
+
callback(null, response.message);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
});
|
|
1648
|
+
return {
|
|
1649
|
+
cancel: function () {
|
|
1650
|
+
callback = null;
|
|
1651
|
+
client.close();
|
|
1652
|
+
}
|
|
1653
|
+
};
|
|
1654
|
+
};
|
|
1655
|
+
|
|
1656
|
+
PlatformClient.prototype.getGroupInfo = function getGroupInfo(requestMessage, metadata, callback) {
|
|
1657
|
+
if (arguments.length === 2) {
|
|
1658
|
+
callback = arguments[1];
|
|
1659
|
+
}
|
|
1660
|
+
var client = grpc.unary(Platform.getGroupInfo, {
|
|
1661
|
+
request: requestMessage,
|
|
1662
|
+
host: this.serviceHost,
|
|
1663
|
+
metadata: metadata,
|
|
1664
|
+
transport: this.options.transport,
|
|
1665
|
+
debug: this.options.debug,
|
|
1666
|
+
onEnd: function (response) {
|
|
1667
|
+
if (callback) {
|
|
1668
|
+
if (response.status !== grpc.Code.OK) {
|
|
1669
|
+
var err = new Error(response.statusMessage);
|
|
1670
|
+
err.code = response.status;
|
|
1671
|
+
err.metadata = response.trailers;
|
|
1672
|
+
callback(err, null);
|
|
1673
|
+
} else {
|
|
1674
|
+
callback(null, response.message);
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
return {
|
|
1680
|
+
cancel: function () {
|
|
1681
|
+
callback = null;
|
|
1682
|
+
client.close();
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1686
|
+
|
|
1687
|
+
PlatformClient.prototype.getGroupInfos = function getGroupInfos(requestMessage, metadata, callback) {
|
|
1688
|
+
if (arguments.length === 2) {
|
|
1689
|
+
callback = arguments[1];
|
|
1690
|
+
}
|
|
1691
|
+
var client = grpc.unary(Platform.getGroupInfos, {
|
|
1692
|
+
request: requestMessage,
|
|
1693
|
+
host: this.serviceHost,
|
|
1694
|
+
metadata: metadata,
|
|
1695
|
+
transport: this.options.transport,
|
|
1696
|
+
debug: this.options.debug,
|
|
1697
|
+
onEnd: function (response) {
|
|
1698
|
+
if (callback) {
|
|
1699
|
+
if (response.status !== grpc.Code.OK) {
|
|
1700
|
+
var err = new Error(response.statusMessage);
|
|
1701
|
+
err.code = response.status;
|
|
1702
|
+
err.metadata = response.trailers;
|
|
1703
|
+
callback(err, null);
|
|
1704
|
+
} else {
|
|
1705
|
+
callback(null, response.message);
|
|
1706
|
+
}
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
return {
|
|
1711
|
+
cancel: function () {
|
|
1712
|
+
callback = null;
|
|
1713
|
+
client.close();
|
|
1714
|
+
}
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
PlatformClient.prototype.getGroupActions = function getGroupActions(requestMessage, metadata, callback) {
|
|
1719
|
+
if (arguments.length === 2) {
|
|
1720
|
+
callback = arguments[1];
|
|
1721
|
+
}
|
|
1722
|
+
var client = grpc.unary(Platform.getGroupActions, {
|
|
1723
|
+
request: requestMessage,
|
|
1724
|
+
host: this.serviceHost,
|
|
1725
|
+
metadata: metadata,
|
|
1726
|
+
transport: this.options.transport,
|
|
1727
|
+
debug: this.options.debug,
|
|
1728
|
+
onEnd: function (response) {
|
|
1729
|
+
if (callback) {
|
|
1730
|
+
if (response.status !== grpc.Code.OK) {
|
|
1731
|
+
var err = new Error(response.statusMessage);
|
|
1732
|
+
err.code = response.status;
|
|
1733
|
+
err.metadata = response.trailers;
|
|
1734
|
+
callback(err, null);
|
|
1735
|
+
} else {
|
|
1736
|
+
callback(null, response.message);
|
|
1737
|
+
}
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
});
|
|
1741
|
+
return {
|
|
1742
|
+
cancel: function () {
|
|
1743
|
+
callback = null;
|
|
1744
|
+
client.close();
|
|
1745
|
+
}
|
|
1746
|
+
};
|
|
1747
|
+
};
|
|
1748
|
+
|
|
1749
|
+
PlatformClient.prototype.getGroupActionSigners = function getGroupActionSigners(requestMessage, metadata, callback) {
|
|
1750
|
+
if (arguments.length === 2) {
|
|
1751
|
+
callback = arguments[1];
|
|
1752
|
+
}
|
|
1753
|
+
var client = grpc.unary(Platform.getGroupActionSigners, {
|
|
1754
|
+
request: requestMessage,
|
|
1755
|
+
host: this.serviceHost,
|
|
1756
|
+
metadata: metadata,
|
|
1757
|
+
transport: this.options.transport,
|
|
1758
|
+
debug: this.options.debug,
|
|
1759
|
+
onEnd: function (response) {
|
|
1760
|
+
if (callback) {
|
|
1761
|
+
if (response.status !== grpc.Code.OK) {
|
|
1762
|
+
var err = new Error(response.statusMessage);
|
|
1763
|
+
err.code = response.status;
|
|
1764
|
+
err.metadata = response.trailers;
|
|
1765
|
+
callback(err, null);
|
|
1766
|
+
} else {
|
|
1767
|
+
callback(null, response.message);
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
});
|
|
1772
|
+
return {
|
|
1773
|
+
cancel: function () {
|
|
1774
|
+
callback = null;
|
|
1775
|
+
client.close();
|
|
1776
|
+
}
|
|
1777
|
+
};
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1300
1780
|
exports.PlatformClient = PlatformClient;
|
|
1301
1781
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
const { loadPackageDefinition } = require('@dashevo/grpc-common');
|
|
4
|
+
|
|
5
|
+
function getDriveDefinition(version) {
|
|
6
|
+
const protoPath = path.join(__dirname, `../protos/drive/v${version}/drive.proto`);
|
|
7
|
+
const includeDirs = [
|
|
8
|
+
path.join(__dirname, '../protos/'),
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
return loadPackageDefinition(
|
|
12
|
+
protoPath,
|
|
13
|
+
`org.dash.platform.drive.v${version}.DriveInternal`,
|
|
14
|
+
includeDirs,
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
module.exports = getDriveDefinition;
|
package/node.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
const { Metadata } = require('@grpc/grpc-js/build/src/metadata');
|
|
2
2
|
const CorePromiseClient = require('./clients/core/v0/nodejs/CorePromiseClient');
|
|
3
3
|
const PlatformPromiseClient = require('./clients/platform/v0/nodejs/PlatformPromiseClient');
|
|
4
|
+
const DrivePromiseClient = require('./clients/drive/v0/nodejs/DrivePromiseClient');
|
|
4
5
|
|
|
5
6
|
const protocCoreMessages = require('./clients/core/v0/nodejs/core_protoc');
|
|
6
7
|
const protocPlatformMessages = require('./clients/platform/v0/nodejs/platform_protoc');
|
|
8
|
+
const protocDriveMessages = require('./clients/drive/v0/nodejs/drive_protoc');
|
|
7
9
|
|
|
8
10
|
const getCoreDefinition = require('./lib/getCoreDefinition');
|
|
9
11
|
const getPlatformDefinition = require('./lib/getPlatformDefinition');
|
|
12
|
+
const getDriveDefinition = require('./lib/getDriveDefinition');
|
|
10
13
|
const parseMetadata = require('./lib/utils/parseMetadata');
|
|
11
14
|
|
|
12
15
|
const {
|
|
@@ -33,19 +36,35 @@ const {
|
|
|
33
36
|
},
|
|
34
37
|
} = require('./clients/platform/v0/nodejs/platform_pbjs');
|
|
35
38
|
|
|
39
|
+
const {
|
|
40
|
+
org: {
|
|
41
|
+
dash: {
|
|
42
|
+
platform: {
|
|
43
|
+
drive: {
|
|
44
|
+
v0: pbjsDriveMessages,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
} = require('./clients/drive/v0/nodejs/drive_pbjs');
|
|
50
|
+
|
|
36
51
|
module.exports = {
|
|
37
52
|
getCoreDefinition,
|
|
38
53
|
getPlatformDefinition,
|
|
54
|
+
getDriveDefinition,
|
|
39
55
|
v0: {
|
|
40
56
|
CorePromiseClient,
|
|
41
57
|
PlatformPromiseClient,
|
|
58
|
+
DrivePromiseClient,
|
|
42
59
|
pbjs: {
|
|
43
60
|
|
|
44
61
|
...pbjsCoreMessages,
|
|
45
62
|
...pbjsPlatformMessages,
|
|
63
|
+
...pbjsDriveMessages,
|
|
46
64
|
},
|
|
47
65
|
...protocCoreMessages,
|
|
48
66
|
...protocPlatformMessages,
|
|
67
|
+
...protocDriveMessages,
|
|
49
68
|
},
|
|
50
69
|
parseMetadata,
|
|
51
70
|
Metadata,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.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": "
|
|
48
|
+
"@dashevo/grpc-common": "2.0.0-rc.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",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint": "^8.53.0",
|
|
60
60
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
61
61
|
"eslint-plugin-import": "^2.29.0",
|
|
62
|
-
"mocha": "^
|
|
62
|
+
"mocha": "^11.1.0",
|
|
63
63
|
"mocha-sinon": "^2.1.2",
|
|
64
64
|
"sinon": "^17.0.1",
|
|
65
65
|
"sinon-chai": "^3.7.0"
|