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