@dashevo/dapi-grpc 0.25.0-dev.8 → 0.25.0-pr.1545.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.
@@ -0,0 +1,3 @@
1
+ # Rust bindings
2
+
3
+ Rust definitions can be found in [dapi-grpc/src](../../../../src/) directory.
@@ -0,0 +1,20 @@
1
+ use dapi_grpc::platform::v0 as platform;
2
+ use dapi_grpc::platform::v0::get_consensus_params_request::GetConsensusParamsRequestV0;
3
+ use prost::Message;
4
+
5
+ fn main() {
6
+ let request = platform::GetConsensusParamsRequest {
7
+ version: Some(platform::get_consensus_params_request::Version::V0(
8
+ GetConsensusParamsRequestV0 {
9
+ height: 123,
10
+ prove: true,
11
+ },
12
+ )),
13
+ };
14
+
15
+ let mut buffer = Vec::<u8>::new();
16
+ request.encode(&mut buffer).expect("failed to encode data");
17
+ let decoded = platform::GetConsensusParamsRequest::decode(buffer.as_ref())
18
+ .expect("failed to decode data");
19
+ assert_eq!(request, decoded);
20
+ }
@@ -56,6 +56,21 @@ class PlatformPromiseClient {
56
56
  );
57
57
  }
58
58
 
59
+ /**
60
+ *
61
+ * @param {!GetDataContractHistoryRequest} getDataContractHistoryRequest
62
+ * @param {?Object<string, string>} metadata
63
+ * @returns {Promise<!GetDataContractResponse>}
64
+ */
65
+ getDataContractHistory(getDataContractHistoryRequest, metadata = {}) {
66
+ return promisify(
67
+ this.client.getDataContractHistory.bind(this.client),
68
+ )(
69
+ getDataContractHistoryRequest,
70
+ metadata,
71
+ );
72
+ }
73
+
59
74
  /**
60
75
  *
61
76
  * @param {!GetDocumentsRequest} getDocumentsRequest
@@ -119,6 +134,48 @@ class PlatformPromiseClient {
119
134
  );
120
135
  }
121
136
 
137
+ /**
138
+ * @param {!GetEpochsInfoRequest} getEpochsInfoRequest
139
+ * @param {?Object<string, string>} metadata
140
+ * @return {Promise<!GetEpochsInfoResponse>}
141
+ */
142
+ getEpochsInfo(getEpochsInfoRequest, metadata = {}) {
143
+ return promisify(
144
+ this.client.getEpochsInfo.bind(this.client),
145
+ )(
146
+ getEpochsInfoRequest,
147
+ metadata,
148
+ );
149
+ }
150
+
151
+ /**
152
+ * @param {!GetProtocolVersionUpgradeVoteStatusRequest} getProtocolVersionUpgradeVoteStatusRequest
153
+ * @param {?Object<string, string>} metadata
154
+ * @return {Promise<!GetProtocolVersionUpgradeVoteStatusResponse>}
155
+ */
156
+ getProtocolVersionUpgradeVoteStatus(getProtocolVersionUpgradeVoteStatusRequest, metadata = {}) {
157
+ return promisify(
158
+ this.client.getProtocolVersionUpgradeVoteStatus.bind(this.client),
159
+ )(
160
+ getProtocolVersionUpgradeVoteStatusRequest,
161
+ metadata,
162
+ );
163
+ }
164
+
165
+ /**
166
+ * @param {!GetProtocolVersionUpgradeStateRequest} getProtocolVersionUpgradeStateRequest
167
+ * @param {?Object<string, string>} metadata
168
+ * @return {Promise<!GetProtocolVersionUpgradeStateResponse>}
169
+ */
170
+ getProtocolVersionUpgradeState(getProtocolVersionUpgradeStateRequest, metadata = {}) {
171
+ return promisify(
172
+ this.client.getProtocolVersionUpgradeState.bind(this.client),
173
+ )(
174
+ getProtocolVersionUpgradeStateRequest,
175
+ metadata,
176
+ );
177
+ }
178
+
122
179
  /**
123
180
  * @param {string} protocolVersion
124
181
  */