@dashevo/dapi-grpc 0.24.0-dev.2 → 0.24.0-dev.20
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 +3 -3
- package/browser.js +13 -5
- package/clients/core/v0/nodejs/CorePromiseClient.js +2 -1
- package/clients/core/v0/nodejs/core_protoc.js +33 -39
- package/clients/core/v0/web/CorePromiseClient.js +159 -0
- package/clients/core/v0/web/core_pb.d.ts +783 -0
- package/clients/core/v0/web/core_pb.js +33 -39
- package/clients/core/v0/web/core_pb_service.d.ts +161 -0
- package/clients/core/v0/web/core_pb_service.js +317 -0
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +2 -1
- package/clients/platform/v0/nodejs/platform_pbjs.js +348 -20
- package/clients/platform/v0/nodejs/platform_protoc.js +131 -45
- package/clients/platform/v0/web/PlatformPromiseClient.js +130 -0
- package/clients/platform/v0/web/platform_pb.d.ts +608 -0
- package/clients/platform/v0/web/platform_pb.js +131 -45
- package/clients/platform/v0/web/platform_pb_service.d.ts +177 -0
- package/clients/platform/v0/web/platform_pb_service.js +301 -0
- package/lib/utils/parseMetadata.js +27 -0
- package/node.js +4 -0
- package/package.json +4 -4
- package/protos/platform/v0/platform.proto +6 -1
- package/scripts/build.sh +11 -10
- package/scripts/patch-protobuf-js.sh +30 -0
- package/clients/core/v0/web/core_grpc_web_pb.js +0 -495
- package/clients/platform/v0/web/platform_grpc_web_pb.js +0 -505
|
@@ -13,35 +13,31 @@
|
|
|
13
13
|
|
|
14
14
|
var jspb = require('google-protobuf');
|
|
15
15
|
var goog = jspb;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
25
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
26
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
27
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
28
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
29
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
30
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
31
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
32
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
33
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
34
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
35
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
36
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
37
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
38
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
39
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
40
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.
|
|
41
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, global);
|
|
42
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, global);
|
|
43
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, global);
|
|
44
|
-
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.ResponsesCase', null, global);
|
|
16
|
+
const proto = {};
|
|
17
|
+
|
|
18
|
+
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
|
|
19
|
+
goog.object.extend(proto, google_protobuf_timestamp_pb);
|
|
20
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest', null, { proto });
|
|
21
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', null, { proto });
|
|
22
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.ConsensusParamsBlock', null, { proto });
|
|
23
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence', null, { proto });
|
|
24
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest', null, { proto });
|
|
25
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse', null, { proto });
|
|
26
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest', null, { proto });
|
|
27
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse', null, { proto });
|
|
28
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto });
|
|
29
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase', null, { proto });
|
|
30
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto });
|
|
31
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest', null, { proto });
|
|
32
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse', null, { proto });
|
|
33
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest', null, { proto });
|
|
34
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse', null, { proto });
|
|
35
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.Proof', null, { proto });
|
|
36
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.ResponseMetadata', null, { proto });
|
|
37
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto });
|
|
38
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto });
|
|
39
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, { proto });
|
|
40
|
+
goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.ResponsesCase', null, { proto });
|
|
45
41
|
/**
|
|
46
42
|
* Generated by JsPbCodeGenerator.
|
|
47
43
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
|
@@ -474,8 +470,9 @@ proto.org.dash.platform.dapi.v0.Proof.prototype.toObject = function(opt_includeI
|
|
|
474
470
|
proto.org.dash.platform.dapi.v0.Proof.toObject = function(includeInstance, msg) {
|
|
475
471
|
var f, obj = {
|
|
476
472
|
merkleProof: msg.getMerkleProof_asB64(),
|
|
477
|
-
|
|
478
|
-
signature: msg.getSignature_asB64()
|
|
473
|
+
quorumHash: msg.getQuorumHash_asB64(),
|
|
474
|
+
signature: msg.getSignature_asB64(),
|
|
475
|
+
round: jspb.Message.getFieldWithDefault(msg, 4, 0)
|
|
479
476
|
};
|
|
480
477
|
|
|
481
478
|
if (includeInstance) {
|
|
@@ -518,12 +515,16 @@ proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader = function(msg
|
|
|
518
515
|
break;
|
|
519
516
|
case 2:
|
|
520
517
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
521
|
-
msg.
|
|
518
|
+
msg.setQuorumHash(value);
|
|
522
519
|
break;
|
|
523
520
|
case 3:
|
|
524
521
|
var value = /** @type {!Uint8Array} */ (reader.readBytes());
|
|
525
522
|
msg.setSignature(value);
|
|
526
523
|
break;
|
|
524
|
+
case 4:
|
|
525
|
+
var value = /** @type {number} */ (reader.readUint32());
|
|
526
|
+
msg.setRound(value);
|
|
527
|
+
break;
|
|
527
528
|
default:
|
|
528
529
|
reader.skipField();
|
|
529
530
|
break;
|
|
@@ -560,7 +561,7 @@ proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message
|
|
|
560
561
|
f
|
|
561
562
|
);
|
|
562
563
|
}
|
|
563
|
-
f = message.
|
|
564
|
+
f = message.getQuorumHash_asU8();
|
|
564
565
|
if (f.length > 0) {
|
|
565
566
|
writer.writeBytes(
|
|
566
567
|
2,
|
|
@@ -574,6 +575,13 @@ proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message
|
|
|
574
575
|
f
|
|
575
576
|
);
|
|
576
577
|
}
|
|
578
|
+
f = message.getRound();
|
|
579
|
+
if (f !== 0) {
|
|
580
|
+
writer.writeUint32(
|
|
581
|
+
4,
|
|
582
|
+
f
|
|
583
|
+
);
|
|
584
|
+
}
|
|
577
585
|
};
|
|
578
586
|
|
|
579
587
|
|
|
@@ -620,35 +628,35 @@ proto.org.dash.platform.dapi.v0.Proof.prototype.setMerkleProof = function(value)
|
|
|
620
628
|
|
|
621
629
|
|
|
622
630
|
/**
|
|
623
|
-
* optional bytes
|
|
631
|
+
* optional bytes quorum_hash = 2;
|
|
624
632
|
* @return {string}
|
|
625
633
|
*/
|
|
626
|
-
proto.org.dash.platform.dapi.v0.Proof.prototype.
|
|
634
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash = function() {
|
|
627
635
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
|
628
636
|
};
|
|
629
637
|
|
|
630
638
|
|
|
631
639
|
/**
|
|
632
|
-
* optional bytes
|
|
633
|
-
* This is a type-conversion wrapper around `
|
|
640
|
+
* optional bytes quorum_hash = 2;
|
|
641
|
+
* This is a type-conversion wrapper around `getQuorumHash()`
|
|
634
642
|
* @return {string}
|
|
635
643
|
*/
|
|
636
|
-
proto.org.dash.platform.dapi.v0.Proof.prototype.
|
|
644
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asB64 = function() {
|
|
637
645
|
return /** @type {string} */ (jspb.Message.bytesAsB64(
|
|
638
|
-
this.
|
|
646
|
+
this.getQuorumHash()));
|
|
639
647
|
};
|
|
640
648
|
|
|
641
649
|
|
|
642
650
|
/**
|
|
643
|
-
* optional bytes
|
|
651
|
+
* optional bytes quorum_hash = 2;
|
|
644
652
|
* Note that Uint8Array is not supported on all browsers.
|
|
645
653
|
* @see http://caniuse.com/Uint8Array
|
|
646
|
-
* This is a type-conversion wrapper around `
|
|
654
|
+
* This is a type-conversion wrapper around `getQuorumHash()`
|
|
647
655
|
* @return {!Uint8Array}
|
|
648
656
|
*/
|
|
649
|
-
proto.org.dash.platform.dapi.v0.Proof.prototype.
|
|
657
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asU8 = function() {
|
|
650
658
|
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
|
|
651
|
-
this.
|
|
659
|
+
this.getQuorumHash()));
|
|
652
660
|
};
|
|
653
661
|
|
|
654
662
|
|
|
@@ -656,7 +664,7 @@ proto.org.dash.platform.dapi.v0.Proof.prototype.getSignatureLlmqHash_asU8 = func
|
|
|
656
664
|
* @param {!(string|Uint8Array)} value
|
|
657
665
|
* @return {!proto.org.dash.platform.dapi.v0.Proof} returns this
|
|
658
666
|
*/
|
|
659
|
-
proto.org.dash.platform.dapi.v0.Proof.prototype.
|
|
667
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.setQuorumHash = function(value) {
|
|
660
668
|
return jspb.Message.setProto3BytesField(this, 2, value);
|
|
661
669
|
};
|
|
662
670
|
|
|
@@ -703,6 +711,24 @@ proto.org.dash.platform.dapi.v0.Proof.prototype.setSignature = function(value) {
|
|
|
703
711
|
};
|
|
704
712
|
|
|
705
713
|
|
|
714
|
+
/**
|
|
715
|
+
* optional uint32 round = 4;
|
|
716
|
+
* @return {number}
|
|
717
|
+
*/
|
|
718
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.getRound = function() {
|
|
719
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
/**
|
|
724
|
+
* @param {number} value
|
|
725
|
+
* @return {!proto.org.dash.platform.dapi.v0.Proof} returns this
|
|
726
|
+
*/
|
|
727
|
+
proto.org.dash.platform.dapi.v0.Proof.prototype.setRound = function(value) {
|
|
728
|
+
return jspb.Message.setProto3IntField(this, 4, value);
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
|
|
706
732
|
|
|
707
733
|
|
|
708
734
|
|
|
@@ -736,7 +762,9 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(o
|
|
|
736
762
|
proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInstance, msg) {
|
|
737
763
|
var f, obj = {
|
|
738
764
|
height: jspb.Message.getFieldWithDefault(msg, 1, 0),
|
|
739
|
-
coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0)
|
|
765
|
+
coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0),
|
|
766
|
+
timeMs: jspb.Message.getFieldWithDefault(msg, 3, 0),
|
|
767
|
+
protocolVersion: jspb.Message.getFieldWithDefault(msg, 4, 0)
|
|
740
768
|
};
|
|
741
769
|
|
|
742
770
|
if (includeInstance) {
|
|
@@ -781,6 +809,14 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = f
|
|
|
781
809
|
var value = /** @type {number} */ (reader.readUint32());
|
|
782
810
|
msg.setCoreChainLockedHeight(value);
|
|
783
811
|
break;
|
|
812
|
+
case 3:
|
|
813
|
+
var value = /** @type {number} */ (reader.readUint64());
|
|
814
|
+
msg.setTimeMs(value);
|
|
815
|
+
break;
|
|
816
|
+
case 4:
|
|
817
|
+
var value = /** @type {number} */ (reader.readUint32());
|
|
818
|
+
msg.setProtocolVersion(value);
|
|
819
|
+
break;
|
|
784
820
|
default:
|
|
785
821
|
reader.skipField();
|
|
786
822
|
break;
|
|
@@ -824,6 +860,20 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter = funct
|
|
|
824
860
|
f
|
|
825
861
|
);
|
|
826
862
|
}
|
|
863
|
+
f = message.getTimeMs();
|
|
864
|
+
if (f !== 0) {
|
|
865
|
+
writer.writeUint64(
|
|
866
|
+
3,
|
|
867
|
+
f
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
f = message.getProtocolVersion();
|
|
871
|
+
if (f !== 0) {
|
|
872
|
+
writer.writeUint32(
|
|
873
|
+
4,
|
|
874
|
+
f
|
|
875
|
+
);
|
|
876
|
+
}
|
|
827
877
|
};
|
|
828
878
|
|
|
829
879
|
|
|
@@ -863,6 +913,42 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setCoreChainLockedHei
|
|
|
863
913
|
};
|
|
864
914
|
|
|
865
915
|
|
|
916
|
+
/**
|
|
917
|
+
* optional uint64 time_ms = 3;
|
|
918
|
+
* @return {number}
|
|
919
|
+
*/
|
|
920
|
+
proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getTimeMs = function() {
|
|
921
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* @param {number} value
|
|
927
|
+
* @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this
|
|
928
|
+
*/
|
|
929
|
+
proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setTimeMs = function(value) {
|
|
930
|
+
return jspb.Message.setProto3IntField(this, 3, value);
|
|
931
|
+
};
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
/**
|
|
935
|
+
* optional uint32 protocol_version = 4;
|
|
936
|
+
* @return {number}
|
|
937
|
+
*/
|
|
938
|
+
proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getProtocolVersion = function() {
|
|
939
|
+
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* @param {number} value
|
|
945
|
+
* @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this
|
|
946
|
+
*/
|
|
947
|
+
proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setProtocolVersion = function(value) {
|
|
948
|
+
return jspb.Message.setProto3IntField(this, 4, value);
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
|
|
866
952
|
|
|
867
953
|
|
|
868
954
|
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// package: org.dash.platform.dapi.v0
|
|
2
|
+
// file: platform.proto
|
|
3
|
+
|
|
4
|
+
import * as platform_pb from "./platform_pb";
|
|
5
|
+
import {grpc} from "@improbable-eng/grpc-web";
|
|
6
|
+
|
|
7
|
+
type PlatformbroadcastStateTransition = {
|
|
8
|
+
readonly methodName: string;
|
|
9
|
+
readonly service: typeof Platform;
|
|
10
|
+
readonly requestStream: false;
|
|
11
|
+
readonly responseStream: false;
|
|
12
|
+
readonly requestType: typeof platform_pb.BroadcastStateTransitionRequest;
|
|
13
|
+
readonly responseType: typeof platform_pb.BroadcastStateTransitionResponse;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type PlatformgetIdentity = {
|
|
17
|
+
readonly methodName: string;
|
|
18
|
+
readonly service: typeof Platform;
|
|
19
|
+
readonly requestStream: false;
|
|
20
|
+
readonly responseStream: false;
|
|
21
|
+
readonly requestType: typeof platform_pb.GetIdentityRequest;
|
|
22
|
+
readonly responseType: typeof platform_pb.GetIdentityResponse;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type PlatformgetDataContract = {
|
|
26
|
+
readonly methodName: string;
|
|
27
|
+
readonly service: typeof Platform;
|
|
28
|
+
readonly requestStream: false;
|
|
29
|
+
readonly responseStream: false;
|
|
30
|
+
readonly requestType: typeof platform_pb.GetDataContractRequest;
|
|
31
|
+
readonly responseType: typeof platform_pb.GetDataContractResponse;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type PlatformgetDocuments = {
|
|
35
|
+
readonly methodName: string;
|
|
36
|
+
readonly service: typeof Platform;
|
|
37
|
+
readonly requestStream: false;
|
|
38
|
+
readonly responseStream: false;
|
|
39
|
+
readonly requestType: typeof platform_pb.GetDocumentsRequest;
|
|
40
|
+
readonly responseType: typeof platform_pb.GetDocumentsResponse;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type PlatformgetIdentitiesByPublicKeyHashes = {
|
|
44
|
+
readonly methodName: string;
|
|
45
|
+
readonly service: typeof Platform;
|
|
46
|
+
readonly requestStream: false;
|
|
47
|
+
readonly responseStream: false;
|
|
48
|
+
readonly requestType: typeof platform_pb.GetIdentitiesByPublicKeyHashesRequest;
|
|
49
|
+
readonly responseType: typeof platform_pb.GetIdentitiesByPublicKeyHashesResponse;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type PlatformwaitForStateTransitionResult = {
|
|
53
|
+
readonly methodName: string;
|
|
54
|
+
readonly service: typeof Platform;
|
|
55
|
+
readonly requestStream: false;
|
|
56
|
+
readonly responseStream: false;
|
|
57
|
+
readonly requestType: typeof platform_pb.WaitForStateTransitionResultRequest;
|
|
58
|
+
readonly responseType: typeof platform_pb.WaitForStateTransitionResultResponse;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type PlatformgetConsensusParams = {
|
|
62
|
+
readonly methodName: string;
|
|
63
|
+
readonly service: typeof Platform;
|
|
64
|
+
readonly requestStream: false;
|
|
65
|
+
readonly responseStream: false;
|
|
66
|
+
readonly requestType: typeof platform_pb.GetConsensusParamsRequest;
|
|
67
|
+
readonly responseType: typeof platform_pb.GetConsensusParamsResponse;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export class Platform {
|
|
71
|
+
static readonly serviceName: string;
|
|
72
|
+
static readonly broadcastStateTransition: PlatformbroadcastStateTransition;
|
|
73
|
+
static readonly getIdentity: PlatformgetIdentity;
|
|
74
|
+
static readonly getDataContract: PlatformgetDataContract;
|
|
75
|
+
static readonly getDocuments: PlatformgetDocuments;
|
|
76
|
+
static readonly getIdentitiesByPublicKeyHashes: PlatformgetIdentitiesByPublicKeyHashes;
|
|
77
|
+
static readonly waitForStateTransitionResult: PlatformwaitForStateTransitionResult;
|
|
78
|
+
static readonly getConsensusParams: PlatformgetConsensusParams;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
|
82
|
+
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
|
83
|
+
|
|
84
|
+
interface UnaryResponse {
|
|
85
|
+
cancel(): void;
|
|
86
|
+
}
|
|
87
|
+
interface ResponseStream<T> {
|
|
88
|
+
cancel(): void;
|
|
89
|
+
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
|
90
|
+
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
|
91
|
+
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
|
92
|
+
}
|
|
93
|
+
interface RequestStream<T> {
|
|
94
|
+
write(message: T): RequestStream<T>;
|
|
95
|
+
end(): void;
|
|
96
|
+
cancel(): void;
|
|
97
|
+
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
|
98
|
+
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
|
99
|
+
}
|
|
100
|
+
interface BidirectionalStream<ReqT, ResT> {
|
|
101
|
+
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
|
102
|
+
end(): void;
|
|
103
|
+
cancel(): void;
|
|
104
|
+
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
|
105
|
+
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
106
|
+
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export class PlatformClient {
|
|
110
|
+
readonly serviceHost: string;
|
|
111
|
+
|
|
112
|
+
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
|
113
|
+
broadcastStateTransition(
|
|
114
|
+
requestMessage: platform_pb.BroadcastStateTransitionRequest,
|
|
115
|
+
metadata: grpc.Metadata,
|
|
116
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.BroadcastStateTransitionResponse|null) => void
|
|
117
|
+
): UnaryResponse;
|
|
118
|
+
broadcastStateTransition(
|
|
119
|
+
requestMessage: platform_pb.BroadcastStateTransitionRequest,
|
|
120
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.BroadcastStateTransitionResponse|null) => void
|
|
121
|
+
): UnaryResponse;
|
|
122
|
+
getIdentity(
|
|
123
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
124
|
+
metadata: grpc.Metadata,
|
|
125
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void
|
|
126
|
+
): UnaryResponse;
|
|
127
|
+
getIdentity(
|
|
128
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
129
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void
|
|
130
|
+
): UnaryResponse;
|
|
131
|
+
getDataContract(
|
|
132
|
+
requestMessage: platform_pb.GetDataContractRequest,
|
|
133
|
+
metadata: grpc.Metadata,
|
|
134
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
|
|
135
|
+
): UnaryResponse;
|
|
136
|
+
getDataContract(
|
|
137
|
+
requestMessage: platform_pb.GetDataContractRequest,
|
|
138
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
|
|
139
|
+
): UnaryResponse;
|
|
140
|
+
getDocuments(
|
|
141
|
+
requestMessage: platform_pb.GetDocumentsRequest,
|
|
142
|
+
metadata: grpc.Metadata,
|
|
143
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsResponse|null) => void
|
|
144
|
+
): UnaryResponse;
|
|
145
|
+
getDocuments(
|
|
146
|
+
requestMessage: platform_pb.GetDocumentsRequest,
|
|
147
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsResponse|null) => void
|
|
148
|
+
): UnaryResponse;
|
|
149
|
+
getIdentitiesByPublicKeyHashes(
|
|
150
|
+
requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
|
|
151
|
+
metadata: grpc.Metadata,
|
|
152
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void
|
|
153
|
+
): UnaryResponse;
|
|
154
|
+
getIdentitiesByPublicKeyHashes(
|
|
155
|
+
requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
|
|
156
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void
|
|
157
|
+
): UnaryResponse;
|
|
158
|
+
waitForStateTransitionResult(
|
|
159
|
+
requestMessage: platform_pb.WaitForStateTransitionResultRequest,
|
|
160
|
+
metadata: grpc.Metadata,
|
|
161
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.WaitForStateTransitionResultResponse|null) => void
|
|
162
|
+
): UnaryResponse;
|
|
163
|
+
waitForStateTransitionResult(
|
|
164
|
+
requestMessage: platform_pb.WaitForStateTransitionResultRequest,
|
|
165
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.WaitForStateTransitionResultResponse|null) => void
|
|
166
|
+
): UnaryResponse;
|
|
167
|
+
getConsensusParams(
|
|
168
|
+
requestMessage: platform_pb.GetConsensusParamsRequest,
|
|
169
|
+
metadata: grpc.Metadata,
|
|
170
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetConsensusParamsResponse|null) => void
|
|
171
|
+
): UnaryResponse;
|
|
172
|
+
getConsensusParams(
|
|
173
|
+
requestMessage: platform_pb.GetConsensusParamsRequest,
|
|
174
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetConsensusParamsResponse|null) => void
|
|
175
|
+
): UnaryResponse;
|
|
176
|
+
}
|
|
177
|
+
|