@dashevo/dapi-grpc 1.8.0 → 2.0.0-rc.1
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/.eslintrc +3 -0
- package/Cargo.toml +35 -15
- package/build.rs +117 -22
- package/clients/drive/v0/nodejs/DrivePromiseClient.js +111 -0
- package/clients/drive/v0/nodejs/drive_pbjs.js +72524 -0
- package/clients/drive/v0/nodejs/drive_protoc.js +420 -0
- package/clients/drive/v0/web/drive_pb.d.ts +56 -0
- package/clients/drive/v0/web/drive_pb.js +420 -0
- package/clients/drive/v0/web/drive_pb_service.d.ts +63 -0
- package/clients/drive/v0/web/drive_pb_service.js +61 -0
- package/clients/platform/v0/nodejs/PlatformPromiseClient.js +0 -39
- package/clients/platform/v0/nodejs/platform_pbjs.js +30162 -7538
- package/clients/platform/v0/nodejs/platform_protoc.js +38679 -16741
- package/clients/platform/v0/web/platform_pb.d.ts +3337 -461
- package/clients/platform/v0/web/platform_pb.js +38679 -16741
- package/clients/platform/v0/web/platform_pb_service.d.ts +247 -19
- package/clients/platform/v0/web/platform_pb_service.js +501 -21
- package/lib/getDriveDefinition.js +18 -0
- package/node.js +19 -0
- package/package.json +3 -3
- package/protos/drive/v0/drive.proto +18 -0
- package/protos/platform/v0/platform.proto +888 -334
- package/scripts/build.sh +55 -0
- package/scripts/patch-protobuf-js.sh +3 -2
- package/src/lib.rs +42 -10
package/.eslintrc
CHANGED
package/Cargo.toml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "dapi-grpc"
|
|
3
3
|
description = "GRPC client for Dash Platform"
|
|
4
|
-
version = "
|
|
4
|
+
version = "2.0.0-rc.1"
|
|
5
5
|
authors = [
|
|
6
6
|
"Samuel Westrich <sam@dash.org>",
|
|
7
7
|
"Igor Markin <igor.markin@dash.org>",
|
|
@@ -15,41 +15,61 @@ license = "MIT"
|
|
|
15
15
|
|
|
16
16
|
[features]
|
|
17
17
|
default = ["core", "platform", "client"]
|
|
18
|
+
# Internal Drive endpoints. Used by DAPI
|
|
19
|
+
drive = ["platform"]
|
|
18
20
|
core = []
|
|
19
21
|
platform = []
|
|
20
22
|
# Re-export Dash Platform protobuf types as `dapi_grpc::platform::proto`
|
|
21
23
|
# Note: client needs tls and tls-roots to connect to testnet which uses TLS.
|
|
22
24
|
tenderdash-proto = []
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
|
|
26
|
+
# Client support.
|
|
27
|
+
client = ["platform"]
|
|
28
|
+
|
|
29
|
+
# Build tonic server code. Includes all client features and adds server-specific dependencies.
|
|
30
|
+
server = [
|
|
29
31
|
"platform",
|
|
32
|
+
"tenderdash-proto/server",
|
|
33
|
+
"client",
|
|
34
|
+
"drive",
|
|
35
|
+
"tonic/router",
|
|
30
36
|
]
|
|
31
|
-
|
|
32
|
-
serde = ["dep:serde", "dep:serde_bytes"]
|
|
37
|
+
|
|
38
|
+
serde = ["dep:serde", "dep:serde_bytes", "tenderdash-proto/serde"]
|
|
33
39
|
mocks = ["serde", "dep:serde_json"]
|
|
34
40
|
|
|
35
41
|
[dependencies]
|
|
42
|
+
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.4.0", tag = "v1.4.0", default-features = false }
|
|
43
|
+
|
|
36
44
|
prost = { version = "0.13" }
|
|
37
45
|
futures-core = "0.3.30"
|
|
38
|
-
tonic = { version = "0.
|
|
46
|
+
tonic = { version = "0.13.0", features = [
|
|
39
47
|
"codegen",
|
|
40
48
|
"prost",
|
|
49
|
+
"tls-ring",
|
|
41
50
|
], default-features = false }
|
|
42
|
-
serde = { version = "1.0.
|
|
51
|
+
serde = { version = "1.0.219", optional = true, features = ["derive"] }
|
|
43
52
|
serde_bytes = { version = "0.11.12", optional = true }
|
|
44
53
|
serde_json = { version = "1.0", optional = true }
|
|
45
|
-
tenderdash-proto = { git = "https://github.com/dashpay/rs-tenderdash-abci", version = "1.2.1", tag = "v1.2.1+1.3.0", default-features = false, features = [
|
|
46
|
-
"grpc",
|
|
47
|
-
] }
|
|
48
54
|
dapi-grpc-macros = { path = "../rs-dapi-grpc-macros" }
|
|
49
55
|
platform-version = { path = "../rs-platform-version" }
|
|
50
56
|
|
|
57
|
+
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
|
58
|
+
getrandom = { version = "0.2", features = ["js"] }
|
|
59
|
+
|
|
60
|
+
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
61
|
+
tonic = { version = "0.13.0", features = [
|
|
62
|
+
"codegen",
|
|
63
|
+
"prost",
|
|
64
|
+
"channel",
|
|
65
|
+
"transport",
|
|
66
|
+
"tls-native-roots",
|
|
67
|
+
"tls-webpki-roots",
|
|
68
|
+
"tls-ring",
|
|
69
|
+
], default-features = false }
|
|
70
|
+
|
|
51
71
|
[build-dependencies]
|
|
52
|
-
tonic-build = { version = "0.
|
|
72
|
+
tonic-build = { version = "0.13.0" }
|
|
53
73
|
|
|
54
74
|
[lib]
|
|
55
75
|
|
package/build.rs
CHANGED
|
@@ -2,7 +2,6 @@ use std::{
|
|
|
2
2
|
collections::HashSet,
|
|
3
3
|
fs::{create_dir_all, remove_dir_all},
|
|
4
4
|
path::PathBuf,
|
|
5
|
-
process::exit,
|
|
6
5
|
};
|
|
7
6
|
|
|
8
7
|
use tonic_build::Builder;
|
|
@@ -14,9 +13,24 @@ const SERDE_WITH_STRING: &str =
|
|
|
14
13
|
r#"#[cfg_attr(feature = "serde", serde(with = "crate::deserialization::from_to_string"))]"#;
|
|
15
14
|
|
|
16
15
|
fn main() {
|
|
16
|
+
#[cfg(feature = "server")]
|
|
17
|
+
generate_code(ImplType::Server);
|
|
18
|
+
#[cfg(feature = "client")]
|
|
19
|
+
generate_code(ImplType::Client);
|
|
20
|
+
|
|
21
|
+
if std::env::var("CARGO_CFG_TARGET_ARCH")
|
|
22
|
+
.unwrap_or_default()
|
|
23
|
+
.eq("wasm32")
|
|
24
|
+
{
|
|
25
|
+
generate_code(ImplType::Wasm);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fn generate_code(typ: ImplType) {
|
|
17
30
|
let core = MappingConfig::new(
|
|
18
31
|
PathBuf::from("protos/core/v0/core.proto"),
|
|
19
32
|
PathBuf::from("src/core"),
|
|
33
|
+
&typ,
|
|
20
34
|
);
|
|
21
35
|
|
|
22
36
|
configure_core(core)
|
|
@@ -26,14 +40,26 @@ fn main() {
|
|
|
26
40
|
let platform = MappingConfig::new(
|
|
27
41
|
PathBuf::from("protos/platform/v0/platform.proto"),
|
|
28
42
|
PathBuf::from("src/platform"),
|
|
43
|
+
&typ,
|
|
29
44
|
);
|
|
30
45
|
|
|
31
46
|
configure_platform(platform)
|
|
32
47
|
.generate()
|
|
33
48
|
.expect("generate platform proto");
|
|
34
49
|
|
|
50
|
+
let drive = MappingConfig::new(
|
|
51
|
+
PathBuf::from("protos/drive/v0/drive.proto"),
|
|
52
|
+
PathBuf::from("src/drive"),
|
|
53
|
+
&typ,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
configure_drive(drive)
|
|
57
|
+
.generate()
|
|
58
|
+
.expect("generate platform proto");
|
|
59
|
+
|
|
35
60
|
println!("cargo:rerun-if-changed=./protos");
|
|
36
61
|
println!("cargo:rerun-if-env-changed=CARGO_FEATURE_SERDE");
|
|
62
|
+
println!("cargo:rerun-if-env-changed=CARGO_CFG_TARGET_ARCH");
|
|
37
63
|
}
|
|
38
64
|
|
|
39
65
|
struct MappingConfig {
|
|
@@ -47,7 +73,7 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
47
73
|
// Derive features for versioned messages
|
|
48
74
|
//
|
|
49
75
|
// "GetConsensusParamsRequest" is excluded as this message does not support proofs
|
|
50
|
-
const VERSIONED_REQUESTS: [&str;
|
|
76
|
+
const VERSIONED_REQUESTS: [&str; 41] = [
|
|
51
77
|
"GetDataContractHistoryRequest",
|
|
52
78
|
"GetDataContractRequest",
|
|
53
79
|
"GetDataContractsRequest",
|
|
@@ -59,10 +85,10 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
59
85
|
"GetIdentityContractNonceRequest",
|
|
60
86
|
"GetIdentityBalanceAndRevisionRequest",
|
|
61
87
|
"GetIdentityBalanceRequest",
|
|
88
|
+
"GetIdentityByNonUniquePublicKeyHashRequest",
|
|
62
89
|
"GetIdentityByPublicKeyHashRequest",
|
|
63
90
|
"GetIdentityKeysRequest",
|
|
64
91
|
"GetIdentityRequest",
|
|
65
|
-
"GetProofsRequest",
|
|
66
92
|
"WaitForStateTransitionResultRequest",
|
|
67
93
|
"GetProtocolVersionUpgradeStateRequest",
|
|
68
94
|
"GetProtocolVersionUpgradeVoteStatusRequest",
|
|
@@ -78,14 +104,28 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
78
104
|
"GetEvonodesProposedEpochBlocksByIdsRequest",
|
|
79
105
|
"GetEvonodesProposedEpochBlocksByRangeRequest",
|
|
80
106
|
"GetStatusRequest",
|
|
107
|
+
"GetIdentityTokenBalancesRequest",
|
|
108
|
+
"GetIdentitiesTokenBalancesRequest",
|
|
109
|
+
"GetIdentityTokenInfosRequest",
|
|
110
|
+
"GetIdentitiesTokenInfosRequest",
|
|
111
|
+
"GetTokenDirectPurchasePricesRequest",
|
|
112
|
+
"GetTokenStatusesRequest",
|
|
113
|
+
"GetTokenTotalSupplyRequest",
|
|
114
|
+
"GetGroupInfoRequest",
|
|
115
|
+
"GetGroupInfosRequest",
|
|
116
|
+
"GetGroupActionsRequest",
|
|
117
|
+
"GetGroupActionSignersRequest",
|
|
81
118
|
];
|
|
82
119
|
|
|
83
120
|
// The following responses are excluded as they don't support proofs:
|
|
84
121
|
// - "GetConsensusParamsResponse"
|
|
85
122
|
// - "GetStatusResponse"
|
|
86
123
|
//
|
|
124
|
+
// The following responses are excluded as they need custom proof handling:
|
|
125
|
+
// - "GetIdentityByNonUniquePublicKeyHashResponse"
|
|
126
|
+
//
|
|
87
127
|
// "GetEvonodesProposedEpochBlocksResponse" is used for 2 Requests
|
|
88
|
-
const VERSIONED_RESPONSES: [&str;
|
|
128
|
+
const VERSIONED_RESPONSES: [&str; 39] = [
|
|
89
129
|
"GetDataContractHistoryResponse",
|
|
90
130
|
"GetDataContractResponse",
|
|
91
131
|
"GetDataContractsResponse",
|
|
@@ -100,7 +140,6 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
100
140
|
"GetIdentityByPublicKeyHashResponse",
|
|
101
141
|
"GetIdentityKeysResponse",
|
|
102
142
|
"GetIdentityResponse",
|
|
103
|
-
"GetProofsResponse",
|
|
104
143
|
"WaitForStateTransitionResultResponse",
|
|
105
144
|
"GetEpochsInfoResponse",
|
|
106
145
|
"GetProtocolVersionUpgradeStateResponse",
|
|
@@ -115,6 +154,17 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
115
154
|
"GetVotePollsByEndDateResponse",
|
|
116
155
|
"GetTotalCreditsInPlatformResponse",
|
|
117
156
|
"GetEvonodesProposedEpochBlocksResponse",
|
|
157
|
+
"GetIdentityTokenBalancesResponse",
|
|
158
|
+
"GetIdentitiesTokenBalancesResponse",
|
|
159
|
+
"GetIdentityTokenInfosResponse",
|
|
160
|
+
"GetIdentitiesTokenInfosResponse",
|
|
161
|
+
"GetTokenDirectPurchasePricesResponse",
|
|
162
|
+
"GetTokenStatusesResponse",
|
|
163
|
+
"GetTokenTotalSupplyResponse",
|
|
164
|
+
"GetGroupInfoResponse",
|
|
165
|
+
"GetGroupInfosResponse",
|
|
166
|
+
"GetGroupActionsResponse",
|
|
167
|
+
"GetGroupActionSignersResponse",
|
|
118
168
|
];
|
|
119
169
|
|
|
120
170
|
check_unique(&VERSIONED_REQUESTS).expect("VERSIONED_REQUESTS");
|
|
@@ -174,6 +224,19 @@ fn configure_platform(mut platform: MappingConfig) -> MappingConfig {
|
|
|
174
224
|
platform
|
|
175
225
|
}
|
|
176
226
|
|
|
227
|
+
fn configure_drive(drive: MappingConfig) -> MappingConfig {
|
|
228
|
+
drive
|
|
229
|
+
.message_attribute(".", r#"#[derive( ::dapi_grpc_macros::Mockable)]"#)
|
|
230
|
+
.type_attribute(
|
|
231
|
+
".",
|
|
232
|
+
r#"#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]"#,
|
|
233
|
+
)
|
|
234
|
+
.type_attribute(
|
|
235
|
+
".",
|
|
236
|
+
r#"#[cfg_attr(feature = "serde", serde(rename_all = "snake_case"))]"#,
|
|
237
|
+
)
|
|
238
|
+
}
|
|
239
|
+
|
|
177
240
|
/// Check for duplicate messages in the list.
|
|
178
241
|
fn check_unique(messages: &[&'static str]) -> Result<(), String> {
|
|
179
242
|
let mut hashset: HashSet<&'static str> = HashSet::new();
|
|
@@ -210,6 +273,43 @@ fn configure_core(core: MappingConfig) -> MappingConfig {
|
|
|
210
273
|
core
|
|
211
274
|
}
|
|
212
275
|
|
|
276
|
+
#[allow(unused)]
|
|
277
|
+
enum ImplType {
|
|
278
|
+
Server,
|
|
279
|
+
Client,
|
|
280
|
+
Wasm,
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
impl ImplType {
|
|
284
|
+
// Configure the builder based on the implementation type.
|
|
285
|
+
pub fn configure(&self, builder: Builder) -> Builder {
|
|
286
|
+
match self {
|
|
287
|
+
Self::Server => builder
|
|
288
|
+
.build_client(true)
|
|
289
|
+
.build_server(true)
|
|
290
|
+
.build_transport(true),
|
|
291
|
+
Self::Client => builder
|
|
292
|
+
.build_client(true)
|
|
293
|
+
.build_server(false)
|
|
294
|
+
.build_transport(true),
|
|
295
|
+
Self::Wasm => builder
|
|
296
|
+
.build_client(true)
|
|
297
|
+
.build_server(false)
|
|
298
|
+
.build_transport(false),
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/// Get the directory name for the implementation type.
|
|
303
|
+
fn dirname(&self) -> String {
|
|
304
|
+
match self {
|
|
305
|
+
Self::Server => "server",
|
|
306
|
+
Self::Client => "client",
|
|
307
|
+
Self::Wasm => "wasm",
|
|
308
|
+
}
|
|
309
|
+
.to_string()
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
213
313
|
impl MappingConfig {
|
|
214
314
|
/// Create a new MappingConfig instance.
|
|
215
315
|
///
|
|
@@ -220,31 +320,18 @@ impl MappingConfig {
|
|
|
220
320
|
///
|
|
221
321
|
/// Depending on the features, either `client`, `server` or `client_server` subdirectory
|
|
222
322
|
/// will be created inside `out_dir`.
|
|
223
|
-
fn new(protobuf_file: PathBuf, out_dir: PathBuf) -> Self {
|
|
323
|
+
fn new(protobuf_file: PathBuf, out_dir: PathBuf, typ: &ImplType) -> Self {
|
|
224
324
|
let protobuf_file = abs_path(&protobuf_file);
|
|
225
325
|
|
|
226
|
-
let build_server = cfg!(feature = "server");
|
|
227
|
-
let build_client = cfg!(feature = "client");
|
|
228
|
-
|
|
229
326
|
// Depending on the features, we need to build the server, client or both.
|
|
230
327
|
// We save these artifacts in separate directories to avoid overwriting the generated files
|
|
231
328
|
// when another crate requires different features.
|
|
232
|
-
let out_dir_suffix =
|
|
233
|
-
(true, true) => "client_server",
|
|
234
|
-
(true, false) => "server",
|
|
235
|
-
(false, true) => "client",
|
|
236
|
-
(false, false) => {
|
|
237
|
-
println!("WARNING: At least one of the features 'server' or 'client' must be enabled; dapi-grpc will not generate any files.");
|
|
238
|
-
exit(0)
|
|
239
|
-
}
|
|
240
|
-
};
|
|
329
|
+
let out_dir_suffix = typ.dirname();
|
|
241
330
|
|
|
242
331
|
let out_dir = abs_path(&out_dir.join(out_dir_suffix));
|
|
243
332
|
|
|
244
|
-
let builder =
|
|
245
|
-
.
|
|
246
|
-
.build_client(build_client)
|
|
247
|
-
.build_transport(build_server || build_client)
|
|
333
|
+
let builder = typ
|
|
334
|
+
.configure(tonic_build::configure())
|
|
248
335
|
.out_dir(out_dir.clone())
|
|
249
336
|
.protoc_arg("--experimental_allow_proto3_optional");
|
|
250
337
|
|
|
@@ -262,6 +349,14 @@ impl MappingConfig {
|
|
|
262
349
|
self
|
|
263
350
|
}
|
|
264
351
|
|
|
352
|
+
#[allow(unused)]
|
|
353
|
+
fn includes(mut self, includes: &[PathBuf]) -> Self {
|
|
354
|
+
for include in includes {
|
|
355
|
+
self.proto_includes.push(abs_path(include));
|
|
356
|
+
}
|
|
357
|
+
self
|
|
358
|
+
}
|
|
359
|
+
|
|
265
360
|
#[allow(unused)]
|
|
266
361
|
fn field_attribute(mut self, path: &str, attribute: &str) -> Self {
|
|
267
362
|
self.builder = self.builder.field_attribute(path, attribute);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
const grpc = require('@grpc/grpc-js');
|
|
2
|
+
const { promisify } = require('util');
|
|
3
|
+
|
|
4
|
+
const {
|
|
5
|
+
convertObjectToMetadata,
|
|
6
|
+
utils: {
|
|
7
|
+
isObject,
|
|
8
|
+
},
|
|
9
|
+
client: {
|
|
10
|
+
interceptors: {
|
|
11
|
+
jsonToProtobufInterceptorFactory,
|
|
12
|
+
},
|
|
13
|
+
converters: {
|
|
14
|
+
jsonToProtobufFactory,
|
|
15
|
+
protobufToJsonFactory,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
} = require('@dashevo/grpc-common');
|
|
19
|
+
|
|
20
|
+
const { URL } = require('url');
|
|
21
|
+
const {
|
|
22
|
+
org: {
|
|
23
|
+
dash: {
|
|
24
|
+
platform: {
|
|
25
|
+
drive: {
|
|
26
|
+
v0: {
|
|
27
|
+
GetProofsRequest: PBJSGetProofsRequest,
|
|
28
|
+
GetProofsResponse: PBJSGetProofsResponse,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
} = require('./drive_pbjs');
|
|
35
|
+
|
|
36
|
+
const {
|
|
37
|
+
GetProofsResponse: ProtocGetProofsResponse,
|
|
38
|
+
} = require('./drive_protoc');
|
|
39
|
+
|
|
40
|
+
const getDriveDefinition = require('../../../../lib/getDriveDefinition');
|
|
41
|
+
|
|
42
|
+
const DriveNodeJSClient = getDriveDefinition(0);
|
|
43
|
+
|
|
44
|
+
class DrivePromiseClient {
|
|
45
|
+
/**
|
|
46
|
+
* @param {string} hostname
|
|
47
|
+
* @param {?Object} credentials
|
|
48
|
+
* @param {?Object} options
|
|
49
|
+
*/
|
|
50
|
+
constructor(hostname, credentials, options = {}) {
|
|
51
|
+
if (credentials !== undefined) {
|
|
52
|
+
throw new Error('"credentials" option is not supported yet');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const url = new URL(hostname);
|
|
56
|
+
const { protocol, host: strippedHostname } = url;
|
|
57
|
+
|
|
58
|
+
// See this issue https://github.com/nodejs/node/issues/3176
|
|
59
|
+
// eslint-disable-next-line no-param-reassign
|
|
60
|
+
credentials = protocol.replace(':', '') === 'https' ? grpc.credentials.createSsl() : grpc.credentials.createInsecure();
|
|
61
|
+
|
|
62
|
+
this.client = new DriveNodeJSClient(strippedHostname, credentials, options);
|
|
63
|
+
|
|
64
|
+
this.client.getProofs = promisify(
|
|
65
|
+
this.client.getProofs.bind(this.client),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
this.protocolVersion = undefined;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @param {!GetProofsRequest} request
|
|
74
|
+
* @param {?Object<string, string>} metadata
|
|
75
|
+
* @param {CallOptions} [options={}]
|
|
76
|
+
* @returns {Promise<!GetProofsResponse>}
|
|
77
|
+
*/
|
|
78
|
+
getProofs(request, metadata = {}, options = {}) {
|
|
79
|
+
if (!isObject(metadata)) {
|
|
80
|
+
throw new Error('metadata must be an object');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return this.client.getProofs(
|
|
84
|
+
request,
|
|
85
|
+
convertObjectToMetadata(metadata),
|
|
86
|
+
{
|
|
87
|
+
interceptors: [
|
|
88
|
+
jsonToProtobufInterceptorFactory(
|
|
89
|
+
jsonToProtobufFactory(
|
|
90
|
+
ProtocGetProofsResponse,
|
|
91
|
+
PBJSGetProofsResponse,
|
|
92
|
+
),
|
|
93
|
+
protobufToJsonFactory(
|
|
94
|
+
PBJSGetProofsRequest,
|
|
95
|
+
),
|
|
96
|
+
),
|
|
97
|
+
],
|
|
98
|
+
...options,
|
|
99
|
+
},
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @param {string} protocolVersion
|
|
105
|
+
*/
|
|
106
|
+
setProtocolVersion(protocolVersion) {
|
|
107
|
+
this.protocolVersion = protocolVersion;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
module.exports = DrivePromiseClient;
|