@dashevo/dapi-grpc 1.0.0-dev.1 → 1.0.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/Cargo.toml +30 -16
- package/build.rs +49 -23
- package/clients/core/v0/rust/core_example.rs +1 -1
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +153 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +3022 -1060
- package/clients/platform/v0/nodejs/platform_protoc.js +2620 -729
- package/clients/platform/v0/rust/platform_example.rs +1 -1
- package/clients/platform/v0/web/PlatformPromiseClient.js +42 -0
- package/clients/platform/v0/web/platform_pb.d.ts +257 -0
- package/clients/platform/v0/web/platform_pb.js +2620 -729
- 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 +84 -0
- package/src/core/proto/org.dash.platform.dapi.v0.rs +577 -0
- package/src/lib.rs +7 -0
- package/src/mock.rs +68 -0
- package/src/platform/proto/org.dash.platform.dapi.v0.rs +1727 -0
- package/test/unit/clients/platform/v0/nodejs/PlatformPromiseClient.spec.js +33 -0
|
@@ -40,6 +40,24 @@ type PlatformgetIdentityKeys = {
|
|
|
40
40
|
readonly responseType: typeof platform_pb.GetIdentityKeysResponse;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type PlatformgetIdentityNonce = {
|
|
44
|
+
readonly methodName: string;
|
|
45
|
+
readonly service: typeof Platform;
|
|
46
|
+
readonly requestStream: false;
|
|
47
|
+
readonly responseStream: false;
|
|
48
|
+
readonly requestType: typeof platform_pb.GetIdentityNonceRequest;
|
|
49
|
+
readonly responseType: typeof platform_pb.GetIdentityNonceResponse;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
type PlatformgetIdentityContractNonce = {
|
|
53
|
+
readonly methodName: string;
|
|
54
|
+
readonly service: typeof Platform;
|
|
55
|
+
readonly requestStream: false;
|
|
56
|
+
readonly responseStream: false;
|
|
57
|
+
readonly requestType: typeof platform_pb.GetIdentityContractNonceRequest;
|
|
58
|
+
readonly responseType: typeof platform_pb.GetIdentityContractNonceResponse;
|
|
59
|
+
};
|
|
60
|
+
|
|
43
61
|
type PlatformgetIdentityBalance = {
|
|
44
62
|
readonly methodName: string;
|
|
45
63
|
readonly service: typeof Platform;
|
|
@@ -172,6 +190,8 @@ export class Platform {
|
|
|
172
190
|
static readonly getIdentity: PlatformgetIdentity;
|
|
173
191
|
static readonly getIdentities: PlatformgetIdentities;
|
|
174
192
|
static readonly getIdentityKeys: PlatformgetIdentityKeys;
|
|
193
|
+
static readonly getIdentityNonce: PlatformgetIdentityNonce;
|
|
194
|
+
static readonly getIdentityContractNonce: PlatformgetIdentityContractNonce;
|
|
175
195
|
static readonly getIdentityBalance: PlatformgetIdentityBalance;
|
|
176
196
|
static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision;
|
|
177
197
|
static readonly getProofs: PlatformgetProofs;
|
|
@@ -256,6 +276,24 @@ export class PlatformClient {
|
|
|
256
276
|
requestMessage: platform_pb.GetIdentityKeysRequest,
|
|
257
277
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void
|
|
258
278
|
): UnaryResponse;
|
|
279
|
+
getIdentityNonce(
|
|
280
|
+
requestMessage: platform_pb.GetIdentityNonceRequest,
|
|
281
|
+
metadata: grpc.Metadata,
|
|
282
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityNonceResponse|null) => void
|
|
283
|
+
): UnaryResponse;
|
|
284
|
+
getIdentityNonce(
|
|
285
|
+
requestMessage: platform_pb.GetIdentityNonceRequest,
|
|
286
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityNonceResponse|null) => void
|
|
287
|
+
): UnaryResponse;
|
|
288
|
+
getIdentityContractNonce(
|
|
289
|
+
requestMessage: platform_pb.GetIdentityContractNonceRequest,
|
|
290
|
+
metadata: grpc.Metadata,
|
|
291
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityContractNonceResponse|null) => void
|
|
292
|
+
): UnaryResponse;
|
|
293
|
+
getIdentityContractNonce(
|
|
294
|
+
requestMessage: platform_pb.GetIdentityContractNonceRequest,
|
|
295
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityContractNonceResponse|null) => void
|
|
296
|
+
): UnaryResponse;
|
|
259
297
|
getIdentityBalance(
|
|
260
298
|
requestMessage: platform_pb.GetIdentityBalanceRequest,
|
|
261
299
|
metadata: grpc.Metadata,
|
|
@@ -46,6 +46,24 @@ Platform.getIdentityKeys = {
|
|
|
46
46
|
responseType: platform_pb.GetIdentityKeysResponse
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
Platform.getIdentityNonce = {
|
|
50
|
+
methodName: "getIdentityNonce",
|
|
51
|
+
service: Platform,
|
|
52
|
+
requestStream: false,
|
|
53
|
+
responseStream: false,
|
|
54
|
+
requestType: platform_pb.GetIdentityNonceRequest,
|
|
55
|
+
responseType: platform_pb.GetIdentityNonceResponse
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
Platform.getIdentityContractNonce = {
|
|
59
|
+
methodName: "getIdentityContractNonce",
|
|
60
|
+
service: Platform,
|
|
61
|
+
requestStream: false,
|
|
62
|
+
responseStream: false,
|
|
63
|
+
requestType: platform_pb.GetIdentityContractNonceRequest,
|
|
64
|
+
responseType: platform_pb.GetIdentityContractNonceResponse
|
|
65
|
+
};
|
|
66
|
+
|
|
49
67
|
Platform.getIdentityBalance = {
|
|
50
68
|
methodName: "getIdentityBalance",
|
|
51
69
|
service: Platform,
|
|
@@ -303,6 +321,68 @@ PlatformClient.prototype.getIdentityKeys = function getIdentityKeys(requestMessa
|
|
|
303
321
|
};
|
|
304
322
|
};
|
|
305
323
|
|
|
324
|
+
PlatformClient.prototype.getIdentityNonce = function getIdentityNonce(requestMessage, metadata, callback) {
|
|
325
|
+
if (arguments.length === 2) {
|
|
326
|
+
callback = arguments[1];
|
|
327
|
+
}
|
|
328
|
+
var client = grpc.unary(Platform.getIdentityNonce, {
|
|
329
|
+
request: requestMessage,
|
|
330
|
+
host: this.serviceHost,
|
|
331
|
+
metadata: metadata,
|
|
332
|
+
transport: this.options.transport,
|
|
333
|
+
debug: this.options.debug,
|
|
334
|
+
onEnd: function (response) {
|
|
335
|
+
if (callback) {
|
|
336
|
+
if (response.status !== grpc.Code.OK) {
|
|
337
|
+
var err = new Error(response.statusMessage);
|
|
338
|
+
err.code = response.status;
|
|
339
|
+
err.metadata = response.trailers;
|
|
340
|
+
callback(err, null);
|
|
341
|
+
} else {
|
|
342
|
+
callback(null, response.message);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
return {
|
|
348
|
+
cancel: function () {
|
|
349
|
+
callback = null;
|
|
350
|
+
client.close();
|
|
351
|
+
}
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
PlatformClient.prototype.getIdentityContractNonce = function getIdentityContractNonce(requestMessage, metadata, callback) {
|
|
356
|
+
if (arguments.length === 2) {
|
|
357
|
+
callback = arguments[1];
|
|
358
|
+
}
|
|
359
|
+
var client = grpc.unary(Platform.getIdentityContractNonce, {
|
|
360
|
+
request: requestMessage,
|
|
361
|
+
host: this.serviceHost,
|
|
362
|
+
metadata: metadata,
|
|
363
|
+
transport: this.options.transport,
|
|
364
|
+
debug: this.options.debug,
|
|
365
|
+
onEnd: function (response) {
|
|
366
|
+
if (callback) {
|
|
367
|
+
if (response.status !== grpc.Code.OK) {
|
|
368
|
+
var err = new Error(response.statusMessage);
|
|
369
|
+
err.code = response.status;
|
|
370
|
+
err.metadata = response.trailers;
|
|
371
|
+
callback(err, null);
|
|
372
|
+
} else {
|
|
373
|
+
callback(null, response.message);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
return {
|
|
379
|
+
cancel: function () {
|
|
380
|
+
callback = null;
|
|
381
|
+
client.close();
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
|
|
306
386
|
PlatformClient.prototype.getIdentityBalance = function getIdentityBalance(requestMessage, metadata, callback) {
|
|
307
387
|
if (arguments.length === 2) {
|
|
308
388
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.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": "1.0.0-dev.
|
|
48
|
+
"@dashevo/grpc-common": "1.0.0-dev.11",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -12,6 +12,8 @@ service Platform {
|
|
|
12
12
|
rpc getIdentity(GetIdentityRequest) returns (GetIdentityResponse);
|
|
13
13
|
rpc getIdentities(GetIdentitiesRequest) returns (GetIdentitiesResponse);
|
|
14
14
|
rpc getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse);
|
|
15
|
+
rpc getIdentityNonce(GetIdentityNonceRequest) returns (GetIdentityNonceResponse);
|
|
16
|
+
rpc getIdentityContractNonce(GetIdentityContractNonceRequest) returns (GetIdentityContractNonceResponse);
|
|
15
17
|
rpc getIdentityBalance(GetIdentityBalanceRequest)
|
|
16
18
|
returns (GetIdentityBalanceResponse);
|
|
17
19
|
rpc getIdentityBalanceAndRevision(GetIdentityBalanceAndRevisionRequest)
|
|
@@ -34,6 +36,7 @@ service Platform {
|
|
|
34
36
|
rpc getProtocolVersionUpgradeState(GetProtocolVersionUpgradeStateRequest) returns (GetProtocolVersionUpgradeStateResponse);
|
|
35
37
|
rpc getProtocolVersionUpgradeVoteStatus(GetProtocolVersionUpgradeVoteStatusRequest) returns (GetProtocolVersionUpgradeVoteStatusResponse);
|
|
36
38
|
rpc getEpochsInfo(GetEpochsInfoRequest) returns (GetEpochsInfoResponse);
|
|
39
|
+
rpc getPathElements(GetPathElementsRequest) returns (GetPathElementsResponse);
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
message Proof {
|
|
@@ -74,6 +77,28 @@ message GetIdentityRequest {
|
|
|
74
77
|
oneof version { GetIdentityRequestV0 v0 = 1; }
|
|
75
78
|
}
|
|
76
79
|
|
|
80
|
+
message GetIdentityNonceRequest {
|
|
81
|
+
|
|
82
|
+
message GetIdentityNonceRequestV0 {
|
|
83
|
+
bytes identity_id = 1;
|
|
84
|
+
bool prove = 2;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
oneof version { GetIdentityNonceRequestV0 v0 = 1; }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
message GetIdentityContractNonceRequest {
|
|
92
|
+
|
|
93
|
+
message GetIdentityContractNonceRequestV0 {
|
|
94
|
+
bytes identity_id = 1;
|
|
95
|
+
bytes contract_id = 2;
|
|
96
|
+
bool prove = 3;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
oneof version { GetIdentityContractNonceRequestV0 v0 = 1; }
|
|
100
|
+
}
|
|
101
|
+
|
|
77
102
|
message GetIdentityBalanceRequest {
|
|
78
103
|
|
|
79
104
|
message GetIdentityBalanceRequestV0 {
|
|
@@ -139,6 +164,32 @@ message GetIdentitiesResponse {
|
|
|
139
164
|
oneof version { GetIdentitiesResponseV0 v0 = 1; }
|
|
140
165
|
}
|
|
141
166
|
|
|
167
|
+
message GetIdentityNonceResponse {
|
|
168
|
+
|
|
169
|
+
message GetIdentityNonceResponseV0 {
|
|
170
|
+
oneof result {
|
|
171
|
+
uint64 identity_nonce = 1;
|
|
172
|
+
Proof proof = 2;
|
|
173
|
+
}
|
|
174
|
+
ResponseMetadata metadata = 3;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
oneof version { GetIdentityNonceResponseV0 v0 = 1; }
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
message GetIdentityContractNonceResponse {
|
|
181
|
+
|
|
182
|
+
message GetIdentityContractNonceResponseV0 {
|
|
183
|
+
oneof result {
|
|
184
|
+
uint64 identity_contract_nonce = 1;
|
|
185
|
+
Proof proof = 2;
|
|
186
|
+
}
|
|
187
|
+
ResponseMetadata metadata = 3;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
oneof version { GetIdentityContractNonceResponseV0 v0 = 1; }
|
|
191
|
+
}
|
|
192
|
+
|
|
142
193
|
message GetIdentityBalanceResponse {
|
|
143
194
|
|
|
144
195
|
message GetIdentityBalanceResponseV0 {
|
|
@@ -234,6 +285,7 @@ message GetProofsRequest {
|
|
|
234
285
|
FULL_IDENTITY = 0;
|
|
235
286
|
BALANCE = 1;
|
|
236
287
|
KEYS = 2;
|
|
288
|
+
REVISION = 3;
|
|
237
289
|
}
|
|
238
290
|
bytes identity_id = 1;
|
|
239
291
|
Type request_type = 2;
|
|
@@ -555,6 +607,7 @@ message GetEpochsInfoResponse {
|
|
|
555
607
|
uint32 first_core_block_height = 3;
|
|
556
608
|
uint64 start_time = 4;
|
|
557
609
|
double fee_multiplier = 5;
|
|
610
|
+
uint32 protocol_version = 6;
|
|
558
611
|
}
|
|
559
612
|
|
|
560
613
|
oneof result {
|
|
@@ -568,3 +621,34 @@ message GetEpochsInfoResponse {
|
|
|
568
621
|
GetEpochsInfoResponseV0 v0 = 1;
|
|
569
622
|
}
|
|
570
623
|
}
|
|
624
|
+
|
|
625
|
+
message GetPathElementsRequest {
|
|
626
|
+
message GetPathElementsRequestV0 {
|
|
627
|
+
repeated bytes path = 1;
|
|
628
|
+
repeated bytes keys = 2;
|
|
629
|
+
bool prove = 3;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
oneof version {
|
|
633
|
+
GetPathElementsRequestV0 v0 = 1;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
message GetPathElementsResponse {
|
|
638
|
+
message GetPathElementsResponseV0 {
|
|
639
|
+
message Elements {
|
|
640
|
+
repeated bytes elements = 1;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
oneof result {
|
|
644
|
+
Elements elements = 1;
|
|
645
|
+
Proof proof = 2;
|
|
646
|
+
}
|
|
647
|
+
ResponseMetadata metadata = 3;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
oneof version {
|
|
651
|
+
GetPathElementsResponseV0 v0 = 1;
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|