miden_node_proto/generated/
ntx_builder_store.rs

1// This file is @generated by prost-build.
2/// Account ID prefix.
3#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct AccountIdPrefix {
5    /// Account ID prefix.
6    #[prost(fixed32, tag = "1")]
7    pub account_id_prefix: u32,
8}
9/// Represents the result of getting network account details by prefix.
10#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
11pub struct MaybeAccountDetails {
12    /// Account details.
13    #[prost(message, optional, tag = "1")]
14    pub details: ::core::option::Option<super::account::AccountDetails>,
15}
16/// Returns a list of unconsumed network notes using pagination.
17#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
18pub struct UnconsumedNetworkNotesRequest {
19    /// An opaque token used to paginate through the notes.
20    ///
21    /// This should be null on the first call, and set to the response  token until the response token
22    /// is null, at which point all data has been fetched.
23    #[prost(uint64, optional, tag = "1")]
24    pub page_token: ::core::option::Option<u64>,
25    /// Number of notes to retrieve per page.
26    #[prost(uint64, tag = "2")]
27    pub page_size: u64,
28}
29/// Returns a paginated list of unconsumed network notes for an account.
30///
31/// Notes created or consumed after the specified block are excluded from the result.
32#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
33pub struct UnconsumedNetworkNotesForAccountRequest {
34    /// This should be null on the first call, and set to the response token until the response token
35    /// is null, at which point all data has been fetched.
36    ///
37    /// Note that this token is only valid if used with the same parameters.
38    #[prost(uint64, optional, tag = "1")]
39    pub page_token: ::core::option::Option<u64>,
40    /// Number of notes to retrieve per page.
41    #[prost(uint64, tag = "2")]
42    pub page_size: u64,
43    /// The network account ID prefix to filter notes by.
44    #[prost(uint32, tag = "3")]
45    pub network_account_id_prefix: u32,
46    /// The block number to filter the returned notes by.
47    ///
48    /// Notes that are created or consumed after this block are excluded from the result.
49    #[prost(fixed32, tag = "4")]
50    pub block_num: u32,
51}
52/// Represents the result of getting the unconsumed network notes.
53#[derive(Clone, PartialEq, ::prost::Message)]
54pub struct UnconsumedNetworkNotes {
55    /// An opaque pagination token.
56    ///
57    /// Use this in your next request to get the next
58    /// set of data.
59    ///
60    /// Will be null once there is no more data remaining.
61    #[prost(uint64, optional, tag = "1")]
62    pub next_token: ::core::option::Option<u64>,
63    /// The list of unconsumed network notes.
64    #[prost(message, repeated, tag = "2")]
65    pub notes: ::prost::alloc::vec::Vec<super::note::NetworkNote>,
66}
67/// Current blockchain data based on the requested block number.
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct CurrentBlockchainData {
70    /// Commitments that represent the current state according to the MMR.
71    #[prost(message, repeated, tag = "1")]
72    pub current_peaks: ::prost::alloc::vec::Vec<super::primitives::Digest>,
73    /// Current block header.
74    #[prost(message, optional, tag = "2")]
75    pub current_block_header: ::core::option::Option<super::blockchain::BlockHeader>,
76}
77/// Generated client implementations.
78pub mod ntx_builder_client {
79    #![allow(
80        unused_variables,
81        dead_code,
82        missing_docs,
83        clippy::wildcard_imports,
84        clippy::let_unit_value,
85    )]
86    use tonic::codegen::*;
87    use tonic::codegen::http::Uri;
88    /// Store API for the network transaction builder component
89    #[derive(Debug, Clone)]
90    pub struct NtxBuilderClient<T> {
91        inner: tonic::client::Grpc<T>,
92    }
93    impl NtxBuilderClient<tonic::transport::Channel> {
94        /// Attempt to create a new client by connecting to a given endpoint.
95        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
96        where
97            D: TryInto<tonic::transport::Endpoint>,
98            D::Error: Into<StdError>,
99        {
100            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
101            Ok(Self::new(conn))
102        }
103    }
104    impl<T> NtxBuilderClient<T>
105    where
106        T: tonic::client::GrpcService<tonic::body::Body>,
107        T::Error: Into<StdError>,
108        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
109        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
110    {
111        pub fn new(inner: T) -> Self {
112            let inner = tonic::client::Grpc::new(inner);
113            Self { inner }
114        }
115        pub fn with_origin(inner: T, origin: Uri) -> Self {
116            let inner = tonic::client::Grpc::with_origin(inner, origin);
117            Self { inner }
118        }
119        pub fn with_interceptor<F>(
120            inner: T,
121            interceptor: F,
122        ) -> NtxBuilderClient<InterceptedService<T, F>>
123        where
124            F: tonic::service::Interceptor,
125            T::ResponseBody: Default,
126            T: tonic::codegen::Service<
127                http::Request<tonic::body::Body>,
128                Response = http::Response<
129                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
130                >,
131            >,
132            <T as tonic::codegen::Service<
133                http::Request<tonic::body::Body>,
134            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
135        {
136            NtxBuilderClient::new(InterceptedService::new(inner, interceptor))
137        }
138        /// Compress requests with the given encoding.
139        ///
140        /// This requires the server to support it otherwise it might respond with an
141        /// error.
142        #[must_use]
143        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
144            self.inner = self.inner.send_compressed(encoding);
145            self
146        }
147        /// Enable decompressing responses.
148        #[must_use]
149        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
150            self.inner = self.inner.accept_compressed(encoding);
151            self
152        }
153        /// Limits the maximum size of a decoded message.
154        ///
155        /// Default: `4MB`
156        #[must_use]
157        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
158            self.inner = self.inner.max_decoding_message_size(limit);
159            self
160        }
161        /// Limits the maximum size of an encoded message.
162        ///
163        /// Default: `usize::MAX`
164        #[must_use]
165        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
166            self.inner = self.inner.max_encoding_message_size(limit);
167            self
168        }
169        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
170        /// and current chain length to authenticate the block's inclusion.
171        pub async fn get_block_header_by_number(
172            &mut self,
173            request: impl tonic::IntoRequest<
174                super::super::shared::BlockHeaderByNumberRequest,
175            >,
176        ) -> std::result::Result<
177            tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
178            tonic::Status,
179        > {
180            self.inner
181                .ready()
182                .await
183                .map_err(|e| {
184                    tonic::Status::unknown(
185                        format!("Service was not ready: {}", e.into()),
186                    )
187                })?;
188            let codec = tonic_prost::ProstCodec::default();
189            let path = http::uri::PathAndQuery::from_static(
190                "/ntx_builder_store.NtxBuilder/GetBlockHeaderByNumber",
191            );
192            let mut req = request.into_request();
193            req.extensions_mut()
194                .insert(
195                    GrpcMethod::new(
196                        "ntx_builder_store.NtxBuilder",
197                        "GetBlockHeaderByNumber",
198                    ),
199                );
200            self.inner.unary(req, path, codec).await
201        }
202        /// Returns a paginated list of unconsumed network notes.
203        pub async fn get_unconsumed_network_notes(
204            &mut self,
205            request: impl tonic::IntoRequest<super::UnconsumedNetworkNotesRequest>,
206        ) -> std::result::Result<
207            tonic::Response<super::UnconsumedNetworkNotes>,
208            tonic::Status,
209        > {
210            self.inner
211                .ready()
212                .await
213                .map_err(|e| {
214                    tonic::Status::unknown(
215                        format!("Service was not ready: {}", e.into()),
216                    )
217                })?;
218            let codec = tonic_prost::ProstCodec::default();
219            let path = http::uri::PathAndQuery::from_static(
220                "/ntx_builder_store.NtxBuilder/GetUnconsumedNetworkNotes",
221            );
222            let mut req = request.into_request();
223            req.extensions_mut()
224                .insert(
225                    GrpcMethod::new(
226                        "ntx_builder_store.NtxBuilder",
227                        "GetUnconsumedNetworkNotes",
228                    ),
229                );
230            self.inner.unary(req, path, codec).await
231        }
232        /// Returns a paginated list of a network account's unconsumed notes up to a specified block number.
233        pub async fn get_unconsumed_network_notes_for_account(
234            &mut self,
235            request: impl tonic::IntoRequest<
236                super::UnconsumedNetworkNotesForAccountRequest,
237            >,
238        ) -> std::result::Result<
239            tonic::Response<super::UnconsumedNetworkNotes>,
240            tonic::Status,
241        > {
242            self.inner
243                .ready()
244                .await
245                .map_err(|e| {
246                    tonic::Status::unknown(
247                        format!("Service was not ready: {}", e.into()),
248                    )
249                })?;
250            let codec = tonic_prost::ProstCodec::default();
251            let path = http::uri::PathAndQuery::from_static(
252                "/ntx_builder_store.NtxBuilder/GetUnconsumedNetworkNotesForAccount",
253            );
254            let mut req = request.into_request();
255            req.extensions_mut()
256                .insert(
257                    GrpcMethod::new(
258                        "ntx_builder_store.NtxBuilder",
259                        "GetUnconsumedNetworkNotesForAccount",
260                    ),
261                );
262            self.inner.unary(req, path, codec).await
263        }
264        /// Returns the block header at the chain tip, as well as the MMR peaks corresponding to this
265        /// header for executing network transactions. If the block number is not provided, the latest
266        /// header and peaks will be retrieved.
267        pub async fn get_current_blockchain_data(
268            &mut self,
269            request: impl tonic::IntoRequest<super::super::blockchain::MaybeBlockNumber>,
270        ) -> std::result::Result<
271            tonic::Response<super::CurrentBlockchainData>,
272            tonic::Status,
273        > {
274            self.inner
275                .ready()
276                .await
277                .map_err(|e| {
278                    tonic::Status::unknown(
279                        format!("Service was not ready: {}", e.into()),
280                    )
281                })?;
282            let codec = tonic_prost::ProstCodec::default();
283            let path = http::uri::PathAndQuery::from_static(
284                "/ntx_builder_store.NtxBuilder/GetCurrentBlockchainData",
285            );
286            let mut req = request.into_request();
287            req.extensions_mut()
288                .insert(
289                    GrpcMethod::new(
290                        "ntx_builder_store.NtxBuilder",
291                        "GetCurrentBlockchainData",
292                    ),
293                );
294            self.inner.unary(req, path, codec).await
295        }
296        /// Returns the latest state of a network account with the specified account prefix.
297        pub async fn get_network_account_details_by_prefix(
298            &mut self,
299            request: impl tonic::IntoRequest<super::AccountIdPrefix>,
300        ) -> std::result::Result<
301            tonic::Response<super::MaybeAccountDetails>,
302            tonic::Status,
303        > {
304            self.inner
305                .ready()
306                .await
307                .map_err(|e| {
308                    tonic::Status::unknown(
309                        format!("Service was not ready: {}", e.into()),
310                    )
311                })?;
312            let codec = tonic_prost::ProstCodec::default();
313            let path = http::uri::PathAndQuery::from_static(
314                "/ntx_builder_store.NtxBuilder/GetNetworkAccountDetailsByPrefix",
315            );
316            let mut req = request.into_request();
317            req.extensions_mut()
318                .insert(
319                    GrpcMethod::new(
320                        "ntx_builder_store.NtxBuilder",
321                        "GetNetworkAccountDetailsByPrefix",
322                    ),
323                );
324            self.inner.unary(req, path, codec).await
325        }
326        /// Returns the script for a note by its root.
327        pub async fn get_note_script_by_root(
328            &mut self,
329            request: impl tonic::IntoRequest<super::super::note::NoteRoot>,
330        ) -> std::result::Result<
331            tonic::Response<super::super::shared::MaybeNoteScript>,
332            tonic::Status,
333        > {
334            self.inner
335                .ready()
336                .await
337                .map_err(|e| {
338                    tonic::Status::unknown(
339                        format!("Service was not ready: {}", e.into()),
340                    )
341                })?;
342            let codec = tonic_prost::ProstCodec::default();
343            let path = http::uri::PathAndQuery::from_static(
344                "/ntx_builder_store.NtxBuilder/GetNoteScriptByRoot",
345            );
346            let mut req = request.into_request();
347            req.extensions_mut()
348                .insert(
349                    GrpcMethod::new(
350                        "ntx_builder_store.NtxBuilder",
351                        "GetNoteScriptByRoot",
352                    ),
353                );
354            self.inner.unary(req, path, codec).await
355        }
356    }
357}
358/// Generated server implementations.
359pub mod ntx_builder_server {
360    #![allow(
361        unused_variables,
362        dead_code,
363        missing_docs,
364        clippy::wildcard_imports,
365        clippy::let_unit_value,
366    )]
367    use tonic::codegen::*;
368    /// Generated trait containing gRPC methods that should be implemented for use with NtxBuilderServer.
369    #[async_trait]
370    pub trait NtxBuilder: std::marker::Send + std::marker::Sync + 'static {
371        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
372        /// and current chain length to authenticate the block's inclusion.
373        async fn get_block_header_by_number(
374            &self,
375            request: tonic::Request<super::super::shared::BlockHeaderByNumberRequest>,
376        ) -> std::result::Result<
377            tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
378            tonic::Status,
379        >;
380        /// Returns a paginated list of unconsumed network notes.
381        async fn get_unconsumed_network_notes(
382            &self,
383            request: tonic::Request<super::UnconsumedNetworkNotesRequest>,
384        ) -> std::result::Result<
385            tonic::Response<super::UnconsumedNetworkNotes>,
386            tonic::Status,
387        >;
388        /// Returns a paginated list of a network account's unconsumed notes up to a specified block number.
389        async fn get_unconsumed_network_notes_for_account(
390            &self,
391            request: tonic::Request<super::UnconsumedNetworkNotesForAccountRequest>,
392        ) -> std::result::Result<
393            tonic::Response<super::UnconsumedNetworkNotes>,
394            tonic::Status,
395        >;
396        /// Returns the block header at the chain tip, as well as the MMR peaks corresponding to this
397        /// header for executing network transactions. If the block number is not provided, the latest
398        /// header and peaks will be retrieved.
399        async fn get_current_blockchain_data(
400            &self,
401            request: tonic::Request<super::super::blockchain::MaybeBlockNumber>,
402        ) -> std::result::Result<
403            tonic::Response<super::CurrentBlockchainData>,
404            tonic::Status,
405        >;
406        /// Returns the latest state of a network account with the specified account prefix.
407        async fn get_network_account_details_by_prefix(
408            &self,
409            request: tonic::Request<super::AccountIdPrefix>,
410        ) -> std::result::Result<
411            tonic::Response<super::MaybeAccountDetails>,
412            tonic::Status,
413        >;
414        /// Returns the script for a note by its root.
415        async fn get_note_script_by_root(
416            &self,
417            request: tonic::Request<super::super::note::NoteRoot>,
418        ) -> std::result::Result<
419            tonic::Response<super::super::shared::MaybeNoteScript>,
420            tonic::Status,
421        >;
422    }
423    /// Store API for the network transaction builder component
424    #[derive(Debug)]
425    pub struct NtxBuilderServer<T> {
426        inner: Arc<T>,
427        accept_compression_encodings: EnabledCompressionEncodings,
428        send_compression_encodings: EnabledCompressionEncodings,
429        max_decoding_message_size: Option<usize>,
430        max_encoding_message_size: Option<usize>,
431    }
432    impl<T> NtxBuilderServer<T> {
433        pub fn new(inner: T) -> Self {
434            Self::from_arc(Arc::new(inner))
435        }
436        pub fn from_arc(inner: Arc<T>) -> Self {
437            Self {
438                inner,
439                accept_compression_encodings: Default::default(),
440                send_compression_encodings: Default::default(),
441                max_decoding_message_size: None,
442                max_encoding_message_size: None,
443            }
444        }
445        pub fn with_interceptor<F>(
446            inner: T,
447            interceptor: F,
448        ) -> InterceptedService<Self, F>
449        where
450            F: tonic::service::Interceptor,
451        {
452            InterceptedService::new(Self::new(inner), interceptor)
453        }
454        /// Enable decompressing requests with the given encoding.
455        #[must_use]
456        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
457            self.accept_compression_encodings.enable(encoding);
458            self
459        }
460        /// Compress responses with the given encoding, if the client supports it.
461        #[must_use]
462        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
463            self.send_compression_encodings.enable(encoding);
464            self
465        }
466        /// Limits the maximum size of a decoded message.
467        ///
468        /// Default: `4MB`
469        #[must_use]
470        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
471            self.max_decoding_message_size = Some(limit);
472            self
473        }
474        /// Limits the maximum size of an encoded message.
475        ///
476        /// Default: `usize::MAX`
477        #[must_use]
478        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
479            self.max_encoding_message_size = Some(limit);
480            self
481        }
482    }
483    impl<T, B> tonic::codegen::Service<http::Request<B>> for NtxBuilderServer<T>
484    where
485        T: NtxBuilder,
486        B: Body + std::marker::Send + 'static,
487        B::Error: Into<StdError> + std::marker::Send + 'static,
488    {
489        type Response = http::Response<tonic::body::Body>;
490        type Error = std::convert::Infallible;
491        type Future = BoxFuture<Self::Response, Self::Error>;
492        fn poll_ready(
493            &mut self,
494            _cx: &mut Context<'_>,
495        ) -> Poll<std::result::Result<(), Self::Error>> {
496            Poll::Ready(Ok(()))
497        }
498        fn call(&mut self, req: http::Request<B>) -> Self::Future {
499            match req.uri().path() {
500                "/ntx_builder_store.NtxBuilder/GetBlockHeaderByNumber" => {
501                    #[allow(non_camel_case_types)]
502                    struct GetBlockHeaderByNumberSvc<T: NtxBuilder>(pub Arc<T>);
503                    impl<
504                        T: NtxBuilder,
505                    > tonic::server::UnaryService<
506                        super::super::shared::BlockHeaderByNumberRequest,
507                    > for GetBlockHeaderByNumberSvc<T> {
508                        type Response = super::super::shared::BlockHeaderByNumberResponse;
509                        type Future = BoxFuture<
510                            tonic::Response<Self::Response>,
511                            tonic::Status,
512                        >;
513                        fn call(
514                            &mut self,
515                            request: tonic::Request<
516                                super::super::shared::BlockHeaderByNumberRequest,
517                            >,
518                        ) -> Self::Future {
519                            let inner = Arc::clone(&self.0);
520                            let fut = async move {
521                                <T as NtxBuilder>::get_block_header_by_number(
522                                        &inner,
523                                        request,
524                                    )
525                                    .await
526                            };
527                            Box::pin(fut)
528                        }
529                    }
530                    let accept_compression_encodings = self.accept_compression_encodings;
531                    let send_compression_encodings = self.send_compression_encodings;
532                    let max_decoding_message_size = self.max_decoding_message_size;
533                    let max_encoding_message_size = self.max_encoding_message_size;
534                    let inner = self.inner.clone();
535                    let fut = async move {
536                        let method = GetBlockHeaderByNumberSvc(inner);
537                        let codec = tonic_prost::ProstCodec::default();
538                        let mut grpc = tonic::server::Grpc::new(codec)
539                            .apply_compression_config(
540                                accept_compression_encodings,
541                                send_compression_encodings,
542                            )
543                            .apply_max_message_size_config(
544                                max_decoding_message_size,
545                                max_encoding_message_size,
546                            );
547                        let res = grpc.unary(method, req).await;
548                        Ok(res)
549                    };
550                    Box::pin(fut)
551                }
552                "/ntx_builder_store.NtxBuilder/GetUnconsumedNetworkNotes" => {
553                    #[allow(non_camel_case_types)]
554                    struct GetUnconsumedNetworkNotesSvc<T: NtxBuilder>(pub Arc<T>);
555                    impl<
556                        T: NtxBuilder,
557                    > tonic::server::UnaryService<super::UnconsumedNetworkNotesRequest>
558                    for GetUnconsumedNetworkNotesSvc<T> {
559                        type Response = super::UnconsumedNetworkNotes;
560                        type Future = BoxFuture<
561                            tonic::Response<Self::Response>,
562                            tonic::Status,
563                        >;
564                        fn call(
565                            &mut self,
566                            request: tonic::Request<super::UnconsumedNetworkNotesRequest>,
567                        ) -> Self::Future {
568                            let inner = Arc::clone(&self.0);
569                            let fut = async move {
570                                <T as NtxBuilder>::get_unconsumed_network_notes(
571                                        &inner,
572                                        request,
573                                    )
574                                    .await
575                            };
576                            Box::pin(fut)
577                        }
578                    }
579                    let accept_compression_encodings = self.accept_compression_encodings;
580                    let send_compression_encodings = self.send_compression_encodings;
581                    let max_decoding_message_size = self.max_decoding_message_size;
582                    let max_encoding_message_size = self.max_encoding_message_size;
583                    let inner = self.inner.clone();
584                    let fut = async move {
585                        let method = GetUnconsumedNetworkNotesSvc(inner);
586                        let codec = tonic_prost::ProstCodec::default();
587                        let mut grpc = tonic::server::Grpc::new(codec)
588                            .apply_compression_config(
589                                accept_compression_encodings,
590                                send_compression_encodings,
591                            )
592                            .apply_max_message_size_config(
593                                max_decoding_message_size,
594                                max_encoding_message_size,
595                            );
596                        let res = grpc.unary(method, req).await;
597                        Ok(res)
598                    };
599                    Box::pin(fut)
600                }
601                "/ntx_builder_store.NtxBuilder/GetUnconsumedNetworkNotesForAccount" => {
602                    #[allow(non_camel_case_types)]
603                    struct GetUnconsumedNetworkNotesForAccountSvc<T: NtxBuilder>(
604                        pub Arc<T>,
605                    );
606                    impl<
607                        T: NtxBuilder,
608                    > tonic::server::UnaryService<
609                        super::UnconsumedNetworkNotesForAccountRequest,
610                    > for GetUnconsumedNetworkNotesForAccountSvc<T> {
611                        type Response = super::UnconsumedNetworkNotes;
612                        type Future = BoxFuture<
613                            tonic::Response<Self::Response>,
614                            tonic::Status,
615                        >;
616                        fn call(
617                            &mut self,
618                            request: tonic::Request<
619                                super::UnconsumedNetworkNotesForAccountRequest,
620                            >,
621                        ) -> Self::Future {
622                            let inner = Arc::clone(&self.0);
623                            let fut = async move {
624                                <T as NtxBuilder>::get_unconsumed_network_notes_for_account(
625                                        &inner,
626                                        request,
627                                    )
628                                    .await
629                            };
630                            Box::pin(fut)
631                        }
632                    }
633                    let accept_compression_encodings = self.accept_compression_encodings;
634                    let send_compression_encodings = self.send_compression_encodings;
635                    let max_decoding_message_size = self.max_decoding_message_size;
636                    let max_encoding_message_size = self.max_encoding_message_size;
637                    let inner = self.inner.clone();
638                    let fut = async move {
639                        let method = GetUnconsumedNetworkNotesForAccountSvc(inner);
640                        let codec = tonic_prost::ProstCodec::default();
641                        let mut grpc = tonic::server::Grpc::new(codec)
642                            .apply_compression_config(
643                                accept_compression_encodings,
644                                send_compression_encodings,
645                            )
646                            .apply_max_message_size_config(
647                                max_decoding_message_size,
648                                max_encoding_message_size,
649                            );
650                        let res = grpc.unary(method, req).await;
651                        Ok(res)
652                    };
653                    Box::pin(fut)
654                }
655                "/ntx_builder_store.NtxBuilder/GetCurrentBlockchainData" => {
656                    #[allow(non_camel_case_types)]
657                    struct GetCurrentBlockchainDataSvc<T: NtxBuilder>(pub Arc<T>);
658                    impl<
659                        T: NtxBuilder,
660                    > tonic::server::UnaryService<
661                        super::super::blockchain::MaybeBlockNumber,
662                    > for GetCurrentBlockchainDataSvc<T> {
663                        type Response = super::CurrentBlockchainData;
664                        type Future = BoxFuture<
665                            tonic::Response<Self::Response>,
666                            tonic::Status,
667                        >;
668                        fn call(
669                            &mut self,
670                            request: tonic::Request<
671                                super::super::blockchain::MaybeBlockNumber,
672                            >,
673                        ) -> Self::Future {
674                            let inner = Arc::clone(&self.0);
675                            let fut = async move {
676                                <T as NtxBuilder>::get_current_blockchain_data(
677                                        &inner,
678                                        request,
679                                    )
680                                    .await
681                            };
682                            Box::pin(fut)
683                        }
684                    }
685                    let accept_compression_encodings = self.accept_compression_encodings;
686                    let send_compression_encodings = self.send_compression_encodings;
687                    let max_decoding_message_size = self.max_decoding_message_size;
688                    let max_encoding_message_size = self.max_encoding_message_size;
689                    let inner = self.inner.clone();
690                    let fut = async move {
691                        let method = GetCurrentBlockchainDataSvc(inner);
692                        let codec = tonic_prost::ProstCodec::default();
693                        let mut grpc = tonic::server::Grpc::new(codec)
694                            .apply_compression_config(
695                                accept_compression_encodings,
696                                send_compression_encodings,
697                            )
698                            .apply_max_message_size_config(
699                                max_decoding_message_size,
700                                max_encoding_message_size,
701                            );
702                        let res = grpc.unary(method, req).await;
703                        Ok(res)
704                    };
705                    Box::pin(fut)
706                }
707                "/ntx_builder_store.NtxBuilder/GetNetworkAccountDetailsByPrefix" => {
708                    #[allow(non_camel_case_types)]
709                    struct GetNetworkAccountDetailsByPrefixSvc<T: NtxBuilder>(
710                        pub Arc<T>,
711                    );
712                    impl<
713                        T: NtxBuilder,
714                    > tonic::server::UnaryService<super::AccountIdPrefix>
715                    for GetNetworkAccountDetailsByPrefixSvc<T> {
716                        type Response = super::MaybeAccountDetails;
717                        type Future = BoxFuture<
718                            tonic::Response<Self::Response>,
719                            tonic::Status,
720                        >;
721                        fn call(
722                            &mut self,
723                            request: tonic::Request<super::AccountIdPrefix>,
724                        ) -> Self::Future {
725                            let inner = Arc::clone(&self.0);
726                            let fut = async move {
727                                <T as NtxBuilder>::get_network_account_details_by_prefix(
728                                        &inner,
729                                        request,
730                                    )
731                                    .await
732                            };
733                            Box::pin(fut)
734                        }
735                    }
736                    let accept_compression_encodings = self.accept_compression_encodings;
737                    let send_compression_encodings = self.send_compression_encodings;
738                    let max_decoding_message_size = self.max_decoding_message_size;
739                    let max_encoding_message_size = self.max_encoding_message_size;
740                    let inner = self.inner.clone();
741                    let fut = async move {
742                        let method = GetNetworkAccountDetailsByPrefixSvc(inner);
743                        let codec = tonic_prost::ProstCodec::default();
744                        let mut grpc = tonic::server::Grpc::new(codec)
745                            .apply_compression_config(
746                                accept_compression_encodings,
747                                send_compression_encodings,
748                            )
749                            .apply_max_message_size_config(
750                                max_decoding_message_size,
751                                max_encoding_message_size,
752                            );
753                        let res = grpc.unary(method, req).await;
754                        Ok(res)
755                    };
756                    Box::pin(fut)
757                }
758                "/ntx_builder_store.NtxBuilder/GetNoteScriptByRoot" => {
759                    #[allow(non_camel_case_types)]
760                    struct GetNoteScriptByRootSvc<T: NtxBuilder>(pub Arc<T>);
761                    impl<
762                        T: NtxBuilder,
763                    > tonic::server::UnaryService<super::super::note::NoteRoot>
764                    for GetNoteScriptByRootSvc<T> {
765                        type Response = super::super::shared::MaybeNoteScript;
766                        type Future = BoxFuture<
767                            tonic::Response<Self::Response>,
768                            tonic::Status,
769                        >;
770                        fn call(
771                            &mut self,
772                            request: tonic::Request<super::super::note::NoteRoot>,
773                        ) -> Self::Future {
774                            let inner = Arc::clone(&self.0);
775                            let fut = async move {
776                                <T as NtxBuilder>::get_note_script_by_root(&inner, request)
777                                    .await
778                            };
779                            Box::pin(fut)
780                        }
781                    }
782                    let accept_compression_encodings = self.accept_compression_encodings;
783                    let send_compression_encodings = self.send_compression_encodings;
784                    let max_decoding_message_size = self.max_decoding_message_size;
785                    let max_encoding_message_size = self.max_encoding_message_size;
786                    let inner = self.inner.clone();
787                    let fut = async move {
788                        let method = GetNoteScriptByRootSvc(inner);
789                        let codec = tonic_prost::ProstCodec::default();
790                        let mut grpc = tonic::server::Grpc::new(codec)
791                            .apply_compression_config(
792                                accept_compression_encodings,
793                                send_compression_encodings,
794                            )
795                            .apply_max_message_size_config(
796                                max_decoding_message_size,
797                                max_encoding_message_size,
798                            );
799                        let res = grpc.unary(method, req).await;
800                        Ok(res)
801                    };
802                    Box::pin(fut)
803                }
804                _ => {
805                    Box::pin(async move {
806                        let mut response = http::Response::new(
807                            tonic::body::Body::default(),
808                        );
809                        let headers = response.headers_mut();
810                        headers
811                            .insert(
812                                tonic::Status::GRPC_STATUS,
813                                (tonic::Code::Unimplemented as i32).into(),
814                            );
815                        headers
816                            .insert(
817                                http::header::CONTENT_TYPE,
818                                tonic::metadata::GRPC_CONTENT_TYPE,
819                            );
820                        Ok(response)
821                    })
822                }
823            }
824        }
825    }
826    impl<T> Clone for NtxBuilderServer<T> {
827        fn clone(&self) -> Self {
828            let inner = self.inner.clone();
829            Self {
830                inner,
831                accept_compression_encodings: self.accept_compression_encodings,
832                send_compression_encodings: self.send_compression_encodings,
833                max_decoding_message_size: self.max_decoding_message_size,
834                max_encoding_message_size: self.max_encoding_message_size,
835            }
836        }
837    }
838    /// Generated gRPC service name
839    pub const SERVICE_NAME: &str = "ntx_builder_store.NtxBuilder";
840    impl<T> tonic::server::NamedService for NtxBuilderServer<T> {
841        const NAME: &'static str = SERVICE_NAME;
842    }
843}