penumbra_sdk_proto/gen/
noble.forwarding.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ForwardingAccount {
4    #[prost(message, optional, tag = "1")]
5    pub base_account: ::core::option::Option<
6        super::super::super::cosmos::auth::v1beta1::BaseAccount,
7    >,
8    #[prost(string, tag = "2")]
9    pub channel: ::prost::alloc::string::String,
10    #[prost(string, tag = "3")]
11    pub recipient: ::prost::alloc::string::String,
12    #[prost(int64, tag = "4")]
13    pub created_at: i64,
14}
15impl ::prost::Name for ForwardingAccount {
16    const NAME: &'static str = "ForwardingAccount";
17    const PACKAGE: &'static str = "noble.forwarding.v1";
18    fn full_name() -> ::prost::alloc::string::String {
19        "noble.forwarding.v1.ForwardingAccount".into()
20    }
21    fn type_url() -> ::prost::alloc::string::String {
22        "/noble.forwarding.v1.ForwardingAccount".into()
23    }
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct ForwardingPubKey {
27    #[prost(bytes = "vec", tag = "1")]
28    pub key: ::prost::alloc::vec::Vec<u8>,
29}
30impl ::prost::Name for ForwardingPubKey {
31    const NAME: &'static str = "ForwardingPubKey";
32    const PACKAGE: &'static str = "noble.forwarding.v1";
33    fn full_name() -> ::prost::alloc::string::String {
34        "noble.forwarding.v1.ForwardingPubKey".into()
35    }
36    fn type_url() -> ::prost::alloc::string::String {
37        "/noble.forwarding.v1.ForwardingPubKey".into()
38    }
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct GenesisState {
42    #[prost(map = "string, uint64", tag = "1")]
43    pub num_of_accounts: ::std::collections::HashMap<
44        ::prost::alloc::string::String,
45        u64,
46    >,
47    #[prost(map = "string, uint64", tag = "2")]
48    pub num_of_forwards: ::std::collections::HashMap<
49        ::prost::alloc::string::String,
50        u64,
51    >,
52    #[prost(map = "string, string", tag = "3")]
53    pub total_forwarded: ::std::collections::HashMap<
54        ::prost::alloc::string::String,
55        ::prost::alloc::string::String,
56    >,
57}
58impl ::prost::Name for GenesisState {
59    const NAME: &'static str = "GenesisState";
60    const PACKAGE: &'static str = "noble.forwarding.v1";
61    fn full_name() -> ::prost::alloc::string::String {
62        "noble.forwarding.v1.GenesisState".into()
63    }
64    fn type_url() -> ::prost::alloc::string::String {
65        "/noble.forwarding.v1.GenesisState".into()
66    }
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct RegisterAccountData {
70    #[prost(string, tag = "1")]
71    pub recipient: ::prost::alloc::string::String,
72    #[prost(string, tag = "2")]
73    pub channel: ::prost::alloc::string::String,
74}
75impl ::prost::Name for RegisterAccountData {
76    const NAME: &'static str = "RegisterAccountData";
77    const PACKAGE: &'static str = "noble.forwarding.v1";
78    fn full_name() -> ::prost::alloc::string::String {
79        "noble.forwarding.v1.RegisterAccountData".into()
80    }
81    fn type_url() -> ::prost::alloc::string::String {
82        "/noble.forwarding.v1.RegisterAccountData".into()
83    }
84}
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct RegisterAccountMemo {
87    #[prost(message, optional, tag = "1")]
88    pub noble: ::core::option::Option<register_account_memo::RegisterAccountDataWrapper>,
89}
90/// Nested message and enum types in `RegisterAccountMemo`.
91pub mod register_account_memo {
92    #[derive(Clone, PartialEq, ::prost::Message)]
93    pub struct RegisterAccountDataWrapper {
94        #[prost(message, optional, tag = "1")]
95        pub forwarding: ::core::option::Option<super::RegisterAccountData>,
96    }
97    impl ::prost::Name for RegisterAccountDataWrapper {
98        const NAME: &'static str = "RegisterAccountDataWrapper";
99        const PACKAGE: &'static str = "noble.forwarding.v1";
100        fn full_name() -> ::prost::alloc::string::String {
101            "noble.forwarding.v1.RegisterAccountMemo.RegisterAccountDataWrapper".into()
102        }
103        fn type_url() -> ::prost::alloc::string::String {
104            "/noble.forwarding.v1.RegisterAccountMemo.RegisterAccountDataWrapper".into()
105        }
106    }
107}
108impl ::prost::Name for RegisterAccountMemo {
109    const NAME: &'static str = "RegisterAccountMemo";
110    const PACKAGE: &'static str = "noble.forwarding.v1";
111    fn full_name() -> ::prost::alloc::string::String {
112        "noble.forwarding.v1.RegisterAccountMemo".into()
113    }
114    fn type_url() -> ::prost::alloc::string::String {
115        "/noble.forwarding.v1.RegisterAccountMemo".into()
116    }
117}
118#[derive(Clone, PartialEq, ::prost::Message)]
119pub struct QueryAddress {
120    #[prost(string, tag = "1")]
121    pub channel: ::prost::alloc::string::String,
122    #[prost(string, tag = "2")]
123    pub recipient: ::prost::alloc::string::String,
124}
125impl ::prost::Name for QueryAddress {
126    const NAME: &'static str = "QueryAddress";
127    const PACKAGE: &'static str = "noble.forwarding.v1";
128    fn full_name() -> ::prost::alloc::string::String {
129        "noble.forwarding.v1.QueryAddress".into()
130    }
131    fn type_url() -> ::prost::alloc::string::String {
132        "/noble.forwarding.v1.QueryAddress".into()
133    }
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct QueryAddressResponse {
137    #[prost(string, tag = "1")]
138    pub address: ::prost::alloc::string::String,
139    #[prost(bool, tag = "2")]
140    pub exists: bool,
141}
142impl ::prost::Name for QueryAddressResponse {
143    const NAME: &'static str = "QueryAddressResponse";
144    const PACKAGE: &'static str = "noble.forwarding.v1";
145    fn full_name() -> ::prost::alloc::string::String {
146        "noble.forwarding.v1.QueryAddressResponse".into()
147    }
148    fn type_url() -> ::prost::alloc::string::String {
149        "/noble.forwarding.v1.QueryAddressResponse".into()
150    }
151}
152#[derive(Clone, Copy, PartialEq, ::prost::Message)]
153pub struct QueryStats {}
154impl ::prost::Name for QueryStats {
155    const NAME: &'static str = "QueryStats";
156    const PACKAGE: &'static str = "noble.forwarding.v1";
157    fn full_name() -> ::prost::alloc::string::String {
158        "noble.forwarding.v1.QueryStats".into()
159    }
160    fn type_url() -> ::prost::alloc::string::String {
161        "/noble.forwarding.v1.QueryStats".into()
162    }
163}
164#[derive(Clone, PartialEq, ::prost::Message)]
165pub struct QueryStatsResponse {
166    #[prost(map = "string, message", tag = "1")]
167    pub stats: ::std::collections::HashMap<::prost::alloc::string::String, Stats>,
168}
169impl ::prost::Name for QueryStatsResponse {
170    const NAME: &'static str = "QueryStatsResponse";
171    const PACKAGE: &'static str = "noble.forwarding.v1";
172    fn full_name() -> ::prost::alloc::string::String {
173        "noble.forwarding.v1.QueryStatsResponse".into()
174    }
175    fn type_url() -> ::prost::alloc::string::String {
176        "/noble.forwarding.v1.QueryStatsResponse".into()
177    }
178}
179#[derive(Clone, PartialEq, ::prost::Message)]
180pub struct QueryStatsByChannel {
181    #[prost(string, tag = "1")]
182    pub channel: ::prost::alloc::string::String,
183}
184impl ::prost::Name for QueryStatsByChannel {
185    const NAME: &'static str = "QueryStatsByChannel";
186    const PACKAGE: &'static str = "noble.forwarding.v1";
187    fn full_name() -> ::prost::alloc::string::String {
188        "noble.forwarding.v1.QueryStatsByChannel".into()
189    }
190    fn type_url() -> ::prost::alloc::string::String {
191        "/noble.forwarding.v1.QueryStatsByChannel".into()
192    }
193}
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct QueryStatsByChannelResponse {
196    #[prost(uint64, tag = "1")]
197    pub num_of_accounts: u64,
198    #[prost(uint64, tag = "2")]
199    pub num_of_forwards: u64,
200    #[prost(message, repeated, tag = "3")]
201    pub total_forwarded: ::prost::alloc::vec::Vec<
202        super::super::super::cosmos::base::v1beta1::Coin,
203    >,
204}
205impl ::prost::Name for QueryStatsByChannelResponse {
206    const NAME: &'static str = "QueryStatsByChannelResponse";
207    const PACKAGE: &'static str = "noble.forwarding.v1";
208    fn full_name() -> ::prost::alloc::string::String {
209        "noble.forwarding.v1.QueryStatsByChannelResponse".into()
210    }
211    fn type_url() -> ::prost::alloc::string::String {
212        "/noble.forwarding.v1.QueryStatsByChannelResponse".into()
213    }
214}
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct Stats {
217    #[prost(string, tag = "1")]
218    pub chain_id: ::prost::alloc::string::String,
219    #[prost(uint64, tag = "2")]
220    pub num_of_accounts: u64,
221    #[prost(uint64, tag = "3")]
222    pub num_of_forwards: u64,
223    #[prost(message, repeated, tag = "4")]
224    pub total_forwarded: ::prost::alloc::vec::Vec<
225        super::super::super::cosmos::base::v1beta1::Coin,
226    >,
227}
228impl ::prost::Name for Stats {
229    const NAME: &'static str = "Stats";
230    const PACKAGE: &'static str = "noble.forwarding.v1";
231    fn full_name() -> ::prost::alloc::string::String {
232        "noble.forwarding.v1.Stats".into()
233    }
234    fn type_url() -> ::prost::alloc::string::String {
235        "/noble.forwarding.v1.Stats".into()
236    }
237}
238/// Generated client implementations.
239#[cfg(feature = "rpc")]
240pub mod query_client {
241    #![allow(
242        unused_variables,
243        dead_code,
244        missing_docs,
245        clippy::wildcard_imports,
246        clippy::let_unit_value,
247    )]
248    use tonic::codegen::*;
249    use tonic::codegen::http::Uri;
250    #[derive(Debug, Clone)]
251    pub struct QueryClient<T> {
252        inner: tonic::client::Grpc<T>,
253    }
254    impl QueryClient<tonic::transport::Channel> {
255        /// Attempt to create a new client by connecting to a given endpoint.
256        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
257        where
258            D: TryInto<tonic::transport::Endpoint>,
259            D::Error: Into<StdError>,
260        {
261            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
262            Ok(Self::new(conn))
263        }
264    }
265    impl<T> QueryClient<T>
266    where
267        T: tonic::client::GrpcService<tonic::body::BoxBody>,
268        T::Error: Into<StdError>,
269        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
270        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
271    {
272        pub fn new(inner: T) -> Self {
273            let inner = tonic::client::Grpc::new(inner);
274            Self { inner }
275        }
276        pub fn with_origin(inner: T, origin: Uri) -> Self {
277            let inner = tonic::client::Grpc::with_origin(inner, origin);
278            Self { inner }
279        }
280        pub fn with_interceptor<F>(
281            inner: T,
282            interceptor: F,
283        ) -> QueryClient<InterceptedService<T, F>>
284        where
285            F: tonic::service::Interceptor,
286            T::ResponseBody: Default,
287            T: tonic::codegen::Service<
288                http::Request<tonic::body::BoxBody>,
289                Response = http::Response<
290                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
291                >,
292            >,
293            <T as tonic::codegen::Service<
294                http::Request<tonic::body::BoxBody>,
295            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
296        {
297            QueryClient::new(InterceptedService::new(inner, interceptor))
298        }
299        /// Compress requests with the given encoding.
300        ///
301        /// This requires the server to support it otherwise it might respond with an
302        /// error.
303        #[must_use]
304        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
305            self.inner = self.inner.send_compressed(encoding);
306            self
307        }
308        /// Enable decompressing responses.
309        #[must_use]
310        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
311            self.inner = self.inner.accept_compressed(encoding);
312            self
313        }
314        /// Limits the maximum size of a decoded message.
315        ///
316        /// Default: `4MB`
317        #[must_use]
318        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
319            self.inner = self.inner.max_decoding_message_size(limit);
320            self
321        }
322        /// Limits the maximum size of an encoded message.
323        ///
324        /// Default: `usize::MAX`
325        #[must_use]
326        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
327            self.inner = self.inner.max_encoding_message_size(limit);
328            self
329        }
330        pub async fn address(
331            &mut self,
332            request: impl tonic::IntoRequest<super::QueryAddress>,
333        ) -> std::result::Result<
334            tonic::Response<super::QueryAddressResponse>,
335            tonic::Status,
336        > {
337            self.inner
338                .ready()
339                .await
340                .map_err(|e| {
341                    tonic::Status::unknown(
342                        format!("Service was not ready: {}", e.into()),
343                    )
344                })?;
345            let codec = tonic::codec::ProstCodec::default();
346            let path = http::uri::PathAndQuery::from_static(
347                "/noble.forwarding.v1.Query/Address",
348            );
349            let mut req = request.into_request();
350            req.extensions_mut()
351                .insert(GrpcMethod::new("noble.forwarding.v1.Query", "Address"));
352            self.inner.unary(req, path, codec).await
353        }
354        pub async fn stats(
355            &mut self,
356            request: impl tonic::IntoRequest<super::QueryStats>,
357        ) -> std::result::Result<
358            tonic::Response<super::QueryStatsResponse>,
359            tonic::Status,
360        > {
361            self.inner
362                .ready()
363                .await
364                .map_err(|e| {
365                    tonic::Status::unknown(
366                        format!("Service was not ready: {}", e.into()),
367                    )
368                })?;
369            let codec = tonic::codec::ProstCodec::default();
370            let path = http::uri::PathAndQuery::from_static(
371                "/noble.forwarding.v1.Query/Stats",
372            );
373            let mut req = request.into_request();
374            req.extensions_mut()
375                .insert(GrpcMethod::new("noble.forwarding.v1.Query", "Stats"));
376            self.inner.unary(req, path, codec).await
377        }
378        pub async fn stats_by_channel(
379            &mut self,
380            request: impl tonic::IntoRequest<super::QueryStatsByChannel>,
381        ) -> std::result::Result<
382            tonic::Response<super::QueryStatsByChannelResponse>,
383            tonic::Status,
384        > {
385            self.inner
386                .ready()
387                .await
388                .map_err(|e| {
389                    tonic::Status::unknown(
390                        format!("Service was not ready: {}", e.into()),
391                    )
392                })?;
393            let codec = tonic::codec::ProstCodec::default();
394            let path = http::uri::PathAndQuery::from_static(
395                "/noble.forwarding.v1.Query/StatsByChannel",
396            );
397            let mut req = request.into_request();
398            req.extensions_mut()
399                .insert(GrpcMethod::new("noble.forwarding.v1.Query", "StatsByChannel"));
400            self.inner.unary(req, path, codec).await
401        }
402    }
403}
404/// Generated server implementations.
405#[cfg(feature = "rpc")]
406pub mod query_server {
407    #![allow(
408        unused_variables,
409        dead_code,
410        missing_docs,
411        clippy::wildcard_imports,
412        clippy::let_unit_value,
413    )]
414    use tonic::codegen::*;
415    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
416    #[async_trait]
417    pub trait Query: std::marker::Send + std::marker::Sync + 'static {
418        async fn address(
419            &self,
420            request: tonic::Request<super::QueryAddress>,
421        ) -> std::result::Result<
422            tonic::Response<super::QueryAddressResponse>,
423            tonic::Status,
424        >;
425        async fn stats(
426            &self,
427            request: tonic::Request<super::QueryStats>,
428        ) -> std::result::Result<
429            tonic::Response<super::QueryStatsResponse>,
430            tonic::Status,
431        >;
432        async fn stats_by_channel(
433            &self,
434            request: tonic::Request<super::QueryStatsByChannel>,
435        ) -> std::result::Result<
436            tonic::Response<super::QueryStatsByChannelResponse>,
437            tonic::Status,
438        >;
439    }
440    #[derive(Debug)]
441    pub struct QueryServer<T> {
442        inner: Arc<T>,
443        accept_compression_encodings: EnabledCompressionEncodings,
444        send_compression_encodings: EnabledCompressionEncodings,
445        max_decoding_message_size: Option<usize>,
446        max_encoding_message_size: Option<usize>,
447    }
448    impl<T> QueryServer<T> {
449        pub fn new(inner: T) -> Self {
450            Self::from_arc(Arc::new(inner))
451        }
452        pub fn from_arc(inner: Arc<T>) -> Self {
453            Self {
454                inner,
455                accept_compression_encodings: Default::default(),
456                send_compression_encodings: Default::default(),
457                max_decoding_message_size: None,
458                max_encoding_message_size: None,
459            }
460        }
461        pub fn with_interceptor<F>(
462            inner: T,
463            interceptor: F,
464        ) -> InterceptedService<Self, F>
465        where
466            F: tonic::service::Interceptor,
467        {
468            InterceptedService::new(Self::new(inner), interceptor)
469        }
470        /// Enable decompressing requests with the given encoding.
471        #[must_use]
472        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
473            self.accept_compression_encodings.enable(encoding);
474            self
475        }
476        /// Compress responses with the given encoding, if the client supports it.
477        #[must_use]
478        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
479            self.send_compression_encodings.enable(encoding);
480            self
481        }
482        /// Limits the maximum size of a decoded message.
483        ///
484        /// Default: `4MB`
485        #[must_use]
486        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
487            self.max_decoding_message_size = Some(limit);
488            self
489        }
490        /// Limits the maximum size of an encoded message.
491        ///
492        /// Default: `usize::MAX`
493        #[must_use]
494        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
495            self.max_encoding_message_size = Some(limit);
496            self
497        }
498    }
499    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
500    where
501        T: Query,
502        B: Body + std::marker::Send + 'static,
503        B::Error: Into<StdError> + std::marker::Send + 'static,
504    {
505        type Response = http::Response<tonic::body::BoxBody>;
506        type Error = std::convert::Infallible;
507        type Future = BoxFuture<Self::Response, Self::Error>;
508        fn poll_ready(
509            &mut self,
510            _cx: &mut Context<'_>,
511        ) -> Poll<std::result::Result<(), Self::Error>> {
512            Poll::Ready(Ok(()))
513        }
514        fn call(&mut self, req: http::Request<B>) -> Self::Future {
515            match req.uri().path() {
516                "/noble.forwarding.v1.Query/Address" => {
517                    #[allow(non_camel_case_types)]
518                    struct AddressSvc<T: Query>(pub Arc<T>);
519                    impl<T: Query> tonic::server::UnaryService<super::QueryAddress>
520                    for AddressSvc<T> {
521                        type Response = super::QueryAddressResponse;
522                        type Future = BoxFuture<
523                            tonic::Response<Self::Response>,
524                            tonic::Status,
525                        >;
526                        fn call(
527                            &mut self,
528                            request: tonic::Request<super::QueryAddress>,
529                        ) -> Self::Future {
530                            let inner = Arc::clone(&self.0);
531                            let fut = async move {
532                                <T as Query>::address(&inner, request).await
533                            };
534                            Box::pin(fut)
535                        }
536                    }
537                    let accept_compression_encodings = self.accept_compression_encodings;
538                    let send_compression_encodings = self.send_compression_encodings;
539                    let max_decoding_message_size = self.max_decoding_message_size;
540                    let max_encoding_message_size = self.max_encoding_message_size;
541                    let inner = self.inner.clone();
542                    let fut = async move {
543                        let method = AddressSvc(inner);
544                        let codec = tonic::codec::ProstCodec::default();
545                        let mut grpc = tonic::server::Grpc::new(codec)
546                            .apply_compression_config(
547                                accept_compression_encodings,
548                                send_compression_encodings,
549                            )
550                            .apply_max_message_size_config(
551                                max_decoding_message_size,
552                                max_encoding_message_size,
553                            );
554                        let res = grpc.unary(method, req).await;
555                        Ok(res)
556                    };
557                    Box::pin(fut)
558                }
559                "/noble.forwarding.v1.Query/Stats" => {
560                    #[allow(non_camel_case_types)]
561                    struct StatsSvc<T: Query>(pub Arc<T>);
562                    impl<T: Query> tonic::server::UnaryService<super::QueryStats>
563                    for StatsSvc<T> {
564                        type Response = super::QueryStatsResponse;
565                        type Future = BoxFuture<
566                            tonic::Response<Self::Response>,
567                            tonic::Status,
568                        >;
569                        fn call(
570                            &mut self,
571                            request: tonic::Request<super::QueryStats>,
572                        ) -> Self::Future {
573                            let inner = Arc::clone(&self.0);
574                            let fut = async move {
575                                <T as Query>::stats(&inner, request).await
576                            };
577                            Box::pin(fut)
578                        }
579                    }
580                    let accept_compression_encodings = self.accept_compression_encodings;
581                    let send_compression_encodings = self.send_compression_encodings;
582                    let max_decoding_message_size = self.max_decoding_message_size;
583                    let max_encoding_message_size = self.max_encoding_message_size;
584                    let inner = self.inner.clone();
585                    let fut = async move {
586                        let method = StatsSvc(inner);
587                        let codec = tonic::codec::ProstCodec::default();
588                        let mut grpc = tonic::server::Grpc::new(codec)
589                            .apply_compression_config(
590                                accept_compression_encodings,
591                                send_compression_encodings,
592                            )
593                            .apply_max_message_size_config(
594                                max_decoding_message_size,
595                                max_encoding_message_size,
596                            );
597                        let res = grpc.unary(method, req).await;
598                        Ok(res)
599                    };
600                    Box::pin(fut)
601                }
602                "/noble.forwarding.v1.Query/StatsByChannel" => {
603                    #[allow(non_camel_case_types)]
604                    struct StatsByChannelSvc<T: Query>(pub Arc<T>);
605                    impl<
606                        T: Query,
607                    > tonic::server::UnaryService<super::QueryStatsByChannel>
608                    for StatsByChannelSvc<T> {
609                        type Response = super::QueryStatsByChannelResponse;
610                        type Future = BoxFuture<
611                            tonic::Response<Self::Response>,
612                            tonic::Status,
613                        >;
614                        fn call(
615                            &mut self,
616                            request: tonic::Request<super::QueryStatsByChannel>,
617                        ) -> Self::Future {
618                            let inner = Arc::clone(&self.0);
619                            let fut = async move {
620                                <T as Query>::stats_by_channel(&inner, request).await
621                            };
622                            Box::pin(fut)
623                        }
624                    }
625                    let accept_compression_encodings = self.accept_compression_encodings;
626                    let send_compression_encodings = self.send_compression_encodings;
627                    let max_decoding_message_size = self.max_decoding_message_size;
628                    let max_encoding_message_size = self.max_encoding_message_size;
629                    let inner = self.inner.clone();
630                    let fut = async move {
631                        let method = StatsByChannelSvc(inner);
632                        let codec = tonic::codec::ProstCodec::default();
633                        let mut grpc = tonic::server::Grpc::new(codec)
634                            .apply_compression_config(
635                                accept_compression_encodings,
636                                send_compression_encodings,
637                            )
638                            .apply_max_message_size_config(
639                                max_decoding_message_size,
640                                max_encoding_message_size,
641                            );
642                        let res = grpc.unary(method, req).await;
643                        Ok(res)
644                    };
645                    Box::pin(fut)
646                }
647                _ => {
648                    Box::pin(async move {
649                        let mut response = http::Response::new(empty_body());
650                        let headers = response.headers_mut();
651                        headers
652                            .insert(
653                                tonic::Status::GRPC_STATUS,
654                                (tonic::Code::Unimplemented as i32).into(),
655                            );
656                        headers
657                            .insert(
658                                http::header::CONTENT_TYPE,
659                                tonic::metadata::GRPC_CONTENT_TYPE,
660                            );
661                        Ok(response)
662                    })
663                }
664            }
665        }
666    }
667    impl<T> Clone for QueryServer<T> {
668        fn clone(&self) -> Self {
669            let inner = self.inner.clone();
670            Self {
671                inner,
672                accept_compression_encodings: self.accept_compression_encodings,
673                send_compression_encodings: self.send_compression_encodings,
674                max_decoding_message_size: self.max_decoding_message_size,
675                max_encoding_message_size: self.max_encoding_message_size,
676            }
677        }
678    }
679    /// Generated gRPC service name
680    pub const SERVICE_NAME: &str = "noble.forwarding.v1.Query";
681    impl<T> tonic::server::NamedService for QueryServer<T> {
682        const NAME: &'static str = SERVICE_NAME;
683    }
684}
685#[derive(Clone, PartialEq, ::prost::Message)]
686pub struct MsgRegisterAccount {
687    #[prost(string, tag = "1")]
688    pub signer: ::prost::alloc::string::String,
689    #[prost(string, tag = "2")]
690    pub recipient: ::prost::alloc::string::String,
691    #[prost(string, tag = "3")]
692    pub channel: ::prost::alloc::string::String,
693}
694impl ::prost::Name for MsgRegisterAccount {
695    const NAME: &'static str = "MsgRegisterAccount";
696    const PACKAGE: &'static str = "noble.forwarding.v1";
697    fn full_name() -> ::prost::alloc::string::String {
698        "noble.forwarding.v1.MsgRegisterAccount".into()
699    }
700    fn type_url() -> ::prost::alloc::string::String {
701        "/noble.forwarding.v1.MsgRegisterAccount".into()
702    }
703}
704#[derive(Clone, PartialEq, ::prost::Message)]
705pub struct MsgRegisterAccountResponse {
706    #[prost(string, tag = "1")]
707    pub address: ::prost::alloc::string::String,
708}
709impl ::prost::Name for MsgRegisterAccountResponse {
710    const NAME: &'static str = "MsgRegisterAccountResponse";
711    const PACKAGE: &'static str = "noble.forwarding.v1";
712    fn full_name() -> ::prost::alloc::string::String {
713        "noble.forwarding.v1.MsgRegisterAccountResponse".into()
714    }
715    fn type_url() -> ::prost::alloc::string::String {
716        "/noble.forwarding.v1.MsgRegisterAccountResponse".into()
717    }
718}
719#[derive(Clone, PartialEq, ::prost::Message)]
720pub struct MsgClearAccount {
721    #[prost(string, tag = "1")]
722    pub signer: ::prost::alloc::string::String,
723    #[prost(string, tag = "2")]
724    pub address: ::prost::alloc::string::String,
725}
726impl ::prost::Name for MsgClearAccount {
727    const NAME: &'static str = "MsgClearAccount";
728    const PACKAGE: &'static str = "noble.forwarding.v1";
729    fn full_name() -> ::prost::alloc::string::String {
730        "noble.forwarding.v1.MsgClearAccount".into()
731    }
732    fn type_url() -> ::prost::alloc::string::String {
733        "/noble.forwarding.v1.MsgClearAccount".into()
734    }
735}
736#[derive(Clone, Copy, PartialEq, ::prost::Message)]
737pub struct MsgClearAccountResponse {}
738impl ::prost::Name for MsgClearAccountResponse {
739    const NAME: &'static str = "MsgClearAccountResponse";
740    const PACKAGE: &'static str = "noble.forwarding.v1";
741    fn full_name() -> ::prost::alloc::string::String {
742        "noble.forwarding.v1.MsgClearAccountResponse".into()
743    }
744    fn type_url() -> ::prost::alloc::string::String {
745        "/noble.forwarding.v1.MsgClearAccountResponse".into()
746    }
747}
748/// Generated client implementations.
749#[cfg(feature = "rpc")]
750pub mod msg_client {
751    #![allow(
752        unused_variables,
753        dead_code,
754        missing_docs,
755        clippy::wildcard_imports,
756        clippy::let_unit_value,
757    )]
758    use tonic::codegen::*;
759    use tonic::codegen::http::Uri;
760    #[derive(Debug, Clone)]
761    pub struct MsgClient<T> {
762        inner: tonic::client::Grpc<T>,
763    }
764    impl MsgClient<tonic::transport::Channel> {
765        /// Attempt to create a new client by connecting to a given endpoint.
766        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
767        where
768            D: TryInto<tonic::transport::Endpoint>,
769            D::Error: Into<StdError>,
770        {
771            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
772            Ok(Self::new(conn))
773        }
774    }
775    impl<T> MsgClient<T>
776    where
777        T: tonic::client::GrpcService<tonic::body::BoxBody>,
778        T::Error: Into<StdError>,
779        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
780        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
781    {
782        pub fn new(inner: T) -> Self {
783            let inner = tonic::client::Grpc::new(inner);
784            Self { inner }
785        }
786        pub fn with_origin(inner: T, origin: Uri) -> Self {
787            let inner = tonic::client::Grpc::with_origin(inner, origin);
788            Self { inner }
789        }
790        pub fn with_interceptor<F>(
791            inner: T,
792            interceptor: F,
793        ) -> MsgClient<InterceptedService<T, F>>
794        where
795            F: tonic::service::Interceptor,
796            T::ResponseBody: Default,
797            T: tonic::codegen::Service<
798                http::Request<tonic::body::BoxBody>,
799                Response = http::Response<
800                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
801                >,
802            >,
803            <T as tonic::codegen::Service<
804                http::Request<tonic::body::BoxBody>,
805            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
806        {
807            MsgClient::new(InterceptedService::new(inner, interceptor))
808        }
809        /// Compress requests with the given encoding.
810        ///
811        /// This requires the server to support it otherwise it might respond with an
812        /// error.
813        #[must_use]
814        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
815            self.inner = self.inner.send_compressed(encoding);
816            self
817        }
818        /// Enable decompressing responses.
819        #[must_use]
820        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
821            self.inner = self.inner.accept_compressed(encoding);
822            self
823        }
824        /// Limits the maximum size of a decoded message.
825        ///
826        /// Default: `4MB`
827        #[must_use]
828        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
829            self.inner = self.inner.max_decoding_message_size(limit);
830            self
831        }
832        /// Limits the maximum size of an encoded message.
833        ///
834        /// Default: `usize::MAX`
835        #[must_use]
836        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
837            self.inner = self.inner.max_encoding_message_size(limit);
838            self
839        }
840        pub async fn register_account(
841            &mut self,
842            request: impl tonic::IntoRequest<super::MsgRegisterAccount>,
843        ) -> std::result::Result<
844            tonic::Response<super::MsgRegisterAccountResponse>,
845            tonic::Status,
846        > {
847            self.inner
848                .ready()
849                .await
850                .map_err(|e| {
851                    tonic::Status::unknown(
852                        format!("Service was not ready: {}", e.into()),
853                    )
854                })?;
855            let codec = tonic::codec::ProstCodec::default();
856            let path = http::uri::PathAndQuery::from_static(
857                "/noble.forwarding.v1.Msg/RegisterAccount",
858            );
859            let mut req = request.into_request();
860            req.extensions_mut()
861                .insert(GrpcMethod::new("noble.forwarding.v1.Msg", "RegisterAccount"));
862            self.inner.unary(req, path, codec).await
863        }
864        pub async fn clear_account(
865            &mut self,
866            request: impl tonic::IntoRequest<super::MsgClearAccount>,
867        ) -> std::result::Result<
868            tonic::Response<super::MsgClearAccountResponse>,
869            tonic::Status,
870        > {
871            self.inner
872                .ready()
873                .await
874                .map_err(|e| {
875                    tonic::Status::unknown(
876                        format!("Service was not ready: {}", e.into()),
877                    )
878                })?;
879            let codec = tonic::codec::ProstCodec::default();
880            let path = http::uri::PathAndQuery::from_static(
881                "/noble.forwarding.v1.Msg/ClearAccount",
882            );
883            let mut req = request.into_request();
884            req.extensions_mut()
885                .insert(GrpcMethod::new("noble.forwarding.v1.Msg", "ClearAccount"));
886            self.inner.unary(req, path, codec).await
887        }
888    }
889}
890/// Generated server implementations.
891#[cfg(feature = "rpc")]
892pub mod msg_server {
893    #![allow(
894        unused_variables,
895        dead_code,
896        missing_docs,
897        clippy::wildcard_imports,
898        clippy::let_unit_value,
899    )]
900    use tonic::codegen::*;
901    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
902    #[async_trait]
903    pub trait Msg: std::marker::Send + std::marker::Sync + 'static {
904        async fn register_account(
905            &self,
906            request: tonic::Request<super::MsgRegisterAccount>,
907        ) -> std::result::Result<
908            tonic::Response<super::MsgRegisterAccountResponse>,
909            tonic::Status,
910        >;
911        async fn clear_account(
912            &self,
913            request: tonic::Request<super::MsgClearAccount>,
914        ) -> std::result::Result<
915            tonic::Response<super::MsgClearAccountResponse>,
916            tonic::Status,
917        >;
918    }
919    #[derive(Debug)]
920    pub struct MsgServer<T> {
921        inner: Arc<T>,
922        accept_compression_encodings: EnabledCompressionEncodings,
923        send_compression_encodings: EnabledCompressionEncodings,
924        max_decoding_message_size: Option<usize>,
925        max_encoding_message_size: Option<usize>,
926    }
927    impl<T> MsgServer<T> {
928        pub fn new(inner: T) -> Self {
929            Self::from_arc(Arc::new(inner))
930        }
931        pub fn from_arc(inner: Arc<T>) -> Self {
932            Self {
933                inner,
934                accept_compression_encodings: Default::default(),
935                send_compression_encodings: Default::default(),
936                max_decoding_message_size: None,
937                max_encoding_message_size: None,
938            }
939        }
940        pub fn with_interceptor<F>(
941            inner: T,
942            interceptor: F,
943        ) -> InterceptedService<Self, F>
944        where
945            F: tonic::service::Interceptor,
946        {
947            InterceptedService::new(Self::new(inner), interceptor)
948        }
949        /// Enable decompressing requests with the given encoding.
950        #[must_use]
951        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
952            self.accept_compression_encodings.enable(encoding);
953            self
954        }
955        /// Compress responses with the given encoding, if the client supports it.
956        #[must_use]
957        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
958            self.send_compression_encodings.enable(encoding);
959            self
960        }
961        /// Limits the maximum size of a decoded message.
962        ///
963        /// Default: `4MB`
964        #[must_use]
965        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
966            self.max_decoding_message_size = Some(limit);
967            self
968        }
969        /// Limits the maximum size of an encoded message.
970        ///
971        /// Default: `usize::MAX`
972        #[must_use]
973        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
974            self.max_encoding_message_size = Some(limit);
975            self
976        }
977    }
978    impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
979    where
980        T: Msg,
981        B: Body + std::marker::Send + 'static,
982        B::Error: Into<StdError> + std::marker::Send + 'static,
983    {
984        type Response = http::Response<tonic::body::BoxBody>;
985        type Error = std::convert::Infallible;
986        type Future = BoxFuture<Self::Response, Self::Error>;
987        fn poll_ready(
988            &mut self,
989            _cx: &mut Context<'_>,
990        ) -> Poll<std::result::Result<(), Self::Error>> {
991            Poll::Ready(Ok(()))
992        }
993        fn call(&mut self, req: http::Request<B>) -> Self::Future {
994            match req.uri().path() {
995                "/noble.forwarding.v1.Msg/RegisterAccount" => {
996                    #[allow(non_camel_case_types)]
997                    struct RegisterAccountSvc<T: Msg>(pub Arc<T>);
998                    impl<T: Msg> tonic::server::UnaryService<super::MsgRegisterAccount>
999                    for RegisterAccountSvc<T> {
1000                        type Response = super::MsgRegisterAccountResponse;
1001                        type Future = BoxFuture<
1002                            tonic::Response<Self::Response>,
1003                            tonic::Status,
1004                        >;
1005                        fn call(
1006                            &mut self,
1007                            request: tonic::Request<super::MsgRegisterAccount>,
1008                        ) -> Self::Future {
1009                            let inner = Arc::clone(&self.0);
1010                            let fut = async move {
1011                                <T as Msg>::register_account(&inner, request).await
1012                            };
1013                            Box::pin(fut)
1014                        }
1015                    }
1016                    let accept_compression_encodings = self.accept_compression_encodings;
1017                    let send_compression_encodings = self.send_compression_encodings;
1018                    let max_decoding_message_size = self.max_decoding_message_size;
1019                    let max_encoding_message_size = self.max_encoding_message_size;
1020                    let inner = self.inner.clone();
1021                    let fut = async move {
1022                        let method = RegisterAccountSvc(inner);
1023                        let codec = tonic::codec::ProstCodec::default();
1024                        let mut grpc = tonic::server::Grpc::new(codec)
1025                            .apply_compression_config(
1026                                accept_compression_encodings,
1027                                send_compression_encodings,
1028                            )
1029                            .apply_max_message_size_config(
1030                                max_decoding_message_size,
1031                                max_encoding_message_size,
1032                            );
1033                        let res = grpc.unary(method, req).await;
1034                        Ok(res)
1035                    };
1036                    Box::pin(fut)
1037                }
1038                "/noble.forwarding.v1.Msg/ClearAccount" => {
1039                    #[allow(non_camel_case_types)]
1040                    struct ClearAccountSvc<T: Msg>(pub Arc<T>);
1041                    impl<T: Msg> tonic::server::UnaryService<super::MsgClearAccount>
1042                    for ClearAccountSvc<T> {
1043                        type Response = super::MsgClearAccountResponse;
1044                        type Future = BoxFuture<
1045                            tonic::Response<Self::Response>,
1046                            tonic::Status,
1047                        >;
1048                        fn call(
1049                            &mut self,
1050                            request: tonic::Request<super::MsgClearAccount>,
1051                        ) -> Self::Future {
1052                            let inner = Arc::clone(&self.0);
1053                            let fut = async move {
1054                                <T as Msg>::clear_account(&inner, request).await
1055                            };
1056                            Box::pin(fut)
1057                        }
1058                    }
1059                    let accept_compression_encodings = self.accept_compression_encodings;
1060                    let send_compression_encodings = self.send_compression_encodings;
1061                    let max_decoding_message_size = self.max_decoding_message_size;
1062                    let max_encoding_message_size = self.max_encoding_message_size;
1063                    let inner = self.inner.clone();
1064                    let fut = async move {
1065                        let method = ClearAccountSvc(inner);
1066                        let codec = tonic::codec::ProstCodec::default();
1067                        let mut grpc = tonic::server::Grpc::new(codec)
1068                            .apply_compression_config(
1069                                accept_compression_encodings,
1070                                send_compression_encodings,
1071                            )
1072                            .apply_max_message_size_config(
1073                                max_decoding_message_size,
1074                                max_encoding_message_size,
1075                            );
1076                        let res = grpc.unary(method, req).await;
1077                        Ok(res)
1078                    };
1079                    Box::pin(fut)
1080                }
1081                _ => {
1082                    Box::pin(async move {
1083                        let mut response = http::Response::new(empty_body());
1084                        let headers = response.headers_mut();
1085                        headers
1086                            .insert(
1087                                tonic::Status::GRPC_STATUS,
1088                                (tonic::Code::Unimplemented as i32).into(),
1089                            );
1090                        headers
1091                            .insert(
1092                                http::header::CONTENT_TYPE,
1093                                tonic::metadata::GRPC_CONTENT_TYPE,
1094                            );
1095                        Ok(response)
1096                    })
1097                }
1098            }
1099        }
1100    }
1101    impl<T> Clone for MsgServer<T> {
1102        fn clone(&self) -> Self {
1103            let inner = self.inner.clone();
1104            Self {
1105                inner,
1106                accept_compression_encodings: self.accept_compression_encodings,
1107                send_compression_encodings: self.send_compression_encodings,
1108                max_decoding_message_size: self.max_decoding_message_size,
1109                max_encoding_message_size: self.max_encoding_message_size,
1110            }
1111        }
1112    }
1113    /// Generated gRPC service name
1114    pub const SERVICE_NAME: &str = "noble.forwarding.v1.Msg";
1115    impl<T> tonic::server::NamedService for MsgServer<T> {
1116        const NAME: &'static str = SERVICE_NAME;
1117    }
1118}