Skip to main content

miden_client/rpc/generated/std/
rpc_store.rs

1// This file is @generated by prost-build.
2/// Represents the status of the store.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct StoreStatus {
5    /// The store's running version.
6    #[prost(string, tag = "1")]
7    pub version: ::prost::alloc::string::String,
8    /// The store's status.
9    #[prost(string, tag = "2")]
10    pub status: ::prost::alloc::string::String,
11    /// Number of the latest block in the chain.
12    #[prost(fixed32, tag = "3")]
13    pub chain_tip: u32,
14}
15/// Returns the latest state proof of the specified account.
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct AccountRequest {
18    /// ID of the account for which we want to get data
19    #[prost(message, optional, tag = "1")]
20    pub account_id: ::core::option::Option<super::account::AccountId>,
21    /// Optional block height at which to return the proof.
22    ///
23    /// Defaults to current chain tip if unspecified.
24    #[prost(message, optional, tag = "2")]
25    pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
26    /// Request for additional account details; valid only for public accounts.
27    #[prost(message, optional, tag = "3")]
28    pub details: ::core::option::Option<account_request::AccountDetailRequest>,
29}
30/// Nested message and enum types in `AccountRequest`.
31pub mod account_request {
32    /// Request the details for a public account.
33    #[derive(Clone, PartialEq, ::prost::Message)]
34    pub struct AccountDetailRequest {
35        /// Last known code commitment to the requester. The response will include account code
36        /// only if its commitment is different from this value.
37        ///
38        /// If the field is ommiteed, the response will not include the account code.
39        #[prost(message, optional, tag = "1")]
40        pub code_commitment: ::core::option::Option<super::super::primitives::Digest>,
41        /// Last known asset vault commitment to the requester. The response will include asset vault data
42        /// only if its commitment is different from this value. If the value is not present in the
43        /// request, the response will not contain one either.
44        /// If the number of to-be-returned asset entries exceed a threshold, they have to be requested
45        /// separately, which is signaled in the response message with dedicated flag.
46        #[prost(message, optional, tag = "2")]
47        pub asset_vault_commitment: ::core::option::Option<
48            super::super::primitives::Digest,
49        >,
50        /// Additional request per storage map.
51        #[prost(message, repeated, tag = "3")]
52        pub storage_maps: ::prost::alloc::vec::Vec<
53            account_detail_request::StorageMapDetailRequest,
54        >,
55    }
56    /// Nested message and enum types in `AccountDetailRequest`.
57    pub mod account_detail_request {
58        /// Represents a storage slot index and the associated map keys.
59        #[derive(Clone, PartialEq, ::prost::Message)]
60        pub struct StorageMapDetailRequest {
61            /// Storage slot index (`\[0..255\]`).
62            #[prost(uint32, tag = "1")]
63            pub slot_index: u32,
64            #[prost(oneof = "storage_map_detail_request::SlotData", tags = "2, 3")]
65            pub slot_data: ::core::option::Option<storage_map_detail_request::SlotData>,
66        }
67        /// Nested message and enum types in `StorageMapDetailRequest`.
68        pub mod storage_map_detail_request {
69            /// Indirection required for use in `oneof {..}` block.
70            #[derive(Clone, PartialEq, ::prost::Message)]
71            pub struct MapKeys {
72                /// A list of map keys associated with this storage slot.
73                #[prost(message, repeated, tag = "1")]
74                pub map_keys: ::prost::alloc::vec::Vec<
75                    super::super::super::super::primitives::Digest,
76                >,
77            }
78            #[derive(Clone, PartialEq, ::prost::Oneof)]
79            pub enum SlotData {
80                /// Request to return all storage map data. If the number exceeds a threshold of 1000 entries,
81                /// the response will not contain them but must be requested separately.
82                #[prost(bool, tag = "2")]
83                AllEntries(bool),
84                /// A list of map keys associated with the given storage slot identified by `slot_index`.
85                #[prost(message, tag = "3")]
86                MapKeys(MapKeys),
87            }
88        }
89    }
90}
91/// Represents the result of getting account proof.
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct AccountResponse {
94    /// The block number at which the account witness was created and the account details were observed.
95    #[prost(message, optional, tag = "1")]
96    pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
97    /// Account ID, current state commitment, and SMT path.
98    #[prost(message, optional, tag = "2")]
99    pub witness: ::core::option::Option<super::account::AccountWitness>,
100    /// Additional details for public accounts.
101    #[prost(message, optional, tag = "3")]
102    pub details: ::core::option::Option<account_response::AccountDetails>,
103}
104/// Nested message and enum types in `AccountResponse`.
105pub mod account_response {
106    #[derive(Clone, PartialEq, ::prost::Message)]
107    pub struct AccountDetails {
108        /// Account header.
109        #[prost(message, optional, tag = "1")]
110        pub header: ::core::option::Option<super::super::account::AccountHeader>,
111        /// Account storage data
112        #[prost(message, optional, tag = "2")]
113        pub storage_details: ::core::option::Option<super::AccountStorageDetails>,
114        /// Account code; empty if code commitments matched or none was requested.
115        #[prost(bytes = "vec", optional, tag = "3")]
116        pub code: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
117        /// Account asset vault data; empty if vault commitments matched or the requester
118        /// omitted it in the request.
119        #[prost(message, optional, tag = "4")]
120        pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
121    }
122}
123/// Account vault details for AccountResponse
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct AccountVaultDetails {
126    /// A flag that is set to true if the account contains too many assets. This indicates
127    /// to the user that `SyncAccountVault` endpoint should be used to retrieve the
128    /// account's assets
129    #[prost(bool, tag = "1")]
130    pub too_many_assets: bool,
131    /// When too_many_assets == false, this will contain the list of assets in the
132    /// account's vault
133    #[prost(message, repeated, tag = "2")]
134    pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
135}
136/// Account storage details for AccountResponse
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct AccountStorageDetails {
139    /// Account storage header (storage slot info for up to 256 slots)
140    #[prost(message, optional, tag = "1")]
141    pub header: ::core::option::Option<super::account::AccountStorageHeader>,
142    /// Additional data for the requested storage maps
143    #[prost(message, repeated, tag = "2")]
144    pub map_details: ::prost::alloc::vec::Vec<
145        account_storage_details::AccountStorageMapDetails,
146    >,
147}
148/// Nested message and enum types in `AccountStorageDetails`.
149pub mod account_storage_details {
150    #[derive(Clone, PartialEq, ::prost::Message)]
151    pub struct AccountStorageMapDetails {
152        /// slot index of the storage map
153        #[prost(uint32, tag = "1")]
154        pub slot_index: u32,
155        /// A flag that is set to `true` if the number of to-be-returned entries in the
156        /// storage map would exceed a threshold. This indicates to the user that `SyncStorageMaps`
157        /// endpoint should be used to get all storage map data.
158        #[prost(bool, tag = "2")]
159        pub too_many_entries: bool,
160        /// By default we provide all storage entries.
161        #[prost(message, optional, tag = "3")]
162        pub entries: ::core::option::Option<account_storage_map_details::MapEntries>,
163    }
164    /// Nested message and enum types in `AccountStorageMapDetails`.
165    pub mod account_storage_map_details {
166        /// Wrapper for repeated storage map entries
167        #[derive(Clone, PartialEq, ::prost::Message)]
168        pub struct MapEntries {
169            #[prost(message, repeated, tag = "1")]
170            pub entries: ::prost::alloc::vec::Vec<map_entries::StorageMapEntry>,
171        }
172        /// Nested message and enum types in `MapEntries`.
173        pub mod map_entries {
174            /// Definition of individual storage entries.
175            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
176            pub struct StorageMapEntry {
177                #[prost(message, optional, tag = "1")]
178                pub key: ::core::option::Option<
179                    super::super::super::super::primitives::Digest,
180                >,
181                #[prost(message, optional, tag = "2")]
182                pub value: ::core::option::Option<
183                    super::super::super::super::primitives::Digest,
184                >,
185            }
186        }
187    }
188}
189/// List of nullifiers to return proofs for.
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct NullifierList {
192    /// List of nullifiers to return proofs for.
193    #[prost(message, repeated, tag = "1")]
194    pub nullifiers: ::prost::alloc::vec::Vec<super::primitives::Digest>,
195}
196/// Represents the result of checking nullifiers.
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct CheckNullifiersResponse {
199    /// Each requested nullifier has its corresponding nullifier proof at the same position.
200    #[prost(message, repeated, tag = "1")]
201    pub proofs: ::prost::alloc::vec::Vec<super::primitives::SmtOpening>,
202}
203/// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
205pub struct SyncNullifiersRequest {
206    /// Block number from which the nullifiers are requested (inclusive).
207    #[prost(message, optional, tag = "1")]
208    pub block_range: ::core::option::Option<BlockRange>,
209    /// Number of bits used for nullifier prefix. Currently the only supported value is 16.
210    #[prost(uint32, tag = "2")]
211    pub prefix_len: u32,
212    /// List of nullifiers to check. Each nullifier is specified by its prefix with length equal
213    /// to `prefix_len`.
214    #[prost(uint32, repeated, tag = "3")]
215    pub nullifiers: ::prost::alloc::vec::Vec<u32>,
216}
217/// Represents the result of syncing nullifiers.
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct SyncNullifiersResponse {
220    /// Pagination information.
221    #[prost(message, optional, tag = "1")]
222    pub pagination_info: ::core::option::Option<PaginationInfo>,
223    /// List of nullifiers matching the prefixes specified in the request.
224    #[prost(message, repeated, tag = "2")]
225    pub nullifiers: ::prost::alloc::vec::Vec<sync_nullifiers_response::NullifierUpdate>,
226}
227/// Nested message and enum types in `SyncNullifiersResponse`.
228pub mod sync_nullifiers_response {
229    /// Represents a single nullifier update.
230    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
231    pub struct NullifierUpdate {
232        /// Nullifier ID.
233        #[prost(message, optional, tag = "1")]
234        pub nullifier: ::core::option::Option<super::super::primitives::Digest>,
235        /// Block number.
236        #[prost(fixed32, tag = "2")]
237        pub block_num: u32,
238    }
239}
240/// State synchronization request.
241///
242/// Specifies state updates the requester is interested in. The server will return the first block which
243/// contains a note matching `note_tags` or the chain tip. And the corresponding updates to
244/// `account_ids` for that block range.
245#[derive(Clone, PartialEq, ::prost::Message)]
246pub struct SyncStateRequest {
247    /// Last block known by the requester. The response will contain data starting from the next block,
248    /// until the first block which contains a note of matching the requested tag, or the chain tip
249    /// if there are no notes.
250    #[prost(fixed32, tag = "1")]
251    pub block_num: u32,
252    /// Accounts' commitment to include in the response.
253    ///
254    /// An account commitment will be included if-and-only-if it is the latest update. Meaning it is
255    /// possible there was an update to the account for the given range, but if it is not the latest,
256    /// it won't be included in the response.
257    #[prost(message, repeated, tag = "2")]
258    pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
259    /// Specifies the tags which the requester is interested in.
260    #[prost(fixed32, repeated, tag = "3")]
261    pub note_tags: ::prost::alloc::vec::Vec<u32>,
262}
263/// Represents the result of syncing state request.
264#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct SyncStateResponse {
266    /// Number of the latest block in the chain.
267    #[prost(fixed32, tag = "1")]
268    pub chain_tip: u32,
269    /// Block header of the block with the first note matching the specified criteria.
270    #[prost(message, optional, tag = "2")]
271    pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
272    /// Data needed to update the partial MMR from `request.block_num + 1` to `response.block_header.block_num`.
273    #[prost(message, optional, tag = "3")]
274    pub mmr_delta: ::core::option::Option<super::primitives::MmrDelta>,
275    /// List of account commitments updated after `request.block_num + 1` but not after `response.block_header.block_num`.
276    #[prost(message, repeated, tag = "5")]
277    pub accounts: ::prost::alloc::vec::Vec<super::account::AccountSummary>,
278    /// List of transactions executed against requested accounts between `request.block_num + 1` and
279    /// `response.block_header.block_num`.
280    #[prost(message, repeated, tag = "6")]
281    pub transactions: ::prost::alloc::vec::Vec<super::transaction::TransactionSummary>,
282    /// List of all notes together with the Merkle paths from `response.block_header.note_root`.
283    #[prost(message, repeated, tag = "7")]
284    pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
285}
286/// Account vault synchronization request.
287///
288/// Allows requesters to sync asset values for specific public accounts within a block range.
289#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
290pub struct SyncAccountVaultRequest {
291    /// Block range from which to start synchronizing.
292    ///
293    /// If the `block_to` is specified, this block must be close to the chain tip (i.e., within 30 blocks),
294    /// otherwise an error will be returned.
295    #[prost(message, optional, tag = "1")]
296    pub block_range: ::core::option::Option<BlockRange>,
297    /// Account for which we want to sync asset vault.
298    #[prost(message, optional, tag = "2")]
299    pub account_id: ::core::option::Option<super::account::AccountId>,
300}
301#[derive(Clone, PartialEq, ::prost::Message)]
302pub struct SyncAccountVaultResponse {
303    /// Pagination information.
304    #[prost(message, optional, tag = "1")]
305    pub pagination_info: ::core::option::Option<PaginationInfo>,
306    /// List of asset updates for the account.
307    ///
308    /// Multiple updates can be returned for a single asset, and the one with a higher `block_num`
309    /// is expected to be retained by the caller.
310    #[prost(message, repeated, tag = "2")]
311    pub updates: ::prost::alloc::vec::Vec<AccountVaultUpdate>,
312}
313#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
314pub struct AccountVaultUpdate {
315    /// Vault key associated with the asset.
316    #[prost(message, optional, tag = "1")]
317    pub vault_key: ::core::option::Option<super::primitives::Digest>,
318    /// Asset value related to the vault key.
319    /// If not present, the asset was removed from the vault.
320    #[prost(message, optional, tag = "2")]
321    pub asset: ::core::option::Option<super::primitives::Asset>,
322    /// Block number at which the above asset was updated in the account vault.
323    #[prost(fixed32, tag = "3")]
324    pub block_num: u32,
325}
326/// Note synchronization request.
327///
328/// Specifies note tags that requester is interested in. The server will return the first block which
329/// contains a note matching `note_tags` or the chain tip.
330#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
331pub struct SyncNotesRequest {
332    /// Block range from which to start synchronizing.
333    #[prost(message, optional, tag = "1")]
334    pub block_range: ::core::option::Option<BlockRange>,
335    /// Specifies the tags which the requester is interested in.
336    #[prost(fixed32, repeated, tag = "2")]
337    pub note_tags: ::prost::alloc::vec::Vec<u32>,
338}
339/// Represents the result of syncing notes request.
340#[derive(Clone, PartialEq, ::prost::Message)]
341pub struct SyncNotesResponse {
342    /// Pagination information.
343    #[prost(message, optional, tag = "1")]
344    pub pagination_info: ::core::option::Option<PaginationInfo>,
345    /// Block header of the block with the first note matching the specified criteria.
346    #[prost(message, optional, tag = "2")]
347    pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
348    /// Merkle path to verify the block's inclusion in the MMR at the returned `chain_tip`.
349    ///
350    /// An MMR proof can be constructed for the leaf of index `block_header.block_num` of
351    /// an MMR of forest `chain_tip` with this path.
352    #[prost(message, optional, tag = "3")]
353    pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
354    /// List of all notes together with the Merkle paths from `response.block_header.note_root`.
355    #[prost(message, repeated, tag = "4")]
356    pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
357}
358/// Storage map synchronization request.
359///
360/// Allows requesters to sync storage map values for specific public accounts within a block range,
361/// with support for cursor-based pagination to handle large storage maps.
362#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
363pub struct SyncStorageMapsRequest {
364    /// Block range from which to start synchronizing.
365    ///
366    /// If the `block_to` is specified, this block must be close to the chain tip (i.e., within 30 blocks),
367    /// otherwise an error will be returned.
368    #[prost(message, optional, tag = "1")]
369    pub block_range: ::core::option::Option<BlockRange>,
370    /// Account for which we want to sync storage maps.
371    #[prost(message, optional, tag = "3")]
372    pub account_id: ::core::option::Option<super::account::AccountId>,
373}
374#[derive(Clone, PartialEq, ::prost::Message)]
375pub struct SyncStorageMapsResponse {
376    /// Pagination information.
377    #[prost(message, optional, tag = "1")]
378    pub pagination_info: ::core::option::Option<PaginationInfo>,
379    /// The list of storage map updates.
380    ///
381    /// Multiple updates can be returned for a single slot index and key combination, and the one
382    /// with a higher `block_num` is expected to be retained by the caller.
383    #[prost(message, repeated, tag = "2")]
384    pub updates: ::prost::alloc::vec::Vec<StorageMapUpdate>,
385}
386/// Represents a single storage map update.
387#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
388pub struct StorageMapUpdate {
389    /// Block number in which the slot was updated.
390    #[prost(fixed32, tag = "1")]
391    pub block_num: u32,
392    /// Slot index (\[0..255\]).
393    #[prost(uint32, tag = "2")]
394    pub slot_index: u32,
395    /// The storage map key.
396    #[prost(message, optional, tag = "3")]
397    pub key: ::core::option::Option<super::primitives::Digest>,
398    /// The storage map value.
399    #[prost(message, optional, tag = "4")]
400    pub value: ::core::option::Option<super::primitives::Digest>,
401}
402/// Represents a block range.
403#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
404pub struct BlockRange {
405    /// Block number from which to start (inclusive).
406    #[prost(fixed32, tag = "1")]
407    pub block_from: u32,
408    /// Block number up to which to check (inclusive). If not specified, checks up to the latest block.
409    #[prost(fixed32, optional, tag = "2")]
410    pub block_to: ::core::option::Option<u32>,
411}
412/// Represents pagination information for chunked responses.
413///
414/// Pagination is done using block numbers as the axis, allowing requesters to request
415/// data in chunks by specifying block ranges and continuing from where the previous
416/// response left off.
417///
418/// To request the next chunk, the requester should use `block_num + 1` from the previous response
419/// as the `block_from` for the next request.
420#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
421pub struct PaginationInfo {
422    /// Current chain tip
423    #[prost(fixed32, tag = "1")]
424    pub chain_tip: u32,
425    /// The block number of the last check included in this response.
426    ///
427    /// For chunked responses, this may be less than `request.block_range.block_to`.
428    /// If it is less than request.block_range.block_to, the user is expected to make a subsequent request
429    /// starting from the next block to this one (ie, request.block_range.block_from = block_num + 1).
430    #[prost(fixed32, tag = "2")]
431    pub block_num: u32,
432}
433/// Transactions synchronization request.
434///
435/// Allows requesters to sync transactions for specific accounts within a block range.
436#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct SyncTransactionsRequest {
438    /// Block range from which to start synchronizing.
439    #[prost(message, optional, tag = "1")]
440    pub block_range: ::core::option::Option<BlockRange>,
441    /// Accounts to sync transactions for.
442    #[prost(message, repeated, tag = "2")]
443    pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
444}
445/// Represents the result of syncing transactions request.
446#[derive(Clone, PartialEq, ::prost::Message)]
447pub struct SyncTransactionsResponse {
448    /// Pagination information.
449    #[prost(message, optional, tag = "1")]
450    pub pagination_info: ::core::option::Option<PaginationInfo>,
451    /// List of transaction records.
452    #[prost(message, repeated, tag = "2")]
453    pub transactions: ::prost::alloc::vec::Vec<TransactionRecord>,
454}
455/// Represents a transaction record.
456#[derive(Clone, PartialEq, ::prost::Message)]
457pub struct TransactionRecord {
458    /// Block number in which the transaction was included.
459    #[prost(fixed32, tag = "1")]
460    pub block_num: u32,
461    /// A transaction header.
462    #[prost(message, optional, tag = "2")]
463    pub header: ::core::option::Option<super::transaction::TransactionHeader>,
464}
465/// Generated client implementations.
466pub mod rpc_client {
467    #![allow(
468        unused_variables,
469        dead_code,
470        missing_docs,
471        clippy::wildcard_imports,
472        clippy::let_unit_value,
473    )]
474    use tonic::codegen::*;
475    use tonic::codegen::http::Uri;
476    /// Store API for the RPC component
477    #[derive(Debug, Clone)]
478    pub struct RpcClient<T> {
479        inner: tonic::client::Grpc<T>,
480    }
481    impl RpcClient<tonic::transport::Channel> {
482        /// Attempt to create a new client by connecting to a given endpoint.
483        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
484        where
485            D: TryInto<tonic::transport::Endpoint>,
486            D::Error: Into<StdError>,
487        {
488            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
489            Ok(Self::new(conn))
490        }
491    }
492    impl<T> RpcClient<T>
493    where
494        T: tonic::client::GrpcService<tonic::body::Body>,
495        T::Error: Into<StdError>,
496        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
497        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
498    {
499        pub fn new(inner: T) -> Self {
500            let inner = tonic::client::Grpc::new(inner);
501            Self { inner }
502        }
503        pub fn with_origin(inner: T, origin: Uri) -> Self {
504            let inner = tonic::client::Grpc::with_origin(inner, origin);
505            Self { inner }
506        }
507        pub fn with_interceptor<F>(
508            inner: T,
509            interceptor: F,
510        ) -> RpcClient<InterceptedService<T, F>>
511        where
512            F: tonic::service::Interceptor,
513            T::ResponseBody: Default,
514            T: tonic::codegen::Service<
515                http::Request<tonic::body::Body>,
516                Response = http::Response<
517                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
518                >,
519            >,
520            <T as tonic::codegen::Service<
521                http::Request<tonic::body::Body>,
522            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
523        {
524            RpcClient::new(InterceptedService::new(inner, interceptor))
525        }
526        /// Compress requests with the given encoding.
527        ///
528        /// This requires the server to support it otherwise it might respond with an
529        /// error.
530        #[must_use]
531        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
532            self.inner = self.inner.send_compressed(encoding);
533            self
534        }
535        /// Enable decompressing responses.
536        #[must_use]
537        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
538            self.inner = self.inner.accept_compressed(encoding);
539            self
540        }
541        /// Limits the maximum size of a decoded message.
542        ///
543        /// Default: `4MB`
544        #[must_use]
545        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
546            self.inner = self.inner.max_decoding_message_size(limit);
547            self
548        }
549        /// Limits the maximum size of an encoded message.
550        ///
551        /// Default: `usize::MAX`
552        #[must_use]
553        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
554            self.inner = self.inner.max_encoding_message_size(limit);
555            self
556        }
557        /// Returns the status info.
558        pub async fn status(
559            &mut self,
560            request: impl tonic::IntoRequest<()>,
561        ) -> std::result::Result<tonic::Response<super::StoreStatus>, tonic::Status> {
562            self.inner
563                .ready()
564                .await
565                .map_err(|e| {
566                    tonic::Status::unknown(
567                        format!("Service was not ready: {}", e.into()),
568                    )
569                })?;
570            let codec = tonic_prost::ProstCodec::default();
571            let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/Status");
572            let mut req = request.into_request();
573            req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "Status"));
574            self.inner.unary(req, path, codec).await
575        }
576        /// Returns a nullifier proof for each of the requested nullifiers.
577        pub async fn check_nullifiers(
578            &mut self,
579            request: impl tonic::IntoRequest<super::NullifierList>,
580        ) -> std::result::Result<
581            tonic::Response<super::CheckNullifiersResponse>,
582            tonic::Status,
583        > {
584            self.inner
585                .ready()
586                .await
587                .map_err(|e| {
588                    tonic::Status::unknown(
589                        format!("Service was not ready: {}", e.into()),
590                    )
591                })?;
592            let codec = tonic_prost::ProstCodec::default();
593            let path = http::uri::PathAndQuery::from_static(
594                "/rpc_store.Rpc/CheckNullifiers",
595            );
596            let mut req = request.into_request();
597            req.extensions_mut()
598                .insert(GrpcMethod::new("rpc_store.Rpc", "CheckNullifiers"));
599            self.inner.unary(req, path, codec).await
600        }
601        /// Returns the latest state proof of the specified account.
602        pub async fn get_account(
603            &mut self,
604            request: impl tonic::IntoRequest<super::AccountRequest>,
605        ) -> std::result::Result<
606            tonic::Response<super::AccountResponse>,
607            tonic::Status,
608        > {
609            self.inner
610                .ready()
611                .await
612                .map_err(|e| {
613                    tonic::Status::unknown(
614                        format!("Service was not ready: {}", e.into()),
615                    )
616                })?;
617            let codec = tonic_prost::ProstCodec::default();
618            let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/GetAccount");
619            let mut req = request.into_request();
620            req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "GetAccount"));
621            self.inner.unary(req, path, codec).await
622        }
623        /// Returns raw block data for the specified block number.
624        pub async fn get_block_by_number(
625            &mut self,
626            request: impl tonic::IntoRequest<super::super::blockchain::BlockNumber>,
627        ) -> std::result::Result<
628            tonic::Response<super::super::blockchain::MaybeBlock>,
629            tonic::Status,
630        > {
631            self.inner
632                .ready()
633                .await
634                .map_err(|e| {
635                    tonic::Status::unknown(
636                        format!("Service was not ready: {}", e.into()),
637                    )
638                })?;
639            let codec = tonic_prost::ProstCodec::default();
640            let path = http::uri::PathAndQuery::from_static(
641                "/rpc_store.Rpc/GetBlockByNumber",
642            );
643            let mut req = request.into_request();
644            req.extensions_mut()
645                .insert(GrpcMethod::new("rpc_store.Rpc", "GetBlockByNumber"));
646            self.inner.unary(req, path, codec).await
647        }
648        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
649        /// and current chain length to authenticate the block's inclusion.
650        pub async fn get_block_header_by_number(
651            &mut self,
652            request: impl tonic::IntoRequest<
653                super::super::shared::BlockHeaderByNumberRequest,
654            >,
655        ) -> std::result::Result<
656            tonic::Response<super::super::shared::BlockHeaderByNumberResponse>,
657            tonic::Status,
658        > {
659            self.inner
660                .ready()
661                .await
662                .map_err(|e| {
663                    tonic::Status::unknown(
664                        format!("Service was not ready: {}", e.into()),
665                    )
666                })?;
667            let codec = tonic_prost::ProstCodec::default();
668            let path = http::uri::PathAndQuery::from_static(
669                "/rpc_store.Rpc/GetBlockHeaderByNumber",
670            );
671            let mut req = request.into_request();
672            req.extensions_mut()
673                .insert(GrpcMethod::new("rpc_store.Rpc", "GetBlockHeaderByNumber"));
674            self.inner.unary(req, path, codec).await
675        }
676        /// Returns a list of committed notes matching the provided note IDs.
677        pub async fn get_notes_by_id(
678            &mut self,
679            request: impl tonic::IntoRequest<super::super::note::NoteIdList>,
680        ) -> std::result::Result<
681            tonic::Response<super::super::note::CommittedNoteList>,
682            tonic::Status,
683        > {
684            self.inner
685                .ready()
686                .await
687                .map_err(|e| {
688                    tonic::Status::unknown(
689                        format!("Service was not ready: {}", e.into()),
690                    )
691                })?;
692            let codec = tonic_prost::ProstCodec::default();
693            let path = http::uri::PathAndQuery::from_static(
694                "/rpc_store.Rpc/GetNotesById",
695            );
696            let mut req = request.into_request();
697            req.extensions_mut()
698                .insert(GrpcMethod::new("rpc_store.Rpc", "GetNotesById"));
699            self.inner.unary(req, path, codec).await
700        }
701        /// Returns the script for a note by its root.
702        pub async fn get_note_script_by_root(
703            &mut self,
704            request: impl tonic::IntoRequest<super::super::note::NoteRoot>,
705        ) -> std::result::Result<
706            tonic::Response<super::super::shared::MaybeNoteScript>,
707            tonic::Status,
708        > {
709            self.inner
710                .ready()
711                .await
712                .map_err(|e| {
713                    tonic::Status::unknown(
714                        format!("Service was not ready: {}", e.into()),
715                    )
716                })?;
717            let codec = tonic_prost::ProstCodec::default();
718            let path = http::uri::PathAndQuery::from_static(
719                "/rpc_store.Rpc/GetNoteScriptByRoot",
720            );
721            let mut req = request.into_request();
722            req.extensions_mut()
723                .insert(GrpcMethod::new("rpc_store.Rpc", "GetNoteScriptByRoot"));
724            self.inner.unary(req, path, codec).await
725        }
726        /// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
727        ///
728        /// Note that only 16-bit prefixes are supported at this time.
729        pub async fn sync_nullifiers(
730            &mut self,
731            request: impl tonic::IntoRequest<super::SyncNullifiersRequest>,
732        ) -> std::result::Result<
733            tonic::Response<super::SyncNullifiersResponse>,
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(
746                "/rpc_store.Rpc/SyncNullifiers",
747            );
748            let mut req = request.into_request();
749            req.extensions_mut()
750                .insert(GrpcMethod::new("rpc_store.Rpc", "SyncNullifiers"));
751            self.inner.unary(req, path, codec).await
752        }
753        /// Returns info which can be used by the requester to sync up to the tip of chain for the notes they are interested in.
754        ///
755        /// requester specifies the `note_tags` they are interested in, and the block height from which to search for new for
756        /// matching notes for. The request will then return the next block containing any note matching the provided tags.
757        ///
758        /// The response includes each note's metadata and inclusion proof.
759        ///
760        /// A basic note sync can be implemented by repeatedly requesting the previous response's block until reaching the
761        /// tip of the chain.
762        pub async fn sync_notes(
763            &mut self,
764            request: impl tonic::IntoRequest<super::SyncNotesRequest>,
765        ) -> std::result::Result<
766            tonic::Response<super::SyncNotesResponse>,
767            tonic::Status,
768        > {
769            self.inner
770                .ready()
771                .await
772                .map_err(|e| {
773                    tonic::Status::unknown(
774                        format!("Service was not ready: {}", e.into()),
775                    )
776                })?;
777            let codec = tonic_prost::ProstCodec::default();
778            let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/SyncNotes");
779            let mut req = request.into_request();
780            req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "SyncNotes"));
781            self.inner.unary(req, path, codec).await
782        }
783        /// Returns info which can be used by the requester to sync up to the latest state of the chain
784        /// for the objects (accounts, notes, nullifiers) the requester is interested in.
785        ///
786        /// This request returns the next block containing requested data. It also returns `chain_tip`
787        /// which is the latest block number in the chain. requester is expected to repeat these requests
788        /// in a loop until `response.block_header.block_num == response.chain_tip`, at which point
789        /// the requester is fully synchronized with the chain.
790        ///
791        /// Each request also returns info about new notes, nullifiers etc. created. It also returns
792        /// Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain
793        /// MMR peaks and chain MMR nodes.
794        ///
795        /// For preserving some degree of privacy, note tags and nullifiers filters contain only high
796        /// part of hashes. Thus, returned data contains excessive notes and nullifiers, requester can make
797        /// additional filtering of that data on its side.
798        pub async fn sync_state(
799            &mut self,
800            request: impl tonic::IntoRequest<super::SyncStateRequest>,
801        ) -> std::result::Result<
802            tonic::Response<super::SyncStateResponse>,
803            tonic::Status,
804        > {
805            self.inner
806                .ready()
807                .await
808                .map_err(|e| {
809                    tonic::Status::unknown(
810                        format!("Service was not ready: {}", e.into()),
811                    )
812                })?;
813            let codec = tonic_prost::ProstCodec::default();
814            let path = http::uri::PathAndQuery::from_static("/rpc_store.Rpc/SyncState");
815            let mut req = request.into_request();
816            req.extensions_mut().insert(GrpcMethod::new("rpc_store.Rpc", "SyncState"));
817            self.inner.unary(req, path, codec).await
818        }
819        /// Returns account vault updates for specified account within a block range.
820        pub async fn sync_account_vault(
821            &mut self,
822            request: impl tonic::IntoRequest<super::SyncAccountVaultRequest>,
823        ) -> std::result::Result<
824            tonic::Response<super::SyncAccountVaultResponse>,
825            tonic::Status,
826        > {
827            self.inner
828                .ready()
829                .await
830                .map_err(|e| {
831                    tonic::Status::unknown(
832                        format!("Service was not ready: {}", e.into()),
833                    )
834                })?;
835            let codec = tonic_prost::ProstCodec::default();
836            let path = http::uri::PathAndQuery::from_static(
837                "/rpc_store.Rpc/SyncAccountVault",
838            );
839            let mut req = request.into_request();
840            req.extensions_mut()
841                .insert(GrpcMethod::new("rpc_store.Rpc", "SyncAccountVault"));
842            self.inner.unary(req, path, codec).await
843        }
844        /// Returns storage map updates for specified account and storage slots within a block range.
845        pub async fn sync_storage_maps(
846            &mut self,
847            request: impl tonic::IntoRequest<super::SyncStorageMapsRequest>,
848        ) -> std::result::Result<
849            tonic::Response<super::SyncStorageMapsResponse>,
850            tonic::Status,
851        > {
852            self.inner
853                .ready()
854                .await
855                .map_err(|e| {
856                    tonic::Status::unknown(
857                        format!("Service was not ready: {}", e.into()),
858                    )
859                })?;
860            let codec = tonic_prost::ProstCodec::default();
861            let path = http::uri::PathAndQuery::from_static(
862                "/rpc_store.Rpc/SyncStorageMaps",
863            );
864            let mut req = request.into_request();
865            req.extensions_mut()
866                .insert(GrpcMethod::new("rpc_store.Rpc", "SyncStorageMaps"));
867            self.inner.unary(req, path, codec).await
868        }
869        /// Returns transactions records for specific accounts within a block range.
870        pub async fn sync_transactions(
871            &mut self,
872            request: impl tonic::IntoRequest<super::SyncTransactionsRequest>,
873        ) -> std::result::Result<
874            tonic::Response<super::SyncTransactionsResponse>,
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_store.Rpc/SyncTransactions",
888            );
889            let mut req = request.into_request();
890            req.extensions_mut()
891                .insert(GrpcMethod::new("rpc_store.Rpc", "SyncTransactions"));
892            self.inner.unary(req, path, codec).await
893        }
894    }
895}