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