@dashevo/dapi-grpc 5.0.3 → 5.1.0-dev.2

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.
@@ -64,6 +64,18 @@ const {
64
64
  GetStatusResponse: PBJSGetStatusResponse,
65
65
  GetIdentityBalanceRequest: PBJSGetIdentityBalanceRequest,
66
66
  GetIdentityBalanceResponse: PBJSGetIdentityBalanceResponse,
67
+ GetYesNoVotePollStateRequest: PBJSGetYesNoVotePollStateRequest,
68
+ GetYesNoVotePollStateResponse: PBJSGetYesNoVotePollStateResponse,
69
+ GetMasternodeYesNoVoteRequest: PBJSGetMasternodeYesNoVoteRequest,
70
+ GetMasternodeYesNoVoteResponse: PBJSGetMasternodeYesNoVoteResponse,
71
+ GetPrivateDocumentEntriesRequest: PBJSGetPrivateDocumentEntriesRequest,
72
+ GetPrivateDocumentEntriesResponse: PBJSGetPrivateDocumentEntriesResponse,
73
+ GetRecentStateTransitionStatusRequest: PBJSGetRecentStateTransitionStatusRequest,
74
+ GetRecentStateTransitionStatusResponse: PBJSGetRecentStateTransitionStatusResponse,
75
+ GetOwnerTransactionsInBlockRequest: PBJSGetOwnerTransactionsInBlockRequest,
76
+ GetOwnerTransactionsInBlockResponse: PBJSGetOwnerTransactionsInBlockResponse,
77
+ GetBlocksRequest: PBJSGetBlocksRequest,
78
+ GetBlocksResponse: PBJSGetBlocksResponse,
67
79
  },
68
80
  },
69
81
  },
@@ -91,6 +103,12 @@ const {
91
103
  GetTotalCreditsInPlatformResponse: ProtocGetTotalCreditsInPlatformResponse,
92
104
  GetStatusResponse: ProtocGetStatusResponse,
93
105
  GetIdentityBalanceResponse: ProtocGetIdentityBalanceResponse,
106
+ GetYesNoVotePollStateResponse: ProtocGetYesNoVotePollStateResponse,
107
+ GetMasternodeYesNoVoteResponse: ProtocGetMasternodeYesNoVoteResponse,
108
+ GetPrivateDocumentEntriesResponse: ProtocGetPrivateDocumentEntriesResponse,
109
+ GetRecentStateTransitionStatusResponse: ProtocGetRecentStateTransitionStatusResponse,
110
+ GetOwnerTransactionsInBlockResponse: ProtocGetOwnerTransactionsInBlockResponse,
111
+ GetBlocksResponse: ProtocGetBlocksResponse,
94
112
  } = require('./platform_protoc');
95
113
 
96
114
  const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
@@ -193,6 +211,30 @@ class PlatformPromiseClient {
193
211
  this.client.getIdentityBalance.bind(this.client),
194
212
  );
195
213
 
214
+ this.client.getYesNoVotePollState = promisify(
215
+ this.client.getYesNoVotePollState.bind(this.client),
216
+ );
217
+
218
+ this.client.getMasternodeYesNoVote = promisify(
219
+ this.client.getMasternodeYesNoVote.bind(this.client),
220
+ );
221
+
222
+ this.client.getPrivateDocumentEntries = promisify(
223
+ this.client.getPrivateDocumentEntries.bind(this.client),
224
+ );
225
+
226
+ this.client.getRecentStateTransitionStatus = promisify(
227
+ this.client.getRecentStateTransitionStatus.bind(this.client),
228
+ );
229
+
230
+ this.client.getOwnerTransactionsInBlock = promisify(
231
+ this.client.getOwnerTransactionsInBlock.bind(this.client),
232
+ );
233
+
234
+ this.client.getBlocks = promisify(
235
+ this.client.getBlocks.bind(this.client),
236
+ );
237
+
196
238
  this.protocolVersion = undefined;
197
239
  }
198
240
 
@@ -798,6 +840,240 @@ class PlatformPromiseClient {
798
840
  );
799
841
  }
800
842
 
