@dashevo/dapi-grpc 1.0.0-pr.1825.9 → 1.0.0-pr.1902.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/Cargo.toml +1 -1
- package/build.rs +4 -2
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +55 -14
- package/clients/platform/v0/nodejs/platform_pbjs.js +7193 -8354
- package/clients/platform/v0/nodejs/platform_protoc.js +3175 -4286
- package/clients/platform/v0/web/PlatformPromiseClient.js +22 -8
- package/clients/platform/v0/web/platform_pb.d.ts +231 -372
- package/clients/platform/v0/web/platform_pb.js +3175 -4286
- package/clients/platform/v0/web/platform_pb_service.d.ts +16 -35
- package/clients/platform/v0/web/platform_pb_service.js +12 -52
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +49 -64
- package/src/core/client/org.dash.platform.dapi.v0.rs +845 -0
- package/src/core/client_server/org.dash.platform.dapi.v0.rs +1537 -0
- package/src/platform/client/org.dash.platform.dapi.v0.rs +2863 -0
- package/src/platform/client_server/org.dash.platform.dapi.v0.rs +4075 -0
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +197 -345
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +21 -0
package/Cargo.toml
CHANGED
package/build.rs
CHANGED
|
@@ -39,7 +39,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
39
39
|
// Derive features for versioned messages
|
|
40
40
|
//
|
|
41
41
|
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
|
|
42
|
-
const VERSIONED_REQUESTS: [&str;
|
|
42
|
+
const VERSIONED_REQUESTS: [&str; 19] = [
|
|
43
43
|
"GetDataContractHistoryRequest",
|
|
44
44
|
"GetDataContractRequest",
|
|
45
45
|
"GetDataContractsRequest",
|
|
@@ -58,10 +58,11 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
58
58
|
"GetProtocolVersionUpgradeStateRequest",
|
|
59
59
|
"GetProtocolVersionUpgradeVoteStatusRequest",
|
|
60
60
|
"GetPathElementsRequest",
|
|
61
|
+
"GetIdentitiesContractKeysRequest",
|
|
61
62
|
];
|
|
62
63
|
|
|
63
64
|
// "GetConsensusParamsResponse" is excluded as this message does not support proofs
|
|
64
|
-
const VERSIONED_RESPONSES: [&str;
|
|
65
|
+
const VERSIONED_RESPONSES: [&str; 20] = [
|
|
65
66
|
"GetDataContractHistoryResponse",
|
|
66
67
|
"GetDataContractResponse",
|
|
67
68
|
"GetDataContractsResponse",
|
|
@@ -81,6 +82,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
81
82
|
"GetProtocolVersionUpgradeStateResponse",
|
|
82
83
|
"GetProtocolVersionUpgradeVoteStatusResponse",
|
|
83
84
|
"GetPathElementsResponse",
|
|
85
|
+
"GetIdentitiesContractKeysResponse",
|
|
84
86
|
];
|
|
85
87
|
|
|
86
88
|
// Derive VersionedGrpcMessage on requests
|
|
@@ -28,14 +28,16 @@ const {
|
|
|
28
28
|
BroadcastStateTransitionResponse: PBJSBroadcastStateTransitionResponse,
|
|
29
29
|
GetIdentityRequest: PBJSGetIdentityRequest,
|
|
30
30
|
GetIdentityResponse: PBJSGetIdentityResponse,
|
|
31
|
+
GetIdentitiesContractKeysRequest: PBJSGetIdentitiesContractKeysRequest,
|
|
32
|
+
GetIdentitiesContractKeysResponse: PBJSGetIdentitiesContractKeysResponse,
|
|
31
33
|
GetDataContractRequest: PBJSGetDataContractRequest,
|
|
32
34
|
GetDataContractResponse: PBJSGetDataContractResponse,
|
|
33
35
|
GetDataContractHistoryRequest: PBJSGetDataContractHistoryRequest,
|
|
34
36
|
GetDataContractHistoryResponse: PBJSGetDataContractHistoryResponse,
|
|
35
37
|
GetDocumentsRequest: PBJSGetDocumentsRequest,
|
|
36
38
|
GetDocumentsResponse: PBJSGetDocumentsResponse,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
GetIdentityByPublicKeyHashRequest: PBJSGetIdentityByPublicKeyHashRequest,
|
|
40
|
+
GetIdentityByPublicKeyHashResponse: PBJSGetIdentityByPublicKeyHashResponse,
|
|
39
41
|
WaitForStateTransitionResultRequest: PBJSWaitForStateTransitionResultRequest,
|
|
40
42
|
WaitForStateTransitionResultResponse: PBJSWaitForStateTransitionResultResponse,
|
|
41
43
|
GetConsensusParamsRequest: PBJSGetConsensusParamsRequest,
|
|
@@ -66,10 +68,11 @@ const {
|
|
|
66
68
|
const {
|
|
67
69
|
BroadcastStateTransitionResponse: ProtocBroadcastStateTransitionResponse,
|
|
68
70
|
GetIdentityResponse: ProtocGetIdentityResponse,
|
|
71
|
+
GetIdentitiesContractKeysResponse: ProtocGetIdentitiesContractKeysResponse,
|
|
69
72
|
GetDataContractResponse: ProtocGetDataContractResponse,
|
|
70
73
|
GetDataContractHistoryResponse: ProtocGetDataContractHistoryResponse,
|
|
71
74
|
GetDocumentsResponse: ProtocGetDocumentsResponse,
|
|
72
|
-
|
|
75
|
+
GetIdentityByPublicKeyHashResponse: ProtocGetIdentityByPublicKeyHashResponse,
|
|
73
76
|
WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
|
|
74
77
|
GetConsensusParamsResponse: ProtocGetConsensusParamsResponse,
|
|
75
78
|
GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
|
|
@@ -113,6 +116,10 @@ class PlatformPromiseClient {
|
|
|
113
116
|
this.client.getIdentity.bind(this.client),
|
|
114
117
|
);
|
|
115
118
|
|
|
119
|
+
this.client.getIdentitiesContractKeys = promisify(
|
|
120
|
+
this.client.getIdentitiesContractKeys.bind(this.client),
|
|
121
|
+
);
|
|
122
|
+
|
|
116
123
|
this.client.getDataContract = promisify(
|
|
117
124
|
this.client.getDataContract.bind(this.client),
|
|
118
125
|
);
|
|
@@ -125,8 +132,8 @@ class PlatformPromiseClient {
|
|
|
125
132
|
this.client.getDocuments.bind(this.client),
|
|
126
133
|
);
|
|
127
134
|
|
|
128
|
-
this.client.
|
|
129
|
-
this.client.
|
|
135
|
+
this.client.getIdentityByPublicKeyHash = promisify(
|
|
136
|
+
this.client.getIdentityByPublicKeyHash.bind(this.client),
|
|
130
137
|
);
|
|
131
138
|
|
|
132
139
|
this.client.waitForStateTransitionResult = promisify(
|
|
@@ -230,6 +237,40 @@ class PlatformPromiseClient {
|
|
|
230
237
|
);
|
|
231
238
|
}
|
|
232
239
|
|
|
240
|
+
/**
|
|
241
|
+
* @param {!GetIdentitiesContractKeysRequest} getIdentitiesContractKeysRequest
|
|
242
|
+
* @param {?Object<string, string>} metadata
|
|
243
|
+
* @param {CallOptions} [options={}]
|
|
244
|
+
* @returns {Promise<!GetIdentitiesContractKeysResponse>}
|
|
245
|
+
*/
|
|
246
|
+
getIdentitiesContractKeys(
|
|
247
|
+
getIdentitiesContractKeysRequest,
|
|
248
|
+
metadata = {},
|
|
249
|
+
options = {},
|
|
250
|
+
) {
|
|
251
|
+
if (!isObject(metadata)) {
|
|
252
|
+
throw new Error('metadata must be an object');
|
|
253
|
+
}
|
|
254
|
+
return this.client.getIdentitiesContractKeys(
|
|
255
|
+
getIdentitiesContractKeysRequest,
|
|
256
|
+
convertObjectToMetadata(metadata),
|
|
257
|
+
{
|
|
258
|
+
interceptors: [
|
|
259
|
+
jsonToProtobufInterceptorFactory(
|
|
260
|
+
jsonToProtobufFactory(
|
|
261
|
+
ProtocGetIdentitiesContractKeysResponse,
|
|
262
|
+
PBJSGetIdentitiesContractKeysResponse,
|
|
263
|
+
),
|
|
264
|
+
protobufToJsonFactory(
|
|
265
|
+
PBJSGetIdentitiesContractKeysRequest,
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
],
|
|
269
|
+
...options,
|
|
270
|
+
},
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
|
|
233
274
|
/**
|
|
234
275
|
*
|
|
235
276
|
* @param {!GetDataContractRequest} getDataContractRequest
|
|
@@ -327,13 +368,13 @@ class PlatformPromiseClient {
|
|
|
327
368
|
}
|
|
328
369
|
|
|
329
370
|
/**
|
|
330
|
-
* @param {!
|
|
371
|
+
* @param {!GetIdentityByPublicKeyHashRequest} getIdentityByPublicKeyHashRequest
|
|
331
372
|
* @param {?Object<string, string>} metadata
|
|
332
373
|
* @param {CallOptions} [options={}]
|
|
333
|
-
* @returns {Promise<!
|
|
374
|
+
* @returns {Promise<!GetIdentityByPublicKeyHashResponse>}
|
|
334
375
|
*/
|
|
335
|
-
|
|
336
|
-
|
|
376
|
+
getIdentityByPublicKeyHash(
|
|
377
|
+
getIdentityByPublicKeyHashRequest,
|
|
337
378
|
metadata = {},
|
|
338
379
|
options = {},
|
|
339
380
|
) {
|
|
@@ -341,18 +382,18 @@ class PlatformPromiseClient {
|
|
|
341
382
|
throw new Error('metadata must be an object');
|
|
342
383
|
}
|
|
343
384
|
|
|
344
|
-
return this.client.
|
|
345
|
-
|
|
385
|
+
return this.client.getIdentityByPublicKeyHash(
|
|
386
|
+
getIdentityByPublicKeyHashRequest,
|
|
346
387
|
convertObjectToMetadata(metadata),
|
|
347
388
|
{
|
|
348
389
|
interceptors: [
|
|
349
390
|
jsonToProtobufInterceptorFactory(
|
|
350
391
|
jsonToProtobufFactory(
|
|
351
|
-
|
|
352
|
-
|
|
392
|
+
ProtocGetIdentityByPublicKeyHashResponse,
|
|
393
|
+
PBJSGetIdentityByPublicKeyHashResponse,
|
|
353
394
|
),
|
|
354
395
|
protobufToJsonFactory(
|
|
355
|
-
|
|
396
|
+
PBJSGetIdentityByPublicKeyHashRequest,
|
|
356
397
|
),
|
|
357
398
|
),
|
|
358
399
|
],
|