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, for past epochs, or the current state for the
760    /// current epoch.
761    #[prost(message, optional, boxed, tag = "3")]
762    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763    #[prost(uint64, optional, tag = "4")]
764    pub first_checkpoint: ::core::option::Option<u64>,
765    #[prost(uint64, optional, tag = "5")]
766    pub last_checkpoint: ::core::option::Option<u64>,
767    #[prost(message, optional, tag = "6")]
768    pub start: ::core::option::Option<::prost_types::Timestamp>,
769    #[prost(message, optional, tag = "7")]
770    pub end: ::core::option::Option<::prost_types::Timestamp>,
771    /// Reference gas price denominated in MIST
772    #[prost(uint64, optional, tag = "8")]
773    pub reference_gas_price: ::core::option::Option<u64>,
774    #[prost(message, optional, tag = "9")]
775    pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777#[non_exhaustive]
778#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
779#[repr(i32)]
780pub enum ErrorReason {
781    Unknown = 0,
782    FieldInvalid = 1,
783    FieldMissing = 2,
784}
785impl ErrorReason {
786    /// String value of the enum field names used in the ProtoBuf definition.
787    ///
788    /// The values are not transformed in any way and thus are considered stable
789    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
790    pub fn as_str_name(&self) -> &'static str {
791        match self {
792            Self::Unknown => "ERROR_REASON_UNKNOWN",
793            Self::FieldInvalid => "FIELD_INVALID",
794            Self::FieldMissing => "FIELD_MISSING",
795        }
796    }
797    /// Creates an enum from field names used in the ProtoBuf definition.
798    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
799        match value {
800            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
801            "FIELD_INVALID" => Some(Self::FieldInvalid),
802            "FIELD_MISSING" => Some(Self::FieldMissing),
803            _ => None,
804        }
805    }
806}
807/// Events emitted during the successful execution of a transaction.
808#[non_exhaustive]
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct TransactionEvents {
811    /// This TransactionEvents serialized as BCS.
812    #[prost(message, optional, tag = "1")]
813    pub bcs: ::core::option::Option<Bcs>,
814    /// The digest of this TransactionEvents.
815    #[prost(string, optional, tag = "2")]
816    pub digest: ::core::option::Option<::prost::alloc::string::String>,
817    /// Set of events emitted by a transaction.
818    #[prost(message, repeated, tag = "3")]
819    pub events: ::prost::alloc::vec::Vec<Event>,
820}
821/// An event.
822#[non_exhaustive]
823#[derive(Clone, PartialEq, ::prost::Message)]
824pub struct Event {
825    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
826    /// event to be emitted.
827    #[prost(string, optional, tag = "1")]
828    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
829    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
830    /// event to be emitted.
831    #[prost(string, optional, tag = "2")]
832    pub module: ::core::option::Option<::prost::alloc::string::String>,
833    /// Address of the account that sent the transaction where this event was emitted.
834    #[prost(string, optional, tag = "3")]
835    pub sender: ::core::option::Option<::prost::alloc::string::String>,
836    /// The type of the event emitted.
837    #[prost(string, optional, tag = "4")]
838    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
839    /// BCS serialized bytes of the event.
840    #[prost(message, optional, tag = "5")]
841    pub contents: ::core::option::Option<Bcs>,
842    /// JSON rendering of the event.
843    #[prost(message, optional, boxed, tag = "6")]
844    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
845}
846#[non_exhaustive]
847#[derive(Clone, PartialEq, ::prost::Message)]
848pub struct ExecutedTransaction {
849    /// The digest of this Transaction.
850    #[prost(string, optional, tag = "1")]
851    pub digest: ::core::option::Option<::prost::alloc::string::String>,
852    /// The transaction itself.
853    #[prost(message, optional, tag = "2")]
854    pub transaction: ::core::option::Option<Transaction>,
855    /// List of user signatures that are used to authorize the
856    /// execution of this transaction.
857    #[prost(message, repeated, tag = "3")]
858    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
859    /// The `TransactionEffects` for this transaction.
860    #[prost(message, optional, tag = "4")]
861    pub effects: ::core::option::Option<TransactionEffects>,
862    /// The `TransactionEvents` for this transaction.
863    ///
864    /// This field might be empty, even if it was explicitly requested, if the
865    /// transaction didn't produce any events.
866    /// `sui.types.TransactionEffects.events_digest` is populated if the
867    /// transaction produced any events.
868    #[prost(message, optional, tag = "5")]
869    pub events: ::core::option::Option<TransactionEvents>,
870    /// The sequence number for the checkpoint that includes this transaction.
871    #[prost(uint64, optional, tag = "6")]
872    pub checkpoint: ::core::option::Option<u64>,
873    /// The Unix timestamp of the checkpoint that includes this transaction.
874    #[prost(message, optional, tag = "7")]
875    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
876    #[prost(message, repeated, tag = "8")]
877    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
878    /// Set of objects either referenced as inputs or produced as
879    /// outputs from this Transaction.
880    #[prost(message, optional, tag = "9")]
881    pub objects: ::core::option::Option<ObjectSet>,
882}
883/// The status of an executed transaction.
884#[non_exhaustive]
885#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
886pub struct ExecutionStatus {
887    /// Indicates if the transaction was successful or not.
888    #[prost(bool, optional, tag = "1")]
889    pub success: ::core::option::Option<bool>,
890    /// The error if `success` is false.
891    #[prost(message, optional, tag = "2")]
892    pub error: ::core::option::Option<ExecutionError>,
893}
894/// An error that can occur during the execution of a transaction.
895#[non_exhaustive]
896#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
897pub struct ExecutionError {
898    /// A human readable description of the error
899    #[prost(string, optional, tag = "1")]
900    pub description: ::core::option::Option<::prost::alloc::string::String>,
901    /// The command, if any, during which the error occurred.
902    #[prost(uint64, optional, tag = "2")]
903    pub command: ::core::option::Option<u64>,
904    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
905    pub kind: ::core::option::Option<i32>,
906    #[prost(
907        oneof = "execution_error::ErrorDetails",
908        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
909    )]
910    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
911}
912/// Nested message and enum types in `ExecutionError`.
913pub mod execution_error {
914    #[non_exhaustive]
915    #[derive(
916        Clone,
917        Copy,
918        Debug,
919        PartialEq,
920        Eq,
921        Hash,
922        PartialOrd,
923        Ord,
924        ::prost::Enumeration
925    )]
926    #[repr(i32)]
927    pub enum ExecutionErrorKind {
928        Unknown = 0,
929        /// Insufficient gas.
930        InsufficientGas = 1,
931        /// Invalid `Gas` object.
932        InvalidGasObject = 2,
933        /// Invariant violation.
934        InvariantViolation = 3,
935        /// Attempted to use feature that is not supported yet.
936        FeatureNotYetSupported = 4,
937        /// Move object is larger than the maximum allowed size.
938        ObjectTooBig = 5,
939        /// Package is larger than the maximum allowed size.
940        PackageTooBig = 6,
941        /// Circular object ownership.
942        CircularObjectOwnership = 7,
943        /// Insufficient coin balance for requested operation.
944        InsufficientCoinBalance = 8,
945        /// Coin balance overflowed an u64.
946        CoinBalanceOverflow = 9,
947        /// Publish error, non-zero address.
948        /// The modules in the package must have their self-addresses set to zero.
949        PublishErrorNonZeroAddress = 10,
950        /// Sui Move bytecode verification error.
951        SuiMoveVerificationError = 11,
952        /// Error from a non-abort instruction.
953        /// Possible causes:
954        /// Arithmetic error, stack overflow, max value depth, or similar.
955        MovePrimitiveRuntimeError = 12,
956        /// Move runtime abort.
957        MoveAbort = 13,
958        /// Bytecode verification error.
959        VmVerificationOrDeserializationError = 14,
960        /// MoveVm invariant violation.
961        VmInvariantViolation = 15,
962        /// Function not found.
963        FunctionNotFound = 16,
964        /// Parity mismatch for Move function.
965        /// The number of arguments does not match the number of parameters.
966        ArityMismatch = 17,
967        /// Type parity mismatch for Move function.
968        /// Mismatch between the number of actual versus expected type arguments.
969        TypeArityMismatch = 18,
970        /// Non-entry function invoked. Move Call must start with an entry function.
971        NonEntryFunctionInvoked = 19,
972        /// Invalid command argument.
973        CommandArgumentError = 20,
974        /// Type argument error.
975        TypeArgumentError = 21,
976        /// Unused result without the drop ability.
977        UnusedValueWithoutDrop = 22,
978        /// Invalid public Move function signature.
979        /// Unsupported return type for return value.
980        InvalidPublicFunctionReturnType = 23,
981        /// Invalid transfer object, object does not have public transfer.
982        InvalidTransferObject = 24,
983        /// Effects from the transaction are too large.
984        EffectsTooLarge = 25,
985        /// Publish or Upgrade is missing dependency.
986        PublishUpgradeMissingDependency = 26,
987        /// Publish or upgrade dependency downgrade.
988        ///
989        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
990        /// on-chain version that is less than the version required by one of the package's
991        /// transitive dependencies.
992        PublishUpgradeDependencyDowngrade = 27,
993        /// Invalid package upgrade.
994        PackageUpgradeError = 28,
995        /// Indicates the transaction tried to write objects too large to storage.
996        WrittenObjectsTooLarge = 29,
997        /// Certificate is on the deny list.
998        CertificateDenied = 30,
999        /// Sui Move bytecode verification timed out.
1000        SuiMoveVerificationTimedout = 31,
1001        /// The requested consensus object operation is not allowed.
1002        ConsensusObjectOperationNotAllowed = 32,
1003        /// Requested consensus object has been deleted.
1004        InputObjectDeleted = 33,
1005        /// Certificate is canceled due to congestion on consensus objects.
1006        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1007        /// Address is denied for this coin type.
1008        AddressDeniedForCoin = 35,
1009        /// Coin type is globally paused for use.
1010        CoinTypeGlobalPause = 36,
1011        /// Certificate is canceled because randomness could not be generated this epoch.
1012        ExecutionCanceledDueToRandomnessUnavailable = 37,
1013        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1014        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1015        /// type of the vector element.
1016        MoveVectorElemTooBig = 38,
1017        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1018        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1019        /// on the type of the value.
1020        MoveRawValueTooBig = 39,
1021        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1022        InvalidLinkage = 40,
1023        /// Insufficient funds for transaction withdrawal
1024        InsufficientFundsForWithdraw = 41,
1025        /// An input object with non-exclusive write mutability was modified
1026        NonExclusiveWriteInputObjectModified = 42,
1027    }
1028    impl ExecutionErrorKind {
1029        /// String value of the enum field names used in the ProtoBuf definition.
1030        ///
1031        /// The values are not transformed in any way and thus are considered stable
1032        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1033        pub fn as_str_name(&self) -> &'static str {
1034            match self {
1035                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1036                Self::InsufficientGas => "INSUFFICIENT_GAS",
1037                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1038                Self::InvariantViolation => "INVARIANT_VIOLATION",
1039                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1040                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1041                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1042                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1043                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1044                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1045                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1046                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1047                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1048                Self::MoveAbort => "MOVE_ABORT",
1049                Self::VmVerificationOrDeserializationError => {
1050                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1051                }
1052                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1053                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1054                Self::ArityMismatch => "ARITY_MISMATCH",
1055                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1056                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1057                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1058                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1059                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1060                Self::InvalidPublicFunctionReturnType => {
1061                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1062                }
1063                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1064                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1065                Self::PublishUpgradeMissingDependency => {
1066                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1067                }
1068                Self::PublishUpgradeDependencyDowngrade => {
1069                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1070                }
1071                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1072                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1073                Self::CertificateDenied => "CERTIFICATE_DENIED",
1074                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1075                Self::ConsensusObjectOperationNotAllowed => {
1076                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1077                }
1078                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1079                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1080                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1081                }
1082                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1083                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1084                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1085                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1086                }
1087                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1088                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1089                Self::InvalidLinkage => "INVALID_LINKAGE",
1090                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1091                Self::NonExclusiveWriteInputObjectModified => {
1092                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1093                }
1094            }
1095        }
1096        /// Creates an enum from field names used in the ProtoBuf definition.
1097        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1098            match value {
1099                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1100                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1101                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1102                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1103                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1104                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1105                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1106                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1107                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1108                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1109                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1110                    Some(Self::PublishErrorNonZeroAddress)
1111                }
1112                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1113                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1114                "MOVE_ABORT" => Some(Self::MoveAbort),
1115                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1116                    Some(Self::VmVerificationOrDeserializationError)
1117                }
1118                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1119                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1120                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1121                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1122                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1123                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1124                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1125                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1126                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1127                    Some(Self::InvalidPublicFunctionReturnType)
1128                }
1129                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1130                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1131                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1132                    Some(Self::PublishUpgradeMissingDependency)
1133                }
1134                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1135                    Some(Self::PublishUpgradeDependencyDowngrade)
1136                }
1137                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1138                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1139                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1140                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1141                    Some(Self::SuiMoveVerificationTimedout)
1142                }
1143                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1144                    Some(Self::ConsensusObjectOperationNotAllowed)
1145                }
1146                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1147                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1148                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1149                }
1150                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1151                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1152                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1153                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1154                }
1155                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1156                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1157                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1158                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1159                    Some(Self::InsufficientFundsForWithdraw)
1160                }
1161                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1162                    Some(Self::NonExclusiveWriteInputObjectModified)
1163                }
1164                _ => None,
1165            }
1166        }
1167    }
1168    #[non_exhaustive]
1169    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1170    pub enum ErrorDetails {
1171        #[prost(message, tag = "4")]
1172        Abort(super::MoveAbort),
1173        #[prost(message, tag = "5")]
1174        SizeError(super::SizeError),
1175        #[prost(message, tag = "6")]
1176        CommandArgumentError(super::CommandArgumentError),
1177        #[prost(message, tag = "7")]
1178        TypeArgumentError(super::TypeArgumentError),
1179        #[prost(message, tag = "8")]
1180        PackageUpgradeError(super::PackageUpgradeError),
1181        #[prost(message, tag = "9")]
1182        IndexError(super::IndexError),
1183        #[prost(string, tag = "10")]
1184        ObjectId(::prost::alloc::string::String),
1185        #[prost(message, tag = "11")]
1186        CoinDenyListError(super::CoinDenyListError),
1187        /// Set of objects that were congested, leading to the transaction's cancellation.
1188        #[prost(message, tag = "12")]
1189        CongestedObjects(super::CongestedObjects),
1190    }
1191}
1192#[non_exhaustive]
1193#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1194pub struct MoveAbort {
1195    #[prost(uint64, optional, tag = "1")]
1196    pub abort_code: ::core::option::Option<u64>,
1197    /// Location in Move where the error occurred.
1198    #[prost(message, optional, tag = "2")]
1199    pub location: ::core::option::Option<MoveLocation>,
1200    /// Extra error information if abort code is a "Clever Error"
1201    #[prost(message, optional, tag = "3")]
1202    pub clever_error: ::core::option::Option<CleverError>,
1203}
1204/// Location in Move bytecode where an error occurred.
1205#[non_exhaustive]
1206#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1207pub struct MoveLocation {
1208    /// The package ID.
1209    #[prost(string, optional, tag = "1")]
1210    pub package: ::core::option::Option<::prost::alloc::string::String>,
1211    /// The module name.
1212    #[prost(string, optional, tag = "2")]
1213    pub module: ::core::option::Option<::prost::alloc::string::String>,
1214    /// The function index.
1215    #[prost(uint32, optional, tag = "3")]
1216    pub function: ::core::option::Option<u32>,
1217    /// Offset of the instruction where the error occurred.
1218    #[prost(uint32, optional, tag = "4")]
1219    pub instruction: ::core::option::Option<u32>,
1220    /// The name of the function, if available.
1221    #[prost(string, optional, tag = "5")]
1222    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1223}
1224#[non_exhaustive]
1225#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1226pub struct CleverError {
1227    #[prost(uint64, optional, tag = "1")]
1228    pub error_code: ::core::option::Option<u64>,
1229    #[prost(uint64, optional, tag = "2")]
1230    pub line_number: ::core::option::Option<u64>,
1231    #[prost(string, optional, tag = "3")]
1232    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1233    #[prost(string, optional, tag = "4")]
1234    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1235    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1236    pub value: ::core::option::Option<clever_error::Value>,
1237}
1238/// Nested message and enum types in `CleverError`.
1239pub mod clever_error {
1240    #[non_exhaustive]
1241    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1242    pub enum Value {
1243        #[prost(string, tag = "5")]
1244        Rendered(::prost::alloc::string::String),
1245        #[prost(bytes, tag = "6")]
1246        Raw(::prost::bytes::Bytes),
1247    }
1248}
1249/// A size error.
1250#[non_exhaustive]
1251#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1252pub struct SizeError {
1253    /// The offending size.
1254    #[prost(uint64, optional, tag = "1")]
1255    pub size: ::core::option::Option<u64>,
1256    /// The maximum allowable size.
1257    #[prost(uint64, optional, tag = "2")]
1258    pub max_size: ::core::option::Option<u64>,
1259}
1260#[non_exhaustive]
1261#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1262pub struct IndexError {
1263    /// Index of an input or result.
1264    #[prost(uint32, optional, tag = "1")]
1265    pub index: ::core::option::Option<u32>,
1266    /// Index of a subresult.
1267    #[prost(uint32, optional, tag = "2")]
1268    pub subresult: ::core::option::Option<u32>,
1269}
1270#[non_exhaustive]
1271#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1272pub struct CoinDenyListError {
1273    /// Denied address.
1274    #[prost(string, optional, tag = "1")]
1275    pub address: ::core::option::Option<::prost::alloc::string::String>,
1276    /// Coin type.
1277    #[prost(string, optional, tag = "2")]
1278    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1279}
1280/// Set of objects that were congested, leading to the transaction's cancellation.
1281#[non_exhaustive]
1282#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1283pub struct CongestedObjects {
1284    #[prost(string, repeated, tag = "1")]
1285    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1286}
1287/// An error with an argument to a command.
1288#[non_exhaustive]
1289#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1290pub struct CommandArgumentError {
1291    /// Position of the problematic argument.
1292    #[prost(uint32, optional, tag = "1")]
1293    pub argument: ::core::option::Option<u32>,
1294    #[prost(
1295        enumeration = "command_argument_error::CommandArgumentErrorKind",
1296        optional,
1297        tag = "2"
1298    )]
1299    pub kind: ::core::option::Option<i32>,
1300    #[prost(message, optional, tag = "3")]
1301    pub index_error: ::core::option::Option<IndexError>,
1302}
1303/// Nested message and enum types in `CommandArgumentError`.
1304pub mod command_argument_error {
1305    #[non_exhaustive]
1306    #[derive(
1307        Clone,
1308        Copy,
1309        Debug,
1310        PartialEq,
1311        Eq,
1312        Hash,
1313        PartialOrd,
1314        Ord,
1315        ::prost::Enumeration
1316    )]
1317    #[repr(i32)]
1318    pub enum CommandArgumentErrorKind {
1319        Unknown = 0,
1320        /// The type of the value does not match the expected type.
1321        TypeMismatch = 1,
1322        /// The argument cannot be deserialized into a value of the specified type.
1323        InvalidBcsBytes = 2,
1324        /// The argument cannot be instantiated from raw bytes.
1325        InvalidUsageOfPureArgument = 3,
1326        /// Invalid argument to private entry function.
1327        /// Private entry functions cannot take arguments from other Move functions.
1328        InvalidArgumentToPrivateEntryFunction = 4,
1329        /// Out of bounds access to input or results.
1330        ///
1331        /// `index` field will be set indicating the invalid index value.
1332        IndexOutOfBounds = 5,
1333        /// Out of bounds access to subresult.
1334        ///
1335        /// `index` and `subresult` fields will be set indicating the invalid index value.
1336        SecondaryIndexOutOfBounds = 6,
1337        /// Invalid usage of result.
1338        /// Expected a single result but found either no return value or multiple.
1339        /// `index` field will be set indicating the invalid index value.
1340        InvalidResultArity = 7,
1341        /// Invalid usage of gas coin.
1342        /// The gas coin can only be used by-value with a `TransferObject` command.
1343        InvalidGasCoinUsage = 8,
1344        /// Invalid usage of Move value.
1345        /// - Mutably borrowed values require unique usage.
1346        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1347        /// - Taken values cannot be used again.
1348        InvalidValueUsage = 9,
1349        /// Immutable objects cannot be passed by-value.
1350        InvalidObjectByValue = 10,
1351        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1352        InvalidObjectByMutRef = 11,
1353        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1354        /// allowed.
1355        ConsensusObjectOperationNotAllowed = 12,
1356        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1357        /// multiple arguments.
1358        InvalidArgumentArity = 13,
1359        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1360        InvalidTransferObject = 14,
1361        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1362        /// all arguments must be the same object type.
1363        InvalidMakeMoveVecNonObjectArgument = 15,
1364        /// Specified argument location does not have a value and cannot be used
1365        ArgumentWithoutValue = 16,
1366        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1367        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1368        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1369        /// ability.
1370        CannotMoveBorrowedValue = 17,
1371        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1372        /// extension of that reference. This is likely due to this argument being used in a Move call
1373        /// that returns a reference, and that reference is used in a later command.
1374        CannotWriteToExtendedReference = 18,
1375        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1376        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1377        /// argument is mutable and another reference extends it and will be used in a later command.
1378        InvalidReferenceArgument = 19,
1379    }
1380    impl CommandArgumentErrorKind {
1381        /// String value of the enum field names used in the ProtoBuf definition.
1382        ///
1383        /// The values are not transformed in any way and thus are considered stable
1384        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1385        pub fn as_str_name(&self) -> &'static str {
1386            match self {
1387                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1388                Self::TypeMismatch => "TYPE_MISMATCH",
1389                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1390                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1391                Self::InvalidArgumentToPrivateEntryFunction => {
1392                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1393                }
1394                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1395                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1396                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1397                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1398                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1399                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1400                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1401                Self::ConsensusObjectOperationNotAllowed => {
1402                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1403                }
1404                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1405                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1406                Self::InvalidMakeMoveVecNonObjectArgument => {
1407                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1408                }
1409                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1410                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1411                Self::CannotWriteToExtendedReference => {
1412                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1413                }
1414                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1415            }
1416        }
1417        /// Creates an enum from field names used in the ProtoBuf definition.
1418        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1419            match value {
1420                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1421                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1422                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1423                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1424                    Some(Self::InvalidUsageOfPureArgument)
1425                }
1426                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1427                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1428                }
1429                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1430                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1431                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1432                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1433                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1434                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1435                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1436                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1437                    Some(Self::ConsensusObjectOperationNotAllowed)
1438                }
1439                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1440                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1441                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1442                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1443                }
1444                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1445                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1446                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1447                    Some(Self::CannotWriteToExtendedReference)
1448                }
1449                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1450                _ => None,
1451            }
1452        }
1453    }
1454}
1455/// An error with upgrading a package.
1456#[non_exhaustive]
1457#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1458pub struct PackageUpgradeError {
1459    #[prost(
1460        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1461        optional,
1462        tag = "1"
1463    )]
1464    pub kind: ::core::option::Option<i32>,
1465    /// The Package Id.
1466    #[prost(string, optional, tag = "2")]
1467    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1468    /// A digest.
1469    #[prost(string, optional, tag = "3")]
1470    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1471    /// The policy.
1472    #[prost(uint32, optional, tag = "4")]
1473    pub policy: ::core::option::Option<u32>,
1474    /// The ticket Id.
1475    #[prost(string, optional, tag = "5")]
1476    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1477}
1478/// Nested message and enum types in `PackageUpgradeError`.
1479pub mod package_upgrade_error {
1480    #[non_exhaustive]
1481    #[derive(
1482        Clone,
1483        Copy,
1484        Debug,
1485        PartialEq,
1486        Eq,
1487        Hash,
1488        PartialOrd,
1489        Ord,
1490        ::prost::Enumeration
1491    )]
1492    #[repr(i32)]
1493    pub enum PackageUpgradeErrorKind {
1494        Unknown = 0,
1495        /// Unable to fetch package.
1496        UnableToFetchPackage = 1,
1497        /// Object is not a package.
1498        NotAPackage = 2,
1499        /// Package upgrade is incompatible with previous version.
1500        IncompatibleUpgrade = 3,
1501        /// Digest in upgrade ticket and computed digest differ.
1502        DigestDoesNotMatch = 4,
1503        /// Upgrade policy is not valid.
1504        UnknownUpgradePolicy = 5,
1505        /// Package ID does not match `PackageId` in upgrade ticket.
1506        PackageIdDoesNotMatch = 6,
1507    }
1508    impl PackageUpgradeErrorKind {
1509        /// String value of the enum field names used in the ProtoBuf definition.
1510        ///
1511        /// The values are not transformed in any way and thus are considered stable
1512        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1513        pub fn as_str_name(&self) -> &'static str {
1514            match self {
1515                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1516                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1517                Self::NotAPackage => "NOT_A_PACKAGE",
1518                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1519                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1520                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1521                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1522            }
1523        }
1524        /// Creates an enum from field names used in the ProtoBuf definition.
1525        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1526            match value {
1527                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1528                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1529                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1530                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1531                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1532                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1533                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1534                _ => None,
1535            }
1536        }
1537    }
1538}
1539/// Type argument error.
1540#[non_exhaustive]
1541#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1542pub struct TypeArgumentError {
1543    /// Index of the problematic type argument.
1544    #[prost(uint32, optional, tag = "1")]
1545    pub type_argument: ::core::option::Option<u32>,
1546    #[prost(
1547        enumeration = "type_argument_error::TypeArgumentErrorKind",
1548        optional,
1549        tag = "2"
1550    )]
1551    pub kind: ::core::option::Option<i32>,
1552}
1553/// Nested message and enum types in `TypeArgumentError`.
1554pub mod type_argument_error {
1555    #[non_exhaustive]
1556    #[derive(
1557        Clone,
1558        Copy,
1559        Debug,
1560        PartialEq,
1561        Eq,
1562        Hash,
1563        PartialOrd,
1564        Ord,
1565        ::prost::Enumeration
1566    )]
1567    #[repr(i32)]
1568    pub enum TypeArgumentErrorKind {
1569        Unknown = 0,
1570        /// A type was not found in the module specified.
1571        TypeNotFound = 1,
1572        /// A type provided did not match the specified constraint.
1573        ConstraintNotSatisfied = 2,
1574    }
1575    impl TypeArgumentErrorKind {
1576        /// String value of the enum field names used in the ProtoBuf definition.
1577        ///
1578        /// The values are not transformed in any way and thus are considered stable
1579        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1580        pub fn as_str_name(&self) -> &'static str {
1581            match self {
1582                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1583                Self::TypeNotFound => "TYPE_NOT_FOUND",
1584                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1585            }
1586        }
1587        /// Creates an enum from field names used in the ProtoBuf definition.
1588        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1589            match value {
1590                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1591                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1592                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1593                _ => None,
1594            }
1595        }
1596    }
1597}
1598/// Summary of gas charges.
1599#[non_exhaustive]
1600#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1601pub struct GasCostSummary {
1602    /// Cost of computation/execution.
1603    #[prost(uint64, optional, tag = "1")]
1604    pub computation_cost: ::core::option::Option<u64>,
1605    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1606    #[prost(uint64, optional, tag = "2")]
1607    pub storage_cost: ::core::option::Option<u64>,
1608    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1609    /// transaction.
1610    #[prost(uint64, optional, tag = "3")]
1611    pub storage_rebate: ::core::option::Option<u64>,
1612    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1613    #[prost(uint64, optional, tag = "4")]
1614    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1615}
1616/// An input to a user transaction.
1617#[non_exhaustive]
1618#[derive(Clone, PartialEq, ::prost::Message)]
1619pub struct Input {
1620    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1621    pub kind: ::core::option::Option<i32>,
1622    /// A move value serialized as BCS.
1623    ///
1624    /// For normal operations this is required to be a move primitive type and not contain structs
1625    /// or objects.
1626    #[prost(bytes = "bytes", optional, tag = "2")]
1627    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1628    /// `ObjectId` of the object input.
1629    #[prost(string, optional, tag = "3")]
1630    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1631    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1632    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1633    /// object when it was shared
1634    #[prost(uint64, optional, tag = "4")]
1635    pub version: ::core::option::Option<u64>,
1636    /// The digest of this object.
1637    #[prost(string, optional, tag = "5")]
1638    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1639    /// Controls whether the caller asks for a mutable reference to the shared
1640    /// object.
1641    #[prost(bool, optional, tag = "6")]
1642    pub mutable: ::core::option::Option<bool>,
1643    /// NOTE: For backwards compatibility purposes the addition of the new
1644    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1645    /// The old `mutable` field will continue to be populated and respected as an
1646    /// input for the time being.
1647    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1648    pub mutability: ::core::option::Option<i32>,
1649    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1650    #[prost(message, optional, tag = "8")]
1651    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1652    /// A literal value
1653    ///
1654    /// INPUT ONLY
1655    #[prost(message, optional, boxed, tag = "1000")]
1656    pub literal: ::core::option::Option<
1657        ::prost::alloc::boxed::Box<::prost_types::Value>,
1658    >,
1659}
1660/// Nested message and enum types in `Input`.
1661pub mod input {
1662    #[non_exhaustive]
1663    #[derive(
1664        Clone,
1665        Copy,
1666        Debug,
1667        PartialEq,
1668        Eq,
1669        Hash,
1670        PartialOrd,
1671        Ord,
1672        ::prost::Enumeration
1673    )]
1674    #[repr(i32)]
1675    pub enum InputKind {
1676        Unknown = 0,
1677        /// A move value serialized as BCS.
1678        Pure = 1,
1679        /// A Move object that is either immutable or address owned.
1680        ImmutableOrOwned = 2,
1681        /// A Move object whose owner is "Shared".
1682        Shared = 3,
1683        /// A Move object that is attempted to be received in this transaction.
1684        Receiving = 4,
1685        /// Reservation to withdraw balance from a funds accumulator
1686        FundsWithdrawal = 5,
1687    }
1688    impl InputKind {
1689        /// String value of the enum field names used in the ProtoBuf definition.
1690        ///
1691        /// The values are not transformed in any way and thus are considered stable
1692        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1693        pub fn as_str_name(&self) -> &'static str {
1694            match self {
1695                Self::Unknown => "INPUT_KIND_UNKNOWN",
1696                Self::Pure => "PURE",
1697                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1698                Self::Shared => "SHARED",
1699                Self::Receiving => "RECEIVING",
1700                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1701            }
1702        }
1703        /// Creates an enum from field names used in the ProtoBuf definition.
1704        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1705            match value {
1706                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1707                "PURE" => Some(Self::Pure),
1708                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1709                "SHARED" => Some(Self::Shared),
1710                "RECEIVING" => Some(Self::Receiving),
1711                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1712                _ => None,
1713            }
1714        }
1715    }
1716    #[non_exhaustive]
1717    #[derive(
1718        Clone,
1719        Copy,
1720        Debug,
1721        PartialEq,
1722        Eq,
1723        Hash,
1724        PartialOrd,
1725        Ord,
1726        ::prost::Enumeration
1727    )]
1728    #[repr(i32)]
1729    pub enum Mutability {
1730        Unknown = 0,
1731        Immutable = 1,
1732        Mutable = 2,
1733        /// Non-exclusive write is used to allow multiple transactions to
1734        /// simultaneously add disjoint dynamic fields to an object.
1735        /// (Currently only used by settlement transactions).
1736        NonExclusiveWrite = 3,
1737    }
1738    impl Mutability {
1739        /// String value of the enum field names used in the ProtoBuf definition.
1740        ///
1741        /// The values are not transformed in any way and thus are considered stable
1742        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1743        pub fn as_str_name(&self) -> &'static str {
1744            match self {
1745                Self::Unknown => "MUTABILITY_UNKNOWN",
1746                Self::Immutable => "IMMUTABLE",
1747                Self::Mutable => "MUTABLE",
1748                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1749            }
1750        }
1751        /// Creates an enum from field names used in the ProtoBuf definition.
1752        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1753            match value {
1754                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1755                "IMMUTABLE" => Some(Self::Immutable),
1756                "MUTABLE" => Some(Self::Mutable),
1757                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1758                _ => None,
1759            }
1760        }
1761    }
1762}
1763#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct FundsWithdrawal {
1766    #[prost(uint64, optional, tag = "1")]
1767    pub amount: ::core::option::Option<u64>,
1768    #[prost(string, optional, tag = "2")]
1769    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1770    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
1771    pub source: ::core::option::Option<i32>,
1772}
1773/// Nested message and enum types in `FundsWithdrawal`.
1774pub mod funds_withdrawal {
1775    #[non_exhaustive]
1776    #[derive(
1777        Clone,
1778        Copy,
1779        Debug,
1780        PartialEq,
1781        Eq,
1782        Hash,
1783        PartialOrd,
1784        Ord,
1785        ::prost::Enumeration
1786    )]
1787    #[repr(i32)]
1788    pub enum Source {
1789        Unknown = 0,
1790        Sender = 1,
1791        Sponsor = 2,
1792    }
1793    impl Source {
1794        /// String value of the enum field names used in the ProtoBuf definition.
1795        ///
1796        /// The values are not transformed in any way and thus are considered stable
1797        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1798        pub fn as_str_name(&self) -> &'static str {
1799            match self {
1800                Self::Unknown => "SOURCE_UNKNOWN",
1801                Self::Sender => "SENDER",
1802                Self::Sponsor => "SPONSOR",
1803            }
1804        }
1805        /// Creates an enum from field names used in the ProtoBuf definition.
1806        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1807            match value {
1808                "SOURCE_UNKNOWN" => Some(Self::Unknown),
1809                "SENDER" => Some(Self::Sender),
1810                "SPONSOR" => Some(Self::Sponsor),
1811                _ => None,
1812            }
1813        }
1814    }
1815}
1816/// Key to uniquely identify a JWK.
1817#[non_exhaustive]
1818#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1819pub struct JwkId {
1820    /// The issuer or identity of the OIDC provider.
1821    #[prost(string, optional, tag = "1")]
1822    pub iss: ::core::option::Option<::prost::alloc::string::String>,
1823    /// A key ID used to uniquely identify a key from an OIDC provider.
1824    #[prost(string, optional, tag = "2")]
1825    pub kid: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827/// A JSON web key.
1828///
1829/// Struct that contains info for a JWK. A list of them for different kinds can
1830/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
1831/// The JWK is used to verify the JWT token.
1832#[non_exhaustive]
1833#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct Jwk {
1835    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
1836    #[prost(string, optional, tag = "1")]
1837    pub kty: ::core::option::Option<::prost::alloc::string::String>,
1838    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
1839    #[prost(string, optional, tag = "2")]
1840    pub e: ::core::option::Option<::prost::alloc::string::String>,
1841    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
1842    #[prost(string, optional, tag = "3")]
1843    pub n: ::core::option::Option<::prost::alloc::string::String>,
1844    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
1845    #[prost(string, optional, tag = "4")]
1846    pub alg: ::core::option::Option<::prost::alloc::string::String>,
1847}
1848#[non_exhaustive]
1849#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1850pub struct GetServiceInfoRequest {}
1851#[non_exhaustive]
1852#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1853pub struct GetServiceInfoResponse {
1854    /// The chain identifier of the chain that this node is on.
1855    ///
1856    /// The chain identifier is the digest of the genesis checkpoint, the
1857    /// checkpoint with sequence number 0.
1858    #[prost(string, optional, tag = "1")]
1859    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
1860    /// Human-readable name of the chain that this node is on.
1861    ///
1862    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
1863    #[prost(string, optional, tag = "2")]
1864    pub chain: ::core::option::Option<::prost::alloc::string::String>,
1865    /// Current epoch of the node based on its highest executed checkpoint.
1866    #[prost(uint64, optional, tag = "3")]
1867    pub epoch: ::core::option::Option<u64>,
1868    /// Checkpoint height of the most recently executed checkpoint.
1869    #[prost(uint64, optional, tag = "4")]
1870    pub checkpoint_height: ::core::option::Option<u64>,
1871    /// Unix timestamp of the most recently executed checkpoint.
1872    #[prost(message, optional, tag = "5")]
1873    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
1874    /// The lowest checkpoint for which checkpoints and transaction data are available.
1875    #[prost(uint64, optional, tag = "6")]
1876    pub lowest_available_checkpoint: ::core::option::Option<u64>,
1877    /// The lowest checkpoint for which object data is available.
1878    #[prost(uint64, optional, tag = "7")]
1879    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
1880    /// Software version of the service. Similar to the `server` http header.
1881    #[prost(string, optional, tag = "8")]
1882    pub server: ::core::option::Option<::prost::alloc::string::String>,
1883}
1884#[non_exhaustive]
1885#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1886pub struct GetObjectRequest {
1887    /// Required. The `ObjectId` of the requested object.
1888    #[prost(string, optional, tag = "1")]
1889    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1890    /// Request a specific version of the object.
1891    /// If no version is specified, and the object is live, then the latest
1892    /// version of the object is returned.
1893    #[prost(uint64, optional, tag = "2")]
1894    pub version: ::core::option::Option<u64>,
1895    /// Mask specifying which fields to read.
1896    /// If no mask is specified, defaults to `object_id,version,digest`.
1897    #[prost(message, optional, tag = "3")]
1898    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1899}
1900#[non_exhaustive]
1901#[derive(Clone, PartialEq, ::prost::Message)]
1902pub struct GetObjectResponse {
1903    #[prost(message, optional, tag = "1")]
1904    pub object: ::core::option::Option<Object>,
1905}
1906#[non_exhaustive]
1907#[derive(Clone, PartialEq, ::prost::Message)]
1908pub struct BatchGetObjectsRequest {
1909    #[prost(message, repeated, tag = "1")]
1910    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
1911    /// Mask specifying which fields to read.
1912    /// If no mask is specified, defaults to `object_id,version,digest`.
1913    #[prost(message, optional, tag = "2")]
1914    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1915}
1916#[non_exhaustive]
1917#[derive(Clone, PartialEq, ::prost::Message)]
1918pub struct BatchGetObjectsResponse {
1919    #[prost(message, repeated, tag = "1")]
1920    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
1921}
1922#[non_exhaustive]
1923#[derive(Clone, PartialEq, ::prost::Message)]
1924pub struct GetObjectResult {
1925    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
1926    pub result: ::core::option::Option<get_object_result::Result>,
1927}
1928/// Nested message and enum types in `GetObjectResult`.
1929pub mod get_object_result {
1930    #[non_exhaustive]
1931    #[derive(Clone, PartialEq, ::prost::Oneof)]
1932    pub enum Result {
1933        #[prost(message, tag = "1")]
1934        Object(super::Object),
1935        #[prost(message, tag = "2")]
1936        Error(super::super::super::super::google::rpc::Status),
1937    }
1938}
1939#[non_exhaustive]
1940#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1941pub struct GetTransactionRequest {
1942    /// Required. The digest of the requested transaction.
1943    #[prost(string, optional, tag = "1")]
1944    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1945    /// Mask specifying which fields to read.
1946    /// If no mask is specified, defaults to `digest`.
1947    #[prost(message, optional, tag = "2")]
1948    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1949}
1950#[non_exhaustive]
1951#[derive(Clone, PartialEq, ::prost::Message)]
1952pub struct GetTransactionResponse {
1953    #[prost(message, optional, tag = "1")]
1954    pub transaction: ::core::option::Option<ExecutedTransaction>,
1955}
1956#[non_exhaustive]
1957#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1958pub struct BatchGetTransactionsRequest {
1959    /// Required. The digests of the requested transactions.
1960    #[prost(string, repeated, tag = "1")]
1961    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1962    /// Mask specifying which fields to read.
1963    /// If no mask is specified, defaults to `digest`.
1964    #[prost(message, optional, tag = "2")]
1965    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1966}
1967#[non_exhaustive]
1968#[derive(Clone, PartialEq, ::prost::Message)]
1969pub struct BatchGetTransactionsResponse {
1970    #[prost(message, repeated, tag = "1")]
1971    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
1972}
1973#[non_exhaustive]
1974#[derive(Clone, PartialEq, ::prost::Message)]
1975pub struct GetTransactionResult {
1976    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
1977    pub result: ::core::option::Option<get_transaction_result::Result>,
1978}
1979/// Nested message and enum types in `GetTransactionResult`.
1980pub mod get_transaction_result {
1981    #[non_exhaustive]
1982    #[derive(Clone, PartialEq, ::prost::Oneof)]
1983    pub enum Result {
1984        #[prost(message, tag = "1")]
1985        Transaction(super::ExecutedTransaction),
1986        #[prost(message, tag = "2")]
1987        Error(super::super::super::super::google::rpc::Status),
1988    }
1989}
1990#[non_exhaustive]
1991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1992pub struct GetCheckpointRequest {
1993    /// Mask specifying which fields to read.
1994    /// If no mask is specified, defaults to `sequence_number,digest`.
1995    #[prost(message, optional, tag = "3")]
1996    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
1997    /// If neither is provided, return the latest
1998    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
1999    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2000}
2001/// Nested message and enum types in `GetCheckpointRequest`.
2002pub mod get_checkpoint_request {
2003    /// If neither is provided, return the latest
2004    #[non_exhaustive]
2005    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2006    pub enum CheckpointId {
2007        /// The sequence number of the requested checkpoint.
2008        #[prost(uint64, tag = "1")]
2009        SequenceNumber(u64),
2010        /// The digest of the requested checkpoint.
2011        #[prost(string, tag = "2")]
2012        Digest(::prost::alloc::string::String),
2013    }
2014}
2015#[non_exhaustive]
2016#[derive(Clone, PartialEq, ::prost::Message)]
2017pub struct GetCheckpointResponse {
2018    #[prost(message, optional, tag = "1")]
2019    pub checkpoint: ::core::option::Option<Checkpoint>,
2020}
2021#[non_exhaustive]
2022#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2023pub struct GetEpochRequest {
2024    /// The requested epoch.
2025    /// If no epoch is provided the current epoch will be returned.
2026    #[prost(uint64, optional, tag = "1")]
2027    pub epoch: ::core::option::Option<u64>,
2028    /// Mask specifying which fields to read.
2029    /// If no mask is specified, defaults to `epoch`.
2030    #[prost(message, optional, tag = "2")]
2031    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2032}
2033#[non_exhaustive]
2034#[derive(Clone, PartialEq, ::prost::Message)]
2035pub struct GetEpochResponse {
2036    #[prost(message, optional, tag = "1")]
2037    pub epoch: ::core::option::Option<Epoch>,
2038}
2039/// Generated client implementations.
2040pub mod ledger_service_client {
2041    #![allow(
2042        unused_variables,
2043        dead_code,
2044        missing_docs,
2045        clippy::wildcard_imports,
2046        clippy::let_unit_value,
2047    )]
2048    use tonic::codegen::*;
2049    use tonic::codegen::http::Uri;
2050    #[derive(Debug, Clone)]
2051    pub struct LedgerServiceClient<T> {
2052        inner: tonic::client::Grpc<T>,
2053    }
2054    impl LedgerServiceClient<tonic::transport::Channel> {
2055        /// Attempt to create a new client by connecting to a given endpoint.
2056        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2057        where
2058            D: TryInto<tonic::transport::Endpoint>,
2059            D::Error: Into<StdError>,
2060        {
2061            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2062            Ok(Self::new(conn))
2063        }
2064    }
2065    impl<T> LedgerServiceClient<T>
2066    where
2067        T: tonic::client::GrpcService<tonic::body::Body>,
2068        T::Error: Into<StdError>,
2069        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2070        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2071    {
2072        pub fn new(inner: T) -> Self {
2073            let inner = tonic::client::Grpc::new(inner);
2074            Self { inner }
2075        }
2076        pub fn with_origin(inner: T, origin: Uri) -> Self {
2077            let inner = tonic::client::Grpc::with_origin(inner, origin);
2078            Self { inner }
2079        }
2080        pub fn with_interceptor<F>(
2081            inner: T,
2082            interceptor: F,
2083        ) -> LedgerServiceClient<InterceptedService<T, F>>
2084        where
2085            F: tonic::service::Interceptor,
2086            T::ResponseBody: Default,
2087            T: tonic::codegen::Service<
2088                http::Request<tonic::body::Body>,
2089                Response = http::Response<
2090                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2091                >,
2092            >,
2093            <T as tonic::codegen::Service<
2094                http::Request<tonic::body::Body>,
2095            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2096        {
2097            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2098        }
2099        /// Compress requests with the given encoding.
2100        ///
2101        /// This requires the server to support it otherwise it might respond with an
2102        /// error.
2103        #[must_use]
2104        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2105            self.inner = self.inner.send_compressed(encoding);
2106            self
2107        }
2108        /// Enable decompressing responses.
2109        #[must_use]
2110        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2111            self.inner = self.inner.accept_compressed(encoding);
2112            self
2113        }
2114        /// Limits the maximum size of a decoded message.
2115        ///
2116        /// Default: `4MB`
2117        #[must_use]
2118        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2119            self.inner = self.inner.max_decoding_message_size(limit);
2120            self
2121        }
2122        /// Limits the maximum size of an encoded message.
2123        ///
2124        /// Default: `usize::MAX`
2125        #[must_use]
2126        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2127            self.inner = self.inner.max_encoding_message_size(limit);
2128            self
2129        }
2130        /// Query the service for general information about its current state.
2131        pub async fn get_service_info(
2132            &mut self,
2133            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2134        ) -> std::result::Result<
2135            tonic::Response<super::GetServiceInfoResponse>,
2136            tonic::Status,
2137        > {
2138            self.inner
2139                .ready()
2140                .await
2141                .map_err(|e| {
2142                    tonic::Status::unknown(
2143                        format!("Service was not ready: {}", e.into()),
2144                    )
2145                })?;
2146            let codec = tonic_prost::ProstCodec::default();
2147            let path = http::uri::PathAndQuery::from_static(
2148                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2149            );
2150            let mut req = request.into_request();
2151            req.extensions_mut()
2152                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2153            self.inner.unary(req, path, codec).await
2154        }
2155        pub async fn get_object(
2156            &mut self,
2157            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2158        ) -> std::result::Result<
2159            tonic::Response<super::GetObjectResponse>,
2160            tonic::Status,
2161        > {
2162            self.inner
2163                .ready()
2164                .await
2165                .map_err(|e| {
2166                    tonic::Status::unknown(
2167                        format!("Service was not ready: {}", e.into()),
2168                    )
2169                })?;
2170            let codec = tonic_prost::ProstCodec::default();
2171            let path = http::uri::PathAndQuery::from_static(
2172                "/sui.rpc.v2.LedgerService/GetObject",
2173            );
2174            let mut req = request.into_request();
2175            req.extensions_mut()
2176                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2177            self.inner.unary(req, path, codec).await
2178        }
2179        pub async fn batch_get_objects(
2180            &mut self,
2181            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2182        ) -> std::result::Result<
2183            tonic::Response<super::BatchGetObjectsResponse>,
2184            tonic::Status,
2185        > {
2186            self.inner
2187                .ready()
2188                .await
2189                .map_err(|e| {
2190                    tonic::Status::unknown(
2191                        format!("Service was not ready: {}", e.into()),
2192                    )
2193                })?;
2194            let codec = tonic_prost::ProstCodec::default();
2195            let path = http::uri::PathAndQuery::from_static(
2196                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2197            );
2198            let mut req = request.into_request();
2199            req.extensions_mut()
2200                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2201            self.inner.unary(req, path, codec).await
2202        }
2203        pub async fn get_transaction(
2204            &mut self,
2205            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2206        ) -> std::result::Result<
2207            tonic::Response<super::GetTransactionResponse>,
2208            tonic::Status,
2209        > {
2210            self.inner
2211                .ready()
2212                .await
2213                .map_err(|e| {
2214                    tonic::Status::unknown(
2215                        format!("Service was not ready: {}", e.into()),
2216                    )
2217                })?;
2218            let codec = tonic_prost::ProstCodec::default();
2219            let path = http::uri::PathAndQuery::from_static(
2220                "/sui.rpc.v2.LedgerService/GetTransaction",
2221            );
2222            let mut req = request.into_request();
2223            req.extensions_mut()
2224                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2225            self.inner.unary(req, path, codec).await
2226        }
2227        pub async fn batch_get_transactions(
2228            &mut self,
2229            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2230        ) -> std::result::Result<
2231            tonic::Response<super::BatchGetTransactionsResponse>,
2232            tonic::Status,
2233        > {
2234            self.inner
2235                .ready()
2236                .await
2237                .map_err(|e| {
2238                    tonic::Status::unknown(
2239                        format!("Service was not ready: {}", e.into()),
2240                    )
2241                })?;
2242            let codec = tonic_prost::ProstCodec::default();
2243            let path = http::uri::PathAndQuery::from_static(
2244                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2245            );
2246            let mut req = request.into_request();
2247            req.extensions_mut()
2248                .insert(
2249                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2250                );
2251            self.inner.unary(req, path, codec).await
2252        }
2253        pub async fn get_checkpoint(
2254            &mut self,
2255            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2256        ) -> std::result::Result<
2257            tonic::Response<super::GetCheckpointResponse>,
2258            tonic::Status,
2259        > {
2260            self.inner
2261                .ready()
2262                .await
2263                .map_err(|e| {
2264                    tonic::Status::unknown(
2265                        format!("Service was not ready: {}", e.into()),
2266                    )
2267                })?;
2268            let codec = tonic_prost::ProstCodec::default();
2269            let path = http::uri::PathAndQuery::from_static(
2270                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2271            );
2272            let mut req = request.into_request();
2273            req.extensions_mut()
2274                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2275            self.inner.unary(req, path, codec).await
2276        }
2277        pub async fn get_epoch(
2278            &mut self,
2279            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2280        ) -> std::result::Result<
2281            tonic::Response<super::GetEpochResponse>,
2282            tonic::Status,
2283        > {
2284            self.inner
2285                .ready()
2286                .await
2287                .map_err(|e| {
2288                    tonic::Status::unknown(
2289                        format!("Service was not ready: {}", e.into()),
2290                    )
2291                })?;
2292            let codec = tonic_prost::ProstCodec::default();
2293            let path = http::uri::PathAndQuery::from_static(
2294                "/sui.rpc.v2.LedgerService/GetEpoch",
2295            );
2296            let mut req = request.into_request();
2297            req.extensions_mut()
2298                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2299            self.inner.unary(req, path, codec).await
2300        }
2301    }
2302}
2303/// Generated server implementations.
2304pub mod ledger_service_server {
2305    #![allow(
2306        unused_variables,
2307        dead_code,
2308        missing_docs,
2309        clippy::wildcard_imports,
2310        clippy::let_unit_value,
2311    )]
2312    use tonic::codegen::*;
2313    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2314    #[async_trait]
2315    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2316        /// Query the service for general information about its current state.
2317        async fn get_service_info(
2318            &self,
2319            request: tonic::Request<super::GetServiceInfoRequest>,
2320        ) -> std::result::Result<
2321            tonic::Response<super::GetServiceInfoResponse>,
2322            tonic::Status,
2323        > {
2324            Err(tonic::Status::unimplemented("Not yet implemented"))
2325        }
2326        async fn get_object(
2327            &self,
2328            request: tonic::Request<super::GetObjectRequest>,
2329        ) -> std::result::Result<
2330            tonic::Response<super::GetObjectResponse>,
2331            tonic::Status,
2332        > {
2333            Err(tonic::Status::unimplemented("Not yet implemented"))
2334        }
2335        async fn batch_get_objects(
2336            &self,
2337            request: tonic::Request<super::BatchGetObjectsRequest>,
2338        ) -> std::result::Result<
2339            tonic::Response<super::BatchGetObjectsResponse>,
2340            tonic::Status,
2341        > {
2342            Err(tonic::Status::unimplemented("Not yet implemented"))
2343        }
2344        async fn get_transaction(
2345            &self,
2346            request: tonic::Request<super::GetTransactionRequest>,
2347        ) -> std::result::Result<
2348            tonic::Response<super::GetTransactionResponse>,
2349            tonic::Status,
2350        > {
2351            Err(tonic::Status::unimplemented("Not yet implemented"))
2352        }
2353        async fn batch_get_transactions(
2354            &self,
2355            request: tonic::Request<super::BatchGetTransactionsRequest>,
2356        ) -> std::result::Result<
2357            tonic::Response<super::BatchGetTransactionsResponse>,
2358            tonic::Status,
2359        > {
2360            Err(tonic::Status::unimplemented("Not yet implemented"))
2361        }
2362        async fn get_checkpoint(
2363            &self,
2364            request: tonic::Request<super::GetCheckpointRequest>,
2365        ) -> std::result::Result<
2366            tonic::Response<super::GetCheckpointResponse>,
2367            tonic::Status,
2368        > {
2369            Err(tonic::Status::unimplemented("Not yet implemented"))
2370        }
2371        async fn get_epoch(
2372            &self,
2373            request: tonic::Request<super::GetEpochRequest>,
2374        ) -> std::result::Result<
2375            tonic::Response<super::GetEpochResponse>,
2376            tonic::Status,
2377        > {
2378            Err(tonic::Status::unimplemented("Not yet implemented"))
2379        }
2380    }
2381    #[derive(Debug)]
2382    pub struct LedgerServiceServer<T> {
2383        inner: Arc<T>,
2384        accept_compression_encodings: EnabledCompressionEncodings,
2385        send_compression_encodings: EnabledCompressionEncodings,
2386        max_decoding_message_size: Option<usize>,
2387        max_encoding_message_size: Option<usize>,
2388    }
2389    impl<T> LedgerServiceServer<T> {
2390        pub fn new(inner: T) -> Self {
2391            Self::from_arc(Arc::new(inner))
2392        }
2393        pub fn from_arc(inner: Arc<T>) -> Self {
2394            Self {
2395                inner,
2396                accept_compression_encodings: Default::default(),
2397                send_compression_encodings: Default::default(),
2398                max_decoding_message_size: None,
2399                max_encoding_message_size: None,
2400            }
2401        }
2402        pub fn with_interceptor<F>(
2403            inner: T,
2404            interceptor: F,
2405        ) -> InterceptedService<Self, F>
2406        where
2407            F: tonic::service::Interceptor,
2408        {
2409            InterceptedService::new(Self::new(inner), interceptor)
2410        }
2411        /// Enable decompressing requests with the given encoding.
2412        #[must_use]
2413        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2414            self.accept_compression_encodings.enable(encoding);
2415            self
2416        }
2417        /// Compress responses with the given encoding, if the client supports it.
2418        #[must_use]
2419        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2420            self.send_compression_encodings.enable(encoding);
2421            self
2422        }
2423        /// Limits the maximum size of a decoded message.
2424        ///
2425        /// Default: `4MB`
2426        #[must_use]
2427        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2428            self.max_decoding_message_size = Some(limit);
2429            self
2430        }
2431        /// Limits the maximum size of an encoded message.
2432        ///
2433        /// Default: `usize::MAX`
2434        #[must_use]
2435        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2436            self.max_encoding_message_size = Some(limit);
2437            self
2438        }
2439    }
2440    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2441    where
2442        T: LedgerService,
2443        B: Body + std::marker::Send + 'static,
2444        B::Error: Into<StdError> + std::marker::Send + 'static,
2445    {
2446        type Response = http::Response<tonic::body::Body>;
2447        type Error = std::convert::Infallible;
2448        type Future = BoxFuture<Self::Response, Self::Error>;
2449        fn poll_ready(
2450            &mut self,
2451            _cx: &mut Context<'_>,
2452        ) -> Poll<std::result::Result<(), Self::Error>> {
2453            Poll::Ready(Ok(()))
2454        }
2455        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2456            match req.uri().path() {
2457                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2458                    #[allow(non_camel_case_types)]
2459                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2460                    impl<
2461                        T: LedgerService,
2462                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
2463                    for GetServiceInfoSvc<T> {
2464                        type Response = super::GetServiceInfoResponse;
2465                        type Future = BoxFuture<
2466                            tonic::Response<Self::Response>,
2467                            tonic::Status,
2468                        >;
2469                        fn call(
2470                            &mut self,
2471                            request: tonic::Request<super::GetServiceInfoRequest>,
2472                        ) -> Self::Future {
2473                            let inner = Arc::clone(&self.0);
2474                            let fut = async move {
2475                                <T as LedgerService>::get_service_info(&inner, request)
2476                                    .await
2477                            };
2478                            Box::pin(fut)
2479                        }
2480                    }
2481                    let accept_compression_encodings = self.accept_compression_encodings;
2482                    let send_compression_encodings = self.send_compression_encodings;
2483                    let max_decoding_message_size = self.max_decoding_message_size;
2484                    let max_encoding_message_size = self.max_encoding_message_size;
2485                    let inner = self.inner.clone();
2486                    let fut = async move {
2487                        let method = GetServiceInfoSvc(inner);
2488                        let codec = tonic_prost::ProstCodec::default();
2489                        let mut grpc = tonic::server::Grpc::new(codec)
2490                            .apply_compression_config(
2491                                accept_compression_encodings,
2492                                send_compression_encodings,
2493                            )
2494                            .apply_max_message_size_config(
2495                                max_decoding_message_size,
2496                                max_encoding_message_size,
2497                            );
2498                        let res = grpc.unary(method, req).await;
2499                        Ok(res)
2500                    };
2501                    Box::pin(fut)
2502                }
2503                "/sui.rpc.v2.LedgerService/GetObject" => {
2504                    #[allow(non_camel_case_types)]
2505                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
2506                    impl<
2507                        T: LedgerService,
2508                    > tonic::server::UnaryService<super::GetObjectRequest>
2509                    for GetObjectSvc<T> {
2510                        type Response = super::GetObjectResponse;
2511                        type Future = BoxFuture<
2512                            tonic::Response<Self::Response>,
2513                            tonic::Status,
2514                        >;
2515                        fn call(
2516                            &mut self,
2517                            request: tonic::Request<super::GetObjectRequest>,
2518                        ) -> Self::Future {
2519                            let inner = Arc::clone(&self.0);
2520                            let fut = async move {
2521                                <T as LedgerService>::get_object(&inner, request).await
2522                            };
2523                            Box::pin(fut)
2524                        }
2525                    }
2526                    let accept_compression_encodings = self.accept_compression_encodings;
2527                    let send_compression_encodings = self.send_compression_encodings;
2528                    let max_decoding_message_size = self.max_decoding_message_size;
2529                    let max_encoding_message_size = self.max_encoding_message_size;
2530                    let inner = self.inner.clone();
2531                    let fut = async move {
2532                        let method = GetObjectSvc(inner);
2533                        let codec = tonic_prost::ProstCodec::default();
2534                        let mut grpc = tonic::server::Grpc::new(codec)
2535                            .apply_compression_config(
2536                                accept_compression_encodings,
2537                                send_compression_encodings,
2538                            )
2539                            .apply_max_message_size_config(
2540                                max_decoding_message_size,
2541                                max_encoding_message_size,
2542                            );
2543                        let res = grpc.unary(method, req).await;
2544                        Ok(res)
2545                    };
2546                    Box::pin(fut)
2547                }
2548                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
2549                    #[allow(non_camel_case_types)]
2550                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
2551                    impl<
2552                        T: LedgerService,
2553                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
2554                    for BatchGetObjectsSvc<T> {
2555                        type Response = super::BatchGetObjectsResponse;
2556                        type Future = BoxFuture<
2557                            tonic::Response<Self::Response>,
2558                            tonic::Status,
2559                        >;
2560                        fn call(
2561                            &mut self,
2562                            request: tonic::Request<super::BatchGetObjectsRequest>,
2563                        ) -> Self::Future {
2564                            let inner = Arc::clone(&self.0);
2565                            let fut = async move {
2566                                <T as LedgerService>::batch_get_objects(&inner, request)
2567                                    .await
2568                            };
2569                            Box::pin(fut)
2570                        }
2571                    }
2572                    let accept_compression_encodings = self.accept_compression_encodings;
2573                    let send_compression_encodings = self.send_compression_encodings;
2574                    let max_decoding_message_size = self.max_decoding_message_size;
2575                    let max_encoding_message_size = self.max_encoding_message_size;
2576                    let inner = self.inner.clone();
2577                    let fut = async move {
2578                        let method = BatchGetObjectsSvc(inner);
2579                        let codec = tonic_prost::ProstCodec::default();
2580                        let mut grpc = tonic::server::Grpc::new(codec)
2581                            .apply_compression_config(
2582                                accept_compression_encodings,
2583                                send_compression_encodings,
2584                            )
2585                            .apply_max_message_size_config(
2586                                max_decoding_message_size,
2587                                max_encoding_message_size,
2588                            );
2589                        let res = grpc.unary(method, req).await;
2590                        Ok(res)
2591                    };
2592                    Box::pin(fut)
2593                }
2594                "/sui.rpc.v2.LedgerService/GetTransaction" => {
2595                    #[allow(non_camel_case_types)]
2596                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
2597                    impl<
2598                        T: LedgerService,
2599                    > tonic::server::UnaryService<super::GetTransactionRequest>
2600                    for GetTransactionSvc<T> {
2601                        type Response = super::GetTransactionResponse;
2602                        type Future = BoxFuture<
2603                            tonic::Response<Self::Response>,
2604                            tonic::Status,
2605                        >;
2606                        fn call(
2607                            &mut self,
2608                            request: tonic::Request<super::GetTransactionRequest>,
2609                        ) -> Self::Future {
2610                            let inner = Arc::clone(&self.0);
2611                            let fut = async move {
2612                                <T as LedgerService>::get_transaction(&inner, request).await
2613                            };
2614                            Box::pin(fut)
2615                        }
2616                    }
2617                    let accept_compression_encodings = self.accept_compression_encodings;
2618                    let send_compression_encodings = self.send_compression_encodings;
2619                    let max_decoding_message_size = self.max_decoding_message_size;
2620                    let max_encoding_message_size = self.max_encoding_message_size;
2621                    let inner = self.inner.clone();
2622                    let fut = async move {
2623                        let method = GetTransactionSvc(inner);
2624                        let codec = tonic_prost::ProstCodec::default();
2625                        let mut grpc = tonic::server::Grpc::new(codec)
2626                            .apply_compression_config(
2627                                accept_compression_encodings,
2628                                send_compression_encodings,
2629                            )
2630                            .apply_max_message_size_config(
2631                                max_decoding_message_size,
2632                                max_encoding_message_size,
2633                            );
2634                        let res = grpc.unary(method, req).await;
2635                        Ok(res)
2636                    };
2637                    Box::pin(fut)
2638                }
2639                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
2640                    #[allow(non_camel_case_types)]
2641                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
2642                    impl<
2643                        T: LedgerService,
2644                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
2645                    for BatchGetTransactionsSvc<T> {
2646                        type Response = super::BatchGetTransactionsResponse;
2647                        type Future = BoxFuture<
2648                            tonic::Response<Self::Response>,
2649                            tonic::Status,
2650                        >;
2651                        fn call(
2652                            &mut self,
2653                            request: tonic::Request<super::BatchGetTransactionsRequest>,
2654                        ) -> Self::Future {
2655                            let inner = Arc::clone(&self.0);
2656                            let fut = async move {
2657                                <T as LedgerService>::batch_get_transactions(
2658                                        &inner,
2659                                        request,
2660                                    )
2661                                    .await
2662                            };
2663                            Box::pin(fut)
2664                        }
2665                    }
2666                    let accept_compression_encodings = self.accept_compression_encodings;
2667                    let send_compression_encodings = self.send_compression_encodings;
2668                    let max_decoding_message_size = self.max_decoding_message_size;
2669                    let max_encoding_message_size = self.max_encoding_message_size;
2670                    let inner = self.inner.clone();
2671                    let fut = async move {
2672                        let method = BatchGetTransactionsSvc(inner);
2673                        let codec = tonic_prost::ProstCodec::default();
2674                        let mut grpc = tonic::server::Grpc::new(codec)
2675                            .apply_compression_config(
2676                                accept_compression_encodings,
2677                                send_compression_encodings,
2678                            )
2679                            .apply_max_message_size_config(
2680                                max_decoding_message_size,
2681                                max_encoding_message_size,
2682                            );
2683                        let res = grpc.unary(method, req).await;
2684                        Ok(res)
2685                    };
2686                    Box::pin(fut)
2687                }
2688                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
2689                    #[allow(non_camel_case_types)]
2690                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
2691                    impl<
2692                        T: LedgerService,
2693                    > tonic::server::UnaryService<super::GetCheckpointRequest>
2694                    for GetCheckpointSvc<T> {
2695                        type Response = super::GetCheckpointResponse;
2696                        type Future = BoxFuture<
2697                            tonic::Response<Self::Response>,
2698                            tonic::Status,
2699                        >;
2700                        fn call(
2701                            &mut self,
2702                            request: tonic::Request<super::GetCheckpointRequest>,
2703                        ) -> Self::Future {
2704                            let inner = Arc::clone(&self.0);
2705                            let fut = async move {
2706                                <T as LedgerService>::get_checkpoint(&inner, request).await
2707                            };
2708                            Box::pin(fut)
2709                        }
2710                    }
2711                    let accept_compression_encodings = self.accept_compression_encodings;
2712                    let send_compression_encodings = self.send_compression_encodings;
2713                    let max_decoding_message_size = self.max_decoding_message_size;
2714                    let max_encoding_message_size = self.max_encoding_message_size;
2715                    let inner = self.inner.clone();
2716                    let fut = async move {
2717                        let method = GetCheckpointSvc(inner);
2718                        let codec = tonic_prost::ProstCodec::default();
2719                        let mut grpc = tonic::server::Grpc::new(codec)
2720                            .apply_compression_config(
2721                                accept_compression_encodings,
2722                                send_compression_encodings,
2723                            )
2724                            .apply_max_message_size_config(
2725                                max_decoding_message_size,
2726                                max_encoding_message_size,
2727                            );
2728                        let res = grpc.unary(method, req).await;
2729                        Ok(res)
2730                    };
2731                    Box::pin(fut)
2732                }
2733                "/sui.rpc.v2.LedgerService/GetEpoch" => {
2734                    #[allow(non_camel_case_types)]
2735                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
2736                    impl<
2737                        T: LedgerService,
2738                    > tonic::server::UnaryService<super::GetEpochRequest>
2739                    for GetEpochSvc<T> {
2740                        type Response = super::GetEpochResponse;
2741                        type Future = BoxFuture<
2742                            tonic::Response<Self::Response>,
2743                            tonic::Status,
2744                        >;
2745                        fn call(
2746                            &mut self,
2747                            request: tonic::Request<super::GetEpochRequest>,
2748                        ) -> Self::Future {
2749                            let inner = Arc::clone(&self.0);
2750                            let fut = async move {
2751                                <T as LedgerService>::get_epoch(&inner, request).await
2752                            };
2753                            Box::pin(fut)
2754                        }
2755                    }
2756                    let accept_compression_encodings = self.accept_compression_encodings;
2757                    let send_compression_encodings = self.send_compression_encodings;
2758                    let max_decoding_message_size = self.max_decoding_message_size;
2759                    let max_encoding_message_size = self.max_encoding_message_size;
2760                    let inner = self.inner.clone();
2761                    let fut = async move {
2762                        let method = GetEpochSvc(inner);
2763                        let codec = tonic_prost::ProstCodec::default();
2764                        let mut grpc = tonic::server::Grpc::new(codec)
2765                            .apply_compression_config(
2766                                accept_compression_encodings,
2767                                send_compression_encodings,
2768                            )
2769                            .apply_max_message_size_config(
2770                                max_decoding_message_size,
2771                                max_encoding_message_size,
2772                            );
2773                        let res = grpc.unary(method, req).await;
2774                        Ok(res)
2775                    };
2776                    Box::pin(fut)
2777                }
2778                _ => {
2779                    Box::pin(async move {
2780                        let mut response = http::Response::new(
2781                            tonic::body::Body::default(),
2782                        );
2783                        let headers = response.headers_mut();
2784                        headers
2785                            .insert(
2786                                tonic::Status::GRPC_STATUS,
2787                                (tonic::Code::Unimplemented as i32).into(),
2788                            );
2789                        headers
2790                            .insert(
2791                                http::header::CONTENT_TYPE,
2792                                tonic::metadata::GRPC_CONTENT_TYPE,
2793                            );
2794                        Ok(response)
2795                    })
2796                }
2797            }
2798        }
2799    }
2800    impl<T> Clone for LedgerServiceServer<T> {
2801        fn clone(&self) -> Self {
2802            let inner = self.inner.clone();
2803            Self {
2804                inner,
2805                accept_compression_encodings: self.accept_compression_encodings,
2806                send_compression_encodings: self.send_compression_encodings,
2807                max_decoding_message_size: self.max_decoding_message_size,
2808                max_encoding_message_size: self.max_encoding_message_size,
2809            }
2810        }
2811    }
2812    /// Generated gRPC service name
2813    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
2814    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
2815        const NAME: &'static str = SERVICE_NAME;
2816    }
2817}
2818/// A Move Package
2819#[non_exhaustive]
2820#[derive(Clone, PartialEq, ::prost::Message)]
2821pub struct Package {
2822    /// The PackageId of this package
2823    ///
2824    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
2825    /// Outside of system packages the `storage_id` for every package version is
2826    /// different.
2827    #[prost(string, optional, tag = "1")]
2828    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
2829    /// The PackageId of the first published version of this package.
2830    ///
2831    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
2832    /// `storage_id` of the first version of this package that has been published.
2833    /// The `original_id`/`runtime_id` is stable across all versions of the
2834    /// package and does not ever change.
2835    #[prost(string, optional, tag = "2")]
2836    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
2837    /// The version of this package
2838    #[prost(uint64, optional, tag = "3")]
2839    pub version: ::core::option::Option<u64>,
2840    /// The modules defined by this package
2841    #[prost(message, repeated, tag = "4")]
2842    pub modules: ::prost::alloc::vec::Vec<Module>,
2843    /// List of datatype origins for mapping datatypes to a package version where
2844    /// it was first defined
2845    #[prost(message, repeated, tag = "5")]
2846    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
2847    /// The package's transitive dependencies as a mapping from the package's
2848    /// runtime Id (the Id it is referred to by in other packages) to its
2849    /// storage Id (the Id it is loaded from on chain).
2850    #[prost(message, repeated, tag = "6")]
2851    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
2852}
2853/// A Move Module.
2854#[non_exhaustive]
2855#[derive(Clone, PartialEq, ::prost::Message)]
2856pub struct Module {
2857    /// Name of this module.
2858    #[prost(string, optional, tag = "1")]
2859    pub name: ::core::option::Option<::prost::alloc::string::String>,
2860    /// Serialized bytecode of the module.
2861    #[prost(bytes = "bytes", optional, tag = "2")]
2862    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
2863    /// List of DataTypes defined by this module.
2864    #[prost(message, repeated, tag = "3")]
2865    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
2866    /// List of Functions defined by this module.
2867    #[prost(message, repeated, tag = "4")]
2868    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
2869}
2870/// Describes a Move Datatype.
2871#[non_exhaustive]
2872#[derive(Clone, PartialEq, ::prost::Message)]
2873pub struct DatatypeDescriptor {
2874    /// Fully qualified name of this Datatype.
2875    ///
2876    /// This is `<defining_id>::<module>::<name>`
2877    #[prost(string, optional, tag = "1")]
2878    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
2879    /// PackageId of the package where this Datatype is defined.
2880    ///
2881    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
2882    #[prost(string, optional, tag = "2")]
2883    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
2884    /// Name of the module where this Datatype is defined
2885    #[prost(string, optional, tag = "3")]
2886    pub module: ::core::option::Option<::prost::alloc::string::String>,
2887    /// Name of this Datatype
2888    #[prost(string, optional, tag = "4")]
2889    pub name: ::core::option::Option<::prost::alloc::string::String>,
2890    /// This type's abilities
2891    #[prost(enumeration = "Ability", repeated, tag = "5")]
2892    pub abilities: ::prost::alloc::vec::Vec<i32>,
2893    /// Ability constraints and phantom status for this type's generic type parameters
2894    #[prost(message, repeated, tag = "6")]
2895    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
2896    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
2897    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
2898    pub kind: ::core::option::Option<i32>,
2899    /// Set of fields if this Datatype is a struct.
2900    ///
2901    /// The order of the entries is the order of how the fields are defined.
2902    #[prost(message, repeated, tag = "8")]
2903    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2904    /// Set of variants if this Datatype is an enum.
2905    ///
2906    /// The order of the entries is the order of how the variants are defined.
2907    #[prost(message, repeated, tag = "9")]
2908    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
2909}
2910/// Nested message and enum types in `DatatypeDescriptor`.
2911pub mod datatype_descriptor {
2912    #[non_exhaustive]
2913    #[derive(
2914        Clone,
2915        Copy,
2916        Debug,
2917        PartialEq,
2918        Eq,
2919        Hash,
2920        PartialOrd,
2921        Ord,
2922        ::prost::Enumeration
2923    )]
2924    #[repr(i32)]
2925    pub enum DatatypeKind {
2926        Unknown = 0,
2927        Struct = 1,
2928        Enum = 2,
2929    }
2930    impl DatatypeKind {
2931        /// String value of the enum field names used in the ProtoBuf definition.
2932        ///
2933        /// The values are not transformed in any way and thus are considered stable
2934        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2935        pub fn as_str_name(&self) -> &'static str {
2936            match self {
2937                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
2938                Self::Struct => "STRUCT",
2939                Self::Enum => "ENUM",
2940            }
2941        }
2942        /// Creates an enum from field names used in the ProtoBuf definition.
2943        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2944            match value {
2945                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
2946                "STRUCT" => Some(Self::Struct),
2947                "ENUM" => Some(Self::Enum),
2948                _ => None,
2949            }
2950        }
2951    }
2952}
2953/// A generic type parameter used in the declaration of a struct or enum.
2954#[non_exhaustive]
2955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2956pub struct TypeParameter {
2957    /// The type parameter constraints
2958    #[prost(enumeration = "Ability", repeated, tag = "1")]
2959    pub constraints: ::prost::alloc::vec::Vec<i32>,
2960    /// Whether the parameter is declared as phantom
2961    #[prost(bool, optional, tag = "2")]
2962    pub is_phantom: ::core::option::Option<bool>,
2963}
2964/// Descriptor of a field that belongs to a struct or enum variant
2965#[non_exhaustive]
2966#[derive(Clone, PartialEq, ::prost::Message)]
2967pub struct FieldDescriptor {
2968    /// Name of the field
2969    #[prost(string, optional, tag = "1")]
2970    pub name: ::core::option::Option<::prost::alloc::string::String>,
2971    /// Order or position of the field in the struct or enum variant definition.
2972    #[prost(uint32, optional, tag = "2")]
2973    pub position: ::core::option::Option<u32>,
2974    /// The type of the field
2975    #[prost(message, optional, tag = "3")]
2976    pub r#type: ::core::option::Option<OpenSignatureBody>,
2977}
2978/// Descriptor of an enum variant
2979#[non_exhaustive]
2980#[derive(Clone, PartialEq, ::prost::Message)]
2981pub struct VariantDescriptor {
2982    /// Name of the variant
2983    #[prost(string, optional, tag = "1")]
2984    pub name: ::core::option::Option<::prost::alloc::string::String>,
2985    /// Order or position of the variant in the enum definition.
2986    #[prost(uint32, optional, tag = "2")]
2987    pub position: ::core::option::Option<u32>,
2988    /// Set of fields defined by this variant.
2989    #[prost(message, repeated, tag = "3")]
2990    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
2991}
2992/// Representation of a type signature that could appear as a field type for a struct or enum
2993#[non_exhaustive]
2994#[derive(Clone, PartialEq, ::prost::Message)]
2995pub struct OpenSignatureBody {
2996    /// Type of this signature
2997    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
2998    pub r#type: ::core::option::Option<i32>,
2999    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3000    #[prost(string, optional, tag = "2")]
3001    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3002    /// Set when `type` is `VECTOR` or `DATATYPE`
3003    #[prost(message, repeated, tag = "3")]
3004    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3005    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3006    #[prost(uint32, optional, tag = "4")]
3007    pub type_parameter: ::core::option::Option<u32>,
3008}
3009/// Nested message and enum types in `OpenSignatureBody`.
3010pub mod open_signature_body {
3011    #[non_exhaustive]
3012    #[derive(
3013        Clone,
3014        Copy,
3015        Debug,
3016        PartialEq,
3017        Eq,
3018        Hash,
3019        PartialOrd,
3020        Ord,
3021        ::prost::Enumeration
3022    )]
3023    #[repr(i32)]
3024    pub enum Type {
3025        Unknown = 0,
3026        Address = 1,
3027        Bool = 2,
3028        U8 = 3,
3029        U16 = 4,
3030        U32 = 5,
3031        U64 = 6,
3032        U128 = 7,
3033        U256 = 8,
3034        Vector = 9,
3035        Datatype = 10,
3036        Parameter = 11,
3037    }
3038    impl Type {
3039        /// String value of the enum field names used in the ProtoBuf definition.
3040        ///
3041        /// The values are not transformed in any way and thus are considered stable
3042        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3043        pub fn as_str_name(&self) -> &'static str {
3044            match self {
3045                Self::Unknown => "TYPE_UNKNOWN",
3046                Self::Address => "ADDRESS",
3047                Self::Bool => "BOOL",
3048                Self::U8 => "U8",
3049                Self::U16 => "U16",
3050                Self::U32 => "U32",
3051                Self::U64 => "U64",
3052                Self::U128 => "U128",
3053                Self::U256 => "U256",
3054                Self::Vector => "VECTOR",
3055                Self::Datatype => "DATATYPE",
3056                Self::Parameter => "TYPE_PARAMETER",
3057            }
3058        }
3059        /// Creates an enum from field names used in the ProtoBuf definition.
3060        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3061            match value {
3062                "TYPE_UNKNOWN" => Some(Self::Unknown),
3063                "ADDRESS" => Some(Self::Address),
3064                "BOOL" => Some(Self::Bool),
3065                "U8" => Some(Self::U8),
3066                "U16" => Some(Self::U16),
3067                "U32" => Some(Self::U32),
3068                "U64" => Some(Self::U64),
3069                "U128" => Some(Self::U128),
3070                "U256" => Some(Self::U256),
3071                "VECTOR" => Some(Self::Vector),
3072                "DATATYPE" => Some(Self::Datatype),
3073                "TYPE_PARAMETER" => Some(Self::Parameter),
3074                _ => None,
3075            }
3076        }
3077    }
3078}
3079/// Descriptor of a Move function
3080#[non_exhaustive]
3081#[derive(Clone, PartialEq, ::prost::Message)]
3082pub struct FunctionDescriptor {
3083    /// Name of the function
3084    #[prost(string, optional, tag = "1")]
3085    pub name: ::core::option::Option<::prost::alloc::string::String>,
3086    /// Whether the function is `public`, `private` or `public(friend)`
3087    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3088    pub visibility: ::core::option::Option<i32>,
3089    /// Whether the function is marked `entry` or not.
3090    #[prost(bool, optional, tag = "6")]
3091    pub is_entry: ::core::option::Option<bool>,
3092    /// Ability constraints for type parameters
3093    #[prost(message, repeated, tag = "7")]
3094    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3095    /// Formal parameter types.
3096    #[prost(message, repeated, tag = "8")]
3097    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3098    /// Return types.
3099    #[prost(message, repeated, tag = "9")]
3100    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3101}
3102/// Nested message and enum types in `FunctionDescriptor`.
3103pub mod function_descriptor {
3104    #[non_exhaustive]
3105    #[derive(
3106        Clone,
3107        Copy,
3108        Debug,
3109        PartialEq,
3110        Eq,
3111        Hash,
3112        PartialOrd,
3113        Ord,
3114        ::prost::Enumeration
3115    )]
3116    #[repr(i32)]
3117    pub enum Visibility {
3118        Unknown = 0,
3119        Private = 1,
3120        Public = 2,
3121        Friend = 3,
3122    }
3123    impl Visibility {
3124        /// String value of the enum field names used in the ProtoBuf definition.
3125        ///
3126        /// The values are not transformed in any way and thus are considered stable
3127        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3128        pub fn as_str_name(&self) -> &'static str {
3129            match self {
3130                Self::Unknown => "VISIBILITY_UNKNOWN",
3131                Self::Private => "PRIVATE",
3132                Self::Public => "PUBLIC",
3133                Self::Friend => "FRIEND",
3134            }
3135        }
3136        /// Creates an enum from field names used in the ProtoBuf definition.
3137        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3138            match value {
3139                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3140                "PRIVATE" => Some(Self::Private),
3141                "PUBLIC" => Some(Self::Public),
3142                "FRIEND" => Some(Self::Friend),
3143                _ => None,
3144            }
3145        }
3146    }
3147}
3148/// Representation of a type signature that could appear as a function parameter or return value.
3149#[non_exhaustive]
3150#[derive(Clone, PartialEq, ::prost::Message)]
3151pub struct OpenSignature {
3152    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3153    pub reference: ::core::option::Option<i32>,
3154    #[prost(message, optional, tag = "2")]
3155    pub body: ::core::option::Option<OpenSignatureBody>,
3156}
3157/// Nested message and enum types in `OpenSignature`.
3158pub mod open_signature {
3159    #[non_exhaustive]
3160    #[derive(
3161        Clone,
3162        Copy,
3163        Debug,
3164        PartialEq,
3165        Eq,
3166        Hash,
3167        PartialOrd,
3168        Ord,
3169        ::prost::Enumeration
3170    )]
3171    #[repr(i32)]
3172    pub enum Reference {
3173        Unknown = 0,
3174        Immutable = 1,
3175        Mutable = 2,
3176    }
3177    impl Reference {
3178        /// String value of the enum field names used in the ProtoBuf definition.
3179        ///
3180        /// The values are not transformed in any way and thus are considered stable
3181        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3182        pub fn as_str_name(&self) -> &'static str {
3183            match self {
3184                Self::Unknown => "REFERENCE_UNKNOWN",
3185                Self::Immutable => "IMMUTABLE",
3186                Self::Mutable => "MUTABLE",
3187            }
3188        }
3189        /// Creates an enum from field names used in the ProtoBuf definition.
3190        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3191            match value {
3192                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3193                "IMMUTABLE" => Some(Self::Immutable),
3194                "MUTABLE" => Some(Self::Mutable),
3195                _ => None,
3196            }
3197        }
3198    }
3199}
3200/// Identifies a struct and the module it was defined in.
3201#[non_exhaustive]
3202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3203pub struct TypeOrigin {
3204    #[prost(string, optional, tag = "1")]
3205    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3206    #[prost(string, optional, tag = "2")]
3207    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3208    #[prost(string, optional, tag = "3")]
3209    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3210}
3211/// Upgraded package info for the linkage table.
3212#[non_exhaustive]
3213#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3214pub struct Linkage {
3215    /// Id of the original package.
3216    #[prost(string, optional, tag = "1")]
3217    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3218    /// Id of the upgraded package.
3219    #[prost(string, optional, tag = "2")]
3220    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3221    /// Version of the upgraded package.
3222    #[prost(uint64, optional, tag = "3")]
3223    pub upgraded_version: ::core::option::Option<u64>,
3224}
3225/// An `Ability` classifies what operations are permitted for a given type
3226#[non_exhaustive]
3227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3228#[repr(i32)]
3229pub enum Ability {
3230    Unknown = 0,
3231    /// Allows values of types with this ability to be copied
3232    Copy = 1,
3233    /// Allows values of types with this ability to be dropped.
3234    Drop = 2,
3235    /// Allows values of types with this ability to exist inside a struct in global storage
3236    Store = 3,
3237    /// Allows the type to serve as a key for global storage operations
3238    Key = 4,
3239}
3240impl Ability {
3241    /// String value of the enum field names used in the ProtoBuf definition.
3242    ///
3243    /// The values are not transformed in any way and thus are considered stable
3244    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3245    pub fn as_str_name(&self) -> &'static str {
3246        match self {
3247            Self::Unknown => "ABILITY_UNKNOWN",
3248            Self::Copy => "COPY",
3249            Self::Drop => "DROP",
3250            Self::Store => "STORE",
3251            Self::Key => "KEY",
3252        }
3253    }
3254    /// Creates an enum from field names used in the ProtoBuf definition.
3255    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3256        match value {
3257            "ABILITY_UNKNOWN" => Some(Self::Unknown),
3258            "COPY" => Some(Self::Copy),
3259            "DROP" => Some(Self::Drop),
3260            "STORE" => Some(Self::Store),
3261            "KEY" => Some(Self::Key),
3262            _ => None,
3263        }
3264    }
3265}
3266#[non_exhaustive]
3267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3268pub struct GetPackageRequest {
3269    /// Required. The `storage_id` of the requested package.
3270    #[prost(string, optional, tag = "1")]
3271    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3272}
3273#[non_exhaustive]
3274#[derive(Clone, PartialEq, ::prost::Message)]
3275pub struct GetPackageResponse {
3276    /// The package.
3277    #[prost(message, optional, tag = "1")]
3278    pub package: ::core::option::Option<Package>,
3279}
3280#[non_exhaustive]
3281#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3282pub struct GetDatatypeRequest {
3283    /// Required. The `storage_id` of the requested package.
3284    #[prost(string, optional, tag = "1")]
3285    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3286    /// Required. The name of the requested module.
3287    #[prost(string, optional, tag = "2")]
3288    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3289    /// Required. The name of the requested datatype.
3290    #[prost(string, optional, tag = "3")]
3291    pub name: ::core::option::Option<::prost::alloc::string::String>,
3292}
3293#[non_exhaustive]
3294#[derive(Clone, PartialEq, ::prost::Message)]
3295pub struct GetDatatypeResponse {
3296    /// The datatype.
3297    #[prost(message, optional, tag = "1")]
3298    pub datatype: ::core::option::Option<DatatypeDescriptor>,
3299}
3300#[non_exhaustive]
3301#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3302pub struct GetFunctionRequest {
3303    /// Required. The `storage_id` of the requested package.
3304    #[prost(string, optional, tag = "1")]
3305    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3306    /// Required. The name of the requested module.
3307    #[prost(string, optional, tag = "2")]
3308    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3309    /// Required. The name of the requested function.
3310    #[prost(string, optional, tag = "3")]
3311    pub name: ::core::option::Option<::prost::alloc::string::String>,
3312}
3313#[non_exhaustive]
3314#[derive(Clone, PartialEq, ::prost::Message)]
3315pub struct GetFunctionResponse {
3316    /// The function.
3317    #[prost(message, optional, tag = "1")]
3318    pub function: ::core::option::Option<FunctionDescriptor>,
3319}
3320#[non_exhaustive]
3321#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3322pub struct ListPackageVersionsRequest {
3323    /// Required. The `storage_id` of any version of the package.
3324    #[prost(string, optional, tag = "1")]
3325    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3326    /// The maximum number of versions to return. The service may return fewer than this value.
3327    /// If unspecified, at most `1000` entries will be returned.
3328    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
3329    #[prost(uint32, optional, tag = "2")]
3330    pub page_size: ::core::option::Option<u32>,
3331    /// A page token, received from a previous `ListPackageVersions` call.
3332    /// Provide this to retrieve the subsequent page.
3333    ///
3334    /// When paginating, all other parameters provided to `ListPackageVersions` must
3335    /// match the call that provided the page token.
3336    #[prost(bytes = "bytes", optional, tag = "3")]
3337    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3338}
3339#[non_exhaustive]
3340#[derive(Clone, PartialEq, ::prost::Message)]
3341pub struct ListPackageVersionsResponse {
3342    /// List of all package versions, ordered by version.
3343    #[prost(message, repeated, tag = "1")]
3344    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
3345    /// A token, which can be sent as `page_token` to retrieve the next page.
3346    /// If this field is omitted, there are no subsequent pages.
3347    #[prost(bytes = "bytes", optional, tag = "2")]
3348    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
3349}
3350/// A simplified representation of a package version
3351#[non_exhaustive]
3352#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3353pub struct PackageVersion {
3354    /// The storage ID of this package version
3355    #[prost(string, optional, tag = "1")]
3356    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3357    /// The version number
3358    #[prost(uint64, optional, tag = "2")]
3359    pub version: ::core::option::Option<u64>,
3360}
3361/// Generated client implementations.
3362pub mod move_package_service_client {
3363    #![allow(
3364        unused_variables,
3365        dead_code,
3366        missing_docs,
3367        clippy::wildcard_imports,
3368        clippy::let_unit_value,
3369    )]
3370    use tonic::codegen::*;
3371    use tonic::codegen::http::Uri;
3372    #[derive(Debug, Clone)]
3373    pub struct MovePackageServiceClient<T> {
3374        inner: tonic::client::Grpc<T>,
3375    }
3376    impl MovePackageServiceClient<tonic::transport::Channel> {
3377        /// Attempt to create a new client by connecting to a given endpoint.
3378        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3379        where
3380            D: TryInto<tonic::transport::Endpoint>,
3381            D::Error: Into<StdError>,
3382        {
3383            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3384            Ok(Self::new(conn))
3385        }
3386    }
3387    impl<T> MovePackageServiceClient<T>
3388    where
3389        T: tonic::client::GrpcService<tonic::body::Body>,
3390        T::Error: Into<StdError>,
3391        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
3392        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
3393    {
3394        pub fn new(inner: T) -> Self {
3395            let inner = tonic::client::Grpc::new(inner);
3396            Self { inner }
3397        }
3398        pub fn with_origin(inner: T, origin: Uri) -> Self {
3399            let inner = tonic::client::Grpc::with_origin(inner, origin);
3400            Self { inner }
3401        }
3402        pub fn with_interceptor<F>(
3403            inner: T,
3404            interceptor: F,
3405        ) -> MovePackageServiceClient<InterceptedService<T, F>>
3406        where
3407            F: tonic::service::Interceptor,
3408            T::ResponseBody: Default,
3409            T: tonic::codegen::Service<
3410                http::Request<tonic::body::Body>,
3411                Response = http::Response<
3412                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
3413                >,
3414            >,
3415            <T as tonic::codegen::Service<
3416                http::Request<tonic::body::Body>,
3417            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
3418        {
3419            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
3420        }
3421        /// Compress requests with the given encoding.
3422        ///
3423        /// This requires the server to support it otherwise it might respond with an
3424        /// error.
3425        #[must_use]
3426        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3427            self.inner = self.inner.send_compressed(encoding);
3428            self
3429        }
3430        /// Enable decompressing responses.
3431        #[must_use]
3432        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3433            self.inner = self.inner.accept_compressed(encoding);
3434            self
3435        }
3436        /// Limits the maximum size of a decoded message.
3437        ///
3438        /// Default: `4MB`
3439        #[must_use]
3440        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3441            self.inner = self.inner.max_decoding_message_size(limit);
3442            self
3443        }
3444        /// Limits the maximum size of an encoded message.
3445        ///
3446        /// Default: `usize::MAX`
3447        #[must_use]
3448        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3449            self.inner = self.inner.max_encoding_message_size(limit);
3450            self
3451        }
3452        pub async fn get_package(
3453            &mut self,
3454            request: impl tonic::IntoRequest<super::GetPackageRequest>,
3455        ) -> std::result::Result<
3456            tonic::Response<super::GetPackageResponse>,
3457            tonic::Status,
3458        > {
3459            self.inner
3460                .ready()
3461                .await
3462                .map_err(|e| {
3463                    tonic::Status::unknown(
3464                        format!("Service was not ready: {}", e.into()),
3465                    )
3466                })?;
3467            let codec = tonic_prost::ProstCodec::default();
3468            let path = http::uri::PathAndQuery::from_static(
3469                "/sui.rpc.v2.MovePackageService/GetPackage",
3470            );
3471            let mut req = request.into_request();
3472            req.extensions_mut()
3473                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
3474            self.inner.unary(req, path, codec).await
3475        }
3476        pub async fn get_datatype(
3477            &mut self,
3478            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
3479        ) -> std::result::Result<
3480            tonic::Response<super::GetDatatypeResponse>,
3481            tonic::Status,
3482        > {
3483            self.inner
3484                .ready()
3485                .await
3486                .map_err(|e| {
3487                    tonic::Status::unknown(
3488                        format!("Service was not ready: {}", e.into()),
3489                    )
3490                })?;
3491            let codec = tonic_prost::ProstCodec::default();
3492            let path = http::uri::PathAndQuery::from_static(
3493                "/sui.rpc.v2.MovePackageService/GetDatatype",
3494            );
3495            let mut req = request.into_request();
3496            req.extensions_mut()
3497                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
3498            self.inner.unary(req, path, codec).await
3499        }
3500        pub async fn get_function(
3501            &mut self,
3502            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
3503        ) -> std::result::Result<
3504            tonic::Response<super::GetFunctionResponse>,
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.MovePackageService/GetFunction",
3518            );
3519            let mut req = request.into_request();
3520            req.extensions_mut()
3521                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
3522            self.inner.unary(req, path, codec).await
3523        }
3524        pub async fn list_package_versions(
3525            &mut self,
3526            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
3527        ) -> std::result::Result<
3528            tonic::Response<super::ListPackageVersionsResponse>,
3529            tonic::Status,
3530        > {
3531            self.inner
3532                .ready()
3533                .await
3534                .map_err(|e| {
3535                    tonic::Status::unknown(
3536                        format!("Service was not ready: {}", e.into()),
3537                    )
3538                })?;
3539            let codec = tonic_prost::ProstCodec::default();
3540            let path = http::uri::PathAndQuery::from_static(
3541                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
3542            );
3543            let mut req = request.into_request();
3544            req.extensions_mut()
3545                .insert(
3546                    GrpcMethod::new(
3547                        "sui.rpc.v2.MovePackageService",
3548                        "ListPackageVersions",
3549                    ),
3550                );
3551            self.inner.unary(req, path, codec).await
3552        }
3553    }
3554}
3555/// Generated server implementations.
3556pub mod move_package_service_server {
3557    #![allow(
3558        unused_variables,
3559        dead_code,
3560        missing_docs,
3561        clippy::wildcard_imports,
3562        clippy::let_unit_value,
3563    )]
3564    use tonic::codegen::*;
3565    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
3566    #[async_trait]
3567    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
3568        async fn get_package(
3569            &self,
3570            request: tonic::Request<super::GetPackageRequest>,
3571        ) -> std::result::Result<
3572            tonic::Response<super::GetPackageResponse>,
3573            tonic::Status,
3574        > {
3575            Err(tonic::Status::unimplemented("Not yet implemented"))
3576        }
3577        async fn get_datatype(
3578            &self,
3579            request: tonic::Request<super::GetDatatypeRequest>,
3580        ) -> std::result::Result<
3581            tonic::Response<super::GetDatatypeResponse>,
3582            tonic::Status,
3583        > {
3584            Err(tonic::Status::unimplemented("Not yet implemented"))
3585        }
3586        async fn get_function(
3587            &self,
3588            request: tonic::Request<super::GetFunctionRequest>,
3589        ) -> std::result::Result<
3590            tonic::Response<super::GetFunctionResponse>,
3591            tonic::Status,
3592        > {
3593            Err(tonic::Status::unimplemented("Not yet implemented"))
3594        }
3595        async fn list_package_versions(
3596            &self,
3597            request: tonic::Request<super::ListPackageVersionsRequest>,
3598        ) -> std::result::Result<
3599            tonic::Response<super::ListPackageVersionsResponse>,
3600            tonic::Status,
3601        > {
3602            Err(tonic::Status::unimplemented("Not yet implemented"))
3603        }
3604    }
3605    #[derive(Debug)]
3606    pub struct MovePackageServiceServer<T> {
3607        inner: Arc<T>,
3608        accept_compression_encodings: EnabledCompressionEncodings,
3609        send_compression_encodings: EnabledCompressionEncodings,
3610        max_decoding_message_size: Option<usize>,
3611        max_encoding_message_size: Option<usize>,
3612    }
3613    impl<T> MovePackageServiceServer<T> {
3614        pub fn new(inner: T) -> Self {
3615            Self::from_arc(Arc::new(inner))
3616        }
3617        pub fn from_arc(inner: Arc<T>) -> Self {
3618            Self {
3619                inner,
3620                accept_compression_encodings: Default::default(),
3621                send_compression_encodings: Default::default(),
3622                max_decoding_message_size: None,
3623                max_encoding_message_size: None,
3624            }
3625        }
3626        pub fn with_interceptor<F>(
3627            inner: T,
3628            interceptor: F,
3629        ) -> InterceptedService<Self, F>
3630        where
3631            F: tonic::service::Interceptor,
3632        {
3633            InterceptedService::new(Self::new(inner), interceptor)
3634        }
3635        /// Enable decompressing requests with the given encoding.
3636        #[must_use]
3637        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3638            self.accept_compression_encodings.enable(encoding);
3639            self
3640        }
3641        /// Compress responses with the given encoding, if the client supports it.
3642        #[must_use]
3643        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3644            self.send_compression_encodings.enable(encoding);
3645            self
3646        }
3647        /// Limits the maximum size of a decoded message.
3648        ///
3649        /// Default: `4MB`
3650        #[must_use]
3651        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3652            self.max_decoding_message_size = Some(limit);
3653            self
3654        }
3655        /// Limits the maximum size of an encoded message.
3656        ///
3657        /// Default: `usize::MAX`
3658        #[must_use]
3659        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3660            self.max_encoding_message_size = Some(limit);
3661            self
3662        }
3663    }
3664    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
3665    where
3666        T: MovePackageService,
3667        B: Body + std::marker::Send + 'static,
3668        B::Error: Into<StdError> + std::marker::Send + 'static,
3669    {
3670        type Response = http::Response<tonic::body::Body>;
3671        type Error = std::convert::Infallible;
3672        type Future = BoxFuture<Self::Response, Self::Error>;
3673        fn poll_ready(
3674            &mut self,
3675            _cx: &mut Context<'_>,
3676        ) -> Poll<std::result::Result<(), Self::Error>> {
3677            Poll::Ready(Ok(()))
3678        }
3679        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3680            match req.uri().path() {
3681                "/sui.rpc.v2.MovePackageService/GetPackage" => {
3682                    #[allow(non_camel_case_types)]
3683                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
3684                    impl<
3685                        T: MovePackageService,
3686                    > tonic::server::UnaryService<super::GetPackageRequest>
3687                    for GetPackageSvc<T> {
3688                        type Response = super::GetPackageResponse;
3689                        type Future = BoxFuture<
3690                            tonic::Response<Self::Response>,
3691                            tonic::Status,
3692                        >;
3693                        fn call(
3694                            &mut self,
3695                            request: tonic::Request<super::GetPackageRequest>,
3696                        ) -> Self::Future {
3697                            let inner = Arc::clone(&self.0);
3698                            let fut = async move {
3699                                <T as MovePackageService>::get_package(&inner, request)
3700                                    .await
3701                            };
3702                            Box::pin(fut)
3703                        }
3704                    }
3705                    let accept_compression_encodings = self.accept_compression_encodings;
3706                    let send_compression_encodings = self.send_compression_encodings;
3707                    let max_decoding_message_size = self.max_decoding_message_size;
3708                    let max_encoding_message_size = self.max_encoding_message_size;
3709                    let inner = self.inner.clone();
3710                    let fut = async move {
3711                        let method = GetPackageSvc(inner);
3712                        let codec = tonic_prost::ProstCodec::default();
3713                        let mut grpc = tonic::server::Grpc::new(codec)
3714                            .apply_compression_config(
3715                                accept_compression_encodings,
3716                                send_compression_encodings,
3717                            )
3718                            .apply_max_message_size_config(
3719                                max_decoding_message_size,
3720                                max_encoding_message_size,
3721                            );
3722                        let res = grpc.unary(method, req).await;
3723                        Ok(res)
3724                    };
3725                    Box::pin(fut)
3726                }
3727                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
3728                    #[allow(non_camel_case_types)]
3729                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
3730                    impl<
3731                        T: MovePackageService,
3732                    > tonic::server::UnaryService<super::GetDatatypeRequest>
3733                    for GetDatatypeSvc<T> {
3734                        type Response = super::GetDatatypeResponse;
3735                        type Future = BoxFuture<
3736                            tonic::Response<Self::Response>,
3737                            tonic::Status,
3738                        >;
3739                        fn call(
3740                            &mut self,
3741                            request: tonic::Request<super::GetDatatypeRequest>,
3742                        ) -> Self::Future {
3743                            let inner = Arc::clone(&self.0);
3744                            let fut = async move {
3745                                <T as MovePackageService>::get_datatype(&inner, request)
3746                                    .await
3747                            };
3748                            Box::pin(fut)
3749                        }
3750                    }
3751                    let accept_compression_encodings = self.accept_compression_encodings;
3752                    let send_compression_encodings = self.send_compression_encodings;
3753                    let max_decoding_message_size = self.max_decoding_message_size;
3754                    let max_encoding_message_size = self.max_encoding_message_size;
3755                    let inner = self.inner.clone();
3756                    let fut = async move {
3757                        let method = GetDatatypeSvc(inner);
3758                        let codec = tonic_prost::ProstCodec::default();
3759                        let mut grpc = tonic::server::Grpc::new(codec)
3760                            .apply_compression_config(
3761                                accept_compression_encodings,
3762                                send_compression_encodings,
3763                            )
3764                            .apply_max_message_size_config(
3765                                max_decoding_message_size,
3766                                max_encoding_message_size,
3767                            );
3768                        let res = grpc.unary(method, req).await;
3769                        Ok(res)
3770                    };
3771                    Box::pin(fut)
3772                }
3773                "/sui.rpc.v2.MovePackageService/GetFunction" => {
3774                    #[allow(non_camel_case_types)]
3775                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
3776                    impl<
3777                        T: MovePackageService,
3778                    > tonic::server::UnaryService<super::GetFunctionRequest>
3779                    for GetFunctionSvc<T> {
3780                        type Response = super::GetFunctionResponse;
3781                        type Future = BoxFuture<
3782                            tonic::Response<Self::Response>,
3783                            tonic::Status,
3784                        >;
3785                        fn call(
3786                            &mut self,
3787                            request: tonic::Request<super::GetFunctionRequest>,
3788                        ) -> Self::Future {
3789                            let inner = Arc::clone(&self.0);
3790                            let fut = async move {
3791                                <T as MovePackageService>::get_function(&inner, request)
3792                                    .await
3793                            };
3794                            Box::pin(fut)
3795                        }
3796                    }
3797                    let accept_compression_encodings = self.accept_compression_encodings;
3798                    let send_compression_encodings = self.send_compression_encodings;
3799                    let max_decoding_message_size = self.max_decoding_message_size;
3800                    let max_encoding_message_size = self.max_encoding_message_size;
3801                    let inner = self.inner.clone();
3802                    let fut = async move {
3803                        let method = GetFunctionSvc(inner);
3804                        let codec = tonic_prost::ProstCodec::default();
3805                        let mut grpc = tonic::server::Grpc::new(codec)
3806                            .apply_compression_config(
3807                                accept_compression_encodings,
3808                                send_compression_encodings,
3809                            )
3810                            .apply_max_message_size_config(
3811                                max_decoding_message_size,
3812                                max_encoding_message_size,
3813                            );
3814                        let res = grpc.unary(method, req).await;
3815                        Ok(res)
3816                    };
3817                    Box::pin(fut)
3818                }
3819                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
3820                    #[allow(non_camel_case_types)]
3821                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
3822                    impl<
3823                        T: MovePackageService,
3824                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
3825                    for ListPackageVersionsSvc<T> {
3826                        type Response = super::ListPackageVersionsResponse;
3827                        type Future = BoxFuture<
3828                            tonic::Response<Self::Response>,
3829                            tonic::Status,
3830                        >;
3831                        fn call(
3832                            &mut self,
3833                            request: tonic::Request<super::ListPackageVersionsRequest>,
3834                        ) -> Self::Future {
3835                            let inner = Arc::clone(&self.0);
3836                            let fut = async move {
3837                                <T as MovePackageService>::list_package_versions(
3838                                        &inner,
3839                                        request,
3840                                    )
3841                                    .await
3842                            };
3843                            Box::pin(fut)
3844                        }
3845                    }
3846                    let accept_compression_encodings = self.accept_compression_encodings;
3847                    let send_compression_encodings = self.send_compression_encodings;
3848                    let max_decoding_message_size = self.max_decoding_message_size;
3849                    let max_encoding_message_size = self.max_encoding_message_size;
3850                    let inner = self.inner.clone();
3851                    let fut = async move {
3852                        let method = ListPackageVersionsSvc(inner);
3853                        let codec = tonic_prost::ProstCodec::default();
3854                        let mut grpc = tonic::server::Grpc::new(codec)
3855                            .apply_compression_config(
3856                                accept_compression_encodings,
3857                                send_compression_encodings,
3858                            )
3859                            .apply_max_message_size_config(
3860                                max_decoding_message_size,
3861                                max_encoding_message_size,
3862                            );
3863                        let res = grpc.unary(method, req).await;
3864                        Ok(res)
3865                    };
3866                    Box::pin(fut)
3867                }
3868                _ => {
3869                    Box::pin(async move {
3870                        let mut response = http::Response::new(
3871                            tonic::body::Body::default(),
3872                        );
3873                        let headers = response.headers_mut();
3874                        headers
3875                            .insert(
3876                                tonic::Status::GRPC_STATUS,
3877                                (tonic::Code::Unimplemented as i32).into(),
3878                            );
3879                        headers
3880                            .insert(
3881                                http::header::CONTENT_TYPE,
3882                                tonic::metadata::GRPC_CONTENT_TYPE,
3883                            );
3884                        Ok(response)
3885                    })
3886                }
3887            }
3888        }
3889    }
3890    impl<T> Clone for MovePackageServiceServer<T> {
3891        fn clone(&self) -> Self {
3892            let inner = self.inner.clone();
3893            Self {
3894                inner,
3895                accept_compression_encodings: self.accept_compression_encodings,
3896                send_compression_encodings: self.send_compression_encodings,
3897                max_decoding_message_size: self.max_decoding_message_size,
3898                max_encoding_message_size: self.max_encoding_message_size,
3899            }
3900        }
3901    }
3902    /// Generated gRPC service name
3903    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
3904    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
3905        const NAME: &'static str = SERVICE_NAME;
3906    }
3907}
3908#[non_exhaustive]
3909#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3910pub struct LookupNameRequest {
3911    /// Required. The SuiNS name to lookup.
3912    ///
3913    /// Supports both `@name` as well as `name.sui` formats.
3914    #[prost(string, optional, tag = "1")]
3915    pub name: ::core::option::Option<::prost::alloc::string::String>,
3916}
3917#[non_exhaustive]
3918#[derive(Clone, PartialEq, ::prost::Message)]
3919pub struct LookupNameResponse {
3920    /// The record for the requested name
3921    #[prost(message, optional, tag = "1")]
3922    pub record: ::core::option::Option<NameRecord>,
3923}
3924#[non_exhaustive]
3925#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3926pub struct ReverseLookupNameRequest {
3927    /// Required. The address to perform a reverse lookup for.
3928    #[prost(string, optional, tag = "1")]
3929    pub address: ::core::option::Option<::prost::alloc::string::String>,
3930}
3931#[non_exhaustive]
3932#[derive(Clone, PartialEq, ::prost::Message)]
3933pub struct ReverseLookupNameResponse {
3934    /// The record for the SuiNS name linked to the requested address
3935    #[prost(message, optional, tag = "1")]
3936    pub record: ::core::option::Option<NameRecord>,
3937}
3938#[non_exhaustive]
3939#[derive(Clone, PartialEq, ::prost::Message)]
3940pub struct NameRecord {
3941    /// Id of this record.
3942    ///
3943    /// Note that records are stored on chain as dynamic fields of the type
3944    /// `Field<Domain,NameRecord>`.
3945    #[prost(string, optional, tag = "1")]
3946    pub id: ::core::option::Option<::prost::alloc::string::String>,
3947    /// The SuiNS name of this record
3948    #[prost(string, optional, tag = "2")]
3949    pub name: ::core::option::Option<::prost::alloc::string::String>,
3950    /// The ID of the `RegistrationNFT` assigned to this record.
3951    ///
3952    /// The owner of the corresponding `RegistrationNFT` has the rights to
3953    /// be able to change and adjust the `target_address` of this domain.
3954    ///
3955    /// It is possible that the ID changes if the record expires and is
3956    /// purchased by someone else.
3957    #[prost(string, optional, tag = "3")]
3958    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
3959    /// Timestamp when the record expires.
3960    ///
3961    /// This is either the expiration of the record itself or the expiration of
3962    /// this record's parent if this is a leaf record.
3963    #[prost(message, optional, tag = "4")]
3964    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
3965    /// The target address that this name points to
3966    #[prost(string, optional, tag = "5")]
3967    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
3968    /// Additional data which may be stored in a record
3969    #[prost(btree_map = "string, string", tag = "6")]
3970    pub data: ::prost::alloc::collections::BTreeMap<
3971        ::prost::alloc::string::String,
3972        ::prost::alloc::string::String,
3973    >,
3974}
3975/// Generated client implementations.
3976pub mod name_service_client {
3977    #![allow(
3978        unused_variables,
3979        dead_code,
3980        missing_docs,
3981        clippy::wildcard_imports,
3982        clippy::let_unit_value,
3983    )]
3984    use tonic::codegen::*;
3985    use tonic::codegen::http::Uri;
3986    #[derive(Debug, Clone)]
3987    pub struct NameServiceClient<T> {
3988        inner: tonic::client::Grpc<T>,
3989    }
3990    impl NameServiceClient<tonic::transport::Channel> {
3991        /// Attempt to create a new client by connecting to a given endpoint.
3992        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
3993        where
3994            D: TryInto<tonic::transport::Endpoint>,
3995            D::Error: Into<StdError>,
3996        {
3997            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
3998            Ok(Self::new(conn))
3999        }
4000    }
4001    impl<T> NameServiceClient<T>
4002    where
4003        T: tonic::client::GrpcService<tonic::body::Body>,
4004        T::Error: Into<StdError>,
4005        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4006        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4007    {
4008        pub fn new(inner: T) -> Self {
4009            let inner = tonic::client::Grpc::new(inner);
4010            Self { inner }
4011        }
4012        pub fn with_origin(inner: T, origin: Uri) -> Self {
4013            let inner = tonic::client::Grpc::with_origin(inner, origin);
4014            Self { inner }
4015        }
4016        pub fn with_interceptor<F>(
4017            inner: T,
4018            interceptor: F,
4019        ) -> NameServiceClient<InterceptedService<T, F>>
4020        where
4021            F: tonic::service::Interceptor,
4022            T::ResponseBody: Default,
4023            T: tonic::codegen::Service<
4024                http::Request<tonic::body::Body>,
4025                Response = http::Response<
4026                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4027                >,
4028            >,
4029            <T as tonic::codegen::Service<
4030                http::Request<tonic::body::Body>,
4031            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4032        {
4033            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4034        }
4035        /// Compress requests with the given encoding.
4036        ///
4037        /// This requires the server to support it otherwise it might respond with an
4038        /// error.
4039        #[must_use]
4040        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4041            self.inner = self.inner.send_compressed(encoding);
4042            self
4043        }
4044        /// Enable decompressing responses.
4045        #[must_use]
4046        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4047            self.inner = self.inner.accept_compressed(encoding);
4048            self
4049        }
4050        /// Limits the maximum size of a decoded message.
4051        ///
4052        /// Default: `4MB`
4053        #[must_use]
4054        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4055            self.inner = self.inner.max_decoding_message_size(limit);
4056            self
4057        }
4058        /// Limits the maximum size of an encoded message.
4059        ///
4060        /// Default: `usize::MAX`
4061        #[must_use]
4062        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4063            self.inner = self.inner.max_encoding_message_size(limit);
4064            self
4065        }
4066        pub async fn lookup_name(
4067            &mut self,
4068            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4069        ) -> std::result::Result<
4070            tonic::Response<super::LookupNameResponse>,
4071            tonic::Status,
4072        > {
4073            self.inner
4074                .ready()
4075                .await
4076                .map_err(|e| {
4077                    tonic::Status::unknown(
4078                        format!("Service was not ready: {}", e.into()),
4079                    )
4080                })?;
4081            let codec = tonic_prost::ProstCodec::default();
4082            let path = http::uri::PathAndQuery::from_static(
4083                "/sui.rpc.v2.NameService/LookupName",
4084            );
4085            let mut req = request.into_request();
4086            req.extensions_mut()
4087                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4088            self.inner.unary(req, path, codec).await
4089        }
4090        pub async fn reverse_lookup_name(
4091            &mut self,
4092            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4093        ) -> std::result::Result<
4094            tonic::Response<super::ReverseLookupNameResponse>,
4095            tonic::Status,
4096        > {
4097            self.inner
4098                .ready()
4099                .await
4100                .map_err(|e| {
4101                    tonic::Status::unknown(
4102                        format!("Service was not ready: {}", e.into()),
4103                    )
4104                })?;
4105            let codec = tonic_prost::ProstCodec::default();
4106            let path = http::uri::PathAndQuery::from_static(
4107                "/sui.rpc.v2.NameService/ReverseLookupName",
4108            );
4109            let mut req = request.into_request();
4110            req.extensions_mut()
4111                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4112            self.inner.unary(req, path, codec).await
4113        }
4114    }
4115}
4116/// Generated server implementations.
4117pub mod name_service_server {
4118    #![allow(
4119        unused_variables,
4120        dead_code,
4121        missing_docs,
4122        clippy::wildcard_imports,
4123        clippy::let_unit_value,
4124    )]
4125    use tonic::codegen::*;
4126    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4127    #[async_trait]
4128    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4129        async fn lookup_name(
4130            &self,
4131            request: tonic::Request<super::LookupNameRequest>,
4132        ) -> std::result::Result<
4133            tonic::Response<super::LookupNameResponse>,
4134            tonic::Status,
4135        > {
4136            Err(tonic::Status::unimplemented("Not yet implemented"))
4137        }
4138        async fn reverse_lookup_name(
4139            &self,
4140            request: tonic::Request<super::ReverseLookupNameRequest>,
4141        ) -> std::result::Result<
4142            tonic::Response<super::ReverseLookupNameResponse>,
4143            tonic::Status,
4144        > {
4145            Err(tonic::Status::unimplemented("Not yet implemented"))
4146        }
4147    }
4148    #[derive(Debug)]
4149    pub struct NameServiceServer<T> {
4150        inner: Arc<T>,
4151        accept_compression_encodings: EnabledCompressionEncodings,
4152        send_compression_encodings: EnabledCompressionEncodings,
4153        max_decoding_message_size: Option<usize>,
4154        max_encoding_message_size: Option<usize>,
4155    }
4156    impl<T> NameServiceServer<T> {
4157        pub fn new(inner: T) -> Self {
4158            Self::from_arc(Arc::new(inner))
4159        }
4160        pub fn from_arc(inner: Arc<T>) -> Self {
4161            Self {
4162                inner,
4163                accept_compression_encodings: Default::default(),
4164                send_compression_encodings: Default::default(),
4165                max_decoding_message_size: None,
4166                max_encoding_message_size: None,
4167            }
4168        }
4169        pub fn with_interceptor<F>(
4170            inner: T,
4171            interceptor: F,
4172        ) -> InterceptedService<Self, F>
4173        where
4174            F: tonic::service::Interceptor,
4175        {
4176            InterceptedService::new(Self::new(inner), interceptor)
4177        }
4178        /// Enable decompressing requests with the given encoding.
4179        #[must_use]
4180        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4181            self.accept_compression_encodings.enable(encoding);
4182            self
4183        }
4184        /// Compress responses with the given encoding, if the client supports it.
4185        #[must_use]
4186        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4187            self.send_compression_encodings.enable(encoding);
4188            self
4189        }
4190        /// Limits the maximum size of a decoded message.
4191        ///
4192        /// Default: `4MB`
4193        #[must_use]
4194        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4195            self.max_decoding_message_size = Some(limit);
4196            self
4197        }
4198        /// Limits the maximum size of an encoded message.
4199        ///
4200        /// Default: `usize::MAX`
4201        #[must_use]
4202        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4203            self.max_encoding_message_size = Some(limit);
4204            self
4205        }
4206    }
4207    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4208    where
4209        T: NameService,
4210        B: Body + std::marker::Send + 'static,
4211        B::Error: Into<StdError> + std::marker::Send + 'static,
4212    {
4213        type Response = http::Response<tonic::body::Body>;
4214        type Error = std::convert::Infallible;
4215        type Future = BoxFuture<Self::Response, Self::Error>;
4216        fn poll_ready(
4217            &mut self,
4218            _cx: &mut Context<'_>,
4219        ) -> Poll<std::result::Result<(), Self::Error>> {
4220            Poll::Ready(Ok(()))
4221        }
4222        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4223            match req.uri().path() {
4224                "/sui.rpc.v2.NameService/LookupName" => {
4225                    #[allow(non_camel_case_types)]
4226                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
4227                    impl<
4228                        T: NameService,
4229                    > tonic::server::UnaryService<super::LookupNameRequest>
4230                    for LookupNameSvc<T> {
4231                        type Response = super::LookupNameResponse;
4232                        type Future = BoxFuture<
4233                            tonic::Response<Self::Response>,
4234                            tonic::Status,
4235                        >;
4236                        fn call(
4237                            &mut self,
4238                            request: tonic::Request<super::LookupNameRequest>,
4239                        ) -> Self::Future {
4240                            let inner = Arc::clone(&self.0);
4241                            let fut = async move {
4242                                <T as NameService>::lookup_name(&inner, request).await
4243                            };
4244                            Box::pin(fut)
4245                        }
4246                    }
4247                    let accept_compression_encodings = self.accept_compression_encodings;
4248                    let send_compression_encodings = self.send_compression_encodings;
4249                    let max_decoding_message_size = self.max_decoding_message_size;
4250                    let max_encoding_message_size = self.max_encoding_message_size;
4251                    let inner = self.inner.clone();
4252                    let fut = async move {
4253                        let method = LookupNameSvc(inner);
4254                        let codec = tonic_prost::ProstCodec::default();
4255                        let mut grpc = tonic::server::Grpc::new(codec)
4256                            .apply_compression_config(
4257                                accept_compression_encodings,
4258                                send_compression_encodings,
4259                            )
4260                            .apply_max_message_size_config(
4261                                max_decoding_message_size,
4262                                max_encoding_message_size,
4263                            );
4264                        let res = grpc.unary(method, req).await;
4265                        Ok(res)
4266                    };
4267                    Box::pin(fut)
4268                }
4269                "/sui.rpc.v2.NameService/ReverseLookupName" => {
4270                    #[allow(non_camel_case_types)]
4271                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4272                    impl<
4273                        T: NameService,
4274                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4275                    for ReverseLookupNameSvc<T> {
4276                        type Response = super::ReverseLookupNameResponse;
4277                        type Future = BoxFuture<
4278                            tonic::Response<Self::Response>,
4279                            tonic::Status,
4280                        >;
4281                        fn call(
4282                            &mut self,
4283                            request: tonic::Request<super::ReverseLookupNameRequest>,
4284                        ) -> Self::Future {
4285                            let inner = Arc::clone(&self.0);
4286                            let fut = async move {
4287                                <T as NameService>::reverse_lookup_name(&inner, request)
4288                                    .await
4289                            };
4290                            Box::pin(fut)
4291                        }
4292                    }
4293                    let accept_compression_encodings = self.accept_compression_encodings;
4294                    let send_compression_encodings = self.send_compression_encodings;
4295                    let max_decoding_message_size = self.max_decoding_message_size;
4296                    let max_encoding_message_size = self.max_encoding_message_size;
4297                    let inner = self.inner.clone();
4298                    let fut = async move {
4299                        let method = ReverseLookupNameSvc(inner);
4300                        let codec = tonic_prost::ProstCodec::default();
4301                        let mut grpc = tonic::server::Grpc::new(codec)
4302                            .apply_compression_config(
4303                                accept_compression_encodings,
4304                                send_compression_encodings,
4305                            )
4306                            .apply_max_message_size_config(
4307                                max_decoding_message_size,
4308                                max_encoding_message_size,
4309                            );
4310                        let res = grpc.unary(method, req).await;
4311                        Ok(res)
4312                    };
4313                    Box::pin(fut)
4314                }
4315                _ => {
4316                    Box::pin(async move {
4317                        let mut response = http::Response::new(
4318                            tonic::body::Body::default(),
4319                        );
4320                        let headers = response.headers_mut();
4321                        headers
4322                            .insert(
4323                                tonic::Status::GRPC_STATUS,
4324                                (tonic::Code::Unimplemented as i32).into(),
4325                            );
4326                        headers
4327                            .insert(
4328                                http::header::CONTENT_TYPE,
4329                                tonic::metadata::GRPC_CONTENT_TYPE,
4330                            );
4331                        Ok(response)
4332                    })
4333                }
4334            }
4335        }
4336    }
4337    impl<T> Clone for NameServiceServer<T> {
4338        fn clone(&self) -> Self {
4339            let inner = self.inner.clone();
4340            Self {
4341                inner,
4342                accept_compression_encodings: self.accept_compression_encodings,
4343                send_compression_encodings: self.send_compression_encodings,
4344                max_decoding_message_size: self.max_decoding_message_size,
4345                max_encoding_message_size: self.max_encoding_message_size,
4346            }
4347        }
4348    }
4349    /// Generated gRPC service name
4350    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
4351    impl<T> tonic::server::NamedService for NameServiceServer<T> {
4352        const NAME: &'static str = SERVICE_NAME;
4353    }
4354}
4355/// An object on the Sui blockchain.
4356#[non_exhaustive]
4357#[derive(Clone, PartialEq, ::prost::Message)]
4358pub struct Object {
4359    /// This Object serialized as BCS.
4360    #[prost(message, optional, tag = "1")]
4361    pub bcs: ::core::option::Option<Bcs>,
4362    /// `ObjectId` for this object.
4363    #[prost(string, optional, tag = "2")]
4364    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4365    /// Version of the object.
4366    #[prost(uint64, optional, tag = "3")]
4367    pub version: ::core::option::Option<u64>,
4368    /// The digest of this Object.
4369    #[prost(string, optional, tag = "4")]
4370    pub digest: ::core::option::Option<::prost::alloc::string::String>,
4371    /// Owner of the object.
4372    #[prost(message, optional, tag = "5")]
4373    pub owner: ::core::option::Option<Owner>,
4374    /// The type of this object.
4375    ///
4376    /// This will be 'package' for packages and a StructTag for move structs.
4377    #[prost(string, optional, tag = "6")]
4378    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
4379    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
4380    /// object. Instead, it is always calculated from the objects type when loaded in execution.
4381    ///
4382    /// Only set for Move structs
4383    #[prost(bool, optional, tag = "7")]
4384    pub has_public_transfer: ::core::option::Option<bool>,
4385    /// BCS bytes of a Move struct value.
4386    ///
4387    /// Only set for Move structs
4388    #[prost(message, optional, tag = "8")]
4389    pub contents: ::core::option::Option<Bcs>,
4390    /// Package information for Move Packages
4391    #[prost(message, optional, tag = "9")]
4392    pub package: ::core::option::Option<Package>,
4393    /// The digest of the transaction that created or last mutated this object
4394    #[prost(string, optional, tag = "10")]
4395    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
4396    /// The amount of SUI to rebate if this object gets deleted.
4397    /// This number is re-calculated each time the object is mutated based on
4398    /// the present storage gas price.
4399    #[prost(uint64, optional, tag = "11")]
4400    pub storage_rebate: ::core::option::Option<u64>,
4401    /// JSON rendering of the object.
4402    #[prost(message, optional, boxed, tag = "100")]
4403    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
4404    /// Current balance if this object is a `0x2::coin::Coin<T>`
4405    #[prost(uint64, optional, tag = "101")]
4406    pub balance: ::core::option::Option<u64>,
4407    /// JSON rendering of the object based on an on-chain template.
4408    /// This will not be set if the value's type does not have an associated `Display` template.
4409    #[prost(message, optional, boxed, tag = "102")]
4410    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
4411}
4412/// Set of Objects
4413#[non_exhaustive]
4414#[derive(Clone, PartialEq, ::prost::Message)]
4415pub struct ObjectSet {
4416    /// Objects are sorted by the key `(object_id, version)`.
4417    #[prost(message, repeated, tag = "1")]
4418    pub objects: ::prost::alloc::vec::Vec<Object>,
4419}
4420/// A rendered JSON blob based on an on-chain template.
4421#[non_exhaustive]
4422#[derive(Clone, PartialEq, ::prost::Message)]
4423pub struct Display {
4424    /// Output for all successfully substituted display fields. Unsuccessful
4425    /// fields will be `null`, and will be accompanied by a field in `errors`,
4426    /// explaining the error.
4427    #[prost(message, optional, tag = "1")]
4428    pub output: ::core::option::Option<::prost_types::Value>,
4429    /// If any fields failed to render, this will contain a mapping from failed
4430    /// field names to error messages. If all fields succeed, this will either be
4431    /// `null` or not set.
4432    #[prost(message, optional, tag = "2")]
4433    pub errors: ::core::option::Option<::prost_types::Value>,
4434}
4435/// Reference to an object.
4436#[non_exhaustive]
4437#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4438pub struct ObjectReference {
4439    /// The object id of this object.
4440    #[prost(string, optional, tag = "1")]
4441    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4442    /// The version of this object.
4443    #[prost(uint64, optional, tag = "2")]
4444    pub version: ::core::option::Option<u64>,
4445    /// The digest of this object.
4446    #[prost(string, optional, tag = "3")]
4447    pub digest: ::core::option::Option<::prost::alloc::string::String>,
4448}
4449/// Enum of different types of ownership for an object.
4450#[non_exhaustive]
4451#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4452pub struct Owner {
4453    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4454    pub kind: ::core::option::Option<i32>,
4455    /// Address or ObjectId of the owner
4456    #[prost(string, optional, tag = "2")]
4457    pub address: ::core::option::Option<::prost::alloc::string::String>,
4458    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
4459    #[prost(uint64, optional, tag = "3")]
4460    pub version: ::core::option::Option<u64>,
4461}
4462/// Nested message and enum types in `Owner`.
4463pub mod owner {
4464    #[non_exhaustive]
4465    #[derive(
4466        Clone,
4467        Copy,
4468        Debug,
4469        PartialEq,
4470        Eq,
4471        Hash,
4472        PartialOrd,
4473        Ord,
4474        ::prost::Enumeration
4475    )]
4476    #[repr(i32)]
4477    pub enum OwnerKind {
4478        Unknown = 0,
4479        Address = 1,
4480        Object = 2,
4481        Shared = 3,
4482        Immutable = 4,
4483        ConsensusAddress = 5,
4484    }
4485    impl OwnerKind {
4486        /// String value of the enum field names used in the ProtoBuf definition.
4487        ///
4488        /// The values are not transformed in any way and thus are considered stable
4489        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4490        pub fn as_str_name(&self) -> &'static str {
4491            match self {
4492                Self::Unknown => "OWNER_KIND_UNKNOWN",
4493                Self::Address => "ADDRESS",
4494                Self::Object => "OBJECT",
4495                Self::Shared => "SHARED",
4496                Self::Immutable => "IMMUTABLE",
4497                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4498            }
4499        }
4500        /// Creates an enum from field names used in the ProtoBuf definition.
4501        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4502            match value {
4503                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4504                "ADDRESS" => Some(Self::Address),
4505                "OBJECT" => Some(Self::Object),
4506                "SHARED" => Some(Self::Shared),
4507                "IMMUTABLE" => Some(Self::Immutable),
4508                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4509                _ => None,
4510            }
4511        }
4512    }
4513}
4514#[non_exhaustive]
4515#[derive(Clone, PartialEq, ::prost::Message)]
4516pub struct ProtocolConfig {
4517    #[prost(uint64, optional, tag = "1")]
4518    pub protocol_version: ::core::option::Option<u64>,
4519    #[prost(btree_map = "string, bool", tag = "2")]
4520    pub feature_flags: ::prost::alloc::collections::BTreeMap<
4521        ::prost::alloc::string::String,
4522        bool,
4523    >,
4524    #[prost(btree_map = "string, string", tag = "3")]
4525    pub attributes: ::prost::alloc::collections::BTreeMap<
4526        ::prost::alloc::string::String,
4527        ::prost::alloc::string::String,
4528    >,
4529}
4530/// A signature from a user.
4531#[non_exhaustive]
4532#[derive(Clone, PartialEq, ::prost::Message)]
4533pub struct UserSignature {
4534    /// This signature serialized as as BCS.
4535    ///
4536    /// When provided as input this will support both the form that is length
4537    /// prefixed as well as not length prefixed.
4538    #[prost(message, optional, tag = "1")]
4539    pub bcs: ::core::option::Option<Bcs>,
4540    /// The signature scheme of this signature.
4541    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4542    pub scheme: ::core::option::Option<i32>,
4543    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4544    pub signature: ::core::option::Option<user_signature::Signature>,
4545}
4546/// Nested message and enum types in `UserSignature`.
4547pub mod user_signature {
4548    #[non_exhaustive]
4549    #[derive(Clone, PartialEq, ::prost::Oneof)]
4550    pub enum Signature {
4551        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
4552        #[prost(message, tag = "3")]
4553        Simple(super::SimpleSignature),
4554        /// The multisig aggregated signature if scheme is `MULTISIG`.
4555        #[prost(message, tag = "4")]
4556        Multisig(super::MultisigAggregatedSignature),
4557        /// The zklogin authenticator if scheme is `ZKLOGIN`.
4558        #[prost(message, tag = "5")]
4559        Zklogin(super::ZkLoginAuthenticator),
4560        /// The passkey authenticator if scheme is `PASSKEY`.
4561        #[prost(message, tag = "6")]
4562        Passkey(super::PasskeyAuthenticator),
4563    }
4564}
4565/// Either an ed25519, secp256k1 or secp256r1 signature
4566#[non_exhaustive]
4567#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4568pub struct SimpleSignature {
4569    /// The signature scheme of this signature.
4570    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4571    pub scheme: ::core::option::Option<i32>,
4572    /// Signature bytes
4573    #[prost(bytes = "bytes", optional, tag = "2")]
4574    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4575    /// Public key bytes
4576    #[prost(bytes = "bytes", optional, tag = "3")]
4577    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4578}
4579/// Public key equivalent for zklogin authenticators.
4580#[non_exhaustive]
4581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4582pub struct ZkLoginPublicIdentifier {
4583    #[prost(string, optional, tag = "1")]
4584    pub iss: ::core::option::Option<::prost::alloc::string::String>,
4585    /// base10 encoded Bn254FieldElement
4586    #[prost(string, optional, tag = "2")]
4587    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4588}
4589/// Set of valid public keys for multisig committee members.
4590#[non_exhaustive]
4591#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4592pub struct MultisigMemberPublicKey {
4593    /// The signature scheme of this public key.
4594    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4595    pub scheme: ::core::option::Option<i32>,
4596    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
4597    #[prost(bytes = "bytes", optional, tag = "2")]
4598    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4599    /// A zklogin public identifier if scheme is zklogin.
4600    #[prost(message, optional, tag = "3")]
4601    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4602}
4603/// A member in a multisig committee.
4604#[non_exhaustive]
4605#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4606pub struct MultisigMember {
4607    /// The public key of the committee member.
4608    #[prost(message, optional, tag = "1")]
4609    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4610    /// The weight of this member's signature.
4611    #[prost(uint32, optional, tag = "2")]
4612    pub weight: ::core::option::Option<u32>,
4613}
4614/// A multisig committee.
4615#[non_exhaustive]
4616#[derive(Clone, PartialEq, ::prost::Message)]
4617pub struct MultisigCommittee {
4618    /// A list of committee members and their corresponding weight.
4619    #[prost(message, repeated, tag = "1")]
4620    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4621    /// The threshold of signatures needed to validate a signature from
4622    /// this committee.
4623    #[prost(uint32, optional, tag = "2")]
4624    pub threshold: ::core::option::Option<u32>,
4625}
4626/// Aggregated signature from members of a multisig committee.
4627#[non_exhaustive]
4628#[derive(Clone, PartialEq, ::prost::Message)]
4629pub struct MultisigAggregatedSignature {
4630    /// The plain signatures encoded with signature scheme.
4631    ///
4632    /// The signatures must be in the same order as they are listed in the committee.
4633    #[prost(message, repeated, tag = "1")]
4634    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4635    /// Bitmap indicating which committee members contributed to the
4636    /// signature.
4637    #[prost(uint32, optional, tag = "2")]
4638    pub bitmap: ::core::option::Option<u32>,
4639    /// If present, means this signature's on-chain format uses the old
4640    /// legacy multisig format.
4641    #[prost(bytes = "bytes", optional, tag = "3")]
4642    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4643    /// The committee to use to validate this signature.
4644    #[prost(message, optional, tag = "4")]
4645    pub committee: ::core::option::Option<MultisigCommittee>,
4646}
4647/// A signature from a member of a multisig committee.
4648#[non_exhaustive]
4649#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4650pub struct MultisigMemberSignature {
4651    /// The signature scheme of this signature.
4652    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4653    pub scheme: ::core::option::Option<i32>,
4654    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
4655    #[prost(bytes = "bytes", optional, tag = "2")]
4656    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4657    /// The zklogin authenticator if scheme is `ZKLOGIN`.
4658    #[prost(message, optional, tag = "3")]
4659    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4660    /// The passkey authenticator if scheme is `PASSKEY`.
4661    #[prost(message, optional, tag = "4")]
4662    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4663}
4664/// A zklogin authenticator.
4665#[non_exhaustive]
4666#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4667pub struct ZkLoginAuthenticator {
4668    /// Zklogin proof and inputs required to perform proof verification.
4669    #[prost(message, optional, tag = "1")]
4670    pub inputs: ::core::option::Option<ZkLoginInputs>,
4671    /// Maximum epoch for which the proof is valid.
4672    #[prost(uint64, optional, tag = "2")]
4673    pub max_epoch: ::core::option::Option<u64>,
4674    /// User signature with the public key attested to by the provided proof.
4675    #[prost(message, optional, tag = "3")]
4676    pub signature: ::core::option::Option<SimpleSignature>,
4677    /// The public identifier (similar to a public key) for this zklogin authenticator
4678    #[prost(message, optional, tag = "4")]
4679    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4680    /// The id of the JWK used to authorize this zklogin authenticator
4681    #[prost(message, optional, tag = "5")]
4682    pub jwk_id: ::core::option::Option<JwkId>,
4683}
4684/// A zklogin groth16 proof and the required inputs to perform proof verification.
4685#[non_exhaustive]
4686#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4687pub struct ZkLoginInputs {
4688    #[prost(message, optional, tag = "1")]
4689    pub proof_points: ::core::option::Option<ZkLoginProof>,
4690    #[prost(message, optional, tag = "2")]
4691    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4692    #[prost(string, optional, tag = "3")]
4693    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4694    /// base10 encoded Bn254FieldElement
4695    #[prost(string, optional, tag = "4")]
4696    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4697}
4698/// A zklogin groth16 proof.
4699#[non_exhaustive]
4700#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4701pub struct ZkLoginProof {
4702    #[prost(message, optional, tag = "1")]
4703    pub a: ::core::option::Option<CircomG1>,
4704    #[prost(message, optional, tag = "2")]
4705    pub b: ::core::option::Option<CircomG2>,
4706    #[prost(message, optional, tag = "3")]
4707    pub c: ::core::option::Option<CircomG1>,
4708}
4709/// A claim of the iss in a zklogin proof.
4710#[non_exhaustive]
4711#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4712pub struct ZkLoginClaim {
4713    #[prost(string, optional, tag = "1")]
4714    pub value: ::core::option::Option<::prost::alloc::string::String>,
4715    #[prost(uint32, optional, tag = "2")]
4716    pub index_mod_4: ::core::option::Option<u32>,
4717}
4718/// A G1 point.
4719#[non_exhaustive]
4720#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4721pub struct CircomG1 {
4722    /// base10 encoded Bn254FieldElement
4723    #[prost(string, optional, tag = "1")]
4724    pub e0: ::core::option::Option<::prost::alloc::string::String>,
4725    /// base10 encoded Bn254FieldElement
4726    #[prost(string, optional, tag = "2")]
4727    pub e1: ::core::option::Option<::prost::alloc::string::String>,
4728    /// base10 encoded Bn254FieldElement
4729    #[prost(string, optional, tag = "3")]
4730    pub e2: ::core::option::Option<::prost::alloc::string::String>,
4731}
4732/// A G2 point.
4733#[non_exhaustive]
4734#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4735pub struct CircomG2 {
4736    /// base10 encoded Bn254FieldElement
4737    #[prost(string, optional, tag = "1")]
4738    pub e00: ::core::option::Option<::prost::alloc::string::String>,
4739    /// base10 encoded Bn254FieldElement
4740    #[prost(string, optional, tag = "2")]
4741    pub e01: ::core::option::Option<::prost::alloc::string::String>,
4742    /// base10 encoded Bn254FieldElement
4743    #[prost(string, optional, tag = "3")]
4744    pub e10: ::core::option::Option<::prost::alloc::string::String>,
4745    /// base10 encoded Bn254FieldElement
4746    #[prost(string, optional, tag = "4")]
4747    pub e11: ::core::option::Option<::prost::alloc::string::String>,
4748    /// base10 encoded Bn254FieldElement
4749    #[prost(string, optional, tag = "5")]
4750    pub e20: ::core::option::Option<::prost::alloc::string::String>,
4751    /// base10 encoded Bn254FieldElement
4752    #[prost(string, optional, tag = "6")]
4753    pub e21: ::core::option::Option<::prost::alloc::string::String>,
4754}
4755/// A passkey authenticator.
4756///
4757/// See
4758/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
4759/// for more information on the requirements on the shape of the
4760/// `client_data_json` field.
4761#[non_exhaustive]
4762#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4763pub struct PasskeyAuthenticator {
4764    /// Opaque authenticator data for this passkey signature.
4765    ///
4766    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
4767    /// more information on this field.
4768    #[prost(bytes = "bytes", optional, tag = "1")]
4769    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4770    /// Structured, unparsed, JSON for this passkey signature.
4771    ///
4772    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
4773    /// for more information on this field.
4774    #[prost(string, optional, tag = "2")]
4775    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4776    /// A secp256r1 signature.
4777    #[prost(message, optional, tag = "3")]
4778    pub signature: ::core::option::Option<SimpleSignature>,
4779}
4780/// The validator set for a particular epoch.
4781#[non_exhaustive]
4782#[derive(Clone, PartialEq, ::prost::Message)]
4783pub struct ValidatorCommittee {
4784    /// The epoch where this committee governs.
4785    #[prost(uint64, optional, tag = "1")]
4786    pub epoch: ::core::option::Option<u64>,
4787    /// The committee members.
4788    #[prost(message, repeated, tag = "2")]
4789    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4790}
4791/// A member of a validator committee.
4792#[non_exhaustive]
4793#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4794pub struct ValidatorCommitteeMember {
4795    /// The 96-byte Bls12381 public key for this validator.
4796    #[prost(bytes = "bytes", optional, tag = "1")]
4797    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4798    /// voting weight this validator possesses.
4799    #[prost(uint64, optional, tag = "2")]
4800    pub weight: ::core::option::Option<u64>,
4801}
4802/// / An aggregated signature from multiple validators.
4803#[non_exhaustive]
4804#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4805pub struct ValidatorAggregatedSignature {
4806    /// The epoch when this signature was produced.
4807    ///
4808    /// This can be used to lookup the `ValidatorCommittee` from this epoch
4809    /// to verify this signature.
4810    #[prost(uint64, optional, tag = "1")]
4811    pub epoch: ::core::option::Option<u64>,
4812    /// The 48-byte Bls12381 aggregated signature.
4813    #[prost(bytes = "bytes", optional, tag = "2")]
4814    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4815    /// Bitmap indicating which members of the committee contributed to
4816    /// this signature.
4817    #[prost(bytes = "bytes", optional, tag = "3")]
4818    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4819}
4820/// Flag use to disambiguate the signature schemes supported by Sui.
4821///
4822/// Note: the enum values defined by this proto message exactly match their
4823/// expected BCS serialized values when serialized as a u8. See
4824/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
4825/// for more information about signature schemes.
4826#[non_exhaustive]
4827#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4828#[repr(i32)]
4829pub enum SignatureScheme {
4830    Ed25519 = 0,
4831    Secp256k1 = 1,
4832    Secp256r1 = 2,
4833    Multisig = 3,
4834    Bls12381 = 4,
4835    Zklogin = 5,
4836    Passkey = 6,
4837}
4838impl SignatureScheme {
4839    /// String value of the enum field names used in the ProtoBuf definition.
4840    ///
4841    /// The values are not transformed in any way and thus are considered stable
4842    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4843    pub fn as_str_name(&self) -> &'static str {
4844        match self {
4845            Self::Ed25519 => "ED25519",
4846            Self::Secp256k1 => "SECP256K1",
4847            Self::Secp256r1 => "SECP256R1",
4848            Self::Multisig => "MULTISIG",
4849            Self::Bls12381 => "BLS12381",
4850            Self::Zklogin => "ZKLOGIN",
4851            Self::Passkey => "PASSKEY",
4852        }
4853    }
4854    /// Creates an enum from field names used in the ProtoBuf definition.
4855    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4856        match value {
4857            "ED25519" => Some(Self::Ed25519),
4858            "SECP256K1" => Some(Self::Secp256k1),
4859            "SECP256R1" => Some(Self::Secp256r1),
4860            "MULTISIG" => Some(Self::Multisig),
4861            "BLS12381" => Some(Self::Bls12381),
4862            "ZKLOGIN" => Some(Self::Zklogin),
4863            "PASSKEY" => Some(Self::Passkey),
4864            _ => None,
4865        }
4866    }
4867}
4868#[non_exhaustive]
4869#[derive(Clone, PartialEq, ::prost::Message)]
4870pub struct VerifySignatureRequest {
4871    /// The message to verify against.
4872    ///
4873    /// Today the only supported message types are `PersonalMessage` and
4874    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
4875    /// message is being verified.
4876    #[prost(message, optional, tag = "1")]
4877    pub message: ::core::option::Option<Bcs>,
4878    /// The signature to verify.
4879    #[prost(message, optional, tag = "2")]
4880    pub signature: ::core::option::Option<UserSignature>,
4881    /// Optional. Address to validate against the provided signature.
4882    ///
4883    /// If provided, this address will be compared against the the address derived
4884    /// from the provide signature and a successful response will only be returned
4885    /// if they match.
4886    #[prost(string, optional, tag = "3")]
4887    pub address: ::core::option::Option<::prost::alloc::string::String>,
4888    /// The set of JWKs to use when verifying Zklogin signatures.
4889    /// If this is empty the current set of valid JWKs stored onchain will be used
4890    #[prost(message, repeated, tag = "4")]
4891    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4892}
4893#[non_exhaustive]
4894#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4895pub struct VerifySignatureResponse {
4896    /// Indicates if the provided signature was valid given the requested parameters.
4897    #[prost(bool, optional, tag = "1")]
4898    pub is_valid: ::core::option::Option<bool>,
4899    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
4900    #[prost(string, optional, tag = "2")]
4901    pub reason: ::core::option::Option<::prost::alloc::string::String>,
4902}
4903/// Generated client implementations.
4904pub mod signature_verification_service_client {
4905    #![allow(
4906        unused_variables,
4907        dead_code,
4908        missing_docs,
4909        clippy::wildcard_imports,
4910        clippy::let_unit_value,
4911    )]
4912    use tonic::codegen::*;
4913    use tonic::codegen::http::Uri;
4914    #[derive(Debug, Clone)]
4915    pub struct SignatureVerificationServiceClient<T> {
4916        inner: tonic::client::Grpc<T>,
4917    }
4918    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4919        /// Attempt to create a new client by connecting to a given endpoint.
4920        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4921        where
4922            D: TryInto<tonic::transport::Endpoint>,
4923            D::Error: Into<StdError>,
4924        {
4925            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4926            Ok(Self::new(conn))
4927        }
4928    }
4929    impl<T> SignatureVerificationServiceClient<T>
4930    where
4931        T: tonic::client::GrpcService<tonic::body::Body>,
4932        T::Error: Into<StdError>,
4933        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4934        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4935    {
4936        pub fn new(inner: T) -> Self {
4937            let inner = tonic::client::Grpc::new(inner);
4938            Self { inner }
4939        }
4940        pub fn with_origin(inner: T, origin: Uri) -> Self {
4941            let inner = tonic::client::Grpc::with_origin(inner, origin);
4942            Self { inner }
4943        }
4944        pub fn with_interceptor<F>(
4945            inner: T,
4946            interceptor: F,
4947        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4948        where
4949            F: tonic::service::Interceptor,
4950            T::ResponseBody: Default,
4951            T: tonic::codegen::Service<
4952                http::Request<tonic::body::Body>,
4953                Response = http::Response<
4954                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4955                >,
4956            >,
4957            <T as tonic::codegen::Service<
4958                http::Request<tonic::body::Body>,
4959            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4960        {
4961            SignatureVerificationServiceClient::new(
4962                InterceptedService::new(inner, interceptor),
4963            )
4964        }
4965        /// Compress requests with the given encoding.
4966        ///
4967        /// This requires the server to support it otherwise it might respond with an
4968        /// error.
4969        #[must_use]
4970        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4971            self.inner = self.inner.send_compressed(encoding);
4972            self
4973        }
4974        /// Enable decompressing responses.
4975        #[must_use]
4976        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4977            self.inner = self.inner.accept_compressed(encoding);
4978            self
4979        }
4980        /// Limits the maximum size of a decoded message.
4981        ///
4982        /// Default: `4MB`
4983        #[must_use]
4984        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4985            self.inner = self.inner.max_decoding_message_size(limit);
4986            self
4987        }
4988        /// Limits the maximum size of an encoded message.
4989        ///
4990        /// Default: `usize::MAX`
4991        #[must_use]
4992        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4993            self.inner = self.inner.max_encoding_message_size(limit);
4994            self
4995        }
4996        /// Perform signature verification of a UserSignature against the provided message.
4997        pub async fn verify_signature(
4998            &mut self,
4999            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5000        ) -> std::result::Result<
5001            tonic::Response<super::VerifySignatureResponse>,
5002            tonic::Status,
5003        > {
5004            self.inner
5005                .ready()
5006                .await
5007                .map_err(|e| {
5008                    tonic::Status::unknown(
5009                        format!("Service was not ready: {}", e.into()),
5010                    )
5011                })?;
5012            let codec = tonic_prost::ProstCodec::default();
5013            let path = http::uri::PathAndQuery::from_static(
5014                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5015            );
5016            let mut req = request.into_request();
5017            req.extensions_mut()
5018                .insert(
5019                    GrpcMethod::new(
5020                        "sui.rpc.v2.SignatureVerificationService",
5021                        "VerifySignature",
5022                    ),
5023                );
5024            self.inner.unary(req, path, codec).await
5025        }
5026    }
5027}
5028/// Generated server implementations.
5029pub mod signature_verification_service_server {
5030    #![allow(
5031        unused_variables,
5032        dead_code,
5033        missing_docs,
5034        clippy::wildcard_imports,
5035        clippy::let_unit_value,
5036    )]
5037    use tonic::codegen::*;
5038    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
5039    #[async_trait]
5040    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5041        /// Perform signature verification of a UserSignature against the provided message.
5042        async fn verify_signature(
5043            &self,
5044            request: tonic::Request<super::VerifySignatureRequest>,
5045        ) -> std::result::Result<
5046            tonic::Response<super::VerifySignatureResponse>,
5047            tonic::Status,
5048        > {
5049            Err(tonic::Status::unimplemented("Not yet implemented"))
5050        }
5051    }
5052    #[derive(Debug)]
5053    pub struct SignatureVerificationServiceServer<T> {
5054        inner: Arc<T>,
5055        accept_compression_encodings: EnabledCompressionEncodings,
5056        send_compression_encodings: EnabledCompressionEncodings,
5057        max_decoding_message_size: Option<usize>,
5058        max_encoding_message_size: Option<usize>,
5059    }
5060    impl<T> SignatureVerificationServiceServer<T> {
5061        pub fn new(inner: T) -> Self {
5062            Self::from_arc(Arc::new(inner))
5063        }
5064        pub fn from_arc(inner: Arc<T>) -> Self {
5065            Self {
5066                inner,
5067                accept_compression_encodings: Default::default(),
5068                send_compression_encodings: Default::default(),
5069                max_decoding_message_size: None,
5070                max_encoding_message_size: None,
5071            }
5072        }
5073        pub fn with_interceptor<F>(
5074            inner: T,
5075            interceptor: F,
5076        ) -> InterceptedService<Self, F>
5077        where
5078            F: tonic::service::Interceptor,
5079        {
5080            InterceptedService::new(Self::new(inner), interceptor)
5081        }
5082        /// Enable decompressing requests with the given encoding.
5083        #[must_use]
5084        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5085            self.accept_compression_encodings.enable(encoding);
5086            self
5087        }
5088        /// Compress responses with the given encoding, if the client supports it.
5089        #[must_use]
5090        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5091            self.send_compression_encodings.enable(encoding);
5092            self
5093        }
5094        /// Limits the maximum size of a decoded message.
5095        ///
5096        /// Default: `4MB`
5097        #[must_use]
5098        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5099            self.max_decoding_message_size = Some(limit);
5100            self
5101        }
5102        /// Limits the maximum size of an encoded message.
5103        ///
5104        /// Default: `usize::MAX`
5105        #[must_use]
5106        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5107            self.max_encoding_message_size = Some(limit);
5108            self
5109        }
5110    }
5111    impl<T, B> tonic::codegen::Service<http::Request<B>>
5112    for SignatureVerificationServiceServer<T>
5113    where
5114        T: SignatureVerificationService,
5115        B: Body + std::marker::Send + 'static,
5116        B::Error: Into<StdError> + std::marker::Send + 'static,
5117    {
5118        type Response = http::Response<tonic::body::Body>;
5119        type Error = std::convert::Infallible;
5120        type Future = BoxFuture<Self::Response, Self::Error>;
5121        fn poll_ready(
5122            &mut self,
5123            _cx: &mut Context<'_>,
5124        ) -> Poll<std::result::Result<(), Self::Error>> {
5125            Poll::Ready(Ok(()))
5126        }
5127        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5128            match req.uri().path() {
5129                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5130                    #[allow(non_camel_case_types)]
5131                    struct VerifySignatureSvc<T: SignatureVerificationService>(
5132                        pub Arc<T>,
5133                    );
5134                    impl<
5135                        T: SignatureVerificationService,
5136                    > tonic::server::UnaryService<super::VerifySignatureRequest>
5137                    for VerifySignatureSvc<T> {
5138                        type Response = super::VerifySignatureResponse;
5139                        type Future = BoxFuture<
5140                            tonic::Response<Self::Response>,
5141                            tonic::Status,
5142                        >;
5143                        fn call(
5144                            &mut self,
5145                            request: tonic::Request<super::VerifySignatureRequest>,
5146                        ) -> Self::Future {
5147                            let inner = Arc::clone(&self.0);
5148                            let fut = async move {
5149                                <T as SignatureVerificationService>::verify_signature(
5150                                        &inner,
5151                                        request,
5152                                    )
5153                                    .await
5154                            };
5155                            Box::pin(fut)
5156                        }
5157                    }
5158                    let accept_compression_encodings = self.accept_compression_encodings;
5159                    let send_compression_encodings = self.send_compression_encodings;
5160                    let max_decoding_message_size = self.max_decoding_message_size;
5161                    let max_encoding_message_size = self.max_encoding_message_size;
5162                    let inner = self.inner.clone();
5163                    let fut = async move {
5164                        let method = VerifySignatureSvc(inner);
5165                        let codec = tonic_prost::ProstCodec::default();
5166                        let mut grpc = tonic::server::Grpc::new(codec)
5167                            .apply_compression_config(
5168                                accept_compression_encodings,
5169                                send_compression_encodings,
5170                            )
5171                            .apply_max_message_size_config(
5172                                max_decoding_message_size,
5173                                max_encoding_message_size,
5174                            );
5175                        let res = grpc.unary(method, req).await;
5176                        Ok(res)
5177                    };
5178                    Box::pin(fut)
5179                }
5180                _ => {
5181                    Box::pin(async move {
5182                        let mut response = http::Response::new(
5183                            tonic::body::Body::default(),
5184                        );
5185                        let headers = response.headers_mut();
5186                        headers
5187                            .insert(
5188                                tonic::Status::GRPC_STATUS,
5189                                (tonic::Code::Unimplemented as i32).into(),
5190                            );
5191                        headers
5192                            .insert(
5193                                http::header::CONTENT_TYPE,
5194                                tonic::metadata::GRPC_CONTENT_TYPE,
5195                            );
5196                        Ok(response)
5197                    })
5198                }
5199            }
5200        }
5201    }
5202    impl<T> Clone for SignatureVerificationServiceServer<T> {
5203        fn clone(&self) -> Self {
5204            let inner = self.inner.clone();
5205            Self {
5206                inner,
5207                accept_compression_encodings: self.accept_compression_encodings,
5208                send_compression_encodings: self.send_compression_encodings,
5209                max_decoding_message_size: self.max_decoding_message_size,
5210                max_encoding_message_size: self.max_encoding_message_size,
5211            }
5212        }
5213    }
5214    /// Generated gRPC service name
5215    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5216    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5217        const NAME: &'static str = SERVICE_NAME;
5218    }
5219}
5220/// Request message for `NodeService.GetCoinInfo`.
5221#[non_exhaustive]
5222#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5223pub struct GetCoinInfoRequest {
5224    /// The coin type to request information about
5225    #[prost(string, optional, tag = "1")]
5226    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5227}
5228/// Response message for `NodeService.GetCoinInfo`.
5229#[non_exhaustive]
5230#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5231pub struct GetCoinInfoResponse {
5232    /// Required. The coin type.
5233    #[prost(string, optional, tag = "1")]
5234    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5235    /// This field will be populated with information about this coin
5236    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
5237    #[prost(message, optional, tag = "2")]
5238    pub metadata: ::core::option::Option<CoinMetadata>,
5239    /// This field will be populated with information about this coin
5240    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
5241    #[prost(message, optional, tag = "3")]
5242    pub treasury: ::core::option::Option<CoinTreasury>,
5243    /// If this coin type is a regulated coin, this field will be
5244    /// populated with information either from its Currency object
5245    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
5246    /// object for coins that have not been migrated to the CoinRegistry
5247    ///
5248    /// If this coin is not known to be regulated, only the
5249    /// coin_regulated_state field will be populated.
5250    #[prost(message, optional, tag = "4")]
5251    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5252}
5253/// Metadata for a coin type
5254#[non_exhaustive]
5255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5256pub struct CoinMetadata {
5257    /// ObjectId of the `0x2::coin::CoinMetadata` object or
5258    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
5259    #[prost(string, optional, tag = "1")]
5260    pub id: ::core::option::Option<::prost::alloc::string::String>,
5261    /// Number of decimal places to coin uses.
5262    #[prost(uint32, optional, tag = "2")]
5263    pub decimals: ::core::option::Option<u32>,
5264    /// Name for the token
5265    #[prost(string, optional, tag = "3")]
5266    pub name: ::core::option::Option<::prost::alloc::string::String>,
5267    /// Symbol for the token
5268    #[prost(string, optional, tag = "4")]
5269    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5270    /// Description of the token
5271    #[prost(string, optional, tag = "5")]
5272    pub description: ::core::option::Option<::prost::alloc::string::String>,
5273    /// URL for the token logo
5274    #[prost(string, optional, tag = "6")]
5275    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5276    /// The MetadataCap ID if it has been claimed for this coin type.
5277    /// This capability allows updating the coin's metadata fields.
5278    /// Only populated when metadata is from CoinRegistry.
5279    #[prost(string, optional, tag = "7")]
5280    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5281    /// State of the MetadataCap for this coin type.
5282    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5283    pub metadata_cap_state: ::core::option::Option<i32>,
5284}
5285/// Nested message and enum types in `CoinMetadata`.
5286pub mod coin_metadata {
5287    /// Information about the state of the coin's MetadataCap
5288    #[non_exhaustive]
5289    #[derive(
5290        Clone,
5291        Copy,
5292        Debug,
5293        PartialEq,
5294        Eq,
5295        Hash,
5296        PartialOrd,
5297        Ord,
5298        ::prost::Enumeration
5299    )]
5300    #[repr(i32)]
5301    pub enum MetadataCapState {
5302        /// Indicates the state of the MetadataCap is unknown.
5303        /// Set when the coin has not been migrated to the CoinRegistry.
5304        Unknown = 0,
5305        /// Indicates the MetadataCap has been claimed.
5306        Claimed = 1,
5307        /// Indicates the MetadataCap has not been claimed.
5308        Unclaimed = 2,
5309        /// Indicates the MetadataCap has been deleted.
5310        Deleted = 3,
5311    }
5312    impl MetadataCapState {
5313        /// String value of the enum field names used in the ProtoBuf definition.
5314        ///
5315        /// The values are not transformed in any way and thus are considered stable
5316        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5317        pub fn as_str_name(&self) -> &'static str {
5318            match self {
5319                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5320                Self::Claimed => "CLAIMED",
5321                Self::Unclaimed => "UNCLAIMED",
5322                Self::Deleted => "DELETED",
5323            }
5324        }
5325        /// Creates an enum from field names used in the ProtoBuf definition.
5326        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5327            match value {
5328                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5329                "CLAIMED" => Some(Self::Claimed),
5330                "UNCLAIMED" => Some(Self::Unclaimed),
5331                "DELETED" => Some(Self::Deleted),
5332                _ => None,
5333            }
5334        }
5335    }
5336}
5337/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
5338#[non_exhaustive]
5339#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5340pub struct CoinTreasury {
5341    /// ObjectId of the `0x2::coin::TreasuryCap` object.
5342    #[prost(string, optional, tag = "1")]
5343    pub id: ::core::option::Option<::prost::alloc::string::String>,
5344    /// Total available supply for this coin type.
5345    #[prost(uint64, optional, tag = "2")]
5346    pub total_supply: ::core::option::Option<u64>,
5347    /// Supply state indicating if the supply is fixed or can still be minted
5348    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5349    pub supply_state: ::core::option::Option<i32>,
5350}
5351/// Nested message and enum types in `CoinTreasury`.
5352pub mod coin_treasury {
5353    /// Supply state of a coin, matching the Move SupplyState enum
5354    #[non_exhaustive]
5355    #[derive(
5356        Clone,
5357        Copy,
5358        Debug,
5359        PartialEq,
5360        Eq,
5361        Hash,
5362        PartialOrd,
5363        Ord,
5364        ::prost::Enumeration
5365    )]
5366    #[repr(i32)]
5367    pub enum SupplyState {
5368        /// Supply is unknown or TreasuryCap still exists (minting still possible)
5369        Unknown = 0,
5370        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
5371        Fixed = 1,
5372        /// Supply can only decrease (burning allowed, minting not allowed)
5373        BurnOnly = 2,
5374    }
5375    impl SupplyState {
5376        /// String value of the enum field names used in the ProtoBuf definition.
5377        ///
5378        /// The values are not transformed in any way and thus are considered stable
5379        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5380        pub fn as_str_name(&self) -> &'static str {
5381            match self {
5382                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5383                Self::Fixed => "FIXED",
5384                Self::BurnOnly => "BURN_ONLY",
5385            }
5386        }
5387        /// Creates an enum from field names used in the ProtoBuf definition.
5388        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5389            match value {
5390                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5391                "FIXED" => Some(Self::Fixed),
5392                "BURN_ONLY" => Some(Self::BurnOnly),
5393                _ => None,
5394            }
5395        }
5396    }
5397}
5398/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
5399#[non_exhaustive]
5400#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5401pub struct RegulatedCoinMetadata {
5402    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
5403    /// Only present for coins that have not been migrated to CoinRegistry.
5404    #[prost(string, optional, tag = "1")]
5405    pub id: ::core::option::Option<::prost::alloc::string::String>,
5406    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
5407    #[prost(string, optional, tag = "2")]
5408    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5409    /// The ID of the coin's `DenyCap` object.
5410    #[prost(string, optional, tag = "3")]
5411    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5412    /// Whether the coin can be globally paused
5413    #[prost(bool, optional, tag = "4")]
5414    pub allow_global_pause: ::core::option::Option<bool>,
5415    /// Variant of the regulated coin metadata
5416    #[prost(uint32, optional, tag = "5")]
5417    pub variant: ::core::option::Option<u32>,
5418    /// Indicates the coin's regulated state.
5419    #[prost(
5420        enumeration = "regulated_coin_metadata::CoinRegulatedState",
5421        optional,
5422        tag = "6"
5423    )]
5424    pub coin_regulated_state: ::core::option::Option<i32>,
5425}
5426/// Nested message and enum types in `RegulatedCoinMetadata`.
5427pub mod regulated_coin_metadata {
5428    /// Indicates the state of the regulation of the coin.
5429    #[non_exhaustive]
5430    #[derive(
5431        Clone,
5432        Copy,
5433        Debug,
5434        PartialEq,
5435        Eq,
5436        Hash,
5437        PartialOrd,
5438        Ord,
5439        ::prost::Enumeration
5440    )]
5441    #[repr(i32)]
5442    pub enum CoinRegulatedState {
5443        /// Indicates the regulation state of the coin is unknown.
5444        /// This is set when a coin has not been migrated to the
5445        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
5446        /// object.
5447        Unknown = 0,
5448        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
5449        Regulated = 1,
5450        /// Indicates a coin is unregulated.
5451        Unregulated = 2,
5452    }
5453    impl CoinRegulatedState {
5454        /// String value of the enum field names used in the ProtoBuf definition.
5455        ///
5456        /// The values are not transformed in any way and thus are considered stable
5457        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5458        pub fn as_str_name(&self) -> &'static str {
5459            match self {
5460                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5461                Self::Regulated => "REGULATED",
5462                Self::Unregulated => "UNREGULATED",
5463            }
5464        }
5465        /// Creates an enum from field names used in the ProtoBuf definition.
5466        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5467            match value {
5468                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5469                "REGULATED" => Some(Self::Regulated),
5470                "UNREGULATED" => Some(Self::Unregulated),
5471                _ => None,
5472            }
5473        }
5474    }
5475}
5476/// Request message for `LiveDataService.GetBalance`.
5477#[non_exhaustive]
5478#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5479pub struct GetBalanceRequest {
5480    /// Required. The owner's Sui address.
5481    #[prost(string, optional, tag = "1")]
5482    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5483    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
5484    #[prost(string, optional, tag = "2")]
5485    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5486}
5487/// Response message for `LiveDataService.GetBalance`.
5488/// Return the total coin balance for one coin type, owned by the address owner.
5489#[non_exhaustive]
5490#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5491pub struct GetBalanceResponse {
5492    /// The balance information for the requested coin type.
5493    #[prost(message, optional, tag = "1")]
5494    pub balance: ::core::option::Option<Balance>,
5495}
5496/// Request message for `LiveDataService.ListBalances`.
5497#[non_exhaustive]
5498#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5499pub struct ListBalancesRequest {
5500    /// Required. The owner's Sui address.
5501    #[prost(string, optional, tag = "1")]
5502    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5503    /// The maximum number of balance entries to return. The service may return fewer than this value.
5504    /// If unspecified, at most `50` entries will be returned.
5505    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5506    #[prost(uint32, optional, tag = "2")]
5507    pub page_size: ::core::option::Option<u32>,
5508    /// A page token, received from a previous `ListBalances` call.
5509    /// Provide this to retrieve the subsequent page.
5510    ///
5511    /// When paginating, all other parameters provided to `ListBalances` must
5512    /// match the call that provided the page token.
5513    #[prost(bytes = "bytes", optional, tag = "3")]
5514    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5515}
5516/// Response message for `LiveDataService.ListBalances`.
5517/// Return the total coin balance for all coin types, owned by the address owner.
5518#[non_exhaustive]
5519#[derive(Clone, PartialEq, ::prost::Message)]
5520pub struct ListBalancesResponse {
5521    /// The list of coin types and their respective balances.
5522    #[prost(message, repeated, tag = "1")]
5523    pub balances: ::prost::alloc::vec::Vec<Balance>,
5524    /// A token, which can be sent as `page_token` to retrieve the next page.
5525    /// If this field is omitted, there are no subsequent pages.
5526    #[prost(bytes = "bytes", optional, tag = "2")]
5527    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5528}
5529/// Balance information for a specific coin type.
5530#[non_exhaustive]
5531#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5532pub struct Balance {
5533    /// The type of the coin (e.g., 0x2::sui::SUI).
5534    #[prost(string, optional, tag = "1")]
5535    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5536    /// The total balance of `coin_type` in its smallest unit.
5537    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
5538    /// and `coin_balance`).
5539    #[prost(uint64, optional, tag = "3")]
5540    pub balance: ::core::option::Option<u64>,
5541    /// The balance of `Balance<T>` in this address's Address Balance.
5542    #[prost(uint64, optional, tag = "4")]
5543    pub address_balance: ::core::option::Option<u64>,
5544    /// The balance of all `Coin<T>` objects owned by this address.
5545    #[prost(uint64, optional, tag = "5")]
5546    pub coin_balance: ::core::option::Option<u64>,
5547}
5548/// Request message for `NodeService.ListDynamicFields`
5549#[non_exhaustive]
5550#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5551pub struct ListDynamicFieldsRequest {
5552    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
5553    #[prost(string, optional, tag = "1")]
5554    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5555    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
5556    /// If unspecified, at most `50` entries will be returned.
5557    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5558    #[prost(uint32, optional, tag = "2")]
5559    pub page_size: ::core::option::Option<u32>,
5560    /// A page token, received from a previous `ListDynamicFields` call.
5561    /// Provide this to retrieve the subsequent page.
5562    ///
5563    /// When paginating, all other parameters provided to `ListDynamicFields` must
5564    /// match the call that provided the page token.
5565    #[prost(bytes = "bytes", optional, tag = "3")]
5566    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5567    /// Mask specifying which fields to read.
5568    /// If no mask is specified, defaults to `parent,field_id`.
5569    #[prost(message, optional, tag = "4")]
5570    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5571}
5572/// Response message for `NodeService.ListDynamicFields`
5573#[non_exhaustive]
5574#[derive(Clone, PartialEq, ::prost::Message)]
5575pub struct ListDynamicFieldsResponse {
5576    /// Page of dynamic fields owned by the specified parent.
5577    #[prost(message, repeated, tag = "1")]
5578    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5579    /// A token, which can be sent as `page_token` to retrieve the next page.
5580    /// If this field is omitted, there are no subsequent pages.
5581    #[prost(bytes = "bytes", optional, tag = "2")]
5582    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5583}
5584#[non_exhaustive]
5585#[derive(Clone, PartialEq, ::prost::Message)]
5586pub struct DynamicField {
5587    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5588    pub kind: ::core::option::Option<i32>,
5589    /// ObjectId of this dynamic field's parent.
5590    #[prost(string, optional, tag = "2")]
5591    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5592    /// ObjectId of this dynamic field.
5593    #[prost(string, optional, tag = "3")]
5594    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5595    /// The field object itself
5596    #[prost(message, optional, tag = "4")]
5597    pub field_object: ::core::option::Option<Object>,
5598    /// The dynamic field's "name"
5599    #[prost(message, optional, tag = "5")]
5600    pub name: ::core::option::Option<Bcs>,
5601    /// The dynamic field's "value"
5602    #[prost(message, optional, tag = "6")]
5603    pub value: ::core::option::Option<Bcs>,
5604    /// The type of the dynamic field "value".
5605    ///
5606    /// If this is a dynamic object field then this is the type of the object
5607    /// itself (which is a child of this field), otherwise this is the type of the
5608    /// value of this field.
5609    #[prost(string, optional, tag = "7")]
5610    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5611    /// The ObjectId of the child object when a child is a dynamic
5612    /// object field.
5613    ///
5614    /// The presence or absence of this field can be used to determine if a child
5615    /// is a dynamic field or a dynamic child object
5616    #[prost(string, optional, tag = "8")]
5617    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5618    /// The object itself when a child is a dynamic object field.
5619    #[prost(message, optional, tag = "9")]
5620    pub child_object: ::core::option::Option<Object>,
5621}
5622/// Nested message and enum types in `DynamicField`.
5623pub mod dynamic_field {
5624    #[non_exhaustive]
5625    #[derive(
5626        Clone,
5627        Copy,
5628        Debug,
5629        PartialEq,
5630        Eq,
5631        Hash,
5632        PartialOrd,
5633        Ord,
5634        ::prost::Enumeration
5635    )]
5636    #[repr(i32)]
5637    pub enum DynamicFieldKind {
5638        Unknown = 0,
5639        Field = 1,
5640        Object = 2,
5641    }
5642    impl DynamicFieldKind {
5643        /// String value of the enum field names used in the ProtoBuf definition.
5644        ///
5645        /// The values are not transformed in any way and thus are considered stable
5646        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5647        pub fn as_str_name(&self) -> &'static str {
5648            match self {
5649                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5650                Self::Field => "FIELD",
5651                Self::Object => "OBJECT",
5652            }
5653        }
5654        /// Creates an enum from field names used in the ProtoBuf definition.
5655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5656            match value {
5657                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5658                "FIELD" => Some(Self::Field),
5659                "OBJECT" => Some(Self::Object),
5660                _ => None,
5661            }
5662        }
5663    }
5664}
5665#[non_exhaustive]
5666#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5667pub struct ListOwnedObjectsRequest {
5668    /// Required. The address of the account that owns the objects.
5669    #[prost(string, optional, tag = "1")]
5670    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5671    /// The maximum number of entries return. The service may return fewer than this value.
5672    /// If unspecified, at most `50` entries will be returned.
5673    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5674    #[prost(uint32, optional, tag = "2")]
5675    pub page_size: ::core::option::Option<u32>,
5676    /// A page token, received from a previous `ListOwnedObjects` call.
5677    /// Provide this to retrieve the subsequent page.
5678    ///
5679    /// When paginating, all other parameters provided to `ListOwnedObjects` must
5680    /// match the call that provided the page token.
5681    #[prost(bytes = "bytes", optional, tag = "3")]
5682    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5683    /// Mask specifying which fields to read.
5684    /// If no mask is specified, defaults to `object_id,version,object_type`.
5685    #[prost(message, optional, tag = "4")]
5686    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5687    /// Optional type filter to limit the types of objects listed.
5688    ///
5689    /// Providing an object type with no type params will return objects of that
5690    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
5691    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
5692    /// with a type param will restrict the returned objects to only those objects
5693    /// that match the provided type parameters, e.g.
5694    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
5695    #[prost(string, optional, tag = "5")]
5696    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5697}
5698#[non_exhaustive]
5699#[derive(Clone, PartialEq, ::prost::Message)]
5700pub struct ListOwnedObjectsResponse {
5701    /// Page of dynamic fields owned by the specified parent.
5702    #[prost(message, repeated, tag = "1")]
5703    pub objects: ::prost::alloc::vec::Vec<Object>,
5704    /// A token, which can be sent as `page_token` to retrieve the next page.
5705    /// If this field is omitted, there are no subsequent pages.
5706    #[prost(bytes = "bytes", optional, tag = "2")]
5707    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5708}
5709/// Generated client implementations.
5710pub mod state_service_client {
5711    #![allow(
5712        unused_variables,
5713        dead_code,
5714        missing_docs,
5715        clippy::wildcard_imports,
5716        clippy::let_unit_value,
5717    )]
5718    use tonic::codegen::*;
5719    use tonic::codegen::http::Uri;
5720    #[derive(Debug, Clone)]
5721    pub struct StateServiceClient<T> {
5722        inner: tonic::client::Grpc<T>,
5723    }
5724    impl StateServiceClient<tonic::transport::Channel> {
5725        /// Attempt to create a new client by connecting to a given endpoint.
5726        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5727        where
5728            D: TryInto<tonic::transport::Endpoint>,
5729            D::Error: Into<StdError>,
5730        {
5731            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5732            Ok(Self::new(conn))
5733        }
5734    }
5735    impl<T> StateServiceClient<T>
5736    where
5737        T: tonic::client::GrpcService<tonic::body::Body>,
5738        T::Error: Into<StdError>,
5739        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5740        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5741    {
5742        pub fn new(inner: T) -> Self {
5743            let inner = tonic::client::Grpc::new(inner);
5744            Self { inner }
5745        }
5746        pub fn with_origin(inner: T, origin: Uri) -> Self {
5747            let inner = tonic::client::Grpc::with_origin(inner, origin);
5748            Self { inner }
5749        }
5750        pub fn with_interceptor<F>(
5751            inner: T,
5752            interceptor: F,
5753        ) -> StateServiceClient<InterceptedService<T, F>>
5754        where
5755            F: tonic::service::Interceptor,
5756            T::ResponseBody: Default,
5757            T: tonic::codegen::Service<
5758                http::Request<tonic::body::Body>,
5759                Response = http::Response<
5760                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5761                >,
5762            >,
5763            <T as tonic::codegen::Service<
5764                http::Request<tonic::body::Body>,
5765            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5766        {
5767            StateServiceClient::new(InterceptedService::new(inner, interceptor))
5768        }
5769        /// Compress requests with the given encoding.
5770        ///
5771        /// This requires the server to support it otherwise it might respond with an
5772        /// error.
5773        #[must_use]
5774        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5775            self.inner = self.inner.send_compressed(encoding);
5776            self
5777        }
5778        /// Enable decompressing responses.
5779        #[must_use]
5780        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5781            self.inner = self.inner.accept_compressed(encoding);
5782            self
5783        }
5784        /// Limits the maximum size of a decoded message.
5785        ///
5786        /// Default: `4MB`
5787        #[must_use]
5788        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5789            self.inner = self.inner.max_decoding_message_size(limit);
5790            self
5791        }
5792        /// Limits the maximum size of an encoded message.
5793        ///
5794        /// Default: `usize::MAX`
5795        #[must_use]
5796        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5797            self.inner = self.inner.max_encoding_message_size(limit);
5798            self
5799        }
5800        pub async fn list_dynamic_fields(
5801            &mut self,
5802            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5803        ) -> std::result::Result<
5804            tonic::Response<super::ListDynamicFieldsResponse>,
5805            tonic::Status,
5806        > {
5807            self.inner
5808                .ready()
5809                .await
5810                .map_err(|e| {
5811                    tonic::Status::unknown(
5812                        format!("Service was not ready: {}", e.into()),
5813                    )
5814                })?;
5815            let codec = tonic_prost::ProstCodec::default();
5816            let path = http::uri::PathAndQuery::from_static(
5817                "/sui.rpc.v2.StateService/ListDynamicFields",
5818            );
5819            let mut req = request.into_request();
5820            req.extensions_mut()
5821                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5822            self.inner.unary(req, path, codec).await
5823        }
5824        pub async fn list_owned_objects(
5825            &mut self,
5826            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5827        ) -> std::result::Result<
5828            tonic::Response<super::ListOwnedObjectsResponse>,
5829            tonic::Status,
5830        > {
5831            self.inner
5832                .ready()
5833                .await
5834                .map_err(|e| {
5835                    tonic::Status::unknown(
5836                        format!("Service was not ready: {}", e.into()),
5837                    )
5838                })?;
5839            let codec = tonic_prost::ProstCodec::default();
5840            let path = http::uri::PathAndQuery::from_static(
5841                "/sui.rpc.v2.StateService/ListOwnedObjects",
5842            );
5843            let mut req = request.into_request();
5844            req.extensions_mut()
5845                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5846            self.inner.unary(req, path, codec).await
5847        }
5848        pub async fn get_coin_info(
5849            &mut self,
5850            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5851        ) -> std::result::Result<
5852            tonic::Response<super::GetCoinInfoResponse>,
5853            tonic::Status,
5854        > {
5855            self.inner
5856                .ready()
5857                .await
5858                .map_err(|e| {
5859                    tonic::Status::unknown(
5860                        format!("Service was not ready: {}", e.into()),
5861                    )
5862                })?;
5863            let codec = tonic_prost::ProstCodec::default();
5864            let path = http::uri::PathAndQuery::from_static(
5865                "/sui.rpc.v2.StateService/GetCoinInfo",
5866            );
5867            let mut req = request.into_request();
5868            req.extensions_mut()
5869                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5870            self.inner.unary(req, path, codec).await
5871        }
5872        pub async fn get_balance(
5873            &mut self,
5874            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5875        ) -> std::result::Result<
5876            tonic::Response<super::GetBalanceResponse>,
5877            tonic::Status,
5878        > {
5879            self.inner
5880                .ready()
5881                .await
5882                .map_err(|e| {
5883                    tonic::Status::unknown(
5884                        format!("Service was not ready: {}", e.into()),
5885                    )
5886                })?;
5887            let codec = tonic_prost::ProstCodec::default();
5888            let path = http::uri::PathAndQuery::from_static(
5889                "/sui.rpc.v2.StateService/GetBalance",
5890            );
5891            let mut req = request.into_request();
5892            req.extensions_mut()
5893                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5894            self.inner.unary(req, path, codec).await
5895        }
5896        pub async fn list_balances(
5897            &mut self,
5898            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5899        ) -> std::result::Result<
5900            tonic::Response<super::ListBalancesResponse>,
5901            tonic::Status,
5902        > {
5903            self.inner
5904                .ready()
5905                .await
5906                .map_err(|e| {
5907                    tonic::Status::unknown(
5908                        format!("Service was not ready: {}", e.into()),
5909                    )
5910                })?;
5911            let codec = tonic_prost::ProstCodec::default();
5912            let path = http::uri::PathAndQuery::from_static(
5913                "/sui.rpc.v2.StateService/ListBalances",
5914            );
5915            let mut req = request.into_request();
5916            req.extensions_mut()
5917                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5918            self.inner.unary(req, path, codec).await
5919        }
5920    }
5921}
5922/// Generated server implementations.
5923pub mod state_service_server {
5924    #![allow(
5925        unused_variables,
5926        dead_code,
5927        missing_docs,
5928        clippy::wildcard_imports,
5929        clippy::let_unit_value,
5930    )]
5931    use tonic::codegen::*;
5932    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
5933    #[async_trait]
5934    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5935        async fn list_dynamic_fields(
5936            &self,
5937            request: tonic::Request<super::ListDynamicFieldsRequest>,
5938        ) -> std::result::Result<
5939            tonic::Response<super::ListDynamicFieldsResponse>,
5940            tonic::Status,
5941        > {
5942            Err(tonic::Status::unimplemented("Not yet implemented"))
5943        }
5944        async fn list_owned_objects(
5945            &self,
5946            request: tonic::Request<super::ListOwnedObjectsRequest>,
5947        ) -> std::result::Result<
5948            tonic::Response<super::ListOwnedObjectsResponse>,
5949            tonic::Status,
5950        > {
5951            Err(tonic::Status::unimplemented("Not yet implemented"))
5952        }
5953        async fn get_coin_info(
5954            &self,
5955            request: tonic::Request<super::GetCoinInfoRequest>,
5956        ) -> std::result::Result<
5957            tonic::Response<super::GetCoinInfoResponse>,
5958            tonic::Status,
5959        > {
5960            Err(tonic::Status::unimplemented("Not yet implemented"))
5961        }
5962        async fn get_balance(
5963            &self,
5964            request: tonic::Request<super::GetBalanceRequest>,
5965        ) -> std::result::Result<
5966            tonic::Response<super::GetBalanceResponse>,
5967            tonic::Status,
5968        > {
5969            Err(tonic::Status::unimplemented("Not yet implemented"))
5970        }
5971        async fn list_balances(
5972            &self,
5973            request: tonic::Request<super::ListBalancesRequest>,
5974        ) -> std::result::Result<
5975            tonic::Response<super::ListBalancesResponse>,
5976            tonic::Status,
5977        > {
5978            Err(tonic::Status::unimplemented("Not yet implemented"))
5979        }
5980    }
5981    #[derive(Debug)]
5982    pub struct StateServiceServer<T> {
5983        inner: Arc<T>,
5984        accept_compression_encodings: EnabledCompressionEncodings,
5985        send_compression_encodings: EnabledCompressionEncodings,
5986        max_decoding_message_size: Option<usize>,
5987        max_encoding_message_size: Option<usize>,
5988    }
5989    impl<T> StateServiceServer<T> {
5990        pub fn new(inner: T) -> Self {
5991            Self::from_arc(Arc::new(inner))
5992        }
5993        pub fn from_arc(inner: Arc<T>) -> Self {
5994            Self {
5995                inner,
5996                accept_compression_encodings: Default::default(),
5997                send_compression_encodings: Default::default(),
5998                max_decoding_message_size: None,
5999                max_encoding_message_size: None,
6000            }
6001        }
6002        pub fn with_interceptor<F>(
6003            inner: T,
6004            interceptor: F,
6005        ) -> InterceptedService<Self, F>
6006        where
6007            F: tonic::service::Interceptor,
6008        {
6009            InterceptedService::new(Self::new(inner), interceptor)
6010        }
6011        /// Enable decompressing requests with the given encoding.
6012        #[must_use]
6013        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6014            self.accept_compression_encodings.enable(encoding);
6015            self
6016        }
6017        /// Compress responses with the given encoding, if the client supports it.
6018        #[must_use]
6019        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6020            self.send_compression_encodings.enable(encoding);
6021            self
6022        }
6023        /// Limits the maximum size of a decoded message.
6024        ///
6025        /// Default: `4MB`
6026        #[must_use]
6027        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6028            self.max_decoding_message_size = Some(limit);
6029            self
6030        }
6031        /// Limits the maximum size of an encoded message.
6032        ///
6033        /// Default: `usize::MAX`
6034        #[must_use]
6035        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6036            self.max_encoding_message_size = Some(limit);
6037            self
6038        }
6039    }
6040    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6041    where
6042        T: StateService,
6043        B: Body + std::marker::Send + 'static,
6044        B::Error: Into<StdError> + std::marker::Send + 'static,
6045    {
6046        type Response = http::Response<tonic::body::Body>;
6047        type Error = std::convert::Infallible;
6048        type Future = BoxFuture<Self::Response, Self::Error>;
6049        fn poll_ready(
6050            &mut self,
6051            _cx: &mut Context<'_>,
6052        ) -> Poll<std::result::Result<(), Self::Error>> {
6053            Poll::Ready(Ok(()))
6054        }
6055        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6056            match req.uri().path() {
6057                "/sui.rpc.v2.StateService/ListDynamicFields" => {
6058                    #[allow(non_camel_case_types)]
6059                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6060                    impl<
6061                        T: StateService,
6062                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6063                    for ListDynamicFieldsSvc<T> {
6064                        type Response = super::ListDynamicFieldsResponse;
6065                        type Future = BoxFuture<
6066                            tonic::Response<Self::Response>,
6067                            tonic::Status,
6068                        >;
6069                        fn call(
6070                            &mut self,
6071                            request: tonic::Request<super::ListDynamicFieldsRequest>,
6072                        ) -> Self::Future {
6073                            let inner = Arc::clone(&self.0);
6074                            let fut = async move {
6075                                <T as StateService>::list_dynamic_fields(&inner, request)
6076                                    .await
6077                            };
6078                            Box::pin(fut)
6079                        }
6080                    }
6081                    let accept_compression_encodings = self.accept_compression_encodings;
6082                    let send_compression_encodings = self.send_compression_encodings;
6083                    let max_decoding_message_size = self.max_decoding_message_size;
6084                    let max_encoding_message_size = self.max_encoding_message_size;
6085                    let inner = self.inner.clone();
6086                    let fut = async move {
6087                        let method = ListDynamicFieldsSvc(inner);
6088                        let codec = tonic_prost::ProstCodec::default();
6089                        let mut grpc = tonic::server::Grpc::new(codec)
6090                            .apply_compression_config(
6091                                accept_compression_encodings,
6092                                send_compression_encodings,
6093                            )
6094                            .apply_max_message_size_config(
6095                                max_decoding_message_size,
6096                                max_encoding_message_size,
6097                            );
6098                        let res = grpc.unary(method, req).await;
6099                        Ok(res)
6100                    };
6101                    Box::pin(fut)
6102                }
6103                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6104                    #[allow(non_camel_case_types)]
6105                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6106                    impl<
6107                        T: StateService,
6108                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6109                    for ListOwnedObjectsSvc<T> {
6110                        type Response = super::ListOwnedObjectsResponse;
6111                        type Future = BoxFuture<
6112                            tonic::Response<Self::Response>,
6113                            tonic::Status,
6114                        >;
6115                        fn call(
6116                            &mut self,
6117                            request: tonic::Request<super::ListOwnedObjectsRequest>,
6118                        ) -> Self::Future {
6119                            let inner = Arc::clone(&self.0);
6120                            let fut = async move {
6121                                <T as StateService>::list_owned_objects(&inner, request)
6122                                    .await
6123                            };
6124                            Box::pin(fut)
6125                        }
6126                    }
6127                    let accept_compression_encodings = self.accept_compression_encodings;
6128                    let send_compression_encodings = self.send_compression_encodings;
6129                    let max_decoding_message_size = self.max_decoding_message_size;
6130                    let max_encoding_message_size = self.max_encoding_message_size;
6131                    let inner = self.inner.clone();
6132                    let fut = async move {
6133                        let method = ListOwnedObjectsSvc(inner);
6134                        let codec = tonic_prost::ProstCodec::default();
6135                        let mut grpc = tonic::server::Grpc::new(codec)
6136                            .apply_compression_config(
6137                                accept_compression_encodings,
6138                                send_compression_encodings,
6139                            )
6140                            .apply_max_message_size_config(
6141                                max_decoding_message_size,
6142                                max_encoding_message_size,
6143                            );
6144                        let res = grpc.unary(method, req).await;
6145                        Ok(res)
6146                    };
6147                    Box::pin(fut)
6148                }
6149                "/sui.rpc.v2.StateService/GetCoinInfo" => {
6150                    #[allow(non_camel_case_types)]
6151                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6152                    impl<
6153                        T: StateService,
6154                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
6155                    for GetCoinInfoSvc<T> {
6156                        type Response = super::GetCoinInfoResponse;
6157                        type Future = BoxFuture<
6158                            tonic::Response<Self::Response>,
6159                            tonic::Status,
6160                        >;
6161                        fn call(
6162                            &mut self,
6163                            request: tonic::Request<super::GetCoinInfoRequest>,
6164                        ) -> Self::Future {
6165                            let inner = Arc::clone(&self.0);
6166                            let fut = async move {
6167                                <T as StateService>::get_coin_info(&inner, request).await
6168                            };
6169                            Box::pin(fut)
6170                        }
6171                    }
6172                    let accept_compression_encodings = self.accept_compression_encodings;
6173                    let send_compression_encodings = self.send_compression_encodings;
6174                    let max_decoding_message_size = self.max_decoding_message_size;
6175                    let max_encoding_message_size = self.max_encoding_message_size;
6176                    let inner = self.inner.clone();
6177                    let fut = async move {
6178                        let method = GetCoinInfoSvc(inner);
6179                        let codec = tonic_prost::ProstCodec::default();
6180                        let mut grpc = tonic::server::Grpc::new(codec)
6181                            .apply_compression_config(
6182                                accept_compression_encodings,
6183                                send_compression_encodings,
6184                            )
6185                            .apply_max_message_size_config(
6186                                max_decoding_message_size,
6187                                max_encoding_message_size,
6188                            );
6189                        let res = grpc.unary(method, req).await;
6190                        Ok(res)
6191                    };
6192                    Box::pin(fut)
6193                }
6194                "/sui.rpc.v2.StateService/GetBalance" => {
6195                    #[allow(non_camel_case_types)]
6196                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6197                    impl<
6198                        T: StateService,
6199                    > tonic::server::UnaryService<super::GetBalanceRequest>
6200                    for GetBalanceSvc<T> {
6201                        type Response = super::GetBalanceResponse;
6202                        type Future = BoxFuture<
6203                            tonic::Response<Self::Response>,
6204                            tonic::Status,
6205                        >;
6206                        fn call(
6207                            &mut self,
6208                            request: tonic::Request<super::GetBalanceRequest>,
6209                        ) -> Self::Future {
6210                            let inner = Arc::clone(&self.0);
6211                            let fut = async move {
6212                                <T as StateService>::get_balance(&inner, request).await
6213                            };
6214                            Box::pin(fut)
6215                        }
6216                    }
6217                    let accept_compression_encodings = self.accept_compression_encodings;
6218                    let send_compression_encodings = self.send_compression_encodings;
6219                    let max_decoding_message_size = self.max_decoding_message_size;
6220                    let max_encoding_message_size = self.max_encoding_message_size;
6221                    let inner = self.inner.clone();
6222                    let fut = async move {
6223                        let method = GetBalanceSvc(inner);
6224                        let codec = tonic_prost::ProstCodec::default();
6225                        let mut grpc = tonic::server::Grpc::new(codec)
6226                            .apply_compression_config(
6227                                accept_compression_encodings,
6228                                send_compression_encodings,
6229                            )
6230                            .apply_max_message_size_config(
6231                                max_decoding_message_size,
6232                                max_encoding_message_size,
6233                            );
6234                        let res = grpc.unary(method, req).await;
6235                        Ok(res)
6236                    };
6237                    Box::pin(fut)
6238                }
6239                "/sui.rpc.v2.StateService/ListBalances" => {
6240                    #[allow(non_camel_case_types)]
6241                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6242                    impl<
6243                        T: StateService,
6244                    > tonic::server::UnaryService<super::ListBalancesRequest>
6245                    for ListBalancesSvc<T> {
6246                        type Response = super::ListBalancesResponse;
6247                        type Future = BoxFuture<
6248                            tonic::Response<Self::Response>,
6249                            tonic::Status,
6250                        >;
6251                        fn call(
6252                            &mut self,
6253                            request: tonic::Request<super::ListBalancesRequest>,
6254                        ) -> Self::Future {
6255                            let inner = Arc::clone(&self.0);
6256                            let fut = async move {
6257                                <T as StateService>::list_balances(&inner, request).await
6258                            };
6259                            Box::pin(fut)
6260                        }
6261                    }
6262                    let accept_compression_encodings = self.accept_compression_encodings;
6263                    let send_compression_encodings = self.send_compression_encodings;
6264                    let max_decoding_message_size = self.max_decoding_message_size;
6265                    let max_encoding_message_size = self.max_encoding_message_size;
6266                    let inner = self.inner.clone();
6267                    let fut = async move {
6268                        let method = ListBalancesSvc(inner);
6269                        let codec = tonic_prost::ProstCodec::default();
6270                        let mut grpc = tonic::server::Grpc::new(codec)
6271                            .apply_compression_config(
6272                                accept_compression_encodings,
6273                                send_compression_encodings,
6274                            )
6275                            .apply_max_message_size_config(
6276                                max_decoding_message_size,
6277                                max_encoding_message_size,
6278                            );
6279                        let res = grpc.unary(method, req).await;
6280                        Ok(res)
6281                    };
6282                    Box::pin(fut)
6283                }
6284                _ => {
6285                    Box::pin(async move {
6286                        let mut response = http::Response::new(
6287                            tonic::body::Body::default(),
6288                        );
6289                        let headers = response.headers_mut();
6290                        headers
6291                            .insert(
6292                                tonic::Status::GRPC_STATUS,
6293                                (tonic::Code::Unimplemented as i32).into(),
6294                            );
6295                        headers
6296                            .insert(
6297                                http::header::CONTENT_TYPE,
6298                                tonic::metadata::GRPC_CONTENT_TYPE,
6299                            );
6300                        Ok(response)
6301                    })
6302                }
6303            }
6304        }
6305    }
6306    impl<T> Clone for StateServiceServer<T> {
6307        fn clone(&self) -> Self {
6308            let inner = self.inner.clone();
6309            Self {
6310                inner,
6311                accept_compression_encodings: self.accept_compression_encodings,
6312                send_compression_encodings: self.send_compression_encodings,
6313                max_decoding_message_size: self.max_decoding_message_size,
6314                max_encoding_message_size: self.max_encoding_message_size,
6315            }
6316        }
6317    }
6318    /// Generated gRPC service name
6319    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6320    impl<T> tonic::server::NamedService for StateServiceServer<T> {
6321        const NAME: &'static str = SERVICE_NAME;
6322    }
6323}
6324/// Request message for SubscriptionService.SubscribeCheckpoints
6325#[non_exhaustive]
6326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6327pub struct SubscribeCheckpointsRequest {
6328    /// Optional. Mask for specifying which parts of the
6329    /// SubscribeCheckpointsResponse should be returned.
6330    #[prost(message, optional, tag = "1")]
6331    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6332}
6333/// Response message for SubscriptionService.SubscribeCheckpoints
6334#[non_exhaustive]
6335#[derive(Clone, PartialEq, ::prost::Message)]
6336pub struct SubscribeCheckpointsResponse {
6337    /// Required. The checkpoint sequence number and value of the current cursor
6338    /// into the checkpoint stream
6339    #[prost(uint64, optional, tag = "1")]
6340    pub cursor: ::core::option::Option<u64>,
6341    /// The requested data for this checkpoint
6342    #[prost(message, optional, tag = "2")]
6343    pub checkpoint: ::core::option::Option<Checkpoint>,
6344}
6345/// Generated client implementations.
6346pub mod subscription_service_client {
6347    #![allow(
6348        unused_variables,
6349        dead_code,
6350        missing_docs,
6351        clippy::wildcard_imports,
6352        clippy::let_unit_value,
6353    )]
6354    use tonic::codegen::*;
6355    use tonic::codegen::http::Uri;
6356    #[derive(Debug, Clone)]
6357    pub struct SubscriptionServiceClient<T> {
6358        inner: tonic::client::Grpc<T>,
6359    }
6360    impl SubscriptionServiceClient<tonic::transport::Channel> {
6361        /// Attempt to create a new client by connecting to a given endpoint.
6362        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6363        where
6364            D: TryInto<tonic::transport::Endpoint>,
6365            D::Error: Into<StdError>,
6366        {
6367            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6368            Ok(Self::new(conn))
6369        }
6370    }
6371    impl<T> SubscriptionServiceClient<T>
6372    where
6373        T: tonic::client::GrpcService<tonic::body::Body>,
6374        T::Error: Into<StdError>,
6375        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6376        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6377    {
6378        pub fn new(inner: T) -> Self {
6379            let inner = tonic::client::Grpc::new(inner);
6380            Self { inner }
6381        }
6382        pub fn with_origin(inner: T, origin: Uri) -> Self {
6383            let inner = tonic::client::Grpc::with_origin(inner, origin);
6384            Self { inner }
6385        }
6386        pub fn with_interceptor<F>(
6387            inner: T,
6388            interceptor: F,
6389        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6390        where
6391            F: tonic::service::Interceptor,
6392            T::ResponseBody: Default,
6393            T: tonic::codegen::Service<
6394                http::Request<tonic::body::Body>,
6395                Response = http::Response<
6396                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6397                >,
6398            >,
6399            <T as tonic::codegen::Service<
6400                http::Request<tonic::body::Body>,
6401            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6402        {
6403            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6404        }
6405        /// Compress requests with the given encoding.
6406        ///
6407        /// This requires the server to support it otherwise it might respond with an
6408        /// error.
6409        #[must_use]
6410        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6411            self.inner = self.inner.send_compressed(encoding);
6412            self
6413        }
6414        /// Enable decompressing responses.
6415        #[must_use]
6416        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6417            self.inner = self.inner.accept_compressed(encoding);
6418            self
6419        }
6420        /// Limits the maximum size of a decoded message.
6421        ///
6422        /// Default: `4MB`
6423        #[must_use]
6424        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6425            self.inner = self.inner.max_decoding_message_size(limit);
6426            self
6427        }
6428        /// Limits the maximum size of an encoded message.
6429        ///
6430        /// Default: `usize::MAX`
6431        #[must_use]
6432        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6433            self.inner = self.inner.max_encoding_message_size(limit);
6434            self
6435        }
6436        /// Subscribe to the stream of checkpoints.
6437        ///
6438        /// This API provides a subscription to the checkpoint stream for the Sui
6439        /// blockchain. When a subscription is initialized the stream will begin with
6440        /// the latest executed checkpoint as seen by the server. Responses are
6441        /// guaranteed to return checkpoints in-order and without gaps. This enables
6442        /// clients to know exactly the last checkpoint they have processed and in the
6443        /// event the subscription terminates (either by the client/server or by the
6444        /// connection breaking), clients will be able to reinitialize a subscription
6445        /// and then leverage other APIs in order to request data for the checkpoints
6446        /// they missed.
6447        pub async fn subscribe_checkpoints(
6448            &mut self,
6449            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6450        ) -> std::result::Result<
6451            tonic::Response<
6452                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6453            >,
6454            tonic::Status,
6455        > {
6456            self.inner
6457                .ready()
6458                .await
6459                .map_err(|e| {
6460                    tonic::Status::unknown(
6461                        format!("Service was not ready: {}", e.into()),
6462                    )
6463                })?;
6464            let codec = tonic_prost::ProstCodec::default();
6465            let path = http::uri::PathAndQuery::from_static(
6466                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6467            );
6468            let mut req = request.into_request();
6469            req.extensions_mut()
6470                .insert(
6471                    GrpcMethod::new(
6472                        "sui.rpc.v2.SubscriptionService",
6473                        "SubscribeCheckpoints",
6474                    ),
6475                );
6476            self.inner.server_streaming(req, path, codec).await
6477        }
6478    }
6479}
6480/// Generated server implementations.
6481pub mod subscription_service_server {
6482    #![allow(
6483        unused_variables,
6484        dead_code,
6485        missing_docs,
6486        clippy::wildcard_imports,
6487        clippy::let_unit_value,
6488    )]
6489    use tonic::codegen::*;
6490    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
6491    #[async_trait]
6492    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6493        /// Subscribe to the stream of checkpoints.
6494        ///
6495        /// This API provides a subscription to the checkpoint stream for the Sui
6496        /// blockchain. When a subscription is initialized the stream will begin with
6497        /// the latest executed checkpoint as seen by the server. Responses are
6498        /// guaranteed to return checkpoints in-order and without gaps. This enables
6499        /// clients to know exactly the last checkpoint they have processed and in the
6500        /// event the subscription terminates (either by the client/server or by the
6501        /// connection breaking), clients will be able to reinitialize a subscription
6502        /// and then leverage other APIs in order to request data for the checkpoints
6503        /// they missed.
6504        async fn subscribe_checkpoints(
6505            &self,
6506            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6507        ) -> std::result::Result<
6508            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
6509            tonic::Status,
6510        > {
6511            Err(tonic::Status::unimplemented("Not yet implemented"))
6512        }
6513    }
6514    #[derive(Debug)]
6515    pub struct SubscriptionServiceServer<T> {
6516        inner: Arc<T>,
6517        accept_compression_encodings: EnabledCompressionEncodings,
6518        send_compression_encodings: EnabledCompressionEncodings,
6519        max_decoding_message_size: Option<usize>,
6520        max_encoding_message_size: Option<usize>,
6521    }
6522    impl<T> SubscriptionServiceServer<T> {
6523        pub fn new(inner: T) -> Self {
6524            Self::from_arc(Arc::new(inner))
6525        }
6526        pub fn from_arc(inner: Arc<T>) -> Self {
6527            Self {
6528                inner,
6529                accept_compression_encodings: Default::default(),
6530                send_compression_encodings: Default::default(),
6531                max_decoding_message_size: None,
6532                max_encoding_message_size: None,
6533            }
6534        }
6535        pub fn with_interceptor<F>(
6536            inner: T,
6537            interceptor: F,
6538        ) -> InterceptedService<Self, F>
6539        where
6540            F: tonic::service::Interceptor,
6541        {
6542            InterceptedService::new(Self::new(inner), interceptor)
6543        }
6544        /// Enable decompressing requests with the given encoding.
6545        #[must_use]
6546        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6547            self.accept_compression_encodings.enable(encoding);
6548            self
6549        }
6550        /// Compress responses with the given encoding, if the client supports it.
6551        #[must_use]
6552        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6553            self.send_compression_encodings.enable(encoding);
6554            self
6555        }
6556        /// Limits the maximum size of a decoded message.
6557        ///
6558        /// Default: `4MB`
6559        #[must_use]
6560        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6561            self.max_decoding_message_size = Some(limit);
6562            self
6563        }
6564        /// Limits the maximum size of an encoded message.
6565        ///
6566        /// Default: `usize::MAX`
6567        #[must_use]
6568        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6569            self.max_encoding_message_size = Some(limit);
6570            self
6571        }
6572    }
6573    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6574    where
6575        T: SubscriptionService,
6576        B: Body + std::marker::Send + 'static,
6577        B::Error: Into<StdError> + std::marker::Send + 'static,
6578    {
6579        type Response = http::Response<tonic::body::Body>;
6580        type Error = std::convert::Infallible;
6581        type Future = BoxFuture<Self::Response, Self::Error>;
6582        fn poll_ready(
6583            &mut self,
6584            _cx: &mut Context<'_>,
6585        ) -> Poll<std::result::Result<(), Self::Error>> {
6586            Poll::Ready(Ok(()))
6587        }
6588        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6589            match req.uri().path() {
6590                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6591                    #[allow(non_camel_case_types)]
6592                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6593                    impl<
6594                        T: SubscriptionService,
6595                    > tonic::server::ServerStreamingService<
6596                        super::SubscribeCheckpointsRequest,
6597                    > for SubscribeCheckpointsSvc<T> {
6598                        type Response = super::SubscribeCheckpointsResponse;
6599                        type ResponseStream = BoxStream<
6600                            super::SubscribeCheckpointsResponse,
6601                        >;
6602                        type Future = BoxFuture<
6603                            tonic::Response<Self::ResponseStream>,
6604                            tonic::Status,
6605                        >;
6606                        fn call(
6607                            &mut self,
6608                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6609                        ) -> Self::Future {
6610                            let inner = Arc::clone(&self.0);
6611                            let fut = async move {
6612                                <T as SubscriptionService>::subscribe_checkpoints(
6613                                        &inner,
6614                                        request,
6615                                    )
6616                                    .await
6617                            };
6618                            Box::pin(fut)
6619                        }
6620                    }
6621                    let accept_compression_encodings = self.accept_compression_encodings;
6622                    let send_compression_encodings = self.send_compression_encodings;
6623                    let max_decoding_message_size = self.max_decoding_message_size;
6624                    let max_encoding_message_size = self.max_encoding_message_size;
6625                    let inner = self.inner.clone();
6626                    let fut = async move {
6627                        let method = SubscribeCheckpointsSvc(inner);
6628                        let codec = tonic_prost::ProstCodec::default();
6629                        let mut grpc = tonic::server::Grpc::new(codec)
6630                            .apply_compression_config(
6631                                accept_compression_encodings,
6632                                send_compression_encodings,
6633                            )
6634                            .apply_max_message_size_config(
6635                                max_decoding_message_size,
6636                                max_encoding_message_size,
6637                            );
6638                        let res = grpc.server_streaming(method, req).await;
6639                        Ok(res)
6640                    };
6641                    Box::pin(fut)
6642                }
6643                _ => {
6644                    Box::pin(async move {
6645                        let mut response = http::Response::new(
6646                            tonic::body::Body::default(),
6647                        );
6648                        let headers = response.headers_mut();
6649                        headers
6650                            .insert(
6651                                tonic::Status::GRPC_STATUS,
6652                                (tonic::Code::Unimplemented as i32).into(),
6653                            );
6654                        headers
6655                            .insert(
6656                                http::header::CONTENT_TYPE,
6657                                tonic::metadata::GRPC_CONTENT_TYPE,
6658                            );
6659                        Ok(response)
6660                    })
6661                }
6662            }
6663        }
6664    }
6665    impl<T> Clone for SubscriptionServiceServer<T> {
6666        fn clone(&self) -> Self {
6667            let inner = self.inner.clone();
6668            Self {
6669                inner,
6670                accept_compression_encodings: self.accept_compression_encodings,
6671                send_compression_encodings: self.send_compression_encodings,
6672                max_decoding_message_size: self.max_decoding_message_size,
6673                max_encoding_message_size: self.max_encoding_message_size,
6674            }
6675        }
6676    }
6677    /// Generated gRPC service name
6678    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6679    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6680        const NAME: &'static str = SERVICE_NAME;
6681    }
6682}
6683#[non_exhaustive]
6684#[derive(Clone, PartialEq, ::prost::Message)]
6685pub struct SystemState {
6686    /// The version of the system state data structure type.
6687    #[prost(uint64, optional, tag = "1")]
6688    pub version: ::core::option::Option<u64>,
6689    /// The epoch id
6690    #[prost(uint64, optional, tag = "2")]
6691    pub epoch: ::core::option::Option<u64>,
6692    /// The protocol version
6693    #[prost(uint64, optional, tag = "3")]
6694    pub protocol_version: ::core::option::Option<u64>,
6695    /// Information about the validators
6696    #[prost(message, optional, tag = "4")]
6697    pub validators: ::core::option::Option<ValidatorSet>,
6698    /// Storage Fund info
6699    #[prost(message, optional, tag = "5")]
6700    pub storage_fund: ::core::option::Option<StorageFund>,
6701    /// Set of system config parameters
6702    #[prost(message, optional, tag = "6")]
6703    pub parameters: ::core::option::Option<SystemParameters>,
6704    /// The reference gas price for this epoch
6705    #[prost(uint64, optional, tag = "7")]
6706    pub reference_gas_price: ::core::option::Option<u64>,
6707    /// A list of the records of validator reporting each other.
6708    ///
6709    /// There is an entry in this list for each validator that has been reported
6710    /// at least once. Each record contains all the validators that reported
6711    /// them. If a validator has never been reported they don't have a record in this list.
6712    /// This lists persists across epoch: a peer continues being in a reported state until the
6713    /// reporter doesn't explicitly remove their report.
6714    #[prost(message, repeated, tag = "8")]
6715    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6716    /// Schedule of stake subsidies given out each epoch.
6717    #[prost(message, optional, tag = "9")]
6718    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6719    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
6720    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
6721    /// It can be reset once we are able to successfully execute advance_epoch.
6722    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
6723    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
6724    /// are out of safe mode.
6725    #[prost(bool, optional, tag = "10")]
6726    pub safe_mode: ::core::option::Option<bool>,
6727    /// Storage rewards accumulated during safe_mode
6728    #[prost(uint64, optional, tag = "11")]
6729    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6730    /// Computation rewards accumulated during safe_mode
6731    #[prost(uint64, optional, tag = "12")]
6732    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6733    /// Storage rebates paid out during safe_mode
6734    #[prost(uint64, optional, tag = "13")]
6735    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6736    /// Nonrefundable storage fees accumulated during safe_mode
6737    #[prost(uint64, optional, tag = "14")]
6738    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6739    /// Unix timestamp of when this this epoch started
6740    #[prost(uint64, optional, tag = "15")]
6741    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6742    /// Any extra fields that's not defined statically.
6743    #[prost(message, optional, tag = "16")]
6744    pub extra_fields: ::core::option::Option<MoveTable>,
6745}
6746#[non_exhaustive]
6747#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6748pub struct ValidatorReportRecord {
6749    /// The address of the validator being reported
6750    #[prost(string, optional, tag = "1")]
6751    pub reported: ::core::option::Option<::prost::alloc::string::String>,
6752    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
6753    #[prost(string, repeated, tag = "2")]
6754    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6755}
6756#[non_exhaustive]
6757#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6758pub struct SystemParameters {
6759    /// The duration of an epoch, in milliseconds.
6760    #[prost(uint64, optional, tag = "1")]
6761    pub epoch_duration_ms: ::core::option::Option<u64>,
6762    /// The starting epoch in which stake subsidies start being paid out
6763    #[prost(uint64, optional, tag = "2")]
6764    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6765    /// Minimum number of active validators at any moment.
6766    #[prost(uint64, optional, tag = "3")]
6767    pub min_validator_count: ::core::option::Option<u64>,
6768    /// Maximum number of active validators at any moment.
6769    /// We do not allow the number of validators in any epoch to go above this.
6770    #[prost(uint64, optional, tag = "4")]
6771    pub max_validator_count: ::core::option::Option<u64>,
6772    /// Deprecated.
6773    /// Lower-bound on the amount of stake required to become a validator.
6774    #[prost(uint64, optional, tag = "5")]
6775    pub min_validator_joining_stake: ::core::option::Option<u64>,
6776    /// Deprecated.
6777    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
6778    /// have low stake and will be escorted out of the validator set after being below this
6779    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
6780    #[prost(uint64, optional, tag = "6")]
6781    pub validator_low_stake_threshold: ::core::option::Option<u64>,
6782    /// Deprecated.
6783    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
6784    /// immediately at epoch change, no grace period.
6785    #[prost(uint64, optional, tag = "7")]
6786    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6787    /// A validator can have stake below `validator_low_stake_threshold`
6788    /// for this many epochs before being kicked out.
6789    #[prost(uint64, optional, tag = "8")]
6790    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6791    /// Any extra fields that are not defined statically.
6792    #[prost(message, optional, tag = "9")]
6793    pub extra_fields: ::core::option::Option<MoveTable>,
6794}
6795/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
6796#[non_exhaustive]
6797#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6798pub struct MoveTable {
6799    /// The UID of the table or bag
6800    #[prost(string, optional, tag = "1")]
6801    pub id: ::core::option::Option<::prost::alloc::string::String>,
6802    /// The size or number of key-value pairs in the table or bag
6803    #[prost(uint64, optional, tag = "2")]
6804    pub size: ::core::option::Option<u64>,
6805}
6806#[non_exhaustive]
6807#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6808pub struct StakeSubsidy {
6809    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
6810    #[prost(uint64, optional, tag = "1")]
6811    pub balance: ::core::option::Option<u64>,
6812    /// Count of the number of times stake subsidies have been distributed.
6813    #[prost(uint64, optional, tag = "2")]
6814    pub distribution_counter: ::core::option::Option<u64>,
6815    /// The amount of stake subsidy to be drawn down per distribution.
6816    /// This amount decays and decreases over time.
6817    #[prost(uint64, optional, tag = "3")]
6818    pub current_distribution_amount: ::core::option::Option<u64>,
6819    /// Number of distributions to occur before the distribution amount decays.
6820    #[prost(uint64, optional, tag = "4")]
6821    pub stake_subsidy_period_length: ::core::option::Option<u64>,
6822    /// The rate at which the distribution amount decays at the end of each
6823    /// period. Expressed in basis points.
6824    #[prost(uint32, optional, tag = "5")]
6825    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6826    /// Any extra fields that's not defined statically.
6827    #[prost(message, optional, tag = "6")]
6828    pub extra_fields: ::core::option::Option<MoveTable>,
6829}
6830/// Struct representing the onchain storage fund.
6831#[non_exhaustive]
6832#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6833pub struct StorageFund {
6834    /// This is the sum of `storage_rebate` of
6835    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
6836    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
6837    /// of transactions, including both the portion refunded to the transaction senders as well as
6838    /// the non-refundable portion taken out and put into `non_refundable_balance`.
6839    #[prost(uint64, optional, tag = "1")]
6840    pub total_object_storage_rebates: ::core::option::Option<u64>,
6841    /// Represents any remaining inflow of the storage fund that should not
6842    /// be taken out of the fund.
6843    #[prost(uint64, optional, tag = "2")]
6844    pub non_refundable_balance: ::core::option::Option<u64>,
6845}
6846#[non_exhaustive]
6847#[derive(Clone, PartialEq, ::prost::Message)]
6848pub struct ValidatorSet {
6849    /// Total amount of stake from all active validators at the beginning of the epoch.
6850    /// Written only once per epoch, in `advance_epoch` function.
6851    #[prost(uint64, optional, tag = "1")]
6852    pub total_stake: ::core::option::Option<u64>,
6853    /// The current list of active validators.
6854    #[prost(message, repeated, tag = "2")]
6855    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6856    /// List of new validator candidates added during the current epoch.
6857    /// They will be processed at the end of the epoch.
6858    ///
6859    /// key: u64 (index), value: 0x3::validator::Validator
6860    #[prost(message, optional, tag = "3")]
6861    pub pending_active_validators: ::core::option::Option<MoveTable>,
6862    /// Removal requests from the validators. Each element is an index
6863    /// pointing to `active_validators`.
6864    #[prost(uint64, repeated, tag = "4")]
6865    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6866    /// Mappings from staking pool's ID to the sui address of a validator.
6867    ///
6868    /// key: address (staking pool Id), value: address (sui address of the validator)
6869    #[prost(message, optional, tag = "5")]
6870    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6871    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
6872    /// When a validator is deactivated the validator is removed from `active_validators` it
6873    /// is added to this table so that stakers can continue to withdraw their stake from it.
6874    ///
6875    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
6876    #[prost(message, optional, tag = "6")]
6877    pub inactive_validators: ::core::option::Option<MoveTable>,
6878    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
6879    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
6880    /// validator.
6881    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
6882    /// officially add them to the active validator set `active_validators` next epoch.
6883    ///
6884    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
6885    #[prost(message, optional, tag = "7")]
6886    pub validator_candidates: ::core::option::Option<MoveTable>,
6887    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
6888    #[prost(btree_map = "string, uint64", tag = "8")]
6889    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6890        ::prost::alloc::string::String,
6891        u64,
6892    >,
6893    /// Any extra fields that's not defined statically.
6894    #[prost(message, optional, tag = "9")]
6895    pub extra_fields: ::core::option::Option<MoveTable>,
6896}
6897/// Definition of a Validator in the system contracts
6898///
6899/// Note: fields of ValidatorMetadata are flattened into this type
6900#[non_exhaustive]
6901#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6902pub struct Validator {
6903    /// A unique human-readable name of this validator.
6904    #[prost(string, optional, tag = "1")]
6905    pub name: ::core::option::Option<::prost::alloc::string::String>,
6906    /// The Sui Address of the validator. This is the sender that created the Validator object,
6907    /// and also the address to send validator/coins to during withdraws.
6908    #[prost(string, optional, tag = "2")]
6909    pub address: ::core::option::Option<::prost::alloc::string::String>,
6910    #[prost(string, optional, tag = "3")]
6911    pub description: ::core::option::Option<::prost::alloc::string::String>,
6912    #[prost(string, optional, tag = "4")]
6913    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6914    #[prost(string, optional, tag = "5")]
6915    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6916    /// The public key bytes corresponding to the private key that the validator
6917    /// holds to sign transactions. For now, this is the same as AuthorityName.
6918    #[prost(bytes = "bytes", optional, tag = "7")]
6919    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6920    /// This is a proof that the validator has ownership of the protocol private key
6921    #[prost(bytes = "bytes", optional, tag = "8")]
6922    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6923    /// The public key bytes corresponding to the private key that the validator
6924    /// uses to establish TLS connections
6925    #[prost(bytes = "bytes", optional, tag = "10")]
6926    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6927    /// The public key bytes corresponding to the Narwhal Worker
6928    #[prost(bytes = "bytes", optional, tag = "12")]
6929    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6930    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
6931    #[prost(string, optional, tag = "13")]
6932    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6933    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
6934    #[prost(string, optional, tag = "14")]
6935    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6936    /// The address of the narwhal primary
6937    #[prost(string, optional, tag = "15")]
6938    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6939    /// The address of the narwhal worker
6940    #[prost(string, optional, tag = "16")]
6941    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6942    #[prost(bytes = "bytes", optional, tag = "18")]
6943    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6944    #[prost(bytes = "bytes", optional, tag = "19")]
6945    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6946    #[prost(bytes = "bytes", optional, tag = "21")]
6947    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6948    #[prost(bytes = "bytes", optional, tag = "23")]
6949    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6950    #[prost(string, optional, tag = "24")]
6951    pub next_epoch_network_address: ::core::option::Option<
6952        ::prost::alloc::string::String,
6953    >,
6954    #[prost(string, optional, tag = "25")]
6955    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6956    #[prost(string, optional, tag = "26")]
6957    pub next_epoch_primary_address: ::core::option::Option<
6958        ::prost::alloc::string::String,
6959    >,
6960    #[prost(string, optional, tag = "27")]
6961    pub next_epoch_worker_address: ::core::option::Option<
6962        ::prost::alloc::string::String,
6963    >,
6964    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
6965    #[prost(message, optional, tag = "28")]
6966    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6967    /// The voting power of this validator, which might be different from its
6968    /// stake amount.
6969    #[prost(uint64, optional, tag = "29")]
6970    pub voting_power: ::core::option::Option<u64>,
6971    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
6972    #[prost(string, optional, tag = "30")]
6973    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6974    /// Gas price quote, updated only at end of epoch.
6975    #[prost(uint64, optional, tag = "31")]
6976    pub gas_price: ::core::option::Option<u64>,
6977    /// Staking pool for this validator.
6978    #[prost(message, optional, tag = "32")]
6979    pub staking_pool: ::core::option::Option<StakingPool>,
6980    /// Commission rate of the validator, in basis point.
6981    #[prost(uint64, optional, tag = "33")]
6982    pub commission_rate: ::core::option::Option<u64>,
6983    /// Total amount of stake that would be active in the next epoch.
6984    #[prost(uint64, optional, tag = "34")]
6985    pub next_epoch_stake: ::core::option::Option<u64>,
6986    /// This validator's gas price quote for the next epoch.
6987    #[prost(uint64, optional, tag = "35")]
6988    pub next_epoch_gas_price: ::core::option::Option<u64>,
6989    /// The commission rate of the validator starting the next epoch, in basis point.
6990    #[prost(uint64, optional, tag = "36")]
6991    pub next_epoch_commission_rate: ::core::option::Option<u64>,
6992    /// Any extra fields that's not defined statically.
6993    #[prost(message, optional, tag = "37")]
6994    pub extra_fields: ::core::option::Option<MoveTable>,
6995}
6996/// A staking pool embedded in each validator struct in the system state object.
6997#[non_exhaustive]
6998#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6999pub struct StakingPool {
7000    /// UID of the StakingPool object
7001    #[prost(string, optional, tag = "1")]
7002    pub id: ::core::option::Option<::prost::alloc::string::String>,
7003    /// The epoch at which this pool became active.
7004    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
7005    #[prost(uint64, optional, tag = "2")]
7006    pub activation_epoch: ::core::option::Option<u64>,
7007    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
7008    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
7009    #[prost(uint64, optional, tag = "3")]
7010    pub deactivation_epoch: ::core::option::Option<u64>,
7011    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
7012    /// in the `StakedSui` object, updated at epoch boundaries.
7013    #[prost(uint64, optional, tag = "4")]
7014    pub sui_balance: ::core::option::Option<u64>,
7015    /// The epoch stake rewards will be added here at the end of each epoch.
7016    #[prost(uint64, optional, tag = "5")]
7017    pub rewards_pool: ::core::option::Option<u64>,
7018    /// Total number of pool tokens issued by the pool.
7019    #[prost(uint64, optional, tag = "6")]
7020    pub pool_token_balance: ::core::option::Option<u64>,
7021    /// Exchange rate history of previous epochs.
7022    ///
7023    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
7024    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
7025    ///
7026    /// key: u64 (epoch number), value: PoolTokenExchangeRate
7027    #[prost(message, optional, tag = "7")]
7028    pub exchange_rates: ::core::option::Option<MoveTable>,
7029    /// Pending stake amount for this epoch, emptied at epoch boundaries.
7030    #[prost(uint64, optional, tag = "8")]
7031    pub pending_stake: ::core::option::Option<u64>,
7032    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
7033    /// This includes both the principal and rewards SUI withdrawn.
7034    #[prost(uint64, optional, tag = "9")]
7035    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
7036    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
7037    #[prost(uint64, optional, tag = "10")]
7038    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
7039    /// Any extra fields that's not defined statically.
7040    #[prost(message, optional, tag = "11")]
7041    pub extra_fields: ::core::option::Option<MoveTable>,
7042}
7043/// A transaction.
7044#[non_exhaustive]
7045#[derive(Clone, PartialEq, ::prost::Message)]
7046pub struct Transaction {
7047    /// This Transaction serialized as BCS.
7048    #[prost(message, optional, tag = "1")]
7049    pub bcs: ::core::option::Option<Bcs>,
7050    /// The digest of this Transaction.
7051    #[prost(string, optional, tag = "2")]
7052    pub digest: ::core::option::Option<::prost::alloc::string::String>,
7053    /// Version of this Transaction.
7054    #[prost(int32, optional, tag = "3")]
7055    pub version: ::core::option::Option<i32>,
7056    #[prost(message, optional, tag = "4")]
7057    pub kind: ::core::option::Option<TransactionKind>,
7058    #[prost(string, optional, tag = "5")]
7059    pub sender: ::core::option::Option<::prost::alloc::string::String>,
7060    #[prost(message, optional, tag = "6")]
7061    pub gas_payment: ::core::option::Option<GasPayment>,
7062    #[prost(message, optional, tag = "7")]
7063    pub expiration: ::core::option::Option<TransactionExpiration>,
7064}
7065/// Payment information for executing a transaction.
7066#[non_exhaustive]
7067#[derive(Clone, PartialEq, ::prost::Message)]
7068pub struct GasPayment {
7069    /// Set of gas objects to use for payment.
7070    #[prost(message, repeated, tag = "1")]
7071    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
7072    /// Owner of the gas objects, either the transaction sender or a sponsor.
7073    #[prost(string, optional, tag = "2")]
7074    pub owner: ::core::option::Option<::prost::alloc::string::String>,
7075    /// Gas unit price to use when charging for computation.
7076    ///
7077    /// Must be greater than or equal to the network's current RGP (reference gas price).
7078    #[prost(uint64, optional, tag = "3")]
7079    pub price: ::core::option::Option<u64>,
7080    /// Total budget willing to spend for the execution of a transaction.
7081    #[prost(uint64, optional, tag = "4")]
7082    pub budget: ::core::option::Option<u64>,
7083}
7084/// A TTL for a transaction.
7085#[non_exhaustive]
7086#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7087pub struct TransactionExpiration {
7088    #[prost(
7089        enumeration = "transaction_expiration::TransactionExpirationKind",
7090        optional,
7091        tag = "1"
7092    )]
7093    pub kind: ::core::option::Option<i32>,
7094    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
7095    /// must be greater than or equal to the current epoch for a transaction to execute.
7096    #[prost(uint64, optional, tag = "2")]
7097    pub epoch: ::core::option::Option<u64>,
7098    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
7099    /// must be less than or equal to the current epoch for a transaction to execute.
7100    #[prost(uint64, optional, tag = "3")]
7101    pub min_epoch: ::core::option::Option<u64>,
7102    /// Minimal UNIX timestamp in which a transaction can be executed. The
7103    /// provided minimal timestamp must be less than or equal to the current
7104    /// clock.
7105    #[prost(message, optional, tag = "4")]
7106    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7107    /// Maximum UNIX timestamp in which a transaction can be executed. The
7108    /// provided maximal timestamp must be greater than or equal to the current
7109    /// clock.
7110    #[prost(message, optional, tag = "5")]
7111    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7112    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
7113    #[prost(string, optional, tag = "6")]
7114    pub chain: ::core::option::Option<::prost::alloc::string::String>,
7115    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
7116    #[prost(uint32, optional, tag = "7")]
7117    pub nonce: ::core::option::Option<u32>,
7118}
7119/// Nested message and enum types in `TransactionExpiration`.
7120pub mod transaction_expiration {
7121    #[non_exhaustive]
7122    #[derive(
7123        Clone,
7124        Copy,
7125        Debug,
7126        PartialEq,
7127        Eq,
7128        Hash,
7129        PartialOrd,
7130        Ord,
7131        ::prost::Enumeration
7132    )]
7133    #[repr(i32)]
7134    pub enum TransactionExpirationKind {
7135        Unknown = 0,
7136        /// The transaction has no expiration.
7137        None = 1,
7138        /// Validators won't sign and execute transaction unless the expiration epoch
7139        /// is greater than or equal to the current epoch.
7140        Epoch = 2,
7141        /// This variant enables gas payments from address balances.
7142        ///
7143        /// When transactions use address balances for gas payment instead of explicit gas coins,
7144        /// we lose the natural transaction uniqueness and replay prevention that comes from
7145        /// mutation of gas coin objects.
7146        ///
7147        /// By bounding expiration and providing a nonce, validators must only retain
7148        /// executed digests for the maximum possible expiry range to differentiate
7149        /// retries from unique transactions with otherwise identical inputs.
7150        ValidDuring = 3,
7151    }
7152    impl TransactionExpirationKind {
7153        /// String value of the enum field names used in the ProtoBuf definition.
7154        ///
7155        /// The values are not transformed in any way and thus are considered stable
7156        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7157        pub fn as_str_name(&self) -> &'static str {
7158            match self {
7159                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7160                Self::None => "NONE",
7161                Self::Epoch => "EPOCH",
7162                Self::ValidDuring => "VALID_DURING",
7163            }
7164        }
7165        /// Creates an enum from field names used in the ProtoBuf definition.
7166        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7167            match value {
7168                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7169                "NONE" => Some(Self::None),
7170                "EPOCH" => Some(Self::Epoch),
7171                "VALID_DURING" => Some(Self::ValidDuring),
7172                _ => None,
7173            }
7174        }
7175    }
7176}
7177/// Transaction type.
7178#[non_exhaustive]
7179#[derive(Clone, PartialEq, ::prost::Message)]
7180pub struct TransactionKind {
7181    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7182    pub kind: ::core::option::Option<i32>,
7183    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7184    pub data: ::core::option::Option<transaction_kind::Data>,
7185}
7186/// Nested message and enum types in `TransactionKind`.
7187pub mod transaction_kind {
7188    #[non_exhaustive]
7189    #[derive(
7190        Clone,
7191        Copy,
7192        Debug,
7193        PartialEq,
7194        Eq,
7195        Hash,
7196        PartialOrd,
7197        Ord,
7198        ::prost::Enumeration
7199    )]
7200    #[repr(i32)]
7201    pub enum Kind {
7202        Unknown = 0,
7203        /// A user transaction comprised of a list of native commands and Move calls.
7204        ProgrammableTransaction = 1,
7205        /// System transaction used to end an epoch.
7206        ///
7207        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7208        /// `EndOfEpochTransaction`).
7209        ChangeEpoch = 2,
7210        /// Transaction used to initialize the chain state.
7211        ///
7212        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7213        /// executed on the chain.
7214        Genesis = 3,
7215        /// V1 consensus commit update.
7216        ConsensusCommitPrologueV1 = 4,
7217        /// Update set of valid JWKs used for zklogin.
7218        AuthenticatorStateUpdate = 5,
7219        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7220        /// the next one.
7221        EndOfEpoch = 6,
7222        /// Randomness update.
7223        RandomnessStateUpdate = 7,
7224        /// V2 consensus commit update.
7225        ConsensusCommitPrologueV2 = 8,
7226        /// V3 consensus commit update.
7227        ConsensusCommitPrologueV3 = 9,
7228        /// V4 consensus commit update.
7229        ConsensusCommitPrologueV4 = 10,
7230        /// A system transaction comprised of a list of native commands and Move calls.
7231        ProgrammableSystemTransaction = 11,
7232    }
7233    impl Kind {
7234        /// String value of the enum field names used in the ProtoBuf definition.
7235        ///
7236        /// The values are not transformed in any way and thus are considered stable
7237        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7238        pub fn as_str_name(&self) -> &'static str {
7239            match self {
7240                Self::Unknown => "KIND_UNKNOWN",
7241                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7242                Self::ChangeEpoch => "CHANGE_EPOCH",
7243                Self::Genesis => "GENESIS",
7244                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7245                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7246                Self::EndOfEpoch => "END_OF_EPOCH",
7247                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7248                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7249                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7250                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7251                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
7252            }
7253        }
7254        /// Creates an enum from field names used in the ProtoBuf definition.
7255        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7256            match value {
7257                "KIND_UNKNOWN" => Some(Self::Unknown),
7258                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7259                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7260                "GENESIS" => Some(Self::Genesis),
7261                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7262                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7263                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7264                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7265                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7266                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7267                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7268                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
7269                    Some(Self::ProgrammableSystemTransaction)
7270                }
7271                _ => None,
7272            }
7273        }
7274    }
7275    #[non_exhaustive]
7276    #[derive(Clone, PartialEq, ::prost::Oneof)]
7277    pub enum Data {
7278        /// A transaction comprised of a list of native commands and Move calls.
7279        #[prost(message, tag = "2")]
7280        ProgrammableTransaction(super::ProgrammableTransaction),
7281        /// System transaction used to end an epoch.
7282        ///
7283        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7284        /// `EndOfEpochTransaction`).
7285        #[prost(message, tag = "3")]
7286        ChangeEpoch(super::ChangeEpoch),
7287        /// Transaction used to initialize the chain state.
7288        ///
7289        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7290        /// executed on the chain.
7291        #[prost(message, tag = "4")]
7292        Genesis(super::GenesisTransaction),
7293        /// consensus commit update info
7294        #[prost(message, tag = "5")]
7295        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7296        /// Update set of valid JWKs used for zklogin.
7297        #[prost(message, tag = "6")]
7298        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7299        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7300        /// the next one.
7301        #[prost(message, tag = "7")]
7302        EndOfEpoch(super::EndOfEpochTransaction),
7303        /// Randomness update.
7304        #[prost(message, tag = "8")]
7305        RandomnessStateUpdate(super::RandomnessStateUpdate),
7306    }
7307}
7308/// A user transaction.
7309///
7310/// Contains a series of native commands and Move calls where the results of one command can be
7311/// used in future commands.
7312#[non_exhaustive]
7313#[derive(Clone, PartialEq, ::prost::Message)]
7314pub struct ProgrammableTransaction {
7315    /// Input objects or primitive values.
7316    #[prost(message, repeated, tag = "1")]
7317    pub inputs: ::prost::alloc::vec::Vec<Input>,
7318    /// The commands to be executed sequentially. A failure in any command
7319    /// results in the failure of the entire transaction.
7320    #[prost(message, repeated, tag = "2")]
7321    pub commands: ::prost::alloc::vec::Vec<Command>,
7322}
7323/// A single command in a programmable transaction.
7324#[non_exhaustive]
7325#[derive(Clone, PartialEq, ::prost::Message)]
7326pub struct Command {
7327    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7328    pub command: ::core::option::Option<command::Command>,
7329}
7330/// Nested message and enum types in `Command`.
7331pub mod command {
7332    #[non_exhaustive]
7333    #[derive(Clone, PartialEq, ::prost::Oneof)]
7334    pub enum Command {
7335        /// A call to either an entry or a public Move function.
7336        #[prost(message, tag = "1")]
7337        MoveCall(super::MoveCall),
7338        /// `(Vec<forall T:key+store. T>, address)`
7339        /// It sends n-objects to the specified address. These objects must have store
7340        /// (public transfer) and either the previous owner must be an address or the object must
7341        /// be newly created.
7342        #[prost(message, tag = "2")]
7343        TransferObjects(super::TransferObjects),
7344        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
7345        /// It splits off some amounts into new coins with those amounts.
7346        #[prost(message, tag = "3")]
7347        SplitCoins(super::SplitCoins),
7348        /// `(&mut Coin<T>, Vec<Coin<T>>)`
7349        /// It merges n-coins into the first coin.
7350        #[prost(message, tag = "4")]
7351        MergeCoins(super::MergeCoins),
7352        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
7353        /// dependencies to link against on chain.
7354        #[prost(message, tag = "5")]
7355        Publish(super::Publish),
7356        /// `forall T: Vec<T> -> vector<T>`
7357        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
7358        /// the type tag must be specified.
7359        #[prost(message, tag = "6")]
7360        MakeMoveVector(super::MakeMoveVector),
7361        /// Upgrades a Move package.
7362        /// Takes (in order):
7363        ///
7364        /// 1. A vector of serialized modules for the package.
7365        /// 1. A vector of object ids for the transitive dependencies of the new package.
7366        /// 1. The object ID of the package being upgraded.
7367        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
7368        ///    programmable transaction.
7369        #[prost(message, tag = "7")]
7370        Upgrade(super::Upgrade),
7371    }
7372}
7373/// Command to call a Move function.
7374///
7375/// Functions that can be called by a `MoveCall` command are those that have a function signature
7376/// that is either `entry` or `public` (which don't have a reference return type).
7377#[non_exhaustive]
7378#[derive(Clone, PartialEq, ::prost::Message)]
7379pub struct MoveCall {
7380    /// The package containing the module and function.
7381    #[prost(string, optional, tag = "1")]
7382    pub package: ::core::option::Option<::prost::alloc::string::String>,
7383    /// The specific module in the package containing the function.
7384    #[prost(string, optional, tag = "2")]
7385    pub module: ::core::option::Option<::prost::alloc::string::String>,
7386    /// The function to be called.
7387    #[prost(string, optional, tag = "3")]
7388    pub function: ::core::option::Option<::prost::alloc::string::String>,
7389    /// The type arguments to the function.
7390    #[prost(string, repeated, tag = "4")]
7391    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7392    /// The arguments to the function.
7393    #[prost(message, repeated, tag = "5")]
7394    pub arguments: ::prost::alloc::vec::Vec<Argument>,
7395}
7396/// Command to transfer ownership of a set of objects to an address.
7397#[non_exhaustive]
7398#[derive(Clone, PartialEq, ::prost::Message)]
7399pub struct TransferObjects {
7400    /// Set of objects to transfer.
7401    #[prost(message, repeated, tag = "1")]
7402    pub objects: ::prost::alloc::vec::Vec<Argument>,
7403    /// The address to transfer ownership to.
7404    #[prost(message, optional, tag = "2")]
7405    pub address: ::core::option::Option<Argument>,
7406}
7407/// Command to split a single coin object into multiple coins.
7408#[non_exhaustive]
7409#[derive(Clone, PartialEq, ::prost::Message)]
7410pub struct SplitCoins {
7411    /// The coin to split.
7412    #[prost(message, optional, tag = "1")]
7413    pub coin: ::core::option::Option<Argument>,
7414    /// The amounts to split off.
7415    #[prost(message, repeated, tag = "2")]
7416    pub amounts: ::prost::alloc::vec::Vec<Argument>,
7417}
7418/// Command to merge multiple coins of the same type into a single coin.
7419#[non_exhaustive]
7420#[derive(Clone, PartialEq, ::prost::Message)]
7421pub struct MergeCoins {
7422    /// Coin to merge coins into.
7423    #[prost(message, optional, tag = "1")]
7424    pub coin: ::core::option::Option<Argument>,
7425    /// Set of coins to merge into `coin`.
7426    ///
7427    /// All listed coins must be of the same type and be the same type as `coin`
7428    #[prost(message, repeated, tag = "2")]
7429    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7430}
7431/// Command to publish a new Move package.
7432#[non_exhaustive]
7433#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7434pub struct Publish {
7435    /// The serialized Move modules.
7436    #[prost(bytes = "bytes", repeated, tag = "1")]
7437    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7438    /// Set of packages that the to-be published package depends on.
7439    #[prost(string, repeated, tag = "2")]
7440    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7441}
7442/// Command to build a Move vector out of a set of individual elements.
7443#[non_exhaustive]
7444#[derive(Clone, PartialEq, ::prost::Message)]
7445pub struct MakeMoveVector {
7446    /// Type of the individual elements.
7447    ///
7448    /// This is required to be set when the type can't be inferred, for example when the set of
7449    /// provided arguments are all pure input values.
7450    #[prost(string, optional, tag = "1")]
7451    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7452    /// The set individual elements to build the vector with.
7453    #[prost(message, repeated, tag = "2")]
7454    pub elements: ::prost::alloc::vec::Vec<Argument>,
7455}
7456/// Command to upgrade an already published package.
7457#[non_exhaustive]
7458#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7459pub struct Upgrade {
7460    /// The serialized Move modules.
7461    #[prost(bytes = "bytes", repeated, tag = "1")]
7462    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7463    /// Set of packages that the to-be published package depends on.
7464    #[prost(string, repeated, tag = "2")]
7465    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7466    /// Package ID of the package to upgrade.
7467    #[prost(string, optional, tag = "3")]
7468    pub package: ::core::option::Option<::prost::alloc::string::String>,
7469    /// Ticket authorizing the upgrade.
7470    #[prost(message, optional, tag = "4")]
7471    pub ticket: ::core::option::Option<Argument>,
7472}
7473/// Randomness update.
7474#[non_exhaustive]
7475#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7476pub struct RandomnessStateUpdate {
7477    /// Epoch of the randomness state update transaction.
7478    #[prost(uint64, optional, tag = "1")]
7479    pub epoch: ::core::option::Option<u64>,
7480    /// Randomness round of the update.
7481    #[prost(uint64, optional, tag = "2")]
7482    pub randomness_round: ::core::option::Option<u64>,
7483    /// Updated random bytes.
7484    #[prost(bytes = "bytes", optional, tag = "3")]
7485    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7486    /// The initial version of the randomness object that it was shared at.
7487    #[prost(uint64, optional, tag = "4")]
7488    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7489}
7490/// System transaction used to change the epoch.
7491#[non_exhaustive]
7492#[derive(Clone, PartialEq, ::prost::Message)]
7493pub struct ChangeEpoch {
7494    /// The next (to become) epoch ID.
7495    #[prost(uint64, optional, tag = "1")]
7496    pub epoch: ::core::option::Option<u64>,
7497    /// The protocol version in effect in the new epoch.
7498    #[prost(uint64, optional, tag = "2")]
7499    pub protocol_version: ::core::option::Option<u64>,
7500    /// The total amount of gas charged for storage during the epoch.
7501    #[prost(uint64, optional, tag = "3")]
7502    pub storage_charge: ::core::option::Option<u64>,
7503    /// The total amount of gas charged for computation during the epoch.
7504    #[prost(uint64, optional, tag = "4")]
7505    pub computation_charge: ::core::option::Option<u64>,
7506    /// The amount of storage rebate refunded to the txn senders.
7507    #[prost(uint64, optional, tag = "5")]
7508    pub storage_rebate: ::core::option::Option<u64>,
7509    /// The non-refundable storage fee.
7510    #[prost(uint64, optional, tag = "6")]
7511    pub non_refundable_storage_fee: ::core::option::Option<u64>,
7512    /// Unix timestamp when epoch started.
7513    #[prost(message, optional, tag = "7")]
7514    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7515    /// System packages (specifically framework and Move stdlib) that are written before the new
7516    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
7517    /// the validator must write out the following modules.  Modules are provided with the version they
7518    /// will be upgraded to, their modules in serialized form (which include their package ID), and
7519    /// a list of their transitive dependencies.
7520    #[prost(message, repeated, tag = "8")]
7521    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7522}
7523/// System package.
7524#[non_exhaustive]
7525#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7526pub struct SystemPackage {
7527    /// Version of the package.
7528    #[prost(uint64, optional, tag = "1")]
7529    pub version: ::core::option::Option<u64>,
7530    /// Move modules.
7531    #[prost(bytes = "bytes", repeated, tag = "2")]
7532    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7533    /// Package dependencies.
7534    #[prost(string, repeated, tag = "3")]
7535    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7536}
7537/// The genesis transaction.
7538#[non_exhaustive]
7539#[derive(Clone, PartialEq, ::prost::Message)]
7540pub struct GenesisTransaction {
7541    /// Set of genesis objects.
7542    #[prost(message, repeated, tag = "1")]
7543    pub objects: ::prost::alloc::vec::Vec<Object>,
7544}
7545/// Consensus commit prologue system transaction.
7546///
7547/// This message can represent V1, V2, and V3 prologue types.
7548#[non_exhaustive]
7549#[derive(Clone, PartialEq, ::prost::Message)]
7550pub struct ConsensusCommitPrologue {
7551    /// Epoch of the commit prologue transaction.
7552    ///
7553    /// Present in V1, V2, V3, V4.
7554    #[prost(uint64, optional, tag = "1")]
7555    pub epoch: ::core::option::Option<u64>,
7556    /// Consensus round of the commit.
7557    ///
7558    /// Present in V1, V2, V3, V4.
7559    #[prost(uint64, optional, tag = "2")]
7560    pub round: ::core::option::Option<u64>,
7561    /// Unix timestamp from consensus.
7562    ///
7563    /// Present in V1, V2, V3, V4.
7564    #[prost(message, optional, tag = "3")]
7565    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7566    /// Digest of consensus output.
7567    ///
7568    /// Present in V2, V3, V4.
7569    #[prost(string, optional, tag = "4")]
7570    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7571    /// The sub DAG index of the consensus commit. This field is populated if there
7572    /// are multiple consensus commits per round.
7573    ///
7574    /// Present in V3, V4.
7575    #[prost(uint64, optional, tag = "5")]
7576    pub sub_dag_index: ::core::option::Option<u64>,
7577    /// Stores consensus handler determined consensus object version assignments.
7578    ///
7579    /// Present in V3, V4.
7580    #[prost(message, optional, tag = "6")]
7581    pub consensus_determined_version_assignments: ::core::option::Option<
7582        ConsensusDeterminedVersionAssignments,
7583    >,
7584    /// Digest of any additional state computed by the consensus handler.
7585    /// Used to detect forking bugs as early as possible.
7586    ///
7587    /// Present in V4.
7588    #[prost(string, optional, tag = "7")]
7589    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7590}
7591/// Object version assignment from consensus.
7592#[non_exhaustive]
7593#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7594pub struct VersionAssignment {
7595    /// `ObjectId` of the object.
7596    #[prost(string, optional, tag = "1")]
7597    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7598    /// start version of the consensus stream for this object
7599    #[prost(uint64, optional, tag = "2")]
7600    pub start_version: ::core::option::Option<u64>,
7601    /// Assigned version.
7602    #[prost(uint64, optional, tag = "3")]
7603    pub version: ::core::option::Option<u64>,
7604}
7605/// A transaction that was canceled.
7606#[non_exhaustive]
7607#[derive(Clone, PartialEq, ::prost::Message)]
7608pub struct CanceledTransaction {
7609    /// Digest of the canceled transaction.
7610    #[prost(string, optional, tag = "1")]
7611    pub digest: ::core::option::Option<::prost::alloc::string::String>,
7612    /// List of object version assignments.
7613    #[prost(message, repeated, tag = "2")]
7614    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7615}
7616/// Version assignments performed by consensus.
7617#[non_exhaustive]
7618#[derive(Clone, PartialEq, ::prost::Message)]
7619pub struct ConsensusDeterminedVersionAssignments {
7620    /// Version of this message
7621    #[prost(int32, optional, tag = "1")]
7622    pub version: ::core::option::Option<i32>,
7623    /// Canceled transaction version assignment.
7624    #[prost(message, repeated, tag = "3")]
7625    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7626}
7627/// Update the set of valid JWKs.
7628#[non_exhaustive]
7629#[derive(Clone, PartialEq, ::prost::Message)]
7630pub struct AuthenticatorStateUpdate {
7631    /// Epoch of the authenticator state update transaction.
7632    #[prost(uint64, optional, tag = "1")]
7633    pub epoch: ::core::option::Option<u64>,
7634    /// Consensus round of the authenticator state update.
7635    #[prost(uint64, optional, tag = "2")]
7636    pub round: ::core::option::Option<u64>,
7637    /// Newly active JWKs.
7638    #[prost(message, repeated, tag = "3")]
7639    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7640    /// The initial version of the authenticator object that it was shared at.
7641    #[prost(uint64, optional, tag = "4")]
7642    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7643}
7644/// A new JWK.
7645#[non_exhaustive]
7646#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7647pub struct ActiveJwk {
7648    /// Identifier used to uniquely identify a JWK.
7649    #[prost(message, optional, tag = "1")]
7650    pub id: ::core::option::Option<JwkId>,
7651    /// The JWK.
7652    #[prost(message, optional, tag = "2")]
7653    pub jwk: ::core::option::Option<Jwk>,
7654    /// Most recent epoch in which the JWK was validated.
7655    #[prost(uint64, optional, tag = "3")]
7656    pub epoch: ::core::option::Option<u64>,
7657}
7658/// Set of operations run at the end of the epoch to close out the current epoch
7659/// and start the next one.
7660#[non_exhaustive]
7661#[derive(Clone, PartialEq, ::prost::Message)]
7662pub struct EndOfEpochTransaction {
7663    #[prost(message, repeated, tag = "1")]
7664    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7665}
7666/// Operation run at the end of an epoch.
7667#[non_exhaustive]
7668#[derive(Clone, PartialEq, ::prost::Message)]
7669pub struct EndOfEpochTransactionKind {
7670    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7671    pub kind: ::core::option::Option<i32>,
7672    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
7673    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7674}
7675/// Nested message and enum types in `EndOfEpochTransactionKind`.
7676pub mod end_of_epoch_transaction_kind {
7677    #[non_exhaustive]
7678    #[derive(
7679        Clone,
7680        Copy,
7681        Debug,
7682        PartialEq,
7683        Eq,
7684        Hash,
7685        PartialOrd,
7686        Ord,
7687        ::prost::Enumeration
7688    )]
7689    #[repr(i32)]
7690    pub enum Kind {
7691        Unknown = 0,
7692        /// End the epoch and start the next one.
7693        ChangeEpoch = 1,
7694        /// Create and initialize the authenticator object used for zklogin.
7695        AuthenticatorStateCreate = 2,
7696        /// Expire JWKs used for zklogin.
7697        AuthenticatorStateExpire = 3,
7698        /// Create and initialize the randomness object.
7699        RandomnessStateCreate = 4,
7700        /// Create and initialize the deny list object.
7701        DenyListStateCreate = 5,
7702        /// Create and initialize the bridge object.
7703        BridgeStateCreate = 6,
7704        /// Initialize the bridge committee.
7705        BridgeCommitteeInit = 7,
7706        /// Execution time observations from the committee to preserve cross epoch
7707        StoreExecutionTimeObservations = 8,
7708        /// Create the accumulator root object.
7709        AccumulatorRootCreate = 9,
7710        /// Create and initialize the Coin Registry object.
7711        CoinRegistryCreate = 10,
7712        /// Create and initialize the Display Registry object.
7713        DisplayRegistryCreate = 11,
7714        /// Create and initialize the Address Alias State object.
7715        AddressAliasStateCreate = 12,
7716        /// Write the end-of-epoch-computed storage cost for accumulator objects.
7717        WriteAccumulatorStorageCost = 13,
7718    }
7719    impl Kind {
7720        /// String value of the enum field names used in the ProtoBuf definition.
7721        ///
7722        /// The values are not transformed in any way and thus are considered stable
7723        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7724        pub fn as_str_name(&self) -> &'static str {
7725            match self {
7726                Self::Unknown => "KIND_UNKNOWN",
7727                Self::ChangeEpoch => "CHANGE_EPOCH",
7728                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7729                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7730                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7731                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7732                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7733                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7734                Self::StoreExecutionTimeObservations => {
7735                    "STORE_EXECUTION_TIME_OBSERVATIONS"
7736                }
7737                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7738                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7739                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7740                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7741                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
7742            }
7743        }
7744        /// Creates an enum from field names used in the ProtoBuf definition.
7745        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7746            match value {
7747                "KIND_UNKNOWN" => Some(Self::Unknown),
7748                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7749                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7750                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7751                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7752                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7753                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7754                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7755                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7756                    Some(Self::StoreExecutionTimeObservations)
7757                }
7758                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7759                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7760                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7761                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7762                "WRITE_ACCUMULATOR_STORAGE_COST" => {
7763                    Some(Self::WriteAccumulatorStorageCost)
7764                }
7765                _ => None,
7766            }
7767        }
7768    }
7769    #[non_exhaustive]
7770    #[derive(Clone, PartialEq, ::prost::Oneof)]
7771    pub enum Data {
7772        /// End the epoch and start the next one.
7773        #[prost(message, tag = "2")]
7774        ChangeEpoch(super::ChangeEpoch),
7775        /// Expire JWKs used for zklogin.
7776        #[prost(message, tag = "3")]
7777        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7778        /// Execution time observations from the committee to preserve cross epoch
7779        #[prost(message, tag = "4")]
7780        ExecutionTimeObservations(super::ExecutionTimeObservations),
7781        /// ChainId used when initializing the bridge
7782        #[prost(string, tag = "5")]
7783        BridgeChainId(::prost::alloc::string::String),
7784        /// Start version of the Bridge object
7785        #[prost(uint64, tag = "6")]
7786        BridgeObjectVersion(u64),
7787        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
7788        #[prost(uint64, tag = "7")]
7789        StorageCost(u64),
7790    }
7791}
7792/// Expire old JWKs.
7793#[non_exhaustive]
7794#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7795pub struct AuthenticatorStateExpire {
7796    /// Expire JWKs that have a lower epoch than this.
7797    #[prost(uint64, optional, tag = "1")]
7798    pub min_epoch: ::core::option::Option<u64>,
7799    /// The initial version of the authenticator object that it was shared at.
7800    #[prost(uint64, optional, tag = "2")]
7801    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7802}
7803#[non_exhaustive]
7804#[derive(Clone, PartialEq, ::prost::Message)]
7805pub struct ExecutionTimeObservations {
7806    /// Version of this ExecutionTimeObservations
7807    #[prost(int32, optional, tag = "1")]
7808    pub version: ::core::option::Option<i32>,
7809    #[prost(message, repeated, tag = "2")]
7810    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7811}
7812#[non_exhaustive]
7813#[derive(Clone, PartialEq, ::prost::Message)]
7814pub struct ExecutionTimeObservation {
7815    #[prost(
7816        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7817        optional,
7818        tag = "1"
7819    )]
7820    pub kind: ::core::option::Option<i32>,
7821    #[prost(message, optional, tag = "2")]
7822    pub move_entry_point: ::core::option::Option<MoveCall>,
7823    #[prost(message, repeated, tag = "3")]
7824    pub validator_observations: ::prost::alloc::vec::Vec<
7825        ValidatorExecutionTimeObservation,
7826    >,
7827}
7828/// Nested message and enum types in `ExecutionTimeObservation`.
7829pub mod execution_time_observation {
7830    #[non_exhaustive]
7831    #[derive(
7832        Clone,
7833        Copy,
7834        Debug,
7835        PartialEq,
7836        Eq,
7837        Hash,
7838        PartialOrd,
7839        Ord,
7840        ::prost::Enumeration
7841    )]
7842    #[repr(i32)]
7843    pub enum ExecutionTimeObservationKind {
7844        Unknown = 0,
7845        MoveEntryPoint = 1,
7846        TransferObjects = 2,
7847        SplitCoins = 3,
7848        MergeCoins = 4,
7849        Publish = 5,
7850        MakeMoveVector = 6,
7851        Upgrade = 7,
7852    }
7853    impl ExecutionTimeObservationKind {
7854        /// String value of the enum field names used in the ProtoBuf definition.
7855        ///
7856        /// The values are not transformed in any way and thus are considered stable
7857        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7858        pub fn as_str_name(&self) -> &'static str {
7859            match self {
7860                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7861                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7862                Self::TransferObjects => "TRANSFER_OBJECTS",
7863                Self::SplitCoins => "SPLIT_COINS",
7864                Self::MergeCoins => "MERGE_COINS",
7865                Self::Publish => "PUBLISH",
7866                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7867                Self::Upgrade => "UPGRADE",
7868            }
7869        }
7870        /// Creates an enum from field names used in the ProtoBuf definition.
7871        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7872            match value {
7873                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7874                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7875                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7876                "SPLIT_COINS" => Some(Self::SplitCoins),
7877                "MERGE_COINS" => Some(Self::MergeCoins),
7878                "PUBLISH" => Some(Self::Publish),
7879                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7880                "UPGRADE" => Some(Self::Upgrade),
7881                _ => None,
7882            }
7883        }
7884    }
7885}
7886#[non_exhaustive]
7887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7888pub struct ValidatorExecutionTimeObservation {
7889    /// Bls12381 public key of the validator
7890    #[prost(bytes = "bytes", optional, tag = "1")]
7891    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7892    /// Duration of an execution observation
7893    #[prost(message, optional, tag = "2")]
7894    pub duration: ::core::option::Option<::prost_types::Duration>,
7895}
7896#[non_exhaustive]
7897#[derive(Clone, PartialEq, ::prost::Message)]
7898pub struct ExecuteTransactionRequest {
7899    /// The transaction to execute.
7900    #[prost(message, optional, tag = "1")]
7901    pub transaction: ::core::option::Option<Transaction>,
7902    /// Set of `UserSignature`s authorizing the execution of the provided
7903    /// transaction.
7904    #[prost(message, repeated, tag = "2")]
7905    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7906    /// Mask specifying which fields to read.
7907    /// If no mask is specified, defaults to `effects.status,checkpoint`.
7908    #[prost(message, optional, tag = "3")]
7909    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7910}
7911/// Response message for `NodeService.ExecuteTransaction`.
7912#[non_exhaustive]
7913#[derive(Clone, PartialEq, ::prost::Message)]
7914pub struct ExecuteTransactionResponse {
7915    #[prost(message, optional, tag = "1")]
7916    pub transaction: ::core::option::Option<ExecutedTransaction>,
7917}
7918#[non_exhaustive]
7919#[derive(Clone, PartialEq, ::prost::Message)]
7920pub struct SimulateTransactionRequest {
7921    #[prost(message, optional, tag = "1")]
7922    pub transaction: ::core::option::Option<Transaction>,
7923    /// Mask specifying which fields to read.
7924    #[prost(message, optional, tag = "2")]
7925    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7926    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
7927    #[prost(
7928        enumeration = "simulate_transaction_request::TransactionChecks",
7929        optional,
7930        tag = "3"
7931    )]
7932    pub checks: ::core::option::Option<i32>,
7933    /// Perform gas selection based on a budget estimation and include the
7934    /// selected gas payment and budget in the response.
7935    ///
7936    /// This option will be ignored if `checks` is `DISABLED`.
7937    #[prost(bool, optional, tag = "4")]
7938    pub do_gas_selection: ::core::option::Option<bool>,
7939}
7940/// Nested message and enum types in `SimulateTransactionRequest`.
7941pub mod simulate_transaction_request {
7942    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
7943    #[non_exhaustive]
7944    #[derive(
7945        Clone,
7946        Copy,
7947        Debug,
7948        PartialEq,
7949        Eq,
7950        Hash,
7951        PartialOrd,
7952        Ord,
7953        ::prost::Enumeration
7954    )]
7955    #[repr(i32)]
7956    pub enum TransactionChecks {
7957        Enabled = 0,
7958        Disabled = 1,
7959    }
7960    impl TransactionChecks {
7961        /// String value of the enum field names used in the ProtoBuf definition.
7962        ///
7963        /// The values are not transformed in any way and thus are considered stable
7964        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7965        pub fn as_str_name(&self) -> &'static str {
7966            match self {
7967                Self::Enabled => "ENABLED",
7968                Self::Disabled => "DISABLED",
7969            }
7970        }
7971        /// Creates an enum from field names used in the ProtoBuf definition.
7972        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7973            match value {
7974                "ENABLED" => Some(Self::Enabled),
7975                "DISABLED" => Some(Self::Disabled),
7976                _ => None,
7977            }
7978        }
7979    }
7980}
7981#[non_exhaustive]
7982#[derive(Clone, PartialEq, ::prost::Message)]
7983pub struct SimulateTransactionResponse {
7984    #[prost(message, optional, tag = "1")]
7985    pub transaction: ::core::option::Option<ExecutedTransaction>,
7986    #[prost(message, repeated, tag = "2")]
7987    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7988    /// A suggested gas price to use, that is above RGP, in order to provide a
7989    /// better chance of the transaction being included in the presence of
7990    /// congested objects.
7991    #[prost(uint64, optional, tag = "3")]
7992    pub suggested_gas_price: ::core::option::Option<u64>,
7993}
7994/// An intermediate result/output from the execution of a single command
7995#[non_exhaustive]
7996#[derive(Clone, PartialEq, ::prost::Message)]
7997pub struct CommandResult {
7998    #[prost(message, repeated, tag = "1")]
7999    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
8000    #[prost(message, repeated, tag = "2")]
8001    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
8002}
8003#[non_exhaustive]
8004#[derive(Clone, PartialEq, ::prost::Message)]
8005pub struct CommandOutput {
8006    #[prost(message, optional, tag = "1")]
8007    pub argument: ::core::option::Option<Argument>,
8008    #[prost(message, optional, tag = "2")]
8009    pub value: ::core::option::Option<Bcs>,
8010    /// JSON rendering of the output.
8011    #[prost(message, optional, boxed, tag = "3")]
8012    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
8013}
8014/// Generated client implementations.
8015pub mod transaction_execution_service_client {
8016    #![allow(
8017        unused_variables,
8018        dead_code,
8019        missing_docs,
8020        clippy::wildcard_imports,
8021        clippy::let_unit_value,
8022    )]
8023    use tonic::codegen::*;
8024    use tonic::codegen::http::Uri;
8025    #[derive(Debug, Clone)]
8026    pub struct TransactionExecutionServiceClient<T> {
8027        inner: tonic::client::Grpc<T>,
8028    }
8029    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
8030        /// Attempt to create a new client by connecting to a given endpoint.
8031        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
8032        where
8033            D: TryInto<tonic::transport::Endpoint>,
8034            D::Error: Into<StdError>,
8035        {
8036            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
8037            Ok(Self::new(conn))
8038        }
8039    }
8040    impl<T> TransactionExecutionServiceClient<T>
8041    where
8042        T: tonic::client::GrpcService<tonic::body::Body>,
8043        T::Error: Into<StdError>,
8044        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
8045        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
8046    {
8047        pub fn new(inner: T) -> Self {
8048            let inner = tonic::client::Grpc::new(inner);
8049            Self { inner }
8050        }
8051        pub fn with_origin(inner: T, origin: Uri) -> Self {
8052            let inner = tonic::client::Grpc::with_origin(inner, origin);
8053            Self { inner }
8054        }
8055        pub fn with_interceptor<F>(
8056            inner: T,
8057            interceptor: F,
8058        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
8059        where
8060            F: tonic::service::Interceptor,
8061            T::ResponseBody: Default,
8062            T: tonic::codegen::Service<
8063                http::Request<tonic::body::Body>,
8064                Response = http::Response<
8065                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
8066                >,
8067            >,
8068            <T as tonic::codegen::Service<
8069                http::Request<tonic::body::Body>,
8070            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
8071        {
8072            TransactionExecutionServiceClient::new(
8073                InterceptedService::new(inner, interceptor),
8074            )
8075        }
8076        /// Compress requests with the given encoding.
8077        ///
8078        /// This requires the server to support it otherwise it might respond with an
8079        /// error.
8080        #[must_use]
8081        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8082            self.inner = self.inner.send_compressed(encoding);
8083            self
8084        }
8085        /// Enable decompressing responses.
8086        #[must_use]
8087        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8088            self.inner = self.inner.accept_compressed(encoding);
8089            self
8090        }
8091        /// Limits the maximum size of a decoded message.
8092        ///
8093        /// Default: `4MB`
8094        #[must_use]
8095        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8096            self.inner = self.inner.max_decoding_message_size(limit);
8097            self
8098        }
8099        /// Limits the maximum size of an encoded message.
8100        ///
8101        /// Default: `usize::MAX`
8102        #[must_use]
8103        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8104            self.inner = self.inner.max_encoding_message_size(limit);
8105            self
8106        }
8107        pub async fn execute_transaction(
8108            &mut self,
8109            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
8110        ) -> std::result::Result<
8111            tonic::Response<super::ExecuteTransactionResponse>,
8112            tonic::Status,
8113        > {
8114            self.inner
8115                .ready()
8116                .await
8117                .map_err(|e| {
8118                    tonic::Status::unknown(
8119                        format!("Service was not ready: {}", e.into()),
8120                    )
8121                })?;
8122            let codec = tonic_prost::ProstCodec::default();
8123            let path = http::uri::PathAndQuery::from_static(
8124                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
8125            );
8126            let mut req = request.into_request();
8127            req.extensions_mut()
8128                .insert(
8129                    GrpcMethod::new(
8130                        "sui.rpc.v2.TransactionExecutionService",
8131                        "ExecuteTransaction",
8132                    ),
8133                );
8134            self.inner.unary(req, path, codec).await
8135        }
8136        pub async fn simulate_transaction(
8137            &mut self,
8138            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8139        ) -> std::result::Result<
8140            tonic::Response<super::SimulateTransactionResponse>,
8141            tonic::Status,
8142        > {
8143            self.inner
8144                .ready()
8145                .await
8146                .map_err(|e| {
8147                    tonic::Status::unknown(
8148                        format!("Service was not ready: {}", e.into()),
8149                    )
8150                })?;
8151            let codec = tonic_prost::ProstCodec::default();
8152            let path = http::uri::PathAndQuery::from_static(
8153                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8154            );
8155            let mut req = request.into_request();
8156            req.extensions_mut()
8157                .insert(
8158                    GrpcMethod::new(
8159                        "sui.rpc.v2.TransactionExecutionService",
8160                        "SimulateTransaction",
8161                    ),
8162                );
8163            self.inner.unary(req, path, codec).await
8164        }
8165    }
8166}
8167/// Generated server implementations.
8168pub mod transaction_execution_service_server {
8169    #![allow(
8170        unused_variables,
8171        dead_code,
8172        missing_docs,
8173        clippy::wildcard_imports,
8174        clippy::let_unit_value,
8175    )]
8176    use tonic::codegen::*;
8177    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
8178    #[async_trait]
8179    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8180        async fn execute_transaction(
8181            &self,
8182            request: tonic::Request<super::ExecuteTransactionRequest>,
8183        ) -> std::result::Result<
8184            tonic::Response<super::ExecuteTransactionResponse>,
8185            tonic::Status,
8186        > {
8187            Err(tonic::Status::unimplemented("Not yet implemented"))
8188        }
8189        async fn simulate_transaction(
8190            &self,
8191            request: tonic::Request<super::SimulateTransactionRequest>,
8192        ) -> std::result::Result<
8193            tonic::Response<super::SimulateTransactionResponse>,
8194            tonic::Status,
8195        > {
8196            Err(tonic::Status::unimplemented("Not yet implemented"))
8197        }
8198    }
8199    #[derive(Debug)]
8200    pub struct TransactionExecutionServiceServer<T> {
8201        inner: Arc<T>,
8202        accept_compression_encodings: EnabledCompressionEncodings,
8203        send_compression_encodings: EnabledCompressionEncodings,
8204        max_decoding_message_size: Option<usize>,
8205        max_encoding_message_size: Option<usize>,
8206    }
8207    impl<T> TransactionExecutionServiceServer<T> {
8208        pub fn new(inner: T) -> Self {
8209            Self::from_arc(Arc::new(inner))
8210        }
8211        pub fn from_arc(inner: Arc<T>) -> Self {
8212            Self {
8213                inner,
8214                accept_compression_encodings: Default::default(),
8215                send_compression_encodings: Default::default(),
8216                max_decoding_message_size: None,
8217                max_encoding_message_size: None,
8218            }
8219        }
8220        pub fn with_interceptor<F>(
8221            inner: T,
8222            interceptor: F,
8223        ) -> InterceptedService<Self, F>
8224        where
8225            F: tonic::service::Interceptor,
8226        {
8227            InterceptedService::new(Self::new(inner), interceptor)
8228        }
8229        /// Enable decompressing requests with the given encoding.
8230        #[must_use]
8231        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8232            self.accept_compression_encodings.enable(encoding);
8233            self
8234        }
8235        /// Compress responses with the given encoding, if the client supports it.
8236        #[must_use]
8237        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8238            self.send_compression_encodings.enable(encoding);
8239            self
8240        }
8241        /// Limits the maximum size of a decoded message.
8242        ///
8243        /// Default: `4MB`
8244        #[must_use]
8245        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8246            self.max_decoding_message_size = Some(limit);
8247            self
8248        }
8249        /// Limits the maximum size of an encoded message.
8250        ///
8251        /// Default: `usize::MAX`
8252        #[must_use]
8253        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8254            self.max_encoding_message_size = Some(limit);
8255            self
8256        }
8257    }
8258    impl<T, B> tonic::codegen::Service<http::Request<B>>
8259    for TransactionExecutionServiceServer<T>
8260    where
8261        T: TransactionExecutionService,
8262        B: Body + std::marker::Send + 'static,
8263        B::Error: Into<StdError> + std::marker::Send + 'static,
8264    {
8265        type Response = http::Response<tonic::body::Body>;
8266        type Error = std::convert::Infallible;
8267        type Future = BoxFuture<Self::Response, Self::Error>;
8268        fn poll_ready(
8269            &mut self,
8270            _cx: &mut Context<'_>,
8271        ) -> Poll<std::result::Result<(), Self::Error>> {
8272            Poll::Ready(Ok(()))
8273        }
8274        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8275            match req.uri().path() {
8276                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8277                    #[allow(non_camel_case_types)]
8278                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8279                        pub Arc<T>,
8280                    );
8281                    impl<
8282                        T: TransactionExecutionService,
8283                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8284                    for ExecuteTransactionSvc<T> {
8285                        type Response = super::ExecuteTransactionResponse;
8286                        type Future = BoxFuture<
8287                            tonic::Response<Self::Response>,
8288                            tonic::Status,
8289                        >;
8290                        fn call(
8291                            &mut self,
8292                            request: tonic::Request<super::ExecuteTransactionRequest>,
8293                        ) -> Self::Future {
8294                            let inner = Arc::clone(&self.0);
8295                            let fut = async move {
8296                                <T as TransactionExecutionService>::execute_transaction(
8297                                        &inner,
8298                                        request,
8299                                    )
8300                                    .await
8301                            };
8302                            Box::pin(fut)
8303                        }
8304                    }
8305                    let accept_compression_encodings = self.accept_compression_encodings;
8306                    let send_compression_encodings = self.send_compression_encodings;
8307                    let max_decoding_message_size = self.max_decoding_message_size;
8308                    let max_encoding_message_size = self.max_encoding_message_size;
8309                    let inner = self.inner.clone();
8310                    let fut = async move {
8311                        let method = ExecuteTransactionSvc(inner);
8312                        let codec = tonic_prost::ProstCodec::default();
8313                        let mut grpc = tonic::server::Grpc::new(codec)
8314                            .apply_compression_config(
8315                                accept_compression_encodings,
8316                                send_compression_encodings,
8317                            )
8318                            .apply_max_message_size_config(
8319                                max_decoding_message_size,
8320                                max_encoding_message_size,
8321                            );
8322                        let res = grpc.unary(method, req).await;
8323                        Ok(res)
8324                    };
8325                    Box::pin(fut)
8326                }
8327                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8328                    #[allow(non_camel_case_types)]
8329                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
8330                        pub Arc<T>,
8331                    );
8332                    impl<
8333                        T: TransactionExecutionService,
8334                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
8335                    for SimulateTransactionSvc<T> {
8336                        type Response = super::SimulateTransactionResponse;
8337                        type Future = BoxFuture<
8338                            tonic::Response<Self::Response>,
8339                            tonic::Status,
8340                        >;
8341                        fn call(
8342                            &mut self,
8343                            request: tonic::Request<super::SimulateTransactionRequest>,
8344                        ) -> Self::Future {
8345                            let inner = Arc::clone(&self.0);
8346                            let fut = async move {
8347                                <T as TransactionExecutionService>::simulate_transaction(
8348                                        &inner,
8349                                        request,
8350                                    )
8351                                    .await
8352                            };
8353                            Box::pin(fut)
8354                        }
8355                    }
8356                    let accept_compression_encodings = self.accept_compression_encodings;
8357                    let send_compression_encodings = self.send_compression_encodings;
8358                    let max_decoding_message_size = self.max_decoding_message_size;
8359                    let max_encoding_message_size = self.max_encoding_message_size;
8360                    let inner = self.inner.clone();
8361                    let fut = async move {
8362                        let method = SimulateTransactionSvc(inner);
8363                        let codec = tonic_prost::ProstCodec::default();
8364                        let mut grpc = tonic::server::Grpc::new(codec)
8365                            .apply_compression_config(
8366                                accept_compression_encodings,
8367                                send_compression_encodings,
8368                            )
8369                            .apply_max_message_size_config(
8370                                max_decoding_message_size,
8371                                max_encoding_message_size,
8372                            );
8373                        let res = grpc.unary(method, req).await;
8374                        Ok(res)
8375                    };
8376                    Box::pin(fut)
8377                }
8378                _ => {
8379                    Box::pin(async move {
8380                        let mut response = http::Response::new(
8381                            tonic::body::Body::default(),
8382                        );
8383                        let headers = response.headers_mut();
8384                        headers
8385                            .insert(
8386                                tonic::Status::GRPC_STATUS,
8387                                (tonic::Code::Unimplemented as i32).into(),
8388                            );
8389                        headers
8390                            .insert(
8391                                http::header::CONTENT_TYPE,
8392                                tonic::metadata::GRPC_CONTENT_TYPE,
8393                            );
8394                        Ok(response)
8395                    })
8396                }
8397            }
8398        }
8399    }
8400    impl<T> Clone for TransactionExecutionServiceServer<T> {
8401        fn clone(&self) -> Self {
8402            let inner = self.inner.clone();
8403            Self {
8404                inner,
8405                accept_compression_encodings: self.accept_compression_encodings,
8406                send_compression_encodings: self.send_compression_encodings,
8407                max_decoding_message_size: self.max_decoding_message_size,
8408                max_encoding_message_size: self.max_encoding_message_size,
8409            }
8410        }
8411    }
8412    /// Generated gRPC service name
8413    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8414    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8415        const NAME: &'static str = SERVICE_NAME;
8416    }
8417}