1#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct RpcStatus {
5 #[prost(string, tag = "1")]
7 pub version: ::prost::alloc::string::String,
8 #[prost(message, optional, tag = "2")]
10 pub genesis_commitment: ::core::option::Option<super::primitives::Digest>,
11 #[prost(message, optional, tag = "3")]
13 pub store: ::core::option::Option<StoreStatus>,
14 #[prost(message, optional, tag = "4")]
16 pub block_producer: ::core::option::Option<BlockProducerStatus>,
17}
18#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
20pub struct BlockProducerStatus {
21 #[prost(string, tag = "1")]
23 pub version: ::prost::alloc::string::String,
24 #[prost(string, tag = "2")]
26 pub status: ::prost::alloc::string::String,
27 #[prost(fixed32, tag = "4")]
32 pub chain_tip: u32,
33 #[prost(message, optional, tag = "3")]
35 pub mempool_stats: ::core::option::Option<MempoolStats>,
36}
37#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
39pub struct MempoolStats {
40 #[prost(uint64, tag = "1")]
42 pub unbatched_transactions: u64,
43 #[prost(uint64, tag = "2")]
45 pub proposed_batches: u64,
46 #[prost(uint64, tag = "3")]
48 pub proven_batches: u64,
49}
50#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
52pub struct StoreStatus {
53 #[prost(string, tag = "1")]
55 pub version: ::prost::alloc::string::String,
56 #[prost(string, tag = "2")]
58 pub status: ::prost::alloc::string::String,
59 #[prost(fixed32, tag = "3")]
61 pub chain_tip: u32,
62}
63#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
68pub struct BlockHeaderByNumberRequest {
69 #[prost(uint32, optional, tag = "1")]
71 pub block_num: ::core::option::Option<u32>,
72 #[prost(bool, optional, tag = "2")]
74 pub include_mmr_proof: ::core::option::Option<bool>,
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct BlockHeaderByNumberResponse {
79 #[prost(message, optional, tag = "1")]
81 pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
82 #[prost(message, optional, tag = "2")]
84 pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
85 #[prost(fixed32, optional, tag = "3")]
87 pub chain_length: ::core::option::Option<u32>,
88}
89#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
91pub struct MaybeNoteScript {
92 #[prost(message, optional, tag = "1")]
94 pub script: ::core::option::Option<super::note::NoteScript>,
95}
96#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct AccountRequest {
99 #[prost(message, optional, tag = "1")]
101 pub account_id: ::core::option::Option<super::account::AccountId>,
102 #[prost(message, optional, tag = "2")]
106 pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
107 #[prost(message, optional, tag = "3")]
109 pub details: ::core::option::Option<account_request::AccountDetailRequest>,
110}
111pub mod account_request {
113 #[derive(Clone, PartialEq, ::prost::Message)]
115 pub struct AccountDetailRequest {
116 #[prost(message, optional, tag = "1")]
121 pub code_commitment: ::core::option::Option<super::super::primitives::Digest>,
122 #[prost(message, optional, tag = "2")]
128 pub asset_vault_commitment: ::core::option::Option<
129 super::super::primitives::Digest,
130 >,
131 #[prost(message, repeated, tag = "3")]
133 pub storage_maps: ::prost::alloc::vec::Vec<
134 account_detail_request::StorageMapDetailRequest,
135 >,
136 }
137 pub mod account_detail_request {
139 #[derive(Clone, PartialEq, ::prost::Message)]
141 pub struct StorageMapDetailRequest {
142 #[prost(string, tag = "1")]
144 pub slot_name: ::prost::alloc::string::String,
145 #[prost(oneof = "storage_map_detail_request::SlotData", tags = "2, 3")]
146 pub slot_data: ::core::option::Option<storage_map_detail_request::SlotData>,
147 }
148 pub mod storage_map_detail_request {
150 #[derive(Clone, PartialEq, ::prost::Message)]
152 pub struct MapKeys {
153 #[prost(message, repeated, tag = "1")]
155 pub map_keys: ::prost::alloc::vec::Vec<
156 super::super::super::super::primitives::Digest,
157 >,
158 }
159 #[derive(Clone, PartialEq, ::prost::Oneof)]
160 pub enum SlotData {
161 #[prost(bool, tag = "2")]
164 AllEntries(bool),
165 #[prost(message, tag = "3")]
167 MapKeys(MapKeys),
168 }
169 }
170 }
171}
172#[derive(Clone, PartialEq, ::prost::Message)]
174pub struct AccountResponse {
175 #[prost(message, optional, tag = "1")]
177 pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
178 #[prost(message, optional, tag = "2")]
180 pub witness: ::core::option::Option<super::account::AccountWitness>,
181 #[prost(message, optional, tag = "3")]
183 pub details: ::core::option::Option<account_response::AccountDetails>,
184}
185pub mod account_response {
187 #[derive(Clone, PartialEq, ::prost::Message)]
188 pub struct AccountDetails {
189 #[prost(message, optional, tag = "1")]
191 pub header: ::core::option::Option<super::super::account::AccountHeader>,
192 #[prost(message, optional, tag = "2")]
194 pub storage_details: ::core::option::Option<super::AccountStorageDetails>,
195 #[prost(bytes = "vec", optional, tag = "3")]
197 pub code: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
198 #[prost(message, optional, tag = "4")]
201 pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
202 }
203}
204#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct AccountVaultDetails {
207 #[prost(bool, tag = "1")]
211 pub too_many_assets: bool,
212 #[prost(message, repeated, tag = "2")]
215 pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
216}
217#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct AccountStorageDetails {
220 #[prost(message, optional, tag = "1")]
222 pub header: ::core::option::Option<super::account::AccountStorageHeader>,
223 #[prost(message, repeated, tag = "2")]
225 pub map_details: ::prost::alloc::vec::Vec<
226 account_storage_details::AccountStorageMapDetails,
227 >,
228}
229pub mod account_storage_details {
231 #[derive(Clone, PartialEq, ::prost::Message)]
232 pub struct AccountStorageMapDetails {
233 #[prost(string, tag = "1")]
235 pub slot_name: ::prost::alloc::string::String,
236 #[prost(bool, tag = "2")]
239 pub too_many_entries: bool,
240 #[prost(oneof = "account_storage_map_details::Entries", tags = "3, 4")]
242 pub entries: ::core::option::Option<account_storage_map_details::Entries>,
243 }
244 pub mod account_storage_map_details {
246 #[derive(Clone, PartialEq, ::prost::Message)]
249 pub struct MapEntriesWithProofs {
250 #[prost(message, repeated, tag = "1")]
251 pub entries: ::prost::alloc::vec::Vec<
252 map_entries_with_proofs::StorageMapEntryWithProof,
253 >,
254 }
255 pub mod map_entries_with_proofs {
257 #[derive(Clone, PartialEq, ::prost::Message)]
259 pub struct StorageMapEntryWithProof {
260 #[prost(message, optional, tag = "1")]
261 pub key: ::core::option::Option<
262 super::super::super::super::primitives::Digest,
263 >,
264 #[prost(message, optional, tag = "2")]
265 pub value: ::core::option::Option<
266 super::super::super::super::primitives::Digest,
267 >,
268 #[prost(message, optional, tag = "3")]
269 pub proof: ::core::option::Option<
270 super::super::super::super::primitives::SmtOpening,
271 >,
272 }
273 }
274 #[derive(Clone, PartialEq, ::prost::Message)]
277 pub struct AllMapEntries {
278 #[prost(message, repeated, tag = "1")]
279 pub entries: ::prost::alloc::vec::Vec<all_map_entries::StorageMapEntry>,
280 }
281 pub mod all_map_entries {
283 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
285 pub struct StorageMapEntry {
286 #[prost(message, optional, tag = "1")]
287 pub key: ::core::option::Option<
288 super::super::super::super::primitives::Digest,
289 >,
290 #[prost(message, optional, tag = "2")]
291 pub value: ::core::option::Option<
292 super::super::super::super::primitives::Digest,
293 >,
294 }
295 }
296 #[derive(Clone, PartialEq, ::prost::Oneof)]
298 pub enum Entries {
299 #[prost(message, tag = "3")]
301 AllEntries(AllMapEntries),
302 #[prost(message, tag = "4")]
304 EntriesWithProofs(MapEntriesWithProofs),
305 }
306 }
307}
308#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct NullifierList {
311 #[prost(message, repeated, tag = "1")]
313 pub nullifiers: ::prost::alloc::vec::Vec<super::primitives::Digest>,
314}
315#[derive(Clone, PartialEq, ::prost::Message)]
317pub struct CheckNullifiersResponse {
318 #[prost(message, repeated, tag = "1")]
320 pub proofs: ::prost::alloc::vec::Vec<super::primitives::SmtOpening>,
321}
322#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
324pub struct SyncNullifiersRequest {
325 #[prost(message, optional, tag = "1")]
327 pub block_range: ::core::option::Option<BlockRange>,
328 #[prost(uint32, tag = "2")]
330 pub prefix_len: u32,
331 #[prost(uint32, repeated, tag = "3")]
334 pub nullifiers: ::prost::alloc::vec::Vec<u32>,
335}
336#[derive(Clone, PartialEq, ::prost::Message)]
338pub struct SyncNullifiersResponse {
339 #[prost(message, optional, tag = "1")]
341 pub pagination_info: ::core::option::Option<PaginationInfo>,
342 #[prost(message, repeated, tag = "2")]
344 pub nullifiers: ::prost::alloc::vec::Vec<sync_nullifiers_response::NullifierUpdate>,
345}
346pub mod sync_nullifiers_response {
348 #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
350 pub struct NullifierUpdate {
351 #[prost(message, optional, tag = "1")]
353 pub nullifier: ::core::option::Option<super::super::primitives::Digest>,
354 #[prost(fixed32, tag = "2")]
356 pub block_num: u32,
357 }
358}
359#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
363pub struct SyncAccountVaultRequest {
364 #[prost(message, optional, tag = "1")]
369 pub block_range: ::core::option::Option<BlockRange>,
370 #[prost(message, optional, tag = "2")]
372 pub account_id: ::core::option::Option<super::account::AccountId>,
373}
374#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct SyncAccountVaultResponse {
376 #[prost(message, optional, tag = "1")]
378 pub pagination_info: ::core::option::Option<PaginationInfo>,
379 #[prost(message, repeated, tag = "2")]
384 pub updates: ::prost::alloc::vec::Vec<AccountVaultUpdate>,
385}
386#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
387pub struct AccountVaultUpdate {
388 #[prost(message, optional, tag = "1")]
390 pub vault_key: ::core::option::Option<super::primitives::Digest>,
391 #[prost(message, optional, tag = "2")]
394 pub asset: ::core::option::Option<super::primitives::Asset>,
395 #[prost(fixed32, tag = "3")]
397 pub block_num: u32,
398}
399#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
404pub struct SyncNotesRequest {
405 #[prost(message, optional, tag = "1")]
407 pub block_range: ::core::option::Option<BlockRange>,
408 #[prost(fixed32, repeated, tag = "2")]
410 pub note_tags: ::prost::alloc::vec::Vec<u32>,
411}
412#[derive(Clone, PartialEq, ::prost::Message)]
414pub struct SyncNotesResponse {
415 #[prost(message, optional, tag = "1")]
417 pub pagination_info: ::core::option::Option<PaginationInfo>,
418 #[prost(message, optional, tag = "2")]
420 pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
421 #[prost(message, optional, tag = "3")]
426 pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
427 #[prost(message, repeated, tag = "4")]
429 pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
430}
431#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct SyncStateRequest {
438 #[prost(fixed32, tag = "1")]
442 pub block_num: u32,
443 #[prost(message, repeated, tag = "2")]
449 pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
450 #[prost(fixed32, repeated, tag = "3")]
452 pub note_tags: ::prost::alloc::vec::Vec<u32>,
453}
454#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct SyncStateResponse {
457 #[prost(fixed32, tag = "1")]
459 pub chain_tip: u32,
460 #[prost(message, optional, tag = "2")]
462 pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
463 #[prost(message, optional, tag = "3")]
465 pub mmr_delta: ::core::option::Option<super::primitives::MmrDelta>,
466 #[prost(message, repeated, tag = "5")]
468 pub accounts: ::prost::alloc::vec::Vec<super::account::AccountSummary>,
469 #[prost(message, repeated, tag = "6")]
472 pub transactions: ::prost::alloc::vec::Vec<super::transaction::TransactionSummary>,
473 #[prost(message, repeated, tag = "7")]
475 pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
476}
477#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
482pub struct SyncAccountStorageMapsRequest {
483 #[prost(message, optional, tag = "1")]
488 pub block_range: ::core::option::Option<BlockRange>,
489 #[prost(message, optional, tag = "3")]
491 pub account_id: ::core::option::Option<super::account::AccountId>,
492}
493#[derive(Clone, PartialEq, ::prost::Message)]
494pub struct SyncAccountStorageMapsResponse {
495 #[prost(message, optional, tag = "1")]
497 pub pagination_info: ::core::option::Option<PaginationInfo>,
498 #[prost(message, repeated, tag = "2")]
503 pub updates: ::prost::alloc::vec::Vec<StorageMapUpdate>,
504}
505#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
507pub struct StorageMapUpdate {
508 #[prost(fixed32, tag = "1")]
510 pub block_num: u32,
511 #[prost(string, tag = "2")]
513 pub slot_name: ::prost::alloc::string::String,
514 #[prost(message, optional, tag = "3")]
516 pub key: ::core::option::Option<super::primitives::Digest>,
517 #[prost(message, optional, tag = "4")]
519 pub value: ::core::option::Option<super::primitives::Digest>,
520}
521#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
523pub struct BlockRange {
524 #[prost(fixed32, tag = "1")]
526 pub block_from: u32,
527 #[prost(fixed32, optional, tag = "2")]
529 pub block_to: ::core::option::Option<u32>,
530}
531#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
540pub struct PaginationInfo {
541 #[prost(fixed32, tag = "1")]
543 pub chain_tip: u32,
544 #[prost(fixed32, tag = "2")]
550 pub block_num: u32,
551}
552#[derive(Clone, PartialEq, ::prost::Message)]
556pub struct SyncTransactionsRequest {
557 #[prost(message, optional, tag = "1")]
559 pub block_range: ::core::option::Option<BlockRange>,
560 #[prost(message, repeated, tag = "2")]
562 pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
563}
564#[derive(Clone, PartialEq, ::prost::Message)]
566pub struct SyncTransactionsResponse {
567 #[prost(message, optional, tag = "1")]
569 pub pagination_info: ::core::option::Option<PaginationInfo>,
570 #[prost(message, repeated, tag = "2")]
572 pub transactions: ::prost::alloc::vec::Vec<TransactionRecord>,
573}
574#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct TransactionRecord {
577 #[prost(fixed32, tag = "1")]
579 pub block_num: u32,
580 #[prost(message, optional, tag = "2")]
582 pub header: ::core::option::Option<super::transaction::TransactionHeader>,
583}
584#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct RpcLimits {
587 #[prost(map = "string, message", tag = "1")]
591 pub endpoints: ::std::collections::HashMap<
592 ::prost::alloc::string::String,
593 EndpointLimits,
594 >,
595}
596#[derive(Clone, PartialEq, ::prost::Message)]
598pub struct EndpointLimits {
599 #[prost(map = "string, uint32", tag = "1")]
603 pub parameters: ::std::collections::HashMap<::prost::alloc::string::String, u32>,
604}
605pub mod api_client {
607 #![allow(
608 unused_variables,
609 dead_code,
610 missing_docs,
611 clippy::wildcard_imports,
612 clippy::let_unit_value,
613 )]
614 use tonic::codegen::*;
615 use tonic::codegen::http::Uri;
616 #[derive(Debug, Clone)]
618 pub struct ApiClient<T> {
619 inner: tonic::client::Grpc<T>,
620 }
621 impl ApiClient<tonic::transport::Channel> {
622 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
624 where
625 D: TryInto<tonic::transport::Endpoint>,
626 D::Error: Into<StdError>,
627 {
628 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
629 Ok(Self::new(conn))
630 }
631 }
632 impl<T> ApiClient<T>
633 where
634 T: tonic::client::GrpcService<tonic::body::Body>,
635 T::Error: Into<StdError>,
636 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
637 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
638 {
639 pub fn new(inner: T) -> Self {
640 let inner = tonic::client::Grpc::new(inner);
641 Self { inner }
642 }
643 pub fn with_origin(inner: T, origin: Uri) -> Self {
644 let inner = tonic::client::Grpc::with_origin(inner, origin);
645 Self { inner }
646 }
647 pub fn with_interceptor<F>(
648 inner: T,
649 interceptor: F,
650 ) -> ApiClient<InterceptedService<T, F>>
651 where
652 F: tonic::service::Interceptor,
653 T::ResponseBody: Default,
654 T: tonic::codegen::Service<
655 http::Request<tonic::body::Body>,
656 Response = http::Response<
657 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
658 >,
659 >,
660 <T as tonic::codegen::Service<
661 http::Request<tonic::body::Body>,
662 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
663 {
664 ApiClient::new(InterceptedService::new(inner, interceptor))
665 }
666 #[must_use]
671 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
672 self.inner = self.inner.send_compressed(encoding);
673 self
674 }
675 #[must_use]
677 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
678 self.inner = self.inner.accept_compressed(encoding);
679 self
680 }
681 #[must_use]
685 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
686 self.inner = self.inner.max_decoding_message_size(limit);
687 self
688 }
689 #[must_use]
693 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
694 self.inner = self.inner.max_encoding_message_size(limit);
695 self
696 }
697 pub async fn status(
699 &mut self,
700 request: impl tonic::IntoRequest<()>,
701 ) -> std::result::Result<tonic::Response<super::RpcStatus>, tonic::Status> {
702 self.inner
703 .ready()
704 .await
705 .map_err(|e| {
706 tonic::Status::unknown(
707 format!("Service was not ready: {}", e.into()),
708 )
709 })?;
710 let codec = tonic_prost::ProstCodec::default();
711 let path = http::uri::PathAndQuery::from_static("/rpc.Api/Status");
712 let mut req = request.into_request();
713 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "Status"));
714 self.inner.unary(req, path, codec).await
715 }
716 pub async fn check_nullifiers(
730 &mut self,
731 request: impl tonic::IntoRequest<super::NullifierList>,
732 ) -> std::result::Result<
733 tonic::Response<super::CheckNullifiersResponse>,
734 tonic::Status,
735 > {
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_prost::ProstCodec::default();
745 let path = http::uri::PathAndQuery::from_static("/rpc.Api/CheckNullifiers");
746 let mut req = request.into_request();
747 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "CheckNullifiers"));
748 self.inner.unary(req, path, codec).await
749 }
750 pub async fn get_account(
752 &mut self,
753 request: impl tonic::IntoRequest<super::AccountRequest>,
754 ) -> std::result::Result<
755 tonic::Response<super::AccountResponse>,
756 tonic::Status,
757 > {
758 self.inner
759 .ready()
760 .await
761 .map_err(|e| {
762 tonic::Status::unknown(
763 format!("Service was not ready: {}", e.into()),
764 )
765 })?;
766 let codec = tonic_prost::ProstCodec::default();
767 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetAccount");
768 let mut req = request.into_request();
769 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetAccount"));
770 self.inner.unary(req, path, codec).await
771 }
772 pub async fn get_block_by_number(
774 &mut self,
775 request: impl tonic::IntoRequest<super::super::blockchain::BlockNumber>,
776 ) -> std::result::Result<
777 tonic::Response<super::super::blockchain::MaybeBlock>,
778 tonic::Status,
779 > {
780 self.inner
781 .ready()
782 .await
783 .map_err(|e| {
784 tonic::Status::unknown(
785 format!("Service was not ready: {}", e.into()),
786 )
787 })?;
788 let codec = tonic_prost::ProstCodec::default();
789 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetBlockByNumber");
790 let mut req = request.into_request();
791 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetBlockByNumber"));
792 self.inner.unary(req, path, codec).await
793 }
794 pub async fn get_block_header_by_number(
797 &mut self,
798 request: impl tonic::IntoRequest<super::BlockHeaderByNumberRequest>,
799 ) -> std::result::Result<
800 tonic::Response<super::BlockHeaderByNumberResponse>,
801 tonic::Status,
802 > {
803 self.inner
804 .ready()
805 .await
806 .map_err(|e| {
807 tonic::Status::unknown(
808 format!("Service was not ready: {}", e.into()),
809 )
810 })?;
811 let codec = tonic_prost::ProstCodec::default();
812 let path = http::uri::PathAndQuery::from_static(
813 "/rpc.Api/GetBlockHeaderByNumber",
814 );
815 let mut req = request.into_request();
816 req.extensions_mut()
817 .insert(GrpcMethod::new("rpc.Api", "GetBlockHeaderByNumber"));
818 self.inner.unary(req, path, codec).await
819 }
820 pub async fn get_notes_by_id(
822 &mut self,
823 request: impl tonic::IntoRequest<super::super::note::NoteIdList>,
824 ) -> std::result::Result<
825 tonic::Response<super::super::note::CommittedNoteList>,
826 tonic::Status,
827 > {
828 self.inner
829 .ready()
830 .await
831 .map_err(|e| {
832 tonic::Status::unknown(
833 format!("Service was not ready: {}", e.into()),
834 )
835 })?;
836 let codec = tonic_prost::ProstCodec::default();
837 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetNotesById");
838 let mut req = request.into_request();
839 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetNotesById"));
840 self.inner.unary(req, path, codec).await
841 }
842 pub async fn get_note_script_by_root(
844 &mut self,
845 request: impl tonic::IntoRequest<super::super::note::NoteRoot>,
846 ) -> std::result::Result<
847 tonic::Response<super::MaybeNoteScript>,
848 tonic::Status,
849 > {
850 self.inner
851 .ready()
852 .await
853 .map_err(|e| {
854 tonic::Status::unknown(
855 format!("Service was not ready: {}", e.into()),
856 )
857 })?;
858 let codec = tonic_prost::ProstCodec::default();
859 let path = http::uri::PathAndQuery::from_static(
860 "/rpc.Api/GetNoteScriptByRoot",
861 );
862 let mut req = request.into_request();
863 req.extensions_mut()
864 .insert(GrpcMethod::new("rpc.Api", "GetNoteScriptByRoot"));
865 self.inner.unary(req, path, codec).await
866 }
867 pub async fn submit_proven_transaction(
869 &mut self,
870 request: impl tonic::IntoRequest<
871 super::super::transaction::ProvenTransaction,
872 >,
873 ) -> std::result::Result<
874 tonic::Response<super::super::blockchain::BlockNumber>,
875 tonic::Status,
876 > {
877 self.inner
878 .ready()
879 .await
880 .map_err(|e| {
881 tonic::Status::unknown(
882 format!("Service was not ready: {}", e.into()),
883 )
884 })?;
885 let codec = tonic_prost::ProstCodec::default();
886 let path = http::uri::PathAndQuery::from_static(
887 "/rpc.Api/SubmitProvenTransaction",
888 );
889 let mut req = request.into_request();
890 req.extensions_mut()
891 .insert(GrpcMethod::new("rpc.Api", "SubmitProvenTransaction"));
892 self.inner.unary(req, path, codec).await
893 }
894 pub async fn submit_proven_batch(
907 &mut self,
908 request: impl tonic::IntoRequest<
909 super::super::transaction::ProvenTransactionBatch,
910 >,
911 ) -> std::result::Result<
912 tonic::Response<super::super::blockchain::BlockNumber>,
913 tonic::Status,
914 > {
915 self.inner
916 .ready()
917 .await
918 .map_err(|e| {
919 tonic::Status::unknown(
920 format!("Service was not ready: {}", e.into()),
921 )
922 })?;
923 let codec = tonic_prost::ProstCodec::default();
924 let path = http::uri::PathAndQuery::from_static(
925 "/rpc.Api/SubmitProvenBatch",
926 );
927 let mut req = request.into_request();
928 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SubmitProvenBatch"));
929 self.inner.unary(req, path, codec).await
930 }
931 pub async fn sync_nullifiers(
935 &mut self,
936 request: impl tonic::IntoRequest<super::SyncNullifiersRequest>,
937 ) -> std::result::Result<
938 tonic::Response<super::SyncNullifiersResponse>,
939 tonic::Status,
940 > {
941 self.inner
942 .ready()
943 .await
944 .map_err(|e| {
945 tonic::Status::unknown(
946 format!("Service was not ready: {}", e.into()),
947 )
948 })?;
949 let codec = tonic_prost::ProstCodec::default();
950 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncNullifiers");
951 let mut req = request.into_request();
952 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncNullifiers"));
953 self.inner.unary(req, path, codec).await
954 }
955 pub async fn sync_account_vault(
957 &mut self,
958 request: impl tonic::IntoRequest<super::SyncAccountVaultRequest>,
959 ) -> std::result::Result<
960 tonic::Response<super::SyncAccountVaultResponse>,
961 tonic::Status,
962 > {
963 self.inner
964 .ready()
965 .await
966 .map_err(|e| {
967 tonic::Status::unknown(
968 format!("Service was not ready: {}", e.into()),
969 )
970 })?;
971 let codec = tonic_prost::ProstCodec::default();
972 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncAccountVault");
973 let mut req = request.into_request();
974 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncAccountVault"));
975 self.inner.unary(req, path, codec).await
976 }
977 pub async fn sync_notes(
987 &mut self,
988 request: impl tonic::IntoRequest<super::SyncNotesRequest>,
989 ) -> std::result::Result<
990 tonic::Response<super::SyncNotesResponse>,
991 tonic::Status,
992 > {
993 self.inner
994 .ready()
995 .await
996 .map_err(|e| {
997 tonic::Status::unknown(
998 format!("Service was not ready: {}", e.into()),
999 )
1000 })?;
1001 let codec = tonic_prost::ProstCodec::default();
1002 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncNotes");
1003 let mut req = request.into_request();
1004 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncNotes"));
1005 self.inner.unary(req, path, codec).await
1006 }
1007 pub async fn sync_state(
1023 &mut self,
1024 request: impl tonic::IntoRequest<super::SyncStateRequest>,
1025 ) -> std::result::Result<
1026 tonic::Response<super::SyncStateResponse>,
1027 tonic::Status,
1028 > {
1029 self.inner
1030 .ready()
1031 .await
1032 .map_err(|e| {
1033 tonic::Status::unknown(
1034 format!("Service was not ready: {}", e.into()),
1035 )
1036 })?;
1037 let codec = tonic_prost::ProstCodec::default();
1038 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncState");
1039 let mut req = request.into_request();
1040 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncState"));
1041 self.inner.unary(req, path, codec).await
1042 }
1043 pub async fn sync_account_storage_maps(
1045 &mut self,
1046 request: impl tonic::IntoRequest<super::SyncAccountStorageMapsRequest>,
1047 ) -> std::result::Result<
1048 tonic::Response<super::SyncAccountStorageMapsResponse>,
1049 tonic::Status,
1050 > {
1051 self.inner
1052 .ready()
1053 .await
1054 .map_err(|e| {
1055 tonic::Status::unknown(
1056 format!("Service was not ready: {}", e.into()),
1057 )
1058 })?;
1059 let codec = tonic_prost::ProstCodec::default();
1060 let path = http::uri::PathAndQuery::from_static(
1061 "/rpc.Api/SyncAccountStorageMaps",
1062 );
1063 let mut req = request.into_request();
1064 req.extensions_mut()
1065 .insert(GrpcMethod::new("rpc.Api", "SyncAccountStorageMaps"));
1066 self.inner.unary(req, path, codec).await
1067 }
1068 pub async fn sync_transactions(
1070 &mut self,
1071 request: impl tonic::IntoRequest<super::SyncTransactionsRequest>,
1072 ) -> std::result::Result<
1073 tonic::Response<super::SyncTransactionsResponse>,
1074 tonic::Status,
1075 > {
1076 self.inner
1077 .ready()
1078 .await
1079 .map_err(|e| {
1080 tonic::Status::unknown(
1081 format!("Service was not ready: {}", e.into()),
1082 )
1083 })?;
1084 let codec = tonic_prost::ProstCodec::default();
1085 let path = http::uri::PathAndQuery::from_static("/rpc.Api/SyncTransactions");
1086 let mut req = request.into_request();
1087 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "SyncTransactions"));
1088 self.inner.unary(req, path, codec).await
1089 }
1090 pub async fn get_limits(
1096 &mut self,
1097 request: impl tonic::IntoRequest<()>,
1098 ) -> std::result::Result<tonic::Response<super::RpcLimits>, tonic::Status> {
1099 self.inner
1100 .ready()
1101 .await
1102 .map_err(|e| {
1103 tonic::Status::unknown(
1104 format!("Service was not ready: {}", e.into()),
1105 )
1106 })?;
1107 let codec = tonic_prost::ProstCodec::default();
1108 let path = http::uri::PathAndQuery::from_static("/rpc.Api/GetLimits");
1109 let mut req = request.into_request();
1110 req.extensions_mut().insert(GrpcMethod::new("rpc.Api", "GetLimits"));
1111 self.inner.unary(req, path, codec).await
1112 }
1113 }
1114}
1115pub mod api_server {
1117 #![allow(
1118 unused_variables,
1119 dead_code,
1120 missing_docs,
1121 clippy::wildcard_imports,
1122 clippy::let_unit_value,
1123 )]
1124 use tonic::codegen::*;
1125 #[async_trait]
1127 pub trait Api: std::marker::Send + std::marker::Sync + 'static {
1128 async fn status(
1130 &self,
1131 request: tonic::Request<()>,
1132 ) -> std::result::Result<tonic::Response<super::RpcStatus>, tonic::Status>;
1133 async fn check_nullifiers(
1147 &self,
1148 request: tonic::Request<super::NullifierList>,
1149 ) -> std::result::Result<
1150 tonic::Response<super::CheckNullifiersResponse>,
1151 tonic::Status,
1152 >;
1153 async fn get_account(
1155 &self,
1156 request: tonic::Request<super::AccountRequest>,
1157 ) -> std::result::Result<tonic::Response<super::AccountResponse>, tonic::Status>;
1158 async fn get_block_by_number(
1160 &self,
1161 request: tonic::Request<super::super::blockchain::BlockNumber>,
1162 ) -> std::result::Result<
1163 tonic::Response<super::super::blockchain::MaybeBlock>,
1164 tonic::Status,
1165 >;
1166 async fn get_block_header_by_number(
1169 &self,
1170 request: tonic::Request<super::BlockHeaderByNumberRequest>,
1171 ) -> std::result::Result<
1172 tonic::Response<super::BlockHeaderByNumberResponse>,
1173 tonic::Status,
1174 >;
1175 async fn get_notes_by_id(
1177 &self,
1178 request: tonic::Request<super::super::note::NoteIdList>,
1179 ) -> std::result::Result<
1180 tonic::Response<super::super::note::CommittedNoteList>,
1181 tonic::Status,
1182 >;
1183 async fn get_note_script_by_root(
1185 &self,
1186 request: tonic::Request<super::super::note::NoteRoot>,
1187 ) -> std::result::Result<tonic::Response<super::MaybeNoteScript>, tonic::Status>;
1188 async fn submit_proven_transaction(
1190 &self,
1191 request: tonic::Request<super::super::transaction::ProvenTransaction>,
1192 ) -> std::result::Result<
1193 tonic::Response<super::super::blockchain::BlockNumber>,
1194 tonic::Status,
1195 >;
1196 async fn submit_proven_batch(
1209 &self,
1210 request: tonic::Request<super::super::transaction::ProvenTransactionBatch>,
1211 ) -> std::result::Result<
1212 tonic::Response<super::super::blockchain::BlockNumber>,
1213 tonic::Status,
1214 >;
1215 async fn sync_nullifiers(
1219 &self,
1220 request: tonic::Request<super::SyncNullifiersRequest>,
1221 ) -> std::result::Result<
1222 tonic::Response<super::SyncNullifiersResponse>,
1223 tonic::Status,
1224 >;
1225 async fn sync_account_vault(
1227 &self,
1228 request: tonic::Request<super::SyncAccountVaultRequest>,
1229 ) -> std::result::Result<
1230 tonic::Response<super::SyncAccountVaultResponse>,
1231 tonic::Status,
1232 >;
1233 async fn sync_notes(
1243 &self,
1244 request: tonic::Request<super::SyncNotesRequest>,
1245 ) -> std::result::Result<
1246 tonic::Response<super::SyncNotesResponse>,
1247 tonic::Status,
1248 >;
1249 async fn sync_state(
1265 &self,
1266 request: tonic::Request<super::SyncStateRequest>,
1267 ) -> std::result::Result<
1268 tonic::Response<super::SyncStateResponse>,
1269 tonic::Status,
1270 >;
1271 async fn sync_account_storage_maps(
1273 &self,
1274 request: tonic::Request<super::SyncAccountStorageMapsRequest>,
1275 ) -> std::result::Result<
1276 tonic::Response<super::SyncAccountStorageMapsResponse>,
1277 tonic::Status,
1278 >;
1279 async fn sync_transactions(
1281 &self,
1282 request: tonic::Request<super::SyncTransactionsRequest>,
1283 ) -> std::result::Result<
1284 tonic::Response<super::SyncTransactionsResponse>,
1285 tonic::Status,
1286 >;
1287 async fn get_limits(
1293 &self,
1294 request: tonic::Request<()>,
1295 ) -> std::result::Result<tonic::Response<super::RpcLimits>, tonic::Status>;
1296 }
1297 #[derive(Debug)]
1299 pub struct ApiServer<T> {
1300 inner: Arc<T>,
1301 accept_compression_encodings: EnabledCompressionEncodings,
1302 send_compression_encodings: EnabledCompressionEncodings,
1303 max_decoding_message_size: Option<usize>,
1304 max_encoding_message_size: Option<usize>,
1305 }
1306 impl<T> ApiServer<T> {
1307 pub fn new(inner: T) -> Self {
1308 Self::from_arc(Arc::new(inner))
1309 }
1310 pub fn from_arc(inner: Arc<T>) -> Self {
1311 Self {
1312 inner,
1313 accept_compression_encodings: Default::default(),
1314 send_compression_encodings: Default::default(),
1315 max_decoding_message_size: None,
1316 max_encoding_message_size: None,
1317 }
1318 }
1319 pub fn with_interceptor<F>(
1320 inner: T,
1321 interceptor: F,
1322 ) -> InterceptedService<Self, F>
1323 where
1324 F: tonic::service::Interceptor,
1325 {
1326 InterceptedService::new(Self::new(inner), interceptor)
1327 }
1328 #[must_use]
1330 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1331 self.accept_compression_encodings.enable(encoding);
1332 self
1333 }
1334 #[must_use]
1336 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1337 self.send_compression_encodings.enable(encoding);
1338 self
1339 }
1340 #[must_use]
1344 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1345 self.max_decoding_message_size = Some(limit);
1346 self
1347 }
1348 #[must_use]
1352 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1353 self.max_encoding_message_size = Some(limit);
1354 self
1355 }
1356 }
1357 impl<T, B> tonic::codegen::Service<http::Request<B>> for ApiServer<T>
1358 where
1359 T: Api,
1360 B: Body + std::marker::Send + 'static,
1361 B::Error: Into<StdError> + std::marker::Send + 'static,
1362 {
1363 type Response = http::Response<tonic::body::Body>;
1364 type Error = std::convert::Infallible;
1365 type Future = BoxFuture<Self::Response, Self::Error>;
1366 fn poll_ready(
1367 &mut self,
1368 _cx: &mut Context<'_>,
1369 ) -> Poll<std::result::Result<(), Self::Error>> {
1370 Poll::Ready(Ok(()))
1371 }
1372 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1373 match req.uri().path() {
1374 "/rpc.Api/Status" => {
1375 #[allow(non_camel_case_types)]
1376 struct StatusSvc<T: Api>(pub Arc<T>);
1377 impl<T: Api> tonic::server::UnaryService<()> for StatusSvc<T> {
1378 type Response = super::RpcStatus;
1379 type Future = BoxFuture<
1380 tonic::Response<Self::Response>,
1381 tonic::Status,
1382 >;
1383 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
1384 let inner = Arc::clone(&self.0);
1385 let fut = async move {
1386 <T as Api>::status(&inner, request).await
1387 };
1388 Box::pin(fut)
1389 }
1390 }
1391 let accept_compression_encodings = self.accept_compression_encodings;
1392 let send_compression_encodings = self.send_compression_encodings;
1393 let max_decoding_message_size = self.max_decoding_message_size;
1394 let max_encoding_message_size = self.max_encoding_message_size;
1395 let inner = self.inner.clone();
1396 let fut = async move {
1397 let method = StatusSvc(inner);
1398 let codec = tonic_prost::ProstCodec::default();
1399 let mut grpc = tonic::server::Grpc::new(codec)
1400 .apply_compression_config(
1401 accept_compression_encodings,
1402 send_compression_encodings,
1403 )
1404 .apply_max_message_size_config(
1405 max_decoding_message_size,
1406 max_encoding_message_size,
1407 );
1408 let res = grpc.unary(method, req).await;
1409 Ok(res)
1410 };
1411 Box::pin(fut)
1412 }
1413 "/rpc.Api/CheckNullifiers" => {
1414 #[allow(non_camel_case_types)]
1415 struct CheckNullifiersSvc<T: Api>(pub Arc<T>);
1416 impl<T: Api> tonic::server::UnaryService<super::NullifierList>
1417 for CheckNullifiersSvc<T> {
1418 type Response = super::CheckNullifiersResponse;
1419 type Future = BoxFuture<
1420 tonic::Response<Self::Response>,
1421 tonic::Status,
1422 >;
1423 fn call(
1424 &mut self,
1425 request: tonic::Request<super::NullifierList>,
1426 ) -> Self::Future {
1427 let inner = Arc::clone(&self.0);
1428 let fut = async move {
1429 <T as Api>::check_nullifiers(&inner, request).await
1430 };
1431 Box::pin(fut)
1432 }
1433 }
1434 let accept_compression_encodings = self.accept_compression_encodings;
1435 let send_compression_encodings = self.send_compression_encodings;
1436 let max_decoding_message_size = self.max_decoding_message_size;
1437 let max_encoding_message_size = self.max_encoding_message_size;
1438 let inner = self.inner.clone();
1439 let fut = async move {
1440 let method = CheckNullifiersSvc(inner);
1441 let codec = tonic_prost::ProstCodec::default();
1442 let mut grpc = tonic::server::Grpc::new(codec)
1443 .apply_compression_config(
1444 accept_compression_encodings,
1445 send_compression_encodings,
1446 )
1447 .apply_max_message_size_config(
1448 max_decoding_message_size,
1449 max_encoding_message_size,
1450 );
1451 let res = grpc.unary(method, req).await;
1452 Ok(res)
1453 };
1454 Box::pin(fut)
1455 }
1456 "/rpc.Api/GetAccount" => {
1457 #[allow(non_camel_case_types)]
1458 struct GetAccountSvc<T: Api>(pub Arc<T>);
1459 impl<T: Api> tonic::server::UnaryService<super::AccountRequest>
1460 for GetAccountSvc<T> {
1461 type Response = super::AccountResponse;
1462 type Future = BoxFuture<
1463 tonic::Response<Self::Response>,
1464 tonic::Status,
1465 >;
1466 fn call(
1467 &mut self,
1468 request: tonic::Request<super::AccountRequest>,
1469 ) -> Self::Future {
1470 let inner = Arc::clone(&self.0);
1471 let fut = async move {
1472 <T as Api>::get_account(&inner, request).await
1473 };
1474 Box::pin(fut)
1475 }
1476 }
1477 let accept_compression_encodings = self.accept_compression_encodings;
1478 let send_compression_encodings = self.send_compression_encodings;
1479 let max_decoding_message_size = self.max_decoding_message_size;
1480 let max_encoding_message_size = self.max_encoding_message_size;
1481 let inner = self.inner.clone();
1482 let fut = async move {
1483 let method = GetAccountSvc(inner);
1484 let codec = tonic_prost::ProstCodec::default();
1485 let mut grpc = tonic::server::Grpc::new(codec)
1486 .apply_compression_config(
1487 accept_compression_encodings,
1488 send_compression_encodings,
1489 )
1490 .apply_max_message_size_config(
1491 max_decoding_message_size,
1492 max_encoding_message_size,
1493 );
1494 let res = grpc.unary(method, req).await;
1495 Ok(res)
1496 };
1497 Box::pin(fut)
1498 }
1499 "/rpc.Api/GetBlockByNumber" => {
1500 #[allow(non_camel_case_types)]
1501 struct GetBlockByNumberSvc<T: Api>(pub Arc<T>);
1502 impl<
1503 T: Api,
1504 > tonic::server::UnaryService<super::super::blockchain::BlockNumber>
1505 for GetBlockByNumberSvc<T> {
1506 type Response = super::super::blockchain::MaybeBlock;
1507 type Future = BoxFuture<
1508 tonic::Response<Self::Response>,
1509 tonic::Status,
1510 >;
1511 fn call(
1512 &mut self,
1513 request: tonic::Request<
1514 super::super::blockchain::BlockNumber,
1515 >,
1516 ) -> Self::Future {
1517 let inner = Arc::clone(&self.0);
1518 let fut = async move {
1519 <T as Api>::get_block_by_number(&inner, request).await
1520 };
1521 Box::pin(fut)
1522 }
1523 }
1524 let accept_compression_encodings = self.accept_compression_encodings;
1525 let send_compression_encodings = self.send_compression_encodings;
1526 let max_decoding_message_size = self.max_decoding_message_size;
1527 let max_encoding_message_size = self.max_encoding_message_size;
1528 let inner = self.inner.clone();
1529 let fut = async move {
1530 let method = GetBlockByNumberSvc(inner);
1531 let codec = tonic_prost::ProstCodec::default();
1532 let mut grpc = tonic::server::Grpc::new(codec)
1533 .apply_compression_config(
1534 accept_compression_encodings,
1535 send_compression_encodings,
1536 )
1537 .apply_max_message_size_config(
1538 max_decoding_message_size,
1539 max_encoding_message_size,
1540 );
1541 let res = grpc.unary(method, req).await;
1542 Ok(res)
1543 };
1544 Box::pin(fut)
1545 }
1546 "/rpc.Api/GetBlockHeaderByNumber" => {
1547 #[allow(non_camel_case_types)]
1548 struct GetBlockHeaderByNumberSvc<T: Api>(pub Arc<T>);
1549 impl<
1550 T: Api,
1551 > tonic::server::UnaryService<super::BlockHeaderByNumberRequest>
1552 for GetBlockHeaderByNumberSvc<T> {
1553 type Response = super::BlockHeaderByNumberResponse;
1554 type Future = BoxFuture<
1555 tonic::Response<Self::Response>,
1556 tonic::Status,
1557 >;
1558 fn call(
1559 &mut self,
1560 request: tonic::Request<super::BlockHeaderByNumberRequest>,
1561 ) -> Self::Future {
1562 let inner = Arc::clone(&self.0);
1563 let fut = async move {
1564 <T as Api>::get_block_header_by_number(&inner, request)
1565 .await
1566 };
1567 Box::pin(fut)
1568 }
1569 }
1570 let accept_compression_encodings = self.accept_compression_encodings;
1571 let send_compression_encodings = self.send_compression_encodings;
1572 let max_decoding_message_size = self.max_decoding_message_size;
1573 let max_encoding_message_size = self.max_encoding_message_size;
1574 let inner = self.inner.clone();
1575 let fut = async move {
1576 let method = GetBlockHeaderByNumberSvc(inner);
1577 let codec = tonic_prost::ProstCodec::default();
1578 let mut grpc = tonic::server::Grpc::new(codec)
1579 .apply_compression_config(
1580 accept_compression_encodings,
1581 send_compression_encodings,
1582 )
1583 .apply_max_message_size_config(
1584 max_decoding_message_size,
1585 max_encoding_message_size,
1586 );
1587 let res = grpc.unary(method, req).await;
1588 Ok(res)
1589 };
1590 Box::pin(fut)
1591 }
1592 "/rpc.Api/GetNotesById" => {
1593 #[allow(non_camel_case_types)]
1594 struct GetNotesByIdSvc<T: Api>(pub Arc<T>);
1595 impl<
1596 T: Api,
1597 > tonic::server::UnaryService<super::super::note::NoteIdList>
1598 for GetNotesByIdSvc<T> {
1599 type Response = super::super::note::CommittedNoteList;
1600 type Future = BoxFuture<
1601 tonic::Response<Self::Response>,
1602 tonic::Status,
1603 >;
1604 fn call(
1605 &mut self,
1606 request: tonic::Request<super::super::note::NoteIdList>,
1607 ) -> Self::Future {
1608 let inner = Arc::clone(&self.0);
1609 let fut = async move {
1610 <T as Api>::get_notes_by_id(&inner, request).await
1611 };
1612 Box::pin(fut)
1613 }
1614 }
1615 let accept_compression_encodings = self.accept_compression_encodings;
1616 let send_compression_encodings = self.send_compression_encodings;
1617 let max_decoding_message_size = self.max_decoding_message_size;
1618 let max_encoding_message_size = self.max_encoding_message_size;
1619 let inner = self.inner.clone();
1620 let fut = async move {
1621 let method = GetNotesByIdSvc(inner);
1622 let codec = tonic_prost::ProstCodec::default();
1623 let mut grpc = tonic::server::Grpc::new(codec)
1624 .apply_compression_config(
1625 accept_compression_encodings,
1626 send_compression_encodings,
1627 )
1628 .apply_max_message_size_config(
1629 max_decoding_message_size,
1630 max_encoding_message_size,
1631 );
1632 let res = grpc.unary(method, req).await;
1633 Ok(res)
1634 };
1635 Box::pin(fut)
1636 }
1637 "/rpc.Api/GetNoteScriptByRoot" => {
1638 #[allow(non_camel_case_types)]
1639 struct GetNoteScriptByRootSvc<T: Api>(pub Arc<T>);
1640 impl<
1641 T: Api,
1642 > tonic::server::UnaryService<super::super::note::NoteRoot>
1643 for GetNoteScriptByRootSvc<T> {
1644 type Response = super::MaybeNoteScript;
1645 type Future = BoxFuture<
1646 tonic::Response<Self::Response>,
1647 tonic::Status,
1648 >;
1649 fn call(
1650 &mut self,
1651 request: tonic::Request<super::super::note::NoteRoot>,
1652 ) -> Self::Future {
1653 let inner = Arc::clone(&self.0);
1654 let fut = async move {
1655 <T as Api>::get_note_script_by_root(&inner, request).await
1656 };
1657 Box::pin(fut)
1658 }
1659 }
1660 let accept_compression_encodings = self.accept_compression_encodings;
1661 let send_compression_encodings = self.send_compression_encodings;
1662 let max_decoding_message_size = self.max_decoding_message_size;
1663 let max_encoding_message_size = self.max_encoding_message_size;
1664 let inner = self.inner.clone();
1665 let fut = async move {
1666 let method = GetNoteScriptByRootSvc(inner);
1667 let codec = tonic_prost::ProstCodec::default();
1668 let mut grpc = tonic::server::Grpc::new(codec)
1669 .apply_compression_config(
1670 accept_compression_encodings,
1671 send_compression_encodings,
1672 )
1673 .apply_max_message_size_config(
1674 max_decoding_message_size,
1675 max_encoding_message_size,
1676 );
1677 let res = grpc.unary(method, req).await;
1678 Ok(res)
1679 };
1680 Box::pin(fut)
1681 }
1682 "/rpc.Api/SubmitProvenTransaction" => {
1683 #[allow(non_camel_case_types)]
1684 struct SubmitProvenTransactionSvc<T: Api>(pub Arc<T>);
1685 impl<
1686 T: Api,
1687 > tonic::server::UnaryService<
1688 super::super::transaction::ProvenTransaction,
1689 > for SubmitProvenTransactionSvc<T> {
1690 type Response = super::super::blockchain::BlockNumber;
1691 type Future = BoxFuture<
1692 tonic::Response<Self::Response>,
1693 tonic::Status,
1694 >;
1695 fn call(
1696 &mut self,
1697 request: tonic::Request<
1698 super::super::transaction::ProvenTransaction,
1699 >,
1700 ) -> Self::Future {
1701 let inner = Arc::clone(&self.0);
1702 let fut = async move {
1703 <T as Api>::submit_proven_transaction(&inner, request).await
1704 };
1705 Box::pin(fut)
1706 }
1707 }
1708 let accept_compression_encodings = self.accept_compression_encodings;
1709 let send_compression_encodings = self.send_compression_encodings;
1710 let max_decoding_message_size = self.max_decoding_message_size;
1711 let max_encoding_message_size = self.max_encoding_message_size;
1712 let inner = self.inner.clone();
1713 let fut = async move {
1714 let method = SubmitProvenTransactionSvc(inner);
1715 let codec = tonic_prost::ProstCodec::default();
1716 let mut grpc = tonic::server::Grpc::new(codec)
1717 .apply_compression_config(
1718 accept_compression_encodings,
1719 send_compression_encodings,
1720 )
1721 .apply_max_message_size_config(
1722 max_decoding_message_size,
1723 max_encoding_message_size,
1724 );
1725 let res = grpc.unary(method, req).await;
1726 Ok(res)
1727 };
1728 Box::pin(fut)
1729 }
1730 "/rpc.Api/SubmitProvenBatch" => {
1731 #[allow(non_camel_case_types)]
1732 struct SubmitProvenBatchSvc<T: Api>(pub Arc<T>);
1733 impl<
1734 T: Api,
1735 > tonic::server::UnaryService<
1736 super::super::transaction::ProvenTransactionBatch,
1737 > for SubmitProvenBatchSvc<T> {
1738 type Response = super::super::blockchain::BlockNumber;
1739 type Future = BoxFuture<
1740 tonic::Response<Self::Response>,
1741 tonic::Status,
1742 >;
1743 fn call(
1744 &mut self,
1745 request: tonic::Request<
1746 super::super::transaction::ProvenTransactionBatch,
1747 >,
1748 ) -> Self::Future {
1749 let inner = Arc::clone(&self.0);
1750 let fut = async move {
1751 <T as Api>::submit_proven_batch(&inner, request).await
1752 };
1753 Box::pin(fut)
1754 }
1755 }
1756 let accept_compression_encodings = self.accept_compression_encodings;
1757 let send_compression_encodings = self.send_compression_encodings;
1758 let max_decoding_message_size = self.max_decoding_message_size;
1759 let max_encoding_message_size = self.max_encoding_message_size;
1760 let inner = self.inner.clone();
1761 let fut = async move {
1762 let method = SubmitProvenBatchSvc(inner);
1763 let codec = tonic_prost::ProstCodec::default();
1764 let mut grpc = tonic::server::Grpc::new(codec)
1765 .apply_compression_config(
1766 accept_compression_encodings,
1767 send_compression_encodings,
1768 )
1769 .apply_max_message_size_config(
1770 max_decoding_message_size,
1771 max_encoding_message_size,
1772 );
1773 let res = grpc.unary(method, req).await;
1774 Ok(res)
1775 };
1776 Box::pin(fut)
1777 }
1778 "/rpc.Api/SyncNullifiers" => {
1779 #[allow(non_camel_case_types)]
1780 struct SyncNullifiersSvc<T: Api>(pub Arc<T>);
1781 impl<
1782 T: Api,
1783 > tonic::server::UnaryService<super::SyncNullifiersRequest>
1784 for SyncNullifiersSvc<T> {
1785 type Response = super::SyncNullifiersResponse;
1786 type Future = BoxFuture<
1787 tonic::Response<Self::Response>,
1788 tonic::Status,
1789 >;
1790 fn call(
1791 &mut self,
1792 request: tonic::Request<super::SyncNullifiersRequest>,
1793 ) -> Self::Future {
1794 let inner = Arc::clone(&self.0);
1795 let fut = async move {
1796 <T as Api>::sync_nullifiers(&inner, request).await
1797 };
1798 Box::pin(fut)
1799 }
1800 }
1801 let accept_compression_encodings = self.accept_compression_encodings;
1802 let send_compression_encodings = self.send_compression_encodings;
1803 let max_decoding_message_size = self.max_decoding_message_size;
1804 let max_encoding_message_size = self.max_encoding_message_size;
1805 let inner = self.inner.clone();
1806 let fut = async move {
1807 let method = SyncNullifiersSvc(inner);
1808 let codec = tonic_prost::ProstCodec::default();
1809 let mut grpc = tonic::server::Grpc::new(codec)
1810 .apply_compression_config(
1811 accept_compression_encodings,
1812 send_compression_encodings,
1813 )
1814 .apply_max_message_size_config(
1815 max_decoding_message_size,
1816 max_encoding_message_size,
1817 );
1818 let res = grpc.unary(method, req).await;
1819 Ok(res)
1820 };
1821 Box::pin(fut)
1822 }
1823 "/rpc.Api/SyncAccountVault" => {
1824 #[allow(non_camel_case_types)]
1825 struct SyncAccountVaultSvc<T: Api>(pub Arc<T>);
1826 impl<
1827 T: Api,
1828 > tonic::server::UnaryService<super::SyncAccountVaultRequest>
1829 for SyncAccountVaultSvc<T> {
1830 type Response = super::SyncAccountVaultResponse;
1831 type Future = BoxFuture<
1832 tonic::Response<Self::Response>,
1833 tonic::Status,
1834 >;
1835 fn call(
1836 &mut self,
1837 request: tonic::Request<super::SyncAccountVaultRequest>,
1838 ) -> Self::Future {
1839 let inner = Arc::clone(&self.0);
1840 let fut = async move {
1841 <T as Api>::sync_account_vault(&inner, request).await
1842 };
1843 Box::pin(fut)
1844 }
1845 }
1846 let accept_compression_encodings = self.accept_compression_encodings;
1847 let send_compression_encodings = self.send_compression_encodings;
1848 let max_decoding_message_size = self.max_decoding_message_size;
1849 let max_encoding_message_size = self.max_encoding_message_size;
1850 let inner = self.inner.clone();
1851 let fut = async move {
1852 let method = SyncAccountVaultSvc(inner);
1853 let codec = tonic_prost::ProstCodec::default();
1854 let mut grpc = tonic::server::Grpc::new(codec)
1855 .apply_compression_config(
1856 accept_compression_encodings,
1857 send_compression_encodings,
1858 )
1859 .apply_max_message_size_config(
1860 max_decoding_message_size,
1861 max_encoding_message_size,
1862 );
1863 let res = grpc.unary(method, req).await;
1864 Ok(res)
1865 };
1866 Box::pin(fut)
1867 }
1868 "/rpc.Api/SyncNotes" => {
1869 #[allow(non_camel_case_types)]
1870 struct SyncNotesSvc<T: Api>(pub Arc<T>);
1871 impl<T: Api> tonic::server::UnaryService<super::SyncNotesRequest>
1872 for SyncNotesSvc<T> {
1873 type Response = super::SyncNotesResponse;
1874 type Future = BoxFuture<
1875 tonic::Response<Self::Response>,
1876 tonic::Status,
1877 >;
1878 fn call(
1879 &mut self,
1880 request: tonic::Request<super::SyncNotesRequest>,
1881 ) -> Self::Future {
1882 let inner = Arc::clone(&self.0);
1883 let fut = async move {
1884 <T as Api>::sync_notes(&inner, request).await
1885 };
1886 Box::pin(fut)
1887 }
1888 }
1889 let accept_compression_encodings = self.accept_compression_encodings;
1890 let send_compression_encodings = self.send_compression_encodings;
1891 let max_decoding_message_size = self.max_decoding_message_size;
1892 let max_encoding_message_size = self.max_encoding_message_size;
1893 let inner = self.inner.clone();
1894 let fut = async move {
1895 let method = SyncNotesSvc(inner);
1896 let codec = tonic_prost::ProstCodec::default();
1897 let mut grpc = tonic::server::Grpc::new(codec)
1898 .apply_compression_config(
1899 accept_compression_encodings,
1900 send_compression_encodings,
1901 )
1902 .apply_max_message_size_config(
1903 max_decoding_message_size,
1904 max_encoding_message_size,
1905 );
1906 let res = grpc.unary(method, req).await;
1907 Ok(res)
1908 };
1909 Box::pin(fut)
1910 }
1911 "/rpc.Api/SyncState" => {
1912 #[allow(non_camel_case_types)]
1913 struct SyncStateSvc<T: Api>(pub Arc<T>);
1914 impl<T: Api> tonic::server::UnaryService<super::SyncStateRequest>
1915 for SyncStateSvc<T> {
1916 type Response = super::SyncStateResponse;
1917 type Future = BoxFuture<
1918 tonic::Response<Self::Response>,
1919 tonic::Status,
1920 >;
1921 fn call(
1922 &mut self,
1923 request: tonic::Request<super::SyncStateRequest>,
1924 ) -> Self::Future {
1925 let inner = Arc::clone(&self.0);
1926 let fut = async move {
1927 <T as Api>::sync_state(&inner, request).await
1928 };
1929 Box::pin(fut)
1930 }
1931 }
1932 let accept_compression_encodings = self.accept_compression_encodings;
1933 let send_compression_encodings = self.send_compression_encodings;
1934 let max_decoding_message_size = self.max_decoding_message_size;
1935 let max_encoding_message_size = self.max_encoding_message_size;
1936 let inner = self.inner.clone();
1937 let fut = async move {
1938 let method = SyncStateSvc(inner);
1939 let codec = tonic_prost::ProstCodec::default();
1940 let mut grpc = tonic::server::Grpc::new(codec)
1941 .apply_compression_config(
1942 accept_compression_encodings,
1943 send_compression_encodings,
1944 )
1945 .apply_max_message_size_config(
1946 max_decoding_message_size,
1947 max_encoding_message_size,
1948 );
1949 let res = grpc.unary(method, req).await;
1950 Ok(res)
1951 };
1952 Box::pin(fut)
1953 }
1954 "/rpc.Api/SyncAccountStorageMaps" => {
1955 #[allow(non_camel_case_types)]
1956 struct SyncAccountStorageMapsSvc<T: Api>(pub Arc<T>);
1957 impl<
1958 T: Api,
1959 > tonic::server::UnaryService<super::SyncAccountStorageMapsRequest>
1960 for SyncAccountStorageMapsSvc<T> {
1961 type Response = super::SyncAccountStorageMapsResponse;
1962 type Future = BoxFuture<
1963 tonic::Response<Self::Response>,
1964 tonic::Status,
1965 >;
1966 fn call(
1967 &mut self,
1968 request: tonic::Request<super::SyncAccountStorageMapsRequest>,
1969 ) -> Self::Future {
1970 let inner = Arc::clone(&self.0);
1971 let fut = async move {
1972 <T as Api>::sync_account_storage_maps(&inner, request).await
1973 };
1974 Box::pin(fut)
1975 }
1976 }
1977 let accept_compression_encodings = self.accept_compression_encodings;
1978 let send_compression_encodings = self.send_compression_encodings;
1979 let max_decoding_message_size = self.max_decoding_message_size;
1980 let max_encoding_message_size = self.max_encoding_message_size;
1981 let inner = self.inner.clone();
1982 let fut = async move {
1983 let method = SyncAccountStorageMapsSvc(inner);
1984 let codec = tonic_prost::ProstCodec::default();
1985 let mut grpc = tonic::server::Grpc::new(codec)
1986 .apply_compression_config(
1987 accept_compression_encodings,
1988 send_compression_encodings,
1989 )
1990 .apply_max_message_size_config(
1991 max_decoding_message_size,
1992 max_encoding_message_size,
1993 );
1994 let res = grpc.unary(method, req).await;
1995 Ok(res)
1996 };
1997 Box::pin(fut)
1998 }
1999 "/rpc.Api/SyncTransactions" => {
2000 #[allow(non_camel_case_types)]
2001 struct SyncTransactionsSvc<T: Api>(pub Arc<T>);
2002 impl<
2003 T: Api,
2004 > tonic::server::UnaryService<super::SyncTransactionsRequest>
2005 for SyncTransactionsSvc<T> {
2006 type Response = super::SyncTransactionsResponse;
2007 type Future = BoxFuture<
2008 tonic::Response<Self::Response>,
2009 tonic::Status,
2010 >;
2011 fn call(
2012 &mut self,
2013 request: tonic::Request<super::SyncTransactionsRequest>,
2014 ) -> Self::Future {
2015 let inner = Arc::clone(&self.0);
2016 let fut = async move {
2017 <T as Api>::sync_transactions(&inner, request).await
2018 };
2019 Box::pin(fut)
2020 }
2021 }
2022 let accept_compression_encodings = self.accept_compression_encodings;
2023 let send_compression_encodings = self.send_compression_encodings;
2024 let max_decoding_message_size = self.max_decoding_message_size;
2025 let max_encoding_message_size = self.max_encoding_message_size;
2026 let inner = self.inner.clone();
2027 let fut = async move {
2028 let method = SyncTransactionsSvc(inner);
2029 let codec = tonic_prost::ProstCodec::default();
2030 let mut grpc = tonic::server::Grpc::new(codec)
2031 .apply_compression_config(
2032 accept_compression_encodings,
2033 send_compression_encodings,
2034 )
2035 .apply_max_message_size_config(
2036 max_decoding_message_size,
2037 max_encoding_message_size,
2038 );
2039 let res = grpc.unary(method, req).await;
2040 Ok(res)
2041 };
2042 Box::pin(fut)
2043 }
2044 "/rpc.Api/GetLimits" => {
2045 #[allow(non_camel_case_types)]
2046 struct GetLimitsSvc<T: Api>(pub Arc<T>);
2047 impl<T: Api> tonic::server::UnaryService<()> for GetLimitsSvc<T> {
2048 type Response = super::RpcLimits;
2049 type Future = BoxFuture<
2050 tonic::Response<Self::Response>,
2051 tonic::Status,
2052 >;
2053 fn call(&mut self, request: tonic::Request<()>) -> Self::Future {
2054 let inner = Arc::clone(&self.0);
2055 let fut = async move {
2056 <T as Api>::get_limits(&inner, request).await
2057 };
2058 Box::pin(fut)
2059 }
2060 }
2061 let accept_compression_encodings = self.accept_compression_encodings;
2062 let send_compression_encodings = self.send_compression_encodings;
2063 let max_decoding_message_size = self.max_decoding_message_size;
2064 let max_encoding_message_size = self.max_encoding_message_size;
2065 let inner = self.inner.clone();
2066 let fut = async move {
2067 let method = GetLimitsSvc(inner);
2068 let codec = tonic_prost::ProstCodec::default();
2069 let mut grpc = tonic::server::Grpc::new(codec)
2070 .apply_compression_config(
2071 accept_compression_encodings,
2072 send_compression_encodings,
2073 )
2074 .apply_max_message_size_config(
2075 max_decoding_message_size,
2076 max_encoding_message_size,
2077 );
2078 let res = grpc.unary(method, req).await;
2079 Ok(res)
2080 };
2081 Box::pin(fut)
2082 }
2083 _ => {
2084 Box::pin(async move {
2085 let mut response = http::Response::new(
2086 tonic::body::Body::default(),
2087 );
2088 let headers = response.headers_mut();
2089 headers
2090 .insert(
2091 tonic::Status::GRPC_STATUS,
2092 (tonic::Code::Unimplemented as i32).into(),
2093 );
2094 headers
2095 .insert(
2096 http::header::CONTENT_TYPE,
2097 tonic::metadata::GRPC_CONTENT_TYPE,
2098 );
2099 Ok(response)
2100 })
2101 }
2102 }
2103 }
2104 }
2105 impl<T> Clone for ApiServer<T> {
2106 fn clone(&self) -> Self {
2107 let inner = self.inner.clone();
2108 Self {
2109 inner,
2110 accept_compression_encodings: self.accept_compression_encodings,
2111 send_compression_encodings: self.send_compression_encodings,
2112 max_decoding_message_size: self.max_decoding_message_size,
2113 max_encoding_message_size: self.max_encoding_message_size,
2114 }
2115 }
2116 }
2117 pub const SERVICE_NAME: &str = "rpc.Api";
2119 impl<T> tonic::server::NamedService for ApiServer<T> {
2120 const NAME: &'static str = SERVICE_NAME;
2121 }
2122}