@dashevo/dapi-grpc 3.0.1-hotfix.4 → 3.1.0-dev.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.
@@ -1,808 +0,0 @@
1
- // This file is @generated by prost-build.
2
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
3
- #[derive(::dash_platform_macros::Mockable)]
4
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5
- pub struct GetBlockchainStatusRequest {}
6
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
7
- #[derive(::dash_platform_macros::Mockable)]
8
- #[derive(Clone, PartialEq, ::prost::Message)]
9
- pub struct GetBlockchainStatusResponse {
10
- #[prost(message, optional, tag = "1")]
11
- pub version: ::core::option::Option<get_blockchain_status_response::Version>,
12
- #[prost(message, optional, tag = "2")]
13
- pub time: ::core::option::Option<get_blockchain_status_response::Time>,
14
- #[prost(enumeration = "get_blockchain_status_response::Status", tag = "3")]
15
- pub status: i32,
16
- #[prost(double, tag = "4")]
17
- pub sync_progress: f64,
18
- #[prost(message, optional, tag = "5")]
19
- pub chain: ::core::option::Option<get_blockchain_status_response::Chain>,
20
- #[prost(message, optional, tag = "7")]
21
- pub network: ::core::option::Option<get_blockchain_status_response::Network>,
22
- }
23
- /// Nested message and enum types in `GetBlockchainStatusResponse`.
24
- pub mod get_blockchain_status_response {
25
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
26
- #[derive(::dash_platform_macros::Mockable)]
27
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
28
- pub struct Version {
29
- #[prost(uint32, tag = "1")]
30
- pub protocol: u32,
31
- #[prost(uint32, tag = "2")]
32
- pub software: u32,
33
- #[prost(string, tag = "3")]
34
- pub agent: ::prost::alloc::string::String,
35
- }
36
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
37
- #[derive(::dash_platform_macros::Mockable)]
38
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
39
- pub struct Time {
40
- #[prost(uint32, tag = "1")]
41
- pub now: u32,
42
- #[prost(int32, tag = "2")]
43
- pub offset: i32,
44
- #[prost(uint32, tag = "3")]
45
- pub median: u32,
46
- }
47
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
48
- #[derive(::dash_platform_macros::Mockable)]
49
- #[derive(Clone, PartialEq, ::prost::Message)]
50
- pub struct Chain {
51
- #[prost(string, tag = "1")]
52
- pub name: ::prost::alloc::string::String,
53
- #[prost(uint32, tag = "2")]
54
- pub headers_count: u32,
55
- #[prost(uint32, tag = "3")]
56
- pub blocks_count: u32,
57
- #[prost(bytes = "vec", tag = "4")]
58
- pub best_block_hash: ::prost::alloc::vec::Vec<u8>,
59
- #[prost(double, tag = "5")]
60
- pub difficulty: f64,
61
- #[prost(bytes = "vec", tag = "6")]
62
- pub chain_work: ::prost::alloc::vec::Vec<u8>,
63
- #[prost(bool, tag = "7")]
64
- pub is_synced: bool,
65
- #[prost(double, tag = "8")]
66
- pub sync_progress: f64,
67
- }
68
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
69
- #[derive(::dash_platform_macros::Mockable)]
70
- #[derive(Clone, Copy, PartialEq, ::prost::Message)]
71
- pub struct NetworkFee {
72
- #[prost(double, tag = "1")]
73
- pub relay: f64,
74
- #[prost(double, tag = "2")]
75
- pub incremental: f64,
76
- }
77
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
78
- #[derive(::dash_platform_macros::Mockable)]
79
- #[derive(Clone, Copy, PartialEq, ::prost::Message)]
80
- pub struct Network {
81
- #[prost(uint32, tag = "1")]
82
- pub peers_count: u32,
83
- #[prost(message, optional, tag = "2")]
84
- pub fee: ::core::option::Option<NetworkFee>,
85
- }
86
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
87
- #[derive(
88
- Clone,
89
- Copy,
90
- Debug,
91
- PartialEq,
92
- Eq,
93
- Hash,
94
- PartialOrd,
95
- Ord,
96
- ::prost::Enumeration
97
- )]
98
- #[repr(i32)]
99
- pub enum Status {
100
- NotStarted = 0,
101
- Syncing = 1,
102
- Ready = 2,
103
- Error = 3,
104
- }
105
- impl Status {
106
- /// String value of the enum field names used in the ProtoBuf definition.
107
- ///
108
- /// The values are not transformed in any way and thus are considered stable
109
- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
110
- pub fn as_str_name(&self) -> &'static str {
111
- match self {
112
- Self::NotStarted => "NOT_STARTED",
113
- Self::Syncing => "SYNCING",
114
- Self::Ready => "READY",
115
- Self::Error => "ERROR",
116
- }
117
- }
118
- /// Creates an enum from field names used in the ProtoBuf definition.
119
- pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
120
- match value {
121
- "NOT_STARTED" => Some(Self::NotStarted),
122
- "SYNCING" => Some(Self::Syncing),
123
- "READY" => Some(Self::Ready),
124
- "ERROR" => Some(Self::Error),
125
- _ => None,
126
- }
127
- }
128
- }
129
- }
130
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
131
- #[derive(::dash_platform_macros::Mockable)]
132
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
133
- pub struct GetMasternodeStatusRequest {}
134
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
135
- #[derive(::dash_platform_macros::Mockable)]
136
- #[derive(Clone, PartialEq, ::prost::Message)]
137
- pub struct GetMasternodeStatusResponse {
138
- #[prost(enumeration = "get_masternode_status_response::Status", tag = "1")]
139
- pub status: i32,
140
- #[prost(bytes = "vec", tag = "2")]
141
- pub pro_tx_hash: ::prost::alloc::vec::Vec<u8>,
142
- #[prost(uint32, tag = "3")]
143
- pub pose_penalty: u32,
144
- #[prost(bool, tag = "4")]
145
- pub is_synced: bool,
146
- #[prost(double, tag = "5")]
147
- pub sync_progress: f64,
148
- }
149
- /// Nested message and enum types in `GetMasternodeStatusResponse`.
150
- pub mod get_masternode_status_response {
151
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
152
- #[derive(
153
- Clone,
154
- Copy,
155
- Debug,
156
- PartialEq,
157
- Eq,
158
- Hash,
159
- PartialOrd,
160
- Ord,
161
- ::prost::Enumeration
162
- )]
163
- #[repr(i32)]
164
- pub enum Status {
165
- Unknown = 0,
166
- WaitingForProtx = 1,
167
- PoseBanned = 2,
168
- Removed = 3,
169
- OperatorKeyChanged = 4,
170
- ProtxIpChanged = 5,
171
- Ready = 6,
172
- Error = 7,
173
- }
174
- impl Status {
175
- /// String value of the enum field names used in the ProtoBuf definition.
176
- ///
177
- /// The values are not transformed in any way and thus are considered stable
178
- /// (if the ProtoBuf definition does not change) and safe for programmatic use.
179
- pub fn as_str_name(&self) -> &'static str {
180
- match self {
181
- Self::Unknown => "UNKNOWN",
182
- Self::WaitingForProtx => "WAITING_FOR_PROTX",
183
- Self::PoseBanned => "POSE_BANNED",
184
- Self::Removed => "REMOVED",
185
- Self::OperatorKeyChanged => "OPERATOR_KEY_CHANGED",
186
- Self::ProtxIpChanged => "PROTX_IP_CHANGED",
187
- Self::Ready => "READY",
188
- Self::Error => "ERROR",
189
- }
190
- }
191
- /// Creates an enum from field names used in the ProtoBuf definition.
192
- pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
193
- match value {
194
- "UNKNOWN" => Some(Self::Unknown),
195
- "WAITING_FOR_PROTX" => Some(Self::WaitingForProtx),
196
- "POSE_BANNED" => Some(Self::PoseBanned),
197
- "REMOVED" => Some(Self::Removed),
198
- "OPERATOR_KEY_CHANGED" => Some(Self::OperatorKeyChanged),
199
- "PROTX_IP_CHANGED" => Some(Self::ProtxIpChanged),
200
- "READY" => Some(Self::Ready),
201
- "ERROR" => Some(Self::Error),
202
- _ => None,
203
- }
204
- }
205
- }
206
- }
207
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
208
- #[derive(::dash_platform_macros::Mockable)]
209
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
210
- pub struct GetBlockRequest {
211
- #[prost(oneof = "get_block_request::Block", tags = "1, 2")]
212
- pub block: ::core::option::Option<get_block_request::Block>,
213
- }
214
- /// Nested message and enum types in `GetBlockRequest`.
215
- pub mod get_block_request {
216
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
217
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
218
- pub enum Block {
219
- #[prost(uint32, tag = "1")]
220
- Height(u32),
221
- #[prost(string, tag = "2")]
222
- Hash(::prost::alloc::string::String),
223
- }
224
- }
225
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
226
- #[derive(::dash_platform_macros::Mockable)]
227
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
228
- pub struct GetBlockResponse {
229
- #[prost(bytes = "vec", tag = "1")]
230
- pub block: ::prost::alloc::vec::Vec<u8>,
231
- }
232
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
233
- #[derive(::dash_platform_macros::Mockable)]
234
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
235
- pub struct GetBestBlockHeightRequest {}
236
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
237
- #[derive(::dash_platform_macros::Mockable)]
238
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
239
- pub struct GetBestBlockHeightResponse {
240
- #[prost(uint32, tag = "1")]
241
- pub height: u32,
242
- }
243
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
244
- #[derive(::dash_platform_macros::Mockable)]
245
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
246
- pub struct BroadcastTransactionRequest {
247
- #[prost(bytes = "vec", tag = "1")]
248
- pub transaction: ::prost::alloc::vec::Vec<u8>,
249
- #[prost(bool, tag = "2")]
250
- pub allow_high_fees: bool,
251
- #[prost(bool, tag = "3")]
252
- pub bypass_limits: bool,
253
- }
254
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
255
- #[derive(::dash_platform_macros::Mockable)]
256
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
257
- pub struct BroadcastTransactionResponse {
258
- #[prost(string, tag = "1")]
259
- pub transaction_id: ::prost::alloc::string::String,
260
- }
261
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
262
- #[derive(::dash_platform_macros::Mockable)]
263
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
264
- pub struct GetTransactionRequest {
265
- #[prost(string, tag = "1")]
266
- pub id: ::prost::alloc::string::String,
267
- }
268
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
269
- #[derive(::dash_platform_macros::Mockable)]
270
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
271
- pub struct GetTransactionResponse {
272
- #[prost(bytes = "vec", tag = "1")]
273
- pub transaction: ::prost::alloc::vec::Vec<u8>,
274
- #[prost(bytes = "vec", tag = "2")]
275
- pub block_hash: ::prost::alloc::vec::Vec<u8>,
276
- #[prost(uint32, tag = "3")]
277
- pub height: u32,
278
- #[prost(uint32, tag = "4")]
279
- pub confirmations: u32,
280
- #[prost(bool, tag = "5")]
281
- pub is_instant_locked: bool,
282
- #[prost(bool, tag = "6")]
283
- pub is_chain_locked: bool,
284
- }
285
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
286
- #[derive(::dash_platform_macros::Mockable)]
287
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
288
- pub struct BlockHeadersWithChainLocksRequest {
289
- #[prost(uint32, tag = "3")]
290
- pub count: u32,
291
- #[prost(oneof = "block_headers_with_chain_locks_request::FromBlock", tags = "1, 2")]
292
- pub from_block: ::core::option::Option<
293
- block_headers_with_chain_locks_request::FromBlock,
294
- >,
295
- }
296
- /// Nested message and enum types in `BlockHeadersWithChainLocksRequest`.
297
- pub mod block_headers_with_chain_locks_request {
298
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
299
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
300
- pub enum FromBlock {
301
- #[prost(bytes, tag = "1")]
302
- FromBlockHash(::prost::alloc::vec::Vec<u8>),
303
- #[prost(uint32, tag = "2")]
304
- FromBlockHeight(u32),
305
- }
306
- }
307
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
308
- #[derive(::dash_platform_macros::Mockable)]
309
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
310
- pub struct BlockHeadersWithChainLocksResponse {
311
- #[prost(oneof = "block_headers_with_chain_locks_response::Responses", tags = "1, 2")]
312
- pub responses: ::core::option::Option<
313
- block_headers_with_chain_locks_response::Responses,
314
- >,
315
- }
316
- /// Nested message and enum types in `BlockHeadersWithChainLocksResponse`.
317
- pub mod block_headers_with_chain_locks_response {
318
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
319
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
320
- pub enum Responses {
321
- #[prost(message, tag = "1")]
322
- BlockHeaders(super::BlockHeaders),
323
- #[prost(bytes, tag = "2")]
324
- ChainLock(::prost::alloc::vec::Vec<u8>),
325
- }
326
- }
327
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
328
- #[derive(::dash_platform_macros::Mockable)]
329
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
330
- pub struct BlockHeaders {
331
- #[prost(bytes = "vec", repeated, tag = "1")]
332
- pub headers: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
333
- }
334
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
335
- #[derive(::dash_platform_macros::Mockable)]
336
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
337
- pub struct GetEstimatedTransactionFeeRequest {
338
- #[prost(uint32, tag = "1")]
339
- pub blocks: u32,
340
- }
341
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
342
- #[derive(::dash_platform_macros::Mockable)]
343
- #[derive(Clone, Copy, PartialEq, ::prost::Message)]
344
- pub struct GetEstimatedTransactionFeeResponse {
345
- #[prost(double, tag = "1")]
346
- pub fee: f64,
347
- }
348
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
349
- #[derive(::dash_platform_macros::Mockable)]
350
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
351
- pub struct TransactionsWithProofsRequest {
352
- #[prost(message, optional, tag = "1")]
353
- pub bloom_filter: ::core::option::Option<BloomFilter>,
354
- #[prost(uint32, tag = "4")]
355
- pub count: u32,
356
- #[prost(bool, tag = "5")]
357
- pub send_transaction_hashes: bool,
358
- #[prost(oneof = "transactions_with_proofs_request::FromBlock", tags = "2, 3")]
359
- pub from_block: ::core::option::Option<transactions_with_proofs_request::FromBlock>,
360
- }
361
- /// Nested message and enum types in `TransactionsWithProofsRequest`.
362
- pub mod transactions_with_proofs_request {
363
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
364
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
365
- pub enum FromBlock {
366
- #[prost(bytes, tag = "2")]
367
- FromBlockHash(::prost::alloc::vec::Vec<u8>),
368
- #[prost(uint32, tag = "3")]
369
- FromBlockHeight(u32),
370
- }
371
- }
372
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
373
- #[derive(::dash_platform_macros::Mockable)]
374
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
375
- pub struct BloomFilter {
376
- #[prost(bytes = "vec", tag = "1")]
377
- pub v_data: ::prost::alloc::vec::Vec<u8>,
378
- #[prost(uint32, tag = "2")]
379
- pub n_hash_funcs: u32,
380
- #[prost(uint32, tag = "3")]
381
- pub n_tweak: u32,
382
- #[prost(uint32, tag = "4")]
383
- pub n_flags: u32,
384
- }
385
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
386
- #[derive(::dash_platform_macros::Mockable)]
387
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
388
- pub struct TransactionsWithProofsResponse {
389
- #[prost(oneof = "transactions_with_proofs_response::Responses", tags = "1, 2, 3")]
390
- pub responses: ::core::option::Option<transactions_with_proofs_response::Responses>,
391
- }
392
- /// Nested message and enum types in `TransactionsWithProofsResponse`.
393
- pub mod transactions_with_proofs_response {
394
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
395
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
396
- pub enum Responses {
397
- #[prost(message, tag = "1")]
398
- RawTransactions(super::RawTransactions),
399
- #[prost(message, tag = "2")]
400
- InstantSendLockMessages(super::InstantSendLockMessages),
401
- #[prost(bytes, tag = "3")]
402
- RawMerkleBlock(::prost::alloc::vec::Vec<u8>),
403
- }
404
- }
405
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
406
- #[derive(::dash_platform_macros::Mockable)]
407
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
408
- pub struct RawTransactions {
409
- #[prost(bytes = "vec", repeated, tag = "1")]
410
- pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
411
- }
412
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
413
- #[derive(::dash_platform_macros::Mockable)]
414
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
415
- pub struct InstantSendLockMessages {
416
- #[prost(bytes = "vec", repeated, tag = "1")]
417
- pub messages: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
418
- }
419
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
420
- #[derive(::dash_platform_macros::Mockable)]
421
- #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
422
- pub struct MasternodeListRequest {}
423
- #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))]
424
- #[derive(::dash_platform_macros::Mockable)]
425
- #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
426
- pub struct MasternodeListResponse {
427
- #[prost(bytes = "vec", tag = "1")]
428
- pub masternode_list_diff: ::prost::alloc::vec::Vec<u8>,
429
- }
430
- /// Generated client implementations.
431
- pub mod core_client {
432
- #![allow(
433
- unused_variables,
434
- dead_code,
435
- missing_docs,
436
- clippy::wildcard_imports,
437
- clippy::let_unit_value,
438
- )]
439
- use tonic::codegen::*;
440
- use tonic::codegen::http::Uri;
441
- #[derive(Debug, Clone)]
442
- pub struct CoreClient<T> {
443
- inner: tonic::client::Grpc<T>,
444
- }
445
- impl CoreClient<tonic::transport::Channel> {
446
- /// Attempt to create a new client by connecting to a given endpoint.
447
- pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
448
- where
449
- D: TryInto<tonic::transport::Endpoint>,
450
- D::Error: Into<StdError>,
451
- {
452
- let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
453
- Ok(Self::new(conn))
454
- }
455
- }
456
- impl<T> CoreClient<T>
457
- where
458
- T: tonic::client::GrpcService<tonic::body::Body>,
459
- T::Error: Into<StdError>,
460
- T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
461
- <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
462
- {
463
- pub fn new(inner: T) -> Self {
464
- let inner = tonic::client::Grpc::new(inner);
465
- Self { inner }
466
- }
467
- pub fn with_origin(inner: T, origin: Uri) -> Self {
468
- let inner = tonic::client::Grpc::with_origin(inner, origin);
469
- Self { inner }
470
- }
471
- pub fn with_interceptor<F>(
472
- inner: T,
473
- interceptor: F,
474
- ) -> CoreClient<InterceptedService<T, F>>
475
- where
476
- F: tonic::service::Interceptor,
477
- T::ResponseBody: Default,
478
- T: tonic::codegen::Service<
479
- http::Request<tonic::body::Body>,
480
- Response = http::Response<
481
- <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
482
- >,
483
- >,
484
- <T as tonic::codegen::Service<
485
- http::Request<tonic::body::Body>,
486
- >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
487
- {
488
- CoreClient::new(InterceptedService::new(inner, interceptor))
489
- }
490
- /// Compress requests with the given encoding.
491
- ///
492
- /// This requires the server to support it otherwise it might respond with an
493
- /// error.
494
- #[must_use]
495
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
496
- self.inner = self.inner.send_compressed(encoding);
497
- self
498
- }
499
- /// Enable decompressing responses.
500
- #[must_use]
501
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
502
- self.inner = self.inner.accept_compressed(encoding);
503
- self
504
- }
505
- /// Limits the maximum size of a decoded message.
506
- ///
507
- /// Default: `4MB`
508
- #[must_use]
509
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
510
- self.inner = self.inner.max_decoding_message_size(limit);
511
- self
512
- }
513
- /// Limits the maximum size of an encoded message.
514
- ///
515
- /// Default: `usize::MAX`
516
- #[must_use]
517
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
518
- self.inner = self.inner.max_encoding_message_size(limit);
519
- self
520
- }
521
- pub async fn get_blockchain_status(
522
- &mut self,
523
- request: impl tonic::IntoRequest<super::GetBlockchainStatusRequest>,
524
- ) -> std::result::Result<
525
- tonic::Response<super::GetBlockchainStatusResponse>,
526
- tonic::Status,
527
- > {
528
- self.inner
529
- .ready()
530
- .await
531
- .map_err(|e| {
532
- tonic::Status::unknown(
533
- format!("Service was not ready: {}", e.into()),
534
- )
535
- })?;
536
- let codec = tonic_prost::ProstCodec::default();
537
- let path = http::uri::PathAndQuery::from_static(
538
- "/org.dash.platform.dapi.v0.Core/getBlockchainStatus",
539
- );
540
- let mut req = request.into_request();
541
- req.extensions_mut()
542
- .insert(
543
- GrpcMethod::new(
544
- "org.dash.platform.dapi.v0.Core",
545
- "getBlockchainStatus",
546
- ),
547
- );
548
- self.inner.unary(req, path, codec).await
549
- }
550
- pub async fn get_masternode_status(
551
- &mut self,
552
- request: impl tonic::IntoRequest<super::GetMasternodeStatusRequest>,
553
- ) -> std::result::Result<
554
- tonic::Response<super::GetMasternodeStatusResponse>,
555
- tonic::Status,
556
- > {
557
- self.inner
558
- .ready()
559
- .await
560
- .map_err(|e| {
561
- tonic::Status::unknown(
562
- format!("Service was not ready: {}", e.into()),
563
- )
564
- })?;
565
- let codec = tonic_prost::ProstCodec::default();
566
- let path = http::uri::PathAndQuery::from_static(
567
- "/org.dash.platform.dapi.v0.Core/getMasternodeStatus",
568
- );
569
- let mut req = request.into_request();
570
- req.extensions_mut()
571
- .insert(
572
- GrpcMethod::new(
573
- "org.dash.platform.dapi.v0.Core",
574
- "getMasternodeStatus",
575
- ),
576
- );
577
- self.inner.unary(req, path, codec).await
578
- }
579
- pub async fn get_block(
580
- &mut self,
581
- request: impl tonic::IntoRequest<super::GetBlockRequest>,
582
- ) -> std::result::Result<
583
- tonic::Response<super::GetBlockResponse>,
584
- tonic::Status,
585
- > {
586
- self.inner
587
- .ready()
588
- .await
589
- .map_err(|e| {
590
- tonic::Status::unknown(
591
- format!("Service was not ready: {}", e.into()),
592
- )
593
- })?;
594
- let codec = tonic_prost::ProstCodec::default();
595
- let path = http::uri::PathAndQuery::from_static(
596
- "/org.dash.platform.dapi.v0.Core/getBlock",
597
- );
598
- let mut req = request.into_request();
599
- req.extensions_mut()
600
- .insert(GrpcMethod::new("org.dash.platform.dapi.v0.Core", "getBlock"));
601
- self.inner.unary(req, path, codec).await
602
- }
603
- pub async fn get_best_block_height(
604
- &mut self,
605
- request: impl tonic::IntoRequest<super::GetBestBlockHeightRequest>,
606
- ) -> std::result::Result<
607
- tonic::Response<super::GetBestBlockHeightResponse>,
608
- tonic::Status,
609
- > {
610
- self.inner
611
- .ready()
612
- .await
613
- .map_err(|e| {
614
- tonic::Status::unknown(
615
- format!("Service was not ready: {}", e.into()),
616
- )
617
- })?;
618
- let codec = tonic_prost::ProstCodec::default();
619
- let path = http::uri::PathAndQuery::from_static(
620
- "/org.dash.platform.dapi.v0.Core/getBestBlockHeight",
621
- );
622
- let mut req = request.into_request();
623
- req.extensions_mut()
624
- .insert(
625
- GrpcMethod::new(
626
- "org.dash.platform.dapi.v0.Core",
627
- "getBestBlockHeight",
628
- ),
629
- );
630
- self.inner.unary(req, path, codec).await
631
- }
632
- pub async fn broadcast_transaction(
633
- &mut self,
634
- request: impl tonic::IntoRequest<super::BroadcastTransactionRequest>,
635
- ) -> std::result::Result<
636
- tonic::Response<super::BroadcastTransactionResponse>,
637
- tonic::Status,
638
- > {
639
- self.inner
640
- .ready()
641
- .await
642
- .map_err(|e| {
643
- tonic::Status::unknown(
644
- format!("Service was not ready: {}", e.into()),
645
- )
646
- })?;
647
- let codec = tonic_prost::ProstCodec::default();
648
- let path = http::uri::PathAndQuery::from_static(
649
- "/org.dash.platform.dapi.v0.Core/broadcastTransaction",
650
- );
651
- let mut req = request.into_request();
652
- req.extensions_mut()
653
- .insert(
654
- GrpcMethod::new(
655
- "org.dash.platform.dapi.v0.Core",
656
- "broadcastTransaction",
657
- ),
658
- );
659
- self.inner.unary(req, path, codec).await
660
- }
661
- pub async fn get_transaction(
662
- &mut self,
663
- request: impl tonic::IntoRequest<super::GetTransactionRequest>,
664
- ) -> std::result::Result<
665
- tonic::Response<super::GetTransactionResponse>,
666
- tonic::Status,
667
- > {
668
- self.inner
669
- .ready()
670
- .await
671
- .map_err(|e| {
672
- tonic::Status::unknown(
673
- format!("Service was not ready: {}", e.into()),
674
- )
675
- })?;
676
- let codec = tonic_prost::ProstCodec::default();
677
- let path = http::uri::PathAndQuery::from_static(
678
- "/org.dash.platform.dapi.v0.Core/getTransaction",
679
- );
680
- let mut req = request.into_request();
681
- req.extensions_mut()
682
- .insert(
683
- GrpcMethod::new("org.dash.platform.dapi.v0.Core", "getTransaction"),
684
- );
685
- self.inner.unary(req, path, codec).await
686
- }
687
- pub async fn get_estimated_transaction_fee(
688
- &mut self,
689
- request: impl tonic::IntoRequest<super::GetEstimatedTransactionFeeRequest>,
690
- ) -> std::result::Result<
691
- tonic::Response<super::GetEstimatedTransactionFeeResponse>,
692
- tonic::Status,
693
- > {
694
- self.inner
695
- .ready()
696
- .await
697
- .map_err(|e| {
698
- tonic::Status::unknown(
699
- format!("Service was not ready: {}", e.into()),
700
- )
701
- })?;
702
- let codec = tonic_prost::ProstCodec::default();
703
- let path = http::uri::PathAndQuery::from_static(
704
- "/org.dash.platform.dapi.v0.Core/getEstimatedTransactionFee",
705
- );
706
- let mut req = request.into_request();
707
- req.extensions_mut()
708
- .insert(
709
- GrpcMethod::new(
710
- "org.dash.platform.dapi.v0.Core",
711
- "getEstimatedTransactionFee",
712
- ),
713
- );
714
- self.inner.unary(req, path, codec).await
715
- }
716
- pub async fn subscribe_to_block_headers_with_chain_locks(
717
- &mut self,
718
- request: impl tonic::IntoRequest<super::BlockHeadersWithChainLocksRequest>,
719
- ) -> std::result::Result<
720
- tonic::Response<
721
- tonic::codec::Streaming<super::BlockHeadersWithChainLocksResponse>,
722
- >,
723
- tonic::Status,
724
- > {
725
- self.inner
726
- .ready()
727
- .await
728
- .map_err(|e| {
729
- tonic::Status::unknown(
730
- format!("Service was not ready: {}", e.into()),
731
- )
732
- })?;
733
- let codec = tonic_prost::ProstCodec::default();
734
- let path = http::uri::PathAndQuery::from_static(
735
- "/org.dash.platform.dapi.v0.Core/subscribeToBlockHeadersWithChainLocks",
736
- );
737
- let mut req = request.into_request();
738
- req.extensions_mut()
739
- .insert(
740
- GrpcMethod::new(
741
- "org.dash.platform.dapi.v0.Core",
742
- "subscribeToBlockHeadersWithChainLocks",
743
- ),
744
- );
745
- self.inner.server_streaming(req, path, codec).await
746
- }
747
- pub async fn subscribe_to_transactions_with_proofs(
748
- &mut self,
749
- request: impl tonic::IntoRequest<super::TransactionsWithProofsRequest>,
750
- ) -> std::result::Result<
751
- tonic::Response<
752
- tonic::codec::Streaming<super::TransactionsWithProofsResponse>,
753
- >,
754
- tonic::Status,
755
- > {
756
- self.inner
757
- .ready()
758
- .await
759
- .map_err(|e| {
760
- tonic::Status::unknown(
761
- format!("Service was not ready: {}", e.into()),
762
- )
763
- })?;
764
- let codec = tonic_prost::ProstCodec::default();
765
- let path = http::uri::PathAndQuery::from_static(
766
- "/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs",
767
- );
768
- let mut req = request.into_request();
769
- req.extensions_mut()
770
- .insert(
771
- GrpcMethod::new(
772
- "org.dash.platform.dapi.v0.Core",
773
- "subscribeToTransactionsWithProofs",
774
- ),
775
- );
776
- self.inner.server_streaming(req, path, codec).await
777
- }
778
- pub async fn subscribe_to_masternode_list(
779
- &mut self,
780
- request: impl tonic::IntoRequest<super::MasternodeListRequest>,
781
- ) -> std::result::Result<
782
- tonic::Response<tonic::codec::Streaming<super::MasternodeListResponse>>,
783
- tonic::Status,
784
- > {
785
- self.inner
786
- .ready()
787
- .await
788
- .map_err(|e| {
789
- tonic::Status::unknown(
790
- format!("Service was not ready: {}", e.into()),
791
- )
792
- })?;
793
- let codec = tonic_prost::ProstCodec::default();
794
- let path = http::uri::PathAndQuery::from_static(
795
- "/org.dash.platform.dapi.v0.Core/subscribeToMasternodeList",
796
- );
797
- let mut req = request.into_request();
798
- req.extensions_mut()
799
- .insert(
800
- GrpcMethod::new(
801
- "org.dash.platform.dapi.v0.Core",
802
- "subscribeToMasternodeList",
803
- ),
804
- );
805
- self.inner.server_streaming(req, path, codec).await
806
- }
807
- }
808
- }