zcash_client_backend/proto/
service.rs

1// This file is @generated by prost-build.
2/// A BlockID message contains identifiers to select a block: a height or a
3/// hash. Specification by hash is not implemented, but may be in the future.
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct BlockId {
6    #[prost(uint64, tag = "1")]
7    pub height: u64,
8    #[prost(bytes = "vec", tag = "2")]
9    pub hash: ::prost::alloc::vec::Vec<u8>,
10}
11/// BlockRange specifies a series of blocks from start to end inclusive.
12/// Both BlockIDs must be heights; specification by hash is not yet supported.
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct BlockRange {
15    #[prost(message, optional, tag = "1")]
16    pub start: ::core::option::Option<BlockId>,
17    #[prost(message, optional, tag = "2")]
18    pub end: ::core::option::Option<BlockId>,
19}
20/// A TxFilter contains the information needed to identify a particular
21/// transaction: either a block and an index, or a direct transaction hash.
22/// Currently, only specification by hash is supported.
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct TxFilter {
25    /// block identifier, height or hash
26    #[prost(message, optional, tag = "1")]
27    pub block: ::core::option::Option<BlockId>,
28    /// index within the block
29    #[prost(uint64, tag = "2")]
30    pub index: u64,
31    /// transaction ID (hash, txid)
32    #[prost(bytes = "vec", tag = "3")]
33    pub hash: ::prost::alloc::vec::Vec<u8>,
34}
35/// RawTransaction contains the complete transaction data. It also optionally includes
36/// the block height in which the transaction was included, or, when returned
37/// by GetMempoolStream(), the latest block height.
38///
39/// FIXME: the documentation here about mempool status contradicts the documentation
40/// for the `height` field. See <https://github.com/zcash/librustzcash/issues/1484>
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct RawTransaction {
43    /// exact data returned by Zcash 'getrawtransaction'
44    #[prost(bytes = "vec", tag = "1")]
45    pub data: ::prost::alloc::vec::Vec<u8>,
46    /// height that the transaction was mined (or -1)
47    #[prost(uint64, tag = "2")]
48    pub height: u64,
49}
50/// A SendResponse encodes an error code and a string. It is currently used
51/// only by SendTransaction(). If error code is zero, the operation was
52/// successful; if non-zero, it and the message specify the failure.
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct SendResponse {
55    #[prost(int32, tag = "1")]
56    pub error_code: i32,
57    #[prost(string, tag = "2")]
58    pub error_message: ::prost::alloc::string::String,
59}
60/// Chainspec is a placeholder to allow specification of a particular chain fork.
61#[derive(Clone, Copy, PartialEq, ::prost::Message)]
62pub struct ChainSpec {}
63/// Empty is for gRPCs that take no arguments, currently only GetLightdInfo.
64#[derive(Clone, Copy, PartialEq, ::prost::Message)]
65pub struct Empty {}
66/// LightdInfo returns various information about this lightwalletd instance
67/// and the state of the blockchain.
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct LightdInfo {
70    #[prost(string, tag = "1")]
71    pub version: ::prost::alloc::string::String,
72    #[prost(string, tag = "2")]
73    pub vendor: ::prost::alloc::string::String,
74    /// true
75    #[prost(bool, tag = "3")]
76    pub taddr_support: bool,
77    /// either "main" or "test"
78    #[prost(string, tag = "4")]
79    pub chain_name: ::prost::alloc::string::String,
80    /// depends on mainnet or testnet
81    #[prost(uint64, tag = "5")]
82    pub sapling_activation_height: u64,
83    /// protocol identifier, see consensus/upgrades.cpp
84    #[prost(string, tag = "6")]
85    pub consensus_branch_id: ::prost::alloc::string::String,
86    /// latest block on the best chain
87    #[prost(uint64, tag = "7")]
88    pub block_height: u64,
89    #[prost(string, tag = "8")]
90    pub git_commit: ::prost::alloc::string::String,
91    #[prost(string, tag = "9")]
92    pub branch: ::prost::alloc::string::String,
93    #[prost(string, tag = "10")]
94    pub build_date: ::prost::alloc::string::String,
95    #[prost(string, tag = "11")]
96    pub build_user: ::prost::alloc::string::String,
97    /// less than tip height if zcashd is syncing
98    #[prost(uint64, tag = "12")]
99    pub estimated_height: u64,
100    /// example: "v4.1.1-877212414"
101    #[prost(string, tag = "13")]
102    pub zcashd_build: ::prost::alloc::string::String,
103    /// example: "/MagicBean:4.1.1/"
104    #[prost(string, tag = "14")]
105    pub zcashd_subversion: ::prost::alloc::string::String,
106    /// Zcash donation UA address
107    #[prost(string, tag = "15")]
108    pub donation_address: ::prost::alloc::string::String,
109}
110/// TransparentAddressBlockFilter restricts the results to the given address
111/// or block range.
112#[derive(Clone, PartialEq, ::prost::Message)]
113pub struct TransparentAddressBlockFilter {
114    /// t-address
115    #[prost(string, tag = "1")]
116    pub address: ::prost::alloc::string::String,
117    /// start, end heights
118    #[prost(message, optional, tag = "2")]
119    pub range: ::core::option::Option<BlockRange>,
120}
121/// Duration is currently used only for testing, so that the Ping rpc
122/// can simulate a delay, to create many simultaneous connections. Units
123/// are microseconds.
124#[derive(Clone, Copy, PartialEq, ::prost::Message)]
125pub struct Duration {
126    #[prost(int64, tag = "1")]
127    pub interval_us: i64,
128}
129/// PingResponse is used to indicate concurrency, how many Ping rpcs
130/// are executing upon entry and upon exit (after the delay).
131/// This rpc is used for testing only.
132#[derive(Clone, Copy, PartialEq, ::prost::Message)]
133pub struct PingResponse {
134    #[prost(int64, tag = "1")]
135    pub entry: i64,
136    #[prost(int64, tag = "2")]
137    pub exit: i64,
138}
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct Address {
141    #[prost(string, tag = "1")]
142    pub address: ::prost::alloc::string::String,
143}
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct AddressList {
146    #[prost(string, repeated, tag = "1")]
147    pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
148}
149#[derive(Clone, Copy, PartialEq, ::prost::Message)]
150pub struct Balance {
151    #[prost(int64, tag = "1")]
152    pub value_zat: i64,
153}
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct Exclude {
156    #[prost(bytes = "vec", repeated, tag = "1")]
157    pub txid: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
158}
159/// The TreeState is derived from the Zcash z_gettreestate rpc.
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct TreeState {
162    /// "main" or "test"
163    #[prost(string, tag = "1")]
164    pub network: ::prost::alloc::string::String,
165    /// block height
166    #[prost(uint64, tag = "2")]
167    pub height: u64,
168    /// block id
169    #[prost(string, tag = "3")]
170    pub hash: ::prost::alloc::string::String,
171    /// Unix epoch time when the block was mined
172    #[prost(uint32, tag = "4")]
173    pub time: u32,
174    /// sapling commitment tree state
175    #[prost(string, tag = "5")]
176    pub sapling_tree: ::prost::alloc::string::String,
177    /// orchard commitment tree state
178    #[prost(string, tag = "6")]
179    pub orchard_tree: ::prost::alloc::string::String,
180}
181#[derive(Clone, Copy, PartialEq, ::prost::Message)]
182pub struct GetSubtreeRootsArg {
183    /// Index identifying where to start returning subtree roots
184    #[prost(uint32, tag = "1")]
185    pub start_index: u32,
186    /// Shielded protocol to return subtree roots for
187    #[prost(enumeration = "ShieldedProtocol", tag = "2")]
188    pub shielded_protocol: i32,
189    /// Maximum number of entries to return, or 0 for all entries.
190    #[prost(uint32, tag = "3")]
191    pub max_entries: u32,
192}
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct SubtreeRoot {
195    /// The 32-byte Merkle root of the subtree.
196    #[prost(bytes = "vec", tag = "2")]
197    pub root_hash: ::prost::alloc::vec::Vec<u8>,
198    /// The hash of the block that completed this subtree.
199    #[prost(bytes = "vec", tag = "3")]
200    pub completing_block_hash: ::prost::alloc::vec::Vec<u8>,
201    /// The height of the block that completed this subtree in the main chain.
202    #[prost(uint64, tag = "4")]
203    pub completing_block_height: u64,
204}
205/// Results are sorted by height, which makes it easy to issue another
206/// request that picks up from where the previous left off.
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct GetAddressUtxosArg {
209    #[prost(string, repeated, tag = "1")]
210    pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
211    #[prost(uint64, tag = "2")]
212    pub start_height: u64,
213    /// zero means unlimited
214    #[prost(uint32, tag = "3")]
215    pub max_entries: u32,
216}
217#[derive(Clone, PartialEq, ::prost::Message)]
218pub struct GetAddressUtxosReply {
219    #[prost(string, tag = "6")]
220    pub address: ::prost::alloc::string::String,
221    #[prost(bytes = "vec", tag = "1")]
222    pub txid: ::prost::alloc::vec::Vec<u8>,
223    #[prost(int32, tag = "2")]
224    pub index: i32,
225    #[prost(bytes = "vec", tag = "3")]
226    pub script: ::prost::alloc::vec::Vec<u8>,
227    #[prost(int64, tag = "4")]
228    pub value_zat: i64,
229    #[prost(uint64, tag = "5")]
230    pub height: u64,
231}
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct GetAddressUtxosReplyList {
234    #[prost(message, repeated, tag = "1")]
235    pub address_utxos: ::prost::alloc::vec::Vec<GetAddressUtxosReply>,
236}
237#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
238#[repr(i32)]
239pub enum ShieldedProtocol {
240    Sapling = 0,
241    Orchard = 1,
242}
243impl ShieldedProtocol {
244    /// String value of the enum field names used in the ProtoBuf definition.
245    ///
246    /// The values are not transformed in any way and thus are considered stable
247    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
248    pub fn as_str_name(&self) -> &'static str {
249        match self {
250            Self::Sapling => "sapling",
251            Self::Orchard => "orchard",
252        }
253    }
254    /// Creates an enum from field names used in the ProtoBuf definition.
255    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
256        match value {
257            "sapling" => Some(Self::Sapling),
258            "orchard" => Some(Self::Orchard),
259            _ => None,
260        }
261    }
262}
263/// Generated client implementations.
264#[cfg(feature = "lightwalletd-tonic")]
265pub mod compact_tx_streamer_client {
266    #![allow(
267        unused_variables,
268        dead_code,
269        missing_docs,
270        clippy::wildcard_imports,
271        clippy::let_unit_value,
272    )]
273    use tonic::codegen::*;
274    use tonic::codegen::http::Uri;
275    #[derive(Debug, Clone)]
276    pub struct CompactTxStreamerClient<T> {
277        inner: tonic::client::Grpc<T>,
278    }
279    impl<T> CompactTxStreamerClient<T>
280    where
281        T: tonic::client::GrpcService<tonic::body::Body>,
282        T::Error: Into<StdError>,
283        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
284        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
285    {
286        pub fn new(inner: T) -> Self {
287            let inner = tonic::client::Grpc::new(inner);
288            Self { inner }
289        }
290        pub fn with_origin(inner: T, origin: Uri) -> Self {
291            let inner = tonic::client::Grpc::with_origin(inner, origin);
292            Self { inner }
293        }
294        pub fn with_interceptor<F>(
295            inner: T,
296            interceptor: F,
297        ) -> CompactTxStreamerClient<InterceptedService<T, F>>
298        where
299            F: tonic::service::Interceptor,
300            T::ResponseBody: Default,
301            T: tonic::codegen::Service<
302                http::Request<tonic::body::Body>,
303                Response = http::Response<
304                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
305                >,
306            >,
307            <T as tonic::codegen::Service<
308                http::Request<tonic::body::Body>,
309            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
310        {
311            CompactTxStreamerClient::new(InterceptedService::new(inner, interceptor))
312        }
313        /// Compress requests with the given encoding.
314        ///
315        /// This requires the server to support it otherwise it might respond with an
316        /// error.
317        #[must_use]
318        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
319            self.inner = self.inner.send_compressed(encoding);
320            self
321        }
322        /// Enable decompressing responses.
323        #[must_use]
324        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
325            self.inner = self.inner.accept_compressed(encoding);
326            self
327        }
328        /// Limits the maximum size of a decoded message.
329        ///
330        /// Default: `4MB`
331        #[must_use]
332        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
333            self.inner = self.inner.max_decoding_message_size(limit);
334            self
335        }
336        /// Limits the maximum size of an encoded message.
337        ///
338        /// Default: `usize::MAX`
339        #[must_use]
340        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
341            self.inner = self.inner.max_encoding_message_size(limit);
342            self
343        }
344        /// Return the BlockID of the block at the tip of the best chain
345        pub async fn get_latest_block(
346            &mut self,
347            request: impl tonic::IntoRequest<super::ChainSpec>,
348        ) -> std::result::Result<tonic::Response<super::BlockId>, tonic::Status> {
349            self.inner
350                .ready()
351                .await
352                .map_err(|e| {
353                    tonic::Status::unknown(
354                        format!("Service was not ready: {}", e.into()),
355                    )
356                })?;
357            let codec = tonic::codec::ProstCodec::default();
358            let path = http::uri::PathAndQuery::from_static(
359                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestBlock",
360            );
361            let mut req = request.into_request();
362            req.extensions_mut()
363                .insert(
364                    GrpcMethod::new(
365                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
366                        "GetLatestBlock",
367                    ),
368                );
369            self.inner.unary(req, path, codec).await
370        }
371        /// Return the compact block corresponding to the given block identifier
372        pub async fn get_block(
373            &mut self,
374            request: impl tonic::IntoRequest<super::BlockId>,
375        ) -> std::result::Result<
376            tonic::Response<crate::proto::compact_formats::CompactBlock>,
377            tonic::Status,
378        > {
379            self.inner
380                .ready()
381                .await
382                .map_err(|e| {
383                    tonic::Status::unknown(
384                        format!("Service was not ready: {}", e.into()),
385                    )
386                })?;
387            let codec = tonic::codec::ProstCodec::default();
388            let path = http::uri::PathAndQuery::from_static(
389                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlock",
390            );
391            let mut req = request.into_request();
392            req.extensions_mut()
393                .insert(
394                    GrpcMethod::new(
395                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
396                        "GetBlock",
397                    ),
398                );
399            self.inner.unary(req, path, codec).await
400        }
401        /// Same as GetBlock except actions contain only nullifiers
402        pub async fn get_block_nullifiers(
403            &mut self,
404            request: impl tonic::IntoRequest<super::BlockId>,
405        ) -> std::result::Result<
406            tonic::Response<crate::proto::compact_formats::CompactBlock>,
407            tonic::Status,
408        > {
409            self.inner
410                .ready()
411                .await
412                .map_err(|e| {
413                    tonic::Status::unknown(
414                        format!("Service was not ready: {}", e.into()),
415                    )
416                })?;
417            let codec = tonic::codec::ProstCodec::default();
418            let path = http::uri::PathAndQuery::from_static(
419                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockNullifiers",
420            );
421            let mut req = request.into_request();
422            req.extensions_mut()
423                .insert(
424                    GrpcMethod::new(
425                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
426                        "GetBlockNullifiers",
427                    ),
428                );
429            self.inner.unary(req, path, codec).await
430        }
431        /// Return a list of consecutive compact blocks
432        pub async fn get_block_range(
433            &mut self,
434            request: impl tonic::IntoRequest<super::BlockRange>,
435        ) -> std::result::Result<
436            tonic::Response<
437                tonic::codec::Streaming<crate::proto::compact_formats::CompactBlock>,
438            >,
439            tonic::Status,
440        > {
441            self.inner
442                .ready()
443                .await
444                .map_err(|e| {
445                    tonic::Status::unknown(
446                        format!("Service was not ready: {}", e.into()),
447                    )
448                })?;
449            let codec = tonic::codec::ProstCodec::default();
450            let path = http::uri::PathAndQuery::from_static(
451                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRange",
452            );
453            let mut req = request.into_request();
454            req.extensions_mut()
455                .insert(
456                    GrpcMethod::new(
457                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
458                        "GetBlockRange",
459                    ),
460                );
461            self.inner.server_streaming(req, path, codec).await
462        }
463        /// Same as GetBlockRange except actions contain only nullifiers
464        pub async fn get_block_range_nullifiers(
465            &mut self,
466            request: impl tonic::IntoRequest<super::BlockRange>,
467        ) -> std::result::Result<
468            tonic::Response<
469                tonic::codec::Streaming<crate::proto::compact_formats::CompactBlock>,
470            >,
471            tonic::Status,
472        > {
473            self.inner
474                .ready()
475                .await
476                .map_err(|e| {
477                    tonic::Status::unknown(
478                        format!("Service was not ready: {}", e.into()),
479                    )
480                })?;
481            let codec = tonic::codec::ProstCodec::default();
482            let path = http::uri::PathAndQuery::from_static(
483                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetBlockRangeNullifiers",
484            );
485            let mut req = request.into_request();
486            req.extensions_mut()
487                .insert(
488                    GrpcMethod::new(
489                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
490                        "GetBlockRangeNullifiers",
491                    ),
492                );
493            self.inner.server_streaming(req, path, codec).await
494        }
495        /// Return the requested full (not compact) transaction (as from zcashd)
496        pub async fn get_transaction(
497            &mut self,
498            request: impl tonic::IntoRequest<super::TxFilter>,
499        ) -> std::result::Result<tonic::Response<super::RawTransaction>, tonic::Status> {
500            self.inner
501                .ready()
502                .await
503                .map_err(|e| {
504                    tonic::Status::unknown(
505                        format!("Service was not ready: {}", e.into()),
506                    )
507                })?;
508            let codec = tonic::codec::ProstCodec::default();
509            let path = http::uri::PathAndQuery::from_static(
510                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTransaction",
511            );
512            let mut req = request.into_request();
513            req.extensions_mut()
514                .insert(
515                    GrpcMethod::new(
516                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
517                        "GetTransaction",
518                    ),
519                );
520            self.inner.unary(req, path, codec).await
521        }
522        /// Submit the given transaction to the Zcash network
523        pub async fn send_transaction(
524            &mut self,
525            request: impl tonic::IntoRequest<super::RawTransaction>,
526        ) -> std::result::Result<tonic::Response<super::SendResponse>, tonic::Status> {
527            self.inner
528                .ready()
529                .await
530                .map_err(|e| {
531                    tonic::Status::unknown(
532                        format!("Service was not ready: {}", e.into()),
533                    )
534                })?;
535            let codec = tonic::codec::ProstCodec::default();
536            let path = http::uri::PathAndQuery::from_static(
537                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/SendTransaction",
538            );
539            let mut req = request.into_request();
540            req.extensions_mut()
541                .insert(
542                    GrpcMethod::new(
543                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
544                        "SendTransaction",
545                    ),
546                );
547            self.inner.unary(req, path, codec).await
548        }
549        /// Return the txids corresponding to the given t-address within the given block range
550        pub async fn get_taddress_txids(
551            &mut self,
552            request: impl tonic::IntoRequest<super::TransparentAddressBlockFilter>,
553        ) -> std::result::Result<
554            tonic::Response<tonic::codec::Streaming<super::RawTransaction>>,
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::codec::ProstCodec::default();
566            let path = http::uri::PathAndQuery::from_static(
567                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressTxids",
568            );
569            let mut req = request.into_request();
570            req.extensions_mut()
571                .insert(
572                    GrpcMethod::new(
573                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
574                        "GetTaddressTxids",
575                    ),
576                );
577            self.inner.server_streaming(req, path, codec).await
578        }
579        pub async fn get_taddress_balance(
580            &mut self,
581            request: impl tonic::IntoRequest<super::AddressList>,
582        ) -> std::result::Result<tonic::Response<super::Balance>, tonic::Status> {
583            self.inner
584                .ready()
585                .await
586                .map_err(|e| {
587                    tonic::Status::unknown(
588                        format!("Service was not ready: {}", e.into()),
589                    )
590                })?;
591            let codec = tonic::codec::ProstCodec::default();
592            let path = http::uri::PathAndQuery::from_static(
593                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalance",
594            );
595            let mut req = request.into_request();
596            req.extensions_mut()
597                .insert(
598                    GrpcMethod::new(
599                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
600                        "GetTaddressBalance",
601                    ),
602                );
603            self.inner.unary(req, path, codec).await
604        }
605        pub async fn get_taddress_balance_stream(
606            &mut self,
607            request: impl tonic::IntoStreamingRequest<Message = super::Address>,
608        ) -> std::result::Result<tonic::Response<super::Balance>, tonic::Status> {
609            self.inner
610                .ready()
611                .await
612                .map_err(|e| {
613                    tonic::Status::unknown(
614                        format!("Service was not ready: {}", e.into()),
615                    )
616                })?;
617            let codec = tonic::codec::ProstCodec::default();
618            let path = http::uri::PathAndQuery::from_static(
619                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTaddressBalanceStream",
620            );
621            let mut req = request.into_streaming_request();
622            req.extensions_mut()
623                .insert(
624                    GrpcMethod::new(
625                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
626                        "GetTaddressBalanceStream",
627                    ),
628                );
629            self.inner.client_streaming(req, path, codec).await
630        }
631        /// Return the compact transactions currently in the mempool; the results
632        /// can be a few seconds out of date. If the Exclude list is empty, return
633        /// all transactions; otherwise return all *except* those in the Exclude list
634        /// (if any); this allows the client to avoid receiving transactions that it
635        /// already has (from an earlier call to this rpc). The transaction IDs in the
636        /// Exclude list can be shortened to any number of bytes to make the request
637        /// more bandwidth-efficient; if two or more transactions in the mempool
638        /// match a shortened txid, they are all sent (none is excluded). Transactions
639        /// in the exclude list that don't exist in the mempool are ignored.
640        pub async fn get_mempool_tx(
641            &mut self,
642            request: impl tonic::IntoRequest<super::Exclude>,
643        ) -> std::result::Result<
644            tonic::Response<
645                tonic::codec::Streaming<crate::proto::compact_formats::CompactTx>,
646            >,
647            tonic::Status,
648        > {
649            self.inner
650                .ready()
651                .await
652                .map_err(|e| {
653                    tonic::Status::unknown(
654                        format!("Service was not ready: {}", e.into()),
655                    )
656                })?;
657            let codec = tonic::codec::ProstCodec::default();
658            let path = http::uri::PathAndQuery::from_static(
659                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolTx",
660            );
661            let mut req = request.into_request();
662            req.extensions_mut()
663                .insert(
664                    GrpcMethod::new(
665                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
666                        "GetMempoolTx",
667                    ),
668                );
669            self.inner.server_streaming(req, path, codec).await
670        }
671        /// Return a stream of current Mempool transactions. This will keep the output stream open while
672        /// there are mempool transactions. It will close the returned stream when a new block is mined.
673        pub async fn get_mempool_stream(
674            &mut self,
675            request: impl tonic::IntoRequest<super::Empty>,
676        ) -> std::result::Result<
677            tonic::Response<tonic::codec::Streaming<super::RawTransaction>>,
678            tonic::Status,
679        > {
680            self.inner
681                .ready()
682                .await
683                .map_err(|e| {
684                    tonic::Status::unknown(
685                        format!("Service was not ready: {}", e.into()),
686                    )
687                })?;
688            let codec = tonic::codec::ProstCodec::default();
689            let path = http::uri::PathAndQuery::from_static(
690                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetMempoolStream",
691            );
692            let mut req = request.into_request();
693            req.extensions_mut()
694                .insert(
695                    GrpcMethod::new(
696                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
697                        "GetMempoolStream",
698                    ),
699                );
700            self.inner.server_streaming(req, path, codec).await
701        }
702        /// GetTreeState returns the note commitment tree state corresponding to the given block.
703        /// See section 3.7 of the Zcash protocol specification. It returns several other useful
704        /// values also (even though they can be obtained using GetBlock).
705        /// The block can be specified by either height or hash.
706        pub async fn get_tree_state(
707            &mut self,
708            request: impl tonic::IntoRequest<super::BlockId>,
709        ) -> std::result::Result<tonic::Response<super::TreeState>, tonic::Status> {
710            self.inner
711                .ready()
712                .await
713                .map_err(|e| {
714                    tonic::Status::unknown(
715                        format!("Service was not ready: {}", e.into()),
716                    )
717                })?;
718            let codec = tonic::codec::ProstCodec::default();
719            let path = http::uri::PathAndQuery::from_static(
720                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetTreeState",
721            );
722            let mut req = request.into_request();
723            req.extensions_mut()
724                .insert(
725                    GrpcMethod::new(
726                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
727                        "GetTreeState",
728                    ),
729                );
730            self.inner.unary(req, path, codec).await
731        }
732        pub async fn get_latest_tree_state(
733            &mut self,
734            request: impl tonic::IntoRequest<super::Empty>,
735        ) -> std::result::Result<tonic::Response<super::TreeState>, tonic::Status> {
736            self.inner
737                .ready()
738                .await
739                .map_err(|e| {
740                    tonic::Status::unknown(
741                        format!("Service was not ready: {}", e.into()),
742                    )
743                })?;
744            let codec = tonic::codec::ProstCodec::default();
745            let path = http::uri::PathAndQuery::from_static(
746                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLatestTreeState",
747            );
748            let mut req = request.into_request();
749            req.extensions_mut()
750                .insert(
751                    GrpcMethod::new(
752                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
753                        "GetLatestTreeState",
754                    ),
755                );
756            self.inner.unary(req, path, codec).await
757        }
758        /// Returns a stream of information about roots of subtrees of the Sapling and Orchard
759        /// note commitment trees.
760        pub async fn get_subtree_roots(
761            &mut self,
762            request: impl tonic::IntoRequest<super::GetSubtreeRootsArg>,
763        ) -> std::result::Result<
764            tonic::Response<tonic::codec::Streaming<super::SubtreeRoot>>,
765            tonic::Status,
766        > {
767            self.inner
768                .ready()
769                .await
770                .map_err(|e| {
771                    tonic::Status::unknown(
772                        format!("Service was not ready: {}", e.into()),
773                    )
774                })?;
775            let codec = tonic::codec::ProstCodec::default();
776            let path = http::uri::PathAndQuery::from_static(
777                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetSubtreeRoots",
778            );
779            let mut req = request.into_request();
780            req.extensions_mut()
781                .insert(
782                    GrpcMethod::new(
783                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
784                        "GetSubtreeRoots",
785                    ),
786                );
787            self.inner.server_streaming(req, path, codec).await
788        }
789        pub async fn get_address_utxos(
790            &mut self,
791            request: impl tonic::IntoRequest<super::GetAddressUtxosArg>,
792        ) -> std::result::Result<
793            tonic::Response<super::GetAddressUtxosReplyList>,
794            tonic::Status,
795        > {
796            self.inner
797                .ready()
798                .await
799                .map_err(|e| {
800                    tonic::Status::unknown(
801                        format!("Service was not ready: {}", e.into()),
802                    )
803                })?;
804            let codec = tonic::codec::ProstCodec::default();
805            let path = http::uri::PathAndQuery::from_static(
806                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxos",
807            );
808            let mut req = request.into_request();
809            req.extensions_mut()
810                .insert(
811                    GrpcMethod::new(
812                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
813                        "GetAddressUtxos",
814                    ),
815                );
816            self.inner.unary(req, path, codec).await
817        }
818        pub async fn get_address_utxos_stream(
819            &mut self,
820            request: impl tonic::IntoRequest<super::GetAddressUtxosArg>,
821        ) -> std::result::Result<
822            tonic::Response<tonic::codec::Streaming<super::GetAddressUtxosReply>>,
823            tonic::Status,
824        > {
825            self.inner
826                .ready()
827                .await
828                .map_err(|e| {
829                    tonic::Status::unknown(
830                        format!("Service was not ready: {}", e.into()),
831                    )
832                })?;
833            let codec = tonic::codec::ProstCodec::default();
834            let path = http::uri::PathAndQuery::from_static(
835                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetAddressUtxosStream",
836            );
837            let mut req = request.into_request();
838            req.extensions_mut()
839                .insert(
840                    GrpcMethod::new(
841                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
842                        "GetAddressUtxosStream",
843                    ),
844                );
845            self.inner.server_streaming(req, path, codec).await
846        }
847        /// Return information about this lightwalletd instance and the blockchain
848        pub async fn get_lightd_info(
849            &mut self,
850            request: impl tonic::IntoRequest<super::Empty>,
851        ) -> std::result::Result<tonic::Response<super::LightdInfo>, tonic::Status> {
852            self.inner
853                .ready()
854                .await
855                .map_err(|e| {
856                    tonic::Status::unknown(
857                        format!("Service was not ready: {}", e.into()),
858                    )
859                })?;
860            let codec = tonic::codec::ProstCodec::default();
861            let path = http::uri::PathAndQuery::from_static(
862                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo",
863            );
864            let mut req = request.into_request();
865            req.extensions_mut()
866                .insert(
867                    GrpcMethod::new(
868                        "cash.z.wallet.sdk.rpc.CompactTxStreamer",
869                        "GetLightdInfo",
870                    ),
871                );
872            self.inner.unary(req, path, codec).await
873        }
874        /// Testing-only, requires lightwalletd --ping-very-insecure (do not enable in production)
875        pub async fn ping(
876            &mut self,
877            request: impl tonic::IntoRequest<super::Duration>,
878        ) -> std::result::Result<tonic::Response<super::PingResponse>, tonic::Status> {
879            self.inner
880                .ready()
881                .await
882                .map_err(|e| {
883                    tonic::Status::unknown(
884                        format!("Service was not ready: {}", e.into()),
885                    )
886                })?;
887            let codec = tonic::codec::ProstCodec::default();
888            let path = http::uri::PathAndQuery::from_static(
889                "/cash.z.wallet.sdk.rpc.CompactTxStreamer/Ping",
890            );
891            let mut req = request.into_request();
892            req.extensions_mut()
893                .insert(
894                    GrpcMethod::new("cash.z.wallet.sdk.rpc.CompactTxStreamer", "Ping"),
895                );
896            self.inner.unary(req, path, codec).await
897        }
898    }
899}