Skip to main content

sui_rpc/proto/generated/
sui.rpc.v2.rs

1// This file is @generated by prost-build.
2/// An argument to a programmable transaction command.
3#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6    #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7    pub kind: ::core::option::Option<i32>,
8    /// Index of an input when `kind` is `INPUT`.
9    #[prost(uint32, optional, tag = "2")]
10    pub input: ::core::option::Option<u32>,
11    /// Index of a result when `kind` is `RESULT`.
12    #[prost(uint32, optional, tag = "3")]
13    pub result: ::core::option::Option<u32>,
14    /// Used to access a nested result when `kind` is `RESULT`.
15    #[prost(uint32, optional, tag = "4")]
16    pub subresult: ::core::option::Option<u32>,
17}
18/// Nested message and enum types in `Argument`.
19pub mod argument {
20    #[non_exhaustive]
21    #[derive(
22        Clone,
23        Copy,
24        Debug,
25        PartialEq,
26        Eq,
27        Hash,
28        PartialOrd,
29        Ord,
30        ::prost::Enumeration
31    )]
32    #[repr(i32)]
33    pub enum ArgumentKind {
34        Unknown = 0,
35        /// The gas coin.
36        Gas = 1,
37        /// One of the input objects or primitive values (from
38        /// `ProgrammableTransaction` inputs).
39        Input = 2,
40        /// The result of another command (from `ProgrammableTransaction` commands).
41        Result = 3,
42    }
43    impl ArgumentKind {
44        /// String value of the enum field names used in the ProtoBuf definition.
45        ///
46        /// The values are not transformed in any way and thus are considered stable
47        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48        pub fn as_str_name(&self) -> &'static str {
49            match self {
50                Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51                Self::Gas => "GAS",
52                Self::Input => "INPUT",
53                Self::Result => "RESULT",
54            }
55        }
56        /// Creates an enum from field names used in the ProtoBuf definition.
57        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58            match value {
59                "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60                "GAS" => Some(Self::Gas),
61                "INPUT" => Some(Self::Input),
62                "RESULT" => Some(Self::Result),
63                _ => None,
64            }
65        }
66    }
67}
68/// The delta, or change, in balance for an address for a particular `Coin` type.
69#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72    /// The account address that is affected by this balance change event.
73    #[prost(string, optional, tag = "1")]
74    pub address: ::core::option::Option<::prost::alloc::string::String>,
75    /// The `Coin` type of this balance change event.
76    #[prost(string, optional, tag = "2")]
77    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78    /// The amount or change in balance.
79    #[prost(string, optional, tag = "3")]
80    pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82/// `Bcs` contains an arbitrary type that is serialized using the
83/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
84/// format as well as a name that identifies the type of the serialized value.
85#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88    /// Name that identifies the type of the serialized value.
89    #[prost(string, optional, tag = "1")]
90    pub name: ::core::option::Option<::prost::alloc::string::String>,
91    /// Bytes of a BCS serialized value.
92    #[prost(bytes = "bytes", optional, tag = "2")]
93    pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98    /// The height of this checkpoint.
99    #[prost(uint64, optional, tag = "1")]
100    pub sequence_number: ::core::option::Option<u64>,
101    /// The digest of this Checkpoint's CheckpointSummary.
102    #[prost(string, optional, tag = "2")]
103    pub digest: ::core::option::Option<::prost::alloc::string::String>,
104    /// The `CheckpointSummary` for this checkpoint.
105    #[prost(message, optional, tag = "3")]
106    pub summary: ::core::option::Option<CheckpointSummary>,
107    /// An aggregated quorum signature from the validator committee that
108    /// certified this checkpoint.
109    #[prost(message, optional, tag = "4")]
110    pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111    /// The `CheckpointContents` for this checkpoint.
112    #[prost(message, optional, tag = "5")]
113    pub contents: ::core::option::Option<CheckpointContents>,
114    /// List of transactions included in this checkpoint.
115    #[prost(message, repeated, tag = "6")]
116    pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117    /// Set of objects either referenced as inputs or produced as
118    /// outputs by transactions included in this checkpoint.
119    ///
120    /// In order to benefit from deduplication of objects that
121    /// appear in multiple transactions in this checkpoint, objects
122    /// will only be present here and the `transactions.objects`
123    /// field will not be populated.
124    #[prost(message, optional, tag = "7")]
125    pub objects: ::core::option::Option<ObjectSet>,
126}
127/// The committed to contents of a checkpoint.
128#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131    /// This CheckpointContents serialized as BCS.
132    #[prost(message, optional, tag = "1")]
133    pub bcs: ::core::option::Option<Bcs>,
134    /// The digest of this CheckpointContents.
135    #[prost(string, optional, tag = "2")]
136    pub digest: ::core::option::Option<::prost::alloc::string::String>,
137    /// Version of this CheckpointContents
138    #[prost(int32, optional, tag = "3")]
139    pub version: ::core::option::Option<i32>,
140    /// Set of transactions committed to in this checkpoint.
141    #[prost(message, repeated, tag = "4")]
142    pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144/// Transaction information committed to in a checkpoint.
145#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148    /// Digest of the transaction.
149    #[prost(string, optional, tag = "1")]
150    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151    /// Digest of the effects.
152    #[prost(string, optional, tag = "2")]
153    pub effects: ::core::option::Option<::prost::alloc::string::String>,
154    /// Set of user signatures that authorized the transaction.
155    #[prost(message, repeated, tag = "3")]
156    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157    /// The `AddressAliases` object version, if any, that was used to verify the
158    /// UserSignature at the same position in `signatures`.
159    ///
160    /// This field is present when CheckpointContents.version is >= 2.
161    #[prost(message, repeated, tag = "4")]
162    pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167    #[prost(uint64, optional, tag = "1")]
168    pub version: ::core::option::Option<u64>,
169}
170/// A header for a checkpoint on the Sui blockchain.
171///
172/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
173/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
174/// however, forms checkpoints after transaction execution has already happened to provide a
175/// certified history of the chain, instead of being formed before execution.
176///
177/// Checkpoints commit to a variety of state, including but not limited to:
178///
179/// * The hash of the previous checkpoint.
180/// * The set of transaction digests, their corresponding effects digests, as well as the set of
181///   user signatures that authorized its execution.
182/// * The objects produced by a transaction.
183/// * The set of live objects that make up the current state of the chain.
184/// * On epoch transitions, the next validator committee.
185///
186/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
187/// are the top-level type by which all the information is committed to transitively via cryptographic
188/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
189/// the validator committee in a given epoch to allow verification of the chain's state.
190#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193    /// This CheckpointSummary serialized as BCS.
194    #[prost(message, optional, tag = "1")]
195    pub bcs: ::core::option::Option<Bcs>,
196    /// The digest of this CheckpointSummary.
197    #[prost(string, optional, tag = "2")]
198    pub digest: ::core::option::Option<::prost::alloc::string::String>,
199    /// Epoch that this checkpoint belongs to.
200    #[prost(uint64, optional, tag = "3")]
201    pub epoch: ::core::option::Option<u64>,
202    /// The height of this checkpoint.
203    #[prost(uint64, optional, tag = "4")]
204    pub sequence_number: ::core::option::Option<u64>,
205    /// Total number of transactions committed since genesis, including those in this
206    /// checkpoint.
207    #[prost(uint64, optional, tag = "5")]
208    pub total_network_transactions: ::core::option::Option<u64>,
209    /// The hash of the `CheckpointContents` for this checkpoint.
210    #[prost(string, optional, tag = "6")]
211    pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212    /// The hash of the previous `CheckpointSummary`.
213    ///
214    /// This will be `None` only for the first, or genesis, checkpoint.
215    #[prost(string, optional, tag = "7")]
216    pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217    /// The running total gas costs of all transactions included in the current epoch so far
218    /// until this checkpoint.
219    #[prost(message, optional, tag = "8")]
220    pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221    /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
222    /// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
223    /// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
224    #[prost(message, optional, tag = "9")]
225    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226    /// Commitments to checkpoint-specific state.
227    #[prost(message, repeated, tag = "10")]
228    pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229    /// Extra data only present in the final checkpoint of an epoch.
230    #[prost(message, optional, tag = "11")]
231    pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232    /// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
233    /// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
234    /// opaque data can be added to checkpoints, which can be deserialized based on the current
235    /// protocol version.
236    #[prost(bytes = "bytes", optional, tag = "12")]
237    pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
240#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243    /// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
244    #[prost(message, repeated, tag = "1")]
245    pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246    /// The protocol version that is in effect during the next epoch.
247    #[prost(uint64, optional, tag = "2")]
248    pub next_epoch_protocol_version: ::core::option::Option<u64>,
249    /// Commitments to epoch specific state (live object set)
250    #[prost(message, repeated, tag = "3")]
251    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253/// A commitment made by a checkpoint.
254#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257    #[prost(
258        enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259        optional,
260        tag = "1"
261    )]
262    pub kind: ::core::option::Option<i32>,
263    #[prost(string, optional, tag = "2")]
264    pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266/// Nested message and enum types in `CheckpointCommitment`.
267pub mod checkpoint_commitment {
268    #[non_exhaustive]
269    #[derive(
270        Clone,
271        Copy,
272        Debug,
273        PartialEq,
274        Eq,
275        Hash,
276        PartialOrd,
277        Ord,
278        ::prost::Enumeration
279    )]
280    #[repr(i32)]
281    pub enum CheckpointCommitmentKind {
282        Unknown = 0,
283        /// An elliptic curve multiset hash attesting to the set of objects that
284        /// comprise the live state of the Sui blockchain.
285        EcmhLiveObjectSet = 1,
286        /// Digest of the checkpoint artifacts.
287        CheckpointArtifacts = 2,
288    }
289    impl CheckpointCommitmentKind {
290        /// String value of the enum field names used in the ProtoBuf definition.
291        ///
292        /// The values are not transformed in any way and thus are considered stable
293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
294        pub fn as_str_name(&self) -> &'static str {
295            match self {
296                Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297                Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298                Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299            }
300        }
301        /// Creates an enum from field names used in the ProtoBuf definition.
302        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303            match value {
304                "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305                "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306                "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307                _ => None,
308            }
309        }
310    }
311}
312/// The effects of executing a transaction.
313#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316    /// This TransactionEffects serialized as BCS.
317    #[prost(message, optional, tag = "1")]
318    pub bcs: ::core::option::Option<Bcs>,
319    /// The digest of this TransactionEffects.
320    #[prost(string, optional, tag = "2")]
321    pub digest: ::core::option::Option<::prost::alloc::string::String>,
322    /// Version of this TransactionEffects.
323    #[prost(int32, optional, tag = "3")]
324    pub version: ::core::option::Option<i32>,
325    /// The status of the execution.
326    #[prost(message, optional, tag = "4")]
327    pub status: ::core::option::Option<ExecutionStatus>,
328    /// The epoch when this transaction was executed.
329    #[prost(uint64, optional, tag = "5")]
330    pub epoch: ::core::option::Option<u64>,
331    /// The gas used by this transaction.
332    #[prost(message, optional, tag = "6")]
333    pub gas_used: ::core::option::Option<GasCostSummary>,
334    /// The transaction digest.
335    #[prost(string, optional, tag = "7")]
336    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337    /// Information about the gas object. Also present in the `changed_objects` vector.
338    ///
339    /// System transactions that don't require gas will leave this as `None`.
340    #[prost(message, optional, tag = "8")]
341    pub gas_object: ::core::option::Option<ChangedObject>,
342    /// The digest of the events emitted during execution,
343    /// can be `None` if the transaction does not emit any event.
344    #[prost(string, optional, tag = "9")]
345    pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346    /// The set of transaction digests this transaction depends on.
347    #[prost(string, repeated, tag = "10")]
348    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349    /// The version number of all the written objects (excluding packages) by this transaction.
350    #[prost(uint64, optional, tag = "11")]
351    pub lamport_version: ::core::option::Option<u64>,
352    /// Objects whose state are changed by this transaction.
353    #[prost(message, repeated, tag = "12")]
354    pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355    /// Consensus objects that are not mutated in this transaction. Unlike owned objects,
356    /// read-only consensus objects' version are not committed in the transaction,
357    /// and in order for a node to catch up and execute it without consensus sequencing,
358    /// the version needs to be committed in the effects.
359    #[prost(message, repeated, tag = "13")]
360    pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361    /// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
362    /// Storing it separately allows us to avoid bloating the effects with data that are not critical.
363    /// It also provides more flexibility on the format and type of the data.
364    #[prost(string, optional, tag = "14")]
365    pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366    #[prost(message, repeated, tag = "15")]
367    pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369/// Input/output state of an object that was changed during execution.
370#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373    /// ID of the object.
374    #[prost(string, optional, tag = "1")]
375    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376    #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377    pub input_state: ::core::option::Option<i32>,
378    /// Version of the object before this transaction executed.
379    #[prost(uint64, optional, tag = "3")]
380    pub input_version: ::core::option::Option<u64>,
381    /// Digest of the object before this transaction executed.
382    #[prost(string, optional, tag = "4")]
383    pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384    /// Owner of the object before this transaction executed.
385    #[prost(message, optional, tag = "5")]
386    pub input_owner: ::core::option::Option<Owner>,
387    #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388    pub output_state: ::core::option::Option<i32>,
389    /// Version of the object after this transaction executed.
390    #[prost(uint64, optional, tag = "7")]
391    pub output_version: ::core::option::Option<u64>,
392    /// Digest of the object after this transaction executed.
393    #[prost(string, optional, tag = "8")]
394    pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395    /// Owner of the object after this transaction executed.
396    #[prost(message, optional, tag = "9")]
397    pub output_owner: ::core::option::Option<Owner>,
398    /// The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
399    #[prost(message, optional, tag = "12")]
400    pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401    /// What happened to an `ObjectId` during execution.
402    #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403    pub id_operation: ::core::option::Option<i32>,
404    /// Type information is not provided by the effects structure but is instead
405    /// provided by an indexing layer
406    #[prost(string, optional, tag = "11")]
407    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409/// Nested message and enum types in `ChangedObject`.
410pub mod changed_object {
411    #[non_exhaustive]
412    #[derive(
413        Clone,
414        Copy,
415        Debug,
416        PartialEq,
417        Eq,
418        Hash,
419        PartialOrd,
420        Ord,
421        ::prost::Enumeration
422    )]
423    #[repr(i32)]
424    pub enum InputObjectState {
425        Unknown = 0,
426        DoesNotExist = 1,
427        Exists = 2,
428    }
429    impl InputObjectState {
430        /// String value of the enum field names used in the ProtoBuf definition.
431        ///
432        /// The values are not transformed in any way and thus are considered stable
433        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434        pub fn as_str_name(&self) -> &'static str {
435            match self {
436                Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437                Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438                Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439            }
440        }
441        /// Creates an enum from field names used in the ProtoBuf definition.
442        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443            match value {
444                "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445                "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446                "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447                _ => None,
448            }
449        }
450    }
451    #[non_exhaustive]
452    #[derive(
453        Clone,
454        Copy,
455        Debug,
456        PartialEq,
457        Eq,
458        Hash,
459        PartialOrd,
460        Ord,
461        ::prost::Enumeration
462    )]
463    #[repr(i32)]
464    pub enum OutputObjectState {
465        Unknown = 0,
466        DoesNotExist = 1,
467        ObjectWrite = 2,
468        PackageWrite = 3,
469        AccumulatorWrite = 4,
470    }
471    impl OutputObjectState {
472        /// String value of the enum field names used in the ProtoBuf definition.
473        ///
474        /// The values are not transformed in any way and thus are considered stable
475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
476        pub fn as_str_name(&self) -> &'static str {
477            match self {
478                Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479                Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480                Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481                Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482                Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489                "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490                "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491                "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492                "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493                _ => None,
494            }
495        }
496    }
497    #[non_exhaustive]
498    #[derive(
499        Clone,
500        Copy,
501        Debug,
502        PartialEq,
503        Eq,
504        Hash,
505        PartialOrd,
506        Ord,
507        ::prost::Enumeration
508    )]
509    #[repr(i32)]
510    pub enum IdOperation {
511        Unknown = 0,
512        None = 1,
513        Created = 2,
514        Deleted = 3,
515    }
516    impl IdOperation {
517        /// String value of the enum field names used in the ProtoBuf definition.
518        ///
519        /// The values are not transformed in any way and thus are considered stable
520        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521        pub fn as_str_name(&self) -> &'static str {
522            match self {
523                Self::Unknown => "ID_OPERATION_UNKNOWN",
524                Self::None => "NONE",
525                Self::Created => "CREATED",
526                Self::Deleted => "DELETED",
527            }
528        }
529        /// Creates an enum from field names used in the ProtoBuf definition.
530        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531            match value {
532                "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533                "NONE" => Some(Self::None),
534                "CREATED" => Some(Self::Created),
535                "DELETED" => Some(Self::Deleted),
536                _ => None,
537            }
538        }
539    }
540}
541/// An entry in an event digest accumulator value.
542#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545    /// Index of the event within its transaction.
546    #[prost(uint64, optional, tag = "1")]
547    pub event_index: ::core::option::Option<u64>,
548    /// Digest of the event.
549    #[prost(string, optional, tag = "2")]
550    pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555    #[prost(string, optional, tag = "1")]
556    pub address: ::core::option::Option<::prost::alloc::string::String>,
557    #[prost(string, optional, tag = "2")]
558    pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559    #[prost(
560        enumeration = "accumulator_write::AccumulatorOperation",
561        optional,
562        tag = "3"
563    )]
564    pub operation: ::core::option::Option<i32>,
565    #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566    pub value_kind: ::core::option::Option<i32>,
567    /// Set when the accumulator value is an integer (value_kind = INTEGER).
568    #[prost(uint64, optional, tag = "5")]
569    pub integer_value: ::core::option::Option<u64>,
570    /// Set, with len 2, when the accumulator value is an integer tuple
571    /// (value_kind = INTEGER_TUPLE).
572    #[prost(uint64, repeated, tag = "6")]
573    pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574    /// Set when the accumulator value is an event digest list (value_kind = EVENT_DIGEST).
575    /// Contains a non-empty list of (event_index, digest) pairs representing
576    /// authenticated event stream entries within a transaction.
577    #[prost(message, repeated, tag = "7")]
578    pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580/// Nested message and enum types in `AccumulatorWrite`.
581pub mod accumulator_write {
582    #[non_exhaustive]
583    #[derive(
584        Clone,
585        Copy,
586        Debug,
587        PartialEq,
588        Eq,
589        Hash,
590        PartialOrd,
591        Ord,
592        ::prost::Enumeration
593    )]
594    #[repr(i32)]
595    pub enum AccumulatorOperation {
596        Unknown = 0,
597        Merge = 1,
598        Split = 2,
599    }
600    impl AccumulatorOperation {
601        /// String value of the enum field names used in the ProtoBuf definition.
602        ///
603        /// The values are not transformed in any way and thus are considered stable
604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605        pub fn as_str_name(&self) -> &'static str {
606            match self {
607                Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608                Self::Merge => "MERGE",
609                Self::Split => "SPLIT",
610            }
611        }
612        /// Creates an enum from field names used in the ProtoBuf definition.
613        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614            match value {
615                "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616                "MERGE" => Some(Self::Merge),
617                "SPLIT" => Some(Self::Split),
618                _ => None,
619            }
620        }
621    }
622    #[non_exhaustive]
623    #[derive(
624        Clone,
625        Copy,
626        Debug,
627        PartialEq,
628        Eq,
629        Hash,
630        PartialOrd,
631        Ord,
632        ::prost::Enumeration
633    )]
634    #[repr(i32)]
635    pub enum AccumulatorValue {
636        Unknown = 0,
637        Integer = 1,
638        IntegerTuple = 2,
639        EventDigest = 3,
640    }
641    impl AccumulatorValue {
642        /// String value of the enum field names used in the ProtoBuf definition.
643        ///
644        /// The values are not transformed in any way and thus are considered stable
645        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
646        pub fn as_str_name(&self) -> &'static str {
647            match self {
648                Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649                Self::Integer => "INTEGER",
650                Self::IntegerTuple => "INTEGER_TUPLE",
651                Self::EventDigest => "EVENT_DIGEST",
652            }
653        }
654        /// Creates an enum from field names used in the ProtoBuf definition.
655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656            match value {
657                "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658                "INTEGER" => Some(Self::Integer),
659                "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660                "EVENT_DIGEST" => Some(Self::EventDigest),
661                _ => None,
662            }
663        }
664    }
665}
666/// A consensus object that wasn't changed during execution.
667#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670    #[prost(
671        enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672        optional,
673        tag = "1"
674    )]
675    pub kind: ::core::option::Option<i32>,
676    /// ObjectId of the consensus object.
677    #[prost(string, optional, tag = "2")]
678    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679    /// Version of the consensus object.
680    #[prost(uint64, optional, tag = "3")]
681    pub version: ::core::option::Option<u64>,
682    /// Digest of the consensus object.
683    #[prost(string, optional, tag = "4")]
684    pub digest: ::core::option::Option<::prost::alloc::string::String>,
685    /// Type information is not provided by the effects structure but is instead
686    /// provided by an indexing layer
687    #[prost(string, optional, tag = "5")]
688    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690/// Nested message and enum types in `UnchangedConsensusObject`.
691pub mod unchanged_consensus_object {
692    #[non_exhaustive]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum UnchangedConsensusObjectKind {
706        Unknown = 0,
707        /// Read-only consensus object from the input.
708        ReadOnlyRoot = 1,
709        /// Objects with ended consensus streams that appear mutably/owned in the input.
710        MutateConsensusStreamEnded = 2,
711        /// Objects with ended consensus streams objects that appear as read-only in the input.
712        ReadConsensusStreamEnded = 3,
713        /// Consensus objects that were congested and resulted in this transaction being
714        /// canceled.
715        Canceled = 4,
716        /// Read of a per-epoch config object that should remain the same during an
717        /// epoch. This optionally will indicate the sequence number of the config
718        /// object at the start of the epoch.
719        PerEpochConfig = 5,
720    }
721    impl UnchangedConsensusObjectKind {
722        /// String value of the enum field names used in the ProtoBuf definition.
723        ///
724        /// The values are not transformed in any way and thus are considered stable
725        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
726        pub fn as_str_name(&self) -> &'static str {
727            match self {
728                Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729                Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730                Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731                Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732                Self::Canceled => "CANCELED",
733                Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734            }
735        }
736        /// Creates an enum from field names used in the ProtoBuf definition.
737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738            match value {
739                "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740                "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741                "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742                "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743                "CANCELED" => Some(Self::Canceled),
744                "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745                _ => None,
746            }
747        }
748    }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753    #[prost(uint64, optional, tag = "1")]
754    pub epoch: ::core::option::Option<u64>,
755    /// The committee governing this epoch.
756    #[prost(message, optional, tag = "2")]
757    pub committee: ::core::option::Option<ValidatorCommittee>,
758    /// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
759    /// beginning of the epoch, except for the current epoch (see
760    /// `GetEpochRequest.epoch`). For the current epoch, fullnodes return their
761    /// live state; kv-rpc returns the state at the highest checkpoint it has
762    /// indexed, or at the checkpoint before it when that is the epoch's last
763    /// checkpoint, even though `last_checkpoint` is then set. kv-rpc instances
764    /// that are not set up for reads at a checkpoint fail with `UNIMPLEMENTED`
765    /// and reason `NOT_SERVED_HERE` when `read_mask` selects it for the current
766    /// epoch.
767    ///
768    /// The state at an epoch's start, including the running epoch's, can be read
769    /// with `GetObject` of `0x5` at `at_checkpoint` = `first_checkpoint` - 1
770    /// (checkpoint 0 for epoch 0), and then its inner dynamic field at the same
771    /// checkpoint.
772    #[prost(message, optional, boxed, tag = "3")]
773    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
774    /// The epoch's first checkpoint. For the running epoch, servers without RPC
775    /// indexes leave it unset, and fullnodes leave it unset until their RPC
776    /// index records the epoch's start, shortly after the epoch begins.
777    #[prost(uint64, optional, tag = "4")]
778    pub first_checkpoint: ::core::option::Option<u64>,
779    /// The epoch's last checkpoint, unset while the epoch is running. Fullnodes
780    /// set it as soon as their RPC index records the epoch's end; kv-rpc sets it
781    /// only when the epoch ended at or before the highest checkpoint it has
782    /// indexed.
783    #[prost(uint64, optional, tag = "5")]
784    pub last_checkpoint: ::core::option::Option<u64>,
785    #[prost(message, optional, tag = "6")]
786    pub start: ::core::option::Option<::prost_types::Timestamp>,
787    #[prost(message, optional, tag = "7")]
788    pub end: ::core::option::Option<::prost_types::Timestamp>,
789    /// Reference gas price denominated in MIST
790    #[prost(uint64, optional, tag = "8")]
791    pub reference_gas_price: ::core::option::Option<u64>,
792    #[prost(message, optional, tag = "9")]
793    pub protocol_config: ::core::option::Option<ProtocolConfig>,
794    /// Sequence number of the first transaction in this epoch (inclusive). Unset
795    /// for the running epoch in the same cases as `first_checkpoint`.
796    #[prost(uint64, optional, tag = "10")]
797    pub transaction_start_inclusive: ::core::option::Option<u64>,
798    /// One past the sequence number of the epoch's last transaction (exclusive):
799    /// the `total_network_transactions` of `last_checkpoint`. Set only when
800    /// `last_checkpoint` is.
801    #[prost(uint64, optional, tag = "11")]
802    pub transaction_end_exclusive: ::core::option::Option<u64>,
803    /// Whether the epoch ended in safe mode: `advance_epoch` failed and
804    /// `advance_epoch_safe_mode` ran instead, so no `SystemEpochInfoEvent` was
805    /// emitted and `system_epoch_info` is unset. Set only when `last_checkpoint`
806    /// is.
807    #[prost(bool, optional, tag = "12")]
808    pub ended_in_safe_mode: ::core::option::Option<bool>,
809    /// Totals from the `0x3::sui_system_state_inner::SystemEpochInfoEvent`
810    /// emitted when this epoch ended. Set only when `last_checkpoint` is, and
811    /// unset if the epoch ended in safe mode.
812    #[prost(message, optional, tag = "13")]
813    pub system_epoch_info: ::core::option::Option<SystemEpochInfo>,
814    /// Commitments to epoch-specific state (the live object set), from the
815    /// `EndOfEpochData` of `last_checkpoint`. Empty while `last_checkpoint` is
816    /// unset, and for epochs that ended before the protocol added epoch
817    /// commitments.
818    #[prost(message, repeated, tag = "14")]
819    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
820}
821/// Totals reported by `SystemEpochInfoEvent` at the end of an epoch. Amounts
822/// are denominated in MIST.
823#[non_exhaustive]
824#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
825pub struct SystemEpochInfo {
826    /// Total stake of the validator set for the next epoch.
827    #[prost(uint64, optional, tag = "1")]
828    pub total_stake: ::core::option::Option<u64>,
829    /// Portion of the epoch's computation rewards reinvested into the storage
830    /// fund.
831    #[prost(uint64, optional, tag = "2")]
832    pub storage_fund_reinvestment: ::core::option::Option<u64>,
833    /// Storage fees charged during the epoch, plus those deferred from any
834    /// preceding epochs that ended in safe mode.
835    #[prost(uint64, optional, tag = "3")]
836    pub storage_charge: ::core::option::Option<u64>,
837    /// Storage rebates paid out during the epoch, plus those deferred from any
838    /// preceding epochs that ended in safe mode.
839    #[prost(uint64, optional, tag = "4")]
840    pub storage_rebate: ::core::option::Option<u64>,
841    /// Balance of the storage fund after the epoch change.
842    #[prost(uint64, optional, tag = "5")]
843    pub storage_fund_balance: ::core::option::Option<u64>,
844    /// Stake subsidy paid out at the end of the epoch.
845    #[prost(uint64, optional, tag = "6")]
846    pub stake_subsidy_amount: ::core::option::Option<u64>,
847    /// Computation gas fees collected during the epoch, plus those deferred from
848    /// any preceding epochs that ended in safe mode.
849    #[prost(uint64, optional, tag = "7")]
850    pub total_gas_fees: ::core::option::Option<u64>,
851    /// Stake rewards distributed to validators and their stakers.
852    #[prost(uint64, optional, tag = "8")]
853    pub total_stake_rewards_distributed: ::core::option::Option<u64>,
854    /// Rewards left over after distribution, added to the storage fund.
855    #[prost(uint64, optional, tag = "9")]
856    pub leftover_storage_fund_inflow: ::core::option::Option<u64>,
857}
858/// Error reasons in the `sui.io` error domain, used as the `reason` of a
859/// `google.rpc.ErrorInfo` or of a `google.rpc.BadRequest.FieldViolation`.
860#[non_exhaustive]
861#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
862#[repr(i32)]
863pub enum ErrorReason {
864    Unknown = 0,
865    FieldInvalid = 1,
866    FieldMissing = 2,
867    /// Gas selection could not find enough SUI to cover the gas budget.
868    /// `SimulateTransaction` returns this with `INVALID_ARGUMENT`. Gas selection
869    /// runs only when `do_gas_selection` is set, `checks` is not `DISABLED`, and
870    /// the transaction has no gas payment objects. When the server estimates the
871    /// budget and the transaction fails in that estimation, `SimulateTransaction`
872    /// returns `TRANSACTION_EXECUTION_FAILED` instead of this error, so with an
873    /// estimated budget this reason means the transaction executed successfully
874    /// in simulation.
875    ///
876    /// Example of an ErrorInfo when the gas owner holds a single 2246360 MIST
877    /// coin, has no address balance, and the transaction needs a budget of
878    /// 8924024 MIST:
879    ///
880    /// ```text
881    /// { "reason": "INSUFFICIENT_GAS_BALANCE",
882    ///    "domain": "sui.io",
883    ///    "metadata": {
884    ///      "owner": "0x0000000000000000000000000000000000000000000000000000000000000123",
885    ///      "requiredBudget": "8924024",
886    ///      "coinBalance": "2246360",
887    ///      "addressBalance": "0"
888    ///    }
889    /// }
890    /// ```
891    ///
892    /// Metadata, with amounts in MIST as decimal strings:
893    ///
894    /// * `owner`: the gas owner's address, as "0x" followed by 64 hex digits.
895    /// * `requiredBudget`: the gas budget the transaction needs. When the
896    ///   request leaves the budget unset, this is the server's estimate plus the
897    ///   cost of loading every coin counted in `coinBalance` beyond the first;
898    ///   otherwise it is the budget from the request. An estimated
899    ///   `requiredBudget` depends on how many coins the gas owner holds: when
900    ///   the owner already holds coins, sending it a new coin raises
901    ///   `requiredBudget` by up to the cost of loading one more coin. A new coin
902    ///   worth `requiredBudget` covers that increase unless `coinBalance` is
903    ///   less than the cost of loading one coin; a new coin worth only
904    ///   `requiredBudget` minus `coinBalance` can fall short.
905    /// * `coinBalance`: total of the gas owner's `Coin<SUI>` objects considered
906    ///   by gas selection: owned, non-consensus coins not already used as
907    ///   transaction inputs, largest first, up to the protocol's maximum number
908    ///   of gas payment objects.
909    /// * `addressBalance`: the gas owner's SUI address balance remaining after
910    ///   the transaction's own explicit SUI withdrawals from the gas owner; "0"
911    ///   if there is none.
912    ///
913    /// The two balances are reported separately because they combine
914    /// differently. When the transaction uses the gas coin (an `Argument` of kind
915    /// `GAS`), coins and address balance are combined to pay for gas. Otherwise
916    /// they are never combined: the address balance pays for gas only if it
917    /// alone covers the budget before coin-loading costs, which is at most
918    /// `requiredBudget`; if it does not, the coins alone must cover
919    /// `requiredBudget`.
920    InsufficientGasBalance = 3,
921    /// The transaction failed while executing in simulation. `SimulateTransaction`
922    /// returns this with `INVALID_ARGUMENT` when it estimates the budget, the
923    /// transaction fails in that estimation, and gas selection then cannot cover
924    /// the budget. It is returned instead of the `INSUFFICIENT_GAS_BALANCE`
925    /// reason in that case because the transaction fails even with its gas paid
926    /// for, so the gas budget is not what stops it; `kind` says what does. Some
927    /// kinds can still be fixed by adding funds: for example,
928    /// `INSUFFICIENT_FUNDS_FOR_WITHDRAW` means a balance the transaction
929    /// withdraws from holds too little. `INSUFFICIENT_GAS` cannot: the estimation
930    /// runs with the maximum gas budget, so it means the transaction needs more
931    /// gas than any budget allows. A gas owner that can cover the budget instead
932    /// gets a successful response whose `effects.status.error` describes the
933    /// failure.
934    ///
935    /// The status details also carry the `ExecutionError`, in the same form as
936    /// `effects.status.error`.
937    ///
938    /// Example of an ErrorInfo for a Move abort in the first command:
939    ///
940    /// ```text
941    /// { "reason": "TRANSACTION_EXECUTION_FAILED",
942    ///    "domain": "sui.io",
943    ///    "metadata": {
944    ///      "kind": "MOVE_ABORT",
945    ///      "command": "0"
946    ///    }
947    /// }
948    /// ```
949    ///
950    /// Metadata:
951    ///
952    /// * `kind`: the failure's `ExecutionError.ExecutionErrorKind` name.
953    /// * `command`: index of the command that failed, as a decimal string, or
954    ///   "" if no single command failed.
955    TransactionExecutionFailed = 4,
956    /// The request reads ledger data above what this server has indexed. The
957    /// `LedgerService` `ListCheckpoints`, `ListTransactions` and `ListEvents`
958    /// RPCs return this with `OUT_OF_RANGE` for a descending query when its
959    /// `end_checkpoint`, which is exclusive, is above
960    /// `firstUnavailableCheckpoint`; when, with `end_checkpoint` unset, its
961    /// `start_checkpoint` is at or above `firstUnavailableCheckpoint`; or when
962    /// its range reaches the latest indexed checkpoint (`end_checkpoint` unset
963    /// or above `firstUnavailableCheckpoint`) and its `before` or `after` cursor
964    /// names a position this server has not indexed. An ascending query never
965    /// gets this error for its cursors or checkpoint range. Its range ends at
966    /// the latest indexed checkpoint, and when the range reaches it, an `after`
967    /// cursor past it ends an empty response with `LEDGER_TIP` at the position
968    /// that cursor resumes from.
969    ///
970    /// Such a cursor comes from a newer view of the ledger than this server's,
971    /// for example from another replica behind the same load balancer. The data
972    /// is not indexed here yet, so the same request becomes servable once this
973    /// server catches up, and a client may resend it unchanged after a delay. A
974    /// cursor comes from a server that had indexed its position, so a request
975    /// rejected for its cursor (`bound` is "cursor") is servable within the time
976    /// replicas take to catch up with each other. Any other `bound` names a
977    /// checkpoint the caller chose, which the chain may not have reached.
978    ///
979    /// Requests pinned to a checkpoint by `at_checkpoint` return this with
980    /// `OUT_OF_RANGE` when that checkpoint is above the latest indexed
981    /// checkpoint.
982    ///
983    /// `BatchGetObjects` reports it only for the item with that `at_checkpoint`.
984    ///
985    /// `ListPackageVersions` follows these rules for its checkpoint range and
986    /// cursors; see `ListPackageVersionsRequest.options`. When it refuses a
987    /// cursor for the version the cursor names, `requestedCheckpoint` is
988    /// `firstUnavailableCheckpoint`; for a cursor from the listing of every
989    /// package, it is the publish checkpoint the cursor names.
990    ///
991    /// `ListObjectVersions` follows these rules for its checkpoint range and
992    /// cursors; see `ListObjectVersionsRequest`.
993    ///
994    /// Example of an ErrorInfo for a descending query's `before` cursor at
995    /// checkpoint 1205, sent to a server whose latest indexed checkpoint is 1199:
996    ///
997    /// ```text
998    /// { "reason": "ABOVE_LATEST_AVAILABLE",
999    ///    "domain": "sui.io",
1000    ///    "metadata": {
1001    ///      "bound": "cursor",
1002    ///      "requestedCheckpoint": "1205",
1003    ///      "firstUnavailableCheckpoint": "1200"
1004    ///    }
1005    /// }
1006    /// ```
1007    ///
1008    /// Metadata, with checkpoints as decimal strings:
1009    ///
1010    /// * `bound`: what reads above the indexed data: "cursor" for a `before` or
1011    ///   `after` cursor, or the name of the request field, such as
1012    ///   "start_checkpoint", "end_checkpoint" or "at_checkpoint".
1013    /// * `requestedCheckpoint`: the checkpoint recorded in the cursor, or the
1014    ///   value of the request field. For a `ListObjectVersions` cursor refused
1015    ///   by its version, it is `firstUnavailableCheckpoint`; for
1016    ///   `ListObjectVersions` cursors refused by the checkpoints they record, it
1017    ///   is the lowest of those checkpoints.
1018    /// * `firstUnavailableCheckpoint`: the lowest checkpoint this server has not
1019    ///   indexed, one above its latest indexed checkpoint, or "0" if it has
1020    ///   indexed none.
1021    AboveLatestAvailable = 5,
1022    /// The request needs ledger data this server has pruned. The `LedgerService`
1023    /// `ListCheckpoints`, `ListTransactions` and `ListEvents` RPCs return this
1024    /// with `OUT_OF_RANGE` when the start of their scan, set by
1025    /// `start_checkpoint` or an `after` cursor, whichever is later, is below the
1026    /// lowest checkpoint this server serves; when a request with neither has a
1027    /// non-empty checkpoint range that ends at or below that checkpoint, or a
1028    /// `before` cursor at or below it; when a descending query with no lower
1029    /// bound of its own reaches it; or when the server prunes data a query has
1030    /// not read yet. A descending query that reaches the lowest checkpoint fails
1031    /// after it streams every item at or above that checkpoint, and its last
1032    /// response carries a watermark at that checkpoint.
1033    ///
1034    /// `GetCheckpoint`, `GetTransaction` and `BatchGetTransactions` (for each
1035    /// item) return this with `OUT_OF_RANGE` for a checkpoint, or a transaction
1036    /// in a checkpoint, that the server can place below the lowest checkpoint it
1037    /// serves; see their request docs. So do point reads whose request docs say
1038    /// so.
1039    ///
1040    /// Requests pinned to a checkpoint by `at_checkpoint` return this with
1041    /// `OUT_OF_RANGE` when that checkpoint is below the lowest checkpoint this
1042    /// server serves.
1043    ///
1044    /// `BatchGetObjects` reports it only for the item with that `at_checkpoint`.
1045    ///
1046    /// `GetPackage` also returns this with `OUT_OF_RANGE` for a `version` this
1047    /// server has pruned.
1048    ///
1049    /// `ListPackageVersions` also returns this with `OUT_OF_RANGE` on servers
1050    /// that prune history; see `ListPackageVersionsRequest`. Its
1051    /// `lowestAvailableCheckpoint` is the lowest `start_checkpoint` it accepts.
1052    ///
1053    /// `ListObjectVersions` returns this with `OUT_OF_RANGE` on servers that
1054    /// prune history; see `ListObjectVersionsRequest`. Its
1055    /// `lowestAvailableCheckpoint` is the lowest `start_checkpoint` the server
1056    /// accepts.
1057    ///
1058    /// Pruned data does not come back, so the same request fails the same way
1059    /// on this server. A client can send it to a server that retains the data,
1060    /// or resume at or above `lowestAvailableCheckpoint`.
1061    ///
1062    /// Example of an ErrorInfo from a server whose lowest available checkpoint
1063    /// is 5000:
1064    ///
1065    /// ```text
1066    /// { "reason": "BELOW_EARLIEST_AVAILABLE",
1067    ///    "domain": "sui.io",
1068    ///    "metadata": {
1069    ///      "lowestAvailableCheckpoint": "5000"
1070    ///    }
1071    /// }
1072    /// ```
1073    ///
1074    /// Metadata, as decimal strings:
1075    ///
1076    /// * `lowestAvailableCheckpoint`: the lowest checkpoint this server serves.
1077    BelowEarliestAvailable = 6,
1078    /// The object was deleted or wrapped at the version a `GetObject` request, or
1079    /// a `BatchGetObjects` item, resolved to (see `GetObjectRequest`). Reported
1080    /// with `NOT_FOUND`. Best effort: a server that cannot find the removal, for
1081    /// example because it pruned it or keeps no record of removals, answers
1082    /// `NOT_FOUND` without this reason, so its absence does not mean the object
1083    /// never existed. A removal written after the request's `at_checkpoint` is
1084    /// not visible to it. The object can come back at a higher version, by an
1085    /// unwrap or by being created again under the same ID; the error describes
1086    /// only the version the request resolved to. To find the transaction that
1087    /// removed it, call `ListObjectVersions` with `start_version` set to
1088    /// `removedVersion`, `end_version` one above it, and `transaction` in
1089    /// `removal_read_mask`.
1090    ///
1091    /// Example of an ErrorInfo for an object deleted at version 42:
1092    ///
1093    /// ```text
1094    /// { "reason": "OBJECT_REMOVED",
1095    ///    "domain": "sui.io",
1096    ///    "metadata": {
1097    ///      "removedVersion": "42",
1098    ///      "removalKind": "DELETED"
1099    ///    }
1100    /// }
1101    /// ```
1102    ///
1103    /// Metadata:
1104    ///
1105    /// * `removedVersion`: the removal's version, as a decimal string.
1106    /// * `removalKind`: `DELETED` or `WRAPPED`, an `ObjectRemoval.Kind` name.
1107    ObjectRemoved = 7,
1108    /// This server is not set up for the method, or for this kind of request on
1109    /// a method it otherwise serves, for example a read at a checkpoint
1110    /// (`GetObject` with `at_checkpoint`) on a server without RPC indexes.
1111    /// Returned with `UNIMPLEMENTED`. The same request to the same server always
1112    /// fails the same way: do not retry it there, send it to a server configured
1113    /// to serve it. `UNIMPLEMENTED` without this reason comes from a server that
1114    /// lacks the method, predates this reason, or does not attach it.
1115    ///
1116    /// Example of an ErrorInfo from a server without RPC indexes:
1117    ///
1118    /// ```text
1119    /// { "reason": "NOT_SERVED_HERE",
1120    ///    "domain": "sui.io",
1121    ///    "metadata": {
1122    ///      "cause": "no_rpc_indexes"
1123    ///    }
1124    /// }
1125    /// ```
1126    ///
1127    /// Metadata:
1128    ///
1129    /// * `cause`: why this server does not serve the request: "no_rpc_indexes"
1130    ///   (it does not keep the RPC indexes the request needs),
1131    ///   "disabled_by_config" (its configuration turns the method or this kind
1132    ///   of request off) or "uncertified_live_state" (its live state includes
1133    ///   data the network has not certified yet, so it cannot serve the request
1134    ///   at the requested finality level; send `x-sui-finality-level: executed`,
1135    ///   or use a server whose live state is certified). More causes may be
1136    ///   added.
1137    NotServedHere = 8,
1138    /// This server cannot serve the request now but will be able to, for example
1139    /// while it starts or backfills history. Returned with `UNAVAILABLE`. Retry,
1140    /// preferably on another replica.
1141    ///
1142    /// Example of an ErrorInfo from a server backfilling history restored from a
1143    /// snapshot:
1144    ///
1145    /// ```text
1146    /// { "reason": "NOT_READY",
1147    ///    "domain": "sui.io",
1148    ///    "metadata": {
1149    ///      "cause": "restore_backfill"
1150    ///    }
1151    /// }
1152    /// ```
1153    ///
1154    /// Metadata:
1155    ///
1156    /// * `cause`: the temporary state that stops the server, such as
1157    ///   "index_empty" (its index holds no data yet), "restore_backfill" (it is
1158    ///   backfilling history restored from a snapshot) or "history_catching_up"
1159    ///   (its indexes trail its live state). More causes may be added.
1160    NotReady = 9,
1161    /// The request needs an older version of an object that this server no
1162    /// longer holds: the server keeps only the latest version of each object,
1163    /// and a newer version has replaced the one requested. Returned with
1164    /// `OUT_OF_RANGE`, for example by `GetObject` with a `version` below the
1165    /// object's latest version and no `at_checkpoint`.
1166    ///
1167    /// The server has no checkpoint below which data is gone, so the error
1168    /// carries no `lowestAvailableCheckpoint`. The version does not come back,
1169    /// so the same request fails the same way on this server. A server that
1170    /// keeps every version of each object, such as kv-rpc, may serve it.
1171    ///
1172    /// Example of an ErrorInfo for `GetObject` with `version` 5 of an object
1173    /// whose latest version on this server is 8:
1174    ///
1175    /// ```text
1176    /// { "reason": "VERSION_NOT_RETAINED",
1177    ///    "domain": "sui.io"
1178    /// }
1179    /// ```
1180    ///
1181    /// It carries no metadata.
1182    VersionNotRetained = 10,
1183}
1184impl ErrorReason {
1185    /// String value of the enum field names used in the ProtoBuf definition.
1186    ///
1187    /// The values are not transformed in any way and thus are considered stable
1188    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1189    pub fn as_str_name(&self) -> &'static str {
1190        match self {
1191            Self::Unknown => "ERROR_REASON_UNKNOWN",
1192            Self::FieldInvalid => "FIELD_INVALID",
1193            Self::FieldMissing => "FIELD_MISSING",
1194            Self::InsufficientGasBalance => "INSUFFICIENT_GAS_BALANCE",
1195            Self::TransactionExecutionFailed => "TRANSACTION_EXECUTION_FAILED",
1196            Self::AboveLatestAvailable => "ABOVE_LATEST_AVAILABLE",
1197            Self::BelowEarliestAvailable => "BELOW_EARLIEST_AVAILABLE",
1198            Self::ObjectRemoved => "OBJECT_REMOVED",
1199            Self::NotServedHere => "NOT_SERVED_HERE",
1200            Self::NotReady => "NOT_READY",
1201            Self::VersionNotRetained => "VERSION_NOT_RETAINED",
1202        }
1203    }
1204    /// Creates an enum from field names used in the ProtoBuf definition.
1205    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1206        match value {
1207            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
1208            "FIELD_INVALID" => Some(Self::FieldInvalid),
1209            "FIELD_MISSING" => Some(Self::FieldMissing),
1210            "INSUFFICIENT_GAS_BALANCE" => Some(Self::InsufficientGasBalance),
1211            "TRANSACTION_EXECUTION_FAILED" => Some(Self::TransactionExecutionFailed),
1212            "ABOVE_LATEST_AVAILABLE" => Some(Self::AboveLatestAvailable),
1213            "BELOW_EARLIEST_AVAILABLE" => Some(Self::BelowEarliestAvailable),
1214            "OBJECT_REMOVED" => Some(Self::ObjectRemoved),
1215            "NOT_SERVED_HERE" => Some(Self::NotServedHere),
1216            "NOT_READY" => Some(Self::NotReady),
1217            "VERSION_NOT_RETAINED" => Some(Self::VersionNotRetained),
1218            _ => None,
1219        }
1220    }
1221}
1222/// Events emitted during the successful execution of a transaction.
1223#[non_exhaustive]
1224#[derive(Clone, PartialEq, ::prost::Message)]
1225pub struct TransactionEvents {
1226    /// This TransactionEvents serialized as BCS.
1227    #[prost(message, optional, tag = "1")]
1228    pub bcs: ::core::option::Option<Bcs>,
1229    /// The digest of this TransactionEvents.
1230    #[prost(string, optional, tag = "2")]
1231    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1232    /// Set of events emitted by a transaction.
1233    #[prost(message, repeated, tag = "3")]
1234    pub events: ::prost::alloc::vec::Vec<Event>,
1235}
1236/// An event.
1237#[non_exhaustive]
1238#[derive(Clone, PartialEq, ::prost::Message)]
1239pub struct Event {
1240    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
1241    /// event to be emitted.
1242    #[prost(string, optional, tag = "1")]
1243    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1244    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
1245    /// event to be emitted.
1246    #[prost(string, optional, tag = "2")]
1247    pub module: ::core::option::Option<::prost::alloc::string::String>,
1248    /// Address of the account that sent the transaction where this event was emitted.
1249    #[prost(string, optional, tag = "3")]
1250    pub sender: ::core::option::Option<::prost::alloc::string::String>,
1251    /// The type of the event emitted.
1252    #[prost(string, optional, tag = "4")]
1253    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1254    /// BCS serialized bytes of the event.
1255    #[prost(message, optional, tag = "5")]
1256    pub contents: ::core::option::Option<Bcs>,
1257    /// JSON rendering of the event.
1258    #[prost(message, optional, boxed, tag = "6")]
1259    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
1260    /// The sequence number of the checkpoint that includes the transaction
1261    /// that emitted this event. Populated when the event is delivered on its
1262    /// own (for example via `LedgerService.ListEvents`); left unset when the
1263    /// event is carried inside its transaction's `events` list, where the
1264    /// enclosing `ExecutedTransaction` already provides this context.
1265    #[prost(uint64, optional, tag = "7")]
1266    pub checkpoint: ::core::option::Option<u64>,
1267    /// The digest of the transaction that emitted this event.
1268    #[prost(string, optional, tag = "8")]
1269    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
1270    /// Zero-based position of the emitting transaction within its containing
1271    /// checkpoint. For clients verifying authenticated event streams this
1272    /// index is part of the BCS-encoded `EventCommitment` leaf used to
1273    /// construct the per-checkpoint merkle root.
1274    #[prost(uint64, optional, tag = "9")]
1275    pub transaction_index: ::core::option::Option<u64>,
1276    /// Zero-based index of this event within its transaction's event list.
1277    #[prost(uint32, optional, tag = "10")]
1278    pub event_index: ::core::option::Option<u32>,
1279}
1280#[non_exhaustive]
1281#[derive(Clone, PartialEq, ::prost::Message)]
1282pub struct ExecutedTransaction {
1283    /// The digest of this Transaction.
1284    #[prost(string, optional, tag = "1")]
1285    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1286    /// The transaction itself.
1287    #[prost(message, optional, tag = "2")]
1288    pub transaction: ::core::option::Option<Transaction>,
1289    /// List of user signatures that are used to authorize the
1290    /// execution of this transaction.
1291    #[prost(message, repeated, tag = "3")]
1292    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
1293    /// The `TransactionEffects` for this transaction.
1294    #[prost(message, optional, tag = "4")]
1295    pub effects: ::core::option::Option<TransactionEffects>,
1296    /// The `TransactionEvents` for this transaction.
1297    ///
1298    /// This field might be empty, even if it was explicitly requested, if the
1299    /// transaction didn't produce any events.
1300    /// `sui.types.TransactionEffects.events_digest` is populated if the
1301    /// transaction produced any events.
1302    #[prost(message, optional, tag = "5")]
1303    pub events: ::core::option::Option<TransactionEvents>,
1304    /// The sequence number for the checkpoint that includes this transaction.
1305    #[prost(uint64, optional, tag = "6")]
1306    pub checkpoint: ::core::option::Option<u64>,
1307    /// The Unix timestamp of the checkpoint that includes this transaction.
1308    #[prost(message, optional, tag = "7")]
1309    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1310    #[prost(message, repeated, tag = "8")]
1311    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
1312    /// Set of objects either referenced as inputs or produced as
1313    /// outputs from this Transaction.
1314    #[prost(message, optional, tag = "9")]
1315    pub objects: ::core::option::Option<ObjectSet>,
1316    /// Zero-based position of this transaction within the checkpoint that
1317    /// includes it.
1318    #[prost(uint64, optional, tag = "10")]
1319    pub transaction_index: ::core::option::Option<u64>,
1320}
1321/// The status of an executed transaction.
1322#[non_exhaustive]
1323#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1324pub struct ExecutionStatus {
1325    /// Indicates if the transaction was successful or not.
1326    #[prost(bool, optional, tag = "1")]
1327    pub success: ::core::option::Option<bool>,
1328    /// The error if `success` is false.
1329    #[prost(message, optional, tag = "2")]
1330    pub error: ::core::option::Option<ExecutionError>,
1331}
1332/// An error that can occur during the execution of a transaction.
1333#[non_exhaustive]
1334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1335pub struct ExecutionError {
1336    /// A human readable description of the error
1337    #[prost(string, optional, tag = "1")]
1338    pub description: ::core::option::Option<::prost::alloc::string::String>,
1339    /// The command, if any, during which the error occurred.
1340    #[prost(uint64, optional, tag = "2")]
1341    pub command: ::core::option::Option<u64>,
1342    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
1343    pub kind: ::core::option::Option<i32>,
1344    #[prost(
1345        oneof = "execution_error::ErrorDetails",
1346        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
1347    )]
1348    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
1349}
1350/// Nested message and enum types in `ExecutionError`.
1351pub mod execution_error {
1352    #[non_exhaustive]
1353    #[derive(
1354        Clone,
1355        Copy,
1356        Debug,
1357        PartialEq,
1358        Eq,
1359        Hash,
1360        PartialOrd,
1361        Ord,
1362        ::prost::Enumeration
1363    )]
1364    #[repr(i32)]
1365    pub enum ExecutionErrorKind {
1366        Unknown = 0,
1367        /// Insufficient gas.
1368        InsufficientGas = 1,
1369        /// Invalid `Gas` object.
1370        InvalidGasObject = 2,
1371        /// Invariant violation.
1372        InvariantViolation = 3,
1373        /// Attempted to use feature that is not supported yet.
1374        FeatureNotYetSupported = 4,
1375        /// Move object is larger than the maximum allowed size.
1376        ObjectTooBig = 5,
1377        /// Package is larger than the maximum allowed size.
1378        PackageTooBig = 6,
1379        /// Circular object ownership.
1380        CircularObjectOwnership = 7,
1381        /// Insufficient coin balance for requested operation.
1382        InsufficientCoinBalance = 8,
1383        /// Coin balance overflowed an u64.
1384        CoinBalanceOverflow = 9,
1385        /// Publish error, non-zero address.
1386        /// The modules in the package must have their self-addresses set to zero.
1387        PublishErrorNonZeroAddress = 10,
1388        /// Sui Move bytecode verification error.
1389        SuiMoveVerificationError = 11,
1390        /// Error from a non-abort instruction.
1391        /// Possible causes:
1392        /// Arithmetic error, stack overflow, max value depth, or similar.
1393        MovePrimitiveRuntimeError = 12,
1394        /// Move runtime abort.
1395        MoveAbort = 13,
1396        /// Bytecode verification error.
1397        VmVerificationOrDeserializationError = 14,
1398        /// MoveVm invariant violation.
1399        VmInvariantViolation = 15,
1400        /// Function not found.
1401        FunctionNotFound = 16,
1402        /// Parity mismatch for Move function.
1403        /// The number of arguments does not match the number of parameters.
1404        ArityMismatch = 17,
1405        /// Type parity mismatch for Move function.
1406        /// Mismatch between the number of actual versus expected type arguments.
1407        TypeArityMismatch = 18,
1408        /// Non-entry function invoked. Move Call must start with an entry function.
1409        NonEntryFunctionInvoked = 19,
1410        /// Invalid command argument.
1411        CommandArgumentError = 20,
1412        /// Type argument error.
1413        TypeArgumentError = 21,
1414        /// Unused result without the drop ability.
1415        UnusedValueWithoutDrop = 22,
1416        /// Invalid public Move function signature.
1417        /// Unsupported return type for return value.
1418        InvalidPublicFunctionReturnType = 23,
1419        /// Invalid transfer object, object does not have public transfer.
1420        InvalidTransferObject = 24,
1421        /// Effects from the transaction are too large.
1422        EffectsTooLarge = 25,
1423        /// Publish or Upgrade is missing dependency.
1424        PublishUpgradeMissingDependency = 26,
1425        /// Publish or upgrade dependency downgrade.
1426        ///
1427        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
1428        /// on-chain version that is less than the version required by one of the package's
1429        /// transitive dependencies.
1430        PublishUpgradeDependencyDowngrade = 27,
1431        /// Invalid package upgrade.
1432        PackageUpgradeError = 28,
1433        /// Indicates the transaction tried to write objects too large to storage.
1434        WrittenObjectsTooLarge = 29,
1435        /// Certificate is on the deny list.
1436        CertificateDenied = 30,
1437        /// Sui Move bytecode verification timed out.
1438        SuiMoveVerificationTimedout = 31,
1439        /// The requested consensus object operation is not allowed.
1440        ConsensusObjectOperationNotAllowed = 32,
1441        /// Requested consensus object has been deleted.
1442        InputObjectDeleted = 33,
1443        /// Certificate is canceled due to congestion on consensus objects.
1444        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1445        /// Address is denied for this coin type.
1446        AddressDeniedForCoin = 35,
1447        /// Coin type is globally paused for use.
1448        CoinTypeGlobalPause = 36,
1449        /// Certificate is canceled because randomness could not be generated this epoch.
1450        ExecutionCanceledDueToRandomnessUnavailable = 37,
1451        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1452        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1453        /// type of the vector element.
1454        MoveVectorElemTooBig = 38,
1455        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1456        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1457        /// on the type of the value.
1458        MoveRawValueTooBig = 39,
1459        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1460        InvalidLinkage = 40,
1461        /// Insufficient funds for transaction withdrawal
1462        InsufficientFundsForWithdraw = 41,
1463        /// An input object with non-exclusive write mutability was modified
1464        NonExclusiveWriteInputObjectModified = 42,
1465        /// The consensus commit timestamp is after the transaction's max_timestamp.
1466        TransactionExpired = 43,
1467    }
1468    impl ExecutionErrorKind {
1469        /// String value of the enum field names used in the ProtoBuf definition.
1470        ///
1471        /// The values are not transformed in any way and thus are considered stable
1472        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1473        pub fn as_str_name(&self) -> &'static str {
1474            match self {
1475                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1476                Self::InsufficientGas => "INSUFFICIENT_GAS",
1477                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1478                Self::InvariantViolation => "INVARIANT_VIOLATION",
1479                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1480                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1481                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1482                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1483                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1484                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1485                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1486                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1487                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1488                Self::MoveAbort => "MOVE_ABORT",
1489                Self::VmVerificationOrDeserializationError => {
1490                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1491                }
1492                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1493                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1494                Self::ArityMismatch => "ARITY_MISMATCH",
1495                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1496                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1497                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1498                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1499                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1500                Self::InvalidPublicFunctionReturnType => {
1501                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1502                }
1503                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1504                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1505                Self::PublishUpgradeMissingDependency => {
1506                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1507                }
1508                Self::PublishUpgradeDependencyDowngrade => {
1509                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1510                }
1511                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1512                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1513                Self::CertificateDenied => "CERTIFICATE_DENIED",
1514                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1515                Self::ConsensusObjectOperationNotAllowed => {
1516                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1517                }
1518                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1519                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1520                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1521                }
1522                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1523                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1524                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1525                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1526                }
1527                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1528                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1529                Self::InvalidLinkage => "INVALID_LINKAGE",
1530                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1531                Self::NonExclusiveWriteInputObjectModified => {
1532                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1533                }
1534                Self::TransactionExpired => "TRANSACTION_EXPIRED",
1535            }
1536        }
1537        /// Creates an enum from field names used in the ProtoBuf definition.
1538        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1539            match value {
1540                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1541                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1542                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1543                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1544                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1545                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1546                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1547                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1548                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1549                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1550                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1551                    Some(Self::PublishErrorNonZeroAddress)
1552                }
1553                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1554                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1555                "MOVE_ABORT" => Some(Self::MoveAbort),
1556                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1557                    Some(Self::VmVerificationOrDeserializationError)
1558                }
1559                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1560                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1561                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1562                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1563                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1564                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1565                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1566                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1567                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1568                    Some(Self::InvalidPublicFunctionReturnType)
1569                }
1570                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1571                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1572                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1573                    Some(Self::PublishUpgradeMissingDependency)
1574                }
1575                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1576                    Some(Self::PublishUpgradeDependencyDowngrade)
1577                }
1578                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1579                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1580                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1581                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1582                    Some(Self::SuiMoveVerificationTimedout)
1583                }
1584                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1585                    Some(Self::ConsensusObjectOperationNotAllowed)
1586                }
1587                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1588                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1589                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1590                }
1591                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1592                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1593                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1594                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1595                }
1596                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1597                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1598                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1599                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1600                    Some(Self::InsufficientFundsForWithdraw)
1601                }
1602                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1603                    Some(Self::NonExclusiveWriteInputObjectModified)
1604                }
1605                "TRANSACTION_EXPIRED" => Some(Self::TransactionExpired),
1606                _ => None,
1607            }
1608        }
1609    }
1610    #[non_exhaustive]
1611    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1612    pub enum ErrorDetails {
1613        #[prost(message, tag = "4")]
1614        Abort(super::MoveAbort),
1615        #[prost(message, tag = "5")]
1616        SizeError(super::SizeError),
1617        #[prost(message, tag = "6")]
1618        CommandArgumentError(super::CommandArgumentError),
1619        #[prost(message, tag = "7")]
1620        TypeArgumentError(super::TypeArgumentError),
1621        #[prost(message, tag = "8")]
1622        PackageUpgradeError(super::PackageUpgradeError),
1623        #[prost(message, tag = "9")]
1624        IndexError(super::IndexError),
1625        #[prost(string, tag = "10")]
1626        ObjectId(::prost::alloc::string::String),
1627        #[prost(message, tag = "11")]
1628        CoinDenyListError(super::CoinDenyListError),
1629        /// Set of objects that were congested, leading to the transaction's cancellation.
1630        #[prost(message, tag = "12")]
1631        CongestedObjects(super::CongestedObjects),
1632    }
1633}
1634#[non_exhaustive]
1635#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1636pub struct MoveAbort {
1637    #[prost(uint64, optional, tag = "1")]
1638    pub abort_code: ::core::option::Option<u64>,
1639    /// Location in Move where the error occurred.
1640    #[prost(message, optional, tag = "2")]
1641    pub location: ::core::option::Option<MoveLocation>,
1642    /// Extra error information if abort code is a "Clever Error"
1643    #[prost(message, optional, tag = "3")]
1644    pub clever_error: ::core::option::Option<CleverError>,
1645}
1646/// Location in Move bytecode where an error occurred.
1647#[non_exhaustive]
1648#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1649pub struct MoveLocation {
1650    /// The package ID.
1651    #[prost(string, optional, tag = "1")]
1652    pub package: ::core::option::Option<::prost::alloc::string::String>,
1653    /// The module name.
1654    #[prost(string, optional, tag = "2")]
1655    pub module: ::core::option::Option<::prost::alloc::string::String>,
1656    /// The function index.
1657    #[prost(uint32, optional, tag = "3")]
1658    pub function: ::core::option::Option<u32>,
1659    /// Offset of the instruction where the error occurred.
1660    #[prost(uint32, optional, tag = "4")]
1661    pub instruction: ::core::option::Option<u32>,
1662    /// The name of the function, if available.
1663    #[prost(string, optional, tag = "5")]
1664    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1665}
1666#[non_exhaustive]
1667#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1668pub struct CleverError {
1669    #[prost(uint64, optional, tag = "1")]
1670    pub error_code: ::core::option::Option<u64>,
1671    #[prost(uint64, optional, tag = "2")]
1672    pub line_number: ::core::option::Option<u64>,
1673    #[prost(string, optional, tag = "3")]
1674    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1675    #[prost(string, optional, tag = "4")]
1676    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1677    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1678    pub value: ::core::option::Option<clever_error::Value>,
1679}
1680/// Nested message and enum types in `CleverError`.
1681pub mod clever_error {
1682    #[non_exhaustive]
1683    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1684    pub enum Value {
1685        #[prost(string, tag = "5")]
1686        Rendered(::prost::alloc::string::String),
1687        #[prost(bytes, tag = "6")]
1688        Raw(::prost::bytes::Bytes),
1689    }
1690}
1691/// A size error.
1692#[non_exhaustive]
1693#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1694pub struct SizeError {
1695    /// The offending size.
1696    #[prost(uint64, optional, tag = "1")]
1697    pub size: ::core::option::Option<u64>,
1698    /// The maximum allowable size.
1699    #[prost(uint64, optional, tag = "2")]
1700    pub max_size: ::core::option::Option<u64>,
1701}
1702#[non_exhaustive]
1703#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1704pub struct IndexError {
1705    /// Index of an input or result.
1706    #[prost(uint32, optional, tag = "1")]
1707    pub index: ::core::option::Option<u32>,
1708    /// Index of a subresult.
1709    #[prost(uint32, optional, tag = "2")]
1710    pub subresult: ::core::option::Option<u32>,
1711}
1712#[non_exhaustive]
1713#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1714pub struct CoinDenyListError {
1715    /// Denied address.
1716    #[prost(string, optional, tag = "1")]
1717    pub address: ::core::option::Option<::prost::alloc::string::String>,
1718    /// Coin type.
1719    #[prost(string, optional, tag = "2")]
1720    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1721}
1722/// Set of objects that were congested, leading to the transaction's cancellation.
1723#[non_exhaustive]
1724#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1725pub struct CongestedObjects {
1726    #[prost(string, repeated, tag = "1")]
1727    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1728}
1729/// An error with an argument to a command.
1730#[non_exhaustive]
1731#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1732pub struct CommandArgumentError {
1733    /// Position of the problematic argument.
1734    #[prost(uint32, optional, tag = "1")]
1735    pub argument: ::core::option::Option<u32>,
1736    #[prost(
1737        enumeration = "command_argument_error::CommandArgumentErrorKind",
1738        optional,
1739        tag = "2"
1740    )]
1741    pub kind: ::core::option::Option<i32>,
1742    #[prost(message, optional, tag = "3")]
1743    pub index_error: ::core::option::Option<IndexError>,
1744}
1745/// Nested message and enum types in `CommandArgumentError`.
1746pub mod command_argument_error {
1747    #[non_exhaustive]
1748    #[derive(
1749        Clone,
1750        Copy,
1751        Debug,
1752        PartialEq,
1753        Eq,
1754        Hash,
1755        PartialOrd,
1756        Ord,
1757        ::prost::Enumeration
1758    )]
1759    #[repr(i32)]
1760    pub enum CommandArgumentErrorKind {
1761        Unknown = 0,
1762        /// The type of the value does not match the expected type.
1763        TypeMismatch = 1,
1764        /// The argument cannot be deserialized into a value of the specified type.
1765        InvalidBcsBytes = 2,
1766        /// The argument cannot be instantiated from raw bytes.
1767        InvalidUsageOfPureArgument = 3,
1768        /// Invalid argument to private entry function.
1769        /// Private entry functions cannot take arguments from other Move functions.
1770        InvalidArgumentToPrivateEntryFunction = 4,
1771        /// Out of bounds access to input or results.
1772        ///
1773        /// `index` field will be set indicating the invalid index value.
1774        IndexOutOfBounds = 5,
1775        /// Out of bounds access to subresult.
1776        ///
1777        /// `index` and `subresult` fields will be set indicating the invalid index value.
1778        SecondaryIndexOutOfBounds = 6,
1779        /// Invalid usage of result.
1780        /// Expected a single result but found either no return value or multiple.
1781        /// `index` field will be set indicating the invalid index value.
1782        InvalidResultArity = 7,
1783        /// Invalid usage of gas coin.
1784        /// The gas coin can only be used by-value with a `TransferObject` command.
1785        InvalidGasCoinUsage = 8,
1786        /// Invalid usage of Move value.
1787        /// - Mutably borrowed values require unique usage.
1788        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1789        /// - Taken values cannot be used again.
1790        InvalidValueUsage = 9,
1791        /// Immutable objects cannot be passed by-value.
1792        InvalidObjectByValue = 10,
1793        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1794        InvalidObjectByMutRef = 11,
1795        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1796        /// allowed.
1797        ConsensusObjectOperationNotAllowed = 12,
1798        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1799        /// multiple arguments.
1800        InvalidArgumentArity = 13,
1801        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1802        InvalidTransferObject = 14,
1803        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1804        /// all arguments must be the same object type.
1805        InvalidMakeMoveVecNonObjectArgument = 15,
1806        /// Specified argument location does not have a value and cannot be used
1807        ArgumentWithoutValue = 16,
1808        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1809        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1810        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1811        /// ability.
1812        CannotMoveBorrowedValue = 17,
1813        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1814        /// extension of that reference. This is likely due to this argument being used in a Move call
1815        /// that returns a reference, and that reference is used in a later command.
1816        CannotWriteToExtendedReference = 18,
1817        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1818        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1819        /// argument is mutable and another reference extends it and will be used in a later command.
1820        InvalidReferenceArgument = 19,
1821        /// Invalid usage of TxContext in the function signature. TxContext can only be used by
1822        /// reference, `&TxContext` or `&mut TxContext`. If used mutably, it must be the only
1823        /// TxContext parameter, and TxContext can never be returned from a Move call.
1824        InvalidTxContext = 20,
1825    }
1826    impl CommandArgumentErrorKind {
1827        /// String value of the enum field names used in the ProtoBuf definition.
1828        ///
1829        /// The values are not transformed in any way and thus are considered stable
1830        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1831        pub fn as_str_name(&self) -> &'static str {
1832            match self {
1833                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1834                Self::TypeMismatch => "TYPE_MISMATCH",
1835                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1836                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1837                Self::InvalidArgumentToPrivateEntryFunction => {
1838                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1839                }
1840                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1841                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1842                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1843                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1844                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1845                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1846                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1847                Self::ConsensusObjectOperationNotAllowed => {
1848                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1849                }
1850                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1851                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1852                Self::InvalidMakeMoveVecNonObjectArgument => {
1853                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1854                }
1855                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1856                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1857                Self::CannotWriteToExtendedReference => {
1858                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1859                }
1860                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1861                Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1862            }
1863        }
1864        /// Creates an enum from field names used in the ProtoBuf definition.
1865        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1866            match value {
1867                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1868                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1869                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1870                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1871                    Some(Self::InvalidUsageOfPureArgument)
1872                }
1873                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1874                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1875                }
1876                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1877                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1878                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1879                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1880                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1881                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1882                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1883                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1884                    Some(Self::ConsensusObjectOperationNotAllowed)
1885                }
1886                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1887                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1888                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1889                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1890                }
1891                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1892                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1893                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1894                    Some(Self::CannotWriteToExtendedReference)
1895                }
1896                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1897                "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1898                _ => None,
1899            }
1900        }
1901    }
1902}
1903/// An error with upgrading a package.
1904#[non_exhaustive]
1905#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1906pub struct PackageUpgradeError {
1907    #[prost(
1908        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1909        optional,
1910        tag = "1"
1911    )]
1912    pub kind: ::core::option::Option<i32>,
1913    /// The Package Id.
1914    #[prost(string, optional, tag = "2")]
1915    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1916    /// A digest.
1917    #[prost(string, optional, tag = "3")]
1918    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1919    /// The policy.
1920    #[prost(uint32, optional, tag = "4")]
1921    pub policy: ::core::option::Option<u32>,
1922    /// The ticket Id.
1923    #[prost(string, optional, tag = "5")]
1924    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1925}
1926/// Nested message and enum types in `PackageUpgradeError`.
1927pub mod package_upgrade_error {
1928    #[non_exhaustive]
1929    #[derive(
1930        Clone,
1931        Copy,
1932        Debug,
1933        PartialEq,
1934        Eq,
1935        Hash,
1936        PartialOrd,
1937        Ord,
1938        ::prost::Enumeration
1939    )]
1940    #[repr(i32)]
1941    pub enum PackageUpgradeErrorKind {
1942        Unknown = 0,
1943        /// Unable to fetch package.
1944        UnableToFetchPackage = 1,
1945        /// Object is not a package.
1946        NotAPackage = 2,
1947        /// Package upgrade is incompatible with previous version.
1948        IncompatibleUpgrade = 3,
1949        /// Digest in upgrade ticket and computed digest differ.
1950        DigestDoesNotMatch = 4,
1951        /// Upgrade policy is not valid.
1952        UnknownUpgradePolicy = 5,
1953        /// Package ID does not match `PackageId` in upgrade ticket.
1954        PackageIdDoesNotMatch = 6,
1955    }
1956    impl PackageUpgradeErrorKind {
1957        /// String value of the enum field names used in the ProtoBuf definition.
1958        ///
1959        /// The values are not transformed in any way and thus are considered stable
1960        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1961        pub fn as_str_name(&self) -> &'static str {
1962            match self {
1963                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1964                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1965                Self::NotAPackage => "NOT_A_PACKAGE",
1966                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1967                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1968                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1969                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1970            }
1971        }
1972        /// Creates an enum from field names used in the ProtoBuf definition.
1973        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1974            match value {
1975                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1976                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1977                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1978                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1979                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1980                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1981                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1982                _ => None,
1983            }
1984        }
1985    }
1986}
1987/// Type argument error.
1988#[non_exhaustive]
1989#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1990pub struct TypeArgumentError {
1991    /// Index of the problematic type argument.
1992    #[prost(uint32, optional, tag = "1")]
1993    pub type_argument: ::core::option::Option<u32>,
1994    #[prost(
1995        enumeration = "type_argument_error::TypeArgumentErrorKind",
1996        optional,
1997        tag = "2"
1998    )]
1999    pub kind: ::core::option::Option<i32>,
2000}
2001/// Nested message and enum types in `TypeArgumentError`.
2002pub mod type_argument_error {
2003    #[non_exhaustive]
2004    #[derive(
2005        Clone,
2006        Copy,
2007        Debug,
2008        PartialEq,
2009        Eq,
2010        Hash,
2011        PartialOrd,
2012        Ord,
2013        ::prost::Enumeration
2014    )]
2015    #[repr(i32)]
2016    pub enum TypeArgumentErrorKind {
2017        Unknown = 0,
2018        /// A type was not found in the module specified.
2019        TypeNotFound = 1,
2020        /// A type provided did not match the specified constraint.
2021        ConstraintNotSatisfied = 2,
2022    }
2023    impl TypeArgumentErrorKind {
2024        /// String value of the enum field names used in the ProtoBuf definition.
2025        ///
2026        /// The values are not transformed in any way and thus are considered stable
2027        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2028        pub fn as_str_name(&self) -> &'static str {
2029            match self {
2030                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
2031                Self::TypeNotFound => "TYPE_NOT_FOUND",
2032                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
2033            }
2034        }
2035        /// Creates an enum from field names used in the ProtoBuf definition.
2036        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2037            match value {
2038                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
2039                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
2040                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
2041                _ => None,
2042            }
2043        }
2044    }
2045}
2046/// DNF filter for transactions: any term may match, and each term is an AND
2047/// of signed literals.
2048/// An absent filter matches everything. A present filter must have at least one
2049/// term.
2050#[derive(Eq, Hash)]
2051#[non_exhaustive]
2052#[derive(Clone, PartialEq, ::prost::Message)]
2053pub struct TransactionFilter {
2054    /// Terms are ORed together.
2055    #[prost(message, repeated, tag = "1")]
2056    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
2057}
2058/// One conjunction in a transaction DNF filter.
2059#[derive(Eq, Hash)]
2060#[non_exhaustive]
2061#[derive(Clone, PartialEq, ::prost::Message)]
2062pub struct TransactionTerm {
2063    /// Literals are ANDed together.
2064    #[prost(message, repeated, tag = "1")]
2065    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
2066}
2067/// One signed transaction predicate literal: a predicate, optionally negated.
2068#[non_exhaustive]
2069#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2070pub struct TransactionLiteral {
2071    /// When true, the literal matches transactions that the predicate does *not*
2072    /// match.
2073    #[prost(bool, tag = "1")]
2074    pub negated: bool,
2075    /// The transaction-index predicate to match.
2076    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
2077    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
2078}
2079/// Nested message and enum types in `TransactionLiteral`.
2080pub mod transaction_literal {
2081    /// The transaction-index predicate to match.
2082    #[non_exhaustive]
2083    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2084    pub enum Predicate {
2085        /// Match transactions sent by the specified address.
2086        #[prost(message, tag = "2")]
2087        Sender(super::SenderFilter),
2088        /// Match transactions where the specified address's state moved as a side
2089        /// effect: it owns an object after the txn, owned an object before the
2090        /// txn that was mutated/transferred away/deleted/wrapped, or its
2091        /// address-balance changed via an accumulator event.
2092        #[prost(message, tag = "3")]
2093        AffectedAddress(super::AffectedAddressFilter),
2094        /// Match transactions whose effects include a change for the specified
2095        /// object.
2096        #[prost(message, tag = "4")]
2097        AffectedObject(super::AffectedObjectFilter),
2098        /// Match transactions that made a Move call matching the specified filter.
2099        #[prost(message, tag = "5")]
2100        MoveCall(super::MoveCallFilter),
2101        /// Match transactions that emitted an event whose package/module fields
2102        /// match the specified filter.
2103        #[prost(message, tag = "6")]
2104        EmitModule(super::EmitModuleFilter),
2105        /// Match transactions that emitted an event with a type matching the
2106        /// specified filter.
2107        #[prost(message, tag = "7")]
2108        EventType(super::EventTypeFilter),
2109        /// Match transactions that wrote to the specified authenticated event
2110        /// stream head.
2111        #[prost(message, tag = "8")]
2112        EventStreamHead(super::EventStreamHeadFilter),
2113        /// Match transactions that wrote a Move package — a first publish or an
2114        /// upgrade, of any package.
2115        #[prost(message, tag = "9")]
2116        PackageWrite(super::PackageWriteFilter),
2117    }
2118}
2119/// DNF filter for events: any term may match, and each term is an AND of
2120/// signed literals. Sender predicates match all events from matching
2121/// transactions; emit-module, event-type, and event-stream-head predicates match
2122/// individual event-space dimensions. An absent filter matches everything. A
2123/// present filter must have at least one term.
2124#[non_exhaustive]
2125#[derive(Clone, PartialEq, ::prost::Message)]
2126pub struct EventFilter {
2127    /// Terms are ORed together.
2128    #[prost(message, repeated, tag = "1")]
2129    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
2130}
2131/// One conjunction in an event DNF filter.
2132#[non_exhaustive]
2133#[derive(Clone, PartialEq, ::prost::Message)]
2134pub struct EventTerm {
2135    /// Literals are ANDed together.
2136    #[prost(message, repeated, tag = "1")]
2137    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
2138}
2139/// One signed event predicate literal: a predicate, optionally negated.
2140#[non_exhaustive]
2141#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2142pub struct EventLiteral {
2143    /// When true, the literal matches events that the predicate does *not* match.
2144    #[prost(bool, tag = "1")]
2145    pub negated: bool,
2146    /// The event-index predicate to match.
2147    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
2148    pub predicate: ::core::option::Option<event_literal::Predicate>,
2149}
2150/// Nested message and enum types in `EventLiteral`.
2151pub mod event_literal {
2152    /// The event-index predicate to match.
2153    #[non_exhaustive]
2154    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2155    pub enum Predicate {
2156        /// Match events from transactions sent by the specified address.
2157        #[prost(message, tag = "2")]
2158        Sender(super::SenderFilter),
2159        /// Match events whose package/module fields match the specified filter.
2160        #[prost(message, tag = "3")]
2161        EmitModule(super::EmitModuleFilter),
2162        /// Match events whose type matches the specified filter.
2163        #[prost(message, tag = "4")]
2164        EventType(super::EventTypeFilter),
2165        /// Match events committed to the specified authenticated event stream head.
2166        #[prost(message, tag = "5")]
2167        EventStreamHead(super::EventStreamHeadFilter),
2168    }
2169}
2170/// Match by transaction sender address.
2171#[non_exhaustive]
2172#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2173pub struct SenderFilter {
2174    /// The sender address (hex-encoded).
2175    #[prost(string, optional, tag = "1")]
2176    pub address: ::core::option::Option<::prost::alloc::string::String>,
2177}
2178/// Match by any address whose state moved as a side effect of the
2179/// transaction: object ownership changes (in either direction), prior
2180/// owners of removed/wrapped objects, and address-balance changes via
2181/// accumulator events.
2182#[non_exhaustive]
2183#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2184pub struct AffectedAddressFilter {
2185    /// The affected address (hex-encoded).
2186    #[prost(string, optional, tag = "1")]
2187    pub address: ::core::option::Option<::prost::alloc::string::String>,
2188}
2189/// Match by changed object ID.
2190#[non_exhaustive]
2191#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2192pub struct AffectedObjectFilter {
2193    /// The changed object ID (hex-encoded).
2194    #[prost(string, optional, tag = "1")]
2195    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2196}
2197/// Match by Move function call, specified as a `::`-delimited Move path.
2198///
2199/// Specificity levels:
2200/// "0xpkg"                        -> matches any call in the package
2201/// "0xpkg::module"                -> matches any call in the module
2202/// "0xpkg::module::function"      -> matches calls to the exact function
2203#[non_exhaustive]
2204#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2205pub struct MoveCallFilter {
2206    /// Required. Move path of the form `package\[::module[::function]\]`.
2207    #[prost(string, optional, tag = "1")]
2208    pub function: ::core::option::Option<::prost::alloc::string::String>,
2209}
2210/// Match by an event's package/module fields, specified as a `::`-delimited
2211/// Move path. These identify the top-level Move call that triggered the event.
2212///
2213/// Specificity levels:
2214/// "0xpkg"               -> matches events with this package_id
2215/// "0xpkg::module"       -> matches events with this package_id and module
2216#[non_exhaustive]
2217#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2218pub struct EmitModuleFilter {
2219    /// Required. Move path of the form `package\[::module\]`.
2220    #[prost(string, optional, tag = "1")]
2221    pub module: ::core::option::Option<::prost::alloc::string::String>,
2222}
2223/// Match by event struct type, specified as a Move type string.
2224///
2225/// Specificity levels:
2226/// "0xaddr"                              -> matches events whose type is defined at this address
2227/// "0xaddr::module"                      -> matches events whose type is in this module
2228/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
2229/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
2230#[non_exhaustive]
2231#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2232pub struct EventTypeFilter {
2233    /// Required. Move type string of the form
2234    /// `address\[::module[::Name[<type_params>]\]]`.
2235    #[prost(string, optional, tag = "1")]
2236    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
2237}
2238/// Match by authenticated event stream head.
2239#[non_exhaustive]
2240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2241pub struct EventStreamHeadFilter {
2242    /// The stream id address (hex-encoded).
2243    #[prost(string, optional, tag = "1")]
2244    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
2245}
2246/// Match transactions that wrote a Move package.
2247#[non_exhaustive]
2248#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2249pub struct PackageWriteFilter {}
2250/// Summary of gas charges.
2251#[non_exhaustive]
2252#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2253pub struct GasCostSummary {
2254    /// Cost of computation/execution.
2255    #[prost(uint64, optional, tag = "1")]
2256    pub computation_cost: ::core::option::Option<u64>,
2257    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
2258    #[prost(uint64, optional, tag = "2")]
2259    pub storage_cost: ::core::option::Option<u64>,
2260    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
2261    /// transaction.
2262    #[prost(uint64, optional, tag = "3")]
2263    pub storage_rebate: ::core::option::Option<u64>,
2264    /// The fee for the rebate. The portion of the storage rebate kept by the system.
2265    #[prost(uint64, optional, tag = "4")]
2266    pub non_refundable_storage_fee: ::core::option::Option<u64>,
2267}
2268/// An input to a user transaction.
2269#[non_exhaustive]
2270#[derive(Clone, PartialEq, ::prost::Message)]
2271pub struct Input {
2272    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
2273    pub kind: ::core::option::Option<i32>,
2274    /// A move value serialized as BCS.
2275    ///
2276    /// For normal operations this is required to be a move primitive type and not contain structs
2277    /// or objects.
2278    #[prost(bytes = "bytes", optional, tag = "2")]
2279    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
2280    /// `ObjectId` of the object input.
2281    #[prost(string, optional, tag = "3")]
2282    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2283    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
2284    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
2285    /// object when it was shared
2286    #[prost(uint64, optional, tag = "4")]
2287    pub version: ::core::option::Option<u64>,
2288    /// The digest of this object.
2289    #[prost(string, optional, tag = "5")]
2290    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2291    /// Controls whether the caller asks for a mutable reference to the shared
2292    /// object.
2293    #[prost(bool, optional, tag = "6")]
2294    pub mutable: ::core::option::Option<bool>,
2295    /// NOTE: For backwards compatibility purposes the addition of the new
2296    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
2297    /// The old `mutable` field will continue to be populated and respected as an
2298    /// input for the time being.
2299    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
2300    pub mutability: ::core::option::Option<i32>,
2301    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
2302    #[prost(message, optional, tag = "8")]
2303    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
2304    /// A literal value
2305    ///
2306    /// INPUT ONLY
2307    #[prost(message, optional, boxed, tag = "1000")]
2308    pub literal: ::core::option::Option<
2309        ::prost::alloc::boxed::Box<::prost_types::Value>,
2310    >,
2311}
2312/// Nested message and enum types in `Input`.
2313pub mod input {
2314    #[non_exhaustive]
2315    #[derive(
2316        Clone,
2317        Copy,
2318        Debug,
2319        PartialEq,
2320        Eq,
2321        Hash,
2322        PartialOrd,
2323        Ord,
2324        ::prost::Enumeration
2325    )]
2326    #[repr(i32)]
2327    pub enum InputKind {
2328        Unknown = 0,
2329        /// A move value serialized as BCS.
2330        Pure = 1,
2331        /// A Move object that is either immutable or address owned.
2332        ImmutableOrOwned = 2,
2333        /// A Move object whose owner is "Shared".
2334        Shared = 3,
2335        /// A Move object that is attempted to be received in this transaction.
2336        Receiving = 4,
2337        /// Reservation to withdraw balance from a funds accumulator
2338        FundsWithdrawal = 5,
2339    }
2340    impl InputKind {
2341        /// String value of the enum field names used in the ProtoBuf definition.
2342        ///
2343        /// The values are not transformed in any way and thus are considered stable
2344        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2345        pub fn as_str_name(&self) -> &'static str {
2346            match self {
2347                Self::Unknown => "INPUT_KIND_UNKNOWN",
2348                Self::Pure => "PURE",
2349                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
2350                Self::Shared => "SHARED",
2351                Self::Receiving => "RECEIVING",
2352                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
2353            }
2354        }
2355        /// Creates an enum from field names used in the ProtoBuf definition.
2356        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2357            match value {
2358                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
2359                "PURE" => Some(Self::Pure),
2360                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
2361                "SHARED" => Some(Self::Shared),
2362                "RECEIVING" => Some(Self::Receiving),
2363                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
2364                _ => None,
2365            }
2366        }
2367    }
2368    #[non_exhaustive]
2369    #[derive(
2370        Clone,
2371        Copy,
2372        Debug,
2373        PartialEq,
2374        Eq,
2375        Hash,
2376        PartialOrd,
2377        Ord,
2378        ::prost::Enumeration
2379    )]
2380    #[repr(i32)]
2381    pub enum Mutability {
2382        Unknown = 0,
2383        Immutable = 1,
2384        Mutable = 2,
2385        /// Non-exclusive write is used to allow multiple transactions to
2386        /// simultaneously add disjoint dynamic fields to an object.
2387        /// (Currently only used by settlement transactions).
2388        NonExclusiveWrite = 3,
2389    }
2390    impl Mutability {
2391        /// String value of the enum field names used in the ProtoBuf definition.
2392        ///
2393        /// The values are not transformed in any way and thus are considered stable
2394        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2395        pub fn as_str_name(&self) -> &'static str {
2396            match self {
2397                Self::Unknown => "MUTABILITY_UNKNOWN",
2398                Self::Immutable => "IMMUTABLE",
2399                Self::Mutable => "MUTABLE",
2400                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
2401            }
2402        }
2403        /// Creates an enum from field names used in the ProtoBuf definition.
2404        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2405            match value {
2406                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
2407                "IMMUTABLE" => Some(Self::Immutable),
2408                "MUTABLE" => Some(Self::Mutable),
2409                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
2410                _ => None,
2411            }
2412        }
2413    }
2414}
2415#[non_exhaustive]
2416#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2417pub struct FundsWithdrawal {
2418    #[prost(uint64, optional, tag = "1")]
2419    pub amount: ::core::option::Option<u64>,
2420    #[prost(string, optional, tag = "2")]
2421    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2422    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2423    pub source: ::core::option::Option<i32>,
2424    /// The address whose balance is debited if `source` is `SENDER_ALLOWANCE`.
2425    #[prost(string, optional, tag = "4")]
2426    pub funder: ::core::option::Option<::prost::alloc::string::String>,
2427    /// `ObjectId` of the allowance object authorizing the withdrawal if `source`
2428    /// is `SENDER_ALLOWANCE`.
2429    #[prost(string, optional, tag = "5")]
2430    pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2431    /// The frozen address whose balance is seized if `source` is
2432    /// `FROZEN_ADDRESS`.
2433    #[prost(string, optional, tag = "6")]
2434    pub seized_from: ::core::option::Option<::prost::alloc::string::String>,
2435    /// `ObjectId` of the seize authorization object authorizing the withdrawal
2436    /// if `source` is `FROZEN_ADDRESS`.
2437    #[prost(string, optional, tag = "7")]
2438    pub seize_auth: ::core::option::Option<::prost::alloc::string::String>,
2439}
2440/// Nested message and enum types in `FundsWithdrawal`.
2441pub mod funds_withdrawal {
2442    #[non_exhaustive]
2443    #[derive(
2444        Clone,
2445        Copy,
2446        Debug,
2447        PartialEq,
2448        Eq,
2449        Hash,
2450        PartialOrd,
2451        Ord,
2452        ::prost::Enumeration
2453    )]
2454    #[repr(i32)]
2455    pub enum Source {
2456        Unknown = 0,
2457        Sender = 1,
2458        Sponsor = 2,
2459        /// Withdraw from `funder`'s balance under the `allowance` object, granted
2460        /// to the sender of the transaction.
2461        SenderAllowance = 3,
2462        /// Seize funds from the balance of `seized_from`, a frozen address, under
2463        /// the `seize_auth` object owned by the sender of the transaction.
2464        FrozenAddress = 4,
2465    }
2466    impl Source {
2467        /// String value of the enum field names used in the ProtoBuf definition.
2468        ///
2469        /// The values are not transformed in any way and thus are considered stable
2470        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2471        pub fn as_str_name(&self) -> &'static str {
2472            match self {
2473                Self::Unknown => "SOURCE_UNKNOWN",
2474                Self::Sender => "SENDER",
2475                Self::Sponsor => "SPONSOR",
2476                Self::SenderAllowance => "SENDER_ALLOWANCE",
2477                Self::FrozenAddress => "FROZEN_ADDRESS",
2478            }
2479        }
2480        /// Creates an enum from field names used in the ProtoBuf definition.
2481        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2482            match value {
2483                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2484                "SENDER" => Some(Self::Sender),
2485                "SPONSOR" => Some(Self::Sponsor),
2486                "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2487                "FROZEN_ADDRESS" => Some(Self::FrozenAddress),
2488                _ => None,
2489            }
2490        }
2491    }
2492}
2493/// Key to uniquely identify a JWK.
2494#[non_exhaustive]
2495#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2496pub struct JwkId {
2497    /// The issuer or identity of the OIDC provider.
2498    #[prost(string, optional, tag = "1")]
2499    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2500    /// A key ID used to uniquely identify a key from an OIDC provider.
2501    #[prost(string, optional, tag = "2")]
2502    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2503}
2504/// A JSON web key.
2505///
2506/// Struct that contains info for a JWK. A list of them for different kinds can
2507/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2508/// The JWK is used to verify the JWT token.
2509#[non_exhaustive]
2510#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2511pub struct Jwk {
2512    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2513    #[prost(string, optional, tag = "1")]
2514    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2515    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2516    #[prost(string, optional, tag = "2")]
2517    pub e: ::core::option::Option<::prost::alloc::string::String>,
2518    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2519    #[prost(string, optional, tag = "3")]
2520    pub n: ::core::option::Option<::prost::alloc::string::String>,
2521    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2522    #[prost(string, optional, tag = "4")]
2523    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2524}
2525#[non_exhaustive]
2526#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2527pub struct GetServiceInfoRequest {}
2528#[non_exhaustive]
2529#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2530pub struct GetServiceInfoResponse {
2531    /// The chain identifier of the chain that this node is on.
2532    ///
2533    /// The chain identifier is the digest of the genesis checkpoint, the
2534    /// checkpoint with sequence number 0.
2535    #[prost(string, optional, tag = "1")]
2536    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2537    /// Human-readable name of the chain that this node is on.
2538    ///
2539    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2540    #[prost(string, optional, tag = "2")]
2541    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2542    /// Current epoch of the node based on its highest executed checkpoint.
2543    #[prost(uint64, optional, tag = "3")]
2544    pub epoch: ::core::option::Option<u64>,
2545    /// Checkpoint height of the most recently executed checkpoint.
2546    #[prost(uint64, optional, tag = "4")]
2547    pub checkpoint_height: ::core::option::Option<u64>,
2548    /// Unix timestamp of the most recently executed checkpoint.
2549    #[prost(message, optional, tag = "5")]
2550    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2551    /// The lowest checkpoint for which checkpoints and transaction data are available.
2552    #[prost(uint64, optional, tag = "6")]
2553    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2554    /// The lowest checkpoint for which object data is available.
2555    #[prost(uint64, optional, tag = "7")]
2556    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2557    /// Software version of the service. Similar to the `server` http header.
2558    #[prost(string, optional, tag = "8")]
2559    pub server: ::core::option::Option<::prost::alloc::string::String>,
2560}
2561/// A request that resolves to a version where the object was deleted or
2562/// wrapped fails with `NOT_FOUND`, with reason `OBJECT_REMOVED` when the server
2563/// can find the removal.
2564#[non_exhaustive]
2565#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2566pub struct GetObjectRequest {
2567    /// Required. The `ObjectId` of the requested object.
2568    #[prost(string, optional, tag = "1")]
2569    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2570    /// Optional. Request a specific version of the object.
2571    ///
2572    /// Mutually exclusive with `max_version`; servers reject a request that sets
2573    /// both with `INVALID_ARGUMENT`. If none of `version`, `max_version` and
2574    /// `at_checkpoint` is set and the object is live, the latest version of the
2575    /// object is returned.
2576    ///
2577    /// Servers that prune object history fail with `OUT_OF_RANGE` and reason
2578    /// `BELOW_EARLIEST_AVAILABLE` for a version they no longer hold. A version
2579    /// above the object's latest version is `NOT_FOUND`.
2580    ///
2581    /// Without `at_checkpoint`, servers that keep only each object's latest
2582    /// version answer requests for that version, even if the object was deleted
2583    /// or wrapped at it (`NOT_FOUND`, as described on `GetObjectRequest`), and
2584    /// fail with `OUT_OF_RANGE` and reason `VERSION_NOT_RETAINED` for any older
2585    /// version. An object they have no entry for at all is `NOT_FOUND`.
2586    #[prost(uint64, optional, tag = "2")]
2587    pub version: ::core::option::Option<u64>,
2588    /// Mask specifying which fields to read.
2589    /// If no mask is specified, defaults to `object_id,version,digest`.
2590    #[prost(message, optional, tag = "3")]
2591    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2592    /// Optional. Set alone, return the object's state at the end of this
2593    /// checkpoint. An object deleted or wrapped at or before it (and not since
2594    /// unwrapped or re-created) is `NOT_FOUND`.
2595    ///
2596    /// Combined with `version` or `max_version`, it bounds which versions are
2597    /// visible: the server resolves the selected version first, then fails with
2598    /// `NOT_FOUND` if that version was written after `at_checkpoint`, without
2599    /// falling back to an older visible version. A visible version is returned
2600    /// even if the object was deleted or wrapped by the end of `at_checkpoint`.
2601    /// For example, if version 5 was written in checkpoint 10 and version 8 in
2602    /// checkpoint 20, then on a server that has indexed checkpoint 25,
2603    /// `max_version: 8` with `at_checkpoint: 15` is `NOT_FOUND`, and with
2604    /// `at_checkpoint: 25` returns version 8. A server that has indexed only up
2605    /// to checkpoint 19 selects version 5 and returns it for `at_checkpoint: 15`.
2606    ///
2607    /// Outside the checkpoints the server has indexed, it fails as a request
2608    /// pinned to a checkpoint (see `ErrorReason.ABOVE_LATEST_AVAILABLE` and
2609    /// `BELOW_EARLIEST_AVAILABLE`).
2610    ///
2611    /// Servers that are not set up for reads at a checkpoint fail with
2612    /// `UNIMPLEMENTED` and reason `NOT_SERVED_HERE`. Servers that cannot serve
2613    /// them yet, for example while they backfill history, fail with
2614    /// `UNAVAILABLE` and reason `NOT_READY`. Servers that predate this field
2615    /// ignore it and answer as if it were unset.
2616    #[prost(uint64, optional, tag = "4")]
2617    pub at_checkpoint: ::core::option::Option<u64>,
2618    /// Optional. Return the object's newest version at or below `max_version`.
2619    /// Without `at_checkpoint`, fullnodes read it from their live state and
2620    /// kv-rpc reads it at the highest checkpoint it has indexed; with it, both
2621    /// select among the versions up to the highest checkpoint they have indexed.
2622    /// Fails with `NOT_FOUND` if there is none, or if the object was deleted or
2623    /// wrapped at that version. Mutually exclusive with `version`; a request
2624    /// that sets both fails with `INVALID_ARGUMENT`. Servers that prune object
2625    /// history fail with `OUT_OF_RANGE` and reason `BELOW_EARLIEST_AVAILABLE`
2626    /// for a version they no longer hold.
2627    ///
2628    /// Servers that are not set up for `max_version` reads, such as fullnodes
2629    /// without RPC indexes, fail with `UNIMPLEMENTED` and reason
2630    /// `NOT_SERVED_HERE`. Servers that cannot serve them yet, for example while
2631    /// they backfill their indexes, fail with `UNAVAILABLE` and reason
2632    /// `NOT_READY`. Servers that predate this field ignore it and answer as if
2633    /// it were unset.
2634    #[prost(uint64, optional, tag = "5")]
2635    pub max_version: ::core::option::Option<u64>,
2636}
2637#[non_exhaustive]
2638#[derive(Clone, PartialEq, ::prost::Message)]
2639pub struct GetObjectResponse {
2640    #[prost(message, optional, tag = "1")]
2641    pub object: ::core::option::Option<Object>,
2642}
2643#[non_exhaustive]
2644#[derive(Clone, PartialEq, ::prost::Message)]
2645pub struct BatchGetObjectsRequest {
2646    /// The objects to fetch. Each request carries its own `version`,
2647    /// `max_version` or `at_checkpoint`, so a single batch may read different
2648    /// objects at different versions or checkpoints. Errors for individual
2649    /// objects, such as `NOT_FOUND`, are reported per item in the response. A
2650    /// malformed request, such as one that sets both `version` and
2651    /// `max_version`, fails the whole batch with `INVALID_ARGUMENT`. If any
2652    /// request sets `at_checkpoint` or `max_version` and the server cannot serve
2653    /// such reads, the whole batch fails as `GetObjectRequest` describes for
2654    /// that field.
2655    #[prost(message, repeated, tag = "1")]
2656    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2657    /// Mask specifying which fields to read.
2658    /// If no mask is specified, defaults to `object_id,version,digest`.
2659    #[prost(message, optional, tag = "2")]
2660    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2661}
2662#[non_exhaustive]
2663#[derive(Clone, PartialEq, ::prost::Message)]
2664pub struct BatchGetObjectsResponse {
2665    #[prost(message, repeated, tag = "1")]
2666    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2667}
2668#[non_exhaustive]
2669#[derive(Clone, PartialEq, ::prost::Message)]
2670pub struct GetObjectResult {
2671    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2672    pub result: ::core::option::Option<get_object_result::Result>,
2673}
2674/// Nested message and enum types in `GetObjectResult`.
2675pub mod get_object_result {
2676    #[non_exhaustive]
2677    #[derive(Clone, PartialEq, ::prost::Oneof)]
2678    pub enum Result {
2679        #[prost(message, tag = "1")]
2680        Object(super::Object),
2681        #[prost(message, tag = "2")]
2682        Error(super::super::super::super::google::rpc::Status),
2683    }
2684}
2685/// Request message for LedgerService.ListObjectVersions.
2686///
2687/// Lists the object's history, one item per version: a live version or a
2688/// removal (a version where it was deleted or wrapped). Both count toward
2689/// `options.limit`, and every bound applies to both. The bounds intersect. An
2690/// empty result, including for an object that does not exist, ends with
2691/// `QueryEnd` rather than `NOT_FOUND`. After a removal the object can come back
2692/// at a higher version, by an unwrap or by being created again under the same
2693/// ID (dynamic fields, derived objects), and the listing continues with it.
2694///
2695/// Past what this server has indexed, the listing follows the other `List*`
2696/// RPCs (see `ErrorReason.ABOVE_LATEST_AVAILABLE`). A descending listing fails
2697/// with `OUT_OF_RANGE` / `ABOVE_LATEST_AVAILABLE` when its `end_checkpoint` is
2698/// above `firstUnavailableCheckpoint` (one above the highest checkpoint the
2699/// server has indexed); with `end_checkpoint` unset, when its
2700/// `start_checkpoint` is at or above `firstUnavailableCheckpoint`, its `after`
2701/// cursor is at or above one past the object's newest version at the highest
2702/// indexed checkpoint, or its `before` cursor is above that. An ascending
2703/// listing is never refused for these: it is served from this server's view
2704/// and, unless `end_version` or `before` ends it first, ends with
2705/// `QUERY_END_REASON_LEDGER_TIP`; an `after` cursor past the highest indexed
2706/// checkpoint comes back unchanged as its last `cursor`. A server that prunes
2707/// history and retains nothing of the object compares the checkpoints the
2708/// cursors record instead; see below.
2709///
2710/// `start_version` and `end_version` may be above the object's newest version
2711/// without error: a descending listing whose `end_version` is above it starts
2712/// at the newest version, and a range entirely above it lists nothing.
2713///
2714/// A server that prunes history lists only the versions it retains: each
2715/// object's history from its state at the end of the lowest checkpoint whose
2716/// object state it keeps. A listing whose version bounds reach below the
2717/// object's oldest retained version starts there, in either order, and ends as
2718/// it would if that were the object's first version; nothing in the response
2719/// marks the difference. An object of which the server retains nothing lists
2720/// nothing. A client that needs an object's complete history uses a server
2721/// that does not prune it.
2722///
2723/// The lowest `start_checkpoint` this server accepts is one above that lowest
2724/// checkpoint. An empty range (`end_checkpoint` equal to `start_checkpoint`)
2725/// lists nothing and is never refused as pruned. Otherwise a lower
2726/// `start_checkpoint` fails with `OUT_OF_RANGE` / `BELOW_EARLIEST_AVAILABLE`
2727/// (unless an `after` cursor bounds the listing at or above that lowest
2728/// start), and so does an `end_checkpoint` at or below it in a request with no
2729/// lower bound of its own (no `start_checkpoint` and no `after` cursor). Every
2730/// `BELOW_EARLIEST_AVAILABLE` error of this method reports that lowest
2731/// `start_checkpoint` as `lowestAvailableCheckpoint`. With `start_checkpoint`
2732/// set, a listing that pruning overtakes while it streams fails the same way
2733/// rather than end at the object's oldest retained version.
2734///
2735/// A descending listing that resumes from a `before` cursor below the object's
2736/// oldest retained version gets an empty page that ends normally, as at the
2737/// object's oldest retained version. So does one for an object of which the
2738/// server retains nothing.
2739///
2740/// A listing bounded below by an `after` cursor, in either order, starts right
2741/// after the position the cursor names: the item the client holds, or the edge
2742/// of an earlier listing that returned nothing past it. When that is below the
2743/// object's oldest retained version, listing from there could leave a gap, so
2744/// the request fails with `OUT_OF_RANGE` / `BELOW_EARLIEST_AVAILABLE`. So does
2745/// a request with an `after` cursor for an object of which the server retains
2746/// nothing. A cursor that marks the edge of an earlier listing, rather than an
2747/// item, is served instead only when the server can tell that the object had
2748/// no version after that edge at or below the lowest checkpoint whose object
2749/// state it keeps, so nothing after it was pruned. The server may return this
2750/// error even when no version existed between the cursor and the oldest
2751/// retained one, if it cannot tell. An ascending listing that pruning
2752/// overtakes while it streams may fail the same way.
2753///
2754/// When the range reaches this server's tip (`end_checkpoint` unset or above
2755/// `firstUnavailableCheckpoint`), a request for an object this server retains
2756/// nothing of whose cursors all come from a server that has indexed further
2757/// than this one fails with `OUT_OF_RANGE` / `ABOVE_LATEST_AVAILABLE` (bound
2758/// "cursor"), in either order, until the server catches up: the object may be
2759/// newer than this server's tip, or pruned here.
2760///
2761/// With `transaction` in `removal_read_mask`, the retained versions start from
2762/// the higher of that checkpoint and the last checkpoint before this server's
2763/// removal transactions start, if any, and that higher checkpoint takes its
2764/// place in the rules above. Above it, a removal whose transaction the server
2765/// cannot find fails the listing with `INTERNAL`.
2766///
2767/// Servers that are not set up for this method, for example without the
2768/// indexes it needs, fail with `UNIMPLEMENTED` and reason `NOT_SERVED_HERE`.
2769/// Servers that cannot serve it yet, for example while they backfill those
2770/// indexes, fail with `UNAVAILABLE` and reason `NOT_READY`.
2771#[non_exhaustive]
2772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2773pub struct ListObjectVersionsRequest {
2774    /// Required. The `ObjectId` of the object whose versions to list.
2775    #[prost(string, optional, tag = "1")]
2776    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2777    /// Mask for each live version's `object`. Defaults to
2778    /// `object_id,version,digest`. Does not apply to `removal`.
2779    #[prost(message, optional, tag = "2")]
2780    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2781    /// Optional. The listing's order is ascending version. The server sets the
2782    /// default and maximum `limit`; larger values are coerced to the maximum,
2783    /// and `0` to `1`. Cursors come from `ListObjectVersionsResponse.cursor` and
2784    /// are per object: a malformed cursor, or one for another object, fails with
2785    /// `INVALID_ARGUMENT`. Resume from the last `cursor` received.
2786    /// A cursor also records the listing's bounding checkpoint: the last
2787    /// checkpoint of the range when `end_checkpoint` is set and that checkpoint
2788    /// is indexed, else the highest checkpoint the server that returned it had
2789    /// indexed.
2790    #[prost(message, optional, tag = "3")]
2791    pub options: ::core::option::Option<QueryOptions>,
2792    /// Optional. Start of the version range to list (inclusive).
2793    #[prost(uint64, optional, tag = "4")]
2794    pub start_version: ::core::option::Option<u64>,
2795    /// Optional. End of the version range to list (exclusive). Below
2796    /// `start_version` it fails with `INVALID_ARGUMENT`; equal to it, the range
2797    /// lists nothing.
2798    #[prost(uint64, optional, tag = "5")]
2799    pub end_version: ::core::option::Option<u64>,
2800    /// Mask for each `removal`, with paths `version`, `kind` and `transaction`.
2801    /// Defaults to `version,kind`.
2802    #[prost(message, optional, tag = "7")]
2803    pub removal_read_mask: ::core::option::Option<::prost_types::FieldMask>,
2804    /// Optional. Start of the checkpoint range to list (inclusive): only
2805    /// versions written in this checkpoint or later. The listing covers the
2806    /// history written in the range, not the object's state at one checkpoint.
2807    /// If unset, the listing starts at the object's first version (on a server
2808    /// that prunes history, its oldest retained version).
2809    #[prost(uint64, optional, tag = "8")]
2810    pub start_checkpoint: ::core::option::Option<u64>,
2811    /// Optional. End of the checkpoint range to list (exclusive): only versions
2812    /// written before this checkpoint. Below `start_checkpoint` it fails with
2813    /// `INVALID_ARGUMENT`; equal to it, the range lists nothing. If unset, the
2814    /// range ends at the highest checkpoint the server has indexed.
2815    ///
2816    /// With `end_checkpoint` set, `QUERY_END_REASON_LEDGER_TIP` means the server
2817    /// stopped at its highest indexed checkpoint, short of `end_checkpoint`:
2818    /// retry later or on another replica.
2819    #[prost(uint64, optional, tag = "9")]
2820    pub end_checkpoint: ::core::option::Option<u64>,
2821}
2822/// Response message for LedgerService.ListObjectVersions.
2823///
2824/// Every frame carries a `cursor`. A frame that delivers an item sets `item`,
2825/// in ascending version order or in reverse for `ORDERING_DESCENDING`. `end`
2826/// is set exactly once, on the last frame; with `QUERY_END_REASON_ITEM_LIMIT`
2827/// it rides on the last item's frame, and otherwise the last frame leaves
2828/// `item` unset. In this listing:
2829///
2830/// * `QUERY_END_REASON_CHECKPOINT_BOUND`: reached `end_version` or
2831///   `start_version`, the end of the checkpoint range, or the object's first
2832///   version (on a server that prunes history, its oldest retained version).
2833/// * `QUERY_END_REASON_CURSOR_BOUND`: reached the far cursor (`before`
2834///   ascending, `after` descending).
2835/// * `QUERY_END_REASON_LEDGER_TIP`: an ascending listing reached the highest
2836///   checkpoint the server has indexed, below `end_checkpoint` if set; resume
2837///   later from the last cursor received.
2838#[non_exhaustive]
2839#[derive(Clone, PartialEq, ::prost::Message)]
2840pub struct ListObjectVersionsResponse {
2841    /// The opaque resume position as of this frame, for use as `options.after`
2842    /// or `options.before`. Set on every frame, including the last. On a frame
2843    /// that sets `item`, it is that item's position; the last frame carries the
2844    /// position where the listing stopped, so a listing with no items still
2845    /// returns a resume cursor, and with `QUERY_END_REASON_CURSOR_BOUND` it is
2846    /// the far cursor. It records the listing's bounding checkpoint (see
2847    /// `ListObjectVersionsRequest.options`), not how far the listing has
2848    /// covered the ledger.
2849    #[prost(bytes = "bytes", optional, tag = "2")]
2850    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
2851    /// Set exactly once, on the final frame of a successful stream.
2852    #[prost(message, optional, tag = "3")]
2853    pub end: ::core::option::Option<QueryEnd>,
2854    /// The item a frame delivers. Unset on a frame that carries only `end`.
2855    #[prost(oneof = "list_object_versions_response::Item", tags = "1, 4")]
2856    pub item: ::core::option::Option<list_object_versions_response::Item>,
2857}
2858/// Nested message and enum types in `ListObjectVersionsResponse`.
2859pub mod list_object_versions_response {
2860    /// The item a frame delivers. Unset on a frame that carries only `end`.
2861    #[non_exhaustive]
2862    #[derive(Clone, PartialEq, ::prost::Oneof)]
2863    pub enum Item {
2864        /// A live version, with the fields selected by `read_mask`.
2865        #[prost(message, tag = "1")]
2866        Object(super::Object),
2867        /// A version at which the object was deleted or wrapped, with the fields
2868        /// selected by `removal_read_mask`.
2869        #[prost(message, tag = "4")]
2870        Removal(super::ObjectRemoval),
2871    }
2872}
2873/// A version at which an object was deleted or wrapped, listed by
2874/// `ListObjectVersions`. The object has no contents at this version.
2875#[non_exhaustive]
2876#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2877pub struct ObjectRemoval {
2878    /// The version the removing transaction assigned the object.
2879    #[prost(uint64, optional, tag = "1")]
2880    pub version: ::core::option::Option<u64>,
2881    /// How the object was removed.
2882    #[prost(enumeration = "object_removal::Kind", optional, tag = "2")]
2883    pub kind: ::core::option::Option<i32>,
2884    /// The digest of the transaction that deleted or wrapped the object. Set
2885    /// only when `ListObjectVersionsRequest.removal_read_mask` selects it, and
2886    /// then always set.
2887    #[prost(string, optional, tag = "3")]
2888    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
2889}
2890/// Nested message and enum types in `ObjectRemoval`.
2891pub mod object_removal {
2892    /// How the object was removed.
2893    #[non_exhaustive]
2894    #[derive(
2895        Clone,
2896        Copy,
2897        Debug,
2898        PartialEq,
2899        Eq,
2900        Hash,
2901        PartialOrd,
2902        Ord,
2903        ::prost::Enumeration
2904    )]
2905    #[repr(i32)]
2906    pub enum Kind {
2907        Unknown = 0,
2908        /// The object was deleted. An object with the same ID can be created again
2909        /// at a higher version, as a dynamic field is when a field with the same
2910        /// name is added again. A transaction that unwraps and deletes an object
2911        /// also shows as `DELETED`.
2912        Deleted = 1,
2913        /// The object was wrapped in another object. It can later be unwrapped at
2914        /// a higher version.
2915        Wrapped = 2,
2916    }
2917    impl Kind {
2918        /// String value of the enum field names used in the ProtoBuf definition.
2919        ///
2920        /// The values are not transformed in any way and thus are considered stable
2921        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2922        pub fn as_str_name(&self) -> &'static str {
2923            match self {
2924                Self::Unknown => "KIND_UNKNOWN",
2925                Self::Deleted => "DELETED",
2926                Self::Wrapped => "WRAPPED",
2927            }
2928        }
2929        /// Creates an enum from field names used in the ProtoBuf definition.
2930        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2931            match value {
2932                "KIND_UNKNOWN" => Some(Self::Unknown),
2933                "DELETED" => Some(Self::Deleted),
2934                "WRAPPED" => Some(Self::Wrapped),
2935                _ => None,
2936            }
2937        }
2938    }
2939}
2940/// A server that prunes history refuses a transaction it can place in a
2941/// checkpoint below its lowest available checkpoint with `OUT_OF_RANGE` and
2942/// reason `BELOW_EARLIEST_AVAILABLE`. A transaction it can no longer find, or
2943/// one above its latest checkpoint, is `NOT_FOUND`.
2944#[non_exhaustive]
2945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2946pub struct GetTransactionRequest {
2947    /// Required. The digest of the requested transaction.
2948    #[prost(string, optional, tag = "1")]
2949    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2950    /// Mask specifying which fields to read.
2951    /// If no mask is specified, defaults to `digest`.
2952    #[prost(message, optional, tag = "2")]
2953    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2954}
2955#[non_exhaustive]
2956#[derive(Clone, PartialEq, ::prost::Message)]
2957pub struct GetTransactionResponse {
2958    #[prost(message, optional, tag = "1")]
2959    pub transaction: ::core::option::Option<ExecutedTransaction>,
2960}
2961/// Each transaction is answered as by `GetTransaction`, in its own result.
2962#[non_exhaustive]
2963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2964pub struct BatchGetTransactionsRequest {
2965    /// Required. The digests of the requested transactions.
2966    #[prost(string, repeated, tag = "1")]
2967    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2968    /// Mask specifying which fields to read.
2969    /// If no mask is specified, defaults to `digest`.
2970    #[prost(message, optional, tag = "2")]
2971    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2972}
2973#[non_exhaustive]
2974#[derive(Clone, PartialEq, ::prost::Message)]
2975pub struct BatchGetTransactionsResponse {
2976    #[prost(message, repeated, tag = "1")]
2977    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2978}
2979#[non_exhaustive]
2980#[derive(Clone, PartialEq, ::prost::Message)]
2981pub struct GetTransactionResult {
2982    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2983    pub result: ::core::option::Option<get_transaction_result::Result>,
2984}
2985/// Nested message and enum types in `GetTransactionResult`.
2986pub mod get_transaction_result {
2987    #[non_exhaustive]
2988    #[derive(Clone, PartialEq, ::prost::Oneof)]
2989    pub enum Result {
2990        #[prost(message, tag = "1")]
2991        Transaction(super::ExecutedTransaction),
2992        #[prost(message, tag = "2")]
2993        Error(super::super::super::super::google::rpc::Status),
2994    }
2995}
2996/// A server that prunes history refuses a checkpoint below its lowest
2997/// available checkpoint with `OUT_OF_RANGE` and reason
2998/// `BELOW_EARLIEST_AVAILABLE`: by `sequence_number` always, by `digest` while
2999/// it can still find the checkpoint. A digest it can no longer find is
3000/// `NOT_FOUND`.
3001#[non_exhaustive]
3002#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3003pub struct GetCheckpointRequest {
3004    /// Mask specifying which fields to read.
3005    /// If no mask is specified, defaults to `sequence_number,digest`.
3006    #[prost(message, optional, tag = "3")]
3007    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3008    /// If neither is provided, return the latest
3009    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
3010    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
3011}
3012/// Nested message and enum types in `GetCheckpointRequest`.
3013pub mod get_checkpoint_request {
3014    /// If neither is provided, return the latest
3015    #[non_exhaustive]
3016    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
3017    pub enum CheckpointId {
3018        /// The sequence number of the requested checkpoint.
3019        #[prost(uint64, tag = "1")]
3020        SequenceNumber(u64),
3021        /// The digest of the requested checkpoint.
3022        #[prost(string, tag = "2")]
3023        Digest(::prost::alloc::string::String),
3024    }
3025}
3026#[non_exhaustive]
3027#[derive(Clone, PartialEq, ::prost::Message)]
3028pub struct GetCheckpointResponse {
3029    #[prost(message, optional, tag = "1")]
3030    pub checkpoint: ::core::option::Option<Checkpoint>,
3031}
3032#[non_exhaustive]
3033#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3034pub struct GetEpochRequest {
3035    /// The requested epoch. If unset, the current epoch: on fullnodes the epoch
3036    /// of their live state, and on kv-rpc the epoch of the highest checkpoint it
3037    /// has indexed. Apart from a fullnode's live epoch, which it answers even
3038    /// before its RPC index records it, an epoch the server has not reached or
3039    /// has not indexed fails with `NOT_FOUND`. Servers without RPC indexes fail
3040    /// a request for a past epoch with `UNIMPLEMENTED` and reason
3041    /// `NOT_SERVED_HERE`.
3042    #[prost(uint64, optional, tag = "1")]
3043    pub epoch: ::core::option::Option<u64>,
3044    /// Mask specifying which fields to read. If no mask is specified, defaults
3045    /// to `epoch`, `first_checkpoint`, `last_checkpoint`, `start`, `end`,
3046    /// `reference_gas_price` and `protocol_config.protocol_version`.
3047    #[prost(message, optional, tag = "2")]
3048    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3049}
3050#[non_exhaustive]
3051#[derive(Clone, PartialEq, ::prost::Message)]
3052pub struct GetEpochResponse {
3053    #[prost(message, optional, tag = "1")]
3054    pub epoch: ::core::option::Option<Epoch>,
3055}
3056#[non_exhaustive]
3057#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3058pub struct GetProtocolConfigRequest {
3059    /// The requested protocol version. If unset, the current version (see
3060    /// `LedgerService.GetProtocolConfig`).
3061    #[prost(uint64, optional, tag = "1")]
3062    pub version: ::core::option::Option<u64>,
3063    /// Mask specifying which fields to read.
3064    /// If no mask is specified, defaults to `protocol_version`.
3065    #[prost(message, optional, tag = "2")]
3066    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3067}
3068#[non_exhaustive]
3069#[derive(Clone, PartialEq, ::prost::Message)]
3070pub struct GetProtocolConfigResponse {
3071    #[prost(message, optional, tag = "1")]
3072    pub protocol_config: ::core::option::Option<ProtocolConfig>,
3073}
3074/// Request message for LedgerService.ListCheckpoints.
3075#[non_exhaustive]
3076#[derive(Clone, PartialEq, ::prost::Message)]
3077pub struct ListCheckpointsRequest {
3078    /// Optional. Mask for specifying which parts of the Checkpoint should be
3079    /// returned (e.g. summary, contents, signatures).
3080    #[prost(message, optional, tag = "1")]
3081    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3082    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
3083    /// genesis.
3084    #[prost(uint64, optional, tag = "2")]
3085    pub start_checkpoint: ::core::option::Option<u64>,
3086    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
3087    /// current indexed ledger tip.
3088    #[prost(uint64, optional, tag = "3")]
3089    pub end_checkpoint: ::core::option::Option<u64>,
3090    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
3091    /// matches if any transaction it contains satisfies the filter. If absent,
3092    /// all checkpoints in the range are returned.
3093    #[prost(message, optional, tag = "4")]
3094    pub filter: ::core::option::Option<TransactionFilter>,
3095    /// Optional cursor-bounded query options. If unspecified, reads in ascending
3096    /// order with the default item limit. The server enforces a maximum item
3097    /// limit and silently coerces larger values down to it. To paginate, pass
3098    /// the last received `Watermark.cursor` as `options.after` (ascending) or
3099    /// `options.before` (descending) on the next request.
3100    #[prost(message, optional, tag = "5")]
3101    pub options: ::core::option::Option<QueryOptions>,
3102}
3103/// Response message for LedgerService.ListCheckpoints.
3104///
3105/// Every frame carries a `watermark` with a safe resume cursor. A frame
3106/// with `checkpoint` set delivers one matching item; a frame without it reports
3107/// scan progress or terminal completion. Watermarks never regress in the
3108/// requested ordering but may repeat.
3109///
3110/// `end` is set exactly once, on the final frame of a successful stream. For
3111/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
3112/// every other end reason, the final frame has no `checkpoint` payload.
3113#[non_exhaustive]
3114#[derive(Clone, PartialEq, ::prost::Message)]
3115pub struct ListCheckpointsResponse {
3116    /// One matching checkpoint.
3117    #[prost(message, optional, tag = "1")]
3118    pub checkpoint: ::core::option::Option<Checkpoint>,
3119    /// Progress watermark as of this frame. Present on every frame. A
3120    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
3121    /// its authoritative scan frontier was already emitted.
3122    #[prost(message, optional, tag = "2")]
3123    pub watermark: ::core::option::Option<Watermark>,
3124    /// Set exactly once, on the final frame of a successful query stream.
3125    #[prost(message, optional, tag = "3")]
3126    pub end: ::core::option::Option<QueryEnd>,
3127}
3128/// Request message for LedgerService.ListTransactions.
3129#[non_exhaustive]
3130#[derive(Clone, PartialEq, ::prost::Message)]
3131pub struct ListTransactionsRequest {
3132    /// Optional. Mask for specifying which parts of the ExecutedTransaction
3133    /// should be returned.
3134    #[prost(message, optional, tag = "1")]
3135    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3136    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
3137    /// genesis.
3138    #[prost(uint64, optional, tag = "2")]
3139    pub start_checkpoint: ::core::option::Option<u64>,
3140    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
3141    /// current indexed ledger tip.
3142    #[prost(uint64, optional, tag = "3")]
3143    pub end_checkpoint: ::core::option::Option<u64>,
3144    /// Optional. DNF filter over indexed dimensions.
3145    /// If absent, all transactions in the range are returned.
3146    #[prost(message, optional, tag = "4")]
3147    pub filter: ::core::option::Option<TransactionFilter>,
3148    /// Optional cursor-bounded query options. If unspecified, reads in ascending
3149    /// order with the default item limit. The server enforces a maximum item
3150    /// limit and silently coerces larger values down to it. To paginate, pass
3151    /// the last received `Watermark.cursor` as `options.after` (ascending) or
3152    /// `options.before` (descending) on the next request.
3153    #[prost(message, optional, tag = "5")]
3154    pub options: ::core::option::Option<QueryOptions>,
3155    /// Optional. Transaction position within `start_checkpoint` at which the
3156    /// query starts (inclusive): within `start_checkpoint`, only transactions
3157    /// whose `ExecutedTransaction.transaction_index` is at least this value are
3158    /// returned. Unset starts at the beginning of `start_checkpoint`. An index at
3159    /// or past the checkpoint's transaction count starts at the next checkpoint.
3160    /// Requires `start_checkpoint`. When this position leaves transactions of
3161    /// `start_checkpoint` out, a descending query does not report that checkpoint
3162    /// as covered in `Watermark.checkpoint`.
3163    ///
3164    /// Combines with `options.after` by intersection: the query starts at
3165    /// whichever of the two is later in ledger order.
3166    ///
3167    /// Servers that predate this field ignore it and start at the beginning of
3168    /// `start_checkpoint`, so clients must still drop transactions before this
3169    /// position themselves.
3170    #[prost(uint64, optional, tag = "6")]
3171    pub start_transaction_index: ::core::option::Option<u64>,
3172    /// Optional. Transaction position within the last checkpoint of the range,
3173    /// `end_checkpoint - 1`, at which the query ends (exclusive): within that
3174    /// checkpoint, only transactions whose `ExecutedTransaction.transaction_index`
3175    /// is below this value are returned, so 0 returns none of it. Unset ends after
3176    /// the whole checkpoint. An index at or past the checkpoint's transaction
3177    /// count ends after the whole checkpoint. Requires `end_checkpoint`. A query
3178    /// that stops at this position ends with `QUERY_END_REASON_CHECKPOINT_BOUND`.
3179    /// When this position leaves transactions of that checkpoint out, an
3180    /// ascending query does not report it as covered in `Watermark.checkpoint`.
3181    ///
3182    /// Combines with `options.before` by intersection: the query ends at
3183    /// whichever of the two is earlier in ledger order.
3184    ///
3185    /// Servers that predate this field ignore it and return the whole
3186    /// checkpoint, so clients must still drop transactions at or after this
3187    /// position themselves.
3188    #[prost(uint64, optional, tag = "7")]
3189    pub end_transaction_index: ::core::option::Option<u64>,
3190}
3191/// Response message for LedgerService.ListTransactions.
3192///
3193/// Every frame carries a `watermark` with a safe resume cursor. A frame
3194/// with `transaction` set delivers one matching item; a frame without it reports
3195/// scan progress or terminal completion. Watermarks never regress in the
3196/// requested ordering but may repeat.
3197///
3198/// `end` is set exactly once, on the final frame of a successful stream. For
3199/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
3200/// every other end reason, the final frame has no `transaction` payload.
3201#[non_exhaustive]
3202#[derive(Clone, PartialEq, ::prost::Message)]
3203pub struct ListTransactionsResponse {
3204    /// One matching transaction. Its position within the containing checkpoint
3205    /// is reported by `ExecutedTransaction.transaction_index`.
3206    #[prost(message, optional, tag = "1")]
3207    pub transaction: ::core::option::Option<ExecutedTransaction>,
3208    /// Progress watermark as of this frame. Present on every frame. A
3209    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
3210    /// its authoritative scan frontier was already emitted.
3211    #[prost(message, optional, tag = "2")]
3212    pub watermark: ::core::option::Option<Watermark>,
3213    /// Set exactly once, on the final frame of a successful query stream.
3214    #[prost(message, optional, tag = "3")]
3215    pub end: ::core::option::Option<QueryEnd>,
3216}
3217/// Request message for LedgerService.ListEvents.
3218#[non_exhaustive]
3219#[derive(Clone, PartialEq, ::prost::Message)]
3220pub struct ListEventsRequest {
3221    /// Optional. Mask for specifying which parts of the Event should be returned.
3222    #[prost(message, optional, tag = "1")]
3223    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
3224    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
3225    /// genesis.
3226    #[prost(uint64, optional, tag = "2")]
3227    pub start_checkpoint: ::core::option::Option<u64>,
3228    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
3229    /// current indexed ledger tip.
3230    #[prost(uint64, optional, tag = "3")]
3231    pub end_checkpoint: ::core::option::Option<u64>,
3232    /// Optional. DNF filter over indexed dimensions.
3233    /// If absent, all events in the range are returned.
3234    #[prost(message, optional, tag = "4")]
3235    pub filter: ::core::option::Option<EventFilter>,
3236    /// Optional cursor-bounded query options. If unspecified, reads in ascending
3237    /// order with the default item limit. The server enforces a maximum item
3238    /// limit and silently coerces larger values down to it. To paginate, pass
3239    /// the last received `Watermark.cursor` as `options.after` (ascending) or
3240    /// `options.before` (descending) on the next request.
3241    #[prost(message, optional, tag = "5")]
3242    pub options: ::core::option::Option<QueryOptions>,
3243    /// Optional. Transaction position within `start_checkpoint` at which the
3244    /// query starts (inclusive): within `start_checkpoint`, only events of
3245    /// transactions whose `Event.transaction_index` is at least this value are
3246    /// returned. Unset starts at the beginning of `start_checkpoint`. An index at
3247    /// or past the checkpoint's transaction count starts at the next checkpoint,
3248    /// ignoring `start_event_index`. Requires `start_checkpoint`. When this
3249    /// position leaves events of `start_checkpoint` out, a descending query does
3250    /// not report that checkpoint as covered in `Watermark.checkpoint`.
3251    ///
3252    /// Combines with `options.after` by intersection: the query starts at
3253    /// whichever of the two is later in ledger order.
3254    ///
3255    /// Servers that predate this field ignore it and start at the beginning of
3256    /// `start_checkpoint`, so clients must still drop events before this
3257    /// position themselves.
3258    #[prost(uint64, optional, tag = "6")]
3259    pub start_transaction_index: ::core::option::Option<u64>,
3260    /// Optional. Event position within the transaction at
3261    /// `start_transaction_index` at which the query starts (inclusive): within
3262    /// that transaction, only events whose `Event.event_index` is at least this
3263    /// value are returned. Unset starts at the transaction's first event. An
3264    /// index past the transaction's last event starts at the next transaction.
3265    /// Requires `start_transaction_index`.
3266    ///
3267    /// Servers that predate this field ignore it, as for
3268    /// `start_transaction_index`.
3269    #[prost(uint32, optional, tag = "7")]
3270    pub start_event_index: ::core::option::Option<u32>,
3271    /// Optional. Transaction position within the last checkpoint of the range,
3272    /// `end_checkpoint - 1`, at which the query ends (exclusive): within that
3273    /// checkpoint, only events of transactions whose `Event.transaction_index` is
3274    /// below this value are returned, plus, with `end_event_index`, the events
3275    /// of the transaction at this index that precede it. Unset ends after the
3276    /// whole checkpoint. An index at or past the checkpoint's transaction count
3277    /// ends after the whole checkpoint. Requires `end_checkpoint`. A query that
3278    /// stops at this position ends with `QUERY_END_REASON_CHECKPOINT_BOUND`.
3279    /// When this position leaves events of that checkpoint out, an ascending
3280    /// query does not report it as covered in `Watermark.checkpoint`.
3281    ///
3282    /// Combines with `options.before` by intersection: the query ends at
3283    /// whichever of the two is earlier in ledger order.
3284    ///
3285    /// Servers that predate this field ignore it and return the whole
3286    /// checkpoint, so clients must still drop events at or after this position
3287    /// themselves.
3288    #[prost(uint64, optional, tag = "8")]
3289    pub end_transaction_index: ::core::option::Option<u64>,
3290    /// Optional. Event position within the transaction at
3291    /// `end_transaction_index` at which the query ends (exclusive): events of
3292    /// that transaction whose `Event.event_index` is below this value are also
3293    /// returned. Unset, like 0, returns none of the transaction's events. An
3294    /// index past the transaction's last event returns all of them. Requires
3295    /// `end_transaction_index`.
3296    ///
3297    /// Servers that predate this field ignore it, as for
3298    /// `end_transaction_index`.
3299    #[prost(uint32, optional, tag = "9")]
3300    pub end_event_index: ::core::option::Option<u32>,
3301}
3302/// Response message for LedgerService.ListEvents.
3303///
3304/// Every frame carries a `watermark` with a safe resume cursor. A frame
3305/// with `event` set delivers one matching item; a frame without it reports scan
3306/// progress or terminal completion. Watermarks never regress in the requested
3307/// ordering but may repeat.
3308///
3309/// `end` is set exactly once, on the final frame of a successful stream. For
3310/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
3311/// every other end reason, the final frame has no `event` payload.
3312#[non_exhaustive]
3313#[derive(Clone, PartialEq, ::prost::Message)]
3314pub struct ListEventsResponse {
3315    /// One matching event. Its ledger position -- containing checkpoint,
3316    /// emitting transaction digest and offset, and index within that
3317    /// transaction's event list -- is reported by the corresponding fields on
3318    /// `Event`.
3319    #[prost(message, optional, tag = "1")]
3320    pub event: ::core::option::Option<Event>,
3321    /// Progress watermark as of this frame. Present on every frame. A
3322    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
3323    /// its authoritative scan frontier was already emitted.
3324    #[prost(message, optional, tag = "2")]
3325    pub watermark: ::core::option::Option<Watermark>,
3326    /// Set exactly once, on the final frame of a successful query stream.
3327    #[prost(message, optional, tag = "3")]
3328    pub end: ::core::option::Option<QueryEnd>,
3329}
3330/// Generated client implementations.
3331pub mod ledger_service_client {
3332    #![allow(
3333        unused_variables,
3334        dead_code,
3335        missing_docs,
3336        clippy::wildcard_imports,
3337        clippy::let_unit_value,
3338    )]
3339    use tonic::codegen::*;
3340    use tonic::codegen::http::Uri;
3341    #[derive(Debug, Clone)]
3342    pub struct LedgerServiceClient<T> {
3343        inner: tonic::client::Grpc<T>,
3344    }
3345    impl LedgerServiceClient<tonic::transport::Channel> {
3346        /// Attempt to create a new client by connecting to a given endpoint.
3347        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3348        where
3349            D: TryInto<tonic::transport::Endpoint>,
3350            D::Error: Into<StdError>,
3351        {
3352            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3353            Ok(Self::new(conn))
3354        }
3355    }
3356    impl<T> LedgerServiceClient<T>
3357    where
3358        T: tonic::client::GrpcService<tonic::body::Body>,
3359        T::Error: Into<StdError>,
3360        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3361        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3362    {
3363        pub fn new(inner: T) -> Self {
3364            let inner = tonic::client::Grpc::new(inner);
3365            Self { inner }
3366        }
3367        pub fn with_origin(inner: T, origin: Uri) -> Self {
3368            let inner = tonic::client::Grpc::with_origin(inner, origin);
3369            Self { inner }
3370        }
3371        pub fn with_interceptor<F>(
3372            inner: T,
3373            interceptor: F,
3374        ) -> LedgerServiceClient<InterceptedService<T, F>>
3375        where
3376            F: tonic::service::Interceptor,
3377            T::ResponseBody: Default,
3378            T: tonic::codegen::Service<
3379                http::Request<tonic::body::Body>,
3380                Response = http::Response<
3381                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3382                >,
3383            >,
3384            <T as tonic::codegen::Service<
3385                http::Request<tonic::body::Body>,
3386            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3387        {
3388            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
3389        }
3390        /// Compress requests with the given encoding.
3391        ///
3392        /// This requires the server to support it otherwise it might respond with an
3393        /// error.
3394        #[must_use]
3395        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3396            self.inner = self.inner.send_compressed(encoding);
3397            self
3398        }
3399        /// Enable decompressing responses.
3400        #[must_use]
3401        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3402            self.inner = self.inner.accept_compressed(encoding);
3403            self
3404        }
3405        /// Limits the maximum size of a decoded message.
3406        ///
3407        /// Default: `4MB`
3408        #[must_use]
3409        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3410            self.inner = self.inner.max_decoding_message_size(limit);
3411            self
3412        }
3413        /// Limits the maximum size of an encoded message.
3414        ///
3415        /// Default: `usize::MAX`
3416        #[must_use]
3417        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3418            self.inner = self.inner.max_encoding_message_size(limit);
3419            self
3420        }
3421        /// Query the service for general information about its current state.
3422        pub async fn get_service_info(
3423            &mut self,
3424            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
3425        ) -> std::result::Result<
3426            tonic::Response<super::GetServiceInfoResponse>,
3427            tonic::Status,
3428        > {
3429            self.inner
3430                .ready()
3431                .await
3432                .map_err(|e| {
3433                    tonic::Status::unknown(
3434                        format!("Service was not ready: {}", e.into()),
3435                    )
3436                })?;
3437            let codec = tonic_prost::ProstCodec::default();
3438            let path = http::uri::PathAndQuery::from_static(
3439                "/sui.rpc.v2.LedgerService/GetServiceInfo",
3440            );
3441            let mut req = request.into_request();
3442            req.extensions_mut()
3443                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
3444            self.inner.unary(req, path, codec).await
3445        }
3446        pub async fn get_object(
3447            &mut self,
3448            request: impl tonic::IntoRequest<super::GetObjectRequest>,
3449        ) -> std::result::Result<
3450            tonic::Response<super::GetObjectResponse>,
3451            tonic::Status,
3452        > {
3453            self.inner
3454                .ready()
3455                .await
3456                .map_err(|e| {
3457                    tonic::Status::unknown(
3458                        format!("Service was not ready: {}", e.into()),
3459                    )
3460                })?;
3461            let codec = tonic_prost::ProstCodec::default();
3462            let path = http::uri::PathAndQuery::from_static(
3463                "/sui.rpc.v2.LedgerService/GetObject",
3464            );
3465            let mut req = request.into_request();
3466            req.extensions_mut()
3467                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
3468            self.inner.unary(req, path, codec).await
3469        }
3470        pub async fn batch_get_objects(
3471            &mut self,
3472            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
3473        ) -> std::result::Result<
3474            tonic::Response<super::BatchGetObjectsResponse>,
3475            tonic::Status,
3476        > {
3477            self.inner
3478                .ready()
3479                .await
3480                .map_err(|e| {
3481                    tonic::Status::unknown(
3482                        format!("Service was not ready: {}", e.into()),
3483                    )
3484                })?;
3485            let codec = tonic_prost::ProstCodec::default();
3486            let path = http::uri::PathAndQuery::from_static(
3487                "/sui.rpc.v2.LedgerService/BatchGetObjects",
3488            );
3489            let mut req = request.into_request();
3490            req.extensions_mut()
3491                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
3492            self.inner.unary(req, path, codec).await
3493        }
3494        /// List one object's history: its live versions and the versions at which it
3495        /// was deleted or wrapped, in ascending or descending version order, one per
3496        /// response frame, paged by cursor.
3497        ///
3498        /// Servers that prune history, such as fullnodes, list the versions they
3499        /// retain; see `ListObjectVersionsRequest`.
3500        pub async fn list_object_versions(
3501            &mut self,
3502            request: impl tonic::IntoRequest<super::ListObjectVersionsRequest>,
3503        ) -> std::result::Result<
3504            tonic::Response<tonic::codec::Streaming<super::ListObjectVersionsResponse>>,
3505            tonic::Status,
3506        > {
3507            self.inner
3508                .ready()
3509                .await
3510                .map_err(|e| {
3511                    tonic::Status::unknown(
3512                        format!("Service was not ready: {}", e.into()),
3513                    )
3514                })?;
3515            let codec = tonic_prost::ProstCodec::default();
3516            let path = http::uri::PathAndQuery::from_static(
3517                "/sui.rpc.v2.LedgerService/ListObjectVersions",
3518            );
3519            let mut req = request.into_request();
3520            req.extensions_mut()
3521                .insert(
3522                    GrpcMethod::new("sui.rpc.v2.LedgerService", "ListObjectVersions"),
3523                );
3524            self.inner.server_streaming(req, path, codec).await
3525        }
3526        pub async fn get_transaction(
3527            &mut self,
3528            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
3529        ) -> std::result::Result<
3530            tonic::Response<super::GetTransactionResponse>,
3531            tonic::Status,
3532        > {
3533            self.inner
3534                .ready()
3535                .await
3536                .map_err(|e| {
3537                    tonic::Status::unknown(
3538                        format!("Service was not ready: {}", e.into()),
3539                    )
3540                })?;
3541            let codec = tonic_prost::ProstCodec::default();
3542            let path = http::uri::PathAndQuery::from_static(
3543                "/sui.rpc.v2.LedgerService/GetTransaction",
3544            );
3545            let mut req = request.into_request();
3546            req.extensions_mut()
3547                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
3548            self.inner.unary(req, path, codec).await
3549        }
3550        pub async fn batch_get_transactions(
3551            &mut self,
3552            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
3553        ) -> std::result::Result<
3554            tonic::Response<super::BatchGetTransactionsResponse>,
3555            tonic::Status,
3556        > {
3557            self.inner
3558                .ready()
3559                .await
3560                .map_err(|e| {
3561                    tonic::Status::unknown(
3562                        format!("Service was not ready: {}", e.into()),
3563                    )
3564                })?;
3565            let codec = tonic_prost::ProstCodec::default();
3566            let path = http::uri::PathAndQuery::from_static(
3567                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
3568            );
3569            let mut req = request.into_request();
3570            req.extensions_mut()
3571                .insert(
3572                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
3573                );
3574            self.inner.unary(req, path, codec).await
3575        }
3576        pub async fn get_checkpoint(
3577            &mut self,
3578            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
3579        ) -> std::result::Result<
3580            tonic::Response<super::GetCheckpointResponse>,
3581            tonic::Status,
3582        > {
3583            self.inner
3584                .ready()
3585                .await
3586                .map_err(|e| {
3587                    tonic::Status::unknown(
3588                        format!("Service was not ready: {}", e.into()),
3589                    )
3590                })?;
3591            let codec = tonic_prost::ProstCodec::default();
3592            let path = http::uri::PathAndQuery::from_static(
3593                "/sui.rpc.v2.LedgerService/GetCheckpoint",
3594            );
3595            let mut req = request.into_request();
3596            req.extensions_mut()
3597                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
3598            self.inner.unary(req, path, codec).await
3599        }
3600        pub async fn get_epoch(
3601            &mut self,
3602            request: impl tonic::IntoRequest<super::GetEpochRequest>,
3603        ) -> std::result::Result<
3604            tonic::Response<super::GetEpochResponse>,
3605            tonic::Status,
3606        > {
3607            self.inner
3608                .ready()
3609                .await
3610                .map_err(|e| {
3611                    tonic::Status::unknown(
3612                        format!("Service was not ready: {}", e.into()),
3613                    )
3614                })?;
3615            let codec = tonic_prost::ProstCodec::default();
3616            let path = http::uri::PathAndQuery::from_static(
3617                "/sui.rpc.v2.LedgerService/GetEpoch",
3618            );
3619            let mut req = request.into_request();
3620            req.extensions_mut()
3621                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
3622            self.inner.unary(req, path, codec).await
3623        }
3624        /// Get the protocol config of a protocol version.
3625        ///
3626        /// With `version` unset, it returns the config of the current protocol
3627        /// version: on fullnodes, the version of their live system state; on kv-rpc,
3628        /// the version in force at the highest checkpoint it has indexed. A
3629        /// `version` above the current one fails with `NOT_FOUND`. kv-rpc also
3630        /// answers `NOT_FOUND` for a version the chain skipped: a protocol upgrade
3631        /// can advance the version by more than one, and a skipped version has no
3632        /// config. Fullnodes compute configs from their own binary and serve every
3633        /// version up to the current one.
3634        ///
3635        /// A server not set up to serve this method fails with `UNIMPLEMENTED` and
3636        /// reason `NOT_SERVED_HERE`.
3637        pub async fn get_protocol_config(
3638            &mut self,
3639            request: impl tonic::IntoRequest<super::GetProtocolConfigRequest>,
3640        ) -> std::result::Result<
3641            tonic::Response<super::GetProtocolConfigResponse>,
3642            tonic::Status,
3643        > {
3644            self.inner
3645                .ready()
3646                .await
3647                .map_err(|e| {
3648                    tonic::Status::unknown(
3649                        format!("Service was not ready: {}", e.into()),
3650                    )
3651                })?;
3652            let codec = tonic_prost::ProstCodec::default();
3653            let path = http::uri::PathAndQuery::from_static(
3654                "/sui.rpc.v2.LedgerService/GetProtocolConfig",
3655            );
3656            let mut req = request.into_request();
3657            req.extensions_mut()
3658                .insert(
3659                    GrpcMethod::new("sui.rpc.v2.LedgerService", "GetProtocolConfig"),
3660                );
3661            self.inner.unary(req, path, codec).await
3662        }
3663        /// List checkpoints matching the provided filters.
3664        ///
3665        /// Checkpoints are returned in ascending or descending checkpoint sequence
3666        /// number order according to the query options ordering.
3667        /// A checkpoint matches if any transaction it contains satisfies the filter.
3668        pub async fn list_checkpoints(
3669            &mut self,
3670            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
3671        ) -> std::result::Result<
3672            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
3673            tonic::Status,
3674        > {
3675            self.inner
3676                .ready()
3677                .await
3678                .map_err(|e| {
3679                    tonic::Status::unknown(
3680                        format!("Service was not ready: {}", e.into()),
3681                    )
3682                })?;
3683            let codec = tonic_prost::ProstCodec::default();
3684            let path = http::uri::PathAndQuery::from_static(
3685                "/sui.rpc.v2.LedgerService/ListCheckpoints",
3686            );
3687            let mut req = request.into_request();
3688            req.extensions_mut()
3689                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
3690            self.inner.server_streaming(req, path, codec).await
3691        }
3692        /// List transactions matching the provided filters.
3693        ///
3694        /// Transactions are returned in ascending or descending transaction sequence
3695        /// order according to the query options ordering.
3696        pub async fn list_transactions(
3697            &mut self,
3698            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
3699        ) -> std::result::Result<
3700            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
3701            tonic::Status,
3702        > {
3703            self.inner
3704                .ready()
3705                .await
3706                .map_err(|e| {
3707                    tonic::Status::unknown(
3708                        format!("Service was not ready: {}", e.into()),
3709                    )
3710                })?;
3711            let codec = tonic_prost::ProstCodec::default();
3712            let path = http::uri::PathAndQuery::from_static(
3713                "/sui.rpc.v2.LedgerService/ListTransactions",
3714            );
3715            let mut req = request.into_request();
3716            req.extensions_mut()
3717                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
3718            self.inner.server_streaming(req, path, codec).await
3719        }
3720        /// List events matching the provided filters.
3721        ///
3722        /// Events are returned in ascending or descending packed event sequence order
3723        /// according to the query options ordering.
3724        pub async fn list_events(
3725            &mut self,
3726            request: impl tonic::IntoRequest<super::ListEventsRequest>,
3727        ) -> std::result::Result<
3728            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
3729            tonic::Status,
3730        > {
3731            self.inner
3732                .ready()
3733                .await
3734                .map_err(|e| {
3735                    tonic::Status::unknown(
3736                        format!("Service was not ready: {}", e.into()),
3737                    )
3738                })?;
3739            let codec = tonic_prost::ProstCodec::default();
3740            let path = http::uri::PathAndQuery::from_static(
3741                "/sui.rpc.v2.LedgerService/ListEvents",
3742            );
3743            let mut req = request.into_request();
3744            req.extensions_mut()
3745                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
3746            self.inner.server_streaming(req, path, codec).await
3747        }
3748    }
3749}
3750/// Generated server implementations.
3751pub mod ledger_service_server {
3752    #![allow(
3753        unused_variables,
3754        dead_code,
3755        missing_docs,
3756        clippy::wildcard_imports,
3757        clippy::let_unit_value,
3758    )]
3759    use tonic::codegen::*;
3760    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
3761    #[async_trait]
3762    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
3763        /// Query the service for general information about its current state.
3764        async fn get_service_info(
3765            &self,
3766            request: tonic::Request<super::GetServiceInfoRequest>,
3767        ) -> std::result::Result<
3768            tonic::Response<super::GetServiceInfoResponse>,
3769            tonic::Status,
3770        > {
3771            Err(tonic::Status::unimplemented("Not yet implemented"))
3772        }
3773        async fn get_object(
3774            &self,
3775            request: tonic::Request<super::GetObjectRequest>,
3776        ) -> std::result::Result<
3777            tonic::Response<super::GetObjectResponse>,
3778            tonic::Status,
3779        > {
3780            Err(tonic::Status::unimplemented("Not yet implemented"))
3781        }
3782        async fn batch_get_objects(
3783            &self,
3784            request: tonic::Request<super::BatchGetObjectsRequest>,
3785        ) -> std::result::Result<
3786            tonic::Response<super::BatchGetObjectsResponse>,
3787            tonic::Status,
3788        > {
3789            Err(tonic::Status::unimplemented("Not yet implemented"))
3790        }
3791        /// List one object's history: its live versions and the versions at which it
3792        /// was deleted or wrapped, in ascending or descending version order, one per
3793        /// response frame, paged by cursor.
3794        ///
3795        /// Servers that prune history, such as fullnodes, list the versions they
3796        /// retain; see `ListObjectVersionsRequest`.
3797        async fn list_object_versions(
3798            &self,
3799            request: tonic::Request<super::ListObjectVersionsRequest>,
3800        ) -> std::result::Result<
3801            tonic::Response<BoxStream<super::ListObjectVersionsResponse>>,
3802            tonic::Status,
3803        > {
3804            Err(tonic::Status::unimplemented("Not yet implemented"))
3805        }
3806        async fn get_transaction(
3807            &self,
3808            request: tonic::Request<super::GetTransactionRequest>,
3809        ) -> std::result::Result<
3810            tonic::Response<super::GetTransactionResponse>,
3811            tonic::Status,
3812        > {
3813            Err(tonic::Status::unimplemented("Not yet implemented"))
3814        }
3815        async fn batch_get_transactions(
3816            &self,
3817            request: tonic::Request<super::BatchGetTransactionsRequest>,
3818        ) -> std::result::Result<
3819            tonic::Response<super::BatchGetTransactionsResponse>,
3820            tonic::Status,
3821        > {
3822            Err(tonic::Status::unimplemented("Not yet implemented"))
3823        }
3824        async fn get_checkpoint(
3825            &self,
3826            request: tonic::Request<super::GetCheckpointRequest>,
3827        ) -> std::result::Result<
3828            tonic::Response<super::GetCheckpointResponse>,
3829            tonic::Status,
3830        > {
3831            Err(tonic::Status::unimplemented("Not yet implemented"))
3832        }
3833        async fn get_epoch(
3834            &self,
3835            request: tonic::Request<super::GetEpochRequest>,
3836        ) -> std::result::Result<
3837            tonic::Response<super::GetEpochResponse>,
3838            tonic::Status,
3839        > {
3840            Err(tonic::Status::unimplemented("Not yet implemented"))
3841        }
3842        /// Get the protocol config of a protocol version.
3843        ///
3844        /// With `version` unset, it returns the config of the current protocol
3845        /// version: on fullnodes, the version of their live system state; on kv-rpc,
3846        /// the version in force at the highest checkpoint it has indexed. A
3847        /// `version` above the current one fails with `NOT_FOUND`. kv-rpc also
3848        /// answers `NOT_FOUND` for a version the chain skipped: a protocol upgrade
3849        /// can advance the version by more than one, and a skipped version has no
3850        /// config. Fullnodes compute configs from their own binary and serve every
3851        /// version up to the current one.
3852        ///
3853        /// A server not set up to serve this method fails with `UNIMPLEMENTED` and
3854        /// reason `NOT_SERVED_HERE`.
3855        async fn get_protocol_config(
3856            &self,
3857            request: tonic::Request<super::GetProtocolConfigRequest>,
3858        ) -> std::result::Result<
3859            tonic::Response<super::GetProtocolConfigResponse>,
3860            tonic::Status,
3861        > {
3862            Err(tonic::Status::unimplemented("Not yet implemented"))
3863        }
3864        /// List checkpoints matching the provided filters.
3865        ///
3866        /// Checkpoints are returned in ascending or descending checkpoint sequence
3867        /// number order according to the query options ordering.
3868        /// A checkpoint matches if any transaction it contains satisfies the filter.
3869        async fn list_checkpoints(
3870            &self,
3871            request: tonic::Request<super::ListCheckpointsRequest>,
3872        ) -> std::result::Result<
3873            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
3874            tonic::Status,
3875        > {
3876            Err(tonic::Status::unimplemented("Not yet implemented"))
3877        }
3878        /// List transactions matching the provided filters.
3879        ///
3880        /// Transactions are returned in ascending or descending transaction sequence
3881        /// order according to the query options ordering.
3882        async fn list_transactions(
3883            &self,
3884            request: tonic::Request<super::ListTransactionsRequest>,
3885        ) -> std::result::Result<
3886            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
3887            tonic::Status,
3888        > {
3889            Err(tonic::Status::unimplemented("Not yet implemented"))
3890        }
3891        /// List events matching the provided filters.
3892        ///
3893        /// Events are returned in ascending or descending packed event sequence order
3894        /// according to the query options ordering.
3895        async fn list_events(
3896            &self,
3897            request: tonic::Request<super::ListEventsRequest>,
3898        ) -> std::result::Result<
3899            tonic::Response<BoxStream<super::ListEventsResponse>>,
3900            tonic::Status,
3901        > {
3902            Err(tonic::Status::unimplemented("Not yet implemented"))
3903        }
3904    }
3905    #[derive(Debug)]
3906    pub struct LedgerServiceServer<T> {
3907        inner: Arc<T>,
3908        accept_compression_encodings: EnabledCompressionEncodings,
3909        send_compression_encodings: EnabledCompressionEncodings,
3910        max_decoding_message_size: Option<usize>,
3911        max_encoding_message_size: Option<usize>,
3912    }
3913    impl<T> LedgerServiceServer<T> {
3914        pub fn new(inner: T) -> Self {
3915            Self::from_arc(Arc::new(inner))
3916        }
3917        pub fn from_arc(inner: Arc<T>) -> Self {
3918            Self {
3919                inner,
3920                accept_compression_encodings: Default::default(),
3921                send_compression_encodings: Default::default(),
3922                max_decoding_message_size: None,
3923                max_encoding_message_size: None,
3924            }
3925        }
3926        pub fn with_interceptor<F>(
3927            inner: T,
3928            interceptor: F,
3929        ) -> InterceptedService<Self, F>
3930        where
3931            F: tonic::service::Interceptor,
3932        {
3933            InterceptedService::new(Self::new(inner), interceptor)
3934        }
3935        /// Enable decompressing requests with the given encoding.
3936        #[must_use]
3937        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3938            self.accept_compression_encodings.enable(encoding);
3939            self
3940        }
3941        /// Compress responses with the given encoding, if the client supports it.
3942        #[must_use]
3943        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3944            self.send_compression_encodings.enable(encoding);
3945            self
3946        }
3947        /// Limits the maximum size of a decoded message.
3948        ///
3949        /// Default: `4MB`
3950        #[must_use]
3951        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3952            self.max_decoding_message_size = Some(limit);
3953            self
3954        }
3955        /// Limits the maximum size of an encoded message.
3956        ///
3957        /// Default: `usize::MAX`
3958        #[must_use]
3959        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3960            self.max_encoding_message_size = Some(limit);
3961            self
3962        }
3963    }
3964    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
3965    where
3966        T: LedgerService,
3967        B: Body + std::marker::Send + 'static,
3968        B::Error: Into<StdError> + std::marker::Send + 'static,
3969    {
3970        type Response = http::Response<tonic::body::Body>;
3971        type Error = std::convert::Infallible;
3972        type Future = BoxFuture<Self::Response, Self::Error>;
3973        fn poll_ready(
3974            &mut self,
3975            _cx: &mut Context<'_>,
3976        ) -> Poll<std::result::Result<(), Self::Error>> {
3977            Poll::Ready(Ok(()))
3978        }
3979        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3980            match req.uri().path() {
3981                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
3982                    #[allow(non_camel_case_types)]
3983                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
3984                    impl<
3985                        T: LedgerService,
3986                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
3987                    for GetServiceInfoSvc<T> {
3988                        type Response = super::GetServiceInfoResponse;
3989                        type Future = BoxFuture<
3990                            tonic::Response<Self::Response>,
3991                            tonic::Status,
3992                        >;
3993                        fn call(
3994                            &mut self,
3995                            request: tonic::Request<super::GetServiceInfoRequest>,
3996                        ) -> Self::Future {
3997                            let inner = Arc::clone(&self.0);
3998                            let fut = async move {
3999                                <T as LedgerService>::get_service_info(&inner, request)
4000                                    .await
4001                            };
4002                            Box::pin(fut)
4003                        }
4004                    }
4005                    let accept_compression_encodings = self.accept_compression_encodings;
4006                    let send_compression_encodings = self.send_compression_encodings;
4007                    let max_decoding_message_size = self.max_decoding_message_size;
4008                    let max_encoding_message_size = self.max_encoding_message_size;
4009                    let inner = self.inner.clone();
4010                    let fut = async move {
4011                        let method = GetServiceInfoSvc(inner);
4012                        let codec = tonic_prost::ProstCodec::default();
4013                        let mut grpc = tonic::server::Grpc::new(codec)
4014                            .apply_compression_config(
4015                                accept_compression_encodings,
4016                                send_compression_encodings,
4017                            )
4018                            .apply_max_message_size_config(
4019                                max_decoding_message_size,
4020                                max_encoding_message_size,
4021                            );
4022                        let res = grpc.unary(method, req).await;
4023                        Ok(res)
4024                    };
4025                    Box::pin(fut)
4026                }
4027                "/sui.rpc.v2.LedgerService/GetObject" => {
4028                    #[allow(non_camel_case_types)]
4029                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
4030                    impl<
4031                        T: LedgerService,
4032                    > tonic::server::UnaryService<super::GetObjectRequest>
4033                    for GetObjectSvc<T> {
4034                        type Response = super::GetObjectResponse;
4035                        type Future = BoxFuture<
4036                            tonic::Response<Self::Response>,
4037                            tonic::Status,
4038                        >;
4039                        fn call(
4040                            &mut self,
4041                            request: tonic::Request<super::GetObjectRequest>,
4042                        ) -> Self::Future {
4043                            let inner = Arc::clone(&self.0);
4044                            let fut = async move {
4045                                <T as LedgerService>::get_object(&inner, request).await
4046                            };
4047                            Box::pin(fut)
4048                        }
4049                    }
4050                    let accept_compression_encodings = self.accept_compression_encodings;
4051                    let send_compression_encodings = self.send_compression_encodings;
4052                    let max_decoding_message_size = self.max_decoding_message_size;
4053                    let max_encoding_message_size = self.max_encoding_message_size;
4054                    let inner = self.inner.clone();
4055                    let fut = async move {
4056                        let method = GetObjectSvc(inner);
4057                        let codec = tonic_prost::ProstCodec::default();
4058                        let mut grpc = tonic::server::Grpc::new(codec)
4059                            .apply_compression_config(
4060                                accept_compression_encodings,
4061                                send_compression_encodings,
4062                            )
4063                            .apply_max_message_size_config(
4064                                max_decoding_message_size,
4065                                max_encoding_message_size,
4066                            );
4067                        let res = grpc.unary(method, req).await;
4068                        Ok(res)
4069                    };
4070                    Box::pin(fut)
4071                }
4072                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
4073                    #[allow(non_camel_case_types)]
4074                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
4075                    impl<
4076                        T: LedgerService,
4077                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
4078                    for BatchGetObjectsSvc<T> {
4079                        type Response = super::BatchGetObjectsResponse;
4080                        type Future = BoxFuture<
4081                            tonic::Response<Self::Response>,
4082                            tonic::Status,
4083                        >;
4084                        fn call(
4085                            &mut self,
4086                            request: tonic::Request<super::BatchGetObjectsRequest>,
4087                        ) -> Self::Future {
4088                            let inner = Arc::clone(&self.0);
4089                            let fut = async move {
4090                                <T as LedgerService>::batch_get_objects(&inner, request)
4091                                    .await
4092                            };
4093                            Box::pin(fut)
4094                        }
4095                    }
4096                    let accept_compression_encodings = self.accept_compression_encodings;
4097                    let send_compression_encodings = self.send_compression_encodings;
4098                    let max_decoding_message_size = self.max_decoding_message_size;
4099                    let max_encoding_message_size = self.max_encoding_message_size;
4100                    let inner = self.inner.clone();
4101                    let fut = async move {
4102                        let method = BatchGetObjectsSvc(inner);
4103                        let codec = tonic_prost::ProstCodec::default();
4104                        let mut grpc = tonic::server::Grpc::new(codec)
4105                            .apply_compression_config(
4106                                accept_compression_encodings,
4107                                send_compression_encodings,
4108                            )
4109                            .apply_max_message_size_config(
4110                                max_decoding_message_size,
4111                                max_encoding_message_size,
4112                            );
4113                        let res = grpc.unary(method, req).await;
4114                        Ok(res)
4115                    };
4116                    Box::pin(fut)
4117                }
4118                "/sui.rpc.v2.LedgerService/ListObjectVersions" => {
4119                    #[allow(non_camel_case_types)]
4120                    struct ListObjectVersionsSvc<T: LedgerService>(pub Arc<T>);
4121                    impl<
4122                        T: LedgerService,
4123                    > tonic::server::ServerStreamingService<
4124                        super::ListObjectVersionsRequest,
4125                    > for ListObjectVersionsSvc<T> {
4126                        type Response = super::ListObjectVersionsResponse;
4127                        type ResponseStream = BoxStream<
4128                            super::ListObjectVersionsResponse,
4129                        >;
4130                        type Future = BoxFuture<
4131                            tonic::Response<Self::ResponseStream>,
4132                            tonic::Status,
4133                        >;
4134                        fn call(
4135                            &mut self,
4136                            request: tonic::Request<super::ListObjectVersionsRequest>,
4137                        ) -> Self::Future {
4138                            let inner = Arc::clone(&self.0);
4139                            let fut = async move {
4140                                <T as LedgerService>::list_object_versions(&inner, request)
4141                                    .await
4142                            };
4143                            Box::pin(fut)
4144                        }
4145                    }
4146                    let accept_compression_encodings = self.accept_compression_encodings;
4147                    let send_compression_encodings = self.send_compression_encodings;
4148                    let max_decoding_message_size = self.max_decoding_message_size;
4149                    let max_encoding_message_size = self.max_encoding_message_size;
4150                    let inner = self.inner.clone();
4151                    let fut = async move {
4152                        let method = ListObjectVersionsSvc(inner);
4153                        let codec = tonic_prost::ProstCodec::default();
4154                        let mut grpc = tonic::server::Grpc::new(codec)
4155                            .apply_compression_config(
4156                                accept_compression_encodings,
4157                                send_compression_encodings,
4158                            )
4159                            .apply_max_message_size_config(
4160                                max_decoding_message_size,
4161                                max_encoding_message_size,
4162                            );
4163                        let res = grpc.server_streaming(method, req).await;
4164                        Ok(res)
4165                    };
4166                    Box::pin(fut)
4167                }
4168                "/sui.rpc.v2.LedgerService/GetTransaction" => {
4169                    #[allow(non_camel_case_types)]
4170                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
4171                    impl<
4172                        T: LedgerService,
4173                    > tonic::server::UnaryService<super::GetTransactionRequest>
4174                    for GetTransactionSvc<T> {
4175                        type Response = super::GetTransactionResponse;
4176                        type Future = BoxFuture<
4177                            tonic::Response<Self::Response>,
4178                            tonic::Status,
4179                        >;
4180                        fn call(
4181                            &mut self,
4182                            request: tonic::Request<super::GetTransactionRequest>,
4183                        ) -> Self::Future {
4184                            let inner = Arc::clone(&self.0);
4185                            let fut = async move {
4186                                <T as LedgerService>::get_transaction(&inner, request).await
4187                            };
4188                            Box::pin(fut)
4189                        }
4190                    }
4191                    let accept_compression_encodings = self.accept_compression_encodings;
4192                    let send_compression_encodings = self.send_compression_encodings;
4193                    let max_decoding_message_size = self.max_decoding_message_size;
4194                    let max_encoding_message_size = self.max_encoding_message_size;
4195                    let inner = self.inner.clone();
4196                    let fut = async move {
4197                        let method = GetTransactionSvc(inner);
4198                        let codec = tonic_prost::ProstCodec::default();
4199                        let mut grpc = tonic::server::Grpc::new(codec)
4200                            .apply_compression_config(
4201                                accept_compression_encodings,
4202                                send_compression_encodings,
4203                            )
4204                            .apply_max_message_size_config(
4205                                max_decoding_message_size,
4206                                max_encoding_message_size,
4207                            );
4208                        let res = grpc.unary(method, req).await;
4209                        Ok(res)
4210                    };
4211                    Box::pin(fut)
4212                }
4213                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
4214                    #[allow(non_camel_case_types)]
4215                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
4216                    impl<
4217                        T: LedgerService,
4218                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
4219                    for BatchGetTransactionsSvc<T> {
4220                        type Response = super::BatchGetTransactionsResponse;
4221                        type Future = BoxFuture<
4222                            tonic::Response<Self::Response>,
4223                            tonic::Status,
4224                        >;
4225                        fn call(
4226                            &mut self,
4227                            request: tonic::Request<super::BatchGetTransactionsRequest>,
4228                        ) -> Self::Future {
4229                            let inner = Arc::clone(&self.0);
4230                            let fut = async move {
4231                                <T as LedgerService>::batch_get_transactions(
4232                                        &inner,
4233                                        request,
4234                                    )
4235                                    .await
4236                            };
4237                            Box::pin(fut)
4238                        }
4239                    }
4240                    let accept_compression_encodings = self.accept_compression_encodings;
4241                    let send_compression_encodings = self.send_compression_encodings;
4242                    let max_decoding_message_size = self.max_decoding_message_size;
4243                    let max_encoding_message_size = self.max_encoding_message_size;
4244                    let inner = self.inner.clone();
4245                    let fut = async move {
4246                        let method = BatchGetTransactionsSvc(inner);
4247                        let codec = tonic_prost::ProstCodec::default();
4248                        let mut grpc = tonic::server::Grpc::new(codec)
4249                            .apply_compression_config(
4250                                accept_compression_encodings,
4251                                send_compression_encodings,
4252                            )
4253                            .apply_max_message_size_config(
4254                                max_decoding_message_size,
4255                                max_encoding_message_size,
4256                            );
4257                        let res = grpc.unary(method, req).await;
4258                        Ok(res)
4259                    };
4260                    Box::pin(fut)
4261                }
4262                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
4263                    #[allow(non_camel_case_types)]
4264                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
4265                    impl<
4266                        T: LedgerService,
4267                    > tonic::server::UnaryService<super::GetCheckpointRequest>
4268                    for GetCheckpointSvc<T> {
4269                        type Response = super::GetCheckpointResponse;
4270                        type Future = BoxFuture<
4271                            tonic::Response<Self::Response>,
4272                            tonic::Status,
4273                        >;
4274                        fn call(
4275                            &mut self,
4276                            request: tonic::Request<super::GetCheckpointRequest>,
4277                        ) -> Self::Future {
4278                            let inner = Arc::clone(&self.0);
4279                            let fut = async move {
4280                                <T as LedgerService>::get_checkpoint(&inner, request).await
4281                            };
4282                            Box::pin(fut)
4283                        }
4284                    }
4285                    let accept_compression_encodings = self.accept_compression_encodings;
4286                    let send_compression_encodings = self.send_compression_encodings;
4287                    let max_decoding_message_size = self.max_decoding_message_size;
4288                    let max_encoding_message_size = self.max_encoding_message_size;
4289                    let inner = self.inner.clone();
4290                    let fut = async move {
4291                        let method = GetCheckpointSvc(inner);
4292                        let codec = tonic_prost::ProstCodec::default();
4293                        let mut grpc = tonic::server::Grpc::new(codec)
4294                            .apply_compression_config(
4295                                accept_compression_encodings,
4296                                send_compression_encodings,
4297                            )
4298                            .apply_max_message_size_config(
4299                                max_decoding_message_size,
4300                                max_encoding_message_size,
4301                            );
4302                        let res = grpc.unary(method, req).await;
4303                        Ok(res)
4304                    };
4305                    Box::pin(fut)
4306                }
4307                "/sui.rpc.v2.LedgerService/GetEpoch" => {
4308                    #[allow(non_camel_case_types)]
4309                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
4310                    impl<
4311                        T: LedgerService,
4312                    > tonic::server::UnaryService<super::GetEpochRequest>
4313                    for GetEpochSvc<T> {
4314                        type Response = super::GetEpochResponse;
4315                        type Future = BoxFuture<
4316                            tonic::Response<Self::Response>,
4317                            tonic::Status,
4318                        >;
4319                        fn call(
4320                            &mut self,
4321                            request: tonic::Request<super::GetEpochRequest>,
4322                        ) -> Self::Future {
4323                            let inner = Arc::clone(&self.0);
4324                            let fut = async move {
4325                                <T as LedgerService>::get_epoch(&inner, request).await
4326                            };
4327                            Box::pin(fut)
4328                        }
4329                    }
4330                    let accept_compression_encodings = self.accept_compression_encodings;
4331                    let send_compression_encodings = self.send_compression_encodings;
4332                    let max_decoding_message_size = self.max_decoding_message_size;
4333                    let max_encoding_message_size = self.max_encoding_message_size;
4334                    let inner = self.inner.clone();
4335                    let fut = async move {
4336                        let method = GetEpochSvc(inner);
4337                        let codec = tonic_prost::ProstCodec::default();
4338                        let mut grpc = tonic::server::Grpc::new(codec)
4339                            .apply_compression_config(
4340                                accept_compression_encodings,
4341                                send_compression_encodings,
4342                            )
4343                            .apply_max_message_size_config(
4344                                max_decoding_message_size,
4345                                max_encoding_message_size,
4346                            );
4347                        let res = grpc.unary(method, req).await;
4348                        Ok(res)
4349                    };
4350                    Box::pin(fut)
4351                }
4352                "/sui.rpc.v2.LedgerService/GetProtocolConfig" => {
4353                    #[allow(non_camel_case_types)]
4354                    struct GetProtocolConfigSvc<T: LedgerService>(pub Arc<T>);
4355                    impl<
4356                        T: LedgerService,
4357                    > tonic::server::UnaryService<super::GetProtocolConfigRequest>
4358                    for GetProtocolConfigSvc<T> {
4359                        type Response = super::GetProtocolConfigResponse;
4360                        type Future = BoxFuture<
4361                            tonic::Response<Self::Response>,
4362                            tonic::Status,
4363                        >;
4364                        fn call(
4365                            &mut self,
4366                            request: tonic::Request<super::GetProtocolConfigRequest>,
4367                        ) -> Self::Future {
4368                            let inner = Arc::clone(&self.0);
4369                            let fut = async move {
4370                                <T as LedgerService>::get_protocol_config(&inner, request)
4371                                    .await
4372                            };
4373                            Box::pin(fut)
4374                        }
4375                    }
4376                    let accept_compression_encodings = self.accept_compression_encodings;
4377                    let send_compression_encodings = self.send_compression_encodings;
4378                    let max_decoding_message_size = self.max_decoding_message_size;
4379                    let max_encoding_message_size = self.max_encoding_message_size;
4380                    let inner = self.inner.clone();
4381                    let fut = async move {
4382                        let method = GetProtocolConfigSvc(inner);
4383                        let codec = tonic_prost::ProstCodec::default();
4384                        let mut grpc = tonic::server::Grpc::new(codec)
4385                            .apply_compression_config(
4386                                accept_compression_encodings,
4387                                send_compression_encodings,
4388                            )
4389                            .apply_max_message_size_config(
4390                                max_decoding_message_size,
4391                                max_encoding_message_size,
4392                            );
4393                        let res = grpc.unary(method, req).await;
4394                        Ok(res)
4395                    };
4396                    Box::pin(fut)
4397                }
4398                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
4399                    #[allow(non_camel_case_types)]
4400                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
4401                    impl<
4402                        T: LedgerService,
4403                    > tonic::server::ServerStreamingService<
4404                        super::ListCheckpointsRequest,
4405                    > for ListCheckpointsSvc<T> {
4406                        type Response = super::ListCheckpointsResponse;
4407                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
4408                        type Future = BoxFuture<
4409                            tonic::Response<Self::ResponseStream>,
4410                            tonic::Status,
4411                        >;
4412                        fn call(
4413                            &mut self,
4414                            request: tonic::Request<super::ListCheckpointsRequest>,
4415                        ) -> Self::Future {
4416                            let inner = Arc::clone(&self.0);
4417                            let fut = async move {
4418                                <T as LedgerService>::list_checkpoints(&inner, request)
4419                                    .await
4420                            };
4421                            Box::pin(fut)
4422                        }
4423                    }
4424                    let accept_compression_encodings = self.accept_compression_encodings;
4425                    let send_compression_encodings = self.send_compression_encodings;
4426                    let max_decoding_message_size = self.max_decoding_message_size;
4427                    let max_encoding_message_size = self.max_encoding_message_size;
4428                    let inner = self.inner.clone();
4429                    let fut = async move {
4430                        let method = ListCheckpointsSvc(inner);
4431                        let codec = tonic_prost::ProstCodec::default();
4432                        let mut grpc = tonic::server::Grpc::new(codec)
4433                            .apply_compression_config(
4434                                accept_compression_encodings,
4435                                send_compression_encodings,
4436                            )
4437                            .apply_max_message_size_config(
4438                                max_decoding_message_size,
4439                                max_encoding_message_size,
4440                            );
4441                        let res = grpc.server_streaming(method, req).await;
4442                        Ok(res)
4443                    };
4444                    Box::pin(fut)
4445                }
4446                "/sui.rpc.v2.LedgerService/ListTransactions" => {
4447                    #[allow(non_camel_case_types)]
4448                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
4449                    impl<
4450                        T: LedgerService,
4451                    > tonic::server::ServerStreamingService<
4452                        super::ListTransactionsRequest,
4453                    > for ListTransactionsSvc<T> {
4454                        type Response = super::ListTransactionsResponse;
4455                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
4456                        type Future = BoxFuture<
4457                            tonic::Response<Self::ResponseStream>,
4458                            tonic::Status,
4459                        >;
4460                        fn call(
4461                            &mut self,
4462                            request: tonic::Request<super::ListTransactionsRequest>,
4463                        ) -> Self::Future {
4464                            let inner = Arc::clone(&self.0);
4465                            let fut = async move {
4466                                <T as LedgerService>::list_transactions(&inner, request)
4467                                    .await
4468                            };
4469                            Box::pin(fut)
4470                        }
4471                    }
4472                    let accept_compression_encodings = self.accept_compression_encodings;
4473                    let send_compression_encodings = self.send_compression_encodings;
4474                    let max_decoding_message_size = self.max_decoding_message_size;
4475                    let max_encoding_message_size = self.max_encoding_message_size;
4476                    let inner = self.inner.clone();
4477                    let fut = async move {
4478                        let method = ListTransactionsSvc(inner);
4479                        let codec = tonic_prost::ProstCodec::default();
4480                        let mut grpc = tonic::server::Grpc::new(codec)
4481                            .apply_compression_config(
4482                                accept_compression_encodings,
4483                                send_compression_encodings,
4484                            )
4485                            .apply_max_message_size_config(
4486                                max_decoding_message_size,
4487                                max_encoding_message_size,
4488                            );
4489                        let res = grpc.server_streaming(method, req).await;
4490                        Ok(res)
4491                    };
4492                    Box::pin(fut)
4493                }
4494                "/sui.rpc.v2.LedgerService/ListEvents" => {
4495                    #[allow(non_camel_case_types)]
4496                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
4497                    impl<
4498                        T: LedgerService,
4499                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
4500                    for ListEventsSvc<T> {
4501                        type Response = super::ListEventsResponse;
4502                        type ResponseStream = BoxStream<super::ListEventsResponse>;
4503                        type Future = BoxFuture<
4504                            tonic::Response<Self::ResponseStream>,
4505                            tonic::Status,
4506                        >;
4507                        fn call(
4508                            &mut self,
4509                            request: tonic::Request<super::ListEventsRequest>,
4510                        ) -> Self::Future {
4511                            let inner = Arc::clone(&self.0);
4512                            let fut = async move {
4513                                <T as LedgerService>::list_events(&inner, request).await
4514                            };
4515                            Box::pin(fut)
4516                        }
4517                    }
4518                    let accept_compression_encodings = self.accept_compression_encodings;
4519                    let send_compression_encodings = self.send_compression_encodings;
4520                    let max_decoding_message_size = self.max_decoding_message_size;
4521                    let max_encoding_message_size = self.max_encoding_message_size;
4522                    let inner = self.inner.clone();
4523                    let fut = async move {
4524                        let method = ListEventsSvc(inner);
4525                        let codec = tonic_prost::ProstCodec::default();
4526                        let mut grpc = tonic::server::Grpc::new(codec)
4527                            .apply_compression_config(
4528                                accept_compression_encodings,
4529                                send_compression_encodings,
4530                            )
4531                            .apply_max_message_size_config(
4532                                max_decoding_message_size,
4533                                max_encoding_message_size,
4534                            );
4535                        let res = grpc.server_streaming(method, req).await;
4536                        Ok(res)
4537                    };
4538                    Box::pin(fut)
4539                }
4540                _ => {
4541                    Box::pin(async move {
4542                        let mut response = http::Response::new(
4543                            tonic::body::Body::default(),
4544                        );
4545                        let headers = response.headers_mut();
4546                        headers
4547                            .insert(
4548                                tonic::Status::GRPC_STATUS,
4549                                (tonic::Code::Unimplemented as i32).into(),
4550                            );
4551                        headers
4552                            .insert(
4553                                http::header::CONTENT_TYPE,
4554                                tonic::metadata::GRPC_CONTENT_TYPE,
4555                            );
4556                        Ok(response)
4557                    })
4558                }
4559            }
4560        }
4561    }
4562    impl<T> Clone for LedgerServiceServer<T> {
4563        fn clone(&self) -> Self {
4564            let inner = self.inner.clone();
4565            Self {
4566                inner,
4567                accept_compression_encodings: self.accept_compression_encodings,
4568                send_compression_encodings: self.send_compression_encodings,
4569                max_decoding_message_size: self.max_decoding_message_size,
4570                max_encoding_message_size: self.max_encoding_message_size,
4571            }
4572        }
4573    }
4574    /// Generated gRPC service name
4575    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
4576    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
4577        const NAME: &'static str = SERVICE_NAME;
4578    }
4579}
4580/// A Move Package
4581#[non_exhaustive]
4582#[derive(Clone, PartialEq, ::prost::Message)]
4583pub struct Package {
4584    /// The PackageId of this package
4585    ///
4586    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
4587    /// Outside of system packages the `storage_id` for every package version is
4588    /// different.
4589    #[prost(string, optional, tag = "1")]
4590    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
4591    /// The PackageId of the first published version of this package.
4592    ///
4593    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
4594    /// `storage_id` of the first version of this package that has been published.
4595    /// The `original_id`/`runtime_id` is stable across all versions of the
4596    /// package and does not ever change.
4597    #[prost(string, optional, tag = "2")]
4598    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
4599    /// The version of this package
4600    #[prost(uint64, optional, tag = "3")]
4601    pub version: ::core::option::Option<u64>,
4602    /// The modules defined by this package
4603    #[prost(message, repeated, tag = "4")]
4604    pub modules: ::prost::alloc::vec::Vec<Module>,
4605    /// List of datatype origins for mapping datatypes to a package version where
4606    /// it was first defined
4607    #[prost(message, repeated, tag = "5")]
4608    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
4609    /// The package's transitive dependencies as a mapping from the package's
4610    /// runtime Id (the Id it is referred to by in other packages) to its
4611    /// storage Id (the Id it is loaded from on chain).
4612    #[prost(message, repeated, tag = "6")]
4613    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
4614}
4615/// A Move Module.
4616#[non_exhaustive]
4617#[derive(Clone, PartialEq, ::prost::Message)]
4618pub struct Module {
4619    /// Name of this module.
4620    #[prost(string, optional, tag = "1")]
4621    pub name: ::core::option::Option<::prost::alloc::string::String>,
4622    /// Serialized bytecode of the module.
4623    #[prost(bytes = "bytes", optional, tag = "2")]
4624    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
4625    /// List of DataTypes defined by this module.
4626    #[prost(message, repeated, tag = "3")]
4627    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
4628    /// List of Functions defined by this module.
4629    #[prost(message, repeated, tag = "4")]
4630    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
4631}
4632/// Describes a Move Datatype.
4633#[non_exhaustive]
4634#[derive(Clone, PartialEq, ::prost::Message)]
4635pub struct DatatypeDescriptor {
4636    /// Fully qualified name of this Datatype.
4637    ///
4638    /// This is `<defining_id>::<module>::<name>`
4639    #[prost(string, optional, tag = "1")]
4640    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
4641    /// PackageId of the package where this Datatype is defined.
4642    ///
4643    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
4644    #[prost(string, optional, tag = "2")]
4645    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
4646    /// Name of the module where this Datatype is defined
4647    #[prost(string, optional, tag = "3")]
4648    pub module: ::core::option::Option<::prost::alloc::string::String>,
4649    /// Name of this Datatype
4650    #[prost(string, optional, tag = "4")]
4651    pub name: ::core::option::Option<::prost::alloc::string::String>,
4652    /// This type's abilities
4653    #[prost(enumeration = "Ability", repeated, tag = "5")]
4654    pub abilities: ::prost::alloc::vec::Vec<i32>,
4655    /// Ability constraints and phantom status for this type's generic type parameters
4656    #[prost(message, repeated, tag = "6")]
4657    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
4658    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
4659    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
4660    pub kind: ::core::option::Option<i32>,
4661    /// Set of fields if this Datatype is a struct.
4662    ///
4663    /// The order of the entries is the order of how the fields are defined.
4664    #[prost(message, repeated, tag = "8")]
4665    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
4666    /// Set of variants if this Datatype is an enum.
4667    ///
4668    /// The order of the entries is the order of how the variants are defined.
4669    #[prost(message, repeated, tag = "9")]
4670    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
4671}
4672/// Nested message and enum types in `DatatypeDescriptor`.
4673pub mod datatype_descriptor {
4674    #[non_exhaustive]
4675    #[derive(
4676        Clone,
4677        Copy,
4678        Debug,
4679        PartialEq,
4680        Eq,
4681        Hash,
4682        PartialOrd,
4683        Ord,
4684        ::prost::Enumeration
4685    )]
4686    #[repr(i32)]
4687    pub enum DatatypeKind {
4688        Unknown = 0,
4689        Struct = 1,
4690        Enum = 2,
4691    }
4692    impl DatatypeKind {
4693        /// String value of the enum field names used in the ProtoBuf definition.
4694        ///
4695        /// The values are not transformed in any way and thus are considered stable
4696        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4697        pub fn as_str_name(&self) -> &'static str {
4698            match self {
4699                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
4700                Self::Struct => "STRUCT",
4701                Self::Enum => "ENUM",
4702            }
4703        }
4704        /// Creates an enum from field names used in the ProtoBuf definition.
4705        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4706            match value {
4707                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
4708                "STRUCT" => Some(Self::Struct),
4709                "ENUM" => Some(Self::Enum),
4710                _ => None,
4711            }
4712        }
4713    }
4714}
4715/// A generic type parameter used in the declaration of a struct or enum.
4716#[non_exhaustive]
4717#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4718pub struct TypeParameter {
4719    /// The type parameter constraints
4720    #[prost(enumeration = "Ability", repeated, tag = "1")]
4721    pub constraints: ::prost::alloc::vec::Vec<i32>,
4722    /// Whether the parameter is declared as phantom
4723    #[prost(bool, optional, tag = "2")]
4724    pub is_phantom: ::core::option::Option<bool>,
4725}
4726/// Descriptor of a field that belongs to a struct or enum variant
4727#[non_exhaustive]
4728#[derive(Clone, PartialEq, ::prost::Message)]
4729pub struct FieldDescriptor {
4730    /// Name of the field
4731    #[prost(string, optional, tag = "1")]
4732    pub name: ::core::option::Option<::prost::alloc::string::String>,
4733    /// Order or position of the field in the struct or enum variant definition.
4734    #[prost(uint32, optional, tag = "2")]
4735    pub position: ::core::option::Option<u32>,
4736    /// The type of the field
4737    #[prost(message, optional, tag = "3")]
4738    pub r#type: ::core::option::Option<OpenSignatureBody>,
4739}
4740/// Descriptor of an enum variant
4741#[non_exhaustive]
4742#[derive(Clone, PartialEq, ::prost::Message)]
4743pub struct VariantDescriptor {
4744    /// Name of the variant
4745    #[prost(string, optional, tag = "1")]
4746    pub name: ::core::option::Option<::prost::alloc::string::String>,
4747    /// Order or position of the variant in the enum definition.
4748    #[prost(uint32, optional, tag = "2")]
4749    pub position: ::core::option::Option<u32>,
4750    /// Set of fields defined by this variant.
4751    #[prost(message, repeated, tag = "3")]
4752    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
4753}
4754/// Representation of a type signature that could appear as a field type for a struct or enum
4755#[non_exhaustive]
4756#[derive(Clone, PartialEq, ::prost::Message)]
4757pub struct OpenSignatureBody {
4758    /// Type of this signature
4759    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
4760    pub r#type: ::core::option::Option<i32>,
4761    /// Fully qualified name of the datatype when `type` is `DATATYPE`
4762    #[prost(string, optional, tag = "2")]
4763    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
4764    /// Set when `type` is `VECTOR` or `DATATYPE`
4765    #[prost(message, repeated, tag = "3")]
4766    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
4767    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
4768    #[prost(uint32, optional, tag = "4")]
4769    pub type_parameter: ::core::option::Option<u32>,
4770}
4771/// Nested message and enum types in `OpenSignatureBody`.
4772pub mod open_signature_body {
4773    #[non_exhaustive]
4774    #[derive(
4775        Clone,
4776        Copy,
4777        Debug,
4778        PartialEq,
4779        Eq,
4780        Hash,
4781        PartialOrd,
4782        Ord,
4783        ::prost::Enumeration
4784    )]
4785    #[repr(i32)]
4786    pub enum Type {
4787        Unknown = 0,
4788        Address = 1,
4789        Bool = 2,
4790        U8 = 3,
4791        U16 = 4,
4792        U32 = 5,
4793        U64 = 6,
4794        U128 = 7,
4795        U256 = 8,
4796        Vector = 9,
4797        Datatype = 10,
4798        Parameter = 11,
4799    }
4800    impl Type {
4801        /// String value of the enum field names used in the ProtoBuf definition.
4802        ///
4803        /// The values are not transformed in any way and thus are considered stable
4804        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4805        pub fn as_str_name(&self) -> &'static str {
4806            match self {
4807                Self::Unknown => "TYPE_UNKNOWN",
4808                Self::Address => "ADDRESS",
4809                Self::Bool => "BOOL",
4810                Self::U8 => "U8",
4811                Self::U16 => "U16",
4812                Self::U32 => "U32",
4813                Self::U64 => "U64",
4814                Self::U128 => "U128",
4815                Self::U256 => "U256",
4816                Self::Vector => "VECTOR",
4817                Self::Datatype => "DATATYPE",
4818                Self::Parameter => "TYPE_PARAMETER",
4819            }
4820        }
4821        /// Creates an enum from field names used in the ProtoBuf definition.
4822        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4823            match value {
4824                "TYPE_UNKNOWN" => Some(Self::Unknown),
4825                "ADDRESS" => Some(Self::Address),
4826                "BOOL" => Some(Self::Bool),
4827                "U8" => Some(Self::U8),
4828                "U16" => Some(Self::U16),
4829                "U32" => Some(Self::U32),
4830                "U64" => Some(Self::U64),
4831                "U128" => Some(Self::U128),
4832                "U256" => Some(Self::U256),
4833                "VECTOR" => Some(Self::Vector),
4834                "DATATYPE" => Some(Self::Datatype),
4835                "TYPE_PARAMETER" => Some(Self::Parameter),
4836                _ => None,
4837            }
4838        }
4839    }
4840}
4841/// Descriptor of a Move function
4842#[non_exhaustive]
4843#[derive(Clone, PartialEq, ::prost::Message)]
4844pub struct FunctionDescriptor {
4845    /// Name of the function
4846    #[prost(string, optional, tag = "1")]
4847    pub name: ::core::option::Option<::prost::alloc::string::String>,
4848    /// Whether the function is `public`, `private` or `public(friend)`
4849    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
4850    pub visibility: ::core::option::Option<i32>,
4851    /// Whether the function is marked `entry` or not.
4852    #[prost(bool, optional, tag = "6")]
4853    pub is_entry: ::core::option::Option<bool>,
4854    /// Ability constraints for type parameters
4855    #[prost(message, repeated, tag = "7")]
4856    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
4857    /// Formal parameter types.
4858    #[prost(message, repeated, tag = "8")]
4859    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
4860    /// Return types.
4861    #[prost(message, repeated, tag = "9")]
4862    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
4863}
4864/// Nested message and enum types in `FunctionDescriptor`.
4865pub mod function_descriptor {
4866    #[non_exhaustive]
4867    #[derive(
4868        Clone,
4869        Copy,
4870        Debug,
4871        PartialEq,
4872        Eq,
4873        Hash,
4874        PartialOrd,
4875        Ord,
4876        ::prost::Enumeration
4877    )]
4878    #[repr(i32)]
4879    pub enum Visibility {
4880        Unknown = 0,
4881        Private = 1,
4882        Public = 2,
4883        Friend = 3,
4884    }
4885    impl Visibility {
4886        /// String value of the enum field names used in the ProtoBuf definition.
4887        ///
4888        /// The values are not transformed in any way and thus are considered stable
4889        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4890        pub fn as_str_name(&self) -> &'static str {
4891            match self {
4892                Self::Unknown => "VISIBILITY_UNKNOWN",
4893                Self::Private => "PRIVATE",
4894                Self::Public => "PUBLIC",
4895                Self::Friend => "FRIEND",
4896            }
4897        }
4898        /// Creates an enum from field names used in the ProtoBuf definition.
4899        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4900            match value {
4901                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
4902                "PRIVATE" => Some(Self::Private),
4903                "PUBLIC" => Some(Self::Public),
4904                "FRIEND" => Some(Self::Friend),
4905                _ => None,
4906            }
4907        }
4908    }
4909}
4910/// Representation of a type signature that could appear as a function parameter or return value.
4911#[non_exhaustive]
4912#[derive(Clone, PartialEq, ::prost::Message)]
4913pub struct OpenSignature {
4914    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
4915    pub reference: ::core::option::Option<i32>,
4916    #[prost(message, optional, tag = "2")]
4917    pub body: ::core::option::Option<OpenSignatureBody>,
4918}
4919/// Nested message and enum types in `OpenSignature`.
4920pub mod open_signature {
4921    #[non_exhaustive]
4922    #[derive(
4923        Clone,
4924        Copy,
4925        Debug,
4926        PartialEq,
4927        Eq,
4928        Hash,
4929        PartialOrd,
4930        Ord,
4931        ::prost::Enumeration
4932    )]
4933    #[repr(i32)]
4934    pub enum Reference {
4935        Unknown = 0,
4936        Immutable = 1,
4937        Mutable = 2,
4938    }
4939    impl Reference {
4940        /// String value of the enum field names used in the ProtoBuf definition.
4941        ///
4942        /// The values are not transformed in any way and thus are considered stable
4943        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4944        pub fn as_str_name(&self) -> &'static str {
4945            match self {
4946                Self::Unknown => "REFERENCE_UNKNOWN",
4947                Self::Immutable => "IMMUTABLE",
4948                Self::Mutable => "MUTABLE",
4949            }
4950        }
4951        /// Creates an enum from field names used in the ProtoBuf definition.
4952        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4953            match value {
4954                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
4955                "IMMUTABLE" => Some(Self::Immutable),
4956                "MUTABLE" => Some(Self::Mutable),
4957                _ => None,
4958            }
4959        }
4960    }
4961}
4962/// Identifies a struct and the module it was defined in.
4963#[non_exhaustive]
4964#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4965pub struct TypeOrigin {
4966    #[prost(string, optional, tag = "1")]
4967    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4968    #[prost(string, optional, tag = "2")]
4969    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
4970    #[prost(string, optional, tag = "3")]
4971    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4972}
4973/// Upgraded package info for the linkage table.
4974#[non_exhaustive]
4975#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4976pub struct Linkage {
4977    /// Id of the original package.
4978    #[prost(string, optional, tag = "1")]
4979    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
4980    /// Id of the upgraded package.
4981    #[prost(string, optional, tag = "2")]
4982    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
4983    /// Version of the upgraded package.
4984    #[prost(uint64, optional, tag = "3")]
4985    pub upgraded_version: ::core::option::Option<u64>,
4986}
4987/// An `Ability` classifies what operations are permitted for a given type
4988#[non_exhaustive]
4989#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4990#[repr(i32)]
4991pub enum Ability {
4992    Unknown = 0,
4993    /// Allows values of types with this ability to be copied
4994    Copy = 1,
4995    /// Allows values of types with this ability to be dropped.
4996    Drop = 2,
4997    /// Allows values of types with this ability to exist inside a struct in global storage
4998    Store = 3,
4999    /// Allows the type to serve as a key for global storage operations
5000    Key = 4,
5001}
5002impl Ability {
5003    /// String value of the enum field names used in the ProtoBuf definition.
5004    ///
5005    /// The values are not transformed in any way and thus are considered stable
5006    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5007    pub fn as_str_name(&self) -> &'static str {
5008        match self {
5009            Self::Unknown => "ABILITY_UNKNOWN",
5010            Self::Copy => "COPY",
5011            Self::Drop => "DROP",
5012            Self::Store => "STORE",
5013            Self::Key => "KEY",
5014        }
5015    }
5016    /// Creates an enum from field names used in the ProtoBuf definition.
5017    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5018        match value {
5019            "ABILITY_UNKNOWN" => Some(Self::Unknown),
5020            "COPY" => Some(Self::Copy),
5021            "DROP" => Some(Self::Drop),
5022            "STORE" => Some(Self::Store),
5023            "KEY" => Some(Self::Key),
5024            _ => None,
5025        }
5026    }
5027}
5028#[non_exhaustive]
5029#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5030pub struct GetPackageRequest {
5031    /// Required. The `storage_id` of any version of the requested package.
5032    ///
5033    /// When no `selector` is set, the package stored at exactly this id is
5034    /// returned. When a `selector` is set, `package_id` only identifies the
5035    /// package's upgrade lineage (via its original id), and the selected
5036    /// version within that lineage is returned.
5037    #[prost(string, optional, tag = "1")]
5038    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5039    /// Optional. Return the package in `package_id`'s upgrade lineage that
5040    /// matches one of the following:
5041    ///
5042    /// * `version`: the package with exactly this version. A server that has
5043    ///   pruned this version fails with `OUT_OF_RANGE` (see
5044    ///   `ErrorReason.BELOW_EARLIEST_AVAILABLE`). While it rebuilds history
5045    ///   after restoring from a snapshot, a version it may still store fails
5046    ///   with `UNAVAILABLE` and reason `NOT_READY` instead. A server that keeps
5047    ///   only the latest version of each object fails an older version of a
5048    ///   system package with `OUT_OF_RANGE` and reason
5049    ///   `ErrorReason.VERSION_NOT_RETAINED`.
5050    /// * `at_checkpoint`: the latest package that existed at or before this
5051    ///   checkpoint, so a successful response is exact as of `at_checkpoint`. A
5052    ///   lineage first published after this checkpoint is `NOT_FOUND`. Outside
5053    ///   the checkpoints the server has indexed, it fails as a request pinned to
5054    ///   a checkpoint (see `ErrorReason.ABOVE_LATEST_AVAILABLE` and
5055    ///   `BELOW_EARLIEST_AVAILABLE`). Servers may fail it with `UNAVAILABLE`
5056    ///   and reason `NOT_READY` while they rebuild history after restoring from
5057    ///   a snapshot.
5058    ///
5059    /// Servers without RPC indexes may fail a selector with `UNIMPLEMENTED` and
5060    /// reason `NOT_SERVED_HERE`.
5061    ///
5062    /// If neither is set, the package stored at `package_id` is returned.
5063    #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
5064    pub selector: ::core::option::Option<get_package_request::Selector>,
5065}
5066/// Nested message and enum types in `GetPackageRequest`.
5067pub mod get_package_request {
5068    /// Optional. Return the package in `package_id`'s upgrade lineage that
5069    /// matches one of the following:
5070    ///
5071    /// * `version`: the package with exactly this version. A server that has
5072    ///   pruned this version fails with `OUT_OF_RANGE` (see
5073    ///   `ErrorReason.BELOW_EARLIEST_AVAILABLE`). While it rebuilds history
5074    ///   after restoring from a snapshot, a version it may still store fails
5075    ///   with `UNAVAILABLE` and reason `NOT_READY` instead. A server that keeps
5076    ///   only the latest version of each object fails an older version of a
5077    ///   system package with `OUT_OF_RANGE` and reason
5078    ///   `ErrorReason.VERSION_NOT_RETAINED`.
5079    /// * `at_checkpoint`: the latest package that existed at or before this
5080    ///   checkpoint, so a successful response is exact as of `at_checkpoint`. A
5081    ///   lineage first published after this checkpoint is `NOT_FOUND`. Outside
5082    ///   the checkpoints the server has indexed, it fails as a request pinned to
5083    ///   a checkpoint (see `ErrorReason.ABOVE_LATEST_AVAILABLE` and
5084    ///   `BELOW_EARLIEST_AVAILABLE`). Servers may fail it with `UNAVAILABLE`
5085    ///   and reason `NOT_READY` while they rebuild history after restoring from
5086    ///   a snapshot.
5087    ///
5088    /// Servers without RPC indexes may fail a selector with `UNIMPLEMENTED` and
5089    /// reason `NOT_SERVED_HERE`.
5090    ///
5091    /// If neither is set, the package stored at `package_id` is returned.
5092    #[non_exhaustive]
5093    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
5094    pub enum Selector {
5095        #[prost(uint64, tag = "2")]
5096        Version(u64),
5097        #[prost(uint64, tag = "3")]
5098        AtCheckpoint(u64),
5099    }
5100}
5101#[non_exhaustive]
5102#[derive(Clone, PartialEq, ::prost::Message)]
5103pub struct GetPackageResponse {
5104    /// The package.
5105    #[prost(message, optional, tag = "1")]
5106    pub package: ::core::option::Option<Package>,
5107}
5108#[non_exhaustive]
5109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5110pub struct GetDatatypeRequest {
5111    /// Required. The `storage_id` of the requested package.
5112    #[prost(string, optional, tag = "1")]
5113    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5114    /// Required. The name of the requested module.
5115    #[prost(string, optional, tag = "2")]
5116    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
5117    /// Required. The name of the requested datatype.
5118    #[prost(string, optional, tag = "3")]
5119    pub name: ::core::option::Option<::prost::alloc::string::String>,
5120}
5121#[non_exhaustive]
5122#[derive(Clone, PartialEq, ::prost::Message)]
5123pub struct GetDatatypeResponse {
5124    /// The datatype.
5125    #[prost(message, optional, tag = "1")]
5126    pub datatype: ::core::option::Option<DatatypeDescriptor>,
5127}
5128#[non_exhaustive]
5129#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5130pub struct GetFunctionRequest {
5131    /// Required. The `storage_id` of the requested package.
5132    #[prost(string, optional, tag = "1")]
5133    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5134    /// Required. The name of the requested module.
5135    #[prost(string, optional, tag = "2")]
5136    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
5137    /// Required. The name of the requested function.
5138    #[prost(string, optional, tag = "3")]
5139    pub name: ::core::option::Option<::prost::alloc::string::String>,
5140}
5141#[non_exhaustive]
5142#[derive(Clone, PartialEq, ::prost::Message)]
5143pub struct GetFunctionResponse {
5144    /// The function.
5145    #[prost(message, optional, tag = "1")]
5146    pub function: ::core::option::Option<FunctionDescriptor>,
5147}
5148/// Servers without the indexes this method needs fail it with `UNIMPLEMENTED`
5149/// and reason `NOT_SERVED_HERE`. Servers may fail any `ListPackageVersions`
5150/// request with `UNAVAILABLE` and reason `NOT_READY` while they rebuild history
5151/// after restoring from a snapshot.
5152#[non_exhaustive]
5153#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5154pub struct ListPackageVersionsRequest {
5155    /// The `storage_id` of any version of a package, to list the versions of
5156    /// that package's upgrade lineage. When unset, the request lists the
5157    /// versions of every package by publish checkpoint (see `options`).
5158    #[prost(string, optional, tag = "1")]
5159    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5160    /// The maximum number of versions to return. The service may return fewer than this value.
5161    /// If unspecified, at most `1000` entries will be returned.
5162    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
5163    ///
5164    /// New clients use `options`. Must be unset when `package_id` is unset or
5165    /// the request sets `options`, `start_version`, `end_version`,
5166    /// `start_checkpoint` or `end_checkpoint` (`INVALID_ARGUMENT` otherwise).
5167    #[prost(uint32, optional, tag = "2")]
5168    pub page_size: ::core::option::Option<u32>,
5169    /// A page token, received from a previous `ListPackageVersions` call.
5170    /// Provide this to retrieve the subsequent page.
5171    ///
5172    /// When paginating, all other parameters provided to `ListPackageVersions` must
5173    /// match the call that provided the page token.
5174    ///
5175    /// A page token names the first version of the next page, so the client
5176    /// holds the version below it. A page token naming a version past what this
5177    /// server has indexed gets an empty page without `next_page_token`. A page
5178    /// token whose next page would skip versions the server does not retain
5179    /// fails with `OUT_OF_RANGE` (see `options`).
5180    ///
5181    /// New clients use `options`. Must be unset when `package_id` is unset or
5182    /// the request sets `options`, `start_version`, `end_version`,
5183    /// `start_checkpoint` or `end_checkpoint` (`INVALID_ARGUMENT` otherwise).
5184    #[prost(bytes = "bytes", optional, tag = "3")]
5185    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5186    /// Optional. Cursor paging (see `QueryOptions`). A request with `package_id`
5187    /// unset, or with `start_version`, `end_version`, `start_checkpoint` or
5188    /// `end_checkpoint` set, pages this way even without `options`. `page_size`
5189    /// and `page_token` must then be unset. Every response sets `end` and never
5190    /// `next_page_token`. Servers that predate these fields ignore them and
5191    /// never set `end`.
5192    ///
5193    /// With `package_id` set, this listing is ordered by ascending version. With
5194    /// `package_id` unset, it is ordered by ascending publish checkpoint, then
5195    /// `original_id`, then version. `limit` defaults to `1000` and is coerced to
5196    /// at most `10000`. Every page but the last holds `limit` versions. Resume
5197    /// from the last version's `cursor`, as `after` when ascending or `before`
5198    /// when descending. A malformed cursor, or one from another listing (of
5199    /// another package, or of every package when `package_id` is set, or vice
5200    /// versa), fails with `INVALID_ARGUMENT`. A cursor also records the highest
5201    /// checkpoint the server that returned it had indexed.
5202    ///
5203    /// With `package_id` set, a package this server has not indexed is
5204    /// `NOT_FOUND`, as in `GetPackage`, unless a cursor comes from a server that
5205    /// has indexed further; such a cursor is handled as a cursor past the tip.
5206    ///
5207    /// Past what this server has indexed, the listing follows the
5208    /// `LedgerService` `List*` RPCs (see `ErrorReason.ABOVE_LATEST_AVAILABLE`).
5209    /// A descending listing fails with `OUT_OF_RANGE` when its `end_checkpoint`
5210    /// is above `firstUnavailableCheckpoint` (one above the highest checkpoint
5211    /// the server has indexed), or, with `end_checkpoint` unset, when its
5212    /// `start_checkpoint` is at or above `firstUnavailableCheckpoint` or a
5213    /// cursor names a version this server has not indexed. An ascending listing
5214    /// is never refused for these: unless `end_version` or a `before` cursor
5215    /// ends it first, it lists through the highest indexed checkpoint and ends
5216    /// with `QUERY_END_REASON_LEDGER_TIP`.
5217    ///
5218    /// On a server that prunes history, a listing of one package in cursor
5219    /// paging with `start_checkpoint` unset covers only the versions the server
5220    /// stores: a version range that starts below the oldest of them starts at
5221    /// it, so a descending listing without an `after` cursor ends there with a
5222    /// short last page, and one with only a `before` cursor at or below that
5223    /// version lists nothing. Nothing marks that version as different from a
5224    /// package's first version.
5225    ///
5226    /// A request that continues a listing names a version the client already
5227    /// holds: the version an `after` cursor names, or the version below a
5228    /// `page_token`'s. When the range starts just above that version (no higher
5229    /// `start_version` or `start_checkpoint` bounds it) and versions between it
5230    /// and the oldest version the server stores are gone, the request fails with
5231    /// `OUT_OF_RANGE` and reason `BELOW_EARLIEST_AVAILABLE` in either ordering
5232    /// rather than skip them. Such a listing can only be completed from a server
5233    /// that retains those versions.
5234    #[prost(message, optional, tag = "5")]
5235    pub options: ::core::option::Option<QueryOptions>,
5236    /// Optional. Start of the version range to list (inclusive). Intersects with
5237    /// every other bound. Must be unset when `package_id` is unset.
5238    #[prost(uint64, optional, tag = "6")]
5239    pub start_version: ::core::option::Option<u64>,
5240    /// Optional. End of the version range to list (exclusive). Intersects with
5241    /// every other bound. Below `start_version` it fails with
5242    /// `INVALID_ARGUMENT`; equal to it, the range lists nothing. Must be unset
5243    /// when `package_id` is unset.
5244    #[prost(uint64, optional, tag = "7")]
5245    pub end_version: ::core::option::Option<u64>,
5246    /// Optional. Start of the checkpoint range to list (inclusive): only
5247    /// versions published in this checkpoint or later. The listing covers the
5248    /// versions published in the range, not the packages' state at one
5249    /// checkpoint. Intersects with every other bound. Unless the range is
5250    /// empty, servers that prune history fail with `OUT_OF_RANGE` and reason
5251    /// `BELOW_EARLIEST_AVAILABLE` for a checkpoint below the lowest one they can
5252    /// list every publish from, unless an `after` cursor bounds the listing at
5253    /// or above that checkpoint.
5254    ///
5255    /// In a listing of every package, if unset, the listing starts at that
5256    /// checkpoint, which is genesis on servers that keep full history, and
5257    /// covers the publishes from that checkpoint on: a descending listing
5258    /// without an `after` cursor at or above that checkpoint ends there with a
5259    /// short last page. With `start_checkpoint` unset, a listing in either
5260    /// order after an `after` cursor below that checkpoint fails with
5261    /// `OUT_OF_RANGE` and reason `BELOW_EARLIEST_AVAILABLE` rather than skip
5262    /// the publishes in between. A `before` cursor below that checkpoint leaves
5263    /// nothing to list.
5264    ///
5265    /// Servers that predate this field fail requests with `package_id` unset
5266    /// with `INVALID_ARGUMENT`.
5267    #[prost(uint64, optional, tag = "8")]
5268    pub start_checkpoint: ::core::option::Option<u64>,
5269    /// Optional. End of the checkpoint range to list (exclusive): only versions
5270    /// published before this checkpoint. Below `start_checkpoint` it fails with
5271    /// `INVALID_ARGUMENT`; equal to it, the range lists nothing and is never
5272    /// refused as pruned. If unset, the range ends at the highest checkpoint the
5273    /// server has indexed. In a request with no lower bound of its own (no
5274    /// `start_checkpoint` and no `after` cursor), an `end_checkpoint` at or
5275    /// below the lowest checkpoint the server can list every publish from fails
5276    /// with `OUT_OF_RANGE` and reason `BELOW_EARLIEST_AVAILABLE`.
5277    ///
5278    /// With `end_checkpoint` set, `QUERY_END_REASON_LEDGER_TIP` means the server
5279    /// stopped at its highest indexed checkpoint, short of `end_checkpoint`:
5280    /// retry later or on another replica.
5281    #[prost(uint64, optional, tag = "9")]
5282    pub end_checkpoint: ::core::option::Option<u64>,
5283}
5284#[non_exhaustive]
5285#[derive(Clone, PartialEq, ::prost::Message)]
5286pub struct ListPackageVersionsResponse {
5287    /// The listed versions in this listing's order (see
5288    /// `ListPackageVersionsRequest.options`), or in reverse when
5289    /// `options.ordering` is `ORDERING_DESCENDING`.
5290    #[prost(message, repeated, tag = "1")]
5291    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
5292    /// A token, which can be sent as `page_token` to retrieve the next page.
5293    /// If this field is omitted, there are no subsequent pages. Never set in
5294    /// cursor paging (see `ListPackageVersionsRequest.options`).
5295    #[prost(bytes = "bytes", optional, tag = "2")]
5296    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5297    /// Set on every response in cursor paging (see
5298    /// `ListPackageVersionsRequest.options`), and never otherwise. A full page
5299    /// ends with `QUERY_END_REASON_ITEM_LIMIT`; a shorter one, the last, with:
5300    ///
5301    /// * `QUERY_END_REASON_CHECKPOINT_BOUND`: reached `end_version` or
5302    ///   `start_version`, the end of the checkpoint range, or, descending, the
5303    ///   package's first version (on a server that prunes history, the oldest
5304    ///   version it stores) or, listing every package, the lowest checkpoint
5305    ///   the server can list every publish from.
5306    /// * `QUERY_END_REASON_CURSOR_BOUND`: reached the far cursor (`before`
5307    ///   ascending, `after` descending).
5308    /// * `QUERY_END_REASON_LEDGER_TIP`: an ascending listing reached the highest
5309    ///   checkpoint the server has indexed, below `end_checkpoint` if set; later
5310    ///   publishes can extend it.
5311    #[prost(message, optional, tag = "3")]
5312    pub end: ::core::option::Option<QueryEnd>,
5313}
5314#[non_exhaustive]
5315#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5316pub struct ListSystemPackagesRequest {
5317    /// Optional. Return the system packages as of the end of this checkpoint.
5318    /// If unset, return the latest set as of the highest checkpoint the server
5319    /// has indexed.
5320    ///
5321    /// Outside the checkpoints the server has indexed, it fails as a request
5322    /// pinned to a checkpoint (see `ErrorReason.ABOVE_LATEST_AVAILABLE` and
5323    /// `BELOW_EARLIEST_AVAILABLE`). Servers without RPC indexes fail the request
5324    /// with `UNIMPLEMENTED` and reason `NOT_SERVED_HERE`, with or without
5325    /// `at_checkpoint`. Servers may fail it with `UNAVAILABLE` and reason
5326    /// `NOT_READY` while their index is empty or they rebuild history after
5327    /// restoring from a snapshot. Any of these fails the whole request, so a
5328    /// successful response is the complete set.
5329    #[prost(uint64, optional, tag = "1")]
5330    pub at_checkpoint: ::core::option::Option<u64>,
5331}
5332#[non_exhaustive]
5333#[derive(Clone, PartialEq, ::prost::Message)]
5334pub struct ListSystemPackagesResponse {
5335    /// The system packages that existed at the end of `at_checkpoint`, or of the
5336    /// highest checkpoint the server has indexed if it is unset, ordered by
5337    /// `package_id`, each at its latest version by then. System packages are
5338    /// upgraded in place, so `original_id` equals `package_id`. `checkpoint` may
5339    /// be unset as `PackageVersion.checkpoint` describes; `cursor` is never set.
5340    #[prost(message, repeated, tag = "1")]
5341    pub system_packages: ::prost::alloc::vec::Vec<PackageVersion>,
5342}
5343/// A simplified representation of a package version
5344#[non_exhaustive]
5345#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5346pub struct PackageVersion {
5347    /// The storage ID of this package version
5348    #[prost(string, optional, tag = "1")]
5349    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
5350    /// The version number
5351    #[prost(uint64, optional, tag = "2")]
5352    pub version: ::core::option::Option<u64>,
5353    /// The checkpoint in which this version was published. Servers that prune
5354    /// history may leave this unset for versions published before their lowest
5355    /// available checkpoint.
5356    #[prost(uint64, optional, tag = "3")]
5357    pub checkpoint: ::core::option::Option<u64>,
5358    /// The opaque position of this version in the listing, for use as
5359    /// `ListPackageVersionsRequest.options.after` or `options.before`.
5360    #[prost(bytes = "bytes", optional, tag = "4")]
5361    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5362    /// The `original_id` of this version's package: the `storage_id` of its
5363    /// first version, shared by every version in its upgrade lineage.
5364    #[prost(string, optional, tag = "5")]
5365    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
5366}
5367/// Generated client implementations.
5368pub mod move_package_service_client {
5369    #![allow(
5370        unused_variables,
5371        dead_code,
5372        missing_docs,
5373        clippy::wildcard_imports,
5374        clippy::let_unit_value,
5375    )]
5376    use tonic::codegen::*;
5377    use tonic::codegen::http::Uri;
5378    #[derive(Debug, Clone)]
5379    pub struct MovePackageServiceClient<T> {
5380        inner: tonic::client::Grpc<T>,
5381    }
5382    impl MovePackageServiceClient<tonic::transport::Channel> {
5383        /// Attempt to create a new client by connecting to a given endpoint.
5384        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5385        where
5386            D: TryInto<tonic::transport::Endpoint>,
5387            D::Error: Into<StdError>,
5388        {
5389            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5390            Ok(Self::new(conn))
5391        }
5392    }
5393    impl<T> MovePackageServiceClient<T>
5394    where
5395        T: tonic::client::GrpcService<tonic::body::Body>,
5396        T::Error: Into<StdError>,
5397        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5398        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5399    {
5400        pub fn new(inner: T) -> Self {
5401            let inner = tonic::client::Grpc::new(inner);
5402            Self { inner }
5403        }
5404        pub fn with_origin(inner: T, origin: Uri) -> Self {
5405            let inner = tonic::client::Grpc::with_origin(inner, origin);
5406            Self { inner }
5407        }
5408        pub fn with_interceptor<F>(
5409            inner: T,
5410            interceptor: F,
5411        ) -> MovePackageServiceClient<InterceptedService<T, F>>
5412        where
5413            F: tonic::service::Interceptor,
5414            T::ResponseBody: Default,
5415            T: tonic::codegen::Service<
5416                http::Request<tonic::body::Body>,
5417                Response = http::Response<
5418                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5419                >,
5420            >,
5421            <T as tonic::codegen::Service<
5422                http::Request<tonic::body::Body>,
5423            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5424        {
5425            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
5426        }
5427        /// Compress requests with the given encoding.
5428        ///
5429        /// This requires the server to support it otherwise it might respond with an
5430        /// error.
5431        #[must_use]
5432        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5433            self.inner = self.inner.send_compressed(encoding);
5434            self
5435        }
5436        /// Enable decompressing responses.
5437        #[must_use]
5438        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5439            self.inner = self.inner.accept_compressed(encoding);
5440            self
5441        }
5442        /// Limits the maximum size of a decoded message.
5443        ///
5444        /// Default: `4MB`
5445        #[must_use]
5446        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5447            self.inner = self.inner.max_decoding_message_size(limit);
5448            self
5449        }
5450        /// Limits the maximum size of an encoded message.
5451        ///
5452        /// Default: `usize::MAX`
5453        #[must_use]
5454        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5455            self.inner = self.inner.max_encoding_message_size(limit);
5456            self
5457        }
5458        pub async fn get_package(
5459            &mut self,
5460            request: impl tonic::IntoRequest<super::GetPackageRequest>,
5461        ) -> std::result::Result<
5462            tonic::Response<super::GetPackageResponse>,
5463            tonic::Status,
5464        > {
5465            self.inner
5466                .ready()
5467                .await
5468                .map_err(|e| {
5469                    tonic::Status::unknown(
5470                        format!("Service was not ready: {}", e.into()),
5471                    )
5472                })?;
5473            let codec = tonic_prost::ProstCodec::default();
5474            let path = http::uri::PathAndQuery::from_static(
5475                "/sui.rpc.v2.MovePackageService/GetPackage",
5476            );
5477            let mut req = request.into_request();
5478            req.extensions_mut()
5479                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
5480            self.inner.unary(req, path, codec).await
5481        }
5482        pub async fn get_datatype(
5483            &mut self,
5484            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
5485        ) -> std::result::Result<
5486            tonic::Response<super::GetDatatypeResponse>,
5487            tonic::Status,
5488        > {
5489            self.inner
5490                .ready()
5491                .await
5492                .map_err(|e| {
5493                    tonic::Status::unknown(
5494                        format!("Service was not ready: {}", e.into()),
5495                    )
5496                })?;
5497            let codec = tonic_prost::ProstCodec::default();
5498            let path = http::uri::PathAndQuery::from_static(
5499                "/sui.rpc.v2.MovePackageService/GetDatatype",
5500            );
5501            let mut req = request.into_request();
5502            req.extensions_mut()
5503                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
5504            self.inner.unary(req, path, codec).await
5505        }
5506        pub async fn get_function(
5507            &mut self,
5508            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
5509        ) -> std::result::Result<
5510            tonic::Response<super::GetFunctionResponse>,
5511            tonic::Status,
5512        > {
5513            self.inner
5514                .ready()
5515                .await
5516                .map_err(|e| {
5517                    tonic::Status::unknown(
5518                        format!("Service was not ready: {}", e.into()),
5519                    )
5520                })?;
5521            let codec = tonic_prost::ProstCodec::default();
5522            let path = http::uri::PathAndQuery::from_static(
5523                "/sui.rpc.v2.MovePackageService/GetFunction",
5524            );
5525            let mut req = request.into_request();
5526            req.extensions_mut()
5527                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
5528            self.inner.unary(req, path, codec).await
5529        }
5530        pub async fn list_package_versions(
5531            &mut self,
5532            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
5533        ) -> std::result::Result<
5534            tonic::Response<super::ListPackageVersionsResponse>,
5535            tonic::Status,
5536        > {
5537            self.inner
5538                .ready()
5539                .await
5540                .map_err(|e| {
5541                    tonic::Status::unknown(
5542                        format!("Service was not ready: {}", e.into()),
5543                    )
5544                })?;
5545            let codec = tonic_prost::ProstCodec::default();
5546            let path = http::uri::PathAndQuery::from_static(
5547                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
5548            );
5549            let mut req = request.into_request();
5550            req.extensions_mut()
5551                .insert(
5552                    GrpcMethod::new(
5553                        "sui.rpc.v2.MovePackageService",
5554                        "ListPackageVersions",
5555                    ),
5556                );
5557            self.inner.unary(req, path, codec).await
5558        }
5559        /// List the system packages as of a checkpoint, or the latest set, each at
5560        /// its latest version then.
5561        pub async fn list_system_packages(
5562            &mut self,
5563            request: impl tonic::IntoRequest<super::ListSystemPackagesRequest>,
5564        ) -> std::result::Result<
5565            tonic::Response<super::ListSystemPackagesResponse>,
5566            tonic::Status,
5567        > {
5568            self.inner
5569                .ready()
5570                .await
5571                .map_err(|e| {
5572                    tonic::Status::unknown(
5573                        format!("Service was not ready: {}", e.into()),
5574                    )
5575                })?;
5576            let codec = tonic_prost::ProstCodec::default();
5577            let path = http::uri::PathAndQuery::from_static(
5578                "/sui.rpc.v2.MovePackageService/ListSystemPackages",
5579            );
5580            let mut req = request.into_request();
5581            req.extensions_mut()
5582                .insert(
5583                    GrpcMethod::new(
5584                        "sui.rpc.v2.MovePackageService",
5585                        "ListSystemPackages",
5586                    ),
5587                );
5588            self.inner.unary(req, path, codec).await
5589        }
5590    }
5591}
5592/// Generated server implementations.
5593pub mod move_package_service_server {
5594    #![allow(
5595        unused_variables,
5596        dead_code,
5597        missing_docs,
5598        clippy::wildcard_imports,
5599        clippy::let_unit_value,
5600    )]
5601    use tonic::codegen::*;
5602    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
5603    #[async_trait]
5604    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
5605        async fn get_package(
5606            &self,
5607            request: tonic::Request<super::GetPackageRequest>,
5608        ) -> std::result::Result<
5609            tonic::Response<super::GetPackageResponse>,
5610            tonic::Status,
5611        > {
5612            Err(tonic::Status::unimplemented("Not yet implemented"))
5613        }
5614        async fn get_datatype(
5615            &self,
5616            request: tonic::Request<super::GetDatatypeRequest>,
5617        ) -> std::result::Result<
5618            tonic::Response<super::GetDatatypeResponse>,
5619            tonic::Status,
5620        > {
5621            Err(tonic::Status::unimplemented("Not yet implemented"))
5622        }
5623        async fn get_function(
5624            &self,
5625            request: tonic::Request<super::GetFunctionRequest>,
5626        ) -> std::result::Result<
5627            tonic::Response<super::GetFunctionResponse>,
5628            tonic::Status,
5629        > {
5630            Err(tonic::Status::unimplemented("Not yet implemented"))
5631        }
5632        async fn list_package_versions(
5633            &self,
5634            request: tonic::Request<super::ListPackageVersionsRequest>,
5635        ) -> std::result::Result<
5636            tonic::Response<super::ListPackageVersionsResponse>,
5637            tonic::Status,
5638        > {
5639            Err(tonic::Status::unimplemented("Not yet implemented"))
5640        }
5641        /// List the system packages as of a checkpoint, or the latest set, each at
5642        /// its latest version then.
5643        async fn list_system_packages(
5644            &self,
5645            request: tonic::Request<super::ListSystemPackagesRequest>,
5646        ) -> std::result::Result<
5647            tonic::Response<super::ListSystemPackagesResponse>,
5648            tonic::Status,
5649        > {
5650            Err(tonic::Status::unimplemented("Not yet implemented"))
5651        }
5652    }
5653    #[derive(Debug)]
5654    pub struct MovePackageServiceServer<T> {
5655        inner: Arc<T>,
5656        accept_compression_encodings: EnabledCompressionEncodings,
5657        send_compression_encodings: EnabledCompressionEncodings,
5658        max_decoding_message_size: Option<usize>,
5659        max_encoding_message_size: Option<usize>,
5660    }
5661    impl<T> MovePackageServiceServer<T> {
5662        pub fn new(inner: T) -> Self {
5663            Self::from_arc(Arc::new(inner))
5664        }
5665        pub fn from_arc(inner: Arc<T>) -> Self {
5666            Self {
5667                inner,
5668                accept_compression_encodings: Default::default(),
5669                send_compression_encodings: Default::default(),
5670                max_decoding_message_size: None,
5671                max_encoding_message_size: None,
5672            }
5673        }
5674        pub fn with_interceptor<F>(
5675            inner: T,
5676            interceptor: F,
5677        ) -> InterceptedService<Self, F>
5678        where
5679            F: tonic::service::Interceptor,
5680        {
5681            InterceptedService::new(Self::new(inner), interceptor)
5682        }
5683        /// Enable decompressing requests with the given encoding.
5684        #[must_use]
5685        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5686            self.accept_compression_encodings.enable(encoding);
5687            self
5688        }
5689        /// Compress responses with the given encoding, if the client supports it.
5690        #[must_use]
5691        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5692            self.send_compression_encodings.enable(encoding);
5693            self
5694        }
5695        /// Limits the maximum size of a decoded message.
5696        ///
5697        /// Default: `4MB`
5698        #[must_use]
5699        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5700            self.max_decoding_message_size = Some(limit);
5701            self
5702        }
5703        /// Limits the maximum size of an encoded message.
5704        ///
5705        /// Default: `usize::MAX`
5706        #[must_use]
5707        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5708            self.max_encoding_message_size = Some(limit);
5709            self
5710        }
5711    }
5712    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
5713    where
5714        T: MovePackageService,
5715        B: Body + std::marker::Send + 'static,
5716        B::Error: Into<StdError> + std::marker::Send + 'static,
5717    {
5718        type Response = http::Response<tonic::body::Body>;
5719        type Error = std::convert::Infallible;
5720        type Future = BoxFuture<Self::Response, Self::Error>;
5721        fn poll_ready(
5722            &mut self,
5723            _cx: &mut Context<'_>,
5724        ) -> Poll<std::result::Result<(), Self::Error>> {
5725            Poll::Ready(Ok(()))
5726        }
5727        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5728            match req.uri().path() {
5729                "/sui.rpc.v2.MovePackageService/GetPackage" => {
5730                    #[allow(non_camel_case_types)]
5731                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
5732                    impl<
5733                        T: MovePackageService,
5734                    > tonic::server::UnaryService<super::GetPackageRequest>
5735                    for GetPackageSvc<T> {
5736                        type Response = super::GetPackageResponse;
5737                        type Future = BoxFuture<
5738                            tonic::Response<Self::Response>,
5739                            tonic::Status,
5740                        >;
5741                        fn call(
5742                            &mut self,
5743                            request: tonic::Request<super::GetPackageRequest>,
5744                        ) -> Self::Future {
5745                            let inner = Arc::clone(&self.0);
5746                            let fut = async move {
5747                                <T as MovePackageService>::get_package(&inner, request)
5748                                    .await
5749                            };
5750                            Box::pin(fut)
5751                        }
5752                    }
5753                    let accept_compression_encodings = self.accept_compression_encodings;
5754                    let send_compression_encodings = self.send_compression_encodings;
5755                    let max_decoding_message_size = self.max_decoding_message_size;
5756                    let max_encoding_message_size = self.max_encoding_message_size;
5757                    let inner = self.inner.clone();
5758                    let fut = async move {
5759                        let method = GetPackageSvc(inner);
5760                        let codec = tonic_prost::ProstCodec::default();
5761                        let mut grpc = tonic::server::Grpc::new(codec)
5762                            .apply_compression_config(
5763                                accept_compression_encodings,
5764                                send_compression_encodings,
5765                            )
5766                            .apply_max_message_size_config(
5767                                max_decoding_message_size,
5768                                max_encoding_message_size,
5769                            );
5770                        let res = grpc.unary(method, req).await;
5771                        Ok(res)
5772                    };
5773                    Box::pin(fut)
5774                }
5775                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
5776                    #[allow(non_camel_case_types)]
5777                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
5778                    impl<
5779                        T: MovePackageService,
5780                    > tonic::server::UnaryService<super::GetDatatypeRequest>
5781                    for GetDatatypeSvc<T> {
5782                        type Response = super::GetDatatypeResponse;
5783                        type Future = BoxFuture<
5784                            tonic::Response<Self::Response>,
5785                            tonic::Status,
5786                        >;
5787                        fn call(
5788                            &mut self,
5789                            request: tonic::Request<super::GetDatatypeRequest>,
5790                        ) -> Self::Future {
5791                            let inner = Arc::clone(&self.0);
5792                            let fut = async move {
5793                                <T as MovePackageService>::get_datatype(&inner, request)
5794                                    .await
5795                            };
5796                            Box::pin(fut)
5797                        }
5798                    }
5799                    let accept_compression_encodings = self.accept_compression_encodings;
5800                    let send_compression_encodings = self.send_compression_encodings;
5801                    let max_decoding_message_size = self.max_decoding_message_size;
5802                    let max_encoding_message_size = self.max_encoding_message_size;
5803                    let inner = self.inner.clone();
5804                    let fut = async move {
5805                        let method = GetDatatypeSvc(inner);
5806                        let codec = tonic_prost::ProstCodec::default();
5807                        let mut grpc = tonic::server::Grpc::new(codec)
5808                            .apply_compression_config(
5809                                accept_compression_encodings,
5810                                send_compression_encodings,
5811                            )
5812                            .apply_max_message_size_config(
5813                                max_decoding_message_size,
5814                                max_encoding_message_size,
5815                            );
5816                        let res = grpc.unary(method, req).await;
5817                        Ok(res)
5818                    };
5819                    Box::pin(fut)
5820                }
5821                "/sui.rpc.v2.MovePackageService/GetFunction" => {
5822                    #[allow(non_camel_case_types)]
5823                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
5824                    impl<
5825                        T: MovePackageService,
5826                    > tonic::server::UnaryService<super::GetFunctionRequest>
5827                    for GetFunctionSvc<T> {
5828                        type Response = super::GetFunctionResponse;
5829                        type Future = BoxFuture<
5830                            tonic::Response<Self::Response>,
5831                            tonic::Status,
5832                        >;
5833                        fn call(
5834                            &mut self,
5835                            request: tonic::Request<super::GetFunctionRequest>,
5836                        ) -> Self::Future {
5837                            let inner = Arc::clone(&self.0);
5838                            let fut = async move {
5839                                <T as MovePackageService>::get_function(&inner, request)
5840                                    .await
5841                            };
5842                            Box::pin(fut)
5843                        }
5844                    }
5845                    let accept_compression_encodings = self.accept_compression_encodings;
5846                    let send_compression_encodings = self.send_compression_encodings;
5847                    let max_decoding_message_size = self.max_decoding_message_size;
5848                    let max_encoding_message_size = self.max_encoding_message_size;
5849                    let inner = self.inner.clone();
5850                    let fut = async move {
5851                        let method = GetFunctionSvc(inner);
5852                        let codec = tonic_prost::ProstCodec::default();
5853                        let mut grpc = tonic::server::Grpc::new(codec)
5854                            .apply_compression_config(
5855                                accept_compression_encodings,
5856                                send_compression_encodings,
5857                            )
5858                            .apply_max_message_size_config(
5859                                max_decoding_message_size,
5860                                max_encoding_message_size,
5861                            );
5862                        let res = grpc.unary(method, req).await;
5863                        Ok(res)
5864                    };
5865                    Box::pin(fut)
5866                }
5867                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
5868                    #[allow(non_camel_case_types)]
5869                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
5870                    impl<
5871                        T: MovePackageService,
5872                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
5873                    for ListPackageVersionsSvc<T> {
5874                        type Response = super::ListPackageVersionsResponse;
5875                        type Future = BoxFuture<
5876                            tonic::Response<Self::Response>,
5877                            tonic::Status,
5878                        >;
5879                        fn call(
5880                            &mut self,
5881                            request: tonic::Request<super::ListPackageVersionsRequest>,
5882                        ) -> Self::Future {
5883                            let inner = Arc::clone(&self.0);
5884                            let fut = async move {
5885                                <T as MovePackageService>::list_package_versions(
5886                                        &inner,
5887                                        request,
5888                                    )
5889                                    .await
5890                            };
5891                            Box::pin(fut)
5892                        }
5893                    }
5894                    let accept_compression_encodings = self.accept_compression_encodings;
5895                    let send_compression_encodings = self.send_compression_encodings;
5896                    let max_decoding_message_size = self.max_decoding_message_size;
5897                    let max_encoding_message_size = self.max_encoding_message_size;
5898                    let inner = self.inner.clone();
5899                    let fut = async move {
5900                        let method = ListPackageVersionsSvc(inner);
5901                        let codec = tonic_prost::ProstCodec::default();
5902                        let mut grpc = tonic::server::Grpc::new(codec)
5903                            .apply_compression_config(
5904                                accept_compression_encodings,
5905                                send_compression_encodings,
5906                            )
5907                            .apply_max_message_size_config(
5908                                max_decoding_message_size,
5909                                max_encoding_message_size,
5910                            );
5911                        let res = grpc.unary(method, req).await;
5912                        Ok(res)
5913                    };
5914                    Box::pin(fut)
5915                }
5916                "/sui.rpc.v2.MovePackageService/ListSystemPackages" => {
5917                    #[allow(non_camel_case_types)]
5918                    struct ListSystemPackagesSvc<T: MovePackageService>(pub Arc<T>);
5919                    impl<
5920                        T: MovePackageService,
5921                    > tonic::server::UnaryService<super::ListSystemPackagesRequest>
5922                    for ListSystemPackagesSvc<T> {
5923                        type Response = super::ListSystemPackagesResponse;
5924                        type Future = BoxFuture<
5925                            tonic::Response<Self::Response>,
5926                            tonic::Status,
5927                        >;
5928                        fn call(
5929                            &mut self,
5930                            request: tonic::Request<super::ListSystemPackagesRequest>,
5931                        ) -> Self::Future {
5932                            let inner = Arc::clone(&self.0);
5933                            let fut = async move {
5934                                <T as MovePackageService>::list_system_packages(
5935                                        &inner,
5936                                        request,
5937                                    )
5938                                    .await
5939                            };
5940                            Box::pin(fut)
5941                        }
5942                    }
5943                    let accept_compression_encodings = self.accept_compression_encodings;
5944                    let send_compression_encodings = self.send_compression_encodings;
5945                    let max_decoding_message_size = self.max_decoding_message_size;
5946                    let max_encoding_message_size = self.max_encoding_message_size;
5947                    let inner = self.inner.clone();
5948                    let fut = async move {
5949                        let method = ListSystemPackagesSvc(inner);
5950                        let codec = tonic_prost::ProstCodec::default();
5951                        let mut grpc = tonic::server::Grpc::new(codec)
5952                            .apply_compression_config(
5953                                accept_compression_encodings,
5954                                send_compression_encodings,
5955                            )
5956                            .apply_max_message_size_config(
5957                                max_decoding_message_size,
5958                                max_encoding_message_size,
5959                            );
5960                        let res = grpc.unary(method, req).await;
5961                        Ok(res)
5962                    };
5963                    Box::pin(fut)
5964                }
5965                _ => {
5966                    Box::pin(async move {
5967                        let mut response = http::Response::new(
5968                            tonic::body::Body::default(),
5969                        );
5970                        let headers = response.headers_mut();
5971                        headers
5972                            .insert(
5973                                tonic::Status::GRPC_STATUS,
5974                                (tonic::Code::Unimplemented as i32).into(),
5975                            );
5976                        headers
5977                            .insert(
5978                                http::header::CONTENT_TYPE,
5979                                tonic::metadata::GRPC_CONTENT_TYPE,
5980                            );
5981                        Ok(response)
5982                    })
5983                }
5984            }
5985        }
5986    }
5987    impl<T> Clone for MovePackageServiceServer<T> {
5988        fn clone(&self) -> Self {
5989            let inner = self.inner.clone();
5990            Self {
5991                inner,
5992                accept_compression_encodings: self.accept_compression_encodings,
5993                send_compression_encodings: self.send_compression_encodings,
5994                max_decoding_message_size: self.max_decoding_message_size,
5995                max_encoding_message_size: self.max_encoding_message_size,
5996            }
5997        }
5998    }
5999    /// Generated gRPC service name
6000    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
6001    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
6002        const NAME: &'static str = SERVICE_NAME;
6003    }
6004}
6005#[non_exhaustive]
6006#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6007pub struct LookupNameRequest {
6008    /// Required. The SuiNS name to lookup.
6009    ///
6010    /// Supports both `@name` as well as `name.sui` formats.
6011    #[prost(string, optional, tag = "1")]
6012    pub name: ::core::option::Option<::prost::alloc::string::String>,
6013}
6014#[non_exhaustive]
6015#[derive(Clone, PartialEq, ::prost::Message)]
6016pub struct LookupNameResponse {
6017    /// The record for the requested name
6018    #[prost(message, optional, tag = "1")]
6019    pub record: ::core::option::Option<NameRecord>,
6020}
6021#[non_exhaustive]
6022#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6023pub struct ReverseLookupNameRequest {
6024    /// Required. The address to perform a reverse lookup for.
6025    #[prost(string, optional, tag = "1")]
6026    pub address: ::core::option::Option<::prost::alloc::string::String>,
6027}
6028#[non_exhaustive]
6029#[derive(Clone, PartialEq, ::prost::Message)]
6030pub struct ReverseLookupNameResponse {
6031    /// The record for the SuiNS name linked to the requested address
6032    #[prost(message, optional, tag = "1")]
6033    pub record: ::core::option::Option<NameRecord>,
6034}
6035#[non_exhaustive]
6036#[derive(Clone, PartialEq, ::prost::Message)]
6037pub struct NameRecord {
6038    /// Id of this record.
6039    ///
6040    /// Note that records are stored on chain as dynamic fields of the type
6041    /// `Field<Domain,NameRecord>`.
6042    #[prost(string, optional, tag = "1")]
6043    pub id: ::core::option::Option<::prost::alloc::string::String>,
6044    /// The SuiNS name of this record
6045    #[prost(string, optional, tag = "2")]
6046    pub name: ::core::option::Option<::prost::alloc::string::String>,
6047    /// The ID of the `RegistrationNFT` assigned to this record.
6048    ///
6049    /// The owner of the corresponding `RegistrationNFT` has the rights to
6050    /// be able to change and adjust the `target_address` of this domain.
6051    ///
6052    /// It is possible that the ID changes if the record expires and is
6053    /// purchased by someone else.
6054    #[prost(string, optional, tag = "3")]
6055    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
6056    /// Timestamp when the record expires.
6057    ///
6058    /// This is either the expiration of the record itself or the expiration of
6059    /// this record's parent if this is a leaf record.
6060    #[prost(message, optional, tag = "4")]
6061    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6062    /// The target address that this name points to
6063    #[prost(string, optional, tag = "5")]
6064    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
6065    /// Additional data which may be stored in a record
6066    #[prost(btree_map = "string, string", tag = "6")]
6067    pub data: ::prost::alloc::collections::BTreeMap<
6068        ::prost::alloc::string::String,
6069        ::prost::alloc::string::String,
6070    >,
6071}
6072/// Generated client implementations.
6073pub mod name_service_client {
6074    #![allow(
6075        unused_variables,
6076        dead_code,
6077        missing_docs,
6078        clippy::wildcard_imports,
6079        clippy::let_unit_value,
6080    )]
6081    use tonic::codegen::*;
6082    use tonic::codegen::http::Uri;
6083    #[derive(Debug, Clone)]
6084    pub struct NameServiceClient<T> {
6085        inner: tonic::client::Grpc<T>,
6086    }
6087    impl NameServiceClient<tonic::transport::Channel> {
6088        /// Attempt to create a new client by connecting to a given endpoint.
6089        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6090        where
6091            D: TryInto<tonic::transport::Endpoint>,
6092            D::Error: Into<StdError>,
6093        {
6094            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6095            Ok(Self::new(conn))
6096        }
6097    }
6098    impl<T> NameServiceClient<T>
6099    where
6100        T: tonic::client::GrpcService<tonic::body::Body>,
6101        T::Error: Into<StdError>,
6102        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6103        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6104    {
6105        pub fn new(inner: T) -> Self {
6106            let inner = tonic::client::Grpc::new(inner);
6107            Self { inner }
6108        }
6109        pub fn with_origin(inner: T, origin: Uri) -> Self {
6110            let inner = tonic::client::Grpc::with_origin(inner, origin);
6111            Self { inner }
6112        }
6113        pub fn with_interceptor<F>(
6114            inner: T,
6115            interceptor: F,
6116        ) -> NameServiceClient<InterceptedService<T, F>>
6117        where
6118            F: tonic::service::Interceptor,
6119            T::ResponseBody: Default,
6120            T: tonic::codegen::Service<
6121                http::Request<tonic::body::Body>,
6122                Response = http::Response<
6123                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6124                >,
6125            >,
6126            <T as tonic::codegen::Service<
6127                http::Request<tonic::body::Body>,
6128            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6129        {
6130            NameServiceClient::new(InterceptedService::new(inner, interceptor))
6131        }
6132        /// Compress requests with the given encoding.
6133        ///
6134        /// This requires the server to support it otherwise it might respond with an
6135        /// error.
6136        #[must_use]
6137        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6138            self.inner = self.inner.send_compressed(encoding);
6139            self
6140        }
6141        /// Enable decompressing responses.
6142        #[must_use]
6143        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6144            self.inner = self.inner.accept_compressed(encoding);
6145            self
6146        }
6147        /// Limits the maximum size of a decoded message.
6148        ///
6149        /// Default: `4MB`
6150        #[must_use]
6151        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6152            self.inner = self.inner.max_decoding_message_size(limit);
6153            self
6154        }
6155        /// Limits the maximum size of an encoded message.
6156        ///
6157        /// Default: `usize::MAX`
6158        #[must_use]
6159        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6160            self.inner = self.inner.max_encoding_message_size(limit);
6161            self
6162        }
6163        pub async fn lookup_name(
6164            &mut self,
6165            request: impl tonic::IntoRequest<super::LookupNameRequest>,
6166        ) -> std::result::Result<
6167            tonic::Response<super::LookupNameResponse>,
6168            tonic::Status,
6169        > {
6170            self.inner
6171                .ready()
6172                .await
6173                .map_err(|e| {
6174                    tonic::Status::unknown(
6175                        format!("Service was not ready: {}", e.into()),
6176                    )
6177                })?;
6178            let codec = tonic_prost::ProstCodec::default();
6179            let path = http::uri::PathAndQuery::from_static(
6180                "/sui.rpc.v2.NameService/LookupName",
6181            );
6182            let mut req = request.into_request();
6183            req.extensions_mut()
6184                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
6185            self.inner.unary(req, path, codec).await
6186        }
6187        pub async fn reverse_lookup_name(
6188            &mut self,
6189            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
6190        ) -> std::result::Result<
6191            tonic::Response<super::ReverseLookupNameResponse>,
6192            tonic::Status,
6193        > {
6194            self.inner
6195                .ready()
6196                .await
6197                .map_err(|e| {
6198                    tonic::Status::unknown(
6199                        format!("Service was not ready: {}", e.into()),
6200                    )
6201                })?;
6202            let codec = tonic_prost::ProstCodec::default();
6203            let path = http::uri::PathAndQuery::from_static(
6204                "/sui.rpc.v2.NameService/ReverseLookupName",
6205            );
6206            let mut req = request.into_request();
6207            req.extensions_mut()
6208                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
6209            self.inner.unary(req, path, codec).await
6210        }
6211    }
6212}
6213/// Generated server implementations.
6214pub mod name_service_server {
6215    #![allow(
6216        unused_variables,
6217        dead_code,
6218        missing_docs,
6219        clippy::wildcard_imports,
6220        clippy::let_unit_value,
6221    )]
6222    use tonic::codegen::*;
6223    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
6224    #[async_trait]
6225    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
6226        async fn lookup_name(
6227            &self,
6228            request: tonic::Request<super::LookupNameRequest>,
6229        ) -> std::result::Result<
6230            tonic::Response<super::LookupNameResponse>,
6231            tonic::Status,
6232        > {
6233            Err(tonic::Status::unimplemented("Not yet implemented"))
6234        }
6235        async fn reverse_lookup_name(
6236            &self,
6237            request: tonic::Request<super::ReverseLookupNameRequest>,
6238        ) -> std::result::Result<
6239            tonic::Response<super::ReverseLookupNameResponse>,
6240            tonic::Status,
6241        > {
6242            Err(tonic::Status::unimplemented("Not yet implemented"))
6243        }
6244    }
6245    #[derive(Debug)]
6246    pub struct NameServiceServer<T> {
6247        inner: Arc<T>,
6248        accept_compression_encodings: EnabledCompressionEncodings,
6249        send_compression_encodings: EnabledCompressionEncodings,
6250        max_decoding_message_size: Option<usize>,
6251        max_encoding_message_size: Option<usize>,
6252    }
6253    impl<T> NameServiceServer<T> {
6254        pub fn new(inner: T) -> Self {
6255            Self::from_arc(Arc::new(inner))
6256        }
6257        pub fn from_arc(inner: Arc<T>) -> Self {
6258            Self {
6259                inner,
6260                accept_compression_encodings: Default::default(),
6261                send_compression_encodings: Default::default(),
6262                max_decoding_message_size: None,
6263                max_encoding_message_size: None,
6264            }
6265        }
6266        pub fn with_interceptor<F>(
6267            inner: T,
6268            interceptor: F,
6269        ) -> InterceptedService<Self, F>
6270        where
6271            F: tonic::service::Interceptor,
6272        {
6273            InterceptedService::new(Self::new(inner), interceptor)
6274        }
6275        /// Enable decompressing requests with the given encoding.
6276        #[must_use]
6277        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6278            self.accept_compression_encodings.enable(encoding);
6279            self
6280        }
6281        /// Compress responses with the given encoding, if the client supports it.
6282        #[must_use]
6283        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6284            self.send_compression_encodings.enable(encoding);
6285            self
6286        }
6287        /// Limits the maximum size of a decoded message.
6288        ///
6289        /// Default: `4MB`
6290        #[must_use]
6291        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6292            self.max_decoding_message_size = Some(limit);
6293            self
6294        }
6295        /// Limits the maximum size of an encoded message.
6296        ///
6297        /// Default: `usize::MAX`
6298        #[must_use]
6299        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6300            self.max_encoding_message_size = Some(limit);
6301            self
6302        }
6303    }
6304    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
6305    where
6306        T: NameService,
6307        B: Body + std::marker::Send + 'static,
6308        B::Error: Into<StdError> + std::marker::Send + 'static,
6309    {
6310        type Response = http::Response<tonic::body::Body>;
6311        type Error = std::convert::Infallible;
6312        type Future = BoxFuture<Self::Response, Self::Error>;
6313        fn poll_ready(
6314            &mut self,
6315            _cx: &mut Context<'_>,
6316        ) -> Poll<std::result::Result<(), Self::Error>> {
6317            Poll::Ready(Ok(()))
6318        }
6319        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6320            match req.uri().path() {
6321                "/sui.rpc.v2.NameService/LookupName" => {
6322                    #[allow(non_camel_case_types)]
6323                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
6324                    impl<
6325                        T: NameService,
6326                    > tonic::server::UnaryService<super::LookupNameRequest>
6327                    for LookupNameSvc<T> {
6328                        type Response = super::LookupNameResponse;
6329                        type Future = BoxFuture<
6330                            tonic::Response<Self::Response>,
6331                            tonic::Status,
6332                        >;
6333                        fn call(
6334                            &mut self,
6335                            request: tonic::Request<super::LookupNameRequest>,
6336                        ) -> Self::Future {
6337                            let inner = Arc::clone(&self.0);
6338                            let fut = async move {
6339                                <T as NameService>::lookup_name(&inner, request).await
6340                            };
6341                            Box::pin(fut)
6342                        }
6343                    }
6344                    let accept_compression_encodings = self.accept_compression_encodings;
6345                    let send_compression_encodings = self.send_compression_encodings;
6346                    let max_decoding_message_size = self.max_decoding_message_size;
6347                    let max_encoding_message_size = self.max_encoding_message_size;
6348                    let inner = self.inner.clone();
6349                    let fut = async move {
6350                        let method = LookupNameSvc(inner);
6351                        let codec = tonic_prost::ProstCodec::default();
6352                        let mut grpc = tonic::server::Grpc::new(codec)
6353                            .apply_compression_config(
6354                                accept_compression_encodings,
6355                                send_compression_encodings,
6356                            )
6357                            .apply_max_message_size_config(
6358                                max_decoding_message_size,
6359                                max_encoding_message_size,
6360                            );
6361                        let res = grpc.unary(method, req).await;
6362                        Ok(res)
6363                    };
6364                    Box::pin(fut)
6365                }
6366                "/sui.rpc.v2.NameService/ReverseLookupName" => {
6367                    #[allow(non_camel_case_types)]
6368                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
6369                    impl<
6370                        T: NameService,
6371                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
6372                    for ReverseLookupNameSvc<T> {
6373                        type Response = super::ReverseLookupNameResponse;
6374                        type Future = BoxFuture<
6375                            tonic::Response<Self::Response>,
6376                            tonic::Status,
6377                        >;
6378                        fn call(
6379                            &mut self,
6380                            request: tonic::Request<super::ReverseLookupNameRequest>,
6381                        ) -> Self::Future {
6382                            let inner = Arc::clone(&self.0);
6383                            let fut = async move {
6384                                <T as NameService>::reverse_lookup_name(&inner, request)
6385                                    .await
6386                            };
6387                            Box::pin(fut)
6388                        }
6389                    }
6390                    let accept_compression_encodings = self.accept_compression_encodings;
6391                    let send_compression_encodings = self.send_compression_encodings;
6392                    let max_decoding_message_size = self.max_decoding_message_size;
6393                    let max_encoding_message_size = self.max_encoding_message_size;
6394                    let inner = self.inner.clone();
6395                    let fut = async move {
6396                        let method = ReverseLookupNameSvc(inner);
6397                        let codec = tonic_prost::ProstCodec::default();
6398                        let mut grpc = tonic::server::Grpc::new(codec)
6399                            .apply_compression_config(
6400                                accept_compression_encodings,
6401                                send_compression_encodings,
6402                            )
6403                            .apply_max_message_size_config(
6404                                max_decoding_message_size,
6405                                max_encoding_message_size,
6406                            );
6407                        let res = grpc.unary(method, req).await;
6408                        Ok(res)
6409                    };
6410                    Box::pin(fut)
6411                }
6412                _ => {
6413                    Box::pin(async move {
6414                        let mut response = http::Response::new(
6415                            tonic::body::Body::default(),
6416                        );
6417                        let headers = response.headers_mut();
6418                        headers
6419                            .insert(
6420                                tonic::Status::GRPC_STATUS,
6421                                (tonic::Code::Unimplemented as i32).into(),
6422                            );
6423                        headers
6424                            .insert(
6425                                http::header::CONTENT_TYPE,
6426                                tonic::metadata::GRPC_CONTENT_TYPE,
6427                            );
6428                        Ok(response)
6429                    })
6430                }
6431            }
6432        }
6433    }
6434    impl<T> Clone for NameServiceServer<T> {
6435        fn clone(&self) -> Self {
6436            let inner = self.inner.clone();
6437            Self {
6438                inner,
6439                accept_compression_encodings: self.accept_compression_encodings,
6440                send_compression_encodings: self.send_compression_encodings,
6441                max_decoding_message_size: self.max_decoding_message_size,
6442                max_encoding_message_size: self.max_encoding_message_size,
6443            }
6444        }
6445    }
6446    /// Generated gRPC service name
6447    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
6448    impl<T> tonic::server::NamedService for NameServiceServer<T> {
6449        const NAME: &'static str = SERVICE_NAME;
6450    }
6451}
6452/// An object on the Sui blockchain.
6453#[non_exhaustive]
6454#[derive(Clone, PartialEq, ::prost::Message)]
6455pub struct Object {
6456    /// This Object serialized as BCS.
6457    #[prost(message, optional, tag = "1")]
6458    pub bcs: ::core::option::Option<Bcs>,
6459    /// `ObjectId` for this object.
6460    #[prost(string, optional, tag = "2")]
6461    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
6462    /// Version of the object.
6463    #[prost(uint64, optional, tag = "3")]
6464    pub version: ::core::option::Option<u64>,
6465    /// The digest of this Object.
6466    #[prost(string, optional, tag = "4")]
6467    pub digest: ::core::option::Option<::prost::alloc::string::String>,
6468    /// Owner of the object.
6469    #[prost(message, optional, tag = "5")]
6470    pub owner: ::core::option::Option<Owner>,
6471    /// The type of this object.
6472    ///
6473    /// This will be 'package' for packages and a StructTag for move structs.
6474    #[prost(string, optional, tag = "6")]
6475    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6476    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
6477    /// object. Instead, it is always calculated from the objects type when loaded in execution.
6478    ///
6479    /// Only set for Move structs
6480    #[prost(bool, optional, tag = "7")]
6481    pub has_public_transfer: ::core::option::Option<bool>,
6482    /// BCS bytes of a Move struct value.
6483    ///
6484    /// Only set for Move structs
6485    #[prost(message, optional, tag = "8")]
6486    pub contents: ::core::option::Option<Bcs>,
6487    /// Package information for Move Packages
6488    #[prost(message, optional, tag = "9")]
6489    pub package: ::core::option::Option<Package>,
6490    /// The digest of the transaction that created or last mutated this object
6491    #[prost(string, optional, tag = "10")]
6492    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
6493    /// The amount of SUI to rebate if this object gets deleted.
6494    /// This number is re-calculated each time the object is mutated based on
6495    /// the present storage gas price.
6496    #[prost(uint64, optional, tag = "11")]
6497    pub storage_rebate: ::core::option::Option<u64>,
6498    /// JSON rendering of the object.
6499    #[prost(message, optional, boxed, tag = "100")]
6500    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
6501    /// Current balance if this object is a `0x2::coin::Coin<T>`
6502    #[prost(uint64, optional, tag = "101")]
6503    pub balance: ::core::option::Option<u64>,
6504    /// JSON rendering of the object based on an on-chain template.
6505    /// This will not be set if the value's type does not have an associated `Display` template.
6506    #[prost(message, optional, boxed, tag = "102")]
6507    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
6508}
6509/// Set of Objects
6510#[non_exhaustive]
6511#[derive(Clone, PartialEq, ::prost::Message)]
6512pub struct ObjectSet {
6513    /// Objects are sorted by the key `(object_id, version)`.
6514    #[prost(message, repeated, tag = "1")]
6515    pub objects: ::prost::alloc::vec::Vec<Object>,
6516}
6517/// A rendered JSON blob based on an on-chain template.
6518#[non_exhaustive]
6519#[derive(Clone, PartialEq, ::prost::Message)]
6520pub struct Display {
6521    /// Output for all successfully substituted display fields. Unsuccessful
6522    /// fields will be `null`, and will be accompanied by a field in `errors`,
6523    /// explaining the error.
6524    #[prost(message, optional, tag = "1")]
6525    pub output: ::core::option::Option<::prost_types::Value>,
6526    /// If any fields failed to render, this will contain a mapping from failed
6527    /// field names to error messages. If all fields succeed, this will either be
6528    /// `null` or not set.
6529    #[prost(message, optional, tag = "2")]
6530    pub errors: ::core::option::Option<::prost_types::Value>,
6531}
6532/// Reference to an object.
6533#[non_exhaustive]
6534#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6535pub struct ObjectReference {
6536    /// The object id of this object.
6537    #[prost(string, optional, tag = "1")]
6538    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
6539    /// The version of this object.
6540    #[prost(uint64, optional, tag = "2")]
6541    pub version: ::core::option::Option<u64>,
6542    /// The digest of this object.
6543    #[prost(string, optional, tag = "3")]
6544    pub digest: ::core::option::Option<::prost::alloc::string::String>,
6545}
6546/// Enum of different types of ownership for an object.
6547#[non_exhaustive]
6548#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6549pub struct Owner {
6550    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
6551    pub kind: ::core::option::Option<i32>,
6552    /// Address or ObjectId of the owner
6553    #[prost(string, optional, tag = "2")]
6554    pub address: ::core::option::Option<::prost::alloc::string::String>,
6555    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
6556    #[prost(uint64, optional, tag = "3")]
6557    pub version: ::core::option::Option<u64>,
6558}
6559/// Nested message and enum types in `Owner`.
6560pub mod owner {
6561    #[non_exhaustive]
6562    #[derive(
6563        Clone,
6564        Copy,
6565        Debug,
6566        PartialEq,
6567        Eq,
6568        Hash,
6569        PartialOrd,
6570        Ord,
6571        ::prost::Enumeration
6572    )]
6573    #[repr(i32)]
6574    pub enum OwnerKind {
6575        Unknown = 0,
6576        Address = 1,
6577        Object = 2,
6578        Shared = 3,
6579        Immutable = 4,
6580        ConsensusAddress = 5,
6581    }
6582    impl OwnerKind {
6583        /// String value of the enum field names used in the ProtoBuf definition.
6584        ///
6585        /// The values are not transformed in any way and thus are considered stable
6586        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6587        pub fn as_str_name(&self) -> &'static str {
6588            match self {
6589                Self::Unknown => "OWNER_KIND_UNKNOWN",
6590                Self::Address => "ADDRESS",
6591                Self::Object => "OBJECT",
6592                Self::Shared => "SHARED",
6593                Self::Immutable => "IMMUTABLE",
6594                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
6595            }
6596        }
6597        /// Creates an enum from field names used in the ProtoBuf definition.
6598        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6599            match value {
6600                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
6601                "ADDRESS" => Some(Self::Address),
6602                "OBJECT" => Some(Self::Object),
6603                "SHARED" => Some(Self::Shared),
6604                "IMMUTABLE" => Some(Self::Immutable),
6605                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
6606                _ => None,
6607            }
6608        }
6609    }
6610}
6611#[non_exhaustive]
6612#[derive(Clone, PartialEq, ::prost::Message)]
6613pub struct ProtocolConfig {
6614    #[prost(uint64, optional, tag = "1")]
6615    pub protocol_version: ::core::option::Option<u64>,
6616    /// Deprecated in favor of the lossless `configs` field.
6617    #[prost(btree_map = "string, bool", tag = "2")]
6618    pub feature_flags: ::prost::alloc::collections::BTreeMap<
6619        ::prost::alloc::string::String,
6620        bool,
6621    >,
6622    /// Deprecated in favor of the lossless `configs` field.
6623    #[prost(btree_map = "string, string", tag = "3")]
6624    pub attributes: ::prost::alloc::collections::BTreeMap<
6625        ::prost::alloc::string::String,
6626        ::prost::alloc::string::String,
6627    >,
6628    #[prost(btree_map = "string, message", tag = "4")]
6629    pub configs: ::prost::alloc::collections::BTreeMap<
6630        ::prost::alloc::string::String,
6631        ::prost_types::Value,
6632    >,
6633}
6634/// Cursor-bounded options for a listing request.
6635///
6636/// `after` and `before` are opaque, exclusive bounds in the listing's canonical
6637/// order. `after` always excludes items at or below that cursor, and `before`
6638/// always excludes items at or above that cursor. Their meaning does not depend
6639/// on `ordering`, which only sets the order of results within the bounded
6640/// interval.
6641///
6642/// Other range fields on the request, such as checkpoint or version bounds,
6643/// compose with the cursor bounds by intersection: results come only from
6644/// inside both.
6645///
6646/// Each method sets its own `limit` default and maximum and documents how to
6647/// resume.
6648#[non_exhaustive]
6649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6650pub struct QueryOptions {
6651    /// The maximum number of items to return. Each method applies its own default
6652    /// and maximum.
6653    #[prost(uint32, optional, tag = "1")]
6654    pub limit: ::core::option::Option<u32>,
6655    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
6656    /// the listing's canonical order.
6657    #[prost(bytes = "bytes", optional, tag = "2")]
6658    pub after: ::core::option::Option<::prost::bytes::Bytes>,
6659    /// Opaque exclusive upper bound. Results must be strictly before this cursor
6660    /// in the listing's canonical order.
6661    #[prost(bytes = "bytes", optional, tag = "3")]
6662    pub before: ::core::option::Option<::prost::bytes::Bytes>,
6663    /// Ordering for returned results. Defaults to ASCENDING.
6664    ///
6665    /// Ordering only controls the order of results within the bounded interval;
6666    /// cursor bounds keep the same meaning for ascending and descending reads.
6667    #[prost(enumeration = "Ordering", optional, tag = "4")]
6668    pub ordering: ::core::option::Option<i32>,
6669}
6670/// A point in ledger order: the boundary between the items whose keys sort
6671/// below this position and the items whose keys sort at or above it.
6672///
6673/// An item's key is (`sequence_number`) for a `Checkpoint`, (`checkpoint`,
6674/// `transaction_index`) for an `ExecutedTransaction`, and (`checkpoint`,
6675/// `transaction_index`, `event_index`) for an `Event`. Keys and positions sort
6676/// lexicographically, with unset fields counting as 0.
6677///
6678/// An index past the last transaction of a checkpoint, or past the last event of
6679/// a transaction, names the start of the next one, so different positions can
6680/// name the same boundary: after the last of checkpoint `c`'s `n` transactions,
6681/// both (`c`, `n`) and (`c + 1`, 0) name the start of checkpoint `c + 1`.
6682/// Sorting never contradicts ledger order: a position that sorts below another
6683/// is at or before it. Use comparisons to drop what is behind, and never assume
6684/// that positions that differ name different boundaries.
6685///
6686/// To bound a request at a position: as its start, set `start_checkpoint` to
6687/// `checkpoint` and, when either index is nonzero, the start index fields to
6688/// both indexes, including one that is 0 (`start_transaction_index`, plus
6689/// `start_event_index` for events). As its end, set `end_checkpoint` to
6690/// `checkpoint` when both indexes are 0; otherwise set `end_checkpoint` to
6691/// `checkpoint + 1` and the end index fields to both indexes
6692/// (`end_transaction_index`, plus `end_event_index` for events). Checkpoint
6693/// positions carry only `checkpoint`, so they set only `start_checkpoint` or
6694/// `end_checkpoint`.
6695#[non_exhaustive]
6696#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6697pub struct LedgerPosition {
6698    /// Checkpoint sequence number.
6699    #[prost(uint64, optional, tag = "1")]
6700    pub checkpoint: ::core::option::Option<u64>,
6701    /// Zero-based position of a transaction within `checkpoint`.
6702    #[prost(uint64, optional, tag = "2")]
6703    pub transaction_index: ::core::option::Option<u64>,
6704    /// Zero-based index of an event within its transaction's event list. Event
6705    /// streams only.
6706    #[prost(uint32, optional, tag = "3")]
6707    pub event_index: ::core::option::Option<u32>,
6708}
6709/// Progress of a scan, carried on every response frame, whether or not the
6710/// frame delivers a matching item. Watermarks never regress in the requested
6711/// ordering, but consecutive frames may carry the same watermark when
6712/// additional work does not advance the safe resume frontier.
6713///
6714/// A watermark has two parts:
6715///
6716/// * The resume point, in two forms: `cursor`, opaque, for the server, and
6717///   `cursor_position`, in ledger coordinates, for clients to order frames and
6718///   drop duplicates.
6719/// * Coverage: `checkpoint`, the boundary checkpoint the scan has proven fully
6720///   covered. It trails the resume point.
6721///
6722/// To continue in the same direction, set the request's start (ascending) or
6723/// end (descending) at `cursor_position`. To read in the other direction, set
6724/// the other bound at `cursor_position` from a frame without an item; from a
6725/// frame with an item, start a page after the item at its key with the finest
6726/// index incremented, or end a page before it at its key. In both cases pass
6727/// `cursor` as `options.after` with a start and as `options.before` with an
6728/// end.
6729///
6730/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
6731/// `limit = N`, the response contains up to N matching items in descending
6732/// order from the interval `(A, B)`. If the response ends with
6733/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
6734/// `before` to the last `Watermark.cursor` received. That cursor is the
6735/// lowest position reached in ledger order, so it becomes the next exclusive
6736/// upper bound.
6737#[non_exhaustive]
6738#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6739pub struct Watermark {
6740    /// Opaque cursor at the resume point. Set on every watermark. Use as
6741    /// `options.after` (ascending) or `options.before` (descending) on the next
6742    /// request to resume from here. The most recently received cursor is always
6743    /// the safe resume point.
6744    ///
6745    /// Pass cursors back unchanged; never compare or inspect them. Cursors that
6746    /// differ can name the same point, and their encoding may change.
6747    #[prost(bytes = "bytes", optional, tag = "1")]
6748    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
6749    /// The inclusive boundary checkpoint that the scan has fully covered within
6750    /// the request's effective interval, in the request's ordering direction: an
6751    /// ascending scan has emitted every matching item in the interval at
6752    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
6753    /// matches); a descending scan has emitted every matching item in the
6754    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
6755    /// the scan direction, but it may repeat while the cursor advances.
6756    ///
6757    /// A starting cursor vouches for what precedes it: a scan resumed from an
6758    /// `after` cursor in checkpoint `c` may report `c - 1` from its first frame,
6759    /// and a descending scan resumed from a `before` cursor in `c` may report
6760    /// `c + 1`. Otherwise this is unset until the scan's first checkpoint is
6761    /// fully covered. A watermark still has a valid resume cursor while this
6762    /// field is unset.
6763    #[prost(uint64, optional, tag = "2")]
6764    pub checkpoint: ::core::option::Option<u64>,
6765    /// The resume point in ledger coordinates. Set on every watermark by servers
6766    /// that support it.
6767    ///
6768    /// Ascending, every match from the request's start up to (excluding)
6769    /// `cursor_position` has been delivered. Descending, every match from
6770    /// `cursor_position` up to (excluding) the request's end has been delivered.
6771    ///
6772    /// On a frame that carries an item, ascending, it is the boundary just past
6773    /// the item, so it is not the item's own key: it is that key with its finest
6774    /// index incremented (`event_index` for events, `transaction_index` for
6775    /// transactions, `checkpoint` for checkpoints). Descending, it is the boundary
6776    /// just before the item, which is the item's key.
6777    ///
6778    /// It never moves before the request's start (ascending) or past its end
6779    /// (descending), so an ascending request that starts beyond what the server
6780    /// has indexed gets its start echoed back: the resume point says where the
6781    /// client is, not where the ledger is. `cursor` may then name an earlier
6782    /// point; bounds intersect, so resuming with both starts at
6783    /// `cursor_position`.
6784    #[prost(message, optional, tag = "4")]
6785    pub cursor_position: ::core::option::Option<LedgerPosition>,
6786}
6787/// Marker for the final frame of a successful query stream. Every successful
6788/// stream sets `QueryEnd` on exactly one frame, after which no further frames
6789/// are sent. On streams whose frames carry a `Watermark`, that frame always
6790/// carries the final watermark. For `ItemLimit`, it also carries the final
6791/// matching item; for every other reason it carries no item. A ScanLimit
6792/// terminal watermark may repeat the previous frame's cursor when its
6793/// authoritative scan frontier was already emitted; this does not repeat an
6794/// item.
6795///
6796/// `QueryEnd` marks a frame; it is not an item, and it does not count against
6797/// `QueryOptions.limit`. A paged unary listing sets `QueryEnd` on every
6798/// response, alongside that page's items; the rules above about the final
6799/// frame and its item apply to streams.
6800///
6801/// A stream that fails or is cancelled terminates with a gRPC status and does
6802/// not send `QueryEnd`.
6803#[non_exhaustive]
6804#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6805pub struct QueryEnd {
6806    /// Reason this response stopped.
6807    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
6808    pub reason: ::core::option::Option<i32>,
6809}
6810/// Ordering for the returned result set.
6811#[non_exhaustive]
6812#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6813#[repr(i32)]
6814pub enum Ordering {
6815    /// Return results in increasing ledger order.
6816    Ascending = 0,
6817    /// Return results in decreasing ledger order.
6818    Descending = 1,
6819}
6820impl Ordering {
6821    /// String value of the enum field names used in the ProtoBuf definition.
6822    ///
6823    /// The values are not transformed in any way and thus are considered stable
6824    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6825    pub fn as_str_name(&self) -> &'static str {
6826        match self {
6827            Self::Ascending => "ORDERING_ASCENDING",
6828            Self::Descending => "ORDERING_DESCENDING",
6829        }
6830    }
6831    /// Creates an enum from field names used in the ProtoBuf definition.
6832    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6833        match value {
6834            "ORDERING_ASCENDING" => Some(Self::Ascending),
6835            "ORDERING_DESCENDING" => Some(Self::Descending),
6836            _ => None,
6837        }
6838    }
6839}
6840/// Reason the server stopped this query response.
6841#[non_exhaustive]
6842#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
6843#[repr(i32)]
6844pub enum QueryEndReason {
6845    /// The stop reason was not specified.
6846    Unknown = 0,
6847    /// The response reached the requested item limit. The final matching item's
6848    /// frame carries `QueryEnd`, plus the final watermark where frames carry
6849    /// one. Resume from that frame's `Watermark.cursor`, or, where frames carry
6850    /// no watermark, from the cursor the method returns with that item, to
6851    /// continue reading the same effective interval.
6852    ItemLimit = 1,
6853    /// The response reached the server's per-request bucket-fetch budget for
6854    /// filtered scans before reaching the effective interval bound. The terminal
6855    /// frame carries no item. Its watermark cursor is the authoritative scan
6856    /// frontier from which to resume.
6857    ScanLimit = 2,
6858    /// The scan reached the edge of the window the request set: its checkpoint
6859    /// range bound, a start or end position the request set within a
6860    /// checkpoint at that range's edge (for example `end_transaction_index` on
6861    /// `ListTransactionsRequest`), or a version range. Despite its name, it
6862    /// applies to any request window. A stream's terminal frame carries no
6863    /// item.
6864    CheckpointBound = 3,
6865    /// The scan reached an exclusive cursor bound. A stream's terminal frame
6866    /// carries no item. Where frames carry a watermark, its cursor represents
6867    /// that resolved bound without claiming that its containing checkpoint was
6868    /// fully covered.
6869    CursorBound = 4,
6870    /// The scan reached the currently indexed ledger tip. A stream's terminal
6871    /// frame carries no item.
6872    LedgerTip = 5,
6873}
6874impl QueryEndReason {
6875    /// String value of the enum field names used in the ProtoBuf definition.
6876    ///
6877    /// The values are not transformed in any way and thus are considered stable
6878    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6879    pub fn as_str_name(&self) -> &'static str {
6880        match self {
6881            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
6882            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
6883            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
6884            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
6885            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
6886            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
6887        }
6888    }
6889    /// Creates an enum from field names used in the ProtoBuf definition.
6890    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6891        match value {
6892            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
6893            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
6894            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
6895            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
6896            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
6897            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
6898            _ => None,
6899        }
6900    }
6901}
6902/// A signature from a user.
6903#[non_exhaustive]
6904#[derive(Clone, PartialEq, ::prost::Message)]
6905pub struct UserSignature {
6906    /// This signature serialized as as BCS.
6907    ///
6908    /// When provided as input this will support both the form that is length
6909    /// prefixed as well as not length prefixed.
6910    #[prost(message, optional, tag = "1")]
6911    pub bcs: ::core::option::Option<Bcs>,
6912    /// The signature scheme of this signature.
6913    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
6914    pub scheme: ::core::option::Option<i32>,
6915    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
6916    pub signature: ::core::option::Option<user_signature::Signature>,
6917}
6918/// Nested message and enum types in `UserSignature`.
6919pub mod user_signature {
6920    #[non_exhaustive]
6921    #[derive(Clone, PartialEq, ::prost::Oneof)]
6922    pub enum Signature {
6923        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1 | mldsa65.
6924        #[prost(message, tag = "3")]
6925        Simple(super::SimpleSignature),
6926        /// The multisig aggregated signature if scheme is `MULTISIG`.
6927        #[prost(message, tag = "4")]
6928        Multisig(super::MultisigAggregatedSignature),
6929        /// The zklogin authenticator if scheme is `ZKLOGIN`.
6930        #[prost(message, tag = "5")]
6931        Zklogin(super::ZkLoginAuthenticator),
6932        /// The passkey authenticator if scheme is `PASSKEY`.
6933        #[prost(message, tag = "6")]
6934        Passkey(super::PasskeyAuthenticator),
6935    }
6936}
6937/// Either an ed25519, secp256k1, secp256r1 or mldsa65 signature
6938#[non_exhaustive]
6939#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6940pub struct SimpleSignature {
6941    /// The signature scheme of this signature.
6942    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
6943    pub scheme: ::core::option::Option<i32>,
6944    /// Signature bytes
6945    #[prost(bytes = "bytes", optional, tag = "2")]
6946    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
6947    /// Public key bytes
6948    #[prost(bytes = "bytes", optional, tag = "3")]
6949    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
6950}
6951/// Public key equivalent for zklogin authenticators.
6952#[non_exhaustive]
6953#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6954pub struct ZkLoginPublicIdentifier {
6955    #[prost(string, optional, tag = "1")]
6956    pub iss: ::core::option::Option<::prost::alloc::string::String>,
6957    /// base10 encoded Bn254FieldElement
6958    #[prost(string, optional, tag = "2")]
6959    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
6960}
6961/// Set of valid public keys for multisig committee members.
6962#[non_exhaustive]
6963#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6964pub struct MultisigMemberPublicKey {
6965    /// The signature scheme of this public key.
6966    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
6967    pub scheme: ::core::option::Option<i32>,
6968    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey | mldsa65.
6969    #[prost(bytes = "bytes", optional, tag = "2")]
6970    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
6971    /// A zklogin public identifier if scheme is zklogin.
6972    #[prost(message, optional, tag = "3")]
6973    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
6974}
6975/// A member in a multisig committee.
6976#[non_exhaustive]
6977#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6978pub struct MultisigMember {
6979    /// The public key of the committee member.
6980    #[prost(message, optional, tag = "1")]
6981    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
6982    /// The weight of this member's signature.
6983    #[prost(uint32, optional, tag = "2")]
6984    pub weight: ::core::option::Option<u32>,
6985}
6986/// A multisig committee.
6987#[non_exhaustive]
6988#[derive(Clone, PartialEq, ::prost::Message)]
6989pub struct MultisigCommittee {
6990    /// A list of committee members and their corresponding weight.
6991    #[prost(message, repeated, tag = "1")]
6992    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
6993    /// The threshold of signatures needed to validate a signature from
6994    /// this committee.
6995    #[prost(uint32, optional, tag = "2")]
6996    pub threshold: ::core::option::Option<u32>,
6997}
6998/// Aggregated signature from members of a multisig committee.
6999#[non_exhaustive]
7000#[derive(Clone, PartialEq, ::prost::Message)]
7001pub struct MultisigAggregatedSignature {
7002    /// The plain signatures encoded with signature scheme.
7003    ///
7004    /// The signatures must be in the same order as they are listed in the committee.
7005    #[prost(message, repeated, tag = "1")]
7006    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
7007    /// Bitmap indicating which committee members contributed to the
7008    /// signature.
7009    #[prost(uint32, optional, tag = "2")]
7010    pub bitmap: ::core::option::Option<u32>,
7011    /// If present, means this signature's on-chain format uses the old
7012    /// legacy multisig format.
7013    #[prost(bytes = "bytes", optional, tag = "3")]
7014    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
7015    /// The committee to use to validate this signature.
7016    #[prost(message, optional, tag = "4")]
7017    pub committee: ::core::option::Option<MultisigCommittee>,
7018}
7019/// A signature from a member of a multisig committee.
7020#[non_exhaustive]
7021#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7022pub struct MultisigMemberSignature {
7023    /// The signature scheme of this signature.
7024    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
7025    pub scheme: ::core::option::Option<i32>,
7026    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1 | mldsa65.
7027    #[prost(bytes = "bytes", optional, tag = "2")]
7028    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
7029    /// The zklogin authenticator if scheme is `ZKLOGIN`.
7030    #[prost(message, optional, tag = "3")]
7031    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
7032    /// The passkey authenticator if scheme is `PASSKEY`.
7033    #[prost(message, optional, tag = "4")]
7034    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
7035}
7036/// A zklogin authenticator.
7037#[non_exhaustive]
7038#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7039pub struct ZkLoginAuthenticator {
7040    /// Zklogin proof and inputs required to perform proof verification.
7041    #[prost(message, optional, tag = "1")]
7042    pub inputs: ::core::option::Option<ZkLoginInputs>,
7043    /// Maximum epoch for which the proof is valid.
7044    #[prost(uint64, optional, tag = "2")]
7045    pub max_epoch: ::core::option::Option<u64>,
7046    /// User signature with the public key attested to by the provided proof.
7047    #[prost(message, optional, tag = "3")]
7048    pub signature: ::core::option::Option<SimpleSignature>,
7049    /// The public identifier (similar to a public key) for this zklogin authenticator
7050    #[prost(message, optional, tag = "4")]
7051    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
7052    /// The id of the JWK used to authorize this zklogin authenticator
7053    #[prost(message, optional, tag = "5")]
7054    pub jwk_id: ::core::option::Option<JwkId>,
7055}
7056/// A zklogin groth16 proof and the required inputs to perform proof verification.
7057#[non_exhaustive]
7058#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7059pub struct ZkLoginInputs {
7060    #[prost(message, optional, tag = "1")]
7061    pub proof_points: ::core::option::Option<ZkLoginProof>,
7062    #[prost(message, optional, tag = "2")]
7063    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
7064    #[prost(string, optional, tag = "3")]
7065    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
7066    /// base10 encoded Bn254FieldElement
7067    #[prost(string, optional, tag = "4")]
7068    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
7069}
7070/// A zklogin groth16 proof.
7071#[non_exhaustive]
7072#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7073pub struct ZkLoginProof {
7074    #[prost(message, optional, tag = "1")]
7075    pub a: ::core::option::Option<CircomG1>,
7076    #[prost(message, optional, tag = "2")]
7077    pub b: ::core::option::Option<CircomG2>,
7078    #[prost(message, optional, tag = "3")]
7079    pub c: ::core::option::Option<CircomG1>,
7080}
7081/// A claim of the iss in a zklogin proof.
7082#[non_exhaustive]
7083#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7084pub struct ZkLoginClaim {
7085    #[prost(string, optional, tag = "1")]
7086    pub value: ::core::option::Option<::prost::alloc::string::String>,
7087    #[prost(uint32, optional, tag = "2")]
7088    pub index_mod_4: ::core::option::Option<u32>,
7089}
7090/// A G1 point.
7091#[non_exhaustive]
7092#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7093pub struct CircomG1 {
7094    /// base10 encoded Bn254FieldElement
7095    #[prost(string, optional, tag = "1")]
7096    pub e0: ::core::option::Option<::prost::alloc::string::String>,
7097    /// base10 encoded Bn254FieldElement
7098    #[prost(string, optional, tag = "2")]
7099    pub e1: ::core::option::Option<::prost::alloc::string::String>,
7100    /// base10 encoded Bn254FieldElement
7101    #[prost(string, optional, tag = "3")]
7102    pub e2: ::core::option::Option<::prost::alloc::string::String>,
7103}
7104/// A G2 point.
7105#[non_exhaustive]
7106#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7107pub struct CircomG2 {
7108    /// base10 encoded Bn254FieldElement
7109    #[prost(string, optional, tag = "1")]
7110    pub e00: ::core::option::Option<::prost::alloc::string::String>,
7111    /// base10 encoded Bn254FieldElement
7112    #[prost(string, optional, tag = "2")]
7113    pub e01: ::core::option::Option<::prost::alloc::string::String>,
7114    /// base10 encoded Bn254FieldElement
7115    #[prost(string, optional, tag = "3")]
7116    pub e10: ::core::option::Option<::prost::alloc::string::String>,
7117    /// base10 encoded Bn254FieldElement
7118    #[prost(string, optional, tag = "4")]
7119    pub e11: ::core::option::Option<::prost::alloc::string::String>,
7120    /// base10 encoded Bn254FieldElement
7121    #[prost(string, optional, tag = "5")]
7122    pub e20: ::core::option::Option<::prost::alloc::string::String>,
7123    /// base10 encoded Bn254FieldElement
7124    #[prost(string, optional, tag = "6")]
7125    pub e21: ::core::option::Option<::prost::alloc::string::String>,
7126}
7127/// A passkey authenticator.
7128///
7129/// See
7130/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
7131/// for more information on the requirements on the shape of the
7132/// `client_data_json` field.
7133#[non_exhaustive]
7134#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7135pub struct PasskeyAuthenticator {
7136    /// Opaque authenticator data for this passkey signature.
7137    ///
7138    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
7139    /// more information on this field.
7140    #[prost(bytes = "bytes", optional, tag = "1")]
7141    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
7142    /// Structured, unparsed, JSON for this passkey signature.
7143    ///
7144    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
7145    /// for more information on this field.
7146    #[prost(string, optional, tag = "2")]
7147    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
7148    /// A secp256r1 signature.
7149    #[prost(message, optional, tag = "3")]
7150    pub signature: ::core::option::Option<SimpleSignature>,
7151}
7152/// The validator set for a particular epoch.
7153#[non_exhaustive]
7154#[derive(Clone, PartialEq, ::prost::Message)]
7155pub struct ValidatorCommittee {
7156    /// The epoch where this committee governs.
7157    #[prost(uint64, optional, tag = "1")]
7158    pub epoch: ::core::option::Option<u64>,
7159    /// The committee members.
7160    #[prost(message, repeated, tag = "2")]
7161    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
7162}
7163/// A member of a validator committee.
7164#[non_exhaustive]
7165#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7166pub struct ValidatorCommitteeMember {
7167    /// The 96-byte Bls12381 public key for this validator.
7168    #[prost(bytes = "bytes", optional, tag = "1")]
7169    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
7170    /// voting weight this validator possesses.
7171    #[prost(uint64, optional, tag = "2")]
7172    pub weight: ::core::option::Option<u64>,
7173}
7174/// / An aggregated signature from multiple validators.
7175#[non_exhaustive]
7176#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7177pub struct ValidatorAggregatedSignature {
7178    /// The epoch when this signature was produced.
7179    ///
7180    /// This can be used to lookup the `ValidatorCommittee` from this epoch
7181    /// to verify this signature.
7182    #[prost(uint64, optional, tag = "1")]
7183    pub epoch: ::core::option::Option<u64>,
7184    /// The 48-byte Bls12381 aggregated signature.
7185    #[prost(bytes = "bytes", optional, tag = "2")]
7186    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
7187    /// Bitmap indicating which members of the committee contributed to
7188    /// this signature.
7189    #[prost(bytes = "bytes", optional, tag = "3")]
7190    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
7191}
7192/// Flag use to disambiguate the signature schemes supported by Sui.
7193///
7194/// Note: the enum values defined by this proto message exactly match their
7195/// expected BCS serialized values when serialized as a u8. See
7196/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
7197/// for more information about signature schemes.
7198#[non_exhaustive]
7199#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
7200#[repr(i32)]
7201pub enum SignatureScheme {
7202    Ed25519 = 0,
7203    Secp256k1 = 1,
7204    Secp256r1 = 2,
7205    Multisig = 3,
7206    Bls12381 = 4,
7207    Zklogin = 5,
7208    Passkey = 6,
7209    Mldsa65 = 7,
7210}
7211impl SignatureScheme {
7212    /// String value of the enum field names used in the ProtoBuf definition.
7213    ///
7214    /// The values are not transformed in any way and thus are considered stable
7215    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7216    pub fn as_str_name(&self) -> &'static str {
7217        match self {
7218            Self::Ed25519 => "ED25519",
7219            Self::Secp256k1 => "SECP256K1",
7220            Self::Secp256r1 => "SECP256R1",
7221            Self::Multisig => "MULTISIG",
7222            Self::Bls12381 => "BLS12381",
7223            Self::Zklogin => "ZKLOGIN",
7224            Self::Passkey => "PASSKEY",
7225            Self::Mldsa65 => "MLDSA65",
7226        }
7227    }
7228    /// Creates an enum from field names used in the ProtoBuf definition.
7229    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7230        match value {
7231            "ED25519" => Some(Self::Ed25519),
7232            "SECP256K1" => Some(Self::Secp256k1),
7233            "SECP256R1" => Some(Self::Secp256r1),
7234            "MULTISIG" => Some(Self::Multisig),
7235            "BLS12381" => Some(Self::Bls12381),
7236            "ZKLOGIN" => Some(Self::Zklogin),
7237            "PASSKEY" => Some(Self::Passkey),
7238            "MLDSA65" => Some(Self::Mldsa65),
7239            _ => None,
7240        }
7241    }
7242}
7243#[non_exhaustive]
7244#[derive(Clone, PartialEq, ::prost::Message)]
7245pub struct VerifySignatureRequest {
7246    /// The message to verify against.
7247    ///
7248    /// Today the only supported message types are `PersonalMessage` and
7249    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
7250    /// message is being verified.
7251    #[prost(message, optional, tag = "1")]
7252    pub message: ::core::option::Option<Bcs>,
7253    /// The signature to verify.
7254    #[prost(message, optional, tag = "2")]
7255    pub signature: ::core::option::Option<UserSignature>,
7256    /// Optional. Address to validate against the provided signature.
7257    ///
7258    /// If provided, this address will be compared against the the address derived
7259    /// from the provide signature and a successful response will only be returned
7260    /// if they match.
7261    #[prost(string, optional, tag = "3")]
7262    pub address: ::core::option::Option<::prost::alloc::string::String>,
7263    /// The set of JWKs to use when verifying Zklogin signatures.
7264    /// If this is empty the current set of valid JWKs stored onchain will be used
7265    #[prost(message, repeated, tag = "4")]
7266    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7267    /// Optional. If true, `address` is required and the signature must be from a
7268    /// member of `address`'s current `AddressAliases` set rather than from
7269    /// `address` itself. An address with no `AddressAliases` set is its own only
7270    /// alias.
7271    ///
7272    /// Servers that predate this field ignore it, so clients must check
7273    /// `address_aliases_checked` in the response.
7274    #[prost(bool, optional, tag = "6")]
7275    pub check_address_aliases: ::core::option::Option<bool>,
7276}
7277#[non_exhaustive]
7278#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7279pub struct VerifySignatureResponse {
7280    /// Indicates if the provided signature was valid given the requested parameters.
7281    #[prost(bool, optional, tag = "1")]
7282    pub is_valid: ::core::option::Option<bool>,
7283    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
7284    #[prost(string, optional, tag = "2")]
7285    pub reason: ::core::option::Option<::prost::alloc::string::String>,
7286    /// Set to true when the server applied `check_address_aliases`, whether or
7287    /// not the signature is valid. Unset by servers that predate it.
7288    #[prost(bool, optional, tag = "3")]
7289    pub address_aliases_checked: ::core::option::Option<bool>,
7290}
7291/// Generated client implementations.
7292pub mod signature_verification_service_client {
7293    #![allow(
7294        unused_variables,
7295        dead_code,
7296        missing_docs,
7297        clippy::wildcard_imports,
7298        clippy::let_unit_value,
7299    )]
7300    use tonic::codegen::*;
7301    use tonic::codegen::http::Uri;
7302    #[derive(Debug, Clone)]
7303    pub struct SignatureVerificationServiceClient<T> {
7304        inner: tonic::client::Grpc<T>,
7305    }
7306    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
7307        /// Attempt to create a new client by connecting to a given endpoint.
7308        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7309        where
7310            D: TryInto<tonic::transport::Endpoint>,
7311            D::Error: Into<StdError>,
7312        {
7313            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7314            Ok(Self::new(conn))
7315        }
7316    }
7317    impl<T> SignatureVerificationServiceClient<T>
7318    where
7319        T: tonic::client::GrpcService<tonic::body::Body>,
7320        T::Error: Into<StdError>,
7321        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7322        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7323    {
7324        pub fn new(inner: T) -> Self {
7325            let inner = tonic::client::Grpc::new(inner);
7326            Self { inner }
7327        }
7328        pub fn with_origin(inner: T, origin: Uri) -> Self {
7329            let inner = tonic::client::Grpc::with_origin(inner, origin);
7330            Self { inner }
7331        }
7332        pub fn with_interceptor<F>(
7333            inner: T,
7334            interceptor: F,
7335        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
7336        where
7337            F: tonic::service::Interceptor,
7338            T::ResponseBody: Default,
7339            T: tonic::codegen::Service<
7340                http::Request<tonic::body::Body>,
7341                Response = http::Response<
7342                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7343                >,
7344            >,
7345            <T as tonic::codegen::Service<
7346                http::Request<tonic::body::Body>,
7347            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7348        {
7349            SignatureVerificationServiceClient::new(
7350                InterceptedService::new(inner, interceptor),
7351            )
7352        }
7353        /// Compress requests with the given encoding.
7354        ///
7355        /// This requires the server to support it otherwise it might respond with an
7356        /// error.
7357        #[must_use]
7358        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7359            self.inner = self.inner.send_compressed(encoding);
7360            self
7361        }
7362        /// Enable decompressing responses.
7363        #[must_use]
7364        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7365            self.inner = self.inner.accept_compressed(encoding);
7366            self
7367        }
7368        /// Limits the maximum size of a decoded message.
7369        ///
7370        /// Default: `4MB`
7371        #[must_use]
7372        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7373            self.inner = self.inner.max_decoding_message_size(limit);
7374            self
7375        }
7376        /// Limits the maximum size of an encoded message.
7377        ///
7378        /// Default: `usize::MAX`
7379        #[must_use]
7380        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7381            self.inner = self.inner.max_encoding_message_size(limit);
7382            self
7383        }
7384        /// Perform signature verification of a UserSignature against the provided message.
7385        pub async fn verify_signature(
7386            &mut self,
7387            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
7388        ) -> std::result::Result<
7389            tonic::Response<super::VerifySignatureResponse>,
7390            tonic::Status,
7391        > {
7392            self.inner
7393                .ready()
7394                .await
7395                .map_err(|e| {
7396                    tonic::Status::unknown(
7397                        format!("Service was not ready: {}", e.into()),
7398                    )
7399                })?;
7400            let codec = tonic_prost::ProstCodec::default();
7401            let path = http::uri::PathAndQuery::from_static(
7402                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
7403            );
7404            let mut req = request.into_request();
7405            req.extensions_mut()
7406                .insert(
7407                    GrpcMethod::new(
7408                        "sui.rpc.v2.SignatureVerificationService",
7409                        "VerifySignature",
7410                    ),
7411                );
7412            self.inner.unary(req, path, codec).await
7413        }
7414    }
7415}
7416/// Generated server implementations.
7417pub mod signature_verification_service_server {
7418    #![allow(
7419        unused_variables,
7420        dead_code,
7421        missing_docs,
7422        clippy::wildcard_imports,
7423        clippy::let_unit_value,
7424    )]
7425    use tonic::codegen::*;
7426    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
7427    #[async_trait]
7428    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
7429        /// Perform signature verification of a UserSignature against the provided message.
7430        async fn verify_signature(
7431            &self,
7432            request: tonic::Request<super::VerifySignatureRequest>,
7433        ) -> std::result::Result<
7434            tonic::Response<super::VerifySignatureResponse>,
7435            tonic::Status,
7436        > {
7437            Err(tonic::Status::unimplemented("Not yet implemented"))
7438        }
7439    }
7440    #[derive(Debug)]
7441    pub struct SignatureVerificationServiceServer<T> {
7442        inner: Arc<T>,
7443        accept_compression_encodings: EnabledCompressionEncodings,
7444        send_compression_encodings: EnabledCompressionEncodings,
7445        max_decoding_message_size: Option<usize>,
7446        max_encoding_message_size: Option<usize>,
7447    }
7448    impl<T> SignatureVerificationServiceServer<T> {
7449        pub fn new(inner: T) -> Self {
7450            Self::from_arc(Arc::new(inner))
7451        }
7452        pub fn from_arc(inner: Arc<T>) -> Self {
7453            Self {
7454                inner,
7455                accept_compression_encodings: Default::default(),
7456                send_compression_encodings: Default::default(),
7457                max_decoding_message_size: None,
7458                max_encoding_message_size: None,
7459            }
7460        }
7461        pub fn with_interceptor<F>(
7462            inner: T,
7463            interceptor: F,
7464        ) -> InterceptedService<Self, F>
7465        where
7466            F: tonic::service::Interceptor,
7467        {
7468            InterceptedService::new(Self::new(inner), interceptor)
7469        }
7470        /// Enable decompressing requests with the given encoding.
7471        #[must_use]
7472        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7473            self.accept_compression_encodings.enable(encoding);
7474            self
7475        }
7476        /// Compress responses with the given encoding, if the client supports it.
7477        #[must_use]
7478        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7479            self.send_compression_encodings.enable(encoding);
7480            self
7481        }
7482        /// Limits the maximum size of a decoded message.
7483        ///
7484        /// Default: `4MB`
7485        #[must_use]
7486        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7487            self.max_decoding_message_size = Some(limit);
7488            self
7489        }
7490        /// Limits the maximum size of an encoded message.
7491        ///
7492        /// Default: `usize::MAX`
7493        #[must_use]
7494        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7495            self.max_encoding_message_size = Some(limit);
7496            self
7497        }
7498    }
7499    impl<T, B> tonic::codegen::Service<http::Request<B>>
7500    for SignatureVerificationServiceServer<T>
7501    where
7502        T: SignatureVerificationService,
7503        B: Body + std::marker::Send + 'static,
7504        B::Error: Into<StdError> + std::marker::Send + 'static,
7505    {
7506        type Response = http::Response<tonic::body::Body>;
7507        type Error = std::convert::Infallible;
7508        type Future = BoxFuture<Self::Response, Self::Error>;
7509        fn poll_ready(
7510            &mut self,
7511            _cx: &mut Context<'_>,
7512        ) -> Poll<std::result::Result<(), Self::Error>> {
7513            Poll::Ready(Ok(()))
7514        }
7515        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7516            match req.uri().path() {
7517                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
7518                    #[allow(non_camel_case_types)]
7519                    struct VerifySignatureSvc<T: SignatureVerificationService>(
7520                        pub Arc<T>,
7521                    );
7522                    impl<
7523                        T: SignatureVerificationService,
7524                    > tonic::server::UnaryService<super::VerifySignatureRequest>
7525                    for VerifySignatureSvc<T> {
7526                        type Response = super::VerifySignatureResponse;
7527                        type Future = BoxFuture<
7528                            tonic::Response<Self::Response>,
7529                            tonic::Status,
7530                        >;
7531                        fn call(
7532                            &mut self,
7533                            request: tonic::Request<super::VerifySignatureRequest>,
7534                        ) -> Self::Future {
7535                            let inner = Arc::clone(&self.0);
7536                            let fut = async move {
7537                                <T as SignatureVerificationService>::verify_signature(
7538                                        &inner,
7539                                        request,
7540                                    )
7541                                    .await
7542                            };
7543                            Box::pin(fut)
7544                        }
7545                    }
7546                    let accept_compression_encodings = self.accept_compression_encodings;
7547                    let send_compression_encodings = self.send_compression_encodings;
7548                    let max_decoding_message_size = self.max_decoding_message_size;
7549                    let max_encoding_message_size = self.max_encoding_message_size;
7550                    let inner = self.inner.clone();
7551                    let fut = async move {
7552                        let method = VerifySignatureSvc(inner);
7553                        let codec = tonic_prost::ProstCodec::default();
7554                        let mut grpc = tonic::server::Grpc::new(codec)
7555                            .apply_compression_config(
7556                                accept_compression_encodings,
7557                                send_compression_encodings,
7558                            )
7559                            .apply_max_message_size_config(
7560                                max_decoding_message_size,
7561                                max_encoding_message_size,
7562                            );
7563                        let res = grpc.unary(method, req).await;
7564                        Ok(res)
7565                    };
7566                    Box::pin(fut)
7567                }
7568                _ => {
7569                    Box::pin(async move {
7570                        let mut response = http::Response::new(
7571                            tonic::body::Body::default(),
7572                        );
7573                        let headers = response.headers_mut();
7574                        headers
7575                            .insert(
7576                                tonic::Status::GRPC_STATUS,
7577                                (tonic::Code::Unimplemented as i32).into(),
7578                            );
7579                        headers
7580                            .insert(
7581                                http::header::CONTENT_TYPE,
7582                                tonic::metadata::GRPC_CONTENT_TYPE,
7583                            );
7584                        Ok(response)
7585                    })
7586                }
7587            }
7588        }
7589    }
7590    impl<T> Clone for SignatureVerificationServiceServer<T> {
7591        fn clone(&self) -> Self {
7592            let inner = self.inner.clone();
7593            Self {
7594                inner,
7595                accept_compression_encodings: self.accept_compression_encodings,
7596                send_compression_encodings: self.send_compression_encodings,
7597                max_decoding_message_size: self.max_decoding_message_size,
7598                max_encoding_message_size: self.max_encoding_message_size,
7599            }
7600        }
7601    }
7602    /// Generated gRPC service name
7603    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
7604    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
7605        const NAME: &'static str = SERVICE_NAME;
7606    }
7607}
7608/// Request message for `NodeService.GetCoinInfo`.
7609#[non_exhaustive]
7610#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7611pub struct GetCoinInfoRequest {
7612    /// The coin type to request information about
7613    #[prost(string, optional, tag = "1")]
7614    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7615}
7616/// Response message for `NodeService.GetCoinInfo`.
7617#[non_exhaustive]
7618#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7619pub struct GetCoinInfoResponse {
7620    /// Required. The coin type.
7621    #[prost(string, optional, tag = "1")]
7622    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7623    /// This field will be populated with information about this coin
7624    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
7625    #[prost(message, optional, tag = "2")]
7626    pub metadata: ::core::option::Option<CoinMetadata>,
7627    /// This field will be populated with information about this coin
7628    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
7629    #[prost(message, optional, tag = "3")]
7630    pub treasury: ::core::option::Option<CoinTreasury>,
7631    /// If this coin type is a regulated coin, this field will be
7632    /// populated with information either from its Currency object
7633    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
7634    /// object for coins that have not been migrated to the CoinRegistry
7635    ///
7636    /// If this coin is not known to be regulated, only the
7637    /// coin_regulated_state field will be populated.
7638    #[prost(message, optional, tag = "4")]
7639    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
7640}
7641/// Metadata for a coin type
7642#[non_exhaustive]
7643#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7644pub struct CoinMetadata {
7645    /// ObjectId of the `0x2::coin::CoinMetadata` object or
7646    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
7647    #[prost(string, optional, tag = "1")]
7648    pub id: ::core::option::Option<::prost::alloc::string::String>,
7649    /// Number of decimal places to coin uses.
7650    #[prost(uint32, optional, tag = "2")]
7651    pub decimals: ::core::option::Option<u32>,
7652    /// Name for the token
7653    #[prost(string, optional, tag = "3")]
7654    pub name: ::core::option::Option<::prost::alloc::string::String>,
7655    /// Symbol for the token
7656    #[prost(string, optional, tag = "4")]
7657    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
7658    /// Description of the token
7659    #[prost(string, optional, tag = "5")]
7660    pub description: ::core::option::Option<::prost::alloc::string::String>,
7661    /// URL for the token logo
7662    #[prost(string, optional, tag = "6")]
7663    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
7664    /// The MetadataCap ID if it has been claimed for this coin type.
7665    /// This capability allows updating the coin's metadata fields.
7666    /// Only populated when metadata is from CoinRegistry.
7667    #[prost(string, optional, tag = "7")]
7668    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
7669    /// State of the MetadataCap for this coin type.
7670    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
7671    pub metadata_cap_state: ::core::option::Option<i32>,
7672}
7673/// Nested message and enum types in `CoinMetadata`.
7674pub mod coin_metadata {
7675    /// Information about the state of the coin's MetadataCap
7676    #[non_exhaustive]
7677    #[derive(
7678        Clone,
7679        Copy,
7680        Debug,
7681        PartialEq,
7682        Eq,
7683        Hash,
7684        PartialOrd,
7685        Ord,
7686        ::prost::Enumeration
7687    )]
7688    #[repr(i32)]
7689    pub enum MetadataCapState {
7690        /// Indicates the state of the MetadataCap is unknown.
7691        /// Set when the coin has not been migrated to the CoinRegistry.
7692        Unknown = 0,
7693        /// Indicates the MetadataCap has been claimed.
7694        Claimed = 1,
7695        /// Indicates the MetadataCap has not been claimed.
7696        Unclaimed = 2,
7697        /// Indicates the MetadataCap has been deleted.
7698        Deleted = 3,
7699    }
7700    impl MetadataCapState {
7701        /// String value of the enum field names used in the ProtoBuf definition.
7702        ///
7703        /// The values are not transformed in any way and thus are considered stable
7704        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7705        pub fn as_str_name(&self) -> &'static str {
7706            match self {
7707                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
7708                Self::Claimed => "CLAIMED",
7709                Self::Unclaimed => "UNCLAIMED",
7710                Self::Deleted => "DELETED",
7711            }
7712        }
7713        /// Creates an enum from field names used in the ProtoBuf definition.
7714        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7715            match value {
7716                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
7717                "CLAIMED" => Some(Self::Claimed),
7718                "UNCLAIMED" => Some(Self::Unclaimed),
7719                "DELETED" => Some(Self::Deleted),
7720                _ => None,
7721            }
7722        }
7723    }
7724}
7725/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
7726#[non_exhaustive]
7727#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7728pub struct CoinTreasury {
7729    /// ObjectId of the `0x2::coin::TreasuryCap` object.
7730    #[prost(string, optional, tag = "1")]
7731    pub id: ::core::option::Option<::prost::alloc::string::String>,
7732    /// Total available supply for this coin type.
7733    #[prost(uint64, optional, tag = "2")]
7734    pub total_supply: ::core::option::Option<u64>,
7735    /// Supply state indicating if the supply is fixed or can still be minted
7736    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
7737    pub supply_state: ::core::option::Option<i32>,
7738}
7739/// Nested message and enum types in `CoinTreasury`.
7740pub mod coin_treasury {
7741    /// Supply state of a coin, matching the Move SupplyState enum
7742    #[non_exhaustive]
7743    #[derive(
7744        Clone,
7745        Copy,
7746        Debug,
7747        PartialEq,
7748        Eq,
7749        Hash,
7750        PartialOrd,
7751        Ord,
7752        ::prost::Enumeration
7753    )]
7754    #[repr(i32)]
7755    pub enum SupplyState {
7756        /// Supply is unknown or TreasuryCap still exists (minting still possible)
7757        Unknown = 0,
7758        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
7759        Fixed = 1,
7760        /// Supply can only decrease (burning allowed, minting not allowed)
7761        BurnOnly = 2,
7762    }
7763    impl SupplyState {
7764        /// String value of the enum field names used in the ProtoBuf definition.
7765        ///
7766        /// The values are not transformed in any way and thus are considered stable
7767        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7768        pub fn as_str_name(&self) -> &'static str {
7769            match self {
7770                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
7771                Self::Fixed => "FIXED",
7772                Self::BurnOnly => "BURN_ONLY",
7773            }
7774        }
7775        /// Creates an enum from field names used in the ProtoBuf definition.
7776        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7777            match value {
7778                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
7779                "FIXED" => Some(Self::Fixed),
7780                "BURN_ONLY" => Some(Self::BurnOnly),
7781                _ => None,
7782            }
7783        }
7784    }
7785}
7786/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
7787#[non_exhaustive]
7788#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7789pub struct RegulatedCoinMetadata {
7790    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
7791    /// Only present for coins that have not been migrated to CoinRegistry.
7792    #[prost(string, optional, tag = "1")]
7793    pub id: ::core::option::Option<::prost::alloc::string::String>,
7794    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
7795    #[prost(string, optional, tag = "2")]
7796    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
7797    /// The ID of the coin's `DenyCap` object.
7798    #[prost(string, optional, tag = "3")]
7799    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
7800    /// Whether the coin can be globally paused
7801    #[prost(bool, optional, tag = "4")]
7802    pub allow_global_pause: ::core::option::Option<bool>,
7803    /// Variant of the regulated coin metadata
7804    #[prost(uint32, optional, tag = "5")]
7805    pub variant: ::core::option::Option<u32>,
7806    /// Indicates the coin's regulated state.
7807    #[prost(
7808        enumeration = "regulated_coin_metadata::CoinRegulatedState",
7809        optional,
7810        tag = "6"
7811    )]
7812    pub coin_regulated_state: ::core::option::Option<i32>,
7813}
7814/// Nested message and enum types in `RegulatedCoinMetadata`.
7815pub mod regulated_coin_metadata {
7816    /// Indicates the state of the regulation of the coin.
7817    #[non_exhaustive]
7818    #[derive(
7819        Clone,
7820        Copy,
7821        Debug,
7822        PartialEq,
7823        Eq,
7824        Hash,
7825        PartialOrd,
7826        Ord,
7827        ::prost::Enumeration
7828    )]
7829    #[repr(i32)]
7830    pub enum CoinRegulatedState {
7831        /// Indicates the regulation state of the coin is unknown.
7832        /// This is set when a coin has not been migrated to the
7833        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
7834        /// object.
7835        Unknown = 0,
7836        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
7837        Regulated = 1,
7838        /// Indicates a coin is unregulated.
7839        Unregulated = 2,
7840    }
7841    impl CoinRegulatedState {
7842        /// String value of the enum field names used in the ProtoBuf definition.
7843        ///
7844        /// The values are not transformed in any way and thus are considered stable
7845        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7846        pub fn as_str_name(&self) -> &'static str {
7847            match self {
7848                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
7849                Self::Regulated => "REGULATED",
7850                Self::Unregulated => "UNREGULATED",
7851            }
7852        }
7853        /// Creates an enum from field names used in the ProtoBuf definition.
7854        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7855            match value {
7856                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
7857                "REGULATED" => Some(Self::Regulated),
7858                "UNREGULATED" => Some(Self::Unregulated),
7859                _ => None,
7860            }
7861        }
7862    }
7863}
7864/// Request message for `LiveDataService.GetBalance`.
7865#[non_exhaustive]
7866#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7867pub struct GetBalanceRequest {
7868    /// Required. The owner's Sui address.
7869    #[prost(string, optional, tag = "1")]
7870    pub owner: ::core::option::Option<::prost::alloc::string::String>,
7871    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
7872    #[prost(string, optional, tag = "2")]
7873    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7874}
7875/// Response message for `LiveDataService.GetBalance`.
7876/// Return the total coin balance for one coin type, owned by the address owner.
7877#[non_exhaustive]
7878#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7879pub struct GetBalanceResponse {
7880    /// The balance information for the requested coin type.
7881    #[prost(message, optional, tag = "1")]
7882    pub balance: ::core::option::Option<Balance>,
7883}
7884/// Request message for `LiveDataService.ListBalances`.
7885#[non_exhaustive]
7886#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7887pub struct ListBalancesRequest {
7888    /// Required. The owner's Sui address.
7889    #[prost(string, optional, tag = "1")]
7890    pub owner: ::core::option::Option<::prost::alloc::string::String>,
7891    /// The maximum number of balance entries to return. The service may return fewer than this value.
7892    /// If unspecified, at most `50` entries will be returned.
7893    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
7894    #[prost(uint32, optional, tag = "2")]
7895    pub page_size: ::core::option::Option<u32>,
7896    /// A page token, received from a previous `ListBalances` call.
7897    /// Provide this to retrieve the subsequent page.
7898    ///
7899    /// When paginating, all other parameters provided to `ListBalances` must
7900    /// match the call that provided the page token.
7901    #[prost(bytes = "bytes", optional, tag = "3")]
7902    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
7903}
7904/// Response message for `LiveDataService.ListBalances`.
7905/// Return the total coin balance for all coin types, owned by the address owner.
7906#[non_exhaustive]
7907#[derive(Clone, PartialEq, ::prost::Message)]
7908pub struct ListBalancesResponse {
7909    /// The list of coin types and their respective balances.
7910    #[prost(message, repeated, tag = "1")]
7911    pub balances: ::prost::alloc::vec::Vec<Balance>,
7912    /// A token, which can be sent as `page_token` to retrieve the next page.
7913    /// If this field is omitted, there are no subsequent pages.
7914    #[prost(bytes = "bytes", optional, tag = "2")]
7915    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
7916}
7917/// Balance information for a specific coin type.
7918#[non_exhaustive]
7919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7920pub struct Balance {
7921    /// The type of the coin (e.g., 0x2::sui::SUI).
7922    #[prost(string, optional, tag = "1")]
7923    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
7924    /// The total balance of `coin_type` in its smallest unit.
7925    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
7926    /// and `coin_balance`).
7927    #[prost(uint64, optional, tag = "3")]
7928    pub balance: ::core::option::Option<u64>,
7929    /// The balance of `Balance<T>` in this address's Address Balance.
7930    #[prost(uint64, optional, tag = "4")]
7931    pub address_balance: ::core::option::Option<u64>,
7932    /// The balance of all `Coin<T>` objects owned by this address.
7933    #[prost(uint64, optional, tag = "5")]
7934    pub coin_balance: ::core::option::Option<u64>,
7935}
7936/// Request message for `NodeService.ListDynamicFields`
7937#[non_exhaustive]
7938#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7939pub struct ListDynamicFieldsRequest {
7940    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
7941    #[prost(string, optional, tag = "1")]
7942    pub parent: ::core::option::Option<::prost::alloc::string::String>,
7943    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
7944    /// If unspecified, at most `50` entries will be returned.
7945    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
7946    #[prost(uint32, optional, tag = "2")]
7947    pub page_size: ::core::option::Option<u32>,
7948    /// A page token, received from a previous `ListDynamicFields` call.
7949    /// Provide this to retrieve the subsequent page.
7950    ///
7951    /// When paginating, all other parameters provided to `ListDynamicFields` must
7952    /// match the call that provided the page token.
7953    #[prost(bytes = "bytes", optional, tag = "3")]
7954    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
7955    /// Mask specifying which fields to read.
7956    /// If no mask is specified, defaults to `parent,field_id`.
7957    #[prost(message, optional, tag = "4")]
7958    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7959}
7960/// Response message for `NodeService.ListDynamicFields`
7961#[non_exhaustive]
7962#[derive(Clone, PartialEq, ::prost::Message)]
7963pub struct ListDynamicFieldsResponse {
7964    /// Page of dynamic fields owned by the specified parent.
7965    #[prost(message, repeated, tag = "1")]
7966    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
7967    /// A token, which can be sent as `page_token` to retrieve the next page.
7968    /// If this field is omitted, there are no subsequent pages.
7969    #[prost(bytes = "bytes", optional, tag = "2")]
7970    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
7971}
7972#[non_exhaustive]
7973#[derive(Clone, PartialEq, ::prost::Message)]
7974pub struct DynamicField {
7975    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
7976    pub kind: ::core::option::Option<i32>,
7977    /// ObjectId of this dynamic field's parent.
7978    #[prost(string, optional, tag = "2")]
7979    pub parent: ::core::option::Option<::prost::alloc::string::String>,
7980    /// ObjectId of this dynamic field.
7981    #[prost(string, optional, tag = "3")]
7982    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
7983    /// The field object itself
7984    #[prost(message, optional, tag = "4")]
7985    pub field_object: ::core::option::Option<Object>,
7986    /// The dynamic field's "name"
7987    #[prost(message, optional, tag = "5")]
7988    pub name: ::core::option::Option<Bcs>,
7989    /// The dynamic field's "value"
7990    #[prost(message, optional, tag = "6")]
7991    pub value: ::core::option::Option<Bcs>,
7992    /// The type of the dynamic field "value".
7993    ///
7994    /// If this is a dynamic object field then this is the type of the object
7995    /// itself (which is a child of this field), otherwise this is the type of the
7996    /// value of this field.
7997    #[prost(string, optional, tag = "7")]
7998    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
7999    /// The ObjectId of the child object when a child is a dynamic
8000    /// object field.
8001    ///
8002    /// The presence or absence of this field can be used to determine if a child
8003    /// is a dynamic field or a dynamic child object
8004    #[prost(string, optional, tag = "8")]
8005    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
8006    /// The object itself when a child is a dynamic object field.
8007    #[prost(message, optional, tag = "9")]
8008    pub child_object: ::core::option::Option<Object>,
8009}
8010/// Nested message and enum types in `DynamicField`.
8011pub mod dynamic_field {
8012    #[non_exhaustive]
8013    #[derive(
8014        Clone,
8015        Copy,
8016        Debug,
8017        PartialEq,
8018        Eq,
8019        Hash,
8020        PartialOrd,
8021        Ord,
8022        ::prost::Enumeration
8023    )]
8024    #[repr(i32)]
8025    pub enum DynamicFieldKind {
8026        Unknown = 0,
8027        Field = 1,
8028        Object = 2,
8029    }
8030    impl DynamicFieldKind {
8031        /// String value of the enum field names used in the ProtoBuf definition.
8032        ///
8033        /// The values are not transformed in any way and thus are considered stable
8034        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8035        pub fn as_str_name(&self) -> &'static str {
8036            match self {
8037                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
8038                Self::Field => "FIELD",
8039                Self::Object => "OBJECT",
8040            }
8041        }
8042        /// Creates an enum from field names used in the ProtoBuf definition.
8043        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8044            match value {
8045                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
8046                "FIELD" => Some(Self::Field),
8047                "OBJECT" => Some(Self::Object),
8048                _ => None,
8049            }
8050        }
8051    }
8052}
8053#[non_exhaustive]
8054#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8055pub struct ListOwnedObjectsRequest {
8056    /// Required. The address of the account that owns the objects.
8057    #[prost(string, optional, tag = "1")]
8058    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8059    /// The maximum number of entries return. The service may return fewer than this value.
8060    /// If unspecified, at most `50` entries will be returned.
8061    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
8062    #[prost(uint32, optional, tag = "2")]
8063    pub page_size: ::core::option::Option<u32>,
8064    /// A page token, received from a previous `ListOwnedObjects` call.
8065    /// Provide this to retrieve the subsequent page.
8066    ///
8067    /// When paginating, all other parameters provided to `ListOwnedObjects` must
8068    /// match the call that provided the page token.
8069    #[prost(bytes = "bytes", optional, tag = "3")]
8070    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
8071    /// Mask specifying which fields to read.
8072    /// If no mask is specified, defaults to `object_id,version,object_type`.
8073    #[prost(message, optional, tag = "4")]
8074    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8075    /// Optional type filter to limit the types of objects listed.
8076    ///
8077    /// Providing an object type with no type params will return objects of that
8078    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
8079    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
8080    /// with a type param will restrict the returned objects to only those objects
8081    /// that match the provided type parameters, e.g.
8082    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
8083    #[prost(string, optional, tag = "5")]
8084    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
8085}
8086#[non_exhaustive]
8087#[derive(Clone, PartialEq, ::prost::Message)]
8088pub struct ListOwnedObjectsResponse {
8089    /// Page of dynamic fields owned by the specified parent.
8090    #[prost(message, repeated, tag = "1")]
8091    pub objects: ::prost::alloc::vec::Vec<Object>,
8092    /// A token, which can be sent as `page_token` to retrieve the next page.
8093    /// If this field is omitted, there are no subsequent pages.
8094    #[prost(bytes = "bytes", optional, tag = "2")]
8095    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
8096}
8097/// Generated client implementations.
8098pub mod state_service_client {
8099    #![allow(
8100        unused_variables,
8101        dead_code,
8102        missing_docs,
8103        clippy::wildcard_imports,
8104        clippy::let_unit_value,
8105    )]
8106    use tonic::codegen::*;
8107    use tonic::codegen::http::Uri;
8108    #[derive(Debug, Clone)]
8109    pub struct StateServiceClient<T> {
8110        inner: tonic::client::Grpc<T>,
8111    }
8112    impl StateServiceClient<tonic::transport::Channel> {
8113        /// Attempt to create a new client by connecting to a given endpoint.
8114        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8115        where
8116            D: TryInto<tonic::transport::Endpoint>,
8117            D::Error: Into<StdError>,
8118        {
8119            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8120            Ok(Self::new(conn))
8121        }
8122    }
8123    impl<T> StateServiceClient<T>
8124    where
8125        T: tonic::client::GrpcService<tonic::body::Body>,
8126        T::Error: Into<StdError>,
8127        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8128        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8129    {
8130        pub fn new(inner: T) -> Self {
8131            let inner = tonic::client::Grpc::new(inner);
8132            Self { inner }
8133        }
8134        pub fn with_origin(inner: T, origin: Uri) -> Self {
8135            let inner = tonic::client::Grpc::with_origin(inner, origin);
8136            Self { inner }
8137        }
8138        pub fn with_interceptor<F>(
8139            inner: T,
8140            interceptor: F,
8141        ) -> StateServiceClient<InterceptedService<T, F>>
8142        where
8143            F: tonic::service::Interceptor,
8144            T::ResponseBody: Default,
8145            T: tonic::codegen::Service<
8146                http::Request<tonic::body::Body>,
8147                Response = http::Response<
8148                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8149                >,
8150            >,
8151            <T as tonic::codegen::Service<
8152                http::Request<tonic::body::Body>,
8153            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8154        {
8155            StateServiceClient::new(InterceptedService::new(inner, interceptor))
8156        }
8157        /// Compress requests with the given encoding.
8158        ///
8159        /// This requires the server to support it otherwise it might respond with an
8160        /// error.
8161        #[must_use]
8162        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8163            self.inner = self.inner.send_compressed(encoding);
8164            self
8165        }
8166        /// Enable decompressing responses.
8167        #[must_use]
8168        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8169            self.inner = self.inner.accept_compressed(encoding);
8170            self
8171        }
8172        /// Limits the maximum size of a decoded message.
8173        ///
8174        /// Default: `4MB`
8175        #[must_use]
8176        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8177            self.inner = self.inner.max_decoding_message_size(limit);
8178            self
8179        }
8180        /// Limits the maximum size of an encoded message.
8181        ///
8182        /// Default: `usize::MAX`
8183        #[must_use]
8184        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8185            self.inner = self.inner.max_encoding_message_size(limit);
8186            self
8187        }
8188        pub async fn list_dynamic_fields(
8189            &mut self,
8190            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
8191        ) -> std::result::Result<
8192            tonic::Response<super::ListDynamicFieldsResponse>,
8193            tonic::Status,
8194        > {
8195            self.inner
8196                .ready()
8197                .await
8198                .map_err(|e| {
8199                    tonic::Status::unknown(
8200                        format!("Service was not ready: {}", e.into()),
8201                    )
8202                })?;
8203            let codec = tonic_prost::ProstCodec::default();
8204            let path = http::uri::PathAndQuery::from_static(
8205                "/sui.rpc.v2.StateService/ListDynamicFields",
8206            );
8207            let mut req = request.into_request();
8208            req.extensions_mut()
8209                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
8210            self.inner.unary(req, path, codec).await
8211        }
8212        pub async fn list_owned_objects(
8213            &mut self,
8214            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
8215        ) -> std::result::Result<
8216            tonic::Response<super::ListOwnedObjectsResponse>,
8217            tonic::Status,
8218        > {
8219            self.inner
8220                .ready()
8221                .await
8222                .map_err(|e| {
8223                    tonic::Status::unknown(
8224                        format!("Service was not ready: {}", e.into()),
8225                    )
8226                })?;
8227            let codec = tonic_prost::ProstCodec::default();
8228            let path = http::uri::PathAndQuery::from_static(
8229                "/sui.rpc.v2.StateService/ListOwnedObjects",
8230            );
8231            let mut req = request.into_request();
8232            req.extensions_mut()
8233                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
8234            self.inner.unary(req, path, codec).await
8235        }
8236        pub async fn get_coin_info(
8237            &mut self,
8238            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
8239        ) -> std::result::Result<
8240            tonic::Response<super::GetCoinInfoResponse>,
8241            tonic::Status,
8242        > {
8243            self.inner
8244                .ready()
8245                .await
8246                .map_err(|e| {
8247                    tonic::Status::unknown(
8248                        format!("Service was not ready: {}", e.into()),
8249                    )
8250                })?;
8251            let codec = tonic_prost::ProstCodec::default();
8252            let path = http::uri::PathAndQuery::from_static(
8253                "/sui.rpc.v2.StateService/GetCoinInfo",
8254            );
8255            let mut req = request.into_request();
8256            req.extensions_mut()
8257                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
8258            self.inner.unary(req, path, codec).await
8259        }
8260        pub async fn get_balance(
8261            &mut self,
8262            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
8263        ) -> std::result::Result<
8264            tonic::Response<super::GetBalanceResponse>,
8265            tonic::Status,
8266        > {
8267            self.inner
8268                .ready()
8269                .await
8270                .map_err(|e| {
8271                    tonic::Status::unknown(
8272                        format!("Service was not ready: {}", e.into()),
8273                    )
8274                })?;
8275            let codec = tonic_prost::ProstCodec::default();
8276            let path = http::uri::PathAndQuery::from_static(
8277                "/sui.rpc.v2.StateService/GetBalance",
8278            );
8279            let mut req = request.into_request();
8280            req.extensions_mut()
8281                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
8282            self.inner.unary(req, path, codec).await
8283        }
8284        pub async fn list_balances(
8285            &mut self,
8286            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
8287        ) -> std::result::Result<
8288            tonic::Response<super::ListBalancesResponse>,
8289            tonic::Status,
8290        > {
8291            self.inner
8292                .ready()
8293                .await
8294                .map_err(|e| {
8295                    tonic::Status::unknown(
8296                        format!("Service was not ready: {}", e.into()),
8297                    )
8298                })?;
8299            let codec = tonic_prost::ProstCodec::default();
8300            let path = http::uri::PathAndQuery::from_static(
8301                "/sui.rpc.v2.StateService/ListBalances",
8302            );
8303            let mut req = request.into_request();
8304            req.extensions_mut()
8305                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
8306            self.inner.unary(req, path, codec).await
8307        }
8308    }
8309}
8310/// Generated server implementations.
8311pub mod state_service_server {
8312    #![allow(
8313        unused_variables,
8314        dead_code,
8315        missing_docs,
8316        clippy::wildcard_imports,
8317        clippy::let_unit_value,
8318    )]
8319    use tonic::codegen::*;
8320    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
8321    #[async_trait]
8322    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
8323        async fn list_dynamic_fields(
8324            &self,
8325            request: tonic::Request<super::ListDynamicFieldsRequest>,
8326        ) -> std::result::Result<
8327            tonic::Response<super::ListDynamicFieldsResponse>,
8328            tonic::Status,
8329        > {
8330            Err(tonic::Status::unimplemented("Not yet implemented"))
8331        }
8332        async fn list_owned_objects(
8333            &self,
8334            request: tonic::Request<super::ListOwnedObjectsRequest>,
8335        ) -> std::result::Result<
8336            tonic::Response<super::ListOwnedObjectsResponse>,
8337            tonic::Status,
8338        > {
8339            Err(tonic::Status::unimplemented("Not yet implemented"))
8340        }
8341        async fn get_coin_info(
8342            &self,
8343            request: tonic::Request<super::GetCoinInfoRequest>,
8344        ) -> std::result::Result<
8345            tonic::Response<super::GetCoinInfoResponse>,
8346            tonic::Status,
8347        > {
8348            Err(tonic::Status::unimplemented("Not yet implemented"))
8349        }
8350        async fn get_balance(
8351            &self,
8352            request: tonic::Request<super::GetBalanceRequest>,
8353        ) -> std::result::Result<
8354            tonic::Response<super::GetBalanceResponse>,
8355            tonic::Status,
8356        > {
8357            Err(tonic::Status::unimplemented("Not yet implemented"))
8358        }
8359        async fn list_balances(
8360            &self,
8361            request: tonic::Request<super::ListBalancesRequest>,
8362        ) -> std::result::Result<
8363            tonic::Response<super::ListBalancesResponse>,
8364            tonic::Status,
8365        > {
8366            Err(tonic::Status::unimplemented("Not yet implemented"))
8367        }
8368    }
8369    #[derive(Debug)]
8370    pub struct StateServiceServer<T> {
8371        inner: Arc<T>,
8372        accept_compression_encodings: EnabledCompressionEncodings,
8373        send_compression_encodings: EnabledCompressionEncodings,
8374        max_decoding_message_size: Option<usize>,
8375        max_encoding_message_size: Option<usize>,
8376    }
8377    impl<T> StateServiceServer<T> {
8378        pub fn new(inner: T) -> Self {
8379            Self::from_arc(Arc::new(inner))
8380        }
8381        pub fn from_arc(inner: Arc<T>) -> Self {
8382            Self {
8383                inner,
8384                accept_compression_encodings: Default::default(),
8385                send_compression_encodings: Default::default(),
8386                max_decoding_message_size: None,
8387                max_encoding_message_size: None,
8388            }
8389        }
8390        pub fn with_interceptor<F>(
8391            inner: T,
8392            interceptor: F,
8393        ) -> InterceptedService<Self, F>
8394        where
8395            F: tonic::service::Interceptor,
8396        {
8397            InterceptedService::new(Self::new(inner), interceptor)
8398        }
8399        /// Enable decompressing requests with the given encoding.
8400        #[must_use]
8401        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8402            self.accept_compression_encodings.enable(encoding);
8403            self
8404        }
8405        /// Compress responses with the given encoding, if the client supports it.
8406        #[must_use]
8407        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8408            self.send_compression_encodings.enable(encoding);
8409            self
8410        }
8411        /// Limits the maximum size of a decoded message.
8412        ///
8413        /// Default: `4MB`
8414        #[must_use]
8415        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8416            self.max_decoding_message_size = Some(limit);
8417            self
8418        }
8419        /// Limits the maximum size of an encoded message.
8420        ///
8421        /// Default: `usize::MAX`
8422        #[must_use]
8423        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8424            self.max_encoding_message_size = Some(limit);
8425            self
8426        }
8427    }
8428    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
8429    where
8430        T: StateService,
8431        B: Body + std::marker::Send + 'static,
8432        B::Error: Into<StdError> + std::marker::Send + 'static,
8433    {
8434        type Response = http::Response<tonic::body::Body>;
8435        type Error = std::convert::Infallible;
8436        type Future = BoxFuture<Self::Response, Self::Error>;
8437        fn poll_ready(
8438            &mut self,
8439            _cx: &mut Context<'_>,
8440        ) -> Poll<std::result::Result<(), Self::Error>> {
8441            Poll::Ready(Ok(()))
8442        }
8443        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8444            match req.uri().path() {
8445                "/sui.rpc.v2.StateService/ListDynamicFields" => {
8446                    #[allow(non_camel_case_types)]
8447                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
8448                    impl<
8449                        T: StateService,
8450                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
8451                    for ListDynamicFieldsSvc<T> {
8452                        type Response = super::ListDynamicFieldsResponse;
8453                        type Future = BoxFuture<
8454                            tonic::Response<Self::Response>,
8455                            tonic::Status,
8456                        >;
8457                        fn call(
8458                            &mut self,
8459                            request: tonic::Request<super::ListDynamicFieldsRequest>,
8460                        ) -> Self::Future {
8461                            let inner = Arc::clone(&self.0);
8462                            let fut = async move {
8463                                <T as StateService>::list_dynamic_fields(&inner, request)
8464                                    .await
8465                            };
8466                            Box::pin(fut)
8467                        }
8468                    }
8469                    let accept_compression_encodings = self.accept_compression_encodings;
8470                    let send_compression_encodings = self.send_compression_encodings;
8471                    let max_decoding_message_size = self.max_decoding_message_size;
8472                    let max_encoding_message_size = self.max_encoding_message_size;
8473                    let inner = self.inner.clone();
8474                    let fut = async move {
8475                        let method = ListDynamicFieldsSvc(inner);
8476                        let codec = tonic_prost::ProstCodec::default();
8477                        let mut grpc = tonic::server::Grpc::new(codec)
8478                            .apply_compression_config(
8479                                accept_compression_encodings,
8480                                send_compression_encodings,
8481                            )
8482                            .apply_max_message_size_config(
8483                                max_decoding_message_size,
8484                                max_encoding_message_size,
8485                            );
8486                        let res = grpc.unary(method, req).await;
8487                        Ok(res)
8488                    };
8489                    Box::pin(fut)
8490                }
8491                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
8492                    #[allow(non_camel_case_types)]
8493                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
8494                    impl<
8495                        T: StateService,
8496                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
8497                    for ListOwnedObjectsSvc<T> {
8498                        type Response = super::ListOwnedObjectsResponse;
8499                        type Future = BoxFuture<
8500                            tonic::Response<Self::Response>,
8501                            tonic::Status,
8502                        >;
8503                        fn call(
8504                            &mut self,
8505                            request: tonic::Request<super::ListOwnedObjectsRequest>,
8506                        ) -> Self::Future {
8507                            let inner = Arc::clone(&self.0);
8508                            let fut = async move {
8509                                <T as StateService>::list_owned_objects(&inner, request)
8510                                    .await
8511                            };
8512                            Box::pin(fut)
8513                        }
8514                    }
8515                    let accept_compression_encodings = self.accept_compression_encodings;
8516                    let send_compression_encodings = self.send_compression_encodings;
8517                    let max_decoding_message_size = self.max_decoding_message_size;
8518                    let max_encoding_message_size = self.max_encoding_message_size;
8519                    let inner = self.inner.clone();
8520                    let fut = async move {
8521                        let method = ListOwnedObjectsSvc(inner);
8522                        let codec = tonic_prost::ProstCodec::default();
8523                        let mut grpc = tonic::server::Grpc::new(codec)
8524                            .apply_compression_config(
8525                                accept_compression_encodings,
8526                                send_compression_encodings,
8527                            )
8528                            .apply_max_message_size_config(
8529                                max_decoding_message_size,
8530                                max_encoding_message_size,
8531                            );
8532                        let res = grpc.unary(method, req).await;
8533                        Ok(res)
8534                    };
8535                    Box::pin(fut)
8536                }
8537                "/sui.rpc.v2.StateService/GetCoinInfo" => {
8538                    #[allow(non_camel_case_types)]
8539                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
8540                    impl<
8541                        T: StateService,
8542                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
8543                    for GetCoinInfoSvc<T> {
8544                        type Response = super::GetCoinInfoResponse;
8545                        type Future = BoxFuture<
8546                            tonic::Response<Self::Response>,
8547                            tonic::Status,
8548                        >;
8549                        fn call(
8550                            &mut self,
8551                            request: tonic::Request<super::GetCoinInfoRequest>,
8552                        ) -> Self::Future {
8553                            let inner = Arc::clone(&self.0);
8554                            let fut = async move {
8555                                <T as StateService>::get_coin_info(&inner, request).await
8556                            };
8557                            Box::pin(fut)
8558                        }
8559                    }
8560                    let accept_compression_encodings = self.accept_compression_encodings;
8561                    let send_compression_encodings = self.send_compression_encodings;
8562                    let max_decoding_message_size = self.max_decoding_message_size;
8563                    let max_encoding_message_size = self.max_encoding_message_size;
8564                    let inner = self.inner.clone();
8565                    let fut = async move {
8566                        let method = GetCoinInfoSvc(inner);
8567                        let codec = tonic_prost::ProstCodec::default();
8568                        let mut grpc = tonic::server::Grpc::new(codec)
8569                            .apply_compression_config(
8570                                accept_compression_encodings,
8571                                send_compression_encodings,
8572                            )
8573                            .apply_max_message_size_config(
8574                                max_decoding_message_size,
8575                                max_encoding_message_size,
8576                            );
8577                        let res = grpc.unary(method, req).await;
8578                        Ok(res)
8579                    };
8580                    Box::pin(fut)
8581                }
8582                "/sui.rpc.v2.StateService/GetBalance" => {
8583                    #[allow(non_camel_case_types)]
8584                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
8585                    impl<
8586                        T: StateService,
8587                    > tonic::server::UnaryService<super::GetBalanceRequest>
8588                    for GetBalanceSvc<T> {
8589                        type Response = super::GetBalanceResponse;
8590                        type Future = BoxFuture<
8591                            tonic::Response<Self::Response>,
8592                            tonic::Status,
8593                        >;
8594                        fn call(
8595                            &mut self,
8596                            request: tonic::Request<super::GetBalanceRequest>,
8597                        ) -> Self::Future {
8598                            let inner = Arc::clone(&self.0);
8599                            let fut = async move {
8600                                <T as StateService>::get_balance(&inner, request).await
8601                            };
8602                            Box::pin(fut)
8603                        }
8604                    }
8605                    let accept_compression_encodings = self.accept_compression_encodings;
8606                    let send_compression_encodings = self.send_compression_encodings;
8607                    let max_decoding_message_size = self.max_decoding_message_size;
8608                    let max_encoding_message_size = self.max_encoding_message_size;
8609                    let inner = self.inner.clone();
8610                    let fut = async move {
8611                        let method = GetBalanceSvc(inner);
8612                        let codec = tonic_prost::ProstCodec::default();
8613                        let mut grpc = tonic::server::Grpc::new(codec)
8614                            .apply_compression_config(
8615                                accept_compression_encodings,
8616                                send_compression_encodings,
8617                            )
8618                            .apply_max_message_size_config(
8619                                max_decoding_message_size,
8620                                max_encoding_message_size,
8621                            );
8622                        let res = grpc.unary(method, req).await;
8623                        Ok(res)
8624                    };
8625                    Box::pin(fut)
8626                }
8627                "/sui.rpc.v2.StateService/ListBalances" => {
8628                    #[allow(non_camel_case_types)]
8629                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
8630                    impl<
8631                        T: StateService,
8632                    > tonic::server::UnaryService<super::ListBalancesRequest>
8633                    for ListBalancesSvc<T> {
8634                        type Response = super::ListBalancesResponse;
8635                        type Future = BoxFuture<
8636                            tonic::Response<Self::Response>,
8637                            tonic::Status,
8638                        >;
8639                        fn call(
8640                            &mut self,
8641                            request: tonic::Request<super::ListBalancesRequest>,
8642                        ) -> Self::Future {
8643                            let inner = Arc::clone(&self.0);
8644                            let fut = async move {
8645                                <T as StateService>::list_balances(&inner, request).await
8646                            };
8647                            Box::pin(fut)
8648                        }
8649                    }
8650                    let accept_compression_encodings = self.accept_compression_encodings;
8651                    let send_compression_encodings = self.send_compression_encodings;
8652                    let max_decoding_message_size = self.max_decoding_message_size;
8653                    let max_encoding_message_size = self.max_encoding_message_size;
8654                    let inner = self.inner.clone();
8655                    let fut = async move {
8656                        let method = ListBalancesSvc(inner);
8657                        let codec = tonic_prost::ProstCodec::default();
8658                        let mut grpc = tonic::server::Grpc::new(codec)
8659                            .apply_compression_config(
8660                                accept_compression_encodings,
8661                                send_compression_encodings,
8662                            )
8663                            .apply_max_message_size_config(
8664                                max_decoding_message_size,
8665                                max_encoding_message_size,
8666                            );
8667                        let res = grpc.unary(method, req).await;
8668                        Ok(res)
8669                    };
8670                    Box::pin(fut)
8671                }
8672                _ => {
8673                    Box::pin(async move {
8674                        let mut response = http::Response::new(
8675                            tonic::body::Body::default(),
8676                        );
8677                        let headers = response.headers_mut();
8678                        headers
8679                            .insert(
8680                                tonic::Status::GRPC_STATUS,
8681                                (tonic::Code::Unimplemented as i32).into(),
8682                            );
8683                        headers
8684                            .insert(
8685                                http::header::CONTENT_TYPE,
8686                                tonic::metadata::GRPC_CONTENT_TYPE,
8687                            );
8688                        Ok(response)
8689                    })
8690                }
8691            }
8692        }
8693    }
8694    impl<T> Clone for StateServiceServer<T> {
8695        fn clone(&self) -> Self {
8696            let inner = self.inner.clone();
8697            Self {
8698                inner,
8699                accept_compression_encodings: self.accept_compression_encodings,
8700                send_compression_encodings: self.send_compression_encodings,
8701                max_decoding_message_size: self.max_decoding_message_size,
8702                max_encoding_message_size: self.max_encoding_message_size,
8703            }
8704        }
8705    }
8706    /// Generated gRPC service name
8707    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
8708    impl<T> tonic::server::NamedService for StateServiceServer<T> {
8709        const NAME: &'static str = SERVICE_NAME;
8710    }
8711}
8712/// Request message for SubscriptionService.SubscribeCheckpoints.
8713#[derive(Eq, Hash)]
8714#[non_exhaustive]
8715#[derive(Clone, PartialEq, ::prost::Message)]
8716pub struct SubscribeCheckpointsRequest {
8717    /// Optional. Mask for specifying which parts of the Checkpoint should be
8718    /// returned (e.g. summary, contents, signatures). `cursor` is always
8719    /// populated and is not subject to the mask.
8720    #[prost(message, optional, tag = "1")]
8721    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8722    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
8723    /// matches if any transaction it contains satisfies the filter. If absent,
8724    /// every checkpoint is streamed.
8725    #[prost(message, optional, tag = "2")]
8726    pub filter: ::core::option::Option<TransactionFilter>,
8727}
8728/// Response message for SubscriptionService.SubscribeCheckpoints.
8729///
8730/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
8731/// sequence number stands in for the `Watermark` message the other
8732/// subscription responses carry. Progress-only frames (with `checkpoint`
8733/// unset) occur only on filtered streams: on an unfiltered stream every frame
8734/// carries both fields, in order and without gaps.
8735#[non_exhaustive]
8736#[derive(Clone, PartialEq, ::prost::Message)]
8737pub struct SubscribeCheckpointsResponse {
8738    /// Required. The checkpoint sequence number the stream has fully covered,
8739    /// inclusive: every matching checkpoint from the stream's start position
8740    /// through `cursor` has been delivered. Present on every frame and
8741    /// advances monotonically.
8742    #[prost(uint64, optional, tag = "1")]
8743    pub cursor: ::core::option::Option<u64>,
8744    /// The matching checkpoint. Unset when this frame only advances the
8745    /// cursor past non-matching checkpoints.
8746    #[prost(message, optional, tag = "2")]
8747    pub checkpoint: ::core::option::Option<Checkpoint>,
8748}
8749/// Request message for SubscriptionService.SubscribeTransactions.
8750#[non_exhaustive]
8751#[derive(Clone, PartialEq, ::prost::Message)]
8752pub struct SubscribeTransactionsRequest {
8753    /// Optional. Mask for specifying which parts of the ExecutedTransaction
8754    /// should be returned.
8755    #[prost(message, optional, tag = "1")]
8756    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8757    /// Optional. DNF filter over indexed dimensions. If absent, every
8758    /// transaction is streamed.
8759    #[prost(message, optional, tag = "2")]
8760    pub filter: ::core::option::Option<TransactionFilter>,
8761}
8762/// Response message for SubscriptionService.SubscribeTransactions.
8763///
8764/// Mirrors ListTransactionsResponse, except there is no `end` field: a
8765/// subscription stream has no successful end.
8766#[non_exhaustive]
8767#[derive(Clone, PartialEq, ::prost::Message)]
8768pub struct SubscribeTransactionsResponse {
8769    /// One matching transaction. Its position within the containing checkpoint
8770    /// is reported by `ExecutedTransaction.transaction_index`.
8771    #[prost(message, optional, tag = "1")]
8772    pub transaction: ::core::option::Option<ExecutedTransaction>,
8773    /// Progress watermark as of this frame. Present on every frame.
8774    #[prost(message, optional, tag = "2")]
8775    pub watermark: ::core::option::Option<Watermark>,
8776}
8777/// Request message for SubscriptionService.SubscribeEvents.
8778#[non_exhaustive]
8779#[derive(Clone, PartialEq, ::prost::Message)]
8780pub struct SubscribeEventsRequest {
8781    /// Optional. Mask for specifying which parts of the Event should be
8782    /// returned.
8783    #[prost(message, optional, tag = "1")]
8784    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
8785    /// Optional. DNF filter over indexed dimensions. If absent, every event is
8786    /// streamed.
8787    #[prost(message, optional, tag = "2")]
8788    pub filter: ::core::option::Option<EventFilter>,
8789}
8790/// Response message for SubscriptionService.SubscribeEvents.
8791///
8792/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
8793/// stream has no successful end.
8794#[non_exhaustive]
8795#[derive(Clone, PartialEq, ::prost::Message)]
8796pub struct SubscribeEventsResponse {
8797    /// One matching event. Its ledger position -- containing checkpoint,
8798    /// emitting transaction digest and offset, and index within that
8799    /// transaction's event list -- is reported by the corresponding fields on
8800    /// `Event`.
8801    #[prost(message, optional, tag = "1")]
8802    pub event: ::core::option::Option<Event>,
8803    /// Progress watermark as of this frame. Present on every frame.
8804    #[prost(message, optional, tag = "2")]
8805    pub watermark: ::core::option::Option<Watermark>,
8806}
8807/// Generated client implementations.
8808pub mod subscription_service_client {
8809    #![allow(
8810        unused_variables,
8811        dead_code,
8812        missing_docs,
8813        clippy::wildcard_imports,
8814        clippy::let_unit_value,
8815    )]
8816    use tonic::codegen::*;
8817    use tonic::codegen::http::Uri;
8818    /// SubscriptionService provides filtered, real-time streams of checkpoints,
8819    /// transactions, and events.
8820    ///
8821    /// Each Subscribe API pairs with the LedgerService List API of the same name:
8822    /// requests take the same filter message, and responses carry the same item
8823    /// and watermark shapes with identical cursor semantics.
8824    ///
8825    /// Subscriptions do not support resumption. A new subscription always begins
8826    /// at the current tip of the chain as seen by the server (the latest executed
8827    /// checkpoint). To recover data missed between subscriptions, replay the gap
8828    /// with the paired List API: pass the last received `Watermark.cursor` as
8829    /// `options.after`, with the request's start at its `cursor_position` (for
8830    /// checkpoints, pass the last received `cursor + 1` as `start_checkpoint`). The
8831    /// List scan reads from the indexed tip, which may trail the subscription's
8832    /// start position; repeat the List call as the index advances until the replay
8833    /// reaches the position established by the subscription's first frame: for
8834    /// transactions and events, that frame's item key if it carries an item, and
8835    /// its `cursor_position` otherwise. Compare positions and item keys, never
8836    /// cursor bytes.
8837    ///
8838    /// A subscription behaves like an unbounded ascending scan: every frame
8839    /// carries the subscriber's resume point, and progress advances as
8840    /// checkpoints are fully covered. Two delivery guarantees keep sparse
8841    /// filters live: the first frame on a filtered subscription is a
8842    /// progress-only frame establishing the stream's start position, and
8843    /// progress continues to advance with bounded staleness even when no item
8844    /// matches.
8845    ///
8846    /// Subscription streams have no successful end: they run until cancelled by
8847    /// the client or terminated by the server with a gRPC status.
8848    #[derive(Debug, Clone)]
8849    pub struct SubscriptionServiceClient<T> {
8850        inner: tonic::client::Grpc<T>,
8851    }
8852    impl SubscriptionServiceClient<tonic::transport::Channel> {
8853        /// Attempt to create a new client by connecting to a given endpoint.
8854        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8855        where
8856            D: TryInto<tonic::transport::Endpoint>,
8857            D::Error: Into<StdError>,
8858        {
8859            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8860            Ok(Self::new(conn))
8861        }
8862    }
8863    impl<T> SubscriptionServiceClient<T>
8864    where
8865        T: tonic::client::GrpcService<tonic::body::Body>,
8866        T::Error: Into<StdError>,
8867        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8868        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8869    {
8870        pub fn new(inner: T) -> Self {
8871            let inner = tonic::client::Grpc::new(inner);
8872            Self { inner }
8873        }
8874        pub fn with_origin(inner: T, origin: Uri) -> Self {
8875            let inner = tonic::client::Grpc::with_origin(inner, origin);
8876            Self { inner }
8877        }
8878        pub fn with_interceptor<F>(
8879            inner: T,
8880            interceptor: F,
8881        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
8882        where
8883            F: tonic::service::Interceptor,
8884            T::ResponseBody: Default,
8885            T: tonic::codegen::Service<
8886                http::Request<tonic::body::Body>,
8887                Response = http::Response<
8888                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8889                >,
8890            >,
8891            <T as tonic::codegen::Service<
8892                http::Request<tonic::body::Body>,
8893            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8894        {
8895            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
8896        }
8897        /// Compress requests with the given encoding.
8898        ///
8899        /// This requires the server to support it otherwise it might respond with an
8900        /// error.
8901        #[must_use]
8902        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8903            self.inner = self.inner.send_compressed(encoding);
8904            self
8905        }
8906        /// Enable decompressing responses.
8907        #[must_use]
8908        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8909            self.inner = self.inner.accept_compressed(encoding);
8910            self
8911        }
8912        /// Limits the maximum size of a decoded message.
8913        ///
8914        /// Default: `4MB`
8915        #[must_use]
8916        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8917            self.inner = self.inner.max_decoding_message_size(limit);
8918            self
8919        }
8920        /// Limits the maximum size of an encoded message.
8921        ///
8922        /// Default: `usize::MAX`
8923        #[must_use]
8924        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8925            self.inner = self.inner.max_encoding_message_size(limit);
8926            self
8927        }
8928        /// Subscribe to the stream of checkpoints.
8929        ///
8930        /// The stream begins at the latest executed checkpoint as seen by the
8931        /// server and yields checkpoints matching the filter as they are executed.
8932        /// A checkpoint matches if any transaction it contains satisfies the
8933        /// filter.
8934        pub async fn subscribe_checkpoints(
8935            &mut self,
8936            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
8937        ) -> std::result::Result<
8938            tonic::Response<
8939                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
8940            >,
8941            tonic::Status,
8942        > {
8943            self.inner
8944                .ready()
8945                .await
8946                .map_err(|e| {
8947                    tonic::Status::unknown(
8948                        format!("Service was not ready: {}", e.into()),
8949                    )
8950                })?;
8951            let codec = tonic_prost::ProstCodec::default();
8952            let path = http::uri::PathAndQuery::from_static(
8953                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
8954            );
8955            let mut req = request.into_request();
8956            req.extensions_mut()
8957                .insert(
8958                    GrpcMethod::new(
8959                        "sui.rpc.v2.SubscriptionService",
8960                        "SubscribeCheckpoints",
8961                    ),
8962                );
8963            self.inner.server_streaming(req, path, codec).await
8964        }
8965        /// Subscribe to the stream of transactions.
8966        ///
8967        /// The stream begins at the latest executed checkpoint as seen by the
8968        /// server and yields transactions matching the filter as they are executed.
8969        pub async fn subscribe_transactions(
8970            &mut self,
8971            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
8972        ) -> std::result::Result<
8973            tonic::Response<
8974                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
8975            >,
8976            tonic::Status,
8977        > {
8978            self.inner
8979                .ready()
8980                .await
8981                .map_err(|e| {
8982                    tonic::Status::unknown(
8983                        format!("Service was not ready: {}", e.into()),
8984                    )
8985                })?;
8986            let codec = tonic_prost::ProstCodec::default();
8987            let path = http::uri::PathAndQuery::from_static(
8988                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
8989            );
8990            let mut req = request.into_request();
8991            req.extensions_mut()
8992                .insert(
8993                    GrpcMethod::new(
8994                        "sui.rpc.v2.SubscriptionService",
8995                        "SubscribeTransactions",
8996                    ),
8997                );
8998            self.inner.server_streaming(req, path, codec).await
8999        }
9000        /// Subscribe to the stream of events.
9001        ///
9002        /// The stream begins at the latest executed checkpoint as seen by the
9003        /// server and yields events matching the filter as they are emitted.
9004        pub async fn subscribe_events(
9005            &mut self,
9006            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
9007        ) -> std::result::Result<
9008            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
9009            tonic::Status,
9010        > {
9011            self.inner
9012                .ready()
9013                .await
9014                .map_err(|e| {
9015                    tonic::Status::unknown(
9016                        format!("Service was not ready: {}", e.into()),
9017                    )
9018                })?;
9019            let codec = tonic_prost::ProstCodec::default();
9020            let path = http::uri::PathAndQuery::from_static(
9021                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
9022            );
9023            let mut req = request.into_request();
9024            req.extensions_mut()
9025                .insert(
9026                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
9027                );
9028            self.inner.server_streaming(req, path, codec).await
9029        }
9030    }
9031}
9032/// Generated server implementations.
9033pub mod subscription_service_server {
9034    #![allow(
9035        unused_variables,
9036        dead_code,
9037        missing_docs,
9038        clippy::wildcard_imports,
9039        clippy::let_unit_value,
9040    )]
9041    use tonic::codegen::*;
9042    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
9043    #[async_trait]
9044    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
9045        /// Subscribe to the stream of checkpoints.
9046        ///
9047        /// The stream begins at the latest executed checkpoint as seen by the
9048        /// server and yields checkpoints matching the filter as they are executed.
9049        /// A checkpoint matches if any transaction it contains satisfies the
9050        /// filter.
9051        async fn subscribe_checkpoints(
9052            &self,
9053            request: tonic::Request<super::SubscribeCheckpointsRequest>,
9054        ) -> std::result::Result<
9055            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
9056            tonic::Status,
9057        > {
9058            Err(tonic::Status::unimplemented("Not yet implemented"))
9059        }
9060        /// Subscribe to the stream of transactions.
9061        ///
9062        /// The stream begins at the latest executed checkpoint as seen by the
9063        /// server and yields transactions matching the filter as they are executed.
9064        async fn subscribe_transactions(
9065            &self,
9066            request: tonic::Request<super::SubscribeTransactionsRequest>,
9067        ) -> std::result::Result<
9068            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
9069            tonic::Status,
9070        > {
9071            Err(tonic::Status::unimplemented("Not yet implemented"))
9072        }
9073        /// Subscribe to the stream of events.
9074        ///
9075        /// The stream begins at the latest executed checkpoint as seen by the
9076        /// server and yields events matching the filter as they are emitted.
9077        async fn subscribe_events(
9078            &self,
9079            request: tonic::Request<super::SubscribeEventsRequest>,
9080        ) -> std::result::Result<
9081            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
9082            tonic::Status,
9083        > {
9084            Err(tonic::Status::unimplemented("Not yet implemented"))
9085        }
9086    }
9087    /// SubscriptionService provides filtered, real-time streams of checkpoints,
9088    /// transactions, and events.
9089    ///
9090    /// Each Subscribe API pairs with the LedgerService List API of the same name:
9091    /// requests take the same filter message, and responses carry the same item
9092    /// and watermark shapes with identical cursor semantics.
9093    ///
9094    /// Subscriptions do not support resumption. A new subscription always begins
9095    /// at the current tip of the chain as seen by the server (the latest executed
9096    /// checkpoint). To recover data missed between subscriptions, replay the gap
9097    /// with the paired List API: pass the last received `Watermark.cursor` as
9098    /// `options.after`, with the request's start at its `cursor_position` (for
9099    /// checkpoints, pass the last received `cursor + 1` as `start_checkpoint`). The
9100    /// List scan reads from the indexed tip, which may trail the subscription's
9101    /// start position; repeat the List call as the index advances until the replay
9102    /// reaches the position established by the subscription's first frame: for
9103    /// transactions and events, that frame's item key if it carries an item, and
9104    /// its `cursor_position` otherwise. Compare positions and item keys, never
9105    /// cursor bytes.
9106    ///
9107    /// A subscription behaves like an unbounded ascending scan: every frame
9108    /// carries the subscriber's resume point, and progress advances as
9109    /// checkpoints are fully covered. Two delivery guarantees keep sparse
9110    /// filters live: the first frame on a filtered subscription is a
9111    /// progress-only frame establishing the stream's start position, and
9112    /// progress continues to advance with bounded staleness even when no item
9113    /// matches.
9114    ///
9115    /// Subscription streams have no successful end: they run until cancelled by
9116    /// the client or terminated by the server with a gRPC status.
9117    #[derive(Debug)]
9118    pub struct SubscriptionServiceServer<T> {
9119        inner: Arc<T>,
9120        accept_compression_encodings: EnabledCompressionEncodings,
9121        send_compression_encodings: EnabledCompressionEncodings,
9122        max_decoding_message_size: Option<usize>,
9123        max_encoding_message_size: Option<usize>,
9124    }
9125    impl<T> SubscriptionServiceServer<T> {
9126        pub fn new(inner: T) -> Self {
9127            Self::from_arc(Arc::new(inner))
9128        }
9129        pub fn from_arc(inner: Arc<T>) -> Self {
9130            Self {
9131                inner,
9132                accept_compression_encodings: Default::default(),
9133                send_compression_encodings: Default::default(),
9134                max_decoding_message_size: None,
9135                max_encoding_message_size: None,
9136            }
9137        }
9138        pub fn with_interceptor<F>(
9139            inner: T,
9140            interceptor: F,
9141        ) -> InterceptedService<Self, F>
9142        where
9143            F: tonic::service::Interceptor,
9144        {
9145            InterceptedService::new(Self::new(inner), interceptor)
9146        }
9147        /// Enable decompressing requests with the given encoding.
9148        #[must_use]
9149        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9150            self.accept_compression_encodings.enable(encoding);
9151            self
9152        }
9153        /// Compress responses with the given encoding, if the client supports it.
9154        #[must_use]
9155        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9156            self.send_compression_encodings.enable(encoding);
9157            self
9158        }
9159        /// Limits the maximum size of a decoded message.
9160        ///
9161        /// Default: `4MB`
9162        #[must_use]
9163        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9164            self.max_decoding_message_size = Some(limit);
9165            self
9166        }
9167        /// Limits the maximum size of an encoded message.
9168        ///
9169        /// Default: `usize::MAX`
9170        #[must_use]
9171        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9172            self.max_encoding_message_size = Some(limit);
9173            self
9174        }
9175    }
9176    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
9177    where
9178        T: SubscriptionService,
9179        B: Body + std::marker::Send + 'static,
9180        B::Error: Into<StdError> + std::marker::Send + 'static,
9181    {
9182        type Response = http::Response<tonic::body::Body>;
9183        type Error = std::convert::Infallible;
9184        type Future = BoxFuture<Self::Response, Self::Error>;
9185        fn poll_ready(
9186            &mut self,
9187            _cx: &mut Context<'_>,
9188        ) -> Poll<std::result::Result<(), Self::Error>> {
9189            Poll::Ready(Ok(()))
9190        }
9191        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9192            match req.uri().path() {
9193                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
9194                    #[allow(non_camel_case_types)]
9195                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
9196                    impl<
9197                        T: SubscriptionService,
9198                    > tonic::server::ServerStreamingService<
9199                        super::SubscribeCheckpointsRequest,
9200                    > for SubscribeCheckpointsSvc<T> {
9201                        type Response = super::SubscribeCheckpointsResponse;
9202                        type ResponseStream = BoxStream<
9203                            super::SubscribeCheckpointsResponse,
9204                        >;
9205                        type Future = BoxFuture<
9206                            tonic::Response<Self::ResponseStream>,
9207                            tonic::Status,
9208                        >;
9209                        fn call(
9210                            &mut self,
9211                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
9212                        ) -> Self::Future {
9213                            let inner = Arc::clone(&self.0);
9214                            let fut = async move {
9215                                <T as SubscriptionService>::subscribe_checkpoints(
9216                                        &inner,
9217                                        request,
9218                                    )
9219                                    .await
9220                            };
9221                            Box::pin(fut)
9222                        }
9223                    }
9224                    let accept_compression_encodings = self.accept_compression_encodings;
9225                    let send_compression_encodings = self.send_compression_encodings;
9226                    let max_decoding_message_size = self.max_decoding_message_size;
9227                    let max_encoding_message_size = self.max_encoding_message_size;
9228                    let inner = self.inner.clone();
9229                    let fut = async move {
9230                        let method = SubscribeCheckpointsSvc(inner);
9231                        let codec = tonic_prost::ProstCodec::default();
9232                        let mut grpc = tonic::server::Grpc::new(codec)
9233                            .apply_compression_config(
9234                                accept_compression_encodings,
9235                                send_compression_encodings,
9236                            )
9237                            .apply_max_message_size_config(
9238                                max_decoding_message_size,
9239                                max_encoding_message_size,
9240                            );
9241                        let res = grpc.server_streaming(method, req).await;
9242                        Ok(res)
9243                    };
9244                    Box::pin(fut)
9245                }
9246                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
9247                    #[allow(non_camel_case_types)]
9248                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
9249                    impl<
9250                        T: SubscriptionService,
9251                    > tonic::server::ServerStreamingService<
9252                        super::SubscribeTransactionsRequest,
9253                    > for SubscribeTransactionsSvc<T> {
9254                        type Response = super::SubscribeTransactionsResponse;
9255                        type ResponseStream = BoxStream<
9256                            super::SubscribeTransactionsResponse,
9257                        >;
9258                        type Future = BoxFuture<
9259                            tonic::Response<Self::ResponseStream>,
9260                            tonic::Status,
9261                        >;
9262                        fn call(
9263                            &mut self,
9264                            request: tonic::Request<super::SubscribeTransactionsRequest>,
9265                        ) -> Self::Future {
9266                            let inner = Arc::clone(&self.0);
9267                            let fut = async move {
9268                                <T as SubscriptionService>::subscribe_transactions(
9269                                        &inner,
9270                                        request,
9271                                    )
9272                                    .await
9273                            };
9274                            Box::pin(fut)
9275                        }
9276                    }
9277                    let accept_compression_encodings = self.accept_compression_encodings;
9278                    let send_compression_encodings = self.send_compression_encodings;
9279                    let max_decoding_message_size = self.max_decoding_message_size;
9280                    let max_encoding_message_size = self.max_encoding_message_size;
9281                    let inner = self.inner.clone();
9282                    let fut = async move {
9283                        let method = SubscribeTransactionsSvc(inner);
9284                        let codec = tonic_prost::ProstCodec::default();
9285                        let mut grpc = tonic::server::Grpc::new(codec)
9286                            .apply_compression_config(
9287                                accept_compression_encodings,
9288                                send_compression_encodings,
9289                            )
9290                            .apply_max_message_size_config(
9291                                max_decoding_message_size,
9292                                max_encoding_message_size,
9293                            );
9294                        let res = grpc.server_streaming(method, req).await;
9295                        Ok(res)
9296                    };
9297                    Box::pin(fut)
9298                }
9299                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
9300                    #[allow(non_camel_case_types)]
9301                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
9302                    impl<
9303                        T: SubscriptionService,
9304                    > tonic::server::ServerStreamingService<
9305                        super::SubscribeEventsRequest,
9306                    > for SubscribeEventsSvc<T> {
9307                        type Response = super::SubscribeEventsResponse;
9308                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
9309                        type Future = BoxFuture<
9310                            tonic::Response<Self::ResponseStream>,
9311                            tonic::Status,
9312                        >;
9313                        fn call(
9314                            &mut self,
9315                            request: tonic::Request<super::SubscribeEventsRequest>,
9316                        ) -> Self::Future {
9317                            let inner = Arc::clone(&self.0);
9318                            let fut = async move {
9319                                <T as SubscriptionService>::subscribe_events(
9320                                        &inner,
9321                                        request,
9322                                    )
9323                                    .await
9324                            };
9325                            Box::pin(fut)
9326                        }
9327                    }
9328                    let accept_compression_encodings = self.accept_compression_encodings;
9329                    let send_compression_encodings = self.send_compression_encodings;
9330                    let max_decoding_message_size = self.max_decoding_message_size;
9331                    let max_encoding_message_size = self.max_encoding_message_size;
9332                    let inner = self.inner.clone();
9333                    let fut = async move {
9334                        let method = SubscribeEventsSvc(inner);
9335                        let codec = tonic_prost::ProstCodec::default();
9336                        let mut grpc = tonic::server::Grpc::new(codec)
9337                            .apply_compression_config(
9338                                accept_compression_encodings,
9339                                send_compression_encodings,
9340                            )
9341                            .apply_max_message_size_config(
9342                                max_decoding_message_size,
9343                                max_encoding_message_size,
9344                            );
9345                        let res = grpc.server_streaming(method, req).await;
9346                        Ok(res)
9347                    };
9348                    Box::pin(fut)
9349                }
9350                _ => {
9351                    Box::pin(async move {
9352                        let mut response = http::Response::new(
9353                            tonic::body::Body::default(),
9354                        );
9355                        let headers = response.headers_mut();
9356                        headers
9357                            .insert(
9358                                tonic::Status::GRPC_STATUS,
9359                                (tonic::Code::Unimplemented as i32).into(),
9360                            );
9361                        headers
9362                            .insert(
9363                                http::header::CONTENT_TYPE,
9364                                tonic::metadata::GRPC_CONTENT_TYPE,
9365                            );
9366                        Ok(response)
9367                    })
9368                }
9369            }
9370        }
9371    }
9372    impl<T> Clone for SubscriptionServiceServer<T> {
9373        fn clone(&self) -> Self {
9374            let inner = self.inner.clone();
9375            Self {
9376                inner,
9377                accept_compression_encodings: self.accept_compression_encodings,
9378                send_compression_encodings: self.send_compression_encodings,
9379                max_decoding_message_size: self.max_decoding_message_size,
9380                max_encoding_message_size: self.max_encoding_message_size,
9381            }
9382        }
9383    }
9384    /// Generated gRPC service name
9385    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
9386    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
9387        const NAME: &'static str = SERVICE_NAME;
9388    }
9389}
9390#[non_exhaustive]
9391#[derive(Clone, PartialEq, ::prost::Message)]
9392pub struct SystemState {
9393    /// The version of the system state data structure type.
9394    #[prost(uint64, optional, tag = "1")]
9395    pub version: ::core::option::Option<u64>,
9396    /// The epoch id
9397    #[prost(uint64, optional, tag = "2")]
9398    pub epoch: ::core::option::Option<u64>,
9399    /// The protocol version
9400    #[prost(uint64, optional, tag = "3")]
9401    pub protocol_version: ::core::option::Option<u64>,
9402    /// Information about the validators
9403    #[prost(message, optional, tag = "4")]
9404    pub validators: ::core::option::Option<ValidatorSet>,
9405    /// Storage Fund info
9406    #[prost(message, optional, tag = "5")]
9407    pub storage_fund: ::core::option::Option<StorageFund>,
9408    /// Set of system config parameters
9409    #[prost(message, optional, tag = "6")]
9410    pub parameters: ::core::option::Option<SystemParameters>,
9411    /// The reference gas price for this epoch
9412    #[prost(uint64, optional, tag = "7")]
9413    pub reference_gas_price: ::core::option::Option<u64>,
9414    /// A list of the records of validator reporting each other.
9415    ///
9416    /// There is an entry in this list for each validator that has been reported
9417    /// at least once. Each record contains all the validators that reported
9418    /// them. If a validator has never been reported they don't have a record in this list.
9419    /// This lists persists across epoch: a peer continues being in a reported state until the
9420    /// reporter doesn't explicitly remove their report.
9421    #[prost(message, repeated, tag = "8")]
9422    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
9423    /// Schedule of stake subsidies given out each epoch.
9424    #[prost(message, optional, tag = "9")]
9425    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
9426    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
9427    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
9428    /// It can be reset once we are able to successfully execute advance_epoch.
9429    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
9430    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
9431    /// are out of safe mode.
9432    #[prost(bool, optional, tag = "10")]
9433    pub safe_mode: ::core::option::Option<bool>,
9434    /// Storage rewards accumulated during safe_mode
9435    #[prost(uint64, optional, tag = "11")]
9436    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
9437    /// Computation rewards accumulated during safe_mode
9438    #[prost(uint64, optional, tag = "12")]
9439    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
9440    /// Storage rebates paid out during safe_mode
9441    #[prost(uint64, optional, tag = "13")]
9442    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
9443    /// Nonrefundable storage fees accumulated during safe_mode
9444    #[prost(uint64, optional, tag = "14")]
9445    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
9446    /// Unix timestamp of when this this epoch started
9447    #[prost(uint64, optional, tag = "15")]
9448    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
9449    /// Any extra fields that's not defined statically.
9450    #[prost(message, optional, tag = "16")]
9451    pub extra_fields: ::core::option::Option<MoveTable>,
9452}
9453#[non_exhaustive]
9454#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9455pub struct ValidatorReportRecord {
9456    /// The address of the validator being reported
9457    #[prost(string, optional, tag = "1")]
9458    pub reported: ::core::option::Option<::prost::alloc::string::String>,
9459    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
9460    #[prost(string, repeated, tag = "2")]
9461    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
9462}
9463#[non_exhaustive]
9464#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9465pub struct SystemParameters {
9466    /// The duration of an epoch, in milliseconds.
9467    #[prost(uint64, optional, tag = "1")]
9468    pub epoch_duration_ms: ::core::option::Option<u64>,
9469    /// The starting epoch in which stake subsidies start being paid out
9470    #[prost(uint64, optional, tag = "2")]
9471    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
9472    /// Minimum number of active validators at any moment.
9473    #[prost(uint64, optional, tag = "3")]
9474    pub min_validator_count: ::core::option::Option<u64>,
9475    /// Maximum number of active validators at any moment.
9476    /// We do not allow the number of validators in any epoch to go above this.
9477    #[prost(uint64, optional, tag = "4")]
9478    pub max_validator_count: ::core::option::Option<u64>,
9479    /// Deprecated.
9480    /// Lower-bound on the amount of stake required to become a validator.
9481    #[prost(uint64, optional, tag = "5")]
9482    pub min_validator_joining_stake: ::core::option::Option<u64>,
9483    /// Deprecated.
9484    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
9485    /// have low stake and will be escorted out of the validator set after being below this
9486    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
9487    #[prost(uint64, optional, tag = "6")]
9488    pub validator_low_stake_threshold: ::core::option::Option<u64>,
9489    /// Deprecated.
9490    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
9491    /// immediately at epoch change, no grace period.
9492    #[prost(uint64, optional, tag = "7")]
9493    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
9494    /// A validator can have stake below `validator_low_stake_threshold`
9495    /// for this many epochs before being kicked out.
9496    #[prost(uint64, optional, tag = "8")]
9497    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
9498    /// Any extra fields that are not defined statically.
9499    #[prost(message, optional, tag = "9")]
9500    pub extra_fields: ::core::option::Option<MoveTable>,
9501}
9502/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
9503#[non_exhaustive]
9504#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9505pub struct MoveTable {
9506    /// The UID of the table or bag
9507    #[prost(string, optional, tag = "1")]
9508    pub id: ::core::option::Option<::prost::alloc::string::String>,
9509    /// The size or number of key-value pairs in the table or bag
9510    #[prost(uint64, optional, tag = "2")]
9511    pub size: ::core::option::Option<u64>,
9512}
9513#[non_exhaustive]
9514#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9515pub struct StakeSubsidy {
9516    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
9517    #[prost(uint64, optional, tag = "1")]
9518    pub balance: ::core::option::Option<u64>,
9519    /// Count of the number of times stake subsidies have been distributed.
9520    #[prost(uint64, optional, tag = "2")]
9521    pub distribution_counter: ::core::option::Option<u64>,
9522    /// The amount of stake subsidy to be drawn down per distribution.
9523    /// This amount decays and decreases over time.
9524    #[prost(uint64, optional, tag = "3")]
9525    pub current_distribution_amount: ::core::option::Option<u64>,
9526    /// Number of distributions to occur before the distribution amount decays.
9527    #[prost(uint64, optional, tag = "4")]
9528    pub stake_subsidy_period_length: ::core::option::Option<u64>,
9529    /// The rate at which the distribution amount decays at the end of each
9530    /// period. Expressed in basis points.
9531    #[prost(uint32, optional, tag = "5")]
9532    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
9533    /// Any extra fields that's not defined statically.
9534    #[prost(message, optional, tag = "6")]
9535    pub extra_fields: ::core::option::Option<MoveTable>,
9536}
9537/// Struct representing the onchain storage fund.
9538#[non_exhaustive]
9539#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9540pub struct StorageFund {
9541    /// This is the sum of `storage_rebate` of
9542    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
9543    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
9544    /// of transactions, including both the portion refunded to the transaction senders as well as
9545    /// the non-refundable portion taken out and put into `non_refundable_balance`.
9546    #[prost(uint64, optional, tag = "1")]
9547    pub total_object_storage_rebates: ::core::option::Option<u64>,
9548    /// Represents any remaining inflow of the storage fund that should not
9549    /// be taken out of the fund.
9550    #[prost(uint64, optional, tag = "2")]
9551    pub non_refundable_balance: ::core::option::Option<u64>,
9552}
9553#[non_exhaustive]
9554#[derive(Clone, PartialEq, ::prost::Message)]
9555pub struct ValidatorSet {
9556    /// Total amount of stake from all active validators at the beginning of the epoch.
9557    /// Written only once per epoch, in `advance_epoch` function.
9558    #[prost(uint64, optional, tag = "1")]
9559    pub total_stake: ::core::option::Option<u64>,
9560    /// The current list of active validators.
9561    #[prost(message, repeated, tag = "2")]
9562    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
9563    /// List of new validator candidates added during the current epoch.
9564    /// They will be processed at the end of the epoch.
9565    ///
9566    /// key: u64 (index), value: 0x3::validator::Validator
9567    #[prost(message, optional, tag = "3")]
9568    pub pending_active_validators: ::core::option::Option<MoveTable>,
9569    /// Removal requests from the validators. Each element is an index
9570    /// pointing to `active_validators`.
9571    #[prost(uint64, repeated, tag = "4")]
9572    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
9573    /// Mappings from staking pool's ID to the sui address of a validator.
9574    ///
9575    /// key: address (staking pool Id), value: address (sui address of the validator)
9576    #[prost(message, optional, tag = "5")]
9577    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
9578    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
9579    /// When a validator is deactivated the validator is removed from `active_validators` it
9580    /// is added to this table so that stakers can continue to withdraw their stake from it.
9581    ///
9582    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
9583    #[prost(message, optional, tag = "6")]
9584    pub inactive_validators: ::core::option::Option<MoveTable>,
9585    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
9586    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
9587    /// validator.
9588    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
9589    /// officially add them to the active validator set `active_validators` next epoch.
9590    ///
9591    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
9592    #[prost(message, optional, tag = "7")]
9593    pub validator_candidates: ::core::option::Option<MoveTable>,
9594    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
9595    #[prost(btree_map = "string, uint64", tag = "8")]
9596    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
9597        ::prost::alloc::string::String,
9598        u64,
9599    >,
9600    /// Any extra fields that's not defined statically.
9601    #[prost(message, optional, tag = "9")]
9602    pub extra_fields: ::core::option::Option<MoveTable>,
9603}
9604/// Definition of a Validator in the system contracts
9605///
9606/// Note: fields of ValidatorMetadata are flattened into this type
9607#[non_exhaustive]
9608#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9609pub struct Validator {
9610    /// A unique human-readable name of this validator.
9611    #[prost(string, optional, tag = "1")]
9612    pub name: ::core::option::Option<::prost::alloc::string::String>,
9613    /// The Sui Address of the validator. This is the sender that created the Validator object,
9614    /// and also the address to send validator/coins to during withdraws.
9615    #[prost(string, optional, tag = "2")]
9616    pub address: ::core::option::Option<::prost::alloc::string::String>,
9617    #[prost(string, optional, tag = "3")]
9618    pub description: ::core::option::Option<::prost::alloc::string::String>,
9619    #[prost(string, optional, tag = "4")]
9620    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
9621    #[prost(string, optional, tag = "5")]
9622    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
9623    /// The public key bytes corresponding to the private key that the validator
9624    /// holds to sign transactions. For now, this is the same as AuthorityName.
9625    #[prost(bytes = "bytes", optional, tag = "7")]
9626    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9627    /// This is a proof that the validator has ownership of the protocol private key
9628    #[prost(bytes = "bytes", optional, tag = "8")]
9629    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
9630    /// The public key bytes corresponding to the private key that the validator
9631    /// uses to establish TLS connections
9632    #[prost(bytes = "bytes", optional, tag = "10")]
9633    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9634    /// The public key bytes corresponding to the Narwhal Worker
9635    #[prost(bytes = "bytes", optional, tag = "12")]
9636    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9637    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
9638    #[prost(string, optional, tag = "13")]
9639    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
9640    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
9641    #[prost(string, optional, tag = "14")]
9642    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
9643    /// The address of the narwhal primary
9644    #[prost(string, optional, tag = "15")]
9645    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
9646    /// The address of the narwhal worker
9647    #[prost(string, optional, tag = "16")]
9648    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
9649    #[prost(bytes = "bytes", optional, tag = "18")]
9650    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9651    #[prost(bytes = "bytes", optional, tag = "19")]
9652    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
9653    #[prost(bytes = "bytes", optional, tag = "21")]
9654    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9655    #[prost(bytes = "bytes", optional, tag = "23")]
9656    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
9657    #[prost(string, optional, tag = "24")]
9658    pub next_epoch_network_address: ::core::option::Option<
9659        ::prost::alloc::string::String,
9660    >,
9661    #[prost(string, optional, tag = "25")]
9662    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
9663    #[prost(string, optional, tag = "26")]
9664    pub next_epoch_primary_address: ::core::option::Option<
9665        ::prost::alloc::string::String,
9666    >,
9667    #[prost(string, optional, tag = "27")]
9668    pub next_epoch_worker_address: ::core::option::Option<
9669        ::prost::alloc::string::String,
9670    >,
9671    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
9672    #[prost(message, optional, tag = "28")]
9673    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
9674    /// The voting power of this validator, which might be different from its
9675    /// stake amount.
9676    #[prost(uint64, optional, tag = "29")]
9677    pub voting_power: ::core::option::Option<u64>,
9678    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
9679    #[prost(string, optional, tag = "30")]
9680    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
9681    /// Gas price quote, updated only at end of epoch.
9682    #[prost(uint64, optional, tag = "31")]
9683    pub gas_price: ::core::option::Option<u64>,
9684    /// Staking pool for this validator.
9685    #[prost(message, optional, tag = "32")]
9686    pub staking_pool: ::core::option::Option<StakingPool>,
9687    /// Commission rate of the validator, in basis point.
9688    #[prost(uint64, optional, tag = "33")]
9689    pub commission_rate: ::core::option::Option<u64>,
9690    /// Total amount of stake that would be active in the next epoch.
9691    #[prost(uint64, optional, tag = "34")]
9692    pub next_epoch_stake: ::core::option::Option<u64>,
9693    /// This validator's gas price quote for the next epoch.
9694    #[prost(uint64, optional, tag = "35")]
9695    pub next_epoch_gas_price: ::core::option::Option<u64>,
9696    /// The commission rate of the validator starting the next epoch, in basis point.
9697    #[prost(uint64, optional, tag = "36")]
9698    pub next_epoch_commission_rate: ::core::option::Option<u64>,
9699    /// Any extra fields that's not defined statically.
9700    #[prost(message, optional, tag = "37")]
9701    pub extra_fields: ::core::option::Option<MoveTable>,
9702}
9703/// A staking pool embedded in each validator struct in the system state object.
9704#[non_exhaustive]
9705#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9706pub struct StakingPool {
9707    /// UID of the StakingPool object
9708    #[prost(string, optional, tag = "1")]
9709    pub id: ::core::option::Option<::prost::alloc::string::String>,
9710    /// The epoch at which this pool became active.
9711    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
9712    #[prost(uint64, optional, tag = "2")]
9713    pub activation_epoch: ::core::option::Option<u64>,
9714    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
9715    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
9716    #[prost(uint64, optional, tag = "3")]
9717    pub deactivation_epoch: ::core::option::Option<u64>,
9718    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
9719    /// in the `StakedSui` object, updated at epoch boundaries.
9720    #[prost(uint64, optional, tag = "4")]
9721    pub sui_balance: ::core::option::Option<u64>,
9722    /// The epoch stake rewards will be added here at the end of each epoch.
9723    #[prost(uint64, optional, tag = "5")]
9724    pub rewards_pool: ::core::option::Option<u64>,
9725    /// Total number of pool tokens issued by the pool.
9726    #[prost(uint64, optional, tag = "6")]
9727    pub pool_token_balance: ::core::option::Option<u64>,
9728    /// Exchange rate history of previous epochs.
9729    ///
9730    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
9731    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
9732    ///
9733    /// key: u64 (epoch number), value: PoolTokenExchangeRate
9734    #[prost(message, optional, tag = "7")]
9735    pub exchange_rates: ::core::option::Option<MoveTable>,
9736    /// Pending stake amount for this epoch, emptied at epoch boundaries.
9737    #[prost(uint64, optional, tag = "8")]
9738    pub pending_stake: ::core::option::Option<u64>,
9739    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
9740    /// This includes both the principal and rewards SUI withdrawn.
9741    #[prost(uint64, optional, tag = "9")]
9742    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
9743    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
9744    #[prost(uint64, optional, tag = "10")]
9745    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
9746    /// Any extra fields that's not defined statically.
9747    #[prost(message, optional, tag = "11")]
9748    pub extra_fields: ::core::option::Option<MoveTable>,
9749}
9750/// A transaction.
9751#[non_exhaustive]
9752#[derive(Clone, PartialEq, ::prost::Message)]
9753pub struct Transaction {
9754    /// This Transaction serialized as BCS.
9755    #[prost(message, optional, tag = "1")]
9756    pub bcs: ::core::option::Option<Bcs>,
9757    /// The digest of this Transaction.
9758    #[prost(string, optional, tag = "2")]
9759    pub digest: ::core::option::Option<::prost::alloc::string::String>,
9760    /// Version of this Transaction.
9761    #[prost(int32, optional, tag = "3")]
9762    pub version: ::core::option::Option<i32>,
9763    #[prost(message, optional, tag = "4")]
9764    pub kind: ::core::option::Option<TransactionKind>,
9765    #[prost(string, optional, tag = "5")]
9766    pub sender: ::core::option::Option<::prost::alloc::string::String>,
9767    #[prost(message, optional, tag = "6")]
9768    pub gas_payment: ::core::option::Option<GasPayment>,
9769    #[prost(message, optional, tag = "7")]
9770    pub expiration: ::core::option::Option<TransactionExpiration>,
9771}
9772/// Payment information for executing a transaction.
9773#[non_exhaustive]
9774#[derive(Clone, PartialEq, ::prost::Message)]
9775pub struct GasPayment {
9776    /// Set of gas objects to use for payment.
9777    #[prost(message, repeated, tag = "1")]
9778    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
9779    /// Owner of the gas objects, either the transaction sender or a sponsor.
9780    #[prost(string, optional, tag = "2")]
9781    pub owner: ::core::option::Option<::prost::alloc::string::String>,
9782    /// Gas unit price to use when charging for computation.
9783    ///
9784    /// Must be greater than or equal to the network's current RGP (reference gas price).
9785    #[prost(uint64, optional, tag = "3")]
9786    pub price: ::core::option::Option<u64>,
9787    /// Total budget willing to spend for the execution of a transaction.
9788    #[prost(uint64, optional, tag = "4")]
9789    pub budget: ::core::option::Option<u64>,
9790}
9791/// A TTL for a transaction.
9792#[non_exhaustive]
9793#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9794pub struct TransactionExpiration {
9795    #[prost(
9796        enumeration = "transaction_expiration::TransactionExpirationKind",
9797        optional,
9798        tag = "1"
9799    )]
9800    pub kind: ::core::option::Option<i32>,
9801    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
9802    /// must be greater than or equal to the current epoch for a transaction to execute.
9803    #[prost(uint64, optional, tag = "2")]
9804    pub epoch: ::core::option::Option<u64>,
9805    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
9806    /// must be less than or equal to the current epoch for a transaction to execute.
9807    #[prost(uint64, optional, tag = "3")]
9808    pub min_epoch: ::core::option::Option<u64>,
9809    /// Minimal UNIX timestamp in which a transaction can be executed. The
9810    /// provided minimal timestamp must be less than or equal to the current
9811    /// clock.
9812    #[prost(message, optional, tag = "4")]
9813    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
9814    /// Maximum UNIX timestamp in which a transaction can be executed. The
9815    /// provided maximal timestamp must be greater than or equal to the current
9816    /// clock.
9817    #[prost(message, optional, tag = "5")]
9818    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
9819    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
9820    #[prost(string, optional, tag = "6")]
9821    pub chain: ::core::option::Option<::prost::alloc::string::String>,
9822    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
9823    #[prost(uint32, optional, tag = "7")]
9824    pub nonce: ::core::option::Option<u32>,
9825    /// The validators allowed to propose this transaction in consensus. Only set when `kind`
9826    /// is `VALIDITY`. Leave unset to let any validator propose the transaction.
9827    #[prost(message, optional, tag = "8")]
9828    pub allowed_proposers: ::core::option::Option<AllowedProposers>,
9829}
9830/// Nested message and enum types in `TransactionExpiration`.
9831pub mod transaction_expiration {
9832    #[non_exhaustive]
9833    #[derive(
9834        Clone,
9835        Copy,
9836        Debug,
9837        PartialEq,
9838        Eq,
9839        Hash,
9840        PartialOrd,
9841        Ord,
9842        ::prost::Enumeration
9843    )]
9844    #[repr(i32)]
9845    pub enum TransactionExpirationKind {
9846        Unknown = 0,
9847        /// The transaction has no expiration.
9848        None = 1,
9849        /// Validators won't sign and execute transaction unless the expiration epoch
9850        /// is greater than or equal to the current epoch.
9851        Epoch = 2,
9852        /// This variant enables gas payments from address balances.
9853        ///
9854        /// When transactions use address balances for gas payment instead of explicit gas coins,
9855        /// we lose the natural transaction uniqueness and replay prevention that comes from
9856        /// mutation of gas coin objects.
9857        ///
9858        /// By bounding expiration and providing a nonce, validators must only retain
9859        /// executed digests for the maximum possible expiry range to differentiate
9860        /// retries from unique transactions with otherwise identical inputs.
9861        ValidDuring = 3,
9862        /// Everything in VALID_DURING, plus a restriction on which validators may
9863        /// propose the transaction in consensus.
9864        Validity = 4,
9865    }
9866    impl TransactionExpirationKind {
9867        /// String value of the enum field names used in the ProtoBuf definition.
9868        ///
9869        /// The values are not transformed in any way and thus are considered stable
9870        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9871        pub fn as_str_name(&self) -> &'static str {
9872            match self {
9873                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
9874                Self::None => "NONE",
9875                Self::Epoch => "EPOCH",
9876                Self::ValidDuring => "VALID_DURING",
9877                Self::Validity => "VALIDITY",
9878            }
9879        }
9880        /// Creates an enum from field names used in the ProtoBuf definition.
9881        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9882            match value {
9883                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
9884                "NONE" => Some(Self::None),
9885                "EPOCH" => Some(Self::Epoch),
9886                "VALID_DURING" => Some(Self::ValidDuring),
9887                "VALIDITY" => Some(Self::Validity),
9888                _ => None,
9889            }
9890        }
9891    }
9892}
9893/// The validators allowed to propose a transaction in consensus.
9894///
9895/// Proposal by any other validator is byzantine behavior and invalidates the whole block.
9896#[non_exhaustive]
9897#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9898pub struct AllowedProposers {
9899    /// The epoch whose committee `proposers` indexes into.
9900    ///
9901    /// Committee indices are only meaningful against one committee, so a set recorded for any
9902    /// other epoch is ignored and the transaction is treated as naming no proposers.
9903    #[prost(uint64, optional, tag = "1")]
9904    pub epoch: ::core::option::Option<u64>,
9905    /// Committee indices of the allowed proposers, strictly increasing and non-empty.
9906    ///
9907    /// An empty list names no validator and is rejected; omit `allowed_proposers` entirely to
9908    /// let any validator propose the transaction.
9909    #[prost(uint32, repeated, tag = "2")]
9910    pub proposers: ::prost::alloc::vec::Vec<u32>,
9911}
9912/// Transaction type.
9913#[non_exhaustive]
9914#[derive(Clone, PartialEq, ::prost::Message)]
9915pub struct TransactionKind {
9916    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
9917    pub kind: ::core::option::Option<i32>,
9918    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
9919    pub data: ::core::option::Option<transaction_kind::Data>,
9920}
9921/// Nested message and enum types in `TransactionKind`.
9922pub mod transaction_kind {
9923    #[non_exhaustive]
9924    #[derive(
9925        Clone,
9926        Copy,
9927        Debug,
9928        PartialEq,
9929        Eq,
9930        Hash,
9931        PartialOrd,
9932        Ord,
9933        ::prost::Enumeration
9934    )]
9935    #[repr(i32)]
9936    pub enum Kind {
9937        Unknown = 0,
9938        /// A user transaction comprised of a list of native commands and Move calls.
9939        ProgrammableTransaction = 1,
9940        /// System transaction used to end an epoch.
9941        ///
9942        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
9943        /// `EndOfEpochTransaction`).
9944        ChangeEpoch = 2,
9945        /// Transaction used to initialize the chain state.
9946        ///
9947        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
9948        /// executed on the chain.
9949        Genesis = 3,
9950        /// V1 consensus commit update.
9951        ConsensusCommitPrologueV1 = 4,
9952        /// Update set of valid JWKs used for zklogin.
9953        AuthenticatorStateUpdate = 5,
9954        /// Set of operations to run at the end of the epoch to close out the current epoch and start
9955        /// the next one.
9956        EndOfEpoch = 6,
9957        /// Randomness update.
9958        RandomnessStateUpdate = 7,
9959        /// V2 consensus commit update.
9960        ConsensusCommitPrologueV2 = 8,
9961        /// V3 consensus commit update.
9962        ConsensusCommitPrologueV3 = 9,
9963        /// V4 consensus commit update.
9964        ConsensusCommitPrologueV4 = 10,
9965        /// A system transaction comprised of a list of native commands and Move calls.
9966        ProgrammableSystemTransaction = 11,
9967    }
9968    impl Kind {
9969        /// String value of the enum field names used in the ProtoBuf definition.
9970        ///
9971        /// The values are not transformed in any way and thus are considered stable
9972        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9973        pub fn as_str_name(&self) -> &'static str {
9974            match self {
9975                Self::Unknown => "KIND_UNKNOWN",
9976                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
9977                Self::ChangeEpoch => "CHANGE_EPOCH",
9978                Self::Genesis => "GENESIS",
9979                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
9980                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
9981                Self::EndOfEpoch => "END_OF_EPOCH",
9982                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
9983                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
9984                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
9985                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
9986                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
9987            }
9988        }
9989        /// Creates an enum from field names used in the ProtoBuf definition.
9990        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9991            match value {
9992                "KIND_UNKNOWN" => Some(Self::Unknown),
9993                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
9994                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
9995                "GENESIS" => Some(Self::Genesis),
9996                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
9997                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
9998                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
9999                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
10000                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
10001                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
10002                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
10003                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
10004                    Some(Self::ProgrammableSystemTransaction)
10005                }
10006                _ => None,
10007            }
10008        }
10009    }
10010    #[non_exhaustive]
10011    #[derive(Clone, PartialEq, ::prost::Oneof)]
10012    pub enum Data {
10013        /// A transaction comprised of a list of native commands and Move calls.
10014        #[prost(message, tag = "2")]
10015        ProgrammableTransaction(super::ProgrammableTransaction),
10016        /// System transaction used to end an epoch.
10017        ///
10018        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
10019        /// `EndOfEpochTransaction`).
10020        #[prost(message, tag = "3")]
10021        ChangeEpoch(super::ChangeEpoch),
10022        /// Transaction used to initialize the chain state.
10023        ///
10024        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
10025        /// executed on the chain.
10026        #[prost(message, tag = "4")]
10027        Genesis(super::GenesisTransaction),
10028        /// consensus commit update info
10029        #[prost(message, tag = "5")]
10030        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
10031        /// Update set of valid JWKs used for zklogin.
10032        #[prost(message, tag = "6")]
10033        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
10034        /// Set of operations to run at the end of the epoch to close out the current epoch and start
10035        /// the next one.
10036        #[prost(message, tag = "7")]
10037        EndOfEpoch(super::EndOfEpochTransaction),
10038        /// Randomness update.
10039        #[prost(message, tag = "8")]
10040        RandomnessStateUpdate(super::RandomnessStateUpdate),
10041    }
10042}
10043/// A user transaction.
10044///
10045/// Contains a series of native commands and Move calls where the results of one command can be
10046/// used in future commands.
10047#[non_exhaustive]
10048#[derive(Clone, PartialEq, ::prost::Message)]
10049pub struct ProgrammableTransaction {
10050    /// Input objects or primitive values.
10051    #[prost(message, repeated, tag = "1")]
10052    pub inputs: ::prost::alloc::vec::Vec<Input>,
10053    /// The commands to be executed sequentially. A failure in any command
10054    /// results in the failure of the entire transaction.
10055    #[prost(message, repeated, tag = "2")]
10056    pub commands: ::prost::alloc::vec::Vec<Command>,
10057}
10058/// A single command in a programmable transaction.
10059#[non_exhaustive]
10060#[derive(Clone, PartialEq, ::prost::Message)]
10061pub struct Command {
10062    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
10063    pub command: ::core::option::Option<command::Command>,
10064}
10065/// Nested message and enum types in `Command`.
10066pub mod command {
10067    #[non_exhaustive]
10068    #[derive(Clone, PartialEq, ::prost::Oneof)]
10069    pub enum Command {
10070        /// A call to either an entry or a public Move function.
10071        #[prost(message, tag = "1")]
10072        MoveCall(super::MoveCall),
10073        /// `(Vec<forall T:key+store. T>, address)`
10074        /// It sends n-objects to the specified address. These objects must have store
10075        /// (public transfer) and either the previous owner must be an address or the object must
10076        /// be newly created.
10077        #[prost(message, tag = "2")]
10078        TransferObjects(super::TransferObjects),
10079        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
10080        /// It splits off some amounts into new coins with those amounts.
10081        #[prost(message, tag = "3")]
10082        SplitCoins(super::SplitCoins),
10083        /// `(&mut Coin<T>, Vec<Coin<T>>)`
10084        /// It merges n-coins into the first coin.
10085        #[prost(message, tag = "4")]
10086        MergeCoins(super::MergeCoins),
10087        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
10088        /// dependencies to link against on chain.
10089        #[prost(message, tag = "5")]
10090        Publish(super::Publish),
10091        /// `forall T: Vec<T> -> vector<T>`
10092        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
10093        /// the type tag must be specified.
10094        #[prost(message, tag = "6")]
10095        MakeMoveVector(super::MakeMoveVector),
10096        /// Upgrades a Move package.
10097        /// Takes (in order):
10098        ///
10099        /// 1. A vector of serialized modules for the package.
10100        /// 1. A vector of object ids for the transitive dependencies of the new package.
10101        /// 1. The object ID of the package being upgraded.
10102        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
10103        ///    programmable transaction.
10104        #[prost(message, tag = "7")]
10105        Upgrade(super::Upgrade),
10106    }
10107}
10108/// Command to call a Move function.
10109///
10110/// Functions that can be called by a `MoveCall` command are those that have a function signature
10111/// that is either `entry` or `public` (which don't have a reference return type).
10112#[non_exhaustive]
10113#[derive(Clone, PartialEq, ::prost::Message)]
10114pub struct MoveCall {
10115    /// The package containing the module and function.
10116    #[prost(string, optional, tag = "1")]
10117    pub package: ::core::option::Option<::prost::alloc::string::String>,
10118    /// The specific module in the package containing the function.
10119    #[prost(string, optional, tag = "2")]
10120    pub module: ::core::option::Option<::prost::alloc::string::String>,
10121    /// The function to be called.
10122    #[prost(string, optional, tag = "3")]
10123    pub function: ::core::option::Option<::prost::alloc::string::String>,
10124    /// The type arguments to the function.
10125    #[prost(string, repeated, tag = "4")]
10126    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10127    /// The arguments to the function.
10128    #[prost(message, repeated, tag = "5")]
10129    pub arguments: ::prost::alloc::vec::Vec<Argument>,
10130}
10131/// Command to transfer ownership of a set of objects to an address.
10132#[non_exhaustive]
10133#[derive(Clone, PartialEq, ::prost::Message)]
10134pub struct TransferObjects {
10135    /// Set of objects to transfer.
10136    #[prost(message, repeated, tag = "1")]
10137    pub objects: ::prost::alloc::vec::Vec<Argument>,
10138    /// The address to transfer ownership to.
10139    #[prost(message, optional, tag = "2")]
10140    pub address: ::core::option::Option<Argument>,
10141}
10142/// Command to split a single coin object into multiple coins.
10143#[non_exhaustive]
10144#[derive(Clone, PartialEq, ::prost::Message)]
10145pub struct SplitCoins {
10146    /// The coin to split.
10147    #[prost(message, optional, tag = "1")]
10148    pub coin: ::core::option::Option<Argument>,
10149    /// The amounts to split off.
10150    #[prost(message, repeated, tag = "2")]
10151    pub amounts: ::prost::alloc::vec::Vec<Argument>,
10152}
10153/// Command to merge multiple coins of the same type into a single coin.
10154#[non_exhaustive]
10155#[derive(Clone, PartialEq, ::prost::Message)]
10156pub struct MergeCoins {
10157    /// Coin to merge coins into.
10158    #[prost(message, optional, tag = "1")]
10159    pub coin: ::core::option::Option<Argument>,
10160    /// Set of coins to merge into `coin`.
10161    ///
10162    /// All listed coins must be of the same type and be the same type as `coin`
10163    #[prost(message, repeated, tag = "2")]
10164    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
10165}
10166/// Command to publish a new Move package.
10167#[non_exhaustive]
10168#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10169pub struct Publish {
10170    /// The serialized Move modules.
10171    #[prost(bytes = "bytes", repeated, tag = "1")]
10172    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10173    /// Set of packages that the to-be published package depends on.
10174    #[prost(string, repeated, tag = "2")]
10175    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10176}
10177/// Command to build a Move vector out of a set of individual elements.
10178#[non_exhaustive]
10179#[derive(Clone, PartialEq, ::prost::Message)]
10180pub struct MakeMoveVector {
10181    /// Type of the individual elements.
10182    ///
10183    /// This is required to be set when the type can't be inferred, for example when the set of
10184    /// provided arguments are all pure input values.
10185    #[prost(string, optional, tag = "1")]
10186    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
10187    /// The set individual elements to build the vector with.
10188    #[prost(message, repeated, tag = "2")]
10189    pub elements: ::prost::alloc::vec::Vec<Argument>,
10190}
10191/// Command to upgrade an already published package.
10192#[non_exhaustive]
10193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10194pub struct Upgrade {
10195    /// The serialized Move modules.
10196    #[prost(bytes = "bytes", repeated, tag = "1")]
10197    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10198    /// Set of packages that the to-be published package depends on.
10199    #[prost(string, repeated, tag = "2")]
10200    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10201    /// Package ID of the package to upgrade.
10202    #[prost(string, optional, tag = "3")]
10203    pub package: ::core::option::Option<::prost::alloc::string::String>,
10204    /// Ticket authorizing the upgrade.
10205    #[prost(message, optional, tag = "4")]
10206    pub ticket: ::core::option::Option<Argument>,
10207}
10208/// Randomness update.
10209#[non_exhaustive]
10210#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10211pub struct RandomnessStateUpdate {
10212    /// Epoch of the randomness state update transaction.
10213    #[prost(uint64, optional, tag = "1")]
10214    pub epoch: ::core::option::Option<u64>,
10215    /// Randomness round of the update.
10216    #[prost(uint64, optional, tag = "2")]
10217    pub randomness_round: ::core::option::Option<u64>,
10218    /// Updated random bytes.
10219    #[prost(bytes = "bytes", optional, tag = "3")]
10220    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
10221    /// The initial version of the randomness object that it was shared at.
10222    #[prost(uint64, optional, tag = "4")]
10223    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
10224}
10225/// System transaction used to change the epoch.
10226#[non_exhaustive]
10227#[derive(Clone, PartialEq, ::prost::Message)]
10228pub struct ChangeEpoch {
10229    /// The next (to become) epoch ID.
10230    #[prost(uint64, optional, tag = "1")]
10231    pub epoch: ::core::option::Option<u64>,
10232    /// The protocol version in effect in the new epoch.
10233    #[prost(uint64, optional, tag = "2")]
10234    pub protocol_version: ::core::option::Option<u64>,
10235    /// The total amount of gas charged for storage during the epoch.
10236    #[prost(uint64, optional, tag = "3")]
10237    pub storage_charge: ::core::option::Option<u64>,
10238    /// The total amount of gas charged for computation during the epoch.
10239    #[prost(uint64, optional, tag = "4")]
10240    pub computation_charge: ::core::option::Option<u64>,
10241    /// The amount of storage rebate refunded to the txn senders.
10242    #[prost(uint64, optional, tag = "5")]
10243    pub storage_rebate: ::core::option::Option<u64>,
10244    /// The non-refundable storage fee.
10245    #[prost(uint64, optional, tag = "6")]
10246    pub non_refundable_storage_fee: ::core::option::Option<u64>,
10247    /// Unix timestamp when epoch started.
10248    #[prost(message, optional, tag = "7")]
10249    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
10250    /// System packages (specifically framework and Move stdlib) that are written before the new
10251    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
10252    /// the validator must write out the following modules.  Modules are provided with the version they
10253    /// will be upgraded to, their modules in serialized form (which include their package ID), and
10254    /// a list of their transitive dependencies.
10255    #[prost(message, repeated, tag = "8")]
10256    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
10257}
10258/// System package.
10259#[non_exhaustive]
10260#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10261pub struct SystemPackage {
10262    /// Version of the package.
10263    #[prost(uint64, optional, tag = "1")]
10264    pub version: ::core::option::Option<u64>,
10265    /// Move modules.
10266    #[prost(bytes = "bytes", repeated, tag = "2")]
10267    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
10268    /// Package dependencies.
10269    #[prost(string, repeated, tag = "3")]
10270    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
10271}
10272/// The genesis transaction.
10273#[non_exhaustive]
10274#[derive(Clone, PartialEq, ::prost::Message)]
10275pub struct GenesisTransaction {
10276    /// Set of genesis objects.
10277    #[prost(message, repeated, tag = "1")]
10278    pub objects: ::prost::alloc::vec::Vec<Object>,
10279}
10280/// Consensus commit prologue system transaction.
10281///
10282/// This message can represent V1, V2, and V3 prologue types.
10283#[non_exhaustive]
10284#[derive(Clone, PartialEq, ::prost::Message)]
10285pub struct ConsensusCommitPrologue {
10286    /// Epoch of the commit prologue transaction.
10287    ///
10288    /// Present in V1, V2, V3, V4.
10289    #[prost(uint64, optional, tag = "1")]
10290    pub epoch: ::core::option::Option<u64>,
10291    /// Consensus round of the commit.
10292    ///
10293    /// Present in V1, V2, V3, V4.
10294    #[prost(uint64, optional, tag = "2")]
10295    pub round: ::core::option::Option<u64>,
10296    /// Unix timestamp from consensus.
10297    ///
10298    /// Present in V1, V2, V3, V4.
10299    #[prost(message, optional, tag = "3")]
10300    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
10301    /// Digest of consensus output.
10302    ///
10303    /// Present in V2, V3, V4.
10304    #[prost(string, optional, tag = "4")]
10305    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
10306    /// The sub DAG index of the consensus commit. This field is populated if there
10307    /// are multiple consensus commits per round.
10308    ///
10309    /// Present in V3, V4.
10310    #[prost(uint64, optional, tag = "5")]
10311    pub sub_dag_index: ::core::option::Option<u64>,
10312    /// Stores consensus handler determined consensus object version assignments.
10313    ///
10314    /// Present in V3, V4.
10315    #[prost(message, optional, tag = "6")]
10316    pub consensus_determined_version_assignments: ::core::option::Option<
10317        ConsensusDeterminedVersionAssignments,
10318    >,
10319    /// Digest of any additional state computed by the consensus handler.
10320    /// Used to detect forking bugs as early as possible.
10321    ///
10322    /// Present in V4.
10323    #[prost(string, optional, tag = "7")]
10324    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
10325}
10326/// Object version assignment from consensus.
10327#[non_exhaustive]
10328#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10329pub struct VersionAssignment {
10330    /// `ObjectId` of the object.
10331    #[prost(string, optional, tag = "1")]
10332    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
10333    /// start version of the consensus stream for this object
10334    #[prost(uint64, optional, tag = "2")]
10335    pub start_version: ::core::option::Option<u64>,
10336    /// Assigned version.
10337    #[prost(uint64, optional, tag = "3")]
10338    pub version: ::core::option::Option<u64>,
10339}
10340/// A transaction that was canceled.
10341#[non_exhaustive]
10342#[derive(Clone, PartialEq, ::prost::Message)]
10343pub struct CanceledTransaction {
10344    /// Digest of the canceled transaction.
10345    #[prost(string, optional, tag = "1")]
10346    pub digest: ::core::option::Option<::prost::alloc::string::String>,
10347    /// List of object version assignments.
10348    #[prost(message, repeated, tag = "2")]
10349    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
10350}
10351/// Version assignments performed by consensus.
10352#[non_exhaustive]
10353#[derive(Clone, PartialEq, ::prost::Message)]
10354pub struct ConsensusDeterminedVersionAssignments {
10355    /// Version of this message
10356    #[prost(int32, optional, tag = "1")]
10357    pub version: ::core::option::Option<i32>,
10358    /// Canceled transaction version assignment.
10359    #[prost(message, repeated, tag = "3")]
10360    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
10361}
10362/// Update the set of valid JWKs.
10363#[non_exhaustive]
10364#[derive(Clone, PartialEq, ::prost::Message)]
10365pub struct AuthenticatorStateUpdate {
10366    /// Epoch of the authenticator state update transaction.
10367    #[prost(uint64, optional, tag = "1")]
10368    pub epoch: ::core::option::Option<u64>,
10369    /// Consensus round of the authenticator state update.
10370    #[prost(uint64, optional, tag = "2")]
10371    pub round: ::core::option::Option<u64>,
10372    /// Newly active JWKs.
10373    #[prost(message, repeated, tag = "3")]
10374    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
10375    /// The initial version of the authenticator object that it was shared at.
10376    #[prost(uint64, optional, tag = "4")]
10377    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
10378}
10379/// A new JWK.
10380#[non_exhaustive]
10381#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10382pub struct ActiveJwk {
10383    /// Identifier used to uniquely identify a JWK.
10384    #[prost(message, optional, tag = "1")]
10385    pub id: ::core::option::Option<JwkId>,
10386    /// The JWK.
10387    #[prost(message, optional, tag = "2")]
10388    pub jwk: ::core::option::Option<Jwk>,
10389    /// Most recent epoch in which the JWK was validated.
10390    #[prost(uint64, optional, tag = "3")]
10391    pub epoch: ::core::option::Option<u64>,
10392}
10393/// Set of operations run at the end of the epoch to close out the current epoch
10394/// and start the next one.
10395#[non_exhaustive]
10396#[derive(Clone, PartialEq, ::prost::Message)]
10397pub struct EndOfEpochTransaction {
10398    #[prost(message, repeated, tag = "1")]
10399    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
10400}
10401/// Operation run at the end of an epoch.
10402#[non_exhaustive]
10403#[derive(Clone, PartialEq, ::prost::Message)]
10404pub struct EndOfEpochTransactionKind {
10405    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
10406    pub kind: ::core::option::Option<i32>,
10407    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
10408    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
10409}
10410/// Nested message and enum types in `EndOfEpochTransactionKind`.
10411pub mod end_of_epoch_transaction_kind {
10412    #[non_exhaustive]
10413    #[derive(
10414        Clone,
10415        Copy,
10416        Debug,
10417        PartialEq,
10418        Eq,
10419        Hash,
10420        PartialOrd,
10421        Ord,
10422        ::prost::Enumeration
10423    )]
10424    #[repr(i32)]
10425    pub enum Kind {
10426        Unknown = 0,
10427        /// End the epoch and start the next one.
10428        ChangeEpoch = 1,
10429        /// Create and initialize the authenticator object used for zklogin.
10430        AuthenticatorStateCreate = 2,
10431        /// Expire JWKs used for zklogin.
10432        AuthenticatorStateExpire = 3,
10433        /// Create and initialize the randomness object.
10434        RandomnessStateCreate = 4,
10435        /// Create and initialize the deny list object.
10436        DenyListStateCreate = 5,
10437        /// Create and initialize the bridge object.
10438        BridgeStateCreate = 6,
10439        /// Initialize the bridge committee.
10440        BridgeCommitteeInit = 7,
10441        /// Execution time observations from the committee to preserve cross epoch
10442        StoreExecutionTimeObservations = 8,
10443        /// Create the accumulator root object.
10444        AccumulatorRootCreate = 9,
10445        /// Create and initialize the Coin Registry object.
10446        CoinRegistryCreate = 10,
10447        /// Create and initialize the Display Registry object.
10448        DisplayRegistryCreate = 11,
10449        /// Create and initialize the Address Alias State object.
10450        AddressAliasStateCreate = 12,
10451        /// Write the end-of-epoch-computed storage cost for accumulator objects.
10452        WriteAccumulatorStorageCost = 13,
10453        /// Create and initialize the Forwarding Address Registry object.
10454        ForwardingAddressRegistryCreate = 14,
10455        /// Create and initialize the coin regulation Freeze List object.
10456        FreezeListCreate = 15,
10457    }
10458    impl Kind {
10459        /// String value of the enum field names used in the ProtoBuf definition.
10460        ///
10461        /// The values are not transformed in any way and thus are considered stable
10462        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
10463        pub fn as_str_name(&self) -> &'static str {
10464            match self {
10465                Self::Unknown => "KIND_UNKNOWN",
10466                Self::ChangeEpoch => "CHANGE_EPOCH",
10467                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
10468                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
10469                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
10470                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
10471                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
10472                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
10473                Self::StoreExecutionTimeObservations => {
10474                    "STORE_EXECUTION_TIME_OBSERVATIONS"
10475                }
10476                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
10477                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
10478                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
10479                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
10480                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
10481                Self::ForwardingAddressRegistryCreate => {
10482                    "FORWARDING_ADDRESS_REGISTRY_CREATE"
10483                }
10484                Self::FreezeListCreate => "FREEZE_LIST_CREATE",
10485            }
10486        }
10487        /// Creates an enum from field names used in the ProtoBuf definition.
10488        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10489            match value {
10490                "KIND_UNKNOWN" => Some(Self::Unknown),
10491                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
10492                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
10493                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
10494                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
10495                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
10496                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
10497                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
10498                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
10499                    Some(Self::StoreExecutionTimeObservations)
10500                }
10501                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
10502                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
10503                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
10504                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
10505                "WRITE_ACCUMULATOR_STORAGE_COST" => {
10506                    Some(Self::WriteAccumulatorStorageCost)
10507                }
10508                "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
10509                    Some(Self::ForwardingAddressRegistryCreate)
10510                }
10511                "FREEZE_LIST_CREATE" => Some(Self::FreezeListCreate),
10512                _ => None,
10513            }
10514        }
10515    }
10516    #[non_exhaustive]
10517    #[derive(Clone, PartialEq, ::prost::Oneof)]
10518    pub enum Data {
10519        /// End the epoch and start the next one.
10520        #[prost(message, tag = "2")]
10521        ChangeEpoch(super::ChangeEpoch),
10522        /// Expire JWKs used for zklogin.
10523        #[prost(message, tag = "3")]
10524        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
10525        /// Execution time observations from the committee to preserve cross epoch
10526        #[prost(message, tag = "4")]
10527        ExecutionTimeObservations(super::ExecutionTimeObservations),
10528        /// ChainId used when initializing the bridge
10529        #[prost(string, tag = "5")]
10530        BridgeChainId(::prost::alloc::string::String),
10531        /// Start version of the Bridge object
10532        #[prost(uint64, tag = "6")]
10533        BridgeObjectVersion(u64),
10534        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
10535        #[prost(uint64, tag = "7")]
10536        StorageCost(u64),
10537    }
10538}
10539/// Expire old JWKs.
10540#[non_exhaustive]
10541#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
10542pub struct AuthenticatorStateExpire {
10543    /// Expire JWKs that have a lower epoch than this.
10544    #[prost(uint64, optional, tag = "1")]
10545    pub min_epoch: ::core::option::Option<u64>,
10546    /// The initial version of the authenticator object that it was shared at.
10547    #[prost(uint64, optional, tag = "2")]
10548    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
10549}
10550#[non_exhaustive]
10551#[derive(Clone, PartialEq, ::prost::Message)]
10552pub struct ExecutionTimeObservations {
10553    /// Version of this ExecutionTimeObservations
10554    #[prost(int32, optional, tag = "1")]
10555    pub version: ::core::option::Option<i32>,
10556    #[prost(message, repeated, tag = "2")]
10557    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
10558}
10559#[non_exhaustive]
10560#[derive(Clone, PartialEq, ::prost::Message)]
10561pub struct ExecutionTimeObservation {
10562    #[prost(
10563        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
10564        optional,
10565        tag = "1"
10566    )]
10567    pub kind: ::core::option::Option<i32>,
10568    #[prost(message, optional, tag = "2")]
10569    pub move_entry_point: ::core::option::Option<MoveCall>,
10570    #[prost(message, repeated, tag = "3")]
10571    pub validator_observations: ::prost::alloc::vec::Vec<
10572        ValidatorExecutionTimeObservation,
10573    >,
10574}
10575/// Nested message and enum types in `ExecutionTimeObservation`.
10576pub mod execution_time_observation {
10577    #[non_exhaustive]
10578    #[derive(
10579        Clone,
10580        Copy,
10581        Debug,
10582        PartialEq,
10583        Eq,
10584        Hash,
10585        PartialOrd,
10586        Ord,
10587        ::prost::Enumeration
10588    )]
10589    #[repr(i32)]
10590    pub enum ExecutionTimeObservationKind {
10591        Unknown = 0,
10592        MoveEntryPoint = 1,
10593        TransferObjects = 2,
10594        SplitCoins = 3,
10595        MergeCoins = 4,
10596        Publish = 5,
10597        MakeMoveVector = 6,
10598        Upgrade = 7,
10599    }
10600    impl ExecutionTimeObservationKind {
10601        /// String value of the enum field names used in the ProtoBuf definition.
10602        ///
10603        /// The values are not transformed in any way and thus are considered stable
10604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
10605        pub fn as_str_name(&self) -> &'static str {
10606            match self {
10607                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
10608                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
10609                Self::TransferObjects => "TRANSFER_OBJECTS",
10610                Self::SplitCoins => "SPLIT_COINS",
10611                Self::MergeCoins => "MERGE_COINS",
10612                Self::Publish => "PUBLISH",
10613                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
10614                Self::Upgrade => "UPGRADE",
10615            }
10616        }
10617        /// Creates an enum from field names used in the ProtoBuf definition.
10618        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10619            match value {
10620                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
10621                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
10622                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
10623                "SPLIT_COINS" => Some(Self::SplitCoins),
10624                "MERGE_COINS" => Some(Self::MergeCoins),
10625                "PUBLISH" => Some(Self::Publish),
10626                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
10627                "UPGRADE" => Some(Self::Upgrade),
10628                _ => None,
10629            }
10630        }
10631    }
10632}
10633#[non_exhaustive]
10634#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
10635pub struct ValidatorExecutionTimeObservation {
10636    /// Bls12381 public key of the validator
10637    #[prost(bytes = "bytes", optional, tag = "1")]
10638    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
10639    /// Duration of an execution observation
10640    #[prost(message, optional, tag = "2")]
10641    pub duration: ::core::option::Option<::prost_types::Duration>,
10642}
10643#[non_exhaustive]
10644#[derive(Clone, PartialEq, ::prost::Message)]
10645pub struct ExecuteTransactionRequest {
10646    /// The transaction to execute.
10647    #[prost(message, optional, tag = "1")]
10648    pub transaction: ::core::option::Option<Transaction>,
10649    /// Set of `UserSignature`s authorizing the execution of the provided
10650    /// transaction.
10651    #[prost(message, repeated, tag = "2")]
10652    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
10653    /// Mask specifying which fields to read.
10654    /// If no mask is specified, defaults to `effects.status,checkpoint`.
10655    #[prost(message, optional, tag = "3")]
10656    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
10657}
10658/// Response message for `NodeService.ExecuteTransaction`.
10659#[non_exhaustive]
10660#[derive(Clone, PartialEq, ::prost::Message)]
10661pub struct ExecuteTransactionResponse {
10662    #[prost(message, optional, tag = "1")]
10663    pub transaction: ::core::option::Option<ExecutedTransaction>,
10664}
10665#[non_exhaustive]
10666#[derive(Clone, PartialEq, ::prost::Message)]
10667pub struct SimulateTransactionRequest {
10668    #[prost(message, optional, tag = "1")]
10669    pub transaction: ::core::option::Option<Transaction>,
10670    /// Mask specifying which fields to read.
10671    #[prost(message, optional, tag = "2")]
10672    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
10673    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
10674    #[prost(
10675        enumeration = "simulate_transaction_request::TransactionChecks",
10676        optional,
10677        tag = "3"
10678    )]
10679    pub checks: ::core::option::Option<i32>,
10680    /// Perform gas selection based on a budget estimation and include the
10681    /// selected gas payment and budget in the response. If selection fails
10682    /// because the gas owner lacks enough SUI to cover the budget, the returned
10683    /// error carries a `google.rpc.ErrorInfo` with reason
10684    /// `INSUFFICIENT_GAS_BALANCE`, or `TRANSACTION_EXECUTION_FAILED` if the
10685    /// transaction also fails while estimating the budget (see `ErrorReason`).
10686    ///
10687    /// This option will be ignored if `checks` is `DISABLED`.
10688    #[prost(bool, optional, tag = "4")]
10689    pub do_gas_selection: ::core::option::Option<bool>,
10690}
10691/// Nested message and enum types in `SimulateTransactionRequest`.
10692pub mod simulate_transaction_request {
10693    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
10694    #[non_exhaustive]
10695    #[derive(
10696        Clone,
10697        Copy,
10698        Debug,
10699        PartialEq,
10700        Eq,
10701        Hash,
10702        PartialOrd,
10703        Ord,
10704        ::prost::Enumeration
10705    )]
10706    #[repr(i32)]
10707    pub enum TransactionChecks {
10708        Enabled = 0,
10709        Disabled = 1,
10710    }
10711    impl TransactionChecks {
10712        /// String value of the enum field names used in the ProtoBuf definition.
10713        ///
10714        /// The values are not transformed in any way and thus are considered stable
10715        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
10716        pub fn as_str_name(&self) -> &'static str {
10717            match self {
10718                Self::Enabled => "ENABLED",
10719                Self::Disabled => "DISABLED",
10720            }
10721        }
10722        /// Creates an enum from field names used in the ProtoBuf definition.
10723        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
10724            match value {
10725                "ENABLED" => Some(Self::Enabled),
10726                "DISABLED" => Some(Self::Disabled),
10727                _ => None,
10728            }
10729        }
10730    }
10731}
10732#[non_exhaustive]
10733#[derive(Clone, PartialEq, ::prost::Message)]
10734pub struct SimulateTransactionResponse {
10735    #[prost(message, optional, tag = "1")]
10736    pub transaction: ::core::option::Option<ExecutedTransaction>,
10737    #[prost(message, repeated, tag = "2")]
10738    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
10739    /// A suggested gas price to use, that is above RGP, in order to provide a
10740    /// better chance of the transaction being included in the presence of
10741    /// congested objects.
10742    #[prost(uint64, optional, tag = "3")]
10743    pub suggested_gas_price: ::core::option::Option<u64>,
10744}
10745/// An intermediate result/output from the execution of a single command
10746#[non_exhaustive]
10747#[derive(Clone, PartialEq, ::prost::Message)]
10748pub struct CommandResult {
10749    #[prost(message, repeated, tag = "1")]
10750    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
10751    #[prost(message, repeated, tag = "2")]
10752    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
10753}
10754#[non_exhaustive]
10755#[derive(Clone, PartialEq, ::prost::Message)]
10756pub struct CommandOutput {
10757    #[prost(message, optional, tag = "1")]
10758    pub argument: ::core::option::Option<Argument>,
10759    #[prost(message, optional, tag = "2")]
10760    pub value: ::core::option::Option<Bcs>,
10761    /// JSON rendering of the output.
10762    #[prost(message, optional, boxed, tag = "3")]
10763    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
10764}
10765/// Generated client implementations.
10766pub mod transaction_execution_service_client {
10767    #![allow(
10768        unused_variables,
10769        dead_code,
10770        missing_docs,
10771        clippy::wildcard_imports,
10772        clippy::let_unit_value,
10773    )]
10774    use tonic::codegen::*;
10775    use tonic::codegen::http::Uri;
10776    #[derive(Debug, Clone)]
10777    pub struct TransactionExecutionServiceClient<T> {
10778        inner: tonic::client::Grpc<T>,
10779    }
10780    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
10781        /// Attempt to create a new client by connecting to a given endpoint.
10782        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
10783        where
10784            D: TryInto<tonic::transport::Endpoint>,
10785            D::Error: Into<StdError>,
10786        {
10787            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
10788            Ok(Self::new(conn))
10789        }
10790    }
10791    impl<T> TransactionExecutionServiceClient<T>
10792    where
10793        T: tonic::client::GrpcService<tonic::body::Body>,
10794        T::Error: Into<StdError>,
10795        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
10796        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
10797    {
10798        pub fn new(inner: T) -> Self {
10799            let inner = tonic::client::Grpc::new(inner);
10800            Self { inner }
10801        }
10802        pub fn with_origin(inner: T, origin: Uri) -> Self {
10803            let inner = tonic::client::Grpc::with_origin(inner, origin);
10804            Self { inner }
10805        }
10806        pub fn with_interceptor<F>(
10807            inner: T,
10808            interceptor: F,
10809        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
10810        where
10811            F: tonic::service::Interceptor,
10812            T::ResponseBody: Default,
10813            T: tonic::codegen::Service<
10814                http::Request<tonic::body::Body>,
10815                Response = http::Response<
10816                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
10817                >,
10818            >,
10819            <T as tonic::codegen::Service<
10820                http::Request<tonic::body::Body>,
10821            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
10822        {
10823            TransactionExecutionServiceClient::new(
10824                InterceptedService::new(inner, interceptor),
10825            )
10826        }
10827        /// Compress requests with the given encoding.
10828        ///
10829        /// This requires the server to support it otherwise it might respond with an
10830        /// error.
10831        #[must_use]
10832        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10833            self.inner = self.inner.send_compressed(encoding);
10834            self
10835        }
10836        /// Enable decompressing responses.
10837        #[must_use]
10838        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10839            self.inner = self.inner.accept_compressed(encoding);
10840            self
10841        }
10842        /// Limits the maximum size of a decoded message.
10843        ///
10844        /// Default: `4MB`
10845        #[must_use]
10846        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10847            self.inner = self.inner.max_decoding_message_size(limit);
10848            self
10849        }
10850        /// Limits the maximum size of an encoded message.
10851        ///
10852        /// Default: `usize::MAX`
10853        #[must_use]
10854        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
10855            self.inner = self.inner.max_encoding_message_size(limit);
10856            self
10857        }
10858        pub async fn execute_transaction(
10859            &mut self,
10860            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
10861        ) -> std::result::Result<
10862            tonic::Response<super::ExecuteTransactionResponse>,
10863            tonic::Status,
10864        > {
10865            self.inner
10866                .ready()
10867                .await
10868                .map_err(|e| {
10869                    tonic::Status::unknown(
10870                        format!("Service was not ready: {}", e.into()),
10871                    )
10872                })?;
10873            let codec = tonic_prost::ProstCodec::default();
10874            let path = http::uri::PathAndQuery::from_static(
10875                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
10876            );
10877            let mut req = request.into_request();
10878            req.extensions_mut()
10879                .insert(
10880                    GrpcMethod::new(
10881                        "sui.rpc.v2.TransactionExecutionService",
10882                        "ExecuteTransaction",
10883                    ),
10884                );
10885            self.inner.unary(req, path, codec).await
10886        }
10887        pub async fn simulate_transaction(
10888            &mut self,
10889            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
10890        ) -> std::result::Result<
10891            tonic::Response<super::SimulateTransactionResponse>,
10892            tonic::Status,
10893        > {
10894            self.inner
10895                .ready()
10896                .await
10897                .map_err(|e| {
10898                    tonic::Status::unknown(
10899                        format!("Service was not ready: {}", e.into()),
10900                    )
10901                })?;
10902            let codec = tonic_prost::ProstCodec::default();
10903            let path = http::uri::PathAndQuery::from_static(
10904                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
10905            );
10906            let mut req = request.into_request();
10907            req.extensions_mut()
10908                .insert(
10909                    GrpcMethod::new(
10910                        "sui.rpc.v2.TransactionExecutionService",
10911                        "SimulateTransaction",
10912                    ),
10913                );
10914            self.inner.unary(req, path, codec).await
10915        }
10916    }
10917}
10918/// Generated server implementations.
10919pub mod transaction_execution_service_server {
10920    #![allow(
10921        unused_variables,
10922        dead_code,
10923        missing_docs,
10924        clippy::wildcard_imports,
10925        clippy::let_unit_value,
10926    )]
10927    use tonic::codegen::*;
10928    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
10929    #[async_trait]
10930    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
10931        async fn execute_transaction(
10932            &self,
10933            request: tonic::Request<super::ExecuteTransactionRequest>,
10934        ) -> std::result::Result<
10935            tonic::Response<super::ExecuteTransactionResponse>,
10936            tonic::Status,
10937        > {
10938            Err(tonic::Status::unimplemented("Not yet implemented"))
10939        }
10940        async fn simulate_transaction(
10941            &self,
10942            request: tonic::Request<super::SimulateTransactionRequest>,
10943        ) -> std::result::Result<
10944            tonic::Response<super::SimulateTransactionResponse>,
10945            tonic::Status,
10946        > {
10947            Err(tonic::Status::unimplemented("Not yet implemented"))
10948        }
10949    }
10950    #[derive(Debug)]
10951    pub struct TransactionExecutionServiceServer<T> {
10952        inner: Arc<T>,
10953        accept_compression_encodings: EnabledCompressionEncodings,
10954        send_compression_encodings: EnabledCompressionEncodings,
10955        max_decoding_message_size: Option<usize>,
10956        max_encoding_message_size: Option<usize>,
10957    }
10958    impl<T> TransactionExecutionServiceServer<T> {
10959        pub fn new(inner: T) -> Self {
10960            Self::from_arc(Arc::new(inner))
10961        }
10962        pub fn from_arc(inner: Arc<T>) -> Self {
10963            Self {
10964                inner,
10965                accept_compression_encodings: Default::default(),
10966                send_compression_encodings: Default::default(),
10967                max_decoding_message_size: None,
10968                max_encoding_message_size: None,
10969            }
10970        }
10971        pub fn with_interceptor<F>(
10972            inner: T,
10973            interceptor: F,
10974        ) -> InterceptedService<Self, F>
10975        where
10976            F: tonic::service::Interceptor,
10977        {
10978            InterceptedService::new(Self::new(inner), interceptor)
10979        }
10980        /// Enable decompressing requests with the given encoding.
10981        #[must_use]
10982        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
10983            self.accept_compression_encodings.enable(encoding);
10984            self
10985        }
10986        /// Compress responses with the given encoding, if the client supports it.
10987        #[must_use]
10988        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
10989            self.send_compression_encodings.enable(encoding);
10990            self
10991        }
10992        /// Limits the maximum size of a decoded message.
10993        ///
10994        /// Default: `4MB`
10995        #[must_use]
10996        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
10997            self.max_decoding_message_size = Some(limit);
10998            self
10999        }
11000        /// Limits the maximum size of an encoded message.
11001        ///
11002        /// Default: `usize::MAX`
11003        #[must_use]
11004        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
11005            self.max_encoding_message_size = Some(limit);
11006            self
11007        }
11008    }
11009    impl<T, B> tonic::codegen::Service<http::Request<B>>
11010    for TransactionExecutionServiceServer<T>
11011    where
11012        T: TransactionExecutionService,
11013        B: Body + std::marker::Send + 'static,
11014        B::Error: Into<StdError> + std::marker::Send + 'static,
11015    {
11016        type Response = http::Response<tonic::body::Body>;
11017        type Error = std::convert::Infallible;
11018        type Future = BoxFuture<Self::Response, Self::Error>;
11019        fn poll_ready(
11020            &mut self,
11021            _cx: &mut Context<'_>,
11022        ) -> Poll<std::result::Result<(), Self::Error>> {
11023            Poll::Ready(Ok(()))
11024        }
11025        fn call(&mut self, req: http::Request<B>) -> Self::Future {
11026            match req.uri().path() {
11027                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
11028                    #[allow(non_camel_case_types)]
11029                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
11030                        pub Arc<T>,
11031                    );
11032                    impl<
11033                        T: TransactionExecutionService,
11034                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
11035                    for ExecuteTransactionSvc<T> {
11036                        type Response = super::ExecuteTransactionResponse;
11037                        type Future = BoxFuture<
11038                            tonic::Response<Self::Response>,
11039                            tonic::Status,
11040                        >;
11041                        fn call(
11042                            &mut self,
11043                            request: tonic::Request<super::ExecuteTransactionRequest>,
11044                        ) -> Self::Future {
11045                            let inner = Arc::clone(&self.0);
11046                            let fut = async move {
11047                                <T as TransactionExecutionService>::execute_transaction(
11048                                        &inner,
11049                                        request,
11050                                    )
11051                                    .await
11052                            };
11053                            Box::pin(fut)
11054                        }
11055                    }
11056                    let accept_compression_encodings = self.accept_compression_encodings;
11057                    let send_compression_encodings = self.send_compression_encodings;
11058                    let max_decoding_message_size = self.max_decoding_message_size;
11059                    let max_encoding_message_size = self.max_encoding_message_size;
11060                    let inner = self.inner.clone();
11061                    let fut = async move {
11062                        let method = ExecuteTransactionSvc(inner);
11063                        let codec = tonic_prost::ProstCodec::default();
11064                        let mut grpc = tonic::server::Grpc::new(codec)
11065                            .apply_compression_config(
11066                                accept_compression_encodings,
11067                                send_compression_encodings,
11068                            )
11069                            .apply_max_message_size_config(
11070                                max_decoding_message_size,
11071                                max_encoding_message_size,
11072                            );
11073                        let res = grpc.unary(method, req).await;
11074                        Ok(res)
11075                    };
11076                    Box::pin(fut)
11077                }
11078                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
11079                    #[allow(non_camel_case_types)]
11080                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
11081                        pub Arc<T>,
11082                    );
11083                    impl<
11084                        T: TransactionExecutionService,
11085                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
11086                    for SimulateTransactionSvc<T> {
11087                        type Response = super::SimulateTransactionResponse;
11088                        type Future = BoxFuture<
11089                            tonic::Response<Self::Response>,
11090                            tonic::Status,
11091                        >;
11092                        fn call(
11093                            &mut self,
11094                            request: tonic::Request<super::SimulateTransactionRequest>,
11095                        ) -> Self::Future {
11096                            let inner = Arc::clone(&self.0);
11097                            let fut = async move {
11098                                <T as TransactionExecutionService>::simulate_transaction(
11099                                        &inner,
11100                                        request,
11101                                    )
11102                                    .await
11103                            };
11104                            Box::pin(fut)
11105                        }
11106                    }
11107                    let accept_compression_encodings = self.accept_compression_encodings;
11108                    let send_compression_encodings = self.send_compression_encodings;
11109                    let max_decoding_message_size = self.max_decoding_message_size;
11110                    let max_encoding_message_size = self.max_encoding_message_size;
11111                    let inner = self.inner.clone();
11112                    let fut = async move {
11113                        let method = SimulateTransactionSvc(inner);
11114                        let codec = tonic_prost::ProstCodec::default();
11115                        let mut grpc = tonic::server::Grpc::new(codec)
11116                            .apply_compression_config(
11117                                accept_compression_encodings,
11118                                send_compression_encodings,
11119                            )
11120                            .apply_max_message_size_config(
11121                                max_decoding_message_size,
11122                                max_encoding_message_size,
11123                            );
11124                        let res = grpc.unary(method, req).await;
11125                        Ok(res)
11126                    };
11127                    Box::pin(fut)
11128                }
11129                _ => {
11130                    Box::pin(async move {
11131                        let mut response = http::Response::new(
11132                            tonic::body::Body::default(),
11133                        );
11134                        let headers = response.headers_mut();
11135                        headers
11136                            .insert(
11137                                tonic::Status::GRPC_STATUS,
11138                                (tonic::Code::Unimplemented as i32).into(),
11139                            );
11140                        headers
11141                            .insert(
11142                                http::header::CONTENT_TYPE,
11143                                tonic::metadata::GRPC_CONTENT_TYPE,
11144                            );
11145                        Ok(response)
11146                    })
11147                }
11148            }
11149        }
11150    }
11151    impl<T> Clone for TransactionExecutionServiceServer<T> {
11152        fn clone(&self) -> Self {
11153            let inner = self.inner.clone();
11154            Self {
11155                inner,
11156                accept_compression_encodings: self.accept_compression_encodings,
11157                send_compression_encodings: self.send_compression_encodings,
11158                max_decoding_message_size: self.max_decoding_message_size,
11159                max_encoding_message_size: self.max_encoding_message_size,
11160            }
11161        }
11162    }
11163    /// Generated gRPC service name
11164    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
11165    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
11166        const NAME: &'static str = SERVICE_NAME;
11167    }
11168}