@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,797 +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<T> CoreClient<T>
446
- where
447
- T: tonic::client::GrpcService<tonic::body::Body>,
448
- T::Error: Into<StdError>,
449
- T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
450
- <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
451
- {
452
- pub fn new(inner: T) -> Self {
453
- let inner = tonic::client::Grpc::new(inner);
454
- Self { inner }
455
- }
456
- pub fn with_origin(inner: T, origin: Uri) -> Self {
457
- let inner = tonic::client::Grpc::with_origin(inner, origin);
458
- Self { inner }
459
- }
460
- pub fn with_interceptor<F>(
461
- inner: T,
462
- interceptor: F,
463
- ) -> CoreClient<InterceptedService<T, F>>
464
- where
465
- F: tonic::service::Interceptor,
466
- T::ResponseBody: Default,
467
- T: tonic::codegen::Service<
468
- http::Request<tonic::body::Body>,
469
- Response = http::Response<
470
- <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
471
- >,
472
- >,
473
- <T as tonic::codegen::Service<
474
- http::Request<tonic::body::Body>,
475
- >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
476
- {
477
- CoreClient::new(InterceptedService::new(inner, interceptor))
478
- }
479
- /// Compress requests with the given encoding.
480
- ///
481
- /// This requires the server to support it otherwise it might respond with an
482
- /// error.
483
- #[must_use]
484
- pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
485
- self.inner = self.inner.send_compressed(encoding);
486
- self
487
- }
488
- /// Enable decompressing responses.
489
- #[must_use]
490
- pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
491
- self.inner = self.inner.accept_compressed(encoding);
492
- self
493
- }
494
- /// Limits the maximum size of a decoded message.
495
- ///
496
- /// Default: `4MB`
497
- #[must_use]
498
- pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
499
- self.inner = self.inner.max_decoding_message_size(limit);
500
- self
501
- }
502
- /// Limits the maximum size of an encoded message.
503
- ///
504
- /// Default: `usize::MAX`
505
- #[must_use]
506
- pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
507
- self.inner = self.inner.max_encoding_message_size(limit);
508
- self
509
- }
510
- pub async fn get_blockchain_status(
511
- &mut self,
512
- request: impl tonic::IntoRequest<super::GetBlockchainStatusRequest>,
513
- ) -> std::result::Result<
514
- tonic::Response<super::GetBlockchainStatusResponse>,
515
- tonic::Status,
516
- > {
517
- self.inner
518
- .ready()
519
- .await
520
- .map_err(|e| {
521
- tonic::Status::unknown(
522
- format!("Service was not ready: {}", e.into()),
523
- )
524
- })?;
525
- let codec = tonic_prost::ProstCodec::default();
526
- let path = http::uri::PathAndQuery::from_static(
527
- "/org.dash.platform.dapi.v0.Core/getBlockchainStatus",
528
- );
529
- let mut req = request.into_request();
530
- req.extensions_mut()
531
- .insert(
532
- GrpcMethod::new(
533
- "org.dash.platform.dapi.v0.Core",
534
- "getBlockchainStatus",
535
- ),
536
- );
537
- self.inner.unary(req, path, codec).await
538
- }
539
- pub async fn get_masternode_status(
540
- &mut self,
541
- request: impl tonic::IntoRequest<super::GetMasternodeStatusRequest>,
542
- ) -> std::result::Result<
543
- tonic::Response<super::GetMasternodeStatusResponse>,
544
- tonic::Status,
545
- > {
546
- self.inner
547
- .ready()
548
- .await
549
- .map_err(|e| {
550
- tonic::Status::unknown(
551
- format!("Service was not ready: {}", e.into()),
552
- )
553
- })?;
554
- let codec = tonic_prost::ProstCodec::default();
555
- let path = http::uri::PathAndQuery::from_static(
556
- "/org.dash.platform.dapi.v0.Core/getMasternodeStatus",
557
- );
558
- let mut req = request.into_request();
559
- req.extensions_mut()
560
- .insert(
561
- GrpcMethod::new(
562
- "org.dash.platform.dapi.v0.Core",
563
- "getMasternodeStatus",
564
- ),
565
- );
566
- self.inner.unary(req, path, codec).await
567
- }
568
- pub async fn get_block(
569
- &mut self,
570
- request: impl tonic::IntoRequest<super::GetBlockRequest>,
571
- ) -> std::result::Result<
572
- tonic::Response<super::GetBlockResponse>,
573
- tonic::Status,
574
- > {
575
- self.inner
576
- .ready()
577
- .await
578
- .map_err(|e| {
579
- tonic::Status::unknown(
580
- format!("Service was not ready: {}", e.into()),
581
- )
582
- })?;
583
- let codec = tonic_prost::ProstCodec::default();
584
- let path = http::uri::PathAndQuery::from_static(
585
- "/org.dash.platform.dapi.v0.Core/getBlock",
586
- );
587
- let mut req = request.into_request();
588
- req.extensions_mut()
589
- .insert(GrpcMethod::new("org.dash.platform.dapi.v0.Core", "getBlock"));
590
- self.inner.unary(req, path, codec).await
591
- }
592
- pub async fn get_best_block_height(
593
- &mut self,
594
- request: impl tonic::IntoRequest<super::GetBestBlockHeightRequest>,
595
- ) -> std::result::Result<
596
- tonic::Response<super::GetBestBlockHeightResponse>,
597
- tonic::Status,
598
- > {
599
- self.inner
600
- .ready()
601
- .await
602
- .map_err(|e| {
603
- tonic::Status::unknown(
604
- format!("Service was not ready: {}", e.into()),
605
- )
606
- })?;
607
- let codec = tonic_prost::ProstCodec::default();
608
- let path = http::uri::PathAndQuery::from_static(
609
- "/org.dash.platform.dapi.v0.Core/getBestBlockHeight",
610
- );
611
- let mut req = request.into_request();
612
- req.extensions_mut()
613
- .insert(
614
- GrpcMethod::new(
615
- "org.dash.platform.dapi.v0.Core",
616
- "getBestBlockHeight",
617
- ),
618
- );
619
- self.inner.unary(req, path, codec).await
620
- }
621
- pub async fn broadcast_transaction(
622
- &mut self,
623
- request: impl tonic::IntoRequest<super::BroadcastTransactionRequest>,
624
- ) -> std::result::Result<
625
- tonic::Response<super::BroadcastTransactionResponse>,
626
- tonic::Status,
627
- > {
628
- self.inner
629
- .ready()
630
- .await
631
- .map_err(|e| {
632
- tonic::Status::unknown(
633
- format!("Service was not ready: {}", e.into()),
634
- )
635
- })?;
636
- let codec = tonic_prost::ProstCodec::default();
637
- let path = http::uri::PathAndQuery::from_static(
638
- "/org.dash.platform.dapi.v0.Core/broadcastTransaction",
639
- );
640
- let mut req = request.into_request();
641
- req.extensions_mut()
642
- .insert(
643
- GrpcMethod::new(
644
- "org.dash.platform.dapi.v0.Core",
645
- "broadcastTransaction",
646
- ),
647
- );
648
- self.inner.unary(req, path, codec).await
649
- }
650
- pub async fn get_transaction(
651
- &mut self,
652
- request: impl tonic::IntoRequest<super::GetTransactionRequest>,
653
- ) -> std::result::Result<
654
- tonic::Response<super::GetTransactionResponse>,
655
- tonic::Status,
656
- > {
657
- self.inner
658
- .ready()
659
- .await
660
- .map_err(|e| {
661
- tonic::Status::unknown(
662
- format!("Service was not ready: {}", e.into()),
663
- )
664
- })?;
665
- let codec = tonic_prost::ProstCodec::default();
666
- let path = http::uri::PathAndQuery::from_static(
667
- "/org.dash.platform.dapi.v0.Core/getTransaction",
668
- );
669
- let mut req = request.into_request();
670
- req.extensions_mut()
671
- .insert(
672
- GrpcMethod::new("org.dash.platform.dapi.v0.Core", "getTransaction"),
673
- );
674
- self.inner.unary(req, path, codec).await
675
- }
676
- pub async fn get_estimated_transaction_fee(
677
- &mut self,
678
- request: impl tonic::IntoRequest<super::GetEstimatedTransactionFeeRequest>,
679
- ) -> std::result::Result<
680
- tonic::Response<super::GetEstimatedTransactionFeeResponse>,
681
- tonic::Status,
682
- > {
683
- self.inner
684
- .ready()
685
- .await
686
- .map_err(|e| {
687
- tonic::Status::unknown(
688
- format!("Service was not ready: {}", e.into()),
689
- )
690
- })?;
691
- let codec = tonic_prost::ProstCodec::default();
692
- let path = http::uri::PathAndQuery::from_static(
693
- "/org.dash.platform.dapi.v0.Core/getEstimatedTransactionFee",
694
- );
695
- let mut req = request.into_request();
696
- req.extensions_mut()
697
- .insert(
698
- GrpcMethod::new(
699
- "org.dash.platform.dapi.v0.Core",
700
- "getEstimatedTransactionFee",
701
- ),
702
- );
703
- self.inner.unary(req, path, codec).await
704
- }
705
- pub async fn subscribe_to_block_headers_with_chain_locks(
706
- &mut self,
707
- request: impl tonic::IntoRequest<super::BlockHeadersWithChainLocksRequest>,
708
- ) -> std::result::Result<
709
- tonic::Response<
710
- tonic::codec::Streaming<super::BlockHeadersWithChainLocksResponse>,
711
- >,
712
- tonic::Status,
713
- > {
714
- self.inner
715
- .ready()
716
- .await
717
- .map_err(|e| {
718
- tonic::Status::unknown(
719
- format!("Service was not ready: {}", e.into()),
720
- )
721
- })?;
722
- let codec = tonic_prost::ProstCodec::default();
723
- let path = http::uri::PathAndQuery::from_static(
724
- "/org.dash.platform.dapi.v0.Core/subscribeToBlockHeadersWithChainLocks",
725
- );
726
- let mut req = request.into_request();
727
- req.extensions_mut()
728
- .insert(
729
- GrpcMethod::new(
730
- "org.dash.platform.dapi.v0.Core",
731
- "subscribeToBlockHeadersWithChainLocks",
732
- ),
733
- );
734
- self.inner.server_streaming(req, path, codec).await
735
- }
736
- pub async fn subscribe_to_transactions_with_proofs(
737
- &mut self,
738
- request: impl tonic::IntoRequest<super::TransactionsWithProofsRequest>,
739
- ) -> std::result::Result<
740
- tonic::Response<
741
- tonic::codec::Streaming<super::TransactionsWithProofsResponse>,
742
- >,
743
- tonic::Status,
744
- > {
745
- self.inner
746
- .ready()
747
- .await
748
- .map_err(|e| {
749
- tonic::Status::unknown(
750
- format!("Service was not ready: {}", e.into()),
751
- )
752
- })?;
753
- let codec = tonic_prost::ProstCodec::default();
754
- let path = http::uri::PathAndQuery::from_static(
755
- "/org.dash.platform.dapi.v0.Core/subscribeToTransactionsWithProofs",
756
- );
757
- let mut req = request.into_request();
758
- req.extensions_mut()
759
- .insert(
760
- GrpcMethod::new(
761
- "org.dash.platform.dapi.v0.Core",
762
- "subscribeToTransactionsWithProofs",
763
- ),
764
- );
765
- self.inner.server_streaming(req, path, codec).await
766
- }
767
- pub async fn subscribe_to_masternode_list(
768
- &mut self,
769
- request: impl tonic::IntoRequest<super::MasternodeListRequest>,
770
- ) -> std::result::Result<
771
- tonic::Response<tonic::codec::Streaming<super::MasternodeListResponse>>,
772
- tonic::Status,
773
- > {
774
- self.inner
775
- .ready()
776
- .await
777
- .map_err(|e| {
778
- tonic::Status::unknown(
779
- format!("Service was not ready: {}", e.into()),
780
- )
781
- })?;
782
- let codec = tonic_prost::ProstCodec::default();
783
- let path = http::uri::PathAndQuery::from_static(
784
- "/org.dash.platform.dapi.v0.Core/subscribeToMasternodeList",
785
- );
786
- let mut req = request.into_request();
787
- req.extensions_mut()
788
- .insert(
789
- GrpcMethod::new(
790
- "org.dash.platform.dapi.v0.Core",
791
- "subscribeToMasternodeList",
792
- ),
793
- );
794
- self.inner.server_streaming(req, path, codec).await
795
- }
796
- }
797
- }