Skip to main content

miden_node_proto/generated/
rpc.rs

1// This file is @generated by prost-build.
2/// Represents the status of the node.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct RpcStatus {
5    /// The rpc component's running version.
6    #[prost(string, tag = "1")]
7    pub version: ::prost::alloc::string::String,
8    /// The genesis commitment.
9    #[prost(message, optional, tag = "2")]
10    pub genesis_commitment: ::core::option::Option<super::primitives::Digest>,
11    /// The store status.
12    #[prost(message, optional, tag = "3")]
13    pub store: ::core::option::Option<StoreStatus>,
14    /// The block producer status.
15    #[prost(message, optional, tag = "4")]
16    pub block_producer: ::core::option::Option<BlockProducerStatus>,
17}
18/// Represents the status of the block producer.
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
20pub struct BlockProducerStatus {
21    /// The block producer's running version.
22    #[prost(string, tag = "1")]
23    pub version: ::prost::alloc::string::String,
24    /// The block producer's status.
25    #[prost(string, tag = "2")]
26    pub status: ::prost::alloc::string::String,
27    /// The block producer's current view of the chain tip height.
28    ///
29    /// This is the height of the latest block that the block producer considers
30    /// to be part of the canonical chain.
31    #[prost(fixed32, tag = "4")]
32    pub chain_tip: u32,
33    /// Statistics about the mempool.
34    #[prost(message, optional, tag = "3")]
35    pub mempool_stats: ::core::option::Option<MempoolStats>,
36}
37/// Statistics about the mempool.
38#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
39pub struct MempoolStats {
40    /// Number of transactions currently in the mempool waiting to be batched.
41    #[prost(uint64, tag = "1")]
42    pub unbatched_transactions: u64,
43    /// Number of batches currently being proven.
44    #[prost(uint64, tag = "2")]
45    pub proposed_batches: u64,
46    /// Number of proven batches waiting for block inclusion.
47    #[prost(uint64, tag = "3")]
48    pub proven_batches: u64,
49}
50/// Represents the status of the store.
51#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
52pub struct StoreStatus {
53    /// The store's running version.
54    #[prost(string, tag = "1")]
55    pub version: ::prost::alloc::string::String,
56    /// The store's status.
57    #[prost(string, tag = "2")]
58    pub status: ::prost::alloc::string::String,
59    /// Number of the latest block in the chain.
60    #[prost(fixed32, tag = "3")]
61    pub chain_tip: u32,
62}
63/// Returns the block header corresponding to the requested block number, as well as the merkle
64/// path and current forest which validate the block's inclusion in the chain.
65///
66/// The Merkle path is an MMR proof for the block's leaf, based on the current chain length.
67#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
68pub struct BlockHeaderByNumberRequest {
69    /// The target block height, defaults to latest if not provided.
70    #[prost(uint32, optional, tag = "1")]
71    pub block_num: ::core::option::Option<u32>,
72    /// Whether or not to return authentication data for the block header.
73    #[prost(bool, optional, tag = "2")]
74    pub include_mmr_proof: ::core::option::Option<bool>,
75}
76/// Represents the result of getting a block header by block number.
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct BlockHeaderByNumberResponse {
79    /// The requested block header.
80    #[prost(message, optional, tag = "1")]
81    pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
82    /// Merkle path to verify the block's inclusion in the MMR at the returned `chain_length`.
83    #[prost(message, optional, tag = "2")]
84    pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
85    /// Current chain length.
86    #[prost(fixed32, optional, tag = "3")]
87    pub chain_length: ::core::option::Option<u32>,
88}
89/// Represents a note script or nothing.
90#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
91pub struct MaybeNoteScript {
92    /// The script for a note by its root.
93    #[prost(message, optional, tag = "1")]
94    pub script: ::core::option::Option<super::note::NoteScript>,
95}
96/// Defines the request for account details.
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct AccountRequest {
99    /// ID of the account for which we want to get data
100    #[prost(message, optional, tag = "1")]
101    pub account_id: ::core::option::Option<super::account::AccountId>,
102    /// Optional block height at which to return the proof.
103    ///
104    /// Defaults to current chain tip if unspecified.
105    #[prost(message, optional, tag = "2")]
106    pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
107    /// Request for additional account details; valid only for public accounts.
108    #[prost(message, optional, tag = "3")]
109    pub details: ::core::option::Option<account_request::AccountDetailRequest>,
110}
111/// Nested message and enum types in `AccountRequest`.
112pub mod account_request {
113    /// Request the details for a public account.
114    #[derive(Clone, PartialEq, ::prost::Message)]
115    pub struct AccountDetailRequest {
116        /// Last known code commitment to the requester. The response will include account code
117        /// only if its commitment is different from this value.
118        ///
119        /// If the field is ommiteed, the response will not include the account code.
120        #[prost(message, optional, tag = "1")]
121        pub code_commitment: ::core::option::Option<super::super::primitives::Digest>,
122        /// Last known asset vault commitment to the requester. The response will include asset vault data
123        /// only if its commitment is different from this value. If the value is not present in the
124        /// request, the response will not contain one either.
125        /// If the number of to-be-returned asset entries exceed a threshold, they have to be requested
126        /// separately, which is signaled in the response message with dedicated flag.
127        #[prost(message, optional, tag = "2")]
128        pub asset_vault_commitment: ::core::option::Option<
129            super::super::primitives::Digest,
130        >,
131        /// Additional request per storage map.
132        #[prost(message, repeated, tag = "3")]
133        pub storage_maps: ::prost::alloc::vec::Vec<
134            account_detail_request::StorageMapDetailRequest,
135        >,
136    }
137    /// Nested message and enum types in `AccountDetailRequest`.
138    pub mod account_detail_request {
139        /// Represents a storage slot index and the associated map keys.
140        #[derive(Clone, PartialEq, ::prost::Message)]
141        pub struct StorageMapDetailRequest {
142            /// Storage slot name.
143            #[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        /// Nested message and enum types in `StorageMapDetailRequest`.
149        pub mod storage_map_detail_request {
150            /// Indirection required for use in `oneof {..}` block.
151            #[derive(Clone, PartialEq, ::prost::Message)]
152            pub struct MapKeys {
153                /// A list of map keys associated with this storage slot.
154                #[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                /// Request to return all storage map data. If the number exceeds a threshold of 1000 entries,
162                /// the response will not contain them but must be requested separately.
163                #[prost(bool, tag = "2")]
164                AllEntries(bool),
165                /// A list of map keys associated with the given storage slot identified by `slot_name`.
166                #[prost(message, tag = "3")]
167                MapKeys(MapKeys),
168            }
169        }
170    }
171}
172/// Represents the result of getting account proof.
173#[derive(Clone, PartialEq, ::prost::Message)]
174pub struct AccountResponse {
175    /// The block number at which the account witness was created and the account details were observed.
176    #[prost(message, optional, tag = "1")]
177    pub block_num: ::core::option::Option<super::blockchain::BlockNumber>,
178    /// Account ID, current state commitment, and SMT path.
179    #[prost(message, optional, tag = "2")]
180    pub witness: ::core::option::Option<super::account::AccountWitness>,
181    /// Additional details for public accounts.
182    #[prost(message, optional, tag = "3")]
183    pub details: ::core::option::Option<account_response::AccountDetails>,
184}
185/// Nested message and enum types in `AccountResponse`.
186pub mod account_response {
187    #[derive(Clone, PartialEq, ::prost::Message)]
188    pub struct AccountDetails {
189        /// Account header.
190        #[prost(message, optional, tag = "1")]
191        pub header: ::core::option::Option<super::super::account::AccountHeader>,
192        /// Account storage data
193        #[prost(message, optional, tag = "2")]
194        pub storage_details: ::core::option::Option<super::AccountStorageDetails>,
195        /// Account code; empty if code commitments matched or none was requested.
196        #[prost(bytes = "vec", optional, tag = "3")]
197        pub code: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
198        /// Account asset vault data; empty if vault commitments matched or the requester
199        /// omitted it in the request.
200        #[prost(message, optional, tag = "4")]
201        pub vault_details: ::core::option::Option<super::AccountVaultDetails>,
202    }
203}
204/// Account vault details for AccountResponse
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct AccountVaultDetails {
207    /// A flag that is set to true if the account contains too many assets. This indicates
208    /// to the user that `SyncAccountVault` endpoint should be used to retrieve the
209    /// account's assets
210    #[prost(bool, tag = "1")]
211    pub too_many_assets: bool,
212    /// When too_many_assets == false, this will contain the list of assets in the
213    /// account's vault
214    #[prost(message, repeated, tag = "2")]
215    pub assets: ::prost::alloc::vec::Vec<super::primitives::Asset>,
216}
217/// Account storage details for AccountResponse
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct AccountStorageDetails {
220    /// Account storage header (storage slot info for up to 256 slots)
221    #[prost(message, optional, tag = "1")]
222    pub header: ::core::option::Option<super::account::AccountStorageHeader>,
223    /// Additional data for the requested storage maps
224    #[prost(message, repeated, tag = "2")]
225    pub map_details: ::prost::alloc::vec::Vec<
226        account_storage_details::AccountStorageMapDetails,
227    >,
228}
229/// Nested message and enum types in `AccountStorageDetails`.
230pub mod account_storage_details {
231    #[derive(Clone, PartialEq, ::prost::Message)]
232    pub struct AccountStorageMapDetails {
233        /// Storage slot name.
234        #[prost(string, tag = "1")]
235        pub slot_name: ::prost::alloc::string::String,
236        /// True when the number of entries exceeds the response limit.
237        /// When set, clients should use the `SyncAccountStorageMaps` endpoint.
238        #[prost(bool, tag = "2")]
239        pub too_many_entries: bool,
240        /// The map entries (with or without proofs). Empty when too_many_entries is true.
241        #[prost(oneof = "account_storage_map_details::Entries", tags = "3, 4")]
242        pub entries: ::core::option::Option<account_storage_map_details::Entries>,
243    }
244    /// Nested message and enum types in `AccountStorageMapDetails`.
245    pub mod account_storage_map_details {
246        /// Wrapper for repeated storage map entries including their proofs.
247        /// Used when specific keys are requested to enable client-side verification.
248        #[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        /// Nested message and enum types in `MapEntriesWithProofs`.
256        pub mod map_entries_with_proofs {
257            /// Definition of individual storage entries including a proof.
258            #[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        /// Wrapper for repeated storage map entries (without proofs).
275        /// Used when all entries are requested for small maps.
276        #[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        /// Nested message and enum types in `AllMapEntries`.
282        pub mod all_map_entries {
283            /// Definition of individual storage entries.
284            #[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        /// The map entries (with or without proofs). Empty when too_many_entries is true.
297        #[derive(Clone, PartialEq, ::prost::Oneof)]
298        pub enum Entries {
299            /// All storage entries without proofs (for small maps or full requests).
300            #[prost(message, tag = "3")]
301            AllEntries(AllMapEntries),
302            /// Specific entries with their SMT proofs (for partial requests).
303            #[prost(message, tag = "4")]
304            EntriesWithProofs(MapEntriesWithProofs),
305        }
306    }
307}
308/// List of nullifiers to return proofs for.
309#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct NullifierList {
311    /// List of nullifiers to return proofs for.
312    #[prost(message, repeated, tag = "1")]
313    pub nullifiers: ::prost::alloc::vec::Vec<super::primitives::Digest>,
314}
315/// Represents the result of checking nullifiers.
316#[derive(Clone, PartialEq, ::prost::Message)]
317pub struct CheckNullifiersResponse {
318    /// Each requested nullifier has its corresponding nullifier proof at the same position.
319    #[prost(message, repeated, tag = "1")]
320    pub proofs: ::prost::alloc::vec::Vec<super::primitives::SmtOpening>,
321}
322/// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
323#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
324pub struct SyncNullifiersRequest {
325    /// Block number from which the nullifiers are requested (inclusive).
326    #[prost(message, optional, tag = "1")]
327    pub block_range: ::core::option::Option<BlockRange>,
328    /// Number of bits used for nullifier prefix. Currently the only supported value is 16.
329    #[prost(uint32, tag = "2")]
330    pub prefix_len: u32,
331    /// List of nullifiers to check. Each nullifier is specified by its prefix with length equal
332    /// to `prefix_len`.
333    #[prost(uint32, repeated, tag = "3")]
334    pub nullifiers: ::prost::alloc::vec::Vec<u32>,
335}
336/// Represents the result of syncing nullifiers.
337#[derive(Clone, PartialEq, ::prost::Message)]
338pub struct SyncNullifiersResponse {
339    /// Pagination information.
340    #[prost(message, optional, tag = "1")]
341    pub pagination_info: ::core::option::Option<PaginationInfo>,
342    /// List of nullifiers matching the prefixes specified in the request.
343    #[prost(message, repeated, tag = "2")]
344    pub nullifiers: ::prost::alloc::vec::Vec<sync_nullifiers_response::NullifierUpdate>,
345}
346/// Nested message and enum types in `SyncNullifiersResponse`.
347pub mod sync_nullifiers_response {
348    /// Represents a single nullifier update.
349    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
350    pub struct NullifierUpdate {
351        /// Nullifier ID.
352        #[prost(message, optional, tag = "1")]
353        pub nullifier: ::core::option::Option<super::super::primitives::Digest>,
354        /// Block number.
355        #[prost(fixed32, tag = "2")]
356        pub block_num: u32,
357    }
358}
359/// Account vault synchronization request.
360///
361/// Allows requesters to sync asset values for specific public accounts within a block range.
362#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
363pub struct SyncAccountVaultRequest {
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 asset vault.
371    #[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    /// Pagination information.
377    #[prost(message, optional, tag = "1")]
378    pub pagination_info: ::core::option::Option<PaginationInfo>,
379    /// List of asset updates for the account.
380    ///
381    /// Multiple updates can be returned for a single asset, and the one with a higher `block_num`
382    /// is expected to be retained by the caller.
383    #[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    /// Vault key associated with the asset.
389    #[prost(message, optional, tag = "1")]
390    pub vault_key: ::core::option::Option<super::primitives::Digest>,
391    /// Asset value related to the vault key.
392    /// If not present, the asset was removed from the vault.
393    #[prost(message, optional, tag = "2")]
394    pub asset: ::core::option::Option<super::primitives::Asset>,
395    /// Block number at which the above asset was updated in the account vault.
396    #[prost(fixed32, tag = "3")]
397    pub block_num: u32,
398}
399/// Note synchronization request.
400///
401/// Specifies note tags that requester is interested in. The server will return the first block which
402/// contains a note matching `note_tags` or the chain tip.
403#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
404pub struct SyncNotesRequest {
405    /// Block range from which to start synchronizing.
406    #[prost(message, optional, tag = "1")]
407    pub block_range: ::core::option::Option<BlockRange>,
408    /// Specifies the tags which the requester is interested in.
409    #[prost(fixed32, repeated, tag = "2")]
410    pub note_tags: ::prost::alloc::vec::Vec<u32>,
411}
412/// Represents the result of syncing notes request.
413#[derive(Clone, PartialEq, ::prost::Message)]
414pub struct SyncNotesResponse {
415    /// Pagination information.
416    #[prost(message, optional, tag = "1")]
417    pub pagination_info: ::core::option::Option<PaginationInfo>,
418    /// Block header of the block with the first note matching the specified criteria.
419    #[prost(message, optional, tag = "2")]
420    pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
421    /// Merkle path to verify the block's inclusion in the MMR at the returned `chain_tip`.
422    ///
423    /// An MMR proof can be constructed for the leaf of index `block_header.block_num` of
424    /// an MMR of forest `chain_tip` with this path.
425    #[prost(message, optional, tag = "3")]
426    pub mmr_path: ::core::option::Option<super::primitives::MerklePath>,
427    /// List of all notes together with the Merkle paths from `response.block_header.note_root`.
428    #[prost(message, repeated, tag = "4")]
429    pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
430}
431/// State synchronization request.
432///
433/// Specifies state updates the requester is interested in. The server will return the first block which
434/// contains a note matching `note_tags` or the chain tip. And the corresponding updates to
435/// `account_ids` for that block range.
436#[derive(Clone, PartialEq, ::prost::Message)]
437pub struct SyncStateRequest {
438    /// Last block known by the requester. The response will contain data starting from the next block,
439    /// until the first block which contains a note of matching the requested tag, or the chain tip
440    /// if there are no notes.
441    #[prost(fixed32, tag = "1")]
442    pub block_num: u32,
443    /// Accounts' commitment to include in the response.
444    ///
445    /// An account commitment will be included if-and-only-if it is the latest update. Meaning it is
446    /// possible there was an update to the account for the given range, but if it is not the latest,
447    /// it won't be included in the response.
448    #[prost(message, repeated, tag = "2")]
449    pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
450    /// Specifies the tags which the requester is interested in.
451    #[prost(fixed32, repeated, tag = "3")]
452    pub note_tags: ::prost::alloc::vec::Vec<u32>,
453}
454/// Represents the result of syncing state request.
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct SyncStateResponse {
457    /// Number of the latest block in the chain.
458    #[prost(fixed32, tag = "1")]
459    pub chain_tip: u32,
460    /// Block header of the block with the first note matching the specified criteria.
461    #[prost(message, optional, tag = "2")]
462    pub block_header: ::core::option::Option<super::blockchain::BlockHeader>,
463    /// Data needed to update the partial MMR from `request.block_num + 1` to `response.block_header.block_num`.
464    #[prost(message, optional, tag = "3")]
465    pub mmr_delta: ::core::option::Option<super::primitives::MmrDelta>,
466    /// List of account commitments updated after `request.block_num + 1` but not after `response.block_header.block_num`.
467    #[prost(message, repeated, tag = "5")]
468    pub accounts: ::prost::alloc::vec::Vec<super::account::AccountSummary>,
469    /// List of transactions executed against requested accounts between `request.block_num + 1` and
470    /// `response.block_header.block_num`.
471    #[prost(message, repeated, tag = "6")]
472    pub transactions: ::prost::alloc::vec::Vec<super::transaction::TransactionSummary>,
473    /// List of all notes together with the Merkle paths from `response.block_header.note_root`.
474    #[prost(message, repeated, tag = "7")]
475    pub notes: ::prost::alloc::vec::Vec<super::note::NoteSyncRecord>,
476}
477/// Storage map synchronization request.
478///
479/// Allows requesters to sync storage map values for specific public accounts within a block range,
480/// with support for cursor-based pagination to handle large storage maps.
481#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
482pub struct SyncAccountStorageMapsRequest {
483    /// Block range from which to start synchronizing.
484    ///
485    /// If the `block_to` is specified, this block must be close to the chain tip (i.e., within 30 blocks),
486    /// otherwise an error will be returned.
487    #[prost(message, optional, tag = "1")]
488    pub block_range: ::core::option::Option<BlockRange>,
489    /// Account for which we want to sync storage maps.
490    #[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    /// Pagination information.
496    #[prost(message, optional, tag = "1")]
497    pub pagination_info: ::core::option::Option<PaginationInfo>,
498    /// The list of storage map updates.
499    ///
500    /// Multiple updates can be returned for a single slot index and key combination, and the one
501    /// with a higher `block_num` is expected to be retained by the caller.
502    #[prost(message, repeated, tag = "2")]
503    pub updates: ::prost::alloc::vec::Vec<StorageMapUpdate>,
504}
505/// Represents a single storage map update.
506#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
507pub struct StorageMapUpdate {
508    /// Block number in which the slot was updated.
509    #[prost(fixed32, tag = "1")]
510    pub block_num: u32,
511    /// Storage slot name.
512    #[prost(string, tag = "2")]
513    pub slot_name: ::prost::alloc::string::String,
514    /// The storage map key.
515    #[prost(message, optional, tag = "3")]
516    pub key: ::core::option::Option<super::primitives::Digest>,
517    /// The storage map value.
518    #[prost(message, optional, tag = "4")]
519    pub value: ::core::option::Option<super::primitives::Digest>,
520}
521/// Represents a block range.
522#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
523pub struct BlockRange {
524    /// Block number from which to start (inclusive).
525    #[prost(fixed32, tag = "1")]
526    pub block_from: u32,
527    /// Block number up to which to check (inclusive). If not specified, checks up to the latest block.
528    #[prost(fixed32, optional, tag = "2")]
529    pub block_to: ::core::option::Option<u32>,
530}
531/// Represents pagination information for chunked responses.
532///
533/// Pagination is done using block numbers as the axis, allowing requesters to request
534/// data in chunks by specifying block ranges and continuing from where the previous
535/// response left off.
536///
537/// To request the next chunk, the requester should use `block_num + 1` from the previous response
538/// as the `block_from` for the next request.
539#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
540pub struct PaginationInfo {
541    /// Current chain tip
542    #[prost(fixed32, tag = "1")]
543    pub chain_tip: u32,
544    /// The block number of the last check included in this response.
545    ///
546    /// For chunked responses, this may be less than `request.block_range.block_to`.
547    /// If it is less than request.block_range.block_to, the user is expected to make a subsequent request
548    /// starting from the next block to this one (ie, request.block_range.block_from = block_num + 1).
549    #[prost(fixed32, tag = "2")]
550    pub block_num: u32,
551}
552/// Transactions synchronization request.
553///
554/// Allows requesters to sync transactions for specific accounts within a block range.
555#[derive(Clone, PartialEq, ::prost::Message)]
556pub struct SyncTransactionsRequest {
557    /// Block range from which to start synchronizing.
558    #[prost(message, optional, tag = "1")]
559    pub block_range: ::core::option::Option<BlockRange>,
560    /// Accounts to sync transactions for.
561    #[prost(message, repeated, tag = "2")]
562    pub account_ids: ::prost::alloc::vec::Vec<super::account::AccountId>,
563}
564/// Represents the result of syncing transactions request.
565#[derive(Clone, PartialEq, ::prost::Message)]
566pub struct SyncTransactionsResponse {
567    /// Pagination information.
568    #[prost(message, optional, tag = "1")]
569    pub pagination_info: ::core::option::Option<PaginationInfo>,
570    /// List of transaction records.
571    #[prost(message, repeated, tag = "2")]
572    pub transactions: ::prost::alloc::vec::Vec<TransactionRecord>,
573}
574/// Represents a transaction record.
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct TransactionRecord {
577    /// Block number in which the transaction was included.
578    #[prost(fixed32, tag = "1")]
579    pub block_num: u32,
580    /// A transaction header.
581    #[prost(message, optional, tag = "2")]
582    pub header: ::core::option::Option<super::transaction::TransactionHeader>,
583}
584/// Represents the query parameter limits for RPC endpoints.
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct RpcLimits {
587    /// Maps RPC endpoint names to their parameter limits.
588    /// Key: endpoint name (e.g., "CheckNullifiers", "SyncState")
589    /// Value: map of parameter names to their limit values
590    #[prost(map = "string, message", tag = "1")]
591    pub endpoints: ::std::collections::HashMap<
592        ::prost::alloc::string::String,
593        EndpointLimits,
594    >,
595}
596/// Represents the parameter limits for a single endpoint.
597#[derive(Clone, PartialEq, ::prost::Message)]
598pub struct EndpointLimits {
599    /// Maps parameter names to their limit values.
600    /// Key: parameter name (e.g., "nullifier", "account_id")
601    /// Value: limit value
602    #[prost(map = "string, uint32", tag = "1")]
603    pub parameters: ::std::collections::HashMap<::prost::alloc::string::String, u32>,
604}
605/// Generated client implementations.
606pub 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    /// RPC API for the RPC component
617    #[derive(Debug, Clone)]
618    pub struct ApiClient<T> {
619        inner: tonic::client::Grpc<T>,
620    }
621    impl ApiClient<tonic::transport::Channel> {
622        /// Attempt to create a new client by connecting to a given endpoint.
623        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        /// Compress requests with the given encoding.
667        ///
668        /// This requires the server to support it otherwise it might respond with an
669        /// error.
670        #[must_use]
671        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
672            self.inner = self.inner.send_compressed(encoding);
673            self
674        }
675        /// Enable decompressing responses.
676        #[must_use]
677        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
678            self.inner = self.inner.accept_compressed(encoding);
679            self
680        }
681        /// Limits the maximum size of a decoded message.
682        ///
683        /// Default: `4MB`
684        #[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        /// Limits the maximum size of an encoded message.
690        ///
691        /// Default: `usize::MAX`
692        #[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        /// Returns the status info of the node.
698        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        /// Returns a Sparse Merkle Tree opening proof for each requested nullifier
717        ///
718        /// Each proof demonstrates either:
719        ///
720        /// * **Inclusion**: Nullifier exists in the tree (note was consumed)
721        /// * **Non-inclusion**: Nullifier does not exist (note was not consumed)
722        ///
723        /// The `leaf` field indicates the status:
724        ///
725        /// * `empty_leaf_index`: Non-inclusion proof (nullifier not in tree)
726        /// * `single` or `multiple`: Inclusion proof only if the requested nullifier appears as a key.
727        ///
728        /// Verify proofs against the nullifier tree root in the latest block header.
729        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        /// Returns the latest details of the specified account.
751        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        /// Returns raw block data for the specified block number.
773        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        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
795        /// and current chain length to authenticate the block's inclusion.
796        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        /// Returns a list of notes matching the provided note IDs.
821        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        /// Returns the script for a note by its root.
843        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        /// Submits proven transaction to the Miden network. Returns the node's current block height.
868        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        /// Submits a proven batch of transactions to the Miden network.
895        ///
896        /// The batch may include transactions which were are:
897        ///
898        /// * already in the mempool i.e. previously successfully submitted
899        /// * will be submitted to the mempool in the future
900        /// * won't be submitted to the mempool at all
901        ///
902        /// All transactions in the batch but not in the mempool must build on the current mempool
903        /// state following normal transaction submission rules.
904        ///
905        /// Returns the node's current block height.
906        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        /// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
932        ///
933        /// Note that only 16-bit prefixes are supported at this time.
934        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        /// Returns account vault updates for specified account within a block range.
956        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        /// Returns info which can be used by the client to sync up to the tip of chain for the notes they are interested in.
978        ///
979        /// Client specifies the `note_tags` they are interested in, and the block height from which to search for new for
980        /// matching notes for. The request will then return the next block containing any note matching the provided tags.
981        ///
982        /// The response includes each note's metadata and inclusion proof.
983        ///
984        /// A basic note sync can be implemented by repeatedly requesting the previous response's block until reaching the
985        /// tip of the chain.
986        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        /// Returns info which can be used by the client to sync up to the latest state of the chain
1008        /// for the objects (accounts and notes) the client is interested in.
1009        ///
1010        /// This request returns the next block containing requested data. It also returns `chain_tip`
1011        /// which is the latest block number in the chain. Client is expected to repeat these requests
1012        /// in a loop until `response.block_header.block_num == response.chain_tip`, at which point
1013        /// the client is fully synchronized with the chain.
1014        ///
1015        /// Each update response also contains info about new notes, accounts etc. created. It also returns
1016        /// Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain
1017        /// MMR peaks and chain MMR nodes.
1018        ///
1019        /// For preserving some degree of privacy, note tags contain only high
1020        /// part of hashes. Thus, returned data contains excessive notes, client can make
1021        /// additional filtering of that data on its side.
1022        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        /// Returns storage map updates for specified account and storage slots within a block range.
1044        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        /// Returns transactions records for specific accounts within a block range.
1069        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        /// Returns the query parameter limits configured for RPC methods.
1091        ///
1092        /// These define the maximum number of each parameter a method will accept.
1093        /// Exceeding the limit will result in the request being rejected and you should instead send
1094        /// multiple smaller requests.
1095        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}
1115/// Generated server implementations.
1116pub 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    /// Generated trait containing gRPC methods that should be implemented for use with ApiServer.
1126    #[async_trait]
1127    pub trait Api: std::marker::Send + std::marker::Sync + 'static {
1128        /// Returns the status info of the node.
1129        async fn status(
1130            &self,
1131            request: tonic::Request<()>,
1132        ) -> std::result::Result<tonic::Response<super::RpcStatus>, tonic::Status>;
1133        /// Returns a Sparse Merkle Tree opening proof for each requested nullifier
1134        ///
1135        /// Each proof demonstrates either:
1136        ///
1137        /// * **Inclusion**: Nullifier exists in the tree (note was consumed)
1138        /// * **Non-inclusion**: Nullifier does not exist (note was not consumed)
1139        ///
1140        /// The `leaf` field indicates the status:
1141        ///
1142        /// * `empty_leaf_index`: Non-inclusion proof (nullifier not in tree)
1143        /// * `single` or `multiple`: Inclusion proof only if the requested nullifier appears as a key.
1144        ///
1145        /// Verify proofs against the nullifier tree root in the latest block header.
1146        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        /// Returns the latest details of the specified account.
1154        async fn get_account(
1155            &self,
1156            request: tonic::Request<super::AccountRequest>,
1157        ) -> std::result::Result<tonic::Response<super::AccountResponse>, tonic::Status>;
1158        /// Returns raw block data for the specified block number.
1159        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        /// Retrieves block header by given block number. Optionally, it also returns the MMR path
1167        /// and current chain length to authenticate the block's inclusion.
1168        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        /// Returns a list of notes matching the provided note IDs.
1176        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        /// Returns the script for a note by its root.
1184        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        /// Submits proven transaction to the Miden network. Returns the node's current block height.
1189        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        /// Submits a proven batch of transactions to the Miden network.
1197        ///
1198        /// The batch may include transactions which were are:
1199        ///
1200        /// * already in the mempool i.e. previously successfully submitted
1201        /// * will be submitted to the mempool in the future
1202        /// * won't be submitted to the mempool at all
1203        ///
1204        /// All transactions in the batch but not in the mempool must build on the current mempool
1205        /// state following normal transaction submission rules.
1206        ///
1207        /// Returns the node's current block height.
1208        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        /// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
1216        ///
1217        /// Note that only 16-bit prefixes are supported at this time.
1218        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        /// Returns account vault updates for specified account within a block range.
1226        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        /// Returns info which can be used by the client to sync up to the tip of chain for the notes they are interested in.
1234        ///
1235        /// Client specifies the `note_tags` they are interested in, and the block height from which to search for new for
1236        /// matching notes for. The request will then return the next block containing any note matching the provided tags.
1237        ///
1238        /// The response includes each note's metadata and inclusion proof.
1239        ///
1240        /// A basic note sync can be implemented by repeatedly requesting the previous response's block until reaching the
1241        /// tip of the chain.
1242        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        /// Returns info which can be used by the client to sync up to the latest state of the chain
1250        /// for the objects (accounts and notes) the client is interested in.
1251        ///
1252        /// This request returns the next block containing requested data. It also returns `chain_tip`
1253        /// which is the latest block number in the chain. Client is expected to repeat these requests
1254        /// in a loop until `response.block_header.block_num == response.chain_tip`, at which point
1255        /// the client is fully synchronized with the chain.
1256        ///
1257        /// Each update response also contains info about new notes, accounts etc. created. It also returns
1258        /// Chain MMR delta that can be used to update the state of Chain MMR. This includes both chain
1259        /// MMR peaks and chain MMR nodes.
1260        ///
1261        /// For preserving some degree of privacy, note tags contain only high
1262        /// part of hashes. Thus, returned data contains excessive notes, client can make
1263        /// additional filtering of that data on its side.
1264        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        /// Returns storage map updates for specified account and storage slots within a block range.
1272        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        /// Returns transactions records for specific accounts within a block range.
1280        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        /// Returns the query parameter limits configured for RPC methods.
1288        ///
1289        /// These define the maximum number of each parameter a method will accept.
1290        /// Exceeding the limit will result in the request being rejected and you should instead send
1291        /// multiple smaller requests.
1292        async fn get_limits(
1293            &self,
1294            request: tonic::Request<()>,
1295        ) -> std::result::Result<tonic::Response<super::RpcLimits>, tonic::Status>;
1296    }
1297    /// RPC API for the RPC component
1298    #[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        /// Enable decompressing requests with the given encoding.
1329        #[must_use]
1330        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1331            self.accept_compression_encodings.enable(encoding);
1332            self
1333        }
1334        /// Compress responses with the given encoding, if the client supports it.
1335        #[must_use]
1336        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1337            self.send_compression_encodings.enable(encoding);
1338            self
1339        }
1340        /// Limits the maximum size of a decoded message.
1341        ///
1342        /// Default: `4MB`
1343        #[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        /// Limits the maximum size of an encoded message.
1349        ///
1350        /// Default: `usize::MAX`
1351        #[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    /// Generated gRPC service name
2118    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}