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}
4316/// Set of Objects
4317#[non_exhaustive]
4318#[derive(Clone, PartialEq, ::prost::Message)]
4319pub struct ObjectSet {
4320    /// Objects are sorted by the key `(object_id, version)`.
4321    #[prost(message, repeated, tag = "1")]
4322    pub objects: ::prost::alloc::vec::Vec<Object>,
4323}
4324/// Reference to an object.
4325#[non_exhaustive]
4326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4327pub struct ObjectReference {
4328    /// The object id of this object.
4329    #[prost(string, optional, tag = "1")]
4330    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
4331    /// The version of this object.
4332    #[prost(uint64, optional, tag = "2")]
4333    pub version: ::core::option::Option<u64>,
4334    /// The digest of this object.
4335    #[prost(string, optional, tag = "3")]
4336    pub digest: ::core::option::Option<::prost::alloc::string::String>,
4337}
4338/// Enum of different types of ownership for an object.
4339#[non_exhaustive]
4340#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4341pub struct Owner {
4342    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
4343    pub kind: ::core::option::Option<i32>,
4344    /// Address or ObjectId of the owner
4345    #[prost(string, optional, tag = "2")]
4346    pub address: ::core::option::Option<::prost::alloc::string::String>,
4347    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
4348    #[prost(uint64, optional, tag = "3")]
4349    pub version: ::core::option::Option<u64>,
4350}
4351/// Nested message and enum types in `Owner`.
4352pub mod owner {
4353    #[non_exhaustive]
4354    #[derive(
4355        Clone,
4356        Copy,
4357        Debug,
4358        PartialEq,
4359        Eq,
4360        Hash,
4361        PartialOrd,
4362        Ord,
4363        ::prost::Enumeration
4364    )]
4365    #[repr(i32)]
4366    pub enum OwnerKind {
4367        Unknown = 0,
4368        Address = 1,
4369        Object = 2,
4370        Shared = 3,
4371        Immutable = 4,
4372        ConsensusAddress = 5,
4373    }
4374    impl OwnerKind {
4375        /// String value of the enum field names used in the ProtoBuf definition.
4376        ///
4377        /// The values are not transformed in any way and thus are considered stable
4378        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4379        pub fn as_str_name(&self) -> &'static str {
4380            match self {
4381                Self::Unknown => "OWNER_KIND_UNKNOWN",
4382                Self::Address => "ADDRESS",
4383                Self::Object => "OBJECT",
4384                Self::Shared => "SHARED",
4385                Self::Immutable => "IMMUTABLE",
4386                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
4387            }
4388        }
4389        /// Creates an enum from field names used in the ProtoBuf definition.
4390        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4391            match value {
4392                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
4393                "ADDRESS" => Some(Self::Address),
4394                "OBJECT" => Some(Self::Object),
4395                "SHARED" => Some(Self::Shared),
4396                "IMMUTABLE" => Some(Self::Immutable),
4397                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
4398                _ => None,
4399            }
4400        }
4401    }
4402}
4403#[non_exhaustive]
4404#[derive(Clone, PartialEq, ::prost::Message)]
4405pub struct ProtocolConfig {
4406    #[prost(uint64, optional, tag = "1")]
4407    pub protocol_version: ::core::option::Option<u64>,
4408    #[prost(btree_map = "string, bool", tag = "2")]
4409    pub feature_flags: ::prost::alloc::collections::BTreeMap<
4410        ::prost::alloc::string::String,
4411        bool,
4412    >,
4413    #[prost(btree_map = "string, string", tag = "3")]
4414    pub attributes: ::prost::alloc::collections::BTreeMap<
4415        ::prost::alloc::string::String,
4416        ::prost::alloc::string::String,
4417    >,
4418}
4419/// A signature from a user.
4420#[non_exhaustive]
4421#[derive(Clone, PartialEq, ::prost::Message)]
4422pub struct UserSignature {
4423    /// This signature serialized as as BCS.
4424    ///
4425    /// When provided as input this will support both the form that is length
4426    /// prefixed as well as not length prefixed.
4427    #[prost(message, optional, tag = "1")]
4428    pub bcs: ::core::option::Option<Bcs>,
4429    /// The signature scheme of this signature.
4430    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
4431    pub scheme: ::core::option::Option<i32>,
4432    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
4433    pub signature: ::core::option::Option<user_signature::Signature>,
4434}
4435/// Nested message and enum types in `UserSignature`.
4436pub mod user_signature {
4437    #[non_exhaustive]
4438    #[derive(Clone, PartialEq, ::prost::Oneof)]
4439    pub enum Signature {
4440        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
4441        #[prost(message, tag = "3")]
4442        Simple(super::SimpleSignature),
4443        /// The multisig aggregated signature if scheme is `MULTISIG`.
4444        #[prost(message, tag = "4")]
4445        Multisig(super::MultisigAggregatedSignature),
4446        /// The zklogin authenticator if scheme is `ZKLOGIN`.
4447        #[prost(message, tag = "5")]
4448        Zklogin(super::ZkLoginAuthenticator),
4449        /// The passkey authenticator if scheme is `PASSKEY`.
4450        #[prost(message, tag = "6")]
4451        Passkey(super::PasskeyAuthenticator),
4452    }
4453}
4454/// Either an ed25519, secp256k1 or secp256r1 signature
4455#[non_exhaustive]
4456#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4457pub struct SimpleSignature {
4458    /// The signature scheme of this signature.
4459    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4460    pub scheme: ::core::option::Option<i32>,
4461    /// Signature bytes
4462    #[prost(bytes = "bytes", optional, tag = "2")]
4463    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4464    /// Public key bytes
4465    #[prost(bytes = "bytes", optional, tag = "3")]
4466    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4467}
4468/// Public key equivalent for zklogin authenticators.
4469#[non_exhaustive]
4470#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4471pub struct ZkLoginPublicIdentifier {
4472    #[prost(string, optional, tag = "1")]
4473    pub iss: ::core::option::Option<::prost::alloc::string::String>,
4474    /// base10 encoded Bn254FieldElement
4475    #[prost(string, optional, tag = "2")]
4476    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4477}
4478/// Set of valid public keys for multisig committee members.
4479#[non_exhaustive]
4480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4481pub struct MultisigMemberPublicKey {
4482    /// The signature scheme of this public key.
4483    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4484    pub scheme: ::core::option::Option<i32>,
4485    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
4486    #[prost(bytes = "bytes", optional, tag = "2")]
4487    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4488    /// A zklogin public identifier if scheme is zklogin.
4489    #[prost(message, optional, tag = "3")]
4490    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
4491}
4492/// A member in a multisig committee.
4493#[non_exhaustive]
4494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4495pub struct MultisigMember {
4496    /// The public key of the committee member.
4497    #[prost(message, optional, tag = "1")]
4498    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
4499    /// The weight of this member's signature.
4500    #[prost(uint32, optional, tag = "2")]
4501    pub weight: ::core::option::Option<u32>,
4502}
4503/// A multisig committee.
4504#[non_exhaustive]
4505#[derive(Clone, PartialEq, ::prost::Message)]
4506pub struct MultisigCommittee {
4507    /// A list of committee members and their corresponding weight.
4508    #[prost(message, repeated, tag = "1")]
4509    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
4510    /// The threshold of signatures needed to validate a signature from
4511    /// this committee.
4512    #[prost(uint32, optional, tag = "2")]
4513    pub threshold: ::core::option::Option<u32>,
4514}
4515/// Aggregated signature from members of a multisig committee.
4516#[non_exhaustive]
4517#[derive(Clone, PartialEq, ::prost::Message)]
4518pub struct MultisigAggregatedSignature {
4519    /// The plain signatures encoded with signature scheme.
4520    ///
4521    /// The signatures must be in the same order as they are listed in the committee.
4522    #[prost(message, repeated, tag = "1")]
4523    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
4524    /// Bitmap indicating which committee members contributed to the
4525    /// signature.
4526    #[prost(uint32, optional, tag = "2")]
4527    pub bitmap: ::core::option::Option<u32>,
4528    /// If present, means this signature's on-chain format uses the old
4529    /// legacy multisig format.
4530    #[prost(bytes = "bytes", optional, tag = "3")]
4531    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4532    /// The committee to use to validate this signature.
4533    #[prost(message, optional, tag = "4")]
4534    pub committee: ::core::option::Option<MultisigCommittee>,
4535}
4536/// A signature from a member of a multisig committee.
4537#[non_exhaustive]
4538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4539pub struct MultisigMemberSignature {
4540    /// The signature scheme of this signature.
4541    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
4542    pub scheme: ::core::option::Option<i32>,
4543    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
4544    #[prost(bytes = "bytes", optional, tag = "2")]
4545    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4546    /// The zklogin authenticator if scheme is `ZKLOGIN`.
4547    #[prost(message, optional, tag = "3")]
4548    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
4549    /// The passkey authenticator if scheme is `PASSKEY`.
4550    #[prost(message, optional, tag = "4")]
4551    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
4552}
4553/// A zklogin authenticator.
4554#[non_exhaustive]
4555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4556pub struct ZkLoginAuthenticator {
4557    /// Zklogin proof and inputs required to perform proof verification.
4558    #[prost(message, optional, tag = "1")]
4559    pub inputs: ::core::option::Option<ZkLoginInputs>,
4560    /// Maximum epoch for which the proof is valid.
4561    #[prost(uint64, optional, tag = "2")]
4562    pub max_epoch: ::core::option::Option<u64>,
4563    /// User signature with the public key attested to by the provided proof.
4564    #[prost(message, optional, tag = "3")]
4565    pub signature: ::core::option::Option<SimpleSignature>,
4566    /// The public identifier (similar to a public key) for this zklogin authenticator
4567    #[prost(message, optional, tag = "4")]
4568    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
4569    /// The id of the JWK used to authorize this zklogin authenticator
4570    #[prost(message, optional, tag = "5")]
4571    pub jwk_id: ::core::option::Option<JwkId>,
4572}
4573/// A zklogin groth16 proof and the required inputs to perform proof verification.
4574#[non_exhaustive]
4575#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4576pub struct ZkLoginInputs {
4577    #[prost(message, optional, tag = "1")]
4578    pub proof_points: ::core::option::Option<ZkLoginProof>,
4579    #[prost(message, optional, tag = "2")]
4580    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
4581    #[prost(string, optional, tag = "3")]
4582    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
4583    /// base10 encoded Bn254FieldElement
4584    #[prost(string, optional, tag = "4")]
4585    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
4586}
4587/// A zklogin groth16 proof.
4588#[non_exhaustive]
4589#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4590pub struct ZkLoginProof {
4591    #[prost(message, optional, tag = "1")]
4592    pub a: ::core::option::Option<CircomG1>,
4593    #[prost(message, optional, tag = "2")]
4594    pub b: ::core::option::Option<CircomG2>,
4595    #[prost(message, optional, tag = "3")]
4596    pub c: ::core::option::Option<CircomG1>,
4597}
4598/// A claim of the iss in a zklogin proof.
4599#[non_exhaustive]
4600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4601pub struct ZkLoginClaim {
4602    #[prost(string, optional, tag = "1")]
4603    pub value: ::core::option::Option<::prost::alloc::string::String>,
4604    #[prost(uint32, optional, tag = "2")]
4605    pub index_mod_4: ::core::option::Option<u32>,
4606}
4607/// A G1 point.
4608#[non_exhaustive]
4609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4610pub struct CircomG1 {
4611    /// base10 encoded Bn254FieldElement
4612    #[prost(string, optional, tag = "1")]
4613    pub e0: ::core::option::Option<::prost::alloc::string::String>,
4614    /// base10 encoded Bn254FieldElement
4615    #[prost(string, optional, tag = "2")]
4616    pub e1: ::core::option::Option<::prost::alloc::string::String>,
4617    /// base10 encoded Bn254FieldElement
4618    #[prost(string, optional, tag = "3")]
4619    pub e2: ::core::option::Option<::prost::alloc::string::String>,
4620}
4621/// A G2 point.
4622#[non_exhaustive]
4623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4624pub struct CircomG2 {
4625    /// base10 encoded Bn254FieldElement
4626    #[prost(string, optional, tag = "1")]
4627    pub e00: ::core::option::Option<::prost::alloc::string::String>,
4628    /// base10 encoded Bn254FieldElement
4629    #[prost(string, optional, tag = "2")]
4630    pub e01: ::core::option::Option<::prost::alloc::string::String>,
4631    /// base10 encoded Bn254FieldElement
4632    #[prost(string, optional, tag = "3")]
4633    pub e10: ::core::option::Option<::prost::alloc::string::String>,
4634    /// base10 encoded Bn254FieldElement
4635    #[prost(string, optional, tag = "4")]
4636    pub e11: ::core::option::Option<::prost::alloc::string::String>,
4637    /// base10 encoded Bn254FieldElement
4638    #[prost(string, optional, tag = "5")]
4639    pub e20: ::core::option::Option<::prost::alloc::string::String>,
4640    /// base10 encoded Bn254FieldElement
4641    #[prost(string, optional, tag = "6")]
4642    pub e21: ::core::option::Option<::prost::alloc::string::String>,
4643}
4644/// A passkey authenticator.
4645///
4646/// See
4647/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
4648/// for more information on the requirements on the shape of the
4649/// `client_data_json` field.
4650#[non_exhaustive]
4651#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4652pub struct PasskeyAuthenticator {
4653    /// Opaque authenticator data for this passkey signature.
4654    ///
4655    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
4656    /// more information on this field.
4657    #[prost(bytes = "bytes", optional, tag = "1")]
4658    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
4659    /// Structured, unparsed, JSON for this passkey signature.
4660    ///
4661    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
4662    /// for more information on this field.
4663    #[prost(string, optional, tag = "2")]
4664    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
4665    /// A secp256r1 signature.
4666    #[prost(message, optional, tag = "3")]
4667    pub signature: ::core::option::Option<SimpleSignature>,
4668}
4669/// The validator set for a particular epoch.
4670#[non_exhaustive]
4671#[derive(Clone, PartialEq, ::prost::Message)]
4672pub struct ValidatorCommittee {
4673    /// The epoch where this committee governs.
4674    #[prost(uint64, optional, tag = "1")]
4675    pub epoch: ::core::option::Option<u64>,
4676    /// The committee members.
4677    #[prost(message, repeated, tag = "2")]
4678    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
4679}
4680/// A member of a validator committee.
4681#[non_exhaustive]
4682#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4683pub struct ValidatorCommitteeMember {
4684    /// The 96-byte Bls12381 public key for this validator.
4685    #[prost(bytes = "bytes", optional, tag = "1")]
4686    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
4687    /// voting weight this validator possesses.
4688    #[prost(uint64, optional, tag = "2")]
4689    pub weight: ::core::option::Option<u64>,
4690}
4691/// / An aggregated signature from multiple validators.
4692#[non_exhaustive]
4693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4694pub struct ValidatorAggregatedSignature {
4695    /// The epoch when this signature was produced.
4696    ///
4697    /// This can be used to lookup the `ValidatorCommittee` from this epoch
4698    /// to verify this signature.
4699    #[prost(uint64, optional, tag = "1")]
4700    pub epoch: ::core::option::Option<u64>,
4701    /// The 48-byte Bls12381 aggregated signature.
4702    #[prost(bytes = "bytes", optional, tag = "2")]
4703    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
4704    /// Bitmap indicating which members of the committee contributed to
4705    /// this signature.
4706    #[prost(bytes = "bytes", optional, tag = "3")]
4707    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
4708}
4709/// Flag use to disambiguate the signature schemes supported by Sui.
4710///
4711/// Note: the enum values defined by this proto message exactly match their
4712/// expected BCS serialized values when serialized as a u8. See
4713/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
4714/// for more information about signature schemes.
4715#[non_exhaustive]
4716#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
4717#[repr(i32)]
4718pub enum SignatureScheme {
4719    Ed25519 = 0,
4720    Secp256k1 = 1,
4721    Secp256r1 = 2,
4722    Multisig = 3,
4723    Bls12381 = 4,
4724    Zklogin = 5,
4725    Passkey = 6,
4726}
4727impl SignatureScheme {
4728    /// String value of the enum field names used in the ProtoBuf definition.
4729    ///
4730    /// The values are not transformed in any way and thus are considered stable
4731    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4732    pub fn as_str_name(&self) -> &'static str {
4733        match self {
4734            Self::Ed25519 => "ED25519",
4735            Self::Secp256k1 => "SECP256K1",
4736            Self::Secp256r1 => "SECP256R1",
4737            Self::Multisig => "MULTISIG",
4738            Self::Bls12381 => "BLS12381",
4739            Self::Zklogin => "ZKLOGIN",
4740            Self::Passkey => "PASSKEY",
4741        }
4742    }
4743    /// Creates an enum from field names used in the ProtoBuf definition.
4744    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4745        match value {
4746            "ED25519" => Some(Self::Ed25519),
4747            "SECP256K1" => Some(Self::Secp256k1),
4748            "SECP256R1" => Some(Self::Secp256r1),
4749            "MULTISIG" => Some(Self::Multisig),
4750            "BLS12381" => Some(Self::Bls12381),
4751            "ZKLOGIN" => Some(Self::Zklogin),
4752            "PASSKEY" => Some(Self::Passkey),
4753            _ => None,
4754        }
4755    }
4756}
4757#[non_exhaustive]
4758#[derive(Clone, PartialEq, ::prost::Message)]
4759pub struct VerifySignatureRequest {
4760    /// The message to verify against.
4761    ///
4762    /// Today the only supported message types are `PersonalMessage` and
4763    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
4764    /// message is being verified.
4765    #[prost(message, optional, tag = "1")]
4766    pub message: ::core::option::Option<Bcs>,
4767    /// The signature to verify.
4768    #[prost(message, optional, tag = "2")]
4769    pub signature: ::core::option::Option<UserSignature>,
4770    /// Optional. Address to validate against the provided signature.
4771    ///
4772    /// If provided, this address will be compared against the the address derived
4773    /// from the provide signature and a successful response will only be returned
4774    /// if they match.
4775    #[prost(string, optional, tag = "3")]
4776    pub address: ::core::option::Option<::prost::alloc::string::String>,
4777    /// The set of JWKs to use when verifying Zklogin signatures.
4778    /// If this is empty the current set of valid JWKs stored onchain will be used
4779    #[prost(message, repeated, tag = "4")]
4780    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
4781}
4782#[non_exhaustive]
4783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4784pub struct VerifySignatureResponse {
4785    /// Indicates if the provided signature was valid given the requested parameters.
4786    #[prost(bool, optional, tag = "1")]
4787    pub is_valid: ::core::option::Option<bool>,
4788    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
4789    #[prost(string, optional, tag = "2")]
4790    pub reason: ::core::option::Option<::prost::alloc::string::String>,
4791}
4792/// Generated client implementations.
4793pub mod signature_verification_service_client {
4794    #![allow(
4795        unused_variables,
4796        dead_code,
4797        missing_docs,
4798        clippy::wildcard_imports,
4799        clippy::let_unit_value,
4800    )]
4801    use tonic::codegen::*;
4802    use tonic::codegen::http::Uri;
4803    #[derive(Debug, Clone)]
4804    pub struct SignatureVerificationServiceClient<T> {
4805        inner: tonic::client::Grpc<T>,
4806    }
4807    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
4808        /// Attempt to create a new client by connecting to a given endpoint.
4809        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4810        where
4811            D: TryInto<tonic::transport::Endpoint>,
4812            D::Error: Into<StdError>,
4813        {
4814            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4815            Ok(Self::new(conn))
4816        }
4817    }
4818    impl<T> SignatureVerificationServiceClient<T>
4819    where
4820        T: tonic::client::GrpcService<tonic::body::Body>,
4821        T::Error: Into<StdError>,
4822        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4823        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4824    {
4825        pub fn new(inner: T) -> Self {
4826            let inner = tonic::client::Grpc::new(inner);
4827            Self { inner }
4828        }
4829        pub fn with_origin(inner: T, origin: Uri) -> Self {
4830            let inner = tonic::client::Grpc::with_origin(inner, origin);
4831            Self { inner }
4832        }
4833        pub fn with_interceptor<F>(
4834            inner: T,
4835            interceptor: F,
4836        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
4837        where
4838            F: tonic::service::Interceptor,
4839            T::ResponseBody: Default,
4840            T: tonic::codegen::Service<
4841                http::Request<tonic::body::Body>,
4842                Response = http::Response<
4843                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4844                >,
4845            >,
4846            <T as tonic::codegen::Service<
4847                http::Request<tonic::body::Body>,
4848            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4849        {
4850            SignatureVerificationServiceClient::new(
4851                InterceptedService::new(inner, interceptor),
4852            )
4853        }
4854        /// Compress requests with the given encoding.
4855        ///
4856        /// This requires the server to support it otherwise it might respond with an
4857        /// error.
4858        #[must_use]
4859        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4860            self.inner = self.inner.send_compressed(encoding);
4861            self
4862        }
4863        /// Enable decompressing responses.
4864        #[must_use]
4865        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4866            self.inner = self.inner.accept_compressed(encoding);
4867            self
4868        }
4869        /// Limits the maximum size of a decoded message.
4870        ///
4871        /// Default: `4MB`
4872        #[must_use]
4873        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4874            self.inner = self.inner.max_decoding_message_size(limit);
4875            self
4876        }
4877        /// Limits the maximum size of an encoded message.
4878        ///
4879        /// Default: `usize::MAX`
4880        #[must_use]
4881        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4882            self.inner = self.inner.max_encoding_message_size(limit);
4883            self
4884        }
4885        /// Perform signature verification of a UserSignature against the provided message.
4886        pub async fn verify_signature(
4887            &mut self,
4888            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
4889        ) -> std::result::Result<
4890            tonic::Response<super::VerifySignatureResponse>,
4891            tonic::Status,
4892        > {
4893            self.inner
4894                .ready()
4895                .await
4896                .map_err(|e| {
4897                    tonic::Status::unknown(
4898                        format!("Service was not ready: {}", e.into()),
4899                    )
4900                })?;
4901            let codec = tonic_prost::ProstCodec::default();
4902            let path = http::uri::PathAndQuery::from_static(
4903                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
4904            );
4905            let mut req = request.into_request();
4906            req.extensions_mut()
4907                .insert(
4908                    GrpcMethod::new(
4909                        "sui.rpc.v2.SignatureVerificationService",
4910                        "VerifySignature",
4911                    ),
4912                );
4913            self.inner.unary(req, path, codec).await
4914        }
4915    }
4916}
4917/// Generated server implementations.
4918pub mod signature_verification_service_server {
4919    #![allow(
4920        unused_variables,
4921        dead_code,
4922        missing_docs,
4923        clippy::wildcard_imports,
4924        clippy::let_unit_value,
4925    )]
4926    use tonic::codegen::*;
4927    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
4928    #[async_trait]
4929    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
4930        /// Perform signature verification of a UserSignature against the provided message.
4931        async fn verify_signature(
4932            &self,
4933            request: tonic::Request<super::VerifySignatureRequest>,
4934        ) -> std::result::Result<
4935            tonic::Response<super::VerifySignatureResponse>,
4936            tonic::Status,
4937        >;
4938    }
4939    #[derive(Debug)]
4940    pub struct SignatureVerificationServiceServer<T> {
4941        inner: Arc<T>,
4942        accept_compression_encodings: EnabledCompressionEncodings,
4943        send_compression_encodings: EnabledCompressionEncodings,
4944        max_decoding_message_size: Option<usize>,
4945        max_encoding_message_size: Option<usize>,
4946    }
4947    impl<T> SignatureVerificationServiceServer<T> {
4948        pub fn new(inner: T) -> Self {
4949            Self::from_arc(Arc::new(inner))
4950        }
4951        pub fn from_arc(inner: Arc<T>) -> Self {
4952            Self {
4953                inner,
4954                accept_compression_encodings: Default::default(),
4955                send_compression_encodings: Default::default(),
4956                max_decoding_message_size: None,
4957                max_encoding_message_size: None,
4958            }
4959        }
4960        pub fn with_interceptor<F>(
4961            inner: T,
4962            interceptor: F,
4963        ) -> InterceptedService<Self, F>
4964        where
4965            F: tonic::service::Interceptor,
4966        {
4967            InterceptedService::new(Self::new(inner), interceptor)
4968        }
4969        /// Enable decompressing requests with the given encoding.
4970        #[must_use]
4971        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4972            self.accept_compression_encodings.enable(encoding);
4973            self
4974        }
4975        /// Compress responses with the given encoding, if the client supports it.
4976        #[must_use]
4977        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4978            self.send_compression_encodings.enable(encoding);
4979            self
4980        }
4981        /// Limits the maximum size of a decoded message.
4982        ///
4983        /// Default: `4MB`
4984        #[must_use]
4985        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4986            self.max_decoding_message_size = Some(limit);
4987            self
4988        }
4989        /// Limits the maximum size of an encoded message.
4990        ///
4991        /// Default: `usize::MAX`
4992        #[must_use]
4993        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4994            self.max_encoding_message_size = Some(limit);
4995            self
4996        }
4997    }
4998    impl<T, B> tonic::codegen::Service<http::Request<B>>
4999    for SignatureVerificationServiceServer<T>
5000    where
5001        T: SignatureVerificationService,
5002        B: Body + std::marker::Send + 'static,
5003        B::Error: Into<StdError> + std::marker::Send + 'static,
5004    {
5005        type Response = http::Response<tonic::body::Body>;
5006        type Error = std::convert::Infallible;
5007        type Future = BoxFuture<Self::Response, Self::Error>;
5008        fn poll_ready(
5009            &mut self,
5010            _cx: &mut Context<'_>,
5011        ) -> Poll<std::result::Result<(), Self::Error>> {
5012            Poll::Ready(Ok(()))
5013        }
5014        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5015            match req.uri().path() {
5016                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5017                    #[allow(non_camel_case_types)]
5018                    struct VerifySignatureSvc<T: SignatureVerificationService>(
5019                        pub Arc<T>,
5020                    );
5021                    impl<
5022                        T: SignatureVerificationService,
5023                    > tonic::server::UnaryService<super::VerifySignatureRequest>
5024                    for VerifySignatureSvc<T> {
5025                        type Response = super::VerifySignatureResponse;
5026                        type Future = BoxFuture<
5027                            tonic::Response<Self::Response>,
5028                            tonic::Status,
5029                        >;
5030                        fn call(
5031                            &mut self,
5032                            request: tonic::Request<super::VerifySignatureRequest>,
5033                        ) -> Self::Future {
5034                            let inner = Arc::clone(&self.0);
5035                            let fut = async move {
5036                                <T as SignatureVerificationService>::verify_signature(
5037                                        &inner,
5038                                        request,
5039                                    )
5040                                    .await
5041                            };
5042                            Box::pin(fut)
5043                        }
5044                    }
5045                    let accept_compression_encodings = self.accept_compression_encodings;
5046                    let send_compression_encodings = self.send_compression_encodings;
5047                    let max_decoding_message_size = self.max_decoding_message_size;
5048                    let max_encoding_message_size = self.max_encoding_message_size;
5049                    let inner = self.inner.clone();
5050                    let fut = async move {
5051                        let method = VerifySignatureSvc(inner);
5052                        let codec = tonic_prost::ProstCodec::default();
5053                        let mut grpc = tonic::server::Grpc::new(codec)
5054                            .apply_compression_config(
5055                                accept_compression_encodings,
5056                                send_compression_encodings,
5057                            )
5058                            .apply_max_message_size_config(
5059                                max_decoding_message_size,
5060                                max_encoding_message_size,
5061                            );
5062                        let res = grpc.unary(method, req).await;
5063                        Ok(res)
5064                    };
5065                    Box::pin(fut)
5066                }
5067                _ => {
5068                    Box::pin(async move {
5069                        let mut response = http::Response::new(
5070                            tonic::body::Body::default(),
5071                        );
5072                        let headers = response.headers_mut();
5073                        headers
5074                            .insert(
5075                                tonic::Status::GRPC_STATUS,
5076                                (tonic::Code::Unimplemented as i32).into(),
5077                            );
5078                        headers
5079                            .insert(
5080                                http::header::CONTENT_TYPE,
5081                                tonic::metadata::GRPC_CONTENT_TYPE,
5082                            );
5083                        Ok(response)
5084                    })
5085                }
5086            }
5087        }
5088    }
5089    impl<T> Clone for SignatureVerificationServiceServer<T> {
5090        fn clone(&self) -> Self {
5091            let inner = self.inner.clone();
5092            Self {
5093                inner,
5094                accept_compression_encodings: self.accept_compression_encodings,
5095                send_compression_encodings: self.send_compression_encodings,
5096                max_decoding_message_size: self.max_decoding_message_size,
5097                max_encoding_message_size: self.max_encoding_message_size,
5098            }
5099        }
5100    }
5101    /// Generated gRPC service name
5102    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
5103    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
5104        const NAME: &'static str = SERVICE_NAME;
5105    }
5106}
5107/// Request message for `NodeService.GetCoinInfo`.
5108#[non_exhaustive]
5109#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5110pub struct GetCoinInfoRequest {
5111    /// The coin type to request information about
5112    #[prost(string, optional, tag = "1")]
5113    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5114}
5115/// Response message for `NodeService.GetCoinInfo`.
5116#[non_exhaustive]
5117#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5118pub struct GetCoinInfoResponse {
5119    /// Required. The coin type.
5120    #[prost(string, optional, tag = "1")]
5121    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5122    /// This field will be populated with information about this coin
5123    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
5124    #[prost(message, optional, tag = "2")]
5125    pub metadata: ::core::option::Option<CoinMetadata>,
5126    /// This field will be populated with information about this coin
5127    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
5128    #[prost(message, optional, tag = "3")]
5129    pub treasury: ::core::option::Option<CoinTreasury>,
5130    /// If this coin type is a regulated coin, this field will be
5131    /// populated with information either from its Currency object
5132    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
5133    /// object for coins that have not been migrated to the CoinRegistry
5134    ///
5135    /// If this coin is not known to be regulated, only the
5136    /// coin_regulated_state field will be populated.
5137    #[prost(message, optional, tag = "4")]
5138    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
5139}
5140/// Metadata for a coin type
5141#[non_exhaustive]
5142#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5143pub struct CoinMetadata {
5144    /// ObjectId of the `0x2::coin::CoinMetadata` object or
5145    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
5146    #[prost(string, optional, tag = "1")]
5147    pub id: ::core::option::Option<::prost::alloc::string::String>,
5148    /// Number of decimal places to coin uses.
5149    #[prost(uint32, optional, tag = "2")]
5150    pub decimals: ::core::option::Option<u32>,
5151    /// Name for the token
5152    #[prost(string, optional, tag = "3")]
5153    pub name: ::core::option::Option<::prost::alloc::string::String>,
5154    /// Symbol for the token
5155    #[prost(string, optional, tag = "4")]
5156    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
5157    /// Description of the token
5158    #[prost(string, optional, tag = "5")]
5159    pub description: ::core::option::Option<::prost::alloc::string::String>,
5160    /// URL for the token logo
5161    #[prost(string, optional, tag = "6")]
5162    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
5163    /// The MetadataCap ID if it has been claimed for this coin type.
5164    /// This capability allows updating the coin's metadata fields.
5165    /// Only populated when metadata is from CoinRegistry.
5166    #[prost(string, optional, tag = "7")]
5167    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
5168    /// State of the MetadataCap for this coin type.
5169    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
5170    pub metadata_cap_state: ::core::option::Option<i32>,
5171}
5172/// Nested message and enum types in `CoinMetadata`.
5173pub mod coin_metadata {
5174    /// Information about the state of the coin's MetadataCap
5175    #[non_exhaustive]
5176    #[derive(
5177        Clone,
5178        Copy,
5179        Debug,
5180        PartialEq,
5181        Eq,
5182        Hash,
5183        PartialOrd,
5184        Ord,
5185        ::prost::Enumeration
5186    )]
5187    #[repr(i32)]
5188    pub enum MetadataCapState {
5189        /// Indicates the state of the MetadataCap is unknown.
5190        /// Set when the coin has not been migrated to the CoinRegistry.
5191        Unknown = 0,
5192        /// Indicates the MetadataCap has been claimed.
5193        Claimed = 1,
5194        /// Indicates the MetadataCap has not been claimed.
5195        Unclaimed = 2,
5196        /// Indicates the MetadataCap has been deleted.
5197        Deleted = 3,
5198    }
5199    impl MetadataCapState {
5200        /// String value of the enum field names used in the ProtoBuf definition.
5201        ///
5202        /// The values are not transformed in any way and thus are considered stable
5203        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5204        pub fn as_str_name(&self) -> &'static str {
5205            match self {
5206                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
5207                Self::Claimed => "CLAIMED",
5208                Self::Unclaimed => "UNCLAIMED",
5209                Self::Deleted => "DELETED",
5210            }
5211        }
5212        /// Creates an enum from field names used in the ProtoBuf definition.
5213        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5214            match value {
5215                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
5216                "CLAIMED" => Some(Self::Claimed),
5217                "UNCLAIMED" => Some(Self::Unclaimed),
5218                "DELETED" => Some(Self::Deleted),
5219                _ => None,
5220            }
5221        }
5222    }
5223}
5224/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
5225#[non_exhaustive]
5226#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5227pub struct CoinTreasury {
5228    /// ObjectId of the `0x2::coin::TreasuryCap` object.
5229    #[prost(string, optional, tag = "1")]
5230    pub id: ::core::option::Option<::prost::alloc::string::String>,
5231    /// Total available supply for this coin type.
5232    #[prost(uint64, optional, tag = "2")]
5233    pub total_supply: ::core::option::Option<u64>,
5234    /// Supply state indicating if the supply is fixed or can still be minted
5235    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
5236    pub supply_state: ::core::option::Option<i32>,
5237}
5238/// Nested message and enum types in `CoinTreasury`.
5239pub mod coin_treasury {
5240    /// Supply state of a coin, matching the Move SupplyState enum
5241    #[non_exhaustive]
5242    #[derive(
5243        Clone,
5244        Copy,
5245        Debug,
5246        PartialEq,
5247        Eq,
5248        Hash,
5249        PartialOrd,
5250        Ord,
5251        ::prost::Enumeration
5252    )]
5253    #[repr(i32)]
5254    pub enum SupplyState {
5255        /// Supply is unknown or TreasuryCap still exists (minting still possible)
5256        Unknown = 0,
5257        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
5258        Fixed = 1,
5259        /// Supply can only decrease (burning allowed, minting not allowed)
5260        BurnOnly = 2,
5261    }
5262    impl SupplyState {
5263        /// String value of the enum field names used in the ProtoBuf definition.
5264        ///
5265        /// The values are not transformed in any way and thus are considered stable
5266        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5267        pub fn as_str_name(&self) -> &'static str {
5268            match self {
5269                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
5270                Self::Fixed => "FIXED",
5271                Self::BurnOnly => "BURN_ONLY",
5272            }
5273        }
5274        /// Creates an enum from field names used in the ProtoBuf definition.
5275        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5276            match value {
5277                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
5278                "FIXED" => Some(Self::Fixed),
5279                "BURN_ONLY" => Some(Self::BurnOnly),
5280                _ => None,
5281            }
5282        }
5283    }
5284}
5285/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
5286#[non_exhaustive]
5287#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5288pub struct RegulatedCoinMetadata {
5289    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
5290    /// Only present for coins that have not been migrated to CoinRegistry.
5291    #[prost(string, optional, tag = "1")]
5292    pub id: ::core::option::Option<::prost::alloc::string::String>,
5293    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
5294    #[prost(string, optional, tag = "2")]
5295    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
5296    /// The ID of the coin's `DenyCap` object.
5297    #[prost(string, optional, tag = "3")]
5298    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
5299    /// Whether the coin can be globally paused
5300    #[prost(bool, optional, tag = "4")]
5301    pub allow_global_pause: ::core::option::Option<bool>,
5302    /// Variant of the regulated coin metadata
5303    #[prost(uint32, optional, tag = "5")]
5304    pub variant: ::core::option::Option<u32>,
5305    /// Indicates the coin's regulated state.
5306    #[prost(
5307        enumeration = "regulated_coin_metadata::CoinRegulatedState",
5308        optional,
5309        tag = "6"
5310    )]
5311    pub coin_regulated_state: ::core::option::Option<i32>,
5312}
5313/// Nested message and enum types in `RegulatedCoinMetadata`.
5314pub mod regulated_coin_metadata {
5315    /// Indicates the state of the regulation of the coin.
5316    #[non_exhaustive]
5317    #[derive(
5318        Clone,
5319        Copy,
5320        Debug,
5321        PartialEq,
5322        Eq,
5323        Hash,
5324        PartialOrd,
5325        Ord,
5326        ::prost::Enumeration
5327    )]
5328    #[repr(i32)]
5329    pub enum CoinRegulatedState {
5330        /// Indicates the regulation state of the coin is unknown.
5331        /// This is set when a coin has not been migrated to the
5332        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
5333        /// object.
5334        Unknown = 0,
5335        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
5336        Regulated = 1,
5337        /// Indicates a coin is unregulated.
5338        Unregulated = 2,
5339    }
5340    impl CoinRegulatedState {
5341        /// String value of the enum field names used in the ProtoBuf definition.
5342        ///
5343        /// The values are not transformed in any way and thus are considered stable
5344        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5345        pub fn as_str_name(&self) -> &'static str {
5346            match self {
5347                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
5348                Self::Regulated => "REGULATED",
5349                Self::Unregulated => "UNREGULATED",
5350            }
5351        }
5352        /// Creates an enum from field names used in the ProtoBuf definition.
5353        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5354            match value {
5355                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
5356                "REGULATED" => Some(Self::Regulated),
5357                "UNREGULATED" => Some(Self::Unregulated),
5358                _ => None,
5359            }
5360        }
5361    }
5362}
5363/// Request message for `LiveDataService.GetBalance`.
5364#[non_exhaustive]
5365#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5366pub struct GetBalanceRequest {
5367    /// Required. The owner's Sui address.
5368    #[prost(string, optional, tag = "1")]
5369    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5370    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
5371    #[prost(string, optional, tag = "2")]
5372    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5373}
5374/// Response message for `LiveDataService.GetBalance`.
5375/// Return the total coin balance for one coin type, owned by the address owner.
5376#[non_exhaustive]
5377#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5378pub struct GetBalanceResponse {
5379    /// The balance information for the requested coin type.
5380    #[prost(message, optional, tag = "1")]
5381    pub balance: ::core::option::Option<Balance>,
5382}
5383/// Request message for `LiveDataService.ListBalances`.
5384#[non_exhaustive]
5385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5386pub struct ListBalancesRequest {
5387    /// Required. The owner's Sui address.
5388    #[prost(string, optional, tag = "1")]
5389    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5390    /// The maximum number of balance entries to return. The service may return fewer than this value.
5391    /// If unspecified, at most `50` entries will be returned.
5392    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5393    #[prost(uint32, optional, tag = "2")]
5394    pub page_size: ::core::option::Option<u32>,
5395    /// A page token, received from a previous `ListBalances` call.
5396    /// Provide this to retrieve the subsequent page.
5397    ///
5398    /// When paginating, all other parameters provided to `ListBalances` must
5399    /// match the call that provided the page token.
5400    #[prost(bytes = "bytes", optional, tag = "3")]
5401    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5402}
5403/// Response message for `LiveDataService.ListBalances`.
5404/// Return the total coin balance for all coin types, owned by the address owner.
5405#[non_exhaustive]
5406#[derive(Clone, PartialEq, ::prost::Message)]
5407pub struct ListBalancesResponse {
5408    /// The list of coin types and their respective balances.
5409    #[prost(message, repeated, tag = "1")]
5410    pub balances: ::prost::alloc::vec::Vec<Balance>,
5411    /// A token, which can be sent as `page_token` to retrieve the next page.
5412    /// If this field is omitted, there are no subsequent pages.
5413    #[prost(bytes = "bytes", optional, tag = "2")]
5414    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5415}
5416/// Balance information for a specific coin type.
5417#[non_exhaustive]
5418#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5419pub struct Balance {
5420    /// The type of the coin (e.g., 0x2::sui::SUI).
5421    #[prost(string, optional, tag = "1")]
5422    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
5423    /// The total balance of `coin_type` in its smallest unit.
5424    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
5425    /// and `coin_balance`).
5426    #[prost(uint64, optional, tag = "3")]
5427    pub balance: ::core::option::Option<u64>,
5428    /// The balance of `Balance<T>` in this address's Address Balance.
5429    #[prost(uint64, optional, tag = "4")]
5430    pub address_balance: ::core::option::Option<u64>,
5431    /// The balance of all `Coin<T>` objects owned by this address.
5432    #[prost(uint64, optional, tag = "5")]
5433    pub coin_balance: ::core::option::Option<u64>,
5434}
5435/// Request message for `NodeService.ListDynamicFields`
5436#[non_exhaustive]
5437#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5438pub struct ListDynamicFieldsRequest {
5439    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
5440    #[prost(string, optional, tag = "1")]
5441    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5442    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
5443    /// If unspecified, at most `50` entries will be returned.
5444    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5445    #[prost(uint32, optional, tag = "2")]
5446    pub page_size: ::core::option::Option<u32>,
5447    /// A page token, received from a previous `ListDynamicFields` call.
5448    /// Provide this to retrieve the subsequent page.
5449    ///
5450    /// When paginating, all other parameters provided to `ListDynamicFields` must
5451    /// match the call that provided the page token.
5452    #[prost(bytes = "bytes", optional, tag = "3")]
5453    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5454    /// Mask specifying which fields to read.
5455    /// If no mask is specified, defaults to `parent,field_id`.
5456    #[prost(message, optional, tag = "4")]
5457    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5458}
5459/// Response message for `NodeService.ListDynamicFields`
5460#[non_exhaustive]
5461#[derive(Clone, PartialEq, ::prost::Message)]
5462pub struct ListDynamicFieldsResponse {
5463    /// Page of dynamic fields owned by the specified parent.
5464    #[prost(message, repeated, tag = "1")]
5465    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5466    /// A token, which can be sent as `page_token` to retrieve the next page.
5467    /// If this field is omitted, there are no subsequent pages.
5468    #[prost(bytes = "bytes", optional, tag = "2")]
5469    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5470}
5471#[non_exhaustive]
5472#[derive(Clone, PartialEq, ::prost::Message)]
5473pub struct DynamicField {
5474    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5475    pub kind: ::core::option::Option<i32>,
5476    /// ObjectId of this dynamic field's parent.
5477    #[prost(string, optional, tag = "2")]
5478    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5479    /// ObjectId of this dynamic field.
5480    #[prost(string, optional, tag = "3")]
5481    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5482    /// The field object itself
5483    #[prost(message, optional, tag = "4")]
5484    pub field_object: ::core::option::Option<Object>,
5485    /// The dynamic field's "name"
5486    #[prost(message, optional, tag = "5")]
5487    pub name: ::core::option::Option<Bcs>,
5488    /// The dynamic field's "value"
5489    #[prost(message, optional, tag = "6")]
5490    pub value: ::core::option::Option<Bcs>,
5491    /// The type of the dynamic field "value".
5492    ///
5493    /// If this is a dynamic object field then this is the type of the object
5494    /// itself (which is a child of this field), otherwise this is the type of the
5495    /// value of this field.
5496    #[prost(string, optional, tag = "7")]
5497    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5498    /// The ObjectId of the child object when a child is a dynamic
5499    /// object field.
5500    ///
5501    /// The presence or absence of this field can be used to determine if a child
5502    /// is a dynamic field or a dynamic child object
5503    #[prost(string, optional, tag = "8")]
5504    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5505    /// The object itself when a child is a dynamic object field.
5506    #[prost(message, optional, tag = "9")]
5507    pub child_object: ::core::option::Option<Object>,
5508}
5509/// Nested message and enum types in `DynamicField`.
5510pub mod dynamic_field {
5511    #[non_exhaustive]
5512    #[derive(
5513        Clone,
5514        Copy,
5515        Debug,
5516        PartialEq,
5517        Eq,
5518        Hash,
5519        PartialOrd,
5520        Ord,
5521        ::prost::Enumeration
5522    )]
5523    #[repr(i32)]
5524    pub enum DynamicFieldKind {
5525        Unknown = 0,
5526        Field = 1,
5527        Object = 2,
5528    }
5529    impl DynamicFieldKind {
5530        /// String value of the enum field names used in the ProtoBuf definition.
5531        ///
5532        /// The values are not transformed in any way and thus are considered stable
5533        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5534        pub fn as_str_name(&self) -> &'static str {
5535            match self {
5536                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5537                Self::Field => "FIELD",
5538                Self::Object => "OBJECT",
5539            }
5540        }
5541        /// Creates an enum from field names used in the ProtoBuf definition.
5542        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5543            match value {
5544                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5545                "FIELD" => Some(Self::Field),
5546                "OBJECT" => Some(Self::Object),
5547                _ => None,
5548            }
5549        }
5550    }
5551}
5552#[non_exhaustive]
5553#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5554pub struct ListOwnedObjectsRequest {
5555    /// Required. The address of the account that owns the objects.
5556    #[prost(string, optional, tag = "1")]
5557    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5558    /// The maximum number of entries return. The service may return fewer than this value.
5559    /// If unspecified, at most `50` entries will be returned.
5560    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5561    #[prost(uint32, optional, tag = "2")]
5562    pub page_size: ::core::option::Option<u32>,
5563    /// A page token, received from a previous `ListOwnedObjects` call.
5564    /// Provide this to retrieve the subsequent page.
5565    ///
5566    /// When paginating, all other parameters provided to `ListOwnedObjects` must
5567    /// match the call that provided the page token.
5568    #[prost(bytes = "bytes", optional, tag = "3")]
5569    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5570    /// Mask specifying which fields to read.
5571    /// If no mask is specified, defaults to `object_id,version,object_type`.
5572    #[prost(message, optional, tag = "4")]
5573    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5574    /// Optional type filter to limit the types of objects listed.
5575    ///
5576    /// Providing an object type with no type params will return objects of that
5577    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
5578    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
5579    /// with a type param will restrict the returned objects to only those objects
5580    /// that match the provided type parameters, e.g.
5581    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
5582    #[prost(string, optional, tag = "5")]
5583    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5584}
5585#[non_exhaustive]
5586#[derive(Clone, PartialEq, ::prost::Message)]
5587pub struct ListOwnedObjectsResponse {
5588    /// Page of dynamic fields owned by the specified parent.
5589    #[prost(message, repeated, tag = "1")]
5590    pub objects: ::prost::alloc::vec::Vec<Object>,
5591    /// A token, which can be sent as `page_token` to retrieve the next page.
5592    /// If this field is omitted, there are no subsequent pages.
5593    #[prost(bytes = "bytes", optional, tag = "2")]
5594    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5595}
5596/// Generated client implementations.
5597pub mod state_service_client {
5598    #![allow(
5599        unused_variables,
5600        dead_code,
5601        missing_docs,
5602        clippy::wildcard_imports,
5603        clippy::let_unit_value,
5604    )]
5605    use tonic::codegen::*;
5606    use tonic::codegen::http::Uri;
5607    #[derive(Debug, Clone)]
5608    pub struct StateServiceClient<T> {
5609        inner: tonic::client::Grpc<T>,
5610    }
5611    impl StateServiceClient<tonic::transport::Channel> {
5612        /// Attempt to create a new client by connecting to a given endpoint.
5613        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5614        where
5615            D: TryInto<tonic::transport::Endpoint>,
5616            D::Error: Into<StdError>,
5617        {
5618            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5619            Ok(Self::new(conn))
5620        }
5621    }
5622    impl<T> StateServiceClient<T>
5623    where
5624        T: tonic::client::GrpcService<tonic::body::Body>,
5625        T::Error: Into<StdError>,
5626        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5627        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5628    {
5629        pub fn new(inner: T) -> Self {
5630            let inner = tonic::client::Grpc::new(inner);
5631            Self { inner }
5632        }
5633        pub fn with_origin(inner: T, origin: Uri) -> Self {
5634            let inner = tonic::client::Grpc::with_origin(inner, origin);
5635            Self { inner }
5636        }
5637        pub fn with_interceptor<F>(
5638            inner: T,
5639            interceptor: F,
5640        ) -> StateServiceClient<InterceptedService<T, F>>
5641        where
5642            F: tonic::service::Interceptor,
5643            T::ResponseBody: Default,
5644            T: tonic::codegen::Service<
5645                http::Request<tonic::body::Body>,
5646                Response = http::Response<
5647                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5648                >,
5649            >,
5650            <T as tonic::codegen::Service<
5651                http::Request<tonic::body::Body>,
5652            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5653        {
5654            StateServiceClient::new(InterceptedService::new(inner, interceptor))
5655        }
5656        /// Compress requests with the given encoding.
5657        ///
5658        /// This requires the server to support it otherwise it might respond with an
5659        /// error.
5660        #[must_use]
5661        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5662            self.inner = self.inner.send_compressed(encoding);
5663            self
5664        }
5665        /// Enable decompressing responses.
5666        #[must_use]
5667        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5668            self.inner = self.inner.accept_compressed(encoding);
5669            self
5670        }
5671        /// Limits the maximum size of a decoded message.
5672        ///
5673        /// Default: `4MB`
5674        #[must_use]
5675        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5676            self.inner = self.inner.max_decoding_message_size(limit);
5677            self
5678        }
5679        /// Limits the maximum size of an encoded message.
5680        ///
5681        /// Default: `usize::MAX`
5682        #[must_use]
5683        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5684            self.inner = self.inner.max_encoding_message_size(limit);
5685            self
5686        }
5687        pub async fn list_dynamic_fields(
5688            &mut self,
5689            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5690        ) -> std::result::Result<
5691            tonic::Response<super::ListDynamicFieldsResponse>,
5692            tonic::Status,
5693        > {
5694            self.inner
5695                .ready()
5696                .await
5697                .map_err(|e| {
5698                    tonic::Status::unknown(
5699                        format!("Service was not ready: {}", e.into()),
5700                    )
5701                })?;
5702            let codec = tonic_prost::ProstCodec::default();
5703            let path = http::uri::PathAndQuery::from_static(
5704                "/sui.rpc.v2.StateService/ListDynamicFields",
5705            );
5706            let mut req = request.into_request();
5707            req.extensions_mut()
5708                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5709            self.inner.unary(req, path, codec).await
5710        }
5711        pub async fn list_owned_objects(
5712            &mut self,
5713            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5714        ) -> std::result::Result<
5715            tonic::Response<super::ListOwnedObjectsResponse>,
5716            tonic::Status,
5717        > {
5718            self.inner
5719                .ready()
5720                .await
5721                .map_err(|e| {
5722                    tonic::Status::unknown(
5723                        format!("Service was not ready: {}", e.into()),
5724                    )
5725                })?;
5726            let codec = tonic_prost::ProstCodec::default();
5727            let path = http::uri::PathAndQuery::from_static(
5728                "/sui.rpc.v2.StateService/ListOwnedObjects",
5729            );
5730            let mut req = request.into_request();
5731            req.extensions_mut()
5732                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5733            self.inner.unary(req, path, codec).await
5734        }
5735        pub async fn get_coin_info(
5736            &mut self,
5737            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5738        ) -> std::result::Result<
5739            tonic::Response<super::GetCoinInfoResponse>,
5740            tonic::Status,
5741        > {
5742            self.inner
5743                .ready()
5744                .await
5745                .map_err(|e| {
5746                    tonic::Status::unknown(
5747                        format!("Service was not ready: {}", e.into()),
5748                    )
5749                })?;
5750            let codec = tonic_prost::ProstCodec::default();
5751            let path = http::uri::PathAndQuery::from_static(
5752                "/sui.rpc.v2.StateService/GetCoinInfo",
5753            );
5754            let mut req = request.into_request();
5755            req.extensions_mut()
5756                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5757            self.inner.unary(req, path, codec).await
5758        }
5759        pub async fn get_balance(
5760            &mut self,
5761            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5762        ) -> std::result::Result<
5763            tonic::Response<super::GetBalanceResponse>,
5764            tonic::Status,
5765        > {
5766            self.inner
5767                .ready()
5768                .await
5769                .map_err(|e| {
5770                    tonic::Status::unknown(
5771                        format!("Service was not ready: {}", e.into()),
5772                    )
5773                })?;
5774            let codec = tonic_prost::ProstCodec::default();
5775            let path = http::uri::PathAndQuery::from_static(
5776                "/sui.rpc.v2.StateService/GetBalance",
5777            );
5778            let mut req = request.into_request();
5779            req.extensions_mut()
5780                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5781            self.inner.unary(req, path, codec).await
5782        }
5783        pub async fn list_balances(
5784            &mut self,
5785            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5786        ) -> std::result::Result<
5787            tonic::Response<super::ListBalancesResponse>,
5788            tonic::Status,
5789        > {
5790            self.inner
5791                .ready()
5792                .await
5793                .map_err(|e| {
5794                    tonic::Status::unknown(
5795                        format!("Service was not ready: {}", e.into()),
5796                    )
5797                })?;
5798            let codec = tonic_prost::ProstCodec::default();
5799            let path = http::uri::PathAndQuery::from_static(
5800                "/sui.rpc.v2.StateService/ListBalances",
5801            );
5802            let mut req = request.into_request();
5803            req.extensions_mut()
5804                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5805            self.inner.unary(req, path, codec).await
5806        }
5807    }
5808}
5809/// Generated server implementations.
5810pub mod state_service_server {
5811    #![allow(
5812        unused_variables,
5813        dead_code,
5814        missing_docs,
5815        clippy::wildcard_imports,
5816        clippy::let_unit_value,
5817    )]
5818    use tonic::codegen::*;
5819    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
5820    #[async_trait]
5821    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5822        async fn list_dynamic_fields(
5823            &self,
5824            request: tonic::Request<super::ListDynamicFieldsRequest>,
5825        ) -> std::result::Result<
5826            tonic::Response<super::ListDynamicFieldsResponse>,
5827            tonic::Status,
5828        >;
5829        async fn list_owned_objects(
5830            &self,
5831            request: tonic::Request<super::ListOwnedObjectsRequest>,
5832        ) -> std::result::Result<
5833            tonic::Response<super::ListOwnedObjectsResponse>,
5834            tonic::Status,
5835        >;
5836        async fn get_coin_info(
5837            &self,
5838            request: tonic::Request<super::GetCoinInfoRequest>,
5839        ) -> std::result::Result<
5840            tonic::Response<super::GetCoinInfoResponse>,
5841            tonic::Status,
5842        >;
5843        async fn get_balance(
5844            &self,
5845            request: tonic::Request<super::GetBalanceRequest>,
5846        ) -> std::result::Result<
5847            tonic::Response<super::GetBalanceResponse>,
5848            tonic::Status,
5849        >;
5850        async fn list_balances(
5851            &self,
5852            request: tonic::Request<super::ListBalancesRequest>,
5853        ) -> std::result::Result<
5854            tonic::Response<super::ListBalancesResponse>,
5855            tonic::Status,
5856        >;
5857    }
5858    #[derive(Debug)]
5859    pub struct StateServiceServer<T> {
5860        inner: Arc<T>,
5861        accept_compression_encodings: EnabledCompressionEncodings,
5862        send_compression_encodings: EnabledCompressionEncodings,
5863        max_decoding_message_size: Option<usize>,
5864        max_encoding_message_size: Option<usize>,
5865    }
5866    impl<T> StateServiceServer<T> {
5867        pub fn new(inner: T) -> Self {
5868            Self::from_arc(Arc::new(inner))
5869        }
5870        pub fn from_arc(inner: Arc<T>) -> Self {
5871            Self {
5872                inner,
5873                accept_compression_encodings: Default::default(),
5874                send_compression_encodings: Default::default(),
5875                max_decoding_message_size: None,
5876                max_encoding_message_size: None,
5877            }
5878        }
5879        pub fn with_interceptor<F>(
5880            inner: T,
5881            interceptor: F,
5882        ) -> InterceptedService<Self, F>
5883        where
5884            F: tonic::service::Interceptor,
5885        {
5886            InterceptedService::new(Self::new(inner), interceptor)
5887        }
5888        /// Enable decompressing requests with the given encoding.
5889        #[must_use]
5890        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5891            self.accept_compression_encodings.enable(encoding);
5892            self
5893        }
5894        /// Compress responses with the given encoding, if the client supports it.
5895        #[must_use]
5896        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5897            self.send_compression_encodings.enable(encoding);
5898            self
5899        }
5900        /// Limits the maximum size of a decoded message.
5901        ///
5902        /// Default: `4MB`
5903        #[must_use]
5904        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5905            self.max_decoding_message_size = Some(limit);
5906            self
5907        }
5908        /// Limits the maximum size of an encoded message.
5909        ///
5910        /// Default: `usize::MAX`
5911        #[must_use]
5912        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5913            self.max_encoding_message_size = Some(limit);
5914            self
5915        }
5916    }
5917    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5918    where
5919        T: StateService,
5920        B: Body + std::marker::Send + 'static,
5921        B::Error: Into<StdError> + std::marker::Send + 'static,
5922    {
5923        type Response = http::Response<tonic::body::Body>;
5924        type Error = std::convert::Infallible;
5925        type Future = BoxFuture<Self::Response, Self::Error>;
5926        fn poll_ready(
5927            &mut self,
5928            _cx: &mut Context<'_>,
5929        ) -> Poll<std::result::Result<(), Self::Error>> {
5930            Poll::Ready(Ok(()))
5931        }
5932        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5933            match req.uri().path() {
5934                "/sui.rpc.v2.StateService/ListDynamicFields" => {
5935                    #[allow(non_camel_case_types)]
5936                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5937                    impl<
5938                        T: StateService,
5939                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5940                    for ListDynamicFieldsSvc<T> {
5941                        type Response = super::ListDynamicFieldsResponse;
5942                        type Future = BoxFuture<
5943                            tonic::Response<Self::Response>,
5944                            tonic::Status,
5945                        >;
5946                        fn call(
5947                            &mut self,
5948                            request: tonic::Request<super::ListDynamicFieldsRequest>,
5949                        ) -> Self::Future {
5950                            let inner = Arc::clone(&self.0);
5951                            let fut = async move {
5952                                <T as StateService>::list_dynamic_fields(&inner, request)
5953                                    .await
5954                            };
5955                            Box::pin(fut)
5956                        }
5957                    }
5958                    let accept_compression_encodings = self.accept_compression_encodings;
5959                    let send_compression_encodings = self.send_compression_encodings;
5960                    let max_decoding_message_size = self.max_decoding_message_size;
5961                    let max_encoding_message_size = self.max_encoding_message_size;
5962                    let inner = self.inner.clone();
5963                    let fut = async move {
5964                        let method = ListDynamicFieldsSvc(inner);
5965                        let codec = tonic_prost::ProstCodec::default();
5966                        let mut grpc = tonic::server::Grpc::new(codec)
5967                            .apply_compression_config(
5968                                accept_compression_encodings,
5969                                send_compression_encodings,
5970                            )
5971                            .apply_max_message_size_config(
5972                                max_decoding_message_size,
5973                                max_encoding_message_size,
5974                            );
5975                        let res = grpc.unary(method, req).await;
5976                        Ok(res)
5977                    };
5978                    Box::pin(fut)
5979                }
5980                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5981                    #[allow(non_camel_case_types)]
5982                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5983                    impl<
5984                        T: StateService,
5985                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5986                    for ListOwnedObjectsSvc<T> {
5987                        type Response = super::ListOwnedObjectsResponse;
5988                        type Future = BoxFuture<
5989                            tonic::Response<Self::Response>,
5990                            tonic::Status,
5991                        >;
5992                        fn call(
5993                            &mut self,
5994                            request: tonic::Request<super::ListOwnedObjectsRequest>,
5995                        ) -> Self::Future {
5996                            let inner = Arc::clone(&self.0);
5997                            let fut = async move {
5998                                <T as StateService>::list_owned_objects(&inner, request)
5999                                    .await
6000                            };
6001                            Box::pin(fut)
6002                        }
6003                    }
6004                    let accept_compression_encodings = self.accept_compression_encodings;
6005                    let send_compression_encodings = self.send_compression_encodings;
6006                    let max_decoding_message_size = self.max_decoding_message_size;
6007                    let max_encoding_message_size = self.max_encoding_message_size;
6008                    let inner = self.inner.clone();
6009                    let fut = async move {
6010                        let method = ListOwnedObjectsSvc(inner);
6011                        let codec = tonic_prost::ProstCodec::default();
6012                        let mut grpc = tonic::server::Grpc::new(codec)
6013                            .apply_compression_config(
6014                                accept_compression_encodings,
6015                                send_compression_encodings,
6016                            )
6017                            .apply_max_message_size_config(
6018                                max_decoding_message_size,
6019                                max_encoding_message_size,
6020                            );
6021                        let res = grpc.unary(method, req).await;
6022                        Ok(res)
6023                    };
6024                    Box::pin(fut)
6025                }
6026                "/sui.rpc.v2.StateService/GetCoinInfo" => {
6027                    #[allow(non_camel_case_types)]
6028                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6029                    impl<
6030                        T: StateService,
6031                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
6032                    for GetCoinInfoSvc<T> {
6033                        type Response = super::GetCoinInfoResponse;
6034                        type Future = BoxFuture<
6035                            tonic::Response<Self::Response>,
6036                            tonic::Status,
6037                        >;
6038                        fn call(
6039                            &mut self,
6040                            request: tonic::Request<super::GetCoinInfoRequest>,
6041                        ) -> Self::Future {
6042                            let inner = Arc::clone(&self.0);
6043                            let fut = async move {
6044                                <T as StateService>::get_coin_info(&inner, request).await
6045                            };
6046                            Box::pin(fut)
6047                        }
6048                    }
6049                    let accept_compression_encodings = self.accept_compression_encodings;
6050                    let send_compression_encodings = self.send_compression_encodings;
6051                    let max_decoding_message_size = self.max_decoding_message_size;
6052                    let max_encoding_message_size = self.max_encoding_message_size;
6053                    let inner = self.inner.clone();
6054                    let fut = async move {
6055                        let method = GetCoinInfoSvc(inner);
6056                        let codec = tonic_prost::ProstCodec::default();
6057                        let mut grpc = tonic::server::Grpc::new(codec)
6058                            .apply_compression_config(
6059                                accept_compression_encodings,
6060                                send_compression_encodings,
6061                            )
6062                            .apply_max_message_size_config(
6063                                max_decoding_message_size,
6064                                max_encoding_message_size,
6065                            );
6066                        let res = grpc.unary(method, req).await;
6067                        Ok(res)
6068                    };
6069                    Box::pin(fut)
6070                }
6071                "/sui.rpc.v2.StateService/GetBalance" => {
6072                    #[allow(non_camel_case_types)]
6073                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6074                    impl<
6075                        T: StateService,
6076                    > tonic::server::UnaryService<super::GetBalanceRequest>
6077                    for GetBalanceSvc<T> {
6078                        type Response = super::GetBalanceResponse;
6079                        type Future = BoxFuture<
6080                            tonic::Response<Self::Response>,
6081                            tonic::Status,
6082                        >;
6083                        fn call(
6084                            &mut self,
6085                            request: tonic::Request<super::GetBalanceRequest>,
6086                        ) -> Self::Future {
6087                            let inner = Arc::clone(&self.0);
6088                            let fut = async move {
6089                                <T as StateService>::get_balance(&inner, request).await
6090                            };
6091                            Box::pin(fut)
6092                        }
6093                    }
6094                    let accept_compression_encodings = self.accept_compression_encodings;
6095                    let send_compression_encodings = self.send_compression_encodings;
6096                    let max_decoding_message_size = self.max_decoding_message_size;
6097                    let max_encoding_message_size = self.max_encoding_message_size;
6098                    let inner = self.inner.clone();
6099                    let fut = async move {
6100                        let method = GetBalanceSvc(inner);
6101                        let codec = tonic_prost::ProstCodec::default();
6102                        let mut grpc = tonic::server::Grpc::new(codec)
6103                            .apply_compression_config(
6104                                accept_compression_encodings,
6105                                send_compression_encodings,
6106                            )
6107                            .apply_max_message_size_config(
6108                                max_decoding_message_size,
6109                                max_encoding_message_size,
6110                            );
6111                        let res = grpc.unary(method, req).await;
6112                        Ok(res)
6113                    };
6114                    Box::pin(fut)
6115                }
6116                "/sui.rpc.v2.StateService/ListBalances" => {
6117                    #[allow(non_camel_case_types)]
6118                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6119                    impl<
6120                        T: StateService,
6121                    > tonic::server::UnaryService<super::ListBalancesRequest>
6122                    for ListBalancesSvc<T> {
6123                        type Response = super::ListBalancesResponse;
6124                        type Future = BoxFuture<
6125                            tonic::Response<Self::Response>,
6126                            tonic::Status,
6127                        >;
6128                        fn call(
6129                            &mut self,
6130                            request: tonic::Request<super::ListBalancesRequest>,
6131                        ) -> Self::Future {
6132                            let inner = Arc::clone(&self.0);
6133                            let fut = async move {
6134                                <T as StateService>::list_balances(&inner, request).await
6135                            };
6136                            Box::pin(fut)
6137                        }
6138                    }
6139                    let accept_compression_encodings = self.accept_compression_encodings;
6140                    let send_compression_encodings = self.send_compression_encodings;
6141                    let max_decoding_message_size = self.max_decoding_message_size;
6142                    let max_encoding_message_size = self.max_encoding_message_size;
6143                    let inner = self.inner.clone();
6144                    let fut = async move {
6145                        let method = ListBalancesSvc(inner);
6146                        let codec = tonic_prost::ProstCodec::default();
6147                        let mut grpc = tonic::server::Grpc::new(codec)
6148                            .apply_compression_config(
6149                                accept_compression_encodings,
6150                                send_compression_encodings,
6151                            )
6152                            .apply_max_message_size_config(
6153                                max_decoding_message_size,
6154                                max_encoding_message_size,
6155                            );
6156                        let res = grpc.unary(method, req).await;
6157                        Ok(res)
6158                    };
6159                    Box::pin(fut)
6160                }
6161                _ => {
6162                    Box::pin(async move {
6163                        let mut response = http::Response::new(
6164                            tonic::body::Body::default(),
6165                        );
6166                        let headers = response.headers_mut();
6167                        headers
6168                            .insert(
6169                                tonic::Status::GRPC_STATUS,
6170                                (tonic::Code::Unimplemented as i32).into(),
6171                            );
6172                        headers
6173                            .insert(
6174                                http::header::CONTENT_TYPE,
6175                                tonic::metadata::GRPC_CONTENT_TYPE,
6176                            );
6177                        Ok(response)
6178                    })
6179                }
6180            }
6181        }
6182    }
6183    impl<T> Clone for StateServiceServer<T> {
6184        fn clone(&self) -> Self {
6185            let inner = self.inner.clone();
6186            Self {
6187                inner,
6188                accept_compression_encodings: self.accept_compression_encodings,
6189                send_compression_encodings: self.send_compression_encodings,
6190                max_decoding_message_size: self.max_decoding_message_size,
6191                max_encoding_message_size: self.max_encoding_message_size,
6192            }
6193        }
6194    }
6195    /// Generated gRPC service name
6196    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6197    impl<T> tonic::server::NamedService for StateServiceServer<T> {
6198        const NAME: &'static str = SERVICE_NAME;
6199    }
6200}
6201/// Request message for SubscriptionService.SubscribeCheckpoints
6202#[non_exhaustive]
6203#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6204pub struct SubscribeCheckpointsRequest {
6205    /// Optional. Mask for specifying which parts of the
6206    /// SubscribeCheckpointsResponse should be returned.
6207    #[prost(message, optional, tag = "1")]
6208    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6209}
6210/// Response message for SubscriptionService.SubscribeCheckpoints
6211#[non_exhaustive]
6212#[derive(Clone, PartialEq, ::prost::Message)]
6213pub struct SubscribeCheckpointsResponse {
6214    /// Required. The checkpoint sequence number and value of the current cursor
6215    /// into the checkpoint stream
6216    #[prost(uint64, optional, tag = "1")]
6217    pub cursor: ::core::option::Option<u64>,
6218    /// The requested data for this checkpoint
6219    #[prost(message, optional, tag = "2")]
6220    pub checkpoint: ::core::option::Option<Checkpoint>,
6221}
6222/// Generated client implementations.
6223pub mod subscription_service_client {
6224    #![allow(
6225        unused_variables,
6226        dead_code,
6227        missing_docs,
6228        clippy::wildcard_imports,
6229        clippy::let_unit_value,
6230    )]
6231    use tonic::codegen::*;
6232    use tonic::codegen::http::Uri;
6233    #[derive(Debug, Clone)]
6234    pub struct SubscriptionServiceClient<T> {
6235        inner: tonic::client::Grpc<T>,
6236    }
6237    impl SubscriptionServiceClient<tonic::transport::Channel> {
6238        /// Attempt to create a new client by connecting to a given endpoint.
6239        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6240        where
6241            D: TryInto<tonic::transport::Endpoint>,
6242            D::Error: Into<StdError>,
6243        {
6244            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6245            Ok(Self::new(conn))
6246        }
6247    }
6248    impl<T> SubscriptionServiceClient<T>
6249    where
6250        T: tonic::client::GrpcService<tonic::body::Body>,
6251        T::Error: Into<StdError>,
6252        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6253        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6254    {
6255        pub fn new(inner: T) -> Self {
6256            let inner = tonic::client::Grpc::new(inner);
6257            Self { inner }
6258        }
6259        pub fn with_origin(inner: T, origin: Uri) -> Self {
6260            let inner = tonic::client::Grpc::with_origin(inner, origin);
6261            Self { inner }
6262        }
6263        pub fn with_interceptor<F>(
6264            inner: T,
6265            interceptor: F,
6266        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6267        where
6268            F: tonic::service::Interceptor,
6269            T::ResponseBody: Default,
6270            T: tonic::codegen::Service<
6271                http::Request<tonic::body::Body>,
6272                Response = http::Response<
6273                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6274                >,
6275            >,
6276            <T as tonic::codegen::Service<
6277                http::Request<tonic::body::Body>,
6278            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6279        {
6280            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6281        }
6282        /// Compress requests with the given encoding.
6283        ///
6284        /// This requires the server to support it otherwise it might respond with an
6285        /// error.
6286        #[must_use]
6287        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6288            self.inner = self.inner.send_compressed(encoding);
6289            self
6290        }
6291        /// Enable decompressing responses.
6292        #[must_use]
6293        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6294            self.inner = self.inner.accept_compressed(encoding);
6295            self
6296        }
6297        /// Limits the maximum size of a decoded message.
6298        ///
6299        /// Default: `4MB`
6300        #[must_use]
6301        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6302            self.inner = self.inner.max_decoding_message_size(limit);
6303            self
6304        }
6305        /// Limits the maximum size of an encoded message.
6306        ///
6307        /// Default: `usize::MAX`
6308        #[must_use]
6309        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6310            self.inner = self.inner.max_encoding_message_size(limit);
6311            self
6312        }
6313        /// Subscribe to the stream of checkpoints.
6314        ///
6315        /// This API provides a subscription to the checkpoint stream for the Sui
6316        /// blockchain. When a subscription is initialized the stream will begin with
6317        /// the latest executed checkpoint as seen by the server. Responses are
6318        /// guaranteed to return checkpoints in-order and without gaps. This enables
6319        /// clients to know exactly the last checkpoint they have processed and in the
6320        /// event the subscription terminates (either by the client/server or by the
6321        /// connection breaking), clients will be able to reinitialize a subscription
6322        /// and then leverage other APIs in order to request data for the checkpoints
6323        /// they missed.
6324        pub async fn subscribe_checkpoints(
6325            &mut self,
6326            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6327        ) -> std::result::Result<
6328            tonic::Response<
6329                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6330            >,
6331            tonic::Status,
6332        > {
6333            self.inner
6334                .ready()
6335                .await
6336                .map_err(|e| {
6337                    tonic::Status::unknown(
6338                        format!("Service was not ready: {}", e.into()),
6339                    )
6340                })?;
6341            let codec = tonic_prost::ProstCodec::default();
6342            let path = http::uri::PathAndQuery::from_static(
6343                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6344            );
6345            let mut req = request.into_request();
6346            req.extensions_mut()
6347                .insert(
6348                    GrpcMethod::new(
6349                        "sui.rpc.v2.SubscriptionService",
6350                        "SubscribeCheckpoints",
6351                    ),
6352                );
6353            self.inner.server_streaming(req, path, codec).await
6354        }
6355    }
6356}
6357/// Generated server implementations.
6358pub mod subscription_service_server {
6359    #![allow(
6360        unused_variables,
6361        dead_code,
6362        missing_docs,
6363        clippy::wildcard_imports,
6364        clippy::let_unit_value,
6365    )]
6366    use tonic::codegen::*;
6367    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
6368    #[async_trait]
6369    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6370        /// Server streaming response type for the SubscribeCheckpoints method.
6371        type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6372                Item = std::result::Result<
6373                    super::SubscribeCheckpointsResponse,
6374                    tonic::Status,
6375                >,
6376            >
6377            + std::marker::Send
6378            + 'static;
6379        /// Subscribe to the stream of checkpoints.
6380        ///
6381        /// This API provides a subscription to the checkpoint stream for the Sui
6382        /// blockchain. When a subscription is initialized the stream will begin with
6383        /// the latest executed checkpoint as seen by the server. Responses are
6384        /// guaranteed to return checkpoints in-order and without gaps. This enables
6385        /// clients to know exactly the last checkpoint they have processed and in the
6386        /// event the subscription terminates (either by the client/server or by the
6387        /// connection breaking), clients will be able to reinitialize a subscription
6388        /// and then leverage other APIs in order to request data for the checkpoints
6389        /// they missed.
6390        async fn subscribe_checkpoints(
6391            &self,
6392            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6393        ) -> std::result::Result<
6394            tonic::Response<Self::SubscribeCheckpointsStream>,
6395            tonic::Status,
6396        >;
6397    }
6398    #[derive(Debug)]
6399    pub struct SubscriptionServiceServer<T> {
6400        inner: Arc<T>,
6401        accept_compression_encodings: EnabledCompressionEncodings,
6402        send_compression_encodings: EnabledCompressionEncodings,
6403        max_decoding_message_size: Option<usize>,
6404        max_encoding_message_size: Option<usize>,
6405    }
6406    impl<T> SubscriptionServiceServer<T> {
6407        pub fn new(inner: T) -> Self {
6408            Self::from_arc(Arc::new(inner))
6409        }
6410        pub fn from_arc(inner: Arc<T>) -> Self {
6411            Self {
6412                inner,
6413                accept_compression_encodings: Default::default(),
6414                send_compression_encodings: Default::default(),
6415                max_decoding_message_size: None,
6416                max_encoding_message_size: None,
6417            }
6418        }
6419        pub fn with_interceptor<F>(
6420            inner: T,
6421            interceptor: F,
6422        ) -> InterceptedService<Self, F>
6423        where
6424            F: tonic::service::Interceptor,
6425        {
6426            InterceptedService::new(Self::new(inner), interceptor)
6427        }
6428        /// Enable decompressing requests with the given encoding.
6429        #[must_use]
6430        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6431            self.accept_compression_encodings.enable(encoding);
6432            self
6433        }
6434        /// Compress responses with the given encoding, if the client supports it.
6435        #[must_use]
6436        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6437            self.send_compression_encodings.enable(encoding);
6438            self
6439        }
6440        /// Limits the maximum size of a decoded message.
6441        ///
6442        /// Default: `4MB`
6443        #[must_use]
6444        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6445            self.max_decoding_message_size = Some(limit);
6446            self
6447        }
6448        /// Limits the maximum size of an encoded message.
6449        ///
6450        /// Default: `usize::MAX`
6451        #[must_use]
6452        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6453            self.max_encoding_message_size = Some(limit);
6454            self
6455        }
6456    }
6457    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6458    where
6459        T: SubscriptionService,
6460        B: Body + std::marker::Send + 'static,
6461        B::Error: Into<StdError> + std::marker::Send + 'static,
6462    {
6463        type Response = http::Response<tonic::body::Body>;
6464        type Error = std::convert::Infallible;
6465        type Future = BoxFuture<Self::Response, Self::Error>;
6466        fn poll_ready(
6467            &mut self,
6468            _cx: &mut Context<'_>,
6469        ) -> Poll<std::result::Result<(), Self::Error>> {
6470            Poll::Ready(Ok(()))
6471        }
6472        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6473            match req.uri().path() {
6474                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6475                    #[allow(non_camel_case_types)]
6476                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6477                    impl<
6478                        T: SubscriptionService,
6479                    > tonic::server::ServerStreamingService<
6480                        super::SubscribeCheckpointsRequest,
6481                    > for SubscribeCheckpointsSvc<T> {
6482                        type Response = super::SubscribeCheckpointsResponse;
6483                        type ResponseStream = T::SubscribeCheckpointsStream;
6484                        type Future = BoxFuture<
6485                            tonic::Response<Self::ResponseStream>,
6486                            tonic::Status,
6487                        >;
6488                        fn call(
6489                            &mut self,
6490                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6491                        ) -> Self::Future {
6492                            let inner = Arc::clone(&self.0);
6493                            let fut = async move {
6494                                <T as SubscriptionService>::subscribe_checkpoints(
6495                                        &inner,
6496                                        request,
6497                                    )
6498                                    .await
6499                            };
6500                            Box::pin(fut)
6501                        }
6502                    }
6503                    let accept_compression_encodings = self.accept_compression_encodings;
6504                    let send_compression_encodings = self.send_compression_encodings;
6505                    let max_decoding_message_size = self.max_decoding_message_size;
6506                    let max_encoding_message_size = self.max_encoding_message_size;
6507                    let inner = self.inner.clone();
6508                    let fut = async move {
6509                        let method = SubscribeCheckpointsSvc(inner);
6510                        let codec = tonic_prost::ProstCodec::default();
6511                        let mut grpc = tonic::server::Grpc::new(codec)
6512                            .apply_compression_config(
6513                                accept_compression_encodings,
6514                                send_compression_encodings,
6515                            )
6516                            .apply_max_message_size_config(
6517                                max_decoding_message_size,
6518                                max_encoding_message_size,
6519                            );
6520                        let res = grpc.server_streaming(method, req).await;
6521                        Ok(res)
6522                    };
6523                    Box::pin(fut)
6524                }
6525                _ => {
6526                    Box::pin(async move {
6527                        let mut response = http::Response::new(
6528                            tonic::body::Body::default(),
6529                        );
6530                        let headers = response.headers_mut();
6531                        headers
6532                            .insert(
6533                                tonic::Status::GRPC_STATUS,
6534                                (tonic::Code::Unimplemented as i32).into(),
6535                            );
6536                        headers
6537                            .insert(
6538                                http::header::CONTENT_TYPE,
6539                                tonic::metadata::GRPC_CONTENT_TYPE,
6540                            );
6541                        Ok(response)
6542                    })
6543                }
6544            }
6545        }
6546    }
6547    impl<T> Clone for SubscriptionServiceServer<T> {
6548        fn clone(&self) -> Self {
6549            let inner = self.inner.clone();
6550            Self {
6551                inner,
6552                accept_compression_encodings: self.accept_compression_encodings,
6553                send_compression_encodings: self.send_compression_encodings,
6554                max_decoding_message_size: self.max_decoding_message_size,
6555                max_encoding_message_size: self.max_encoding_message_size,
6556            }
6557        }
6558    }
6559    /// Generated gRPC service name
6560    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6561    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6562        const NAME: &'static str = SERVICE_NAME;
6563    }
6564}
6565#[non_exhaustive]
6566#[derive(Clone, PartialEq, ::prost::Message)]
6567pub struct SystemState {
6568    /// The version of the system state data structure type.
6569    #[prost(uint64, optional, tag = "1")]
6570    pub version: ::core::option::Option<u64>,
6571    /// The epoch id
6572    #[prost(uint64, optional, tag = "2")]
6573    pub epoch: ::core::option::Option<u64>,
6574    /// The protocol version
6575    #[prost(uint64, optional, tag = "3")]
6576    pub protocol_version: ::core::option::Option<u64>,
6577    /// Information about the validators
6578    #[prost(message, optional, tag = "4")]
6579    pub validators: ::core::option::Option<ValidatorSet>,
6580    /// Storage Fund info
6581    #[prost(message, optional, tag = "5")]
6582    pub storage_fund: ::core::option::Option<StorageFund>,
6583    /// Set of system config parameters
6584    #[prost(message, optional, tag = "6")]
6585    pub parameters: ::core::option::Option<SystemParameters>,
6586    /// The reference gas price for this epoch
6587    #[prost(uint64, optional, tag = "7")]
6588    pub reference_gas_price: ::core::option::Option<u64>,
6589    /// A list of the records of validator reporting each other.
6590    ///
6591    /// There is an entry in this list for each validator that has been reported
6592    /// at least once. Each record contains all the validators that reported
6593    /// them. If a validator has never been reported they don't have a record in this list.
6594    /// This lists persists across epoch: a peer continues being in a reported state until the
6595    /// reporter doesn't explicitly remove their report.
6596    #[prost(message, repeated, tag = "8")]
6597    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6598    /// Schedule of stake subsidies given out each epoch.
6599    #[prost(message, optional, tag = "9")]
6600    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6601    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
6602    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
6603    /// It can be reset once we are able to successfully execute advance_epoch.
6604    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
6605    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
6606    /// are out of safe mode.
6607    #[prost(bool, optional, tag = "10")]
6608    pub safe_mode: ::core::option::Option<bool>,
6609    /// Storage rewards accumulated during safe_mode
6610    #[prost(uint64, optional, tag = "11")]
6611    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6612    /// Computation rewards accumulated during safe_mode
6613    #[prost(uint64, optional, tag = "12")]
6614    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6615    /// Storage rebates paid out during safe_mode
6616    #[prost(uint64, optional, tag = "13")]
6617    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6618    /// Nonrefundable storage fees accumulated during safe_mode
6619    #[prost(uint64, optional, tag = "14")]
6620    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6621    /// Unix timestamp of when this this epoch started
6622    #[prost(uint64, optional, tag = "15")]
6623    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6624    /// Any extra fields that's not defined statically.
6625    #[prost(message, optional, tag = "16")]
6626    pub extra_fields: ::core::option::Option<MoveTable>,
6627}
6628#[non_exhaustive]
6629#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6630pub struct ValidatorReportRecord {
6631    /// The address of the validator being reported
6632    #[prost(string, optional, tag = "1")]
6633    pub reported: ::core::option::Option<::prost::alloc::string::String>,
6634    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
6635    #[prost(string, repeated, tag = "2")]
6636    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6637}
6638#[non_exhaustive]
6639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6640pub struct SystemParameters {
6641    /// The duration of an epoch, in milliseconds.
6642    #[prost(uint64, optional, tag = "1")]
6643    pub epoch_duration_ms: ::core::option::Option<u64>,
6644    /// The starting epoch in which stake subsidies start being paid out
6645    #[prost(uint64, optional, tag = "2")]
6646    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6647    /// Minimum number of active validators at any moment.
6648    #[prost(uint64, optional, tag = "3")]
6649    pub min_validator_count: ::core::option::Option<u64>,
6650    /// Maximum number of active validators at any moment.
6651    /// We do not allow the number of validators in any epoch to go above this.
6652    #[prost(uint64, optional, tag = "4")]
6653    pub max_validator_count: ::core::option::Option<u64>,
6654    /// Deprecated.
6655    /// Lower-bound on the amount of stake required to become a validator.
6656    #[prost(uint64, optional, tag = "5")]
6657    pub min_validator_joining_stake: ::core::option::Option<u64>,
6658    /// Deprecated.
6659    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
6660    /// have low stake and will be escorted out of the validator set after being below this
6661    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
6662    #[prost(uint64, optional, tag = "6")]
6663    pub validator_low_stake_threshold: ::core::option::Option<u64>,
6664    /// Deprecated.
6665    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
6666    /// immediately at epoch change, no grace period.
6667    #[prost(uint64, optional, tag = "7")]
6668    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6669    /// A validator can have stake below `validator_low_stake_threshold`
6670    /// for this many epochs before being kicked out.
6671    #[prost(uint64, optional, tag = "8")]
6672    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6673    /// Any extra fields that are not defined statically.
6674    #[prost(message, optional, tag = "9")]
6675    pub extra_fields: ::core::option::Option<MoveTable>,
6676}
6677/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
6678#[non_exhaustive]
6679#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6680pub struct MoveTable {
6681    /// The UID of the table or bag
6682    #[prost(string, optional, tag = "1")]
6683    pub id: ::core::option::Option<::prost::alloc::string::String>,
6684    /// The size or number of key-value pairs in the table or bag
6685    #[prost(uint64, optional, tag = "2")]
6686    pub size: ::core::option::Option<u64>,
6687}
6688#[non_exhaustive]
6689#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6690pub struct StakeSubsidy {
6691    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
6692    #[prost(uint64, optional, tag = "1")]
6693    pub balance: ::core::option::Option<u64>,
6694    /// Count of the number of times stake subsidies have been distributed.
6695    #[prost(uint64, optional, tag = "2")]
6696    pub distribution_counter: ::core::option::Option<u64>,
6697    /// The amount of stake subsidy to be drawn down per distribution.
6698    /// This amount decays and decreases over time.
6699    #[prost(uint64, optional, tag = "3")]
6700    pub current_distribution_amount: ::core::option::Option<u64>,
6701    /// Number of distributions to occur before the distribution amount decays.
6702    #[prost(uint64, optional, tag = "4")]
6703    pub stake_subsidy_period_length: ::core::option::Option<u64>,
6704    /// The rate at which the distribution amount decays at the end of each
6705    /// period. Expressed in basis points.
6706    #[prost(uint32, optional, tag = "5")]
6707    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6708    /// Any extra fields that's not defined statically.
6709    #[prost(message, optional, tag = "6")]
6710    pub extra_fields: ::core::option::Option<MoveTable>,
6711}
6712/// Struct representing the onchain storage fund.
6713#[non_exhaustive]
6714#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6715pub struct StorageFund {
6716    /// This is the sum of `storage_rebate` of
6717    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
6718    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
6719    /// of transactions, including both the portion refunded to the transaction senders as well as
6720    /// the non-refundable portion taken out and put into `non_refundable_balance`.
6721    #[prost(uint64, optional, tag = "1")]
6722    pub total_object_storage_rebates: ::core::option::Option<u64>,
6723    /// Represents any remaining inflow of the storage fund that should not
6724    /// be taken out of the fund.
6725    #[prost(uint64, optional, tag = "2")]
6726    pub non_refundable_balance: ::core::option::Option<u64>,
6727}
6728#[non_exhaustive]
6729#[derive(Clone, PartialEq, ::prost::Message)]
6730pub struct ValidatorSet {
6731    /// Total amount of stake from all active validators at the beginning of the epoch.
6732    /// Written only once per epoch, in `advance_epoch` function.
6733    #[prost(uint64, optional, tag = "1")]
6734    pub total_stake: ::core::option::Option<u64>,
6735    /// The current list of active validators.
6736    #[prost(message, repeated, tag = "2")]
6737    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6738    /// List of new validator candidates added during the current epoch.
6739    /// They will be processed at the end of the epoch.
6740    ///
6741    /// key: u64 (index), value: 0x3::validator::Validator
6742    #[prost(message, optional, tag = "3")]
6743    pub pending_active_validators: ::core::option::Option<MoveTable>,
6744    /// Removal requests from the validators. Each element is an index
6745    /// pointing to `active_validators`.
6746    #[prost(uint64, repeated, tag = "4")]
6747    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6748    /// Mappings from staking pool's ID to the sui address of a validator.
6749    ///
6750    /// key: address (staking pool Id), value: address (sui address of the validator)
6751    #[prost(message, optional, tag = "5")]
6752    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6753    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
6754    /// When a validator is deactivated the validator is removed from `active_validators` it
6755    /// is added to this table so that stakers can continue to withdraw their stake from it.
6756    ///
6757    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
6758    #[prost(message, optional, tag = "6")]
6759    pub inactive_validators: ::core::option::Option<MoveTable>,
6760    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
6761    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
6762    /// validator.
6763    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
6764    /// officially add them to the active validator set `active_validators` next epoch.
6765    ///
6766    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
6767    #[prost(message, optional, tag = "7")]
6768    pub validator_candidates: ::core::option::Option<MoveTable>,
6769    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
6770    #[prost(btree_map = "string, uint64", tag = "8")]
6771    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6772        ::prost::alloc::string::String,
6773        u64,
6774    >,
6775    /// Any extra fields that's not defined statically.
6776    #[prost(message, optional, tag = "9")]
6777    pub extra_fields: ::core::option::Option<MoveTable>,
6778}
6779/// Definition of a Validator in the system contracts
6780///
6781/// Note: fields of ValidatorMetadata are flattened into this type
6782#[non_exhaustive]
6783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6784pub struct Validator {
6785    /// A unique human-readable name of this validator.
6786    #[prost(string, optional, tag = "1")]
6787    pub name: ::core::option::Option<::prost::alloc::string::String>,
6788    /// The Sui Address of the validator. This is the sender that created the Validator object,
6789    /// and also the address to send validator/coins to during withdraws.
6790    #[prost(string, optional, tag = "2")]
6791    pub address: ::core::option::Option<::prost::alloc::string::String>,
6792    #[prost(string, optional, tag = "3")]
6793    pub description: ::core::option::Option<::prost::alloc::string::String>,
6794    #[prost(string, optional, tag = "4")]
6795    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6796    #[prost(string, optional, tag = "5")]
6797    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6798    /// The public key bytes corresponding to the private key that the validator
6799    /// holds to sign transactions. For now, this is the same as AuthorityName.
6800    #[prost(bytes = "bytes", optional, tag = "7")]
6801    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6802    /// This is a proof that the validator has ownership of the protocol private key
6803    #[prost(bytes = "bytes", optional, tag = "8")]
6804    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6805    /// The public key bytes corresponding to the private key that the validator
6806    /// uses to establish TLS connections
6807    #[prost(bytes = "bytes", optional, tag = "10")]
6808    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6809    /// The public key bytes corresponding to the Narwhal Worker
6810    #[prost(bytes = "bytes", optional, tag = "12")]
6811    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6812    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
6813    #[prost(string, optional, tag = "13")]
6814    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6815    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
6816    #[prost(string, optional, tag = "14")]
6817    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6818    /// The address of the narwhal primary
6819    #[prost(string, optional, tag = "15")]
6820    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6821    /// The address of the narwhal worker
6822    #[prost(string, optional, tag = "16")]
6823    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6824    #[prost(bytes = "bytes", optional, tag = "18")]
6825    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6826    #[prost(bytes = "bytes", optional, tag = "19")]
6827    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6828    #[prost(bytes = "bytes", optional, tag = "21")]
6829    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6830    #[prost(bytes = "bytes", optional, tag = "23")]
6831    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6832    #[prost(string, optional, tag = "24")]
6833    pub next_epoch_network_address: ::core::option::Option<
6834        ::prost::alloc::string::String,
6835    >,
6836    #[prost(string, optional, tag = "25")]
6837    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6838    #[prost(string, optional, tag = "26")]
6839    pub next_epoch_primary_address: ::core::option::Option<
6840        ::prost::alloc::string::String,
6841    >,
6842    #[prost(string, optional, tag = "27")]
6843    pub next_epoch_worker_address: ::core::option::Option<
6844        ::prost::alloc::string::String,
6845    >,
6846    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
6847    #[prost(message, optional, tag = "28")]
6848    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6849    /// The voting power of this validator, which might be different from its
6850    /// stake amount.
6851    #[prost(uint64, optional, tag = "29")]
6852    pub voting_power: ::core::option::Option<u64>,
6853    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
6854    #[prost(string, optional, tag = "30")]
6855    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6856    /// Gas price quote, updated only at end of epoch.
6857    #[prost(uint64, optional, tag = "31")]
6858    pub gas_price: ::core::option::Option<u64>,
6859    /// Staking pool for this validator.
6860    #[prost(message, optional, tag = "32")]
6861    pub staking_pool: ::core::option::Option<StakingPool>,
6862    /// Commission rate of the validator, in basis point.
6863    #[prost(uint64, optional, tag = "33")]
6864    pub commission_rate: ::core::option::Option<u64>,
6865    /// Total amount of stake that would be active in the next epoch.
6866    #[prost(uint64, optional, tag = "34")]
6867    pub next_epoch_stake: ::core::option::Option<u64>,
6868    /// This validator's gas price quote for the next epoch.
6869    #[prost(uint64, optional, tag = "35")]
6870    pub next_epoch_gas_price: ::core::option::Option<u64>,
6871    /// The commission rate of the validator starting the next epoch, in basis point.
6872    #[prost(uint64, optional, tag = "36")]
6873    pub next_epoch_commission_rate: ::core::option::Option<u64>,
6874    /// Any extra fields that's not defined statically.
6875    #[prost(message, optional, tag = "37")]
6876    pub extra_fields: ::core::option::Option<MoveTable>,
6877}
6878/// A staking pool embedded in each validator struct in the system state object.
6879#[non_exhaustive]
6880#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6881pub struct StakingPool {
6882    /// UID of the StakingPool object
6883    #[prost(string, optional, tag = "1")]
6884    pub id: ::core::option::Option<::prost::alloc::string::String>,
6885    /// The epoch at which this pool became active.
6886    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
6887    #[prost(uint64, optional, tag = "2")]
6888    pub activation_epoch: ::core::option::Option<u64>,
6889    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
6890    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
6891    #[prost(uint64, optional, tag = "3")]
6892    pub deactivation_epoch: ::core::option::Option<u64>,
6893    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
6894    /// in the `StakedSui` object, updated at epoch boundaries.
6895    #[prost(uint64, optional, tag = "4")]
6896    pub sui_balance: ::core::option::Option<u64>,
6897    /// The epoch stake rewards will be added here at the end of each epoch.
6898    #[prost(uint64, optional, tag = "5")]
6899    pub rewards_pool: ::core::option::Option<u64>,
6900    /// Total number of pool tokens issued by the pool.
6901    #[prost(uint64, optional, tag = "6")]
6902    pub pool_token_balance: ::core::option::Option<u64>,
6903    /// Exchange rate history of previous epochs.
6904    ///
6905    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
6906    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
6907    ///
6908    /// key: u64 (epoch number), value: PoolTokenExchangeRate
6909    #[prost(message, optional, tag = "7")]
6910    pub exchange_rates: ::core::option::Option<MoveTable>,
6911    /// Pending stake amount for this epoch, emptied at epoch boundaries.
6912    #[prost(uint64, optional, tag = "8")]
6913    pub pending_stake: ::core::option::Option<u64>,
6914    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
6915    /// This includes both the principal and rewards SUI withdrawn.
6916    #[prost(uint64, optional, tag = "9")]
6917    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6918    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
6919    #[prost(uint64, optional, tag = "10")]
6920    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6921    /// Any extra fields that's not defined statically.
6922    #[prost(message, optional, tag = "11")]
6923    pub extra_fields: ::core::option::Option<MoveTable>,
6924}
6925/// A transaction.
6926#[non_exhaustive]
6927#[derive(Clone, PartialEq, ::prost::Message)]
6928pub struct Transaction {
6929    /// This Transaction serialized as BCS.
6930    #[prost(message, optional, tag = "1")]
6931    pub bcs: ::core::option::Option<Bcs>,
6932    /// The digest of this Transaction.
6933    #[prost(string, optional, tag = "2")]
6934    pub digest: ::core::option::Option<::prost::alloc::string::String>,
6935    /// Version of this Transaction.
6936    #[prost(int32, optional, tag = "3")]
6937    pub version: ::core::option::Option<i32>,
6938    #[prost(message, optional, tag = "4")]
6939    pub kind: ::core::option::Option<TransactionKind>,
6940    #[prost(string, optional, tag = "5")]
6941    pub sender: ::core::option::Option<::prost::alloc::string::String>,
6942    #[prost(message, optional, tag = "6")]
6943    pub gas_payment: ::core::option::Option<GasPayment>,
6944    #[prost(message, optional, tag = "7")]
6945    pub expiration: ::core::option::Option<TransactionExpiration>,
6946}
6947/// Payment information for executing a transaction.
6948#[non_exhaustive]
6949#[derive(Clone, PartialEq, ::prost::Message)]
6950pub struct GasPayment {
6951    /// Set of gas objects to use for payment.
6952    #[prost(message, repeated, tag = "1")]
6953    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6954    /// Owner of the gas objects, either the transaction sender or a sponsor.
6955    #[prost(string, optional, tag = "2")]
6956    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6957    /// Gas unit price to use when charging for computation.
6958    ///
6959    /// Must be greater than or equal to the network's current RGP (reference gas price).
6960    #[prost(uint64, optional, tag = "3")]
6961    pub price: ::core::option::Option<u64>,
6962    /// Total budget willing to spend for the execution of a transaction.
6963    #[prost(uint64, optional, tag = "4")]
6964    pub budget: ::core::option::Option<u64>,
6965}
6966/// A TTL for a transaction.
6967#[non_exhaustive]
6968#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6969pub struct TransactionExpiration {
6970    #[prost(
6971        enumeration = "transaction_expiration::TransactionExpirationKind",
6972        optional,
6973        tag = "1"
6974    )]
6975    pub kind: ::core::option::Option<i32>,
6976    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
6977    /// must be greater than or equal to the current epoch for a transaction to execute.
6978    #[prost(uint64, optional, tag = "2")]
6979    pub epoch: ::core::option::Option<u64>,
6980    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
6981    /// must be less than or equal to the current epoch for a transaction to execute.
6982    #[prost(uint64, optional, tag = "3")]
6983    pub min_epoch: ::core::option::Option<u64>,
6984    /// Minimal UNIX timestamp in which a transaction can be executed. The
6985    /// provided minimal timestamp must be less than or equal to the current
6986    /// clock.
6987    #[prost(message, optional, tag = "4")]
6988    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6989    /// Maximum UNIX timestamp in which a transaction can be executed. The
6990    /// provided maximal timestamp must be greater than or equal to the current
6991    /// clock.
6992    #[prost(message, optional, tag = "5")]
6993    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6994    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
6995    #[prost(string, optional, tag = "6")]
6996    pub chain: ::core::option::Option<::prost::alloc::string::String>,
6997    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
6998    #[prost(uint32, optional, tag = "7")]
6999    pub nonce: ::core::option::Option<u32>,
7000}
7001/// Nested message and enum types in `TransactionExpiration`.
7002pub mod transaction_expiration {
7003    #[non_exhaustive]
7004    #[derive(
7005        Clone,
7006        Copy,
7007        Debug,
7008        PartialEq,
7009        Eq,
7010        Hash,
7011        PartialOrd,
7012        Ord,
7013        ::prost::Enumeration
7014    )]
7015    #[repr(i32)]
7016    pub enum TransactionExpirationKind {
7017        Unknown = 0,
7018        /// The transaction has no expiration.
7019        None = 1,
7020        /// Validators won't sign and execute transaction unless the expiration epoch
7021        /// is greater than or equal to the current epoch.
7022        Epoch = 2,
7023        /// This variant enables gas payments from address balances.
7024        ///
7025        /// When transactions use address balances for gas payment instead of explicit gas coins,
7026        /// we lose the natural transaction uniqueness and replay prevention that comes from
7027        /// mutation of gas coin objects.
7028        ///
7029        /// By bounding expiration and providing a nonce, validators must only retain
7030        /// executed digests for the maximum possible expiry range to differentiate
7031        /// retries from unique transactions with otherwise identical inputs.
7032        ValidDuring = 3,
7033    }
7034    impl TransactionExpirationKind {
7035        /// String value of the enum field names used in the ProtoBuf definition.
7036        ///
7037        /// The values are not transformed in any way and thus are considered stable
7038        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7039        pub fn as_str_name(&self) -> &'static str {
7040            match self {
7041                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7042                Self::None => "NONE",
7043                Self::Epoch => "EPOCH",
7044                Self::ValidDuring => "VALID_DURING",
7045            }
7046        }
7047        /// Creates an enum from field names used in the ProtoBuf definition.
7048        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7049            match value {
7050                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7051                "NONE" => Some(Self::None),
7052                "EPOCH" => Some(Self::Epoch),
7053                "VALID_DURING" => Some(Self::ValidDuring),
7054                _ => None,
7055            }
7056        }
7057    }
7058}
7059/// Transaction type.
7060#[non_exhaustive]
7061#[derive(Clone, PartialEq, ::prost::Message)]
7062pub struct TransactionKind {
7063    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7064    pub kind: ::core::option::Option<i32>,
7065    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7066    pub data: ::core::option::Option<transaction_kind::Data>,
7067}
7068/// Nested message and enum types in `TransactionKind`.
7069pub mod transaction_kind {
7070    #[non_exhaustive]
7071    #[derive(
7072        Clone,
7073        Copy,
7074        Debug,
7075        PartialEq,
7076        Eq,
7077        Hash,
7078        PartialOrd,
7079        Ord,
7080        ::prost::Enumeration
7081    )]
7082    #[repr(i32)]
7083    pub enum Kind {
7084        Unknown = 0,
7085        /// A user transaction comprised of a list of native commands and Move calls.
7086        ProgrammableTransaction = 1,
7087        /// System transaction used to end an epoch.
7088        ///
7089        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7090        /// `EndOfEpochTransaction`).
7091        ChangeEpoch = 2,
7092        /// Transaction used to initialize the chain state.
7093        ///
7094        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7095        /// executed on the chain.
7096        Genesis = 3,
7097        /// V1 consensus commit update.
7098        ConsensusCommitPrologueV1 = 4,
7099        /// Update set of valid JWKs used for zklogin.
7100        AuthenticatorStateUpdate = 5,
7101        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7102        /// the next one.
7103        EndOfEpoch = 6,
7104        /// Randomness update.
7105        RandomnessStateUpdate = 7,
7106        /// V2 consensus commit update.
7107        ConsensusCommitPrologueV2 = 8,
7108        /// V3 consensus commit update.
7109        ConsensusCommitPrologueV3 = 9,
7110        /// V4 consensus commit update.
7111        ConsensusCommitPrologueV4 = 10,
7112    }
7113    impl Kind {
7114        /// String value of the enum field names used in the ProtoBuf definition.
7115        ///
7116        /// The values are not transformed in any way and thus are considered stable
7117        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7118        pub fn as_str_name(&self) -> &'static str {
7119            match self {
7120                Self::Unknown => "KIND_UNKNOWN",
7121                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7122                Self::ChangeEpoch => "CHANGE_EPOCH",
7123                Self::Genesis => "GENESIS",
7124                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7125                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7126                Self::EndOfEpoch => "END_OF_EPOCH",
7127                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7128                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7129                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7130                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7131            }
7132        }
7133        /// Creates an enum from field names used in the ProtoBuf definition.
7134        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7135            match value {
7136                "KIND_UNKNOWN" => Some(Self::Unknown),
7137                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7138                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7139                "GENESIS" => Some(Self::Genesis),
7140                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7141                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7142                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7143                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7144                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7145                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7146                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7147                _ => None,
7148            }
7149        }
7150    }
7151    #[non_exhaustive]
7152    #[derive(Clone, PartialEq, ::prost::Oneof)]
7153    pub enum Data {
7154        /// A transaction comprised of a list of native commands and Move calls.
7155        #[prost(message, tag = "2")]
7156        ProgrammableTransaction(super::ProgrammableTransaction),
7157        /// System transaction used to end an epoch.
7158        ///
7159        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7160        /// `EndOfEpochTransaction`).
7161        #[prost(message, tag = "3")]
7162        ChangeEpoch(super::ChangeEpoch),
7163        /// Transaction used to initialize the chain state.
7164        ///
7165        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7166        /// executed on the chain.
7167        #[prost(message, tag = "4")]
7168        Genesis(super::GenesisTransaction),
7169        /// consensus commit update info
7170        #[prost(message, tag = "5")]
7171        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7172        /// Update set of valid JWKs used for zklogin.
7173        #[prost(message, tag = "6")]
7174        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7175        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7176        /// the next one.
7177        #[prost(message, tag = "7")]
7178        EndOfEpoch(super::EndOfEpochTransaction),
7179        /// Randomness update.
7180        #[prost(message, tag = "8")]
7181        RandomnessStateUpdate(super::RandomnessStateUpdate),
7182    }
7183}
7184/// A user transaction.
7185///
7186/// Contains a series of native commands and Move calls where the results of one command can be
7187/// used in future commands.
7188#[non_exhaustive]
7189#[derive(Clone, PartialEq, ::prost::Message)]
7190pub struct ProgrammableTransaction {
7191    /// Input objects or primitive values.
7192    #[prost(message, repeated, tag = "1")]
7193    pub inputs: ::prost::alloc::vec::Vec<Input>,
7194    /// The commands to be executed sequentially. A failure in any command
7195    /// results in the failure of the entire transaction.
7196    #[prost(message, repeated, tag = "2")]
7197    pub commands: ::prost::alloc::vec::Vec<Command>,
7198}
7199/// A single command in a programmable transaction.
7200#[non_exhaustive]
7201#[derive(Clone, PartialEq, ::prost::Message)]
7202pub struct Command {
7203    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7204    pub command: ::core::option::Option<command::Command>,
7205}
7206/// Nested message and enum types in `Command`.
7207pub mod command {
7208    #[non_exhaustive]
7209    #[derive(Clone, PartialEq, ::prost::Oneof)]
7210    pub enum Command {
7211        /// A call to either an entry or a public Move function.
7212        #[prost(message, tag = "1")]
7213        MoveCall(super::MoveCall),
7214        /// `(Vec<forall T:key+store. T>, address)`
7215        /// It sends n-objects to the specified address. These objects must have store
7216        /// (public transfer) and either the previous owner must be an address or the object must
7217        /// be newly created.
7218        #[prost(message, tag = "2")]
7219        TransferObjects(super::TransferObjects),
7220        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
7221        /// It splits off some amounts into new coins with those amounts.
7222        #[prost(message, tag = "3")]
7223        SplitCoins(super::SplitCoins),
7224        /// `(&mut Coin<T>, Vec<Coin<T>>)`
7225        /// It merges n-coins into the first coin.
7226        #[prost(message, tag = "4")]
7227        MergeCoins(super::MergeCoins),
7228        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
7229        /// dependencies to link against on chain.
7230        #[prost(message, tag = "5")]
7231        Publish(super::Publish),
7232        /// `forall T: Vec<T> -> vector<T>`
7233        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
7234        /// the type tag must be specified.
7235        #[prost(message, tag = "6")]
7236        MakeMoveVector(super::MakeMoveVector),
7237        /// Upgrades a Move package.
7238        /// Takes (in order):
7239        ///
7240        /// 1. A vector of serialized modules for the package.
7241        /// 1. A vector of object ids for the transitive dependencies of the new package.
7242        /// 1. The object ID of the package being upgraded.
7243        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
7244        ///    programmable transaction.
7245        #[prost(message, tag = "7")]
7246        Upgrade(super::Upgrade),
7247    }
7248}
7249/// Command to call a Move function.
7250///
7251/// Functions that can be called by a `MoveCall` command are those that have a function signature
7252/// that is either `entry` or `public` (which don't have a reference return type).
7253#[non_exhaustive]
7254#[derive(Clone, PartialEq, ::prost::Message)]
7255pub struct MoveCall {
7256    /// The package containing the module and function.
7257    #[prost(string, optional, tag = "1")]
7258    pub package: ::core::option::Option<::prost::alloc::string::String>,
7259    /// The specific module in the package containing the function.
7260    #[prost(string, optional, tag = "2")]
7261    pub module: ::core::option::Option<::prost::alloc::string::String>,
7262    /// The function to be called.
7263    #[prost(string, optional, tag = "3")]
7264    pub function: ::core::option::Option<::prost::alloc::string::String>,
7265    /// The type arguments to the function.
7266    #[prost(string, repeated, tag = "4")]
7267    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7268    /// The arguments to the function.
7269    #[prost(message, repeated, tag = "5")]
7270    pub arguments: ::prost::alloc::vec::Vec<Argument>,
7271}
7272/// Command to transfer ownership of a set of objects to an address.
7273#[non_exhaustive]
7274#[derive(Clone, PartialEq, ::prost::Message)]
7275pub struct TransferObjects {
7276    /// Set of objects to transfer.
7277    #[prost(message, repeated, tag = "1")]
7278    pub objects: ::prost::alloc::vec::Vec<Argument>,
7279    /// The address to transfer ownership to.
7280    #[prost(message, optional, tag = "2")]
7281    pub address: ::core::option::Option<Argument>,
7282}
7283/// Command to split a single coin object into multiple coins.
7284#[non_exhaustive]
7285#[derive(Clone, PartialEq, ::prost::Message)]
7286pub struct SplitCoins {
7287    /// The coin to split.
7288    #[prost(message, optional, tag = "1")]
7289    pub coin: ::core::option::Option<Argument>,
7290    /// The amounts to split off.
7291    #[prost(message, repeated, tag = "2")]
7292    pub amounts: ::prost::alloc::vec::Vec<Argument>,
7293}
7294/// Command to merge multiple coins of the same type into a single coin.
7295#[non_exhaustive]
7296#[derive(Clone, PartialEq, ::prost::Message)]
7297pub struct MergeCoins {
7298    /// Coin to merge coins into.
7299    #[prost(message, optional, tag = "1")]
7300    pub coin: ::core::option::Option<Argument>,
7301    /// Set of coins to merge into `coin`.
7302    ///
7303    /// All listed coins must be of the same type and be the same type as `coin`
7304    #[prost(message, repeated, tag = "2")]
7305    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7306}
7307/// Command to publish a new Move package.
7308#[non_exhaustive]
7309#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7310pub struct Publish {
7311    /// The serialized Move modules.
7312    #[prost(bytes = "bytes", repeated, tag = "1")]
7313    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7314    /// Set of packages that the to-be published package depends on.
7315    #[prost(string, repeated, tag = "2")]
7316    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7317}
7318/// Command to build a Move vector out of a set of individual elements.
7319#[non_exhaustive]
7320#[derive(Clone, PartialEq, ::prost::Message)]
7321pub struct MakeMoveVector {
7322    /// Type of the individual elements.
7323    ///
7324    /// This is required to be set when the type can't be inferred, for example when the set of
7325    /// provided arguments are all pure input values.
7326    #[prost(string, optional, tag = "1")]
7327    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7328    /// The set individual elements to build the vector with.
7329    #[prost(message, repeated, tag = "2")]
7330    pub elements: ::prost::alloc::vec::Vec<Argument>,
7331}
7332/// Command to upgrade an already published package.
7333#[non_exhaustive]
7334#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7335pub struct Upgrade {
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    /// Package ID of the package to upgrade.
7343    #[prost(string, optional, tag = "3")]
7344    pub package: ::core::option::Option<::prost::alloc::string::String>,
7345    /// Ticket authorizing the upgrade.
7346    #[prost(message, optional, tag = "4")]
7347    pub ticket: ::core::option::Option<Argument>,
7348}
7349/// Randomness update.
7350#[non_exhaustive]
7351#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7352pub struct RandomnessStateUpdate {
7353    /// Epoch of the randomness state update transaction.
7354    #[prost(uint64, optional, tag = "1")]
7355    pub epoch: ::core::option::Option<u64>,
7356    /// Randomness round of the update.
7357    #[prost(uint64, optional, tag = "2")]
7358    pub randomness_round: ::core::option::Option<u64>,
7359    /// Updated random bytes.
7360    #[prost(bytes = "bytes", optional, tag = "3")]
7361    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7362    /// The initial version of the randomness object that it was shared at.
7363    #[prost(uint64, optional, tag = "4")]
7364    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7365}
7366/// System transaction used to change the epoch.
7367#[non_exhaustive]
7368#[derive(Clone, PartialEq, ::prost::Message)]
7369pub struct ChangeEpoch {
7370    /// The next (to become) epoch ID.
7371    #[prost(uint64, optional, tag = "1")]
7372    pub epoch: ::core::option::Option<u64>,
7373    /// The protocol version in effect in the new epoch.
7374    #[prost(uint64, optional, tag = "2")]
7375    pub protocol_version: ::core::option::Option<u64>,
7376    /// The total amount of gas charged for storage during the epoch.
7377    #[prost(uint64, optional, tag = "3")]
7378    pub storage_charge: ::core::option::Option<u64>,
7379    /// The total amount of gas charged for computation during the epoch.
7380    #[prost(uint64, optional, tag = "4")]
7381    pub computation_charge: ::core::option::Option<u64>,
7382    /// The amount of storage rebate refunded to the txn senders.
7383    #[prost(uint64, optional, tag = "5")]
7384    pub storage_rebate: ::core::option::Option<u64>,
7385    /// The non-refundable storage fee.
7386    #[prost(uint64, optional, tag = "6")]
7387    pub non_refundable_storage_fee: ::core::option::Option<u64>,
7388    /// Unix timestamp when epoch started.
7389    #[prost(message, optional, tag = "7")]
7390    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7391    /// System packages (specifically framework and Move stdlib) that are written before the new
7392    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
7393    /// the validator must write out the following modules.  Modules are provided with the version they
7394    /// will be upgraded to, their modules in serialized form (which include their package ID), and
7395    /// a list of their transitive dependencies.
7396    #[prost(message, repeated, tag = "8")]
7397    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7398}
7399/// System package.
7400#[non_exhaustive]
7401#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7402pub struct SystemPackage {
7403    /// Version of the package.
7404    #[prost(uint64, optional, tag = "1")]
7405    pub version: ::core::option::Option<u64>,
7406    /// Move modules.
7407    #[prost(bytes = "bytes", repeated, tag = "2")]
7408    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7409    /// Package dependencies.
7410    #[prost(string, repeated, tag = "3")]
7411    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7412}
7413/// The genesis transaction.
7414#[non_exhaustive]
7415#[derive(Clone, PartialEq, ::prost::Message)]
7416pub struct GenesisTransaction {
7417    /// Set of genesis objects.
7418    #[prost(message, repeated, tag = "1")]
7419    pub objects: ::prost::alloc::vec::Vec<Object>,
7420}
7421/// Consensus commit prologue system transaction.
7422///
7423/// This message can represent V1, V2, and V3 prologue types.
7424#[non_exhaustive]
7425#[derive(Clone, PartialEq, ::prost::Message)]
7426pub struct ConsensusCommitPrologue {
7427    /// Epoch of the commit prologue transaction.
7428    ///
7429    /// Present in V1, V2, V3, V4.
7430    #[prost(uint64, optional, tag = "1")]
7431    pub epoch: ::core::option::Option<u64>,
7432    /// Consensus round of the commit.
7433    ///
7434    /// Present in V1, V2, V3, V4.
7435    #[prost(uint64, optional, tag = "2")]
7436    pub round: ::core::option::Option<u64>,
7437    /// Unix timestamp from consensus.
7438    ///
7439    /// Present in V1, V2, V3, V4.
7440    #[prost(message, optional, tag = "3")]
7441    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7442    /// Digest of consensus output.
7443    ///
7444    /// Present in V2, V3, V4.
7445    #[prost(string, optional, tag = "4")]
7446    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7447    /// The sub DAG index of the consensus commit. This field is populated if there
7448    /// are multiple consensus commits per round.
7449    ///
7450    /// Present in V3, V4.
7451    #[prost(uint64, optional, tag = "5")]
7452    pub sub_dag_index: ::core::option::Option<u64>,
7453    /// Stores consensus handler determined consensus object version assignments.
7454    ///
7455    /// Present in V3, V4.
7456    #[prost(message, optional, tag = "6")]
7457    pub consensus_determined_version_assignments: ::core::option::Option<
7458        ConsensusDeterminedVersionAssignments,
7459    >,
7460    /// Digest of any additional state computed by the consensus handler.
7461    /// Used to detect forking bugs as early as possible.
7462    ///
7463    /// Present in V4.
7464    #[prost(string, optional, tag = "7")]
7465    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7466}
7467/// Object version assignment from consensus.
7468#[non_exhaustive]
7469#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7470pub struct VersionAssignment {
7471    /// `ObjectId` of the object.
7472    #[prost(string, optional, tag = "1")]
7473    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7474    /// start version of the consensus stream for this object
7475    #[prost(uint64, optional, tag = "2")]
7476    pub start_version: ::core::option::Option<u64>,
7477    /// Assigned version.
7478    #[prost(uint64, optional, tag = "3")]
7479    pub version: ::core::option::Option<u64>,
7480}
7481/// A transaction that was canceled.
7482#[non_exhaustive]
7483#[derive(Clone, PartialEq, ::prost::Message)]
7484pub struct CanceledTransaction {
7485    /// Digest of the canceled transaction.
7486    #[prost(string, optional, tag = "1")]
7487    pub digest: ::core::option::Option<::prost::alloc::string::String>,
7488    /// List of object version assignments.
7489    #[prost(message, repeated, tag = "2")]
7490    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7491}
7492/// Version assignments performed by consensus.
7493#[non_exhaustive]
7494#[derive(Clone, PartialEq, ::prost::Message)]
7495pub struct ConsensusDeterminedVersionAssignments {
7496    /// Version of this message
7497    #[prost(int32, optional, tag = "1")]
7498    pub version: ::core::option::Option<i32>,
7499    /// Canceled transaction version assignment.
7500    #[prost(message, repeated, tag = "3")]
7501    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7502}
7503/// Update the set of valid JWKs.
7504#[non_exhaustive]
7505#[derive(Clone, PartialEq, ::prost::Message)]
7506pub struct AuthenticatorStateUpdate {
7507    /// Epoch of the authenticator state update transaction.
7508    #[prost(uint64, optional, tag = "1")]
7509    pub epoch: ::core::option::Option<u64>,
7510    /// Consensus round of the authenticator state update.
7511    #[prost(uint64, optional, tag = "2")]
7512    pub round: ::core::option::Option<u64>,
7513    /// Newly active JWKs.
7514    #[prost(message, repeated, tag = "3")]
7515    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7516    /// The initial version of the authenticator object that it was shared at.
7517    #[prost(uint64, optional, tag = "4")]
7518    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7519}
7520/// A new JWK.
7521#[non_exhaustive]
7522#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7523pub struct ActiveJwk {
7524    /// Identifier used to uniquely identify a JWK.
7525    #[prost(message, optional, tag = "1")]
7526    pub id: ::core::option::Option<JwkId>,
7527    /// The JWK.
7528    #[prost(message, optional, tag = "2")]
7529    pub jwk: ::core::option::Option<Jwk>,
7530    /// Most recent epoch in which the JWK was validated.
7531    #[prost(uint64, optional, tag = "3")]
7532    pub epoch: ::core::option::Option<u64>,
7533}
7534/// Set of operations run at the end of the epoch to close out the current epoch
7535/// and start the next one.
7536#[non_exhaustive]
7537#[derive(Clone, PartialEq, ::prost::Message)]
7538pub struct EndOfEpochTransaction {
7539    #[prost(message, repeated, tag = "1")]
7540    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7541}
7542/// Operation run at the end of an epoch.
7543#[non_exhaustive]
7544#[derive(Clone, PartialEq, ::prost::Message)]
7545pub struct EndOfEpochTransactionKind {
7546    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7547    pub kind: ::core::option::Option<i32>,
7548    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7549    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7550}
7551/// Nested message and enum types in `EndOfEpochTransactionKind`.
7552pub mod end_of_epoch_transaction_kind {
7553    #[non_exhaustive]
7554    #[derive(
7555        Clone,
7556        Copy,
7557        Debug,
7558        PartialEq,
7559        Eq,
7560        Hash,
7561        PartialOrd,
7562        Ord,
7563        ::prost::Enumeration
7564    )]
7565    #[repr(i32)]
7566    pub enum Kind {
7567        Unknown = 0,
7568        /// End the epoch and start the next one.
7569        ChangeEpoch = 1,
7570        /// Create and initialize the authenticator object used for zklogin.
7571        AuthenticatorStateCreate = 2,
7572        /// Expire JWKs used for zklogin.
7573        AuthenticatorStateExpire = 3,
7574        /// Create and initialize the randomness object.
7575        RandomnessStateCreate = 4,
7576        /// Create and initialize the deny list object.
7577        DenyListStateCreate = 5,
7578        /// Create and initialize the bridge object.
7579        BridgeStateCreate = 6,
7580        /// Initialize the bridge committee.
7581        BridgeCommitteeInit = 7,
7582        /// Execution time observations from the committee to preserve cross epoch
7583        StoreExecutionTimeObservations = 8,
7584        /// Create the accumulator root object.
7585        AccumulatorRootCreate = 9,
7586        /// Create and initialize the Coin Registry object.
7587        CoinRegistryCreate = 10,
7588        /// Create and initialize the Display Registry object.
7589        DisplayRegistryCreate = 11,
7590        /// Create and initialize the Address Alias State object.
7591        AddressAliasStateCreate = 12,
7592    }
7593    impl Kind {
7594        /// String value of the enum field names used in the ProtoBuf definition.
7595        ///
7596        /// The values are not transformed in any way and thus are considered stable
7597        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7598        pub fn as_str_name(&self) -> &'static str {
7599            match self {
7600                Self::Unknown => "KIND_UNKNOWN",
7601                Self::ChangeEpoch => "CHANGE_EPOCH",
7602                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7603                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7604                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7605                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7606                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7607                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7608                Self::StoreExecutionTimeObservations => {
7609                    "STORE_EXECUTION_TIME_OBSERVATIONS"
7610                }
7611                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7612                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7613                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7614                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7615            }
7616        }
7617        /// Creates an enum from field names used in the ProtoBuf definition.
7618        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7619            match value {
7620                "KIND_UNKNOWN" => Some(Self::Unknown),
7621                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7622                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7623                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7624                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7625                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7626                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7627                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7628                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7629                    Some(Self::StoreExecutionTimeObservations)
7630                }
7631                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7632                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7633                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7634                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7635                _ => None,
7636            }
7637        }
7638    }
7639    #[non_exhaustive]
7640    #[derive(Clone, PartialEq, ::prost::Oneof)]
7641    pub enum Data {
7642        /// End the epoch and start the next one.
7643        #[prost(message, tag = "2")]
7644        ChangeEpoch(super::ChangeEpoch),
7645        /// Expire JWKs used for zklogin.
7646        #[prost(message, tag = "3")]
7647        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7648        /// Execution time observations from the committee to preserve cross epoch
7649        #[prost(message, tag = "4")]
7650        ExecutionTimeObservations(super::ExecutionTimeObservations),
7651        /// ChainId used when initializing the bridge
7652        #[prost(string, tag = "5")]
7653        BridgeChainId(::prost::alloc::string::String),
7654        /// Start version of the Bridge object
7655        #[prost(uint64, tag = "6")]
7656        BridgeObjectVersion(u64),
7657    }
7658}
7659/// Expire old JWKs.
7660#[non_exhaustive]
7661#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7662pub struct AuthenticatorStateExpire {
7663    /// Expire JWKs that have a lower epoch than this.
7664    #[prost(uint64, optional, tag = "1")]
7665    pub min_epoch: ::core::option::Option<u64>,
7666    /// The initial version of the authenticator object that it was shared at.
7667    #[prost(uint64, optional, tag = "2")]
7668    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7669}
7670#[non_exhaustive]
7671#[derive(Clone, PartialEq, ::prost::Message)]
7672pub struct ExecutionTimeObservations {
7673    /// Version of this ExecutionTimeObservations
7674    #[prost(int32, optional, tag = "1")]
7675    pub version: ::core::option::Option<i32>,
7676    #[prost(message, repeated, tag = "2")]
7677    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7678}
7679#[non_exhaustive]
7680#[derive(Clone, PartialEq, ::prost::Message)]
7681pub struct ExecutionTimeObservation {
7682    #[prost(
7683        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7684        optional,
7685        tag = "1"
7686    )]
7687    pub kind: ::core::option::Option<i32>,
7688    #[prost(message, optional, tag = "2")]
7689    pub move_entry_point: ::core::option::Option<MoveCall>,
7690    #[prost(message, repeated, tag = "3")]
7691    pub validator_observations: ::prost::alloc::vec::Vec<
7692        ValidatorExecutionTimeObservation,
7693    >,
7694}
7695/// Nested message and enum types in `ExecutionTimeObservation`.
7696pub mod execution_time_observation {
7697    #[non_exhaustive]
7698    #[derive(
7699        Clone,
7700        Copy,
7701        Debug,
7702        PartialEq,
7703        Eq,
7704        Hash,
7705        PartialOrd,
7706        Ord,
7707        ::prost::Enumeration
7708    )]
7709    #[repr(i32)]
7710    pub enum ExecutionTimeObservationKind {
7711        Unknown = 0,
7712        MoveEntryPoint = 1,
7713        TransferObjects = 2,
7714        SplitCoins = 3,
7715        MergeCoins = 4,
7716        Publish = 5,
7717        MakeMoveVector = 6,
7718        Upgrade = 7,
7719    }
7720    impl ExecutionTimeObservationKind {
7721        /// String value of the enum field names used in the ProtoBuf definition.
7722        ///
7723        /// The values are not transformed in any way and thus are considered stable
7724        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7725        pub fn as_str_name(&self) -> &'static str {
7726            match self {
7727                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7728                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7729                Self::TransferObjects => "TRANSFER_OBJECTS",
7730                Self::SplitCoins => "SPLIT_COINS",
7731                Self::MergeCoins => "MERGE_COINS",
7732                Self::Publish => "PUBLISH",
7733                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7734                Self::Upgrade => "UPGRADE",
7735            }
7736        }
7737        /// Creates an enum from field names used in the ProtoBuf definition.
7738        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7739            match value {
7740                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7741                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7742                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7743                "SPLIT_COINS" => Some(Self::SplitCoins),
7744                "MERGE_COINS" => Some(Self::MergeCoins),
7745                "PUBLISH" => Some(Self::Publish),
7746                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7747                "UPGRADE" => Some(Self::Upgrade),
7748                _ => None,
7749            }
7750        }
7751    }
7752}
7753#[non_exhaustive]
7754#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7755pub struct ValidatorExecutionTimeObservation {
7756    /// Bls12381 public key of the validator
7757    #[prost(bytes = "bytes", optional, tag = "1")]
7758    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7759    /// Duration of an execution observation
7760    #[prost(message, optional, tag = "2")]
7761    pub duration: ::core::option::Option<::prost_types::Duration>,
7762}
7763#[non_exhaustive]
7764#[derive(Clone, PartialEq, ::prost::Message)]
7765pub struct ExecuteTransactionRequest {
7766    /// The transaction to execute.
7767    #[prost(message, optional, tag = "1")]
7768    pub transaction: ::core::option::Option<Transaction>,
7769    /// Set of `UserSignature`s authorizing the execution of the provided
7770    /// transaction.
7771    #[prost(message, repeated, tag = "2")]
7772    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7773    /// Mask specifying which fields to read.
7774    /// If no mask is specified, defaults to `effects.status,checkpoint`.
7775    #[prost(message, optional, tag = "3")]
7776    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7777}
7778/// Response message for `NodeService.ExecuteTransaction`.
7779#[non_exhaustive]
7780#[derive(Clone, PartialEq, ::prost::Message)]
7781pub struct ExecuteTransactionResponse {
7782    #[prost(message, optional, tag = "1")]
7783    pub transaction: ::core::option::Option<ExecutedTransaction>,
7784}
7785#[non_exhaustive]
7786#[derive(Clone, PartialEq, ::prost::Message)]
7787pub struct SimulateTransactionRequest {
7788    #[prost(message, optional, tag = "1")]
7789    pub transaction: ::core::option::Option<Transaction>,
7790    /// Mask specifying which fields to read.
7791    #[prost(message, optional, tag = "2")]
7792    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7793    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
7794    #[prost(
7795        enumeration = "simulate_transaction_request::TransactionChecks",
7796        optional,
7797        tag = "3"
7798    )]
7799    pub checks: ::core::option::Option<i32>,
7800    /// Perform gas selection based on a budget estimation and include the
7801    /// selected gas payment and budget in the response.
7802    ///
7803    /// This option will be ignored if `checks` is `DISABLED`.
7804    #[prost(bool, optional, tag = "4")]
7805    pub do_gas_selection: ::core::option::Option<bool>,
7806}
7807/// Nested message and enum types in `SimulateTransactionRequest`.
7808pub mod simulate_transaction_request {
7809    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
7810    #[non_exhaustive]
7811    #[derive(
7812        Clone,
7813        Copy,
7814        Debug,
7815        PartialEq,
7816        Eq,
7817        Hash,
7818        PartialOrd,
7819        Ord,
7820        ::prost::Enumeration
7821    )]
7822    #[repr(i32)]
7823    pub enum TransactionChecks {
7824        Enabled = 0,
7825        Disabled = 1,
7826    }
7827    impl TransactionChecks {
7828        /// String value of the enum field names used in the ProtoBuf definition.
7829        ///
7830        /// The values are not transformed in any way and thus are considered stable
7831        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7832        pub fn as_str_name(&self) -> &'static str {
7833            match self {
7834                Self::Enabled => "ENABLED",
7835                Self::Disabled => "DISABLED",
7836            }
7837        }
7838        /// Creates an enum from field names used in the ProtoBuf definition.
7839        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7840            match value {
7841                "ENABLED" => Some(Self::Enabled),
7842                "DISABLED" => Some(Self::Disabled),
7843                _ => None,
7844            }
7845        }
7846    }
7847}
7848#[non_exhaustive]
7849#[derive(Clone, PartialEq, ::prost::Message)]
7850pub struct SimulateTransactionResponse {
7851    #[prost(message, optional, tag = "1")]
7852    pub transaction: ::core::option::Option<ExecutedTransaction>,
7853    #[prost(message, repeated, tag = "2")]
7854    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7855}
7856/// An intermediate result/output from the execution of a single command
7857#[non_exhaustive]
7858#[derive(Clone, PartialEq, ::prost::Message)]
7859pub struct CommandResult {
7860    #[prost(message, repeated, tag = "1")]
7861    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7862    #[prost(message, repeated, tag = "2")]
7863    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7864}
7865#[non_exhaustive]
7866#[derive(Clone, PartialEq, ::prost::Message)]
7867pub struct CommandOutput {
7868    #[prost(message, optional, tag = "1")]
7869    pub argument: ::core::option::Option<Argument>,
7870    #[prost(message, optional, tag = "2")]
7871    pub value: ::core::option::Option<Bcs>,
7872    /// JSON rendering of the output.
7873    #[prost(message, optional, boxed, tag = "3")]
7874    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7875}
7876/// Generated client implementations.
7877pub mod transaction_execution_service_client {
7878    #![allow(
7879        unused_variables,
7880        dead_code,
7881        missing_docs,
7882        clippy::wildcard_imports,
7883        clippy::let_unit_value,
7884    )]
7885    use tonic::codegen::*;
7886    use tonic::codegen::http::Uri;
7887    #[derive(Debug, Clone)]
7888    pub struct TransactionExecutionServiceClient<T> {
7889        inner: tonic::client::Grpc<T>,
7890    }
7891    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7892        /// Attempt to create a new client by connecting to a given endpoint.
7893        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7894        where
7895            D: TryInto<tonic::transport::Endpoint>,
7896            D::Error: Into<StdError>,
7897        {
7898            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7899            Ok(Self::new(conn))
7900        }
7901    }
7902    impl<T> TransactionExecutionServiceClient<T>
7903    where
7904        T: tonic::client::GrpcService<tonic::body::Body>,
7905        T::Error: Into<StdError>,
7906        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7907        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7908    {
7909        pub fn new(inner: T) -> Self {
7910            let inner = tonic::client::Grpc::new(inner);
7911            Self { inner }
7912        }
7913        pub fn with_origin(inner: T, origin: Uri) -> Self {
7914            let inner = tonic::client::Grpc::with_origin(inner, origin);
7915            Self { inner }
7916        }
7917        pub fn with_interceptor<F>(
7918            inner: T,
7919            interceptor: F,
7920        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7921        where
7922            F: tonic::service::Interceptor,
7923            T::ResponseBody: Default,
7924            T: tonic::codegen::Service<
7925                http::Request<tonic::body::Body>,
7926                Response = http::Response<
7927                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7928                >,
7929            >,
7930            <T as tonic::codegen::Service<
7931                http::Request<tonic::body::Body>,
7932            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7933        {
7934            TransactionExecutionServiceClient::new(
7935                InterceptedService::new(inner, interceptor),
7936            )
7937        }
7938        /// Compress requests with the given encoding.
7939        ///
7940        /// This requires the server to support it otherwise it might respond with an
7941        /// error.
7942        #[must_use]
7943        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7944            self.inner = self.inner.send_compressed(encoding);
7945            self
7946        }
7947        /// Enable decompressing responses.
7948        #[must_use]
7949        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7950            self.inner = self.inner.accept_compressed(encoding);
7951            self
7952        }
7953        /// Limits the maximum size of a decoded message.
7954        ///
7955        /// Default: `4MB`
7956        #[must_use]
7957        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7958            self.inner = self.inner.max_decoding_message_size(limit);
7959            self
7960        }
7961        /// Limits the maximum size of an encoded message.
7962        ///
7963        /// Default: `usize::MAX`
7964        #[must_use]
7965        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7966            self.inner = self.inner.max_encoding_message_size(limit);
7967            self
7968        }
7969        pub async fn execute_transaction(
7970            &mut self,
7971            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7972        ) -> std::result::Result<
7973            tonic::Response<super::ExecuteTransactionResponse>,
7974            tonic::Status,
7975        > {
7976            self.inner
7977                .ready()
7978                .await
7979                .map_err(|e| {
7980                    tonic::Status::unknown(
7981                        format!("Service was not ready: {}", e.into()),
7982                    )
7983                })?;
7984            let codec = tonic_prost::ProstCodec::default();
7985            let path = http::uri::PathAndQuery::from_static(
7986                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7987            );
7988            let mut req = request.into_request();
7989            req.extensions_mut()
7990                .insert(
7991                    GrpcMethod::new(
7992                        "sui.rpc.v2.TransactionExecutionService",
7993                        "ExecuteTransaction",
7994                    ),
7995                );
7996            self.inner.unary(req, path, codec).await
7997        }
7998        pub async fn simulate_transaction(
7999            &mut self,
8000            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
8001        ) -> std::result::Result<
8002            tonic::Response<super::SimulateTransactionResponse>,
8003            tonic::Status,
8004        > {
8005            self.inner
8006                .ready()
8007                .await
8008                .map_err(|e| {
8009                    tonic::Status::unknown(
8010                        format!("Service was not ready: {}", e.into()),
8011                    )
8012                })?;
8013            let codec = tonic_prost::ProstCodec::default();
8014            let path = http::uri::PathAndQuery::from_static(
8015                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8016            );
8017            let mut req = request.into_request();
8018            req.extensions_mut()
8019                .insert(
8020                    GrpcMethod::new(
8021                        "sui.rpc.v2.TransactionExecutionService",
8022                        "SimulateTransaction",
8023                    ),
8024                );
8025            self.inner.unary(req, path, codec).await
8026        }
8027    }
8028}
8029/// Generated server implementations.
8030pub mod transaction_execution_service_server {
8031    #![allow(
8032        unused_variables,
8033        dead_code,
8034        missing_docs,
8035        clippy::wildcard_imports,
8036        clippy::let_unit_value,
8037    )]
8038    use tonic::codegen::*;
8039    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
8040    #[async_trait]
8041    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8042        async fn execute_transaction(
8043            &self,
8044            request: tonic::Request<super::ExecuteTransactionRequest>,
8045        ) -> std::result::Result<
8046            tonic::Response<super::ExecuteTransactionResponse>,
8047            tonic::Status,
8048        >;
8049        async fn simulate_transaction(
8050            &self,
8051            request: tonic::Request<super::SimulateTransactionRequest>,
8052        ) -> std::result::Result<
8053            tonic::Response<super::SimulateTransactionResponse>,
8054            tonic::Status,
8055        >;
8056    }
8057    #[derive(Debug)]
8058    pub struct TransactionExecutionServiceServer<T> {
8059        inner: Arc<T>,
8060        accept_compression_encodings: EnabledCompressionEncodings,
8061        send_compression_encodings: EnabledCompressionEncodings,
8062        max_decoding_message_size: Option<usize>,
8063        max_encoding_message_size: Option<usize>,
8064    }
8065    impl<T> TransactionExecutionServiceServer<T> {
8066        pub fn new(inner: T) -> Self {
8067            Self::from_arc(Arc::new(inner))
8068        }
8069        pub fn from_arc(inner: Arc<T>) -> Self {
8070            Self {
8071                inner,
8072                accept_compression_encodings: Default::default(),
8073                send_compression_encodings: Default::default(),
8074                max_decoding_message_size: None,
8075                max_encoding_message_size: None,
8076            }
8077        }
8078        pub fn with_interceptor<F>(
8079            inner: T,
8080            interceptor: F,
8081        ) -> InterceptedService<Self, F>
8082        where
8083            F: tonic::service::Interceptor,
8084        {
8085            InterceptedService::new(Self::new(inner), interceptor)
8086        }
8087        /// Enable decompressing requests with the given encoding.
8088        #[must_use]
8089        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8090            self.accept_compression_encodings.enable(encoding);
8091            self
8092        }
8093        /// Compress responses with the given encoding, if the client supports it.
8094        #[must_use]
8095        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8096            self.send_compression_encodings.enable(encoding);
8097            self
8098        }
8099        /// Limits the maximum size of a decoded message.
8100        ///
8101        /// Default: `4MB`
8102        #[must_use]
8103        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8104            self.max_decoding_message_size = Some(limit);
8105            self
8106        }
8107        /// Limits the maximum size of an encoded message.
8108        ///
8109        /// Default: `usize::MAX`
8110        #[must_use]
8111        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8112            self.max_encoding_message_size = Some(limit);
8113            self
8114        }
8115    }
8116    impl<T, B> tonic::codegen::Service<http::Request<B>>
8117    for TransactionExecutionServiceServer<T>
8118    where
8119        T: TransactionExecutionService,
8120        B: Body + std::marker::Send + 'static,
8121        B::Error: Into<StdError> + std::marker::Send + 'static,
8122    {
8123        type Response = http::Response<tonic::body::Body>;
8124        type Error = std::convert::Infallible;
8125        type Future = BoxFuture<Self::Response, Self::Error>;
8126        fn poll_ready(
8127            &mut self,
8128            _cx: &mut Context<'_>,
8129        ) -> Poll<std::result::Result<(), Self::Error>> {
8130            Poll::Ready(Ok(()))
8131        }
8132        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8133            match req.uri().path() {
8134                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8135                    #[allow(non_camel_case_types)]
8136                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8137                        pub Arc<T>,
8138                    );
8139                    impl<
8140                        T: TransactionExecutionService,
8141                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8142                    for ExecuteTransactionSvc<T> {
8143                        type Response = super::ExecuteTransactionResponse;
8144                        type Future = BoxFuture<
8145                            tonic::Response<Self::Response>,
8146                            tonic::Status,
8147                        >;
8148                        fn call(
8149                            &mut self,
8150                            request: tonic::Request<super::ExecuteTransactionRequest>,
8151                        ) -> Self::Future {
8152                            let inner = Arc::clone(&self.0);
8153                            let fut = async move {
8154                                <T as TransactionExecutionService>::execute_transaction(
8155                                        &inner,
8156                                        request,
8157                                    )
8158                                    .await
8159                            };
8160                            Box::pin(fut)
8161                        }
8162                    }
8163                    let accept_compression_encodings = self.accept_compression_encodings;
8164                    let send_compression_encodings = self.send_compression_encodings;
8165                    let max_decoding_message_size = self.max_decoding_message_size;
8166                    let max_encoding_message_size = self.max_encoding_message_size;
8167                    let inner = self.inner.clone();
8168                    let fut = async move {
8169                        let method = ExecuteTransactionSvc(inner);
8170                        let codec = tonic_prost::ProstCodec::default();
8171                        let mut grpc = tonic::server::Grpc::new(codec)
8172                            .apply_compression_config(
8173                                accept_compression_encodings,
8174                                send_compression_encodings,
8175                            )
8176                            .apply_max_message_size_config(
8177                                max_decoding_message_size,
8178                                max_encoding_message_size,
8179                            );
8180                        let res = grpc.unary(method, req).await;
8181                        Ok(res)
8182                    };
8183                    Box::pin(fut)
8184                }
8185                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8186                    #[allow(non_camel_case_types)]
8187                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
8188                        pub Arc<T>,
8189                    );
8190                    impl<
8191                        T: TransactionExecutionService,
8192                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
8193                    for SimulateTransactionSvc<T> {
8194                        type Response = super::SimulateTransactionResponse;
8195                        type Future = BoxFuture<
8196                            tonic::Response<Self::Response>,
8197                            tonic::Status,
8198                        >;
8199                        fn call(
8200                            &mut self,
8201                            request: tonic::Request<super::SimulateTransactionRequest>,
8202                        ) -> Self::Future {
8203                            let inner = Arc::clone(&self.0);
8204                            let fut = async move {
8205                                <T as TransactionExecutionService>::simulate_transaction(
8206                                        &inner,
8207                                        request,
8208                                    )
8209                                    .await
8210                            };
8211                            Box::pin(fut)
8212                        }
8213                    }
8214                    let accept_compression_encodings = self.accept_compression_encodings;
8215                    let send_compression_encodings = self.send_compression_encodings;
8216                    let max_decoding_message_size = self.max_decoding_message_size;
8217                    let max_encoding_message_size = self.max_encoding_message_size;
8218                    let inner = self.inner.clone();
8219                    let fut = async move {
8220                        let method = SimulateTransactionSvc(inner);
8221                        let codec = tonic_prost::ProstCodec::default();
8222                        let mut grpc = tonic::server::Grpc::new(codec)
8223                            .apply_compression_config(
8224                                accept_compression_encodings,
8225                                send_compression_encodings,
8226                            )
8227                            .apply_max_message_size_config(
8228                                max_decoding_message_size,
8229                                max_encoding_message_size,
8230                            );
8231                        let res = grpc.unary(method, req).await;
8232                        Ok(res)
8233                    };
8234                    Box::pin(fut)
8235                }
8236                _ => {
8237                    Box::pin(async move {
8238                        let mut response = http::Response::new(
8239                            tonic::body::Body::default(),
8240                        );
8241                        let headers = response.headers_mut();
8242                        headers
8243                            .insert(
8244                                tonic::Status::GRPC_STATUS,
8245                                (tonic::Code::Unimplemented as i32).into(),
8246                            );
8247                        headers
8248                            .insert(
8249                                http::header::CONTENT_TYPE,
8250                                tonic::metadata::GRPC_CONTENT_TYPE,
8251                            );
8252                        Ok(response)
8253                    })
8254                }
8255            }
8256        }
8257    }
8258    impl<T> Clone for TransactionExecutionServiceServer<T> {
8259        fn clone(&self) -> Self {
8260            let inner = self.inner.clone();
8261            Self {
8262                inner,
8263                accept_compression_encodings: self.accept_compression_encodings,
8264                send_compression_encodings: self.send_compression_encodings,
8265                max_decoding_message_size: self.max_decoding_message_size,
8266                max_encoding_message_size: self.max_encoding_message_size,
8267            }
8268        }
8269    }
8270    /// Generated gRPC service name
8271    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8272    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8273        const NAME: &'static str = SERVICE_NAME;
8274    }
8275}