Skip to main content

miden_client/rpc/generated/std/
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}