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