843
+ /**
844
+ * @param {!GetYesNoVotePollStateRequest} getYesNoVotePollStateRequest
845
+ * @param {?Object<string, string>} metadata
846
+ * @param {CallOptions} [options={}]
847
+ * @return {Promise<!GetYesNoVotePollStateResponse>}
848
+ */
849
+ getYesNoVotePollState(
850
+ getYesNoVotePollStateRequest,
851
+ metadata = {},
852
+ options = {},
853
+ ) {
854
+ if (!isObject(metadata)) {
855
+ throw new Error('metadata must be an object');
856
+ }
857
+
858
+ return this.client.getYesNoVotePollState(
859
+ getYesNoVotePollStateRequest,
860
+ convertObjectToMetadata(metadata),
861
+ {
862
+ interceptors: [
863
+ jsonToProtobufInterceptorFactory(
864
+ jsonToProtobufFactory(
865
+ ProtocGetYesNoVotePollStateResponse,
866
+ PBJSGetYesNoVotePollStateResponse,
867
+ ),
868
+ protobufToJsonFactory(
869
+ PBJSGetYesNoVotePollStateRequest,
870
+ ),
871
+ ),
872
+ ],
873
+ ...options,
874
+ },
875
+ );
876
+ }
877
+
878
+ /**
879
+ * @param {!GetMasternodeYesNoVoteRequest} getMasternodeYesNoVoteRequest
880
+ * @param {?Object<string, string>} metadata
881
+ * @param {CallOptions} [options={}]
882
+ * @return {Promise<!GetMasternodeYesNoVoteResponse>}
883
+ */
884
+ getMasternodeYesNoVote(
885
+ getMasternodeYesNoVoteRequest,
886
+ metadata = {},
887
+ options = {},
888
+ ) {
889
+ if (!isObject(metadata)) {
890
+ throw new Error('metadata must be an object');
891
+ }
892
+
893
+ return this.client.getMasternodeYesNoVote(
894
+ getMasternodeYesNoVoteRequest,
895
+ convertObjectToMetadata(metadata),
896
+ {
897
+ interceptors: [
898
+ jsonToProtobufInterceptorFactory(
899
+ jsonToProtobufFactory(
900
+ ProtocGetMasternodeYesNoVoteResponse,
901
+ PBJSGetMasternodeYesNoVoteResponse,
902
+ ),
903
+ protobufToJsonFactory(
904
+ PBJSGetMasternodeYesNoVoteRequest,
905
+ ),
906
+ ),
907
+ ],
908
+ ...options,
909
+ },
910
+ );
911
+ }
912
+
913
+ /**
914
+ * @param {!GetPrivateDocumentEntriesRequest} getPrivateDocumentEntriesRequest
915
+ * @param {?Object<string, string>} metadata
916
+ * @param {CallOptions} [options={}]
917
+ * @return {Promise<!GetPrivateDocumentEntriesResponse>}
918
+ */
919
+ getPrivateDocumentEntries(
920
+ getPrivateDocumentEntriesRequest,
921
+ metadata = {},
922
+ options = {},
923
+ ) {
924
+ if (!isObject(metadata)) {
925
+ throw new Error('metadata must be an object');
926
+ }
927
+
928
+ // A caller's interceptors run outside the conversion between protobuf messages and the
929
+ // plain objects the service sends, so they see the messages and the conversion still runs.
930
+ const { interceptors: callerInterceptors = [], ...callOptions } = options;
931
+
932
+ return this.client.getPrivateDocumentEntries(
933
+ getPrivateDocumentEntriesRequest,
934
+ convertObjectToMetadata(metadata),
935
+ {
936
+ ...callOptions,
937
+ interceptors: [
938
+ ...callerInterceptors,
939
+ jsonToProtobufInterceptorFactory(
940
+ jsonToProtobufFactory(
941
+ ProtocGetPrivateDocumentEntriesResponse,
942
+ PBJSGetPrivateDocumentEntriesResponse,
943
+ ),
944
+ protobufToJsonFactory(
945
+ PBJSGetPrivateDocumentEntriesRequest,
946
+ ),
947
+ ),
948
+ ],
949
+ },
950
+ );
951
+ }
952
+
953
+ /**
954
+ * What the answering node knows of a state transition, by hash, without waiting: committed,
955
+ * pending in its mempool, or unknown. Unproved and per node: use it to decide whether waiting
956
+ * longer makes sense, never to decide that a transition cannot execute.
957
+ *
958
+ * @param {!GetRecentStateTransitionStatusRequest} getRecentStateTransitionStatusRequest
959
+ * @param {?Object<string, string>} metadata
960
+ * @param {CallOptions} [options={}]
961
+ * @return {Promise<!GetRecentStateTransitionStatusResponse>}
962
+ */
963
+ getRecentStateTransitionStatus(
964
+ getRecentStateTransitionStatusRequest,
965
+ metadata = {},
966
+ options = {},
967
+ ) {
968
+ if (!isObject(metadata)) {
969
+ throw new Error('metadata must be an object');
970
+ }
971
+
972
+ // A caller's interceptors run outside the conversion between protobuf messages and the
973
+ // plain objects the service sends, so they see the messages and the conversion still runs.
974
+ const { interceptors: callerInterceptors = [], ...callOptions } = options;
975
+
976
+ return this.client.getRecentStateTransitionStatus(
977
+ getRecentStateTransitionStatusRequest,
978
+ convertObjectToMetadata(metadata),
979
+ {
980
+ ...callOptions,
981
+ interceptors: [
982
+ ...callerInterceptors,
983
+ jsonToProtobufInterceptorFactory(
984
+ jsonToProtobufFactory(
985
+ ProtocGetRecentStateTransitionStatusResponse,
986
+ PBJSGetRecentStateTransitionStatusResponse,
987
+ ),
988
+ protobufToJsonFactory(
989
+ PBJSGetRecentStateTransitionStatusRequest,
990
+ ),
991
+ ),
992
+ ],
993
+ },
994
+ );
995
+ }
996
+
997
+ /**
998
+ * @param {!GetOwnerTransactionsInBlockRequest} getOwnerTransactionsInBlockRequest
999
+ * @param {?Object<string, string>} metadata
1000
+ * @param {CallOptions} [options={}]
1001
+ * @return {Promise<!GetOwnerTransactionsInBlockResponse>}
1002
+ */
1003
+ getOwnerTransactionsInBlock(
1004
+ getOwnerTransactionsInBlockRequest,
1005
+ metadata = {},
1006
+ options = {},
1007
+ ) {
1008
+ if (!isObject(metadata)) {
1009
+ throw new Error('metadata must be an object');
1010
+ }
1011
+
1012
+ // A caller's interceptors run outside the conversion between protobuf messages and the
1013
+ // plain objects the service sends, so they see the messages and the conversion still runs.
1014
+ const { interceptors: callerInterceptors = [], ...callOptions } = options;
1015
+
1016
+ return this.client.getOwnerTransactionsInBlock(
1017
+ getOwnerTransactionsInBlockRequest,
1018
+ convertObjectToMetadata(metadata),
1019
+ {
1020
+ ...callOptions,
1021
+ interceptors: [
1022
+ ...callerInterceptors,
1023
+ jsonToProtobufInterceptorFactory(
1024
+ jsonToProtobufFactory(
1025
+ ProtocGetOwnerTransactionsInBlockResponse,
1026
+ PBJSGetOwnerTransactionsInBlockResponse,
1027
+ ),
1028
+ protobufToJsonFactory(
1029
+ PBJSGetOwnerTransactionsInBlockRequest,
1030
+ ),
1031
+ ),
1032
+ ],
1033
+ },
1034
+ );
1035
+ }
1036
+
1037
+ /**
1038
+ * @param {!GetBlocksRequest} getBlocksRequest
1039
+ * @param {?Object<string, string>} metadata
1040
+ * @param {CallOptions} [options={}]
1041
+ * @return {Promise<!GetBlocksResponse>}
1042
+ */
1043
+ getBlocks(
1044
+ getBlocksRequest,
1045
+ metadata = {},
1046
+ options = {},
1047
+ ) {
1048
+ if (!isObject(metadata)) {
1049
+ throw new Error('metadata must be an object');
1050
+ }
1051
+
1052
+ // A caller's interceptors run outside the conversion between protobuf messages and the
1053
+ // plain objects the service sends, so they see the messages and the conversion still runs.
1054
+ const { interceptors: callerInterceptors = [], ...callOptions } = options;
1055
+
1056
+ return this.client.getBlocks(
1057
+ getBlocksRequest,
1058
+ convertObjectToMetadata(metadata),
1059
+ {
1060
+ ...callOptions,
1061
+ interceptors: [
1062
+ ...callerInterceptors,
1063
+ jsonToProtobufInterceptorFactory(
1064
+ jsonToProtobufFactory(
1065
+ ProtocGetBlocksResponse,
1066
+ PBJSGetBlocksResponse,
1067
+ ),
1068
+ protobufToJsonFactory(
1069
+ PBJSGetBlocksRequest,
1070
+ ),
1071
+ ),
1072
+ ],
1073
+ },
1074
+ );
1075
+ }
1076
+
801
1077
  /**
802
1078
  * @param {string} protocolVersion
803
1079
  */