@dashevo/dapi-grpc 1.0.0-dev.5 → 1.0.0-dev.6
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
CHANGED
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "dapi-grpc"
|
|
3
3
|
description = "GRPC client for Dash Platform"
|
|
4
|
-
version = "1.0.0-dev.
|
|
4
|
+
version = "1.0.0-dev.6"
|
|
5
5
|
authors = [
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
"Samuel Westrich <sam@dash.org>",
|
|
7
|
+
"Igor Markin <igor.markin@dash.org>",
|
|
8
|
+
"Łukasz Klimek <lukasz.klimek@dash.org>",
|
|
9
|
+
"Anton Suprunchuk <anton.suprunchuk@dash.org>",
|
|
10
|
+
"Ivan Shumkov <shumkov@dash.org>",
|
|
11
11
|
]
|
|
12
12
|
edition = "2021"
|
|
13
|
-
rust-version = "1.
|
|
13
|
+
rust-version = "1.76"
|
|
14
14
|
license = "MIT"
|
|
15
15
|
|
|
16
16
|
[features]
|
|
17
|
-
|
|
17
|
+
# Enable all features by default, otherwise different crates
|
|
18
|
+
# triggier bulding proto with different feature set that overwrites
|
|
19
|
+
# previous results and causes build errors
|
|
20
|
+
default = ["core", "platform", "client", "serde", "server"]
|
|
18
21
|
core = []
|
|
19
22
|
platform = []
|
|
20
23
|
# Re-export Dash Platform protobuf types as `dapi_grpc::platform::proto`
|
|
21
24
|
tenderdash-proto = []
|
|
22
25
|
client = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
|
|
26
|
+
server = ["tonic/channel", "tonic/tls", "tonic/tls-roots", "platform"]
|
|
23
27
|
serde = ["dep:serde", "dep:serde_bytes"]
|
|
24
28
|
mocks = ["dep:serde_json"]
|
|
25
29
|
|
|
26
30
|
[dependencies]
|
|
27
|
-
prost = { version = "0.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
prost = { version = "0.12.3" }
|
|
32
|
+
futures-core = "0.3.30"
|
|
33
|
+
tonic = { version = "0.11", features = [
|
|
34
|
+
"codegen",
|
|
35
|
+
"prost",
|
|
31
36
|
], default-features = false }
|
|
32
37
|
serde = { version = "1.0.171", optional = true, features = ["derive"] }
|
|
33
38
|
serde_bytes = { version = "0.11.12", optional = true }
|
|
34
39
|
serde_json = { version = "1.0", optional = true }
|
|
35
|
-
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci",
|
|
40
|
+
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", rev = "81d28aa0b15fc0844dfa7f7251f6949f6c6c405a", features = [
|
|
41
|
+
"grpc-server",
|
|
42
|
+
] }
|
|
36
43
|
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
|
|
37
44
|
platform-version = { path = "../rs-platform-version" }
|
|
38
45
|
|
package/build.rs
CHANGED
|
@@ -10,6 +10,7 @@ fn main() {
|
|
|
10
10
|
PathBuf::from("protos/core/v0/core.proto"),
|
|
11
11
|
PathBuf::from("src/core/proto"),
|
|
12
12
|
);
|
|
13
|
+
|
|
13
14
|
configure_core(core)
|
|
14
15
|
.generate()
|
|
15
16
|
.expect("generate core proto");
|
|
@@ -18,6 +19,7 @@ fn main() {
|
|
|
18
19
|
PathBuf::from("protos/platform/v0/platform.proto"),
|
|
19
20
|
PathBuf::from("src/platform/proto"),
|
|
20
21
|
);
|
|
22
|
+
|
|
21
23
|
configure_platform(platform)
|
|
22
24
|
.generate()
|
|
23
25
|
.expect("generate platform proto");
|
|
@@ -164,16 +166,16 @@ impl MappingConfig {
|
|
|
164
166
|
let protobuf_file = abs_path(&protobuf_file);
|
|
165
167
|
let out_dir = abs_path(&out_dir);
|
|
166
168
|
|
|
169
|
+
let build_server = cfg!(feature = "server");
|
|
170
|
+
let build_client = cfg!(feature = "client");
|
|
171
|
+
|
|
167
172
|
let builder = tonic_build::configure()
|
|
168
|
-
.build_server(
|
|
173
|
+
.build_server(build_server)
|
|
174
|
+
.build_client(build_client)
|
|
175
|
+
.build_transport(build_server || build_client)
|
|
169
176
|
.out_dir(out_dir.clone())
|
|
170
177
|
.protoc_arg("--experimental_allow_proto3_optional");
|
|
171
178
|
|
|
172
|
-
#[cfg(feature = "client")]
|
|
173
|
-
let builder = builder.build_client(true).build_transport(true);
|
|
174
|
-
#[cfg(not(feature = "client"))]
|
|
175
|
-
let builder = builder.build_client(false).build_transport(false);
|
|
176
|
-
|
|
177
179
|
Self {
|
|
178
180
|
protobuf_file,
|
|
179
181
|
out_dir,
|
|
@@ -48,6 +48,8 @@ const {
|
|
|
48
48
|
PBJSGetProtocolVersionUpgradeVoteStatusResponse,
|
|
49
49
|
GetProtocolVersionUpgradeStateRequest: PBJSGetProtocolVersionUpgradeStateRequest,
|
|
50
50
|
GetProtocolVersionUpgradeStateResponse: PBJSGetProtocolVersionUpgradeStateResponse,
|
|
51
|
+
GetProofsRequest: PBJSGetProofsRequest,
|
|
52
|
+
GetProofsResponse: PBJSGetProofsResponse,
|
|
51
53
|
GetIdentityContractNonceRequest: PBJSGetIdentityContractNonceRequest,
|
|
52
54
|
GetIdentityContractNonceResponse: PBJSGetIdentityContractNonceResponse,
|
|
53
55
|
GetIdentityNonceRequest: PBJSGetIdentityNonceRequest,
|
|
@@ -71,6 +73,7 @@ const {
|
|
|
71
73
|
GetEpochsInfoResponse: ProtocGetEpochsInfoResponse,
|
|
72
74
|
GetProtocolVersionUpgradeVoteStatusResponse: ProtocGetProtocolVersionUpgradeVoteStatusResponse,
|
|
73
75
|
GetProtocolVersionUpgradeStateResponse: ProtocGetProtocolVersionUpgradeStateResponse,
|
|
76
|
+
GetProofsResponse: ProtocGetProofsResponse,
|
|
74
77
|
GetIdentityContractNonceResponse: ProtocGetIdentityContractNonceResponse,
|
|
75
78
|
GetIdentityNonceResponse: ProtocGetIdentityNonceResponse,
|
|
76
79
|
} = require('./platform_protoc');
|
|
@@ -143,6 +146,10 @@ class PlatformPromiseClient {
|
|
|
143
146
|
this.client.getProtocolVersionUpgradeState.bind(this.client),
|
|
144
147
|
);
|
|
145
148
|
|
|
149
|
+
this.client.getProofs = promisify(
|
|
150
|
+
this.client.getProofs.bind(this.client),
|
|
151
|
+
);
|
|
152
|
+
|
|
146
153
|
this.client.getIdentityContractNonce = promisify(
|
|
147
154
|
this.client.getIdentityContractNonce.bind(this.client),
|
|
148
155
|
);
|
|
@@ -510,6 +517,38 @@ class PlatformPromiseClient {
|
|
|
510
517
|
);
|
|
511
518
|
}
|
|
512
519
|
|
|
520
|
+
/**
|
|
521
|
+
*
|
|
522
|
+
* @param {!GetProofsRequest} request
|
|
523
|
+
* @param {?Object<string, string>} metadata
|
|
524
|
+
* @param {CallOptions} [options={}]
|
|
525
|
+
* @returns {Promise<!GetProofsResponse>}
|
|
526
|
+
*/
|
|
527
|
+
getProofs(request, metadata = {}, options = {}) {
|
|
528
|
+
if (!isObject(metadata)) {
|
|
529
|
+
throw new Error('metadata must be an object');
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
return this.client.getProofs(
|
|
533
|
+
request,
|
|
534
|
+
convertObjectToMetadata(metadata),
|
|
535
|
+
{
|
|
536
|
+
interceptors: [
|
|
537
|
+
jsonToProtobufInterceptorFactory(
|
|
538
|
+
jsonToProtobufFactory(
|
|
539
|
+
ProtocGetProofsResponse,
|
|
540
|
+
PBJSGetProofsResponse,
|
|
541
|
+
),
|
|
542
|
+
protobufToJsonFactory(
|
|
543
|
+
PBJSGetProofsRequest,
|
|
544
|
+
),
|
|
545
|
+
),
|
|
546
|
+
],
|
|
547
|
+
...options,
|
|
548
|
+
},
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
|
|
513
552
|
/**
|
|
514
553
|
* @param {!PBJSGetIdentityContractNonceRequest} getIdentityContractNonceRequest
|
|
515
554
|
* @param {?Object<string, string>} metadata
|
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.6",
|
|
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.6",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|