Skip to main content

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

1// This file is @generated by prost-build.
2/// An argument to a programmable transaction command.
3#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6    #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7    pub kind: ::core::option::Option<i32>,
8    /// Index of an input when `kind` is `INPUT`.
9    #[prost(uint32, optional, tag = "2")]
10    pub input: ::core::option::Option<u32>,
11    /// Index of a result when `kind` is `RESULT`.
12    #[prost(uint32, optional, tag = "3")]
13    pub result: ::core::option::Option<u32>,
14    /// Used to access a nested result when `kind` is `RESULT`.
15    #[prost(uint32, optional, tag = "4")]
16    pub subresult: ::core::option::Option<u32>,
17}
18/// Nested message and enum types in `Argument`.
19pub mod argument {
20    #[non_exhaustive]
21    #[derive(
22        Clone,
23        Copy,
24        Debug,
25        PartialEq,
26        Eq,
27        Hash,
28        PartialOrd,
29        Ord,
30        ::prost::Enumeration
31    )]
32    #[repr(i32)]
33    pub enum ArgumentKind {
34        Unknown = 0,
35        /// The gas coin.
36        Gas = 1,
37        /// One of the input objects or primitive values (from
38        /// `ProgrammableTransaction` inputs).
39        Input = 2,
40        /// The result of another command (from `ProgrammableTransaction` commands).
41        Result = 3,
42    }
43    impl ArgumentKind {
44        /// String value of the enum field names used in the ProtoBuf definition.
45        ///
46        /// The values are not transformed in any way and thus are considered stable
47        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48        pub fn as_str_name(&self) -> &'static str {
49            match self {
50                Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51                Self::Gas => "GAS",
52                Self::Input => "INPUT",
53                Self::Result => "RESULT",
54            }
55        }
56        /// Creates an enum from field names used in the ProtoBuf definition.
57        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58            match value {
59                "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60                "GAS" => Some(Self::Gas),
61                "INPUT" => Some(Self::Input),
62                "RESULT" => Some(Self::Result),
63                _ => None,
64            }
65        }
66    }
67}
68/// The delta, or change, in balance for an address for a particular `Coin` type.
69#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72    /// The account address that is affected by this balance change event.
73    #[prost(string, optional, tag = "1")]
74    pub address: ::core::option::Option<::prost::alloc::string::String>,
75    /// The `Coin` type of this balance change event.
76    #[prost(string, optional, tag = "2")]
77    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78    /// The amount or change in balance.
79    #[prost(string, optional, tag = "3")]
80    pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82/// `Bcs` contains an arbitrary type that is serialized using the
83/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
84/// format as well as a name that identifies the type of the serialized value.
85#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88    /// Name that identifies the type of the serialized value.
89    #[prost(string, optional, tag = "1")]
90    pub name: ::core::option::Option<::prost::alloc::string::String>,
91    /// Bytes of a BCS serialized value.
92    #[prost(bytes = "bytes", optional, tag = "2")]
93    pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98    /// The height of this checkpoint.
99    #[prost(uint64, optional, tag = "1")]
100    pub sequence_number: ::core::option::Option<u64>,
101    /// The digest of this Checkpoint's CheckpointSummary.
102    #[prost(string, optional, tag = "2")]
103    pub digest: ::core::option::Option<::prost::alloc::string::String>,
104    /// The `CheckpointSummary` for this checkpoint.
105    #[prost(message, optional, tag = "3")]
106    pub summary: ::core::option::Option<CheckpointSummary>,
107    /// An aggregated quorum signature from the validator committee that
108    /// certified this checkpoint.
109    #[prost(message, optional, tag = "4")]
110    pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111    /// The `CheckpointContents` for this checkpoint.
112    #[prost(message, optional, tag = "5")]
113    pub contents: ::core::option::Option<CheckpointContents>,
114    /// List of transactions included in this checkpoint.
115    #[prost(message, repeated, tag = "6")]
116    pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117    /// Set of objects either referenced as inputs or produced as
118    /// outputs by transactions included in this checkpoint.
119    ///
120    /// In order to benefit from deduplication of objects that
121    /// appear in multiple transactions in this checkpoint, objects
122    /// will only be present here and the `transactions.objects`
123    /// field will not be populated.
124    #[prost(message, optional, tag = "7")]
125    pub objects: ::core::option::Option<ObjectSet>,
126}
127/// The committed to contents of a checkpoint.
128#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131    /// This CheckpointContents serialized as BCS.
132    #[prost(message, optional, tag = "1")]
133    pub bcs: ::core::option::Option<Bcs>,
134    /// The digest of this CheckpointContents.
135    #[prost(string, optional, tag = "2")]
136    pub digest: ::core::option::Option<::prost::alloc::string::String>,
137    /// Version of this CheckpointContents
138    #[prost(int32, optional, tag = "3")]
139    pub version: ::core::option::Option<i32>,
140    /// Set of transactions committed to in this checkpoint.
141    #[prost(message, repeated, tag = "4")]
142    pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144/// Transaction information committed to in a checkpoint.
145#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148    /// Digest of the transaction.
149    #[prost(string, optional, tag = "1")]
150    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151    /// Digest of the effects.
152    #[prost(string, optional, tag = "2")]
153    pub effects: ::core::option::Option<::prost::alloc::string::String>,
154    /// Set of user signatures that authorized the transaction.
155    #[prost(message, repeated, tag = "3")]
156    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157    /// The `AddressAliases` object version, if any, that was used to verify the
158    /// UserSignature at the same position in `signatures`.
159    ///
160    /// This field is present when CheckpointContents.version is >= 2.
161    #[prost(message, repeated, tag = "4")]
162    pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167    #[prost(uint64, optional, tag = "1")]
168    pub version: ::core::option::Option<u64>,
169}
170/// A header for a checkpoint on the Sui blockchain.
171///
172/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
173/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
174/// however, forms checkpoints after transaction execution has already happened to provide a
175/// certified history of the chain, instead of being formed before execution.
176///
177/// Checkpoints commit to a variety of state, including but not limited to:
178///
179/// * The hash of the previous checkpoint.
180/// * The set of transaction digests, their corresponding effects digests, as well as the set of
181///   user signatures that authorized its execution.
182/// * The objects produced by a transaction.
183/// * The set of live objects that make up the current state of the chain.
184/// * On epoch transitions, the next validator committee.
185///
186/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
187/// are the top-level type by which all the information is committed to transitively via cryptographic
188/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
189/// the validator committee in a given epoch to allow verification of the chain's state.
190#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193    /// This CheckpointSummary serialized as BCS.
194    #[prost(message, optional, tag = "1")]
195    pub bcs: ::core::option::Option<Bcs>,
196    /// The digest of this CheckpointSummary.
197    #[prost(string, optional, tag = "2")]
198    pub digest: ::core::option::Option<::prost::alloc::string::String>,
199    /// Epoch that this checkpoint belongs to.
200    #[prost(uint64, optional, tag = "3")]
201    pub epoch: ::core::option::Option<u64>,
202    /// The height of this checkpoint.
203    #[prost(uint64, optional, tag = "4")]
204    pub sequence_number: ::core::option::Option<u64>,
205    /// Total number of transactions committed since genesis, including those in this
206    /// checkpoint.
207    #[prost(uint64, optional, tag = "5")]
208    pub total_network_transactions: ::core::option::Option<u64>,
209    /// The hash of the `CheckpointContents` for this checkpoint.
210    #[prost(string, optional, tag = "6")]
211    pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212    /// The hash of the previous `CheckpointSummary`.
213    ///
214    /// This will be `None` only for the first, or genesis, checkpoint.
215    #[prost(string, optional, tag = "7")]
216    pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217    /// The running total gas costs of all transactions included in the current epoch so far
218    /// until this checkpoint.
219    #[prost(message, optional, tag = "8")]
220    pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221    /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
222    /// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
223    /// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
224    #[prost(message, optional, tag = "9")]
225    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226    /// Commitments to checkpoint-specific state.
227    #[prost(message, repeated, tag = "10")]
228    pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229    /// Extra data only present in the final checkpoint of an epoch.
230    #[prost(message, optional, tag = "11")]
231    pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232    /// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
233    /// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
234    /// opaque data can be added to checkpoints, which can be deserialized based on the current
235    /// protocol version.
236    #[prost(bytes = "bytes", optional, tag = "12")]
237    pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
240#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243    /// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
244    #[prost(message, repeated, tag = "1")]
245    pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246    /// The protocol version that is in effect during the next epoch.
247    #[prost(uint64, optional, tag = "2")]
248    pub next_epoch_protocol_version: ::core::option::Option<u64>,
249    /// Commitments to epoch specific state (live object set)
250    #[prost(message, repeated, tag = "3")]
251    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253/// A commitment made by a checkpoint.
254#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257    #[prost(
258        enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259        optional,
260        tag = "1"
261    )]
262    pub kind: ::core::option::Option<i32>,
263    #[prost(string, optional, tag = "2")]
264    pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266/// Nested message and enum types in `CheckpointCommitment`.
267pub mod checkpoint_commitment {
268    #[non_exhaustive]
269    #[derive(
270        Clone,
271        Copy,
272        Debug,
273        PartialEq,
274        Eq,
275        Hash,
276        PartialOrd,
277        Ord,
278        ::prost::Enumeration
279    )]
280    #[repr(i32)]
281    pub enum CheckpointCommitmentKind {
282        Unknown = 0,
283        /// An elliptic curve multiset hash attesting to the set of objects that
284        /// comprise the live state of the Sui blockchain.
285        EcmhLiveObjectSet = 1,
286        /// Digest of the checkpoint artifacts.
287        CheckpointArtifacts = 2,
288    }
289    impl CheckpointCommitmentKind {
290        /// String value of the enum field names used in the ProtoBuf definition.
291        ///
292        /// The values are not transformed in any way and thus are considered stable
293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
294        pub fn as_str_name(&self) -> &'static str {
295            match self {
296                Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297                Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298                Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299            }
300        }
301        /// Creates an enum from field names used in the ProtoBuf definition.
302        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303            match value {
304                "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305                "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306                "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307                _ => None,
308            }
309        }
310    }
311}
312/// The effects of executing a transaction.
313#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316    /// This TransactionEffects serialized as BCS.
317    #[prost(message, optional, tag = "1")]
318    pub bcs: ::core::option::Option<Bcs>,
319    /// The digest of this TransactionEffects.
320    #[prost(string, optional, tag = "2")]
321    pub digest: ::core::option::Option<::prost::alloc::string::String>,
322    /// Version of this TransactionEffects.
323    #[prost(int32, optional, tag = "3")]
324    pub version: ::core::option::Option<i32>,
325    /// The status of the execution.
326    #[prost(message, optional, tag = "4")]
327    pub status: ::core::option::Option<ExecutionStatus>,
328    /// The epoch when this transaction was executed.
329    #[prost(uint64, optional, tag = "5")]
330    pub epoch: ::core::option::Option<u64>,
331    /// The gas used by this transaction.
332    #[prost(message, optional, tag = "6")]
333    pub gas_used: ::core::option::Option<GasCostSummary>,
334    /// The transaction digest.
335    #[prost(string, optional, tag = "7")]
336    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337    /// Information about the gas object. Also present in the `changed_objects` vector.
338    ///
339    /// System transactions that don't require gas will leave this as `None`.
340    #[prost(message, optional, tag = "8")]
341    pub gas_object: ::core::option::Option<ChangedObject>,
342    /// The digest of the events emitted during execution,
343    /// can be `None` if the transaction does not emit any event.
344    #[prost(string, optional, tag = "9")]
345    pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346    /// The set of transaction digests this transaction depends on.
347    #[prost(string, repeated, tag = "10")]
348    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349    /// The version number of all the written objects (excluding packages) by this transaction.
350    #[prost(uint64, optional, tag = "11")]
351    pub lamport_version: ::core::option::Option<u64>,
352    /// Objects whose state are changed by this transaction.
353    #[prost(message, repeated, tag = "12")]
354    pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355    /// Consensus objects that are not mutated in this transaction. Unlike owned objects,
356    /// read-only consensus objects' version are not committed in the transaction,
357    /// and in order for a node to catch up and execute it without consensus sequencing,
358    /// the version needs to be committed in the effects.
359    #[prost(message, repeated, tag = "13")]
360    pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361    /// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
362    /// Storing it separately allows us to avoid bloating the effects with data that are not critical.
363    /// It also provides more flexibility on the format and type of the data.
364    #[prost(string, optional, tag = "14")]
365    pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366    #[prost(message, repeated, tag = "15")]
367    pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369/// Input/output state of an object that was changed during execution.
370#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373    /// ID of the object.
374    #[prost(string, optional, tag = "1")]
375    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376    #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377    pub input_state: ::core::option::Option<i32>,
378    /// Version of the object before this transaction executed.
379    #[prost(uint64, optional, tag = "3")]
380    pub input_version: ::core::option::Option<u64>,
381    /// Digest of the object before this transaction executed.
382    #[prost(string, optional, tag = "4")]
383    pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384    /// Owner of the object before this transaction executed.
385    #[prost(message, optional, tag = "5")]
386    pub input_owner: ::core::option::Option<Owner>,
387    #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388    pub output_state: ::core::option::Option<i32>,
389    /// Version of the object after this transaction executed.
390    #[prost(uint64, optional, tag = "7")]
391    pub output_version: ::core::option::Option<u64>,
392    /// Digest of the object after this transaction executed.
393    #[prost(string, optional, tag = "8")]
394    pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395    /// Owner of the object after this transaction executed.
396    #[prost(message, optional, tag = "9")]
397    pub output_owner: ::core::option::Option<Owner>,
398    /// The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
399    #[prost(message, optional, tag = "12")]
400    pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401    /// What happened to an `ObjectId` during execution.
402    #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403    pub id_operation: ::core::option::Option<i32>,
404    /// Type information is not provided by the effects structure but is instead
405    /// provided by an indexing layer
406    #[prost(string, optional, tag = "11")]
407    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409/// Nested message and enum types in `ChangedObject`.
410pub mod changed_object {
411    #[non_exhaustive]
412    #[derive(
413        Clone,
414        Copy,
415        Debug,
416        PartialEq,
417        Eq,
418        Hash,
419        PartialOrd,
420        Ord,
421        ::prost::Enumeration
422    )]
423    #[repr(i32)]
424    pub enum InputObjectState {
425        Unknown = 0,
426        DoesNotExist = 1,
427        Exists = 2,
428    }
429    impl InputObjectState {
430        /// String value of the enum field names used in the ProtoBuf definition.
431        ///
432        /// The values are not transformed in any way and thus are considered stable
433        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434        pub fn as_str_name(&self) -> &'static str {
435            match self {
436                Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437                Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438                Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439            }
440        }
441        /// Creates an enum from field names used in the ProtoBuf definition.
442        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443            match value {
444                "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445                "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446                "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447                _ => None,
448            }
449        }
450    }
451    #[non_exhaustive]
452    #[derive(
453        Clone,
454        Copy,
455        Debug,
456        PartialEq,
457        Eq,
458        Hash,
459        PartialOrd,
460        Ord,
461        ::prost::Enumeration
462    )]
463    #[repr(i32)]
464    pub enum OutputObjectState {
465        Unknown = 0,
466        DoesNotExist = 1,
467        ObjectWrite = 2,
468        PackageWrite = 3,
469        AccumulatorWrite = 4,
470    }
471    impl OutputObjectState {
472        /// String value of the enum field names used in the ProtoBuf definition.
473        ///
474        /// The values are not transformed in any way and thus are considered stable
475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
476        pub fn as_str_name(&self) -> &'static str {
477            match self {
478                Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479                Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480                Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481                Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482                Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489                "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490                "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491                "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492                "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493                _ => None,
494            }
495        }
496    }
497    #[non_exhaustive]
498    #[derive(
499        Clone,
500        Copy,
501        Debug,
502        PartialEq,
503        Eq,
504        Hash,
505        PartialOrd,
506        Ord,
507        ::prost::Enumeration
508    )]
509    #[repr(i32)]
510    pub enum IdOperation {
511        Unknown = 0,
512        None = 1,
513        Created = 2,
514        Deleted = 3,
515    }
516    impl IdOperation {
517        /// String value of the enum field names used in the ProtoBuf definition.
518        ///
519        /// The values are not transformed in any way and thus are considered stable
520        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521        pub fn as_str_name(&self) -> &'static str {
522            match self {
523                Self::Unknown => "ID_OPERATION_UNKNOWN",
524                Self::None => "NONE",
525                Self::Created => "CREATED",
526                Self::Deleted => "DELETED",
527            }
528        }
529        /// Creates an enum from field names used in the ProtoBuf definition.
530        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531            match value {
532                "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533                "NONE" => Some(Self::None),
534                "CREATED" => Some(Self::Created),
535                "DELETED" => Some(Self::Deleted),
536                _ => None,
537            }
538        }
539    }
540}
541/// An entry in an event digest accumulator value.
542#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545    /// Index of the event within its transaction.
546    #[prost(uint64, optional, tag = "1")]
547    pub event_index: ::core::option::Option<u64>,
548    /// Digest of the event.
549    #[prost(string, optional, tag = "2")]
550    pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555    #[prost(string, optional, tag = "1")]
556    pub address: ::core::option::Option<::prost::alloc::string::String>,
557    #[prost(string, optional, tag = "2")]
558    pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559    #[prost(
560        enumeration = "accumulator_write::AccumulatorOperation",
561        optional,
562        tag = "3"
563    )]
564    pub operation: ::core::option::Option<i32>,
565    #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566    pub value_kind: ::core::option::Option<i32>,
567    /// Set when the accumulator value is an integer (value_kind = INTEGER).
568    #[prost(uint64, optional, tag = "5")]
569    pub integer_value: ::core::option::Option<u64>,
570    /// Set, with len 2, when the accumulator value is an integer tuple
571    /// (value_kind = INTEGER_TUPLE).
572    #[prost(uint64, repeated, tag = "6")]
573    pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574    /// Set when the accumulator value is an event digest list (value_kind = EVENT_DIGEST).
575    /// Contains a non-empty list of (event_index, digest) pairs representing
576    /// authenticated event stream entries within a transaction.
577    #[prost(message, repeated, tag = "7")]
578    pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580/// Nested message and enum types in `AccumulatorWrite`.
581pub mod accumulator_write {
582    #[non_exhaustive]
583    #[derive(
584        Clone,
585        Copy,
586        Debug,
587        PartialEq,
588        Eq,
589        Hash,
590        PartialOrd,
591        Ord,
592        ::prost::Enumeration
593    )]
594    #[repr(i32)]
595    pub enum AccumulatorOperation {
596        Unknown = 0,
597        Merge = 1,
598        Split = 2,
599    }
600    impl AccumulatorOperation {
601        /// String value of the enum field names used in the ProtoBuf definition.
602        ///
603        /// The values are not transformed in any way and thus are considered stable
604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605        pub fn as_str_name(&self) -> &'static str {
606            match self {
607                Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608                Self::Merge => "MERGE",
609                Self::Split => "SPLIT",
610            }
611        }
612        /// Creates an enum from field names used in the ProtoBuf definition.
613        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614            match value {
615                "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616                "MERGE" => Some(Self::Merge),
617                "SPLIT" => Some(Self::Split),
618                _ => None,
619            }
620        }
621    }
622    #[non_exhaustive]
623    #[derive(
624        Clone,
625        Copy,
626        Debug,
627        PartialEq,
628        Eq,
629        Hash,
630        PartialOrd,
631        Ord,
632        ::prost::Enumeration
633    )]
634    #[repr(i32)]
635    pub enum AccumulatorValue {
636        Unknown = 0,
637        Integer = 1,
638        IntegerTuple = 2,
639        EventDigest = 3,
640    }
641    impl AccumulatorValue {
642        /// String value of the enum field names used in the ProtoBuf definition.
643        ///
644        /// The values are not transformed in any way and thus are considered stable
645        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
646        pub fn as_str_name(&self) -> &'static str {
647            match self {
648                Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649                Self::Integer => "INTEGER",
650                Self::IntegerTuple => "INTEGER_TUPLE",
651                Self::EventDigest => "EVENT_DIGEST",
652            }
653        }
654        /// Creates an enum from field names used in the ProtoBuf definition.
655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656            match value {
657                "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658                "INTEGER" => Some(Self::Integer),
659                "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660                "EVENT_DIGEST" => Some(Self::EventDigest),
661                _ => None,
662            }
663        }
664    }
665}
666/// A consensus object that wasn't changed during execution.
667#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670    #[prost(
671        enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672        optional,
673        tag = "1"
674    )]
675    pub kind: ::core::option::Option<i32>,
676    /// ObjectId of the consensus object.
677    #[prost(string, optional, tag = "2")]
678    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679    /// Version of the consensus object.
680    #[prost(uint64, optional, tag = "3")]
681    pub version: ::core::option::Option<u64>,
682    /// Digest of the consensus object.
683    #[prost(string, optional, tag = "4")]
684    pub digest: ::core::option::Option<::prost::alloc::string::String>,
685    /// Type information is not provided by the effects structure but is instead
686    /// provided by an indexing layer
687    #[prost(string, optional, tag = "5")]
688    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690/// Nested message and enum types in `UnchangedConsensusObject`.
691pub mod unchanged_consensus_object {
692    #[non_exhaustive]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum UnchangedConsensusObjectKind {
706        Unknown = 0,
707        /// Read-only consensus object from the input.
708        ReadOnlyRoot = 1,
709        /// Objects with ended consensus streams that appear mutably/owned in the input.
710        MutateConsensusStreamEnded = 2,
711        /// Objects with ended consensus streams objects that appear as read-only in the input.
712        ReadConsensusStreamEnded = 3,
713        /// Consensus objects that were congested and resulted in this transaction being
714        /// canceled.
715        Canceled = 4,
716        /// Read of a per-epoch config object that should remain the same during an
717        /// epoch. This optionally will indicate the sequence number of the config
718        /// object at the start of the epoch.
719        PerEpochConfig = 5,
720    }
721    impl UnchangedConsensusObjectKind {
722        /// String value of the enum field names used in the ProtoBuf definition.
723        ///
724        /// The values are not transformed in any way and thus are considered stable
725        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
726        pub fn as_str_name(&self) -> &'static str {
727            match self {
728                Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729                Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730                Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731                Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732                Self::Canceled => "CANCELED",
733                Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734            }
735        }
736        /// Creates an enum from field names used in the ProtoBuf definition.
737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738            match value {
739                "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740                "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741                "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742                "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743                "CANCELED" => Some(Self::Canceled),
744                "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745                _ => None,
746            }
747        }
748    }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753    #[prost(uint64, optional, tag = "1")]
754    pub epoch: ::core::option::Option<u64>,
755    /// The committee governing this epoch.
756    #[prost(message, optional, tag = "2")]
757    pub committee: ::core::option::Option<ValidatorCommittee>,
758    /// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
759    /// beginning of the epoch, for past epochs, or the current state for the
760    /// current epoch.
761    #[prost(message, optional, boxed, tag = "3")]
762    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763    #[prost(uint64, optional, tag = "4")]
764    pub first_checkpoint: ::core::option::Option<u64>,
765    #[prost(uint64, optional, tag = "5")]
766    pub last_checkpoint: ::core::option::Option<u64>,
767    #[prost(message, optional, tag = "6")]
768    pub start: ::core::option::Option<::prost_types::Timestamp>,
769    #[prost(message, optional, tag = "7")]
770    pub end: ::core::option::Option<::prost_types::Timestamp>,
771    /// Reference gas price denominated in MIST
772    #[prost(uint64, optional, tag = "8")]
773    pub reference_gas_price: ::core::option::Option<u64>,
774    #[prost(message, optional, tag = "9")]
775    pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777/// Error reasons in the `sui.io` error domain, used as the `reason` of a
778/// `google.rpc.ErrorInfo` or of a `google.rpc.BadRequest.FieldViolation`.
779#[non_exhaustive]
780#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
781#[repr(i32)]
782pub enum ErrorReason {
783    Unknown = 0,
784    FieldInvalid = 1,
785    FieldMissing = 2,
786    /// Gas selection could not find enough SUI to cover the gas budget.
787    /// `SimulateTransaction` returns this with `INVALID_ARGUMENT`. Gas selection
788    /// runs only when `do_gas_selection` is set, `checks` is not `DISABLED`, and
789    /// the transaction has no gas payment objects. When the server estimates the
790    /// budget and the transaction fails in that estimation, `SimulateTransaction`
791    /// returns `TRANSACTION_EXECUTION_FAILED` instead of this error, so with an
792    /// estimated budget this reason means the transaction executed successfully
793    /// in simulation.
794    ///
795    /// Example of an ErrorInfo when the gas owner holds a single 2246360 MIST
796    /// coin, has no address balance, and the transaction needs a budget of
797    /// 8924024 MIST:
798    ///
799    /// ```text
800    /// { "reason": "INSUFFICIENT_GAS_BALANCE",
801    ///    "domain": "sui.io",
802    ///    "metadata": {
803    ///      "owner": "0x0000000000000000000000000000000000000000000000000000000000000123",
804    ///      "requiredBudget": "8924024",
805    ///      "coinBalance": "2246360",
806    ///      "addressBalance": "0"
807    ///    }
808    /// }
809    /// ```
810    ///
811    /// Metadata, with amounts in MIST as decimal strings:
812    ///
813    /// * `owner`: the gas owner's address, as "0x" followed by 64 hex digits.
814    /// * `requiredBudget`: the gas budget the transaction needs. When the
815    ///   request leaves the budget unset, this is the server's estimate plus the
816    ///   cost of loading every coin counted in `coinBalance` beyond the first;
817    ///   otherwise it is the budget from the request. An estimated
818    ///   `requiredBudget` depends on how many coins the gas owner holds: when
819    ///   the owner already holds coins, sending it a new coin raises
820    ///   `requiredBudget` by up to the cost of loading one more coin. A new coin
821    ///   worth `requiredBudget` covers that increase unless `coinBalance` is
822    ///   less than the cost of loading one coin; a new coin worth only
823    ///   `requiredBudget` minus `coinBalance` can fall short.
824    /// * `coinBalance`: total of the gas owner's `Coin<SUI>` objects considered
825    ///   by gas selection: owned, non-consensus coins not already used as
826    ///   transaction inputs, largest first, up to the protocol's maximum number
827    ///   of gas payment objects.
828    /// * `addressBalance`: the gas owner's SUI address balance remaining after
829    ///   the transaction's own explicit SUI withdrawals from the gas owner; "0"
830    ///   if there is none.
831    ///
832    /// The two balances are reported separately because they combine
833    /// differently. When the transaction uses the gas coin (an `Argument` of kind
834    /// `GAS`), coins and address balance are combined to pay for gas. Otherwise
835    /// they are never combined: the address balance pays for gas only if it
836    /// alone covers the budget before coin-loading costs, which is at most
837    /// `requiredBudget`; if it does not, the coins alone must cover
838    /// `requiredBudget`.
839    InsufficientGasBalance = 3,
840    /// The transaction failed while executing in simulation. `SimulateTransaction`
841    /// returns this with `INVALID_ARGUMENT` when it estimates the budget, the
842    /// transaction fails in that estimation, and gas selection then cannot cover
843    /// the budget. It is returned instead of the `INSUFFICIENT_GAS_BALANCE`
844    /// reason in that case because the transaction fails even with its gas paid
845    /// for, so the gas budget is not what stops it; `kind` says what does. Some
846    /// kinds can still be fixed by adding funds: for example,
847    /// `INSUFFICIENT_FUNDS_FOR_WITHDRAW` means a balance the transaction
848    /// withdraws from holds too little. `INSUFFICIENT_GAS` cannot: the estimation
849    /// runs with the maximum gas budget, so it means the transaction needs more
850    /// gas than any budget allows. A gas owner that can cover the budget instead
851    /// gets a successful response whose `effects.status.error` describes the
852    /// failure.
853    ///
854    /// The status details also carry the `ExecutionError`, in the same form as
855    /// `effects.status.error`.
856    ///
857    /// Example of an ErrorInfo for a Move abort in the first command:
858    ///
859    /// ```text
860    /// { "reason": "TRANSACTION_EXECUTION_FAILED",
861    ///    "domain": "sui.io",
862    ///    "metadata": {
863    ///      "kind": "MOVE_ABORT",
864    ///      "command": "0"
865    ///    }
866    /// }
867    /// ```
868    ///
869    /// Metadata:
870    ///
871    /// * `kind`: the failure's `ExecutionError.ExecutionErrorKind` name.
872    /// * `command`: index of the command that failed, as a decimal string, or
873    ///   "" if no single command failed.
874    TransactionExecutionFailed = 4,
875}
876impl ErrorReason {
877    /// String value of the enum field names used in the ProtoBuf definition.
878    ///
879    /// The values are not transformed in any way and thus are considered stable
880    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
881    pub fn as_str_name(&self) -> &'static str {
882        match self {
883            Self::Unknown => "ERROR_REASON_UNKNOWN",
884            Self::FieldInvalid => "FIELD_INVALID",
885            Self::FieldMissing => "FIELD_MISSING",
886            Self::InsufficientGasBalance => "INSUFFICIENT_GAS_BALANCE",
887            Self::TransactionExecutionFailed => "TRANSACTION_EXECUTION_FAILED",
888        }
889    }
890    /// Creates an enum from field names used in the ProtoBuf definition.
891    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
892        match value {
893            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
894            "FIELD_INVALID" => Some(Self::FieldInvalid),
895            "FIELD_MISSING" => Some(Self::FieldMissing),
896            "INSUFFICIENT_GAS_BALANCE" => Some(Self::InsufficientGasBalance),
897            "TRANSACTION_EXECUTION_FAILED" => Some(Self::TransactionExecutionFailed),
898            _ => None,
899        }
900    }
901}
902/// Events emitted during the successful execution of a transaction.
903#[non_exhaustive]
904#[derive(Clone, PartialEq, ::prost::Message)]
905pub struct TransactionEvents {
906    /// This TransactionEvents serialized as BCS.
907    #[prost(message, optional, tag = "1")]
908    pub bcs: ::core::option::Option<Bcs>,
909    /// The digest of this TransactionEvents.
910    #[prost(string, optional, tag = "2")]
911    pub digest: ::core::option::Option<::prost::alloc::string::String>,
912    /// Set of events emitted by a transaction.
913    #[prost(message, repeated, tag = "3")]
914    pub events: ::prost::alloc::vec::Vec<Event>,
915}
916/// An event.
917#[non_exhaustive]
918#[derive(Clone, PartialEq, ::prost::Message)]
919pub struct Event {
920    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
921    /// event to be emitted.
922    #[prost(string, optional, tag = "1")]
923    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
924    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
925    /// event to be emitted.
926    #[prost(string, optional, tag = "2")]
927    pub module: ::core::option::Option<::prost::alloc::string::String>,
928    /// Address of the account that sent the transaction where this event was emitted.
929    #[prost(string, optional, tag = "3")]
930    pub sender: ::core::option::Option<::prost::alloc::string::String>,
931    /// The type of the event emitted.
932    #[prost(string, optional, tag = "4")]
933    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
934    /// BCS serialized bytes of the event.
935    #[prost(message, optional, tag = "5")]
936    pub contents: ::core::option::Option<Bcs>,
937    /// JSON rendering of the event.
938    #[prost(message, optional, boxed, tag = "6")]
939    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
940    /// The sequence number of the checkpoint that includes the transaction
941    /// that emitted this event. Populated when the event is delivered on its
942    /// own (for example via `LedgerService.ListEvents`); left unset when the
943    /// event is carried inside its transaction's `events` list, where the
944    /// enclosing `ExecutedTransaction` already provides this context.
945    #[prost(uint64, optional, tag = "7")]
946    pub checkpoint: ::core::option::Option<u64>,
947    /// The digest of the transaction that emitted this event.
948    #[prost(string, optional, tag = "8")]
949    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
950    /// Zero-based position of the emitting transaction within its containing
951    /// checkpoint. For clients verifying authenticated event streams this
952    /// index is part of the BCS-encoded `EventCommitment` leaf used to
953    /// construct the per-checkpoint merkle root.
954    #[prost(uint64, optional, tag = "9")]
955    pub transaction_index: ::core::option::Option<u64>,
956    /// Zero-based index of this event within its transaction's event list.
957    #[prost(uint32, optional, tag = "10")]
958    pub event_index: ::core::option::Option<u32>,
959}
960#[non_exhaustive]
961#[derive(Clone, PartialEq, ::prost::Message)]
962pub struct ExecutedTransaction {
963    /// The digest of this Transaction.
964    #[prost(string, optional, tag = "1")]
965    pub digest: ::core::option::Option<::prost::alloc::string::String>,
966    /// The transaction itself.
967    #[prost(message, optional, tag = "2")]
968    pub transaction: ::core::option::Option<Transaction>,
969    /// List of user signatures that are used to authorize the
970    /// execution of this transaction.
971    #[prost(message, repeated, tag = "3")]
972    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
973    /// The `TransactionEffects` for this transaction.
974    #[prost(message, optional, tag = "4")]
975    pub effects: ::core::option::Option<TransactionEffects>,
976    /// The `TransactionEvents` for this transaction.
977    ///
978    /// This field might be empty, even if it was explicitly requested, if the
979    /// transaction didn't produce any events.
980    /// `sui.types.TransactionEffects.events_digest` is populated if the
981    /// transaction produced any events.
982    #[prost(message, optional, tag = "5")]
983    pub events: ::core::option::Option<TransactionEvents>,
984    /// The sequence number for the checkpoint that includes this transaction.
985    #[prost(uint64, optional, tag = "6")]
986    pub checkpoint: ::core::option::Option<u64>,
987    /// The Unix timestamp of the checkpoint that includes this transaction.
988    #[prost(message, optional, tag = "7")]
989    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
990    #[prost(message, repeated, tag = "8")]
991    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
992    /// Set of objects either referenced as inputs or produced as
993    /// outputs from this Transaction.
994    #[prost(message, optional, tag = "9")]
995    pub objects: ::core::option::Option<ObjectSet>,
996    /// Zero-based position of this transaction within the checkpoint that
997    /// includes it.
998    #[prost(uint64, optional, tag = "10")]
999    pub transaction_index: ::core::option::Option<u64>,
1000}
1001/// The status of an executed transaction.
1002#[non_exhaustive]
1003#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1004pub struct ExecutionStatus {
1005    /// Indicates if the transaction was successful or not.
1006    #[prost(bool, optional, tag = "1")]
1007    pub success: ::core::option::Option<bool>,
1008    /// The error if `success` is false.
1009    #[prost(message, optional, tag = "2")]
1010    pub error: ::core::option::Option<ExecutionError>,
1011}
1012/// An error that can occur during the execution of a transaction.
1013#[non_exhaustive]
1014#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1015pub struct ExecutionError {
1016    /// A human readable description of the error
1017    #[prost(string, optional, tag = "1")]
1018    pub description: ::core::option::Option<::prost::alloc::string::String>,
1019    /// The command, if any, during which the error occurred.
1020    #[prost(uint64, optional, tag = "2")]
1021    pub command: ::core::option::Option<u64>,
1022    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
1023    pub kind: ::core::option::Option<i32>,
1024    #[prost(
1025        oneof = "execution_error::ErrorDetails",
1026        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
1027    )]
1028    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
1029}
1030/// Nested message and enum types in `ExecutionError`.
1031pub mod execution_error {
1032    #[non_exhaustive]
1033    #[derive(
1034        Clone,
1035        Copy,
1036        Debug,
1037        PartialEq,
1038        Eq,
1039        Hash,
1040        PartialOrd,
1041        Ord,
1042        ::prost::Enumeration
1043    )]
1044    #[repr(i32)]
1045    pub enum ExecutionErrorKind {
1046        Unknown = 0,
1047        /// Insufficient gas.
1048        InsufficientGas = 1,
1049        /// Invalid `Gas` object.
1050        InvalidGasObject = 2,
1051        /// Invariant violation.
1052        InvariantViolation = 3,
1053        /// Attempted to use feature that is not supported yet.
1054        FeatureNotYetSupported = 4,
1055        /// Move object is larger than the maximum allowed size.
1056        ObjectTooBig = 5,
1057        /// Package is larger than the maximum allowed size.
1058        PackageTooBig = 6,
1059        /// Circular object ownership.
1060        CircularObjectOwnership = 7,
1061        /// Insufficient coin balance for requested operation.
1062        InsufficientCoinBalance = 8,
1063        /// Coin balance overflowed an u64.
1064        CoinBalanceOverflow = 9,
1065        /// Publish error, non-zero address.
1066        /// The modules in the package must have their self-addresses set to zero.
1067        PublishErrorNonZeroAddress = 10,
1068        /// Sui Move bytecode verification error.
1069        SuiMoveVerificationError = 11,
1070        /// Error from a non-abort instruction.
1071        /// Possible causes:
1072        /// Arithmetic error, stack overflow, max value depth, or similar.
1073        MovePrimitiveRuntimeError = 12,
1074        /// Move runtime abort.
1075        MoveAbort = 13,
1076        /// Bytecode verification error.
1077        VmVerificationOrDeserializationError = 14,
1078        /// MoveVm invariant violation.
1079        VmInvariantViolation = 15,
1080        /// Function not found.
1081        FunctionNotFound = 16,
1082        /// Parity mismatch for Move function.
1083        /// The number of arguments does not match the number of parameters.
1084        ArityMismatch = 17,
1085        /// Type parity mismatch for Move function.
1086        /// Mismatch between the number of actual versus expected type arguments.
1087        TypeArityMismatch = 18,
1088        /// Non-entry function invoked. Move Call must start with an entry function.
1089        NonEntryFunctionInvoked = 19,
1090        /// Invalid command argument.
1091        CommandArgumentError = 20,
1092        /// Type argument error.
1093        TypeArgumentError = 21,
1094        /// Unused result without the drop ability.
1095        UnusedValueWithoutDrop = 22,
1096        /// Invalid public Move function signature.
1097        /// Unsupported return type for return value.
1098        InvalidPublicFunctionReturnType = 23,
1099        /// Invalid transfer object, object does not have public transfer.
1100        InvalidTransferObject = 24,
1101        /// Effects from the transaction are too large.
1102        EffectsTooLarge = 25,
1103        /// Publish or Upgrade is missing dependency.
1104        PublishUpgradeMissingDependency = 26,
1105        /// Publish or upgrade dependency downgrade.
1106        ///
1107        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
1108        /// on-chain version that is less than the version required by one of the package's
1109        /// transitive dependencies.
1110        PublishUpgradeDependencyDowngrade = 27,
1111        /// Invalid package upgrade.
1112        PackageUpgradeError = 28,
1113        /// Indicates the transaction tried to write objects too large to storage.
1114        WrittenObjectsTooLarge = 29,
1115        /// Certificate is on the deny list.
1116        CertificateDenied = 30,
1117        /// Sui Move bytecode verification timed out.
1118        SuiMoveVerificationTimedout = 31,
1119        /// The requested consensus object operation is not allowed.
1120        ConsensusObjectOperationNotAllowed = 32,
1121        /// Requested consensus object has been deleted.
1122        InputObjectDeleted = 33,
1123        /// Certificate is canceled due to congestion on consensus objects.
1124        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1125        /// Address is denied for this coin type.
1126        AddressDeniedForCoin = 35,
1127        /// Coin type is globally paused for use.
1128        CoinTypeGlobalPause = 36,
1129        /// Certificate is canceled because randomness could not be generated this epoch.
1130        ExecutionCanceledDueToRandomnessUnavailable = 37,
1131        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1132        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1133        /// type of the vector element.
1134        MoveVectorElemTooBig = 38,
1135        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1136        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1137        /// on the type of the value.
1138        MoveRawValueTooBig = 39,
1139        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1140        InvalidLinkage = 40,
1141        /// Insufficient funds for transaction withdrawal
1142        InsufficientFundsForWithdraw = 41,
1143        /// An input object with non-exclusive write mutability was modified
1144        NonExclusiveWriteInputObjectModified = 42,
1145    }
1146    impl ExecutionErrorKind {
1147        /// String value of the enum field names used in the ProtoBuf definition.
1148        ///
1149        /// The values are not transformed in any way and thus are considered stable
1150        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1151        pub fn as_str_name(&self) -> &'static str {
1152            match self {
1153                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1154                Self::InsufficientGas => "INSUFFICIENT_GAS",
1155                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1156                Self::InvariantViolation => "INVARIANT_VIOLATION",
1157                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1158                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1159                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1160                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1161                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1162                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1163                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1164                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1165                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1166                Self::MoveAbort => "MOVE_ABORT",
1167                Self::VmVerificationOrDeserializationError => {
1168                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1169                }
1170                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1171                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1172                Self::ArityMismatch => "ARITY_MISMATCH",
1173                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1174                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1175                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1176                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1177                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1178                Self::InvalidPublicFunctionReturnType => {
1179                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1180                }
1181                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1182                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1183                Self::PublishUpgradeMissingDependency => {
1184                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1185                }
1186                Self::PublishUpgradeDependencyDowngrade => {
1187                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1188                }
1189                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1190                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1191                Self::CertificateDenied => "CERTIFICATE_DENIED",
1192                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1193                Self::ConsensusObjectOperationNotAllowed => {
1194                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1195                }
1196                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1197                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1198                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1199                }
1200                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1201                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1202                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1203                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1204                }
1205                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1206                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1207                Self::InvalidLinkage => "INVALID_LINKAGE",
1208                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1209                Self::NonExclusiveWriteInputObjectModified => {
1210                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1211                }
1212            }
1213        }
1214        /// Creates an enum from field names used in the ProtoBuf definition.
1215        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1216            match value {
1217                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1218                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1219                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1220                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1221                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1222                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1223                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1224                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1225                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1226                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1227                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1228                    Some(Self::PublishErrorNonZeroAddress)
1229                }
1230                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1231                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1232                "MOVE_ABORT" => Some(Self::MoveAbort),
1233                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1234                    Some(Self::VmVerificationOrDeserializationError)
1235                }
1236                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1237                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1238                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1239                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1240                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1241                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1242                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1243                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1244                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1245                    Some(Self::InvalidPublicFunctionReturnType)
1246                }
1247                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1248                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1249                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1250                    Some(Self::PublishUpgradeMissingDependency)
1251                }
1252                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1253                    Some(Self::PublishUpgradeDependencyDowngrade)
1254                }
1255                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1256                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1257                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1258                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1259                    Some(Self::SuiMoveVerificationTimedout)
1260                }
1261                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1262                    Some(Self::ConsensusObjectOperationNotAllowed)
1263                }
1264                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1265                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1266                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1267                }
1268                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1269                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1270                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1271                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1272                }
1273                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1274                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1275                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1276                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1277                    Some(Self::InsufficientFundsForWithdraw)
1278                }
1279                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1280                    Some(Self::NonExclusiveWriteInputObjectModified)
1281                }
1282                _ => None,
1283            }
1284        }
1285    }
1286    #[non_exhaustive]
1287    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1288    pub enum ErrorDetails {
1289        #[prost(message, tag = "4")]
1290        Abort(super::MoveAbort),
1291        #[prost(message, tag = "5")]
1292        SizeError(super::SizeError),
1293        #[prost(message, tag = "6")]
1294        CommandArgumentError(super::CommandArgumentError),
1295        #[prost(message, tag = "7")]
1296        TypeArgumentError(super::TypeArgumentError),
1297        #[prost(message, tag = "8")]
1298        PackageUpgradeError(super::PackageUpgradeError),
1299        #[prost(message, tag = "9")]
1300        IndexError(super::IndexError),
1301        #[prost(string, tag = "10")]
1302        ObjectId(::prost::alloc::string::String),
1303        #[prost(message, tag = "11")]
1304        CoinDenyListError(super::CoinDenyListError),
1305        /// Set of objects that were congested, leading to the transaction's cancellation.
1306        #[prost(message, tag = "12")]
1307        CongestedObjects(super::CongestedObjects),
1308    }
1309}
1310#[non_exhaustive]
1311#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1312pub struct MoveAbort {
1313    #[prost(uint64, optional, tag = "1")]
1314    pub abort_code: ::core::option::Option<u64>,
1315    /// Location in Move where the error occurred.
1316    #[prost(message, optional, tag = "2")]
1317    pub location: ::core::option::Option<MoveLocation>,
1318    /// Extra error information if abort code is a "Clever Error"
1319    #[prost(message, optional, tag = "3")]
1320    pub clever_error: ::core::option::Option<CleverError>,
1321}
1322/// Location in Move bytecode where an error occurred.
1323#[non_exhaustive]
1324#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1325pub struct MoveLocation {
1326    /// The package ID.
1327    #[prost(string, optional, tag = "1")]
1328    pub package: ::core::option::Option<::prost::alloc::string::String>,
1329    /// The module name.
1330    #[prost(string, optional, tag = "2")]
1331    pub module: ::core::option::Option<::prost::alloc::string::String>,
1332    /// The function index.
1333    #[prost(uint32, optional, tag = "3")]
1334    pub function: ::core::option::Option<u32>,
1335    /// Offset of the instruction where the error occurred.
1336    #[prost(uint32, optional, tag = "4")]
1337    pub instruction: ::core::option::Option<u32>,
1338    /// The name of the function, if available.
1339    #[prost(string, optional, tag = "5")]
1340    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1341}
1342#[non_exhaustive]
1343#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1344pub struct CleverError {
1345    #[prost(uint64, optional, tag = "1")]
1346    pub error_code: ::core::option::Option<u64>,
1347    #[prost(uint64, optional, tag = "2")]
1348    pub line_number: ::core::option::Option<u64>,
1349    #[prost(string, optional, tag = "3")]
1350    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1351    #[prost(string, optional, tag = "4")]
1352    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1353    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1354    pub value: ::core::option::Option<clever_error::Value>,
1355}
1356/// Nested message and enum types in `CleverError`.
1357pub mod clever_error {
1358    #[non_exhaustive]
1359    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1360    pub enum Value {
1361        #[prost(string, tag = "5")]
1362        Rendered(::prost::alloc::string::String),
1363        #[prost(bytes, tag = "6")]
1364        Raw(::prost::bytes::Bytes),
1365    }
1366}
1367/// A size error.
1368#[non_exhaustive]
1369#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1370pub struct SizeError {
1371    /// The offending size.
1372    #[prost(uint64, optional, tag = "1")]
1373    pub size: ::core::option::Option<u64>,
1374    /// The maximum allowable size.
1375    #[prost(uint64, optional, tag = "2")]
1376    pub max_size: ::core::option::Option<u64>,
1377}
1378#[non_exhaustive]
1379#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1380pub struct IndexError {
1381    /// Index of an input or result.
1382    #[prost(uint32, optional, tag = "1")]
1383    pub index: ::core::option::Option<u32>,
1384    /// Index of a subresult.
1385    #[prost(uint32, optional, tag = "2")]
1386    pub subresult: ::core::option::Option<u32>,
1387}
1388#[non_exhaustive]
1389#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1390pub struct CoinDenyListError {
1391    /// Denied address.
1392    #[prost(string, optional, tag = "1")]
1393    pub address: ::core::option::Option<::prost::alloc::string::String>,
1394    /// Coin type.
1395    #[prost(string, optional, tag = "2")]
1396    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1397}
1398/// Set of objects that were congested, leading to the transaction's cancellation.
1399#[non_exhaustive]
1400#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1401pub struct CongestedObjects {
1402    #[prost(string, repeated, tag = "1")]
1403    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1404}
1405/// An error with an argument to a command.
1406#[non_exhaustive]
1407#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1408pub struct CommandArgumentError {
1409    /// Position of the problematic argument.
1410    #[prost(uint32, optional, tag = "1")]
1411    pub argument: ::core::option::Option<u32>,
1412    #[prost(
1413        enumeration = "command_argument_error::CommandArgumentErrorKind",
1414        optional,
1415        tag = "2"
1416    )]
1417    pub kind: ::core::option::Option<i32>,
1418    #[prost(message, optional, tag = "3")]
1419    pub index_error: ::core::option::Option<IndexError>,
1420}
1421/// Nested message and enum types in `CommandArgumentError`.
1422pub mod command_argument_error {
1423    #[non_exhaustive]
1424    #[derive(
1425        Clone,
1426        Copy,
1427        Debug,
1428        PartialEq,
1429        Eq,
1430        Hash,
1431        PartialOrd,
1432        Ord,
1433        ::prost::Enumeration
1434    )]
1435    #[repr(i32)]
1436    pub enum CommandArgumentErrorKind {
1437        Unknown = 0,
1438        /// The type of the value does not match the expected type.
1439        TypeMismatch = 1,
1440        /// The argument cannot be deserialized into a value of the specified type.
1441        InvalidBcsBytes = 2,
1442        /// The argument cannot be instantiated from raw bytes.
1443        InvalidUsageOfPureArgument = 3,
1444        /// Invalid argument to private entry function.
1445        /// Private entry functions cannot take arguments from other Move functions.
1446        InvalidArgumentToPrivateEntryFunction = 4,
1447        /// Out of bounds access to input or results.
1448        ///
1449        /// `index` field will be set indicating the invalid index value.
1450        IndexOutOfBounds = 5,
1451        /// Out of bounds access to subresult.
1452        ///
1453        /// `index` and `subresult` fields will be set indicating the invalid index value.
1454        SecondaryIndexOutOfBounds = 6,
1455        /// Invalid usage of result.
1456        /// Expected a single result but found either no return value or multiple.
1457        /// `index` field will be set indicating the invalid index value.
1458        InvalidResultArity = 7,
1459        /// Invalid usage of gas coin.
1460        /// The gas coin can only be used by-value with a `TransferObject` command.
1461        InvalidGasCoinUsage = 8,
1462        /// Invalid usage of Move value.
1463        /// - Mutably borrowed values require unique usage.
1464        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1465        /// - Taken values cannot be used again.
1466        InvalidValueUsage = 9,
1467        /// Immutable objects cannot be passed by-value.
1468        InvalidObjectByValue = 10,
1469        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1470        InvalidObjectByMutRef = 11,
1471        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1472        /// allowed.
1473        ConsensusObjectOperationNotAllowed = 12,
1474        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1475        /// multiple arguments.
1476        InvalidArgumentArity = 13,
1477        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1478        InvalidTransferObject = 14,
1479        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1480        /// all arguments must be the same object type.
1481        InvalidMakeMoveVecNonObjectArgument = 15,
1482        /// Specified argument location does not have a value and cannot be used
1483        ArgumentWithoutValue = 16,
1484        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1485        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1486        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1487        /// ability.
1488        CannotMoveBorrowedValue = 17,
1489        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1490        /// extension of that reference. This is likely due to this argument being used in a Move call
1491        /// that returns a reference, and that reference is used in a later command.
1492        CannotWriteToExtendedReference = 18,
1493        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1494        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1495        /// argument is mutable and another reference extends it and will be used in a later command.
1496        InvalidReferenceArgument = 19,
1497        /// Invalid usage of TxContext in the function signature. TxContext can only be used by
1498        /// reference, `&TxContext` or `&mut TxContext`. If used mutably, it must be the only
1499        /// TxContext parameter, and TxContext can never be returned from a Move call.
1500        InvalidTxContext = 20,
1501    }
1502    impl CommandArgumentErrorKind {
1503        /// String value of the enum field names used in the ProtoBuf definition.
1504        ///
1505        /// The values are not transformed in any way and thus are considered stable
1506        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1507        pub fn as_str_name(&self) -> &'static str {
1508            match self {
1509                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1510                Self::TypeMismatch => "TYPE_MISMATCH",
1511                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1512                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1513                Self::InvalidArgumentToPrivateEntryFunction => {
1514                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1515                }
1516                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1517                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1518                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1519                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1520                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1521                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1522                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1523                Self::ConsensusObjectOperationNotAllowed => {
1524                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1525                }
1526                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1527                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1528                Self::InvalidMakeMoveVecNonObjectArgument => {
1529                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1530                }
1531                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1532                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1533                Self::CannotWriteToExtendedReference => {
1534                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1535                }
1536                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1537                Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1538            }
1539        }
1540        /// Creates an enum from field names used in the ProtoBuf definition.
1541        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1542            match value {
1543                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1544                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1545                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1546                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1547                    Some(Self::InvalidUsageOfPureArgument)
1548                }
1549                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1550                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1551                }
1552                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1553                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1554                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1555                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1556                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1557                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1558                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1559                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1560                    Some(Self::ConsensusObjectOperationNotAllowed)
1561                }
1562                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1563                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1564                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1565                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1566                }
1567                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1568                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1569                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1570                    Some(Self::CannotWriteToExtendedReference)
1571                }
1572                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1573                "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1574                _ => None,
1575            }
1576        }
1577    }
1578}
1579/// An error with upgrading a package.
1580#[non_exhaustive]
1581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1582pub struct PackageUpgradeError {
1583    #[prost(
1584        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1585        optional,
1586        tag = "1"
1587    )]
1588    pub kind: ::core::option::Option<i32>,
1589    /// The Package Id.
1590    #[prost(string, optional, tag = "2")]
1591    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1592    /// A digest.
1593    #[prost(string, optional, tag = "3")]
1594    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1595    /// The policy.
1596    #[prost(uint32, optional, tag = "4")]
1597    pub policy: ::core::option::Option<u32>,
1598    /// The ticket Id.
1599    #[prost(string, optional, tag = "5")]
1600    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1601}
1602/// Nested message and enum types in `PackageUpgradeError`.
1603pub mod package_upgrade_error {
1604    #[non_exhaustive]
1605    #[derive(
1606        Clone,
1607        Copy,
1608        Debug,
1609        PartialEq,
1610        Eq,
1611        Hash,
1612        PartialOrd,
1613        Ord,
1614        ::prost::Enumeration
1615    )]
1616    #[repr(i32)]
1617    pub enum PackageUpgradeErrorKind {
1618        Unknown = 0,
1619        /// Unable to fetch package.
1620        UnableToFetchPackage = 1,
1621        /// Object is not a package.
1622        NotAPackage = 2,
1623        /// Package upgrade is incompatible with previous version.
1624        IncompatibleUpgrade = 3,
1625        /// Digest in upgrade ticket and computed digest differ.
1626        DigestDoesNotMatch = 4,
1627        /// Upgrade policy is not valid.
1628        UnknownUpgradePolicy = 5,
1629        /// Package ID does not match `PackageId` in upgrade ticket.
1630        PackageIdDoesNotMatch = 6,
1631    }
1632    impl PackageUpgradeErrorKind {
1633        /// String value of the enum field names used in the ProtoBuf definition.
1634        ///
1635        /// The values are not transformed in any way and thus are considered stable
1636        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1637        pub fn as_str_name(&self) -> &'static str {
1638            match self {
1639                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1640                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1641                Self::NotAPackage => "NOT_A_PACKAGE",
1642                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1643                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1644                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1645                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1646            }
1647        }
1648        /// Creates an enum from field names used in the ProtoBuf definition.
1649        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1650            match value {
1651                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1652                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1653                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1654                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1655                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1656                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1657                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1658                _ => None,
1659            }
1660        }
1661    }
1662}
1663/// Type argument error.
1664#[non_exhaustive]
1665#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1666pub struct TypeArgumentError {
1667    /// Index of the problematic type argument.
1668    #[prost(uint32, optional, tag = "1")]
1669    pub type_argument: ::core::option::Option<u32>,
1670    #[prost(
1671        enumeration = "type_argument_error::TypeArgumentErrorKind",
1672        optional,
1673        tag = "2"
1674    )]
1675    pub kind: ::core::option::Option<i32>,
1676}
1677/// Nested message and enum types in `TypeArgumentError`.
1678pub mod type_argument_error {
1679    #[non_exhaustive]
1680    #[derive(
1681        Clone,
1682        Copy,
1683        Debug,
1684        PartialEq,
1685        Eq,
1686        Hash,
1687        PartialOrd,
1688        Ord,
1689        ::prost::Enumeration
1690    )]
1691    #[repr(i32)]
1692    pub enum TypeArgumentErrorKind {
1693        Unknown = 0,
1694        /// A type was not found in the module specified.
1695        TypeNotFound = 1,
1696        /// A type provided did not match the specified constraint.
1697        ConstraintNotSatisfied = 2,
1698    }
1699    impl TypeArgumentErrorKind {
1700        /// String value of the enum field names used in the ProtoBuf definition.
1701        ///
1702        /// The values are not transformed in any way and thus are considered stable
1703        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1704        pub fn as_str_name(&self) -> &'static str {
1705            match self {
1706                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1707                Self::TypeNotFound => "TYPE_NOT_FOUND",
1708                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1709            }
1710        }
1711        /// Creates an enum from field names used in the ProtoBuf definition.
1712        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1713            match value {
1714                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1715                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1716                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1717                _ => None,
1718            }
1719        }
1720    }
1721}
1722/// DNF filter for transactions: any term may match, and each term is an AND
1723/// of signed literals.
1724/// An absent filter matches everything. A present filter must have at least one
1725/// term.
1726#[derive(Eq, Hash)]
1727#[non_exhaustive]
1728#[derive(Clone, PartialEq, ::prost::Message)]
1729pub struct TransactionFilter {
1730    /// Terms are ORed together.
1731    #[prost(message, repeated, tag = "1")]
1732    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1733}
1734/// One conjunction in a transaction DNF filter.
1735#[derive(Eq, Hash)]
1736#[non_exhaustive]
1737#[derive(Clone, PartialEq, ::prost::Message)]
1738pub struct TransactionTerm {
1739    /// Literals are ANDed together.
1740    #[prost(message, repeated, tag = "1")]
1741    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1742}
1743/// One signed transaction predicate literal: a predicate, optionally negated.
1744#[non_exhaustive]
1745#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1746pub struct TransactionLiteral {
1747    /// When true, the literal matches transactions that the predicate does *not*
1748    /// match.
1749    #[prost(bool, tag = "1")]
1750    pub negated: bool,
1751    /// The transaction-index predicate to match.
1752    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1753    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1754}
1755/// Nested message and enum types in `TransactionLiteral`.
1756pub mod transaction_literal {
1757    /// The transaction-index predicate to match.
1758    #[non_exhaustive]
1759    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1760    pub enum Predicate {
1761        /// Match transactions sent by the specified address.
1762        #[prost(message, tag = "2")]
1763        Sender(super::SenderFilter),
1764        /// Match transactions where the specified address's state moved as a side
1765        /// effect: it owns an object after the txn, owned an object before the
1766        /// txn that was mutated/transferred away/deleted/wrapped, or its
1767        /// address-balance changed via an accumulator event.
1768        #[prost(message, tag = "3")]
1769        AffectedAddress(super::AffectedAddressFilter),
1770        /// Match transactions whose effects include a change for the specified
1771        /// object.
1772        #[prost(message, tag = "4")]
1773        AffectedObject(super::AffectedObjectFilter),
1774        /// Match transactions that made a Move call matching the specified filter.
1775        #[prost(message, tag = "5")]
1776        MoveCall(super::MoveCallFilter),
1777        /// Match transactions that emitted an event whose package/module fields
1778        /// match the specified filter.
1779        #[prost(message, tag = "6")]
1780        EmitModule(super::EmitModuleFilter),
1781        /// Match transactions that emitted an event with a type matching the
1782        /// specified filter.
1783        #[prost(message, tag = "7")]
1784        EventType(super::EventTypeFilter),
1785        /// Match transactions that wrote to the specified authenticated event
1786        /// stream head.
1787        #[prost(message, tag = "8")]
1788        EventStreamHead(super::EventStreamHeadFilter),
1789        /// Match transactions that wrote a Move package — a first publish or an
1790        /// upgrade, of any package.
1791        #[prost(message, tag = "9")]
1792        PackageWrite(super::PackageWriteFilter),
1793    }
1794}
1795/// DNF filter for events: any term may match, and each term is an AND of
1796/// signed literals. Sender predicates match all events from matching
1797/// transactions; emit-module, event-type, and event-stream-head predicates match
1798/// individual event-space dimensions. An absent filter matches everything. A
1799/// present filter must have at least one term.
1800#[non_exhaustive]
1801#[derive(Clone, PartialEq, ::prost::Message)]
1802pub struct EventFilter {
1803    /// Terms are ORed together.
1804    #[prost(message, repeated, tag = "1")]
1805    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1806}
1807/// One conjunction in an event DNF filter.
1808#[non_exhaustive]
1809#[derive(Clone, PartialEq, ::prost::Message)]
1810pub struct EventTerm {
1811    /// Literals are ANDed together.
1812    #[prost(message, repeated, tag = "1")]
1813    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1814}
1815/// One signed event predicate literal: a predicate, optionally negated.
1816#[non_exhaustive]
1817#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1818pub struct EventLiteral {
1819    /// When true, the literal matches events that the predicate does *not* match.
1820    #[prost(bool, tag = "1")]
1821    pub negated: bool,
1822    /// The event-index predicate to match.
1823    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1824    pub predicate: ::core::option::Option<event_literal::Predicate>,
1825}
1826/// Nested message and enum types in `EventLiteral`.
1827pub mod event_literal {
1828    /// The event-index predicate to match.
1829    #[non_exhaustive]
1830    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1831    pub enum Predicate {
1832        /// Match events from transactions sent by the specified address.
1833        #[prost(message, tag = "2")]
1834        Sender(super::SenderFilter),
1835        /// Match events whose package/module fields match the specified filter.
1836        #[prost(message, tag = "3")]
1837        EmitModule(super::EmitModuleFilter),
1838        /// Match events whose type matches the specified filter.
1839        #[prost(message, tag = "4")]
1840        EventType(super::EventTypeFilter),
1841        /// Match events committed to the specified authenticated event stream head.
1842        #[prost(message, tag = "5")]
1843        EventStreamHead(super::EventStreamHeadFilter),
1844    }
1845}
1846/// Match by transaction sender address.
1847#[non_exhaustive]
1848#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1849pub struct SenderFilter {
1850    /// The sender address (hex-encoded).
1851    #[prost(string, optional, tag = "1")]
1852    pub address: ::core::option::Option<::prost::alloc::string::String>,
1853}
1854/// Match by any address whose state moved as a side effect of the
1855/// transaction: object ownership changes (in either direction), prior
1856/// owners of removed/wrapped objects, and address-balance changes via
1857/// accumulator events.
1858#[non_exhaustive]
1859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1860pub struct AffectedAddressFilter {
1861    /// The affected address (hex-encoded).
1862    #[prost(string, optional, tag = "1")]
1863    pub address: ::core::option::Option<::prost::alloc::string::String>,
1864}
1865/// Match by changed object ID.
1866#[non_exhaustive]
1867#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1868pub struct AffectedObjectFilter {
1869    /// The changed object ID (hex-encoded).
1870    #[prost(string, optional, tag = "1")]
1871    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1872}
1873/// Match by Move function call, specified as a `::`-delimited Move path.
1874///
1875/// Specificity levels:
1876/// "0xpkg"                        -> matches any call in the package
1877/// "0xpkg::module"                -> matches any call in the module
1878/// "0xpkg::module::function"      -> matches calls to the exact function
1879#[non_exhaustive]
1880#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1881pub struct MoveCallFilter {
1882    /// Required. Move path of the form `package\[::module[::function]\]`.
1883    #[prost(string, optional, tag = "1")]
1884    pub function: ::core::option::Option<::prost::alloc::string::String>,
1885}
1886/// Match by an event's package/module fields, specified as a `::`-delimited
1887/// Move path. These identify the top-level Move call that triggered the event.
1888///
1889/// Specificity levels:
1890/// "0xpkg"               -> matches events with this package_id
1891/// "0xpkg::module"       -> matches events with this package_id and module
1892#[non_exhaustive]
1893#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1894pub struct EmitModuleFilter {
1895    /// Required. Move path of the form `package\[::module\]`.
1896    #[prost(string, optional, tag = "1")]
1897    pub module: ::core::option::Option<::prost::alloc::string::String>,
1898}
1899/// Match by event struct type, specified as a Move type string.
1900///
1901/// Specificity levels:
1902/// "0xaddr"                              -> matches events whose type is defined at this address
1903/// "0xaddr::module"                      -> matches events whose type is in this module
1904/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
1905/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
1906#[non_exhaustive]
1907#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1908pub struct EventTypeFilter {
1909    /// Required. Move type string of the form
1910    /// `address\[::module[::Name[<type_params>]\]]`.
1911    #[prost(string, optional, tag = "1")]
1912    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1913}
1914/// Match by authenticated event stream head.
1915#[non_exhaustive]
1916#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1917pub struct EventStreamHeadFilter {
1918    /// The stream id address (hex-encoded).
1919    #[prost(string, optional, tag = "1")]
1920    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1921}
1922/// Match transactions that wrote a Move package.
1923#[non_exhaustive]
1924#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1925pub struct PackageWriteFilter {}
1926/// Summary of gas charges.
1927#[non_exhaustive]
1928#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1929pub struct GasCostSummary {
1930    /// Cost of computation/execution.
1931    #[prost(uint64, optional, tag = "1")]
1932    pub computation_cost: ::core::option::Option<u64>,
1933    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1934    #[prost(uint64, optional, tag = "2")]
1935    pub storage_cost: ::core::option::Option<u64>,
1936    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1937    /// transaction.
1938    #[prost(uint64, optional, tag = "3")]
1939    pub storage_rebate: ::core::option::Option<u64>,
1940    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1941    #[prost(uint64, optional, tag = "4")]
1942    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1943}
1944/// An input to a user transaction.
1945#[non_exhaustive]
1946#[derive(Clone, PartialEq, ::prost::Message)]
1947pub struct Input {
1948    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1949    pub kind: ::core::option::Option<i32>,
1950    /// A move value serialized as BCS.
1951    ///
1952    /// For normal operations this is required to be a move primitive type and not contain structs
1953    /// or objects.
1954    #[prost(bytes = "bytes", optional, tag = "2")]
1955    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1956    /// `ObjectId` of the object input.
1957    #[prost(string, optional, tag = "3")]
1958    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1959    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1960    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1961    /// object when it was shared
1962    #[prost(uint64, optional, tag = "4")]
1963    pub version: ::core::option::Option<u64>,
1964    /// The digest of this object.
1965    #[prost(string, optional, tag = "5")]
1966    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1967    /// Controls whether the caller asks for a mutable reference to the shared
1968    /// object.
1969    #[prost(bool, optional, tag = "6")]
1970    pub mutable: ::core::option::Option<bool>,
1971    /// NOTE: For backwards compatibility purposes the addition of the new
1972    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1973    /// The old `mutable` field will continue to be populated and respected as an
1974    /// input for the time being.
1975    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1976    pub mutability: ::core::option::Option<i32>,
1977    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1978    #[prost(message, optional, tag = "8")]
1979    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1980    /// A literal value
1981    ///
1982    /// INPUT ONLY
1983    #[prost(message, optional, boxed, tag = "1000")]
1984    pub literal: ::core::option::Option<
1985        ::prost::alloc::boxed::Box<::prost_types::Value>,
1986    >,
1987}
1988/// Nested message and enum types in `Input`.
1989pub mod input {
1990    #[non_exhaustive]
1991    #[derive(
1992        Clone,
1993        Copy,
1994        Debug,
1995        PartialEq,
1996        Eq,
1997        Hash,
1998        PartialOrd,
1999        Ord,
2000        ::prost::Enumeration
2001    )]
2002    #[repr(i32)]
2003    pub enum InputKind {
2004        Unknown = 0,
2005        /// A move value serialized as BCS.
2006        Pure = 1,
2007        /// A Move object that is either immutable or address owned.
2008        ImmutableOrOwned = 2,
2009        /// A Move object whose owner is "Shared".
2010        Shared = 3,
2011        /// A Move object that is attempted to be received in this transaction.
2012        Receiving = 4,
2013        /// Reservation to withdraw balance from a funds accumulator
2014        FundsWithdrawal = 5,
2015    }
2016    impl InputKind {
2017        /// String value of the enum field names used in the ProtoBuf definition.
2018        ///
2019        /// The values are not transformed in any way and thus are considered stable
2020        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2021        pub fn as_str_name(&self) -> &'static str {
2022            match self {
2023                Self::Unknown => "INPUT_KIND_UNKNOWN",
2024                Self::Pure => "PURE",
2025                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
2026                Self::Shared => "SHARED",
2027                Self::Receiving => "RECEIVING",
2028                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
2029            }
2030        }
2031        /// Creates an enum from field names used in the ProtoBuf definition.
2032        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2033            match value {
2034                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
2035                "PURE" => Some(Self::Pure),
2036                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
2037                "SHARED" => Some(Self::Shared),
2038                "RECEIVING" => Some(Self::Receiving),
2039                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
2040                _ => None,
2041            }
2042        }
2043    }
2044    #[non_exhaustive]
2045    #[derive(
2046        Clone,
2047        Copy,
2048        Debug,
2049        PartialEq,
2050        Eq,
2051        Hash,
2052        PartialOrd,
2053        Ord,
2054        ::prost::Enumeration
2055    )]
2056    #[repr(i32)]
2057    pub enum Mutability {
2058        Unknown = 0,
2059        Immutable = 1,
2060        Mutable = 2,
2061        /// Non-exclusive write is used to allow multiple transactions to
2062        /// simultaneously add disjoint dynamic fields to an object.
2063        /// (Currently only used by settlement transactions).
2064        NonExclusiveWrite = 3,
2065    }
2066    impl Mutability {
2067        /// String value of the enum field names used in the ProtoBuf definition.
2068        ///
2069        /// The values are not transformed in any way and thus are considered stable
2070        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2071        pub fn as_str_name(&self) -> &'static str {
2072            match self {
2073                Self::Unknown => "MUTABILITY_UNKNOWN",
2074                Self::Immutable => "IMMUTABLE",
2075                Self::Mutable => "MUTABLE",
2076                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
2077            }
2078        }
2079        /// Creates an enum from field names used in the ProtoBuf definition.
2080        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2081            match value {
2082                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
2083                "IMMUTABLE" => Some(Self::Immutable),
2084                "MUTABLE" => Some(Self::Mutable),
2085                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
2086                _ => None,
2087            }
2088        }
2089    }
2090}
2091#[non_exhaustive]
2092#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2093pub struct FundsWithdrawal {
2094    #[prost(uint64, optional, tag = "1")]
2095    pub amount: ::core::option::Option<u64>,
2096    #[prost(string, optional, tag = "2")]
2097    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2098    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2099    pub source: ::core::option::Option<i32>,
2100    /// The address whose balance is debited if `source` is `SENDER_ALLOWANCE`.
2101    #[prost(string, optional, tag = "4")]
2102    pub funder: ::core::option::Option<::prost::alloc::string::String>,
2103    /// `ObjectId` of the allowance object authorizing the withdrawal if `source`
2104    /// is `SENDER_ALLOWANCE`.
2105    #[prost(string, optional, tag = "5")]
2106    pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2107}
2108/// Nested message and enum types in `FundsWithdrawal`.
2109pub mod funds_withdrawal {
2110    #[non_exhaustive]
2111    #[derive(
2112        Clone,
2113        Copy,
2114        Debug,
2115        PartialEq,
2116        Eq,
2117        Hash,
2118        PartialOrd,
2119        Ord,
2120        ::prost::Enumeration
2121    )]
2122    #[repr(i32)]
2123    pub enum Source {
2124        Unknown = 0,
2125        Sender = 1,
2126        Sponsor = 2,
2127        /// Withdraw from `funder`'s balance under the `allowance` object, granted
2128        /// to the sender of the transaction.
2129        SenderAllowance = 3,
2130    }
2131    impl Source {
2132        /// String value of the enum field names used in the ProtoBuf definition.
2133        ///
2134        /// The values are not transformed in any way and thus are considered stable
2135        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2136        pub fn as_str_name(&self) -> &'static str {
2137            match self {
2138                Self::Unknown => "SOURCE_UNKNOWN",
2139                Self::Sender => "SENDER",
2140                Self::Sponsor => "SPONSOR",
2141                Self::SenderAllowance => "SENDER_ALLOWANCE",
2142            }
2143        }
2144        /// Creates an enum from field names used in the ProtoBuf definition.
2145        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2146            match value {
2147                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2148                "SENDER" => Some(Self::Sender),
2149                "SPONSOR" => Some(Self::Sponsor),
2150                "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2151                _ => None,
2152            }
2153        }
2154    }
2155}
2156/// Key to uniquely identify a JWK.
2157#[non_exhaustive]
2158#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2159pub struct JwkId {
2160    /// The issuer or identity of the OIDC provider.
2161    #[prost(string, optional, tag = "1")]
2162    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2163    /// A key ID used to uniquely identify a key from an OIDC provider.
2164    #[prost(string, optional, tag = "2")]
2165    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2166}
2167/// A JSON web key.
2168///
2169/// Struct that contains info for a JWK. A list of them for different kinds can
2170/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2171/// The JWK is used to verify the JWT token.
2172#[non_exhaustive]
2173#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2174pub struct Jwk {
2175    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2176    #[prost(string, optional, tag = "1")]
2177    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2178    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2179    #[prost(string, optional, tag = "2")]
2180    pub e: ::core::option::Option<::prost::alloc::string::String>,
2181    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2182    #[prost(string, optional, tag = "3")]
2183    pub n: ::core::option::Option<::prost::alloc::string::String>,
2184    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2185    #[prost(string, optional, tag = "4")]
2186    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2187}
2188#[non_exhaustive]
2189#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2190pub struct GetServiceInfoRequest {}
2191#[non_exhaustive]
2192#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2193pub struct GetServiceInfoResponse {
2194    /// The chain identifier of the chain that this node is on.
2195    ///
2196    /// The chain identifier is the digest of the genesis checkpoint, the
2197    /// checkpoint with sequence number 0.
2198    #[prost(string, optional, tag = "1")]
2199    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2200    /// Human-readable name of the chain that this node is on.
2201    ///
2202    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2203    #[prost(string, optional, tag = "2")]
2204    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2205    /// Current epoch of the node based on its highest executed checkpoint.
2206    #[prost(uint64, optional, tag = "3")]
2207    pub epoch: ::core::option::Option<u64>,
2208    /// Checkpoint height of the most recently executed checkpoint.
2209    #[prost(uint64, optional, tag = "4")]
2210    pub checkpoint_height: ::core::option::Option<u64>,
2211    /// Unix timestamp of the most recently executed checkpoint.
2212    #[prost(message, optional, tag = "5")]
2213    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2214    /// The lowest checkpoint for which checkpoints and transaction data are available.
2215    #[prost(uint64, optional, tag = "6")]
2216    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2217    /// The lowest checkpoint for which object data is available.
2218    #[prost(uint64, optional, tag = "7")]
2219    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2220    /// Software version of the service. Similar to the `server` http header.
2221    #[prost(string, optional, tag = "8")]
2222    pub server: ::core::option::Option<::prost::alloc::string::String>,
2223}
2224#[non_exhaustive]
2225#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2226pub struct GetObjectRequest {
2227    /// Required. The `ObjectId` of the requested object.
2228    #[prost(string, optional, tag = "1")]
2229    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2230    /// Request a specific version of the object.
2231    /// If no version is specified, and the object is live, then the latest
2232    /// version of the object is returned.
2233    #[prost(uint64, optional, tag = "2")]
2234    pub version: ::core::option::Option<u64>,
2235    /// Mask specifying which fields to read.
2236    /// If no mask is specified, defaults to `object_id,version,digest`.
2237    #[prost(message, optional, tag = "3")]
2238    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2239}
2240#[non_exhaustive]
2241#[derive(Clone, PartialEq, ::prost::Message)]
2242pub struct GetObjectResponse {
2243    #[prost(message, optional, tag = "1")]
2244    pub object: ::core::option::Option<Object>,
2245}
2246#[non_exhaustive]
2247#[derive(Clone, PartialEq, ::prost::Message)]
2248pub struct BatchGetObjectsRequest {
2249    #[prost(message, repeated, tag = "1")]
2250    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2251    /// Mask specifying which fields to read.
2252    /// If no mask is specified, defaults to `object_id,version,digest`.
2253    #[prost(message, optional, tag = "2")]
2254    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2255}
2256#[non_exhaustive]
2257#[derive(Clone, PartialEq, ::prost::Message)]
2258pub struct BatchGetObjectsResponse {
2259    #[prost(message, repeated, tag = "1")]
2260    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2261}
2262#[non_exhaustive]
2263#[derive(Clone, PartialEq, ::prost::Message)]
2264pub struct GetObjectResult {
2265    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2266    pub result: ::core::option::Option<get_object_result::Result>,
2267}
2268/// Nested message and enum types in `GetObjectResult`.
2269pub mod get_object_result {
2270    #[non_exhaustive]
2271    #[derive(Clone, PartialEq, ::prost::Oneof)]
2272    pub enum Result {
2273        #[prost(message, tag = "1")]
2274        Object(super::Object),
2275        #[prost(message, tag = "2")]
2276        Error(super::super::super::super::google::rpc::Status),
2277    }
2278}
2279#[non_exhaustive]
2280#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2281pub struct GetTransactionRequest {
2282    /// Required. The digest of the requested transaction.
2283    #[prost(string, optional, tag = "1")]
2284    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2285    /// Mask specifying which fields to read.
2286    /// If no mask is specified, defaults to `digest`.
2287    #[prost(message, optional, tag = "2")]
2288    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2289}
2290#[non_exhaustive]
2291#[derive(Clone, PartialEq, ::prost::Message)]
2292pub struct GetTransactionResponse {
2293    #[prost(message, optional, tag = "1")]
2294    pub transaction: ::core::option::Option<ExecutedTransaction>,
2295}
2296#[non_exhaustive]
2297#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2298pub struct BatchGetTransactionsRequest {
2299    /// Required. The digests of the requested transactions.
2300    #[prost(string, repeated, tag = "1")]
2301    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2302    /// Mask specifying which fields to read.
2303    /// If no mask is specified, defaults to `digest`.
2304    #[prost(message, optional, tag = "2")]
2305    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2306}
2307#[non_exhaustive]
2308#[derive(Clone, PartialEq, ::prost::Message)]
2309pub struct BatchGetTransactionsResponse {
2310    #[prost(message, repeated, tag = "1")]
2311    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2312}
2313#[non_exhaustive]
2314#[derive(Clone, PartialEq, ::prost::Message)]
2315pub struct GetTransactionResult {
2316    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2317    pub result: ::core::option::Option<get_transaction_result::Result>,
2318}
2319/// Nested message and enum types in `GetTransactionResult`.
2320pub mod get_transaction_result {
2321    #[non_exhaustive]
2322    #[derive(Clone, PartialEq, ::prost::Oneof)]
2323    pub enum Result {
2324        #[prost(message, tag = "1")]
2325        Transaction(super::ExecutedTransaction),
2326        #[prost(message, tag = "2")]
2327        Error(super::super::super::super::google::rpc::Status),
2328    }
2329}
2330#[non_exhaustive]
2331#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2332pub struct GetCheckpointRequest {
2333    /// Mask specifying which fields to read.
2334    /// If no mask is specified, defaults to `sequence_number,digest`.
2335    #[prost(message, optional, tag = "3")]
2336    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2337    /// If neither is provided, return the latest
2338    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2339    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2340}
2341/// Nested message and enum types in `GetCheckpointRequest`.
2342pub mod get_checkpoint_request {
2343    /// If neither is provided, return the latest
2344    #[non_exhaustive]
2345    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2346    pub enum CheckpointId {
2347        /// The sequence number of the requested checkpoint.
2348        #[prost(uint64, tag = "1")]
2349        SequenceNumber(u64),
2350        /// The digest of the requested checkpoint.
2351        #[prost(string, tag = "2")]
2352        Digest(::prost::alloc::string::String),
2353    }
2354}
2355#[non_exhaustive]
2356#[derive(Clone, PartialEq, ::prost::Message)]
2357pub struct GetCheckpointResponse {
2358    #[prost(message, optional, tag = "1")]
2359    pub checkpoint: ::core::option::Option<Checkpoint>,
2360}
2361#[non_exhaustive]
2362#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2363pub struct GetEpochRequest {
2364    /// The requested epoch.
2365    /// If no epoch is provided the current epoch will be returned.
2366    #[prost(uint64, optional, tag = "1")]
2367    pub epoch: ::core::option::Option<u64>,
2368    /// Mask specifying which fields to read.
2369    /// If no mask is specified, defaults to `epoch`.
2370    #[prost(message, optional, tag = "2")]
2371    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2372}
2373#[non_exhaustive]
2374#[derive(Clone, PartialEq, ::prost::Message)]
2375pub struct GetEpochResponse {
2376    #[prost(message, optional, tag = "1")]
2377    pub epoch: ::core::option::Option<Epoch>,
2378}
2379/// Request message for LedgerService.ListCheckpoints.
2380#[non_exhaustive]
2381#[derive(Clone, PartialEq, ::prost::Message)]
2382pub struct ListCheckpointsRequest {
2383    /// Optional. Mask for specifying which parts of the Checkpoint should be
2384    /// returned (e.g. summary, contents, signatures).
2385    #[prost(message, optional, tag = "1")]
2386    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2387    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2388    /// genesis.
2389    #[prost(uint64, optional, tag = "2")]
2390    pub start_checkpoint: ::core::option::Option<u64>,
2391    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2392    /// current indexed ledger tip.
2393    #[prost(uint64, optional, tag = "3")]
2394    pub end_checkpoint: ::core::option::Option<u64>,
2395    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
2396    /// matches if any transaction it contains satisfies the filter. If absent,
2397    /// all checkpoints in the range are returned.
2398    #[prost(message, optional, tag = "4")]
2399    pub filter: ::core::option::Option<TransactionFilter>,
2400    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2401    /// order with the default item limit. The server enforces a maximum item
2402    /// limit and silently coerces larger values down to it. To paginate, pass
2403    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2404    /// `options.before` (descending) on the next request.
2405    #[prost(message, optional, tag = "5")]
2406    pub options: ::core::option::Option<QueryOptions>,
2407}
2408/// Response message for LedgerService.ListCheckpoints.
2409///
2410/// Every frame carries a `watermark` with a safe resume cursor. A frame
2411/// with `checkpoint` set delivers one matching item; a frame without it reports
2412/// scan progress or terminal completion. Watermarks never regress in the
2413/// requested ordering but may repeat.
2414///
2415/// `end` is set exactly once, on the final frame of a successful stream. For
2416/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2417/// every other end reason, the final frame has no `checkpoint` payload.
2418#[non_exhaustive]
2419#[derive(Clone, PartialEq, ::prost::Message)]
2420pub struct ListCheckpointsResponse {
2421    /// One matching checkpoint.
2422    #[prost(message, optional, tag = "1")]
2423    pub checkpoint: ::core::option::Option<Checkpoint>,
2424    /// Progress watermark as of this frame. Present on every frame. A
2425    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2426    /// its authoritative scan frontier was already emitted.
2427    #[prost(message, optional, tag = "2")]
2428    pub watermark: ::core::option::Option<Watermark>,
2429    /// Set exactly once, on the final frame of a successful query stream.
2430    #[prost(message, optional, tag = "3")]
2431    pub end: ::core::option::Option<QueryEnd>,
2432}
2433/// Request message for LedgerService.ListTransactions.
2434#[non_exhaustive]
2435#[derive(Clone, PartialEq, ::prost::Message)]
2436pub struct ListTransactionsRequest {
2437    /// Optional. Mask for specifying which parts of the ExecutedTransaction
2438    /// should be returned.
2439    #[prost(message, optional, tag = "1")]
2440    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2441    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2442    /// genesis.
2443    #[prost(uint64, optional, tag = "2")]
2444    pub start_checkpoint: ::core::option::Option<u64>,
2445    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2446    /// current indexed ledger tip.
2447    #[prost(uint64, optional, tag = "3")]
2448    pub end_checkpoint: ::core::option::Option<u64>,
2449    /// Optional. DNF filter over indexed dimensions.
2450    /// If absent, all transactions in the range are returned.
2451    #[prost(message, optional, tag = "4")]
2452    pub filter: ::core::option::Option<TransactionFilter>,
2453    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2454    /// order with the default item limit. The server enforces a maximum item
2455    /// limit and silently coerces larger values down to it. To paginate, pass
2456    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2457    /// `options.before` (descending) on the next request.
2458    #[prost(message, optional, tag = "5")]
2459    pub options: ::core::option::Option<QueryOptions>,
2460}
2461/// Response message for LedgerService.ListTransactions.
2462///
2463/// Every frame carries a `watermark` with a safe resume cursor. A frame
2464/// with `transaction` set delivers one matching item; a frame without it reports
2465/// scan progress or terminal completion. Watermarks never regress in the
2466/// requested ordering but may repeat.
2467///
2468/// `end` is set exactly once, on the final frame of a successful stream. For
2469/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2470/// every other end reason, the final frame has no `transaction` payload.
2471#[non_exhaustive]
2472#[derive(Clone, PartialEq, ::prost::Message)]
2473pub struct ListTransactionsResponse {
2474    /// One matching transaction. Its position within the containing checkpoint
2475    /// is reported by `ExecutedTransaction.transaction_index`.
2476    #[prost(message, optional, tag = "1")]
2477    pub transaction: ::core::option::Option<ExecutedTransaction>,
2478    /// Progress watermark as of this frame. Present on every frame. A
2479    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2480    /// its authoritative scan frontier was already emitted.
2481    #[prost(message, optional, tag = "2")]
2482    pub watermark: ::core::option::Option<Watermark>,
2483    /// Set exactly once, on the final frame of a successful query stream.
2484    #[prost(message, optional, tag = "3")]
2485    pub end: ::core::option::Option<QueryEnd>,
2486}
2487/// Request message for LedgerService.ListEvents.
2488#[non_exhaustive]
2489#[derive(Clone, PartialEq, ::prost::Message)]
2490pub struct ListEventsRequest {
2491    /// Optional. Mask for specifying which parts of the Event should be returned.
2492    #[prost(message, optional, tag = "1")]
2493    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2494    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2495    /// genesis.
2496    #[prost(uint64, optional, tag = "2")]
2497    pub start_checkpoint: ::core::option::Option<u64>,
2498    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2499    /// current indexed ledger tip.
2500    #[prost(uint64, optional, tag = "3")]
2501    pub end_checkpoint: ::core::option::Option<u64>,
2502    /// Optional. DNF filter over indexed dimensions.
2503    /// If absent, all events in the range are returned.
2504    #[prost(message, optional, tag = "4")]
2505    pub filter: ::core::option::Option<EventFilter>,
2506    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2507    /// order with the default item limit. The server enforces a maximum item
2508    /// limit and silently coerces larger values down to it. To paginate, pass
2509    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2510    /// `options.before` (descending) on the next request.
2511    #[prost(message, optional, tag = "5")]
2512    pub options: ::core::option::Option<QueryOptions>,
2513}
2514/// Response message for LedgerService.ListEvents.
2515///
2516/// Every frame carries a `watermark` with a safe resume cursor. A frame
2517/// with `event` set delivers one matching item; a frame without it reports scan
2518/// progress or terminal completion. Watermarks never regress in the requested
2519/// ordering but may repeat.
2520///
2521/// `end` is set exactly once, on the final frame of a successful stream. For
2522/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2523/// every other end reason, the final frame has no `event` payload.
2524#[non_exhaustive]
2525#[derive(Clone, PartialEq, ::prost::Message)]
2526pub struct ListEventsResponse {
2527    /// One matching event. Its ledger position -- containing checkpoint,
2528    /// emitting transaction digest and offset, and index within that
2529    /// transaction's event list -- is reported by the corresponding fields on
2530    /// `Event`.
2531    #[prost(message, optional, tag = "1")]
2532    pub event: ::core::option::Option<Event>,
2533    /// Progress watermark as of this frame. Present on every frame. A
2534    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2535    /// its authoritative scan frontier was already emitted.
2536    #[prost(message, optional, tag = "2")]
2537    pub watermark: ::core::option::Option<Watermark>,
2538    /// Set exactly once, on the final frame of a successful query stream.
2539    #[prost(message, optional, tag = "3")]
2540    pub end: ::core::option::Option<QueryEnd>,
2541}
2542/// Generated client implementations.
2543pub mod ledger_service_client {
2544    #![allow(
2545        unused_variables,
2546        dead_code,
2547        missing_docs,
2548        clippy::wildcard_imports,
2549        clippy::let_unit_value,
2550    )]
2551    use tonic::codegen::*;
2552    use tonic::codegen::http::Uri;
2553    #[derive(Debug, Clone)]
2554    pub struct LedgerServiceClient<T> {
2555        inner: tonic::client::Grpc<T>,
2556    }
2557    impl LedgerServiceClient<tonic::transport::Channel> {
2558        /// Attempt to create a new client by connecting to a given endpoint.
2559        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2560        where
2561            D: TryInto<tonic::transport::Endpoint>,
2562            D::Error: Into<StdError>,
2563        {
2564            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2565            Ok(Self::new(conn))
2566        }
2567    }
2568    impl<T> LedgerServiceClient<T>
2569    where
2570        T: tonic::client::GrpcService<tonic::body::Body>,
2571        T::Error: Into<StdError>,
2572        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2573        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2574    {
2575        pub fn new(inner: T) -> Self {
2576            let inner = tonic::client::Grpc::new(inner);
2577            Self { inner }
2578        }
2579        pub fn with_origin(inner: T, origin: Uri) -> Self {
2580            let inner = tonic::client::Grpc::with_origin(inner, origin);
2581            Self { inner }
2582        }
2583        pub fn with_interceptor<F>(
2584            inner: T,
2585            interceptor: F,
2586        ) -> LedgerServiceClient<InterceptedService<T, F>>
2587        where
2588            F: tonic::service::Interceptor,
2589            T::ResponseBody: Default,
2590            T: tonic::codegen::Service<
2591                http::Request<tonic::body::Body>,
2592                Response = http::Response<
2593                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2594                >,
2595            >,
2596            <T as tonic::codegen::Service<
2597                http::Request<tonic::body::Body>,
2598            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2599        {
2600            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2601        }
2602        /// Compress requests with the given encoding.
2603        ///
2604        /// This requires the server to support it otherwise it might respond with an
2605        /// error.
2606        #[must_use]
2607        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2608            self.inner = self.inner.send_compressed(encoding);
2609            self
2610        }
2611        /// Enable decompressing responses.
2612        #[must_use]
2613        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2614            self.inner = self.inner.accept_compressed(encoding);
2615            self
2616        }
2617        /// Limits the maximum size of a decoded message.
2618        ///
2619        /// Default: `4MB`
2620        #[must_use]
2621        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2622            self.inner = self.inner.max_decoding_message_size(limit);
2623            self
2624        }
2625        /// Limits the maximum size of an encoded message.
2626        ///
2627        /// Default: `usize::MAX`
2628        #[must_use]
2629        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2630            self.inner = self.inner.max_encoding_message_size(limit);
2631            self
2632        }
2633        /// Query the service for general information about its current state.
2634        pub async fn get_service_info(
2635            &mut self,
2636            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2637        ) -> std::result::Result<
2638            tonic::Response<super::GetServiceInfoResponse>,
2639            tonic::Status,
2640        > {
2641            self.inner
2642                .ready()
2643                .await
2644                .map_err(|e| {
2645                    tonic::Status::unknown(
2646                        format!("Service was not ready: {}", e.into()),
2647                    )
2648                })?;
2649            let codec = tonic_prost::ProstCodec::default();
2650            let path = http::uri::PathAndQuery::from_static(
2651                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2652            );
2653            let mut req = request.into_request();
2654            req.extensions_mut()
2655                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2656            self.inner.unary(req, path, codec).await
2657        }
2658        pub async fn get_object(
2659            &mut self,
2660            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2661        ) -> std::result::Result<
2662            tonic::Response<super::GetObjectResponse>,
2663            tonic::Status,
2664        > {
2665            self.inner
2666                .ready()
2667                .await
2668                .map_err(|e| {
2669                    tonic::Status::unknown(
2670                        format!("Service was not ready: {}", e.into()),
2671                    )
2672                })?;
2673            let codec = tonic_prost::ProstCodec::default();
2674            let path = http::uri::PathAndQuery::from_static(
2675                "/sui.rpc.v2.LedgerService/GetObject",
2676            );
2677            let mut req = request.into_request();
2678            req.extensions_mut()
2679                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2680            self.inner.unary(req, path, codec).await
2681        }
2682        pub async fn batch_get_objects(
2683            &mut self,
2684            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2685        ) -> std::result::Result<
2686            tonic::Response<super::BatchGetObjectsResponse>,
2687            tonic::Status,
2688        > {
2689            self.inner
2690                .ready()
2691                .await
2692                .map_err(|e| {
2693                    tonic::Status::unknown(
2694                        format!("Service was not ready: {}", e.into()),
2695                    )
2696                })?;
2697            let codec = tonic_prost::ProstCodec::default();
2698            let path = http::uri::PathAndQuery::from_static(
2699                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2700            );
2701            let mut req = request.into_request();
2702            req.extensions_mut()
2703                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2704            self.inner.unary(req, path, codec).await
2705        }
2706        pub async fn get_transaction(
2707            &mut self,
2708            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2709        ) -> std::result::Result<
2710            tonic::Response<super::GetTransactionResponse>,
2711            tonic::Status,
2712        > {
2713            self.inner
2714                .ready()
2715                .await
2716                .map_err(|e| {
2717                    tonic::Status::unknown(
2718                        format!("Service was not ready: {}", e.into()),
2719                    )
2720                })?;
2721            let codec = tonic_prost::ProstCodec::default();
2722            let path = http::uri::PathAndQuery::from_static(
2723                "/sui.rpc.v2.LedgerService/GetTransaction",
2724            );
2725            let mut req = request.into_request();
2726            req.extensions_mut()
2727                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2728            self.inner.unary(req, path, codec).await
2729        }
2730        pub async fn batch_get_transactions(
2731            &mut self,
2732            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2733        ) -> std::result::Result<
2734            tonic::Response<super::BatchGetTransactionsResponse>,
2735            tonic::Status,
2736        > {
2737            self.inner
2738                .ready()
2739                .await
2740                .map_err(|e| {
2741                    tonic::Status::unknown(
2742                        format!("Service was not ready: {}", e.into()),
2743                    )
2744                })?;
2745            let codec = tonic_prost::ProstCodec::default();
2746            let path = http::uri::PathAndQuery::from_static(
2747                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2748            );
2749            let mut req = request.into_request();
2750            req.extensions_mut()
2751                .insert(
2752                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2753                );
2754            self.inner.unary(req, path, codec).await
2755        }
2756        pub async fn get_checkpoint(
2757            &mut self,
2758            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2759        ) -> std::result::Result<
2760            tonic::Response<super::GetCheckpointResponse>,
2761            tonic::Status,
2762        > {
2763            self.inner
2764                .ready()
2765                .await
2766                .map_err(|e| {
2767                    tonic::Status::unknown(
2768                        format!("Service was not ready: {}", e.into()),
2769                    )
2770                })?;
2771            let codec = tonic_prost::ProstCodec::default();
2772            let path = http::uri::PathAndQuery::from_static(
2773                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2774            );
2775            let mut req = request.into_request();
2776            req.extensions_mut()
2777                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2778            self.inner.unary(req, path, codec).await
2779        }
2780        pub async fn get_epoch(
2781            &mut self,
2782            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2783        ) -> std::result::Result<
2784            tonic::Response<super::GetEpochResponse>,
2785            tonic::Status,
2786        > {
2787            self.inner
2788                .ready()
2789                .await
2790                .map_err(|e| {
2791                    tonic::Status::unknown(
2792                        format!("Service was not ready: {}", e.into()),
2793                    )
2794                })?;
2795            let codec = tonic_prost::ProstCodec::default();
2796            let path = http::uri::PathAndQuery::from_static(
2797                "/sui.rpc.v2.LedgerService/GetEpoch",
2798            );
2799            let mut req = request.into_request();
2800            req.extensions_mut()
2801                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2802            self.inner.unary(req, path, codec).await
2803        }
2804        /// List checkpoints matching the provided filters.
2805        ///
2806        /// Checkpoints are returned in ascending or descending checkpoint sequence
2807        /// number order according to the query options ordering.
2808        /// A checkpoint matches if any transaction it contains satisfies the filter.
2809        pub async fn list_checkpoints(
2810            &mut self,
2811            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2812        ) -> std::result::Result<
2813            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2814            tonic::Status,
2815        > {
2816            self.inner
2817                .ready()
2818                .await
2819                .map_err(|e| {
2820                    tonic::Status::unknown(
2821                        format!("Service was not ready: {}", e.into()),
2822                    )
2823                })?;
2824            let codec = tonic_prost::ProstCodec::default();
2825            let path = http::uri::PathAndQuery::from_static(
2826                "/sui.rpc.v2.LedgerService/ListCheckpoints",
2827            );
2828            let mut req = request.into_request();
2829            req.extensions_mut()
2830                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2831            self.inner.server_streaming(req, path, codec).await
2832        }
2833        /// List transactions matching the provided filters.
2834        ///
2835        /// Transactions are returned in ascending or descending transaction sequence
2836        /// order according to the query options ordering.
2837        pub async fn list_transactions(
2838            &mut self,
2839            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2840        ) -> std::result::Result<
2841            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2842            tonic::Status,
2843        > {
2844            self.inner
2845                .ready()
2846                .await
2847                .map_err(|e| {
2848                    tonic::Status::unknown(
2849                        format!("Service was not ready: {}", e.into()),
2850                    )
2851                })?;
2852            let codec = tonic_prost::ProstCodec::default();
2853            let path = http::uri::PathAndQuery::from_static(
2854                "/sui.rpc.v2.LedgerService/ListTransactions",
2855            );
2856            let mut req = request.into_request();
2857            req.extensions_mut()
2858                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2859            self.inner.server_streaming(req, path, codec).await
2860        }
2861        /// List events matching the provided filters.
2862        ///
2863        /// Events are returned in ascending or descending packed event sequence order
2864        /// according to the query options ordering.
2865        pub async fn list_events(
2866            &mut self,
2867            request: impl tonic::IntoRequest<super::ListEventsRequest>,
2868        ) -> std::result::Result<
2869            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2870            tonic::Status,
2871        > {
2872            self.inner
2873                .ready()
2874                .await
2875                .map_err(|e| {
2876                    tonic::Status::unknown(
2877                        format!("Service was not ready: {}", e.into()),
2878                    )
2879                })?;
2880            let codec = tonic_prost::ProstCodec::default();
2881            let path = http::uri::PathAndQuery::from_static(
2882                "/sui.rpc.v2.LedgerService/ListEvents",
2883            );
2884            let mut req = request.into_request();
2885            req.extensions_mut()
2886                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2887            self.inner.server_streaming(req, path, codec).await
2888        }
2889    }
2890}
2891/// Generated server implementations.
2892pub mod ledger_service_server {
2893    #![allow(
2894        unused_variables,
2895        dead_code,
2896        missing_docs,
2897        clippy::wildcard_imports,
2898        clippy::let_unit_value,
2899    )]
2900    use tonic::codegen::*;
2901    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2902    #[async_trait]
2903    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2904        /// Query the service for general information about its current state.
2905        async fn get_service_info(
2906            &self,
2907            request: tonic::Request<super::GetServiceInfoRequest>,
2908        ) -> std::result::Result<
2909            tonic::Response<super::GetServiceInfoResponse>,
2910            tonic::Status,
2911        > {
2912            Err(tonic::Status::unimplemented("Not yet implemented"))
2913        }
2914        async fn get_object(
2915            &self,
2916            request: tonic::Request<super::GetObjectRequest>,
2917        ) -> std::result::Result<
2918            tonic::Response<super::GetObjectResponse>,
2919            tonic::Status,
2920        > {
2921            Err(tonic::Status::unimplemented("Not yet implemented"))
2922        }
2923        async fn batch_get_objects(
2924            &self,
2925            request: tonic::Request<super::BatchGetObjectsRequest>,
2926        ) -> std::result::Result<
2927            tonic::Response<super::BatchGetObjectsResponse>,
2928            tonic::Status,
2929        > {
2930            Err(tonic::Status::unimplemented("Not yet implemented"))
2931        }
2932        async fn get_transaction(
2933            &self,
2934            request: tonic::Request<super::GetTransactionRequest>,
2935        ) -> std::result::Result<
2936            tonic::Response<super::GetTransactionResponse>,
2937            tonic::Status,
2938        > {
2939            Err(tonic::Status::unimplemented("Not yet implemented"))
2940        }
2941        async fn batch_get_transactions(
2942            &self,
2943            request: tonic::Request<super::BatchGetTransactionsRequest>,
2944        ) -> std::result::Result<
2945            tonic::Response<super::BatchGetTransactionsResponse>,
2946            tonic::Status,
2947        > {
2948            Err(tonic::Status::unimplemented("Not yet implemented"))
2949        }
2950        async fn get_checkpoint(
2951            &self,
2952            request: tonic::Request<super::GetCheckpointRequest>,
2953        ) -> std::result::Result<
2954            tonic::Response<super::GetCheckpointResponse>,
2955            tonic::Status,
2956        > {
2957            Err(tonic::Status::unimplemented("Not yet implemented"))
2958        }
2959        async fn get_epoch(
2960            &self,
2961            request: tonic::Request<super::GetEpochRequest>,
2962        ) -> std::result::Result<
2963            tonic::Response<super::GetEpochResponse>,
2964            tonic::Status,
2965        > {
2966            Err(tonic::Status::unimplemented("Not yet implemented"))
2967        }
2968        /// List checkpoints matching the provided filters.
2969        ///
2970        /// Checkpoints are returned in ascending or descending checkpoint sequence
2971        /// number order according to the query options ordering.
2972        /// A checkpoint matches if any transaction it contains satisfies the filter.
2973        async fn list_checkpoints(
2974            &self,
2975            request: tonic::Request<super::ListCheckpointsRequest>,
2976        ) -> std::result::Result<
2977            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2978            tonic::Status,
2979        > {
2980            Err(tonic::Status::unimplemented("Not yet implemented"))
2981        }
2982        /// List transactions matching the provided filters.
2983        ///
2984        /// Transactions are returned in ascending or descending transaction sequence
2985        /// order according to the query options ordering.
2986        async fn list_transactions(
2987            &self,
2988            request: tonic::Request<super::ListTransactionsRequest>,
2989        ) -> std::result::Result<
2990            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2991            tonic::Status,
2992        > {
2993            Err(tonic::Status::unimplemented("Not yet implemented"))
2994        }
2995        /// List events matching the provided filters.
2996        ///
2997        /// Events are returned in ascending or descending packed event sequence order
2998        /// according to the query options ordering.
2999        async fn list_events(
3000            &self,
3001            request: tonic::Request<super::ListEventsRequest>,
3002        ) -> std::result::Result<
3003            tonic::Response<BoxStream<super::ListEventsResponse>>,
3004            tonic::Status,
3005        > {
3006            Err(tonic::Status::unimplemented("Not yet implemented"))
3007        }
3008    }
3009    #[derive(Debug)]
3010    pub struct LedgerServiceServer<T> {
3011        inner: Arc<T>,
3012        accept_compression_encodings: EnabledCompressionEncodings,
3013        send_compression_encodings: EnabledCompressionEncodings,
3014        max_decoding_message_size: Option<usize>,
3015        max_encoding_message_size: Option<usize>,
3016    }
3017    impl<T> LedgerServiceServer<T> {
3018        pub fn new(inner: T) -> Self {
3019            Self::from_arc(Arc::new(inner))
3020        }
3021        pub fn from_arc(inner: Arc<T>) -> Self {
3022            Self {
3023                inner,
3024                accept_compression_encodings: Default::default(),
3025                send_compression_encodings: Default::default(),
3026                max_decoding_message_size: None,
3027                max_encoding_message_size: None,
3028            }
3029        }
3030        pub fn with_interceptor<F>(
3031            inner: T,
3032            interceptor: F,
3033        ) -> InterceptedService<Self, F>
3034        where
3035            F: tonic::service::Interceptor,
3036        {
3037            InterceptedService::new(Self::new(inner), interceptor)
3038        }
3039        /// Enable decompressing requests with the given encoding.
3040        #[must_use]
3041        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
3042            self.accept_compression_encodings.enable(encoding);
3043            self
3044        }
3045        /// Compress responses with the given encoding, if the client supports it.
3046        #[must_use]
3047        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
3048            self.send_compression_encodings.enable(encoding);
3049            self
3050        }
3051        /// Limits the maximum size of a decoded message.
3052        ///
3053        /// Default: `4MB`
3054        #[must_use]
3055        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
3056            self.max_decoding_message_size = Some(limit);
3057            self
3058        }
3059        /// Limits the maximum size of an encoded message.
3060        ///
3061        /// Default: `usize::MAX`
3062        #[must_use]
3063        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
3064            self.max_encoding_message_size = Some(limit);
3065            self
3066        }
3067    }
3068    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
3069    where
3070        T: LedgerService,
3071        B: Body + std::marker::Send + 'static,
3072        B::Error: Into<StdError> + std::marker::Send + 'static,
3073    {
3074        type Response = http::Response<tonic::body::Body>;
3075        type Error = std::convert::Infallible;
3076        type Future = BoxFuture<Self::Response, Self::Error>;
3077        fn poll_ready(
3078            &mut self,
3079            _cx: &mut Context<'_>,
3080        ) -> Poll<std::result::Result<(), Self::Error>> {
3081            Poll::Ready(Ok(()))
3082        }
3083        fn call(&mut self, req: http::Request<B>) -> Self::Future {
3084            match req.uri().path() {
3085                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
3086                    #[allow(non_camel_case_types)]
3087                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
3088                    impl<
3089                        T: LedgerService,
3090                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
3091                    for GetServiceInfoSvc<T> {
3092                        type Response = super::GetServiceInfoResponse;
3093                        type Future = BoxFuture<
3094                            tonic::Response<Self::Response>,
3095                            tonic::Status,
3096                        >;
3097                        fn call(
3098                            &mut self,
3099                            request: tonic::Request<super::GetServiceInfoRequest>,
3100                        ) -> Self::Future {
3101                            let inner = Arc::clone(&self.0);
3102                            let fut = async move {
3103                                <T as LedgerService>::get_service_info(&inner, request)
3104                                    .await
3105                            };
3106                            Box::pin(fut)
3107                        }
3108                    }
3109                    let accept_compression_encodings = self.accept_compression_encodings;
3110                    let send_compression_encodings = self.send_compression_encodings;
3111                    let max_decoding_message_size = self.max_decoding_message_size;
3112                    let max_encoding_message_size = self.max_encoding_message_size;
3113                    let inner = self.inner.clone();
3114                    let fut = async move {
3115                        let method = GetServiceInfoSvc(inner);
3116                        let codec = tonic_prost::ProstCodec::default();
3117                        let mut grpc = tonic::server::Grpc::new(codec)
3118                            .apply_compression_config(
3119                                accept_compression_encodings,
3120                                send_compression_encodings,
3121                            )
3122                            .apply_max_message_size_config(
3123                                max_decoding_message_size,
3124                                max_encoding_message_size,
3125                            );
3126                        let res = grpc.unary(method, req).await;
3127                        Ok(res)
3128                    };
3129                    Box::pin(fut)
3130                }
3131                "/sui.rpc.v2.LedgerService/GetObject" => {
3132                    #[allow(non_camel_case_types)]
3133                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3134                    impl<
3135                        T: LedgerService,
3136                    > tonic::server::UnaryService<super::GetObjectRequest>
3137                    for GetObjectSvc<T> {
3138                        type Response = super::GetObjectResponse;
3139                        type Future = BoxFuture<
3140                            tonic::Response<Self::Response>,
3141                            tonic::Status,
3142                        >;
3143                        fn call(
3144                            &mut self,
3145                            request: tonic::Request<super::GetObjectRequest>,
3146                        ) -> Self::Future {
3147                            let inner = Arc::clone(&self.0);
3148                            let fut = async move {
3149                                <T as LedgerService>::get_object(&inner, request).await
3150                            };
3151                            Box::pin(fut)
3152                        }
3153                    }
3154                    let accept_compression_encodings = self.accept_compression_encodings;
3155                    let send_compression_encodings = self.send_compression_encodings;
3156                    let max_decoding_message_size = self.max_decoding_message_size;
3157                    let max_encoding_message_size = self.max_encoding_message_size;
3158                    let inner = self.inner.clone();
3159                    let fut = async move {
3160                        let method = GetObjectSvc(inner);
3161                        let codec = tonic_prost::ProstCodec::default();
3162                        let mut grpc = tonic::server::Grpc::new(codec)
3163                            .apply_compression_config(
3164                                accept_compression_encodings,
3165                                send_compression_encodings,
3166                            )
3167                            .apply_max_message_size_config(
3168                                max_decoding_message_size,
3169                                max_encoding_message_size,
3170                            );
3171                        let res = grpc.unary(method, req).await;
3172                        Ok(res)
3173                    };
3174                    Box::pin(fut)
3175                }
3176                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3177                    #[allow(non_camel_case_types)]
3178                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3179                    impl<
3180                        T: LedgerService,
3181                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3182                    for BatchGetObjectsSvc<T> {
3183                        type Response = super::BatchGetObjectsResponse;
3184                        type Future = BoxFuture<
3185                            tonic::Response<Self::Response>,
3186                            tonic::Status,
3187                        >;
3188                        fn call(
3189                            &mut self,
3190                            request: tonic::Request<super::BatchGetObjectsRequest>,
3191                        ) -> Self::Future {
3192                            let inner = Arc::clone(&self.0);
3193                            let fut = async move {
3194                                <T as LedgerService>::batch_get_objects(&inner, request)
3195                                    .await
3196                            };
3197                            Box::pin(fut)
3198                        }
3199                    }
3200                    let accept_compression_encodings = self.accept_compression_encodings;
3201                    let send_compression_encodings = self.send_compression_encodings;
3202                    let max_decoding_message_size = self.max_decoding_message_size;
3203                    let max_encoding_message_size = self.max_encoding_message_size;
3204                    let inner = self.inner.clone();
3205                    let fut = async move {
3206                        let method = BatchGetObjectsSvc(inner);
3207                        let codec = tonic_prost::ProstCodec::default();
3208                        let mut grpc = tonic::server::Grpc::new(codec)
3209                            .apply_compression_config(
3210                                accept_compression_encodings,
3211                                send_compression_encodings,
3212                            )
3213                            .apply_max_message_size_config(
3214                                max_decoding_message_size,
3215                                max_encoding_message_size,
3216                            );
3217                        let res = grpc.unary(method, req).await;
3218                        Ok(res)
3219                    };
3220                    Box::pin(fut)
3221                }
3222                "/sui.rpc.v2.LedgerService/GetTransaction" => {
3223                    #[allow(non_camel_case_types)]
3224                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3225                    impl<
3226                        T: LedgerService,
3227                    > tonic::server::UnaryService<super::GetTransactionRequest>
3228                    for GetTransactionSvc<T> {
3229                        type Response = super::GetTransactionResponse;
3230                        type Future = BoxFuture<
3231                            tonic::Response<Self::Response>,
3232                            tonic::Status,
3233                        >;
3234                        fn call(
3235                            &mut self,
3236                            request: tonic::Request<super::GetTransactionRequest>,
3237                        ) -> Self::Future {
3238                            let inner = Arc::clone(&self.0);
3239                            let fut = async move {
3240                                <T as LedgerService>::get_transaction(&inner, request).await
3241                            };
3242                            Box::pin(fut)
3243                        }
3244                    }
3245                    let accept_compression_encodings = self.accept_compression_encodings;
3246                    let send_compression_encodings = self.send_compression_encodings;
3247                    let max_decoding_message_size = self.max_decoding_message_size;
3248                    let max_encoding_message_size = self.max_encoding_message_size;
3249                    let inner = self.inner.clone();
3250                    let fut = async move {
3251                        let method = GetTransactionSvc(inner);
3252                        let codec = tonic_prost::ProstCodec::default();
3253                        let mut grpc = tonic::server::Grpc::new(codec)
3254                            .apply_compression_config(
3255                                accept_compression_encodings,
3256                                send_compression_encodings,
3257                            )
3258                            .apply_max_message_size_config(
3259                                max_decoding_message_size,
3260                                max_encoding_message_size,
3261                            );
3262                        let res = grpc.unary(method, req).await;
3263                        Ok(res)
3264                    };
3265                    Box::pin(fut)
3266                }
3267                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3268                    #[allow(non_camel_case_types)]
3269                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3270                    impl<
3271                        T: LedgerService,
3272                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3273                    for BatchGetTransactionsSvc<T> {
3274                        type Response = super::BatchGetTransactionsResponse;
3275                        type Future = BoxFuture<
3276                            tonic::Response<Self::Response>,
3277                            tonic::Status,
3278                        >;
3279                        fn call(
3280                            &mut self,
3281                            request: tonic::Request<super::BatchGetTransactionsRequest>,
3282                        ) -> Self::Future {
3283                            let inner = Arc::clone(&self.0);
3284                            let fut = async move {
3285                                <T as LedgerService>::batch_get_transactions(
3286                                        &inner,
3287                                        request,
3288                                    )
3289                                    .await
3290                            };
3291                            Box::pin(fut)
3292                        }
3293                    }
3294                    let accept_compression_encodings = self.accept_compression_encodings;
3295                    let send_compression_encodings = self.send_compression_encodings;
3296                    let max_decoding_message_size = self.max_decoding_message_size;
3297                    let max_encoding_message_size = self.max_encoding_message_size;
3298                    let inner = self.inner.clone();
3299                    let fut = async move {
3300                        let method = BatchGetTransactionsSvc(inner);
3301                        let codec = tonic_prost::ProstCodec::default();
3302                        let mut grpc = tonic::server::Grpc::new(codec)
3303                            .apply_compression_config(
3304                                accept_compression_encodings,
3305                                send_compression_encodings,
3306                            )
3307                            .apply_max_message_size_config(
3308                                max_decoding_message_size,
3309                                max_encoding_message_size,
3310                            );
3311                        let res = grpc.unary(method, req).await;
3312                        Ok(res)
3313                    };
3314                    Box::pin(fut)
3315                }
3316                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3317                    #[allow(non_camel_case_types)]
3318                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3319                    impl<
3320                        T: LedgerService,
3321                    > tonic::server::UnaryService<super::GetCheckpointRequest>
3322                    for GetCheckpointSvc<T> {
3323                        type Response = super::GetCheckpointResponse;
3324                        type Future = BoxFuture<
3325                            tonic::Response<Self::Response>,
3326                            tonic::Status,
3327                        >;
3328                        fn call(
3329                            &mut self,
3330                            request: tonic::Request<super::GetCheckpointRequest>,
3331                        ) -> Self::Future {
3332                            let inner = Arc::clone(&self.0);
3333                            let fut = async move {
3334                                <T as LedgerService>::get_checkpoint(&inner, request).await
3335                            };
3336                            Box::pin(fut)
3337                        }
3338                    }
3339                    let accept_compression_encodings = self.accept_compression_encodings;
3340                    let send_compression_encodings = self.send_compression_encodings;
3341                    let max_decoding_message_size = self.max_decoding_message_size;
3342                    let max_encoding_message_size = self.max_encoding_message_size;
3343                    let inner = self.inner.clone();
3344                    let fut = async move {
3345                        let method = GetCheckpointSvc(inner);
3346                        let codec = tonic_prost::ProstCodec::default();
3347                        let mut grpc = tonic::server::Grpc::new(codec)
3348                            .apply_compression_config(
3349                                accept_compression_encodings,
3350                                send_compression_encodings,
3351                            )
3352                            .apply_max_message_size_config(
3353                                max_decoding_message_size,
3354                                max_encoding_message_size,
3355                            );
3356                        let res = grpc.unary(method, req).await;
3357                        Ok(res)
3358                    };
3359                    Box::pin(fut)
3360                }
3361                "/sui.rpc.v2.LedgerService/GetEpoch" => {
3362                    #[allow(non_camel_case_types)]
3363                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3364                    impl<
3365                        T: LedgerService,
3366                    > tonic::server::UnaryService<super::GetEpochRequest>
3367                    for GetEpochSvc<T> {
3368                        type Response = super::GetEpochResponse;
3369                        type Future = BoxFuture<
3370                            tonic::Response<Self::Response>,
3371                            tonic::Status,
3372                        >;
3373                        fn call(
3374                            &mut self,
3375                            request: tonic::Request<super::GetEpochRequest>,
3376                        ) -> Self::Future {
3377                            let inner = Arc::clone(&self.0);
3378                            let fut = async move {
3379                                <T as LedgerService>::get_epoch(&inner, request).await
3380                            };
3381                            Box::pin(fut)
3382                        }
3383                    }
3384                    let accept_compression_encodings = self.accept_compression_encodings;
3385                    let send_compression_encodings = self.send_compression_encodings;
3386                    let max_decoding_message_size = self.max_decoding_message_size;
3387                    let max_encoding_message_size = self.max_encoding_message_size;
3388                    let inner = self.inner.clone();
3389                    let fut = async move {
3390                        let method = GetEpochSvc(inner);
3391                        let codec = tonic_prost::ProstCodec::default();
3392                        let mut grpc = tonic::server::Grpc::new(codec)
3393                            .apply_compression_config(
3394                                accept_compression_encodings,
3395                                send_compression_encodings,
3396                            )
3397                            .apply_max_message_size_config(
3398                                max_decoding_message_size,
3399                                max_encoding_message_size,
3400                            );
3401                        let res = grpc.unary(method, req).await;
3402                        Ok(res)
3403                    };
3404                    Box::pin(fut)
3405                }
3406                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3407                    #[allow(non_camel_case_types)]
3408                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3409                    impl<
3410                        T: LedgerService,
3411                    > tonic::server::ServerStreamingService<
3412                        super::ListCheckpointsRequest,
3413                    > for ListCheckpointsSvc<T> {
3414                        type Response = super::ListCheckpointsResponse;
3415                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3416                        type Future = BoxFuture<
3417                            tonic::Response<Self::ResponseStream>,
3418                            tonic::Status,
3419                        >;
3420                        fn call(
3421                            &mut self,
3422                            request: tonic::Request<super::ListCheckpointsRequest>,
3423                        ) -> Self::Future {
3424                            let inner = Arc::clone(&self.0);
3425                            let fut = async move {
3426                                <T as LedgerService>::list_checkpoints(&inner, request)
3427                                    .await
3428                            };
3429                            Box::pin(fut)
3430                        }
3431                    }
3432                    let accept_compression_encodings = self.accept_compression_encodings;
3433                    let send_compression_encodings = self.send_compression_encodings;
3434                    let max_decoding_message_size = self.max_decoding_message_size;
3435                    let max_encoding_message_size = self.max_encoding_message_size;
3436                    let inner = self.inner.clone();
3437                    let fut = async move {
3438                        let method = ListCheckpointsSvc(inner);
3439                        let codec = tonic_prost::ProstCodec::default();
3440                        let mut grpc = tonic::server::Grpc::new(codec)
3441                            .apply_compression_config(
3442                                accept_compression_encodings,
3443                                send_compression_encodings,
3444                            )
3445                            .apply_max_message_size_config(
3446                                max_decoding_message_size,
3447                                max_encoding_message_size,
3448                            );
3449                        let res = grpc.server_streaming(method, req).await;
3450                        Ok(res)
3451                    };
3452                    Box::pin(fut)
3453                }
3454                "/sui.rpc.v2.LedgerService/ListTransactions" => {
3455                    #[allow(non_camel_case_types)]
3456                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3457                    impl<
3458                        T: LedgerService,
3459                    > tonic::server::ServerStreamingService<
3460                        super::ListTransactionsRequest,
3461                    > for ListTransactionsSvc<T> {
3462                        type Response = super::ListTransactionsResponse;
3463                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3464                        type Future = BoxFuture<
3465                            tonic::Response<Self::ResponseStream>,
3466                            tonic::Status,
3467                        >;
3468                        fn call(
3469                            &mut self,
3470                            request: tonic::Request<super::ListTransactionsRequest>,
3471                        ) -> Self::Future {
3472                            let inner = Arc::clone(&self.0);
3473                            let fut = async move {
3474                                <T as LedgerService>::list_transactions(&inner, request)
3475                                    .await
3476                            };
3477                            Box::pin(fut)
3478                        }
3479                    }
3480                    let accept_compression_encodings = self.accept_compression_encodings;
3481                    let send_compression_encodings = self.send_compression_encodings;
3482                    let max_decoding_message_size = self.max_decoding_message_size;
3483                    let max_encoding_message_size = self.max_encoding_message_size;
3484                    let inner = self.inner.clone();
3485                    let fut = async move {
3486                        let method = ListTransactionsSvc(inner);
3487                        let codec = tonic_prost::ProstCodec::default();
3488                        let mut grpc = tonic::server::Grpc::new(codec)
3489                            .apply_compression_config(
3490                                accept_compression_encodings,
3491                                send_compression_encodings,
3492                            )
3493                            .apply_max_message_size_config(
3494                                max_decoding_message_size,
3495                                max_encoding_message_size,
3496                            );
3497                        let res = grpc.server_streaming(method, req).await;
3498                        Ok(res)
3499                    };
3500                    Box::pin(fut)
3501                }
3502                "/sui.rpc.v2.LedgerService/ListEvents" => {
3503                    #[allow(non_camel_case_types)]
3504                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3505                    impl<
3506                        T: LedgerService,
3507                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
3508                    for ListEventsSvc<T> {
3509                        type Response = super::ListEventsResponse;
3510                        type ResponseStream = BoxStream<super::ListEventsResponse>;
3511                        type Future = BoxFuture<
3512                            tonic::Response<Self::ResponseStream>,
3513                            tonic::Status,
3514                        >;
3515                        fn call(
3516                            &mut self,
3517                            request: tonic::Request<super::ListEventsRequest>,
3518                        ) -> Self::Future {
3519                            let inner = Arc::clone(&self.0);
3520                            let fut = async move {
3521                                <T as LedgerService>::list_events(&inner, request).await
3522                            };
3523                            Box::pin(fut)
3524                        }
3525                    }
3526                    let accept_compression_encodings = self.accept_compression_encodings;
3527                    let send_compression_encodings = self.send_compression_encodings;
3528                    let max_decoding_message_size = self.max_decoding_message_size;
3529                    let max_encoding_message_size = self.max_encoding_message_size;
3530                    let inner = self.inner.clone();
3531                    let fut = async move {
3532                        let method = ListEventsSvc(inner);
3533                        let codec = tonic_prost::ProstCodec::default();
3534                        let mut grpc = tonic::server::Grpc::new(codec)
3535                            .apply_compression_config(
3536                                accept_compression_encodings,
3537                                send_compression_encodings,
3538                            )
3539                            .apply_max_message_size_config(
3540                                max_decoding_message_size,
3541                                max_encoding_message_size,
3542                            );
3543                        let res = grpc.server_streaming(method, req).await;
3544                        Ok(res)
3545                    };
3546                    Box::pin(fut)
3547                }
3548                _ => {
3549                    Box::pin(async move {
3550                        let mut response = http::Response::new(
3551                            tonic::body::Body::default(),
3552                        );
3553                        let headers = response.headers_mut();
3554                        headers
3555                            .insert(
3556                                tonic::Status::GRPC_STATUS,
3557                                (tonic::Code::Unimplemented as i32).into(),
3558                            );
3559                        headers
3560                            .insert(
3561                                http::header::CONTENT_TYPE,
3562                                tonic::metadata::GRPC_CONTENT_TYPE,
3563                            );
3564                        Ok(response)
3565                    })
3566                }
3567            }
3568        }
3569    }
3570    impl<T> Clone for LedgerServiceServer<T> {
3571        fn clone(&self) -> Self {
3572            let inner = self.inner.clone();
3573            Self {
3574                inner,
3575                accept_compression_encodings: self.accept_compression_encodings,
3576                send_compression_encodings: self.send_compression_encodings,
3577                max_decoding_message_size: self.max_decoding_message_size,
3578                max_encoding_message_size: self.max_encoding_message_size,
3579            }
3580        }
3581    }
3582    /// Generated gRPC service name
3583    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3584    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3585        const NAME: &'static str = SERVICE_NAME;
3586    }
3587}
3588/// A Move Package
3589#[non_exhaustive]
3590#[derive(Clone, PartialEq, ::prost::Message)]
3591pub struct Package {
3592    /// The PackageId of this package
3593    ///
3594    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
3595    /// Outside of system packages the `storage_id` for every package version is
3596    /// different.
3597    #[prost(string, optional, tag = "1")]
3598    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3599    /// The PackageId of the first published version of this package.
3600    ///
3601    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
3602    /// `storage_id` of the first version of this package that has been published.
3603    /// The `original_id`/`runtime_id` is stable across all versions of the
3604    /// package and does not ever change.
3605    #[prost(string, optional, tag = "2")]
3606    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3607    /// The version of this package
3608    #[prost(uint64, optional, tag = "3")]
3609    pub version: ::core::option::Option<u64>,
3610    /// The modules defined by this package
3611    #[prost(message, repeated, tag = "4")]
3612    pub modules: ::prost::alloc::vec::Vec<Module>,
3613    /// List of datatype origins for mapping datatypes to a package version where
3614    /// it was first defined
3615    #[prost(message, repeated, tag = "5")]
3616    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3617    /// The package's transitive dependencies as a mapping from the package's
3618    /// runtime Id (the Id it is referred to by in other packages) to its
3619    /// storage Id (the Id it is loaded from on chain).
3620    #[prost(message, repeated, tag = "6")]
3621    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3622}
3623/// A Move Module.
3624#[non_exhaustive]
3625#[derive(Clone, PartialEq, ::prost::Message)]
3626pub struct Module {
3627    /// Name of this module.
3628    #[prost(string, optional, tag = "1")]
3629    pub name: ::core::option::Option<::prost::alloc::string::String>,
3630    /// Serialized bytecode of the module.
3631    #[prost(bytes = "bytes", optional, tag = "2")]
3632    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3633    /// List of DataTypes defined by this module.
3634    #[prost(message, repeated, tag = "3")]
3635    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3636    /// List of Functions defined by this module.
3637    #[prost(message, repeated, tag = "4")]
3638    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3639}
3640/// Describes a Move Datatype.
3641#[non_exhaustive]
3642#[derive(Clone, PartialEq, ::prost::Message)]
3643pub struct DatatypeDescriptor {
3644    /// Fully qualified name of this Datatype.
3645    ///
3646    /// This is `<defining_id>::<module>::<name>`
3647    #[prost(string, optional, tag = "1")]
3648    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3649    /// PackageId of the package where this Datatype is defined.
3650    ///
3651    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
3652    #[prost(string, optional, tag = "2")]
3653    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3654    /// Name of the module where this Datatype is defined
3655    #[prost(string, optional, tag = "3")]
3656    pub module: ::core::option::Option<::prost::alloc::string::String>,
3657    /// Name of this Datatype
3658    #[prost(string, optional, tag = "4")]
3659    pub name: ::core::option::Option<::prost::alloc::string::String>,
3660    /// This type's abilities
3661    #[prost(enumeration = "Ability", repeated, tag = "5")]
3662    pub abilities: ::prost::alloc::vec::Vec<i32>,
3663    /// Ability constraints and phantom status for this type's generic type parameters
3664    #[prost(message, repeated, tag = "6")]
3665    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3666    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
3667    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3668    pub kind: ::core::option::Option<i32>,
3669    /// Set of fields if this Datatype is a struct.
3670    ///
3671    /// The order of the entries is the order of how the fields are defined.
3672    #[prost(message, repeated, tag = "8")]
3673    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3674    /// Set of variants if this Datatype is an enum.
3675    ///
3676    /// The order of the entries is the order of how the variants are defined.
3677    #[prost(message, repeated, tag = "9")]
3678    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3679}
3680/// Nested message and enum types in `DatatypeDescriptor`.
3681pub mod datatype_descriptor {
3682    #[non_exhaustive]
3683    #[derive(
3684        Clone,
3685        Copy,
3686        Debug,
3687        PartialEq,
3688        Eq,
3689        Hash,
3690        PartialOrd,
3691        Ord,
3692        ::prost::Enumeration
3693    )]
3694    #[repr(i32)]
3695    pub enum DatatypeKind {
3696        Unknown = 0,
3697        Struct = 1,
3698        Enum = 2,
3699    }
3700    impl DatatypeKind {
3701        /// String value of the enum field names used in the ProtoBuf definition.
3702        ///
3703        /// The values are not transformed in any way and thus are considered stable
3704        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3705        pub fn as_str_name(&self) -> &'static str {
3706            match self {
3707                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3708                Self::Struct => "STRUCT",
3709                Self::Enum => "ENUM",
3710            }
3711        }
3712        /// Creates an enum from field names used in the ProtoBuf definition.
3713        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3714            match value {
3715                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3716                "STRUCT" => Some(Self::Struct),
3717                "ENUM" => Some(Self::Enum),
3718                _ => None,
3719            }
3720        }
3721    }
3722}
3723/// A generic type parameter used in the declaration of a struct or enum.
3724#[non_exhaustive]
3725#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3726pub struct TypeParameter {
3727    /// The type parameter constraints
3728    #[prost(enumeration = "Ability", repeated, tag = "1")]
3729    pub constraints: ::prost::alloc::vec::Vec<i32>,
3730    /// Whether the parameter is declared as phantom
3731    #[prost(bool, optional, tag = "2")]
3732    pub is_phantom: ::core::option::Option<bool>,
3733}
3734/// Descriptor of a field that belongs to a struct or enum variant
3735#[non_exhaustive]
3736#[derive(Clone, PartialEq, ::prost::Message)]
3737pub struct FieldDescriptor {
3738    /// Name of the field
3739    #[prost(string, optional, tag = "1")]
3740    pub name: ::core::option::Option<::prost::alloc::string::String>,
3741    /// Order or position of the field in the struct or enum variant definition.
3742    #[prost(uint32, optional, tag = "2")]
3743    pub position: ::core::option::Option<u32>,
3744    /// The type of the field
3745    #[prost(message, optional, tag = "3")]
3746    pub r#type: ::core::option::Option<OpenSignatureBody>,
3747}
3748/// Descriptor of an enum variant
3749#[non_exhaustive]
3750#[derive(Clone, PartialEq, ::prost::Message)]
3751pub struct VariantDescriptor {
3752    /// Name of the variant
3753    #[prost(string, optional, tag = "1")]
3754    pub name: ::core::option::Option<::prost::alloc::string::String>,
3755    /// Order or position of the variant in the enum definition.
3756    #[prost(uint32, optional, tag = "2")]
3757    pub position: ::core::option::Option<u32>,
3758    /// Set of fields defined by this variant.
3759    #[prost(message, repeated, tag = "3")]
3760    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3761}
3762/// Representation of a type signature that could appear as a field type for a struct or enum
3763#[non_exhaustive]
3764#[derive(Clone, PartialEq, ::prost::Message)]
3765pub struct OpenSignatureBody {
3766    /// Type of this signature
3767    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3768    pub r#type: ::core::option::Option<i32>,
3769    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3770    #[prost(string, optional, tag = "2")]
3771    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3772    /// Set when `type` is `VECTOR` or `DATATYPE`
3773    #[prost(message, repeated, tag = "3")]
3774    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3775    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3776    #[prost(uint32, optional, tag = "4")]
3777    pub type_parameter: ::core::option::Option<u32>,
3778}
3779/// Nested message and enum types in `OpenSignatureBody`.
3780pub mod open_signature_body {
3781    #[non_exhaustive]
3782    #[derive(
3783        Clone,
3784        Copy,
3785        Debug,
3786        PartialEq,
3787        Eq,
3788        Hash,
3789        PartialOrd,
3790        Ord,
3791        ::prost::Enumeration
3792    )]
3793    #[repr(i32)]
3794    pub enum Type {
3795        Unknown = 0,
3796        Address = 1,
3797        Bool = 2,
3798        U8 = 3,
3799        U16 = 4,
3800        U32 = 5,
3801        U64 = 6,
3802        U128 = 7,
3803        U256 = 8,
3804        Vector = 9,
3805        Datatype = 10,
3806        Parameter = 11,
3807    }
3808    impl Type {
3809        /// String value of the enum field names used in the ProtoBuf definition.
3810        ///
3811        /// The values are not transformed in any way and thus are considered stable
3812        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3813        pub fn as_str_name(&self) -> &'static str {
3814            match self {
3815                Self::Unknown => "TYPE_UNKNOWN",
3816                Self::Address => "ADDRESS",
3817                Self::Bool => "BOOL",
3818                Self::U8 => "U8",
3819                Self::U16 => "U16",
3820                Self::U32 => "U32",
3821                Self::U64 => "U64",
3822                Self::U128 => "U128",
3823                Self::U256 => "U256",
3824                Self::Vector => "VECTOR",
3825                Self::Datatype => "DATATYPE",
3826                Self::Parameter => "TYPE_PARAMETER",
3827            }
3828        }
3829        /// Creates an enum from field names used in the ProtoBuf definition.
3830        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3831            match value {
3832                "TYPE_UNKNOWN" => Some(Self::Unknown),
3833                "ADDRESS" => Some(Self::Address),
3834                "BOOL" => Some(Self::Bool),
3835                "U8" => Some(Self::U8),
3836                "U16" => Some(Self::U16),
3837                "U32" => Some(Self::U32),
3838                "U64" => Some(Self::U64),
3839                "U128" => Some(Self::U128),
3840                "U256" => Some(Self::U256),
3841                "VECTOR" => Some(Self::Vector),
3842                "DATATYPE" => Some(Self::Datatype),
3843                "TYPE_PARAMETER" => Some(Self::Parameter),
3844                _ => None,
3845            }
3846        }
3847    }
3848}
3849/// Descriptor of a Move function
3850#[non_exhaustive]
3851#[derive(Clone, PartialEq, ::prost::Message)]
3852pub struct FunctionDescriptor {
3853    /// Name of the function
3854    #[prost(string, optional, tag = "1")]
3855    pub name: ::core::option::Option<::prost::alloc::string::String>,
3856    /// Whether the function is `public`, `private` or `public(friend)`
3857    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3858    pub visibility: ::core::option::Option<i32>,
3859    /// Whether the function is marked `entry` or not.
3860    #[prost(bool, optional, tag = "6")]
3861    pub is_entry: ::core::option::Option<bool>,
3862    /// Ability constraints for type parameters
3863    #[prost(message, repeated, tag = "7")]
3864    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3865    /// Formal parameter types.
3866    #[prost(message, repeated, tag = "8")]
3867    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3868    /// Return types.
3869    #[prost(message, repeated, tag = "9")]
3870    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3871}
3872/// Nested message and enum types in `FunctionDescriptor`.
3873pub mod function_descriptor {
3874    #[non_exhaustive]
3875    #[derive(
3876        Clone,
3877        Copy,
3878        Debug,
3879        PartialEq,
3880        Eq,
3881        Hash,
3882        PartialOrd,
3883        Ord,
3884        ::prost::Enumeration
3885    )]
3886    #[repr(i32)]
3887    pub enum Visibility {
3888        Unknown = 0,
3889        Private = 1,
3890        Public = 2,
3891        Friend = 3,
3892    }
3893    impl Visibility {
3894        /// String value of the enum field names used in the ProtoBuf definition.
3895        ///
3896        /// The values are not transformed in any way and thus are considered stable
3897        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3898        pub fn as_str_name(&self) -> &'static str {
3899            match self {
3900                Self::Unknown => "VISIBILITY_UNKNOWN",
3901                Self::Private => "PRIVATE",
3902                Self::Public => "PUBLIC",
3903                Self::Friend => "FRIEND",
3904            }
3905        }
3906        /// Creates an enum from field names used in the ProtoBuf definition.
3907        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3908            match value {
3909                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3910                "PRIVATE" => Some(Self::Private),
3911                "PUBLIC" => Some(Self::Public),
3912                "FRIEND" => Some(Self::Friend),
3913                _ => None,
3914            }
3915        }
3916    }
3917}
3918/// Representation of a type signature that could appear as a function parameter or return value.
3919#[non_exhaustive]
3920#[derive(Clone, PartialEq, ::prost::Message)]
3921pub struct OpenSignature {
3922    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3923    pub reference: ::core::option::Option<i32>,
3924    #[prost(message, optional, tag = "2")]
3925    pub body: ::core::option::Option<OpenSignatureBody>,
3926}
3927/// Nested message and enum types in `OpenSignature`.
3928pub mod open_signature {
3929    #[non_exhaustive]
3930    #[derive(
3931        Clone,
3932        Copy,
3933        Debug,
3934        PartialEq,
3935        Eq,
3936        Hash,
3937        PartialOrd,
3938        Ord,
3939        ::prost::Enumeration
3940    )]
3941    #[repr(i32)]
3942    pub enum Reference {
3943        Unknown = 0,
3944        Immutable = 1,
3945        Mutable = 2,
3946    }
3947    impl Reference {
3948        /// String value of the enum field names used in the ProtoBuf definition.
3949        ///
3950        /// The values are not transformed in any way and thus are considered stable
3951        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3952        pub fn as_str_name(&self) -> &'static str {
3953            match self {
3954                Self::Unknown => "REFERENCE_UNKNOWN",
3955                Self::Immutable => "IMMUTABLE",
3956                Self::Mutable => "MUTABLE",
3957            }
3958        }
3959        /// Creates an enum from field names used in the ProtoBuf definition.
3960        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3961            match value {
3962                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3963                "IMMUTABLE" => Some(Self::Immutable),
3964                "MUTABLE" => Some(Self::Mutable),
3965                _ => None,
3966            }
3967        }
3968    }
3969}
3970/// Identifies a struct and the module it was defined in.
3971#[non_exhaustive]
3972#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3973pub struct TypeOrigin {
3974    #[prost(string, optional, tag = "1")]
3975    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3976    #[prost(string, optional, tag = "2")]
3977    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3978    #[prost(string, optional, tag = "3")]
3979    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3980}
3981/// Upgraded package info for the linkage table.
3982#[non_exhaustive]
3983#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3984pub struct Linkage {
3985    /// Id of the original package.
3986    #[prost(string, optional, tag = "1")]
3987    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3988    /// Id of the upgraded package.
3989    #[prost(string, optional, tag = "2")]
3990    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3991    /// Version of the upgraded package.
3992    #[prost(uint64, optional, tag = "3")]
3993    pub upgraded_version: ::core::option::Option<u64>,
3994}
3995/// An `Ability` classifies what operations are permitted for a given type
3996#[non_exhaustive]
3997#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3998#[repr(i32)]
3999pub enum Ability {
4000    Unknown = 0,
4001    /// Allows values of types with this ability to be copied
4002    Copy = 1,
4003    /// Allows values of types with this ability to be dropped.
4004    Drop = 2,
4005    /// Allows values of types with this ability to exist inside a struct in global storage
4006    Store = 3,
4007    /// Allows the type to serve as a key for global storage operations
4008    Key = 4,
4009}
4010impl Ability {
4011    /// String value of the enum field names used in the ProtoBuf definition.
4012    ///
4013    /// The values are not transformed in any way and thus are considered stable
4014    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4015    pub fn as_str_name(&self) -> &'static str {
4016        match self {
4017            Self::Unknown => "ABILITY_UNKNOWN",
4018            Self::Copy => "COPY",
4019            Self::Drop => "DROP",
4020            Self::Store => "STORE",
4021            Self::Key => "KEY",
4022        }
4023    }
4024    /// Creates an enum from field names used in the ProtoBuf definition.
4025    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
4026        match value {
4027            "ABILITY_UNKNOWN" => Some(Self::Unknown),
4028            "COPY" => Some(Self::Copy),
4029            "DROP" => Some(Self::Drop),
4030            "STORE" => Some(Self::Store),
4031            "KEY" => Some(Self::Key),
4032            _ => None,
4033        }
4034    }
4035}
4036#[non_exhaustive]
4037#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4038pub struct GetPackageRequest {
4039    /// Required. The `storage_id` of any version of the requested package.
4040    ///
4041    /// When no `selector` is set, the package stored at exactly this id is
4042    /// returned. When a `selector` is set, `package_id` only identifies the
4043    /// package's upgrade lineage (via its original id), and the selected
4044    /// version within that lineage is returned.
4045    #[prost(string, optional, tag = "1")]
4046    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4047    /// Optional. Return the package in `package_id`'s upgrade lineage that
4048    /// matches one of the following:
4049    ///
4050    /// * `version`: the package with exactly this version.
4051    /// * `at_checkpoint`: the latest package that existed at or before this
4052    ///   checkpoint. The checkpoint must be at or below the highest checkpoint
4053    ///   the server has indexed; larger values fail with `NOT_FOUND` instead of
4054    ///   resolving to the latest known version, so a successful response is
4055    ///   exact as of `at_checkpoint`. Servers that prune history may also fail
4056    ///   with `NOT_FOUND` for checkpoints below their lowest available one.
4057    ///
4058    /// If neither is set, the package stored at `package_id` is returned.
4059    #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
4060    pub selector: ::core::option::Option<get_package_request::Selector>,
4061}
4062/// Nested message and enum types in `GetPackageRequest`.
4063pub mod get_package_request {
4064    /// Optional. Return the package in `package_id`'s upgrade lineage that
4065    /// matches one of the following:
4066    ///
4067    /// * `version`: the package with exactly this version.
4068    /// * `at_checkpoint`: the latest package that existed at or before this
4069    ///   checkpoint. The checkpoint must be at or below the highest checkpoint
4070    ///   the server has indexed; larger values fail with `NOT_FOUND` instead of
4071    ///   resolving to the latest known version, so a successful response is
4072    ///   exact as of `at_checkpoint`. Servers that prune history may also fail
4073    ///   with `NOT_FOUND` for checkpoints below their lowest available one.
4074    ///
4075    /// If neither is set, the package stored at `package_id` is returned.
4076    #[non_exhaustive]
4077    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
4078    pub enum Selector {
4079        #[prost(uint64, tag = "2")]
4080        Version(u64),
4081        #[prost(uint64, tag = "3")]
4082        AtCheckpoint(u64),
4083    }
4084}
4085#[non_exhaustive]
4086#[derive(Clone, PartialEq, ::prost::Message)]
4087pub struct GetPackageResponse {
4088    /// The package.
4089    #[prost(message, optional, tag = "1")]
4090    pub package: ::core::option::Option<Package>,
4091}
4092#[non_exhaustive]
4093#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4094pub struct GetDatatypeRequest {
4095    /// Required. The `storage_id` of the requested package.
4096    #[prost(string, optional, tag = "1")]
4097    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4098    /// Required. The name of the requested module.
4099    #[prost(string, optional, tag = "2")]
4100    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4101    /// Required. The name of the requested datatype.
4102    #[prost(string, optional, tag = "3")]
4103    pub name: ::core::option::Option<::prost::alloc::string::String>,
4104}
4105#[non_exhaustive]
4106#[derive(Clone, PartialEq, ::prost::Message)]
4107pub struct GetDatatypeResponse {
4108    /// The datatype.
4109    #[prost(message, optional, tag = "1")]
4110    pub datatype: ::core::option::Option<DatatypeDescriptor>,
4111}
4112#[non_exhaustive]
4113#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4114pub struct GetFunctionRequest {
4115    /// Required. The `storage_id` of the requested package.
4116    #[prost(string, optional, tag = "1")]
4117    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4118    /// Required. The name of the requested module.
4119    #[prost(string, optional, tag = "2")]
4120    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4121    /// Required. The name of the requested function.
4122    #[prost(string, optional, tag = "3")]
4123    pub name: ::core::option::Option<::prost::alloc::string::String>,
4124}
4125#[non_exhaustive]
4126#[derive(Clone, PartialEq, ::prost::Message)]
4127pub struct GetFunctionResponse {
4128    /// The function.
4129    #[prost(message, optional, tag = "1")]
4130    pub function: ::core::option::Option<FunctionDescriptor>,
4131}
4132#[non_exhaustive]
4133#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4134pub struct ListPackageVersionsRequest {
4135    /// Required. The `storage_id` of any version of the package.
4136    #[prost(string, optional, tag = "1")]
4137    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4138    /// The maximum number of versions to return. The service may return fewer than this value.
4139    /// If unspecified, at most `1000` entries will be returned.
4140    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
4141    #[prost(uint32, optional, tag = "2")]
4142    pub page_size: ::core::option::Option<u32>,
4143    /// A page token, received from a previous `ListPackageVersions` call.
4144    /// Provide this to retrieve the subsequent page.
4145    ///
4146    /// When paginating, all other parameters provided to `ListPackageVersions` must
4147    /// match the call that provided the page token.
4148    #[prost(bytes = "bytes", optional, tag = "3")]
4149    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4150}
4151#[non_exhaustive]
4152#[derive(Clone, PartialEq, ::prost::Message)]
4153pub struct ListPackageVersionsResponse {
4154    /// List of all package versions, ordered by version.
4155    #[prost(message, repeated, tag = "1")]
4156    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4157    /// A token, which can be sent as `page_token` to retrieve the next page.
4158    /// If this field is omitted, there are no subsequent pages.
4159    #[prost(bytes = "bytes", optional, tag = "2")]
4160    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4161}
4162/// A simplified representation of a package version
4163#[non_exhaustive]
4164#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4165pub struct PackageVersion {
4166    /// The storage ID of this package version
4167    #[prost(string, optional, tag = "1")]
4168    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4169    /// The version number
4170    #[prost(uint64, optional, tag = "2")]
4171    pub version: ::core::option::Option<u64>,
4172}
4173/// Generated client implementations.
4174pub mod move_package_service_client {
4175    #![allow(
4176        unused_variables,
4177        dead_code,
4178        missing_docs,
4179        clippy::wildcard_imports,
4180        clippy::let_unit_value,
4181    )]
4182    use tonic::codegen::*;
4183    use tonic::codegen::http::Uri;
4184    #[derive(Debug, Clone)]
4185    pub struct MovePackageServiceClient<T> {
4186        inner: tonic::client::Grpc<T>,
4187    }
4188    impl MovePackageServiceClient<tonic::transport::Channel> {
4189        /// Attempt to create a new client by connecting to a given endpoint.
4190        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4191        where
4192            D: TryInto<tonic::transport::Endpoint>,
4193            D::Error: Into<StdError>,
4194        {
4195            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4196            Ok(Self::new(conn))
4197        }
4198    }
4199    impl<T> MovePackageServiceClient<T>
4200    where
4201        T: tonic::client::GrpcService<tonic::body::Body>,
4202        T::Error: Into<StdError>,
4203        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4204        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4205    {
4206        pub fn new(inner: T) -> Self {
4207            let inner = tonic::client::Grpc::new(inner);
4208            Self { inner }
4209        }
4210        pub fn with_origin(inner: T, origin: Uri) -> Self {
4211            let inner = tonic::client::Grpc::with_origin(inner, origin);
4212            Self { inner }
4213        }
4214        pub fn with_interceptor<F>(
4215            inner: T,
4216            interceptor: F,
4217        ) -> MovePackageServiceClient<InterceptedService<T, F>>
4218        where
4219            F: tonic::service::Interceptor,
4220            T::ResponseBody: Default,
4221            T: tonic::codegen::Service<
4222                http::Request<tonic::body::Body>,
4223                Response = http::Response<
4224                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4225                >,
4226            >,
4227            <T as tonic::codegen::Service<
4228                http::Request<tonic::body::Body>,
4229            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4230        {
4231            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4232        }
4233        /// Compress requests with the given encoding.
4234        ///
4235        /// This requires the server to support it otherwise it might respond with an
4236        /// error.
4237        #[must_use]
4238        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4239            self.inner = self.inner.send_compressed(encoding);
4240            self
4241        }
4242        /// Enable decompressing responses.
4243        #[must_use]
4244        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4245            self.inner = self.inner.accept_compressed(encoding);
4246            self
4247        }
4248        /// Limits the maximum size of a decoded message.
4249        ///
4250        /// Default: `4MB`
4251        #[must_use]
4252        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4253            self.inner = self.inner.max_decoding_message_size(limit);
4254            self
4255        }
4256        /// Limits the maximum size of an encoded message.
4257        ///
4258        /// Default: `usize::MAX`
4259        #[must_use]
4260        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4261            self.inner = self.inner.max_encoding_message_size(limit);
4262            self
4263        }
4264        pub async fn get_package(
4265            &mut self,
4266            request: impl tonic::IntoRequest<super::GetPackageRequest>,
4267        ) -> std::result::Result<
4268            tonic::Response<super::GetPackageResponse>,
4269            tonic::Status,
4270        > {
4271            self.inner
4272                .ready()
4273                .await
4274                .map_err(|e| {
4275                    tonic::Status::unknown(
4276                        format!("Service was not ready: {}", e.into()),
4277                    )
4278                })?;
4279            let codec = tonic_prost::ProstCodec::default();
4280            let path = http::uri::PathAndQuery::from_static(
4281                "/sui.rpc.v2.MovePackageService/GetPackage",
4282            );
4283            let mut req = request.into_request();
4284            req.extensions_mut()
4285                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4286            self.inner.unary(req, path, codec).await
4287        }
4288        pub async fn get_datatype(
4289            &mut self,
4290            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4291        ) -> std::result::Result<
4292            tonic::Response<super::GetDatatypeResponse>,
4293            tonic::Status,
4294        > {
4295            self.inner
4296                .ready()
4297                .await
4298                .map_err(|e| {
4299                    tonic::Status::unknown(
4300                        format!("Service was not ready: {}", e.into()),
4301                    )
4302                })?;
4303            let codec = tonic_prost::ProstCodec::default();
4304            let path = http::uri::PathAndQuery::from_static(
4305                "/sui.rpc.v2.MovePackageService/GetDatatype",
4306            );
4307            let mut req = request.into_request();
4308            req.extensions_mut()
4309                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4310            self.inner.unary(req, path, codec).await
4311        }
4312        pub async fn get_function(
4313            &mut self,
4314            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4315        ) -> std::result::Result<
4316            tonic::Response<super::GetFunctionResponse>,
4317            tonic::Status,
4318        > {
4319            self.inner
4320                .ready()
4321                .await
4322                .map_err(|e| {
4323                    tonic::Status::unknown(
4324                        format!("Service was not ready: {}", e.into()),
4325                    )
4326                })?;
4327            let codec = tonic_prost::ProstCodec::default();
4328            let path = http::uri::PathAndQuery::from_static(
4329                "/sui.rpc.v2.MovePackageService/GetFunction",
4330            );
4331            let mut req = request.into_request();
4332            req.extensions_mut()
4333                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4334            self.inner.unary(req, path, codec).await
4335        }
4336        pub async fn list_package_versions(
4337            &mut self,
4338            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4339        ) -> std::result::Result<
4340            tonic::Response<super::ListPackageVersionsResponse>,
4341            tonic::Status,
4342        > {
4343            self.inner
4344                .ready()
4345                .await
4346                .map_err(|e| {
4347                    tonic::Status::unknown(
4348                        format!("Service was not ready: {}", e.into()),
4349                    )
4350                })?;
4351            let codec = tonic_prost::ProstCodec::default();
4352            let path = http::uri::PathAndQuery::from_static(
4353                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4354            );
4355            let mut req = request.into_request();
4356            req.extensions_mut()
4357                .insert(
4358                    GrpcMethod::new(
4359                        "sui.rpc.v2.MovePackageService",
4360                        "ListPackageVersions",
4361                    ),
4362                );
4363            self.inner.unary(req, path, codec).await
4364        }
4365    }
4366}
4367/// Generated server implementations.
4368pub mod move_package_service_server {
4369    #![allow(
4370        unused_variables,
4371        dead_code,
4372        missing_docs,
4373        clippy::wildcard_imports,
4374        clippy::let_unit_value,
4375    )]
4376    use tonic::codegen::*;
4377    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
4378    #[async_trait]
4379    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4380        async fn get_package(
4381            &self,
4382            request: tonic::Request<super::GetPackageRequest>,
4383        ) -> std::result::Result<
4384            tonic::Response<super::GetPackageResponse>,
4385            tonic::Status,
4386        > {
4387            Err(tonic::Status::unimplemented("Not yet implemented"))
4388        }
4389        async fn get_datatype(
4390            &self,
4391            request: tonic::Request<super::GetDatatypeRequest>,
4392        ) -> std::result::Result<
4393            tonic::Response<super::GetDatatypeResponse>,
4394            tonic::Status,
4395        > {
4396            Err(tonic::Status::unimplemented("Not yet implemented"))
4397        }
4398        async fn get_function(
4399            &self,
4400            request: tonic::Request<super::GetFunctionRequest>,
4401        ) -> std::result::Result<
4402            tonic::Response<super::GetFunctionResponse>,
4403            tonic::Status,
4404        > {
4405            Err(tonic::Status::unimplemented("Not yet implemented"))
4406        }
4407        async fn list_package_versions(
4408            &self,
4409            request: tonic::Request<super::ListPackageVersionsRequest>,
4410        ) -> std::result::Result<
4411            tonic::Response<super::ListPackageVersionsResponse>,
4412            tonic::Status,
4413        > {
4414            Err(tonic::Status::unimplemented("Not yet implemented"))
4415        }
4416    }
4417    #[derive(Debug)]
4418    pub struct MovePackageServiceServer<T> {
4419        inner: Arc<T>,
4420        accept_compression_encodings: EnabledCompressionEncodings,
4421        send_compression_encodings: EnabledCompressionEncodings,
4422        max_decoding_message_size: Option<usize>,
4423        max_encoding_message_size: Option<usize>,
4424    }
4425    impl<T> MovePackageServiceServer<T> {
4426        pub fn new(inner: T) -> Self {
4427            Self::from_arc(Arc::new(inner))
4428        }
4429        pub fn from_arc(inner: Arc<T>) -> Self {
4430            Self {
4431                inner,
4432                accept_compression_encodings: Default::default(),
4433                send_compression_encodings: Default::default(),
4434                max_decoding_message_size: None,
4435                max_encoding_message_size: None,
4436            }
4437        }
4438        pub fn with_interceptor<F>(
4439            inner: T,
4440            interceptor: F,
4441        ) -> InterceptedService<Self, F>
4442        where
4443            F: tonic::service::Interceptor,
4444        {
4445            InterceptedService::new(Self::new(inner), interceptor)
4446        }
4447        /// Enable decompressing requests with the given encoding.
4448        #[must_use]
4449        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4450            self.accept_compression_encodings.enable(encoding);
4451            self
4452        }
4453        /// Compress responses with the given encoding, if the client supports it.
4454        #[must_use]
4455        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4456            self.send_compression_encodings.enable(encoding);
4457            self
4458        }
4459        /// Limits the maximum size of a decoded message.
4460        ///
4461        /// Default: `4MB`
4462        #[must_use]
4463        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4464            self.max_decoding_message_size = Some(limit);
4465            self
4466        }
4467        /// Limits the maximum size of an encoded message.
4468        ///
4469        /// Default: `usize::MAX`
4470        #[must_use]
4471        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4472            self.max_encoding_message_size = Some(limit);
4473            self
4474        }
4475    }
4476    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4477    where
4478        T: MovePackageService,
4479        B: Body + std::marker::Send + 'static,
4480        B::Error: Into<StdError> + std::marker::Send + 'static,
4481    {
4482        type Response = http::Response<tonic::body::Body>;
4483        type Error = std::convert::Infallible;
4484        type Future = BoxFuture<Self::Response, Self::Error>;
4485        fn poll_ready(
4486            &mut self,
4487            _cx: &mut Context<'_>,
4488        ) -> Poll<std::result::Result<(), Self::Error>> {
4489            Poll::Ready(Ok(()))
4490        }
4491        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4492            match req.uri().path() {
4493                "/sui.rpc.v2.MovePackageService/GetPackage" => {
4494                    #[allow(non_camel_case_types)]
4495                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4496                    impl<
4497                        T: MovePackageService,
4498                    > tonic::server::UnaryService<super::GetPackageRequest>
4499                    for GetPackageSvc<T> {
4500                        type Response = super::GetPackageResponse;
4501                        type Future = BoxFuture<
4502                            tonic::Response<Self::Response>,
4503                            tonic::Status,
4504                        >;
4505                        fn call(
4506                            &mut self,
4507                            request: tonic::Request<super::GetPackageRequest>,
4508                        ) -> Self::Future {
4509                            let inner = Arc::clone(&self.0);
4510                            let fut = async move {
4511                                <T as MovePackageService>::get_package(&inner, request)
4512                                    .await
4513                            };
4514                            Box::pin(fut)
4515                        }
4516                    }
4517                    let accept_compression_encodings = self.accept_compression_encodings;
4518                    let send_compression_encodings = self.send_compression_encodings;
4519                    let max_decoding_message_size = self.max_decoding_message_size;
4520                    let max_encoding_message_size = self.max_encoding_message_size;
4521                    let inner = self.inner.clone();
4522                    let fut = async move {
4523                        let method = GetPackageSvc(inner);
4524                        let codec = tonic_prost::ProstCodec::default();
4525                        let mut grpc = tonic::server::Grpc::new(codec)
4526                            .apply_compression_config(
4527                                accept_compression_encodings,
4528                                send_compression_encodings,
4529                            )
4530                            .apply_max_message_size_config(
4531                                max_decoding_message_size,
4532                                max_encoding_message_size,
4533                            );
4534                        let res = grpc.unary(method, req).await;
4535                        Ok(res)
4536                    };
4537                    Box::pin(fut)
4538                }
4539                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4540                    #[allow(non_camel_case_types)]
4541                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4542                    impl<
4543                        T: MovePackageService,
4544                    > tonic::server::UnaryService<super::GetDatatypeRequest>
4545                    for GetDatatypeSvc<T> {
4546                        type Response = super::GetDatatypeResponse;
4547                        type Future = BoxFuture<
4548                            tonic::Response<Self::Response>,
4549                            tonic::Status,
4550                        >;
4551                        fn call(
4552                            &mut self,
4553                            request: tonic::Request<super::GetDatatypeRequest>,
4554                        ) -> Self::Future {
4555                            let inner = Arc::clone(&self.0);
4556                            let fut = async move {
4557                                <T as MovePackageService>::get_datatype(&inner, request)
4558                                    .await
4559                            };
4560                            Box::pin(fut)
4561                        }
4562                    }
4563                    let accept_compression_encodings = self.accept_compression_encodings;
4564                    let send_compression_encodings = self.send_compression_encodings;
4565                    let max_decoding_message_size = self.max_decoding_message_size;
4566                    let max_encoding_message_size = self.max_encoding_message_size;
4567                    let inner = self.inner.clone();
4568                    let fut = async move {
4569                        let method = GetDatatypeSvc(inner);
4570                        let codec = tonic_prost::ProstCodec::default();
4571                        let mut grpc = tonic::server::Grpc::new(codec)
4572                            .apply_compression_config(
4573                                accept_compression_encodings,
4574                                send_compression_encodings,
4575                            )
4576                            .apply_max_message_size_config(
4577                                max_decoding_message_size,
4578                                max_encoding_message_size,
4579                            );
4580                        let res = grpc.unary(method, req).await;
4581                        Ok(res)
4582                    };
4583                    Box::pin(fut)
4584                }
4585                "/sui.rpc.v2.MovePackageService/GetFunction" => {
4586                    #[allow(non_camel_case_types)]
4587                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4588                    impl<
4589                        T: MovePackageService,
4590                    > tonic::server::UnaryService<super::GetFunctionRequest>
4591                    for GetFunctionSvc<T> {
4592                        type Response = super::GetFunctionResponse;
4593                        type Future = BoxFuture<
4594                            tonic::Response<Self::Response>,
4595                            tonic::Status,
4596                        >;
4597                        fn call(
4598                            &mut self,
4599                            request: tonic::Request<super::GetFunctionRequest>,
4600                        ) -> Self::Future {
4601                            let inner = Arc::clone(&self.0);
4602                            let fut = async move {
4603                                <T as MovePackageService>::get_function(&inner, request)
4604                                    .await
4605                            };
4606                            Box::pin(fut)
4607                        }
4608                    }
4609                    let accept_compression_encodings = self.accept_compression_encodings;
4610                    let send_compression_encodings = self.send_compression_encodings;
4611                    let max_decoding_message_size = self.max_decoding_message_size;
4612                    let max_encoding_message_size = self.max_encoding_message_size;
4613                    let inner = self.inner.clone();
4614                    let fut = async move {
4615                        let method = GetFunctionSvc(inner);
4616                        let codec = tonic_prost::ProstCodec::default();
4617                        let mut grpc = tonic::server::Grpc::new(codec)
4618                            .apply_compression_config(
4619                                accept_compression_encodings,
4620                                send_compression_encodings,
4621                            )
4622                            .apply_max_message_size_config(
4623                                max_decoding_message_size,
4624                                max_encoding_message_size,
4625                            );
4626                        let res = grpc.unary(method, req).await;
4627                        Ok(res)
4628                    };
4629                    Box::pin(fut)
4630                }
4631                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4632                    #[allow(non_camel_case_types)]
4633                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4634                    impl<
4635                        T: MovePackageService,
4636                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4637                    for ListPackageVersionsSvc<T> {
4638                        type Response = super::ListPackageVersionsResponse;
4639                        type Future = BoxFuture<
4640                            tonic::Response<Self::Response>,
4641                            tonic::Status,
4642                        >;
4643                        fn call(
4644                            &mut self,
4645                            request: tonic::Request<super::ListPackageVersionsRequest>,
4646                        ) -> Self::Future {
4647                            let inner = Arc::clone(&self.0);
4648                            let fut = async move {
4649                                <T as MovePackageService>::list_package_versions(
4650                                        &inner,
4651                                        request,
4652                                    )
4653                                    .await
4654                            };
4655                            Box::pin(fut)
4656                        }
4657                    }
4658                    let accept_compression_encodings = self.accept_compression_encodings;
4659                    let send_compression_encodings = self.send_compression_encodings;
4660                    let max_decoding_message_size = self.max_decoding_message_size;
4661                    let max_encoding_message_size = self.max_encoding_message_size;
4662                    let inner = self.inner.clone();
4663                    let fut = async move {
4664                        let method = ListPackageVersionsSvc(inner);
4665                        let codec = tonic_prost::ProstCodec::default();
4666                        let mut grpc = tonic::server::Grpc::new(codec)
4667                            .apply_compression_config(
4668                                accept_compression_encodings,
4669                                send_compression_encodings,
4670                            )
4671                            .apply_max_message_size_config(
4672                                max_decoding_message_size,
4673                                max_encoding_message_size,
4674                            );
4675                        let res = grpc.unary(method, req).await;
4676                        Ok(res)
4677                    };
4678                    Box::pin(fut)
4679                }
4680                _ => {
4681                    Box::pin(async move {
4682                        let mut response = http::Response::new(
4683                            tonic::body::Body::default(),
4684                        );
4685                        let headers = response.headers_mut();
4686                        headers
4687                            .insert(
4688                                tonic::Status::GRPC_STATUS,
4689                                (tonic::Code::Unimplemented as i32).into(),
4690                            );
4691                        headers
4692                            .insert(
4693                                http::header::CONTENT_TYPE,
4694                                tonic::metadata::GRPC_CONTENT_TYPE,
4695                            );
4696                        Ok(response)
4697                    })
4698                }
4699            }
4700        }
4701    }
4702    impl<T> Clone for MovePackageServiceServer<T> {
4703        fn clone(&self) -> Self {
4704            let inner = self.inner.clone();
4705            Self {
4706                inner,
4707                accept_compression_encodings: self.accept_compression_encodings,
4708                send_compression_encodings: self.send_compression_encodings,
4709                max_decoding_message_size: self.max_decoding_message_size,
4710                max_encoding_message_size: self.max_encoding_message_size,
4711            }
4712        }
4713    }
4714    /// Generated gRPC service name
4715    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4716    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4717        const NAME: &'static str = SERVICE_NAME;
4718    }
4719}
4720#[non_exhaustive]
4721#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4722pub struct LookupNameRequest {
4723    /// Required. The SuiNS name to lookup.
4724    ///
4725    /// Supports both `@name` as well as `name.sui` formats.
4726    #[prost(string, optional, tag = "1")]
4727    pub name: ::core::option::Option<::prost::alloc::string::String>,
4728}
4729#[non_exhaustive]
4730#[derive(Clone, PartialEq, ::prost::Message)]
4731pub struct LookupNameResponse {
4732    /// The record for the requested name
4733    #[prost(message, optional, tag = "1")]
4734    pub record: ::core::option::Option<NameRecord>,
4735}
4736#[non_exhaustive]
4737#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4738pub struct ReverseLookupNameRequest {
4739    /// Required. The address to perform a reverse lookup for.
4740    #[prost(string, optional, tag = "1")]
4741    pub address: ::core::option::Option<::prost::alloc::string::String>,
4742}
4743#[non_exhaustive]
4744#[derive(Clone, PartialEq, ::prost::Message)]
4745pub struct ReverseLookupNameResponse {
4746    /// The record for the SuiNS name linked to the requested address
4747    #[prost(message, optional, tag = "1")]
4748    pub record: ::core::option::Option<NameRecord>,
4749}
4750#[non_exhaustive]
4751#[derive(Clone, PartialEq, ::prost::Message)]
4752pub struct NameRecord {
4753    /// Id of this record.
4754    ///
4755    /// Note that records are stored on chain as dynamic fields of the type
4756    /// `Field<Domain,NameRecord>`.
4757    #[prost(string, optional, tag = "1")]
4758    pub id: ::core::option::Option<::prost::alloc::string::String>,
4759    /// The SuiNS name of this record
4760    #[prost(string, optional, tag = "2")]
4761    pub name: ::core::option::Option<::prost::alloc::string::String>,
4762    /// The ID of the `RegistrationNFT` assigned to this record.
4763    ///
4764    /// The owner of the corresponding `RegistrationNFT` has the rights to
4765    /// be able to change and adjust the `target_address` of this domain.
4766    ///
4767    /// It is possible that the ID changes if the record expires and is
4768    /// purchased by someone else.
4769    #[prost(string, optional, tag = "3")]
4770    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4771    /// Timestamp when the record expires.
4772    ///
4773    /// This is either the expiration of the record itself or the expiration of
4774    /// this record's parent if this is a leaf record.
4775    #[prost(message, optional, tag = "4")]
4776    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4777    /// The target address that this name points to
4778    #[prost(string, optional, tag = "5")]
4779    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4780    /// Additional data which may be stored in a record
4781    #[prost(btree_map = "string, string", tag = "6")]
4782    pub data: ::prost::alloc::collections::BTreeMap<
4783        ::prost::alloc::string::String,
4784        ::prost::alloc::string::String,
4785    >,
4786}
4787/// Generated client implementations.
4788pub mod name_service_client {
4789    #![allow(
4790        unused_variables,
4791        dead_code,
4792        missing_docs,
4793        clippy::wildcard_imports,
4794        clippy::let_unit_value,
4795    )]
4796    use tonic::codegen::*;
4797    use tonic::codegen::http::Uri;
4798    #[derive(Debug, Clone)]
4799    pub struct NameServiceClient<T> {
4800        inner: tonic::client::Grpc<T>,
4801    }
4802    impl NameServiceClient<tonic::transport::Channel> {
4803        /// Attempt to create a new client by connecting to a given endpoint.
4804        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4805        where
4806            D: TryInto<tonic::transport::Endpoint>,
4807            D::Error: Into<StdError>,
4808        {
4809            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4810            Ok(Self::new(conn))
4811        }
4812    }
4813    impl<T> NameServiceClient<T>
4814    where
4815        T: tonic::client::GrpcService<tonic::body::Body>,
4816        T::Error: Into<StdError>,
4817        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4818        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4819    {
4820        pub fn new(inner: T) -> Self {
4821            let inner = tonic::client::Grpc::new(inner);
4822            Self { inner }
4823        }
4824        pub fn with_origin(inner: T, origin: Uri) -> Self {
4825            let inner = tonic::client::Grpc::with_origin(inner, origin);
4826            Self { inner }
4827        }
4828        pub fn with_interceptor<F>(
4829            inner: T,
4830            interceptor: F,
4831        ) -> NameServiceClient<InterceptedService<T, F>>
4832        where
4833            F: tonic::service::Interceptor,
4834            T::ResponseBody: Default,
4835            T: tonic::codegen::Service<
4836                http::Request<tonic::body::Body>,
4837                Response = http::Response<
4838                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4839                >,
4840            >,
4841            <T as tonic::codegen::Service<
4842                http::Request<tonic::body::Body>,
4843            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4844        {
4845            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4846        }
4847        /// Compress requests with the given encoding.
4848        ///
4849        /// This requires the server to support it otherwise it might respond with an
4850        /// error.
4851        #[must_use]
4852        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4853            self.inner = self.inner.send_compressed(encoding);
4854            self
4855        }
4856        /// Enable decompressing responses.
4857        #[must_use]
4858        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4859            self.inner = self.inner.accept_compressed(encoding);
4860            self
4861        }
4862        /// Limits the maximum size of a decoded message.
4863        ///
4864        /// Default: `4MB`
4865        #[must_use]
4866        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4867            self.inner = self.inner.max_decoding_message_size(limit);
4868            self
4869        }
4870        /// Limits the maximum size of an encoded message.
4871        ///
4872        /// Default: `usize::MAX`
4873        #[must_use]
4874        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4875            self.inner = self.inner.max_encoding_message_size(limit);
4876            self
4877        }
4878        pub async fn lookup_name(
4879            &mut self,
4880            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4881        ) -> std::result::Result<
4882            tonic::Response<super::LookupNameResponse>,
4883            tonic::Status,
4884        > {
4885            self.inner
4886                .ready()
4887                .await
4888                .map_err(|e| {
4889                    tonic::Status::unknown(
4890                        format!("Service was not ready: {}", e.into()),
4891                    )
4892                })?;
4893            let codec = tonic_prost::ProstCodec::default();
4894            let path = http::uri::PathAndQuery::from_static(
4895                "/sui.rpc.v2.NameService/LookupName",
4896            );
4897            let mut req = request.into_request();
4898            req.extensions_mut()
4899                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4900            self.inner.unary(req, path, codec).await
4901        }
4902        pub async fn reverse_lookup_name(
4903            &mut self,
4904            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4905        ) -> std::result::Result<
4906            tonic::Response<super::ReverseLookupNameResponse>,
4907            tonic::Status,
4908        > {
4909            self.inner
4910                .ready()
4911                .await
4912                .map_err(|e| {
4913                    tonic::Status::unknown(
4914                        format!("Service was not ready: {}", e.into()),
4915                    )
4916                })?;
4917            let codec = tonic_prost::ProstCodec::default();
4918            let path = http::uri::PathAndQuery::from_static(
4919                "/sui.rpc.v2.NameService/ReverseLookupName",
4920            );
4921            let mut req = request.into_request();
4922            req.extensions_mut()
4923                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4924            self.inner.unary(req, path, codec).await
4925        }
4926    }
4927}
4928/// Generated server implementations.
4929pub mod name_service_server {
4930    #![allow(
4931        unused_variables,
4932        dead_code,
4933        missing_docs,
4934        clippy::wildcard_imports,
4935        clippy::let_unit_value,
4936    )]
4937    use tonic::codegen::*;
4938    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4939    #[async_trait]
4940    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4941        async fn lookup_name(
4942            &self,
4943            request: tonic::Request<super::LookupNameRequest>,
4944        ) -> std::result::Result<
4945            tonic::Response<super::LookupNameResponse>,
4946            tonic::Status,
4947        > {
4948            Err(tonic::Status::unimplemented("Not yet implemented"))
4949        }
4950        async fn reverse_lookup_name(
4951            &self,
4952            request: tonic::Request<super::ReverseLookupNameRequest>,
4953        ) -> std::result::Result<
4954            tonic::Response<super::ReverseLookupNameResponse>,
4955            tonic::Status,
4956        > {
4957            Err(tonic::Status::unimplemented("Not yet implemented"))
4958        }
4959    }
4960    #[derive(Debug)]
4961    pub struct NameServiceServer<T> {
4962        inner: Arc<T>,
4963        accept_compression_encodings: EnabledCompressionEncodings,
4964        send_compression_encodings: EnabledCompressionEncodings,
4965        max_decoding_message_size: Option<usize>,
4966        max_encoding_message_size: Option<usize>,
4967    }
4968    impl<T> NameServiceServer<T> {
4969        pub fn new(inner: T) -> Self {
4970            Self::from_arc(Arc::new(inner))
4971        }
4972        pub fn from_arc(inner: Arc<T>) -> Self {
4973            Self {
4974                inner,
4975                accept_compression_encodings: Default::default(),
4976                send_compression_encodings: Default::default(),
4977                max_decoding_message_size: None,
4978                max_encoding_message_size: None,
4979            }
4980        }
4981        pub fn with_interceptor<F>(
4982            inner: T,
4983            interceptor: F,
4984        ) -> InterceptedService<Self, F>
4985        where
4986            F: tonic::service::Interceptor,
4987        {
4988            InterceptedService::new(Self::new(inner), interceptor)
4989        }
4990        /// Enable decompressing requests with the given encoding.
4991        #[must_use]
4992        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4993            self.accept_compression_encodings.enable(encoding);
4994            self
4995        }
4996        /// Compress responses with the given encoding, if the client supports it.
4997        #[must_use]
4998        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4999            self.send_compression_encodings.enable(encoding);
5000            self
5001        }
5002        /// Limits the maximum size of a decoded message.
5003        ///
5004        /// Default: `4MB`
5005        #[must_use]
5006        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5007            self.max_decoding_message_size = Some(limit);
5008            self
5009        }
5010        /// Limits the maximum size of an encoded message.
5011        ///
5012        /// Default: `usize::MAX`
5013        #[must_use]
5014        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5015            self.max_encoding_message_size = Some(limit);
5016            self
5017        }
5018    }
5019    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
5020    where
5021        T: NameService,
5022        B: Body + std::marker::Send + 'static,
5023        B::Error: Into<StdError> + std::marker::Send + 'static,
5024    {
5025        type Response = http::Response<tonic::body::Body>;
5026        type Error = std::convert::Infallible;
5027        type Future = BoxFuture<Self::Response, Self::Error>;
5028        fn poll_ready(
5029            &mut self,
5030            _cx: &mut Context<'_>,
5031        ) -> Poll<std::result::Result<(), Self::Error>> {
5032            Poll::Ready(Ok(()))
5033        }
5034        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5035            match req.uri().path() {
5036                "/sui.rpc.v2.NameService/LookupName" => {
5037                    #[allow(non_camel_case_types)]
5038                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
5039                    impl<
5040                        T: NameService,
5041                    > tonic::server::UnaryService<super::LookupNameRequest>
5042                    for LookupNameSvc<T> {
5043                        type Response = super::LookupNameResponse;
5044                        type Future = BoxFuture<
5045                            tonic::Response<Self::Response>,
5046                            tonic::Status,
5047                        >;
5048                        fn call(
5049                            &mut self,
5050                            request: tonic::Request<super::LookupNameRequest>,
5051                        ) -> Self::Future {
5052                            let inner = Arc::clone(&self.0);
5053                            let fut = async move {
5054                                <T as NameService>::lookup_name(&inner, request).await
5055                            };
5056                            Box::pin(fut)
5057                        }
5058                    }
5059                    let accept_compression_encodings = self.accept_compression_encodings;
5060                    let send_compression_encodings = self.send_compression_encodings;
5061                    let max_decoding_message_size = self.max_decoding_message_size;
5062                    let max_encoding_message_size = self.max_encoding_message_size;
5063                    let inner = self.inner.clone();
5064                    let fut = async move {
5065                        let method = LookupNameSvc(inner);
5066                        let codec = tonic_prost::ProstCodec::default();
5067                        let mut grpc = tonic::server::Grpc::new(codec)
5068                            .apply_compression_config(
5069                                accept_compression_encodings,
5070                                send_compression_encodings,
5071                            )
5072                            .apply_max_message_size_config(
5073                                max_decoding_message_size,
5074                                max_encoding_message_size,
5075                            );
5076                        let res = grpc.unary(method, req).await;
5077                        Ok(res)
5078                    };
5079                    Box::pin(fut)
5080                }
5081                "/sui.rpc.v2.NameService/ReverseLookupName" => {
5082                    #[allow(non_camel_case_types)]
5083                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
5084                    impl<
5085                        T: NameService,
5086                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
5087                    for ReverseLookupNameSvc<T> {
5088                        type Response = super::ReverseLookupNameResponse;
5089                        type Future = BoxFuture<
5090                            tonic::Response<Self::Response>,
5091                            tonic::Status,
5092                        >;
5093                        fn call(
5094                            &mut self,
5095                            request: tonic::Request<super::ReverseLookupNameRequest>,
5096                        ) -> Self::Future {
5097                            let inner = Arc::clone(&self.0);
5098                            let fut = async move {
5099                                <T as NameService>::reverse_lookup_name(&inner, request)
5100                                    .await
5101                            };
5102                            Box::pin(fut)
5103                        }
5104                    }
5105                    let accept_compression_encodings = self.accept_compression_encodings;
5106                    let send_compression_encodings = self.send_compression_encodings;
5107                    let max_decoding_message_size = self.max_decoding_message_size;
5108                    let max_encoding_message_size = self.max_encoding_message_size;
5109                    let inner = self.inner.clone();
5110                    let fut = async move {
5111                        let method = ReverseLookupNameSvc(inner);
5112                        let codec = tonic_prost::ProstCodec::default();
5113                        let mut grpc = tonic::server::Grpc::new(codec)
5114                            .apply_compression_config(
5115                                accept_compression_encodings,
5116                                send_compression_encodings,
5117                            )
5118                            .apply_max_message_size_config(
5119                                max_decoding_message_size,
5120                                max_encoding_message_size,
5121                            );
5122                        let res = grpc.unary(method, req).await;
5123                        Ok(res)
5124                    };
5125                    Box::pin(fut)
5126                }
5127                _ => {
5128                    Box::pin(async move {
5129                        let mut response = http::Response::new(
5130                            tonic::body::Body::default(),
5131                        );
5132                        let headers = response.headers_mut();
5133                        headers
5134                            .insert(
5135                                tonic::Status::GRPC_STATUS,
5136                                (tonic::Code::Unimplemented as i32).into(),
5137                            );
5138                        headers
5139                            .insert(
5140                                http::header::CONTENT_TYPE,
5141                                tonic::metadata::GRPC_CONTENT_TYPE,
5142                            );
5143                        Ok(response)
5144                    })
5145                }
5146            }
5147        }
5148    }
5149    impl<T> Clone for NameServiceServer<T> {
5150        fn clone(&self) -> Self {
5151            let inner = self.inner.clone();
5152            Self {
5153                inner,
5154                accept_compression_encodings: self.accept_compression_encodings,
5155                send_compression_encodings: self.send_compression_encodings,
5156                max_decoding_message_size: self.max_decoding_message_size,
5157                max_encoding_message_size: self.max_encoding_message_size,
5158            }
5159        }
5160    }
5161    /// Generated gRPC service name
5162    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5163    impl<T> tonic::server::NamedService for NameServiceServer<T> {
5164        const NAME: &'static str = SERVICE_NAME;
5165    }
5166}
5167/// An object on the Sui blockchain.
5168#[non_exhaustive]
5169#[derive(Clone, PartialEq, ::prost::Message)]
5170pub struct Object {
5171    /// This Object serialized as BCS.
5172    #[prost(message, optional, tag = "1")]
5173    pub bcs: ::core::option::Option<Bcs>,
5174    /// `ObjectId` for this object.
5175    #[prost(string, optional, tag = "2")]
5176    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5177    /// Version of the object.
5178    #[prost(uint64, optional, tag = "3")]
5179    pub version: ::core::option::Option<u64>,
5180    /// The digest of this Object.
5181    #[prost(string, optional, tag = "4")]
5182    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5183    /// Owner of the object.
5184    #[prost(message, optional, tag = "5")]
5185    pub owner: ::core::option::Option<Owner>,
5186    /// The type of this object.
5187    ///
5188    /// This will be 'package' for packages and a StructTag for move structs.
5189    #[prost(string, optional, tag = "6")]
5190    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5191    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
5192    /// object. Instead, it is always calculated from the objects type when loaded in execution.
5193    ///
5194    /// Only set for Move structs
5195    #[prost(bool, optional, tag = "7")]
5196    pub has_public_transfer: ::core::option::Option<bool>,
5197    /// BCS bytes of a Move struct value.
5198    ///
5199    /// Only set for Move structs
5200    #[prost(message, optional, tag = "8")]
5201    pub contents: ::core::option::Option<Bcs>,
5202    /// Package information for Move Packages
5203    #[prost(message, optional, tag = "9")]
5204    pub package: ::core::option::Option<Package>,
5205    /// The digest of the transaction that created or last mutated this object
5206    #[prost(string, optional, tag = "10")]
5207    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5208    /// The amount of SUI to rebate if this object gets deleted.
5209    /// This number is re-calculated each time the object is mutated based on
5210    /// the present storage gas price.
5211    #[prost(uint64, optional, tag = "11")]
5212    pub storage_rebate: ::core::option::Option<u64>,
5213    /// JSON rendering of the object.
5214    #[prost(message, optional, boxed, tag = "100")]
5215    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5216    /// Current balance if this object is a `0x2::coin::Coin<T>`
5217    #[prost(uint64, optional, tag = "101")]
5218    pub balance: ::core::option::Option<u64>,
5219    /// JSON rendering of the object based on an on-chain template.
5220    /// This will not be set if the value's type does not have an associated `Display` template.
5221    #[prost(message, optional, boxed, tag = "102")]
5222    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5223}
5224/// Set of Objects
5225#[non_exhaustive]
5226#[derive(Clone, PartialEq, ::prost::Message)]
5227pub struct ObjectSet {
5228    /// Objects are sorted by the key `(object_id, version)`.
5229    #[prost(message, repeated, tag = "1")]
5230    pub objects: ::prost::alloc::vec::Vec<Object>,
5231}
5232/// A rendered JSON blob based on an on-chain template.
5233#[non_exhaustive]
5234#[derive(Clone, PartialEq, ::prost::Message)]
5235pub struct Display {
5236    /// Output for all successfully substituted display fields. Unsuccessful
5237    /// fields will be `null`, and will be accompanied by a field in `errors`,
5238    /// explaining the error.
5239    #[prost(message, optional, tag = "1")]
5240    pub output: ::core::option::Option<::prost_types::Value>,
5241    /// If any fields failed to render, this will contain a mapping from failed
5242    /// field names to error messages. If all fields succeed, this will either be
5243    /// `null` or not set.
5244    #[prost(message, optional, tag = "2")]
5245    pub errors: ::core::option::Option<::prost_types::Value>,
5246}
5247/// Reference to an object.
5248#[non_exhaustive]
5249#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5250pub struct ObjectReference {
5251    /// The object id of this object.
5252    #[prost(string, optional, tag = "1")]
5253    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5254    /// The version of this object.
5255    #[prost(uint64, optional, tag = "2")]
5256    pub version: ::core::option::Option<u64>,
5257    /// The digest of this object.
5258    #[prost(string, optional, tag = "3")]
5259    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5260}
5261/// Enum of different types of ownership for an object.
5262#[non_exhaustive]
5263#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5264pub struct Owner {
5265    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5266    pub kind: ::core::option::Option<i32>,
5267    /// Address or ObjectId of the owner
5268    #[prost(string, optional, tag = "2")]
5269    pub address: ::core::option::Option<::prost::alloc::string::String>,
5270    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
5271    #[prost(uint64, optional, tag = "3")]
5272    pub version: ::core::option::Option<u64>,
5273}
5274/// Nested message and enum types in `Owner`.
5275pub mod owner {
5276    #[non_exhaustive]
5277    #[derive(
5278        Clone,
5279        Copy,
5280        Debug,
5281        PartialEq,
5282        Eq,
5283        Hash,
5284        PartialOrd,
5285        Ord,
5286        ::prost::Enumeration
5287    )]
5288    #[repr(i32)]
5289    pub enum OwnerKind {
5290        Unknown = 0,
5291        Address = 1,
5292        Object = 2,
5293        Shared = 3,
5294        Immutable = 4,
5295        ConsensusAddress = 5,
5296    }
5297    impl OwnerKind {
5298        /// String value of the enum field names used in the ProtoBuf definition.
5299        ///
5300        /// The values are not transformed in any way and thus are considered stable
5301        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5302        pub fn as_str_name(&self) -> &'static str {
5303            match self {
5304                Self::Unknown => "OWNER_KIND_UNKNOWN",
5305                Self::Address => "ADDRESS",
5306                Self::Object => "OBJECT",
5307                Self::Shared => "SHARED",
5308                Self::Immutable => "IMMUTABLE",
5309                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5310            }
5311        }
5312        /// Creates an enum from field names used in the ProtoBuf definition.
5313        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5314            match value {
5315                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5316                "ADDRESS" => Some(Self::Address),
5317                "OBJECT" => Some(Self::Object),
5318                "SHARED" => Some(Self::Shared),
5319                "IMMUTABLE" => Some(Self::Immutable),
5320                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5321                _ => None,
5322            }
5323        }
5324    }
5325}
5326#[non_exhaustive]
5327#[derive(Clone, PartialEq, ::prost::Message)]
5328pub struct ProtocolConfig {
5329    #[prost(uint64, optional, tag = "1")]
5330    pub protocol_version: ::core::option::Option<u64>,
5331    /// Deprecated in favor of the lossless `configs` field.
5332    #[prost(btree_map = "string, bool", tag = "2")]
5333    pub feature_flags: ::prost::alloc::collections::BTreeMap<
5334        ::prost::alloc::string::String,
5335        bool,
5336    >,
5337    /// Deprecated in favor of the lossless `configs` field.
5338    #[prost(btree_map = "string, string", tag = "3")]
5339    pub attributes: ::prost::alloc::collections::BTreeMap<
5340        ::prost::alloc::string::String,
5341        ::prost::alloc::string::String,
5342    >,
5343    #[prost(btree_map = "string, message", tag = "4")]
5344    pub configs: ::prost::alloc::collections::BTreeMap<
5345        ::prost::alloc::string::String,
5346        ::prost_types::Value,
5347    >,
5348}
5349/// Cursor-bounded query options.
5350///
5351/// `after` and `before` are canonical ledger-position bounds, not
5352/// ordering-relative cursors. `after` always excludes items at or below that
5353/// cursor, and `before` always excludes items at or above that cursor. Ordering
5354/// only controls the order of returned items within the resulting open interval.
5355///
5356/// When a request also specifies a checkpoint range, cursor bounds and
5357/// checkpoint bounds compose by intersection: results come only from ledger
5358/// positions inside both. Checkpoint bounds are likewise canonical and
5359/// ordering-independent.
5360///
5361/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
5362/// `limit = N`, the response contains up to N matching items in descending
5363/// order from the interval `(A, B)`. If the response ends with
5364/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
5365/// `before` to the last `Watermark.cursor` received. That cursor is the
5366/// lowest position reached in ledger order, so it becomes the next exclusive
5367/// upper bound.
5368#[non_exhaustive]
5369#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5370pub struct QueryOptions {
5371    /// The maximum number of items to return. Each method applies its own default
5372    /// and maximum. QueryEnd does not count against this limit.
5373    #[prost(uint32, optional, tag = "1")]
5374    pub limit: ::core::option::Option<u32>,
5375    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
5376    /// canonical ledger order.
5377    #[prost(bytes = "bytes", optional, tag = "2")]
5378    pub after: ::core::option::Option<::prost::bytes::Bytes>,
5379    /// Opaque exclusive upper bound. Results must be strictly before this cursor
5380    /// in canonical ledger order.
5381    #[prost(bytes = "bytes", optional, tag = "3")]
5382    pub before: ::core::option::Option<::prost::bytes::Bytes>,
5383    /// Ordering for returned results. Defaults to ASCENDING.
5384    ///
5385    /// Ordering only controls the order of results within the bounded interval;
5386    /// cursor bounds keep the same meaning for ascending and descending reads.
5387    #[prost(enumeration = "Ordering", optional, tag = "4")]
5388    pub ordering: ::core::option::Option<i32>,
5389}
5390/// Progress marker for a query scan. Carried on every response frame, whether or
5391/// not the frame delivers a matching item. Watermarks never regress in the
5392/// requested ordering, but consecutive frames may carry the same watermark when
5393/// additional work does not advance the safe resume frontier.
5394#[non_exhaustive]
5395#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5396pub struct Watermark {
5397    /// Opaque cursor at this scan position. Set on every watermark. Use as
5398    /// `options.after` (ascending) or `options.before` (descending) on the next
5399    /// request to resume from here. The most recently received cursor is always
5400    /// the safe resume point.
5401    #[prost(bytes = "bytes", optional, tag = "1")]
5402    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5403    /// The inclusive boundary checkpoint that the scan has fully covered within
5404    /// the request's effective interval, in the request's ordering direction: an
5405    /// ascending scan has emitted every matching item in the interval at
5406    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
5407    /// matches); a descending scan has emitted every matching item in the
5408    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
5409    /// the scan direction, but it may repeat while the cursor advances.
5410    ///
5411    /// Unset until the scan's first checkpoint is fully covered. For example, a
5412    /// scan resumed from a cursor that lands mid-checkpoint leaves this unset
5413    /// until the next checkpoint boundary in the scan direction is fully covered.
5414    /// A watermark still has a valid resume cursor while this field is unset.
5415    #[prost(uint64, optional, tag = "2")]
5416    pub checkpoint: ::core::option::Option<u64>,
5417}
5418/// Marker for the final frame of a successful query stream. Every successful
5419/// stream sets `QueryEnd` on exactly one frame, after which no further frames
5420/// are sent. That frame always carries the final watermark. For `ItemLimit`, it
5421/// also carries the final matching item; for every other reason it carries no
5422/// item. A ScanLimit terminal watermark may repeat the previous frame's cursor
5423/// when its authoritative scan frontier was already emitted; this does not
5424/// repeat an item.
5425///
5426/// A stream that fails or is cancelled terminates with a gRPC status and does
5427/// not send `QueryEnd`.
5428#[non_exhaustive]
5429#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5430pub struct QueryEnd {
5431    /// Reason this response stopped.
5432    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5433    pub reason: ::core::option::Option<i32>,
5434}
5435/// Ordering for the returned result set.
5436#[non_exhaustive]
5437#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5438#[repr(i32)]
5439pub enum Ordering {
5440    /// Return results in increasing cursor order.
5441    Ascending = 0,
5442    /// Return results in decreasing cursor order.
5443    Descending = 1,
5444}
5445impl Ordering {
5446    /// String value of the enum field names used in the ProtoBuf definition.
5447    ///
5448    /// The values are not transformed in any way and thus are considered stable
5449    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5450    pub fn as_str_name(&self) -> &'static str {
5451        match self {
5452            Self::Ascending => "ORDERING_ASCENDING",
5453            Self::Descending => "ORDERING_DESCENDING",
5454        }
5455    }
5456    /// Creates an enum from field names used in the ProtoBuf definition.
5457    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5458        match value {
5459            "ORDERING_ASCENDING" => Some(Self::Ascending),
5460            "ORDERING_DESCENDING" => Some(Self::Descending),
5461            _ => None,
5462        }
5463    }
5464}
5465/// Reason the server stopped this query response.
5466#[non_exhaustive]
5467#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5468#[repr(i32)]
5469pub enum QueryEndReason {
5470    /// The stop reason was not specified.
5471    Unknown = 0,
5472    /// The response reached the requested item limit. The final matching item's
5473    /// frame carries `QueryEnd` and the final watermark. Resume from that frame's
5474    /// `Watermark.cursor` to continue reading the same effective interval.
5475    ItemLimit = 1,
5476    /// The response reached the server's per-request bucket-fetch budget for
5477    /// filtered scans before reaching the effective interval bound. The terminal
5478    /// frame carries no item. Its watermark cursor is the authoritative scan
5479    /// frontier from which to resume.
5480    ScanLimit = 2,
5481    /// The scan reached a requested checkpoint range bound. The terminal frame
5482    /// carries no item.
5483    CheckpointBound = 3,
5484    /// The scan reached an exclusive cursor bound. The terminal frame carries no
5485    /// item. Its watermark cursor represents that resolved bound without claiming
5486    /// that its containing checkpoint was fully covered.
5487    CursorBound = 4,
5488    /// The scan reached the currently indexed ledger tip. The terminal frame
5489    /// carries no item.
5490    LedgerTip = 5,
5491}
5492impl QueryEndReason {
5493    /// String value of the enum field names used in the ProtoBuf definition.
5494    ///
5495    /// The values are not transformed in any way and thus are considered stable
5496    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5497    pub fn as_str_name(&self) -> &'static str {
5498        match self {
5499            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5500            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5501            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5502            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5503            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5504            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5505        }
5506    }
5507    /// Creates an enum from field names used in the ProtoBuf definition.
5508    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5509        match value {
5510            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5511            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5512            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5513            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5514            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5515            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5516            _ => None,
5517        }
5518    }
5519}
5520/// A signature from a user.
5521#[non_exhaustive]
5522#[derive(Clone, PartialEq, ::prost::Message)]
5523pub struct UserSignature {
5524    /// This signature serialized as as BCS.
5525    ///
5526    /// When provided as input this will support both the form that is length
5527    /// prefixed as well as not length prefixed.
5528    #[prost(message, optional, tag = "1")]
5529    pub bcs: ::core::option::Option<Bcs>,
5530    /// The signature scheme of this signature.
5531    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5532    pub scheme: ::core::option::Option<i32>,
5533    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5534    pub signature: ::core::option::Option<user_signature::Signature>,
5535}
5536/// Nested message and enum types in `UserSignature`.
5537pub mod user_signature {
5538    #[non_exhaustive]
5539    #[derive(Clone, PartialEq, ::prost::Oneof)]
5540    pub enum Signature {
5541        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1 | mldsa65.
5542        #[prost(message, tag = "3")]
5543        Simple(super::SimpleSignature),
5544        /// The multisig aggregated signature if scheme is `MULTISIG`.
5545        #[prost(message, tag = "4")]
5546        Multisig(super::MultisigAggregatedSignature),
5547        /// The zklogin authenticator if scheme is `ZKLOGIN`.
5548        #[prost(message, tag = "5")]
5549        Zklogin(super::ZkLoginAuthenticator),
5550        /// The passkey authenticator if scheme is `PASSKEY`.
5551        #[prost(message, tag = "6")]
5552        Passkey(super::PasskeyAuthenticator),
5553    }
5554}
5555/// Either an ed25519, secp256k1, secp256r1 or mldsa65 signature
5556#[non_exhaustive]
5557#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5558pub struct SimpleSignature {
5559    /// The signature scheme of this signature.
5560    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5561    pub scheme: ::core::option::Option<i32>,
5562    /// Signature bytes
5563    #[prost(bytes = "bytes", optional, tag = "2")]
5564    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5565    /// Public key bytes
5566    #[prost(bytes = "bytes", optional, tag = "3")]
5567    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5568}
5569/// Public key equivalent for zklogin authenticators.
5570#[non_exhaustive]
5571#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5572pub struct ZkLoginPublicIdentifier {
5573    #[prost(string, optional, tag = "1")]
5574    pub iss: ::core::option::Option<::prost::alloc::string::String>,
5575    /// base10 encoded Bn254FieldElement
5576    #[prost(string, optional, tag = "2")]
5577    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5578}
5579/// Set of valid public keys for multisig committee members.
5580#[non_exhaustive]
5581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5582pub struct MultisigMemberPublicKey {
5583    /// The signature scheme of this public key.
5584    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5585    pub scheme: ::core::option::Option<i32>,
5586    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey | mldsa65.
5587    #[prost(bytes = "bytes", optional, tag = "2")]
5588    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5589    /// A zklogin public identifier if scheme is zklogin.
5590    #[prost(message, optional, tag = "3")]
5591    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5592}
5593/// A member in a multisig committee.
5594#[non_exhaustive]
5595#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5596pub struct MultisigMember {
5597    /// The public key of the committee member.
5598    #[prost(message, optional, tag = "1")]
5599    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5600    /// The weight of this member's signature.
5601    #[prost(uint32, optional, tag = "2")]
5602    pub weight: ::core::option::Option<u32>,
5603}
5604/// A multisig committee.
5605#[non_exhaustive]
5606#[derive(Clone, PartialEq, ::prost::Message)]
5607pub struct MultisigCommittee {
5608    /// A list of committee members and their corresponding weight.
5609    #[prost(message, repeated, tag = "1")]
5610    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5611    /// The threshold of signatures needed to validate a signature from
5612    /// this committee.
5613    #[prost(uint32, optional, tag = "2")]
5614    pub threshold: ::core::option::Option<u32>,
5615}
5616/// Aggregated signature from members of a multisig committee.
5617#[non_exhaustive]
5618#[derive(Clone, PartialEq, ::prost::Message)]
5619pub struct MultisigAggregatedSignature {
5620    /// The plain signatures encoded with signature scheme.
5621    ///
5622    /// The signatures must be in the same order as they are listed in the committee.
5623    #[prost(message, repeated, tag = "1")]
5624    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5625    /// Bitmap indicating which committee members contributed to the
5626    /// signature.
5627    #[prost(uint32, optional, tag = "2")]
5628    pub bitmap: ::core::option::Option<u32>,
5629    /// If present, means this signature's on-chain format uses the old
5630    /// legacy multisig format.
5631    #[prost(bytes = "bytes", optional, tag = "3")]
5632    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5633    /// The committee to use to validate this signature.
5634    #[prost(message, optional, tag = "4")]
5635    pub committee: ::core::option::Option<MultisigCommittee>,
5636}
5637/// A signature from a member of a multisig committee.
5638#[non_exhaustive]
5639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5640pub struct MultisigMemberSignature {
5641    /// The signature scheme of this signature.
5642    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5643    pub scheme: ::core::option::Option<i32>,
5644    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1 | mldsa65.
5645    #[prost(bytes = "bytes", optional, tag = "2")]
5646    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5647    /// The zklogin authenticator if scheme is `ZKLOGIN`.
5648    #[prost(message, optional, tag = "3")]
5649    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5650    /// The passkey authenticator if scheme is `PASSKEY`.
5651    #[prost(message, optional, tag = "4")]
5652    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5653}
5654/// A zklogin authenticator.
5655#[non_exhaustive]
5656#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5657pub struct ZkLoginAuthenticator {
5658    /// Zklogin proof and inputs required to perform proof verification.
5659    #[prost(message, optional, tag = "1")]
5660    pub inputs: ::core::option::Option<ZkLoginInputs>,
5661    /// Maximum epoch for which the proof is valid.
5662    #[prost(uint64, optional, tag = "2")]
5663    pub max_epoch: ::core::option::Option<u64>,
5664    /// User signature with the public key attested to by the provided proof.
5665    #[prost(message, optional, tag = "3")]
5666    pub signature: ::core::option::Option<SimpleSignature>,
5667    /// The public identifier (similar to a public key) for this zklogin authenticator
5668    #[prost(message, optional, tag = "4")]
5669    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5670    /// The id of the JWK used to authorize this zklogin authenticator
5671    #[prost(message, optional, tag = "5")]
5672    pub jwk_id: ::core::option::Option<JwkId>,
5673}
5674/// A zklogin groth16 proof and the required inputs to perform proof verification.
5675#[non_exhaustive]
5676#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5677pub struct ZkLoginInputs {
5678    #[prost(message, optional, tag = "1")]
5679    pub proof_points: ::core::option::Option<ZkLoginProof>,
5680    #[prost(message, optional, tag = "2")]
5681    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5682    #[prost(string, optional, tag = "3")]
5683    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5684    /// base10 encoded Bn254FieldElement
5685    #[prost(string, optional, tag = "4")]
5686    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5687}
5688/// A zklogin groth16 proof.
5689#[non_exhaustive]
5690#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5691pub struct ZkLoginProof {
5692    #[prost(message, optional, tag = "1")]
5693    pub a: ::core::option::Option<CircomG1>,
5694    #[prost(message, optional, tag = "2")]
5695    pub b: ::core::option::Option<CircomG2>,
5696    #[prost(message, optional, tag = "3")]
5697    pub c: ::core::option::Option<CircomG1>,
5698}
5699/// A claim of the iss in a zklogin proof.
5700#[non_exhaustive]
5701#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5702pub struct ZkLoginClaim {
5703    #[prost(string, optional, tag = "1")]
5704    pub value: ::core::option::Option<::prost::alloc::string::String>,
5705    #[prost(uint32, optional, tag = "2")]
5706    pub index_mod_4: ::core::option::Option<u32>,
5707}
5708/// A G1 point.
5709#[non_exhaustive]
5710#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5711pub struct CircomG1 {
5712    /// base10 encoded Bn254FieldElement
5713    #[prost(string, optional, tag = "1")]
5714    pub e0: ::core::option::Option<::prost::alloc::string::String>,
5715    /// base10 encoded Bn254FieldElement
5716    #[prost(string, optional, tag = "2")]
5717    pub e1: ::core::option::Option<::prost::alloc::string::String>,
5718    /// base10 encoded Bn254FieldElement
5719    #[prost(string, optional, tag = "3")]
5720    pub e2: ::core::option::Option<::prost::alloc::string::String>,
5721}
5722/// A G2 point.
5723#[non_exhaustive]
5724#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5725pub struct CircomG2 {
5726    /// base10 encoded Bn254FieldElement
5727    #[prost(string, optional, tag = "1")]
5728    pub e00: ::core::option::Option<::prost::alloc::string::String>,
5729    /// base10 encoded Bn254FieldElement
5730    #[prost(string, optional, tag = "2")]
5731    pub e01: ::core::option::Option<::prost::alloc::string::String>,
5732    /// base10 encoded Bn254FieldElement
5733    #[prost(string, optional, tag = "3")]
5734    pub e10: ::core::option::Option<::prost::alloc::string::String>,
5735    /// base10 encoded Bn254FieldElement
5736    #[prost(string, optional, tag = "4")]
5737    pub e11: ::core::option::Option<::prost::alloc::string::String>,
5738    /// base10 encoded Bn254FieldElement
5739    #[prost(string, optional, tag = "5")]
5740    pub e20: ::core::option::Option<::prost::alloc::string::String>,
5741    /// base10 encoded Bn254FieldElement
5742    #[prost(string, optional, tag = "6")]
5743    pub e21: ::core::option::Option<::prost::alloc::string::String>,
5744}
5745/// A passkey authenticator.
5746///
5747/// See
5748/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
5749/// for more information on the requirements on the shape of the
5750/// `client_data_json` field.
5751#[non_exhaustive]
5752#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5753pub struct PasskeyAuthenticator {
5754    /// Opaque authenticator data for this passkey signature.
5755    ///
5756    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
5757    /// more information on this field.
5758    #[prost(bytes = "bytes", optional, tag = "1")]
5759    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5760    /// Structured, unparsed, JSON for this passkey signature.
5761    ///
5762    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
5763    /// for more information on this field.
5764    #[prost(string, optional, tag = "2")]
5765    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5766    /// A secp256r1 signature.
5767    #[prost(message, optional, tag = "3")]
5768    pub signature: ::core::option::Option<SimpleSignature>,
5769}
5770/// The validator set for a particular epoch.
5771#[non_exhaustive]
5772#[derive(Clone, PartialEq, ::prost::Message)]
5773pub struct ValidatorCommittee {
5774    /// The epoch where this committee governs.
5775    #[prost(uint64, optional, tag = "1")]
5776    pub epoch: ::core::option::Option<u64>,
5777    /// The committee members.
5778    #[prost(message, repeated, tag = "2")]
5779    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5780}
5781/// A member of a validator committee.
5782#[non_exhaustive]
5783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5784pub struct ValidatorCommitteeMember {
5785    /// The 96-byte Bls12381 public key for this validator.
5786    #[prost(bytes = "bytes", optional, tag = "1")]
5787    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5788    /// voting weight this validator possesses.
5789    #[prost(uint64, optional, tag = "2")]
5790    pub weight: ::core::option::Option<u64>,
5791}
5792/// / An aggregated signature from multiple validators.
5793#[non_exhaustive]
5794#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5795pub struct ValidatorAggregatedSignature {
5796    /// The epoch when this signature was produced.
5797    ///
5798    /// This can be used to lookup the `ValidatorCommittee` from this epoch
5799    /// to verify this signature.
5800    #[prost(uint64, optional, tag = "1")]
5801    pub epoch: ::core::option::Option<u64>,
5802    /// The 48-byte Bls12381 aggregated signature.
5803    #[prost(bytes = "bytes", optional, tag = "2")]
5804    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5805    /// Bitmap indicating which members of the committee contributed to
5806    /// this signature.
5807    #[prost(bytes = "bytes", optional, tag = "3")]
5808    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5809}
5810/// Flag use to disambiguate the signature schemes supported by Sui.
5811///
5812/// Note: the enum values defined by this proto message exactly match their
5813/// expected BCS serialized values when serialized as a u8. See
5814/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
5815/// for more information about signature schemes.
5816#[non_exhaustive]
5817#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5818#[repr(i32)]
5819pub enum SignatureScheme {
5820    Ed25519 = 0,
5821    Secp256k1 = 1,
5822    Secp256r1 = 2,
5823    Multisig = 3,
5824    Bls12381 = 4,
5825    Zklogin = 5,
5826    Passkey = 6,
5827    Mldsa65 = 7,
5828}
5829impl SignatureScheme {
5830    /// String value of the enum field names used in the ProtoBuf definition.
5831    ///
5832    /// The values are not transformed in any way and thus are considered stable
5833    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5834    pub fn as_str_name(&self) -> &'static str {
5835        match self {
5836            Self::Ed25519 => "ED25519",
5837            Self::Secp256k1 => "SECP256K1",
5838            Self::Secp256r1 => "SECP256R1",
5839            Self::Multisig => "MULTISIG",
5840            Self::Bls12381 => "BLS12381",
5841            Self::Zklogin => "ZKLOGIN",
5842            Self::Passkey => "PASSKEY",
5843            Self::Mldsa65 => "MLDSA65",
5844        }
5845    }
5846    /// Creates an enum from field names used in the ProtoBuf definition.
5847    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5848        match value {
5849            "ED25519" => Some(Self::Ed25519),
5850            "SECP256K1" => Some(Self::Secp256k1),
5851            "SECP256R1" => Some(Self::Secp256r1),
5852            "MULTISIG" => Some(Self::Multisig),
5853            "BLS12381" => Some(Self::Bls12381),
5854            "ZKLOGIN" => Some(Self::Zklogin),
5855            "PASSKEY" => Some(Self::Passkey),
5856            "MLDSA65" => Some(Self::Mldsa65),
5857            _ => None,
5858        }
5859    }
5860}
5861#[non_exhaustive]
5862#[derive(Clone, PartialEq, ::prost::Message)]
5863pub struct VerifySignatureRequest {
5864    /// The message to verify against.
5865    ///
5866    /// Today the only supported message types are `PersonalMessage` and
5867    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
5868    /// message is being verified.
5869    #[prost(message, optional, tag = "1")]
5870    pub message: ::core::option::Option<Bcs>,
5871    /// The signature to verify.
5872    #[prost(message, optional, tag = "2")]
5873    pub signature: ::core::option::Option<UserSignature>,
5874    /// Optional. Address to validate against the provided signature.
5875    ///
5876    /// If provided, this address will be compared against the the address derived
5877    /// from the provide signature and a successful response will only be returned
5878    /// if they match.
5879    #[prost(string, optional, tag = "3")]
5880    pub address: ::core::option::Option<::prost::alloc::string::String>,
5881    /// The set of JWKs to use when verifying Zklogin signatures.
5882    /// If this is empty the current set of valid JWKs stored onchain will be used
5883    #[prost(message, repeated, tag = "4")]
5884    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5885}
5886#[non_exhaustive]
5887#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5888pub struct VerifySignatureResponse {
5889    /// Indicates if the provided signature was valid given the requested parameters.
5890    #[prost(bool, optional, tag = "1")]
5891    pub is_valid: ::core::option::Option<bool>,
5892    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
5893    #[prost(string, optional, tag = "2")]
5894    pub reason: ::core::option::Option<::prost::alloc::string::String>,
5895}
5896/// Generated client implementations.
5897pub mod signature_verification_service_client {
5898    #![allow(
5899        unused_variables,
5900        dead_code,
5901        missing_docs,
5902        clippy::wildcard_imports,
5903        clippy::let_unit_value,
5904    )]
5905    use tonic::codegen::*;
5906    use tonic::codegen::http::Uri;
5907    #[derive(Debug, Clone)]
5908    pub struct SignatureVerificationServiceClient<T> {
5909        inner: tonic::client::Grpc<T>,
5910    }
5911    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5912        /// Attempt to create a new client by connecting to a given endpoint.
5913        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5914        where
5915            D: TryInto<tonic::transport::Endpoint>,
5916            D::Error: Into<StdError>,
5917        {
5918            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5919            Ok(Self::new(conn))
5920        }
5921    }
5922    impl<T> SignatureVerificationServiceClient<T>
5923    where
5924        T: tonic::client::GrpcService<tonic::body::Body>,
5925        T::Error: Into<StdError>,
5926        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5927        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5928    {
5929        pub fn new(inner: T) -> Self {
5930            let inner = tonic::client::Grpc::new(inner);
5931            Self { inner }
5932        }
5933        pub fn with_origin(inner: T, origin: Uri) -> Self {
5934            let inner = tonic::client::Grpc::with_origin(inner, origin);
5935            Self { inner }
5936        }
5937        pub fn with_interceptor<F>(
5938            inner: T,
5939            interceptor: F,
5940        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5941        where
5942            F: tonic::service::Interceptor,
5943            T::ResponseBody: Default,
5944            T: tonic::codegen::Service<
5945                http::Request<tonic::body::Body>,
5946                Response = http::Response<
5947                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5948                >,
5949            >,
5950            <T as tonic::codegen::Service<
5951                http::Request<tonic::body::Body>,
5952            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5953        {
5954            SignatureVerificationServiceClient::new(
5955                InterceptedService::new(inner, interceptor),
5956            )
5957        }
5958        /// Compress requests with the given encoding.
5959        ///
5960        /// This requires the server to support it otherwise it might respond with an
5961        /// error.
5962        #[must_use]
5963        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5964            self.inner = self.inner.send_compressed(encoding);
5965            self
5966        }
5967        /// Enable decompressing responses.
5968        #[must_use]
5969        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5970            self.inner = self.inner.accept_compressed(encoding);
5971            self
5972        }
5973        /// Limits the maximum size of a decoded message.
5974        ///
5975        /// Default: `4MB`
5976        #[must_use]
5977        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5978            self.inner = self.inner.max_decoding_message_size(limit);
5979            self
5980        }
5981        /// Limits the maximum size of an encoded message.
5982        ///
5983        /// Default: `usize::MAX`
5984        #[must_use]
5985        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5986            self.inner = self.inner.max_encoding_message_size(limit);
5987            self
5988        }
5989        /// Perform signature verification of a UserSignature against the provided message.
5990        pub async fn verify_signature(
5991            &mut self,
5992            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5993        ) -> std::result::Result<
5994            tonic::Response<super::VerifySignatureResponse>,
5995            tonic::Status,
5996        > {
5997            self.inner
5998                .ready()
5999                .await
6000                .map_err(|e| {
6001                    tonic::Status::unknown(
6002                        format!("Service was not ready: {}", e.into()),
6003                    )
6004                })?;
6005            let codec = tonic_prost::ProstCodec::default();
6006            let path = http::uri::PathAndQuery::from_static(
6007                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
6008            );
6009            let mut req = request.into_request();
6010            req.extensions_mut()
6011                .insert(
6012                    GrpcMethod::new(
6013                        "sui.rpc.v2.SignatureVerificationService",
6014                        "VerifySignature",
6015                    ),
6016                );
6017            self.inner.unary(req, path, codec).await
6018        }
6019    }
6020}
6021/// Generated server implementations.
6022pub mod signature_verification_service_server {
6023    #![allow(
6024        unused_variables,
6025        dead_code,
6026        missing_docs,
6027        clippy::wildcard_imports,
6028        clippy::let_unit_value,
6029    )]
6030    use tonic::codegen::*;
6031    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
6032    #[async_trait]
6033    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
6034        /// Perform signature verification of a UserSignature against the provided message.
6035        async fn verify_signature(
6036            &self,
6037            request: tonic::Request<super::VerifySignatureRequest>,
6038        ) -> std::result::Result<
6039            tonic::Response<super::VerifySignatureResponse>,
6040            tonic::Status,
6041        > {
6042            Err(tonic::Status::unimplemented("Not yet implemented"))
6043        }
6044    }
6045    #[derive(Debug)]
6046    pub struct SignatureVerificationServiceServer<T> {
6047        inner: Arc<T>,
6048        accept_compression_encodings: EnabledCompressionEncodings,
6049        send_compression_encodings: EnabledCompressionEncodings,
6050        max_decoding_message_size: Option<usize>,
6051        max_encoding_message_size: Option<usize>,
6052    }
6053    impl<T> SignatureVerificationServiceServer<T> {
6054        pub fn new(inner: T) -> Self {
6055            Self::from_arc(Arc::new(inner))
6056        }
6057        pub fn from_arc(inner: Arc<T>) -> Self {
6058            Self {
6059                inner,
6060                accept_compression_encodings: Default::default(),
6061                send_compression_encodings: Default::default(),
6062                max_decoding_message_size: None,
6063                max_encoding_message_size: None,
6064            }
6065        }
6066        pub fn with_interceptor<F>(
6067            inner: T,
6068            interceptor: F,
6069        ) -> InterceptedService<Self, F>
6070        where
6071            F: tonic::service::Interceptor,
6072        {
6073            InterceptedService::new(Self::new(inner), interceptor)
6074        }
6075        /// Enable decompressing requests with the given encoding.
6076        #[must_use]
6077        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6078            self.accept_compression_encodings.enable(encoding);
6079            self
6080        }
6081        /// Compress responses with the given encoding, if the client supports it.
6082        #[must_use]
6083        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6084            self.send_compression_encodings.enable(encoding);
6085            self
6086        }
6087        /// Limits the maximum size of a decoded message.
6088        ///
6089        /// Default: `4MB`
6090        #[must_use]
6091        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6092            self.max_decoding_message_size = Some(limit);
6093            self
6094        }
6095        /// Limits the maximum size of an encoded message.
6096        ///
6097        /// Default: `usize::MAX`
6098        #[must_use]
6099        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6100            self.max_encoding_message_size = Some(limit);
6101            self
6102        }
6103    }
6104    impl<T, B> tonic::codegen::Service<http::Request<B>>
6105    for SignatureVerificationServiceServer<T>
6106    where
6107        T: SignatureVerificationService,
6108        B: Body + std::marker::Send + 'static,
6109        B::Error: Into<StdError> + std::marker::Send + 'static,
6110    {
6111        type Response = http::Response<tonic::body::Body>;
6112        type Error = std::convert::Infallible;
6113        type Future = BoxFuture<Self::Response, Self::Error>;
6114        fn poll_ready(
6115            &mut self,
6116            _cx: &mut Context<'_>,
6117        ) -> Poll<std::result::Result<(), Self::Error>> {
6118            Poll::Ready(Ok(()))
6119        }
6120        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6121            match req.uri().path() {
6122                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6123                    #[allow(non_camel_case_types)]
6124                    struct VerifySignatureSvc<T: SignatureVerificationService>(
6125                        pub Arc<T>,
6126                    );
6127                    impl<
6128                        T: SignatureVerificationService,
6129                    > tonic::server::UnaryService<super::VerifySignatureRequest>
6130                    for VerifySignatureSvc<T> {
6131                        type Response = super::VerifySignatureResponse;
6132                        type Future = BoxFuture<
6133                            tonic::Response<Self::Response>,
6134                            tonic::Status,
6135                        >;
6136                        fn call(
6137                            &mut self,
6138                            request: tonic::Request<super::VerifySignatureRequest>,
6139                        ) -> Self::Future {
6140                            let inner = Arc::clone(&self.0);
6141                            let fut = async move {
6142                                <T as SignatureVerificationService>::verify_signature(
6143                                        &inner,
6144                                        request,
6145                                    )
6146                                    .await
6147                            };
6148                            Box::pin(fut)
6149                        }
6150                    }
6151                    let accept_compression_encodings = self.accept_compression_encodings;
6152                    let send_compression_encodings = self.send_compression_encodings;
6153                    let max_decoding_message_size = self.max_decoding_message_size;
6154                    let max_encoding_message_size = self.max_encoding_message_size;
6155                    let inner = self.inner.clone();
6156                    let fut = async move {
6157                        let method = VerifySignatureSvc(inner);
6158                        let codec = tonic_prost::ProstCodec::default();
6159                        let mut grpc = tonic::server::Grpc::new(codec)
6160                            .apply_compression_config(
6161                                accept_compression_encodings,
6162                                send_compression_encodings,
6163                            )
6164                            .apply_max_message_size_config(
6165                                max_decoding_message_size,
6166                                max_encoding_message_size,
6167                            );
6168                        let res = grpc.unary(method, req).await;
6169                        Ok(res)
6170                    };
6171                    Box::pin(fut)
6172                }
6173                _ => {
6174                    Box::pin(async move {
6175                        let mut response = http::Response::new(
6176                            tonic::body::Body::default(),
6177                        );
6178                        let headers = response.headers_mut();
6179                        headers
6180                            .insert(
6181                                tonic::Status::GRPC_STATUS,
6182                                (tonic::Code::Unimplemented as i32).into(),
6183                            );
6184                        headers
6185                            .insert(
6186                                http::header::CONTENT_TYPE,
6187                                tonic::metadata::GRPC_CONTENT_TYPE,
6188                            );
6189                        Ok(response)
6190                    })
6191                }
6192            }
6193        }
6194    }
6195    impl<T> Clone for SignatureVerificationServiceServer<T> {
6196        fn clone(&self) -> Self {
6197            let inner = self.inner.clone();
6198            Self {
6199                inner,
6200                accept_compression_encodings: self.accept_compression_encodings,
6201                send_compression_encodings: self.send_compression_encodings,
6202                max_decoding_message_size: self.max_decoding_message_size,
6203                max_encoding_message_size: self.max_encoding_message_size,
6204            }
6205        }
6206    }
6207    /// Generated gRPC service name
6208    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6209    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6210        const NAME: &'static str = SERVICE_NAME;
6211    }
6212}
6213/// Request message for `NodeService.GetCoinInfo`.
6214#[non_exhaustive]
6215#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6216pub struct GetCoinInfoRequest {
6217    /// The coin type to request information about
6218    #[prost(string, optional, tag = "1")]
6219    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6220}
6221/// Response message for `NodeService.GetCoinInfo`.
6222#[non_exhaustive]
6223#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6224pub struct GetCoinInfoResponse {
6225    /// Required. The coin type.
6226    #[prost(string, optional, tag = "1")]
6227    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6228    /// This field will be populated with information about this coin
6229    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
6230    #[prost(message, optional, tag = "2")]
6231    pub metadata: ::core::option::Option<CoinMetadata>,
6232    /// This field will be populated with information about this coin
6233    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
6234    #[prost(message, optional, tag = "3")]
6235    pub treasury: ::core::option::Option<CoinTreasury>,
6236    /// If this coin type is a regulated coin, this field will be
6237    /// populated with information either from its Currency object
6238    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
6239    /// object for coins that have not been migrated to the CoinRegistry
6240    ///
6241    /// If this coin is not known to be regulated, only the
6242    /// coin_regulated_state field will be populated.
6243    #[prost(message, optional, tag = "4")]
6244    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6245}
6246/// Metadata for a coin type
6247#[non_exhaustive]
6248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6249pub struct CoinMetadata {
6250    /// ObjectId of the `0x2::coin::CoinMetadata` object or
6251    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
6252    #[prost(string, optional, tag = "1")]
6253    pub id: ::core::option::Option<::prost::alloc::string::String>,
6254    /// Number of decimal places to coin uses.
6255    #[prost(uint32, optional, tag = "2")]
6256    pub decimals: ::core::option::Option<u32>,
6257    /// Name for the token
6258    #[prost(string, optional, tag = "3")]
6259    pub name: ::core::option::Option<::prost::alloc::string::String>,
6260    /// Symbol for the token
6261    #[prost(string, optional, tag = "4")]
6262    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6263    /// Description of the token
6264    #[prost(string, optional, tag = "5")]
6265    pub description: ::core::option::Option<::prost::alloc::string::String>,
6266    /// URL for the token logo
6267    #[prost(string, optional, tag = "6")]
6268    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6269    /// The MetadataCap ID if it has been claimed for this coin type.
6270    /// This capability allows updating the coin's metadata fields.
6271    /// Only populated when metadata is from CoinRegistry.
6272    #[prost(string, optional, tag = "7")]
6273    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6274    /// State of the MetadataCap for this coin type.
6275    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6276    pub metadata_cap_state: ::core::option::Option<i32>,
6277}
6278/// Nested message and enum types in `CoinMetadata`.
6279pub mod coin_metadata {
6280    /// Information about the state of the coin's MetadataCap
6281    #[non_exhaustive]
6282    #[derive(
6283        Clone,
6284        Copy,
6285        Debug,
6286        PartialEq,
6287        Eq,
6288        Hash,
6289        PartialOrd,
6290        Ord,
6291        ::prost::Enumeration
6292    )]
6293    #[repr(i32)]
6294    pub enum MetadataCapState {
6295        /// Indicates the state of the MetadataCap is unknown.
6296        /// Set when the coin has not been migrated to the CoinRegistry.
6297        Unknown = 0,
6298        /// Indicates the MetadataCap has been claimed.
6299        Claimed = 1,
6300        /// Indicates the MetadataCap has not been claimed.
6301        Unclaimed = 2,
6302        /// Indicates the MetadataCap has been deleted.
6303        Deleted = 3,
6304    }
6305    impl MetadataCapState {
6306        /// String value of the enum field names used in the ProtoBuf definition.
6307        ///
6308        /// The values are not transformed in any way and thus are considered stable
6309        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6310        pub fn as_str_name(&self) -> &'static str {
6311            match self {
6312                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6313                Self::Claimed => "CLAIMED",
6314                Self::Unclaimed => "UNCLAIMED",
6315                Self::Deleted => "DELETED",
6316            }
6317        }
6318        /// Creates an enum from field names used in the ProtoBuf definition.
6319        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6320            match value {
6321                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6322                "CLAIMED" => Some(Self::Claimed),
6323                "UNCLAIMED" => Some(Self::Unclaimed),
6324                "DELETED" => Some(Self::Deleted),
6325                _ => None,
6326            }
6327        }
6328    }
6329}
6330/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
6331#[non_exhaustive]
6332#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6333pub struct CoinTreasury {
6334    /// ObjectId of the `0x2::coin::TreasuryCap` object.
6335    #[prost(string, optional, tag = "1")]
6336    pub id: ::core::option::Option<::prost::alloc::string::String>,
6337    /// Total available supply for this coin type.
6338    #[prost(uint64, optional, tag = "2")]
6339    pub total_supply: ::core::option::Option<u64>,
6340    /// Supply state indicating if the supply is fixed or can still be minted
6341    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6342    pub supply_state: ::core::option::Option<i32>,
6343}
6344/// Nested message and enum types in `CoinTreasury`.
6345pub mod coin_treasury {
6346    /// Supply state of a coin, matching the Move SupplyState enum
6347    #[non_exhaustive]
6348    #[derive(
6349        Clone,
6350        Copy,
6351        Debug,
6352        PartialEq,
6353        Eq,
6354        Hash,
6355        PartialOrd,
6356        Ord,
6357        ::prost::Enumeration
6358    )]
6359    #[repr(i32)]
6360    pub enum SupplyState {
6361        /// Supply is unknown or TreasuryCap still exists (minting still possible)
6362        Unknown = 0,
6363        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
6364        Fixed = 1,
6365        /// Supply can only decrease (burning allowed, minting not allowed)
6366        BurnOnly = 2,
6367    }
6368    impl SupplyState {
6369        /// String value of the enum field names used in the ProtoBuf definition.
6370        ///
6371        /// The values are not transformed in any way and thus are considered stable
6372        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6373        pub fn as_str_name(&self) -> &'static str {
6374            match self {
6375                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6376                Self::Fixed => "FIXED",
6377                Self::BurnOnly => "BURN_ONLY",
6378            }
6379        }
6380        /// Creates an enum from field names used in the ProtoBuf definition.
6381        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6382            match value {
6383                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6384                "FIXED" => Some(Self::Fixed),
6385                "BURN_ONLY" => Some(Self::BurnOnly),
6386                _ => None,
6387            }
6388        }
6389    }
6390}
6391/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
6392#[non_exhaustive]
6393#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6394pub struct RegulatedCoinMetadata {
6395    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
6396    /// Only present for coins that have not been migrated to CoinRegistry.
6397    #[prost(string, optional, tag = "1")]
6398    pub id: ::core::option::Option<::prost::alloc::string::String>,
6399    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
6400    #[prost(string, optional, tag = "2")]
6401    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6402    /// The ID of the coin's `DenyCap` object.
6403    #[prost(string, optional, tag = "3")]
6404    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6405    /// Whether the coin can be globally paused
6406    #[prost(bool, optional, tag = "4")]
6407    pub allow_global_pause: ::core::option::Option<bool>,
6408    /// Variant of the regulated coin metadata
6409    #[prost(uint32, optional, tag = "5")]
6410    pub variant: ::core::option::Option<u32>,
6411    /// Indicates the coin's regulated state.
6412    #[prost(
6413        enumeration = "regulated_coin_metadata::CoinRegulatedState",
6414        optional,
6415        tag = "6"
6416    )]
6417    pub coin_regulated_state: ::core::option::Option<i32>,
6418}
6419/// Nested message and enum types in `RegulatedCoinMetadata`.
6420pub mod regulated_coin_metadata {
6421    /// Indicates the state of the regulation of the coin.
6422    #[non_exhaustive]
6423    #[derive(
6424        Clone,
6425        Copy,
6426        Debug,
6427        PartialEq,
6428        Eq,
6429        Hash,
6430        PartialOrd,
6431        Ord,
6432        ::prost::Enumeration
6433    )]
6434    #[repr(i32)]
6435    pub enum CoinRegulatedState {
6436        /// Indicates the regulation state of the coin is unknown.
6437        /// This is set when a coin has not been migrated to the
6438        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
6439        /// object.
6440        Unknown = 0,
6441        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
6442        Regulated = 1,
6443        /// Indicates a coin is unregulated.
6444        Unregulated = 2,
6445    }
6446    impl CoinRegulatedState {
6447        /// String value of the enum field names used in the ProtoBuf definition.
6448        ///
6449        /// The values are not transformed in any way and thus are considered stable
6450        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6451        pub fn as_str_name(&self) -> &'static str {
6452            match self {
6453                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6454                Self::Regulated => "REGULATED",
6455                Self::Unregulated => "UNREGULATED",
6456            }
6457        }
6458        /// Creates an enum from field names used in the ProtoBuf definition.
6459        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6460            match value {
6461                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6462                "REGULATED" => Some(Self::Regulated),
6463                "UNREGULATED" => Some(Self::Unregulated),
6464                _ => None,
6465            }
6466        }
6467    }
6468}
6469/// Request message for `LiveDataService.GetBalance`.
6470#[non_exhaustive]
6471#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6472pub struct GetBalanceRequest {
6473    /// Required. The owner's Sui address.
6474    #[prost(string, optional, tag = "1")]
6475    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6476    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
6477    #[prost(string, optional, tag = "2")]
6478    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6479}
6480/// Response message for `LiveDataService.GetBalance`.
6481/// Return the total coin balance for one coin type, owned by the address owner.
6482#[non_exhaustive]
6483#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6484pub struct GetBalanceResponse {
6485    /// The balance information for the requested coin type.
6486    #[prost(message, optional, tag = "1")]
6487    pub balance: ::core::option::Option<Balance>,
6488}
6489/// Request message for `LiveDataService.ListBalances`.
6490#[non_exhaustive]
6491#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6492pub struct ListBalancesRequest {
6493    /// Required. The owner's Sui address.
6494    #[prost(string, optional, tag = "1")]
6495    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6496    /// The maximum number of balance entries to return. The service may return fewer than this value.
6497    /// If unspecified, at most `50` entries will be returned.
6498    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6499    #[prost(uint32, optional, tag = "2")]
6500    pub page_size: ::core::option::Option<u32>,
6501    /// A page token, received from a previous `ListBalances` call.
6502    /// Provide this to retrieve the subsequent page.
6503    ///
6504    /// When paginating, all other parameters provided to `ListBalances` must
6505    /// match the call that provided the page token.
6506    #[prost(bytes = "bytes", optional, tag = "3")]
6507    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6508}
6509/// Response message for `LiveDataService.ListBalances`.
6510/// Return the total coin balance for all coin types, owned by the address owner.
6511#[non_exhaustive]
6512#[derive(Clone, PartialEq, ::prost::Message)]
6513pub struct ListBalancesResponse {
6514    /// The list of coin types and their respective balances.
6515    #[prost(message, repeated, tag = "1")]
6516    pub balances: ::prost::alloc::vec::Vec<Balance>,
6517    /// A token, which can be sent as `page_token` to retrieve the next page.
6518    /// If this field is omitted, there are no subsequent pages.
6519    #[prost(bytes = "bytes", optional, tag = "2")]
6520    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6521}
6522/// Balance information for a specific coin type.
6523#[non_exhaustive]
6524#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6525pub struct Balance {
6526    /// The type of the coin (e.g., 0x2::sui::SUI).
6527    #[prost(string, optional, tag = "1")]
6528    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6529    /// The total balance of `coin_type` in its smallest unit.
6530    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
6531    /// and `coin_balance`).
6532    #[prost(uint64, optional, tag = "3")]
6533    pub balance: ::core::option::Option<u64>,
6534    /// The balance of `Balance<T>` in this address's Address Balance.
6535    #[prost(uint64, optional, tag = "4")]
6536    pub address_balance: ::core::option::Option<u64>,
6537    /// The balance of all `Coin<T>` objects owned by this address.
6538    #[prost(uint64, optional, tag = "5")]
6539    pub coin_balance: ::core::option::Option<u64>,
6540}
6541/// Request message for `NodeService.ListDynamicFields`
6542#[non_exhaustive]
6543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6544pub struct ListDynamicFieldsRequest {
6545    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
6546    #[prost(string, optional, tag = "1")]
6547    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6548    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
6549    /// If unspecified, at most `50` entries will be returned.
6550    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6551    #[prost(uint32, optional, tag = "2")]
6552    pub page_size: ::core::option::Option<u32>,
6553    /// A page token, received from a previous `ListDynamicFields` call.
6554    /// Provide this to retrieve the subsequent page.
6555    ///
6556    /// When paginating, all other parameters provided to `ListDynamicFields` must
6557    /// match the call that provided the page token.
6558    #[prost(bytes = "bytes", optional, tag = "3")]
6559    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6560    /// Mask specifying which fields to read.
6561    /// If no mask is specified, defaults to `parent,field_id`.
6562    #[prost(message, optional, tag = "4")]
6563    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6564}
6565/// Response message for `NodeService.ListDynamicFields`
6566#[non_exhaustive]
6567#[derive(Clone, PartialEq, ::prost::Message)]
6568pub struct ListDynamicFieldsResponse {
6569    /// Page of dynamic fields owned by the specified parent.
6570    #[prost(message, repeated, tag = "1")]
6571    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6572    /// A token, which can be sent as `page_token` to retrieve the next page.
6573    /// If this field is omitted, there are no subsequent pages.
6574    #[prost(bytes = "bytes", optional, tag = "2")]
6575    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6576}
6577#[non_exhaustive]
6578#[derive(Clone, PartialEq, ::prost::Message)]
6579pub struct DynamicField {
6580    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6581    pub kind: ::core::option::Option<i32>,
6582    /// ObjectId of this dynamic field's parent.
6583    #[prost(string, optional, tag = "2")]
6584    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6585    /// ObjectId of this dynamic field.
6586    #[prost(string, optional, tag = "3")]
6587    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6588    /// The field object itself
6589    #[prost(message, optional, tag = "4")]
6590    pub field_object: ::core::option::Option<Object>,
6591    /// The dynamic field's "name"
6592    #[prost(message, optional, tag = "5")]
6593    pub name: ::core::option::Option<Bcs>,
6594    /// The dynamic field's "value"
6595    #[prost(message, optional, tag = "6")]
6596    pub value: ::core::option::Option<Bcs>,
6597    /// The type of the dynamic field "value".
6598    ///
6599    /// If this is a dynamic object field then this is the type of the object
6600    /// itself (which is a child of this field), otherwise this is the type of the
6601    /// value of this field.
6602    #[prost(string, optional, tag = "7")]
6603    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6604    /// The ObjectId of the child object when a child is a dynamic
6605    /// object field.
6606    ///
6607    /// The presence or absence of this field can be used to determine if a child
6608    /// is a dynamic field or a dynamic child object
6609    #[prost(string, optional, tag = "8")]
6610    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6611    /// The object itself when a child is a dynamic object field.
6612    #[prost(message, optional, tag = "9")]
6613    pub child_object: ::core::option::Option<Object>,
6614}
6615/// Nested message and enum types in `DynamicField`.
6616pub mod dynamic_field {
6617    #[non_exhaustive]
6618    #[derive(
6619        Clone,
6620        Copy,
6621        Debug,
6622        PartialEq,
6623        Eq,
6624        Hash,
6625        PartialOrd,
6626        Ord,
6627        ::prost::Enumeration
6628    )]
6629    #[repr(i32)]
6630    pub enum DynamicFieldKind {
6631        Unknown = 0,
6632        Field = 1,
6633        Object = 2,
6634    }
6635    impl DynamicFieldKind {
6636        /// String value of the enum field names used in the ProtoBuf definition.
6637        ///
6638        /// The values are not transformed in any way and thus are considered stable
6639        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6640        pub fn as_str_name(&self) -> &'static str {
6641            match self {
6642                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6643                Self::Field => "FIELD",
6644                Self::Object => "OBJECT",
6645            }
6646        }
6647        /// Creates an enum from field names used in the ProtoBuf definition.
6648        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6649            match value {
6650                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6651                "FIELD" => Some(Self::Field),
6652                "OBJECT" => Some(Self::Object),
6653                _ => None,
6654            }
6655        }
6656    }
6657}
6658#[non_exhaustive]
6659#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6660pub struct ListOwnedObjectsRequest {
6661    /// Required. The address of the account that owns the objects.
6662    #[prost(string, optional, tag = "1")]
6663    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6664    /// The maximum number of entries return. The service may return fewer than this value.
6665    /// If unspecified, at most `50` entries will be returned.
6666    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6667    #[prost(uint32, optional, tag = "2")]
6668    pub page_size: ::core::option::Option<u32>,
6669    /// A page token, received from a previous `ListOwnedObjects` call.
6670    /// Provide this to retrieve the subsequent page.
6671    ///
6672    /// When paginating, all other parameters provided to `ListOwnedObjects` must
6673    /// match the call that provided the page token.
6674    #[prost(bytes = "bytes", optional, tag = "3")]
6675    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6676    /// Mask specifying which fields to read.
6677    /// If no mask is specified, defaults to `object_id,version,object_type`.
6678    #[prost(message, optional, tag = "4")]
6679    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6680    /// Optional type filter to limit the types of objects listed.
6681    ///
6682    /// Providing an object type with no type params will return objects of that
6683    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
6684    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
6685    /// with a type param will restrict the returned objects to only those objects
6686    /// that match the provided type parameters, e.g.
6687    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
6688    #[prost(string, optional, tag = "5")]
6689    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6690}
6691#[non_exhaustive]
6692#[derive(Clone, PartialEq, ::prost::Message)]
6693pub struct ListOwnedObjectsResponse {
6694    /// Page of dynamic fields owned by the specified parent.
6695    #[prost(message, repeated, tag = "1")]
6696    pub objects: ::prost::alloc::vec::Vec<Object>,
6697    /// A token, which can be sent as `page_token` to retrieve the next page.
6698    /// If this field is omitted, there are no subsequent pages.
6699    #[prost(bytes = "bytes", optional, tag = "2")]
6700    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6701}
6702/// Generated client implementations.
6703pub mod state_service_client {
6704    #![allow(
6705        unused_variables,
6706        dead_code,
6707        missing_docs,
6708        clippy::wildcard_imports,
6709        clippy::let_unit_value,
6710    )]
6711    use tonic::codegen::*;
6712    use tonic::codegen::http::Uri;
6713    #[derive(Debug, Clone)]
6714    pub struct StateServiceClient<T> {
6715        inner: tonic::client::Grpc<T>,
6716    }
6717    impl StateServiceClient<tonic::transport::Channel> {
6718        /// Attempt to create a new client by connecting to a given endpoint.
6719        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6720        where
6721            D: TryInto<tonic::transport::Endpoint>,
6722            D::Error: Into<StdError>,
6723        {
6724            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6725            Ok(Self::new(conn))
6726        }
6727    }
6728    impl<T> StateServiceClient<T>
6729    where
6730        T: tonic::client::GrpcService<tonic::body::Body>,
6731        T::Error: Into<StdError>,
6732        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6733        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6734    {
6735        pub fn new(inner: T) -> Self {
6736            let inner = tonic::client::Grpc::new(inner);
6737            Self { inner }
6738        }
6739        pub fn with_origin(inner: T, origin: Uri) -> Self {
6740            let inner = tonic::client::Grpc::with_origin(inner, origin);
6741            Self { inner }
6742        }
6743        pub fn with_interceptor<F>(
6744            inner: T,
6745            interceptor: F,
6746        ) -> StateServiceClient<InterceptedService<T, F>>
6747        where
6748            F: tonic::service::Interceptor,
6749            T::ResponseBody: Default,
6750            T: tonic::codegen::Service<
6751                http::Request<tonic::body::Body>,
6752                Response = http::Response<
6753                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6754                >,
6755            >,
6756            <T as tonic::codegen::Service<
6757                http::Request<tonic::body::Body>,
6758            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6759        {
6760            StateServiceClient::new(InterceptedService::new(inner, interceptor))
6761        }
6762        /// Compress requests with the given encoding.
6763        ///
6764        /// This requires the server to support it otherwise it might respond with an
6765        /// error.
6766        #[must_use]
6767        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6768            self.inner = self.inner.send_compressed(encoding);
6769            self
6770        }
6771        /// Enable decompressing responses.
6772        #[must_use]
6773        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6774            self.inner = self.inner.accept_compressed(encoding);
6775            self
6776        }
6777        /// Limits the maximum size of a decoded message.
6778        ///
6779        /// Default: `4MB`
6780        #[must_use]
6781        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6782            self.inner = self.inner.max_decoding_message_size(limit);
6783            self
6784        }
6785        /// Limits the maximum size of an encoded message.
6786        ///
6787        /// Default: `usize::MAX`
6788        #[must_use]
6789        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6790            self.inner = self.inner.max_encoding_message_size(limit);
6791            self
6792        }
6793        pub async fn list_dynamic_fields(
6794            &mut self,
6795            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6796        ) -> std::result::Result<
6797            tonic::Response<super::ListDynamicFieldsResponse>,
6798            tonic::Status,
6799        > {
6800            self.inner
6801                .ready()
6802                .await
6803                .map_err(|e| {
6804                    tonic::Status::unknown(
6805                        format!("Service was not ready: {}", e.into()),
6806                    )
6807                })?;
6808            let codec = tonic_prost::ProstCodec::default();
6809            let path = http::uri::PathAndQuery::from_static(
6810                "/sui.rpc.v2.StateService/ListDynamicFields",
6811            );
6812            let mut req = request.into_request();
6813            req.extensions_mut()
6814                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6815            self.inner.unary(req, path, codec).await
6816        }
6817        pub async fn list_owned_objects(
6818            &mut self,
6819            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6820        ) -> std::result::Result<
6821            tonic::Response<super::ListOwnedObjectsResponse>,
6822            tonic::Status,
6823        > {
6824            self.inner
6825                .ready()
6826                .await
6827                .map_err(|e| {
6828                    tonic::Status::unknown(
6829                        format!("Service was not ready: {}", e.into()),
6830                    )
6831                })?;
6832            let codec = tonic_prost::ProstCodec::default();
6833            let path = http::uri::PathAndQuery::from_static(
6834                "/sui.rpc.v2.StateService/ListOwnedObjects",
6835            );
6836            let mut req = request.into_request();
6837            req.extensions_mut()
6838                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6839            self.inner.unary(req, path, codec).await
6840        }
6841        pub async fn get_coin_info(
6842            &mut self,
6843            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6844        ) -> std::result::Result<
6845            tonic::Response<super::GetCoinInfoResponse>,
6846            tonic::Status,
6847        > {
6848            self.inner
6849                .ready()
6850                .await
6851                .map_err(|e| {
6852                    tonic::Status::unknown(
6853                        format!("Service was not ready: {}", e.into()),
6854                    )
6855                })?;
6856            let codec = tonic_prost::ProstCodec::default();
6857            let path = http::uri::PathAndQuery::from_static(
6858                "/sui.rpc.v2.StateService/GetCoinInfo",
6859            );
6860            let mut req = request.into_request();
6861            req.extensions_mut()
6862                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6863            self.inner.unary(req, path, codec).await
6864        }
6865        pub async fn get_balance(
6866            &mut self,
6867            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6868        ) -> std::result::Result<
6869            tonic::Response<super::GetBalanceResponse>,
6870            tonic::Status,
6871        > {
6872            self.inner
6873                .ready()
6874                .await
6875                .map_err(|e| {
6876                    tonic::Status::unknown(
6877                        format!("Service was not ready: {}", e.into()),
6878                    )
6879                })?;
6880            let codec = tonic_prost::ProstCodec::default();
6881            let path = http::uri::PathAndQuery::from_static(
6882                "/sui.rpc.v2.StateService/GetBalance",
6883            );
6884            let mut req = request.into_request();
6885            req.extensions_mut()
6886                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6887            self.inner.unary(req, path, codec).await
6888        }
6889        pub async fn list_balances(
6890            &mut self,
6891            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6892        ) -> std::result::Result<
6893            tonic::Response<super::ListBalancesResponse>,
6894            tonic::Status,
6895        > {
6896            self.inner
6897                .ready()
6898                .await
6899                .map_err(|e| {
6900                    tonic::Status::unknown(
6901                        format!("Service was not ready: {}", e.into()),
6902                    )
6903                })?;
6904            let codec = tonic_prost::ProstCodec::default();
6905            let path = http::uri::PathAndQuery::from_static(
6906                "/sui.rpc.v2.StateService/ListBalances",
6907            );
6908            let mut req = request.into_request();
6909            req.extensions_mut()
6910                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6911            self.inner.unary(req, path, codec).await
6912        }
6913    }
6914}
6915/// Generated server implementations.
6916pub mod state_service_server {
6917    #![allow(
6918        unused_variables,
6919        dead_code,
6920        missing_docs,
6921        clippy::wildcard_imports,
6922        clippy::let_unit_value,
6923    )]
6924    use tonic::codegen::*;
6925    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
6926    #[async_trait]
6927    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6928        async fn list_dynamic_fields(
6929            &self,
6930            request: tonic::Request<super::ListDynamicFieldsRequest>,
6931        ) -> std::result::Result<
6932            tonic::Response<super::ListDynamicFieldsResponse>,
6933            tonic::Status,
6934        > {
6935            Err(tonic::Status::unimplemented("Not yet implemented"))
6936        }
6937        async fn list_owned_objects(
6938            &self,
6939            request: tonic::Request<super::ListOwnedObjectsRequest>,
6940        ) -> std::result::Result<
6941            tonic::Response<super::ListOwnedObjectsResponse>,
6942            tonic::Status,
6943        > {
6944            Err(tonic::Status::unimplemented("Not yet implemented"))
6945        }
6946        async fn get_coin_info(
6947            &self,
6948            request: tonic::Request<super::GetCoinInfoRequest>,
6949        ) -> std::result::Result<
6950            tonic::Response<super::GetCoinInfoResponse>,
6951            tonic::Status,
6952        > {
6953            Err(tonic::Status::unimplemented("Not yet implemented"))
6954        }
6955        async fn get_balance(
6956            &self,
6957            request: tonic::Request<super::GetBalanceRequest>,
6958        ) -> std::result::Result<
6959            tonic::Response<super::GetBalanceResponse>,
6960            tonic::Status,
6961        > {
6962            Err(tonic::Status::unimplemented("Not yet implemented"))
6963        }
6964        async fn list_balances(
6965            &self,
6966            request: tonic::Request<super::ListBalancesRequest>,
6967        ) -> std::result::Result<
6968            tonic::Response<super::ListBalancesResponse>,
6969            tonic::Status,
6970        > {
6971            Err(tonic::Status::unimplemented("Not yet implemented"))
6972        }
6973    }
6974    #[derive(Debug)]
6975    pub struct StateServiceServer<T> {
6976        inner: Arc<T>,
6977        accept_compression_encodings: EnabledCompressionEncodings,
6978        send_compression_encodings: EnabledCompressionEncodings,
6979        max_decoding_message_size: Option<usize>,
6980        max_encoding_message_size: Option<usize>,
6981    }
6982    impl<T> StateServiceServer<T> {
6983        pub fn new(inner: T) -> Self {
6984            Self::from_arc(Arc::new(inner))
6985        }
6986        pub fn from_arc(inner: Arc<T>) -> Self {
6987            Self {
6988                inner,
6989                accept_compression_encodings: Default::default(),
6990                send_compression_encodings: Default::default(),
6991                max_decoding_message_size: None,
6992                max_encoding_message_size: None,
6993            }
6994        }
6995        pub fn with_interceptor<F>(
6996            inner: T,
6997            interceptor: F,
6998        ) -> InterceptedService<Self, F>
6999        where
7000            F: tonic::service::Interceptor,
7001        {
7002            InterceptedService::new(Self::new(inner), interceptor)
7003        }
7004        /// Enable decompressing requests with the given encoding.
7005        #[must_use]
7006        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7007            self.accept_compression_encodings.enable(encoding);
7008            self
7009        }
7010        /// Compress responses with the given encoding, if the client supports it.
7011        #[must_use]
7012        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7013            self.send_compression_encodings.enable(encoding);
7014            self
7015        }
7016        /// Limits the maximum size of a decoded message.
7017        ///
7018        /// Default: `4MB`
7019        #[must_use]
7020        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7021            self.max_decoding_message_size = Some(limit);
7022            self
7023        }
7024        /// Limits the maximum size of an encoded message.
7025        ///
7026        /// Default: `usize::MAX`
7027        #[must_use]
7028        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7029            self.max_encoding_message_size = Some(limit);
7030            self
7031        }
7032    }
7033    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
7034    where
7035        T: StateService,
7036        B: Body + std::marker::Send + 'static,
7037        B::Error: Into<StdError> + std::marker::Send + 'static,
7038    {
7039        type Response = http::Response<tonic::body::Body>;
7040        type Error = std::convert::Infallible;
7041        type Future = BoxFuture<Self::Response, Self::Error>;
7042        fn poll_ready(
7043            &mut self,
7044            _cx: &mut Context<'_>,
7045        ) -> Poll<std::result::Result<(), Self::Error>> {
7046            Poll::Ready(Ok(()))
7047        }
7048        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7049            match req.uri().path() {
7050                "/sui.rpc.v2.StateService/ListDynamicFields" => {
7051                    #[allow(non_camel_case_types)]
7052                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
7053                    impl<
7054                        T: StateService,
7055                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
7056                    for ListDynamicFieldsSvc<T> {
7057                        type Response = super::ListDynamicFieldsResponse;
7058                        type Future = BoxFuture<
7059                            tonic::Response<Self::Response>,
7060                            tonic::Status,
7061                        >;
7062                        fn call(
7063                            &mut self,
7064                            request: tonic::Request<super::ListDynamicFieldsRequest>,
7065                        ) -> Self::Future {
7066                            let inner = Arc::clone(&self.0);
7067                            let fut = async move {
7068                                <T as StateService>::list_dynamic_fields(&inner, request)
7069                                    .await
7070                            };
7071                            Box::pin(fut)
7072                        }
7073                    }
7074                    let accept_compression_encodings = self.accept_compression_encodings;
7075                    let send_compression_encodings = self.send_compression_encodings;
7076                    let max_decoding_message_size = self.max_decoding_message_size;
7077                    let max_encoding_message_size = self.max_encoding_message_size;
7078                    let inner = self.inner.clone();
7079                    let fut = async move {
7080                        let method = ListDynamicFieldsSvc(inner);
7081                        let codec = tonic_prost::ProstCodec::default();
7082                        let mut grpc = tonic::server::Grpc::new(codec)
7083                            .apply_compression_config(
7084                                accept_compression_encodings,
7085                                send_compression_encodings,
7086                            )
7087                            .apply_max_message_size_config(
7088                                max_decoding_message_size,
7089                                max_encoding_message_size,
7090                            );
7091                        let res = grpc.unary(method, req).await;
7092                        Ok(res)
7093                    };
7094                    Box::pin(fut)
7095                }
7096                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
7097                    #[allow(non_camel_case_types)]
7098                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
7099                    impl<
7100                        T: StateService,
7101                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
7102                    for ListOwnedObjectsSvc<T> {
7103                        type Response = super::ListOwnedObjectsResponse;
7104                        type Future = BoxFuture<
7105                            tonic::Response<Self::Response>,
7106                            tonic::Status,
7107                        >;
7108                        fn call(
7109                            &mut self,
7110                            request: tonic::Request<super::ListOwnedObjectsRequest>,
7111                        ) -> Self::Future {
7112                            let inner = Arc::clone(&self.0);
7113                            let fut = async move {
7114                                <T as StateService>::list_owned_objects(&inner, request)
7115                                    .await
7116                            };
7117                            Box::pin(fut)
7118                        }
7119                    }
7120                    let accept_compression_encodings = self.accept_compression_encodings;
7121                    let send_compression_encodings = self.send_compression_encodings;
7122                    let max_decoding_message_size = self.max_decoding_message_size;
7123                    let max_encoding_message_size = self.max_encoding_message_size;
7124                    let inner = self.inner.clone();
7125                    let fut = async move {
7126                        let method = ListOwnedObjectsSvc(inner);
7127                        let codec = tonic_prost::ProstCodec::default();
7128                        let mut grpc = tonic::server::Grpc::new(codec)
7129                            .apply_compression_config(
7130                                accept_compression_encodings,
7131                                send_compression_encodings,
7132                            )
7133                            .apply_max_message_size_config(
7134                                max_decoding_message_size,
7135                                max_encoding_message_size,
7136                            );
7137                        let res = grpc.unary(method, req).await;
7138                        Ok(res)
7139                    };
7140                    Box::pin(fut)
7141                }
7142                "/sui.rpc.v2.StateService/GetCoinInfo" => {
7143                    #[allow(non_camel_case_types)]
7144                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7145                    impl<
7146                        T: StateService,
7147                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
7148                    for GetCoinInfoSvc<T> {
7149                        type Response = super::GetCoinInfoResponse;
7150                        type Future = BoxFuture<
7151                            tonic::Response<Self::Response>,
7152                            tonic::Status,
7153                        >;
7154                        fn call(
7155                            &mut self,
7156                            request: tonic::Request<super::GetCoinInfoRequest>,
7157                        ) -> Self::Future {
7158                            let inner = Arc::clone(&self.0);
7159                            let fut = async move {
7160                                <T as StateService>::get_coin_info(&inner, request).await
7161                            };
7162                            Box::pin(fut)
7163                        }
7164                    }
7165                    let accept_compression_encodings = self.accept_compression_encodings;
7166                    let send_compression_encodings = self.send_compression_encodings;
7167                    let max_decoding_message_size = self.max_decoding_message_size;
7168                    let max_encoding_message_size = self.max_encoding_message_size;
7169                    let inner = self.inner.clone();
7170                    let fut = async move {
7171                        let method = GetCoinInfoSvc(inner);
7172                        let codec = tonic_prost::ProstCodec::default();
7173                        let mut grpc = tonic::server::Grpc::new(codec)
7174                            .apply_compression_config(
7175                                accept_compression_encodings,
7176                                send_compression_encodings,
7177                            )
7178                            .apply_max_message_size_config(
7179                                max_decoding_message_size,
7180                                max_encoding_message_size,
7181                            );
7182                        let res = grpc.unary(method, req).await;
7183                        Ok(res)
7184                    };
7185                    Box::pin(fut)
7186                }
7187                "/sui.rpc.v2.StateService/GetBalance" => {
7188                    #[allow(non_camel_case_types)]
7189                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7190                    impl<
7191                        T: StateService,
7192                    > tonic::server::UnaryService<super::GetBalanceRequest>
7193                    for GetBalanceSvc<T> {
7194                        type Response = super::GetBalanceResponse;
7195                        type Future = BoxFuture<
7196                            tonic::Response<Self::Response>,
7197                            tonic::Status,
7198                        >;
7199                        fn call(
7200                            &mut self,
7201                            request: tonic::Request<super::GetBalanceRequest>,
7202                        ) -> Self::Future {
7203                            let inner = Arc::clone(&self.0);
7204                            let fut = async move {
7205                                <T as StateService>::get_balance(&inner, request).await
7206                            };
7207                            Box::pin(fut)
7208                        }
7209                    }
7210                    let accept_compression_encodings = self.accept_compression_encodings;
7211                    let send_compression_encodings = self.send_compression_encodings;
7212                    let max_decoding_message_size = self.max_decoding_message_size;
7213                    let max_encoding_message_size = self.max_encoding_message_size;
7214                    let inner = self.inner.clone();
7215                    let fut = async move {
7216                        let method = GetBalanceSvc(inner);
7217                        let codec = tonic_prost::ProstCodec::default();
7218                        let mut grpc = tonic::server::Grpc::new(codec)
7219                            .apply_compression_config(
7220                                accept_compression_encodings,
7221                                send_compression_encodings,
7222                            )
7223                            .apply_max_message_size_config(
7224                                max_decoding_message_size,
7225                                max_encoding_message_size,
7226                            );
7227                        let res = grpc.unary(method, req).await;
7228                        Ok(res)
7229                    };
7230                    Box::pin(fut)
7231                }
7232                "/sui.rpc.v2.StateService/ListBalances" => {
7233                    #[allow(non_camel_case_types)]
7234                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7235                    impl<
7236                        T: StateService,
7237                    > tonic::server::UnaryService<super::ListBalancesRequest>
7238                    for ListBalancesSvc<T> {
7239                        type Response = super::ListBalancesResponse;
7240                        type Future = BoxFuture<
7241                            tonic::Response<Self::Response>,
7242                            tonic::Status,
7243                        >;
7244                        fn call(
7245                            &mut self,
7246                            request: tonic::Request<super::ListBalancesRequest>,
7247                        ) -> Self::Future {
7248                            let inner = Arc::clone(&self.0);
7249                            let fut = async move {
7250                                <T as StateService>::list_balances(&inner, request).await
7251                            };
7252                            Box::pin(fut)
7253                        }
7254                    }
7255                    let accept_compression_encodings = self.accept_compression_encodings;
7256                    let send_compression_encodings = self.send_compression_encodings;
7257                    let max_decoding_message_size = self.max_decoding_message_size;
7258                    let max_encoding_message_size = self.max_encoding_message_size;
7259                    let inner = self.inner.clone();
7260                    let fut = async move {
7261                        let method = ListBalancesSvc(inner);
7262                        let codec = tonic_prost::ProstCodec::default();
7263                        let mut grpc = tonic::server::Grpc::new(codec)
7264                            .apply_compression_config(
7265                                accept_compression_encodings,
7266                                send_compression_encodings,
7267                            )
7268                            .apply_max_message_size_config(
7269                                max_decoding_message_size,
7270                                max_encoding_message_size,
7271                            );
7272                        let res = grpc.unary(method, req).await;
7273                        Ok(res)
7274                    };
7275                    Box::pin(fut)
7276                }
7277                _ => {
7278                    Box::pin(async move {
7279                        let mut response = http::Response::new(
7280                            tonic::body::Body::default(),
7281                        );
7282                        let headers = response.headers_mut();
7283                        headers
7284                            .insert(
7285                                tonic::Status::GRPC_STATUS,
7286                                (tonic::Code::Unimplemented as i32).into(),
7287                            );
7288                        headers
7289                            .insert(
7290                                http::header::CONTENT_TYPE,
7291                                tonic::metadata::GRPC_CONTENT_TYPE,
7292                            );
7293                        Ok(response)
7294                    })
7295                }
7296            }
7297        }
7298    }
7299    impl<T> Clone for StateServiceServer<T> {
7300        fn clone(&self) -> Self {
7301            let inner = self.inner.clone();
7302            Self {
7303                inner,
7304                accept_compression_encodings: self.accept_compression_encodings,
7305                send_compression_encodings: self.send_compression_encodings,
7306                max_decoding_message_size: self.max_decoding_message_size,
7307                max_encoding_message_size: self.max_encoding_message_size,
7308            }
7309        }
7310    }
7311    /// Generated gRPC service name
7312    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7313    impl<T> tonic::server::NamedService for StateServiceServer<T> {
7314        const NAME: &'static str = SERVICE_NAME;
7315    }
7316}
7317/// Request message for SubscriptionService.SubscribeCheckpoints.
7318#[derive(Eq, Hash)]
7319#[non_exhaustive]
7320#[derive(Clone, PartialEq, ::prost::Message)]
7321pub struct SubscribeCheckpointsRequest {
7322    /// Optional. Mask for specifying which parts of the Checkpoint should be
7323    /// returned (e.g. summary, contents, signatures). `cursor` is always
7324    /// populated and is not subject to the mask.
7325    #[prost(message, optional, tag = "1")]
7326    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7327    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
7328    /// matches if any transaction it contains satisfies the filter. If absent,
7329    /// every checkpoint is streamed.
7330    #[prost(message, optional, tag = "2")]
7331    pub filter: ::core::option::Option<TransactionFilter>,
7332}
7333/// Response message for SubscriptionService.SubscribeCheckpoints.
7334///
7335/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
7336/// sequence number stands in for the `Watermark` message the other
7337/// subscription responses carry. Progress-only frames (with `checkpoint`
7338/// unset) occur only on filtered streams: on an unfiltered stream every frame
7339/// carries both fields, in order and without gaps.
7340#[non_exhaustive]
7341#[derive(Clone, PartialEq, ::prost::Message)]
7342pub struct SubscribeCheckpointsResponse {
7343    /// Required. The checkpoint sequence number the stream has fully covered,
7344    /// inclusive: every matching checkpoint from the stream's start position
7345    /// through `cursor` has been delivered. Present on every frame and
7346    /// advances monotonically.
7347    #[prost(uint64, optional, tag = "1")]
7348    pub cursor: ::core::option::Option<u64>,
7349    /// The matching checkpoint. Unset when this frame only advances the
7350    /// cursor past non-matching checkpoints.
7351    #[prost(message, optional, tag = "2")]
7352    pub checkpoint: ::core::option::Option<Checkpoint>,
7353}
7354/// Request message for SubscriptionService.SubscribeTransactions.
7355#[non_exhaustive]
7356#[derive(Clone, PartialEq, ::prost::Message)]
7357pub struct SubscribeTransactionsRequest {
7358    /// Optional. Mask for specifying which parts of the ExecutedTransaction
7359    /// should be returned.
7360    #[prost(message, optional, tag = "1")]
7361    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7362    /// Optional. DNF filter over indexed dimensions. If absent, every
7363    /// transaction is streamed.
7364    #[prost(message, optional, tag = "2")]
7365    pub filter: ::core::option::Option<TransactionFilter>,
7366}
7367/// Response message for SubscriptionService.SubscribeTransactions.
7368///
7369/// Mirrors ListTransactionsResponse, except there is no `end` field: a
7370/// subscription stream has no successful end.
7371#[non_exhaustive]
7372#[derive(Clone, PartialEq, ::prost::Message)]
7373pub struct SubscribeTransactionsResponse {
7374    /// One matching transaction. Its position within the containing checkpoint
7375    /// is reported by `ExecutedTransaction.transaction_index`.
7376    #[prost(message, optional, tag = "1")]
7377    pub transaction: ::core::option::Option<ExecutedTransaction>,
7378    /// Progress watermark as of this frame. Present on every frame.
7379    #[prost(message, optional, tag = "2")]
7380    pub watermark: ::core::option::Option<Watermark>,
7381}
7382/// Request message for SubscriptionService.SubscribeEvents.
7383#[non_exhaustive]
7384#[derive(Clone, PartialEq, ::prost::Message)]
7385pub struct SubscribeEventsRequest {
7386    /// Optional. Mask for specifying which parts of the Event should be
7387    /// returned.
7388    #[prost(message, optional, tag = "1")]
7389    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7390    /// Optional. DNF filter over indexed dimensions. If absent, every event is
7391    /// streamed.
7392    #[prost(message, optional, tag = "2")]
7393    pub filter: ::core::option::Option<EventFilter>,
7394}
7395/// Response message for SubscriptionService.SubscribeEvents.
7396///
7397/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
7398/// stream has no successful end.
7399#[non_exhaustive]
7400#[derive(Clone, PartialEq, ::prost::Message)]
7401pub struct SubscribeEventsResponse {
7402    /// One matching event. Its ledger position -- containing checkpoint,
7403    /// emitting transaction digest and offset, and index within that
7404    /// transaction's event list -- is reported by the corresponding fields on
7405    /// `Event`.
7406    #[prost(message, optional, tag = "1")]
7407    pub event: ::core::option::Option<Event>,
7408    /// Progress watermark as of this frame. Present on every frame.
7409    #[prost(message, optional, tag = "2")]
7410    pub watermark: ::core::option::Option<Watermark>,
7411}
7412/// Generated client implementations.
7413pub mod subscription_service_client {
7414    #![allow(
7415        unused_variables,
7416        dead_code,
7417        missing_docs,
7418        clippy::wildcard_imports,
7419        clippy::let_unit_value,
7420    )]
7421    use tonic::codegen::*;
7422    use tonic::codegen::http::Uri;
7423    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7424    /// transactions, and events.
7425    ///
7426    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7427    /// requests take the same filter message, and responses carry the same item
7428    /// and watermark shapes with identical cursor semantics.
7429    ///
7430    /// Subscriptions do not support resumption. A new subscription always begins
7431    /// at the current tip of the chain as seen by the server (the latest executed
7432    /// checkpoint). To recover data missed between subscriptions, replay the gap
7433    /// with the paired List API: pass the last received `Watermark.cursor` as
7434    /// `options.after` on the List request (for checkpoints, pass the last
7435    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7436    /// indexed tip, which may trail the subscription's start position; repeat the
7437    /// List call as the index advances until the replay reaches the position
7438    /// established by the subscription's first frame.
7439    ///
7440    /// A subscription behaves like an unbounded ascending scan: every frame
7441    /// carries the subscriber's resume point, and progress advances as
7442    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7443    /// filters live: the first frame on a filtered subscription is a
7444    /// progress-only frame establishing the stream's start position, and
7445    /// progress continues to advance with bounded staleness even when no item
7446    /// matches.
7447    ///
7448    /// Subscription streams have no successful end: they run until cancelled by
7449    /// the client or terminated by the server with a gRPC status.
7450    #[derive(Debug, Clone)]
7451    pub struct SubscriptionServiceClient<T> {
7452        inner: tonic::client::Grpc<T>,
7453    }
7454    impl SubscriptionServiceClient<tonic::transport::Channel> {
7455        /// Attempt to create a new client by connecting to a given endpoint.
7456        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7457        where
7458            D: TryInto<tonic::transport::Endpoint>,
7459            D::Error: Into<StdError>,
7460        {
7461            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7462            Ok(Self::new(conn))
7463        }
7464    }
7465    impl<T> SubscriptionServiceClient<T>
7466    where
7467        T: tonic::client::GrpcService<tonic::body::Body>,
7468        T::Error: Into<StdError>,
7469        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7470        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7471    {
7472        pub fn new(inner: T) -> Self {
7473            let inner = tonic::client::Grpc::new(inner);
7474            Self { inner }
7475        }
7476        pub fn with_origin(inner: T, origin: Uri) -> Self {
7477            let inner = tonic::client::Grpc::with_origin(inner, origin);
7478            Self { inner }
7479        }
7480        pub fn with_interceptor<F>(
7481            inner: T,
7482            interceptor: F,
7483        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7484        where
7485            F: tonic::service::Interceptor,
7486            T::ResponseBody: Default,
7487            T: tonic::codegen::Service<
7488                http::Request<tonic::body::Body>,
7489                Response = http::Response<
7490                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7491                >,
7492            >,
7493            <T as tonic::codegen::Service<
7494                http::Request<tonic::body::Body>,
7495            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7496        {
7497            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7498        }
7499        /// Compress requests with the given encoding.
7500        ///
7501        /// This requires the server to support it otherwise it might respond with an
7502        /// error.
7503        #[must_use]
7504        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7505            self.inner = self.inner.send_compressed(encoding);
7506            self
7507        }
7508        /// Enable decompressing responses.
7509        #[must_use]
7510        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7511            self.inner = self.inner.accept_compressed(encoding);
7512            self
7513        }
7514        /// Limits the maximum size of a decoded message.
7515        ///
7516        /// Default: `4MB`
7517        #[must_use]
7518        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7519            self.inner = self.inner.max_decoding_message_size(limit);
7520            self
7521        }
7522        /// Limits the maximum size of an encoded message.
7523        ///
7524        /// Default: `usize::MAX`
7525        #[must_use]
7526        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7527            self.inner = self.inner.max_encoding_message_size(limit);
7528            self
7529        }
7530        /// Subscribe to the stream of checkpoints.
7531        ///
7532        /// The stream begins at the latest executed checkpoint as seen by the
7533        /// server and yields checkpoints matching the filter as they are executed.
7534        /// A checkpoint matches if any transaction it contains satisfies the
7535        /// filter.
7536        pub async fn subscribe_checkpoints(
7537            &mut self,
7538            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7539        ) -> std::result::Result<
7540            tonic::Response<
7541                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7542            >,
7543            tonic::Status,
7544        > {
7545            self.inner
7546                .ready()
7547                .await
7548                .map_err(|e| {
7549                    tonic::Status::unknown(
7550                        format!("Service was not ready: {}", e.into()),
7551                    )
7552                })?;
7553            let codec = tonic_prost::ProstCodec::default();
7554            let path = http::uri::PathAndQuery::from_static(
7555                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7556            );
7557            let mut req = request.into_request();
7558            req.extensions_mut()
7559                .insert(
7560                    GrpcMethod::new(
7561                        "sui.rpc.v2.SubscriptionService",
7562                        "SubscribeCheckpoints",
7563                    ),
7564                );
7565            self.inner.server_streaming(req, path, codec).await
7566        }
7567        /// Subscribe to the stream of transactions.
7568        ///
7569        /// The stream begins at the latest executed checkpoint as seen by the
7570        /// server and yields transactions matching the filter as they are executed.
7571        pub async fn subscribe_transactions(
7572            &mut self,
7573            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7574        ) -> std::result::Result<
7575            tonic::Response<
7576                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7577            >,
7578            tonic::Status,
7579        > {
7580            self.inner
7581                .ready()
7582                .await
7583                .map_err(|e| {
7584                    tonic::Status::unknown(
7585                        format!("Service was not ready: {}", e.into()),
7586                    )
7587                })?;
7588            let codec = tonic_prost::ProstCodec::default();
7589            let path = http::uri::PathAndQuery::from_static(
7590                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7591            );
7592            let mut req = request.into_request();
7593            req.extensions_mut()
7594                .insert(
7595                    GrpcMethod::new(
7596                        "sui.rpc.v2.SubscriptionService",
7597                        "SubscribeTransactions",
7598                    ),
7599                );
7600            self.inner.server_streaming(req, path, codec).await
7601        }
7602        /// Subscribe to the stream of events.
7603        ///
7604        /// The stream begins at the latest executed checkpoint as seen by the
7605        /// server and yields events matching the filter as they are emitted.
7606        pub async fn subscribe_events(
7607            &mut self,
7608            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7609        ) -> std::result::Result<
7610            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7611            tonic::Status,
7612        > {
7613            self.inner
7614                .ready()
7615                .await
7616                .map_err(|e| {
7617                    tonic::Status::unknown(
7618                        format!("Service was not ready: {}", e.into()),
7619                    )
7620                })?;
7621            let codec = tonic_prost::ProstCodec::default();
7622            let path = http::uri::PathAndQuery::from_static(
7623                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7624            );
7625            let mut req = request.into_request();
7626            req.extensions_mut()
7627                .insert(
7628                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7629                );
7630            self.inner.server_streaming(req, path, codec).await
7631        }
7632    }
7633}
7634/// Generated server implementations.
7635pub mod subscription_service_server {
7636    #![allow(
7637        unused_variables,
7638        dead_code,
7639        missing_docs,
7640        clippy::wildcard_imports,
7641        clippy::let_unit_value,
7642    )]
7643    use tonic::codegen::*;
7644    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
7645    #[async_trait]
7646    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7647        /// Subscribe to the stream of checkpoints.
7648        ///
7649        /// The stream begins at the latest executed checkpoint as seen by the
7650        /// server and yields checkpoints matching the filter as they are executed.
7651        /// A checkpoint matches if any transaction it contains satisfies the
7652        /// filter.
7653        async fn subscribe_checkpoints(
7654            &self,
7655            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7656        ) -> std::result::Result<
7657            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7658            tonic::Status,
7659        > {
7660            Err(tonic::Status::unimplemented("Not yet implemented"))
7661        }
7662        /// Subscribe to the stream of transactions.
7663        ///
7664        /// The stream begins at the latest executed checkpoint as seen by the
7665        /// server and yields transactions matching the filter as they are executed.
7666        async fn subscribe_transactions(
7667            &self,
7668            request: tonic::Request<super::SubscribeTransactionsRequest>,
7669        ) -> std::result::Result<
7670            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7671            tonic::Status,
7672        > {
7673            Err(tonic::Status::unimplemented("Not yet implemented"))
7674        }
7675        /// Subscribe to the stream of events.
7676        ///
7677        /// The stream begins at the latest executed checkpoint as seen by the
7678        /// server and yields events matching the filter as they are emitted.
7679        async fn subscribe_events(
7680            &self,
7681            request: tonic::Request<super::SubscribeEventsRequest>,
7682        ) -> std::result::Result<
7683            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7684            tonic::Status,
7685        > {
7686            Err(tonic::Status::unimplemented("Not yet implemented"))
7687        }
7688    }
7689    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7690    /// transactions, and events.
7691    ///
7692    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7693    /// requests take the same filter message, and responses carry the same item
7694    /// and watermark shapes with identical cursor semantics.
7695    ///
7696    /// Subscriptions do not support resumption. A new subscription always begins
7697    /// at the current tip of the chain as seen by the server (the latest executed
7698    /// checkpoint). To recover data missed between subscriptions, replay the gap
7699    /// with the paired List API: pass the last received `Watermark.cursor` as
7700    /// `options.after` on the List request (for checkpoints, pass the last
7701    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7702    /// indexed tip, which may trail the subscription's start position; repeat the
7703    /// List call as the index advances until the replay reaches the position
7704    /// established by the subscription's first frame.
7705    ///
7706    /// A subscription behaves like an unbounded ascending scan: every frame
7707    /// carries the subscriber's resume point, and progress advances as
7708    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7709    /// filters live: the first frame on a filtered subscription is a
7710    /// progress-only frame establishing the stream's start position, and
7711    /// progress continues to advance with bounded staleness even when no item
7712    /// matches.
7713    ///
7714    /// Subscription streams have no successful end: they run until cancelled by
7715    /// the client or terminated by the server with a gRPC status.
7716    #[derive(Debug)]
7717    pub struct SubscriptionServiceServer<T> {
7718        inner: Arc<T>,
7719        accept_compression_encodings: EnabledCompressionEncodings,
7720        send_compression_encodings: EnabledCompressionEncodings,
7721        max_decoding_message_size: Option<usize>,
7722        max_encoding_message_size: Option<usize>,
7723    }
7724    impl<T> SubscriptionServiceServer<T> {
7725        pub fn new(inner: T) -> Self {
7726            Self::from_arc(Arc::new(inner))
7727        }
7728        pub fn from_arc(inner: Arc<T>) -> Self {
7729            Self {
7730                inner,
7731                accept_compression_encodings: Default::default(),
7732                send_compression_encodings: Default::default(),
7733                max_decoding_message_size: None,
7734                max_encoding_message_size: None,
7735            }
7736        }
7737        pub fn with_interceptor<F>(
7738            inner: T,
7739            interceptor: F,
7740        ) -> InterceptedService<Self, F>
7741        where
7742            F: tonic::service::Interceptor,
7743        {
7744            InterceptedService::new(Self::new(inner), interceptor)
7745        }
7746        /// Enable decompressing requests with the given encoding.
7747        #[must_use]
7748        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7749            self.accept_compression_encodings.enable(encoding);
7750            self
7751        }
7752        /// Compress responses with the given encoding, if the client supports it.
7753        #[must_use]
7754        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7755            self.send_compression_encodings.enable(encoding);
7756            self
7757        }
7758        /// Limits the maximum size of a decoded message.
7759        ///
7760        /// Default: `4MB`
7761        #[must_use]
7762        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7763            self.max_decoding_message_size = Some(limit);
7764            self
7765        }
7766        /// Limits the maximum size of an encoded message.
7767        ///
7768        /// Default: `usize::MAX`
7769        #[must_use]
7770        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7771            self.max_encoding_message_size = Some(limit);
7772            self
7773        }
7774    }
7775    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7776    where
7777        T: SubscriptionService,
7778        B: Body + std::marker::Send + 'static,
7779        B::Error: Into<StdError> + std::marker::Send + 'static,
7780    {
7781        type Response = http::Response<tonic::body::Body>;
7782        type Error = std::convert::Infallible;
7783        type Future = BoxFuture<Self::Response, Self::Error>;
7784        fn poll_ready(
7785            &mut self,
7786            _cx: &mut Context<'_>,
7787        ) -> Poll<std::result::Result<(), Self::Error>> {
7788            Poll::Ready(Ok(()))
7789        }
7790        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7791            match req.uri().path() {
7792                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7793                    #[allow(non_camel_case_types)]
7794                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7795                    impl<
7796                        T: SubscriptionService,
7797                    > tonic::server::ServerStreamingService<
7798                        super::SubscribeCheckpointsRequest,
7799                    > for SubscribeCheckpointsSvc<T> {
7800                        type Response = super::SubscribeCheckpointsResponse;
7801                        type ResponseStream = BoxStream<
7802                            super::SubscribeCheckpointsResponse,
7803                        >;
7804                        type Future = BoxFuture<
7805                            tonic::Response<Self::ResponseStream>,
7806                            tonic::Status,
7807                        >;
7808                        fn call(
7809                            &mut self,
7810                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7811                        ) -> Self::Future {
7812                            let inner = Arc::clone(&self.0);
7813                            let fut = async move {
7814                                <T as SubscriptionService>::subscribe_checkpoints(
7815                                        &inner,
7816                                        request,
7817                                    )
7818                                    .await
7819                            };
7820                            Box::pin(fut)
7821                        }
7822                    }
7823                    let accept_compression_encodings = self.accept_compression_encodings;
7824                    let send_compression_encodings = self.send_compression_encodings;
7825                    let max_decoding_message_size = self.max_decoding_message_size;
7826                    let max_encoding_message_size = self.max_encoding_message_size;
7827                    let inner = self.inner.clone();
7828                    let fut = async move {
7829                        let method = SubscribeCheckpointsSvc(inner);
7830                        let codec = tonic_prost::ProstCodec::default();
7831                        let mut grpc = tonic::server::Grpc::new(codec)
7832                            .apply_compression_config(
7833                                accept_compression_encodings,
7834                                send_compression_encodings,
7835                            )
7836                            .apply_max_message_size_config(
7837                                max_decoding_message_size,
7838                                max_encoding_message_size,
7839                            );
7840                        let res = grpc.server_streaming(method, req).await;
7841                        Ok(res)
7842                    };
7843                    Box::pin(fut)
7844                }
7845                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7846                    #[allow(non_camel_case_types)]
7847                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7848                    impl<
7849                        T: SubscriptionService,
7850                    > tonic::server::ServerStreamingService<
7851                        super::SubscribeTransactionsRequest,
7852                    > for SubscribeTransactionsSvc<T> {
7853                        type Response = super::SubscribeTransactionsResponse;
7854                        type ResponseStream = BoxStream<
7855                            super::SubscribeTransactionsResponse,
7856                        >;
7857                        type Future = BoxFuture<
7858                            tonic::Response<Self::ResponseStream>,
7859                            tonic::Status,
7860                        >;
7861                        fn call(
7862                            &mut self,
7863                            request: tonic::Request<super::SubscribeTransactionsRequest>,
7864                        ) -> Self::Future {
7865                            let inner = Arc::clone(&self.0);
7866                            let fut = async move {
7867                                <T as SubscriptionService>::subscribe_transactions(
7868                                        &inner,
7869                                        request,
7870                                    )
7871                                    .await
7872                            };
7873                            Box::pin(fut)
7874                        }
7875                    }
7876                    let accept_compression_encodings = self.accept_compression_encodings;
7877                    let send_compression_encodings = self.send_compression_encodings;
7878                    let max_decoding_message_size = self.max_decoding_message_size;
7879                    let max_encoding_message_size = self.max_encoding_message_size;
7880                    let inner = self.inner.clone();
7881                    let fut = async move {
7882                        let method = SubscribeTransactionsSvc(inner);
7883                        let codec = tonic_prost::ProstCodec::default();
7884                        let mut grpc = tonic::server::Grpc::new(codec)
7885                            .apply_compression_config(
7886                                accept_compression_encodings,
7887                                send_compression_encodings,
7888                            )
7889                            .apply_max_message_size_config(
7890                                max_decoding_message_size,
7891                                max_encoding_message_size,
7892                            );
7893                        let res = grpc.server_streaming(method, req).await;
7894                        Ok(res)
7895                    };
7896                    Box::pin(fut)
7897                }
7898                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7899                    #[allow(non_camel_case_types)]
7900                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7901                    impl<
7902                        T: SubscriptionService,
7903                    > tonic::server::ServerStreamingService<
7904                        super::SubscribeEventsRequest,
7905                    > for SubscribeEventsSvc<T> {
7906                        type Response = super::SubscribeEventsResponse;
7907                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7908                        type Future = BoxFuture<
7909                            tonic::Response<Self::ResponseStream>,
7910                            tonic::Status,
7911                        >;
7912                        fn call(
7913                            &mut self,
7914                            request: tonic::Request<super::SubscribeEventsRequest>,
7915                        ) -> Self::Future {
7916                            let inner = Arc::clone(&self.0);
7917                            let fut = async move {
7918                                <T as SubscriptionService>::subscribe_events(
7919                                        &inner,
7920                                        request,
7921                                    )
7922                                    .await
7923                            };
7924                            Box::pin(fut)
7925                        }
7926                    }
7927                    let accept_compression_encodings = self.accept_compression_encodings;
7928                    let send_compression_encodings = self.send_compression_encodings;
7929                    let max_decoding_message_size = self.max_decoding_message_size;
7930                    let max_encoding_message_size = self.max_encoding_message_size;
7931                    let inner = self.inner.clone();
7932                    let fut = async move {
7933                        let method = SubscribeEventsSvc(inner);
7934                        let codec = tonic_prost::ProstCodec::default();
7935                        let mut grpc = tonic::server::Grpc::new(codec)
7936                            .apply_compression_config(
7937                                accept_compression_encodings,
7938                                send_compression_encodings,
7939                            )
7940                            .apply_max_message_size_config(
7941                                max_decoding_message_size,
7942                                max_encoding_message_size,
7943                            );
7944                        let res = grpc.server_streaming(method, req).await;
7945                        Ok(res)
7946                    };
7947                    Box::pin(fut)
7948                }
7949                _ => {
7950                    Box::pin(async move {
7951                        let mut response = http::Response::new(
7952                            tonic::body::Body::default(),
7953                        );
7954                        let headers = response.headers_mut();
7955                        headers
7956                            .insert(
7957                                tonic::Status::GRPC_STATUS,
7958                                (tonic::Code::Unimplemented as i32).into(),
7959                            );
7960                        headers
7961                            .insert(
7962                                http::header::CONTENT_TYPE,
7963                                tonic::metadata::GRPC_CONTENT_TYPE,
7964                            );
7965                        Ok(response)
7966                    })
7967                }
7968            }
7969        }
7970    }
7971    impl<T> Clone for SubscriptionServiceServer<T> {
7972        fn clone(&self) -> Self {
7973            let inner = self.inner.clone();
7974            Self {
7975                inner,
7976                accept_compression_encodings: self.accept_compression_encodings,
7977                send_compression_encodings: self.send_compression_encodings,
7978                max_decoding_message_size: self.max_decoding_message_size,
7979                max_encoding_message_size: self.max_encoding_message_size,
7980            }
7981        }
7982    }
7983    /// Generated gRPC service name
7984    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7985    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7986        const NAME: &'static str = SERVICE_NAME;
7987    }
7988}
7989#[non_exhaustive]
7990#[derive(Clone, PartialEq, ::prost::Message)]
7991pub struct SystemState {
7992    /// The version of the system state data structure type.
7993    #[prost(uint64, optional, tag = "1")]
7994    pub version: ::core::option::Option<u64>,
7995    /// The epoch id
7996    #[prost(uint64, optional, tag = "2")]
7997    pub epoch: ::core::option::Option<u64>,
7998    /// The protocol version
7999    #[prost(uint64, optional, tag = "3")]
8000    pub protocol_version: ::core::option::Option<u64>,
8001    /// Information about the validators
8002    #[prost(message, optional, tag = "4")]
8003    pub validators: ::core::option::Option<ValidatorSet>,
8004    /// Storage Fund info
8005    #[prost(message, optional, tag = "5")]
8006    pub storage_fund: ::core::option::Option<StorageFund>,
8007    /// Set of system config parameters
8008    #[prost(message, optional, tag = "6")]
8009    pub parameters: ::core::option::Option<SystemParameters>,
8010    /// The reference gas price for this epoch
8011    #[prost(uint64, optional, tag = "7")]
8012    pub reference_gas_price: ::core::option::Option<u64>,
8013    /// A list of the records of validator reporting each other.
8014    ///
8015    /// There is an entry in this list for each validator that has been reported
8016    /// at least once. Each record contains all the validators that reported
8017    /// them. If a validator has never been reported they don't have a record in this list.
8018    /// This lists persists across epoch: a peer continues being in a reported state until the
8019    /// reporter doesn't explicitly remove their report.
8020    #[prost(message, repeated, tag = "8")]
8021    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
8022    /// Schedule of stake subsidies given out each epoch.
8023    #[prost(message, optional, tag = "9")]
8024    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
8025    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
8026    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
8027    /// It can be reset once we are able to successfully execute advance_epoch.
8028    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
8029    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
8030    /// are out of safe mode.
8031    #[prost(bool, optional, tag = "10")]
8032    pub safe_mode: ::core::option::Option<bool>,
8033    /// Storage rewards accumulated during safe_mode
8034    #[prost(uint64, optional, tag = "11")]
8035    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
8036    /// Computation rewards accumulated during safe_mode
8037    #[prost(uint64, optional, tag = "12")]
8038    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
8039    /// Storage rebates paid out during safe_mode
8040    #[prost(uint64, optional, tag = "13")]
8041    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
8042    /// Nonrefundable storage fees accumulated during safe_mode
8043    #[prost(uint64, optional, tag = "14")]
8044    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
8045    /// Unix timestamp of when this this epoch started
8046    #[prost(uint64, optional, tag = "15")]
8047    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
8048    /// Any extra fields that's not defined statically.
8049    #[prost(message, optional, tag = "16")]
8050    pub extra_fields: ::core::option::Option<MoveTable>,
8051}
8052#[non_exhaustive]
8053#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8054pub struct ValidatorReportRecord {
8055    /// The address of the validator being reported
8056    #[prost(string, optional, tag = "1")]
8057    pub reported: ::core::option::Option<::prost::alloc::string::String>,
8058    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
8059    #[prost(string, repeated, tag = "2")]
8060    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8061}
8062#[non_exhaustive]
8063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8064pub struct SystemParameters {
8065    /// The duration of an epoch, in milliseconds.
8066    #[prost(uint64, optional, tag = "1")]
8067    pub epoch_duration_ms: ::core::option::Option<u64>,
8068    /// The starting epoch in which stake subsidies start being paid out
8069    #[prost(uint64, optional, tag = "2")]
8070    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
8071    /// Minimum number of active validators at any moment.
8072    #[prost(uint64, optional, tag = "3")]
8073    pub min_validator_count: ::core::option::Option<u64>,
8074    /// Maximum number of active validators at any moment.
8075    /// We do not allow the number of validators in any epoch to go above this.
8076    #[prost(uint64, optional, tag = "4")]
8077    pub max_validator_count: ::core::option::Option<u64>,
8078    /// Deprecated.
8079    /// Lower-bound on the amount of stake required to become a validator.
8080    #[prost(uint64, optional, tag = "5")]
8081    pub min_validator_joining_stake: ::core::option::Option<u64>,
8082    /// Deprecated.
8083    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
8084    /// have low stake and will be escorted out of the validator set after being below this
8085    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
8086    #[prost(uint64, optional, tag = "6")]
8087    pub validator_low_stake_threshold: ::core::option::Option<u64>,
8088    /// Deprecated.
8089    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
8090    /// immediately at epoch change, no grace period.
8091    #[prost(uint64, optional, tag = "7")]
8092    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
8093    /// A validator can have stake below `validator_low_stake_threshold`
8094    /// for this many epochs before being kicked out.
8095    #[prost(uint64, optional, tag = "8")]
8096    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
8097    /// Any extra fields that are not defined statically.
8098    #[prost(message, optional, tag = "9")]
8099    pub extra_fields: ::core::option::Option<MoveTable>,
8100}
8101/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
8102#[non_exhaustive]
8103#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8104pub struct MoveTable {
8105    /// The UID of the table or bag
8106    #[prost(string, optional, tag = "1")]
8107    pub id: ::core::option::Option<::prost::alloc::string::String>,
8108    /// The size or number of key-value pairs in the table or bag
8109    #[prost(uint64, optional, tag = "2")]
8110    pub size: ::core::option::Option<u64>,
8111}
8112#[non_exhaustive]
8113#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8114pub struct StakeSubsidy {
8115    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
8116    #[prost(uint64, optional, tag = "1")]
8117    pub balance: ::core::option::Option<u64>,
8118    /// Count of the number of times stake subsidies have been distributed.
8119    #[prost(uint64, optional, tag = "2")]
8120    pub distribution_counter: ::core::option::Option<u64>,
8121    /// The amount of stake subsidy to be drawn down per distribution.
8122    /// This amount decays and decreases over time.
8123    #[prost(uint64, optional, tag = "3")]
8124    pub current_distribution_amount: ::core::option::Option<u64>,
8125    /// Number of distributions to occur before the distribution amount decays.
8126    #[prost(uint64, optional, tag = "4")]
8127    pub stake_subsidy_period_length: ::core::option::Option<u64>,
8128    /// The rate at which the distribution amount decays at the end of each
8129    /// period. Expressed in basis points.
8130    #[prost(uint32, optional, tag = "5")]
8131    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8132    /// Any extra fields that's not defined statically.
8133    #[prost(message, optional, tag = "6")]
8134    pub extra_fields: ::core::option::Option<MoveTable>,
8135}
8136/// Struct representing the onchain storage fund.
8137#[non_exhaustive]
8138#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8139pub struct StorageFund {
8140    /// This is the sum of `storage_rebate` of
8141    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
8142    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
8143    /// of transactions, including both the portion refunded to the transaction senders as well as
8144    /// the non-refundable portion taken out and put into `non_refundable_balance`.
8145    #[prost(uint64, optional, tag = "1")]
8146    pub total_object_storage_rebates: ::core::option::Option<u64>,
8147    /// Represents any remaining inflow of the storage fund that should not
8148    /// be taken out of the fund.
8149    #[prost(uint64, optional, tag = "2")]
8150    pub non_refundable_balance: ::core::option::Option<u64>,
8151}
8152#[non_exhaustive]
8153#[derive(Clone, PartialEq, ::prost::Message)]
8154pub struct ValidatorSet {
8155    /// Total amount of stake from all active validators at the beginning of the epoch.
8156    /// Written only once per epoch, in `advance_epoch` function.
8157    #[prost(uint64, optional, tag = "1")]
8158    pub total_stake: ::core::option::Option<u64>,
8159    /// The current list of active validators.
8160    #[prost(message, repeated, tag = "2")]
8161    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8162    /// List of new validator candidates added during the current epoch.
8163    /// They will be processed at the end of the epoch.
8164    ///
8165    /// key: u64 (index), value: 0x3::validator::Validator
8166    #[prost(message, optional, tag = "3")]
8167    pub pending_active_validators: ::core::option::Option<MoveTable>,
8168    /// Removal requests from the validators. Each element is an index
8169    /// pointing to `active_validators`.
8170    #[prost(uint64, repeated, tag = "4")]
8171    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8172    /// Mappings from staking pool's ID to the sui address of a validator.
8173    ///
8174    /// key: address (staking pool Id), value: address (sui address of the validator)
8175    #[prost(message, optional, tag = "5")]
8176    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8177    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
8178    /// When a validator is deactivated the validator is removed from `active_validators` it
8179    /// is added to this table so that stakers can continue to withdraw their stake from it.
8180    ///
8181    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
8182    #[prost(message, optional, tag = "6")]
8183    pub inactive_validators: ::core::option::Option<MoveTable>,
8184    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
8185    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
8186    /// validator.
8187    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
8188    /// officially add them to the active validator set `active_validators` next epoch.
8189    ///
8190    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
8191    #[prost(message, optional, tag = "7")]
8192    pub validator_candidates: ::core::option::Option<MoveTable>,
8193    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
8194    #[prost(btree_map = "string, uint64", tag = "8")]
8195    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8196        ::prost::alloc::string::String,
8197        u64,
8198    >,
8199    /// Any extra fields that's not defined statically.
8200    #[prost(message, optional, tag = "9")]
8201    pub extra_fields: ::core::option::Option<MoveTable>,
8202}
8203/// Definition of a Validator in the system contracts
8204///
8205/// Note: fields of ValidatorMetadata are flattened into this type
8206#[non_exhaustive]
8207#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8208pub struct Validator {
8209    /// A unique human-readable name of this validator.
8210    #[prost(string, optional, tag = "1")]
8211    pub name: ::core::option::Option<::prost::alloc::string::String>,
8212    /// The Sui Address of the validator. This is the sender that created the Validator object,
8213    /// and also the address to send validator/coins to during withdraws.
8214    #[prost(string, optional, tag = "2")]
8215    pub address: ::core::option::Option<::prost::alloc::string::String>,
8216    #[prost(string, optional, tag = "3")]
8217    pub description: ::core::option::Option<::prost::alloc::string::String>,
8218    #[prost(string, optional, tag = "4")]
8219    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8220    #[prost(string, optional, tag = "5")]
8221    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8222    /// The public key bytes corresponding to the private key that the validator
8223    /// holds to sign transactions. For now, this is the same as AuthorityName.
8224    #[prost(bytes = "bytes", optional, tag = "7")]
8225    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8226    /// This is a proof that the validator has ownership of the protocol private key
8227    #[prost(bytes = "bytes", optional, tag = "8")]
8228    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8229    /// The public key bytes corresponding to the private key that the validator
8230    /// uses to establish TLS connections
8231    #[prost(bytes = "bytes", optional, tag = "10")]
8232    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8233    /// The public key bytes corresponding to the Narwhal Worker
8234    #[prost(bytes = "bytes", optional, tag = "12")]
8235    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8236    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
8237    #[prost(string, optional, tag = "13")]
8238    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8239    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
8240    #[prost(string, optional, tag = "14")]
8241    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8242    /// The address of the narwhal primary
8243    #[prost(string, optional, tag = "15")]
8244    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8245    /// The address of the narwhal worker
8246    #[prost(string, optional, tag = "16")]
8247    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8248    #[prost(bytes = "bytes", optional, tag = "18")]
8249    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8250    #[prost(bytes = "bytes", optional, tag = "19")]
8251    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8252    #[prost(bytes = "bytes", optional, tag = "21")]
8253    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8254    #[prost(bytes = "bytes", optional, tag = "23")]
8255    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8256    #[prost(string, optional, tag = "24")]
8257    pub next_epoch_network_address: ::core::option::Option<
8258        ::prost::alloc::string::String,
8259    >,
8260    #[prost(string, optional, tag = "25")]
8261    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8262    #[prost(string, optional, tag = "26")]
8263    pub next_epoch_primary_address: ::core::option::Option<
8264        ::prost::alloc::string::String,
8265    >,
8266    #[prost(string, optional, tag = "27")]
8267    pub next_epoch_worker_address: ::core::option::Option<
8268        ::prost::alloc::string::String,
8269    >,
8270    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
8271    #[prost(message, optional, tag = "28")]
8272    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8273    /// The voting power of this validator, which might be different from its
8274    /// stake amount.
8275    #[prost(uint64, optional, tag = "29")]
8276    pub voting_power: ::core::option::Option<u64>,
8277    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
8278    #[prost(string, optional, tag = "30")]
8279    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8280    /// Gas price quote, updated only at end of epoch.
8281    #[prost(uint64, optional, tag = "31")]
8282    pub gas_price: ::core::option::Option<u64>,
8283    /// Staking pool for this validator.
8284    #[prost(message, optional, tag = "32")]
8285    pub staking_pool: ::core::option::Option<StakingPool>,
8286    /// Commission rate of the validator, in basis point.
8287    #[prost(uint64, optional, tag = "33")]
8288    pub commission_rate: ::core::option::Option<u64>,
8289    /// Total amount of stake that would be active in the next epoch.
8290    #[prost(uint64, optional, tag = "34")]
8291    pub next_epoch_stake: ::core::option::Option<u64>,
8292    /// This validator's gas price quote for the next epoch.
8293    #[prost(uint64, optional, tag = "35")]
8294    pub next_epoch_gas_price: ::core::option::Option<u64>,
8295    /// The commission rate of the validator starting the next epoch, in basis point.
8296    #[prost(uint64, optional, tag = "36")]
8297    pub next_epoch_commission_rate: ::core::option::Option<u64>,
8298    /// Any extra fields that's not defined statically.
8299    #[prost(message, optional, tag = "37")]
8300    pub extra_fields: ::core::option::Option<MoveTable>,
8301}
8302/// A staking pool embedded in each validator struct in the system state object.
8303#[non_exhaustive]
8304#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8305pub struct StakingPool {
8306    /// UID of the StakingPool object
8307    #[prost(string, optional, tag = "1")]
8308    pub id: ::core::option::Option<::prost::alloc::string::String>,
8309    /// The epoch at which this pool became active.
8310    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
8311    #[prost(uint64, optional, tag = "2")]
8312    pub activation_epoch: ::core::option::Option<u64>,
8313    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
8314    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
8315    #[prost(uint64, optional, tag = "3")]
8316    pub deactivation_epoch: ::core::option::Option<u64>,
8317    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
8318    /// in the `StakedSui` object, updated at epoch boundaries.
8319    #[prost(uint64, optional, tag = "4")]
8320    pub sui_balance: ::core::option::Option<u64>,
8321    /// The epoch stake rewards will be added here at the end of each epoch.
8322    #[prost(uint64, optional, tag = "5")]
8323    pub rewards_pool: ::core::option::Option<u64>,
8324    /// Total number of pool tokens issued by the pool.
8325    #[prost(uint64, optional, tag = "6")]
8326    pub pool_token_balance: ::core::option::Option<u64>,
8327    /// Exchange rate history of previous epochs.
8328    ///
8329    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
8330    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
8331    ///
8332    /// key: u64 (epoch number), value: PoolTokenExchangeRate
8333    #[prost(message, optional, tag = "7")]
8334    pub exchange_rates: ::core::option::Option<MoveTable>,
8335    /// Pending stake amount for this epoch, emptied at epoch boundaries.
8336    #[prost(uint64, optional, tag = "8")]
8337    pub pending_stake: ::core::option::Option<u64>,
8338    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
8339    /// This includes both the principal and rewards SUI withdrawn.
8340    #[prost(uint64, optional, tag = "9")]
8341    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8342    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
8343    #[prost(uint64, optional, tag = "10")]
8344    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8345    /// Any extra fields that's not defined statically.
8346    #[prost(message, optional, tag = "11")]
8347    pub extra_fields: ::core::option::Option<MoveTable>,
8348}
8349/// A transaction.
8350#[non_exhaustive]
8351#[derive(Clone, PartialEq, ::prost::Message)]
8352pub struct Transaction {
8353    /// This Transaction serialized as BCS.
8354    #[prost(message, optional, tag = "1")]
8355    pub bcs: ::core::option::Option<Bcs>,
8356    /// The digest of this Transaction.
8357    #[prost(string, optional, tag = "2")]
8358    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8359    /// Version of this Transaction.
8360    #[prost(int32, optional, tag = "3")]
8361    pub version: ::core::option::Option<i32>,
8362    #[prost(message, optional, tag = "4")]
8363    pub kind: ::core::option::Option<TransactionKind>,
8364    #[prost(string, optional, tag = "5")]
8365    pub sender: ::core::option::Option<::prost::alloc::string::String>,
8366    #[prost(message, optional, tag = "6")]
8367    pub gas_payment: ::core::option::Option<GasPayment>,
8368    #[prost(message, optional, tag = "7")]
8369    pub expiration: ::core::option::Option<TransactionExpiration>,
8370}
8371/// Payment information for executing a transaction.
8372#[non_exhaustive]
8373#[derive(Clone, PartialEq, ::prost::Message)]
8374pub struct GasPayment {
8375    /// Set of gas objects to use for payment.
8376    #[prost(message, repeated, tag = "1")]
8377    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8378    /// Owner of the gas objects, either the transaction sender or a sponsor.
8379    #[prost(string, optional, tag = "2")]
8380    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8381    /// Gas unit price to use when charging for computation.
8382    ///
8383    /// Must be greater than or equal to the network's current RGP (reference gas price).
8384    #[prost(uint64, optional, tag = "3")]
8385    pub price: ::core::option::Option<u64>,
8386    /// Total budget willing to spend for the execution of a transaction.
8387    #[prost(uint64, optional, tag = "4")]
8388    pub budget: ::core::option::Option<u64>,
8389}
8390/// A TTL for a transaction.
8391#[non_exhaustive]
8392#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8393pub struct TransactionExpiration {
8394    #[prost(
8395        enumeration = "transaction_expiration::TransactionExpirationKind",
8396        optional,
8397        tag = "1"
8398    )]
8399    pub kind: ::core::option::Option<i32>,
8400    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
8401    /// must be greater than or equal to the current epoch for a transaction to execute.
8402    #[prost(uint64, optional, tag = "2")]
8403    pub epoch: ::core::option::Option<u64>,
8404    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
8405    /// must be less than or equal to the current epoch for a transaction to execute.
8406    #[prost(uint64, optional, tag = "3")]
8407    pub min_epoch: ::core::option::Option<u64>,
8408    /// Minimal UNIX timestamp in which a transaction can be executed. The
8409    /// provided minimal timestamp must be less than or equal to the current
8410    /// clock.
8411    #[prost(message, optional, tag = "4")]
8412    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8413    /// Maximum UNIX timestamp in which a transaction can be executed. The
8414    /// provided maximal timestamp must be greater than or equal to the current
8415    /// clock.
8416    #[prost(message, optional, tag = "5")]
8417    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8418    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
8419    #[prost(string, optional, tag = "6")]
8420    pub chain: ::core::option::Option<::prost::alloc::string::String>,
8421    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
8422    #[prost(uint32, optional, tag = "7")]
8423    pub nonce: ::core::option::Option<u32>,
8424    /// The validators allowed to propose this transaction in consensus. Only set when `kind`
8425    /// is `VALIDITY`. Leave unset to let any validator propose the transaction.
8426    #[prost(message, optional, tag = "8")]
8427    pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8428}
8429/// Nested message and enum types in `TransactionExpiration`.
8430pub mod transaction_expiration {
8431    #[non_exhaustive]
8432    #[derive(
8433        Clone,
8434        Copy,
8435        Debug,
8436        PartialEq,
8437        Eq,
8438        Hash,
8439        PartialOrd,
8440        Ord,
8441        ::prost::Enumeration
8442    )]
8443    #[repr(i32)]
8444    pub enum TransactionExpirationKind {
8445        Unknown = 0,
8446        /// The transaction has no expiration.
8447        None = 1,
8448        /// Validators won't sign and execute transaction unless the expiration epoch
8449        /// is greater than or equal to the current epoch.
8450        Epoch = 2,
8451        /// This variant enables gas payments from address balances.
8452        ///
8453        /// When transactions use address balances for gas payment instead of explicit gas coins,
8454        /// we lose the natural transaction uniqueness and replay prevention that comes from
8455        /// mutation of gas coin objects.
8456        ///
8457        /// By bounding expiration and providing a nonce, validators must only retain
8458        /// executed digests for the maximum possible expiry range to differentiate
8459        /// retries from unique transactions with otherwise identical inputs.
8460        ValidDuring = 3,
8461        /// Everything in VALID_DURING, plus a restriction on which validators may
8462        /// propose the transaction in consensus.
8463        Validity = 4,
8464    }
8465    impl TransactionExpirationKind {
8466        /// String value of the enum field names used in the ProtoBuf definition.
8467        ///
8468        /// The values are not transformed in any way and thus are considered stable
8469        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8470        pub fn as_str_name(&self) -> &'static str {
8471            match self {
8472                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8473                Self::None => "NONE",
8474                Self::Epoch => "EPOCH",
8475                Self::ValidDuring => "VALID_DURING",
8476                Self::Validity => "VALIDITY",
8477            }
8478        }
8479        /// Creates an enum from field names used in the ProtoBuf definition.
8480        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8481            match value {
8482                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8483                "NONE" => Some(Self::None),
8484                "EPOCH" => Some(Self::Epoch),
8485                "VALID_DURING" => Some(Self::ValidDuring),
8486                "VALIDITY" => Some(Self::Validity),
8487                _ => None,
8488            }
8489        }
8490    }
8491}
8492/// The validators allowed to propose a transaction in consensus.
8493///
8494/// Proposal by any other validator is byzantine behavior and invalidates the whole block.
8495#[non_exhaustive]
8496#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8497pub struct AllowedProposers {
8498    /// The epoch whose committee `proposers` indexes into.
8499    ///
8500    /// Committee indices are only meaningful against one committee, so a set recorded for any
8501    /// other epoch is ignored and the transaction is treated as naming no proposers.
8502    #[prost(uint64, optional, tag = "1")]
8503    pub epoch: ::core::option::Option<u64>,
8504    /// Committee indices of the allowed proposers, strictly increasing and non-empty.
8505    ///
8506    /// An empty list names no validator and is rejected; omit `allowed_proposers` entirely to
8507    /// let any validator propose the transaction.
8508    #[prost(uint32, repeated, tag = "2")]
8509    pub proposers: ::prost::alloc::vec::Vec<u32>,
8510}
8511/// Transaction type.
8512#[non_exhaustive]
8513#[derive(Clone, PartialEq, ::prost::Message)]
8514pub struct TransactionKind {
8515    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8516    pub kind: ::core::option::Option<i32>,
8517    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8518    pub data: ::core::option::Option<transaction_kind::Data>,
8519}
8520/// Nested message and enum types in `TransactionKind`.
8521pub mod transaction_kind {
8522    #[non_exhaustive]
8523    #[derive(
8524        Clone,
8525        Copy,
8526        Debug,
8527        PartialEq,
8528        Eq,
8529        Hash,
8530        PartialOrd,
8531        Ord,
8532        ::prost::Enumeration
8533    )]
8534    #[repr(i32)]
8535    pub enum Kind {
8536        Unknown = 0,
8537        /// A user transaction comprised of a list of native commands and Move calls.
8538        ProgrammableTransaction = 1,
8539        /// System transaction used to end an epoch.
8540        ///
8541        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8542        /// `EndOfEpochTransaction`).
8543        ChangeEpoch = 2,
8544        /// Transaction used to initialize the chain state.
8545        ///
8546        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8547        /// executed on the chain.
8548        Genesis = 3,
8549        /// V1 consensus commit update.
8550        ConsensusCommitPrologueV1 = 4,
8551        /// Update set of valid JWKs used for zklogin.
8552        AuthenticatorStateUpdate = 5,
8553        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8554        /// the next one.
8555        EndOfEpoch = 6,
8556        /// Randomness update.
8557        RandomnessStateUpdate = 7,
8558        /// V2 consensus commit update.
8559        ConsensusCommitPrologueV2 = 8,
8560        /// V3 consensus commit update.
8561        ConsensusCommitPrologueV3 = 9,
8562        /// V4 consensus commit update.
8563        ConsensusCommitPrologueV4 = 10,
8564        /// A system transaction comprised of a list of native commands and Move calls.
8565        ProgrammableSystemTransaction = 11,
8566    }
8567    impl Kind {
8568        /// String value of the enum field names used in the ProtoBuf definition.
8569        ///
8570        /// The values are not transformed in any way and thus are considered stable
8571        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8572        pub fn as_str_name(&self) -> &'static str {
8573            match self {
8574                Self::Unknown => "KIND_UNKNOWN",
8575                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8576                Self::ChangeEpoch => "CHANGE_EPOCH",
8577                Self::Genesis => "GENESIS",
8578                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8579                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8580                Self::EndOfEpoch => "END_OF_EPOCH",
8581                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8582                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8583                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8584                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8585                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8586            }
8587        }
8588        /// Creates an enum from field names used in the ProtoBuf definition.
8589        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8590            match value {
8591                "KIND_UNKNOWN" => Some(Self::Unknown),
8592                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8593                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8594                "GENESIS" => Some(Self::Genesis),
8595                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8596                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8597                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8598                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8599                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8600                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8601                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8602                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8603                    Some(Self::ProgrammableSystemTransaction)
8604                }
8605                _ => None,
8606            }
8607        }
8608    }
8609    #[non_exhaustive]
8610    #[derive(Clone, PartialEq, ::prost::Oneof)]
8611    pub enum Data {
8612        /// A transaction comprised of a list of native commands and Move calls.
8613        #[prost(message, tag = "2")]
8614        ProgrammableTransaction(super::ProgrammableTransaction),
8615        /// System transaction used to end an epoch.
8616        ///
8617        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8618        /// `EndOfEpochTransaction`).
8619        #[prost(message, tag = "3")]
8620        ChangeEpoch(super::ChangeEpoch),
8621        /// Transaction used to initialize the chain state.
8622        ///
8623        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8624        /// executed on the chain.
8625        #[prost(message, tag = "4")]
8626        Genesis(super::GenesisTransaction),
8627        /// consensus commit update info
8628        #[prost(message, tag = "5")]
8629        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8630        /// Update set of valid JWKs used for zklogin.
8631        #[prost(message, tag = "6")]
8632        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8633        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8634        /// the next one.
8635        #[prost(message, tag = "7")]
8636        EndOfEpoch(super::EndOfEpochTransaction),
8637        /// Randomness update.
8638        #[prost(message, tag = "8")]
8639        RandomnessStateUpdate(super::RandomnessStateUpdate),
8640    }
8641}
8642/// A user transaction.
8643///
8644/// Contains a series of native commands and Move calls where the results of one command can be
8645/// used in future commands.
8646#[non_exhaustive]
8647#[derive(Clone, PartialEq, ::prost::Message)]
8648pub struct ProgrammableTransaction {
8649    /// Input objects or primitive values.
8650    #[prost(message, repeated, tag = "1")]
8651    pub inputs: ::prost::alloc::vec::Vec<Input>,
8652    /// The commands to be executed sequentially. A failure in any command
8653    /// results in the failure of the entire transaction.
8654    #[prost(message, repeated, tag = "2")]
8655    pub commands: ::prost::alloc::vec::Vec<Command>,
8656}
8657/// A single command in a programmable transaction.
8658#[non_exhaustive]
8659#[derive(Clone, PartialEq, ::prost::Message)]
8660pub struct Command {
8661    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8662    pub command: ::core::option::Option<command::Command>,
8663}
8664/// Nested message and enum types in `Command`.
8665pub mod command {
8666    #[non_exhaustive]
8667    #[derive(Clone, PartialEq, ::prost::Oneof)]
8668    pub enum Command {
8669        /// A call to either an entry or a public Move function.
8670        #[prost(message, tag = "1")]
8671        MoveCall(super::MoveCall),
8672        /// `(Vec<forall T:key+store. T>, address)`
8673        /// It sends n-objects to the specified address. These objects must have store
8674        /// (public transfer) and either the previous owner must be an address or the object must
8675        /// be newly created.
8676        #[prost(message, tag = "2")]
8677        TransferObjects(super::TransferObjects),
8678        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
8679        /// It splits off some amounts into new coins with those amounts.
8680        #[prost(message, tag = "3")]
8681        SplitCoins(super::SplitCoins),
8682        /// `(&mut Coin<T>, Vec<Coin<T>>)`
8683        /// It merges n-coins into the first coin.
8684        #[prost(message, tag = "4")]
8685        MergeCoins(super::MergeCoins),
8686        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
8687        /// dependencies to link against on chain.
8688        #[prost(message, tag = "5")]
8689        Publish(super::Publish),
8690        /// `forall T: Vec<T> -> vector<T>`
8691        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
8692        /// the type tag must be specified.
8693        #[prost(message, tag = "6")]
8694        MakeMoveVector(super::MakeMoveVector),
8695        /// Upgrades a Move package.
8696        /// Takes (in order):
8697        ///
8698        /// 1. A vector of serialized modules for the package.
8699        /// 1. A vector of object ids for the transitive dependencies of the new package.
8700        /// 1. The object ID of the package being upgraded.
8701        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
8702        ///    programmable transaction.
8703        #[prost(message, tag = "7")]
8704        Upgrade(super::Upgrade),
8705    }
8706}
8707/// Command to call a Move function.
8708///
8709/// Functions that can be called by a `MoveCall` command are those that have a function signature
8710/// that is either `entry` or `public` (which don't have a reference return type).
8711#[non_exhaustive]
8712#[derive(Clone, PartialEq, ::prost::Message)]
8713pub struct MoveCall {
8714    /// The package containing the module and function.
8715    #[prost(string, optional, tag = "1")]
8716    pub package: ::core::option::Option<::prost::alloc::string::String>,
8717    /// The specific module in the package containing the function.
8718    #[prost(string, optional, tag = "2")]
8719    pub module: ::core::option::Option<::prost::alloc::string::String>,
8720    /// The function to be called.
8721    #[prost(string, optional, tag = "3")]
8722    pub function: ::core::option::Option<::prost::alloc::string::String>,
8723    /// The type arguments to the function.
8724    #[prost(string, repeated, tag = "4")]
8725    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8726    /// The arguments to the function.
8727    #[prost(message, repeated, tag = "5")]
8728    pub arguments: ::prost::alloc::vec::Vec<Argument>,
8729}
8730/// Command to transfer ownership of a set of objects to an address.
8731#[non_exhaustive]
8732#[derive(Clone, PartialEq, ::prost::Message)]
8733pub struct TransferObjects {
8734    /// Set of objects to transfer.
8735    #[prost(message, repeated, tag = "1")]
8736    pub objects: ::prost::alloc::vec::Vec<Argument>,
8737    /// The address to transfer ownership to.
8738    #[prost(message, optional, tag = "2")]
8739    pub address: ::core::option::Option<Argument>,
8740}
8741/// Command to split a single coin object into multiple coins.
8742#[non_exhaustive]
8743#[derive(Clone, PartialEq, ::prost::Message)]
8744pub struct SplitCoins {
8745    /// The coin to split.
8746    #[prost(message, optional, tag = "1")]
8747    pub coin: ::core::option::Option<Argument>,
8748    /// The amounts to split off.
8749    #[prost(message, repeated, tag = "2")]
8750    pub amounts: ::prost::alloc::vec::Vec<Argument>,
8751}
8752/// Command to merge multiple coins of the same type into a single coin.
8753#[non_exhaustive]
8754#[derive(Clone, PartialEq, ::prost::Message)]
8755pub struct MergeCoins {
8756    /// Coin to merge coins into.
8757    #[prost(message, optional, tag = "1")]
8758    pub coin: ::core::option::Option<Argument>,
8759    /// Set of coins to merge into `coin`.
8760    ///
8761    /// All listed coins must be of the same type and be the same type as `coin`
8762    #[prost(message, repeated, tag = "2")]
8763    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8764}
8765/// Command to publish a new Move package.
8766#[non_exhaustive]
8767#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8768pub struct Publish {
8769    /// The serialized Move modules.
8770    #[prost(bytes = "bytes", repeated, tag = "1")]
8771    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8772    /// Set of packages that the to-be published package depends on.
8773    #[prost(string, repeated, tag = "2")]
8774    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8775}
8776/// Command to build a Move vector out of a set of individual elements.
8777#[non_exhaustive]
8778#[derive(Clone, PartialEq, ::prost::Message)]
8779pub struct MakeMoveVector {
8780    /// Type of the individual elements.
8781    ///
8782    /// This is required to be set when the type can't be inferred, for example when the set of
8783    /// provided arguments are all pure input values.
8784    #[prost(string, optional, tag = "1")]
8785    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8786    /// The set individual elements to build the vector with.
8787    #[prost(message, repeated, tag = "2")]
8788    pub elements: ::prost::alloc::vec::Vec<Argument>,
8789}
8790/// Command to upgrade an already published package.
8791#[non_exhaustive]
8792#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8793pub struct Upgrade {
8794    /// The serialized Move modules.
8795    #[prost(bytes = "bytes", repeated, tag = "1")]
8796    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8797    /// Set of packages that the to-be published package depends on.
8798    #[prost(string, repeated, tag = "2")]
8799    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8800    /// Package ID of the package to upgrade.
8801    #[prost(string, optional, tag = "3")]
8802    pub package: ::core::option::Option<::prost::alloc::string::String>,
8803    /// Ticket authorizing the upgrade.
8804    #[prost(message, optional, tag = "4")]
8805    pub ticket: ::core::option::Option<Argument>,
8806}
8807/// Randomness update.
8808#[non_exhaustive]
8809#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8810pub struct RandomnessStateUpdate {
8811    /// Epoch of the randomness state update transaction.
8812    #[prost(uint64, optional, tag = "1")]
8813    pub epoch: ::core::option::Option<u64>,
8814    /// Randomness round of the update.
8815    #[prost(uint64, optional, tag = "2")]
8816    pub randomness_round: ::core::option::Option<u64>,
8817    /// Updated random bytes.
8818    #[prost(bytes = "bytes", optional, tag = "3")]
8819    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8820    /// The initial version of the randomness object that it was shared at.
8821    #[prost(uint64, optional, tag = "4")]
8822    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8823}
8824/// System transaction used to change the epoch.
8825#[non_exhaustive]
8826#[derive(Clone, PartialEq, ::prost::Message)]
8827pub struct ChangeEpoch {
8828    /// The next (to become) epoch ID.
8829    #[prost(uint64, optional, tag = "1")]
8830    pub epoch: ::core::option::Option<u64>,
8831    /// The protocol version in effect in the new epoch.
8832    #[prost(uint64, optional, tag = "2")]
8833    pub protocol_version: ::core::option::Option<u64>,
8834    /// The total amount of gas charged for storage during the epoch.
8835    #[prost(uint64, optional, tag = "3")]
8836    pub storage_charge: ::core::option::Option<u64>,
8837    /// The total amount of gas charged for computation during the epoch.
8838    #[prost(uint64, optional, tag = "4")]
8839    pub computation_charge: ::core::option::Option<u64>,
8840    /// The amount of storage rebate refunded to the txn senders.
8841    #[prost(uint64, optional, tag = "5")]
8842    pub storage_rebate: ::core::option::Option<u64>,
8843    /// The non-refundable storage fee.
8844    #[prost(uint64, optional, tag = "6")]
8845    pub non_refundable_storage_fee: ::core::option::Option<u64>,
8846    /// Unix timestamp when epoch started.
8847    #[prost(message, optional, tag = "7")]
8848    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8849    /// System packages (specifically framework and Move stdlib) that are written before the new
8850    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
8851    /// the validator must write out the following modules.  Modules are provided with the version they
8852    /// will be upgraded to, their modules in serialized form (which include their package ID), and
8853    /// a list of their transitive dependencies.
8854    #[prost(message, repeated, tag = "8")]
8855    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8856}
8857/// System package.
8858#[non_exhaustive]
8859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8860pub struct SystemPackage {
8861    /// Version of the package.
8862    #[prost(uint64, optional, tag = "1")]
8863    pub version: ::core::option::Option<u64>,
8864    /// Move modules.
8865    #[prost(bytes = "bytes", repeated, tag = "2")]
8866    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8867    /// Package dependencies.
8868    #[prost(string, repeated, tag = "3")]
8869    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8870}
8871/// The genesis transaction.
8872#[non_exhaustive]
8873#[derive(Clone, PartialEq, ::prost::Message)]
8874pub struct GenesisTransaction {
8875    /// Set of genesis objects.
8876    #[prost(message, repeated, tag = "1")]
8877    pub objects: ::prost::alloc::vec::Vec<Object>,
8878}
8879/// Consensus commit prologue system transaction.
8880///
8881/// This message can represent V1, V2, and V3 prologue types.
8882#[non_exhaustive]
8883#[derive(Clone, PartialEq, ::prost::Message)]
8884pub struct ConsensusCommitPrologue {
8885    /// Epoch of the commit prologue transaction.
8886    ///
8887    /// Present in V1, V2, V3, V4.
8888    #[prost(uint64, optional, tag = "1")]
8889    pub epoch: ::core::option::Option<u64>,
8890    /// Consensus round of the commit.
8891    ///
8892    /// Present in V1, V2, V3, V4.
8893    #[prost(uint64, optional, tag = "2")]
8894    pub round: ::core::option::Option<u64>,
8895    /// Unix timestamp from consensus.
8896    ///
8897    /// Present in V1, V2, V3, V4.
8898    #[prost(message, optional, tag = "3")]
8899    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8900    /// Digest of consensus output.
8901    ///
8902    /// Present in V2, V3, V4.
8903    #[prost(string, optional, tag = "4")]
8904    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8905    /// The sub DAG index of the consensus commit. This field is populated if there
8906    /// are multiple consensus commits per round.
8907    ///
8908    /// Present in V3, V4.
8909    #[prost(uint64, optional, tag = "5")]
8910    pub sub_dag_index: ::core::option::Option<u64>,
8911    /// Stores consensus handler determined consensus object version assignments.
8912    ///
8913    /// Present in V3, V4.
8914    #[prost(message, optional, tag = "6")]
8915    pub consensus_determined_version_assignments: ::core::option::Option<
8916        ConsensusDeterminedVersionAssignments,
8917    >,
8918    /// Digest of any additional state computed by the consensus handler.
8919    /// Used to detect forking bugs as early as possible.
8920    ///
8921    /// Present in V4.
8922    #[prost(string, optional, tag = "7")]
8923    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8924}
8925/// Object version assignment from consensus.
8926#[non_exhaustive]
8927#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8928pub struct VersionAssignment {
8929    /// `ObjectId` of the object.
8930    #[prost(string, optional, tag = "1")]
8931    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8932    /// start version of the consensus stream for this object
8933    #[prost(uint64, optional, tag = "2")]
8934    pub start_version: ::core::option::Option<u64>,
8935    /// Assigned version.
8936    #[prost(uint64, optional, tag = "3")]
8937    pub version: ::core::option::Option<u64>,
8938}
8939/// A transaction that was canceled.
8940#[non_exhaustive]
8941#[derive(Clone, PartialEq, ::prost::Message)]
8942pub struct CanceledTransaction {
8943    /// Digest of the canceled transaction.
8944    #[prost(string, optional, tag = "1")]
8945    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8946    /// List of object version assignments.
8947    #[prost(message, repeated, tag = "2")]
8948    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8949}
8950/// Version assignments performed by consensus.
8951#[non_exhaustive]
8952#[derive(Clone, PartialEq, ::prost::Message)]
8953pub struct ConsensusDeterminedVersionAssignments {
8954    /// Version of this message
8955    #[prost(int32, optional, tag = "1")]
8956    pub version: ::core::option::Option<i32>,
8957    /// Canceled transaction version assignment.
8958    #[prost(message, repeated, tag = "3")]
8959    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8960}
8961/// Update the set of valid JWKs.
8962#[non_exhaustive]
8963#[derive(Clone, PartialEq, ::prost::Message)]
8964pub struct AuthenticatorStateUpdate {
8965    /// Epoch of the authenticator state update transaction.
8966    #[prost(uint64, optional, tag = "1")]
8967    pub epoch: ::core::option::Option<u64>,
8968    /// Consensus round of the authenticator state update.
8969    #[prost(uint64, optional, tag = "2")]
8970    pub round: ::core::option::Option<u64>,
8971    /// Newly active JWKs.
8972    #[prost(message, repeated, tag = "3")]
8973    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8974    /// The initial version of the authenticator object that it was shared at.
8975    #[prost(uint64, optional, tag = "4")]
8976    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8977}
8978/// A new JWK.
8979#[non_exhaustive]
8980#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8981pub struct ActiveJwk {
8982    /// Identifier used to uniquely identify a JWK.
8983    #[prost(message, optional, tag = "1")]
8984    pub id: ::core::option::Option<JwkId>,
8985    /// The JWK.
8986    #[prost(message, optional, tag = "2")]
8987    pub jwk: ::core::option::Option<Jwk>,
8988    /// Most recent epoch in which the JWK was validated.
8989    #[prost(uint64, optional, tag = "3")]
8990    pub epoch: ::core::option::Option<u64>,
8991}
8992/// Set of operations run at the end of the epoch to close out the current epoch
8993/// and start the next one.
8994#[non_exhaustive]
8995#[derive(Clone, PartialEq, ::prost::Message)]
8996pub struct EndOfEpochTransaction {
8997    #[prost(message, repeated, tag = "1")]
8998    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8999}
9000/// Operation run at the end of an epoch.
9001#[non_exhaustive]
9002#[derive(Clone, PartialEq, ::prost::Message)]
9003pub struct EndOfEpochTransactionKind {
9004    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
9005    pub kind: ::core::option::Option<i32>,
9006    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
9007    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
9008}
9009/// Nested message and enum types in `EndOfEpochTransactionKind`.
9010pub mod end_of_epoch_transaction_kind {
9011    #[non_exhaustive]
9012    #[derive(
9013        Clone,
9014        Copy,
9015        Debug,
9016        PartialEq,
9017        Eq,
9018        Hash,
9019        PartialOrd,
9020        Ord,
9021        ::prost::Enumeration
9022    )]
9023    #[repr(i32)]
9024    pub enum Kind {
9025        Unknown = 0,
9026        /// End the epoch and start the next one.
9027        ChangeEpoch = 1,
9028        /// Create and initialize the authenticator object used for zklogin.
9029        AuthenticatorStateCreate = 2,
9030        /// Expire JWKs used for zklogin.
9031        AuthenticatorStateExpire = 3,
9032        /// Create and initialize the randomness object.
9033        RandomnessStateCreate = 4,
9034        /// Create and initialize the deny list object.
9035        DenyListStateCreate = 5,
9036        /// Create and initialize the bridge object.
9037        BridgeStateCreate = 6,
9038        /// Initialize the bridge committee.
9039        BridgeCommitteeInit = 7,
9040        /// Execution time observations from the committee to preserve cross epoch
9041        StoreExecutionTimeObservations = 8,
9042        /// Create the accumulator root object.
9043        AccumulatorRootCreate = 9,
9044        /// Create and initialize the Coin Registry object.
9045        CoinRegistryCreate = 10,
9046        /// Create and initialize the Display Registry object.
9047        DisplayRegistryCreate = 11,
9048        /// Create and initialize the Address Alias State object.
9049        AddressAliasStateCreate = 12,
9050        /// Write the end-of-epoch-computed storage cost for accumulator objects.
9051        WriteAccumulatorStorageCost = 13,
9052        /// Create and initialize the Forwarding Address Registry object.
9053        ForwardingAddressRegistryCreate = 14,
9054    }
9055    impl Kind {
9056        /// String value of the enum field names used in the ProtoBuf definition.
9057        ///
9058        /// The values are not transformed in any way and thus are considered stable
9059        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9060        pub fn as_str_name(&self) -> &'static str {
9061            match self {
9062                Self::Unknown => "KIND_UNKNOWN",
9063                Self::ChangeEpoch => "CHANGE_EPOCH",
9064                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
9065                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
9066                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
9067                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
9068                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
9069                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
9070                Self::StoreExecutionTimeObservations => {
9071                    "STORE_EXECUTION_TIME_OBSERVATIONS"
9072                }
9073                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
9074                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
9075                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
9076                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
9077                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
9078                Self::ForwardingAddressRegistryCreate => {
9079                    "FORWARDING_ADDRESS_REGISTRY_CREATE"
9080                }
9081            }
9082        }
9083        /// Creates an enum from field names used in the ProtoBuf definition.
9084        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9085            match value {
9086                "KIND_UNKNOWN" => Some(Self::Unknown),
9087                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
9088                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
9089                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
9090                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
9091                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
9092                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
9093                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
9094                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
9095                    Some(Self::StoreExecutionTimeObservations)
9096                }
9097                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
9098                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
9099                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
9100                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
9101                "WRITE_ACCUMULATOR_STORAGE_COST" => {
9102                    Some(Self::WriteAccumulatorStorageCost)
9103                }
9104                "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9105                    Some(Self::ForwardingAddressRegistryCreate)
9106                }
9107                _ => None,
9108            }
9109        }
9110    }
9111    #[non_exhaustive]
9112    #[derive(Clone, PartialEq, ::prost::Oneof)]
9113    pub enum Data {
9114        /// End the epoch and start the next one.
9115        #[prost(message, tag = "2")]
9116        ChangeEpoch(super::ChangeEpoch),
9117        /// Expire JWKs used for zklogin.
9118        #[prost(message, tag = "3")]
9119        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9120        /// Execution time observations from the committee to preserve cross epoch
9121        #[prost(message, tag = "4")]
9122        ExecutionTimeObservations(super::ExecutionTimeObservations),
9123        /// ChainId used when initializing the bridge
9124        #[prost(string, tag = "5")]
9125        BridgeChainId(::prost::alloc::string::String),
9126        /// Start version of the Bridge object
9127        #[prost(uint64, tag = "6")]
9128        BridgeObjectVersion(u64),
9129        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
9130        #[prost(uint64, tag = "7")]
9131        StorageCost(u64),
9132    }
9133}
9134/// Expire old JWKs.
9135#[non_exhaustive]
9136#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9137pub struct AuthenticatorStateExpire {
9138    /// Expire JWKs that have a lower epoch than this.
9139    #[prost(uint64, optional, tag = "1")]
9140    pub min_epoch: ::core::option::Option<u64>,
9141    /// The initial version of the authenticator object that it was shared at.
9142    #[prost(uint64, optional, tag = "2")]
9143    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9144}
9145#[non_exhaustive]
9146#[derive(Clone, PartialEq, ::prost::Message)]
9147pub struct ExecutionTimeObservations {
9148    /// Version of this ExecutionTimeObservations
9149    #[prost(int32, optional, tag = "1")]
9150    pub version: ::core::option::Option<i32>,
9151    #[prost(message, repeated, tag = "2")]
9152    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9153}
9154#[non_exhaustive]
9155#[derive(Clone, PartialEq, ::prost::Message)]
9156pub struct ExecutionTimeObservation {
9157    #[prost(
9158        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9159        optional,
9160        tag = "1"
9161    )]
9162    pub kind: ::core::option::Option<i32>,
9163    #[prost(message, optional, tag = "2")]
9164    pub move_entry_point: ::core::option::Option<MoveCall>,
9165    #[prost(message, repeated, tag = "3")]
9166    pub validator_observations: ::prost::alloc::vec::Vec<
9167        ValidatorExecutionTimeObservation,
9168    >,
9169}
9170/// Nested message and enum types in `ExecutionTimeObservation`.
9171pub mod execution_time_observation {
9172    #[non_exhaustive]
9173    #[derive(
9174        Clone,
9175        Copy,
9176        Debug,
9177        PartialEq,
9178        Eq,
9179        Hash,
9180        PartialOrd,
9181        Ord,
9182        ::prost::Enumeration
9183    )]
9184    #[repr(i32)]
9185    pub enum ExecutionTimeObservationKind {
9186        Unknown = 0,
9187        MoveEntryPoint = 1,
9188        TransferObjects = 2,
9189        SplitCoins = 3,
9190        MergeCoins = 4,
9191        Publish = 5,
9192        MakeMoveVector = 6,
9193        Upgrade = 7,
9194    }
9195    impl ExecutionTimeObservationKind {
9196        /// String value of the enum field names used in the ProtoBuf definition.
9197        ///
9198        /// The values are not transformed in any way and thus are considered stable
9199        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9200        pub fn as_str_name(&self) -> &'static str {
9201            match self {
9202                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9203                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9204                Self::TransferObjects => "TRANSFER_OBJECTS",
9205                Self::SplitCoins => "SPLIT_COINS",
9206                Self::MergeCoins => "MERGE_COINS",
9207                Self::Publish => "PUBLISH",
9208                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9209                Self::Upgrade => "UPGRADE",
9210            }
9211        }
9212        /// Creates an enum from field names used in the ProtoBuf definition.
9213        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9214            match value {
9215                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9216                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9217                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9218                "SPLIT_COINS" => Some(Self::SplitCoins),
9219                "MERGE_COINS" => Some(Self::MergeCoins),
9220                "PUBLISH" => Some(Self::Publish),
9221                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9222                "UPGRADE" => Some(Self::Upgrade),
9223                _ => None,
9224            }
9225        }
9226    }
9227}
9228#[non_exhaustive]
9229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9230pub struct ValidatorExecutionTimeObservation {
9231    /// Bls12381 public key of the validator
9232    #[prost(bytes = "bytes", optional, tag = "1")]
9233    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9234    /// Duration of an execution observation
9235    #[prost(message, optional, tag = "2")]
9236    pub duration: ::core::option::Option<::prost_types::Duration>,
9237}
9238#[non_exhaustive]
9239#[derive(Clone, PartialEq, ::prost::Message)]
9240pub struct ExecuteTransactionRequest {
9241    /// The transaction to execute.
9242    #[prost(message, optional, tag = "1")]
9243    pub transaction: ::core::option::Option<Transaction>,
9244    /// Set of `UserSignature`s authorizing the execution of the provided
9245    /// transaction.
9246    #[prost(message, repeated, tag = "2")]
9247    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9248    /// Mask specifying which fields to read.
9249    /// If no mask is specified, defaults to `effects.status,checkpoint`.
9250    #[prost(message, optional, tag = "3")]
9251    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9252}
9253/// Response message for `NodeService.ExecuteTransaction`.
9254#[non_exhaustive]
9255#[derive(Clone, PartialEq, ::prost::Message)]
9256pub struct ExecuteTransactionResponse {
9257    #[prost(message, optional, tag = "1")]
9258    pub transaction: ::core::option::Option<ExecutedTransaction>,
9259}
9260#[non_exhaustive]
9261#[derive(Clone, PartialEq, ::prost::Message)]
9262pub struct SimulateTransactionRequest {
9263    #[prost(message, optional, tag = "1")]
9264    pub transaction: ::core::option::Option<Transaction>,
9265    /// Mask specifying which fields to read.
9266    #[prost(message, optional, tag = "2")]
9267    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9268    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
9269    #[prost(
9270        enumeration = "simulate_transaction_request::TransactionChecks",
9271        optional,
9272        tag = "3"
9273    )]
9274    pub checks: ::core::option::Option<i32>,
9275    /// Perform gas selection based on a budget estimation and include the
9276    /// selected gas payment and budget in the response. If selection fails
9277    /// because the gas owner lacks enough SUI to cover the budget, the returned
9278    /// error carries a `google.rpc.ErrorInfo` with reason
9279    /// `INSUFFICIENT_GAS_BALANCE`, or `TRANSACTION_EXECUTION_FAILED` if the
9280    /// transaction also fails while estimating the budget (see `ErrorReason`).
9281    ///
9282    /// This option will be ignored if `checks` is `DISABLED`.
9283    #[prost(bool, optional, tag = "4")]
9284    pub do_gas_selection: ::core::option::Option<bool>,
9285}
9286/// Nested message and enum types in `SimulateTransactionRequest`.
9287pub mod simulate_transaction_request {
9288    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
9289    #[non_exhaustive]
9290    #[derive(
9291        Clone,
9292        Copy,
9293        Debug,
9294        PartialEq,
9295        Eq,
9296        Hash,
9297        PartialOrd,
9298        Ord,
9299        ::prost::Enumeration
9300    )]
9301    #[repr(i32)]
9302    pub enum TransactionChecks {
9303        Enabled = 0,
9304        Disabled = 1,
9305    }
9306    impl TransactionChecks {
9307        /// String value of the enum field names used in the ProtoBuf definition.
9308        ///
9309        /// The values are not transformed in any way and thus are considered stable
9310        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9311        pub fn as_str_name(&self) -> &'static str {
9312            match self {
9313                Self::Enabled => "ENABLED",
9314                Self::Disabled => "DISABLED",
9315            }
9316        }
9317        /// Creates an enum from field names used in the ProtoBuf definition.
9318        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9319            match value {
9320                "ENABLED" => Some(Self::Enabled),
9321                "DISABLED" => Some(Self::Disabled),
9322                _ => None,
9323            }
9324        }
9325    }
9326}
9327#[non_exhaustive]
9328#[derive(Clone, PartialEq, ::prost::Message)]
9329pub struct SimulateTransactionResponse {
9330    #[prost(message, optional, tag = "1")]
9331    pub transaction: ::core::option::Option<ExecutedTransaction>,
9332    #[prost(message, repeated, tag = "2")]
9333    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9334    /// A suggested gas price to use, that is above RGP, in order to provide a
9335    /// better chance of the transaction being included in the presence of
9336    /// congested objects.
9337    #[prost(uint64, optional, tag = "3")]
9338    pub suggested_gas_price: ::core::option::Option<u64>,
9339}
9340/// An intermediate result/output from the execution of a single command
9341#[non_exhaustive]
9342#[derive(Clone, PartialEq, ::prost::Message)]
9343pub struct CommandResult {
9344    #[prost(message, repeated, tag = "1")]
9345    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9346    #[prost(message, repeated, tag = "2")]
9347    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9348}
9349#[non_exhaustive]
9350#[derive(Clone, PartialEq, ::prost::Message)]
9351pub struct CommandOutput {
9352    #[prost(message, optional, tag = "1")]
9353    pub argument: ::core::option::Option<Argument>,
9354    #[prost(message, optional, tag = "2")]
9355    pub value: ::core::option::Option<Bcs>,
9356    /// JSON rendering of the output.
9357    #[prost(message, optional, boxed, tag = "3")]
9358    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9359}
9360/// Generated client implementations.
9361pub mod transaction_execution_service_client {
9362    #![allow(
9363        unused_variables,
9364        dead_code,
9365        missing_docs,
9366        clippy::wildcard_imports,
9367        clippy::let_unit_value,
9368    )]
9369    use tonic::codegen::*;
9370    use tonic::codegen::http::Uri;
9371    #[derive(Debug, Clone)]
9372    pub struct TransactionExecutionServiceClient<T> {
9373        inner: tonic::client::Grpc<T>,
9374    }
9375    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9376        /// Attempt to create a new client by connecting to a given endpoint.
9377        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9378        where
9379            D: TryInto<tonic::transport::Endpoint>,
9380            D::Error: Into<StdError>,
9381        {
9382            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9383            Ok(Self::new(conn))
9384        }
9385    }
9386    impl<T> TransactionExecutionServiceClient<T>
9387    where
9388        T: tonic::client::GrpcService<tonic::body::Body>,
9389        T::Error: Into<StdError>,
9390        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9391        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9392    {
9393        pub fn new(inner: T) -> Self {
9394            let inner = tonic::client::Grpc::new(inner);
9395            Self { inner }
9396        }
9397        pub fn with_origin(inner: T, origin: Uri) -> Self {
9398            let inner = tonic::client::Grpc::with_origin(inner, origin);
9399            Self { inner }
9400        }
9401        pub fn with_interceptor<F>(
9402            inner: T,
9403            interceptor: F,
9404        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9405        where
9406            F: tonic::service::Interceptor,
9407            T::ResponseBody: Default,
9408            T: tonic::codegen::Service<
9409                http::Request<tonic::body::Body>,
9410                Response = http::Response<
9411                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9412                >,
9413            >,
9414            <T as tonic::codegen::Service<
9415                http::Request<tonic::body::Body>,
9416            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9417        {
9418            TransactionExecutionServiceClient::new(
9419                InterceptedService::new(inner, interceptor),
9420            )
9421        }
9422        /// Compress requests with the given encoding.
9423        ///
9424        /// This requires the server to support it otherwise it might respond with an
9425        /// error.
9426        #[must_use]
9427        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9428            self.inner = self.inner.send_compressed(encoding);
9429            self
9430        }
9431        /// Enable decompressing responses.
9432        #[must_use]
9433        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9434            self.inner = self.inner.accept_compressed(encoding);
9435            self
9436        }
9437        /// Limits the maximum size of a decoded message.
9438        ///
9439        /// Default: `4MB`
9440        #[must_use]
9441        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9442            self.inner = self.inner.max_decoding_message_size(limit);
9443            self
9444        }
9445        /// Limits the maximum size of an encoded message.
9446        ///
9447        /// Default: `usize::MAX`
9448        #[must_use]
9449        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9450            self.inner = self.inner.max_encoding_message_size(limit);
9451            self
9452        }
9453        pub async fn execute_transaction(
9454            &mut self,
9455            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9456        ) -> std::result::Result<
9457            tonic::Response<super::ExecuteTransactionResponse>,
9458            tonic::Status,
9459        > {
9460            self.inner
9461                .ready()
9462                .await
9463                .map_err(|e| {
9464                    tonic::Status::unknown(
9465                        format!("Service was not ready: {}", e.into()),
9466                    )
9467                })?;
9468            let codec = tonic_prost::ProstCodec::default();
9469            let path = http::uri::PathAndQuery::from_static(
9470                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9471            );
9472            let mut req = request.into_request();
9473            req.extensions_mut()
9474                .insert(
9475                    GrpcMethod::new(
9476                        "sui.rpc.v2.TransactionExecutionService",
9477                        "ExecuteTransaction",
9478                    ),
9479                );
9480            self.inner.unary(req, path, codec).await
9481        }
9482        pub async fn simulate_transaction(
9483            &mut self,
9484            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9485        ) -> std::result::Result<
9486            tonic::Response<super::SimulateTransactionResponse>,
9487            tonic::Status,
9488        > {
9489            self.inner
9490                .ready()
9491                .await
9492                .map_err(|e| {
9493                    tonic::Status::unknown(
9494                        format!("Service was not ready: {}", e.into()),
9495                    )
9496                })?;
9497            let codec = tonic_prost::ProstCodec::default();
9498            let path = http::uri::PathAndQuery::from_static(
9499                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9500            );
9501            let mut req = request.into_request();
9502            req.extensions_mut()
9503                .insert(
9504                    GrpcMethod::new(
9505                        "sui.rpc.v2.TransactionExecutionService",
9506                        "SimulateTransaction",
9507                    ),
9508                );
9509            self.inner.unary(req, path, codec).await
9510        }
9511    }
9512}
9513/// Generated server implementations.
9514pub mod transaction_execution_service_server {
9515    #![allow(
9516        unused_variables,
9517        dead_code,
9518        missing_docs,
9519        clippy::wildcard_imports,
9520        clippy::let_unit_value,
9521    )]
9522    use tonic::codegen::*;
9523    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
9524    #[async_trait]
9525    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9526        async fn execute_transaction(
9527            &self,
9528            request: tonic::Request<super::ExecuteTransactionRequest>,
9529        ) -> std::result::Result<
9530            tonic::Response<super::ExecuteTransactionResponse>,
9531            tonic::Status,
9532        > {
9533            Err(tonic::Status::unimplemented("Not yet implemented"))
9534        }
9535        async fn simulate_transaction(
9536            &self,
9537            request: tonic::Request<super::SimulateTransactionRequest>,
9538        ) -> std::result::Result<
9539            tonic::Response<super::SimulateTransactionResponse>,
9540            tonic::Status,
9541        > {
9542            Err(tonic::Status::unimplemented("Not yet implemented"))
9543        }
9544    }
9545    #[derive(Debug)]
9546    pub struct TransactionExecutionServiceServer<T> {
9547        inner: Arc<T>,
9548        accept_compression_encodings: EnabledCompressionEncodings,
9549        send_compression_encodings: EnabledCompressionEncodings,
9550        max_decoding_message_size: Option<usize>,
9551        max_encoding_message_size: Option<usize>,
9552    }
9553    impl<T> TransactionExecutionServiceServer<T> {
9554        pub fn new(inner: T) -> Self {
9555            Self::from_arc(Arc::new(inner))
9556        }
9557        pub fn from_arc(inner: Arc<T>) -> Self {
9558            Self {
9559                inner,
9560                accept_compression_encodings: Default::default(),
9561                send_compression_encodings: Default::default(),
9562                max_decoding_message_size: None,
9563                max_encoding_message_size: None,
9564            }
9565        }
9566        pub fn with_interceptor<F>(
9567            inner: T,
9568            interceptor: F,
9569        ) -> InterceptedService<Self, F>
9570        where
9571            F: tonic::service::Interceptor,
9572        {
9573            InterceptedService::new(Self::new(inner), interceptor)
9574        }
9575        /// Enable decompressing requests with the given encoding.
9576        #[must_use]
9577        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9578            self.accept_compression_encodings.enable(encoding);
9579            self
9580        }
9581        /// Compress responses with the given encoding, if the client supports it.
9582        #[must_use]
9583        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9584            self.send_compression_encodings.enable(encoding);
9585            self
9586        }
9587        /// Limits the maximum size of a decoded message.
9588        ///
9589        /// Default: `4MB`
9590        #[must_use]
9591        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9592            self.max_decoding_message_size = Some(limit);
9593            self
9594        }
9595        /// Limits the maximum size of an encoded message.
9596        ///
9597        /// Default: `usize::MAX`
9598        #[must_use]
9599        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9600            self.max_encoding_message_size = Some(limit);
9601            self
9602        }
9603    }
9604    impl<T, B> tonic::codegen::Service<http::Request<B>>
9605    for TransactionExecutionServiceServer<T>
9606    where
9607        T: TransactionExecutionService,
9608        B: Body + std::marker::Send + 'static,
9609        B::Error: Into<StdError> + std::marker::Send + 'static,
9610    {
9611        type Response = http::Response<tonic::body::Body>;
9612        type Error = std::convert::Infallible;
9613        type Future = BoxFuture<Self::Response, Self::Error>;
9614        fn poll_ready(
9615            &mut self,
9616            _cx: &mut Context<'_>,
9617        ) -> Poll<std::result::Result<(), Self::Error>> {
9618            Poll::Ready(Ok(()))
9619        }
9620        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9621            match req.uri().path() {
9622                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9623                    #[allow(non_camel_case_types)]
9624                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9625                        pub Arc<T>,
9626                    );
9627                    impl<
9628                        T: TransactionExecutionService,
9629                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9630                    for ExecuteTransactionSvc<T> {
9631                        type Response = super::ExecuteTransactionResponse;
9632                        type Future = BoxFuture<
9633                            tonic::Response<Self::Response>,
9634                            tonic::Status,
9635                        >;
9636                        fn call(
9637                            &mut self,
9638                            request: tonic::Request<super::ExecuteTransactionRequest>,
9639                        ) -> Self::Future {
9640                            let inner = Arc::clone(&self.0);
9641                            let fut = async move {
9642                                <T as TransactionExecutionService>::execute_transaction(
9643                                        &inner,
9644                                        request,
9645                                    )
9646                                    .await
9647                            };
9648                            Box::pin(fut)
9649                        }
9650                    }
9651                    let accept_compression_encodings = self.accept_compression_encodings;
9652                    let send_compression_encodings = self.send_compression_encodings;
9653                    let max_decoding_message_size = self.max_decoding_message_size;
9654                    let max_encoding_message_size = self.max_encoding_message_size;
9655                    let inner = self.inner.clone();
9656                    let fut = async move {
9657                        let method = ExecuteTransactionSvc(inner);
9658                        let codec = tonic_prost::ProstCodec::default();
9659                        let mut grpc = tonic::server::Grpc::new(codec)
9660                            .apply_compression_config(
9661                                accept_compression_encodings,
9662                                send_compression_encodings,
9663                            )
9664                            .apply_max_message_size_config(
9665                                max_decoding_message_size,
9666                                max_encoding_message_size,
9667                            );
9668                        let res = grpc.unary(method, req).await;
9669                        Ok(res)
9670                    };
9671                    Box::pin(fut)
9672                }
9673                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9674                    #[allow(non_camel_case_types)]
9675                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
9676                        pub Arc<T>,
9677                    );
9678                    impl<
9679                        T: TransactionExecutionService,
9680                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
9681                    for SimulateTransactionSvc<T> {
9682                        type Response = super::SimulateTransactionResponse;
9683                        type Future = BoxFuture<
9684                            tonic::Response<Self::Response>,
9685                            tonic::Status,
9686                        >;
9687                        fn call(
9688                            &mut self,
9689                            request: tonic::Request<super::SimulateTransactionRequest>,
9690                        ) -> Self::Future {
9691                            let inner = Arc::clone(&self.0);
9692                            let fut = async move {
9693                                <T as TransactionExecutionService>::simulate_transaction(
9694                                        &inner,
9695                                        request,
9696                                    )
9697                                    .await
9698                            };
9699                            Box::pin(fut)
9700                        }
9701                    }
9702                    let accept_compression_encodings = self.accept_compression_encodings;
9703                    let send_compression_encodings = self.send_compression_encodings;
9704                    let max_decoding_message_size = self.max_decoding_message_size;
9705                    let max_encoding_message_size = self.max_encoding_message_size;
9706                    let inner = self.inner.clone();
9707                    let fut = async move {
9708                        let method = SimulateTransactionSvc(inner);
9709                        let codec = tonic_prost::ProstCodec::default();
9710                        let mut grpc = tonic::server::Grpc::new(codec)
9711                            .apply_compression_config(
9712                                accept_compression_encodings,
9713                                send_compression_encodings,
9714                            )
9715                            .apply_max_message_size_config(
9716                                max_decoding_message_size,
9717                                max_encoding_message_size,
9718                            );
9719                        let res = grpc.unary(method, req).await;
9720                        Ok(res)
9721                    };
9722                    Box::pin(fut)
9723                }
9724                _ => {
9725                    Box::pin(async move {
9726                        let mut response = http::Response::new(
9727                            tonic::body::Body::default(),
9728                        );
9729                        let headers = response.headers_mut();
9730                        headers
9731                            .insert(
9732                                tonic::Status::GRPC_STATUS,
9733                                (tonic::Code::Unimplemented as i32).into(),
9734                            );
9735                        headers
9736                            .insert(
9737                                http::header::CONTENT_TYPE,
9738                                tonic::metadata::GRPC_CONTENT_TYPE,
9739                            );
9740                        Ok(response)
9741                    })
9742                }
9743            }
9744        }
9745    }
9746    impl<T> Clone for TransactionExecutionServiceServer<T> {
9747        fn clone(&self) -> Self {
9748            let inner = self.inner.clone();
9749            Self {
9750                inner,
9751                accept_compression_encodings: self.accept_compression_encodings,
9752                send_compression_encodings: self.send_compression_encodings,
9753                max_decoding_message_size: self.max_decoding_message_size,
9754                max_encoding_message_size: self.max_encoding_message_size,
9755            }
9756        }
9757    }
9758    /// Generated gRPC service name
9759    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9760    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9761        const NAME: &'static str = SERVICE_NAME;
9762    }
9763}