@dashevo/dapi-grpc 4.2.0-dev.10 → 4.2.0-dev.11
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/build.rs +5 -2
- package/clients/drive/v0/nodejs/drive_pbjs.js +2112 -123
- package/clients/platform/v0/nodejs/platform_pbjs.js +2112 -123
- package/clients/platform/v0/nodejs/platform_protoc.js +2107 -67
- package/clients/platform/v0/web/platform_pb.d.ts +268 -0
- package/clients/platform/v0/web/platform_pb.js +2107 -67
- package/clients/platform/v0/web/platform_pb_service.d.ts +38 -0
- package/clients/platform/v0/web/platform_pb_service.js +80 -0
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +77 -0
|
@@ -121,6 +121,15 @@ type PlatformgetDataContractHistory = {
|
|
|
121
121
|
readonly responseType: typeof platform_pb.GetDataContractHistoryResponse;
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
+
type PlatformgetDataContractsLatestVersions = {
|
|
125
|
+
readonly methodName: string;
|
|
126
|
+
readonly service: typeof Platform;
|
|
127
|
+
readonly requestStream: false;
|
|
128
|
+
readonly responseStream: false;
|
|
129
|
+
readonly requestType: typeof platform_pb.GetDataContractsLatestVersionsRequest;
|
|
130
|
+
readonly responseType: typeof platform_pb.GetDataContractsLatestVersionsResponse;
|
|
131
|
+
};
|
|
132
|
+
|
|
124
133
|
type PlatformgetDataContracts = {
|
|
125
134
|
readonly methodName: string;
|
|
126
135
|
readonly service: typeof Platform;
|
|
@@ -130,6 +139,15 @@ type PlatformgetDataContracts = {
|
|
|
130
139
|
readonly responseType: typeof platform_pb.GetDataContractsResponse;
|
|
131
140
|
};
|
|
132
141
|
|
|
142
|
+
type PlatformgetDataContractsByRange = {
|
|
143
|
+
readonly methodName: string;
|
|
144
|
+
readonly service: typeof Platform;
|
|
145
|
+
readonly requestStream: false;
|
|
146
|
+
readonly responseStream: false;
|
|
147
|
+
readonly requestType: typeof platform_pb.GetDataContractsByRangeRequest;
|
|
148
|
+
readonly responseType: typeof platform_pb.GetDataContractsResponse;
|
|
149
|
+
};
|
|
150
|
+
|
|
133
151
|
type PlatformgetDocumentHistory = {
|
|
134
152
|
readonly methodName: string;
|
|
135
153
|
readonly service: typeof Platform;
|
|
@@ -559,7 +577,9 @@ export class Platform {
|
|
|
559
577
|
static readonly getEvonodesProposedEpochBlocksByRange: PlatformgetEvonodesProposedEpochBlocksByRange;
|
|
560
578
|
static readonly getDataContract: PlatformgetDataContract;
|
|
561
579
|
static readonly getDataContractHistory: PlatformgetDataContractHistory;
|
|
580
|
+
static readonly getDataContractsLatestVersions: PlatformgetDataContractsLatestVersions;
|
|
562
581
|
static readonly getDataContracts: PlatformgetDataContracts;
|
|
582
|
+
static readonly getDataContractsByRange: PlatformgetDataContractsByRange;
|
|
563
583
|
static readonly getDocumentHistory: PlatformgetDocumentHistory;
|
|
564
584
|
static readonly getDocuments: PlatformgetDocuments;
|
|
565
585
|
static readonly getIdentityByPublicKeyHash: PlatformgetIdentityByPublicKeyHash;
|
|
@@ -757,6 +777,15 @@ export class PlatformClient {
|
|
|
757
777
|
requestMessage: platform_pb.GetDataContractHistoryRequest,
|
|
758
778
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractHistoryResponse|null) => void
|
|
759
779
|
): UnaryResponse;
|
|
780
|
+
getDataContractsLatestVersions(
|
|
781
|
+
requestMessage: platform_pb.GetDataContractsLatestVersionsRequest,
|
|
782
|
+
metadata: grpc.Metadata,
|
|
783
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsLatestVersionsResponse|null) => void
|
|
784
|
+
): UnaryResponse;
|
|
785
|
+
getDataContractsLatestVersions(
|
|
786
|
+
requestMessage: platform_pb.GetDataContractsLatestVersionsRequest,
|
|
787
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsLatestVersionsResponse|null) => void
|
|
788
|
+
): UnaryResponse;
|
|
760
789
|
getDataContracts(
|
|
761
790
|
requestMessage: platform_pb.GetDataContractsRequest,
|
|
762
791
|
metadata: grpc.Metadata,
|
|
@@ -766,6 +795,15 @@ export class PlatformClient {
|
|
|
766
795
|
requestMessage: platform_pb.GetDataContractsRequest,
|
|
767
796
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
|
|
768
797
|
): UnaryResponse;
|
|
798
|
+
getDataContractsByRange(
|
|
799
|
+
requestMessage: platform_pb.GetDataContractsByRangeRequest,
|
|
800
|
+
metadata: grpc.Metadata,
|
|
801
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
|
|
802
|
+
): UnaryResponse;
|
|
803
|
+
getDataContractsByRange(
|
|
804
|
+
requestMessage: platform_pb.GetDataContractsByRangeRequest,
|
|
805
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
|
|
806
|
+
): UnaryResponse;
|
|
769
807
|
getDocumentHistory(
|
|
770
808
|
requestMessage: platform_pb.GetDocumentHistoryRequest,
|
|
771
809
|
metadata: grpc.Metadata,
|
|
@@ -127,6 +127,15 @@ Platform.getDataContractHistory = {
|
|
|
127
127
|
responseType: platform_pb.GetDataContractHistoryResponse
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
+
Platform.getDataContractsLatestVersions = {
|
|
131
|
+
methodName: "getDataContractsLatestVersions",
|
|
132
|
+
service: Platform,
|
|
133
|
+
requestStream: false,
|
|
134
|
+
responseStream: false,
|
|
135
|
+
requestType: platform_pb.GetDataContractsLatestVersionsRequest,
|
|
136
|
+
responseType: platform_pb.GetDataContractsLatestVersionsResponse
|
|
137
|
+
};
|
|
138
|
+
|
|
130
139
|
Platform.getDataContracts = {
|
|
131
140
|
methodName: "getDataContracts",
|
|
132
141
|
service: Platform,
|
|
@@ -136,6 +145,15 @@ Platform.getDataContracts = {
|
|
|
136
145
|
responseType: platform_pb.GetDataContractsResponse
|
|
137
146
|
};
|
|
138
147
|
|
|
148
|
+
Platform.getDataContractsByRange = {
|
|
149
|
+
methodName: "getDataContractsByRange",
|
|
150
|
+
service: Platform,
|
|
151
|
+
requestStream: false,
|
|
152
|
+
responseStream: false,
|
|
153
|
+
requestType: platform_pb.GetDataContractsByRangeRequest,
|
|
154
|
+
responseType: platform_pb.GetDataContractsResponse
|
|
155
|
+
};
|
|
156
|
+
|
|
139
157
|
Platform.getDocumentHistory = {
|
|
140
158
|
methodName: "getDocumentHistory",
|
|
141
159
|
service: Platform,
|
|
@@ -960,6 +978,37 @@ PlatformClient.prototype.getDataContractHistory = function getDataContractHistor
|
|
|
960
978
|
};
|
|
961
979
|
};
|
|
962
980
|
|
|
981
|
+
PlatformClient.prototype.getDataContractsLatestVersions = function getDataContractsLatestVersions(requestMessage, metadata, callback) {
|
|
982
|
+
if (arguments.length === 2) {
|
|
983
|
+
callback = arguments[1];
|
|
984
|
+
}
|
|
985
|
+
var client = grpc.unary(Platform.getDataContractsLatestVersions, {
|
|
986
|
+
request: requestMessage,
|
|
987
|
+
host: this.serviceHost,
|
|
988
|
+
metadata: metadata,
|
|
989
|
+
transport: this.options.transport,
|
|
990
|
+
debug: this.options.debug,
|
|
991
|
+
onEnd: function (response) {
|
|
992
|
+
if (callback) {
|
|
993
|
+
if (response.status !== grpc.Code.OK) {
|
|
994
|
+
var err = new Error(response.statusMessage);
|
|
995
|
+
err.code = response.status;
|
|
996
|
+
err.metadata = response.trailers;
|
|
997
|
+
callback(err, null);
|
|
998
|
+
} else {
|
|
999
|
+
callback(null, response.message);
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
});
|
|
1004
|
+
return {
|
|
1005
|
+
cancel: function () {
|
|
1006
|
+
callback = null;
|
|
1007
|
+
client.close();
|
|
1008
|
+
}
|
|
1009
|
+
};
|
|
1010
|
+
};
|
|
1011
|
+
|
|
963
1012
|
PlatformClient.prototype.getDataContracts = function getDataContracts(requestMessage, metadata, callback) {
|
|
964
1013
|
if (arguments.length === 2) {
|
|
965
1014
|
callback = arguments[1];
|
|
@@ -991,6 +1040,37 @@ PlatformClient.prototype.getDataContracts = function getDataContracts(requestMes
|
|
|
991
1040
|
};
|
|
992
1041
|
};
|
|
993
1042
|
|
|
1043
|
+
PlatformClient.prototype.getDataContractsByRange = function getDataContractsByRange(requestMessage, metadata, callback) {
|
|
1044
|
+
if (arguments.length === 2) {
|
|
1045
|
+
callback = arguments[1];
|
|
1046
|
+
}
|
|
1047
|
+
var client = grpc.unary(Platform.getDataContractsByRange, {
|
|
1048
|
+
request: requestMessage,
|
|
1049
|
+
host: this.serviceHost,
|
|
1050
|
+
metadata: metadata,
|
|
1051
|
+
transport: this.options.transport,
|
|
1052
|
+
debug: this.options.debug,
|
|
1053
|
+
onEnd: function (response) {
|
|
1054
|
+
if (callback) {
|
|
1055
|
+
if (response.status !== grpc.Code.OK) {
|
|
1056
|
+
var err = new Error(response.statusMessage);
|
|
1057
|
+
err.code = response.status;
|
|
1058
|
+
err.metadata = response.trailers;
|
|
1059
|
+
callback(err, null);
|
|
1060
|
+
} else {
|
|
1061
|
+
callback(null, response.message);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
return {
|
|
1067
|
+
cancel: function () {
|
|
1068
|
+
callback = null;
|
|
1069
|
+
client.close();
|
|
1070
|
+
}
|
|
1071
|
+
};
|
|
1072
|
+
};
|
|
1073
|
+
|
|
994
1074
|
PlatformClient.prototype.getDocumentHistory = function getDocumentHistory(requestMessage, metadata, callback) {
|
|
995
1075
|
if (arguments.length === 2) {
|
|
996
1076
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "4.2.0-dev.
|
|
3
|
+
"version": "4.2.0-dev.11",
|
|
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": "4.2.0-dev.
|
|
48
|
+
"@dashevo/grpc-common": "4.2.0-dev.11",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "^1.14.3",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -33,8 +33,12 @@ service Platform {
|
|
|
33
33
|
rpc getDataContract(GetDataContractRequest) returns (GetDataContractResponse);
|
|
34
34
|
rpc getDataContractHistory(GetDataContractHistoryRequest)
|
|
35
35
|
returns (GetDataContractHistoryResponse);
|
|
36
|
+
rpc getDataContractsLatestVersions(GetDataContractsLatestVersionsRequest)
|
|
37
|
+
returns (GetDataContractsLatestVersionsResponse);
|
|
36
38
|
rpc getDataContracts(GetDataContractsRequest)
|
|
37
39
|
returns (GetDataContractsResponse);
|
|
40
|
+
rpc getDataContractsByRange(GetDataContractsByRangeRequest)
|
|
41
|
+
returns (GetDataContractsResponse);
|
|
38
42
|
rpc getDocumentHistory(GetDocumentHistoryRequest)
|
|
39
43
|
returns (GetDocumentHistoryResponse);
|
|
40
44
|
rpc getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
|
|
@@ -497,6 +501,57 @@ message GetDataContractResponse {
|
|
|
497
501
|
oneof version { GetDataContractResponseV0 v0 = 1; }
|
|
498
502
|
}
|
|
499
503
|
|
|
504
|
+
// Returns the current version number of each requested data contract: the
|
|
505
|
+
// cheap way for a client to check that the contracts it already holds are
|
|
506
|
+
// still current. Every distinct requested id gets an entry; an id no contract has gets
|
|
507
|
+
// an entry without `version`. Serialized contracts are added only when
|
|
508
|
+
// `include_contracts` is set.
|
|
509
|
+
//
|
|
510
|
+
// From protocol version 14 every contract carries a four-byte version item
|
|
511
|
+
// beside it in state. Without `include_contracts`, the unproved form answers
|
|
512
|
+
// from Drive's contract cache or that item without loading a contract, and
|
|
513
|
+
// the proof covers the items, a few hundred bytes of hash path per contract.
|
|
514
|
+
// With `include_contracts`, and on earlier protocol versions, the unproved
|
|
515
|
+
// form reads the contracts through the cache and the proof is the
|
|
516
|
+
// multi-contract proof `getDataContracts` returns, which carries the
|
|
517
|
+
// contracts.
|
|
518
|
+
message GetDataContractsLatestVersionsRequest {
|
|
519
|
+
message GetDataContractsLatestVersionsRequestV0 {
|
|
520
|
+
repeated bytes ids =
|
|
521
|
+
1; // The IDs of the data contracts, at least one and at most 100
|
|
522
|
+
bool include_contracts =
|
|
523
|
+
2; // When set, found entries also carry the serialized contract
|
|
524
|
+
bool prove = 3; // Flag to request a proof as the response
|
|
525
|
+
}
|
|
526
|
+
oneof version { GetDataContractsLatestVersionsRequestV0 v0 = 1; }
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
message GetDataContractsLatestVersionsResponse {
|
|
530
|
+
message DataContractLatestVersionEntry {
|
|
531
|
+
bytes identifier = 1; // The requested contract id
|
|
532
|
+
optional uint32 version =
|
|
533
|
+
2; // The contract's current version number; absent when no contract has this id
|
|
534
|
+
optional bytes data_contract =
|
|
535
|
+
3; // The serialized contract, only when `include_contracts` was set and the contract exists
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
message DataContractsLatestVersions {
|
|
539
|
+
repeated DataContractLatestVersionEntry entries =
|
|
540
|
+
1; // One entry per requested contract id
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
message GetDataContractsLatestVersionsResponseV0 {
|
|
544
|
+
oneof result {
|
|
545
|
+
DataContractsLatestVersions data_contracts_latest_versions =
|
|
546
|
+
1; // The current versions, and the contracts if requested
|
|
547
|
+
Proof proof =
|
|
548
|
+
2; // Cryptographic proof of the data contracts, if requested
|
|
549
|
+
}
|
|
550
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
551
|
+
}
|
|
552
|
+
oneof version { GetDataContractsLatestVersionsResponseV0 v0 = 1; }
|
|
553
|
+
}
|
|
554
|
+
|
|
500
555
|
message GetDataContractsRequest {
|
|
501
556
|
message GetDataContractsRequestV0 {
|
|
502
557
|
repeated bytes ids =
|
|
@@ -506,6 +561,28 @@ message GetDataContractsRequest {
|
|
|
506
561
|
oneof version { GetDataContractsRequestV0 v0 = 1; }
|
|
507
562
|
}
|
|
508
563
|
|
|
564
|
+
// Enumerates every data contract on Platform, one page at a time, in
|
|
565
|
+
// ascending contract id order. Answered with `GetDataContractsResponse`:
|
|
566
|
+
// each `DataContractEntry` carries the contract id and, unless `ids_only`
|
|
567
|
+
// is set, the serialized contract. An empty page (no more contracts) is an
|
|
568
|
+
// empty `data_contract_entries` list, never NotFound. A page shorter than
|
|
569
|
+
// `limit` is the last page; otherwise pass the last entry's identifier as
|
|
570
|
+
// `start_after` to fetch the next one.
|
|
571
|
+
message GetDataContractsByRangeRequest {
|
|
572
|
+
message GetDataContractsByRangeRequestV0 {
|
|
573
|
+
optional uint32 limit =
|
|
574
|
+
1; // Maximum number of contracts to return, 1..=100; absent means 100
|
|
575
|
+
oneof start {
|
|
576
|
+
bytes start_after = 2; // 32-byte contract id; the page starts after it
|
|
577
|
+
bytes start_at = 3; // 32-byte contract id; the page starts at it
|
|
578
|
+
}
|
|
579
|
+
bool ids_only =
|
|
580
|
+
4; // When set, entries carry only `identifier`; `data_contract` is unset
|
|
581
|
+
bool prove = 5; // Flag to request a proof as the response
|
|
582
|
+
}
|
|
583
|
+
oneof version { GetDataContractsByRangeRequestV0 v0 = 1; }
|
|
584
|
+
}
|
|
585
|
+
|
|
509
586
|
message GetDataContractsResponse {
|
|
510
587
|
message DataContractEntry {
|
|
511
588
|
bytes identifier = 1; // The unique identifier of the data contract
|