@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.
- package/Cargo.toml +45 -0
- package/build.rs +69 -0
- package/clients/core/v0/rust/README.md +3 -0
- package/clients/core/v0/rust/core_example.rs +14 -0
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +163 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +23402 -1734
- package/clients/platform/v0/nodejs/platform_protoc.js +20140 -1970
- package/clients/platform/v0/rust/README.md +3 -0
- package/clients/platform/v0/rust/platform_example.rs +20 -0
- package/clients/platform/v0/web/PlatformPromiseClient.js +57 -0
- package/clients/platform/v0/web/platform_pb.d.ts +2739 -300
- package/clients/platform/v0/web/platform_pb.js +20140 -1970
- package/clients/platform/v0/web/platform_pb_service.d.ts +209 -0
- package/clients/platform/v0/web/platform_pb_service.js +440 -0
- package/package.json +16 -4
- package/protos/platform/v0/platform.proto +555 -51
- package/scripts/build.sh +91 -115
- package/scripts/patch-protobuf-js.sh +10 -9
- package/src/core/proto/org.dash.platform.dapi.v0.rs +666 -0
- package/src/lib.rs +15 -0
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +2030 -0
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +32 -0
- package/clients/core/v0/rust/core.rs +0 -4956
- package/clients/core/v0/rust/core_grpc.rs +0 -223
- package/clients/core/v0/rust/mod.rs +0 -3
- package/clients/platform/v0/rust/mod.rs +0 -3
- package/clients/platform/v0/rust/platform.rs +0 -3555
- package/clients/platform/v0/rust/platform_grpc.rs +0 -223
|
@@ -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
|
*/
|