@dashevo/dapi-grpc 0.25.22 → 1.0.0-beta.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 +35 -16
- package/build.rs +139 -56
- package/clients/core/v0/nodejs/CorePromiseClient.js +124 -13
- package/clients/core/v0/nodejs/core_pbjs.js +1922 -987
- package/clients/core/v0/nodejs/core_protoc.js +1291 -645
- package/clients/core/v0/rust/core_example.rs +1 -1
- package/clients/core/v0/web/CorePromiseClient.js +49 -5
- package/clients/core/v0/web/core_pb.d.ts +173 -89
- package/clients/core/v0/web/core_pb.js +1291 -645
- package/clients/core/v0/web/core_pb_service.d.ts +59 -10
- package/clients/core/v0/web/core_pb_service.js +134 -6
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +208 -14
- package/clients/platform/v0/nodejs/platform_pbjs.js +22951 -9938
- package/clients/platform/v0/nodejs/platform_protoc.js +22332 -9091
- package/clients/platform/v0/rust/platform_example.rs +1 -1
- package/clients/platform/v0/web/PlatformPromiseClient.js +64 -8
- package/clients/platform/v0/web/platform_pb.d.ts +2057 -302
- package/clients/platform/v0/web/platform_pb.js +22332 -9091
- package/clients/platform/v0/web/platform_pb_service.d.ts +187 -35
- package/clients/platform/v0/web/platform_pb_service.js +355 -35
- package/package.json +2 -2
- package/protos/core/v0/core.proto +45 -23
- package/protos/platform/v0/platform.proto +429 -50
- package/src/lib.rs +26 -2
- package/src/mock/serde_mockable.rs +105 -0
- package/src/mock.rs +130 -0
- package/test/unit/clients/core/v0/nodejs/CorePromiseClient.spec.js +27 -6
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +55 -1
- package/test/unit/getCoreDefinition.spec.js +5 -2
- package/src/core/proto/org.dash.platform.dapi.v0.rs +0 -666
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +0 -2481
|
@@ -4,13 +4,22 @@
|
|
|
4
4
|
import * as core_pb from "./core_pb";
|
|
5
5
|
import {grpc} from "@improbable-eng/grpc-web";
|
|
6
6
|
|
|
7
|
-
type
|
|
7
|
+
type CoregetBlockchainStatus = {
|
|
8
8
|
readonly methodName: string;
|
|
9
9
|
readonly service: typeof Core;
|
|
10
10
|
readonly requestStream: false;
|
|
11
11
|
readonly responseStream: false;
|
|
12
|
-
readonly requestType: typeof core_pb.
|
|
13
|
-
readonly responseType: typeof core_pb.
|
|
12
|
+
readonly requestType: typeof core_pb.GetBlockchainStatusRequest;
|
|
13
|
+
readonly responseType: typeof core_pb.GetBlockchainStatusResponse;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type CoregetMasternodeStatus = {
|
|
17
|
+
readonly methodName: string;
|
|
18
|
+
readonly service: typeof Core;
|
|
19
|
+
readonly requestStream: false;
|
|
20
|
+
readonly responseStream: false;
|
|
21
|
+
readonly requestType: typeof core_pb.GetMasternodeStatusRequest;
|
|
22
|
+
readonly responseType: typeof core_pb.GetMasternodeStatusResponse;
|
|
14
23
|
};
|
|
15
24
|
|
|
16
25
|
type CoregetBlock = {
|
|
@@ -22,6 +31,15 @@ type CoregetBlock = {
|
|
|
22
31
|
readonly responseType: typeof core_pb.GetBlockResponse;
|
|
23
32
|
};
|
|
24
33
|
|
|
34
|
+
type CoregetBestBlockHeight = {
|
|
35
|
+
readonly methodName: string;
|
|
36
|
+
readonly service: typeof Core;
|
|
37
|
+
readonly requestStream: false;
|
|
38
|
+
readonly responseStream: false;
|
|
39
|
+
readonly requestType: typeof core_pb.GetBestBlockHeightRequest;
|
|
40
|
+
readonly responseType: typeof core_pb.GetBestBlockHeightResponse;
|
|
41
|
+
};
|
|
42
|
+
|
|
25
43
|
type CorebroadcastTransaction = {
|
|
26
44
|
readonly methodName: string;
|
|
27
45
|
readonly service: typeof Core;
|
|
@@ -67,15 +85,27 @@ type CoresubscribeToTransactionsWithProofs = {
|
|
|
67
85
|
readonly responseType: typeof core_pb.TransactionsWithProofsResponse;
|
|
68
86
|
};
|
|
69
87
|
|
|
88
|
+
type CoresubscribeToMasternodeList = {
|
|
89
|
+
readonly methodName: string;
|
|
90
|
+
readonly service: typeof Core;
|
|
91
|
+
readonly requestStream: false;
|
|
92
|
+
readonly responseStream: true;
|
|
93
|
+
readonly requestType: typeof core_pb.MasternodeListRequest;
|
|
94
|
+
readonly responseType: typeof core_pb.MasternodeListResponse;
|
|
95
|
+
};
|
|
96
|
+
|
|
70
97
|
export class Core {
|
|
71
98
|
static readonly serviceName: string;
|
|
72
|
-
static readonly
|
|
99
|
+
static readonly getBlockchainStatus: CoregetBlockchainStatus;
|
|
100
|
+
static readonly getMasternodeStatus: CoregetMasternodeStatus;
|
|
73
101
|
static readonly getBlock: CoregetBlock;
|
|
102
|
+
static readonly getBestBlockHeight: CoregetBestBlockHeight;
|
|
74
103
|
static readonly broadcastTransaction: CorebroadcastTransaction;
|
|
75
104
|
static readonly getTransaction: CoregetTransaction;
|
|
76
105
|
static readonly getEstimatedTransactionFee: CoregetEstimatedTransactionFee;
|
|
77
106
|
static readonly subscribeToBlockHeadersWithChainLocks: CoresubscribeToBlockHeadersWithChainLocks;
|
|
78
107
|
static readonly subscribeToTransactionsWithProofs: CoresubscribeToTransactionsWithProofs;
|
|
108
|
+
static readonly subscribeToMasternodeList: CoresubscribeToMasternodeList;
|
|
79
109
|
}
|
|
80
110
|
|
|
81
111
|
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
|
@@ -110,14 +140,23 @@ export class CoreClient {
|
|
|
110
140
|
readonly serviceHost: string;
|
|
111
141
|
|
|
112
142
|
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
|
113
|
-
|
|
114
|
-
requestMessage: core_pb.
|
|
143
|
+
getBlockchainStatus(
|
|
144
|
+
requestMessage: core_pb.GetBlockchainStatusRequest,
|
|
115
145
|
metadata: grpc.Metadata,
|
|
116
|
-
callback: (error: ServiceError|null, responseMessage: core_pb.
|
|
146
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetBlockchainStatusResponse|null) => void
|
|
117
147
|
): UnaryResponse;
|
|
118
|
-
|
|
119
|
-
requestMessage: core_pb.
|
|
120
|
-
callback: (error: ServiceError|null, responseMessage: core_pb.
|
|
148
|
+
getBlockchainStatus(
|
|
149
|
+
requestMessage: core_pb.GetBlockchainStatusRequest,
|
|
150
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetBlockchainStatusResponse|null) => void
|
|
151
|
+
): UnaryResponse;
|
|
152
|
+
getMasternodeStatus(
|
|
153
|
+
requestMessage: core_pb.GetMasternodeStatusRequest,
|
|
154
|
+
metadata: grpc.Metadata,
|
|
155
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetMasternodeStatusResponse|null) => void
|
|
156
|
+
): UnaryResponse;
|
|
157
|
+
getMasternodeStatus(
|
|
158
|
+
requestMessage: core_pb.GetMasternodeStatusRequest,
|
|
159
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetMasternodeStatusResponse|null) => void
|
|
121
160
|
): UnaryResponse;
|
|
122
161
|
getBlock(
|
|
123
162
|
requestMessage: core_pb.GetBlockRequest,
|
|
@@ -128,6 +167,15 @@ export class CoreClient {
|
|
|
128
167
|
requestMessage: core_pb.GetBlockRequest,
|
|
129
168
|
callback: (error: ServiceError|null, responseMessage: core_pb.GetBlockResponse|null) => void
|
|
130
169
|
): UnaryResponse;
|
|
170
|
+
getBestBlockHeight(
|
|
171
|
+
requestMessage: core_pb.GetBestBlockHeightRequest,
|
|
172
|
+
metadata: grpc.Metadata,
|
|
173
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetBestBlockHeightResponse|null) => void
|
|
174
|
+
): UnaryResponse;
|
|
175
|
+
getBestBlockHeight(
|
|
176
|
+
requestMessage: core_pb.GetBestBlockHeightRequest,
|
|
177
|
+
callback: (error: ServiceError|null, responseMessage: core_pb.GetBestBlockHeightResponse|null) => void
|
|
178
|
+
): UnaryResponse;
|
|
131
179
|
broadcastTransaction(
|
|
132
180
|
requestMessage: core_pb.BroadcastTransactionRequest,
|
|
133
181
|
metadata: grpc.Metadata,
|
|
@@ -157,5 +205,6 @@ export class CoreClient {
|
|
|
157
205
|
): UnaryResponse;
|
|
158
206
|
subscribeToBlockHeadersWithChainLocks(requestMessage: core_pb.BlockHeadersWithChainLocksRequest, metadata?: grpc.Metadata): ResponseStream<core_pb.BlockHeadersWithChainLocksResponse>;
|
|
159
207
|
subscribeToTransactionsWithProofs(requestMessage: core_pb.TransactionsWithProofsRequest, metadata?: grpc.Metadata): ResponseStream<core_pb.TransactionsWithProofsResponse>;
|
|
208
|
+
subscribeToMasternodeList(requestMessage: core_pb.MasternodeListRequest, metadata?: grpc.Metadata): ResponseStream<core_pb.MasternodeListResponse>;
|
|
160
209
|
}
|
|
161
210
|
|
|
@@ -10,13 +10,22 @@ var Core = (function () {
|
|
|
10
10
|
return Core;
|
|
11
11
|
}());
|
|
12
12
|
|
|
13
|
-
Core.
|
|
14
|
-
methodName: "
|
|
13
|
+
Core.getBlockchainStatus = {
|
|
14
|
+
methodName: "getBlockchainStatus",
|
|
15
15
|
service: Core,
|
|
16
16
|
requestStream: false,
|
|
17
17
|
responseStream: false,
|
|
18
|
-
requestType: core_pb.
|
|
19
|
-
responseType: core_pb.
|
|
18
|
+
requestType: core_pb.GetBlockchainStatusRequest,
|
|
19
|
+
responseType: core_pb.GetBlockchainStatusResponse
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
Core.getMasternodeStatus = {
|
|
23
|
+
methodName: "getMasternodeStatus",
|
|
24
|
+
service: Core,
|
|
25
|
+
requestStream: false,
|
|
26
|
+
responseStream: false,
|
|
27
|
+
requestType: core_pb.GetMasternodeStatusRequest,
|
|
28
|
+
responseType: core_pb.GetMasternodeStatusResponse
|
|
20
29
|
};
|
|
21
30
|
|
|
22
31
|
Core.getBlock = {
|
|
@@ -28,6 +37,15 @@ Core.getBlock = {
|
|
|
28
37
|
responseType: core_pb.GetBlockResponse
|
|
29
38
|
};
|
|
30
39
|
|
|
40
|
+
Core.getBestBlockHeight = {
|
|
41
|
+
methodName: "getBestBlockHeight",
|
|
42
|
+
service: Core,
|
|
43
|
+
requestStream: false,
|
|
44
|
+
responseStream: false,
|
|
45
|
+
requestType: core_pb.GetBestBlockHeightRequest,
|
|
46
|
+
responseType: core_pb.GetBestBlockHeightResponse
|
|
47
|
+
};
|
|
48
|
+
|
|
31
49
|
Core.broadcastTransaction = {
|
|
32
50
|
methodName: "broadcastTransaction",
|
|
33
51
|
service: Core,
|
|
@@ -73,6 +91,15 @@ Core.subscribeToTransactionsWithProofs = {
|
|
|
73
91
|
responseType: core_pb.TransactionsWithProofsResponse
|
|
74
92
|
};
|
|
75
93
|
|
|
94
|
+
Core.subscribeToMasternodeList = {
|
|
95
|
+
methodName: "subscribeToMasternodeList",
|
|
96
|
+
service: Core,
|
|
97
|
+
requestStream: false,
|
|
98
|
+
responseStream: true,
|
|
99
|
+
requestType: core_pb.MasternodeListRequest,
|
|
100
|
+
responseType: core_pb.MasternodeListResponse
|
|
101
|
+
};
|
|
102
|
+
|
|
76
103
|
exports.Core = Core;
|
|
77
104
|
|
|
78
105
|
function CoreClient(serviceHost, options) {
|
|
@@ -80,11 +107,42 @@ function CoreClient(serviceHost, options) {
|
|
|
80
107
|
this.options = options || {};
|
|
81
108
|
}
|
|
82
109
|
|
|
83
|
-
CoreClient.prototype.
|
|
110
|
+
CoreClient.prototype.getBlockchainStatus = function getBlockchainStatus(requestMessage, metadata, callback) {
|
|
84
111
|
if (arguments.length === 2) {
|
|
85
112
|
callback = arguments[1];
|
|
86
113
|
}
|
|
87
|
-
var client = grpc.unary(Core.
|
|
114
|
+
var client = grpc.unary(Core.getBlockchainStatus, {
|
|
115
|
+
request: requestMessage,
|
|
116
|
+
host: this.serviceHost,
|
|
117
|
+
metadata: metadata,
|
|
118
|
+
transport: this.options.transport,
|
|
119
|
+
debug: this.options.debug,
|
|
120
|
+
onEnd: function (response) {
|
|
121
|
+
if (callback) {
|
|
122
|
+
if (response.status !== grpc.Code.OK) {
|
|
123
|
+
var err = new Error(response.statusMessage);
|
|
124
|
+
err.code = response.status;
|
|
125
|
+
err.metadata = response.trailers;
|
|
126
|
+
callback(err, null);
|
|
127
|
+
} else {
|
|
128
|
+
callback(null, response.message);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return {
|
|
134
|
+
cancel: function () {
|
|
135
|
+
callback = null;
|
|
136
|
+
client.close();
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
CoreClient.prototype.getMasternodeStatus = function getMasternodeStatus(requestMessage, metadata, callback) {
|
|
142
|
+
if (arguments.length === 2) {
|
|
143
|
+
callback = arguments[1];
|
|
144
|
+
}
|
|
145
|
+
var client = grpc.unary(Core.getMasternodeStatus, {
|
|
88
146
|
request: requestMessage,
|
|
89
147
|
host: this.serviceHost,
|
|
90
148
|
metadata: metadata,
|
|
@@ -142,6 +200,37 @@ CoreClient.prototype.getBlock = function getBlock(requestMessage, metadata, call
|
|
|
142
200
|
};
|
|
143
201
|
};
|
|
144
202
|
|
|
203
|
+
CoreClient.prototype.getBestBlockHeight = function getBestBlockHeight(requestMessage, metadata, callback) {
|
|
204
|
+
if (arguments.length === 2) {
|
|
205
|
+
callback = arguments[1];
|
|
206
|
+
}
|
|
207
|
+
var client = grpc.unary(Core.getBestBlockHeight, {
|
|
208
|
+
request: requestMessage,
|
|
209
|
+
host: this.serviceHost,
|
|
210
|
+
metadata: metadata,
|
|
211
|
+
transport: this.options.transport,
|
|
212
|
+
debug: this.options.debug,
|
|
213
|
+
onEnd: function (response) {
|
|
214
|
+
if (callback) {
|
|
215
|
+
if (response.status !== grpc.Code.OK) {
|
|
216
|
+
var err = new Error(response.statusMessage);
|
|
217
|
+
err.code = response.status;
|
|
218
|
+
err.metadata = response.trailers;
|
|
219
|
+
callback(err, null);
|
|
220
|
+
} else {
|
|
221
|
+
callback(null, response.message);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return {
|
|
227
|
+
cancel: function () {
|
|
228
|
+
callback = null;
|
|
229
|
+
client.close();
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
|
|
145
234
|
CoreClient.prototype.broadcastTransaction = function broadcastTransaction(requestMessage, metadata, callback) {
|
|
146
235
|
if (arguments.length === 2) {
|
|
147
236
|
callback = arguments[1];
|
|
@@ -313,5 +402,44 @@ CoreClient.prototype.subscribeToTransactionsWithProofs = function subscribeToTra
|
|
|
313
402
|
};
|
|
314
403
|
};
|
|
315
404
|
|
|
405
|
+
CoreClient.prototype.subscribeToMasternodeList = function subscribeToMasternodeList(requestMessage, metadata) {
|
|
406
|
+
var listeners = {
|
|
407
|
+
data: [],
|
|
408
|
+
end: [],
|
|
409
|
+
status: []
|
|
410
|
+
};
|
|
411
|
+
var client = grpc.invoke(Core.subscribeToMasternodeList, {
|
|
412
|
+
request: requestMessage,
|
|
413
|
+
host: this.serviceHost,
|
|
414
|
+
metadata: metadata,
|
|
415
|
+
transport: this.options.transport,
|
|
416
|
+
debug: this.options.debug,
|
|
417
|
+
onMessage: function (responseMessage) {
|
|
418
|
+
listeners.data.forEach(function (handler) {
|
|
419
|
+
handler(responseMessage);
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
onEnd: function (status, statusMessage, trailers) {
|
|
423
|
+
listeners.status.forEach(function (handler) {
|
|
424
|
+
handler({ code: status, details: statusMessage, metadata: trailers });
|
|
425
|
+
});
|
|
426
|
+
listeners.end.forEach(function (handler) {
|
|
427
|
+
handler({ code: status, details: statusMessage, metadata: trailers });
|
|
428
|
+
});
|
|
429
|
+
listeners = null;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
return {
|
|
433
|
+
on: function (type, handler) {
|
|
434
|
+
listeners[type].push(handler);
|
|
435
|
+
return this;
|
|
436
|
+
},
|
|
437
|
+
cancel: function () {
|
|
438
|
+
listeners = null;
|
|
439
|
+
client.close();
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
|
|
316
444
|
exports.CoreClient = CoreClient;
|
|
317
445
|
|
|
@@ -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,
|
|
@@ -48,6 +50,14 @@ const {
|
|
|
48
50
|
PBJSGetProtocolVersionUpgradeVoteStatusResponse,
|
|
49
51
|
GetProtocolVersionUpgradeStateRequest: PBJSGetProtocolVersionUpgradeStateRequest,
|
|
50
52
|
GetProtocolVersionUpgradeStateResponse: PBJSGetProtocolVersionUpgradeStateResponse,
|
|
53
|
+
GetProofsRequest: PBJSGetProofsRequest,
|
|
54
|
+
GetProofsResponse: PBJSGetProofsResponse,
|
|
55
|
+
GetIdentityContractNonceRequest: PBJSGetIdentityContractNonceRequest,
|
|
56
|
+
GetIdentityContractNonceResponse: PBJSGetIdentityContractNonceResponse,
|
|
57
|
+
GetIdentityNonceRequest: PBJSGetIdentityNonceRequest,
|
|
58
|
+
GetIdentityNonceResponse: PBJSGetIdentityNonceResponse,
|
|
59
|
+
GetIdentityKeysRequest: PBJSGetIdentityKeysRequest,
|
|
60
|
+
GetIdentityKeysResponse: PBJSGetIdentityKeysResponse,
|
|
51
61
|
},
|
|
52
62
|
},
|
|
53
63
|
},
|
|
@@ -58,15 +68,20 @@ const {
|
|
|
58
68
|
const {
|
|
59
69
|
BroadcastStateTransitionResponse: ProtocBroadcastStateTransitionResponse,
|
|
60
70
|
GetIdentityResponse: ProtocGetIdentityResponse,
|
|
71
|
+
GetIdentitiesContractKeysResponse: ProtocGetIdentitiesContractKeysResponse,
|
|
61
72
|
GetDataContractResponse: ProtocGetDataContractResponse,
|
|
62
73
|
GetDataContractHistoryResponse: ProtocGetDataContractHistoryResponse,
|
|
63
74
|
GetDocumentsResponse: ProtocGetDocumentsResponse,
|
|
64
|
-
|
|
75
|
+
GetIdentityByPublicKeyHashResponse: ProtocGetIdentityByPublicKeyHashResponse,
|
|
65
76
|
WaitForStateTransitionResultResponse: ProtocWaitForStateTransitionResultResponse,
|
|
66
77
|
GetConsensusParamsResponse: ProtocGetConsensusParamsResponse,
|
|
67
78
|
GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
|
|
68
79
|
GetProtocolVersionUpgradeVoteStatusResponse: ProtocGetProtocolVersionUpgradeVoteStatusResponse,
|
|
69
80
|
GetProtocolVersionUpgradeStateResponse: ProtocGetProtocolVersionUpgradeStateResponse,
|
|
81
|
+
GetProofsResponse: ProtocGetProofsResponse,
|
|
82
|
+
GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
|
|
83
|
+
GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
|
|
84
|
+
GetIdentityKeysResponse: ProtocGetIdentityKeysResponse,
|
|
70
85
|
} = require('./platform_protoc');
|
|
71
86
|
|
|
72
87
|
const getPlatformDefinition = require('../../../../lib/getPlatformDefinition');
|
|
@@ -101,6 +116,10 @@ class PlatformPromiseClient {
|
|
|
101
116
|
this.client.getIdentity.bind(this.client),
|
|
102
117
|
);
|
|
103
118
|
|
|
119
|
+
this.client.getIdentitiesContractKeys = promisify(
|
|
120
|
+
this.client.getIdentitiesContractKeys.bind(this.client),
|
|
121
|
+
);
|
|
122
|
+
|
|
104
123
|
this.client.getDataContract = promisify(
|
|
105
124
|
this.client.getDataContract.bind(this.client),
|
|
106
125
|
);
|
|
@@ -113,8 +132,8 @@ class PlatformPromiseClient {
|
|
|
113
132
|
this.client.getDocuments.bind(this.client),
|
|
114
133
|
);
|
|
115
134
|
|
|
116
|
-
this.client.
|
|
117
|
-
this.client.
|
|
135
|
+
this.client.getIdentityByPublicKeyHash = promisify(
|
|
136
|
+
this.client.getIdentityByPublicKeyHash.bind(this.client),
|
|
118
137
|
);
|
|
119
138
|
|
|
120
139
|
this.client.waitForStateTransitionResult = promisify(
|
|
@@ -137,6 +156,22 @@ class PlatformPromiseClient {
|
|
|
137
156
|
this.client.getProtocolVersionUpgradeState.bind(this.client),
|
|
138
157
|
);
|
|
139
158
|
|
|
159
|
+
this.client.getProofs = promisify(
|
|
160
|
+
this.client.getProofs.bind(this.client),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
this.client.getIdentityContractNonce = promisify(
|
|
164
|
+
this.client.getIdentityContractNonce.bind(this.client),
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
this.client.getIdentityNonce = promisify(
|
|
168
|
+
this.client.getIdentityNonce.bind(this.client),
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
this.client.getIdentityKeys = promisify(
|
|
172
|
+
this.client.getIdentityKeys.bind(this.client),
|
|
173
|
+
);
|
|
174
|
+
|
|
140
175
|
this.protocolVersion = undefined;
|
|
141
176
|
}
|
|
142
177
|
|
|
@@ -202,6 +237,40 @@ class PlatformPromiseClient {
|
|
|
202
237
|
);
|
|
203
238
|
}
|
|
204
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
|
+
|
|
205
274
|
/**
|
|
206
275
|
*
|
|
207
276
|
* @param {!GetDataContractRequest} getDataContractRequest
|
|
@@ -299,13 +368,13 @@ class PlatformPromiseClient {
|
|
|
299
368
|
}
|
|
300
369
|
|
|
301
370
|
/**
|
|
302
|
-
* @param {!
|
|
371
|
+
* @param {!GetIdentityByPublicKeyHashRequest} getIdentityByPublicKeyHashRequest
|
|
303
372
|
* @param {?Object<string, string>} metadata
|
|
304
373
|
* @param {CallOptions} [options={}]
|
|
305
|
-
* @returns {Promise<!
|
|
374
|
+
* @returns {Promise<!GetIdentityByPublicKeyHashResponse>}
|
|
306
375
|
*/
|
|
307
|
-
|
|
308
|
-
|
|
376
|
+
getIdentityByPublicKeyHash(
|
|
377
|
+
getIdentityByPublicKeyHashRequest,
|
|
309
378
|
metadata = {},
|
|
310
379
|
options = {},
|
|
311
380
|
) {
|
|
@@ -313,18 +382,18 @@ class PlatformPromiseClient {
|
|
|
313
382
|
throw new Error('metadata must be an object');
|
|
314
383
|
}
|
|
315
384
|
|
|
316
|
-
return this.client.
|
|
317
|
-
|
|
385
|
+
return this.client.getIdentityByPublicKeyHash(
|
|
386
|
+
getIdentityByPublicKeyHashRequest,
|
|
318
387
|
convertObjectToMetadata(metadata),
|
|
319
388
|
{
|
|
320
389
|
interceptors: [
|
|
321
390
|
jsonToProtobufInterceptorFactory(
|
|
322
391
|
jsonToProtobufFactory(
|
|
323
|
-
|
|
324
|
-
|
|
392
|
+
ProtocGetIdentityByPublicKeyHashResponse,
|
|
393
|
+
PBJSGetIdentityByPublicKeyHashResponse,
|
|
325
394
|
),
|
|
326
395
|
protobufToJsonFactory(
|
|
327
|
-
|
|
396
|
+
PBJSGetIdentityByPublicKeyHashRequest,
|
|
328
397
|
),
|
|
329
398
|
),
|
|
330
399
|
],
|
|
@@ -496,6 +565,131 @@ class PlatformPromiseClient {
|
|
|
496
565
|
);
|
|
497
566
|
}
|
|
498
567
|
|
|
568
|
+
/**
|
|
569
|
+
*
|
|
570
|
+
* @param {!GetProofsRequest} request
|
|
571
|
+
* @param {?Object<string, string>} metadata
|
|
572
|
+
* @param {CallOptions} [options={}]
|
|
573
|
+
* @returns {Promise<!GetProofsResponse>}
|
|
574
|
+
*/
|
|
575
|
+
getProofs(request, metadata = {}, options = {}) {
|
|
576
|
+
if (!isObject(metadata)) {
|
|
577
|
+
throw new Error('metadata must be an object');
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
return this.client.getProofs(
|
|
581
|
+
request,
|
|
582
|
+
convertObjectToMetadata(metadata),
|
|
583
|
+
{
|
|
584
|
+
interceptors: [
|
|
585
|
+
jsonToProtobufInterceptorFactory(
|
|
586
|
+
jsonToProtobufFactory(
|
|
587
|
+
ProtocGetProofsResponse,
|
|
588
|
+
PBJSGetProofsResponse,
|
|
589
|
+
),
|
|
590
|
+
protobufToJsonFactory(
|
|
591
|
+
PBJSGetProofsRequest,
|
|
592
|
+
),
|
|
593
|
+
),
|
|
594
|
+
],
|
|
595
|
+
...options,
|
|
596
|
+
},
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/**
|
|
601
|
+
* @param {!PBJSGetIdentityContractNonceRequest} getIdentityContractNonceRequest
|
|
602
|
+
* @param {?Object<string, string>} metadata
|
|
603
|
+
* @param {CallOptions} [options={}]
|
|
604
|
+
* @return {Promise<!GetIdentityContractNonceResponse>}
|
|
605
|
+
*/
|
|
606
|
+
getIdentityContractNonce(
|
|
607
|
+
getIdentityContractNonceRequest,
|
|
608
|
+
metadata = {},
|
|
609
|
+
options = {},
|
|
610
|
+
) {
|
|
611
|
+
if (!isObject(metadata)) {
|
|
612
|
+
throw new Error('metadata must be an object');
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
return this.client.getIdentityContractNonce(
|
|
616
|
+
getIdentityContractNonceRequest,
|
|
617
|
+
convertObjectToMetadata(metadata),
|
|
618
|
+
{
|
|
619
|
+
interceptors: [
|
|
620
|
+
jsonToProtobufInterceptorFactory(
|
|
621
|
+
jsonToProtobufFactory(
|
|
622
|
+
ProtocGetIdentityContractNonceResponse,
|
|
623
|
+
PBJSGetIdentityContractNonceResponse,
|
|
624
|
+
),
|
|
625
|
+
protobufToJsonFactory(
|
|
626
|
+
PBJSGetIdentityContractNonceRequest,
|
|
627
|
+
),
|
|
628
|
+
),
|
|
629
|
+
],
|
|
630
|
+
...options,
|
|
631
|
+
},
|
|
632
|
+
);
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
getIdentityNonce(
|
|
636
|
+
getIdentityNonceRequest,
|
|
637
|
+
metadata = {},
|
|
638
|
+
options = {},
|
|
639
|
+
) {
|
|
640
|
+
if (!isObject(metadata)) {
|
|
641
|
+
throw new Error('metadata must be an object');
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return this.client.getIdentityNonce(
|
|
645
|
+
getIdentityNonceRequest,
|
|
646
|
+
convertObjectToMetadata(metadata),
|
|
647
|
+
{
|
|
648
|
+
interceptors: [
|
|
649
|
+
jsonToProtobufInterceptorFactory(
|
|
650
|
+
jsonToProtobufFactory(
|
|
651
|
+
ProtocGetIdentityNonceResponse,
|
|
652
|
+
PBJSGetIdentityNonceResponse,
|
|
653
|
+
),
|
|
654
|
+
protobufToJsonFactory(
|
|
655
|
+
PBJSGetIdentityNonceRequest,
|
|
656
|
+
),
|
|
657
|
+
),
|
|
658
|
+
],
|
|
659
|
+
...options,
|
|
660
|
+
},
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
getIdentityKeys(
|
|
665
|
+
getIdentityKeysRequest,
|
|
666
|
+
metadata = {},
|
|
667
|
+
options = {},
|
|
668
|
+
) {
|
|
669
|
+
if (!isObject(metadata)) {
|
|
670
|
+
throw new Error('metadata must be an object');
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
return this.client.getIdentityKeys(
|
|
674
|
+
getIdentityKeysRequest,
|
|
675
|
+
convertObjectToMetadata(metadata),
|
|
676
|
+
{
|
|
677
|
+
interceptors: [
|
|
678
|
+
jsonToProtobufInterceptorFactory(
|
|
679
|
+
jsonToProtobufFactory(
|
|
680
|
+
ProtocGetIdentityKeysResponse,
|
|
681
|
+
PBJSGetIdentityKeysResponse,
|
|
682
|
+
),
|
|
683
|
+
protobufToJsonFactory(
|
|
684
|
+
PBJSGetIdentityKeysRequest,
|
|
685
|
+
),
|
|
686
|
+
),
|
|
687
|
+
],
|
|
688
|
+
...options,
|
|
689
|
+
},
|
|
690
|
+
);
|
|
691
|
+
}
|
|
692
|
+
|
|
499
693
|
/**
|
|
500
694
|
* @param {string} protocolVersion
|
|
501
695
|
*/
|