@dashevo/dapi-grpc 0.25.0-dev.9 → 0.25.0
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 +44 -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 +39 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +13976 -1484
- package/clients/platform/v0/nodejs/platform_protoc.js +11116 -1468
- package/clients/platform/v0/rust/README.md +3 -0
- package/clients/platform/v0/rust/platform_example.rs +15 -0
- package/clients/platform/v0/web/PlatformPromiseClient.js +15 -0
- package/clients/platform/v0/web/platform_pb.d.ts +1278 -22
- package/clients/platform/v0/web/platform_pb.js +11116 -1468
- package/clients/platform/v0/web/platform_pb_service.d.ts +152 -0
- package/clients/platform/v0/web/platform_pb_service.js +320 -0
- package/package.json +16 -4
- package/protos/platform/v0/platform.proto +274 -16
- 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 +1324 -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
|
@@ -22,6 +22,51 @@ type PlatformgetIdentity = {
|
|
|
22
22
|
readonly responseType: typeof platform_pb.GetIdentityResponse;
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
+
type PlatformgetIdentities = {
|
|
26
|
+
readonly methodName: string;
|
|
27
|
+
readonly service: typeof Platform;
|
|
28
|
+
readonly requestStream: false;
|
|
29
|
+
readonly responseStream: false;
|
|
30
|
+
readonly requestType: typeof platform_pb.GetIdentitiesRequest;
|
|
31
|
+
readonly responseType: typeof platform_pb.GetIdentitiesResponse;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type PlatformgetIdentityKeys = {
|
|
35
|
+
readonly methodName: string;
|
|
36
|
+
readonly service: typeof Platform;
|
|
37
|
+
readonly requestStream: false;
|
|
38
|
+
readonly responseStream: false;
|
|
39
|
+
readonly requestType: typeof platform_pb.GetIdentityKeysRequest;
|
|
40
|
+
readonly responseType: typeof platform_pb.GetIdentityKeysResponse;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
type PlatformgetIdentityBalance = {
|
|
44
|
+
readonly methodName: string;
|
|
45
|
+
readonly service: typeof Platform;
|
|
46
|
+
readonly requestStream: false;
|
|
47
|
+
readonly responseStream: false;
|
|
48
|
+
readonly requestType: typeof platform_pb.GetIdentityRequest;
|
|
49
|
+
readonly responseType: typeof platform_pb.GetIdentityBalanceResponse;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type PlatformgetIdentityBalanceAndRevision = {
|
|
53
|
+
readonly methodName: string;
|
|
54
|
+
readonly service: typeof Platform;
|
|
55
|
+
readonly requestStream: false;
|
|
56
|
+
readonly responseStream: false;
|
|
57
|
+
readonly requestType: typeof platform_pb.GetIdentityRequest;
|
|
58
|
+
readonly responseType: typeof platform_pb.GetIdentityBalanceAndRevisionResponse;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type PlatformgetProofs = {
|
|
62
|
+
readonly methodName: string;
|
|
63
|
+
readonly service: typeof Platform;
|
|
64
|
+
readonly requestStream: false;
|
|
65
|
+
readonly responseStream: false;
|
|
66
|
+
readonly requestType: typeof platform_pb.GetProofsRequest;
|
|
67
|
+
readonly responseType: typeof platform_pb.GetProofsResponse;
|
|
68
|
+
};
|
|
69
|
+
|
|
25
70
|
type PlatformgetDataContract = {
|
|
26
71
|
readonly methodName: string;
|
|
27
72
|
readonly service: typeof Platform;
|
|
@@ -31,6 +76,24 @@ type PlatformgetDataContract = {
|
|
|
31
76
|
readonly responseType: typeof platform_pb.GetDataContractResponse;
|
|
32
77
|
};
|
|
33
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
|
+
|
|
88
|
+
type PlatformgetDataContracts = {
|
|
89
|
+
readonly methodName: string;
|
|
90
|
+
readonly service: typeof Platform;
|
|
91
|
+
readonly requestStream: false;
|
|
92
|
+
readonly responseStream: false;
|
|
93
|
+
readonly requestType: typeof platform_pb.GetDataContractsRequest;
|
|
94
|
+
readonly responseType: typeof platform_pb.GetDataContractsResponse;
|
|
95
|
+
};
|
|
96
|
+
|
|
34
97
|
type PlatformgetDocuments = {
|
|
35
98
|
readonly methodName: string;
|
|
36
99
|
readonly service: typeof Platform;
|
|
@@ -49,6 +112,15 @@ type PlatformgetIdentitiesByPublicKeyHashes = {
|
|
|
49
112
|
readonly responseType: typeof platform_pb.GetIdentitiesByPublicKeyHashesResponse;
|
|
50
113
|
};
|
|
51
114
|
|
|
115
|
+
type PlatformgetIdentityByPublicKeyHashes = {
|
|
116
|
+
readonly methodName: string;
|
|
117
|
+
readonly service: typeof Platform;
|
|
118
|
+
readonly requestStream: false;
|
|
119
|
+
readonly responseStream: false;
|
|
120
|
+
readonly requestType: typeof platform_pb.GetIdentityByPublicKeyHashesRequest;
|
|
121
|
+
readonly responseType: typeof platform_pb.GetIdentityByPublicKeyHashesResponse;
|
|
122
|
+
};
|
|
123
|
+
|
|
52
124
|
type PlatformwaitForStateTransitionResult = {
|
|
53
125
|
readonly methodName: string;
|
|
54
126
|
readonly service: typeof Platform;
|
|
@@ -71,9 +143,17 @@ export class Platform {
|
|
|
71
143
|
static readonly serviceName: string;
|
|
72
144
|
static readonly broadcastStateTransition: PlatformbroadcastStateTransition;
|
|
73
145
|
static readonly getIdentity: PlatformgetIdentity;
|
|
146
|
+
static readonly getIdentities: PlatformgetIdentities;
|
|
147
|
+
static readonly getIdentityKeys: PlatformgetIdentityKeys;
|
|
148
|
+
static readonly getIdentityBalance: PlatformgetIdentityBalance;
|
|
149
|
+
static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision;
|
|
150
|
+
static readonly getProofs: PlatformgetProofs;
|
|
74
151
|
static readonly getDataContract: PlatformgetDataContract;
|
|
152
|
+
static readonly getDataContractHistory: PlatformgetDataContractHistory;
|
|
153
|
+
static readonly getDataContracts: PlatformgetDataContracts;
|
|
75
154
|
static readonly getDocuments: PlatformgetDocuments;
|
|
76
155
|
static readonly getIdentitiesByPublicKeyHashes: PlatformgetIdentitiesByPublicKeyHashes;
|
|
156
|
+
static readonly getIdentityByPublicKeyHashes: PlatformgetIdentityByPublicKeyHashes;
|
|
77
157
|
static readonly waitForStateTransitionResult: PlatformwaitForStateTransitionResult;
|
|
78
158
|
static readonly getConsensusParams: PlatformgetConsensusParams;
|
|
79
159
|
}
|
|
@@ -128,6 +208,51 @@ export class PlatformClient {
|
|
|
128
208
|
requestMessage: platform_pb.GetIdentityRequest,
|
|
129
209
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void
|
|
130
210
|
): UnaryResponse;
|
|
211
|
+
getIdentities(
|
|
212
|
+
requestMessage: platform_pb.GetIdentitiesRequest,
|
|
213
|
+
metadata: grpc.Metadata,
|
|
214
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesResponse|null) => void
|
|
215
|
+
): UnaryResponse;
|
|
216
|
+
getIdentities(
|
|
217
|
+
requestMessage: platform_pb.GetIdentitiesRequest,
|
|
218
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesResponse|null) => void
|
|
219
|
+
): UnaryResponse;
|
|
220
|
+
getIdentityKeys(
|
|
221
|
+
requestMessage: platform_pb.GetIdentityKeysRequest,
|
|
222
|
+
metadata: grpc.Metadata,
|
|
223
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void
|
|
224
|
+
): UnaryResponse;
|
|
225
|
+
getIdentityKeys(
|
|
226
|
+
requestMessage: platform_pb.GetIdentityKeysRequest,
|
|
227
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void
|
|
228
|
+
): UnaryResponse;
|
|
229
|
+
getIdentityBalance(
|
|
230
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
231
|
+
metadata: grpc.Metadata,
|
|
232
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void
|
|
233
|
+
): UnaryResponse;
|
|
234
|
+
getIdentityBalance(
|
|
235
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
236
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void
|
|
237
|
+
): UnaryResponse;
|
|
238
|
+
getIdentityBalanceAndRevision(
|
|
239
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
240
|
+
metadata: grpc.Metadata,
|
|
241
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void
|
|
242
|
+
): UnaryResponse;
|
|
243
|
+
getIdentityBalanceAndRevision(
|
|
244
|
+
requestMessage: platform_pb.GetIdentityRequest,
|
|
245
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void
|
|
246
|
+
): UnaryResponse;
|
|
247
|
+
getProofs(
|
|
248
|
+
requestMessage: platform_pb.GetProofsRequest,
|
|
249
|
+
metadata: grpc.Metadata,
|
|
250
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetProofsResponse|null) => void
|
|
251
|
+
): UnaryResponse;
|
|
252
|
+
getProofs(
|
|
253
|
+
requestMessage: platform_pb.GetProofsRequest,
|
|
254
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetProofsResponse|null) => void
|
|
255
|
+
): UnaryResponse;
|
|
131
256
|
getDataContract(
|
|
132
257
|
requestMessage: platform_pb.GetDataContractRequest,
|
|
133
258
|
metadata: grpc.Metadata,
|
|
@@ -137,6 +262,24 @@ export class PlatformClient {
|
|
|
137
262
|
requestMessage: platform_pb.GetDataContractRequest,
|
|
138
263
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
|
|
139
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;
|
|
274
|
+
getDataContracts(
|
|
275
|
+
requestMessage: platform_pb.GetDataContractsRequest,
|
|
276
|
+
metadata: grpc.Metadata,
|
|
277
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
|
|
278
|
+
): UnaryResponse;
|
|
279
|
+
getDataContracts(
|
|
280
|
+
requestMessage: platform_pb.GetDataContractsRequest,
|
|
281
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
|
|
282
|
+
): UnaryResponse;
|
|
140
283
|
getDocuments(
|
|
141
284
|
requestMessage: platform_pb.GetDocumentsRequest,
|
|
142
285
|
metadata: grpc.Metadata,
|
|
@@ -155,6 +298,15 @@ export class PlatformClient {
|
|
|
155
298
|
requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
|
|
156
299
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void
|
|
157
300
|
): UnaryResponse;
|
|
301
|
+
getIdentityByPublicKeyHashes(
|
|
302
|
+
requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest,
|
|
303
|
+
metadata: grpc.Metadata,
|
|
304
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void
|
|
305
|
+
): UnaryResponse;
|
|
306
|
+
getIdentityByPublicKeyHashes(
|
|
307
|
+
requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest,
|
|
308
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void
|
|
309
|
+
): UnaryResponse;
|
|
158
310
|
waitForStateTransitionResult(
|
|
159
311
|
requestMessage: platform_pb.WaitForStateTransitionResultRequest,
|
|
160
312
|
metadata: grpc.Metadata,
|
|
@@ -28,6 +28,51 @@ Platform.getIdentity = {
|
|
|
28
28
|
responseType: platform_pb.GetIdentityResponse
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
+
Platform.getIdentities = {
|
|
32
|
+
methodName: "getIdentities",
|
|
33
|
+
service: Platform,
|
|
34
|
+
requestStream: false,
|
|
35
|
+
responseStream: false,
|
|
36
|
+
requestType: platform_pb.GetIdentitiesRequest,
|
|
37
|
+
responseType: platform_pb.GetIdentitiesResponse
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
Platform.getIdentityKeys = {
|
|
41
|
+
methodName: "getIdentityKeys",
|
|
42
|
+
service: Platform,
|
|
43
|
+
requestStream: false,
|
|
44
|
+
responseStream: false,
|
|
45
|
+
requestType: platform_pb.GetIdentityKeysRequest,
|
|
46
|
+
responseType: platform_pb.GetIdentityKeysResponse
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
Platform.getIdentityBalance = {
|
|
50
|
+
methodName: "getIdentityBalance",
|
|
51
|
+
service: Platform,
|
|
52
|
+
requestStream: false,
|
|
53
|
+
responseStream: false,
|
|
54
|
+
requestType: platform_pb.GetIdentityRequest,
|
|
55
|
+
responseType: platform_pb.GetIdentityBalanceResponse
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
Platform.getIdentityBalanceAndRevision = {
|
|
59
|
+
methodName: "getIdentityBalanceAndRevision",
|
|
60
|
+
service: Platform,
|
|
61
|
+
requestStream: false,
|
|
62
|
+
responseStream: false,
|
|
63
|
+
requestType: platform_pb.GetIdentityRequest,
|
|
64
|
+
responseType: platform_pb.GetIdentityBalanceAndRevisionResponse
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
Platform.getProofs = {
|
|
68
|
+
methodName: "getProofs",
|
|
69
|
+
service: Platform,
|
|
70
|
+
requestStream: false,
|
|
71
|
+
responseStream: false,
|
|
72
|
+
requestType: platform_pb.GetProofsRequest,
|
|
73
|
+
responseType: platform_pb.GetProofsResponse
|
|
74
|
+
};
|
|
75
|
+
|
|
31
76
|
Platform.getDataContract = {
|
|
32
77
|
methodName: "getDataContract",
|
|
33
78
|
service: Platform,
|
|
@@ -37,6 +82,24 @@ Platform.getDataContract = {
|
|
|
37
82
|
responseType: platform_pb.GetDataContractResponse
|
|
38
83
|
};
|
|
39
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
|
+
|
|
94
|
+
Platform.getDataContracts = {
|
|
95
|
+
methodName: "getDataContracts",
|
|
96
|
+
service: Platform,
|
|
97
|
+
requestStream: false,
|
|
98
|
+
responseStream: false,
|
|
99
|
+
requestType: platform_pb.GetDataContractsRequest,
|
|
100
|
+
responseType: platform_pb.GetDataContractsResponse
|
|
101
|
+
};
|
|
102
|
+
|
|
40
103
|
Platform.getDocuments = {
|
|
41
104
|
methodName: "getDocuments",
|
|
42
105
|
service: Platform,
|
|
@@ -55,6 +118,15 @@ Platform.getIdentitiesByPublicKeyHashes = {
|
|
|
55
118
|
responseType: platform_pb.GetIdentitiesByPublicKeyHashesResponse
|
|
56
119
|
};
|
|
57
120
|
|
|
121
|
+
Platform.getIdentityByPublicKeyHashes = {
|
|
122
|
+
methodName: "getIdentityByPublicKeyHashes",
|
|
123
|
+
service: Platform,
|
|
124
|
+
requestStream: false,
|
|
125
|
+
responseStream: false,
|
|
126
|
+
requestType: platform_pb.GetIdentityByPublicKeyHashesRequest,
|
|
127
|
+
responseType: platform_pb.GetIdentityByPublicKeyHashesResponse
|
|
128
|
+
};
|
|
129
|
+
|
|
58
130
|
Platform.waitForStateTransitionResult = {
|
|
59
131
|
methodName: "waitForStateTransitionResult",
|
|
60
132
|
service: Platform,
|
|
@@ -142,6 +214,161 @@ PlatformClient.prototype.getIdentity = function getIdentity(requestMessage, meta
|
|
|
142
214
|
};
|
|
143
215
|
};
|
|
144
216
|
|
|
217
|
+
PlatformClient.prototype.getIdentities = function getIdentities(requestMessage, metadata, callback) {
|
|
218
|
+
if (arguments.length === 2) {
|
|
219
|
+
callback = arguments[1];
|
|
220
|
+
}
|
|
221
|
+
var client = grpc.unary(Platform.getIdentities, {
|
|
222
|
+
request: requestMessage,
|
|
223
|
+
host: this.serviceHost,
|
|
224
|
+
metadata: metadata,
|
|
225
|
+
transport: this.options.transport,
|
|
226
|
+
debug: this.options.debug,
|
|
227
|
+
onEnd: function (response) {
|
|
228
|
+
if (callback) {
|
|
229
|
+
if (response.status !== grpc.Code.OK) {
|
|
230
|
+
var err = new Error(response.statusMessage);
|
|
231
|
+
err.code = response.status;
|
|
232
|
+
err.metadata = response.trailers;
|
|
233
|
+
callback(err, null);
|
|
234
|
+
} else {
|
|
235
|
+
callback(null, response.message);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
return {
|
|
241
|
+
cancel: function () {
|
|
242
|
+
callback = null;
|
|
243
|
+
client.close();
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
PlatformClient.prototype.getIdentityKeys = function getIdentityKeys(requestMessage, metadata, callback) {
|
|
249
|
+
if (arguments.length === 2) {
|
|
250
|
+
callback = arguments[1];
|
|
251
|
+
}
|
|
252
|
+
var client = grpc.unary(Platform.getIdentityKeys, {
|
|
253
|
+
request: requestMessage,
|
|
254
|
+
host: this.serviceHost,
|
|
255
|
+
metadata: metadata,
|
|
256
|
+
transport: this.options.transport,
|
|
257
|
+
debug: this.options.debug,
|
|
258
|
+
onEnd: function (response) {
|
|
259
|
+
if (callback) {
|
|
260
|
+
if (response.status !== grpc.Code.OK) {
|
|
261
|
+
var err = new Error(response.statusMessage);
|
|
262
|
+
err.code = response.status;
|
|
263
|
+
err.metadata = response.trailers;
|
|
264
|
+
callback(err, null);
|
|
265
|
+
} else {
|
|
266
|
+
callback(null, response.message);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
return {
|
|
272
|
+
cancel: function () {
|
|
273
|
+
callback = null;
|
|
274
|
+
client.close();
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
PlatformClient.prototype.getIdentityBalance = function getIdentityBalance(requestMessage, metadata, callback) {
|
|
280
|
+
if (arguments.length === 2) {
|
|
281
|
+
callback = arguments[1];
|
|
282
|
+
}
|
|
283
|
+
var client = grpc.unary(Platform.getIdentityBalance, {
|
|
284
|
+
request: requestMessage,
|
|
285
|
+
host: this.serviceHost,
|
|
286
|
+
metadata: metadata,
|
|
287
|
+
transport: this.options.transport,
|
|
288
|
+
debug: this.options.debug,
|
|
289
|
+
onEnd: function (response) {
|
|
290
|
+
if (callback) {
|
|
291
|
+
if (response.status !== grpc.Code.OK) {
|
|
292
|
+
var err = new Error(response.statusMessage);
|
|
293
|
+
err.code = response.status;
|
|
294
|
+
err.metadata = response.trailers;
|
|
295
|
+
callback(err, null);
|
|
296
|
+
} else {
|
|
297
|
+
callback(null, response.message);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
return {
|
|
303
|
+
cancel: function () {
|
|
304
|
+
callback = null;
|
|
305
|
+
client.close();
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
PlatformClient.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(requestMessage, metadata, callback) {
|
|
311
|
+
if (arguments.length === 2) {
|
|
312
|
+
callback = arguments[1];
|
|
313
|
+
}
|
|
314
|
+
var client = grpc.unary(Platform.getIdentityBalanceAndRevision, {
|
|
315
|
+
request: requestMessage,
|
|
316
|
+
host: this.serviceHost,
|
|
317
|
+
metadata: metadata,
|
|
318
|
+
transport: this.options.transport,
|
|
319
|
+
debug: this.options.debug,
|
|
320
|
+
onEnd: function (response) {
|
|
321
|
+
if (callback) {
|
|
322
|
+
if (response.status !== grpc.Code.OK) {
|
|
323
|
+
var err = new Error(response.statusMessage);
|
|
324
|
+
err.code = response.status;
|
|
325
|
+
err.metadata = response.trailers;
|
|
326
|
+
callback(err, null);
|
|
327
|
+
} else {
|
|
328
|
+
callback(null, response.message);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
return {
|
|
334
|
+
cancel: function () {
|
|
335
|
+
callback = null;
|
|
336
|
+
client.close();
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
};
|
|
340
|
+
|
|
341
|
+
PlatformClient.prototype.getProofs = function getProofs(requestMessage, metadata, callback) {
|
|
342
|
+
if (arguments.length === 2) {
|
|
343
|
+
callback = arguments[1];
|
|
344
|
+
}
|
|
345
|
+
var client = grpc.unary(Platform.getProofs, {
|
|
346
|
+
request: requestMessage,
|
|
347
|
+
host: this.serviceHost,
|
|
348
|
+
metadata: metadata,
|
|
349
|
+
transport: this.options.transport,
|
|
350
|
+
debug: this.options.debug,
|
|
351
|
+
onEnd: function (response) {
|
|
352
|
+
if (callback) {
|
|
353
|
+
if (response.status !== grpc.Code.OK) {
|
|
354
|
+
var err = new Error(response.statusMessage);
|
|
355
|
+
err.code = response.status;
|
|
356
|
+
err.metadata = response.trailers;
|
|
357
|
+
callback(err, null);
|
|
358
|
+
} else {
|
|
359
|
+
callback(null, response.message);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
return {
|
|
365
|
+
cancel: function () {
|
|
366
|
+
callback = null;
|
|
367
|
+
client.close();
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
145
372
|
PlatformClient.prototype.getDataContract = function getDataContract(requestMessage, metadata, callback) {
|
|
146
373
|
if (arguments.length === 2) {
|
|
147
374
|
callback = arguments[1];
|
|
@@ -173,6 +400,68 @@ PlatformClient.prototype.getDataContract = function getDataContract(requestMessa
|
|
|
173
400
|
};
|
|
174
401
|
};
|
|
175
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
|
+
|
|
434
|
+
PlatformClient.prototype.getDataContracts = function getDataContracts(requestMessage, metadata, callback) {
|
|
435
|
+
if (arguments.length === 2) {
|
|
436
|
+
callback = arguments[1];
|
|
437
|
+
}
|
|
438
|
+
var client = grpc.unary(Platform.getDataContracts, {
|
|
439
|
+
request: requestMessage,
|
|
440
|
+
host: this.serviceHost,
|
|
441
|
+
metadata: metadata,
|
|
442
|
+
transport: this.options.transport,
|
|
443
|
+
debug: this.options.debug,
|
|
444
|
+
onEnd: function (response) {
|
|
445
|
+
if (callback) {
|
|
446
|
+
if (response.status !== grpc.Code.OK) {
|
|
447
|
+
var err = new Error(response.statusMessage);
|
|
448
|
+
err.code = response.status;
|
|
449
|
+
err.metadata = response.trailers;
|
|
450
|
+
callback(err, null);
|
|
451
|
+
} else {
|
|
452
|
+
callback(null, response.message);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
return {
|
|
458
|
+
cancel: function () {
|
|
459
|
+
callback = null;
|
|
460
|
+
client.close();
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
};
|
|
464
|
+
|
|
176
465
|
PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, metadata, callback) {
|
|
177
466
|
if (arguments.length === 2) {
|
|
178
467
|
callback = arguments[1];
|
|
@@ -235,6 +524,37 @@ PlatformClient.prototype.getIdentitiesByPublicKeyHashes = function getIdentities
|
|
|
235
524
|
};
|
|
236
525
|
};
|
|
237
526
|
|
|
527
|
+
PlatformClient.prototype.getIdentityByPublicKeyHashes = function getIdentityByPublicKeyHashes(requestMessage, metadata, callback) {
|
|
528
|
+
if (arguments.length === 2) {
|
|
529
|
+
callback = arguments[1];
|
|
530
|
+
}
|
|
531
|
+
var client = grpc.unary(Platform.getIdentityByPublicKeyHashes, {
|
|
532
|
+
request: requestMessage,
|
|
533
|
+
host: this.serviceHost,
|
|
534
|
+
metadata: metadata,
|
|
535
|
+
transport: this.options.transport,
|
|
536
|
+
debug: this.options.debug,
|
|
537
|
+
onEnd: function (response) {
|
|
538
|
+
if (callback) {
|
|
539
|
+
if (response.status !== grpc.Code.OK) {
|
|
540
|
+
var err = new Error(response.statusMessage);
|
|
541
|
+
err.code = response.status;
|
|
542
|
+
err.metadata = response.trailers;
|
|
543
|
+
callback(err, null);
|
|
544
|
+
} else {
|
|
545
|
+
callback(null, response.message);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
return {
|
|
551
|
+
cancel: function () {
|
|
552
|
+
callback = null;
|
|
553
|
+
client.close();
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
};
|
|
557
|
+
|
|
238
558
|
PlatformClient.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(requestMessage, metadata, callback) {
|
|
239
559
|
if (arguments.length === 2) {
|
|
240
560
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "0.25.0
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "DAPI GRPC definition file and generated clients",
|
|
5
5
|
"browser": "browser.js",
|
|
6
6
|
"main": "node.js",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "yarn exec scripts/build.sh
|
|
8
|
+
"build": "yarn exec scripts/build.sh",
|
|
9
9
|
"lint": "eslint .",
|
|
10
10
|
"prepublishOnly": "yarn run build",
|
|
11
11
|
"test": "yarn run test:unit",
|
|
@@ -21,6 +21,18 @@
|
|
|
21
21
|
"name": "Anton Suprunchuk",
|
|
22
22
|
"email": "anton.suprunchuk@dash.org",
|
|
23
23
|
"url": "https://github.com/antouhou"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "Samuel Westrich",
|
|
27
|
+
"email": "sam@dash.org"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "Igor Markin",
|
|
31
|
+
"email": "igor.markin@dash.org"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Łukasz Klimek",
|
|
35
|
+
"email": "lukasz.klimek@dash.org"
|
|
24
36
|
}
|
|
25
37
|
],
|
|
26
38
|
"repository": {
|
|
@@ -33,7 +45,7 @@
|
|
|
33
45
|
},
|
|
34
46
|
"homepage": "https://github.com/dashevo/dapi-grpc#readme",
|
|
35
47
|
"dependencies": {
|
|
36
|
-
"@dashevo/grpc-common": "0.25.0
|
|
48
|
+
"@dashevo/grpc-common": "0.25.0",
|
|
37
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
38
50
|
"@grpc/grpc-js": "^1.3.7",
|
|
39
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -41,7 +53,7 @@
|
|
|
41
53
|
"long": "^5.2.0"
|
|
42
54
|
},
|
|
43
55
|
"devDependencies": {
|
|
44
|
-
"chai": "^4.3.
|
|
56
|
+
"chai": "^4.3.9",
|
|
45
57
|
"chai-as-promised": "^7.1.1",
|
|
46
58
|
"dirty-chai": "^2.0.1",
|
|
47
59
|
"eslint": "^7.32.0",
|