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