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    /// Shows the total balance of the coin in its smallest unit.
5424    #[prost(uint64, optional, tag = "3")]
5425    pub balance: ::core::option::Option<u64>,
5426}
5427/// Request message for `NodeService.ListDynamicFields`
5428#[non_exhaustive]
5429#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5430pub struct ListDynamicFieldsRequest {
5431    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
5432    #[prost(string, optional, tag = "1")]
5433    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5434    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
5435    /// If unspecified, at most `50` entries will be returned.
5436    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5437    #[prost(uint32, optional, tag = "2")]
5438    pub page_size: ::core::option::Option<u32>,
5439    /// A page token, received from a previous `ListDynamicFields` call.
5440    /// Provide this to retrieve the subsequent page.
5441    ///
5442    /// When paginating, all other parameters provided to `ListDynamicFields` must
5443    /// match the call that provided the page token.
5444    #[prost(bytes = "bytes", optional, tag = "3")]
5445    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5446    /// Mask specifying which fields to read.
5447    /// If no mask is specified, defaults to `parent,field_id`.
5448    #[prost(message, optional, tag = "4")]
5449    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5450}
5451/// Response message for `NodeService.ListDynamicFields`
5452#[non_exhaustive]
5453#[derive(Clone, PartialEq, ::prost::Message)]
5454pub struct ListDynamicFieldsResponse {
5455    /// Page of dynamic fields owned by the specified parent.
5456    #[prost(message, repeated, tag = "1")]
5457    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
5458    /// A token, which can be sent as `page_token` to retrieve the next page.
5459    /// If this field is omitted, there are no subsequent pages.
5460    #[prost(bytes = "bytes", optional, tag = "2")]
5461    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5462}
5463#[non_exhaustive]
5464#[derive(Clone, PartialEq, ::prost::Message)]
5465pub struct DynamicField {
5466    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
5467    pub kind: ::core::option::Option<i32>,
5468    /// ObjectId of this dynamic field's parent.
5469    #[prost(string, optional, tag = "2")]
5470    pub parent: ::core::option::Option<::prost::alloc::string::String>,
5471    /// ObjectId of this dynamic field.
5472    #[prost(string, optional, tag = "3")]
5473    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
5474    /// The field object itself
5475    #[prost(message, optional, tag = "4")]
5476    pub field_object: ::core::option::Option<Object>,
5477    /// The dynamic field's "name"
5478    #[prost(message, optional, tag = "5")]
5479    pub name: ::core::option::Option<Bcs>,
5480    /// The dynamic field's "value"
5481    #[prost(message, optional, tag = "6")]
5482    pub value: ::core::option::Option<Bcs>,
5483    /// The type of the dynamic field "value".
5484    ///
5485    /// If this is a dynamic object field then this is the type of the object
5486    /// itself (which is a child of this field), otherwise this is the type of the
5487    /// value of this field.
5488    #[prost(string, optional, tag = "7")]
5489    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
5490    /// The ObjectId of the child object when a child is a dynamic
5491    /// object field.
5492    ///
5493    /// The presence or absence of this field can be used to determine if a child
5494    /// is a dynamic field or a dynamic child object
5495    #[prost(string, optional, tag = "8")]
5496    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
5497    /// The object itself when a child is a dynamic object field.
5498    #[prost(message, optional, tag = "9")]
5499    pub child_object: ::core::option::Option<Object>,
5500}
5501/// Nested message and enum types in `DynamicField`.
5502pub mod dynamic_field {
5503    #[non_exhaustive]
5504    #[derive(
5505        Clone,
5506        Copy,
5507        Debug,
5508        PartialEq,
5509        Eq,
5510        Hash,
5511        PartialOrd,
5512        Ord,
5513        ::prost::Enumeration
5514    )]
5515    #[repr(i32)]
5516    pub enum DynamicFieldKind {
5517        Unknown = 0,
5518        Field = 1,
5519        Object = 2,
5520    }
5521    impl DynamicFieldKind {
5522        /// String value of the enum field names used in the ProtoBuf definition.
5523        ///
5524        /// The values are not transformed in any way and thus are considered stable
5525        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5526        pub fn as_str_name(&self) -> &'static str {
5527            match self {
5528                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
5529                Self::Field => "FIELD",
5530                Self::Object => "OBJECT",
5531            }
5532        }
5533        /// Creates an enum from field names used in the ProtoBuf definition.
5534        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5535            match value {
5536                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
5537                "FIELD" => Some(Self::Field),
5538                "OBJECT" => Some(Self::Object),
5539                _ => None,
5540            }
5541        }
5542    }
5543}
5544#[non_exhaustive]
5545#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5546pub struct ListOwnedObjectsRequest {
5547    /// Required. The address of the account that owns the objects.
5548    #[prost(string, optional, tag = "1")]
5549    pub owner: ::core::option::Option<::prost::alloc::string::String>,
5550    /// The maximum number of entries return. The service may return fewer than this value.
5551    /// If unspecified, at most `50` entries will be returned.
5552    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
5553    #[prost(uint32, optional, tag = "2")]
5554    pub page_size: ::core::option::Option<u32>,
5555    /// A page token, received from a previous `ListOwnedObjects` call.
5556    /// Provide this to retrieve the subsequent page.
5557    ///
5558    /// When paginating, all other parameters provided to `ListOwnedObjects` must
5559    /// match the call that provided the page token.
5560    #[prost(bytes = "bytes", optional, tag = "3")]
5561    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
5562    /// Mask specifying which fields to read.
5563    /// If no mask is specified, defaults to `object_id,version,object_type`.
5564    #[prost(message, optional, tag = "4")]
5565    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
5566    /// Optional type filter to limit the types of objects listed.
5567    ///
5568    /// Providing an object type with no type params will return objects of that
5569    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
5570    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
5571    /// with a type param will restrict the returned objects to only those objects
5572    /// that match the provided type parameters, e.g.
5573    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
5574    #[prost(string, optional, tag = "5")]
5575    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5576}
5577#[non_exhaustive]
5578#[derive(Clone, PartialEq, ::prost::Message)]
5579pub struct ListOwnedObjectsResponse {
5580    /// Page of dynamic fields owned by the specified parent.
5581    #[prost(message, repeated, tag = "1")]
5582    pub objects: ::prost::alloc::vec::Vec<Object>,
5583    /// A token, which can be sent as `page_token` to retrieve the next page.
5584    /// If this field is omitted, there are no subsequent pages.
5585    #[prost(bytes = "bytes", optional, tag = "2")]
5586    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
5587}
5588/// Generated client implementations.
5589pub mod state_service_client {
5590    #![allow(
5591        unused_variables,
5592        dead_code,
5593        missing_docs,
5594        clippy::wildcard_imports,
5595        clippy::let_unit_value,
5596    )]
5597    use tonic::codegen::*;
5598    use tonic::codegen::http::Uri;
5599    #[derive(Debug, Clone)]
5600    pub struct StateServiceClient<T> {
5601        inner: tonic::client::Grpc<T>,
5602    }
5603    impl StateServiceClient<tonic::transport::Channel> {
5604        /// Attempt to create a new client by connecting to a given endpoint.
5605        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5606        where
5607            D: TryInto<tonic::transport::Endpoint>,
5608            D::Error: Into<StdError>,
5609        {
5610            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5611            Ok(Self::new(conn))
5612        }
5613    }
5614    impl<T> StateServiceClient<T>
5615    where
5616        T: tonic::client::GrpcService<tonic::body::Body>,
5617        T::Error: Into<StdError>,
5618        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5619        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5620    {
5621        pub fn new(inner: T) -> Self {
5622            let inner = tonic::client::Grpc::new(inner);
5623            Self { inner }
5624        }
5625        pub fn with_origin(inner: T, origin: Uri) -> Self {
5626            let inner = tonic::client::Grpc::with_origin(inner, origin);
5627            Self { inner }
5628        }
5629        pub fn with_interceptor<F>(
5630            inner: T,
5631            interceptor: F,
5632        ) -> StateServiceClient<InterceptedService<T, F>>
5633        where
5634            F: tonic::service::Interceptor,
5635            T::ResponseBody: Default,
5636            T: tonic::codegen::Service<
5637                http::Request<tonic::body::Body>,
5638                Response = http::Response<
5639                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5640                >,
5641            >,
5642            <T as tonic::codegen::Service<
5643                http::Request<tonic::body::Body>,
5644            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5645        {
5646            StateServiceClient::new(InterceptedService::new(inner, interceptor))
5647        }
5648        /// Compress requests with the given encoding.
5649        ///
5650        /// This requires the server to support it otherwise it might respond with an
5651        /// error.
5652        #[must_use]
5653        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5654            self.inner = self.inner.send_compressed(encoding);
5655            self
5656        }
5657        /// Enable decompressing responses.
5658        #[must_use]
5659        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5660            self.inner = self.inner.accept_compressed(encoding);
5661            self
5662        }
5663        /// Limits the maximum size of a decoded message.
5664        ///
5665        /// Default: `4MB`
5666        #[must_use]
5667        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5668            self.inner = self.inner.max_decoding_message_size(limit);
5669            self
5670        }
5671        /// Limits the maximum size of an encoded message.
5672        ///
5673        /// Default: `usize::MAX`
5674        #[must_use]
5675        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5676            self.inner = self.inner.max_encoding_message_size(limit);
5677            self
5678        }
5679        pub async fn list_dynamic_fields(
5680            &mut self,
5681            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
5682        ) -> std::result::Result<
5683            tonic::Response<super::ListDynamicFieldsResponse>,
5684            tonic::Status,
5685        > {
5686            self.inner
5687                .ready()
5688                .await
5689                .map_err(|e| {
5690                    tonic::Status::unknown(
5691                        format!("Service was not ready: {}", e.into()),
5692                    )
5693                })?;
5694            let codec = tonic_prost::ProstCodec::default();
5695            let path = http::uri::PathAndQuery::from_static(
5696                "/sui.rpc.v2.StateService/ListDynamicFields",
5697            );
5698            let mut req = request.into_request();
5699            req.extensions_mut()
5700                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
5701            self.inner.unary(req, path, codec).await
5702        }
5703        pub async fn list_owned_objects(
5704            &mut self,
5705            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
5706        ) -> std::result::Result<
5707            tonic::Response<super::ListOwnedObjectsResponse>,
5708            tonic::Status,
5709        > {
5710            self.inner
5711                .ready()
5712                .await
5713                .map_err(|e| {
5714                    tonic::Status::unknown(
5715                        format!("Service was not ready: {}", e.into()),
5716                    )
5717                })?;
5718            let codec = tonic_prost::ProstCodec::default();
5719            let path = http::uri::PathAndQuery::from_static(
5720                "/sui.rpc.v2.StateService/ListOwnedObjects",
5721            );
5722            let mut req = request.into_request();
5723            req.extensions_mut()
5724                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
5725            self.inner.unary(req, path, codec).await
5726        }
5727        pub async fn get_coin_info(
5728            &mut self,
5729            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
5730        ) -> std::result::Result<
5731            tonic::Response<super::GetCoinInfoResponse>,
5732            tonic::Status,
5733        > {
5734            self.inner
5735                .ready()
5736                .await
5737                .map_err(|e| {
5738                    tonic::Status::unknown(
5739                        format!("Service was not ready: {}", e.into()),
5740                    )
5741                })?;
5742            let codec = tonic_prost::ProstCodec::default();
5743            let path = http::uri::PathAndQuery::from_static(
5744                "/sui.rpc.v2.StateService/GetCoinInfo",
5745            );
5746            let mut req = request.into_request();
5747            req.extensions_mut()
5748                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
5749            self.inner.unary(req, path, codec).await
5750        }
5751        pub async fn get_balance(
5752            &mut self,
5753            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
5754        ) -> std::result::Result<
5755            tonic::Response<super::GetBalanceResponse>,
5756            tonic::Status,
5757        > {
5758            self.inner
5759                .ready()
5760                .await
5761                .map_err(|e| {
5762                    tonic::Status::unknown(
5763                        format!("Service was not ready: {}", e.into()),
5764                    )
5765                })?;
5766            let codec = tonic_prost::ProstCodec::default();
5767            let path = http::uri::PathAndQuery::from_static(
5768                "/sui.rpc.v2.StateService/GetBalance",
5769            );
5770            let mut req = request.into_request();
5771            req.extensions_mut()
5772                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
5773            self.inner.unary(req, path, codec).await
5774        }
5775        pub async fn list_balances(
5776            &mut self,
5777            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
5778        ) -> std::result::Result<
5779            tonic::Response<super::ListBalancesResponse>,
5780            tonic::Status,
5781        > {
5782            self.inner
5783                .ready()
5784                .await
5785                .map_err(|e| {
5786                    tonic::Status::unknown(
5787                        format!("Service was not ready: {}", e.into()),
5788                    )
5789                })?;
5790            let codec = tonic_prost::ProstCodec::default();
5791            let path = http::uri::PathAndQuery::from_static(
5792                "/sui.rpc.v2.StateService/ListBalances",
5793            );
5794            let mut req = request.into_request();
5795            req.extensions_mut()
5796                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
5797            self.inner.unary(req, path, codec).await
5798        }
5799    }
5800}
5801/// Generated server implementations.
5802pub mod state_service_server {
5803    #![allow(
5804        unused_variables,
5805        dead_code,
5806        missing_docs,
5807        clippy::wildcard_imports,
5808        clippy::let_unit_value,
5809    )]
5810    use tonic::codegen::*;
5811    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
5812    #[async_trait]
5813    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
5814        async fn list_dynamic_fields(
5815            &self,
5816            request: tonic::Request<super::ListDynamicFieldsRequest>,
5817        ) -> std::result::Result<
5818            tonic::Response<super::ListDynamicFieldsResponse>,
5819            tonic::Status,
5820        >;
5821        async fn list_owned_objects(
5822            &self,
5823            request: tonic::Request<super::ListOwnedObjectsRequest>,
5824        ) -> std::result::Result<
5825            tonic::Response<super::ListOwnedObjectsResponse>,
5826            tonic::Status,
5827        >;
5828        async fn get_coin_info(
5829            &self,
5830            request: tonic::Request<super::GetCoinInfoRequest>,
5831        ) -> std::result::Result<
5832            tonic::Response<super::GetCoinInfoResponse>,
5833            tonic::Status,
5834        >;
5835        async fn get_balance(
5836            &self,
5837            request: tonic::Request<super::GetBalanceRequest>,
5838        ) -> std::result::Result<
5839            tonic::Response<super::GetBalanceResponse>,
5840            tonic::Status,
5841        >;
5842        async fn list_balances(
5843            &self,
5844            request: tonic::Request<super::ListBalancesRequest>,
5845        ) -> std::result::Result<
5846            tonic::Response<super::ListBalancesResponse>,
5847            tonic::Status,
5848        >;
5849    }
5850    #[derive(Debug)]
5851    pub struct StateServiceServer<T> {
5852        inner: Arc<T>,
5853        accept_compression_encodings: EnabledCompressionEncodings,
5854        send_compression_encodings: EnabledCompressionEncodings,
5855        max_decoding_message_size: Option<usize>,
5856        max_encoding_message_size: Option<usize>,
5857    }
5858    impl<T> StateServiceServer<T> {
5859        pub fn new(inner: T) -> Self {
5860            Self::from_arc(Arc::new(inner))
5861        }
5862        pub fn from_arc(inner: Arc<T>) -> Self {
5863            Self {
5864                inner,
5865                accept_compression_encodings: Default::default(),
5866                send_compression_encodings: Default::default(),
5867                max_decoding_message_size: None,
5868                max_encoding_message_size: None,
5869            }
5870        }
5871        pub fn with_interceptor<F>(
5872            inner: T,
5873            interceptor: F,
5874        ) -> InterceptedService<Self, F>
5875        where
5876            F: tonic::service::Interceptor,
5877        {
5878            InterceptedService::new(Self::new(inner), interceptor)
5879        }
5880        /// Enable decompressing requests with the given encoding.
5881        #[must_use]
5882        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5883            self.accept_compression_encodings.enable(encoding);
5884            self
5885        }
5886        /// Compress responses with the given encoding, if the client supports it.
5887        #[must_use]
5888        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5889            self.send_compression_encodings.enable(encoding);
5890            self
5891        }
5892        /// Limits the maximum size of a decoded message.
5893        ///
5894        /// Default: `4MB`
5895        #[must_use]
5896        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5897            self.max_decoding_message_size = Some(limit);
5898            self
5899        }
5900        /// Limits the maximum size of an encoded message.
5901        ///
5902        /// Default: `usize::MAX`
5903        #[must_use]
5904        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5905            self.max_encoding_message_size = Some(limit);
5906            self
5907        }
5908    }
5909    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
5910    where
5911        T: StateService,
5912        B: Body + std::marker::Send + 'static,
5913        B::Error: Into<StdError> + std::marker::Send + 'static,
5914    {
5915        type Response = http::Response<tonic::body::Body>;
5916        type Error = std::convert::Infallible;
5917        type Future = BoxFuture<Self::Response, Self::Error>;
5918        fn poll_ready(
5919            &mut self,
5920            _cx: &mut Context<'_>,
5921        ) -> Poll<std::result::Result<(), Self::Error>> {
5922            Poll::Ready(Ok(()))
5923        }
5924        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5925            match req.uri().path() {
5926                "/sui.rpc.v2.StateService/ListDynamicFields" => {
5927                    #[allow(non_camel_case_types)]
5928                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
5929                    impl<
5930                        T: StateService,
5931                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
5932                    for ListDynamicFieldsSvc<T> {
5933                        type Response = super::ListDynamicFieldsResponse;
5934                        type Future = BoxFuture<
5935                            tonic::Response<Self::Response>,
5936                            tonic::Status,
5937                        >;
5938                        fn call(
5939                            &mut self,
5940                            request: tonic::Request<super::ListDynamicFieldsRequest>,
5941                        ) -> Self::Future {
5942                            let inner = Arc::clone(&self.0);
5943                            let fut = async move {
5944                                <T as StateService>::list_dynamic_fields(&inner, request)
5945                                    .await
5946                            };
5947                            Box::pin(fut)
5948                        }
5949                    }
5950                    let accept_compression_encodings = self.accept_compression_encodings;
5951                    let send_compression_encodings = self.send_compression_encodings;
5952                    let max_decoding_message_size = self.max_decoding_message_size;
5953                    let max_encoding_message_size = self.max_encoding_message_size;
5954                    let inner = self.inner.clone();
5955                    let fut = async move {
5956                        let method = ListDynamicFieldsSvc(inner);
5957                        let codec = tonic_prost::ProstCodec::default();
5958                        let mut grpc = tonic::server::Grpc::new(codec)
5959                            .apply_compression_config(
5960                                accept_compression_encodings,
5961                                send_compression_encodings,
5962                            )
5963                            .apply_max_message_size_config(
5964                                max_decoding_message_size,
5965                                max_encoding_message_size,
5966                            );
5967                        let res = grpc.unary(method, req).await;
5968                        Ok(res)
5969                    };
5970                    Box::pin(fut)
5971                }
5972                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
5973                    #[allow(non_camel_case_types)]
5974                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
5975                    impl<
5976                        T: StateService,
5977                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
5978                    for ListOwnedObjectsSvc<T> {
5979                        type Response = super::ListOwnedObjectsResponse;
5980                        type Future = BoxFuture<
5981                            tonic::Response<Self::Response>,
5982                            tonic::Status,
5983                        >;
5984                        fn call(
5985                            &mut self,
5986                            request: tonic::Request<super::ListOwnedObjectsRequest>,
5987                        ) -> Self::Future {
5988                            let inner = Arc::clone(&self.0);
5989                            let fut = async move {
5990                                <T as StateService>::list_owned_objects(&inner, request)
5991                                    .await
5992                            };
5993                            Box::pin(fut)
5994                        }
5995                    }
5996                    let accept_compression_encodings = self.accept_compression_encodings;
5997                    let send_compression_encodings = self.send_compression_encodings;
5998                    let max_decoding_message_size = self.max_decoding_message_size;
5999                    let max_encoding_message_size = self.max_encoding_message_size;
6000                    let inner = self.inner.clone();
6001                    let fut = async move {
6002                        let method = ListOwnedObjectsSvc(inner);
6003                        let codec = tonic_prost::ProstCodec::default();
6004                        let mut grpc = tonic::server::Grpc::new(codec)
6005                            .apply_compression_config(
6006                                accept_compression_encodings,
6007                                send_compression_encodings,
6008                            )
6009                            .apply_max_message_size_config(
6010                                max_decoding_message_size,
6011                                max_encoding_message_size,
6012                            );
6013                        let res = grpc.unary(method, req).await;
6014                        Ok(res)
6015                    };
6016                    Box::pin(fut)
6017                }
6018                "/sui.rpc.v2.StateService/GetCoinInfo" => {
6019                    #[allow(non_camel_case_types)]
6020                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6021                    impl<
6022                        T: StateService,
6023                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
6024                    for GetCoinInfoSvc<T> {
6025                        type Response = super::GetCoinInfoResponse;
6026                        type Future = BoxFuture<
6027                            tonic::Response<Self::Response>,
6028                            tonic::Status,
6029                        >;
6030                        fn call(
6031                            &mut self,
6032                            request: tonic::Request<super::GetCoinInfoRequest>,
6033                        ) -> Self::Future {
6034                            let inner = Arc::clone(&self.0);
6035                            let fut = async move {
6036                                <T as StateService>::get_coin_info(&inner, request).await
6037                            };
6038                            Box::pin(fut)
6039                        }
6040                    }
6041                    let accept_compression_encodings = self.accept_compression_encodings;
6042                    let send_compression_encodings = self.send_compression_encodings;
6043                    let max_decoding_message_size = self.max_decoding_message_size;
6044                    let max_encoding_message_size = self.max_encoding_message_size;
6045                    let inner = self.inner.clone();
6046                    let fut = async move {
6047                        let method = GetCoinInfoSvc(inner);
6048                        let codec = tonic_prost::ProstCodec::default();
6049                        let mut grpc = tonic::server::Grpc::new(codec)
6050                            .apply_compression_config(
6051                                accept_compression_encodings,
6052                                send_compression_encodings,
6053                            )
6054                            .apply_max_message_size_config(
6055                                max_decoding_message_size,
6056                                max_encoding_message_size,
6057                            );
6058                        let res = grpc.unary(method, req).await;
6059                        Ok(res)
6060                    };
6061                    Box::pin(fut)
6062                }
6063                "/sui.rpc.v2.StateService/GetBalance" => {
6064                    #[allow(non_camel_case_types)]
6065                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
6066                    impl<
6067                        T: StateService,
6068                    > tonic::server::UnaryService<super::GetBalanceRequest>
6069                    for GetBalanceSvc<T> {
6070                        type Response = super::GetBalanceResponse;
6071                        type Future = BoxFuture<
6072                            tonic::Response<Self::Response>,
6073                            tonic::Status,
6074                        >;
6075                        fn call(
6076                            &mut self,
6077                            request: tonic::Request<super::GetBalanceRequest>,
6078                        ) -> Self::Future {
6079                            let inner = Arc::clone(&self.0);
6080                            let fut = async move {
6081                                <T as StateService>::get_balance(&inner, request).await
6082                            };
6083                            Box::pin(fut)
6084                        }
6085                    }
6086                    let accept_compression_encodings = self.accept_compression_encodings;
6087                    let send_compression_encodings = self.send_compression_encodings;
6088                    let max_decoding_message_size = self.max_decoding_message_size;
6089                    let max_encoding_message_size = self.max_encoding_message_size;
6090                    let inner = self.inner.clone();
6091                    let fut = async move {
6092                        let method = GetBalanceSvc(inner);
6093                        let codec = tonic_prost::ProstCodec::default();
6094                        let mut grpc = tonic::server::Grpc::new(codec)
6095                            .apply_compression_config(
6096                                accept_compression_encodings,
6097                                send_compression_encodings,
6098                            )
6099                            .apply_max_message_size_config(
6100                                max_decoding_message_size,
6101                                max_encoding_message_size,
6102                            );
6103                        let res = grpc.unary(method, req).await;
6104                        Ok(res)
6105                    };
6106                    Box::pin(fut)
6107                }
6108                "/sui.rpc.v2.StateService/ListBalances" => {
6109                    #[allow(non_camel_case_types)]
6110                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
6111                    impl<
6112                        T: StateService,
6113                    > tonic::server::UnaryService<super::ListBalancesRequest>
6114                    for ListBalancesSvc<T> {
6115                        type Response = super::ListBalancesResponse;
6116                        type Future = BoxFuture<
6117                            tonic::Response<Self::Response>,
6118                            tonic::Status,
6119                        >;
6120                        fn call(
6121                            &mut self,
6122                            request: tonic::Request<super::ListBalancesRequest>,
6123                        ) -> Self::Future {
6124                            let inner = Arc::clone(&self.0);
6125                            let fut = async move {
6126                                <T as StateService>::list_balances(&inner, request).await
6127                            };
6128                            Box::pin(fut)
6129                        }
6130                    }
6131                    let accept_compression_encodings = self.accept_compression_encodings;
6132                    let send_compression_encodings = self.send_compression_encodings;
6133                    let max_decoding_message_size = self.max_decoding_message_size;
6134                    let max_encoding_message_size = self.max_encoding_message_size;
6135                    let inner = self.inner.clone();
6136                    let fut = async move {
6137                        let method = ListBalancesSvc(inner);
6138                        let codec = tonic_prost::ProstCodec::default();
6139                        let mut grpc = tonic::server::Grpc::new(codec)
6140                            .apply_compression_config(
6141                                accept_compression_encodings,
6142                                send_compression_encodings,
6143                            )
6144                            .apply_max_message_size_config(
6145                                max_decoding_message_size,
6146                                max_encoding_message_size,
6147                            );
6148                        let res = grpc.unary(method, req).await;
6149                        Ok(res)
6150                    };
6151                    Box::pin(fut)
6152                }
6153                _ => {
6154                    Box::pin(async move {
6155                        let mut response = http::Response::new(
6156                            tonic::body::Body::default(),
6157                        );
6158                        let headers = response.headers_mut();
6159                        headers
6160                            .insert(
6161                                tonic::Status::GRPC_STATUS,
6162                                (tonic::Code::Unimplemented as i32).into(),
6163                            );
6164                        headers
6165                            .insert(
6166                                http::header::CONTENT_TYPE,
6167                                tonic::metadata::GRPC_CONTENT_TYPE,
6168                            );
6169                        Ok(response)
6170                    })
6171                }
6172            }
6173        }
6174    }
6175    impl<T> Clone for StateServiceServer<T> {
6176        fn clone(&self) -> Self {
6177            let inner = self.inner.clone();
6178            Self {
6179                inner,
6180                accept_compression_encodings: self.accept_compression_encodings,
6181                send_compression_encodings: self.send_compression_encodings,
6182                max_decoding_message_size: self.max_decoding_message_size,
6183                max_encoding_message_size: self.max_encoding_message_size,
6184            }
6185        }
6186    }
6187    /// Generated gRPC service name
6188    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
6189    impl<T> tonic::server::NamedService for StateServiceServer<T> {
6190        const NAME: &'static str = SERVICE_NAME;
6191    }
6192}
6193/// Request message for SubscriptionService.SubscribeCheckpoints
6194#[non_exhaustive]
6195#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6196pub struct SubscribeCheckpointsRequest {
6197    /// Optional. Mask for specifying which parts of the
6198    /// SubscribeCheckpointsResponse should be returned.
6199    #[prost(message, optional, tag = "1")]
6200    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6201}
6202/// Response message for SubscriptionService.SubscribeCheckpoints
6203#[non_exhaustive]
6204#[derive(Clone, PartialEq, ::prost::Message)]
6205pub struct SubscribeCheckpointsResponse {
6206    /// Required. The checkpoint sequence number and value of the current cursor
6207    /// into the checkpoint stream
6208    #[prost(uint64, optional, tag = "1")]
6209    pub cursor: ::core::option::Option<u64>,
6210    /// The requested data for this checkpoint
6211    #[prost(message, optional, tag = "2")]
6212    pub checkpoint: ::core::option::Option<Checkpoint>,
6213}
6214/// Generated client implementations.
6215pub mod subscription_service_client {
6216    #![allow(
6217        unused_variables,
6218        dead_code,
6219        missing_docs,
6220        clippy::wildcard_imports,
6221        clippy::let_unit_value,
6222    )]
6223    use tonic::codegen::*;
6224    use tonic::codegen::http::Uri;
6225    #[derive(Debug, Clone)]
6226    pub struct SubscriptionServiceClient<T> {
6227        inner: tonic::client::Grpc<T>,
6228    }
6229    impl SubscriptionServiceClient<tonic::transport::Channel> {
6230        /// Attempt to create a new client by connecting to a given endpoint.
6231        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6232        where
6233            D: TryInto<tonic::transport::Endpoint>,
6234            D::Error: Into<StdError>,
6235        {
6236            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6237            Ok(Self::new(conn))
6238        }
6239    }
6240    impl<T> SubscriptionServiceClient<T>
6241    where
6242        T: tonic::client::GrpcService<tonic::body::Body>,
6243        T::Error: Into<StdError>,
6244        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6245        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6246    {
6247        pub fn new(inner: T) -> Self {
6248            let inner = tonic::client::Grpc::new(inner);
6249            Self { inner }
6250        }
6251        pub fn with_origin(inner: T, origin: Uri) -> Self {
6252            let inner = tonic::client::Grpc::with_origin(inner, origin);
6253            Self { inner }
6254        }
6255        pub fn with_interceptor<F>(
6256            inner: T,
6257            interceptor: F,
6258        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
6259        where
6260            F: tonic::service::Interceptor,
6261            T::ResponseBody: Default,
6262            T: tonic::codegen::Service<
6263                http::Request<tonic::body::Body>,
6264                Response = http::Response<
6265                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6266                >,
6267            >,
6268            <T as tonic::codegen::Service<
6269                http::Request<tonic::body::Body>,
6270            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6271        {
6272            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
6273        }
6274        /// Compress requests with the given encoding.
6275        ///
6276        /// This requires the server to support it otherwise it might respond with an
6277        /// error.
6278        #[must_use]
6279        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6280            self.inner = self.inner.send_compressed(encoding);
6281            self
6282        }
6283        /// Enable decompressing responses.
6284        #[must_use]
6285        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6286            self.inner = self.inner.accept_compressed(encoding);
6287            self
6288        }
6289        /// Limits the maximum size of a decoded message.
6290        ///
6291        /// Default: `4MB`
6292        #[must_use]
6293        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6294            self.inner = self.inner.max_decoding_message_size(limit);
6295            self
6296        }
6297        /// Limits the maximum size of an encoded message.
6298        ///
6299        /// Default: `usize::MAX`
6300        #[must_use]
6301        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6302            self.inner = self.inner.max_encoding_message_size(limit);
6303            self
6304        }
6305        /// Subscribe to the stream of checkpoints.
6306        ///
6307        /// This API provides a subscription to the checkpoint stream for the Sui
6308        /// blockchain. When a subscription is initialized the stream will begin with
6309        /// the latest executed checkpoint as seen by the server. Responses are
6310        /// guaranteed to return checkpoints in-order and without gaps. This enables
6311        /// clients to know exactly the last checkpoint they have processed and in the
6312        /// event the subscription terminates (either by the client/server or by the
6313        /// connection breaking), clients will be able to reinitialize a subscription
6314        /// and then leverage other APIs in order to request data for the checkpoints
6315        /// they missed.
6316        pub async fn subscribe_checkpoints(
6317            &mut self,
6318            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
6319        ) -> std::result::Result<
6320            tonic::Response<
6321                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
6322            >,
6323            tonic::Status,
6324        > {
6325            self.inner
6326                .ready()
6327                .await
6328                .map_err(|e| {
6329                    tonic::Status::unknown(
6330                        format!("Service was not ready: {}", e.into()),
6331                    )
6332                })?;
6333            let codec = tonic_prost::ProstCodec::default();
6334            let path = http::uri::PathAndQuery::from_static(
6335                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
6336            );
6337            let mut req = request.into_request();
6338            req.extensions_mut()
6339                .insert(
6340                    GrpcMethod::new(
6341                        "sui.rpc.v2.SubscriptionService",
6342                        "SubscribeCheckpoints",
6343                    ),
6344                );
6345            self.inner.server_streaming(req, path, codec).await
6346        }
6347    }
6348}
6349/// Generated server implementations.
6350pub mod subscription_service_server {
6351    #![allow(
6352        unused_variables,
6353        dead_code,
6354        missing_docs,
6355        clippy::wildcard_imports,
6356        clippy::let_unit_value,
6357    )]
6358    use tonic::codegen::*;
6359    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
6360    #[async_trait]
6361    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
6362        /// Server streaming response type for the SubscribeCheckpoints method.
6363        type SubscribeCheckpointsStream: tonic::codegen::tokio_stream::Stream<
6364                Item = std::result::Result<
6365                    super::SubscribeCheckpointsResponse,
6366                    tonic::Status,
6367                >,
6368            >
6369            + std::marker::Send
6370            + 'static;
6371        /// Subscribe to the stream of checkpoints.
6372        ///
6373        /// This API provides a subscription to the checkpoint stream for the Sui
6374        /// blockchain. When a subscription is initialized the stream will begin with
6375        /// the latest executed checkpoint as seen by the server. Responses are
6376        /// guaranteed to return checkpoints in-order and without gaps. This enables
6377        /// clients to know exactly the last checkpoint they have processed and in the
6378        /// event the subscription terminates (either by the client/server or by the
6379        /// connection breaking), clients will be able to reinitialize a subscription
6380        /// and then leverage other APIs in order to request data for the checkpoints
6381        /// they missed.
6382        async fn subscribe_checkpoints(
6383            &self,
6384            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6385        ) -> std::result::Result<
6386            tonic::Response<Self::SubscribeCheckpointsStream>,
6387            tonic::Status,
6388        >;
6389    }
6390    #[derive(Debug)]
6391    pub struct SubscriptionServiceServer<T> {
6392        inner: Arc<T>,
6393        accept_compression_encodings: EnabledCompressionEncodings,
6394        send_compression_encodings: EnabledCompressionEncodings,
6395        max_decoding_message_size: Option<usize>,
6396        max_encoding_message_size: Option<usize>,
6397    }
6398    impl<T> SubscriptionServiceServer<T> {
6399        pub fn new(inner: T) -> Self {
6400            Self::from_arc(Arc::new(inner))
6401        }
6402        pub fn from_arc(inner: Arc<T>) -> Self {
6403            Self {
6404                inner,
6405                accept_compression_encodings: Default::default(),
6406                send_compression_encodings: Default::default(),
6407                max_decoding_message_size: None,
6408                max_encoding_message_size: None,
6409            }
6410        }
6411        pub fn with_interceptor<F>(
6412            inner: T,
6413            interceptor: F,
6414        ) -> InterceptedService<Self, F>
6415        where
6416            F: tonic::service::Interceptor,
6417        {
6418            InterceptedService::new(Self::new(inner), interceptor)
6419        }
6420        /// Enable decompressing requests with the given encoding.
6421        #[must_use]
6422        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6423            self.accept_compression_encodings.enable(encoding);
6424            self
6425        }
6426        /// Compress responses with the given encoding, if the client supports it.
6427        #[must_use]
6428        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6429            self.send_compression_encodings.enable(encoding);
6430            self
6431        }
6432        /// Limits the maximum size of a decoded message.
6433        ///
6434        /// Default: `4MB`
6435        #[must_use]
6436        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6437            self.max_decoding_message_size = Some(limit);
6438            self
6439        }
6440        /// Limits the maximum size of an encoded message.
6441        ///
6442        /// Default: `usize::MAX`
6443        #[must_use]
6444        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6445            self.max_encoding_message_size = Some(limit);
6446            self
6447        }
6448    }
6449    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
6450    where
6451        T: SubscriptionService,
6452        B: Body + std::marker::Send + 'static,
6453        B::Error: Into<StdError> + std::marker::Send + 'static,
6454    {
6455        type Response = http::Response<tonic::body::Body>;
6456        type Error = std::convert::Infallible;
6457        type Future = BoxFuture<Self::Response, Self::Error>;
6458        fn poll_ready(
6459            &mut self,
6460            _cx: &mut Context<'_>,
6461        ) -> Poll<std::result::Result<(), Self::Error>> {
6462            Poll::Ready(Ok(()))
6463        }
6464        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6465            match req.uri().path() {
6466                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
6467                    #[allow(non_camel_case_types)]
6468                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
6469                    impl<
6470                        T: SubscriptionService,
6471                    > tonic::server::ServerStreamingService<
6472                        super::SubscribeCheckpointsRequest,
6473                    > for SubscribeCheckpointsSvc<T> {
6474                        type Response = super::SubscribeCheckpointsResponse;
6475                        type ResponseStream = T::SubscribeCheckpointsStream;
6476                        type Future = BoxFuture<
6477                            tonic::Response<Self::ResponseStream>,
6478                            tonic::Status,
6479                        >;
6480                        fn call(
6481                            &mut self,
6482                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
6483                        ) -> Self::Future {
6484                            let inner = Arc::clone(&self.0);
6485                            let fut = async move {
6486                                <T as SubscriptionService>::subscribe_checkpoints(
6487                                        &inner,
6488                                        request,
6489                                    )
6490                                    .await
6491                            };
6492                            Box::pin(fut)
6493                        }
6494                    }
6495                    let accept_compression_encodings = self.accept_compression_encodings;
6496                    let send_compression_encodings = self.send_compression_encodings;
6497                    let max_decoding_message_size = self.max_decoding_message_size;
6498                    let max_encoding_message_size = self.max_encoding_message_size;
6499                    let inner = self.inner.clone();
6500                    let fut = async move {
6501                        let method = SubscribeCheckpointsSvc(inner);
6502                        let codec = tonic_prost::ProstCodec::default();
6503                        let mut grpc = tonic::server::Grpc::new(codec)
6504                            .apply_compression_config(
6505                                accept_compression_encodings,
6506                                send_compression_encodings,
6507                            )
6508                            .apply_max_message_size_config(
6509                                max_decoding_message_size,
6510                                max_encoding_message_size,
6511                            );
6512                        let res = grpc.server_streaming(method, req).await;
6513                        Ok(res)
6514                    };
6515                    Box::pin(fut)
6516                }
6517                _ => {
6518                    Box::pin(async move {
6519                        let mut response = http::Response::new(
6520                            tonic::body::Body::default(),
6521                        );
6522                        let headers = response.headers_mut();
6523                        headers
6524                            .insert(
6525                                tonic::Status::GRPC_STATUS,
6526                                (tonic::Code::Unimplemented as i32).into(),
6527                            );
6528                        headers
6529                            .insert(
6530                                http::header::CONTENT_TYPE,
6531                                tonic::metadata::GRPC_CONTENT_TYPE,
6532                            );
6533                        Ok(response)
6534                    })
6535                }
6536            }
6537        }
6538    }
6539    impl<T> Clone for SubscriptionServiceServer<T> {
6540        fn clone(&self) -> Self {
6541            let inner = self.inner.clone();
6542            Self {
6543                inner,
6544                accept_compression_encodings: self.accept_compression_encodings,
6545                send_compression_encodings: self.send_compression_encodings,
6546                max_decoding_message_size: self.max_decoding_message_size,
6547                max_encoding_message_size: self.max_encoding_message_size,
6548            }
6549        }
6550    }
6551    /// Generated gRPC service name
6552    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
6553    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
6554        const NAME: &'static str = SERVICE_NAME;
6555    }
6556}
6557#[non_exhaustive]
6558#[derive(Clone, PartialEq, ::prost::Message)]
6559pub struct SystemState {
6560    /// The version of the system state data structure type.
6561    #[prost(uint64, optional, tag = "1")]
6562    pub version: ::core::option::Option<u64>,
6563    /// The epoch id
6564    #[prost(uint64, optional, tag = "2")]
6565    pub epoch: ::core::option::Option<u64>,
6566    /// The protocol version
6567    #[prost(uint64, optional, tag = "3")]
6568    pub protocol_version: ::core::option::Option<u64>,
6569    /// Information about the validators
6570    #[prost(message, optional, tag = "4")]
6571    pub validators: ::core::option::Option<ValidatorSet>,
6572    /// Storage Fund info
6573    #[prost(message, optional, tag = "5")]
6574    pub storage_fund: ::core::option::Option<StorageFund>,
6575    /// Set of system config parameters
6576    #[prost(message, optional, tag = "6")]
6577    pub parameters: ::core::option::Option<SystemParameters>,
6578    /// The reference gas price for this epoch
6579    #[prost(uint64, optional, tag = "7")]
6580    pub reference_gas_price: ::core::option::Option<u64>,
6581    /// A list of the records of validator reporting each other.
6582    ///
6583    /// There is an entry in this list for each validator that has been reported
6584    /// at least once. Each record contains all the validators that reported
6585    /// them. If a validator has never been reported they don't have a record in this list.
6586    /// This lists persists across epoch: a peer continues being in a reported state until the
6587    /// reporter doesn't explicitly remove their report.
6588    #[prost(message, repeated, tag = "8")]
6589    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
6590    /// Schedule of stake subsidies given out each epoch.
6591    #[prost(message, optional, tag = "9")]
6592    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
6593    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
6594    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
6595    /// It can be reset once we are able to successfully execute advance_epoch.
6596    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
6597    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
6598    /// are out of safe mode.
6599    #[prost(bool, optional, tag = "10")]
6600    pub safe_mode: ::core::option::Option<bool>,
6601    /// Storage rewards accumulated during safe_mode
6602    #[prost(uint64, optional, tag = "11")]
6603    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
6604    /// Computation rewards accumulated during safe_mode
6605    #[prost(uint64, optional, tag = "12")]
6606    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
6607    /// Storage rebates paid out during safe_mode
6608    #[prost(uint64, optional, tag = "13")]
6609    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
6610    /// Nonrefundable storage fees accumulated during safe_mode
6611    #[prost(uint64, optional, tag = "14")]
6612    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
6613    /// Unix timestamp of when this this epoch started
6614    #[prost(uint64, optional, tag = "15")]
6615    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
6616    /// Any extra fields that's not defined statically.
6617    #[prost(message, optional, tag = "16")]
6618    pub extra_fields: ::core::option::Option<MoveTable>,
6619}
6620#[non_exhaustive]
6621#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6622pub struct ValidatorReportRecord {
6623    /// The address of the validator being reported
6624    #[prost(string, optional, tag = "1")]
6625    pub reported: ::core::option::Option<::prost::alloc::string::String>,
6626    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
6627    #[prost(string, repeated, tag = "2")]
6628    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
6629}
6630#[non_exhaustive]
6631#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6632pub struct SystemParameters {
6633    /// The duration of an epoch, in milliseconds.
6634    #[prost(uint64, optional, tag = "1")]
6635    pub epoch_duration_ms: ::core::option::Option<u64>,
6636    /// The starting epoch in which stake subsidies start being paid out
6637    #[prost(uint64, optional, tag = "2")]
6638    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
6639    /// Minimum number of active validators at any moment.
6640    #[prost(uint64, optional, tag = "3")]
6641    pub min_validator_count: ::core::option::Option<u64>,
6642    /// Maximum number of active validators at any moment.
6643    /// We do not allow the number of validators in any epoch to go above this.
6644    #[prost(uint64, optional, tag = "4")]
6645    pub max_validator_count: ::core::option::Option<u64>,
6646    /// Deprecated.
6647    /// Lower-bound on the amount of stake required to become a validator.
6648    #[prost(uint64, optional, tag = "5")]
6649    pub min_validator_joining_stake: ::core::option::Option<u64>,
6650    /// Deprecated.
6651    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
6652    /// have low stake and will be escorted out of the validator set after being below this
6653    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
6654    #[prost(uint64, optional, tag = "6")]
6655    pub validator_low_stake_threshold: ::core::option::Option<u64>,
6656    /// Deprecated.
6657    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
6658    /// immediately at epoch change, no grace period.
6659    #[prost(uint64, optional, tag = "7")]
6660    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
6661    /// A validator can have stake below `validator_low_stake_threshold`
6662    /// for this many epochs before being kicked out.
6663    #[prost(uint64, optional, tag = "8")]
6664    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
6665    /// Any extra fields that are not defined statically.
6666    #[prost(message, optional, tag = "9")]
6667    pub extra_fields: ::core::option::Option<MoveTable>,
6668}
6669/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
6670#[non_exhaustive]
6671#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6672pub struct MoveTable {
6673    /// The UID of the table or bag
6674    #[prost(string, optional, tag = "1")]
6675    pub id: ::core::option::Option<::prost::alloc::string::String>,
6676    /// The size or number of key-value pairs in the table or bag
6677    #[prost(uint64, optional, tag = "2")]
6678    pub size: ::core::option::Option<u64>,
6679}
6680#[non_exhaustive]
6681#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6682pub struct StakeSubsidy {
6683    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
6684    #[prost(uint64, optional, tag = "1")]
6685    pub balance: ::core::option::Option<u64>,
6686    /// Count of the number of times stake subsidies have been distributed.
6687    #[prost(uint64, optional, tag = "2")]
6688    pub distribution_counter: ::core::option::Option<u64>,
6689    /// The amount of stake subsidy to be drawn down per distribution.
6690    /// This amount decays and decreases over time.
6691    #[prost(uint64, optional, tag = "3")]
6692    pub current_distribution_amount: ::core::option::Option<u64>,
6693    /// Number of distributions to occur before the distribution amount decays.
6694    #[prost(uint64, optional, tag = "4")]
6695    pub stake_subsidy_period_length: ::core::option::Option<u64>,
6696    /// The rate at which the distribution amount decays at the end of each
6697    /// period. Expressed in basis points.
6698    #[prost(uint32, optional, tag = "5")]
6699    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
6700    /// Any extra fields that's not defined statically.
6701    #[prost(message, optional, tag = "6")]
6702    pub extra_fields: ::core::option::Option<MoveTable>,
6703}
6704/// Struct representing the onchain storage fund.
6705#[non_exhaustive]
6706#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
6707pub struct StorageFund {
6708    /// This is the sum of `storage_rebate` of
6709    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
6710    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
6711    /// of transactions, including both the portion refunded to the transaction senders as well as
6712    /// the non-refundable portion taken out and put into `non_refundable_balance`.
6713    #[prost(uint64, optional, tag = "1")]
6714    pub total_object_storage_rebates: ::core::option::Option<u64>,
6715    /// Represents any remaining inflow of the storage fund that should not
6716    /// be taken out of the fund.
6717    #[prost(uint64, optional, tag = "2")]
6718    pub non_refundable_balance: ::core::option::Option<u64>,
6719}
6720#[non_exhaustive]
6721#[derive(Clone, PartialEq, ::prost::Message)]
6722pub struct ValidatorSet {
6723    /// Total amount of stake from all active validators at the beginning of the epoch.
6724    /// Written only once per epoch, in `advance_epoch` function.
6725    #[prost(uint64, optional, tag = "1")]
6726    pub total_stake: ::core::option::Option<u64>,
6727    /// The current list of active validators.
6728    #[prost(message, repeated, tag = "2")]
6729    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
6730    /// List of new validator candidates added during the current epoch.
6731    /// They will be processed at the end of the epoch.
6732    ///
6733    /// key: u64 (index), value: 0x3::validator::Validator
6734    #[prost(message, optional, tag = "3")]
6735    pub pending_active_validators: ::core::option::Option<MoveTable>,
6736    /// Removal requests from the validators. Each element is an index
6737    /// pointing to `active_validators`.
6738    #[prost(uint64, repeated, tag = "4")]
6739    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
6740    /// Mappings from staking pool's ID to the sui address of a validator.
6741    ///
6742    /// key: address (staking pool Id), value: address (sui address of the validator)
6743    #[prost(message, optional, tag = "5")]
6744    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
6745    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
6746    /// When a validator is deactivated the validator is removed from `active_validators` it
6747    /// is added to this table so that stakers can continue to withdraw their stake from it.
6748    ///
6749    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
6750    #[prost(message, optional, tag = "6")]
6751    pub inactive_validators: ::core::option::Option<MoveTable>,
6752    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
6753    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
6754    /// validator.
6755    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
6756    /// officially add them to the active validator set `active_validators` next epoch.
6757    ///
6758    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
6759    #[prost(message, optional, tag = "7")]
6760    pub validator_candidates: ::core::option::Option<MoveTable>,
6761    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
6762    #[prost(btree_map = "string, uint64", tag = "8")]
6763    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
6764        ::prost::alloc::string::String,
6765        u64,
6766    >,
6767    /// Any extra fields that's not defined statically.
6768    #[prost(message, optional, tag = "9")]
6769    pub extra_fields: ::core::option::Option<MoveTable>,
6770}
6771/// Definition of a Validator in the system contracts
6772///
6773/// Note: fields of ValidatorMetadata are flattened into this type
6774#[non_exhaustive]
6775#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6776pub struct Validator {
6777    /// A unique human-readable name of this validator.
6778    #[prost(string, optional, tag = "1")]
6779    pub name: ::core::option::Option<::prost::alloc::string::String>,
6780    /// The Sui Address of the validator. This is the sender that created the Validator object,
6781    /// and also the address to send validator/coins to during withdraws.
6782    #[prost(string, optional, tag = "2")]
6783    pub address: ::core::option::Option<::prost::alloc::string::String>,
6784    #[prost(string, optional, tag = "3")]
6785    pub description: ::core::option::Option<::prost::alloc::string::String>,
6786    #[prost(string, optional, tag = "4")]
6787    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
6788    #[prost(string, optional, tag = "5")]
6789    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
6790    /// The public key bytes corresponding to the private key that the validator
6791    /// holds to sign transactions. For now, this is the same as AuthorityName.
6792    #[prost(bytes = "bytes", optional, tag = "7")]
6793    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6794    /// This is a proof that the validator has ownership of the protocol private key
6795    #[prost(bytes = "bytes", optional, tag = "8")]
6796    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6797    /// The public key bytes corresponding to the private key that the validator
6798    /// uses to establish TLS connections
6799    #[prost(bytes = "bytes", optional, tag = "10")]
6800    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6801    /// The public key bytes corresponding to the Narwhal Worker
6802    #[prost(bytes = "bytes", optional, tag = "12")]
6803    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6804    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
6805    #[prost(string, optional, tag = "13")]
6806    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
6807    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
6808    #[prost(string, optional, tag = "14")]
6809    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6810    /// The address of the narwhal primary
6811    #[prost(string, optional, tag = "15")]
6812    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
6813    /// The address of the narwhal worker
6814    #[prost(string, optional, tag = "16")]
6815    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
6816    #[prost(bytes = "bytes", optional, tag = "18")]
6817    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6818    #[prost(bytes = "bytes", optional, tag = "19")]
6819    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
6820    #[prost(bytes = "bytes", optional, tag = "21")]
6821    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6822    #[prost(bytes = "bytes", optional, tag = "23")]
6823    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
6824    #[prost(string, optional, tag = "24")]
6825    pub next_epoch_network_address: ::core::option::Option<
6826        ::prost::alloc::string::String,
6827    >,
6828    #[prost(string, optional, tag = "25")]
6829    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
6830    #[prost(string, optional, tag = "26")]
6831    pub next_epoch_primary_address: ::core::option::Option<
6832        ::prost::alloc::string::String,
6833    >,
6834    #[prost(string, optional, tag = "27")]
6835    pub next_epoch_worker_address: ::core::option::Option<
6836        ::prost::alloc::string::String,
6837    >,
6838    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
6839    #[prost(message, optional, tag = "28")]
6840    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
6841    /// The voting power of this validator, which might be different from its
6842    /// stake amount.
6843    #[prost(uint64, optional, tag = "29")]
6844    pub voting_power: ::core::option::Option<u64>,
6845    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
6846    #[prost(string, optional, tag = "30")]
6847    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6848    /// Gas price quote, updated only at end of epoch.
6849    #[prost(uint64, optional, tag = "31")]
6850    pub gas_price: ::core::option::Option<u64>,
6851    /// Staking pool for this validator.
6852    #[prost(message, optional, tag = "32")]
6853    pub staking_pool: ::core::option::Option<StakingPool>,
6854    /// Commission rate of the validator, in basis point.
6855    #[prost(uint64, optional, tag = "33")]
6856    pub commission_rate: ::core::option::Option<u64>,
6857    /// Total amount of stake that would be active in the next epoch.
6858    #[prost(uint64, optional, tag = "34")]
6859    pub next_epoch_stake: ::core::option::Option<u64>,
6860    /// This validator's gas price quote for the next epoch.
6861    #[prost(uint64, optional, tag = "35")]
6862    pub next_epoch_gas_price: ::core::option::Option<u64>,
6863    /// The commission rate of the validator starting the next epoch, in basis point.
6864    #[prost(uint64, optional, tag = "36")]
6865    pub next_epoch_commission_rate: ::core::option::Option<u64>,
6866    /// Any extra fields that's not defined statically.
6867    #[prost(message, optional, tag = "37")]
6868    pub extra_fields: ::core::option::Option<MoveTable>,
6869}
6870/// A staking pool embedded in each validator struct in the system state object.
6871#[non_exhaustive]
6872#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6873pub struct StakingPool {
6874    /// UID of the StakingPool object
6875    #[prost(string, optional, tag = "1")]
6876    pub id: ::core::option::Option<::prost::alloc::string::String>,
6877    /// The epoch at which this pool became active.
6878    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
6879    #[prost(uint64, optional, tag = "2")]
6880    pub activation_epoch: ::core::option::Option<u64>,
6881    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
6882    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
6883    #[prost(uint64, optional, tag = "3")]
6884    pub deactivation_epoch: ::core::option::Option<u64>,
6885    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
6886    /// in the `StakedSui` object, updated at epoch boundaries.
6887    #[prost(uint64, optional, tag = "4")]
6888    pub sui_balance: ::core::option::Option<u64>,
6889    /// The epoch stake rewards will be added here at the end of each epoch.
6890    #[prost(uint64, optional, tag = "5")]
6891    pub rewards_pool: ::core::option::Option<u64>,
6892    /// Total number of pool tokens issued by the pool.
6893    #[prost(uint64, optional, tag = "6")]
6894    pub pool_token_balance: ::core::option::Option<u64>,
6895    /// Exchange rate history of previous epochs.
6896    ///
6897    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
6898    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
6899    ///
6900    /// key: u64 (epoch number), value: PoolTokenExchangeRate
6901    #[prost(message, optional, tag = "7")]
6902    pub exchange_rates: ::core::option::Option<MoveTable>,
6903    /// Pending stake amount for this epoch, emptied at epoch boundaries.
6904    #[prost(uint64, optional, tag = "8")]
6905    pub pending_stake: ::core::option::Option<u64>,
6906    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
6907    /// This includes both the principal and rewards SUI withdrawn.
6908    #[prost(uint64, optional, tag = "9")]
6909    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
6910    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
6911    #[prost(uint64, optional, tag = "10")]
6912    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
6913    /// Any extra fields that's not defined statically.
6914    #[prost(message, optional, tag = "11")]
6915    pub extra_fields: ::core::option::Option<MoveTable>,
6916}
6917/// A transaction.
6918#[non_exhaustive]
6919#[derive(Clone, PartialEq, ::prost::Message)]
6920pub struct Transaction {
6921    /// This Transaction serialized as BCS.
6922    #[prost(message, optional, tag = "1")]
6923    pub bcs: ::core::option::Option<Bcs>,
6924    /// The digest of this Transaction.
6925    #[prost(string, optional, tag = "2")]
6926    pub digest: ::core::option::Option<::prost::alloc::string::String>,
6927    /// Version of this Transaction.
6928    #[prost(int32, optional, tag = "3")]
6929    pub version: ::core::option::Option<i32>,
6930    #[prost(message, optional, tag = "4")]
6931    pub kind: ::core::option::Option<TransactionKind>,
6932    #[prost(string, optional, tag = "5")]
6933    pub sender: ::core::option::Option<::prost::alloc::string::String>,
6934    #[prost(message, optional, tag = "6")]
6935    pub gas_payment: ::core::option::Option<GasPayment>,
6936    #[prost(message, optional, tag = "7")]
6937    pub expiration: ::core::option::Option<TransactionExpiration>,
6938}
6939/// Payment information for executing a transaction.
6940#[non_exhaustive]
6941#[derive(Clone, PartialEq, ::prost::Message)]
6942pub struct GasPayment {
6943    /// Set of gas objects to use for payment.
6944    #[prost(message, repeated, tag = "1")]
6945    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
6946    /// Owner of the gas objects, either the transaction sender or a sponsor.
6947    #[prost(string, optional, tag = "2")]
6948    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6949    /// Gas unit price to use when charging for computation.
6950    ///
6951    /// Must be greater than or equal to the network's current RGP (reference gas price).
6952    #[prost(uint64, optional, tag = "3")]
6953    pub price: ::core::option::Option<u64>,
6954    /// Total budget willing to spend for the execution of a transaction.
6955    #[prost(uint64, optional, tag = "4")]
6956    pub budget: ::core::option::Option<u64>,
6957}
6958/// A TTL for a transaction.
6959#[non_exhaustive]
6960#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6961pub struct TransactionExpiration {
6962    #[prost(
6963        enumeration = "transaction_expiration::TransactionExpirationKind",
6964        optional,
6965        tag = "1"
6966    )]
6967    pub kind: ::core::option::Option<i32>,
6968    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
6969    /// must be greater than or equal to the current epoch for a transaction to execute.
6970    #[prost(uint64, optional, tag = "2")]
6971    pub epoch: ::core::option::Option<u64>,
6972    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
6973    /// must be less than or equal to the current epoch for a transaction to execute.
6974    #[prost(uint64, optional, tag = "3")]
6975    pub min_epoch: ::core::option::Option<u64>,
6976    /// Minimal UNIX timestamp in which a transaction can be executed. The
6977    /// provided minimal timestamp must be less than or equal to the current
6978    /// clock.
6979    #[prost(message, optional, tag = "4")]
6980    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6981    /// Maximum UNIX timestamp in which a transaction can be executed. The
6982    /// provided maximal timestamp must be greater than or equal to the current
6983    /// clock.
6984    #[prost(message, optional, tag = "5")]
6985    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
6986    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
6987    #[prost(string, optional, tag = "6")]
6988    pub chain: ::core::option::Option<::prost::alloc::string::String>,
6989    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
6990    #[prost(uint32, optional, tag = "7")]
6991    pub nonce: ::core::option::Option<u32>,
6992}
6993/// Nested message and enum types in `TransactionExpiration`.
6994pub mod transaction_expiration {
6995    #[non_exhaustive]
6996    #[derive(
6997        Clone,
6998        Copy,
6999        Debug,
7000        PartialEq,
7001        Eq,
7002        Hash,
7003        PartialOrd,
7004        Ord,
7005        ::prost::Enumeration
7006    )]
7007    #[repr(i32)]
7008    pub enum TransactionExpirationKind {
7009        Unknown = 0,
7010        /// The transaction has no expiration.
7011        None = 1,
7012        /// Validators won't sign and execute transaction unless the expiration epoch
7013        /// is greater than or equal to the current epoch.
7014        Epoch = 2,
7015        /// This variant enables gas payments from address balances.
7016        ///
7017        /// When transactions use address balances for gas payment instead of explicit gas coins,
7018        /// we lose the natural transaction uniqueness and replay prevention that comes from
7019        /// mutation of gas coin objects.
7020        ///
7021        /// By bounding expiration and providing a nonce, validators must only retain
7022        /// executed digests for the maximum possible expiry range to differentiate
7023        /// retries from unique transactions with otherwise identical inputs.
7024        ValidDuring = 3,
7025    }
7026    impl TransactionExpirationKind {
7027        /// String value of the enum field names used in the ProtoBuf definition.
7028        ///
7029        /// The values are not transformed in any way and thus are considered stable
7030        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7031        pub fn as_str_name(&self) -> &'static str {
7032            match self {
7033                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
7034                Self::None => "NONE",
7035                Self::Epoch => "EPOCH",
7036                Self::ValidDuring => "VALID_DURING",
7037            }
7038        }
7039        /// Creates an enum from field names used in the ProtoBuf definition.
7040        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7041            match value {
7042                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
7043                "NONE" => Some(Self::None),
7044                "EPOCH" => Some(Self::Epoch),
7045                "VALID_DURING" => Some(Self::ValidDuring),
7046                _ => None,
7047            }
7048        }
7049    }
7050}
7051/// Transaction type.
7052#[non_exhaustive]
7053#[derive(Clone, PartialEq, ::prost::Message)]
7054pub struct TransactionKind {
7055    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
7056    pub kind: ::core::option::Option<i32>,
7057    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
7058    pub data: ::core::option::Option<transaction_kind::Data>,
7059}
7060/// Nested message and enum types in `TransactionKind`.
7061pub mod transaction_kind {
7062    #[non_exhaustive]
7063    #[derive(
7064        Clone,
7065        Copy,
7066        Debug,
7067        PartialEq,
7068        Eq,
7069        Hash,
7070        PartialOrd,
7071        Ord,
7072        ::prost::Enumeration
7073    )]
7074    #[repr(i32)]
7075    pub enum Kind {
7076        Unknown = 0,
7077        /// A user transaction comprised of a list of native commands and Move calls.
7078        ProgrammableTransaction = 1,
7079        /// System transaction used to end an epoch.
7080        ///
7081        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7082        /// `EndOfEpochTransaction`).
7083        ChangeEpoch = 2,
7084        /// Transaction used to initialize the chain state.
7085        ///
7086        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7087        /// executed on the chain.
7088        Genesis = 3,
7089        /// V1 consensus commit update.
7090        ConsensusCommitPrologueV1 = 4,
7091        /// Update set of valid JWKs used for zklogin.
7092        AuthenticatorStateUpdate = 5,
7093        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7094        /// the next one.
7095        EndOfEpoch = 6,
7096        /// Randomness update.
7097        RandomnessStateUpdate = 7,
7098        /// V2 consensus commit update.
7099        ConsensusCommitPrologueV2 = 8,
7100        /// V3 consensus commit update.
7101        ConsensusCommitPrologueV3 = 9,
7102        /// V4 consensus commit update.
7103        ConsensusCommitPrologueV4 = 10,
7104    }
7105    impl Kind {
7106        /// String value of the enum field names used in the ProtoBuf definition.
7107        ///
7108        /// The values are not transformed in any way and thus are considered stable
7109        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7110        pub fn as_str_name(&self) -> &'static str {
7111            match self {
7112                Self::Unknown => "KIND_UNKNOWN",
7113                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
7114                Self::ChangeEpoch => "CHANGE_EPOCH",
7115                Self::Genesis => "GENESIS",
7116                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
7117                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
7118                Self::EndOfEpoch => "END_OF_EPOCH",
7119                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
7120                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
7121                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
7122                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
7123            }
7124        }
7125        /// Creates an enum from field names used in the ProtoBuf definition.
7126        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7127            match value {
7128                "KIND_UNKNOWN" => Some(Self::Unknown),
7129                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
7130                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7131                "GENESIS" => Some(Self::Genesis),
7132                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
7133                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
7134                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
7135                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
7136                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
7137                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
7138                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
7139                _ => None,
7140            }
7141        }
7142    }
7143    #[non_exhaustive]
7144    #[derive(Clone, PartialEq, ::prost::Oneof)]
7145    pub enum Data {
7146        /// A transaction comprised of a list of native commands and Move calls.
7147        #[prost(message, tag = "2")]
7148        ProgrammableTransaction(super::ProgrammableTransaction),
7149        /// System transaction used to end an epoch.
7150        ///
7151        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
7152        /// `EndOfEpochTransaction`).
7153        #[prost(message, tag = "3")]
7154        ChangeEpoch(super::ChangeEpoch),
7155        /// Transaction used to initialize the chain state.
7156        ///
7157        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
7158        /// executed on the chain.
7159        #[prost(message, tag = "4")]
7160        Genesis(super::GenesisTransaction),
7161        /// consensus commit update info
7162        #[prost(message, tag = "5")]
7163        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
7164        /// Update set of valid JWKs used for zklogin.
7165        #[prost(message, tag = "6")]
7166        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
7167        /// Set of operations to run at the end of the epoch to close out the current epoch and start
7168        /// the next one.
7169        #[prost(message, tag = "7")]
7170        EndOfEpoch(super::EndOfEpochTransaction),
7171        /// Randomness update.
7172        #[prost(message, tag = "8")]
7173        RandomnessStateUpdate(super::RandomnessStateUpdate),
7174    }
7175}
7176/// A user transaction.
7177///
7178/// Contains a series of native commands and Move calls where the results of one command can be
7179/// used in future commands.
7180#[non_exhaustive]
7181#[derive(Clone, PartialEq, ::prost::Message)]
7182pub struct ProgrammableTransaction {
7183    /// Input objects or primitive values.
7184    #[prost(message, repeated, tag = "1")]
7185    pub inputs: ::prost::alloc::vec::Vec<Input>,
7186    /// The commands to be executed sequentially. A failure in any command
7187    /// results in the failure of the entire transaction.
7188    #[prost(message, repeated, tag = "2")]
7189    pub commands: ::prost::alloc::vec::Vec<Command>,
7190}
7191/// A single command in a programmable transaction.
7192#[non_exhaustive]
7193#[derive(Clone, PartialEq, ::prost::Message)]
7194pub struct Command {
7195    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
7196    pub command: ::core::option::Option<command::Command>,
7197}
7198/// Nested message and enum types in `Command`.
7199pub mod command {
7200    #[non_exhaustive]
7201    #[derive(Clone, PartialEq, ::prost::Oneof)]
7202    pub enum Command {
7203        /// A call to either an entry or a public Move function.
7204        #[prost(message, tag = "1")]
7205        MoveCall(super::MoveCall),
7206        /// `(Vec<forall T:key+store. T>, address)`
7207        /// It sends n-objects to the specified address. These objects must have store
7208        /// (public transfer) and either the previous owner must be an address or the object must
7209        /// be newly created.
7210        #[prost(message, tag = "2")]
7211        TransferObjects(super::TransferObjects),
7212        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
7213        /// It splits off some amounts into new coins with those amounts.
7214        #[prost(message, tag = "3")]
7215        SplitCoins(super::SplitCoins),
7216        /// `(&mut Coin<T>, Vec<Coin<T>>)`
7217        /// It merges n-coins into the first coin.
7218        #[prost(message, tag = "4")]
7219        MergeCoins(super::MergeCoins),
7220        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
7221        /// dependencies to link against on chain.
7222        #[prost(message, tag = "5")]
7223        Publish(super::Publish),
7224        /// `forall T: Vec<T> -> vector<T>`
7225        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
7226        /// the type tag must be specified.
7227        #[prost(message, tag = "6")]
7228        MakeMoveVector(super::MakeMoveVector),
7229        /// Upgrades a Move package.
7230        /// Takes (in order):
7231        ///
7232        /// 1. A vector of serialized modules for the package.
7233        /// 1. A vector of object ids for the transitive dependencies of the new package.
7234        /// 1. The object ID of the package being upgraded.
7235        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
7236        ///    programmable transaction.
7237        #[prost(message, tag = "7")]
7238        Upgrade(super::Upgrade),
7239    }
7240}
7241/// Command to call a Move function.
7242///
7243/// Functions that can be called by a `MoveCall` command are those that have a function signature
7244/// that is either `entry` or `public` (which don't have a reference return type).
7245#[non_exhaustive]
7246#[derive(Clone, PartialEq, ::prost::Message)]
7247pub struct MoveCall {
7248    /// The package containing the module and function.
7249    #[prost(string, optional, tag = "1")]
7250    pub package: ::core::option::Option<::prost::alloc::string::String>,
7251    /// The specific module in the package containing the function.
7252    #[prost(string, optional, tag = "2")]
7253    pub module: ::core::option::Option<::prost::alloc::string::String>,
7254    /// The function to be called.
7255    #[prost(string, optional, tag = "3")]
7256    pub function: ::core::option::Option<::prost::alloc::string::String>,
7257    /// The type arguments to the function.
7258    #[prost(string, repeated, tag = "4")]
7259    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7260    /// The arguments to the function.
7261    #[prost(message, repeated, tag = "5")]
7262    pub arguments: ::prost::alloc::vec::Vec<Argument>,
7263}
7264/// Command to transfer ownership of a set of objects to an address.
7265#[non_exhaustive]
7266#[derive(Clone, PartialEq, ::prost::Message)]
7267pub struct TransferObjects {
7268    /// Set of objects to transfer.
7269    #[prost(message, repeated, tag = "1")]
7270    pub objects: ::prost::alloc::vec::Vec<Argument>,
7271    /// The address to transfer ownership to.
7272    #[prost(message, optional, tag = "2")]
7273    pub address: ::core::option::Option<Argument>,
7274}
7275/// Command to split a single coin object into multiple coins.
7276#[non_exhaustive]
7277#[derive(Clone, PartialEq, ::prost::Message)]
7278pub struct SplitCoins {
7279    /// The coin to split.
7280    #[prost(message, optional, tag = "1")]
7281    pub coin: ::core::option::Option<Argument>,
7282    /// The amounts to split off.
7283    #[prost(message, repeated, tag = "2")]
7284    pub amounts: ::prost::alloc::vec::Vec<Argument>,
7285}
7286/// Command to merge multiple coins of the same type into a single coin.
7287#[non_exhaustive]
7288#[derive(Clone, PartialEq, ::prost::Message)]
7289pub struct MergeCoins {
7290    /// Coin to merge coins into.
7291    #[prost(message, optional, tag = "1")]
7292    pub coin: ::core::option::Option<Argument>,
7293    /// Set of coins to merge into `coin`.
7294    ///
7295    /// All listed coins must be of the same type and be the same type as `coin`
7296    #[prost(message, repeated, tag = "2")]
7297    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
7298}
7299/// Command to publish a new Move package.
7300#[non_exhaustive]
7301#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7302pub struct Publish {
7303    /// The serialized Move modules.
7304    #[prost(bytes = "bytes", repeated, tag = "1")]
7305    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7306    /// Set of packages that the to-be published package depends on.
7307    #[prost(string, repeated, tag = "2")]
7308    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7309}
7310/// Command to build a Move vector out of a set of individual elements.
7311#[non_exhaustive]
7312#[derive(Clone, PartialEq, ::prost::Message)]
7313pub struct MakeMoveVector {
7314    /// Type of the individual elements.
7315    ///
7316    /// This is required to be set when the type can't be inferred, for example when the set of
7317    /// provided arguments are all pure input values.
7318    #[prost(string, optional, tag = "1")]
7319    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
7320    /// The set individual elements to build the vector with.
7321    #[prost(message, repeated, tag = "2")]
7322    pub elements: ::prost::alloc::vec::Vec<Argument>,
7323}
7324/// Command to upgrade an already published package.
7325#[non_exhaustive]
7326#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7327pub struct Upgrade {
7328    /// The serialized Move modules.
7329    #[prost(bytes = "bytes", repeated, tag = "1")]
7330    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7331    /// Set of packages that the to-be published package depends on.
7332    #[prost(string, repeated, tag = "2")]
7333    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7334    /// Package ID of the package to upgrade.
7335    #[prost(string, optional, tag = "3")]
7336    pub package: ::core::option::Option<::prost::alloc::string::String>,
7337    /// Ticket authorizing the upgrade.
7338    #[prost(message, optional, tag = "4")]
7339    pub ticket: ::core::option::Option<Argument>,
7340}
7341/// Randomness update.
7342#[non_exhaustive]
7343#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7344pub struct RandomnessStateUpdate {
7345    /// Epoch of the randomness state update transaction.
7346    #[prost(uint64, optional, tag = "1")]
7347    pub epoch: ::core::option::Option<u64>,
7348    /// Randomness round of the update.
7349    #[prost(uint64, optional, tag = "2")]
7350    pub randomness_round: ::core::option::Option<u64>,
7351    /// Updated random bytes.
7352    #[prost(bytes = "bytes", optional, tag = "3")]
7353    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
7354    /// The initial version of the randomness object that it was shared at.
7355    #[prost(uint64, optional, tag = "4")]
7356    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
7357}
7358/// System transaction used to change the epoch.
7359#[non_exhaustive]
7360#[derive(Clone, PartialEq, ::prost::Message)]
7361pub struct ChangeEpoch {
7362    /// The next (to become) epoch ID.
7363    #[prost(uint64, optional, tag = "1")]
7364    pub epoch: ::core::option::Option<u64>,
7365    /// The protocol version in effect in the new epoch.
7366    #[prost(uint64, optional, tag = "2")]
7367    pub protocol_version: ::core::option::Option<u64>,
7368    /// The total amount of gas charged for storage during the epoch.
7369    #[prost(uint64, optional, tag = "3")]
7370    pub storage_charge: ::core::option::Option<u64>,
7371    /// The total amount of gas charged for computation during the epoch.
7372    #[prost(uint64, optional, tag = "4")]
7373    pub computation_charge: ::core::option::Option<u64>,
7374    /// The amount of storage rebate refunded to the txn senders.
7375    #[prost(uint64, optional, tag = "5")]
7376    pub storage_rebate: ::core::option::Option<u64>,
7377    /// The non-refundable storage fee.
7378    #[prost(uint64, optional, tag = "6")]
7379    pub non_refundable_storage_fee: ::core::option::Option<u64>,
7380    /// Unix timestamp when epoch started.
7381    #[prost(message, optional, tag = "7")]
7382    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7383    /// System packages (specifically framework and Move stdlib) that are written before the new
7384    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
7385    /// the validator must write out the following modules.  Modules are provided with the version they
7386    /// will be upgraded to, their modules in serialized form (which include their package ID), and
7387    /// a list of their transitive dependencies.
7388    #[prost(message, repeated, tag = "8")]
7389    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
7390}
7391/// System package.
7392#[non_exhaustive]
7393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7394pub struct SystemPackage {
7395    /// Version of the package.
7396    #[prost(uint64, optional, tag = "1")]
7397    pub version: ::core::option::Option<u64>,
7398    /// Move modules.
7399    #[prost(bytes = "bytes", repeated, tag = "2")]
7400    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
7401    /// Package dependencies.
7402    #[prost(string, repeated, tag = "3")]
7403    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7404}
7405/// The genesis transaction.
7406#[non_exhaustive]
7407#[derive(Clone, PartialEq, ::prost::Message)]
7408pub struct GenesisTransaction {
7409    /// Set of genesis objects.
7410    #[prost(message, repeated, tag = "1")]
7411    pub objects: ::prost::alloc::vec::Vec<Object>,
7412}
7413/// Consensus commit prologue system transaction.
7414///
7415/// This message can represent V1, V2, and V3 prologue types.
7416#[non_exhaustive]
7417#[derive(Clone, PartialEq, ::prost::Message)]
7418pub struct ConsensusCommitPrologue {
7419    /// Epoch of the commit prologue transaction.
7420    ///
7421    /// Present in V1, V2, V3, V4.
7422    #[prost(uint64, optional, tag = "1")]
7423    pub epoch: ::core::option::Option<u64>,
7424    /// Consensus round of the commit.
7425    ///
7426    /// Present in V1, V2, V3, V4.
7427    #[prost(uint64, optional, tag = "2")]
7428    pub round: ::core::option::Option<u64>,
7429    /// Unix timestamp from consensus.
7430    ///
7431    /// Present in V1, V2, V3, V4.
7432    #[prost(message, optional, tag = "3")]
7433    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
7434    /// Digest of consensus output.
7435    ///
7436    /// Present in V2, V3, V4.
7437    #[prost(string, optional, tag = "4")]
7438    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
7439    /// The sub DAG index of the consensus commit. This field is populated if there
7440    /// are multiple consensus commits per round.
7441    ///
7442    /// Present in V3, V4.
7443    #[prost(uint64, optional, tag = "5")]
7444    pub sub_dag_index: ::core::option::Option<u64>,
7445    /// Stores consensus handler determined consensus object version assignments.
7446    ///
7447    /// Present in V3, V4.
7448    #[prost(message, optional, tag = "6")]
7449    pub consensus_determined_version_assignments: ::core::option::Option<
7450        ConsensusDeterminedVersionAssignments,
7451    >,
7452    /// Digest of any additional state computed by the consensus handler.
7453    /// Used to detect forking bugs as early as possible.
7454    ///
7455    /// Present in V4.
7456    #[prost(string, optional, tag = "7")]
7457    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
7458}
7459/// Object version assignment from consensus.
7460#[non_exhaustive]
7461#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7462pub struct VersionAssignment {
7463    /// `ObjectId` of the object.
7464    #[prost(string, optional, tag = "1")]
7465    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
7466    /// start version of the consensus stream for this object
7467    #[prost(uint64, optional, tag = "2")]
7468    pub start_version: ::core::option::Option<u64>,
7469    /// Assigned version.
7470    #[prost(uint64, optional, tag = "3")]
7471    pub version: ::core::option::Option<u64>,
7472}
7473/// A transaction that was canceled.
7474#[non_exhaustive]
7475#[derive(Clone, PartialEq, ::prost::Message)]
7476pub struct CanceledTransaction {
7477    /// Digest of the canceled transaction.
7478    #[prost(string, optional, tag = "1")]
7479    pub digest: ::core::option::Option<::prost::alloc::string::String>,
7480    /// List of object version assignments.
7481    #[prost(message, repeated, tag = "2")]
7482    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
7483}
7484/// Version assignments performed by consensus.
7485#[non_exhaustive]
7486#[derive(Clone, PartialEq, ::prost::Message)]
7487pub struct ConsensusDeterminedVersionAssignments {
7488    /// Version of this message
7489    #[prost(int32, optional, tag = "1")]
7490    pub version: ::core::option::Option<i32>,
7491    /// Canceled transaction version assignment.
7492    #[prost(message, repeated, tag = "3")]
7493    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
7494}
7495/// Update the set of valid JWKs.
7496#[non_exhaustive]
7497#[derive(Clone, PartialEq, ::prost::Message)]
7498pub struct AuthenticatorStateUpdate {
7499    /// Epoch of the authenticator state update transaction.
7500    #[prost(uint64, optional, tag = "1")]
7501    pub epoch: ::core::option::Option<u64>,
7502    /// Consensus round of the authenticator state update.
7503    #[prost(uint64, optional, tag = "2")]
7504    pub round: ::core::option::Option<u64>,
7505    /// Newly active JWKs.
7506    #[prost(message, repeated, tag = "3")]
7507    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
7508    /// The initial version of the authenticator object that it was shared at.
7509    #[prost(uint64, optional, tag = "4")]
7510    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7511}
7512/// A new JWK.
7513#[non_exhaustive]
7514#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7515pub struct ActiveJwk {
7516    /// Identifier used to uniquely identify a JWK.
7517    #[prost(message, optional, tag = "1")]
7518    pub id: ::core::option::Option<JwkId>,
7519    /// The JWK.
7520    #[prost(message, optional, tag = "2")]
7521    pub jwk: ::core::option::Option<Jwk>,
7522    /// Most recent epoch in which the JWK was validated.
7523    #[prost(uint64, optional, tag = "3")]
7524    pub epoch: ::core::option::Option<u64>,
7525}
7526/// Set of operations run at the end of the epoch to close out the current epoch
7527/// and start the next one.
7528#[non_exhaustive]
7529#[derive(Clone, PartialEq, ::prost::Message)]
7530pub struct EndOfEpochTransaction {
7531    #[prost(message, repeated, tag = "1")]
7532    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
7533}
7534/// Operation run at the end of an epoch.
7535#[non_exhaustive]
7536#[derive(Clone, PartialEq, ::prost::Message)]
7537pub struct EndOfEpochTransactionKind {
7538    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
7539    pub kind: ::core::option::Option<i32>,
7540    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6")]
7541    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
7542}
7543/// Nested message and enum types in `EndOfEpochTransactionKind`.
7544pub mod end_of_epoch_transaction_kind {
7545    #[non_exhaustive]
7546    #[derive(
7547        Clone,
7548        Copy,
7549        Debug,
7550        PartialEq,
7551        Eq,
7552        Hash,
7553        PartialOrd,
7554        Ord,
7555        ::prost::Enumeration
7556    )]
7557    #[repr(i32)]
7558    pub enum Kind {
7559        Unknown = 0,
7560        /// End the epoch and start the next one.
7561        ChangeEpoch = 1,
7562        /// Create and initialize the authenticator object used for zklogin.
7563        AuthenticatorStateCreate = 2,
7564        /// Expire JWKs used for zklogin.
7565        AuthenticatorStateExpire = 3,
7566        /// Create and initialize the randomness object.
7567        RandomnessStateCreate = 4,
7568        /// Create and initialize the deny list object.
7569        DenyListStateCreate = 5,
7570        /// Create and initialize the bridge object.
7571        BridgeStateCreate = 6,
7572        /// Initialize the bridge committee.
7573        BridgeCommitteeInit = 7,
7574        /// Execution time observations from the committee to preserve cross epoch
7575        StoreExecutionTimeObservations = 8,
7576        /// Create the accumulator root object.
7577        AccumulatorRootCreate = 9,
7578        /// Create and initialize the Coin Registry object.
7579        CoinRegistryCreate = 10,
7580        /// Create and initialize the Display Registry object.
7581        DisplayRegistryCreate = 11,
7582        /// Create and initialize the Address Alias State object.
7583        AddressAliasStateCreate = 12,
7584    }
7585    impl Kind {
7586        /// String value of the enum field names used in the ProtoBuf definition.
7587        ///
7588        /// The values are not transformed in any way and thus are considered stable
7589        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7590        pub fn as_str_name(&self) -> &'static str {
7591            match self {
7592                Self::Unknown => "KIND_UNKNOWN",
7593                Self::ChangeEpoch => "CHANGE_EPOCH",
7594                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
7595                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
7596                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
7597                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
7598                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
7599                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
7600                Self::StoreExecutionTimeObservations => {
7601                    "STORE_EXECUTION_TIME_OBSERVATIONS"
7602                }
7603                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
7604                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
7605                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
7606                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
7607            }
7608        }
7609        /// Creates an enum from field names used in the ProtoBuf definition.
7610        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7611            match value {
7612                "KIND_UNKNOWN" => Some(Self::Unknown),
7613                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
7614                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
7615                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
7616                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
7617                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
7618                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
7619                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
7620                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
7621                    Some(Self::StoreExecutionTimeObservations)
7622                }
7623                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
7624                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
7625                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
7626                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
7627                _ => None,
7628            }
7629        }
7630    }
7631    #[non_exhaustive]
7632    #[derive(Clone, PartialEq, ::prost::Oneof)]
7633    pub enum Data {
7634        /// End the epoch and start the next one.
7635        #[prost(message, tag = "2")]
7636        ChangeEpoch(super::ChangeEpoch),
7637        /// Expire JWKs used for zklogin.
7638        #[prost(message, tag = "3")]
7639        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
7640        /// Execution time observations from the committee to preserve cross epoch
7641        #[prost(message, tag = "4")]
7642        ExecutionTimeObservations(super::ExecutionTimeObservations),
7643        /// ChainId used when initializing the bridge
7644        #[prost(string, tag = "5")]
7645        BridgeChainId(::prost::alloc::string::String),
7646        /// Start version of the Bridge object
7647        #[prost(uint64, tag = "6")]
7648        BridgeObjectVersion(u64),
7649    }
7650}
7651/// Expire old JWKs.
7652#[non_exhaustive]
7653#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7654pub struct AuthenticatorStateExpire {
7655    /// Expire JWKs that have a lower epoch than this.
7656    #[prost(uint64, optional, tag = "1")]
7657    pub min_epoch: ::core::option::Option<u64>,
7658    /// The initial version of the authenticator object that it was shared at.
7659    #[prost(uint64, optional, tag = "2")]
7660    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
7661}
7662#[non_exhaustive]
7663#[derive(Clone, PartialEq, ::prost::Message)]
7664pub struct ExecutionTimeObservations {
7665    /// Version of this ExecutionTimeObservations
7666    #[prost(int32, optional, tag = "1")]
7667    pub version: ::core::option::Option<i32>,
7668    #[prost(message, repeated, tag = "2")]
7669    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
7670}
7671#[non_exhaustive]
7672#[derive(Clone, PartialEq, ::prost::Message)]
7673pub struct ExecutionTimeObservation {
7674    #[prost(
7675        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
7676        optional,
7677        tag = "1"
7678    )]
7679    pub kind: ::core::option::Option<i32>,
7680    #[prost(message, optional, tag = "2")]
7681    pub move_entry_point: ::core::option::Option<MoveCall>,
7682    #[prost(message, repeated, tag = "3")]
7683    pub validator_observations: ::prost::alloc::vec::Vec<
7684        ValidatorExecutionTimeObservation,
7685    >,
7686}
7687/// Nested message and enum types in `ExecutionTimeObservation`.
7688pub mod execution_time_observation {
7689    #[non_exhaustive]
7690    #[derive(
7691        Clone,
7692        Copy,
7693        Debug,
7694        PartialEq,
7695        Eq,
7696        Hash,
7697        PartialOrd,
7698        Ord,
7699        ::prost::Enumeration
7700    )]
7701    #[repr(i32)]
7702    pub enum ExecutionTimeObservationKind {
7703        Unknown = 0,
7704        MoveEntryPoint = 1,
7705        TransferObjects = 2,
7706        SplitCoins = 3,
7707        MergeCoins = 4,
7708        Publish = 5,
7709        MakeMoveVector = 6,
7710        Upgrade = 7,
7711    }
7712    impl ExecutionTimeObservationKind {
7713        /// String value of the enum field names used in the ProtoBuf definition.
7714        ///
7715        /// The values are not transformed in any way and thus are considered stable
7716        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7717        pub fn as_str_name(&self) -> &'static str {
7718            match self {
7719                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
7720                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
7721                Self::TransferObjects => "TRANSFER_OBJECTS",
7722                Self::SplitCoins => "SPLIT_COINS",
7723                Self::MergeCoins => "MERGE_COINS",
7724                Self::Publish => "PUBLISH",
7725                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
7726                Self::Upgrade => "UPGRADE",
7727            }
7728        }
7729        /// Creates an enum from field names used in the ProtoBuf definition.
7730        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7731            match value {
7732                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
7733                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
7734                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
7735                "SPLIT_COINS" => Some(Self::SplitCoins),
7736                "MERGE_COINS" => Some(Self::MergeCoins),
7737                "PUBLISH" => Some(Self::Publish),
7738                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
7739                "UPGRADE" => Some(Self::Upgrade),
7740                _ => None,
7741            }
7742        }
7743    }
7744}
7745#[non_exhaustive]
7746#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7747pub struct ValidatorExecutionTimeObservation {
7748    /// Bls12381 public key of the validator
7749    #[prost(bytes = "bytes", optional, tag = "1")]
7750    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
7751    /// Duration of an execution observation
7752    #[prost(message, optional, tag = "2")]
7753    pub duration: ::core::option::Option<::prost_types::Duration>,
7754}
7755#[non_exhaustive]
7756#[derive(Clone, PartialEq, ::prost::Message)]
7757pub struct ExecuteTransactionRequest {
7758    /// The transaction to execute.
7759    #[prost(message, optional, tag = "1")]
7760    pub transaction: ::core::option::Option<Transaction>,
7761    /// Set of `UserSignature`s authorizing the execution of the provided
7762    /// transaction.
7763    #[prost(message, repeated, tag = "2")]
7764    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
7765    /// Mask specifying which fields to read.
7766    /// If no mask is specified, defaults to `effects.status,checkpoint`.
7767    #[prost(message, optional, tag = "3")]
7768    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7769}
7770/// Response message for `NodeService.ExecuteTransaction`.
7771#[non_exhaustive]
7772#[derive(Clone, PartialEq, ::prost::Message)]
7773pub struct ExecuteTransactionResponse {
7774    #[prost(message, optional, tag = "1")]
7775    pub transaction: ::core::option::Option<ExecutedTransaction>,
7776}
7777#[non_exhaustive]
7778#[derive(Clone, PartialEq, ::prost::Message)]
7779pub struct SimulateTransactionRequest {
7780    #[prost(message, optional, tag = "1")]
7781    pub transaction: ::core::option::Option<Transaction>,
7782    /// Mask specifying which fields to read.
7783    #[prost(message, optional, tag = "2")]
7784    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7785    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
7786    #[prost(
7787        enumeration = "simulate_transaction_request::TransactionChecks",
7788        optional,
7789        tag = "3"
7790    )]
7791    pub checks: ::core::option::Option<i32>,
7792    /// Perform gas selection based on a budget estimation and include the
7793    /// selected gas payment and budget in the response.
7794    ///
7795    /// This option will be ignored if `checks` is `DISABLED`.
7796    #[prost(bool, optional, tag = "4")]
7797    pub do_gas_selection: ::core::option::Option<bool>,
7798}
7799/// Nested message and enum types in `SimulateTransactionRequest`.
7800pub mod simulate_transaction_request {
7801    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
7802    #[non_exhaustive]
7803    #[derive(
7804        Clone,
7805        Copy,
7806        Debug,
7807        PartialEq,
7808        Eq,
7809        Hash,
7810        PartialOrd,
7811        Ord,
7812        ::prost::Enumeration
7813    )]
7814    #[repr(i32)]
7815    pub enum TransactionChecks {
7816        Enabled = 0,
7817        Disabled = 1,
7818    }
7819    impl TransactionChecks {
7820        /// String value of the enum field names used in the ProtoBuf definition.
7821        ///
7822        /// The values are not transformed in any way and thus are considered stable
7823        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
7824        pub fn as_str_name(&self) -> &'static str {
7825            match self {
7826                Self::Enabled => "ENABLED",
7827                Self::Disabled => "DISABLED",
7828            }
7829        }
7830        /// Creates an enum from field names used in the ProtoBuf definition.
7831        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
7832            match value {
7833                "ENABLED" => Some(Self::Enabled),
7834                "DISABLED" => Some(Self::Disabled),
7835                _ => None,
7836            }
7837        }
7838    }
7839}
7840#[non_exhaustive]
7841#[derive(Clone, PartialEq, ::prost::Message)]
7842pub struct SimulateTransactionResponse {
7843    #[prost(message, optional, tag = "1")]
7844    pub transaction: ::core::option::Option<ExecutedTransaction>,
7845    #[prost(message, repeated, tag = "2")]
7846    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
7847}
7848/// An intermediate result/output from the execution of a single command
7849#[non_exhaustive]
7850#[derive(Clone, PartialEq, ::prost::Message)]
7851pub struct CommandResult {
7852    #[prost(message, repeated, tag = "1")]
7853    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
7854    #[prost(message, repeated, tag = "2")]
7855    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
7856}
7857#[non_exhaustive]
7858#[derive(Clone, PartialEq, ::prost::Message)]
7859pub struct CommandOutput {
7860    #[prost(message, optional, tag = "1")]
7861    pub argument: ::core::option::Option<Argument>,
7862    #[prost(message, optional, tag = "2")]
7863    pub value: ::core::option::Option<Bcs>,
7864    /// JSON rendering of the output.
7865    #[prost(message, optional, boxed, tag = "3")]
7866    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
7867}
7868/// Generated client implementations.
7869pub mod transaction_execution_service_client {
7870    #![allow(
7871        unused_variables,
7872        dead_code,
7873        missing_docs,
7874        clippy::wildcard_imports,
7875        clippy::let_unit_value,
7876    )]
7877    use tonic::codegen::*;
7878    use tonic::codegen::http::Uri;
7879    #[derive(Debug, Clone)]
7880    pub struct TransactionExecutionServiceClient<T> {
7881        inner: tonic::client::Grpc<T>,
7882    }
7883    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
7884        /// Attempt to create a new client by connecting to a given endpoint.
7885        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7886        where
7887            D: TryInto<tonic::transport::Endpoint>,
7888            D::Error: Into<StdError>,
7889        {
7890            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7891            Ok(Self::new(conn))
7892        }
7893    }
7894    impl<T> TransactionExecutionServiceClient<T>
7895    where
7896        T: tonic::client::GrpcService<tonic::body::Body>,
7897        T::Error: Into<StdError>,
7898        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7899        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7900    {
7901        pub fn new(inner: T) -> Self {
7902            let inner = tonic::client::Grpc::new(inner);
7903            Self { inner }
7904        }
7905        pub fn with_origin(inner: T, origin: Uri) -> Self {
7906            let inner = tonic::client::Grpc::with_origin(inner, origin);
7907            Self { inner }
7908        }
7909        pub fn with_interceptor<F>(
7910            inner: T,
7911            interceptor: F,
7912        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
7913        where
7914            F: tonic::service::Interceptor,
7915            T::ResponseBody: Default,
7916            T: tonic::codegen::Service<
7917                http::Request<tonic::body::Body>,
7918                Response = http::Response<
7919                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7920                >,
7921            >,
7922            <T as tonic::codegen::Service<
7923                http::Request<tonic::body::Body>,
7924            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7925        {
7926            TransactionExecutionServiceClient::new(
7927                InterceptedService::new(inner, interceptor),
7928            )
7929        }
7930        /// Compress requests with the given encoding.
7931        ///
7932        /// This requires the server to support it otherwise it might respond with an
7933        /// error.
7934        #[must_use]
7935        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7936            self.inner = self.inner.send_compressed(encoding);
7937            self
7938        }
7939        /// Enable decompressing responses.
7940        #[must_use]
7941        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7942            self.inner = self.inner.accept_compressed(encoding);
7943            self
7944        }
7945        /// Limits the maximum size of a decoded message.
7946        ///
7947        /// Default: `4MB`
7948        #[must_use]
7949        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7950            self.inner = self.inner.max_decoding_message_size(limit);
7951            self
7952        }
7953        /// Limits the maximum size of an encoded message.
7954        ///
7955        /// Default: `usize::MAX`
7956        #[must_use]
7957        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7958            self.inner = self.inner.max_encoding_message_size(limit);
7959            self
7960        }
7961        pub async fn execute_transaction(
7962            &mut self,
7963            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
7964        ) -> std::result::Result<
7965            tonic::Response<super::ExecuteTransactionResponse>,
7966            tonic::Status,
7967        > {
7968            self.inner
7969                .ready()
7970                .await
7971                .map_err(|e| {
7972                    tonic::Status::unknown(
7973                        format!("Service was not ready: {}", e.into()),
7974                    )
7975                })?;
7976            let codec = tonic_prost::ProstCodec::default();
7977            let path = http::uri::PathAndQuery::from_static(
7978                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
7979            );
7980            let mut req = request.into_request();
7981            req.extensions_mut()
7982                .insert(
7983                    GrpcMethod::new(
7984                        "sui.rpc.v2.TransactionExecutionService",
7985                        "ExecuteTransaction",
7986                    ),
7987                );
7988            self.inner.unary(req, path, codec).await
7989        }
7990        pub async fn simulate_transaction(
7991            &mut self,
7992            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
7993        ) -> std::result::Result<
7994            tonic::Response<super::SimulateTransactionResponse>,
7995            tonic::Status,
7996        > {
7997            self.inner
7998                .ready()
7999                .await
8000                .map_err(|e| {
8001                    tonic::Status::unknown(
8002                        format!("Service was not ready: {}", e.into()),
8003                    )
8004                })?;
8005            let codec = tonic_prost::ProstCodec::default();
8006            let path = http::uri::PathAndQuery::from_static(
8007                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
8008            );
8009            let mut req = request.into_request();
8010            req.extensions_mut()
8011                .insert(
8012                    GrpcMethod::new(
8013                        "sui.rpc.v2.TransactionExecutionService",
8014                        "SimulateTransaction",
8015                    ),
8016                );
8017            self.inner.unary(req, path, codec).await
8018        }
8019    }
8020}
8021/// Generated server implementations.
8022pub mod transaction_execution_service_server {
8023    #![allow(
8024        unused_variables,
8025        dead_code,
8026        missing_docs,
8027        clippy::wildcard_imports,
8028        clippy::let_unit_value,
8029    )]
8030    use tonic::codegen::*;
8031    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
8032    #[async_trait]
8033    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
8034        async fn execute_transaction(
8035            &self,
8036            request: tonic::Request<super::ExecuteTransactionRequest>,
8037        ) -> std::result::Result<
8038            tonic::Response<super::ExecuteTransactionResponse>,
8039            tonic::Status,
8040        >;
8041        async fn simulate_transaction(
8042            &self,
8043            request: tonic::Request<super::SimulateTransactionRequest>,
8044        ) -> std::result::Result<
8045            tonic::Response<super::SimulateTransactionResponse>,
8046            tonic::Status,
8047        >;
8048    }
8049    #[derive(Debug)]
8050    pub struct TransactionExecutionServiceServer<T> {
8051        inner: Arc<T>,
8052        accept_compression_encodings: EnabledCompressionEncodings,
8053        send_compression_encodings: EnabledCompressionEncodings,
8054        max_decoding_message_size: Option<usize>,
8055        max_encoding_message_size: Option<usize>,
8056    }
8057    impl<T> TransactionExecutionServiceServer<T> {
8058        pub fn new(inner: T) -> Self {
8059            Self::from_arc(Arc::new(inner))
8060        }
8061        pub fn from_arc(inner: Arc<T>) -> Self {
8062            Self {
8063                inner,
8064                accept_compression_encodings: Default::default(),
8065                send_compression_encodings: Default::default(),
8066                max_decoding_message_size: None,
8067                max_encoding_message_size: None,
8068            }
8069        }
8070        pub fn with_interceptor<F>(
8071            inner: T,
8072            interceptor: F,
8073        ) -> InterceptedService<Self, F>
8074        where
8075            F: tonic::service::Interceptor,
8076        {
8077            InterceptedService::new(Self::new(inner), interceptor)
8078        }
8079        /// Enable decompressing requests with the given encoding.
8080        #[must_use]
8081        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
8082            self.accept_compression_encodings.enable(encoding);
8083            self
8084        }
8085        /// Compress responses with the given encoding, if the client supports it.
8086        #[must_use]
8087        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
8088            self.send_compression_encodings.enable(encoding);
8089            self
8090        }
8091        /// Limits the maximum size of a decoded message.
8092        ///
8093        /// Default: `4MB`
8094        #[must_use]
8095        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
8096            self.max_decoding_message_size = Some(limit);
8097            self
8098        }
8099        /// Limits the maximum size of an encoded message.
8100        ///
8101        /// Default: `usize::MAX`
8102        #[must_use]
8103        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
8104            self.max_encoding_message_size = Some(limit);
8105            self
8106        }
8107    }
8108    impl<T, B> tonic::codegen::Service<http::Request<B>>
8109    for TransactionExecutionServiceServer<T>
8110    where
8111        T: TransactionExecutionService,
8112        B: Body + std::marker::Send + 'static,
8113        B::Error: Into<StdError> + std::marker::Send + 'static,
8114    {
8115        type Response = http::Response<tonic::body::Body>;
8116        type Error = std::convert::Infallible;
8117        type Future = BoxFuture<Self::Response, Self::Error>;
8118        fn poll_ready(
8119            &mut self,
8120            _cx: &mut Context<'_>,
8121        ) -> Poll<std::result::Result<(), Self::Error>> {
8122            Poll::Ready(Ok(()))
8123        }
8124        fn call(&mut self, req: http::Request<B>) -> Self::Future {
8125            match req.uri().path() {
8126                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
8127                    #[allow(non_camel_case_types)]
8128                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
8129                        pub Arc<T>,
8130                    );
8131                    impl<
8132                        T: TransactionExecutionService,
8133                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
8134                    for ExecuteTransactionSvc<T> {
8135                        type Response = super::ExecuteTransactionResponse;
8136                        type Future = BoxFuture<
8137                            tonic::Response<Self::Response>,
8138                            tonic::Status,
8139                        >;
8140                        fn call(
8141                            &mut self,
8142                            request: tonic::Request<super::ExecuteTransactionRequest>,
8143                        ) -> Self::Future {
8144                            let inner = Arc::clone(&self.0);
8145                            let fut = async move {
8146                                <T as TransactionExecutionService>::execute_transaction(
8147                                        &inner,
8148                                        request,
8149                                    )
8150                                    .await
8151                            };
8152                            Box::pin(fut)
8153                        }
8154                    }
8155                    let accept_compression_encodings = self.accept_compression_encodings;
8156                    let send_compression_encodings = self.send_compression_encodings;
8157                    let max_decoding_message_size = self.max_decoding_message_size;
8158                    let max_encoding_message_size = self.max_encoding_message_size;
8159                    let inner = self.inner.clone();
8160                    let fut = async move {
8161                        let method = ExecuteTransactionSvc(inner);
8162                        let codec = tonic_prost::ProstCodec::default();
8163                        let mut grpc = tonic::server::Grpc::new(codec)
8164                            .apply_compression_config(
8165                                accept_compression_encodings,
8166                                send_compression_encodings,
8167                            )
8168                            .apply_max_message_size_config(
8169                                max_decoding_message_size,
8170                                max_encoding_message_size,
8171                            );
8172                        let res = grpc.unary(method, req).await;
8173                        Ok(res)
8174                    };
8175                    Box::pin(fut)
8176                }
8177                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
8178                    #[allow(non_camel_case_types)]
8179                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
8180                        pub Arc<T>,
8181                    );
8182                    impl<
8183                        T: TransactionExecutionService,
8184                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
8185                    for SimulateTransactionSvc<T> {
8186                        type Response = super::SimulateTransactionResponse;
8187                        type Future = BoxFuture<
8188                            tonic::Response<Self::Response>,
8189                            tonic::Status,
8190                        >;
8191                        fn call(
8192                            &mut self,
8193                            request: tonic::Request<super::SimulateTransactionRequest>,
8194                        ) -> Self::Future {
8195                            let inner = Arc::clone(&self.0);
8196                            let fut = async move {
8197                                <T as TransactionExecutionService>::simulate_transaction(
8198                                        &inner,
8199                                        request,
8200                                    )
8201                                    .await
8202                            };
8203                            Box::pin(fut)
8204                        }
8205                    }
8206                    let accept_compression_encodings = self.accept_compression_encodings;
8207                    let send_compression_encodings = self.send_compression_encodings;
8208                    let max_decoding_message_size = self.max_decoding_message_size;
8209                    let max_encoding_message_size = self.max_encoding_message_size;
8210                    let inner = self.inner.clone();
8211                    let fut = async move {
8212                        let method = SimulateTransactionSvc(inner);
8213                        let codec = tonic_prost::ProstCodec::default();
8214                        let mut grpc = tonic::server::Grpc::new(codec)
8215                            .apply_compression_config(
8216                                accept_compression_encodings,
8217                                send_compression_encodings,
8218                            )
8219                            .apply_max_message_size_config(
8220                                max_decoding_message_size,
8221                                max_encoding_message_size,
8222                            );
8223                        let res = grpc.unary(method, req).await;
8224                        Ok(res)
8225                    };
8226                    Box::pin(fut)
8227                }
8228                _ => {
8229                    Box::pin(async move {
8230                        let mut response = http::Response::new(
8231                            tonic::body::Body::default(),
8232                        );
8233                        let headers = response.headers_mut();
8234                        headers
8235                            .insert(
8236                                tonic::Status::GRPC_STATUS,
8237                                (tonic::Code::Unimplemented as i32).into(),
8238                            );
8239                        headers
8240                            .insert(
8241                                http::header::CONTENT_TYPE,
8242                                tonic::metadata::GRPC_CONTENT_TYPE,
8243                            );
8244                        Ok(response)
8245                    })
8246                }
8247            }
8248        }
8249    }
8250    impl<T> Clone for TransactionExecutionServiceServer<T> {
8251        fn clone(&self) -> Self {
8252            let inner = self.inner.clone();
8253            Self {
8254                inner,
8255                accept_compression_encodings: self.accept_compression_encodings,
8256                send_compression_encodings: self.send_compression_encodings,
8257                max_decoding_message_size: self.max_decoding_message_size,
8258                max_encoding_message_size: self.max_encoding_message_size,
8259            }
8260        }
8261    }
8262    /// Generated gRPC service name
8263    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
8264    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
8265        const NAME: &'static str = SERVICE_NAME;
8266    }
8267}