@dashevo/dapi-grpc 0.25.0-dev.15 → 0.25.0-dev.17
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 +7 -2
- package/build.rs +10 -6
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +39 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +2136 -288
- package/clients/platform/v0/nodejs/platform_protoc.js +2186 -327
- package/clients/platform/v0/web/PlatformPromiseClient.js +15 -0
- package/clients/platform/v0/web/platform_pb.d.ts +285 -28
- package/clients/platform/v0/web/platform_pb.js +2186 -327
- package/clients/platform/v0/web/platform_pb_service.d.ts +19 -0
- package/clients/platform/v0/web/platform_pb_service.js +40 -0
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +70 -15
- package/src/core/proto/org.dash.platform.dapi.v0.rs +666 -0
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +1324 -0
|
@@ -76,6 +76,15 @@ type PlatformgetDataContract = {
|
|
|
76
76
|
readonly responseType: typeof platform_pb.GetDataContractResponse;
|
|
77
77
|
};
|
|
78
78
|
|
|
79
|
+
type PlatformgetDataContractHistory = {
|
|
80
|
+
readonly methodName: string;
|
|
81
|
+
readonly service: typeof Platform;
|
|
82
|
+
readonly requestStream: false;
|
|
83
|
+
readonly responseStream: false;
|
|
84
|
+
readonly requestType: typeof platform_pb.GetDataContractHistoryRequest;
|
|
85
|
+
readonly responseType: typeof platform_pb.GetDataContractHistoryResponse;
|
|
86
|
+
};
|
|
87
|
+
|
|
79
88
|
type PlatformgetDataContracts = {
|
|
80
89
|
readonly methodName: string;
|
|
81
90
|
readonly service: typeof Platform;
|
|
@@ -140,6 +149,7 @@ export class Platform {
|
|
|
140
149
|
static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision;
|
|
141
150
|
static readonly getProofs: PlatformgetProofs;
|
|
142
151
|
static readonly getDataContract: PlatformgetDataContract;
|
|
152
|
+
static readonly getDataContractHistory: PlatformgetDataContractHistory;
|
|
143
153
|
static readonly getDataContracts: PlatformgetDataContracts;
|
|
144
154
|
static readonly getDocuments: PlatformgetDocuments;
|
|
145
155
|
static readonly getIdentitiesByPublicKeyHashes: PlatformgetIdentitiesByPublicKeyHashes;
|
|
@@ -252,6 +262,15 @@ export class PlatformClient {
|
|
|
252
262
|
requestMessage: platform_pb.GetDataContractRequest,
|
|
253
263
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
|
|
254
264
|
): UnaryResponse;
|
|
265
|
+
getDataContractHistory(
|
|
266
|
+
requestMessage: platform_pb.GetDataContractHistoryRequest,
|
|
267
|
+
metadata: grpc.Metadata,
|
|
268
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractHistoryResponse|null) => void
|
|
269
|
+
): UnaryResponse;
|
|
270
|
+
getDataContractHistory(
|
|
271
|
+
requestMessage: platform_pb.GetDataContractHistoryRequest,
|
|
272
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractHistoryResponse|null) => void
|
|
273
|
+
): UnaryResponse;
|
|
255
274
|
getDataContracts(
|
|
256
275
|
requestMessage: platform_pb.GetDataContractsRequest,
|
|
257
276
|
metadata: grpc.Metadata,
|
|
@@ -82,6 +82,15 @@ Platform.getDataContract = {
|
|
|
82
82
|
responseType: platform_pb.GetDataContractResponse
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
+
Platform.getDataContractHistory = {
|
|
86
|
+
methodName: "getDataContractHistory",
|
|
87
|
+
service: Platform,
|
|
88
|
+
requestStream: false,
|
|
89
|
+
responseStream: false,
|
|
90
|
+
requestType: platform_pb.GetDataContractHistoryRequest,
|
|
91
|
+
responseType: platform_pb.GetDataContractHistoryResponse
|
|
92
|
+
};
|
|
93
|
+
|
|
85
94
|
Platform.getDataContracts = {
|
|
86
95
|
methodName: "getDataContracts",
|
|
87
96
|
service: Platform,
|
|
@@ -391,6 +400,37 @@ PlatformClient.prototype.getDataContract = function getDataContract(requestMessa
|
|
|
391
400
|
};
|
|
392
401
|
};
|
|
393
402
|
|
|
403
|
+
PlatformClient.prototype.getDataContractHistory = function getDataContractHistory(requestMessage, metadata, callback) {
|
|
404
|
+
if (arguments.length === 2) {
|
|
405
|
+
callback = arguments[1];
|
|
406
|
+
}
|
|
407
|
+
var client = grpc.unary(Platform.getDataContractHistory, {
|
|
408
|
+
request: requestMessage,
|
|
409
|
+
host: this.serviceHost,
|
|
410
|
+
metadata: metadata,
|
|
411
|
+
transport: this.options.transport,
|
|
412
|
+
debug: this.options.debug,
|
|
413
|
+
onEnd: function (response) {
|
|
414
|
+
if (callback) {
|
|
415
|
+
if (response.status !== grpc.Code.OK) {
|
|
416
|
+
var err = new Error(response.statusMessage);
|
|
417
|
+
err.code = response.status;
|
|
418
|
+
err.metadata = response.trailers;
|
|
419
|
+
callback(err, null);
|
|
420
|
+
} else {
|
|
421
|
+
callback(null, response.message);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
return {
|
|
427
|
+
cancel: function () {
|
|
428
|
+
callback = null;
|
|
429
|
+
client.close();
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
};
|
|
433
|
+
|
|
394
434
|
PlatformClient.prototype.getDataContracts = function getDataContracts(requestMessage, metadata, callback) {
|
|
395
435
|
if (arguments.length === 2) {
|
|
396
436
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "0.25.0-dev.
|
|
3
|
+
"version": "0.25.0-dev.17",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@dashevo/grpc-common": "0.25.0-dev.
|
|
48
|
+
"@dashevo/grpc-common": "0.25.0-dev.17",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "^1.3.7",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -17,6 +17,7 @@ service Platform {
|
|
|
17
17
|
returns (GetIdentityBalanceAndRevisionResponse);
|
|
18
18
|
rpc getProofs (GetProofsRequest) returns (GetProofsResponse);
|
|
19
19
|
rpc getDataContract (GetDataContractRequest) returns (GetDataContractResponse);
|
|
20
|
+
rpc getDataContractHistory (GetDataContractHistoryRequest) returns (GetDataContractHistoryResponse);
|
|
20
21
|
rpc getDataContracts (GetDataContractsRequest) returns (GetDataContractsResponse);
|
|
21
22
|
rpc getDocuments (GetDocumentsRequest) returns (GetDocumentsResponse);
|
|
22
23
|
rpc getIdentitiesByPublicKeyHashes (GetIdentitiesByPublicKeyHashesRequest) returns (GetIdentitiesByPublicKeyHashesResponse);
|
|
@@ -30,6 +31,8 @@ message Proof {
|
|
|
30
31
|
bytes quorum_hash = 2;
|
|
31
32
|
bytes signature = 3;
|
|
32
33
|
uint32 round = 4;
|
|
34
|
+
bytes block_id_hash = 5;
|
|
35
|
+
uint32 quorum_type = 6;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
message ResponseMetadata {
|
|
@@ -37,6 +40,7 @@ message ResponseMetadata {
|
|
|
37
40
|
uint32 core_chain_locked_height = 2;
|
|
38
41
|
uint64 time_ms = 3;
|
|
39
42
|
uint32 protocol_version = 4;
|
|
43
|
+
string chain_id = 5;
|
|
40
44
|
}
|
|
41
45
|
|
|
42
46
|
message StateTransitionBroadcastError {
|
|
@@ -59,8 +63,10 @@ message GetIdentityRequest {
|
|
|
59
63
|
}
|
|
60
64
|
|
|
61
65
|
message GetIdentityResponse {
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
oneof result {
|
|
67
|
+
bytes identity = 1;
|
|
68
|
+
Proof proof = 2;
|
|
69
|
+
}
|
|
64
70
|
ResponseMetadata metadata = 3;
|
|
65
71
|
}
|
|
66
72
|
|
|
@@ -91,16 +97,24 @@ message GetIdentitiesResponse {
|
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
message GetIdentityBalanceResponse {
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
oneof result {
|
|
101
|
+
google.protobuf.UInt64Value balance = 1;
|
|
102
|
+
Proof proof = 2;
|
|
103
|
+
}
|
|
96
104
|
ResponseMetadata metadata = 3;
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
message GetIdentityBalanceAndRevisionResponse {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
message BalanceAndRevision {
|
|
109
|
+
google.protobuf.UInt64Value balance = 1;
|
|
110
|
+
google.protobuf.UInt64Value revision = 2;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
oneof result {
|
|
114
|
+
BalanceAndRevision balance_and_revision = 1;
|
|
115
|
+
Proof proof = 2;
|
|
116
|
+
}
|
|
117
|
+
ResponseMetadata metadata = 3;
|
|
104
118
|
}
|
|
105
119
|
|
|
106
120
|
message KeyRequestType {
|
|
@@ -224,8 +238,10 @@ message GetDataContractRequest {
|
|
|
224
238
|
}
|
|
225
239
|
|
|
226
240
|
message GetDataContractResponse {
|
|
227
|
-
|
|
228
|
-
|
|
241
|
+
oneof result {
|
|
242
|
+
bytes data_contract = 1;
|
|
243
|
+
Proof proof = 2;
|
|
244
|
+
}
|
|
229
245
|
ResponseMetadata metadata = 3;
|
|
230
246
|
}
|
|
231
247
|
|
|
@@ -254,6 +270,33 @@ message GetDataContractsResponse {
|
|
|
254
270
|
}
|
|
255
271
|
ResponseMetadata metadata = 3;
|
|
256
272
|
}
|
|
273
|
+
|
|
274
|
+
message GetDataContractHistoryRequest {
|
|
275
|
+
bytes id = 1;
|
|
276
|
+
google.protobuf.UInt32Value limit = 2;
|
|
277
|
+
google.protobuf.UInt32Value offset = 3;
|
|
278
|
+
uint64 start_at_ms = 4;
|
|
279
|
+
bool prove = 5;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
message GetDataContractHistoryResponse {
|
|
283
|
+
message DataContractHistoryEntry {
|
|
284
|
+
uint64 date = 1;
|
|
285
|
+
bytes value = 2;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
message DataContractHistory {
|
|
289
|
+
repeated DataContractHistoryEntry data_contract_entries = 1;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
oneof result {
|
|
293
|
+
DataContractHistory data_contract_history = 1;
|
|
294
|
+
Proof proof = 2;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
ResponseMetadata metadata = 3;
|
|
298
|
+
}
|
|
299
|
+
|
|
257
300
|
message GetDocumentsRequest {
|
|
258
301
|
bytes data_contract_id = 1;
|
|
259
302
|
string document_type = 2;
|
|
@@ -272,8 +315,14 @@ message GetDocumentsRequest {
|
|
|
272
315
|
}
|
|
273
316
|
|
|
274
317
|
message GetDocumentsResponse {
|
|
275
|
-
|
|
276
|
-
|
|
318
|
+
message Documents {
|
|
319
|
+
repeated bytes documents = 1;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
oneof result {
|
|
323
|
+
Documents documents = 1;
|
|
324
|
+
Proof proof = 2;
|
|
325
|
+
}
|
|
277
326
|
ResponseMetadata metadata = 3;
|
|
278
327
|
}
|
|
279
328
|
|
|
@@ -283,8 +332,14 @@ message GetIdentitiesByPublicKeyHashesRequest {
|
|
|
283
332
|
}
|
|
284
333
|
|
|
285
334
|
message GetIdentitiesByPublicKeyHashesResponse {
|
|
286
|
-
|
|
287
|
-
|
|
335
|
+
message Identities {
|
|
336
|
+
repeated bytes identities = 1;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
oneof result {
|
|
340
|
+
Identities identities = 1;
|
|
341
|
+
Proof proof = 2;
|
|
342
|
+
}
|
|
288
343
|
ResponseMetadata metadata = 3;
|
|
289
344
|
}
|
|
290
345
|
|
|
@@ -307,7 +362,7 @@ message WaitForStateTransitionResultRequest {
|
|
|
307
362
|
}
|
|
308
363
|
|
|
309
364
|
message WaitForStateTransitionResultResponse {
|
|
310
|
-
oneof
|
|
365
|
+
oneof result {
|
|
311
366
|
StateTransitionBroadcastError error = 1;
|
|
312
367
|
Proof proof = 2;
|
|
313
368
|
}
|