Skip to main content

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

1// This file is @generated by prost-build.
2/// An argument to a programmable transaction command.
3#[non_exhaustive]
4#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5pub struct Argument {
6    #[prost(enumeration = "argument::ArgumentKind", optional, tag = "1")]
7    pub kind: ::core::option::Option<i32>,
8    /// Index of an input when `kind` is `INPUT`.
9    #[prost(uint32, optional, tag = "2")]
10    pub input: ::core::option::Option<u32>,
11    /// Index of a result when `kind` is `RESULT`.
12    #[prost(uint32, optional, tag = "3")]
13    pub result: ::core::option::Option<u32>,
14    /// Used to access a nested result when `kind` is `RESULT`.
15    #[prost(uint32, optional, tag = "4")]
16    pub subresult: ::core::option::Option<u32>,
17}
18/// Nested message and enum types in `Argument`.
19pub mod argument {
20    #[non_exhaustive]
21    #[derive(
22        Clone,
23        Copy,
24        Debug,
25        PartialEq,
26        Eq,
27        Hash,
28        PartialOrd,
29        Ord,
30        ::prost::Enumeration
31    )]
32    #[repr(i32)]
33    pub enum ArgumentKind {
34        Unknown = 0,
35        /// The gas coin.
36        Gas = 1,
37        /// One of the input objects or primitive values (from
38        /// `ProgrammableTransaction` inputs).
39        Input = 2,
40        /// The result of another command (from `ProgrammableTransaction` commands).
41        Result = 3,
42    }
43    impl ArgumentKind {
44        /// String value of the enum field names used in the ProtoBuf definition.
45        ///
46        /// The values are not transformed in any way and thus are considered stable
47        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
48        pub fn as_str_name(&self) -> &'static str {
49            match self {
50                Self::Unknown => "ARGUMENT_KIND_UNKNOWN",
51                Self::Gas => "GAS",
52                Self::Input => "INPUT",
53                Self::Result => "RESULT",
54            }
55        }
56        /// Creates an enum from field names used in the ProtoBuf definition.
57        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
58            match value {
59                "ARGUMENT_KIND_UNKNOWN" => Some(Self::Unknown),
60                "GAS" => Some(Self::Gas),
61                "INPUT" => Some(Self::Input),
62                "RESULT" => Some(Self::Result),
63                _ => None,
64            }
65        }
66    }
67}
68/// The delta, or change, in balance for an address for a particular `Coin` type.
69#[non_exhaustive]
70#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
71pub struct BalanceChange {
72    /// The account address that is affected by this balance change event.
73    #[prost(string, optional, tag = "1")]
74    pub address: ::core::option::Option<::prost::alloc::string::String>,
75    /// The `Coin` type of this balance change event.
76    #[prost(string, optional, tag = "2")]
77    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
78    /// The amount or change in balance.
79    #[prost(string, optional, tag = "3")]
80    pub amount: ::core::option::Option<::prost::alloc::string::String>,
81}
82/// `Bcs` contains an arbitrary type that is serialized using the
83/// [BCS](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/index.html#bcs>)
84/// format as well as a name that identifies the type of the serialized value.
85#[non_exhaustive]
86#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
87pub struct Bcs {
88    /// Name that identifies the type of the serialized value.
89    #[prost(string, optional, tag = "1")]
90    pub name: ::core::option::Option<::prost::alloc::string::String>,
91    /// Bytes of a BCS serialized value.
92    #[prost(bytes = "bytes", optional, tag = "2")]
93    pub value: ::core::option::Option<::prost::bytes::Bytes>,
94}
95#[non_exhaustive]
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct Checkpoint {
98    /// The height of this checkpoint.
99    #[prost(uint64, optional, tag = "1")]
100    pub sequence_number: ::core::option::Option<u64>,
101    /// The digest of this Checkpoint's CheckpointSummary.
102    #[prost(string, optional, tag = "2")]
103    pub digest: ::core::option::Option<::prost::alloc::string::String>,
104    /// The `CheckpointSummary` for this checkpoint.
105    #[prost(message, optional, tag = "3")]
106    pub summary: ::core::option::Option<CheckpointSummary>,
107    /// An aggregated quorum signature from the validator committee that
108    /// certified this checkpoint.
109    #[prost(message, optional, tag = "4")]
110    pub signature: ::core::option::Option<ValidatorAggregatedSignature>,
111    /// The `CheckpointContents` for this checkpoint.
112    #[prost(message, optional, tag = "5")]
113    pub contents: ::core::option::Option<CheckpointContents>,
114    /// List of transactions included in this checkpoint.
115    #[prost(message, repeated, tag = "6")]
116    pub transactions: ::prost::alloc::vec::Vec<ExecutedTransaction>,
117    /// Set of objects either referenced as inputs or produced as
118    /// outputs by transactions included in this checkpoint.
119    ///
120    /// In order to benefit from deduplication of objects that
121    /// appear in multiple transactions in this checkpoint, objects
122    /// will only be present here and the `transactions.objects`
123    /// field will not be populated.
124    #[prost(message, optional, tag = "7")]
125    pub objects: ::core::option::Option<ObjectSet>,
126}
127/// The committed to contents of a checkpoint.
128#[non_exhaustive]
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct CheckpointContents {
131    /// This CheckpointContents serialized as BCS.
132    #[prost(message, optional, tag = "1")]
133    pub bcs: ::core::option::Option<Bcs>,
134    /// The digest of this CheckpointContents.
135    #[prost(string, optional, tag = "2")]
136    pub digest: ::core::option::Option<::prost::alloc::string::String>,
137    /// Version of this CheckpointContents
138    #[prost(int32, optional, tag = "3")]
139    pub version: ::core::option::Option<i32>,
140    /// Set of transactions committed to in this checkpoint.
141    #[prost(message, repeated, tag = "4")]
142    pub transactions: ::prost::alloc::vec::Vec<CheckpointedTransactionInfo>,
143}
144/// Transaction information committed to in a checkpoint.
145#[non_exhaustive]
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct CheckpointedTransactionInfo {
148    /// Digest of the transaction.
149    #[prost(string, optional, tag = "1")]
150    pub transaction: ::core::option::Option<::prost::alloc::string::String>,
151    /// Digest of the effects.
152    #[prost(string, optional, tag = "2")]
153    pub effects: ::core::option::Option<::prost::alloc::string::String>,
154    /// Set of user signatures that authorized the transaction.
155    #[prost(message, repeated, tag = "3")]
156    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
157    /// The `AddressAliases` object version, if any, that was used to verify the
158    /// UserSignature at the same position in `signatures`.
159    ///
160    /// This field is present when CheckpointContents.version is >= 2.
161    #[prost(message, repeated, tag = "4")]
162    pub address_aliases_versions: ::prost::alloc::vec::Vec<AddressAliasesVersion>,
163}
164#[non_exhaustive]
165#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
166pub struct AddressAliasesVersion {
167    #[prost(uint64, optional, tag = "1")]
168    pub version: ::core::option::Option<u64>,
169}
170/// A header for a checkpoint on the Sui blockchain.
171///
172/// On the Sui network, checkpoints define the history of the blockchain. They are quite similar to
173/// the concept of blocks used by other blockchains like Bitcoin or Ethereum. The Sui blockchain,
174/// however, forms checkpoints after transaction execution has already happened to provide a
175/// certified history of the chain, instead of being formed before execution.
176///
177/// Checkpoints commit to a variety of state, including but not limited to:
178///
179/// * The hash of the previous checkpoint.
180/// * The set of transaction digests, their corresponding effects digests, as well as the set of
181///   user signatures that authorized its execution.
182/// * The objects produced by a transaction.
183/// * The set of live objects that make up the current state of the chain.
184/// * On epoch transitions, the next validator committee.
185///
186/// `CheckpointSummary`s themselves don't directly include all of the previous information but they
187/// are the top-level type by which all the information is committed to transitively via cryptographic
188/// hashes included in the summary. `CheckpointSummary`s are signed and certified by a quorum of
189/// the validator committee in a given epoch to allow verification of the chain's state.
190#[non_exhaustive]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct CheckpointSummary {
193    /// This CheckpointSummary serialized as BCS.
194    #[prost(message, optional, tag = "1")]
195    pub bcs: ::core::option::Option<Bcs>,
196    /// The digest of this CheckpointSummary.
197    #[prost(string, optional, tag = "2")]
198    pub digest: ::core::option::Option<::prost::alloc::string::String>,
199    /// Epoch that this checkpoint belongs to.
200    #[prost(uint64, optional, tag = "3")]
201    pub epoch: ::core::option::Option<u64>,
202    /// The height of this checkpoint.
203    #[prost(uint64, optional, tag = "4")]
204    pub sequence_number: ::core::option::Option<u64>,
205    /// Total number of transactions committed since genesis, including those in this
206    /// checkpoint.
207    #[prost(uint64, optional, tag = "5")]
208    pub total_network_transactions: ::core::option::Option<u64>,
209    /// The hash of the `CheckpointContents` for this checkpoint.
210    #[prost(string, optional, tag = "6")]
211    pub content_digest: ::core::option::Option<::prost::alloc::string::String>,
212    /// The hash of the previous `CheckpointSummary`.
213    ///
214    /// This will be `None` only for the first, or genesis, checkpoint.
215    #[prost(string, optional, tag = "7")]
216    pub previous_digest: ::core::option::Option<::prost::alloc::string::String>,
217    /// The running total gas costs of all transactions included in the current epoch so far
218    /// until this checkpoint.
219    #[prost(message, optional, tag = "8")]
220    pub epoch_rolling_gas_cost_summary: ::core::option::Option<GasCostSummary>,
221    /// Timestamp of the checkpoint - number of milliseconds from the Unix epoch
222    /// Checkpoint timestamps are monotonic, but not strongly monotonic - subsequent
223    /// checkpoints can have the same timestamp if they originate from the same underlining consensus commit.
224    #[prost(message, optional, tag = "9")]
225    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
226    /// Commitments to checkpoint-specific state.
227    #[prost(message, repeated, tag = "10")]
228    pub commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
229    /// Extra data only present in the final checkpoint of an epoch.
230    #[prost(message, optional, tag = "11")]
231    pub end_of_epoch_data: ::core::option::Option<EndOfEpochData>,
232    /// `CheckpointSummary` is not an evolvable structure - it must be readable by any version of
233    /// the code. Therefore, to allow extensions to be added to `CheckpointSummary`,
234    /// opaque data can be added to checkpoints, which can be deserialized based on the current
235    /// protocol version.
236    #[prost(bytes = "bytes", optional, tag = "12")]
237    pub version_specific_data: ::core::option::Option<::prost::bytes::Bytes>,
238}
239/// Data, which when included in a `CheckpointSummary`, signals the end of an `Epoch`.
240#[non_exhaustive]
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct EndOfEpochData {
243    /// The set of validators that will be in the `ValidatorCommittee` for the next epoch.
244    #[prost(message, repeated, tag = "1")]
245    pub next_epoch_committee: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
246    /// The protocol version that is in effect during the next epoch.
247    #[prost(uint64, optional, tag = "2")]
248    pub next_epoch_protocol_version: ::core::option::Option<u64>,
249    /// Commitments to epoch specific state (live object set)
250    #[prost(message, repeated, tag = "3")]
251    pub epoch_commitments: ::prost::alloc::vec::Vec<CheckpointCommitment>,
252}
253/// A commitment made by a checkpoint.
254#[non_exhaustive]
255#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
256pub struct CheckpointCommitment {
257    #[prost(
258        enumeration = "checkpoint_commitment::CheckpointCommitmentKind",
259        optional,
260        tag = "1"
261    )]
262    pub kind: ::core::option::Option<i32>,
263    #[prost(string, optional, tag = "2")]
264    pub digest: ::core::option::Option<::prost::alloc::string::String>,
265}
266/// Nested message and enum types in `CheckpointCommitment`.
267pub mod checkpoint_commitment {
268    #[non_exhaustive]
269    #[derive(
270        Clone,
271        Copy,
272        Debug,
273        PartialEq,
274        Eq,
275        Hash,
276        PartialOrd,
277        Ord,
278        ::prost::Enumeration
279    )]
280    #[repr(i32)]
281    pub enum CheckpointCommitmentKind {
282        Unknown = 0,
283        /// An elliptic curve multiset hash attesting to the set of objects that
284        /// comprise the live state of the Sui blockchain.
285        EcmhLiveObjectSet = 1,
286        /// Digest of the checkpoint artifacts.
287        CheckpointArtifacts = 2,
288    }
289    impl CheckpointCommitmentKind {
290        /// String value of the enum field names used in the ProtoBuf definition.
291        ///
292        /// The values are not transformed in any way and thus are considered stable
293        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
294        pub fn as_str_name(&self) -> &'static str {
295            match self {
296                Self::Unknown => "CHECKPOINT_COMMITMENT_KIND_UNKNOWN",
297                Self::EcmhLiveObjectSet => "ECMH_LIVE_OBJECT_SET",
298                Self::CheckpointArtifacts => "CHECKPOINT_ARTIFACTS",
299            }
300        }
301        /// Creates an enum from field names used in the ProtoBuf definition.
302        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
303            match value {
304                "CHECKPOINT_COMMITMENT_KIND_UNKNOWN" => Some(Self::Unknown),
305                "ECMH_LIVE_OBJECT_SET" => Some(Self::EcmhLiveObjectSet),
306                "CHECKPOINT_ARTIFACTS" => Some(Self::CheckpointArtifacts),
307                _ => None,
308            }
309        }
310    }
311}
312/// The effects of executing a transaction.
313#[non_exhaustive]
314#[derive(Clone, PartialEq, ::prost::Message)]
315pub struct TransactionEffects {
316    /// This TransactionEffects serialized as BCS.
317    #[prost(message, optional, tag = "1")]
318    pub bcs: ::core::option::Option<Bcs>,
319    /// The digest of this TransactionEffects.
320    #[prost(string, optional, tag = "2")]
321    pub digest: ::core::option::Option<::prost::alloc::string::String>,
322    /// Version of this TransactionEffects.
323    #[prost(int32, optional, tag = "3")]
324    pub version: ::core::option::Option<i32>,
325    /// The status of the execution.
326    #[prost(message, optional, tag = "4")]
327    pub status: ::core::option::Option<ExecutionStatus>,
328    /// The epoch when this transaction was executed.
329    #[prost(uint64, optional, tag = "5")]
330    pub epoch: ::core::option::Option<u64>,
331    /// The gas used by this transaction.
332    #[prost(message, optional, tag = "6")]
333    pub gas_used: ::core::option::Option<GasCostSummary>,
334    /// The transaction digest.
335    #[prost(string, optional, tag = "7")]
336    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
337    /// Information about the gas object. Also present in the `changed_objects` vector.
338    ///
339    /// System transactions that don't require gas will leave this as `None`.
340    #[prost(message, optional, tag = "8")]
341    pub gas_object: ::core::option::Option<ChangedObject>,
342    /// The digest of the events emitted during execution,
343    /// can be `None` if the transaction does not emit any event.
344    #[prost(string, optional, tag = "9")]
345    pub events_digest: ::core::option::Option<::prost::alloc::string::String>,
346    /// The set of transaction digests this transaction depends on.
347    #[prost(string, repeated, tag = "10")]
348    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
349    /// The version number of all the written objects (excluding packages) by this transaction.
350    #[prost(uint64, optional, tag = "11")]
351    pub lamport_version: ::core::option::Option<u64>,
352    /// Objects whose state are changed by this transaction.
353    #[prost(message, repeated, tag = "12")]
354    pub changed_objects: ::prost::alloc::vec::Vec<ChangedObject>,
355    /// Consensus objects that are not mutated in this transaction. Unlike owned objects,
356    /// read-only consensus objects' version are not committed in the transaction,
357    /// and in order for a node to catch up and execute it without consensus sequencing,
358    /// the version needs to be committed in the effects.
359    #[prost(message, repeated, tag = "13")]
360    pub unchanged_consensus_objects: ::prost::alloc::vec::Vec<UnchangedConsensusObject>,
361    /// Auxiliary data that are not protocol-critical, generated as part of the effects but are stored separately.
362    /// Storing it separately allows us to avoid bloating the effects with data that are not critical.
363    /// It also provides more flexibility on the format and type of the data.
364    #[prost(string, optional, tag = "14")]
365    pub auxiliary_data_digest: ::core::option::Option<::prost::alloc::string::String>,
366    #[prost(message, repeated, tag = "15")]
367    pub unchanged_loaded_runtime_objects: ::prost::alloc::vec::Vec<ObjectReference>,
368}
369/// Input/output state of an object that was changed during execution.
370#[non_exhaustive]
371#[derive(Clone, PartialEq, ::prost::Message)]
372pub struct ChangedObject {
373    /// ID of the object.
374    #[prost(string, optional, tag = "1")]
375    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
376    #[prost(enumeration = "changed_object::InputObjectState", optional, tag = "2")]
377    pub input_state: ::core::option::Option<i32>,
378    /// Version of the object before this transaction executed.
379    #[prost(uint64, optional, tag = "3")]
380    pub input_version: ::core::option::Option<u64>,
381    /// Digest of the object before this transaction executed.
382    #[prost(string, optional, tag = "4")]
383    pub input_digest: ::core::option::Option<::prost::alloc::string::String>,
384    /// Owner of the object before this transaction executed.
385    #[prost(message, optional, tag = "5")]
386    pub input_owner: ::core::option::Option<Owner>,
387    #[prost(enumeration = "changed_object::OutputObjectState", optional, tag = "6")]
388    pub output_state: ::core::option::Option<i32>,
389    /// Version of the object after this transaction executed.
390    #[prost(uint64, optional, tag = "7")]
391    pub output_version: ::core::option::Option<u64>,
392    /// Digest of the object after this transaction executed.
393    #[prost(string, optional, tag = "8")]
394    pub output_digest: ::core::option::Option<::prost::alloc::string::String>,
395    /// Owner of the object after this transaction executed.
396    #[prost(message, optional, tag = "9")]
397    pub output_owner: ::core::option::Option<Owner>,
398    /// The contents of the accumulator write when `output_state` is `OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE`
399    #[prost(message, optional, tag = "12")]
400    pub accumulator_write: ::core::option::Option<AccumulatorWrite>,
401    /// What happened to an `ObjectId` during execution.
402    #[prost(enumeration = "changed_object::IdOperation", optional, tag = "10")]
403    pub id_operation: ::core::option::Option<i32>,
404    /// Type information is not provided by the effects structure but is instead
405    /// provided by an indexing layer
406    #[prost(string, optional, tag = "11")]
407    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
408}
409/// Nested message and enum types in `ChangedObject`.
410pub mod changed_object {
411    #[non_exhaustive]
412    #[derive(
413        Clone,
414        Copy,
415        Debug,
416        PartialEq,
417        Eq,
418        Hash,
419        PartialOrd,
420        Ord,
421        ::prost::Enumeration
422    )]
423    #[repr(i32)]
424    pub enum InputObjectState {
425        Unknown = 0,
426        DoesNotExist = 1,
427        Exists = 2,
428    }
429    impl InputObjectState {
430        /// String value of the enum field names used in the ProtoBuf definition.
431        ///
432        /// The values are not transformed in any way and thus are considered stable
433        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
434        pub fn as_str_name(&self) -> &'static str {
435            match self {
436                Self::Unknown => "INPUT_OBJECT_STATE_UNKNOWN",
437                Self::DoesNotExist => "INPUT_OBJECT_STATE_DOES_NOT_EXIST",
438                Self::Exists => "INPUT_OBJECT_STATE_EXISTS",
439            }
440        }
441        /// Creates an enum from field names used in the ProtoBuf definition.
442        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
443            match value {
444                "INPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
445                "INPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
446                "INPUT_OBJECT_STATE_EXISTS" => Some(Self::Exists),
447                _ => None,
448            }
449        }
450    }
451    #[non_exhaustive]
452    #[derive(
453        Clone,
454        Copy,
455        Debug,
456        PartialEq,
457        Eq,
458        Hash,
459        PartialOrd,
460        Ord,
461        ::prost::Enumeration
462    )]
463    #[repr(i32)]
464    pub enum OutputObjectState {
465        Unknown = 0,
466        DoesNotExist = 1,
467        ObjectWrite = 2,
468        PackageWrite = 3,
469        AccumulatorWrite = 4,
470    }
471    impl OutputObjectState {
472        /// String value of the enum field names used in the ProtoBuf definition.
473        ///
474        /// The values are not transformed in any way and thus are considered stable
475        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
476        pub fn as_str_name(&self) -> &'static str {
477            match self {
478                Self::Unknown => "OUTPUT_OBJECT_STATE_UNKNOWN",
479                Self::DoesNotExist => "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST",
480                Self::ObjectWrite => "OUTPUT_OBJECT_STATE_OBJECT_WRITE",
481                Self::PackageWrite => "OUTPUT_OBJECT_STATE_PACKAGE_WRITE",
482                Self::AccumulatorWrite => "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE",
483            }
484        }
485        /// Creates an enum from field names used in the ProtoBuf definition.
486        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
487            match value {
488                "OUTPUT_OBJECT_STATE_UNKNOWN" => Some(Self::Unknown),
489                "OUTPUT_OBJECT_STATE_DOES_NOT_EXIST" => Some(Self::DoesNotExist),
490                "OUTPUT_OBJECT_STATE_OBJECT_WRITE" => Some(Self::ObjectWrite),
491                "OUTPUT_OBJECT_STATE_PACKAGE_WRITE" => Some(Self::PackageWrite),
492                "OUTPUT_OBJECT_STATE_ACCUMULATOR_WRITE" => Some(Self::AccumulatorWrite),
493                _ => None,
494            }
495        }
496    }
497    #[non_exhaustive]
498    #[derive(
499        Clone,
500        Copy,
501        Debug,
502        PartialEq,
503        Eq,
504        Hash,
505        PartialOrd,
506        Ord,
507        ::prost::Enumeration
508    )]
509    #[repr(i32)]
510    pub enum IdOperation {
511        Unknown = 0,
512        None = 1,
513        Created = 2,
514        Deleted = 3,
515    }
516    impl IdOperation {
517        /// String value of the enum field names used in the ProtoBuf definition.
518        ///
519        /// The values are not transformed in any way and thus are considered stable
520        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
521        pub fn as_str_name(&self) -> &'static str {
522            match self {
523                Self::Unknown => "ID_OPERATION_UNKNOWN",
524                Self::None => "NONE",
525                Self::Created => "CREATED",
526                Self::Deleted => "DELETED",
527            }
528        }
529        /// Creates an enum from field names used in the ProtoBuf definition.
530        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
531            match value {
532                "ID_OPERATION_UNKNOWN" => Some(Self::Unknown),
533                "NONE" => Some(Self::None),
534                "CREATED" => Some(Self::Created),
535                "DELETED" => Some(Self::Deleted),
536                _ => None,
537            }
538        }
539    }
540}
541/// An entry in an event digest accumulator value.
542#[non_exhaustive]
543#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
544pub struct EventDigestEntry {
545    /// Index of the event within its transaction.
546    #[prost(uint64, optional, tag = "1")]
547    pub event_index: ::core::option::Option<u64>,
548    /// Digest of the event.
549    #[prost(string, optional, tag = "2")]
550    pub digest: ::core::option::Option<::prost::alloc::string::String>,
551}
552#[non_exhaustive]
553#[derive(Clone, PartialEq, ::prost::Message)]
554pub struct AccumulatorWrite {
555    #[prost(string, optional, tag = "1")]
556    pub address: ::core::option::Option<::prost::alloc::string::String>,
557    #[prost(string, optional, tag = "2")]
558    pub accumulator_type: ::core::option::Option<::prost::alloc::string::String>,
559    #[prost(
560        enumeration = "accumulator_write::AccumulatorOperation",
561        optional,
562        tag = "3"
563    )]
564    pub operation: ::core::option::Option<i32>,
565    #[prost(enumeration = "accumulator_write::AccumulatorValue", optional, tag = "4")]
566    pub value_kind: ::core::option::Option<i32>,
567    /// Set when the accumulator value is an integer (value_kind = INTEGER).
568    #[prost(uint64, optional, tag = "5")]
569    pub integer_value: ::core::option::Option<u64>,
570    /// Set, with len 2, when the accumulator value is an integer tuple
571    /// (value_kind = INTEGER_TUPLE).
572    #[prost(uint64, repeated, tag = "6")]
573    pub integer_tuple: ::prost::alloc::vec::Vec<u64>,
574    /// Set when the accumulator value is an event digest list (value_kind = EVENT_DIGEST).
575    /// Contains a non-empty list of (event_index, digest) pairs representing
576    /// authenticated event stream entries within a transaction.
577    #[prost(message, repeated, tag = "7")]
578    pub event_digest_value: ::prost::alloc::vec::Vec<EventDigestEntry>,
579}
580/// Nested message and enum types in `AccumulatorWrite`.
581pub mod accumulator_write {
582    #[non_exhaustive]
583    #[derive(
584        Clone,
585        Copy,
586        Debug,
587        PartialEq,
588        Eq,
589        Hash,
590        PartialOrd,
591        Ord,
592        ::prost::Enumeration
593    )]
594    #[repr(i32)]
595    pub enum AccumulatorOperation {
596        Unknown = 0,
597        Merge = 1,
598        Split = 2,
599    }
600    impl AccumulatorOperation {
601        /// String value of the enum field names used in the ProtoBuf definition.
602        ///
603        /// The values are not transformed in any way and thus are considered stable
604        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
605        pub fn as_str_name(&self) -> &'static str {
606            match self {
607                Self::Unknown => "ACCUMULATOR_OPERATION_UNKNOWN",
608                Self::Merge => "MERGE",
609                Self::Split => "SPLIT",
610            }
611        }
612        /// Creates an enum from field names used in the ProtoBuf definition.
613        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
614            match value {
615                "ACCUMULATOR_OPERATION_UNKNOWN" => Some(Self::Unknown),
616                "MERGE" => Some(Self::Merge),
617                "SPLIT" => Some(Self::Split),
618                _ => None,
619            }
620        }
621    }
622    #[non_exhaustive]
623    #[derive(
624        Clone,
625        Copy,
626        Debug,
627        PartialEq,
628        Eq,
629        Hash,
630        PartialOrd,
631        Ord,
632        ::prost::Enumeration
633    )]
634    #[repr(i32)]
635    pub enum AccumulatorValue {
636        Unknown = 0,
637        Integer = 1,
638        IntegerTuple = 2,
639        EventDigest = 3,
640    }
641    impl AccumulatorValue {
642        /// String value of the enum field names used in the ProtoBuf definition.
643        ///
644        /// The values are not transformed in any way and thus are considered stable
645        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
646        pub fn as_str_name(&self) -> &'static str {
647            match self {
648                Self::Unknown => "ACCUMULATOR_VALUE_UNKNOWN",
649                Self::Integer => "INTEGER",
650                Self::IntegerTuple => "INTEGER_TUPLE",
651                Self::EventDigest => "EVENT_DIGEST",
652            }
653        }
654        /// Creates an enum from field names used in the ProtoBuf definition.
655        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
656            match value {
657                "ACCUMULATOR_VALUE_UNKNOWN" => Some(Self::Unknown),
658                "INTEGER" => Some(Self::Integer),
659                "INTEGER_TUPLE" => Some(Self::IntegerTuple),
660                "EVENT_DIGEST" => Some(Self::EventDigest),
661                _ => None,
662            }
663        }
664    }
665}
666/// A consensus object that wasn't changed during execution.
667#[non_exhaustive]
668#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
669pub struct UnchangedConsensusObject {
670    #[prost(
671        enumeration = "unchanged_consensus_object::UnchangedConsensusObjectKind",
672        optional,
673        tag = "1"
674    )]
675    pub kind: ::core::option::Option<i32>,
676    /// ObjectId of the consensus object.
677    #[prost(string, optional, tag = "2")]
678    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
679    /// Version of the consensus object.
680    #[prost(uint64, optional, tag = "3")]
681    pub version: ::core::option::Option<u64>,
682    /// Digest of the consensus object.
683    #[prost(string, optional, tag = "4")]
684    pub digest: ::core::option::Option<::prost::alloc::string::String>,
685    /// Type information is not provided by the effects structure but is instead
686    /// provided by an indexing layer
687    #[prost(string, optional, tag = "5")]
688    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
689}
690/// Nested message and enum types in `UnchangedConsensusObject`.
691pub mod unchanged_consensus_object {
692    #[non_exhaustive]
693    #[derive(
694        Clone,
695        Copy,
696        Debug,
697        PartialEq,
698        Eq,
699        Hash,
700        PartialOrd,
701        Ord,
702        ::prost::Enumeration
703    )]
704    #[repr(i32)]
705    pub enum UnchangedConsensusObjectKind {
706        Unknown = 0,
707        /// Read-only consensus object from the input.
708        ReadOnlyRoot = 1,
709        /// Objects with ended consensus streams that appear mutably/owned in the input.
710        MutateConsensusStreamEnded = 2,
711        /// Objects with ended consensus streams objects that appear as read-only in the input.
712        ReadConsensusStreamEnded = 3,
713        /// Consensus objects that were congested and resulted in this transaction being
714        /// canceled.
715        Canceled = 4,
716        /// Read of a per-epoch config object that should remain the same during an
717        /// epoch. This optionally will indicate the sequence number of the config
718        /// object at the start of the epoch.
719        PerEpochConfig = 5,
720    }
721    impl UnchangedConsensusObjectKind {
722        /// String value of the enum field names used in the ProtoBuf definition.
723        ///
724        /// The values are not transformed in any way and thus are considered stable
725        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
726        pub fn as_str_name(&self) -> &'static str {
727            match self {
728                Self::Unknown => "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN",
729                Self::ReadOnlyRoot => "READ_ONLY_ROOT",
730                Self::MutateConsensusStreamEnded => "MUTATE_CONSENSUS_STREAM_ENDED",
731                Self::ReadConsensusStreamEnded => "READ_CONSENSUS_STREAM_ENDED",
732                Self::Canceled => "CANCELED",
733                Self::PerEpochConfig => "PER_EPOCH_CONFIG",
734            }
735        }
736        /// Creates an enum from field names used in the ProtoBuf definition.
737        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
738            match value {
739                "UNCHANGED_CONSENSUS_OBJECT_KIND_UNKNOWN" => Some(Self::Unknown),
740                "READ_ONLY_ROOT" => Some(Self::ReadOnlyRoot),
741                "MUTATE_CONSENSUS_STREAM_ENDED" => Some(Self::MutateConsensusStreamEnded),
742                "READ_CONSENSUS_STREAM_ENDED" => Some(Self::ReadConsensusStreamEnded),
743                "CANCELED" => Some(Self::Canceled),
744                "PER_EPOCH_CONFIG" => Some(Self::PerEpochConfig),
745                _ => None,
746            }
747        }
748    }
749}
750#[non_exhaustive]
751#[derive(Clone, PartialEq, ::prost::Message)]
752pub struct Epoch {
753    #[prost(uint64, optional, tag = "1")]
754    pub epoch: ::core::option::Option<u64>,
755    /// The committee governing this epoch.
756    #[prost(message, optional, tag = "2")]
757    pub committee: ::core::option::Option<ValidatorCommittee>,
758    /// Snapshot of Sui's SystemState (`0x3::sui_system::SystemState`) at the
759    /// beginning of the epoch, for past epochs, or the current state for the
760    /// current epoch.
761    #[prost(message, optional, boxed, tag = "3")]
762    pub system_state: ::core::option::Option<::prost::alloc::boxed::Box<SystemState>>,
763    #[prost(uint64, optional, tag = "4")]
764    pub first_checkpoint: ::core::option::Option<u64>,
765    #[prost(uint64, optional, tag = "5")]
766    pub last_checkpoint: ::core::option::Option<u64>,
767    #[prost(message, optional, tag = "6")]
768    pub start: ::core::option::Option<::prost_types::Timestamp>,
769    #[prost(message, optional, tag = "7")]
770    pub end: ::core::option::Option<::prost_types::Timestamp>,
771    /// Reference gas price denominated in MIST
772    #[prost(uint64, optional, tag = "8")]
773    pub reference_gas_price: ::core::option::Option<u64>,
774    #[prost(message, optional, tag = "9")]
775    pub protocol_config: ::core::option::Option<ProtocolConfig>,
776}
777#[non_exhaustive]
778#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
779#[repr(i32)]
780pub enum ErrorReason {
781    Unknown = 0,
782    FieldInvalid = 1,
783    FieldMissing = 2,
784}
785impl ErrorReason {
786    /// String value of the enum field names used in the ProtoBuf definition.
787    ///
788    /// The values are not transformed in any way and thus are considered stable
789    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
790    pub fn as_str_name(&self) -> &'static str {
791        match self {
792            Self::Unknown => "ERROR_REASON_UNKNOWN",
793            Self::FieldInvalid => "FIELD_INVALID",
794            Self::FieldMissing => "FIELD_MISSING",
795        }
796    }
797    /// Creates an enum from field names used in the ProtoBuf definition.
798    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
799        match value {
800            "ERROR_REASON_UNKNOWN" => Some(Self::Unknown),
801            "FIELD_INVALID" => Some(Self::FieldInvalid),
802            "FIELD_MISSING" => Some(Self::FieldMissing),
803            _ => None,
804        }
805    }
806}
807/// Events emitted during the successful execution of a transaction.
808#[non_exhaustive]
809#[derive(Clone, PartialEq, ::prost::Message)]
810pub struct TransactionEvents {
811    /// This TransactionEvents serialized as BCS.
812    #[prost(message, optional, tag = "1")]
813    pub bcs: ::core::option::Option<Bcs>,
814    /// The digest of this TransactionEvents.
815    #[prost(string, optional, tag = "2")]
816    pub digest: ::core::option::Option<::prost::alloc::string::String>,
817    /// Set of events emitted by a transaction.
818    #[prost(message, repeated, tag = "3")]
819    pub events: ::prost::alloc::vec::Vec<Event>,
820}
821/// An event.
822#[non_exhaustive]
823#[derive(Clone, PartialEq, ::prost::Message)]
824pub struct Event {
825    /// Package ID of the top-level function invoked by a `MoveCall` command that triggered this
826    /// event to be emitted.
827    #[prost(string, optional, tag = "1")]
828    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
829    /// Module name of the top-level function invoked by a `MoveCall` command that triggered this
830    /// event to be emitted.
831    #[prost(string, optional, tag = "2")]
832    pub module: ::core::option::Option<::prost::alloc::string::String>,
833    /// Address of the account that sent the transaction where this event was emitted.
834    #[prost(string, optional, tag = "3")]
835    pub sender: ::core::option::Option<::prost::alloc::string::String>,
836    /// The type of the event emitted.
837    #[prost(string, optional, tag = "4")]
838    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
839    /// BCS serialized bytes of the event.
840    #[prost(message, optional, tag = "5")]
841    pub contents: ::core::option::Option<Bcs>,
842    /// JSON rendering of the event.
843    #[prost(message, optional, boxed, tag = "6")]
844    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
845    /// The sequence number of the checkpoint that includes the transaction
846    /// that emitted this event. Populated when the event is delivered on its
847    /// own (for example via `LedgerService.ListEvents`); left unset when the
848    /// event is carried inside its transaction's `events` list, where the
849    /// enclosing `ExecutedTransaction` already provides this context.
850    #[prost(uint64, optional, tag = "7")]
851    pub checkpoint: ::core::option::Option<u64>,
852    /// The digest of the transaction that emitted this event.
853    #[prost(string, optional, tag = "8")]
854    pub transaction_digest: ::core::option::Option<::prost::alloc::string::String>,
855    /// Zero-based position of the emitting transaction within its containing
856    /// checkpoint. For clients verifying authenticated event streams this
857    /// index is part of the BCS-encoded `EventCommitment` leaf used to
858    /// construct the per-checkpoint merkle root.
859    #[prost(uint64, optional, tag = "9")]
860    pub transaction_index: ::core::option::Option<u64>,
861    /// Zero-based index of this event within its transaction's event list.
862    #[prost(uint32, optional, tag = "10")]
863    pub event_index: ::core::option::Option<u32>,
864}
865#[non_exhaustive]
866#[derive(Clone, PartialEq, ::prost::Message)]
867pub struct ExecutedTransaction {
868    /// The digest of this Transaction.
869    #[prost(string, optional, tag = "1")]
870    pub digest: ::core::option::Option<::prost::alloc::string::String>,
871    /// The transaction itself.
872    #[prost(message, optional, tag = "2")]
873    pub transaction: ::core::option::Option<Transaction>,
874    /// List of user signatures that are used to authorize the
875    /// execution of this transaction.
876    #[prost(message, repeated, tag = "3")]
877    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
878    /// The `TransactionEffects` for this transaction.
879    #[prost(message, optional, tag = "4")]
880    pub effects: ::core::option::Option<TransactionEffects>,
881    /// The `TransactionEvents` for this transaction.
882    ///
883    /// This field might be empty, even if it was explicitly requested, if the
884    /// transaction didn't produce any events.
885    /// `sui.types.TransactionEffects.events_digest` is populated if the
886    /// transaction produced any events.
887    #[prost(message, optional, tag = "5")]
888    pub events: ::core::option::Option<TransactionEvents>,
889    /// The sequence number for the checkpoint that includes this transaction.
890    #[prost(uint64, optional, tag = "6")]
891    pub checkpoint: ::core::option::Option<u64>,
892    /// The Unix timestamp of the checkpoint that includes this transaction.
893    #[prost(message, optional, tag = "7")]
894    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
895    #[prost(message, repeated, tag = "8")]
896    pub balance_changes: ::prost::alloc::vec::Vec<BalanceChange>,
897    /// Set of objects either referenced as inputs or produced as
898    /// outputs from this Transaction.
899    #[prost(message, optional, tag = "9")]
900    pub objects: ::core::option::Option<ObjectSet>,
901    /// Zero-based position of this transaction within the checkpoint that
902    /// includes it.
903    #[prost(uint64, optional, tag = "10")]
904    pub transaction_index: ::core::option::Option<u64>,
905}
906/// The status of an executed transaction.
907#[non_exhaustive]
908#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
909pub struct ExecutionStatus {
910    /// Indicates if the transaction was successful or not.
911    #[prost(bool, optional, tag = "1")]
912    pub success: ::core::option::Option<bool>,
913    /// The error if `success` is false.
914    #[prost(message, optional, tag = "2")]
915    pub error: ::core::option::Option<ExecutionError>,
916}
917/// An error that can occur during the execution of a transaction.
918#[non_exhaustive]
919#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
920pub struct ExecutionError {
921    /// A human readable description of the error
922    #[prost(string, optional, tag = "1")]
923    pub description: ::core::option::Option<::prost::alloc::string::String>,
924    /// The command, if any, during which the error occurred.
925    #[prost(uint64, optional, tag = "2")]
926    pub command: ::core::option::Option<u64>,
927    #[prost(enumeration = "execution_error::ExecutionErrorKind", optional, tag = "3")]
928    pub kind: ::core::option::Option<i32>,
929    #[prost(
930        oneof = "execution_error::ErrorDetails",
931        tags = "4, 5, 6, 7, 8, 9, 10, 11, 12"
932    )]
933    pub error_details: ::core::option::Option<execution_error::ErrorDetails>,
934}
935/// Nested message and enum types in `ExecutionError`.
936pub mod execution_error {
937    #[non_exhaustive]
938    #[derive(
939        Clone,
940        Copy,
941        Debug,
942        PartialEq,
943        Eq,
944        Hash,
945        PartialOrd,
946        Ord,
947        ::prost::Enumeration
948    )]
949    #[repr(i32)]
950    pub enum ExecutionErrorKind {
951        Unknown = 0,
952        /// Insufficient gas.
953        InsufficientGas = 1,
954        /// Invalid `Gas` object.
955        InvalidGasObject = 2,
956        /// Invariant violation.
957        InvariantViolation = 3,
958        /// Attempted to use feature that is not supported yet.
959        FeatureNotYetSupported = 4,
960        /// Move object is larger than the maximum allowed size.
961        ObjectTooBig = 5,
962        /// Package is larger than the maximum allowed size.
963        PackageTooBig = 6,
964        /// Circular object ownership.
965        CircularObjectOwnership = 7,
966        /// Insufficient coin balance for requested operation.
967        InsufficientCoinBalance = 8,
968        /// Coin balance overflowed an u64.
969        CoinBalanceOverflow = 9,
970        /// Publish error, non-zero address.
971        /// The modules in the package must have their self-addresses set to zero.
972        PublishErrorNonZeroAddress = 10,
973        /// Sui Move bytecode verification error.
974        SuiMoveVerificationError = 11,
975        /// Error from a non-abort instruction.
976        /// Possible causes:
977        /// Arithmetic error, stack overflow, max value depth, or similar.
978        MovePrimitiveRuntimeError = 12,
979        /// Move runtime abort.
980        MoveAbort = 13,
981        /// Bytecode verification error.
982        VmVerificationOrDeserializationError = 14,
983        /// MoveVm invariant violation.
984        VmInvariantViolation = 15,
985        /// Function not found.
986        FunctionNotFound = 16,
987        /// Parity mismatch for Move function.
988        /// The number of arguments does not match the number of parameters.
989        ArityMismatch = 17,
990        /// Type parity mismatch for Move function.
991        /// Mismatch between the number of actual versus expected type arguments.
992        TypeArityMismatch = 18,
993        /// Non-entry function invoked. Move Call must start with an entry function.
994        NonEntryFunctionInvoked = 19,
995        /// Invalid command argument.
996        CommandArgumentError = 20,
997        /// Type argument error.
998        TypeArgumentError = 21,
999        /// Unused result without the drop ability.
1000        UnusedValueWithoutDrop = 22,
1001        /// Invalid public Move function signature.
1002        /// Unsupported return type for return value.
1003        InvalidPublicFunctionReturnType = 23,
1004        /// Invalid transfer object, object does not have public transfer.
1005        InvalidTransferObject = 24,
1006        /// Effects from the transaction are too large.
1007        EffectsTooLarge = 25,
1008        /// Publish or Upgrade is missing dependency.
1009        PublishUpgradeMissingDependency = 26,
1010        /// Publish or upgrade dependency downgrade.
1011        ///
1012        /// Indirect (transitive) dependency of published or upgraded package has been assigned an
1013        /// on-chain version that is less than the version required by one of the package's
1014        /// transitive dependencies.
1015        PublishUpgradeDependencyDowngrade = 27,
1016        /// Invalid package upgrade.
1017        PackageUpgradeError = 28,
1018        /// Indicates the transaction tried to write objects too large to storage.
1019        WrittenObjectsTooLarge = 29,
1020        /// Certificate is on the deny list.
1021        CertificateDenied = 30,
1022        /// Sui Move bytecode verification timed out.
1023        SuiMoveVerificationTimedout = 31,
1024        /// The requested consensus object operation is not allowed.
1025        ConsensusObjectOperationNotAllowed = 32,
1026        /// Requested consensus object has been deleted.
1027        InputObjectDeleted = 33,
1028        /// Certificate is canceled due to congestion on consensus objects.
1029        ExecutionCanceledDueToConsensusObjectCongestion = 34,
1030        /// Address is denied for this coin type.
1031        AddressDeniedForCoin = 35,
1032        /// Coin type is globally paused for use.
1033        CoinTypeGlobalPause = 36,
1034        /// Certificate is canceled because randomness could not be generated this epoch.
1035        ExecutionCanceledDueToRandomnessUnavailable = 37,
1036        /// Move vector element (passed to MakeMoveVec) with size {value_size} is larger
1037        /// than the maximum size {max_scaled_size}. Note that this maximum is scaled based on the
1038        /// type of the vector element.
1039        MoveVectorElemTooBig = 38,
1040        /// Move value (possibly an upgrade ticket or a dev-inspect value) with size {value_size}
1041        /// is larger than the maximum size  {max_scaled_size}. Note that this maximum is scaled based
1042        /// on the type of the value.
1043        MoveRawValueTooBig = 39,
1044        /// A valid linkage was unable to be determined for the transaction or one of its commands.
1045        InvalidLinkage = 40,
1046        /// Insufficient funds for transaction withdrawal
1047        InsufficientFundsForWithdraw = 41,
1048        /// An input object with non-exclusive write mutability was modified
1049        NonExclusiveWriteInputObjectModified = 42,
1050    }
1051    impl ExecutionErrorKind {
1052        /// String value of the enum field names used in the ProtoBuf definition.
1053        ///
1054        /// The values are not transformed in any way and thus are considered stable
1055        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1056        pub fn as_str_name(&self) -> &'static str {
1057            match self {
1058                Self::Unknown => "EXECUTION_ERROR_KIND_UNKNOWN",
1059                Self::InsufficientGas => "INSUFFICIENT_GAS",
1060                Self::InvalidGasObject => "INVALID_GAS_OBJECT",
1061                Self::InvariantViolation => "INVARIANT_VIOLATION",
1062                Self::FeatureNotYetSupported => "FEATURE_NOT_YET_SUPPORTED",
1063                Self::ObjectTooBig => "OBJECT_TOO_BIG",
1064                Self::PackageTooBig => "PACKAGE_TOO_BIG",
1065                Self::CircularObjectOwnership => "CIRCULAR_OBJECT_OWNERSHIP",
1066                Self::InsufficientCoinBalance => "INSUFFICIENT_COIN_BALANCE",
1067                Self::CoinBalanceOverflow => "COIN_BALANCE_OVERFLOW",
1068                Self::PublishErrorNonZeroAddress => "PUBLISH_ERROR_NON_ZERO_ADDRESS",
1069                Self::SuiMoveVerificationError => "SUI_MOVE_VERIFICATION_ERROR",
1070                Self::MovePrimitiveRuntimeError => "MOVE_PRIMITIVE_RUNTIME_ERROR",
1071                Self::MoveAbort => "MOVE_ABORT",
1072                Self::VmVerificationOrDeserializationError => {
1073                    "VM_VERIFICATION_OR_DESERIALIZATION_ERROR"
1074                }
1075                Self::VmInvariantViolation => "VM_INVARIANT_VIOLATION",
1076                Self::FunctionNotFound => "FUNCTION_NOT_FOUND",
1077                Self::ArityMismatch => "ARITY_MISMATCH",
1078                Self::TypeArityMismatch => "TYPE_ARITY_MISMATCH",
1079                Self::NonEntryFunctionInvoked => "NON_ENTRY_FUNCTION_INVOKED",
1080                Self::CommandArgumentError => "COMMAND_ARGUMENT_ERROR",
1081                Self::TypeArgumentError => "TYPE_ARGUMENT_ERROR",
1082                Self::UnusedValueWithoutDrop => "UNUSED_VALUE_WITHOUT_DROP",
1083                Self::InvalidPublicFunctionReturnType => {
1084                    "INVALID_PUBLIC_FUNCTION_RETURN_TYPE"
1085                }
1086                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1087                Self::EffectsTooLarge => "EFFECTS_TOO_LARGE",
1088                Self::PublishUpgradeMissingDependency => {
1089                    "PUBLISH_UPGRADE_MISSING_DEPENDENCY"
1090                }
1091                Self::PublishUpgradeDependencyDowngrade => {
1092                    "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE"
1093                }
1094                Self::PackageUpgradeError => "PACKAGE_UPGRADE_ERROR",
1095                Self::WrittenObjectsTooLarge => "WRITTEN_OBJECTS_TOO_LARGE",
1096                Self::CertificateDenied => "CERTIFICATE_DENIED",
1097                Self::SuiMoveVerificationTimedout => "SUI_MOVE_VERIFICATION_TIMEDOUT",
1098                Self::ConsensusObjectOperationNotAllowed => {
1099                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1100                }
1101                Self::InputObjectDeleted => "INPUT_OBJECT_DELETED",
1102                Self::ExecutionCanceledDueToConsensusObjectCongestion => {
1103                    "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION"
1104                }
1105                Self::AddressDeniedForCoin => "ADDRESS_DENIED_FOR_COIN",
1106                Self::CoinTypeGlobalPause => "COIN_TYPE_GLOBAL_PAUSE",
1107                Self::ExecutionCanceledDueToRandomnessUnavailable => {
1108                    "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE"
1109                }
1110                Self::MoveVectorElemTooBig => "MOVE_VECTOR_ELEM_TOO_BIG",
1111                Self::MoveRawValueTooBig => "MOVE_RAW_VALUE_TOO_BIG",
1112                Self::InvalidLinkage => "INVALID_LINKAGE",
1113                Self::InsufficientFundsForWithdraw => "INSUFFICIENT_FUNDS_FOR_WITHDRAW",
1114                Self::NonExclusiveWriteInputObjectModified => {
1115                    "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED"
1116                }
1117            }
1118        }
1119        /// Creates an enum from field names used in the ProtoBuf definition.
1120        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1121            match value {
1122                "EXECUTION_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1123                "INSUFFICIENT_GAS" => Some(Self::InsufficientGas),
1124                "INVALID_GAS_OBJECT" => Some(Self::InvalidGasObject),
1125                "INVARIANT_VIOLATION" => Some(Self::InvariantViolation),
1126                "FEATURE_NOT_YET_SUPPORTED" => Some(Self::FeatureNotYetSupported),
1127                "OBJECT_TOO_BIG" => Some(Self::ObjectTooBig),
1128                "PACKAGE_TOO_BIG" => Some(Self::PackageTooBig),
1129                "CIRCULAR_OBJECT_OWNERSHIP" => Some(Self::CircularObjectOwnership),
1130                "INSUFFICIENT_COIN_BALANCE" => Some(Self::InsufficientCoinBalance),
1131                "COIN_BALANCE_OVERFLOW" => Some(Self::CoinBalanceOverflow),
1132                "PUBLISH_ERROR_NON_ZERO_ADDRESS" => {
1133                    Some(Self::PublishErrorNonZeroAddress)
1134                }
1135                "SUI_MOVE_VERIFICATION_ERROR" => Some(Self::SuiMoveVerificationError),
1136                "MOVE_PRIMITIVE_RUNTIME_ERROR" => Some(Self::MovePrimitiveRuntimeError),
1137                "MOVE_ABORT" => Some(Self::MoveAbort),
1138                "VM_VERIFICATION_OR_DESERIALIZATION_ERROR" => {
1139                    Some(Self::VmVerificationOrDeserializationError)
1140                }
1141                "VM_INVARIANT_VIOLATION" => Some(Self::VmInvariantViolation),
1142                "FUNCTION_NOT_FOUND" => Some(Self::FunctionNotFound),
1143                "ARITY_MISMATCH" => Some(Self::ArityMismatch),
1144                "TYPE_ARITY_MISMATCH" => Some(Self::TypeArityMismatch),
1145                "NON_ENTRY_FUNCTION_INVOKED" => Some(Self::NonEntryFunctionInvoked),
1146                "COMMAND_ARGUMENT_ERROR" => Some(Self::CommandArgumentError),
1147                "TYPE_ARGUMENT_ERROR" => Some(Self::TypeArgumentError),
1148                "UNUSED_VALUE_WITHOUT_DROP" => Some(Self::UnusedValueWithoutDrop),
1149                "INVALID_PUBLIC_FUNCTION_RETURN_TYPE" => {
1150                    Some(Self::InvalidPublicFunctionReturnType)
1151                }
1152                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1153                "EFFECTS_TOO_LARGE" => Some(Self::EffectsTooLarge),
1154                "PUBLISH_UPGRADE_MISSING_DEPENDENCY" => {
1155                    Some(Self::PublishUpgradeMissingDependency)
1156                }
1157                "PUBLISH_UPGRADE_DEPENDENCY_DOWNGRADE" => {
1158                    Some(Self::PublishUpgradeDependencyDowngrade)
1159                }
1160                "PACKAGE_UPGRADE_ERROR" => Some(Self::PackageUpgradeError),
1161                "WRITTEN_OBJECTS_TOO_LARGE" => Some(Self::WrittenObjectsTooLarge),
1162                "CERTIFICATE_DENIED" => Some(Self::CertificateDenied),
1163                "SUI_MOVE_VERIFICATION_TIMEDOUT" => {
1164                    Some(Self::SuiMoveVerificationTimedout)
1165                }
1166                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1167                    Some(Self::ConsensusObjectOperationNotAllowed)
1168                }
1169                "INPUT_OBJECT_DELETED" => Some(Self::InputObjectDeleted),
1170                "EXECUTION_CANCELED_DUE_TO_CONSENSUS_OBJECT_CONGESTION" => {
1171                    Some(Self::ExecutionCanceledDueToConsensusObjectCongestion)
1172                }
1173                "ADDRESS_DENIED_FOR_COIN" => Some(Self::AddressDeniedForCoin),
1174                "COIN_TYPE_GLOBAL_PAUSE" => Some(Self::CoinTypeGlobalPause),
1175                "EXECUTION_CANCELED_DUE_TO_RANDOMNESS_UNAVAILABLE" => {
1176                    Some(Self::ExecutionCanceledDueToRandomnessUnavailable)
1177                }
1178                "MOVE_VECTOR_ELEM_TOO_BIG" => Some(Self::MoveVectorElemTooBig),
1179                "MOVE_RAW_VALUE_TOO_BIG" => Some(Self::MoveRawValueTooBig),
1180                "INVALID_LINKAGE" => Some(Self::InvalidLinkage),
1181                "INSUFFICIENT_FUNDS_FOR_WITHDRAW" => {
1182                    Some(Self::InsufficientFundsForWithdraw)
1183                }
1184                "NON_EXCLUSIVE_WRITE_INPUT_OBJECT_MODIFIED" => {
1185                    Some(Self::NonExclusiveWriteInputObjectModified)
1186                }
1187                _ => None,
1188            }
1189        }
1190    }
1191    #[non_exhaustive]
1192    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1193    pub enum ErrorDetails {
1194        #[prost(message, tag = "4")]
1195        Abort(super::MoveAbort),
1196        #[prost(message, tag = "5")]
1197        SizeError(super::SizeError),
1198        #[prost(message, tag = "6")]
1199        CommandArgumentError(super::CommandArgumentError),
1200        #[prost(message, tag = "7")]
1201        TypeArgumentError(super::TypeArgumentError),
1202        #[prost(message, tag = "8")]
1203        PackageUpgradeError(super::PackageUpgradeError),
1204        #[prost(message, tag = "9")]
1205        IndexError(super::IndexError),
1206        #[prost(string, tag = "10")]
1207        ObjectId(::prost::alloc::string::String),
1208        #[prost(message, tag = "11")]
1209        CoinDenyListError(super::CoinDenyListError),
1210        /// Set of objects that were congested, leading to the transaction's cancellation.
1211        #[prost(message, tag = "12")]
1212        CongestedObjects(super::CongestedObjects),
1213    }
1214}
1215#[non_exhaustive]
1216#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1217pub struct MoveAbort {
1218    #[prost(uint64, optional, tag = "1")]
1219    pub abort_code: ::core::option::Option<u64>,
1220    /// Location in Move where the error occurred.
1221    #[prost(message, optional, tag = "2")]
1222    pub location: ::core::option::Option<MoveLocation>,
1223    /// Extra error information if abort code is a "Clever Error"
1224    #[prost(message, optional, tag = "3")]
1225    pub clever_error: ::core::option::Option<CleverError>,
1226}
1227/// Location in Move bytecode where an error occurred.
1228#[non_exhaustive]
1229#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1230pub struct MoveLocation {
1231    /// The package ID.
1232    #[prost(string, optional, tag = "1")]
1233    pub package: ::core::option::Option<::prost::alloc::string::String>,
1234    /// The module name.
1235    #[prost(string, optional, tag = "2")]
1236    pub module: ::core::option::Option<::prost::alloc::string::String>,
1237    /// The function index.
1238    #[prost(uint32, optional, tag = "3")]
1239    pub function: ::core::option::Option<u32>,
1240    /// Offset of the instruction where the error occurred.
1241    #[prost(uint32, optional, tag = "4")]
1242    pub instruction: ::core::option::Option<u32>,
1243    /// The name of the function, if available.
1244    #[prost(string, optional, tag = "5")]
1245    pub function_name: ::core::option::Option<::prost::alloc::string::String>,
1246}
1247#[non_exhaustive]
1248#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1249pub struct CleverError {
1250    #[prost(uint64, optional, tag = "1")]
1251    pub error_code: ::core::option::Option<u64>,
1252    #[prost(uint64, optional, tag = "2")]
1253    pub line_number: ::core::option::Option<u64>,
1254    #[prost(string, optional, tag = "3")]
1255    pub constant_name: ::core::option::Option<::prost::alloc::string::String>,
1256    #[prost(string, optional, tag = "4")]
1257    pub constant_type: ::core::option::Option<::prost::alloc::string::String>,
1258    #[prost(oneof = "clever_error::Value", tags = "5, 6")]
1259    pub value: ::core::option::Option<clever_error::Value>,
1260}
1261/// Nested message and enum types in `CleverError`.
1262pub mod clever_error {
1263    #[non_exhaustive]
1264    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1265    pub enum Value {
1266        #[prost(string, tag = "5")]
1267        Rendered(::prost::alloc::string::String),
1268        #[prost(bytes, tag = "6")]
1269        Raw(::prost::bytes::Bytes),
1270    }
1271}
1272/// A size error.
1273#[non_exhaustive]
1274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1275pub struct SizeError {
1276    /// The offending size.
1277    #[prost(uint64, optional, tag = "1")]
1278    pub size: ::core::option::Option<u64>,
1279    /// The maximum allowable size.
1280    #[prost(uint64, optional, tag = "2")]
1281    pub max_size: ::core::option::Option<u64>,
1282}
1283#[non_exhaustive]
1284#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1285pub struct IndexError {
1286    /// Index of an input or result.
1287    #[prost(uint32, optional, tag = "1")]
1288    pub index: ::core::option::Option<u32>,
1289    /// Index of a subresult.
1290    #[prost(uint32, optional, tag = "2")]
1291    pub subresult: ::core::option::Option<u32>,
1292}
1293#[non_exhaustive]
1294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1295pub struct CoinDenyListError {
1296    /// Denied address.
1297    #[prost(string, optional, tag = "1")]
1298    pub address: ::core::option::Option<::prost::alloc::string::String>,
1299    /// Coin type.
1300    #[prost(string, optional, tag = "2")]
1301    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1302}
1303/// Set of objects that were congested, leading to the transaction's cancellation.
1304#[non_exhaustive]
1305#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1306pub struct CongestedObjects {
1307    #[prost(string, repeated, tag = "1")]
1308    pub objects: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1309}
1310/// An error with an argument to a command.
1311#[non_exhaustive]
1312#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1313pub struct CommandArgumentError {
1314    /// Position of the problematic argument.
1315    #[prost(uint32, optional, tag = "1")]
1316    pub argument: ::core::option::Option<u32>,
1317    #[prost(
1318        enumeration = "command_argument_error::CommandArgumentErrorKind",
1319        optional,
1320        tag = "2"
1321    )]
1322    pub kind: ::core::option::Option<i32>,
1323    #[prost(message, optional, tag = "3")]
1324    pub index_error: ::core::option::Option<IndexError>,
1325}
1326/// Nested message and enum types in `CommandArgumentError`.
1327pub mod command_argument_error {
1328    #[non_exhaustive]
1329    #[derive(
1330        Clone,
1331        Copy,
1332        Debug,
1333        PartialEq,
1334        Eq,
1335        Hash,
1336        PartialOrd,
1337        Ord,
1338        ::prost::Enumeration
1339    )]
1340    #[repr(i32)]
1341    pub enum CommandArgumentErrorKind {
1342        Unknown = 0,
1343        /// The type of the value does not match the expected type.
1344        TypeMismatch = 1,
1345        /// The argument cannot be deserialized into a value of the specified type.
1346        InvalidBcsBytes = 2,
1347        /// The argument cannot be instantiated from raw bytes.
1348        InvalidUsageOfPureArgument = 3,
1349        /// Invalid argument to private entry function.
1350        /// Private entry functions cannot take arguments from other Move functions.
1351        InvalidArgumentToPrivateEntryFunction = 4,
1352        /// Out of bounds access to input or results.
1353        ///
1354        /// `index` field will be set indicating the invalid index value.
1355        IndexOutOfBounds = 5,
1356        /// Out of bounds access to subresult.
1357        ///
1358        /// `index` and `subresult` fields will be set indicating the invalid index value.
1359        SecondaryIndexOutOfBounds = 6,
1360        /// Invalid usage of result.
1361        /// Expected a single result but found either no return value or multiple.
1362        /// `index` field will be set indicating the invalid index value.
1363        InvalidResultArity = 7,
1364        /// Invalid usage of gas coin.
1365        /// The gas coin can only be used by-value with a `TransferObject` command.
1366        InvalidGasCoinUsage = 8,
1367        /// Invalid usage of Move value.
1368        /// - Mutably borrowed values require unique usage.
1369        /// - Immutably borrowed values cannot be taken or borrowed mutably.
1370        /// - Taken values cannot be used again.
1371        InvalidValueUsage = 9,
1372        /// Immutable objects cannot be passed by-value.
1373        InvalidObjectByValue = 10,
1374        /// Immutable objects cannot be passed by mutable reference, `&mut`.
1375        InvalidObjectByMutRef = 11,
1376        /// Consensus object operations such as wrapping, freezing, or converting to owned are not
1377        /// allowed.
1378        ConsensusObjectOperationNotAllowed = 12,
1379        /// Invalid argument arity. Expected a single argument but found a result that expanded to
1380        /// multiple arguments.
1381        InvalidArgumentArity = 13,
1382        /// Object passed to TransferObject does not have public transfer, i.e. the `store` ability
1383        InvalidTransferObject = 14,
1384        /// First argument to MakeMoveVec is not an object. If no type is specified for MakeMoveVec,
1385        /// all arguments must be the same object type.
1386        InvalidMakeMoveVecNonObjectArgument = 15,
1387        /// Specified argument location does not have a value and cannot be used
1388        ArgumentWithoutValue = 16,
1389        /// Cannot move a borrowed value. The value's type does resulted in this argument usage being
1390        /// inferred as a move. This is likely due to the type not having the `copy` ability; although
1391        /// in rare cases, it could also be this is the last usage of a value without the `drop`
1392        /// ability.
1393        CannotMoveBorrowedValue = 17,
1394        /// Cannot write to an argument location that is still borrowed, and where that borrow is an
1395        /// extension of that reference. This is likely due to this argument being used in a Move call
1396        /// that returns a reference, and that reference is used in a later command.
1397        CannotWriteToExtendedReference = 18,
1398        /// The argument specified cannot be used as a reference argument in the Move call. Either the
1399        /// argument is a mutable reference and it conflicts with another argument to the call, or the
1400        /// argument is mutable and another reference extends it and will be used in a later command.
1401        InvalidReferenceArgument = 19,
1402        /// Invalid usage of TxContext in the function signature. TxContext can only be used by
1403        /// reference, `&TxContext` or `&mut TxContext`. If used mutably, it must be the only
1404        /// TxContext parameter, and TxContext can never be returned from a Move call.
1405        InvalidTxContext = 20,
1406    }
1407    impl CommandArgumentErrorKind {
1408        /// String value of the enum field names used in the ProtoBuf definition.
1409        ///
1410        /// The values are not transformed in any way and thus are considered stable
1411        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1412        pub fn as_str_name(&self) -> &'static str {
1413            match self {
1414                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1415                Self::TypeMismatch => "TYPE_MISMATCH",
1416                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1417                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1418                Self::InvalidArgumentToPrivateEntryFunction => {
1419                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1420                }
1421                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1422                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1423                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1424                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1425                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1426                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1427                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1428                Self::ConsensusObjectOperationNotAllowed => {
1429                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1430                }
1431                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1432                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1433                Self::InvalidMakeMoveVecNonObjectArgument => {
1434                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1435                }
1436                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1437                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1438                Self::CannotWriteToExtendedReference => {
1439                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1440                }
1441                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1442                Self::InvalidTxContext => "INVALID_TX_CONTEXT",
1443            }
1444        }
1445        /// Creates an enum from field names used in the ProtoBuf definition.
1446        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1447            match value {
1448                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1449                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1450                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1451                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1452                    Some(Self::InvalidUsageOfPureArgument)
1453                }
1454                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1455                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1456                }
1457                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1458                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1459                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1460                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1461                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1462                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1463                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1464                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1465                    Some(Self::ConsensusObjectOperationNotAllowed)
1466                }
1467                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1468                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1469                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1470                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1471                }
1472                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1473                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1474                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1475                    Some(Self::CannotWriteToExtendedReference)
1476                }
1477                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1478                "INVALID_TX_CONTEXT" => Some(Self::InvalidTxContext),
1479                _ => None,
1480            }
1481        }
1482    }
1483}
1484/// An error with upgrading a package.
1485#[non_exhaustive]
1486#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1487pub struct PackageUpgradeError {
1488    #[prost(
1489        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1490        optional,
1491        tag = "1"
1492    )]
1493    pub kind: ::core::option::Option<i32>,
1494    /// The Package Id.
1495    #[prost(string, optional, tag = "2")]
1496    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1497    /// A digest.
1498    #[prost(string, optional, tag = "3")]
1499    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1500    /// The policy.
1501    #[prost(uint32, optional, tag = "4")]
1502    pub policy: ::core::option::Option<u32>,
1503    /// The ticket Id.
1504    #[prost(string, optional, tag = "5")]
1505    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1506}
1507/// Nested message and enum types in `PackageUpgradeError`.
1508pub mod package_upgrade_error {
1509    #[non_exhaustive]
1510    #[derive(
1511        Clone,
1512        Copy,
1513        Debug,
1514        PartialEq,
1515        Eq,
1516        Hash,
1517        PartialOrd,
1518        Ord,
1519        ::prost::Enumeration
1520    )]
1521    #[repr(i32)]
1522    pub enum PackageUpgradeErrorKind {
1523        Unknown = 0,
1524        /// Unable to fetch package.
1525        UnableToFetchPackage = 1,
1526        /// Object is not a package.
1527        NotAPackage = 2,
1528        /// Package upgrade is incompatible with previous version.
1529        IncompatibleUpgrade = 3,
1530        /// Digest in upgrade ticket and computed digest differ.
1531        DigestDoesNotMatch = 4,
1532        /// Upgrade policy is not valid.
1533        UnknownUpgradePolicy = 5,
1534        /// Package ID does not match `PackageId` in upgrade ticket.
1535        PackageIdDoesNotMatch = 6,
1536    }
1537    impl PackageUpgradeErrorKind {
1538        /// String value of the enum field names used in the ProtoBuf definition.
1539        ///
1540        /// The values are not transformed in any way and thus are considered stable
1541        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1542        pub fn as_str_name(&self) -> &'static str {
1543            match self {
1544                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1545                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1546                Self::NotAPackage => "NOT_A_PACKAGE",
1547                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1548                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1549                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1550                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1551            }
1552        }
1553        /// Creates an enum from field names used in the ProtoBuf definition.
1554        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1555            match value {
1556                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1557                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1558                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1559                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1560                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1561                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1562                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1563                _ => None,
1564            }
1565        }
1566    }
1567}
1568/// Type argument error.
1569#[non_exhaustive]
1570#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1571pub struct TypeArgumentError {
1572    /// Index of the problematic type argument.
1573    #[prost(uint32, optional, tag = "1")]
1574    pub type_argument: ::core::option::Option<u32>,
1575    #[prost(
1576        enumeration = "type_argument_error::TypeArgumentErrorKind",
1577        optional,
1578        tag = "2"
1579    )]
1580    pub kind: ::core::option::Option<i32>,
1581}
1582/// Nested message and enum types in `TypeArgumentError`.
1583pub mod type_argument_error {
1584    #[non_exhaustive]
1585    #[derive(
1586        Clone,
1587        Copy,
1588        Debug,
1589        PartialEq,
1590        Eq,
1591        Hash,
1592        PartialOrd,
1593        Ord,
1594        ::prost::Enumeration
1595    )]
1596    #[repr(i32)]
1597    pub enum TypeArgumentErrorKind {
1598        Unknown = 0,
1599        /// A type was not found in the module specified.
1600        TypeNotFound = 1,
1601        /// A type provided did not match the specified constraint.
1602        ConstraintNotSatisfied = 2,
1603    }
1604    impl TypeArgumentErrorKind {
1605        /// String value of the enum field names used in the ProtoBuf definition.
1606        ///
1607        /// The values are not transformed in any way and thus are considered stable
1608        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1609        pub fn as_str_name(&self) -> &'static str {
1610            match self {
1611                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1612                Self::TypeNotFound => "TYPE_NOT_FOUND",
1613                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1614            }
1615        }
1616        /// Creates an enum from field names used in the ProtoBuf definition.
1617        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1618            match value {
1619                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1620                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1621                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1622                _ => None,
1623            }
1624        }
1625    }
1626}
1627/// DNF filter for transactions: any term may match, and each term is an AND
1628/// of signed literals.
1629/// An absent filter matches everything. A present filter must have at least one
1630/// term.
1631#[derive(Eq, Hash)]
1632#[non_exhaustive]
1633#[derive(Clone, PartialEq, ::prost::Message)]
1634pub struct TransactionFilter {
1635    /// Terms are ORed together.
1636    #[prost(message, repeated, tag = "1")]
1637    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1638}
1639/// One conjunction in a transaction DNF filter.
1640#[derive(Eq, Hash)]
1641#[non_exhaustive]
1642#[derive(Clone, PartialEq, ::prost::Message)]
1643pub struct TransactionTerm {
1644    /// Literals are ANDed together.
1645    #[prost(message, repeated, tag = "1")]
1646    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1647}
1648/// One signed transaction predicate literal: a predicate, optionally negated.
1649#[non_exhaustive]
1650#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1651pub struct TransactionLiteral {
1652    /// When true, the literal matches transactions that the predicate does *not*
1653    /// match.
1654    #[prost(bool, tag = "1")]
1655    pub negated: bool,
1656    /// The transaction-index predicate to match.
1657    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1658    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1659}
1660/// Nested message and enum types in `TransactionLiteral`.
1661pub mod transaction_literal {
1662    /// The transaction-index predicate to match.
1663    #[non_exhaustive]
1664    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1665    pub enum Predicate {
1666        /// Match transactions sent by the specified address.
1667        #[prost(message, tag = "2")]
1668        Sender(super::SenderFilter),
1669        /// Match transactions where the specified address's state moved as a side
1670        /// effect: it owns an object after the txn, owned an object before the
1671        /// txn that was mutated/transferred away/deleted/wrapped, or its
1672        /// address-balance changed via an accumulator event.
1673        #[prost(message, tag = "3")]
1674        AffectedAddress(super::AffectedAddressFilter),
1675        /// Match transactions whose effects include a change for the specified
1676        /// object.
1677        #[prost(message, tag = "4")]
1678        AffectedObject(super::AffectedObjectFilter),
1679        /// Match transactions that made a Move call matching the specified filter.
1680        #[prost(message, tag = "5")]
1681        MoveCall(super::MoveCallFilter),
1682        /// Match transactions that emitted an event whose package/module fields
1683        /// match the specified filter.
1684        #[prost(message, tag = "6")]
1685        EmitModule(super::EmitModuleFilter),
1686        /// Match transactions that emitted an event with a type matching the
1687        /// specified filter.
1688        #[prost(message, tag = "7")]
1689        EventType(super::EventTypeFilter),
1690        /// Match transactions that wrote to the specified authenticated event
1691        /// stream head.
1692        #[prost(message, tag = "8")]
1693        EventStreamHead(super::EventStreamHeadFilter),
1694        /// Match transactions that wrote a Move package — a first publish or an
1695        /// upgrade, of any package.
1696        #[prost(message, tag = "9")]
1697        PackageWrite(super::PackageWriteFilter),
1698    }
1699}
1700/// DNF filter for events: any term may match, and each term is an AND of
1701/// signed literals. Sender predicates match all events from matching
1702/// transactions; emit-module, event-type, and event-stream-head predicates match
1703/// individual event-space dimensions. An absent filter matches everything. A
1704/// present filter must have at least one term.
1705#[non_exhaustive]
1706#[derive(Clone, PartialEq, ::prost::Message)]
1707pub struct EventFilter {
1708    /// Terms are ORed together.
1709    #[prost(message, repeated, tag = "1")]
1710    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1711}
1712/// One conjunction in an event DNF filter.
1713#[non_exhaustive]
1714#[derive(Clone, PartialEq, ::prost::Message)]
1715pub struct EventTerm {
1716    /// Literals are ANDed together.
1717    #[prost(message, repeated, tag = "1")]
1718    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1719}
1720/// One signed event predicate literal: a predicate, optionally negated.
1721#[non_exhaustive]
1722#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1723pub struct EventLiteral {
1724    /// When true, the literal matches events that the predicate does *not* match.
1725    #[prost(bool, tag = "1")]
1726    pub negated: bool,
1727    /// The event-index predicate to match.
1728    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1729    pub predicate: ::core::option::Option<event_literal::Predicate>,
1730}
1731/// Nested message and enum types in `EventLiteral`.
1732pub mod event_literal {
1733    /// The event-index predicate to match.
1734    #[non_exhaustive]
1735    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1736    pub enum Predicate {
1737        /// Match events from transactions sent by the specified address.
1738        #[prost(message, tag = "2")]
1739        Sender(super::SenderFilter),
1740        /// Match events whose package/module fields match the specified filter.
1741        #[prost(message, tag = "3")]
1742        EmitModule(super::EmitModuleFilter),
1743        /// Match events whose type matches the specified filter.
1744        #[prost(message, tag = "4")]
1745        EventType(super::EventTypeFilter),
1746        /// Match events committed to the specified authenticated event stream head.
1747        #[prost(message, tag = "5")]
1748        EventStreamHead(super::EventStreamHeadFilter),
1749    }
1750}
1751/// Match by transaction sender address.
1752#[non_exhaustive]
1753#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1754pub struct SenderFilter {
1755    /// The sender address (hex-encoded).
1756    #[prost(string, optional, tag = "1")]
1757    pub address: ::core::option::Option<::prost::alloc::string::String>,
1758}
1759/// Match by any address whose state moved as a side effect of the
1760/// transaction: object ownership changes (in either direction), prior
1761/// owners of removed/wrapped objects, and address-balance changes via
1762/// accumulator events.
1763#[non_exhaustive]
1764#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1765pub struct AffectedAddressFilter {
1766    /// The affected address (hex-encoded).
1767    #[prost(string, optional, tag = "1")]
1768    pub address: ::core::option::Option<::prost::alloc::string::String>,
1769}
1770/// Match by changed object ID.
1771#[non_exhaustive]
1772#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1773pub struct AffectedObjectFilter {
1774    /// The changed object ID (hex-encoded).
1775    #[prost(string, optional, tag = "1")]
1776    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1777}
1778/// Match by Move function call, specified as a `::`-delimited Move path.
1779///
1780/// Specificity levels:
1781/// "0xpkg"                        -> matches any call in the package
1782/// "0xpkg::module"                -> matches any call in the module
1783/// "0xpkg::module::function"      -> matches calls to the exact function
1784#[non_exhaustive]
1785#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1786pub struct MoveCallFilter {
1787    /// Required. Move path of the form `package\[::module[::function]\]`.
1788    #[prost(string, optional, tag = "1")]
1789    pub function: ::core::option::Option<::prost::alloc::string::String>,
1790}
1791/// Match by an event's package/module fields, specified as a `::`-delimited
1792/// Move path. These identify the top-level Move call that triggered the event.
1793///
1794/// Specificity levels:
1795/// "0xpkg"               -> matches events with this package_id
1796/// "0xpkg::module"       -> matches events with this package_id and module
1797#[non_exhaustive]
1798#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1799pub struct EmitModuleFilter {
1800    /// Required. Move path of the form `package\[::module\]`.
1801    #[prost(string, optional, tag = "1")]
1802    pub module: ::core::option::Option<::prost::alloc::string::String>,
1803}
1804/// Match by event struct type, specified as a Move type string.
1805///
1806/// Specificity levels:
1807/// "0xaddr"                              -> matches events whose type is defined at this address
1808/// "0xaddr::module"                      -> matches events whose type is in this module
1809/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
1810/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
1811#[non_exhaustive]
1812#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1813pub struct EventTypeFilter {
1814    /// Required. Move type string of the form
1815    /// `address\[::module[::Name[<type_params>]\]]`.
1816    #[prost(string, optional, tag = "1")]
1817    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1818}
1819/// Match by authenticated event stream head.
1820#[non_exhaustive]
1821#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1822pub struct EventStreamHeadFilter {
1823    /// The stream id address (hex-encoded).
1824    #[prost(string, optional, tag = "1")]
1825    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1826}
1827/// Match transactions that wrote a Move package.
1828#[non_exhaustive]
1829#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1830pub struct PackageWriteFilter {}
1831/// Summary of gas charges.
1832#[non_exhaustive]
1833#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1834pub struct GasCostSummary {
1835    /// Cost of computation/execution.
1836    #[prost(uint64, optional, tag = "1")]
1837    pub computation_cost: ::core::option::Option<u64>,
1838    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1839    #[prost(uint64, optional, tag = "2")]
1840    pub storage_cost: ::core::option::Option<u64>,
1841    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1842    /// transaction.
1843    #[prost(uint64, optional, tag = "3")]
1844    pub storage_rebate: ::core::option::Option<u64>,
1845    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1846    #[prost(uint64, optional, tag = "4")]
1847    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1848}
1849/// An input to a user transaction.
1850#[non_exhaustive]
1851#[derive(Clone, PartialEq, ::prost::Message)]
1852pub struct Input {
1853    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1854    pub kind: ::core::option::Option<i32>,
1855    /// A move value serialized as BCS.
1856    ///
1857    /// For normal operations this is required to be a move primitive type and not contain structs
1858    /// or objects.
1859    #[prost(bytes = "bytes", optional, tag = "2")]
1860    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1861    /// `ObjectId` of the object input.
1862    #[prost(string, optional, tag = "3")]
1863    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1864    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1865    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1866    /// object when it was shared
1867    #[prost(uint64, optional, tag = "4")]
1868    pub version: ::core::option::Option<u64>,
1869    /// The digest of this object.
1870    #[prost(string, optional, tag = "5")]
1871    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1872    /// Controls whether the caller asks for a mutable reference to the shared
1873    /// object.
1874    #[prost(bool, optional, tag = "6")]
1875    pub mutable: ::core::option::Option<bool>,
1876    /// NOTE: For backwards compatibility purposes the addition of the new
1877    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1878    /// The old `mutable` field will continue to be populated and respected as an
1879    /// input for the time being.
1880    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1881    pub mutability: ::core::option::Option<i32>,
1882    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1883    #[prost(message, optional, tag = "8")]
1884    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1885    /// A literal value
1886    ///
1887    /// INPUT ONLY
1888    #[prost(message, optional, boxed, tag = "1000")]
1889    pub literal: ::core::option::Option<
1890        ::prost::alloc::boxed::Box<::prost_types::Value>,
1891    >,
1892}
1893/// Nested message and enum types in `Input`.
1894pub mod input {
1895    #[non_exhaustive]
1896    #[derive(
1897        Clone,
1898        Copy,
1899        Debug,
1900        PartialEq,
1901        Eq,
1902        Hash,
1903        PartialOrd,
1904        Ord,
1905        ::prost::Enumeration
1906    )]
1907    #[repr(i32)]
1908    pub enum InputKind {
1909        Unknown = 0,
1910        /// A move value serialized as BCS.
1911        Pure = 1,
1912        /// A Move object that is either immutable or address owned.
1913        ImmutableOrOwned = 2,
1914        /// A Move object whose owner is "Shared".
1915        Shared = 3,
1916        /// A Move object that is attempted to be received in this transaction.
1917        Receiving = 4,
1918        /// Reservation to withdraw balance from a funds accumulator
1919        FundsWithdrawal = 5,
1920    }
1921    impl InputKind {
1922        /// String value of the enum field names used in the ProtoBuf definition.
1923        ///
1924        /// The values are not transformed in any way and thus are considered stable
1925        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1926        pub fn as_str_name(&self) -> &'static str {
1927            match self {
1928                Self::Unknown => "INPUT_KIND_UNKNOWN",
1929                Self::Pure => "PURE",
1930                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1931                Self::Shared => "SHARED",
1932                Self::Receiving => "RECEIVING",
1933                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1934            }
1935        }
1936        /// Creates an enum from field names used in the ProtoBuf definition.
1937        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1938            match value {
1939                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1940                "PURE" => Some(Self::Pure),
1941                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1942                "SHARED" => Some(Self::Shared),
1943                "RECEIVING" => Some(Self::Receiving),
1944                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1945                _ => None,
1946            }
1947        }
1948    }
1949    #[non_exhaustive]
1950    #[derive(
1951        Clone,
1952        Copy,
1953        Debug,
1954        PartialEq,
1955        Eq,
1956        Hash,
1957        PartialOrd,
1958        Ord,
1959        ::prost::Enumeration
1960    )]
1961    #[repr(i32)]
1962    pub enum Mutability {
1963        Unknown = 0,
1964        Immutable = 1,
1965        Mutable = 2,
1966        /// Non-exclusive write is used to allow multiple transactions to
1967        /// simultaneously add disjoint dynamic fields to an object.
1968        /// (Currently only used by settlement transactions).
1969        NonExclusiveWrite = 3,
1970    }
1971    impl Mutability {
1972        /// String value of the enum field names used in the ProtoBuf definition.
1973        ///
1974        /// The values are not transformed in any way and thus are considered stable
1975        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1976        pub fn as_str_name(&self) -> &'static str {
1977            match self {
1978                Self::Unknown => "MUTABILITY_UNKNOWN",
1979                Self::Immutable => "IMMUTABLE",
1980                Self::Mutable => "MUTABLE",
1981                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1982            }
1983        }
1984        /// Creates an enum from field names used in the ProtoBuf definition.
1985        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1986            match value {
1987                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1988                "IMMUTABLE" => Some(Self::Immutable),
1989                "MUTABLE" => Some(Self::Mutable),
1990                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1991                _ => None,
1992            }
1993        }
1994    }
1995}
1996#[non_exhaustive]
1997#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1998pub struct FundsWithdrawal {
1999    #[prost(uint64, optional, tag = "1")]
2000    pub amount: ::core::option::Option<u64>,
2001    #[prost(string, optional, tag = "2")]
2002    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
2003    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
2004    pub source: ::core::option::Option<i32>,
2005    /// The address whose balance is debited if `source` is `SENDER_ALLOWANCE`.
2006    #[prost(string, optional, tag = "4")]
2007    pub funder: ::core::option::Option<::prost::alloc::string::String>,
2008    /// `ObjectId` of the allowance object authorizing the withdrawal if `source`
2009    /// is `SENDER_ALLOWANCE`.
2010    #[prost(string, optional, tag = "5")]
2011    pub allowance: ::core::option::Option<::prost::alloc::string::String>,
2012}
2013/// Nested message and enum types in `FundsWithdrawal`.
2014pub mod funds_withdrawal {
2015    #[non_exhaustive]
2016    #[derive(
2017        Clone,
2018        Copy,
2019        Debug,
2020        PartialEq,
2021        Eq,
2022        Hash,
2023        PartialOrd,
2024        Ord,
2025        ::prost::Enumeration
2026    )]
2027    #[repr(i32)]
2028    pub enum Source {
2029        Unknown = 0,
2030        Sender = 1,
2031        Sponsor = 2,
2032        /// Withdraw from `funder`'s balance under the `allowance` object, granted
2033        /// to the sender of the transaction.
2034        SenderAllowance = 3,
2035    }
2036    impl Source {
2037        /// String value of the enum field names used in the ProtoBuf definition.
2038        ///
2039        /// The values are not transformed in any way and thus are considered stable
2040        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2041        pub fn as_str_name(&self) -> &'static str {
2042            match self {
2043                Self::Unknown => "SOURCE_UNKNOWN",
2044                Self::Sender => "SENDER",
2045                Self::Sponsor => "SPONSOR",
2046                Self::SenderAllowance => "SENDER_ALLOWANCE",
2047            }
2048        }
2049        /// Creates an enum from field names used in the ProtoBuf definition.
2050        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2051            match value {
2052                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2053                "SENDER" => Some(Self::Sender),
2054                "SPONSOR" => Some(Self::Sponsor),
2055                "SENDER_ALLOWANCE" => Some(Self::SenderAllowance),
2056                _ => None,
2057            }
2058        }
2059    }
2060}
2061/// Key to uniquely identify a JWK.
2062#[non_exhaustive]
2063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2064pub struct JwkId {
2065    /// The issuer or identity of the OIDC provider.
2066    #[prost(string, optional, tag = "1")]
2067    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2068    /// A key ID used to uniquely identify a key from an OIDC provider.
2069    #[prost(string, optional, tag = "2")]
2070    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2071}
2072/// A JSON web key.
2073///
2074/// Struct that contains info for a JWK. A list of them for different kinds can
2075/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2076/// The JWK is used to verify the JWT token.
2077#[non_exhaustive]
2078#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2079pub struct Jwk {
2080    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2081    #[prost(string, optional, tag = "1")]
2082    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2083    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2084    #[prost(string, optional, tag = "2")]
2085    pub e: ::core::option::Option<::prost::alloc::string::String>,
2086    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2087    #[prost(string, optional, tag = "3")]
2088    pub n: ::core::option::Option<::prost::alloc::string::String>,
2089    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2090    #[prost(string, optional, tag = "4")]
2091    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2092}
2093#[non_exhaustive]
2094#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2095pub struct GetServiceInfoRequest {}
2096#[non_exhaustive]
2097#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2098pub struct GetServiceInfoResponse {
2099    /// The chain identifier of the chain that this node is on.
2100    ///
2101    /// The chain identifier is the digest of the genesis checkpoint, the
2102    /// checkpoint with sequence number 0.
2103    #[prost(string, optional, tag = "1")]
2104    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2105    /// Human-readable name of the chain that this node is on.
2106    ///
2107    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2108    #[prost(string, optional, tag = "2")]
2109    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2110    /// Current epoch of the node based on its highest executed checkpoint.
2111    #[prost(uint64, optional, tag = "3")]
2112    pub epoch: ::core::option::Option<u64>,
2113    /// Checkpoint height of the most recently executed checkpoint.
2114    #[prost(uint64, optional, tag = "4")]
2115    pub checkpoint_height: ::core::option::Option<u64>,
2116    /// Unix timestamp of the most recently executed checkpoint.
2117    #[prost(message, optional, tag = "5")]
2118    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2119    /// The lowest checkpoint for which checkpoints and transaction data are available.
2120    #[prost(uint64, optional, tag = "6")]
2121    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2122    /// The lowest checkpoint for which object data is available.
2123    #[prost(uint64, optional, tag = "7")]
2124    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2125    /// Software version of the service. Similar to the `server` http header.
2126    #[prost(string, optional, tag = "8")]
2127    pub server: ::core::option::Option<::prost::alloc::string::String>,
2128}
2129#[non_exhaustive]
2130#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2131pub struct GetObjectRequest {
2132    /// Required. The `ObjectId` of the requested object.
2133    #[prost(string, optional, tag = "1")]
2134    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2135    /// Request a specific version of the object.
2136    /// If no version is specified, and the object is live, then the latest
2137    /// version of the object is returned.
2138    #[prost(uint64, optional, tag = "2")]
2139    pub version: ::core::option::Option<u64>,
2140    /// Mask specifying which fields to read.
2141    /// If no mask is specified, defaults to `object_id,version,digest`.
2142    #[prost(message, optional, tag = "3")]
2143    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2144}
2145#[non_exhaustive]
2146#[derive(Clone, PartialEq, ::prost::Message)]
2147pub struct GetObjectResponse {
2148    #[prost(message, optional, tag = "1")]
2149    pub object: ::core::option::Option<Object>,
2150}
2151#[non_exhaustive]
2152#[derive(Clone, PartialEq, ::prost::Message)]
2153pub struct BatchGetObjectsRequest {
2154    #[prost(message, repeated, tag = "1")]
2155    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2156    /// Mask specifying which fields to read.
2157    /// If no mask is specified, defaults to `object_id,version,digest`.
2158    #[prost(message, optional, tag = "2")]
2159    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2160}
2161#[non_exhaustive]
2162#[derive(Clone, PartialEq, ::prost::Message)]
2163pub struct BatchGetObjectsResponse {
2164    #[prost(message, repeated, tag = "1")]
2165    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2166}
2167#[non_exhaustive]
2168#[derive(Clone, PartialEq, ::prost::Message)]
2169pub struct GetObjectResult {
2170    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2171    pub result: ::core::option::Option<get_object_result::Result>,
2172}
2173/// Nested message and enum types in `GetObjectResult`.
2174pub mod get_object_result {
2175    #[non_exhaustive]
2176    #[derive(Clone, PartialEq, ::prost::Oneof)]
2177    pub enum Result {
2178        #[prost(message, tag = "1")]
2179        Object(super::Object),
2180        #[prost(message, tag = "2")]
2181        Error(super::super::super::super::google::rpc::Status),
2182    }
2183}
2184#[non_exhaustive]
2185#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2186pub struct GetTransactionRequest {
2187    /// Required. The digest of the requested transaction.
2188    #[prost(string, optional, tag = "1")]
2189    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2190    /// Mask specifying which fields to read.
2191    /// If no mask is specified, defaults to `digest`.
2192    #[prost(message, optional, tag = "2")]
2193    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2194}
2195#[non_exhaustive]
2196#[derive(Clone, PartialEq, ::prost::Message)]
2197pub struct GetTransactionResponse {
2198    #[prost(message, optional, tag = "1")]
2199    pub transaction: ::core::option::Option<ExecutedTransaction>,
2200}
2201#[non_exhaustive]
2202#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2203pub struct BatchGetTransactionsRequest {
2204    /// Required. The digests of the requested transactions.
2205    #[prost(string, repeated, tag = "1")]
2206    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2207    /// Mask specifying which fields to read.
2208    /// If no mask is specified, defaults to `digest`.
2209    #[prost(message, optional, tag = "2")]
2210    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2211}
2212#[non_exhaustive]
2213#[derive(Clone, PartialEq, ::prost::Message)]
2214pub struct BatchGetTransactionsResponse {
2215    #[prost(message, repeated, tag = "1")]
2216    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2217}
2218#[non_exhaustive]
2219#[derive(Clone, PartialEq, ::prost::Message)]
2220pub struct GetTransactionResult {
2221    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2222    pub result: ::core::option::Option<get_transaction_result::Result>,
2223}
2224/// Nested message and enum types in `GetTransactionResult`.
2225pub mod get_transaction_result {
2226    #[non_exhaustive]
2227    #[derive(Clone, PartialEq, ::prost::Oneof)]
2228    pub enum Result {
2229        #[prost(message, tag = "1")]
2230        Transaction(super::ExecutedTransaction),
2231        #[prost(message, tag = "2")]
2232        Error(super::super::super::super::google::rpc::Status),
2233    }
2234}
2235#[non_exhaustive]
2236#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2237pub struct GetCheckpointRequest {
2238    /// Mask specifying which fields to read.
2239    /// If no mask is specified, defaults to `sequence_number,digest`.
2240    #[prost(message, optional, tag = "3")]
2241    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2242    /// If neither is provided, return the latest
2243    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2244    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2245}
2246/// Nested message and enum types in `GetCheckpointRequest`.
2247pub mod get_checkpoint_request {
2248    /// If neither is provided, return the latest
2249    #[non_exhaustive]
2250    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2251    pub enum CheckpointId {
2252        /// The sequence number of the requested checkpoint.
2253        #[prost(uint64, tag = "1")]
2254        SequenceNumber(u64),
2255        /// The digest of the requested checkpoint.
2256        #[prost(string, tag = "2")]
2257        Digest(::prost::alloc::string::String),
2258    }
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetCheckpointResponse {
2263    #[prost(message, optional, tag = "1")]
2264    pub checkpoint: ::core::option::Option<Checkpoint>,
2265}
2266#[non_exhaustive]
2267#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2268pub struct GetEpochRequest {
2269    /// The requested epoch.
2270    /// If no epoch is provided the current epoch will be returned.
2271    #[prost(uint64, optional, tag = "1")]
2272    pub epoch: ::core::option::Option<u64>,
2273    /// Mask specifying which fields to read.
2274    /// If no mask is specified, defaults to `epoch`.
2275    #[prost(message, optional, tag = "2")]
2276    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2277}
2278#[non_exhaustive]
2279#[derive(Clone, PartialEq, ::prost::Message)]
2280pub struct GetEpochResponse {
2281    #[prost(message, optional, tag = "1")]
2282    pub epoch: ::core::option::Option<Epoch>,
2283}
2284/// Request message for LedgerService.ListCheckpoints.
2285#[non_exhaustive]
2286#[derive(Clone, PartialEq, ::prost::Message)]
2287pub struct ListCheckpointsRequest {
2288    /// Optional. Mask for specifying which parts of the Checkpoint should be
2289    /// returned (e.g. summary, contents, signatures).
2290    #[prost(message, optional, tag = "1")]
2291    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2292    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2293    /// genesis.
2294    #[prost(uint64, optional, tag = "2")]
2295    pub start_checkpoint: ::core::option::Option<u64>,
2296    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2297    /// current indexed ledger tip.
2298    #[prost(uint64, optional, tag = "3")]
2299    pub end_checkpoint: ::core::option::Option<u64>,
2300    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
2301    /// matches if any transaction it contains satisfies the filter. If absent,
2302    /// all checkpoints in the range are returned.
2303    #[prost(message, optional, tag = "4")]
2304    pub filter: ::core::option::Option<TransactionFilter>,
2305    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2306    /// order with the default item limit. The server enforces a maximum item
2307    /// limit and silently coerces larger values down to it. To paginate, pass
2308    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2309    /// `options.before` (descending) on the next request.
2310    #[prost(message, optional, tag = "5")]
2311    pub options: ::core::option::Option<QueryOptions>,
2312}
2313/// Response message for LedgerService.ListCheckpoints.
2314///
2315/// Every frame carries a `watermark` with a safe resume cursor. A frame
2316/// with `checkpoint` set delivers one matching item; a frame without it reports
2317/// scan progress or terminal completion. Watermarks never regress in the
2318/// requested ordering but may repeat.
2319///
2320/// `end` is set exactly once, on the final frame of a successful stream. For
2321/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2322/// every other end reason, the final frame has no `checkpoint` payload.
2323#[non_exhaustive]
2324#[derive(Clone, PartialEq, ::prost::Message)]
2325pub struct ListCheckpointsResponse {
2326    /// One matching checkpoint.
2327    #[prost(message, optional, tag = "1")]
2328    pub checkpoint: ::core::option::Option<Checkpoint>,
2329    /// Progress watermark as of this frame. Present on every frame. A
2330    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2331    /// its authoritative scan frontier was already emitted.
2332    #[prost(message, optional, tag = "2")]
2333    pub watermark: ::core::option::Option<Watermark>,
2334    /// Set exactly once, on the final frame of a successful query stream.
2335    #[prost(message, optional, tag = "3")]
2336    pub end: ::core::option::Option<QueryEnd>,
2337}
2338/// Request message for LedgerService.ListTransactions.
2339#[non_exhaustive]
2340#[derive(Clone, PartialEq, ::prost::Message)]
2341pub struct ListTransactionsRequest {
2342    /// Optional. Mask for specifying which parts of the ExecutedTransaction
2343    /// should be returned.
2344    #[prost(message, optional, tag = "1")]
2345    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2346    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2347    /// genesis.
2348    #[prost(uint64, optional, tag = "2")]
2349    pub start_checkpoint: ::core::option::Option<u64>,
2350    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2351    /// current indexed ledger tip.
2352    #[prost(uint64, optional, tag = "3")]
2353    pub end_checkpoint: ::core::option::Option<u64>,
2354    /// Optional. DNF filter over indexed dimensions.
2355    /// If absent, all transactions in the range are returned.
2356    #[prost(message, optional, tag = "4")]
2357    pub filter: ::core::option::Option<TransactionFilter>,
2358    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2359    /// order with the default item limit. The server enforces a maximum item
2360    /// limit and silently coerces larger values down to it. To paginate, pass
2361    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2362    /// `options.before` (descending) on the next request.
2363    #[prost(message, optional, tag = "5")]
2364    pub options: ::core::option::Option<QueryOptions>,
2365}
2366/// Response message for LedgerService.ListTransactions.
2367///
2368/// Every frame carries a `watermark` with a safe resume cursor. A frame
2369/// with `transaction` set delivers one matching item; a frame without it reports
2370/// scan progress or terminal completion. Watermarks never regress in the
2371/// requested ordering but may repeat.
2372///
2373/// `end` is set exactly once, on the final frame of a successful stream. For
2374/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2375/// every other end reason, the final frame has no `transaction` payload.
2376#[non_exhaustive]
2377#[derive(Clone, PartialEq, ::prost::Message)]
2378pub struct ListTransactionsResponse {
2379    /// One matching transaction. Its position within the containing checkpoint
2380    /// is reported by `ExecutedTransaction.transaction_index`.
2381    #[prost(message, optional, tag = "1")]
2382    pub transaction: ::core::option::Option<ExecutedTransaction>,
2383    /// Progress watermark as of this frame. Present on every frame. A
2384    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2385    /// its authoritative scan frontier was already emitted.
2386    #[prost(message, optional, tag = "2")]
2387    pub watermark: ::core::option::Option<Watermark>,
2388    /// Set exactly once, on the final frame of a successful query stream.
2389    #[prost(message, optional, tag = "3")]
2390    pub end: ::core::option::Option<QueryEnd>,
2391}
2392/// Request message for LedgerService.ListEvents.
2393#[non_exhaustive]
2394#[derive(Clone, PartialEq, ::prost::Message)]
2395pub struct ListEventsRequest {
2396    /// Optional. Mask for specifying which parts of the Event should be returned.
2397    #[prost(message, optional, tag = "1")]
2398    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2399    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2400    /// genesis.
2401    #[prost(uint64, optional, tag = "2")]
2402    pub start_checkpoint: ::core::option::Option<u64>,
2403    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2404    /// current indexed ledger tip.
2405    #[prost(uint64, optional, tag = "3")]
2406    pub end_checkpoint: ::core::option::Option<u64>,
2407    /// Optional. DNF filter over indexed dimensions.
2408    /// If absent, all events in the range are returned.
2409    #[prost(message, optional, tag = "4")]
2410    pub filter: ::core::option::Option<EventFilter>,
2411    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2412    /// order with the default item limit. The server enforces a maximum item
2413    /// limit and silently coerces larger values down to it. To paginate, pass
2414    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2415    /// `options.before` (descending) on the next request.
2416    #[prost(message, optional, tag = "5")]
2417    pub options: ::core::option::Option<QueryOptions>,
2418}
2419/// Response message for LedgerService.ListEvents.
2420///
2421/// Every frame carries a `watermark` with a safe resume cursor. A frame
2422/// with `event` set delivers one matching item; a frame without it reports scan
2423/// progress or terminal completion. Watermarks never regress in the requested
2424/// ordering but may repeat.
2425///
2426/// `end` is set exactly once, on the final frame of a successful stream. For
2427/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2428/// every other end reason, the final frame has no `event` payload.
2429#[non_exhaustive]
2430#[derive(Clone, PartialEq, ::prost::Message)]
2431pub struct ListEventsResponse {
2432    /// One matching event. Its ledger position -- containing checkpoint,
2433    /// emitting transaction digest and offset, and index within that
2434    /// transaction's event list -- is reported by the corresponding fields on
2435    /// `Event`.
2436    #[prost(message, optional, tag = "1")]
2437    pub event: ::core::option::Option<Event>,
2438    /// Progress watermark as of this frame. Present on every frame. A
2439    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2440    /// its authoritative scan frontier was already emitted.
2441    #[prost(message, optional, tag = "2")]
2442    pub watermark: ::core::option::Option<Watermark>,
2443    /// Set exactly once, on the final frame of a successful query stream.
2444    #[prost(message, optional, tag = "3")]
2445    pub end: ::core::option::Option<QueryEnd>,
2446}
2447/// Generated client implementations.
2448pub mod ledger_service_client {
2449    #![allow(
2450        unused_variables,
2451        dead_code,
2452        missing_docs,
2453        clippy::wildcard_imports,
2454        clippy::let_unit_value,
2455    )]
2456    use tonic::codegen::*;
2457    use tonic::codegen::http::Uri;
2458    #[derive(Debug, Clone)]
2459    pub struct LedgerServiceClient<T> {
2460        inner: tonic::client::Grpc<T>,
2461    }
2462    impl LedgerServiceClient<tonic::transport::Channel> {
2463        /// Attempt to create a new client by connecting to a given endpoint.
2464        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2465        where
2466            D: TryInto<tonic::transport::Endpoint>,
2467            D::Error: Into<StdError>,
2468        {
2469            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2470            Ok(Self::new(conn))
2471        }
2472    }
2473    impl<T> LedgerServiceClient<T>
2474    where
2475        T: tonic::client::GrpcService<tonic::body::Body>,
2476        T::Error: Into<StdError>,
2477        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2478        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2479    {
2480        pub fn new(inner: T) -> Self {
2481            let inner = tonic::client::Grpc::new(inner);
2482            Self { inner }
2483        }
2484        pub fn with_origin(inner: T, origin: Uri) -> Self {
2485            let inner = tonic::client::Grpc::with_origin(inner, origin);
2486            Self { inner }
2487        }
2488        pub fn with_interceptor<F>(
2489            inner: T,
2490            interceptor: F,
2491        ) -> LedgerServiceClient<InterceptedService<T, F>>
2492        where
2493            F: tonic::service::Interceptor,
2494            T::ResponseBody: Default,
2495            T: tonic::codegen::Service<
2496                http::Request<tonic::body::Body>,
2497                Response = http::Response<
2498                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2499                >,
2500            >,
2501            <T as tonic::codegen::Service<
2502                http::Request<tonic::body::Body>,
2503            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2504        {
2505            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2506        }
2507        /// Compress requests with the given encoding.
2508        ///
2509        /// This requires the server to support it otherwise it might respond with an
2510        /// error.
2511        #[must_use]
2512        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2513            self.inner = self.inner.send_compressed(encoding);
2514            self
2515        }
2516        /// Enable decompressing responses.
2517        #[must_use]
2518        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2519            self.inner = self.inner.accept_compressed(encoding);
2520            self
2521        }
2522        /// Limits the maximum size of a decoded message.
2523        ///
2524        /// Default: `4MB`
2525        #[must_use]
2526        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2527            self.inner = self.inner.max_decoding_message_size(limit);
2528            self
2529        }
2530        /// Limits the maximum size of an encoded message.
2531        ///
2532        /// Default: `usize::MAX`
2533        #[must_use]
2534        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2535            self.inner = self.inner.max_encoding_message_size(limit);
2536            self
2537        }
2538        /// Query the service for general information about its current state.
2539        pub async fn get_service_info(
2540            &mut self,
2541            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2542        ) -> std::result::Result<
2543            tonic::Response<super::GetServiceInfoResponse>,
2544            tonic::Status,
2545        > {
2546            self.inner
2547                .ready()
2548                .await
2549                .map_err(|e| {
2550                    tonic::Status::unknown(
2551                        format!("Service was not ready: {}", e.into()),
2552                    )
2553                })?;
2554            let codec = tonic_prost::ProstCodec::default();
2555            let path = http::uri::PathAndQuery::from_static(
2556                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2557            );
2558            let mut req = request.into_request();
2559            req.extensions_mut()
2560                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2561            self.inner.unary(req, path, codec).await
2562        }
2563        pub async fn get_object(
2564            &mut self,
2565            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2566        ) -> std::result::Result<
2567            tonic::Response<super::GetObjectResponse>,
2568            tonic::Status,
2569        > {
2570            self.inner
2571                .ready()
2572                .await
2573                .map_err(|e| {
2574                    tonic::Status::unknown(
2575                        format!("Service was not ready: {}", e.into()),
2576                    )
2577                })?;
2578            let codec = tonic_prost::ProstCodec::default();
2579            let path = http::uri::PathAndQuery::from_static(
2580                "/sui.rpc.v2.LedgerService/GetObject",
2581            );
2582            let mut req = request.into_request();
2583            req.extensions_mut()
2584                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2585            self.inner.unary(req, path, codec).await
2586        }
2587        pub async fn batch_get_objects(
2588            &mut self,
2589            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2590        ) -> std::result::Result<
2591            tonic::Response<super::BatchGetObjectsResponse>,
2592            tonic::Status,
2593        > {
2594            self.inner
2595                .ready()
2596                .await
2597                .map_err(|e| {
2598                    tonic::Status::unknown(
2599                        format!("Service was not ready: {}", e.into()),
2600                    )
2601                })?;
2602            let codec = tonic_prost::ProstCodec::default();
2603            let path = http::uri::PathAndQuery::from_static(
2604                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2605            );
2606            let mut req = request.into_request();
2607            req.extensions_mut()
2608                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2609            self.inner.unary(req, path, codec).await
2610        }
2611        pub async fn get_transaction(
2612            &mut self,
2613            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2614        ) -> std::result::Result<
2615            tonic::Response<super::GetTransactionResponse>,
2616            tonic::Status,
2617        > {
2618            self.inner
2619                .ready()
2620                .await
2621                .map_err(|e| {
2622                    tonic::Status::unknown(
2623                        format!("Service was not ready: {}", e.into()),
2624                    )
2625                })?;
2626            let codec = tonic_prost::ProstCodec::default();
2627            let path = http::uri::PathAndQuery::from_static(
2628                "/sui.rpc.v2.LedgerService/GetTransaction",
2629            );
2630            let mut req = request.into_request();
2631            req.extensions_mut()
2632                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2633            self.inner.unary(req, path, codec).await
2634        }
2635        pub async fn batch_get_transactions(
2636            &mut self,
2637            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2638        ) -> std::result::Result<
2639            tonic::Response<super::BatchGetTransactionsResponse>,
2640            tonic::Status,
2641        > {
2642            self.inner
2643                .ready()
2644                .await
2645                .map_err(|e| {
2646                    tonic::Status::unknown(
2647                        format!("Service was not ready: {}", e.into()),
2648                    )
2649                })?;
2650            let codec = tonic_prost::ProstCodec::default();
2651            let path = http::uri::PathAndQuery::from_static(
2652                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2653            );
2654            let mut req = request.into_request();
2655            req.extensions_mut()
2656                .insert(
2657                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2658                );
2659            self.inner.unary(req, path, codec).await
2660        }
2661        pub async fn get_checkpoint(
2662            &mut self,
2663            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2664        ) -> std::result::Result<
2665            tonic::Response<super::GetCheckpointResponse>,
2666            tonic::Status,
2667        > {
2668            self.inner
2669                .ready()
2670                .await
2671                .map_err(|e| {
2672                    tonic::Status::unknown(
2673                        format!("Service was not ready: {}", e.into()),
2674                    )
2675                })?;
2676            let codec = tonic_prost::ProstCodec::default();
2677            let path = http::uri::PathAndQuery::from_static(
2678                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2679            );
2680            let mut req = request.into_request();
2681            req.extensions_mut()
2682                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2683            self.inner.unary(req, path, codec).await
2684        }
2685        pub async fn get_epoch(
2686            &mut self,
2687            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2688        ) -> std::result::Result<
2689            tonic::Response<super::GetEpochResponse>,
2690            tonic::Status,
2691        > {
2692            self.inner
2693                .ready()
2694                .await
2695                .map_err(|e| {
2696                    tonic::Status::unknown(
2697                        format!("Service was not ready: {}", e.into()),
2698                    )
2699                })?;
2700            let codec = tonic_prost::ProstCodec::default();
2701            let path = http::uri::PathAndQuery::from_static(
2702                "/sui.rpc.v2.LedgerService/GetEpoch",
2703            );
2704            let mut req = request.into_request();
2705            req.extensions_mut()
2706                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2707            self.inner.unary(req, path, codec).await
2708        }
2709        /// List checkpoints matching the provided filters.
2710        ///
2711        /// Checkpoints are returned in ascending or descending checkpoint sequence
2712        /// number order according to the query options ordering.
2713        /// A checkpoint matches if any transaction it contains satisfies the filter.
2714        pub async fn list_checkpoints(
2715            &mut self,
2716            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2717        ) -> std::result::Result<
2718            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2719            tonic::Status,
2720        > {
2721            self.inner
2722                .ready()
2723                .await
2724                .map_err(|e| {
2725                    tonic::Status::unknown(
2726                        format!("Service was not ready: {}", e.into()),
2727                    )
2728                })?;
2729            let codec = tonic_prost::ProstCodec::default();
2730            let path = http::uri::PathAndQuery::from_static(
2731                "/sui.rpc.v2.LedgerService/ListCheckpoints",
2732            );
2733            let mut req = request.into_request();
2734            req.extensions_mut()
2735                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2736            self.inner.server_streaming(req, path, codec).await
2737        }
2738        /// List transactions matching the provided filters.
2739        ///
2740        /// Transactions are returned in ascending or descending transaction sequence
2741        /// order according to the query options ordering.
2742        pub async fn list_transactions(
2743            &mut self,
2744            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2745        ) -> std::result::Result<
2746            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2747            tonic::Status,
2748        > {
2749            self.inner
2750                .ready()
2751                .await
2752                .map_err(|e| {
2753                    tonic::Status::unknown(
2754                        format!("Service was not ready: {}", e.into()),
2755                    )
2756                })?;
2757            let codec = tonic_prost::ProstCodec::default();
2758            let path = http::uri::PathAndQuery::from_static(
2759                "/sui.rpc.v2.LedgerService/ListTransactions",
2760            );
2761            let mut req = request.into_request();
2762            req.extensions_mut()
2763                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2764            self.inner.server_streaming(req, path, codec).await
2765        }
2766        /// List events matching the provided filters.
2767        ///
2768        /// Events are returned in ascending or descending packed event sequence order
2769        /// according to the query options ordering.
2770        pub async fn list_events(
2771            &mut self,
2772            request: impl tonic::IntoRequest<super::ListEventsRequest>,
2773        ) -> std::result::Result<
2774            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2775            tonic::Status,
2776        > {
2777            self.inner
2778                .ready()
2779                .await
2780                .map_err(|e| {
2781                    tonic::Status::unknown(
2782                        format!("Service was not ready: {}", e.into()),
2783                    )
2784                })?;
2785            let codec = tonic_prost::ProstCodec::default();
2786            let path = http::uri::PathAndQuery::from_static(
2787                "/sui.rpc.v2.LedgerService/ListEvents",
2788            );
2789            let mut req = request.into_request();
2790            req.extensions_mut()
2791                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2792            self.inner.server_streaming(req, path, codec).await
2793        }
2794    }
2795}
2796/// Generated server implementations.
2797pub mod ledger_service_server {
2798    #![allow(
2799        unused_variables,
2800        dead_code,
2801        missing_docs,
2802        clippy::wildcard_imports,
2803        clippy::let_unit_value,
2804    )]
2805    use tonic::codegen::*;
2806    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2807    #[async_trait]
2808    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2809        /// Query the service for general information about its current state.
2810        async fn get_service_info(
2811            &self,
2812            request: tonic::Request<super::GetServiceInfoRequest>,
2813        ) -> std::result::Result<
2814            tonic::Response<super::GetServiceInfoResponse>,
2815            tonic::Status,
2816        > {
2817            Err(tonic::Status::unimplemented("Not yet implemented"))
2818        }
2819        async fn get_object(
2820            &self,
2821            request: tonic::Request<super::GetObjectRequest>,
2822        ) -> std::result::Result<
2823            tonic::Response<super::GetObjectResponse>,
2824            tonic::Status,
2825        > {
2826            Err(tonic::Status::unimplemented("Not yet implemented"))
2827        }
2828        async fn batch_get_objects(
2829            &self,
2830            request: tonic::Request<super::BatchGetObjectsRequest>,
2831        ) -> std::result::Result<
2832            tonic::Response<super::BatchGetObjectsResponse>,
2833            tonic::Status,
2834        > {
2835            Err(tonic::Status::unimplemented("Not yet implemented"))
2836        }
2837        async fn get_transaction(
2838            &self,
2839            request: tonic::Request<super::GetTransactionRequest>,
2840        ) -> std::result::Result<
2841            tonic::Response<super::GetTransactionResponse>,
2842            tonic::Status,
2843        > {
2844            Err(tonic::Status::unimplemented("Not yet implemented"))
2845        }
2846        async fn batch_get_transactions(
2847            &self,
2848            request: tonic::Request<super::BatchGetTransactionsRequest>,
2849        ) -> std::result::Result<
2850            tonic::Response<super::BatchGetTransactionsResponse>,
2851            tonic::Status,
2852        > {
2853            Err(tonic::Status::unimplemented("Not yet implemented"))
2854        }
2855        async fn get_checkpoint(
2856            &self,
2857            request: tonic::Request<super::GetCheckpointRequest>,
2858        ) -> std::result::Result<
2859            tonic::Response<super::GetCheckpointResponse>,
2860            tonic::Status,
2861        > {
2862            Err(tonic::Status::unimplemented("Not yet implemented"))
2863        }
2864        async fn get_epoch(
2865            &self,
2866            request: tonic::Request<super::GetEpochRequest>,
2867        ) -> std::result::Result<
2868            tonic::Response<super::GetEpochResponse>,
2869            tonic::Status,
2870        > {
2871            Err(tonic::Status::unimplemented("Not yet implemented"))
2872        }
2873        /// List checkpoints matching the provided filters.
2874        ///
2875        /// Checkpoints are returned in ascending or descending checkpoint sequence
2876        /// number order according to the query options ordering.
2877        /// A checkpoint matches if any transaction it contains satisfies the filter.
2878        async fn list_checkpoints(
2879            &self,
2880            request: tonic::Request<super::ListCheckpointsRequest>,
2881        ) -> std::result::Result<
2882            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2883            tonic::Status,
2884        > {
2885            Err(tonic::Status::unimplemented("Not yet implemented"))
2886        }
2887        /// List transactions matching the provided filters.
2888        ///
2889        /// Transactions are returned in ascending or descending transaction sequence
2890        /// order according to the query options ordering.
2891        async fn list_transactions(
2892            &self,
2893            request: tonic::Request<super::ListTransactionsRequest>,
2894        ) -> std::result::Result<
2895            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2896            tonic::Status,
2897        > {
2898            Err(tonic::Status::unimplemented("Not yet implemented"))
2899        }
2900        /// List events matching the provided filters.
2901        ///
2902        /// Events are returned in ascending or descending packed event sequence order
2903        /// according to the query options ordering.
2904        async fn list_events(
2905            &self,
2906            request: tonic::Request<super::ListEventsRequest>,
2907        ) -> std::result::Result<
2908            tonic::Response<BoxStream<super::ListEventsResponse>>,
2909            tonic::Status,
2910        > {
2911            Err(tonic::Status::unimplemented("Not yet implemented"))
2912        }
2913    }
2914    #[derive(Debug)]
2915    pub struct LedgerServiceServer<T> {
2916        inner: Arc<T>,
2917        accept_compression_encodings: EnabledCompressionEncodings,
2918        send_compression_encodings: EnabledCompressionEncodings,
2919        max_decoding_message_size: Option<usize>,
2920        max_encoding_message_size: Option<usize>,
2921    }
2922    impl<T> LedgerServiceServer<T> {
2923        pub fn new(inner: T) -> Self {
2924            Self::from_arc(Arc::new(inner))
2925        }
2926        pub fn from_arc(inner: Arc<T>) -> Self {
2927            Self {
2928                inner,
2929                accept_compression_encodings: Default::default(),
2930                send_compression_encodings: Default::default(),
2931                max_decoding_message_size: None,
2932                max_encoding_message_size: None,
2933            }
2934        }
2935        pub fn with_interceptor<F>(
2936            inner: T,
2937            interceptor: F,
2938        ) -> InterceptedService<Self, F>
2939        where
2940            F: tonic::service::Interceptor,
2941        {
2942            InterceptedService::new(Self::new(inner), interceptor)
2943        }
2944        /// Enable decompressing requests with the given encoding.
2945        #[must_use]
2946        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2947            self.accept_compression_encodings.enable(encoding);
2948            self
2949        }
2950        /// Compress responses with the given encoding, if the client supports it.
2951        #[must_use]
2952        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2953            self.send_compression_encodings.enable(encoding);
2954            self
2955        }
2956        /// Limits the maximum size of a decoded message.
2957        ///
2958        /// Default: `4MB`
2959        #[must_use]
2960        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2961            self.max_decoding_message_size = Some(limit);
2962            self
2963        }
2964        /// Limits the maximum size of an encoded message.
2965        ///
2966        /// Default: `usize::MAX`
2967        #[must_use]
2968        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2969            self.max_encoding_message_size = Some(limit);
2970            self
2971        }
2972    }
2973    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2974    where
2975        T: LedgerService,
2976        B: Body + std::marker::Send + 'static,
2977        B::Error: Into<StdError> + std::marker::Send + 'static,
2978    {
2979        type Response = http::Response<tonic::body::Body>;
2980        type Error = std::convert::Infallible;
2981        type Future = BoxFuture<Self::Response, Self::Error>;
2982        fn poll_ready(
2983            &mut self,
2984            _cx: &mut Context<'_>,
2985        ) -> Poll<std::result::Result<(), Self::Error>> {
2986            Poll::Ready(Ok(()))
2987        }
2988        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2989            match req.uri().path() {
2990                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2991                    #[allow(non_camel_case_types)]
2992                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2993                    impl<
2994                        T: LedgerService,
2995                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
2996                    for GetServiceInfoSvc<T> {
2997                        type Response = super::GetServiceInfoResponse;
2998                        type Future = BoxFuture<
2999                            tonic::Response<Self::Response>,
3000                            tonic::Status,
3001                        >;
3002                        fn call(
3003                            &mut self,
3004                            request: tonic::Request<super::GetServiceInfoRequest>,
3005                        ) -> Self::Future {
3006                            let inner = Arc::clone(&self.0);
3007                            let fut = async move {
3008                                <T as LedgerService>::get_service_info(&inner, request)
3009                                    .await
3010                            };
3011                            Box::pin(fut)
3012                        }
3013                    }
3014                    let accept_compression_encodings = self.accept_compression_encodings;
3015                    let send_compression_encodings = self.send_compression_encodings;
3016                    let max_decoding_message_size = self.max_decoding_message_size;
3017                    let max_encoding_message_size = self.max_encoding_message_size;
3018                    let inner = self.inner.clone();
3019                    let fut = async move {
3020                        let method = GetServiceInfoSvc(inner);
3021                        let codec = tonic_prost::ProstCodec::default();
3022                        let mut grpc = tonic::server::Grpc::new(codec)
3023                            .apply_compression_config(
3024                                accept_compression_encodings,
3025                                send_compression_encodings,
3026                            )
3027                            .apply_max_message_size_config(
3028                                max_decoding_message_size,
3029                                max_encoding_message_size,
3030                            );
3031                        let res = grpc.unary(method, req).await;
3032                        Ok(res)
3033                    };
3034                    Box::pin(fut)
3035                }
3036                "/sui.rpc.v2.LedgerService/GetObject" => {
3037                    #[allow(non_camel_case_types)]
3038                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3039                    impl<
3040                        T: LedgerService,
3041                    > tonic::server::UnaryService<super::GetObjectRequest>
3042                    for GetObjectSvc<T> {
3043                        type Response = super::GetObjectResponse;
3044                        type Future = BoxFuture<
3045                            tonic::Response<Self::Response>,
3046                            tonic::Status,
3047                        >;
3048                        fn call(
3049                            &mut self,
3050                            request: tonic::Request<super::GetObjectRequest>,
3051                        ) -> Self::Future {
3052                            let inner = Arc::clone(&self.0);
3053                            let fut = async move {
3054                                <T as LedgerService>::get_object(&inner, request).await
3055                            };
3056                            Box::pin(fut)
3057                        }
3058                    }
3059                    let accept_compression_encodings = self.accept_compression_encodings;
3060                    let send_compression_encodings = self.send_compression_encodings;
3061                    let max_decoding_message_size = self.max_decoding_message_size;
3062                    let max_encoding_message_size = self.max_encoding_message_size;
3063                    let inner = self.inner.clone();
3064                    let fut = async move {
3065                        let method = GetObjectSvc(inner);
3066                        let codec = tonic_prost::ProstCodec::default();
3067                        let mut grpc = tonic::server::Grpc::new(codec)
3068                            .apply_compression_config(
3069                                accept_compression_encodings,
3070                                send_compression_encodings,
3071                            )
3072                            .apply_max_message_size_config(
3073                                max_decoding_message_size,
3074                                max_encoding_message_size,
3075                            );
3076                        let res = grpc.unary(method, req).await;
3077                        Ok(res)
3078                    };
3079                    Box::pin(fut)
3080                }
3081                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3082                    #[allow(non_camel_case_types)]
3083                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3084                    impl<
3085                        T: LedgerService,
3086                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3087                    for BatchGetObjectsSvc<T> {
3088                        type Response = super::BatchGetObjectsResponse;
3089                        type Future = BoxFuture<
3090                            tonic::Response<Self::Response>,
3091                            tonic::Status,
3092                        >;
3093                        fn call(
3094                            &mut self,
3095                            request: tonic::Request<super::BatchGetObjectsRequest>,
3096                        ) -> Self::Future {
3097                            let inner = Arc::clone(&self.0);
3098                            let fut = async move {
3099                                <T as LedgerService>::batch_get_objects(&inner, request)
3100                                    .await
3101                            };
3102                            Box::pin(fut)
3103                        }
3104                    }
3105                    let accept_compression_encodings = self.accept_compression_encodings;
3106                    let send_compression_encodings = self.send_compression_encodings;
3107                    let max_decoding_message_size = self.max_decoding_message_size;
3108                    let max_encoding_message_size = self.max_encoding_message_size;
3109                    let inner = self.inner.clone();
3110                    let fut = async move {
3111                        let method = BatchGetObjectsSvc(inner);
3112                        let codec = tonic_prost::ProstCodec::default();
3113                        let mut grpc = tonic::server::Grpc::new(codec)
3114                            .apply_compression_config(
3115                                accept_compression_encodings,
3116                                send_compression_encodings,
3117                            )
3118                            .apply_max_message_size_config(
3119                                max_decoding_message_size,
3120                                max_encoding_message_size,
3121                            );
3122                        let res = grpc.unary(method, req).await;
3123                        Ok(res)
3124                    };
3125                    Box::pin(fut)
3126                }
3127                "/sui.rpc.v2.LedgerService/GetTransaction" => {
3128                    #[allow(non_camel_case_types)]
3129                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3130                    impl<
3131                        T: LedgerService,
3132                    > tonic::server::UnaryService<super::GetTransactionRequest>
3133                    for GetTransactionSvc<T> {
3134                        type Response = super::GetTransactionResponse;
3135                        type Future = BoxFuture<
3136                            tonic::Response<Self::Response>,
3137                            tonic::Status,
3138                        >;
3139                        fn call(
3140                            &mut self,
3141                            request: tonic::Request<super::GetTransactionRequest>,
3142                        ) -> Self::Future {
3143                            let inner = Arc::clone(&self.0);
3144                            let fut = async move {
3145                                <T as LedgerService>::get_transaction(&inner, request).await
3146                            };
3147                            Box::pin(fut)
3148                        }
3149                    }
3150                    let accept_compression_encodings = self.accept_compression_encodings;
3151                    let send_compression_encodings = self.send_compression_encodings;
3152                    let max_decoding_message_size = self.max_decoding_message_size;
3153                    let max_encoding_message_size = self.max_encoding_message_size;
3154                    let inner = self.inner.clone();
3155                    let fut = async move {
3156                        let method = GetTransactionSvc(inner);
3157                        let codec = tonic_prost::ProstCodec::default();
3158                        let mut grpc = tonic::server::Grpc::new(codec)
3159                            .apply_compression_config(
3160                                accept_compression_encodings,
3161                                send_compression_encodings,
3162                            )
3163                            .apply_max_message_size_config(
3164                                max_decoding_message_size,
3165                                max_encoding_message_size,
3166                            );
3167                        let res = grpc.unary(method, req).await;
3168                        Ok(res)
3169                    };
3170                    Box::pin(fut)
3171                }
3172                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3173                    #[allow(non_camel_case_types)]
3174                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3175                    impl<
3176                        T: LedgerService,
3177                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3178                    for BatchGetTransactionsSvc<T> {
3179                        type Response = super::BatchGetTransactionsResponse;
3180                        type Future = BoxFuture<
3181                            tonic::Response<Self::Response>,
3182                            tonic::Status,
3183                        >;
3184                        fn call(
3185                            &mut self,
3186                            request: tonic::Request<super::BatchGetTransactionsRequest>,
3187                        ) -> Self::Future {
3188                            let inner = Arc::clone(&self.0);
3189                            let fut = async move {
3190                                <T as LedgerService>::batch_get_transactions(
3191                                        &inner,
3192                                        request,
3193                                    )
3194                                    .await
3195                            };
3196                            Box::pin(fut)
3197                        }
3198                    }
3199                    let accept_compression_encodings = self.accept_compression_encodings;
3200                    let send_compression_encodings = self.send_compression_encodings;
3201                    let max_decoding_message_size = self.max_decoding_message_size;
3202                    let max_encoding_message_size = self.max_encoding_message_size;
3203                    let inner = self.inner.clone();
3204                    let fut = async move {
3205                        let method = BatchGetTransactionsSvc(inner);
3206                        let codec = tonic_prost::ProstCodec::default();
3207                        let mut grpc = tonic::server::Grpc::new(codec)
3208                            .apply_compression_config(
3209                                accept_compression_encodings,
3210                                send_compression_encodings,
3211                            )
3212                            .apply_max_message_size_config(
3213                                max_decoding_message_size,
3214                                max_encoding_message_size,
3215                            );
3216                        let res = grpc.unary(method, req).await;
3217                        Ok(res)
3218                    };
3219                    Box::pin(fut)
3220                }
3221                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3222                    #[allow(non_camel_case_types)]
3223                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3224                    impl<
3225                        T: LedgerService,
3226                    > tonic::server::UnaryService<super::GetCheckpointRequest>
3227                    for GetCheckpointSvc<T> {
3228                        type Response = super::GetCheckpointResponse;
3229                        type Future = BoxFuture<
3230                            tonic::Response<Self::Response>,
3231                            tonic::Status,
3232                        >;
3233                        fn call(
3234                            &mut self,
3235                            request: tonic::Request<super::GetCheckpointRequest>,
3236                        ) -> Self::Future {
3237                            let inner = Arc::clone(&self.0);
3238                            let fut = async move {
3239                                <T as LedgerService>::get_checkpoint(&inner, request).await
3240                            };
3241                            Box::pin(fut)
3242                        }
3243                    }
3244                    let accept_compression_encodings = self.accept_compression_encodings;
3245                    let send_compression_encodings = self.send_compression_encodings;
3246                    let max_decoding_message_size = self.max_decoding_message_size;
3247                    let max_encoding_message_size = self.max_encoding_message_size;
3248                    let inner = self.inner.clone();
3249                    let fut = async move {
3250                        let method = GetCheckpointSvc(inner);
3251                        let codec = tonic_prost::ProstCodec::default();
3252                        let mut grpc = tonic::server::Grpc::new(codec)
3253                            .apply_compression_config(
3254                                accept_compression_encodings,
3255                                send_compression_encodings,
3256                            )
3257                            .apply_max_message_size_config(
3258                                max_decoding_message_size,
3259                                max_encoding_message_size,
3260                            );
3261                        let res = grpc.unary(method, req).await;
3262                        Ok(res)
3263                    };
3264                    Box::pin(fut)
3265                }
3266                "/sui.rpc.v2.LedgerService/GetEpoch" => {
3267                    #[allow(non_camel_case_types)]
3268                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3269                    impl<
3270                        T: LedgerService,
3271                    > tonic::server::UnaryService<super::GetEpochRequest>
3272                    for GetEpochSvc<T> {
3273                        type Response = super::GetEpochResponse;
3274                        type Future = BoxFuture<
3275                            tonic::Response<Self::Response>,
3276                            tonic::Status,
3277                        >;
3278                        fn call(
3279                            &mut self,
3280                            request: tonic::Request<super::GetEpochRequest>,
3281                        ) -> Self::Future {
3282                            let inner = Arc::clone(&self.0);
3283                            let fut = async move {
3284                                <T as LedgerService>::get_epoch(&inner, request).await
3285                            };
3286                            Box::pin(fut)
3287                        }
3288                    }
3289                    let accept_compression_encodings = self.accept_compression_encodings;
3290                    let send_compression_encodings = self.send_compression_encodings;
3291                    let max_decoding_message_size = self.max_decoding_message_size;
3292                    let max_encoding_message_size = self.max_encoding_message_size;
3293                    let inner = self.inner.clone();
3294                    let fut = async move {
3295                        let method = GetEpochSvc(inner);
3296                        let codec = tonic_prost::ProstCodec::default();
3297                        let mut grpc = tonic::server::Grpc::new(codec)
3298                            .apply_compression_config(
3299                                accept_compression_encodings,
3300                                send_compression_encodings,
3301                            )
3302                            .apply_max_message_size_config(
3303                                max_decoding_message_size,
3304                                max_encoding_message_size,
3305                            );
3306                        let res = grpc.unary(method, req).await;
3307                        Ok(res)
3308                    };
3309                    Box::pin(fut)
3310                }
3311                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3312                    #[allow(non_camel_case_types)]
3313                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3314                    impl<
3315                        T: LedgerService,
3316                    > tonic::server::ServerStreamingService<
3317                        super::ListCheckpointsRequest,
3318                    > for ListCheckpointsSvc<T> {
3319                        type Response = super::ListCheckpointsResponse;
3320                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3321                        type Future = BoxFuture<
3322                            tonic::Response<Self::ResponseStream>,
3323                            tonic::Status,
3324                        >;
3325                        fn call(
3326                            &mut self,
3327                            request: tonic::Request<super::ListCheckpointsRequest>,
3328                        ) -> Self::Future {
3329                            let inner = Arc::clone(&self.0);
3330                            let fut = async move {
3331                                <T as LedgerService>::list_checkpoints(&inner, request)
3332                                    .await
3333                            };
3334                            Box::pin(fut)
3335                        }
3336                    }
3337                    let accept_compression_encodings = self.accept_compression_encodings;
3338                    let send_compression_encodings = self.send_compression_encodings;
3339                    let max_decoding_message_size = self.max_decoding_message_size;
3340                    let max_encoding_message_size = self.max_encoding_message_size;
3341                    let inner = self.inner.clone();
3342                    let fut = async move {
3343                        let method = ListCheckpointsSvc(inner);
3344                        let codec = tonic_prost::ProstCodec::default();
3345                        let mut grpc = tonic::server::Grpc::new(codec)
3346                            .apply_compression_config(
3347                                accept_compression_encodings,
3348                                send_compression_encodings,
3349                            )
3350                            .apply_max_message_size_config(
3351                                max_decoding_message_size,
3352                                max_encoding_message_size,
3353                            );
3354                        let res = grpc.server_streaming(method, req).await;
3355                        Ok(res)
3356                    };
3357                    Box::pin(fut)
3358                }
3359                "/sui.rpc.v2.LedgerService/ListTransactions" => {
3360                    #[allow(non_camel_case_types)]
3361                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3362                    impl<
3363                        T: LedgerService,
3364                    > tonic::server::ServerStreamingService<
3365                        super::ListTransactionsRequest,
3366                    > for ListTransactionsSvc<T> {
3367                        type Response = super::ListTransactionsResponse;
3368                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3369                        type Future = BoxFuture<
3370                            tonic::Response<Self::ResponseStream>,
3371                            tonic::Status,
3372                        >;
3373                        fn call(
3374                            &mut self,
3375                            request: tonic::Request<super::ListTransactionsRequest>,
3376                        ) -> Self::Future {
3377                            let inner = Arc::clone(&self.0);
3378                            let fut = async move {
3379                                <T as LedgerService>::list_transactions(&inner, request)
3380                                    .await
3381                            };
3382                            Box::pin(fut)
3383                        }
3384                    }
3385                    let accept_compression_encodings = self.accept_compression_encodings;
3386                    let send_compression_encodings = self.send_compression_encodings;
3387                    let max_decoding_message_size = self.max_decoding_message_size;
3388                    let max_encoding_message_size = self.max_encoding_message_size;
3389                    let inner = self.inner.clone();
3390                    let fut = async move {
3391                        let method = ListTransactionsSvc(inner);
3392                        let codec = tonic_prost::ProstCodec::default();
3393                        let mut grpc = tonic::server::Grpc::new(codec)
3394                            .apply_compression_config(
3395                                accept_compression_encodings,
3396                                send_compression_encodings,
3397                            )
3398                            .apply_max_message_size_config(
3399                                max_decoding_message_size,
3400                                max_encoding_message_size,
3401                            );
3402                        let res = grpc.server_streaming(method, req).await;
3403                        Ok(res)
3404                    };
3405                    Box::pin(fut)
3406                }
3407                "/sui.rpc.v2.LedgerService/ListEvents" => {
3408                    #[allow(non_camel_case_types)]
3409                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3410                    impl<
3411                        T: LedgerService,
3412                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
3413                    for ListEventsSvc<T> {
3414                        type Response = super::ListEventsResponse;
3415                        type ResponseStream = BoxStream<super::ListEventsResponse>;
3416                        type Future = BoxFuture<
3417                            tonic::Response<Self::ResponseStream>,
3418                            tonic::Status,
3419                        >;
3420                        fn call(
3421                            &mut self,
3422                            request: tonic::Request<super::ListEventsRequest>,
3423                        ) -> Self::Future {
3424                            let inner = Arc::clone(&self.0);
3425                            let fut = async move {
3426                                <T as LedgerService>::list_events(&inner, request).await
3427                            };
3428                            Box::pin(fut)
3429                        }
3430                    }
3431                    let accept_compression_encodings = self.accept_compression_encodings;
3432                    let send_compression_encodings = self.send_compression_encodings;
3433                    let max_decoding_message_size = self.max_decoding_message_size;
3434                    let max_encoding_message_size = self.max_encoding_message_size;
3435                    let inner = self.inner.clone();
3436                    let fut = async move {
3437                        let method = ListEventsSvc(inner);
3438                        let codec = tonic_prost::ProstCodec::default();
3439                        let mut grpc = tonic::server::Grpc::new(codec)
3440                            .apply_compression_config(
3441                                accept_compression_encodings,
3442                                send_compression_encodings,
3443                            )
3444                            .apply_max_message_size_config(
3445                                max_decoding_message_size,
3446                                max_encoding_message_size,
3447                            );
3448                        let res = grpc.server_streaming(method, req).await;
3449                        Ok(res)
3450                    };
3451                    Box::pin(fut)
3452                }
3453                _ => {
3454                    Box::pin(async move {
3455                        let mut response = http::Response::new(
3456                            tonic::body::Body::default(),
3457                        );
3458                        let headers = response.headers_mut();
3459                        headers
3460                            .insert(
3461                                tonic::Status::GRPC_STATUS,
3462                                (tonic::Code::Unimplemented as i32).into(),
3463                            );
3464                        headers
3465                            .insert(
3466                                http::header::CONTENT_TYPE,
3467                                tonic::metadata::GRPC_CONTENT_TYPE,
3468                            );
3469                        Ok(response)
3470                    })
3471                }
3472            }
3473        }
3474    }
3475    impl<T> Clone for LedgerServiceServer<T> {
3476        fn clone(&self) -> Self {
3477            let inner = self.inner.clone();
3478            Self {
3479                inner,
3480                accept_compression_encodings: self.accept_compression_encodings,
3481                send_compression_encodings: self.send_compression_encodings,
3482                max_decoding_message_size: self.max_decoding_message_size,
3483                max_encoding_message_size: self.max_encoding_message_size,
3484            }
3485        }
3486    }
3487    /// Generated gRPC service name
3488    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3489    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3490        const NAME: &'static str = SERVICE_NAME;
3491    }
3492}
3493/// A Move Package
3494#[non_exhaustive]
3495#[derive(Clone, PartialEq, ::prost::Message)]
3496pub struct Package {
3497    /// The PackageId of this package
3498    ///
3499    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
3500    /// Outside of system packages the `storage_id` for every package version is
3501    /// different.
3502    #[prost(string, optional, tag = "1")]
3503    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3504    /// The PackageId of the first published version of this package.
3505    ///
3506    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
3507    /// `storage_id` of the first version of this package that has been published.
3508    /// The `original_id`/`runtime_id` is stable across all versions of the
3509    /// package and does not ever change.
3510    #[prost(string, optional, tag = "2")]
3511    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3512    /// The version of this package
3513    #[prost(uint64, optional, tag = "3")]
3514    pub version: ::core::option::Option<u64>,
3515    /// The modules defined by this package
3516    #[prost(message, repeated, tag = "4")]
3517    pub modules: ::prost::alloc::vec::Vec<Module>,
3518    /// List of datatype origins for mapping datatypes to a package version where
3519    /// it was first defined
3520    #[prost(message, repeated, tag = "5")]
3521    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3522    /// The package's transitive dependencies as a mapping from the package's
3523    /// runtime Id (the Id it is referred to by in other packages) to its
3524    /// storage Id (the Id it is loaded from on chain).
3525    #[prost(message, repeated, tag = "6")]
3526    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3527}
3528/// A Move Module.
3529#[non_exhaustive]
3530#[derive(Clone, PartialEq, ::prost::Message)]
3531pub struct Module {
3532    /// Name of this module.
3533    #[prost(string, optional, tag = "1")]
3534    pub name: ::core::option::Option<::prost::alloc::string::String>,
3535    /// Serialized bytecode of the module.
3536    #[prost(bytes = "bytes", optional, tag = "2")]
3537    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3538    /// List of DataTypes defined by this module.
3539    #[prost(message, repeated, tag = "3")]
3540    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3541    /// List of Functions defined by this module.
3542    #[prost(message, repeated, tag = "4")]
3543    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3544}
3545/// Describes a Move Datatype.
3546#[non_exhaustive]
3547#[derive(Clone, PartialEq, ::prost::Message)]
3548pub struct DatatypeDescriptor {
3549    /// Fully qualified name of this Datatype.
3550    ///
3551    /// This is `<defining_id>::<module>::<name>`
3552    #[prost(string, optional, tag = "1")]
3553    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3554    /// PackageId of the package where this Datatype is defined.
3555    ///
3556    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
3557    #[prost(string, optional, tag = "2")]
3558    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3559    /// Name of the module where this Datatype is defined
3560    #[prost(string, optional, tag = "3")]
3561    pub module: ::core::option::Option<::prost::alloc::string::String>,
3562    /// Name of this Datatype
3563    #[prost(string, optional, tag = "4")]
3564    pub name: ::core::option::Option<::prost::alloc::string::String>,
3565    /// This type's abilities
3566    #[prost(enumeration = "Ability", repeated, tag = "5")]
3567    pub abilities: ::prost::alloc::vec::Vec<i32>,
3568    /// Ability constraints and phantom status for this type's generic type parameters
3569    #[prost(message, repeated, tag = "6")]
3570    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3571    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
3572    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3573    pub kind: ::core::option::Option<i32>,
3574    /// Set of fields if this Datatype is a struct.
3575    ///
3576    /// The order of the entries is the order of how the fields are defined.
3577    #[prost(message, repeated, tag = "8")]
3578    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3579    /// Set of variants if this Datatype is an enum.
3580    ///
3581    /// The order of the entries is the order of how the variants are defined.
3582    #[prost(message, repeated, tag = "9")]
3583    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3584}
3585/// Nested message and enum types in `DatatypeDescriptor`.
3586pub mod datatype_descriptor {
3587    #[non_exhaustive]
3588    #[derive(
3589        Clone,
3590        Copy,
3591        Debug,
3592        PartialEq,
3593        Eq,
3594        Hash,
3595        PartialOrd,
3596        Ord,
3597        ::prost::Enumeration
3598    )]
3599    #[repr(i32)]
3600    pub enum DatatypeKind {
3601        Unknown = 0,
3602        Struct = 1,
3603        Enum = 2,
3604    }
3605    impl DatatypeKind {
3606        /// String value of the enum field names used in the ProtoBuf definition.
3607        ///
3608        /// The values are not transformed in any way and thus are considered stable
3609        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3610        pub fn as_str_name(&self) -> &'static str {
3611            match self {
3612                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3613                Self::Struct => "STRUCT",
3614                Self::Enum => "ENUM",
3615            }
3616        }
3617        /// Creates an enum from field names used in the ProtoBuf definition.
3618        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3619            match value {
3620                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3621                "STRUCT" => Some(Self::Struct),
3622                "ENUM" => Some(Self::Enum),
3623                _ => None,
3624            }
3625        }
3626    }
3627}
3628/// A generic type parameter used in the declaration of a struct or enum.
3629#[non_exhaustive]
3630#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3631pub struct TypeParameter {
3632    /// The type parameter constraints
3633    #[prost(enumeration = "Ability", repeated, tag = "1")]
3634    pub constraints: ::prost::alloc::vec::Vec<i32>,
3635    /// Whether the parameter is declared as phantom
3636    #[prost(bool, optional, tag = "2")]
3637    pub is_phantom: ::core::option::Option<bool>,
3638}
3639/// Descriptor of a field that belongs to a struct or enum variant
3640#[non_exhaustive]
3641#[derive(Clone, PartialEq, ::prost::Message)]
3642pub struct FieldDescriptor {
3643    /// Name of the field
3644    #[prost(string, optional, tag = "1")]
3645    pub name: ::core::option::Option<::prost::alloc::string::String>,
3646    /// Order or position of the field in the struct or enum variant definition.
3647    #[prost(uint32, optional, tag = "2")]
3648    pub position: ::core::option::Option<u32>,
3649    /// The type of the field
3650    #[prost(message, optional, tag = "3")]
3651    pub r#type: ::core::option::Option<OpenSignatureBody>,
3652}
3653/// Descriptor of an enum variant
3654#[non_exhaustive]
3655#[derive(Clone, PartialEq, ::prost::Message)]
3656pub struct VariantDescriptor {
3657    /// Name of the variant
3658    #[prost(string, optional, tag = "1")]
3659    pub name: ::core::option::Option<::prost::alloc::string::String>,
3660    /// Order or position of the variant in the enum definition.
3661    #[prost(uint32, optional, tag = "2")]
3662    pub position: ::core::option::Option<u32>,
3663    /// Set of fields defined by this variant.
3664    #[prost(message, repeated, tag = "3")]
3665    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3666}
3667/// Representation of a type signature that could appear as a field type for a struct or enum
3668#[non_exhaustive]
3669#[derive(Clone, PartialEq, ::prost::Message)]
3670pub struct OpenSignatureBody {
3671    /// Type of this signature
3672    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3673    pub r#type: ::core::option::Option<i32>,
3674    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3675    #[prost(string, optional, tag = "2")]
3676    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3677    /// Set when `type` is `VECTOR` or `DATATYPE`
3678    #[prost(message, repeated, tag = "3")]
3679    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3680    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3681    #[prost(uint32, optional, tag = "4")]
3682    pub type_parameter: ::core::option::Option<u32>,
3683}
3684/// Nested message and enum types in `OpenSignatureBody`.
3685pub mod open_signature_body {
3686    #[non_exhaustive]
3687    #[derive(
3688        Clone,
3689        Copy,
3690        Debug,
3691        PartialEq,
3692        Eq,
3693        Hash,
3694        PartialOrd,
3695        Ord,
3696        ::prost::Enumeration
3697    )]
3698    #[repr(i32)]
3699    pub enum Type {
3700        Unknown = 0,
3701        Address = 1,
3702        Bool = 2,
3703        U8 = 3,
3704        U16 = 4,
3705        U32 = 5,
3706        U64 = 6,
3707        U128 = 7,
3708        U256 = 8,
3709        Vector = 9,
3710        Datatype = 10,
3711        Parameter = 11,
3712    }
3713    impl Type {
3714        /// String value of the enum field names used in the ProtoBuf definition.
3715        ///
3716        /// The values are not transformed in any way and thus are considered stable
3717        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3718        pub fn as_str_name(&self) -> &'static str {
3719            match self {
3720                Self::Unknown => "TYPE_UNKNOWN",
3721                Self::Address => "ADDRESS",
3722                Self::Bool => "BOOL",
3723                Self::U8 => "U8",
3724                Self::U16 => "U16",
3725                Self::U32 => "U32",
3726                Self::U64 => "U64",
3727                Self::U128 => "U128",
3728                Self::U256 => "U256",
3729                Self::Vector => "VECTOR",
3730                Self::Datatype => "DATATYPE",
3731                Self::Parameter => "TYPE_PARAMETER",
3732            }
3733        }
3734        /// Creates an enum from field names used in the ProtoBuf definition.
3735        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3736            match value {
3737                "TYPE_UNKNOWN" => Some(Self::Unknown),
3738                "ADDRESS" => Some(Self::Address),
3739                "BOOL" => Some(Self::Bool),
3740                "U8" => Some(Self::U8),
3741                "U16" => Some(Self::U16),
3742                "U32" => Some(Self::U32),
3743                "U64" => Some(Self::U64),
3744                "U128" => Some(Self::U128),
3745                "U256" => Some(Self::U256),
3746                "VECTOR" => Some(Self::Vector),
3747                "DATATYPE" => Some(Self::Datatype),
3748                "TYPE_PARAMETER" => Some(Self::Parameter),
3749                _ => None,
3750            }
3751        }
3752    }
3753}
3754/// Descriptor of a Move function
3755#[non_exhaustive]
3756#[derive(Clone, PartialEq, ::prost::Message)]
3757pub struct FunctionDescriptor {
3758    /// Name of the function
3759    #[prost(string, optional, tag = "1")]
3760    pub name: ::core::option::Option<::prost::alloc::string::String>,
3761    /// Whether the function is `public`, `private` or `public(friend)`
3762    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3763    pub visibility: ::core::option::Option<i32>,
3764    /// Whether the function is marked `entry` or not.
3765    #[prost(bool, optional, tag = "6")]
3766    pub is_entry: ::core::option::Option<bool>,
3767    /// Ability constraints for type parameters
3768    #[prost(message, repeated, tag = "7")]
3769    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3770    /// Formal parameter types.
3771    #[prost(message, repeated, tag = "8")]
3772    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3773    /// Return types.
3774    #[prost(message, repeated, tag = "9")]
3775    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3776}
3777/// Nested message and enum types in `FunctionDescriptor`.
3778pub mod function_descriptor {
3779    #[non_exhaustive]
3780    #[derive(
3781        Clone,
3782        Copy,
3783        Debug,
3784        PartialEq,
3785        Eq,
3786        Hash,
3787        PartialOrd,
3788        Ord,
3789        ::prost::Enumeration
3790    )]
3791    #[repr(i32)]
3792    pub enum Visibility {
3793        Unknown = 0,
3794        Private = 1,
3795        Public = 2,
3796        Friend = 3,
3797    }
3798    impl Visibility {
3799        /// String value of the enum field names used in the ProtoBuf definition.
3800        ///
3801        /// The values are not transformed in any way and thus are considered stable
3802        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3803        pub fn as_str_name(&self) -> &'static str {
3804            match self {
3805                Self::Unknown => "VISIBILITY_UNKNOWN",
3806                Self::Private => "PRIVATE",
3807                Self::Public => "PUBLIC",
3808                Self::Friend => "FRIEND",
3809            }
3810        }
3811        /// Creates an enum from field names used in the ProtoBuf definition.
3812        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3813            match value {
3814                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3815                "PRIVATE" => Some(Self::Private),
3816                "PUBLIC" => Some(Self::Public),
3817                "FRIEND" => Some(Self::Friend),
3818                _ => None,
3819            }
3820        }
3821    }
3822}
3823/// Representation of a type signature that could appear as a function parameter or return value.
3824#[non_exhaustive]
3825#[derive(Clone, PartialEq, ::prost::Message)]
3826pub struct OpenSignature {
3827    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3828    pub reference: ::core::option::Option<i32>,
3829    #[prost(message, optional, tag = "2")]
3830    pub body: ::core::option::Option<OpenSignatureBody>,
3831}
3832/// Nested message and enum types in `OpenSignature`.
3833pub mod open_signature {
3834    #[non_exhaustive]
3835    #[derive(
3836        Clone,
3837        Copy,
3838        Debug,
3839        PartialEq,
3840        Eq,
3841        Hash,
3842        PartialOrd,
3843        Ord,
3844        ::prost::Enumeration
3845    )]
3846    #[repr(i32)]
3847    pub enum Reference {
3848        Unknown = 0,
3849        Immutable = 1,
3850        Mutable = 2,
3851    }
3852    impl Reference {
3853        /// String value of the enum field names used in the ProtoBuf definition.
3854        ///
3855        /// The values are not transformed in any way and thus are considered stable
3856        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3857        pub fn as_str_name(&self) -> &'static str {
3858            match self {
3859                Self::Unknown => "REFERENCE_UNKNOWN",
3860                Self::Immutable => "IMMUTABLE",
3861                Self::Mutable => "MUTABLE",
3862            }
3863        }
3864        /// Creates an enum from field names used in the ProtoBuf definition.
3865        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3866            match value {
3867                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3868                "IMMUTABLE" => Some(Self::Immutable),
3869                "MUTABLE" => Some(Self::Mutable),
3870                _ => None,
3871            }
3872        }
3873    }
3874}
3875/// Identifies a struct and the module it was defined in.
3876#[non_exhaustive]
3877#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3878pub struct TypeOrigin {
3879    #[prost(string, optional, tag = "1")]
3880    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3881    #[prost(string, optional, tag = "2")]
3882    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3883    #[prost(string, optional, tag = "3")]
3884    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3885}
3886/// Upgraded package info for the linkage table.
3887#[non_exhaustive]
3888#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3889pub struct Linkage {
3890    /// Id of the original package.
3891    #[prost(string, optional, tag = "1")]
3892    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3893    /// Id of the upgraded package.
3894    #[prost(string, optional, tag = "2")]
3895    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3896    /// Version of the upgraded package.
3897    #[prost(uint64, optional, tag = "3")]
3898    pub upgraded_version: ::core::option::Option<u64>,
3899}
3900/// An `Ability` classifies what operations are permitted for a given type
3901#[non_exhaustive]
3902#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3903#[repr(i32)]
3904pub enum Ability {
3905    Unknown = 0,
3906    /// Allows values of types with this ability to be copied
3907    Copy = 1,
3908    /// Allows values of types with this ability to be dropped.
3909    Drop = 2,
3910    /// Allows values of types with this ability to exist inside a struct in global storage
3911    Store = 3,
3912    /// Allows the type to serve as a key for global storage operations
3913    Key = 4,
3914}
3915impl Ability {
3916    /// String value of the enum field names used in the ProtoBuf definition.
3917    ///
3918    /// The values are not transformed in any way and thus are considered stable
3919    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3920    pub fn as_str_name(&self) -> &'static str {
3921        match self {
3922            Self::Unknown => "ABILITY_UNKNOWN",
3923            Self::Copy => "COPY",
3924            Self::Drop => "DROP",
3925            Self::Store => "STORE",
3926            Self::Key => "KEY",
3927        }
3928    }
3929    /// Creates an enum from field names used in the ProtoBuf definition.
3930    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3931        match value {
3932            "ABILITY_UNKNOWN" => Some(Self::Unknown),
3933            "COPY" => Some(Self::Copy),
3934            "DROP" => Some(Self::Drop),
3935            "STORE" => Some(Self::Store),
3936            "KEY" => Some(Self::Key),
3937            _ => None,
3938        }
3939    }
3940}
3941#[non_exhaustive]
3942#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3943pub struct GetPackageRequest {
3944    /// Required. The `storage_id` of any version of the requested package.
3945    ///
3946    /// When `version` is not set, the package stored at exactly this id is
3947    /// returned. When `version` is set, `package_id` only identifies the
3948    /// package's upgrade lineage (via its original id), and the requested
3949    /// version within that lineage is returned.
3950    #[prost(string, optional, tag = "1")]
3951    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3952    /// Optional. Return the package in `package_id`'s upgrade lineage that
3953    /// matches one of the following:
3954    ///
3955    /// * `version`: the package with exactly this version.
3956    /// * `at_checkpoint`: the latest package that existed at or before this
3957    ///   checkpoint. Values above the current ledger tip resolve to the latest
3958    ///   known version.
3959    ///
3960    /// If neither is set, the package stored at `package_id` is returned.
3961    #[prost(oneof = "get_package_request::Selector", tags = "2, 3")]
3962    pub selector: ::core::option::Option<get_package_request::Selector>,
3963}
3964/// Nested message and enum types in `GetPackageRequest`.
3965pub mod get_package_request {
3966    /// Optional. Return the package in `package_id`'s upgrade lineage that
3967    /// matches one of the following:
3968    ///
3969    /// * `version`: the package with exactly this version.
3970    /// * `at_checkpoint`: the latest package that existed at or before this
3971    ///   checkpoint. Values above the current ledger tip resolve to the latest
3972    ///   known version.
3973    ///
3974    /// If neither is set, the package stored at `package_id` is returned.
3975    #[non_exhaustive]
3976    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
3977    pub enum Selector {
3978        #[prost(uint64, tag = "2")]
3979        Version(u64),
3980        #[prost(uint64, tag = "3")]
3981        AtCheckpoint(u64),
3982    }
3983}
3984#[non_exhaustive]
3985#[derive(Clone, PartialEq, ::prost::Message)]
3986pub struct GetPackageResponse {
3987    /// The package.
3988    #[prost(message, optional, tag = "1")]
3989    pub package: ::core::option::Option<Package>,
3990}
3991#[non_exhaustive]
3992#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3993pub struct GetDatatypeRequest {
3994    /// Required. The `storage_id` of the requested package.
3995    #[prost(string, optional, tag = "1")]
3996    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3997    /// Required. The name of the requested module.
3998    #[prost(string, optional, tag = "2")]
3999    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4000    /// Required. The name of the requested datatype.
4001    #[prost(string, optional, tag = "3")]
4002    pub name: ::core::option::Option<::prost::alloc::string::String>,
4003}
4004#[non_exhaustive]
4005#[derive(Clone, PartialEq, ::prost::Message)]
4006pub struct GetDatatypeResponse {
4007    /// The datatype.
4008    #[prost(message, optional, tag = "1")]
4009    pub datatype: ::core::option::Option<DatatypeDescriptor>,
4010}
4011#[non_exhaustive]
4012#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4013pub struct GetFunctionRequest {
4014    /// Required. The `storage_id` of the requested package.
4015    #[prost(string, optional, tag = "1")]
4016    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4017    /// Required. The name of the requested module.
4018    #[prost(string, optional, tag = "2")]
4019    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
4020    /// Required. The name of the requested function.
4021    #[prost(string, optional, tag = "3")]
4022    pub name: ::core::option::Option<::prost::alloc::string::String>,
4023}
4024#[non_exhaustive]
4025#[derive(Clone, PartialEq, ::prost::Message)]
4026pub struct GetFunctionResponse {
4027    /// The function.
4028    #[prost(message, optional, tag = "1")]
4029    pub function: ::core::option::Option<FunctionDescriptor>,
4030}
4031#[non_exhaustive]
4032#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4033pub struct ListPackageVersionsRequest {
4034    /// Required. The `storage_id` of any version of the package.
4035    #[prost(string, optional, tag = "1")]
4036    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4037    /// The maximum number of versions to return. The service may return fewer than this value.
4038    /// If unspecified, at most `1000` entries will be returned.
4039    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
4040    #[prost(uint32, optional, tag = "2")]
4041    pub page_size: ::core::option::Option<u32>,
4042    /// A page token, received from a previous `ListPackageVersions` call.
4043    /// Provide this to retrieve the subsequent page.
4044    ///
4045    /// When paginating, all other parameters provided to `ListPackageVersions` must
4046    /// match the call that provided the page token.
4047    #[prost(bytes = "bytes", optional, tag = "3")]
4048    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
4049}
4050#[non_exhaustive]
4051#[derive(Clone, PartialEq, ::prost::Message)]
4052pub struct ListPackageVersionsResponse {
4053    /// List of all package versions, ordered by version.
4054    #[prost(message, repeated, tag = "1")]
4055    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4056    /// A token, which can be sent as `page_token` to retrieve the next page.
4057    /// If this field is omitted, there are no subsequent pages.
4058    #[prost(bytes = "bytes", optional, tag = "2")]
4059    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4060}
4061/// A simplified representation of a package version
4062#[non_exhaustive]
4063#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4064pub struct PackageVersion {
4065    /// The storage ID of this package version
4066    #[prost(string, optional, tag = "1")]
4067    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4068    /// The version number
4069    #[prost(uint64, optional, tag = "2")]
4070    pub version: ::core::option::Option<u64>,
4071}
4072/// Generated client implementations.
4073pub mod move_package_service_client {
4074    #![allow(
4075        unused_variables,
4076        dead_code,
4077        missing_docs,
4078        clippy::wildcard_imports,
4079        clippy::let_unit_value,
4080    )]
4081    use tonic::codegen::*;
4082    use tonic::codegen::http::Uri;
4083    #[derive(Debug, Clone)]
4084    pub struct MovePackageServiceClient<T> {
4085        inner: tonic::client::Grpc<T>,
4086    }
4087    impl MovePackageServiceClient<tonic::transport::Channel> {
4088        /// Attempt to create a new client by connecting to a given endpoint.
4089        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4090        where
4091            D: TryInto<tonic::transport::Endpoint>,
4092            D::Error: Into<StdError>,
4093        {
4094            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4095            Ok(Self::new(conn))
4096        }
4097    }
4098    impl<T> MovePackageServiceClient<T>
4099    where
4100        T: tonic::client::GrpcService<tonic::body::Body>,
4101        T::Error: Into<StdError>,
4102        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4103        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4104    {
4105        pub fn new(inner: T) -> Self {
4106            let inner = tonic::client::Grpc::new(inner);
4107            Self { inner }
4108        }
4109        pub fn with_origin(inner: T, origin: Uri) -> Self {
4110            let inner = tonic::client::Grpc::with_origin(inner, origin);
4111            Self { inner }
4112        }
4113        pub fn with_interceptor<F>(
4114            inner: T,
4115            interceptor: F,
4116        ) -> MovePackageServiceClient<InterceptedService<T, F>>
4117        where
4118            F: tonic::service::Interceptor,
4119            T::ResponseBody: Default,
4120            T: tonic::codegen::Service<
4121                http::Request<tonic::body::Body>,
4122                Response = http::Response<
4123                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4124                >,
4125            >,
4126            <T as tonic::codegen::Service<
4127                http::Request<tonic::body::Body>,
4128            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4129        {
4130            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4131        }
4132        /// Compress requests with the given encoding.
4133        ///
4134        /// This requires the server to support it otherwise it might respond with an
4135        /// error.
4136        #[must_use]
4137        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4138            self.inner = self.inner.send_compressed(encoding);
4139            self
4140        }
4141        /// Enable decompressing responses.
4142        #[must_use]
4143        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4144            self.inner = self.inner.accept_compressed(encoding);
4145            self
4146        }
4147        /// Limits the maximum size of a decoded message.
4148        ///
4149        /// Default: `4MB`
4150        #[must_use]
4151        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4152            self.inner = self.inner.max_decoding_message_size(limit);
4153            self
4154        }
4155        /// Limits the maximum size of an encoded message.
4156        ///
4157        /// Default: `usize::MAX`
4158        #[must_use]
4159        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4160            self.inner = self.inner.max_encoding_message_size(limit);
4161            self
4162        }
4163        pub async fn get_package(
4164            &mut self,
4165            request: impl tonic::IntoRequest<super::GetPackageRequest>,
4166        ) -> std::result::Result<
4167            tonic::Response<super::GetPackageResponse>,
4168            tonic::Status,
4169        > {
4170            self.inner
4171                .ready()
4172                .await
4173                .map_err(|e| {
4174                    tonic::Status::unknown(
4175                        format!("Service was not ready: {}", e.into()),
4176                    )
4177                })?;
4178            let codec = tonic_prost::ProstCodec::default();
4179            let path = http::uri::PathAndQuery::from_static(
4180                "/sui.rpc.v2.MovePackageService/GetPackage",
4181            );
4182            let mut req = request.into_request();
4183            req.extensions_mut()
4184                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4185            self.inner.unary(req, path, codec).await
4186        }
4187        pub async fn get_datatype(
4188            &mut self,
4189            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4190        ) -> std::result::Result<
4191            tonic::Response<super::GetDatatypeResponse>,
4192            tonic::Status,
4193        > {
4194            self.inner
4195                .ready()
4196                .await
4197                .map_err(|e| {
4198                    tonic::Status::unknown(
4199                        format!("Service was not ready: {}", e.into()),
4200                    )
4201                })?;
4202            let codec = tonic_prost::ProstCodec::default();
4203            let path = http::uri::PathAndQuery::from_static(
4204                "/sui.rpc.v2.MovePackageService/GetDatatype",
4205            );
4206            let mut req = request.into_request();
4207            req.extensions_mut()
4208                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4209            self.inner.unary(req, path, codec).await
4210        }
4211        pub async fn get_function(
4212            &mut self,
4213            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4214        ) -> std::result::Result<
4215            tonic::Response<super::GetFunctionResponse>,
4216            tonic::Status,
4217        > {
4218            self.inner
4219                .ready()
4220                .await
4221                .map_err(|e| {
4222                    tonic::Status::unknown(
4223                        format!("Service was not ready: {}", e.into()),
4224                    )
4225                })?;
4226            let codec = tonic_prost::ProstCodec::default();
4227            let path = http::uri::PathAndQuery::from_static(
4228                "/sui.rpc.v2.MovePackageService/GetFunction",
4229            );
4230            let mut req = request.into_request();
4231            req.extensions_mut()
4232                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4233            self.inner.unary(req, path, codec).await
4234        }
4235        pub async fn list_package_versions(
4236            &mut self,
4237            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4238        ) -> std::result::Result<
4239            tonic::Response<super::ListPackageVersionsResponse>,
4240            tonic::Status,
4241        > {
4242            self.inner
4243                .ready()
4244                .await
4245                .map_err(|e| {
4246                    tonic::Status::unknown(
4247                        format!("Service was not ready: {}", e.into()),
4248                    )
4249                })?;
4250            let codec = tonic_prost::ProstCodec::default();
4251            let path = http::uri::PathAndQuery::from_static(
4252                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4253            );
4254            let mut req = request.into_request();
4255            req.extensions_mut()
4256                .insert(
4257                    GrpcMethod::new(
4258                        "sui.rpc.v2.MovePackageService",
4259                        "ListPackageVersions",
4260                    ),
4261                );
4262            self.inner.unary(req, path, codec).await
4263        }
4264    }
4265}
4266/// Generated server implementations.
4267pub mod move_package_service_server {
4268    #![allow(
4269        unused_variables,
4270        dead_code,
4271        missing_docs,
4272        clippy::wildcard_imports,
4273        clippy::let_unit_value,
4274    )]
4275    use tonic::codegen::*;
4276    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
4277    #[async_trait]
4278    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4279        async fn get_package(
4280            &self,
4281            request: tonic::Request<super::GetPackageRequest>,
4282        ) -> std::result::Result<
4283            tonic::Response<super::GetPackageResponse>,
4284            tonic::Status,
4285        > {
4286            Err(tonic::Status::unimplemented("Not yet implemented"))
4287        }
4288        async fn get_datatype(
4289            &self,
4290            request: tonic::Request<super::GetDatatypeRequest>,
4291        ) -> std::result::Result<
4292            tonic::Response<super::GetDatatypeResponse>,
4293            tonic::Status,
4294        > {
4295            Err(tonic::Status::unimplemented("Not yet implemented"))
4296        }
4297        async fn get_function(
4298            &self,
4299            request: tonic::Request<super::GetFunctionRequest>,
4300        ) -> std::result::Result<
4301            tonic::Response<super::GetFunctionResponse>,
4302            tonic::Status,
4303        > {
4304            Err(tonic::Status::unimplemented("Not yet implemented"))
4305        }
4306        async fn list_package_versions(
4307            &self,
4308            request: tonic::Request<super::ListPackageVersionsRequest>,
4309        ) -> std::result::Result<
4310            tonic::Response<super::ListPackageVersionsResponse>,
4311            tonic::Status,
4312        > {
4313            Err(tonic::Status::unimplemented("Not yet implemented"))
4314        }
4315    }
4316    #[derive(Debug)]
4317    pub struct MovePackageServiceServer<T> {
4318        inner: Arc<T>,
4319        accept_compression_encodings: EnabledCompressionEncodings,
4320        send_compression_encodings: EnabledCompressionEncodings,
4321        max_decoding_message_size: Option<usize>,
4322        max_encoding_message_size: Option<usize>,
4323    }
4324    impl<T> MovePackageServiceServer<T> {
4325        pub fn new(inner: T) -> Self {
4326            Self::from_arc(Arc::new(inner))
4327        }
4328        pub fn from_arc(inner: Arc<T>) -> Self {
4329            Self {
4330                inner,
4331                accept_compression_encodings: Default::default(),
4332                send_compression_encodings: Default::default(),
4333                max_decoding_message_size: None,
4334                max_encoding_message_size: None,
4335            }
4336        }
4337        pub fn with_interceptor<F>(
4338            inner: T,
4339            interceptor: F,
4340        ) -> InterceptedService<Self, F>
4341        where
4342            F: tonic::service::Interceptor,
4343        {
4344            InterceptedService::new(Self::new(inner), interceptor)
4345        }
4346        /// Enable decompressing requests with the given encoding.
4347        #[must_use]
4348        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4349            self.accept_compression_encodings.enable(encoding);
4350            self
4351        }
4352        /// Compress responses with the given encoding, if the client supports it.
4353        #[must_use]
4354        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4355            self.send_compression_encodings.enable(encoding);
4356            self
4357        }
4358        /// Limits the maximum size of a decoded message.
4359        ///
4360        /// Default: `4MB`
4361        #[must_use]
4362        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4363            self.max_decoding_message_size = Some(limit);
4364            self
4365        }
4366        /// Limits the maximum size of an encoded message.
4367        ///
4368        /// Default: `usize::MAX`
4369        #[must_use]
4370        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4371            self.max_encoding_message_size = Some(limit);
4372            self
4373        }
4374    }
4375    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4376    where
4377        T: MovePackageService,
4378        B: Body + std::marker::Send + 'static,
4379        B::Error: Into<StdError> + std::marker::Send + 'static,
4380    {
4381        type Response = http::Response<tonic::body::Body>;
4382        type Error = std::convert::Infallible;
4383        type Future = BoxFuture<Self::Response, Self::Error>;
4384        fn poll_ready(
4385            &mut self,
4386            _cx: &mut Context<'_>,
4387        ) -> Poll<std::result::Result<(), Self::Error>> {
4388            Poll::Ready(Ok(()))
4389        }
4390        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4391            match req.uri().path() {
4392                "/sui.rpc.v2.MovePackageService/GetPackage" => {
4393                    #[allow(non_camel_case_types)]
4394                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4395                    impl<
4396                        T: MovePackageService,
4397                    > tonic::server::UnaryService<super::GetPackageRequest>
4398                    for GetPackageSvc<T> {
4399                        type Response = super::GetPackageResponse;
4400                        type Future = BoxFuture<
4401                            tonic::Response<Self::Response>,
4402                            tonic::Status,
4403                        >;
4404                        fn call(
4405                            &mut self,
4406                            request: tonic::Request<super::GetPackageRequest>,
4407                        ) -> Self::Future {
4408                            let inner = Arc::clone(&self.0);
4409                            let fut = async move {
4410                                <T as MovePackageService>::get_package(&inner, request)
4411                                    .await
4412                            };
4413                            Box::pin(fut)
4414                        }
4415                    }
4416                    let accept_compression_encodings = self.accept_compression_encodings;
4417                    let send_compression_encodings = self.send_compression_encodings;
4418                    let max_decoding_message_size = self.max_decoding_message_size;
4419                    let max_encoding_message_size = self.max_encoding_message_size;
4420                    let inner = self.inner.clone();
4421                    let fut = async move {
4422                        let method = GetPackageSvc(inner);
4423                        let codec = tonic_prost::ProstCodec::default();
4424                        let mut grpc = tonic::server::Grpc::new(codec)
4425                            .apply_compression_config(
4426                                accept_compression_encodings,
4427                                send_compression_encodings,
4428                            )
4429                            .apply_max_message_size_config(
4430                                max_decoding_message_size,
4431                                max_encoding_message_size,
4432                            );
4433                        let res = grpc.unary(method, req).await;
4434                        Ok(res)
4435                    };
4436                    Box::pin(fut)
4437                }
4438                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4439                    #[allow(non_camel_case_types)]
4440                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4441                    impl<
4442                        T: MovePackageService,
4443                    > tonic::server::UnaryService<super::GetDatatypeRequest>
4444                    for GetDatatypeSvc<T> {
4445                        type Response = super::GetDatatypeResponse;
4446                        type Future = BoxFuture<
4447                            tonic::Response<Self::Response>,
4448                            tonic::Status,
4449                        >;
4450                        fn call(
4451                            &mut self,
4452                            request: tonic::Request<super::GetDatatypeRequest>,
4453                        ) -> Self::Future {
4454                            let inner = Arc::clone(&self.0);
4455                            let fut = async move {
4456                                <T as MovePackageService>::get_datatype(&inner, request)
4457                                    .await
4458                            };
4459                            Box::pin(fut)
4460                        }
4461                    }
4462                    let accept_compression_encodings = self.accept_compression_encodings;
4463                    let send_compression_encodings = self.send_compression_encodings;
4464                    let max_decoding_message_size = self.max_decoding_message_size;
4465                    let max_encoding_message_size = self.max_encoding_message_size;
4466                    let inner = self.inner.clone();
4467                    let fut = async move {
4468                        let method = GetDatatypeSvc(inner);
4469                        let codec = tonic_prost::ProstCodec::default();
4470                        let mut grpc = tonic::server::Grpc::new(codec)
4471                            .apply_compression_config(
4472                                accept_compression_encodings,
4473                                send_compression_encodings,
4474                            )
4475                            .apply_max_message_size_config(
4476                                max_decoding_message_size,
4477                                max_encoding_message_size,
4478                            );
4479                        let res = grpc.unary(method, req).await;
4480                        Ok(res)
4481                    };
4482                    Box::pin(fut)
4483                }
4484                "/sui.rpc.v2.MovePackageService/GetFunction" => {
4485                    #[allow(non_camel_case_types)]
4486                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4487                    impl<
4488                        T: MovePackageService,
4489                    > tonic::server::UnaryService<super::GetFunctionRequest>
4490                    for GetFunctionSvc<T> {
4491                        type Response = super::GetFunctionResponse;
4492                        type Future = BoxFuture<
4493                            tonic::Response<Self::Response>,
4494                            tonic::Status,
4495                        >;
4496                        fn call(
4497                            &mut self,
4498                            request: tonic::Request<super::GetFunctionRequest>,
4499                        ) -> Self::Future {
4500                            let inner = Arc::clone(&self.0);
4501                            let fut = async move {
4502                                <T as MovePackageService>::get_function(&inner, request)
4503                                    .await
4504                            };
4505                            Box::pin(fut)
4506                        }
4507                    }
4508                    let accept_compression_encodings = self.accept_compression_encodings;
4509                    let send_compression_encodings = self.send_compression_encodings;
4510                    let max_decoding_message_size = self.max_decoding_message_size;
4511                    let max_encoding_message_size = self.max_encoding_message_size;
4512                    let inner = self.inner.clone();
4513                    let fut = async move {
4514                        let method = GetFunctionSvc(inner);
4515                        let codec = tonic_prost::ProstCodec::default();
4516                        let mut grpc = tonic::server::Grpc::new(codec)
4517                            .apply_compression_config(
4518                                accept_compression_encodings,
4519                                send_compression_encodings,
4520                            )
4521                            .apply_max_message_size_config(
4522                                max_decoding_message_size,
4523                                max_encoding_message_size,
4524                            );
4525                        let res = grpc.unary(method, req).await;
4526                        Ok(res)
4527                    };
4528                    Box::pin(fut)
4529                }
4530                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4531                    #[allow(non_camel_case_types)]
4532                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4533                    impl<
4534                        T: MovePackageService,
4535                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4536                    for ListPackageVersionsSvc<T> {
4537                        type Response = super::ListPackageVersionsResponse;
4538                        type Future = BoxFuture<
4539                            tonic::Response<Self::Response>,
4540                            tonic::Status,
4541                        >;
4542                        fn call(
4543                            &mut self,
4544                            request: tonic::Request<super::ListPackageVersionsRequest>,
4545                        ) -> Self::Future {
4546                            let inner = Arc::clone(&self.0);
4547                            let fut = async move {
4548                                <T as MovePackageService>::list_package_versions(
4549                                        &inner,
4550                                        request,
4551                                    )
4552                                    .await
4553                            };
4554                            Box::pin(fut)
4555                        }
4556                    }
4557                    let accept_compression_encodings = self.accept_compression_encodings;
4558                    let send_compression_encodings = self.send_compression_encodings;
4559                    let max_decoding_message_size = self.max_decoding_message_size;
4560                    let max_encoding_message_size = self.max_encoding_message_size;
4561                    let inner = self.inner.clone();
4562                    let fut = async move {
4563                        let method = ListPackageVersionsSvc(inner);
4564                        let codec = tonic_prost::ProstCodec::default();
4565                        let mut grpc = tonic::server::Grpc::new(codec)
4566                            .apply_compression_config(
4567                                accept_compression_encodings,
4568                                send_compression_encodings,
4569                            )
4570                            .apply_max_message_size_config(
4571                                max_decoding_message_size,
4572                                max_encoding_message_size,
4573                            );
4574                        let res = grpc.unary(method, req).await;
4575                        Ok(res)
4576                    };
4577                    Box::pin(fut)
4578                }
4579                _ => {
4580                    Box::pin(async move {
4581                        let mut response = http::Response::new(
4582                            tonic::body::Body::default(),
4583                        );
4584                        let headers = response.headers_mut();
4585                        headers
4586                            .insert(
4587                                tonic::Status::GRPC_STATUS,
4588                                (tonic::Code::Unimplemented as i32).into(),
4589                            );
4590                        headers
4591                            .insert(
4592                                http::header::CONTENT_TYPE,
4593                                tonic::metadata::GRPC_CONTENT_TYPE,
4594                            );
4595                        Ok(response)
4596                    })
4597                }
4598            }
4599        }
4600    }
4601    impl<T> Clone for MovePackageServiceServer<T> {
4602        fn clone(&self) -> Self {
4603            let inner = self.inner.clone();
4604            Self {
4605                inner,
4606                accept_compression_encodings: self.accept_compression_encodings,
4607                send_compression_encodings: self.send_compression_encodings,
4608                max_decoding_message_size: self.max_decoding_message_size,
4609                max_encoding_message_size: self.max_encoding_message_size,
4610            }
4611        }
4612    }
4613    /// Generated gRPC service name
4614    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4615    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4616        const NAME: &'static str = SERVICE_NAME;
4617    }
4618}
4619#[non_exhaustive]
4620#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4621pub struct LookupNameRequest {
4622    /// Required. The SuiNS name to lookup.
4623    ///
4624    /// Supports both `@name` as well as `name.sui` formats.
4625    #[prost(string, optional, tag = "1")]
4626    pub name: ::core::option::Option<::prost::alloc::string::String>,
4627}
4628#[non_exhaustive]
4629#[derive(Clone, PartialEq, ::prost::Message)]
4630pub struct LookupNameResponse {
4631    /// The record for the requested name
4632    #[prost(message, optional, tag = "1")]
4633    pub record: ::core::option::Option<NameRecord>,
4634}
4635#[non_exhaustive]
4636#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4637pub struct ReverseLookupNameRequest {
4638    /// Required. The address to perform a reverse lookup for.
4639    #[prost(string, optional, tag = "1")]
4640    pub address: ::core::option::Option<::prost::alloc::string::String>,
4641}
4642#[non_exhaustive]
4643#[derive(Clone, PartialEq, ::prost::Message)]
4644pub struct ReverseLookupNameResponse {
4645    /// The record for the SuiNS name linked to the requested address
4646    #[prost(message, optional, tag = "1")]
4647    pub record: ::core::option::Option<NameRecord>,
4648}
4649#[non_exhaustive]
4650#[derive(Clone, PartialEq, ::prost::Message)]
4651pub struct NameRecord {
4652    /// Id of this record.
4653    ///
4654    /// Note that records are stored on chain as dynamic fields of the type
4655    /// `Field<Domain,NameRecord>`.
4656    #[prost(string, optional, tag = "1")]
4657    pub id: ::core::option::Option<::prost::alloc::string::String>,
4658    /// The SuiNS name of this record
4659    #[prost(string, optional, tag = "2")]
4660    pub name: ::core::option::Option<::prost::alloc::string::String>,
4661    /// The ID of the `RegistrationNFT` assigned to this record.
4662    ///
4663    /// The owner of the corresponding `RegistrationNFT` has the rights to
4664    /// be able to change and adjust the `target_address` of this domain.
4665    ///
4666    /// It is possible that the ID changes if the record expires and is
4667    /// purchased by someone else.
4668    #[prost(string, optional, tag = "3")]
4669    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4670    /// Timestamp when the record expires.
4671    ///
4672    /// This is either the expiration of the record itself or the expiration of
4673    /// this record's parent if this is a leaf record.
4674    #[prost(message, optional, tag = "4")]
4675    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4676    /// The target address that this name points to
4677    #[prost(string, optional, tag = "5")]
4678    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4679    /// Additional data which may be stored in a record
4680    #[prost(btree_map = "string, string", tag = "6")]
4681    pub data: ::prost::alloc::collections::BTreeMap<
4682        ::prost::alloc::string::String,
4683        ::prost::alloc::string::String,
4684    >,
4685}
4686/// Generated client implementations.
4687pub mod name_service_client {
4688    #![allow(
4689        unused_variables,
4690        dead_code,
4691        missing_docs,
4692        clippy::wildcard_imports,
4693        clippy::let_unit_value,
4694    )]
4695    use tonic::codegen::*;
4696    use tonic::codegen::http::Uri;
4697    #[derive(Debug, Clone)]
4698    pub struct NameServiceClient<T> {
4699        inner: tonic::client::Grpc<T>,
4700    }
4701    impl NameServiceClient<tonic::transport::Channel> {
4702        /// Attempt to create a new client by connecting to a given endpoint.
4703        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4704        where
4705            D: TryInto<tonic::transport::Endpoint>,
4706            D::Error: Into<StdError>,
4707        {
4708            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4709            Ok(Self::new(conn))
4710        }
4711    }
4712    impl<T> NameServiceClient<T>
4713    where
4714        T: tonic::client::GrpcService<tonic::body::Body>,
4715        T::Error: Into<StdError>,
4716        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4717        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4718    {
4719        pub fn new(inner: T) -> Self {
4720            let inner = tonic::client::Grpc::new(inner);
4721            Self { inner }
4722        }
4723        pub fn with_origin(inner: T, origin: Uri) -> Self {
4724            let inner = tonic::client::Grpc::with_origin(inner, origin);
4725            Self { inner }
4726        }
4727        pub fn with_interceptor<F>(
4728            inner: T,
4729            interceptor: F,
4730        ) -> NameServiceClient<InterceptedService<T, F>>
4731        where
4732            F: tonic::service::Interceptor,
4733            T::ResponseBody: Default,
4734            T: tonic::codegen::Service<
4735                http::Request<tonic::body::Body>,
4736                Response = http::Response<
4737                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4738                >,
4739            >,
4740            <T as tonic::codegen::Service<
4741                http::Request<tonic::body::Body>,
4742            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4743        {
4744            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4745        }
4746        /// Compress requests with the given encoding.
4747        ///
4748        /// This requires the server to support it otherwise it might respond with an
4749        /// error.
4750        #[must_use]
4751        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4752            self.inner = self.inner.send_compressed(encoding);
4753            self
4754        }
4755        /// Enable decompressing responses.
4756        #[must_use]
4757        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4758            self.inner = self.inner.accept_compressed(encoding);
4759            self
4760        }
4761        /// Limits the maximum size of a decoded message.
4762        ///
4763        /// Default: `4MB`
4764        #[must_use]
4765        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4766            self.inner = self.inner.max_decoding_message_size(limit);
4767            self
4768        }
4769        /// Limits the maximum size of an encoded message.
4770        ///
4771        /// Default: `usize::MAX`
4772        #[must_use]
4773        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4774            self.inner = self.inner.max_encoding_message_size(limit);
4775            self
4776        }
4777        pub async fn lookup_name(
4778            &mut self,
4779            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4780        ) -> std::result::Result<
4781            tonic::Response<super::LookupNameResponse>,
4782            tonic::Status,
4783        > {
4784            self.inner
4785                .ready()
4786                .await
4787                .map_err(|e| {
4788                    tonic::Status::unknown(
4789                        format!("Service was not ready: {}", e.into()),
4790                    )
4791                })?;
4792            let codec = tonic_prost::ProstCodec::default();
4793            let path = http::uri::PathAndQuery::from_static(
4794                "/sui.rpc.v2.NameService/LookupName",
4795            );
4796            let mut req = request.into_request();
4797            req.extensions_mut()
4798                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4799            self.inner.unary(req, path, codec).await
4800        }
4801        pub async fn reverse_lookup_name(
4802            &mut self,
4803            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4804        ) -> std::result::Result<
4805            tonic::Response<super::ReverseLookupNameResponse>,
4806            tonic::Status,
4807        > {
4808            self.inner
4809                .ready()
4810                .await
4811                .map_err(|e| {
4812                    tonic::Status::unknown(
4813                        format!("Service was not ready: {}", e.into()),
4814                    )
4815                })?;
4816            let codec = tonic_prost::ProstCodec::default();
4817            let path = http::uri::PathAndQuery::from_static(
4818                "/sui.rpc.v2.NameService/ReverseLookupName",
4819            );
4820            let mut req = request.into_request();
4821            req.extensions_mut()
4822                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4823            self.inner.unary(req, path, codec).await
4824        }
4825    }
4826}
4827/// Generated server implementations.
4828pub mod name_service_server {
4829    #![allow(
4830        unused_variables,
4831        dead_code,
4832        missing_docs,
4833        clippy::wildcard_imports,
4834        clippy::let_unit_value,
4835    )]
4836    use tonic::codegen::*;
4837    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4838    #[async_trait]
4839    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4840        async fn lookup_name(
4841            &self,
4842            request: tonic::Request<super::LookupNameRequest>,
4843        ) -> std::result::Result<
4844            tonic::Response<super::LookupNameResponse>,
4845            tonic::Status,
4846        > {
4847            Err(tonic::Status::unimplemented("Not yet implemented"))
4848        }
4849        async fn reverse_lookup_name(
4850            &self,
4851            request: tonic::Request<super::ReverseLookupNameRequest>,
4852        ) -> std::result::Result<
4853            tonic::Response<super::ReverseLookupNameResponse>,
4854            tonic::Status,
4855        > {
4856            Err(tonic::Status::unimplemented("Not yet implemented"))
4857        }
4858    }
4859    #[derive(Debug)]
4860    pub struct NameServiceServer<T> {
4861        inner: Arc<T>,
4862        accept_compression_encodings: EnabledCompressionEncodings,
4863        send_compression_encodings: EnabledCompressionEncodings,
4864        max_decoding_message_size: Option<usize>,
4865        max_encoding_message_size: Option<usize>,
4866    }
4867    impl<T> NameServiceServer<T> {
4868        pub fn new(inner: T) -> Self {
4869            Self::from_arc(Arc::new(inner))
4870        }
4871        pub fn from_arc(inner: Arc<T>) -> Self {
4872            Self {
4873                inner,
4874                accept_compression_encodings: Default::default(),
4875                send_compression_encodings: Default::default(),
4876                max_decoding_message_size: None,
4877                max_encoding_message_size: None,
4878            }
4879        }
4880        pub fn with_interceptor<F>(
4881            inner: T,
4882            interceptor: F,
4883        ) -> InterceptedService<Self, F>
4884        where
4885            F: tonic::service::Interceptor,
4886        {
4887            InterceptedService::new(Self::new(inner), interceptor)
4888        }
4889        /// Enable decompressing requests with the given encoding.
4890        #[must_use]
4891        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4892            self.accept_compression_encodings.enable(encoding);
4893            self
4894        }
4895        /// Compress responses with the given encoding, if the client supports it.
4896        #[must_use]
4897        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4898            self.send_compression_encodings.enable(encoding);
4899            self
4900        }
4901        /// Limits the maximum size of a decoded message.
4902        ///
4903        /// Default: `4MB`
4904        #[must_use]
4905        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4906            self.max_decoding_message_size = Some(limit);
4907            self
4908        }
4909        /// Limits the maximum size of an encoded message.
4910        ///
4911        /// Default: `usize::MAX`
4912        #[must_use]
4913        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4914            self.max_encoding_message_size = Some(limit);
4915            self
4916        }
4917    }
4918    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4919    where
4920        T: NameService,
4921        B: Body + std::marker::Send + 'static,
4922        B::Error: Into<StdError> + std::marker::Send + 'static,
4923    {
4924        type Response = http::Response<tonic::body::Body>;
4925        type Error = std::convert::Infallible;
4926        type Future = BoxFuture<Self::Response, Self::Error>;
4927        fn poll_ready(
4928            &mut self,
4929            _cx: &mut Context<'_>,
4930        ) -> Poll<std::result::Result<(), Self::Error>> {
4931            Poll::Ready(Ok(()))
4932        }
4933        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4934            match req.uri().path() {
4935                "/sui.rpc.v2.NameService/LookupName" => {
4936                    #[allow(non_camel_case_types)]
4937                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
4938                    impl<
4939                        T: NameService,
4940                    > tonic::server::UnaryService<super::LookupNameRequest>
4941                    for LookupNameSvc<T> {
4942                        type Response = super::LookupNameResponse;
4943                        type Future = BoxFuture<
4944                            tonic::Response<Self::Response>,
4945                            tonic::Status,
4946                        >;
4947                        fn call(
4948                            &mut self,
4949                            request: tonic::Request<super::LookupNameRequest>,
4950                        ) -> Self::Future {
4951                            let inner = Arc::clone(&self.0);
4952                            let fut = async move {
4953                                <T as NameService>::lookup_name(&inner, request).await
4954                            };
4955                            Box::pin(fut)
4956                        }
4957                    }
4958                    let accept_compression_encodings = self.accept_compression_encodings;
4959                    let send_compression_encodings = self.send_compression_encodings;
4960                    let max_decoding_message_size = self.max_decoding_message_size;
4961                    let max_encoding_message_size = self.max_encoding_message_size;
4962                    let inner = self.inner.clone();
4963                    let fut = async move {
4964                        let method = LookupNameSvc(inner);
4965                        let codec = tonic_prost::ProstCodec::default();
4966                        let mut grpc = tonic::server::Grpc::new(codec)
4967                            .apply_compression_config(
4968                                accept_compression_encodings,
4969                                send_compression_encodings,
4970                            )
4971                            .apply_max_message_size_config(
4972                                max_decoding_message_size,
4973                                max_encoding_message_size,
4974                            );
4975                        let res = grpc.unary(method, req).await;
4976                        Ok(res)
4977                    };
4978                    Box::pin(fut)
4979                }
4980                "/sui.rpc.v2.NameService/ReverseLookupName" => {
4981                    #[allow(non_camel_case_types)]
4982                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4983                    impl<
4984                        T: NameService,
4985                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4986                    for ReverseLookupNameSvc<T> {
4987                        type Response = super::ReverseLookupNameResponse;
4988                        type Future = BoxFuture<
4989                            tonic::Response<Self::Response>,
4990                            tonic::Status,
4991                        >;
4992                        fn call(
4993                            &mut self,
4994                            request: tonic::Request<super::ReverseLookupNameRequest>,
4995                        ) -> Self::Future {
4996                            let inner = Arc::clone(&self.0);
4997                            let fut = async move {
4998                                <T as NameService>::reverse_lookup_name(&inner, request)
4999                                    .await
5000                            };
5001                            Box::pin(fut)
5002                        }
5003                    }
5004                    let accept_compression_encodings = self.accept_compression_encodings;
5005                    let send_compression_encodings = self.send_compression_encodings;
5006                    let max_decoding_message_size = self.max_decoding_message_size;
5007                    let max_encoding_message_size = self.max_encoding_message_size;
5008                    let inner = self.inner.clone();
5009                    let fut = async move {
5010                        let method = ReverseLookupNameSvc(inner);
5011                        let codec = tonic_prost::ProstCodec::default();
5012                        let mut grpc = tonic::server::Grpc::new(codec)
5013                            .apply_compression_config(
5014                                accept_compression_encodings,
5015                                send_compression_encodings,
5016                            )
5017                            .apply_max_message_size_config(
5018                                max_decoding_message_size,
5019                                max_encoding_message_size,
5020                            );
5021                        let res = grpc.unary(method, req).await;
5022                        Ok(res)
5023                    };
5024                    Box::pin(fut)
5025                }
5026                _ => {
5027                    Box::pin(async move {
5028                        let mut response = http::Response::new(
5029                            tonic::body::Body::default(),
5030                        );
5031                        let headers = response.headers_mut();
5032                        headers
5033                            .insert(
5034                                tonic::Status::GRPC_STATUS,
5035                                (tonic::Code::Unimplemented as i32).into(),
5036                            );
5037                        headers
5038                            .insert(
5039                                http::header::CONTENT_TYPE,
5040                                tonic::metadata::GRPC_CONTENT_TYPE,
5041                            );
5042                        Ok(response)
5043                    })
5044                }
5045            }
5046        }
5047    }
5048    impl<T> Clone for NameServiceServer<T> {
5049        fn clone(&self) -> Self {
5050            let inner = self.inner.clone();
5051            Self {
5052                inner,
5053                accept_compression_encodings: self.accept_compression_encodings,
5054                send_compression_encodings: self.send_compression_encodings,
5055                max_decoding_message_size: self.max_decoding_message_size,
5056                max_encoding_message_size: self.max_encoding_message_size,
5057            }
5058        }
5059    }
5060    /// Generated gRPC service name
5061    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5062    impl<T> tonic::server::NamedService for NameServiceServer<T> {
5063        const NAME: &'static str = SERVICE_NAME;
5064    }
5065}
5066/// An object on the Sui blockchain.
5067#[non_exhaustive]
5068#[derive(Clone, PartialEq, ::prost::Message)]
5069pub struct Object {
5070    /// This Object serialized as BCS.
5071    #[prost(message, optional, tag = "1")]
5072    pub bcs: ::core::option::Option<Bcs>,
5073    /// `ObjectId` for this object.
5074    #[prost(string, optional, tag = "2")]
5075    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5076    /// Version of the object.
5077    #[prost(uint64, optional, tag = "3")]
5078    pub version: ::core::option::Option<u64>,
5079    /// The digest of this Object.
5080    #[prost(string, optional, tag = "4")]
5081    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5082    /// Owner of the object.
5083    #[prost(message, optional, tag = "5")]
5084    pub owner: ::core::option::Option<Owner>,
5085    /// The type of this object.
5086    ///
5087    /// This will be 'package' for packages and a StructTag for move structs.
5088    #[prost(string, optional, tag = "6")]
5089    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5090    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
5091    /// object. Instead, it is always calculated from the objects type when loaded in execution.
5092    ///
5093    /// Only set for Move structs
5094    #[prost(bool, optional, tag = "7")]
5095    pub has_public_transfer: ::core::option::Option<bool>,
5096    /// BCS bytes of a Move struct value.
5097    ///
5098    /// Only set for Move structs
5099    #[prost(message, optional, tag = "8")]
5100    pub contents: ::core::option::Option<Bcs>,
5101    /// Package information for Move Packages
5102    #[prost(message, optional, tag = "9")]
5103    pub package: ::core::option::Option<Package>,
5104    /// The digest of the transaction that created or last mutated this object
5105    #[prost(string, optional, tag = "10")]
5106    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5107    /// The amount of SUI to rebate if this object gets deleted.
5108    /// This number is re-calculated each time the object is mutated based on
5109    /// the present storage gas price.
5110    #[prost(uint64, optional, tag = "11")]
5111    pub storage_rebate: ::core::option::Option<u64>,
5112    /// JSON rendering of the object.
5113    #[prost(message, optional, boxed, tag = "100")]
5114    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5115    /// Current balance if this object is a `0x2::coin::Coin<T>`
5116    #[prost(uint64, optional, tag = "101")]
5117    pub balance: ::core::option::Option<u64>,
5118    /// JSON rendering of the object based on an on-chain template.
5119    /// This will not be set if the value's type does not have an associated `Display` template.
5120    #[prost(message, optional, boxed, tag = "102")]
5121    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5122}
5123/// Set of Objects
5124#[non_exhaustive]
5125#[derive(Clone, PartialEq, ::prost::Message)]
5126pub struct ObjectSet {
5127    /// Objects are sorted by the key `(object_id, version)`.
5128    #[prost(message, repeated, tag = "1")]
5129    pub objects: ::prost::alloc::vec::Vec<Object>,
5130}
5131/// A rendered JSON blob based on an on-chain template.
5132#[non_exhaustive]
5133#[derive(Clone, PartialEq, ::prost::Message)]
5134pub struct Display {
5135    /// Output for all successfully substituted display fields. Unsuccessful
5136    /// fields will be `null`, and will be accompanied by a field in `errors`,
5137    /// explaining the error.
5138    #[prost(message, optional, tag = "1")]
5139    pub output: ::core::option::Option<::prost_types::Value>,
5140    /// If any fields failed to render, this will contain a mapping from failed
5141    /// field names to error messages. If all fields succeed, this will either be
5142    /// `null` or not set.
5143    #[prost(message, optional, tag = "2")]
5144    pub errors: ::core::option::Option<::prost_types::Value>,
5145}
5146/// Reference to an object.
5147#[non_exhaustive]
5148#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5149pub struct ObjectReference {
5150    /// The object id of this object.
5151    #[prost(string, optional, tag = "1")]
5152    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5153    /// The version of this object.
5154    #[prost(uint64, optional, tag = "2")]
5155    pub version: ::core::option::Option<u64>,
5156    /// The digest of this object.
5157    #[prost(string, optional, tag = "3")]
5158    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5159}
5160/// Enum of different types of ownership for an object.
5161#[non_exhaustive]
5162#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5163pub struct Owner {
5164    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5165    pub kind: ::core::option::Option<i32>,
5166    /// Address or ObjectId of the owner
5167    #[prost(string, optional, tag = "2")]
5168    pub address: ::core::option::Option<::prost::alloc::string::String>,
5169    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
5170    #[prost(uint64, optional, tag = "3")]
5171    pub version: ::core::option::Option<u64>,
5172}
5173/// Nested message and enum types in `Owner`.
5174pub mod owner {
5175    #[non_exhaustive]
5176    #[derive(
5177        Clone,
5178        Copy,
5179        Debug,
5180        PartialEq,
5181        Eq,
5182        Hash,
5183        PartialOrd,
5184        Ord,
5185        ::prost::Enumeration
5186    )]
5187    #[repr(i32)]
5188    pub enum OwnerKind {
5189        Unknown = 0,
5190        Address = 1,
5191        Object = 2,
5192        Shared = 3,
5193        Immutable = 4,
5194        ConsensusAddress = 5,
5195    }
5196    impl OwnerKind {
5197        /// String value of the enum field names used in the ProtoBuf definition.
5198        ///
5199        /// The values are not transformed in any way and thus are considered stable
5200        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5201        pub fn as_str_name(&self) -> &'static str {
5202            match self {
5203                Self::Unknown => "OWNER_KIND_UNKNOWN",
5204                Self::Address => "ADDRESS",
5205                Self::Object => "OBJECT",
5206                Self::Shared => "SHARED",
5207                Self::Immutable => "IMMUTABLE",
5208                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5209            }
5210        }
5211        /// Creates an enum from field names used in the ProtoBuf definition.
5212        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5213            match value {
5214                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5215                "ADDRESS" => Some(Self::Address),
5216                "OBJECT" => Some(Self::Object),
5217                "SHARED" => Some(Self::Shared),
5218                "IMMUTABLE" => Some(Self::Immutable),
5219                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5220                _ => None,
5221            }
5222        }
5223    }
5224}
5225#[non_exhaustive]
5226#[derive(Clone, PartialEq, ::prost::Message)]
5227pub struct ProtocolConfig {
5228    #[prost(uint64, optional, tag = "1")]
5229    pub protocol_version: ::core::option::Option<u64>,
5230    /// Deprecated in favor of the lossless `configs` field.
5231    #[prost(btree_map = "string, bool", tag = "2")]
5232    pub feature_flags: ::prost::alloc::collections::BTreeMap<
5233        ::prost::alloc::string::String,
5234        bool,
5235    >,
5236    /// Deprecated in favor of the lossless `configs` field.
5237    #[prost(btree_map = "string, string", tag = "3")]
5238    pub attributes: ::prost::alloc::collections::BTreeMap<
5239        ::prost::alloc::string::String,
5240        ::prost::alloc::string::String,
5241    >,
5242    #[prost(btree_map = "string, message", tag = "4")]
5243    pub configs: ::prost::alloc::collections::BTreeMap<
5244        ::prost::alloc::string::String,
5245        ::prost_types::Value,
5246    >,
5247}
5248/// Cursor-bounded query options.
5249///
5250/// `after` and `before` are canonical ledger-position bounds, not
5251/// ordering-relative cursors. `after` always excludes items at or below that
5252/// cursor, and `before` always excludes items at or above that cursor. Ordering
5253/// only controls the order of returned items within the resulting open interval.
5254///
5255/// When a request also specifies a checkpoint range, cursor bounds and
5256/// checkpoint bounds compose by intersection: results come only from ledger
5257/// positions inside both. Checkpoint bounds are likewise canonical and
5258/// ordering-independent.
5259///
5260/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
5261/// `limit = N`, the response contains up to N matching items in descending
5262/// order from the interval `(A, B)`. If the response ends with
5263/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
5264/// `before` to the last `Watermark.cursor` received. That cursor is the
5265/// lowest position reached in ledger order, so it becomes the next exclusive
5266/// upper bound.
5267#[non_exhaustive]
5268#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5269pub struct QueryOptions {
5270    /// The maximum number of items to return. Each method applies its own default
5271    /// and maximum. QueryEnd does not count against this limit.
5272    #[prost(uint32, optional, tag = "1")]
5273    pub limit: ::core::option::Option<u32>,
5274    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
5275    /// canonical ledger order.
5276    #[prost(bytes = "bytes", optional, tag = "2")]
5277    pub after: ::core::option::Option<::prost::bytes::Bytes>,
5278    /// Opaque exclusive upper bound. Results must be strictly before this cursor
5279    /// in canonical ledger order.
5280    #[prost(bytes = "bytes", optional, tag = "3")]
5281    pub before: ::core::option::Option<::prost::bytes::Bytes>,
5282    /// Ordering for returned results. Defaults to ASCENDING.
5283    ///
5284    /// Ordering only controls the order of results within the bounded interval;
5285    /// cursor bounds keep the same meaning for ascending and descending reads.
5286    #[prost(enumeration = "Ordering", optional, tag = "4")]
5287    pub ordering: ::core::option::Option<i32>,
5288}
5289/// Progress marker for a query scan. Carried on every response frame, whether or
5290/// not the frame delivers a matching item. Watermarks never regress in the
5291/// requested ordering, but consecutive frames may carry the same watermark when
5292/// additional work does not advance the safe resume frontier.
5293#[non_exhaustive]
5294#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5295pub struct Watermark {
5296    /// Opaque cursor at this scan position. Set on every watermark. Use as
5297    /// `options.after` (ascending) or `options.before` (descending) on the next
5298    /// request to resume from here. The most recently received cursor is always
5299    /// the safe resume point.
5300    #[prost(bytes = "bytes", optional, tag = "1")]
5301    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5302    /// The inclusive boundary checkpoint that the scan has fully covered within
5303    /// the request's effective interval, in the request's ordering direction: an
5304    /// ascending scan has emitted every matching item in the interval at
5305    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
5306    /// matches); a descending scan has emitted every matching item in the
5307    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
5308    /// the scan direction, but it may repeat while the cursor advances.
5309    ///
5310    /// Unset until the scan's first checkpoint is fully covered. For example, a
5311    /// scan resumed from a cursor that lands mid-checkpoint leaves this unset
5312    /// until the next checkpoint boundary in the scan direction is fully covered.
5313    /// A watermark still has a valid resume cursor while this field is unset.
5314    #[prost(uint64, optional, tag = "2")]
5315    pub checkpoint: ::core::option::Option<u64>,
5316}
5317/// Marker for the final frame of a successful query stream. Every successful
5318/// stream sets `QueryEnd` on exactly one frame, after which no further frames
5319/// are sent. That frame always carries the final watermark. For `ItemLimit`, it
5320/// also carries the final matching item; for every other reason it carries no
5321/// item. A ScanLimit terminal watermark may repeat the previous frame's cursor
5322/// when its authoritative scan frontier was already emitted; this does not
5323/// repeat an item.
5324///
5325/// A stream that fails or is cancelled terminates with a gRPC status and does
5326/// not send `QueryEnd`.
5327#[non_exhaustive]
5328#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5329pub struct QueryEnd {
5330    /// Reason this response stopped.
5331    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5332    pub reason: ::core::option::Option<i32>,
5333}
5334/// Ordering for the returned result set.
5335#[non_exhaustive]
5336#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5337#[repr(i32)]
5338pub enum Ordering {
5339    /// Return results in increasing cursor order.
5340    Ascending = 0,
5341    /// Return results in decreasing cursor order.
5342    Descending = 1,
5343}
5344impl Ordering {
5345    /// String value of the enum field names used in the ProtoBuf definition.
5346    ///
5347    /// The values are not transformed in any way and thus are considered stable
5348    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5349    pub fn as_str_name(&self) -> &'static str {
5350        match self {
5351            Self::Ascending => "ORDERING_ASCENDING",
5352            Self::Descending => "ORDERING_DESCENDING",
5353        }
5354    }
5355    /// Creates an enum from field names used in the ProtoBuf definition.
5356    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5357        match value {
5358            "ORDERING_ASCENDING" => Some(Self::Ascending),
5359            "ORDERING_DESCENDING" => Some(Self::Descending),
5360            _ => None,
5361        }
5362    }
5363}
5364/// Reason the server stopped this query response.
5365#[non_exhaustive]
5366#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5367#[repr(i32)]
5368pub enum QueryEndReason {
5369    /// The stop reason was not specified.
5370    Unknown = 0,
5371    /// The response reached the requested item limit. The final matching item's
5372    /// frame carries `QueryEnd` and the final watermark. Resume from that frame's
5373    /// `Watermark.cursor` to continue reading the same effective interval.
5374    ItemLimit = 1,
5375    /// The response reached the server's per-request bucket-fetch budget for
5376    /// filtered scans before reaching the effective interval bound. The terminal
5377    /// frame carries no item. Its watermark cursor is the authoritative scan
5378    /// frontier from which to resume.
5379    ScanLimit = 2,
5380    /// The scan reached a requested checkpoint range bound. The terminal frame
5381    /// carries no item.
5382    CheckpointBound = 3,
5383    /// The scan reached an exclusive cursor bound. The terminal frame carries no
5384    /// item. Its watermark cursor represents that resolved bound without claiming
5385    /// that its containing checkpoint was fully covered.
5386    CursorBound = 4,
5387    /// The scan reached the currently indexed ledger tip. The terminal frame
5388    /// carries no item.
5389    LedgerTip = 5,
5390}
5391impl QueryEndReason {
5392    /// String value of the enum field names used in the ProtoBuf definition.
5393    ///
5394    /// The values are not transformed in any way and thus are considered stable
5395    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5396    pub fn as_str_name(&self) -> &'static str {
5397        match self {
5398            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5399            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5400            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5401            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5402            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5403            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5404        }
5405    }
5406    /// Creates an enum from field names used in the ProtoBuf definition.
5407    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5408        match value {
5409            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5410            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5411            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5412            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5413            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5414            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5415            _ => None,
5416        }
5417    }
5418}
5419/// A signature from a user.
5420#[non_exhaustive]
5421#[derive(Clone, PartialEq, ::prost::Message)]
5422pub struct UserSignature {
5423    /// This signature serialized as as BCS.
5424    ///
5425    /// When provided as input this will support both the form that is length
5426    /// prefixed as well as not length prefixed.
5427    #[prost(message, optional, tag = "1")]
5428    pub bcs: ::core::option::Option<Bcs>,
5429    /// The signature scheme of this signature.
5430    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5431    pub scheme: ::core::option::Option<i32>,
5432    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5433    pub signature: ::core::option::Option<user_signature::Signature>,
5434}
5435/// Nested message and enum types in `UserSignature`.
5436pub mod user_signature {
5437    #[non_exhaustive]
5438    #[derive(Clone, PartialEq, ::prost::Oneof)]
5439    pub enum Signature {
5440        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
5441        #[prost(message, tag = "3")]
5442        Simple(super::SimpleSignature),
5443        /// The multisig aggregated signature if scheme is `MULTISIG`.
5444        #[prost(message, tag = "4")]
5445        Multisig(super::MultisigAggregatedSignature),
5446        /// The zklogin authenticator if scheme is `ZKLOGIN`.
5447        #[prost(message, tag = "5")]
5448        Zklogin(super::ZkLoginAuthenticator),
5449        /// The passkey authenticator if scheme is `PASSKEY`.
5450        #[prost(message, tag = "6")]
5451        Passkey(super::PasskeyAuthenticator),
5452    }
5453}
5454/// Either an ed25519, secp256k1 or secp256r1 signature
5455#[non_exhaustive]
5456#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5457pub struct SimpleSignature {
5458    /// The signature scheme of this signature.
5459    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5460    pub scheme: ::core::option::Option<i32>,
5461    /// Signature bytes
5462    #[prost(bytes = "bytes", optional, tag = "2")]
5463    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5464    /// Public key bytes
5465    #[prost(bytes = "bytes", optional, tag = "3")]
5466    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5467}
5468/// Public key equivalent for zklogin authenticators.
5469#[non_exhaustive]
5470#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5471pub struct ZkLoginPublicIdentifier {
5472    #[prost(string, optional, tag = "1")]
5473    pub iss: ::core::option::Option<::prost::alloc::string::String>,
5474    /// base10 encoded Bn254FieldElement
5475    #[prost(string, optional, tag = "2")]
5476    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5477}
5478/// Set of valid public keys for multisig committee members.
5479#[non_exhaustive]
5480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5481pub struct MultisigMemberPublicKey {
5482    /// The signature scheme of this public key.
5483    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5484    pub scheme: ::core::option::Option<i32>,
5485    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
5486    #[prost(bytes = "bytes", optional, tag = "2")]
5487    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5488    /// A zklogin public identifier if scheme is zklogin.
5489    #[prost(message, optional, tag = "3")]
5490    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5491}
5492/// A member in a multisig committee.
5493#[non_exhaustive]
5494#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5495pub struct MultisigMember {
5496    /// The public key of the committee member.
5497    #[prost(message, optional, tag = "1")]
5498    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5499    /// The weight of this member's signature.
5500    #[prost(uint32, optional, tag = "2")]
5501    pub weight: ::core::option::Option<u32>,
5502}
5503/// A multisig committee.
5504#[non_exhaustive]
5505#[derive(Clone, PartialEq, ::prost::Message)]
5506pub struct MultisigCommittee {
5507    /// A list of committee members and their corresponding weight.
5508    #[prost(message, repeated, tag = "1")]
5509    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5510    /// The threshold of signatures needed to validate a signature from
5511    /// this committee.
5512    #[prost(uint32, optional, tag = "2")]
5513    pub threshold: ::core::option::Option<u32>,
5514}
5515/// Aggregated signature from members of a multisig committee.
5516#[non_exhaustive]
5517#[derive(Clone, PartialEq, ::prost::Message)]
5518pub struct MultisigAggregatedSignature {
5519    /// The plain signatures encoded with signature scheme.
5520    ///
5521    /// The signatures must be in the same order as they are listed in the committee.
5522    #[prost(message, repeated, tag = "1")]
5523    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5524    /// Bitmap indicating which committee members contributed to the
5525    /// signature.
5526    #[prost(uint32, optional, tag = "2")]
5527    pub bitmap: ::core::option::Option<u32>,
5528    /// If present, means this signature's on-chain format uses the old
5529    /// legacy multisig format.
5530    #[prost(bytes = "bytes", optional, tag = "3")]
5531    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5532    /// The committee to use to validate this signature.
5533    #[prost(message, optional, tag = "4")]
5534    pub committee: ::core::option::Option<MultisigCommittee>,
5535}
5536/// A signature from a member of a multisig committee.
5537#[non_exhaustive]
5538#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5539pub struct MultisigMemberSignature {
5540    /// The signature scheme of this signature.
5541    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5542    pub scheme: ::core::option::Option<i32>,
5543    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
5544    #[prost(bytes = "bytes", optional, tag = "2")]
5545    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5546    /// The zklogin authenticator if scheme is `ZKLOGIN`.
5547    #[prost(message, optional, tag = "3")]
5548    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5549    /// The passkey authenticator if scheme is `PASSKEY`.
5550    #[prost(message, optional, tag = "4")]
5551    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5552}
5553/// A zklogin authenticator.
5554#[non_exhaustive]
5555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5556pub struct ZkLoginAuthenticator {
5557    /// Zklogin proof and inputs required to perform proof verification.
5558    #[prost(message, optional, tag = "1")]
5559    pub inputs: ::core::option::Option<ZkLoginInputs>,
5560    /// Maximum epoch for which the proof is valid.
5561    #[prost(uint64, optional, tag = "2")]
5562    pub max_epoch: ::core::option::Option<u64>,
5563    /// User signature with the public key attested to by the provided proof.
5564    #[prost(message, optional, tag = "3")]
5565    pub signature: ::core::option::Option<SimpleSignature>,
5566    /// The public identifier (similar to a public key) for this zklogin authenticator
5567    #[prost(message, optional, tag = "4")]
5568    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5569    /// The id of the JWK used to authorize this zklogin authenticator
5570    #[prost(message, optional, tag = "5")]
5571    pub jwk_id: ::core::option::Option<JwkId>,
5572}
5573/// A zklogin groth16 proof and the required inputs to perform proof verification.
5574#[non_exhaustive]
5575#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5576pub struct ZkLoginInputs {
5577    #[prost(message, optional, tag = "1")]
5578    pub proof_points: ::core::option::Option<ZkLoginProof>,
5579    #[prost(message, optional, tag = "2")]
5580    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5581    #[prost(string, optional, tag = "3")]
5582    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5583    /// base10 encoded Bn254FieldElement
5584    #[prost(string, optional, tag = "4")]
5585    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5586}
5587/// A zklogin groth16 proof.
5588#[non_exhaustive]
5589#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5590pub struct ZkLoginProof {
5591    #[prost(message, optional, tag = "1")]
5592    pub a: ::core::option::Option<CircomG1>,
5593    #[prost(message, optional, tag = "2")]
5594    pub b: ::core::option::Option<CircomG2>,
5595    #[prost(message, optional, tag = "3")]
5596    pub c: ::core::option::Option<CircomG1>,
5597}
5598/// A claim of the iss in a zklogin proof.
5599#[non_exhaustive]
5600#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5601pub struct ZkLoginClaim {
5602    #[prost(string, optional, tag = "1")]
5603    pub value: ::core::option::Option<::prost::alloc::string::String>,
5604    #[prost(uint32, optional, tag = "2")]
5605    pub index_mod_4: ::core::option::Option<u32>,
5606}
5607/// A G1 point.
5608#[non_exhaustive]
5609#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5610pub struct CircomG1 {
5611    /// base10 encoded Bn254FieldElement
5612    #[prost(string, optional, tag = "1")]
5613    pub e0: ::core::option::Option<::prost::alloc::string::String>,
5614    /// base10 encoded Bn254FieldElement
5615    #[prost(string, optional, tag = "2")]
5616    pub e1: ::core::option::Option<::prost::alloc::string::String>,
5617    /// base10 encoded Bn254FieldElement
5618    #[prost(string, optional, tag = "3")]
5619    pub e2: ::core::option::Option<::prost::alloc::string::String>,
5620}
5621/// A G2 point.
5622#[non_exhaustive]
5623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5624pub struct CircomG2 {
5625    /// base10 encoded Bn254FieldElement
5626    #[prost(string, optional, tag = "1")]
5627    pub e00: ::core::option::Option<::prost::alloc::string::String>,
5628    /// base10 encoded Bn254FieldElement
5629    #[prost(string, optional, tag = "2")]
5630    pub e01: ::core::option::Option<::prost::alloc::string::String>,
5631    /// base10 encoded Bn254FieldElement
5632    #[prost(string, optional, tag = "3")]
5633    pub e10: ::core::option::Option<::prost::alloc::string::String>,
5634    /// base10 encoded Bn254FieldElement
5635    #[prost(string, optional, tag = "4")]
5636    pub e11: ::core::option::Option<::prost::alloc::string::String>,
5637    /// base10 encoded Bn254FieldElement
5638    #[prost(string, optional, tag = "5")]
5639    pub e20: ::core::option::Option<::prost::alloc::string::String>,
5640    /// base10 encoded Bn254FieldElement
5641    #[prost(string, optional, tag = "6")]
5642    pub e21: ::core::option::Option<::prost::alloc::string::String>,
5643}
5644/// A passkey authenticator.
5645///
5646/// See
5647/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
5648/// for more information on the requirements on the shape of the
5649/// `client_data_json` field.
5650#[non_exhaustive]
5651#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5652pub struct PasskeyAuthenticator {
5653    /// Opaque authenticator data for this passkey signature.
5654    ///
5655    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
5656    /// more information on this field.
5657    #[prost(bytes = "bytes", optional, tag = "1")]
5658    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5659    /// Structured, unparsed, JSON for this passkey signature.
5660    ///
5661    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
5662    /// for more information on this field.
5663    #[prost(string, optional, tag = "2")]
5664    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5665    /// A secp256r1 signature.
5666    #[prost(message, optional, tag = "3")]
5667    pub signature: ::core::option::Option<SimpleSignature>,
5668}
5669/// The validator set for a particular epoch.
5670#[non_exhaustive]
5671#[derive(Clone, PartialEq, ::prost::Message)]
5672pub struct ValidatorCommittee {
5673    /// The epoch where this committee governs.
5674    #[prost(uint64, optional, tag = "1")]
5675    pub epoch: ::core::option::Option<u64>,
5676    /// The committee members.
5677    #[prost(message, repeated, tag = "2")]
5678    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5679}
5680/// A member of a validator committee.
5681#[non_exhaustive]
5682#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5683pub struct ValidatorCommitteeMember {
5684    /// The 96-byte Bls12381 public key for this validator.
5685    #[prost(bytes = "bytes", optional, tag = "1")]
5686    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5687    /// voting weight this validator possesses.
5688    #[prost(uint64, optional, tag = "2")]
5689    pub weight: ::core::option::Option<u64>,
5690}
5691/// / An aggregated signature from multiple validators.
5692#[non_exhaustive]
5693#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5694pub struct ValidatorAggregatedSignature {
5695    /// The epoch when this signature was produced.
5696    ///
5697    /// This can be used to lookup the `ValidatorCommittee` from this epoch
5698    /// to verify this signature.
5699    #[prost(uint64, optional, tag = "1")]
5700    pub epoch: ::core::option::Option<u64>,
5701    /// The 48-byte Bls12381 aggregated signature.
5702    #[prost(bytes = "bytes", optional, tag = "2")]
5703    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5704    /// Bitmap indicating which members of the committee contributed to
5705    /// this signature.
5706    #[prost(bytes = "bytes", optional, tag = "3")]
5707    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5708}
5709/// Flag use to disambiguate the signature schemes supported by Sui.
5710///
5711/// Note: the enum values defined by this proto message exactly match their
5712/// expected BCS serialized values when serialized as a u8. See
5713/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
5714/// for more information about signature schemes.
5715#[non_exhaustive]
5716#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5717#[repr(i32)]
5718pub enum SignatureScheme {
5719    Ed25519 = 0,
5720    Secp256k1 = 1,
5721    Secp256r1 = 2,
5722    Multisig = 3,
5723    Bls12381 = 4,
5724    Zklogin = 5,
5725    Passkey = 6,
5726}
5727impl SignatureScheme {
5728    /// String value of the enum field names used in the ProtoBuf definition.
5729    ///
5730    /// The values are not transformed in any way and thus are considered stable
5731    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5732    pub fn as_str_name(&self) -> &'static str {
5733        match self {
5734            Self::Ed25519 => "ED25519",
5735            Self::Secp256k1 => "SECP256K1",
5736            Self::Secp256r1 => "SECP256R1",
5737            Self::Multisig => "MULTISIG",
5738            Self::Bls12381 => "BLS12381",
5739            Self::Zklogin => "ZKLOGIN",
5740            Self::Passkey => "PASSKEY",
5741        }
5742    }
5743    /// Creates an enum from field names used in the ProtoBuf definition.
5744    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5745        match value {
5746            "ED25519" => Some(Self::Ed25519),
5747            "SECP256K1" => Some(Self::Secp256k1),
5748            "SECP256R1" => Some(Self::Secp256r1),
5749            "MULTISIG" => Some(Self::Multisig),
5750            "BLS12381" => Some(Self::Bls12381),
5751            "ZKLOGIN" => Some(Self::Zklogin),
5752            "PASSKEY" => Some(Self::Passkey),
5753            _ => None,
5754        }
5755    }
5756}
5757#[non_exhaustive]
5758#[derive(Clone, PartialEq, ::prost::Message)]
5759pub struct VerifySignatureRequest {
5760    /// The message to verify against.
5761    ///
5762    /// Today the only supported message types are `PersonalMessage` and
5763    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
5764    /// message is being verified.
5765    #[prost(message, optional, tag = "1")]
5766    pub message: ::core::option::Option<Bcs>,
5767    /// The signature to verify.
5768    #[prost(message, optional, tag = "2")]
5769    pub signature: ::core::option::Option<UserSignature>,
5770    /// Optional. Address to validate against the provided signature.
5771    ///
5772    /// If provided, this address will be compared against the the address derived
5773    /// from the provide signature and a successful response will only be returned
5774    /// if they match.
5775    #[prost(string, optional, tag = "3")]
5776    pub address: ::core::option::Option<::prost::alloc::string::String>,
5777    /// The set of JWKs to use when verifying Zklogin signatures.
5778    /// If this is empty the current set of valid JWKs stored onchain will be used
5779    #[prost(message, repeated, tag = "4")]
5780    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5781}
5782#[non_exhaustive]
5783#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5784pub struct VerifySignatureResponse {
5785    /// Indicates if the provided signature was valid given the requested parameters.
5786    #[prost(bool, optional, tag = "1")]
5787    pub is_valid: ::core::option::Option<bool>,
5788    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
5789    #[prost(string, optional, tag = "2")]
5790    pub reason: ::core::option::Option<::prost::alloc::string::String>,
5791}
5792/// Generated client implementations.
5793pub mod signature_verification_service_client {
5794    #![allow(
5795        unused_variables,
5796        dead_code,
5797        missing_docs,
5798        clippy::wildcard_imports,
5799        clippy::let_unit_value,
5800    )]
5801    use tonic::codegen::*;
5802    use tonic::codegen::http::Uri;
5803    #[derive(Debug, Clone)]
5804    pub struct SignatureVerificationServiceClient<T> {
5805        inner: tonic::client::Grpc<T>,
5806    }
5807    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5808        /// Attempt to create a new client by connecting to a given endpoint.
5809        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5810        where
5811            D: TryInto<tonic::transport::Endpoint>,
5812            D::Error: Into<StdError>,
5813        {
5814            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5815            Ok(Self::new(conn))
5816        }
5817    }
5818    impl<T> SignatureVerificationServiceClient<T>
5819    where
5820        T: tonic::client::GrpcService<tonic::body::Body>,
5821        T::Error: Into<StdError>,
5822        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5823        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5824    {
5825        pub fn new(inner: T) -> Self {
5826            let inner = tonic::client::Grpc::new(inner);
5827            Self { inner }
5828        }
5829        pub fn with_origin(inner: T, origin: Uri) -> Self {
5830            let inner = tonic::client::Grpc::with_origin(inner, origin);
5831            Self { inner }
5832        }
5833        pub fn with_interceptor<F>(
5834            inner: T,
5835            interceptor: F,
5836        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5837        where
5838            F: tonic::service::Interceptor,
5839            T::ResponseBody: Default,
5840            T: tonic::codegen::Service<
5841                http::Request<tonic::body::Body>,
5842                Response = http::Response<
5843                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5844                >,
5845            >,
5846            <T as tonic::codegen::Service<
5847                http::Request<tonic::body::Body>,
5848            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5849        {
5850            SignatureVerificationServiceClient::new(
5851                InterceptedService::new(inner, interceptor),
5852            )
5853        }
5854        /// Compress requests with the given encoding.
5855        ///
5856        /// This requires the server to support it otherwise it might respond with an
5857        /// error.
5858        #[must_use]
5859        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5860            self.inner = self.inner.send_compressed(encoding);
5861            self
5862        }
5863        /// Enable decompressing responses.
5864        #[must_use]
5865        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5866            self.inner = self.inner.accept_compressed(encoding);
5867            self
5868        }
5869        /// Limits the maximum size of a decoded message.
5870        ///
5871        /// Default: `4MB`
5872        #[must_use]
5873        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5874            self.inner = self.inner.max_decoding_message_size(limit);
5875            self
5876        }
5877        /// Limits the maximum size of an encoded message.
5878        ///
5879        /// Default: `usize::MAX`
5880        #[must_use]
5881        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5882            self.inner = self.inner.max_encoding_message_size(limit);
5883            self
5884        }
5885        /// Perform signature verification of a UserSignature against the provided message.
5886        pub async fn verify_signature(
5887            &mut self,
5888            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5889        ) -> std::result::Result<
5890            tonic::Response<super::VerifySignatureResponse>,
5891            tonic::Status,
5892        > {
5893            self.inner
5894                .ready()
5895                .await
5896                .map_err(|e| {
5897                    tonic::Status::unknown(
5898                        format!("Service was not ready: {}", e.into()),
5899                    )
5900                })?;
5901            let codec = tonic_prost::ProstCodec::default();
5902            let path = http::uri::PathAndQuery::from_static(
5903                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5904            );
5905            let mut req = request.into_request();
5906            req.extensions_mut()
5907                .insert(
5908                    GrpcMethod::new(
5909                        "sui.rpc.v2.SignatureVerificationService",
5910                        "VerifySignature",
5911                    ),
5912                );
5913            self.inner.unary(req, path, codec).await
5914        }
5915    }
5916}
5917/// Generated server implementations.
5918pub mod signature_verification_service_server {
5919    #![allow(
5920        unused_variables,
5921        dead_code,
5922        missing_docs,
5923        clippy::wildcard_imports,
5924        clippy::let_unit_value,
5925    )]
5926    use tonic::codegen::*;
5927    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
5928    #[async_trait]
5929    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5930        /// Perform signature verification of a UserSignature against the provided message.
5931        async fn verify_signature(
5932            &self,
5933            request: tonic::Request<super::VerifySignatureRequest>,
5934        ) -> std::result::Result<
5935            tonic::Response<super::VerifySignatureResponse>,
5936            tonic::Status,
5937        > {
5938            Err(tonic::Status::unimplemented("Not yet implemented"))
5939        }
5940    }
5941    #[derive(Debug)]
5942    pub struct SignatureVerificationServiceServer<T> {
5943        inner: Arc<T>,
5944        accept_compression_encodings: EnabledCompressionEncodings,
5945        send_compression_encodings: EnabledCompressionEncodings,
5946        max_decoding_message_size: Option<usize>,
5947        max_encoding_message_size: Option<usize>,
5948    }
5949    impl<T> SignatureVerificationServiceServer<T> {
5950        pub fn new(inner: T) -> Self {
5951            Self::from_arc(Arc::new(inner))
5952        }
5953        pub fn from_arc(inner: Arc<T>) -> Self {
5954            Self {
5955                inner,
5956                accept_compression_encodings: Default::default(),
5957                send_compression_encodings: Default::default(),
5958                max_decoding_message_size: None,
5959                max_encoding_message_size: None,
5960            }
5961        }
5962        pub fn with_interceptor<F>(
5963            inner: T,
5964            interceptor: F,
5965        ) -> InterceptedService<Self, F>
5966        where
5967            F: tonic::service::Interceptor,
5968        {
5969            InterceptedService::new(Self::new(inner), interceptor)
5970        }
5971        /// Enable decompressing requests with the given encoding.
5972        #[must_use]
5973        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5974            self.accept_compression_encodings.enable(encoding);
5975            self
5976        }
5977        /// Compress responses with the given encoding, if the client supports it.
5978        #[must_use]
5979        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5980            self.send_compression_encodings.enable(encoding);
5981            self
5982        }
5983        /// Limits the maximum size of a decoded message.
5984        ///
5985        /// Default: `4MB`
5986        #[must_use]
5987        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5988            self.max_decoding_message_size = Some(limit);
5989            self
5990        }
5991        /// Limits the maximum size of an encoded message.
5992        ///
5993        /// Default: `usize::MAX`
5994        #[must_use]
5995        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5996            self.max_encoding_message_size = Some(limit);
5997            self
5998        }
5999    }
6000    impl<T, B> tonic::codegen::Service<http::Request<B>>
6001    for SignatureVerificationServiceServer<T>
6002    where
6003        T: SignatureVerificationService,
6004        B: Body + std::marker::Send + 'static,
6005        B::Error: Into<StdError> + std::marker::Send + 'static,
6006    {
6007        type Response = http::Response<tonic::body::Body>;
6008        type Error = std::convert::Infallible;
6009        type Future = BoxFuture<Self::Response, Self::Error>;
6010        fn poll_ready(
6011            &mut self,
6012            _cx: &mut Context<'_>,
6013        ) -> Poll<std::result::Result<(), Self::Error>> {
6014            Poll::Ready(Ok(()))
6015        }
6016        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6017            match req.uri().path() {
6018                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
6019                    #[allow(non_camel_case_types)]
6020                    struct VerifySignatureSvc<T: SignatureVerificationService>(
6021                        pub Arc<T>,
6022                    );
6023                    impl<
6024                        T: SignatureVerificationService,
6025                    > tonic::server::UnaryService<super::VerifySignatureRequest>
6026                    for VerifySignatureSvc<T> {
6027                        type Response = super::VerifySignatureResponse;
6028                        type Future = BoxFuture<
6029                            tonic::Response<Self::Response>,
6030                            tonic::Status,
6031                        >;
6032                        fn call(
6033                            &mut self,
6034                            request: tonic::Request<super::VerifySignatureRequest>,
6035                        ) -> Self::Future {
6036                            let inner = Arc::clone(&self.0);
6037                            let fut = async move {
6038                                <T as SignatureVerificationService>::verify_signature(
6039                                        &inner,
6040                                        request,
6041                                    )
6042                                    .await
6043                            };
6044                            Box::pin(fut)
6045                        }
6046                    }
6047                    let accept_compression_encodings = self.accept_compression_encodings;
6048                    let send_compression_encodings = self.send_compression_encodings;
6049                    let max_decoding_message_size = self.max_decoding_message_size;
6050                    let max_encoding_message_size = self.max_encoding_message_size;
6051                    let inner = self.inner.clone();
6052                    let fut = async move {
6053                        let method = VerifySignatureSvc(inner);
6054                        let codec = tonic_prost::ProstCodec::default();
6055                        let mut grpc = tonic::server::Grpc::new(codec)
6056                            .apply_compression_config(
6057                                accept_compression_encodings,
6058                                send_compression_encodings,
6059                            )
6060                            .apply_max_message_size_config(
6061                                max_decoding_message_size,
6062                                max_encoding_message_size,
6063                            );
6064                        let res = grpc.unary(method, req).await;
6065                        Ok(res)
6066                    };
6067                    Box::pin(fut)
6068                }
6069                _ => {
6070                    Box::pin(async move {
6071                        let mut response = http::Response::new(
6072                            tonic::body::Body::default(),
6073                        );
6074                        let headers = response.headers_mut();
6075                        headers
6076                            .insert(
6077                                tonic::Status::GRPC_STATUS,
6078                                (tonic::Code::Unimplemented as i32).into(),
6079                            );
6080                        headers
6081                            .insert(
6082                                http::header::CONTENT_TYPE,
6083                                tonic::metadata::GRPC_CONTENT_TYPE,
6084                            );
6085                        Ok(response)
6086                    })
6087                }
6088            }
6089        }
6090    }
6091    impl<T> Clone for SignatureVerificationServiceServer<T> {
6092        fn clone(&self) -> Self {
6093            let inner = self.inner.clone();
6094            Self {
6095                inner,
6096                accept_compression_encodings: self.accept_compression_encodings,
6097                send_compression_encodings: self.send_compression_encodings,
6098                max_decoding_message_size: self.max_decoding_message_size,
6099                max_encoding_message_size: self.max_encoding_message_size,
6100            }
6101        }
6102    }
6103    /// Generated gRPC service name
6104    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6105    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6106        const NAME: &'static str = SERVICE_NAME;
6107    }
6108}
6109/// Request message for `NodeService.GetCoinInfo`.
6110#[non_exhaustive]
6111#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6112pub struct GetCoinInfoRequest {
6113    /// The coin type to request information about
6114    #[prost(string, optional, tag = "1")]
6115    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6116}
6117/// Response message for `NodeService.GetCoinInfo`.
6118#[non_exhaustive]
6119#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6120pub struct GetCoinInfoResponse {
6121    /// Required. The coin type.
6122    #[prost(string, optional, tag = "1")]
6123    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6124    /// This field will be populated with information about this coin
6125    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
6126    #[prost(message, optional, tag = "2")]
6127    pub metadata: ::core::option::Option<CoinMetadata>,
6128    /// This field will be populated with information about this coin
6129    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
6130    #[prost(message, optional, tag = "3")]
6131    pub treasury: ::core::option::Option<CoinTreasury>,
6132    /// If this coin type is a regulated coin, this field will be
6133    /// populated with information either from its Currency object
6134    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
6135    /// object for coins that have not been migrated to the CoinRegistry
6136    ///
6137    /// If this coin is not known to be regulated, only the
6138    /// coin_regulated_state field will be populated.
6139    #[prost(message, optional, tag = "4")]
6140    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6141}
6142/// Metadata for a coin type
6143#[non_exhaustive]
6144#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6145pub struct CoinMetadata {
6146    /// ObjectId of the `0x2::coin::CoinMetadata` object or
6147    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
6148    #[prost(string, optional, tag = "1")]
6149    pub id: ::core::option::Option<::prost::alloc::string::String>,
6150    /// Number of decimal places to coin uses.
6151    #[prost(uint32, optional, tag = "2")]
6152    pub decimals: ::core::option::Option<u32>,
6153    /// Name for the token
6154    #[prost(string, optional, tag = "3")]
6155    pub name: ::core::option::Option<::prost::alloc::string::String>,
6156    /// Symbol for the token
6157    #[prost(string, optional, tag = "4")]
6158    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6159    /// Description of the token
6160    #[prost(string, optional, tag = "5")]
6161    pub description: ::core::option::Option<::prost::alloc::string::String>,
6162    /// URL for the token logo
6163    #[prost(string, optional, tag = "6")]
6164    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6165    /// The MetadataCap ID if it has been claimed for this coin type.
6166    /// This capability allows updating the coin's metadata fields.
6167    /// Only populated when metadata is from CoinRegistry.
6168    #[prost(string, optional, tag = "7")]
6169    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6170    /// State of the MetadataCap for this coin type.
6171    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6172    pub metadata_cap_state: ::core::option::Option<i32>,
6173}
6174/// Nested message and enum types in `CoinMetadata`.
6175pub mod coin_metadata {
6176    /// Information about the state of the coin's MetadataCap
6177    #[non_exhaustive]
6178    #[derive(
6179        Clone,
6180        Copy,
6181        Debug,
6182        PartialEq,
6183        Eq,
6184        Hash,
6185        PartialOrd,
6186        Ord,
6187        ::prost::Enumeration
6188    )]
6189    #[repr(i32)]
6190    pub enum MetadataCapState {
6191        /// Indicates the state of the MetadataCap is unknown.
6192        /// Set when the coin has not been migrated to the CoinRegistry.
6193        Unknown = 0,
6194        /// Indicates the MetadataCap has been claimed.
6195        Claimed = 1,
6196        /// Indicates the MetadataCap has not been claimed.
6197        Unclaimed = 2,
6198        /// Indicates the MetadataCap has been deleted.
6199        Deleted = 3,
6200    }
6201    impl MetadataCapState {
6202        /// String value of the enum field names used in the ProtoBuf definition.
6203        ///
6204        /// The values are not transformed in any way and thus are considered stable
6205        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6206        pub fn as_str_name(&self) -> &'static str {
6207            match self {
6208                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6209                Self::Claimed => "CLAIMED",
6210                Self::Unclaimed => "UNCLAIMED",
6211                Self::Deleted => "DELETED",
6212            }
6213        }
6214        /// Creates an enum from field names used in the ProtoBuf definition.
6215        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6216            match value {
6217                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6218                "CLAIMED" => Some(Self::Claimed),
6219                "UNCLAIMED" => Some(Self::Unclaimed),
6220                "DELETED" => Some(Self::Deleted),
6221                _ => None,
6222            }
6223        }
6224    }
6225}
6226/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
6227#[non_exhaustive]
6228#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6229pub struct CoinTreasury {
6230    /// ObjectId of the `0x2::coin::TreasuryCap` object.
6231    #[prost(string, optional, tag = "1")]
6232    pub id: ::core::option::Option<::prost::alloc::string::String>,
6233    /// Total available supply for this coin type.
6234    #[prost(uint64, optional, tag = "2")]
6235    pub total_supply: ::core::option::Option<u64>,
6236    /// Supply state indicating if the supply is fixed or can still be minted
6237    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6238    pub supply_state: ::core::option::Option<i32>,
6239}
6240/// Nested message and enum types in `CoinTreasury`.
6241pub mod coin_treasury {
6242    /// Supply state of a coin, matching the Move SupplyState enum
6243    #[non_exhaustive]
6244    #[derive(
6245        Clone,
6246        Copy,
6247        Debug,
6248        PartialEq,
6249        Eq,
6250        Hash,
6251        PartialOrd,
6252        Ord,
6253        ::prost::Enumeration
6254    )]
6255    #[repr(i32)]
6256    pub enum SupplyState {
6257        /// Supply is unknown or TreasuryCap still exists (minting still possible)
6258        Unknown = 0,
6259        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
6260        Fixed = 1,
6261        /// Supply can only decrease (burning allowed, minting not allowed)
6262        BurnOnly = 2,
6263    }
6264    impl SupplyState {
6265        /// String value of the enum field names used in the ProtoBuf definition.
6266        ///
6267        /// The values are not transformed in any way and thus are considered stable
6268        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6269        pub fn as_str_name(&self) -> &'static str {
6270            match self {
6271                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6272                Self::Fixed => "FIXED",
6273                Self::BurnOnly => "BURN_ONLY",
6274            }
6275        }
6276        /// Creates an enum from field names used in the ProtoBuf definition.
6277        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6278            match value {
6279                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6280                "FIXED" => Some(Self::Fixed),
6281                "BURN_ONLY" => Some(Self::BurnOnly),
6282                _ => None,
6283            }
6284        }
6285    }
6286}
6287/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
6288#[non_exhaustive]
6289#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6290pub struct RegulatedCoinMetadata {
6291    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
6292    /// Only present for coins that have not been migrated to CoinRegistry.
6293    #[prost(string, optional, tag = "1")]
6294    pub id: ::core::option::Option<::prost::alloc::string::String>,
6295    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
6296    #[prost(string, optional, tag = "2")]
6297    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6298    /// The ID of the coin's `DenyCap` object.
6299    #[prost(string, optional, tag = "3")]
6300    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6301    /// Whether the coin can be globally paused
6302    #[prost(bool, optional, tag = "4")]
6303    pub allow_global_pause: ::core::option::Option<bool>,
6304    /// Variant of the regulated coin metadata
6305    #[prost(uint32, optional, tag = "5")]
6306    pub variant: ::core::option::Option<u32>,
6307    /// Indicates the coin's regulated state.
6308    #[prost(
6309        enumeration = "regulated_coin_metadata::CoinRegulatedState",
6310        optional,
6311        tag = "6"
6312    )]
6313    pub coin_regulated_state: ::core::option::Option<i32>,
6314}
6315/// Nested message and enum types in `RegulatedCoinMetadata`.
6316pub mod regulated_coin_metadata {
6317    /// Indicates the state of the regulation of the coin.
6318    #[non_exhaustive]
6319    #[derive(
6320        Clone,
6321        Copy,
6322        Debug,
6323        PartialEq,
6324        Eq,
6325        Hash,
6326        PartialOrd,
6327        Ord,
6328        ::prost::Enumeration
6329    )]
6330    #[repr(i32)]
6331    pub enum CoinRegulatedState {
6332        /// Indicates the regulation state of the coin is unknown.
6333        /// This is set when a coin has not been migrated to the
6334        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
6335        /// object.
6336        Unknown = 0,
6337        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
6338        Regulated = 1,
6339        /// Indicates a coin is unregulated.
6340        Unregulated = 2,
6341    }
6342    impl CoinRegulatedState {
6343        /// String value of the enum field names used in the ProtoBuf definition.
6344        ///
6345        /// The values are not transformed in any way and thus are considered stable
6346        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6347        pub fn as_str_name(&self) -> &'static str {
6348            match self {
6349                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6350                Self::Regulated => "REGULATED",
6351                Self::Unregulated => "UNREGULATED",
6352            }
6353        }
6354        /// Creates an enum from field names used in the ProtoBuf definition.
6355        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6356            match value {
6357                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6358                "REGULATED" => Some(Self::Regulated),
6359                "UNREGULATED" => Some(Self::Unregulated),
6360                _ => None,
6361            }
6362        }
6363    }
6364}
6365/// Request message for `LiveDataService.GetBalance`.
6366#[non_exhaustive]
6367#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6368pub struct GetBalanceRequest {
6369    /// Required. The owner's Sui address.
6370    #[prost(string, optional, tag = "1")]
6371    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6372    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
6373    #[prost(string, optional, tag = "2")]
6374    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6375}
6376/// Response message for `LiveDataService.GetBalance`.
6377/// Return the total coin balance for one coin type, owned by the address owner.
6378#[non_exhaustive]
6379#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6380pub struct GetBalanceResponse {
6381    /// The balance information for the requested coin type.
6382    #[prost(message, optional, tag = "1")]
6383    pub balance: ::core::option::Option<Balance>,
6384}
6385/// Request message for `LiveDataService.ListBalances`.
6386#[non_exhaustive]
6387#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6388pub struct ListBalancesRequest {
6389    /// Required. The owner's Sui address.
6390    #[prost(string, optional, tag = "1")]
6391    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6392    /// The maximum number of balance entries to return. The service may return fewer than this value.
6393    /// If unspecified, at most `50` entries will be returned.
6394    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6395    #[prost(uint32, optional, tag = "2")]
6396    pub page_size: ::core::option::Option<u32>,
6397    /// A page token, received from a previous `ListBalances` call.
6398    /// Provide this to retrieve the subsequent page.
6399    ///
6400    /// When paginating, all other parameters provided to `ListBalances` must
6401    /// match the call that provided the page token.
6402    #[prost(bytes = "bytes", optional, tag = "3")]
6403    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6404}
6405/// Response message for `LiveDataService.ListBalances`.
6406/// Return the total coin balance for all coin types, owned by the address owner.
6407#[non_exhaustive]
6408#[derive(Clone, PartialEq, ::prost::Message)]
6409pub struct ListBalancesResponse {
6410    /// The list of coin types and their respective balances.
6411    #[prost(message, repeated, tag = "1")]
6412    pub balances: ::prost::alloc::vec::Vec<Balance>,
6413    /// A token, which can be sent as `page_token` to retrieve the next page.
6414    /// If this field is omitted, there are no subsequent pages.
6415    #[prost(bytes = "bytes", optional, tag = "2")]
6416    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6417}
6418/// Balance information for a specific coin type.
6419#[non_exhaustive]
6420#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6421pub struct Balance {
6422    /// The type of the coin (e.g., 0x2::sui::SUI).
6423    #[prost(string, optional, tag = "1")]
6424    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6425    /// The total balance of `coin_type` in its smallest unit.
6426    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
6427    /// and `coin_balance`).
6428    #[prost(uint64, optional, tag = "3")]
6429    pub balance: ::core::option::Option<u64>,
6430    /// The balance of `Balance<T>` in this address's Address Balance.
6431    #[prost(uint64, optional, tag = "4")]
6432    pub address_balance: ::core::option::Option<u64>,
6433    /// The balance of all `Coin<T>` objects owned by this address.
6434    #[prost(uint64, optional, tag = "5")]
6435    pub coin_balance: ::core::option::Option<u64>,
6436}
6437/// Request message for `NodeService.ListDynamicFields`
6438#[non_exhaustive]
6439#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6440pub struct ListDynamicFieldsRequest {
6441    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
6442    #[prost(string, optional, tag = "1")]
6443    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6444    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
6445    /// If unspecified, at most `50` entries will be returned.
6446    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6447    #[prost(uint32, optional, tag = "2")]
6448    pub page_size: ::core::option::Option<u32>,
6449    /// A page token, received from a previous `ListDynamicFields` call.
6450    /// Provide this to retrieve the subsequent page.
6451    ///
6452    /// When paginating, all other parameters provided to `ListDynamicFields` must
6453    /// match the call that provided the page token.
6454    #[prost(bytes = "bytes", optional, tag = "3")]
6455    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6456    /// Mask specifying which fields to read.
6457    /// If no mask is specified, defaults to `parent,field_id`.
6458    #[prost(message, optional, tag = "4")]
6459    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6460}
6461/// Response message for `NodeService.ListDynamicFields`
6462#[non_exhaustive]
6463#[derive(Clone, PartialEq, ::prost::Message)]
6464pub struct ListDynamicFieldsResponse {
6465    /// Page of dynamic fields owned by the specified parent.
6466    #[prost(message, repeated, tag = "1")]
6467    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6468    /// A token, which can be sent as `page_token` to retrieve the next page.
6469    /// If this field is omitted, there are no subsequent pages.
6470    #[prost(bytes = "bytes", optional, tag = "2")]
6471    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6472}
6473#[non_exhaustive]
6474#[derive(Clone, PartialEq, ::prost::Message)]
6475pub struct DynamicField {
6476    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6477    pub kind: ::core::option::Option<i32>,
6478    /// ObjectId of this dynamic field's parent.
6479    #[prost(string, optional, tag = "2")]
6480    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6481    /// ObjectId of this dynamic field.
6482    #[prost(string, optional, tag = "3")]
6483    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6484    /// The field object itself
6485    #[prost(message, optional, tag = "4")]
6486    pub field_object: ::core::option::Option<Object>,
6487    /// The dynamic field's "name"
6488    #[prost(message, optional, tag = "5")]
6489    pub name: ::core::option::Option<Bcs>,
6490    /// The dynamic field's "value"
6491    #[prost(message, optional, tag = "6")]
6492    pub value: ::core::option::Option<Bcs>,
6493    /// The type of the dynamic field "value".
6494    ///
6495    /// If this is a dynamic object field then this is the type of the object
6496    /// itself (which is a child of this field), otherwise this is the type of the
6497    /// value of this field.
6498    #[prost(string, optional, tag = "7")]
6499    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6500    /// The ObjectId of the child object when a child is a dynamic
6501    /// object field.
6502    ///
6503    /// The presence or absence of this field can be used to determine if a child
6504    /// is a dynamic field or a dynamic child object
6505    #[prost(string, optional, tag = "8")]
6506    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6507    /// The object itself when a child is a dynamic object field.
6508    #[prost(message, optional, tag = "9")]
6509    pub child_object: ::core::option::Option<Object>,
6510}
6511/// Nested message and enum types in `DynamicField`.
6512pub mod dynamic_field {
6513    #[non_exhaustive]
6514    #[derive(
6515        Clone,
6516        Copy,
6517        Debug,
6518        PartialEq,
6519        Eq,
6520        Hash,
6521        PartialOrd,
6522        Ord,
6523        ::prost::Enumeration
6524    )]
6525    #[repr(i32)]
6526    pub enum DynamicFieldKind {
6527        Unknown = 0,
6528        Field = 1,
6529        Object = 2,
6530    }
6531    impl DynamicFieldKind {
6532        /// String value of the enum field names used in the ProtoBuf definition.
6533        ///
6534        /// The values are not transformed in any way and thus are considered stable
6535        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6536        pub fn as_str_name(&self) -> &'static str {
6537            match self {
6538                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6539                Self::Field => "FIELD",
6540                Self::Object => "OBJECT",
6541            }
6542        }
6543        /// Creates an enum from field names used in the ProtoBuf definition.
6544        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6545            match value {
6546                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6547                "FIELD" => Some(Self::Field),
6548                "OBJECT" => Some(Self::Object),
6549                _ => None,
6550            }
6551        }
6552    }
6553}
6554#[non_exhaustive]
6555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6556pub struct ListOwnedObjectsRequest {
6557    /// Required. The address of the account that owns the objects.
6558    #[prost(string, optional, tag = "1")]
6559    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6560    /// The maximum number of entries return. The service may return fewer than this value.
6561    /// If unspecified, at most `50` entries will be returned.
6562    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6563    #[prost(uint32, optional, tag = "2")]
6564    pub page_size: ::core::option::Option<u32>,
6565    /// A page token, received from a previous `ListOwnedObjects` call.
6566    /// Provide this to retrieve the subsequent page.
6567    ///
6568    /// When paginating, all other parameters provided to `ListOwnedObjects` must
6569    /// match the call that provided the page token.
6570    #[prost(bytes = "bytes", optional, tag = "3")]
6571    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6572    /// Mask specifying which fields to read.
6573    /// If no mask is specified, defaults to `object_id,version,object_type`.
6574    #[prost(message, optional, tag = "4")]
6575    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6576    /// Optional type filter to limit the types of objects listed.
6577    ///
6578    /// Providing an object type with no type params will return objects of that
6579    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
6580    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
6581    /// with a type param will restrict the returned objects to only those objects
6582    /// that match the provided type parameters, e.g.
6583    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
6584    #[prost(string, optional, tag = "5")]
6585    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6586}
6587#[non_exhaustive]
6588#[derive(Clone, PartialEq, ::prost::Message)]
6589pub struct ListOwnedObjectsResponse {
6590    /// Page of dynamic fields owned by the specified parent.
6591    #[prost(message, repeated, tag = "1")]
6592    pub objects: ::prost::alloc::vec::Vec<Object>,
6593    /// A token, which can be sent as `page_token` to retrieve the next page.
6594    /// If this field is omitted, there are no subsequent pages.
6595    #[prost(bytes = "bytes", optional, tag = "2")]
6596    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6597}
6598/// Generated client implementations.
6599pub mod state_service_client {
6600    #![allow(
6601        unused_variables,
6602        dead_code,
6603        missing_docs,
6604        clippy::wildcard_imports,
6605        clippy::let_unit_value,
6606    )]
6607    use tonic::codegen::*;
6608    use tonic::codegen::http::Uri;
6609    #[derive(Debug, Clone)]
6610    pub struct StateServiceClient<T> {
6611        inner: tonic::client::Grpc<T>,
6612    }
6613    impl StateServiceClient<tonic::transport::Channel> {
6614        /// Attempt to create a new client by connecting to a given endpoint.
6615        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6616        where
6617            D: TryInto<tonic::transport::Endpoint>,
6618            D::Error: Into<StdError>,
6619        {
6620            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6621            Ok(Self::new(conn))
6622        }
6623    }
6624    impl<T> StateServiceClient<T>
6625    where
6626        T: tonic::client::GrpcService<tonic::body::Body>,
6627        T::Error: Into<StdError>,
6628        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6629        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6630    {
6631        pub fn new(inner: T) -> Self {
6632            let inner = tonic::client::Grpc::new(inner);
6633            Self { inner }
6634        }
6635        pub fn with_origin(inner: T, origin: Uri) -> Self {
6636            let inner = tonic::client::Grpc::with_origin(inner, origin);
6637            Self { inner }
6638        }
6639        pub fn with_interceptor<F>(
6640            inner: T,
6641            interceptor: F,
6642        ) -> StateServiceClient<InterceptedService<T, F>>
6643        where
6644            F: tonic::service::Interceptor,
6645            T::ResponseBody: Default,
6646            T: tonic::codegen::Service<
6647                http::Request<tonic::body::Body>,
6648                Response = http::Response<
6649                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6650                >,
6651            >,
6652            <T as tonic::codegen::Service<
6653                http::Request<tonic::body::Body>,
6654            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6655        {
6656            StateServiceClient::new(InterceptedService::new(inner, interceptor))
6657        }
6658        /// Compress requests with the given encoding.
6659        ///
6660        /// This requires the server to support it otherwise it might respond with an
6661        /// error.
6662        #[must_use]
6663        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6664            self.inner = self.inner.send_compressed(encoding);
6665            self
6666        }
6667        /// Enable decompressing responses.
6668        #[must_use]
6669        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6670            self.inner = self.inner.accept_compressed(encoding);
6671            self
6672        }
6673        /// Limits the maximum size of a decoded message.
6674        ///
6675        /// Default: `4MB`
6676        #[must_use]
6677        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6678            self.inner = self.inner.max_decoding_message_size(limit);
6679            self
6680        }
6681        /// Limits the maximum size of an encoded message.
6682        ///
6683        /// Default: `usize::MAX`
6684        #[must_use]
6685        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6686            self.inner = self.inner.max_encoding_message_size(limit);
6687            self
6688        }
6689        pub async fn list_dynamic_fields(
6690            &mut self,
6691            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6692        ) -> std::result::Result<
6693            tonic::Response<super::ListDynamicFieldsResponse>,
6694            tonic::Status,
6695        > {
6696            self.inner
6697                .ready()
6698                .await
6699                .map_err(|e| {
6700                    tonic::Status::unknown(
6701                        format!("Service was not ready: {}", e.into()),
6702                    )
6703                })?;
6704            let codec = tonic_prost::ProstCodec::default();
6705            let path = http::uri::PathAndQuery::from_static(
6706                "/sui.rpc.v2.StateService/ListDynamicFields",
6707            );
6708            let mut req = request.into_request();
6709            req.extensions_mut()
6710                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6711            self.inner.unary(req, path, codec).await
6712        }
6713        pub async fn list_owned_objects(
6714            &mut self,
6715            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6716        ) -> std::result::Result<
6717            tonic::Response<super::ListOwnedObjectsResponse>,
6718            tonic::Status,
6719        > {
6720            self.inner
6721                .ready()
6722                .await
6723                .map_err(|e| {
6724                    tonic::Status::unknown(
6725                        format!("Service was not ready: {}", e.into()),
6726                    )
6727                })?;
6728            let codec = tonic_prost::ProstCodec::default();
6729            let path = http::uri::PathAndQuery::from_static(
6730                "/sui.rpc.v2.StateService/ListOwnedObjects",
6731            );
6732            let mut req = request.into_request();
6733            req.extensions_mut()
6734                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6735            self.inner.unary(req, path, codec).await
6736        }
6737        pub async fn get_coin_info(
6738            &mut self,
6739            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6740        ) -> std::result::Result<
6741            tonic::Response<super::GetCoinInfoResponse>,
6742            tonic::Status,
6743        > {
6744            self.inner
6745                .ready()
6746                .await
6747                .map_err(|e| {
6748                    tonic::Status::unknown(
6749                        format!("Service was not ready: {}", e.into()),
6750                    )
6751                })?;
6752            let codec = tonic_prost::ProstCodec::default();
6753            let path = http::uri::PathAndQuery::from_static(
6754                "/sui.rpc.v2.StateService/GetCoinInfo",
6755            );
6756            let mut req = request.into_request();
6757            req.extensions_mut()
6758                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6759            self.inner.unary(req, path, codec).await
6760        }
6761        pub async fn get_balance(
6762            &mut self,
6763            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6764        ) -> std::result::Result<
6765            tonic::Response<super::GetBalanceResponse>,
6766            tonic::Status,
6767        > {
6768            self.inner
6769                .ready()
6770                .await
6771                .map_err(|e| {
6772                    tonic::Status::unknown(
6773                        format!("Service was not ready: {}", e.into()),
6774                    )
6775                })?;
6776            let codec = tonic_prost::ProstCodec::default();
6777            let path = http::uri::PathAndQuery::from_static(
6778                "/sui.rpc.v2.StateService/GetBalance",
6779            );
6780            let mut req = request.into_request();
6781            req.extensions_mut()
6782                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6783            self.inner.unary(req, path, codec).await
6784        }
6785        pub async fn list_balances(
6786            &mut self,
6787            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6788        ) -> std::result::Result<
6789            tonic::Response<super::ListBalancesResponse>,
6790            tonic::Status,
6791        > {
6792            self.inner
6793                .ready()
6794                .await
6795                .map_err(|e| {
6796                    tonic::Status::unknown(
6797                        format!("Service was not ready: {}", e.into()),
6798                    )
6799                })?;
6800            let codec = tonic_prost::ProstCodec::default();
6801            let path = http::uri::PathAndQuery::from_static(
6802                "/sui.rpc.v2.StateService/ListBalances",
6803            );
6804            let mut req = request.into_request();
6805            req.extensions_mut()
6806                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6807            self.inner.unary(req, path, codec).await
6808        }
6809    }
6810}
6811/// Generated server implementations.
6812pub mod state_service_server {
6813    #![allow(
6814        unused_variables,
6815        dead_code,
6816        missing_docs,
6817        clippy::wildcard_imports,
6818        clippy::let_unit_value,
6819    )]
6820    use tonic::codegen::*;
6821    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
6822    #[async_trait]
6823    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6824        async fn list_dynamic_fields(
6825            &self,
6826            request: tonic::Request<super::ListDynamicFieldsRequest>,
6827        ) -> std::result::Result<
6828            tonic::Response<super::ListDynamicFieldsResponse>,
6829            tonic::Status,
6830        > {
6831            Err(tonic::Status::unimplemented("Not yet implemented"))
6832        }
6833        async fn list_owned_objects(
6834            &self,
6835            request: tonic::Request<super::ListOwnedObjectsRequest>,
6836        ) -> std::result::Result<
6837            tonic::Response<super::ListOwnedObjectsResponse>,
6838            tonic::Status,
6839        > {
6840            Err(tonic::Status::unimplemented("Not yet implemented"))
6841        }
6842        async fn get_coin_info(
6843            &self,
6844            request: tonic::Request<super::GetCoinInfoRequest>,
6845        ) -> std::result::Result<
6846            tonic::Response<super::GetCoinInfoResponse>,
6847            tonic::Status,
6848        > {
6849            Err(tonic::Status::unimplemented("Not yet implemented"))
6850        }
6851        async fn get_balance(
6852            &self,
6853            request: tonic::Request<super::GetBalanceRequest>,
6854        ) -> std::result::Result<
6855            tonic::Response<super::GetBalanceResponse>,
6856            tonic::Status,
6857        > {
6858            Err(tonic::Status::unimplemented("Not yet implemented"))
6859        }
6860        async fn list_balances(
6861            &self,
6862            request: tonic::Request<super::ListBalancesRequest>,
6863        ) -> std::result::Result<
6864            tonic::Response<super::ListBalancesResponse>,
6865            tonic::Status,
6866        > {
6867            Err(tonic::Status::unimplemented("Not yet implemented"))
6868        }
6869    }
6870    #[derive(Debug)]
6871    pub struct StateServiceServer<T> {
6872        inner: Arc<T>,
6873        accept_compression_encodings: EnabledCompressionEncodings,
6874        send_compression_encodings: EnabledCompressionEncodings,
6875        max_decoding_message_size: Option<usize>,
6876        max_encoding_message_size: Option<usize>,
6877    }
6878    impl<T> StateServiceServer<T> {
6879        pub fn new(inner: T) -> Self {
6880            Self::from_arc(Arc::new(inner))
6881        }
6882        pub fn from_arc(inner: Arc<T>) -> Self {
6883            Self {
6884                inner,
6885                accept_compression_encodings: Default::default(),
6886                send_compression_encodings: Default::default(),
6887                max_decoding_message_size: None,
6888                max_encoding_message_size: None,
6889            }
6890        }
6891        pub fn with_interceptor<F>(
6892            inner: T,
6893            interceptor: F,
6894        ) -> InterceptedService<Self, F>
6895        where
6896            F: tonic::service::Interceptor,
6897        {
6898            InterceptedService::new(Self::new(inner), interceptor)
6899        }
6900        /// Enable decompressing requests with the given encoding.
6901        #[must_use]
6902        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6903            self.accept_compression_encodings.enable(encoding);
6904            self
6905        }
6906        /// Compress responses with the given encoding, if the client supports it.
6907        #[must_use]
6908        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6909            self.send_compression_encodings.enable(encoding);
6910            self
6911        }
6912        /// Limits the maximum size of a decoded message.
6913        ///
6914        /// Default: `4MB`
6915        #[must_use]
6916        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6917            self.max_decoding_message_size = Some(limit);
6918            self
6919        }
6920        /// Limits the maximum size of an encoded message.
6921        ///
6922        /// Default: `usize::MAX`
6923        #[must_use]
6924        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6925            self.max_encoding_message_size = Some(limit);
6926            self
6927        }
6928    }
6929    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6930    where
6931        T: StateService,
6932        B: Body + std::marker::Send + 'static,
6933        B::Error: Into<StdError> + std::marker::Send + 'static,
6934    {
6935        type Response = http::Response<tonic::body::Body>;
6936        type Error = std::convert::Infallible;
6937        type Future = BoxFuture<Self::Response, Self::Error>;
6938        fn poll_ready(
6939            &mut self,
6940            _cx: &mut Context<'_>,
6941        ) -> Poll<std::result::Result<(), Self::Error>> {
6942            Poll::Ready(Ok(()))
6943        }
6944        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6945            match req.uri().path() {
6946                "/sui.rpc.v2.StateService/ListDynamicFields" => {
6947                    #[allow(non_camel_case_types)]
6948                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6949                    impl<
6950                        T: StateService,
6951                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6952                    for ListDynamicFieldsSvc<T> {
6953                        type Response = super::ListDynamicFieldsResponse;
6954                        type Future = BoxFuture<
6955                            tonic::Response<Self::Response>,
6956                            tonic::Status,
6957                        >;
6958                        fn call(
6959                            &mut self,
6960                            request: tonic::Request<super::ListDynamicFieldsRequest>,
6961                        ) -> Self::Future {
6962                            let inner = Arc::clone(&self.0);
6963                            let fut = async move {
6964                                <T as StateService>::list_dynamic_fields(&inner, request)
6965                                    .await
6966                            };
6967                            Box::pin(fut)
6968                        }
6969                    }
6970                    let accept_compression_encodings = self.accept_compression_encodings;
6971                    let send_compression_encodings = self.send_compression_encodings;
6972                    let max_decoding_message_size = self.max_decoding_message_size;
6973                    let max_encoding_message_size = self.max_encoding_message_size;
6974                    let inner = self.inner.clone();
6975                    let fut = async move {
6976                        let method = ListDynamicFieldsSvc(inner);
6977                        let codec = tonic_prost::ProstCodec::default();
6978                        let mut grpc = tonic::server::Grpc::new(codec)
6979                            .apply_compression_config(
6980                                accept_compression_encodings,
6981                                send_compression_encodings,
6982                            )
6983                            .apply_max_message_size_config(
6984                                max_decoding_message_size,
6985                                max_encoding_message_size,
6986                            );
6987                        let res = grpc.unary(method, req).await;
6988                        Ok(res)
6989                    };
6990                    Box::pin(fut)
6991                }
6992                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6993                    #[allow(non_camel_case_types)]
6994                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6995                    impl<
6996                        T: StateService,
6997                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6998                    for ListOwnedObjectsSvc<T> {
6999                        type Response = super::ListOwnedObjectsResponse;
7000                        type Future = BoxFuture<
7001                            tonic::Response<Self::Response>,
7002                            tonic::Status,
7003                        >;
7004                        fn call(
7005                            &mut self,
7006                            request: tonic::Request<super::ListOwnedObjectsRequest>,
7007                        ) -> Self::Future {
7008                            let inner = Arc::clone(&self.0);
7009                            let fut = async move {
7010                                <T as StateService>::list_owned_objects(&inner, request)
7011                                    .await
7012                            };
7013                            Box::pin(fut)
7014                        }
7015                    }
7016                    let accept_compression_encodings = self.accept_compression_encodings;
7017                    let send_compression_encodings = self.send_compression_encodings;
7018                    let max_decoding_message_size = self.max_decoding_message_size;
7019                    let max_encoding_message_size = self.max_encoding_message_size;
7020                    let inner = self.inner.clone();
7021                    let fut = async move {
7022                        let method = ListOwnedObjectsSvc(inner);
7023                        let codec = tonic_prost::ProstCodec::default();
7024                        let mut grpc = tonic::server::Grpc::new(codec)
7025                            .apply_compression_config(
7026                                accept_compression_encodings,
7027                                send_compression_encodings,
7028                            )
7029                            .apply_max_message_size_config(
7030                                max_decoding_message_size,
7031                                max_encoding_message_size,
7032                            );
7033                        let res = grpc.unary(method, req).await;
7034                        Ok(res)
7035                    };
7036                    Box::pin(fut)
7037                }
7038                "/sui.rpc.v2.StateService/GetCoinInfo" => {
7039                    #[allow(non_camel_case_types)]
7040                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
7041                    impl<
7042                        T: StateService,
7043                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
7044                    for GetCoinInfoSvc<T> {
7045                        type Response = super::GetCoinInfoResponse;
7046                        type Future = BoxFuture<
7047                            tonic::Response<Self::Response>,
7048                            tonic::Status,
7049                        >;
7050                        fn call(
7051                            &mut self,
7052                            request: tonic::Request<super::GetCoinInfoRequest>,
7053                        ) -> Self::Future {
7054                            let inner = Arc::clone(&self.0);
7055                            let fut = async move {
7056                                <T as StateService>::get_coin_info(&inner, request).await
7057                            };
7058                            Box::pin(fut)
7059                        }
7060                    }
7061                    let accept_compression_encodings = self.accept_compression_encodings;
7062                    let send_compression_encodings = self.send_compression_encodings;
7063                    let max_decoding_message_size = self.max_decoding_message_size;
7064                    let max_encoding_message_size = self.max_encoding_message_size;
7065                    let inner = self.inner.clone();
7066                    let fut = async move {
7067                        let method = GetCoinInfoSvc(inner);
7068                        let codec = tonic_prost::ProstCodec::default();
7069                        let mut grpc = tonic::server::Grpc::new(codec)
7070                            .apply_compression_config(
7071                                accept_compression_encodings,
7072                                send_compression_encodings,
7073                            )
7074                            .apply_max_message_size_config(
7075                                max_decoding_message_size,
7076                                max_encoding_message_size,
7077                            );
7078                        let res = grpc.unary(method, req).await;
7079                        Ok(res)
7080                    };
7081                    Box::pin(fut)
7082                }
7083                "/sui.rpc.v2.StateService/GetBalance" => {
7084                    #[allow(non_camel_case_types)]
7085                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7086                    impl<
7087                        T: StateService,
7088                    > tonic::server::UnaryService<super::GetBalanceRequest>
7089                    for GetBalanceSvc<T> {
7090                        type Response = super::GetBalanceResponse;
7091                        type Future = BoxFuture<
7092                            tonic::Response<Self::Response>,
7093                            tonic::Status,
7094                        >;
7095                        fn call(
7096                            &mut self,
7097                            request: tonic::Request<super::GetBalanceRequest>,
7098                        ) -> Self::Future {
7099                            let inner = Arc::clone(&self.0);
7100                            let fut = async move {
7101                                <T as StateService>::get_balance(&inner, request).await
7102                            };
7103                            Box::pin(fut)
7104                        }
7105                    }
7106                    let accept_compression_encodings = self.accept_compression_encodings;
7107                    let send_compression_encodings = self.send_compression_encodings;
7108                    let max_decoding_message_size = self.max_decoding_message_size;
7109                    let max_encoding_message_size = self.max_encoding_message_size;
7110                    let inner = self.inner.clone();
7111                    let fut = async move {
7112                        let method = GetBalanceSvc(inner);
7113                        let codec = tonic_prost::ProstCodec::default();
7114                        let mut grpc = tonic::server::Grpc::new(codec)
7115                            .apply_compression_config(
7116                                accept_compression_encodings,
7117                                send_compression_encodings,
7118                            )
7119                            .apply_max_message_size_config(
7120                                max_decoding_message_size,
7121                                max_encoding_message_size,
7122                            );
7123                        let res = grpc.unary(method, req).await;
7124                        Ok(res)
7125                    };
7126                    Box::pin(fut)
7127                }
7128                "/sui.rpc.v2.StateService/ListBalances" => {
7129                    #[allow(non_camel_case_types)]
7130                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7131                    impl<
7132                        T: StateService,
7133                    > tonic::server::UnaryService<super::ListBalancesRequest>
7134                    for ListBalancesSvc<T> {
7135                        type Response = super::ListBalancesResponse;
7136                        type Future = BoxFuture<
7137                            tonic::Response<Self::Response>,
7138                            tonic::Status,
7139                        >;
7140                        fn call(
7141                            &mut self,
7142                            request: tonic::Request<super::ListBalancesRequest>,
7143                        ) -> Self::Future {
7144                            let inner = Arc::clone(&self.0);
7145                            let fut = async move {
7146                                <T as StateService>::list_balances(&inner, request).await
7147                            };
7148                            Box::pin(fut)
7149                        }
7150                    }
7151                    let accept_compression_encodings = self.accept_compression_encodings;
7152                    let send_compression_encodings = self.send_compression_encodings;
7153                    let max_decoding_message_size = self.max_decoding_message_size;
7154                    let max_encoding_message_size = self.max_encoding_message_size;
7155                    let inner = self.inner.clone();
7156                    let fut = async move {
7157                        let method = ListBalancesSvc(inner);
7158                        let codec = tonic_prost::ProstCodec::default();
7159                        let mut grpc = tonic::server::Grpc::new(codec)
7160                            .apply_compression_config(
7161                                accept_compression_encodings,
7162                                send_compression_encodings,
7163                            )
7164                            .apply_max_message_size_config(
7165                                max_decoding_message_size,
7166                                max_encoding_message_size,
7167                            );
7168                        let res = grpc.unary(method, req).await;
7169                        Ok(res)
7170                    };
7171                    Box::pin(fut)
7172                }
7173                _ => {
7174                    Box::pin(async move {
7175                        let mut response = http::Response::new(
7176                            tonic::body::Body::default(),
7177                        );
7178                        let headers = response.headers_mut();
7179                        headers
7180                            .insert(
7181                                tonic::Status::GRPC_STATUS,
7182                                (tonic::Code::Unimplemented as i32).into(),
7183                            );
7184                        headers
7185                            .insert(
7186                                http::header::CONTENT_TYPE,
7187                                tonic::metadata::GRPC_CONTENT_TYPE,
7188                            );
7189                        Ok(response)
7190                    })
7191                }
7192            }
7193        }
7194    }
7195    impl<T> Clone for StateServiceServer<T> {
7196        fn clone(&self) -> Self {
7197            let inner = self.inner.clone();
7198            Self {
7199                inner,
7200                accept_compression_encodings: self.accept_compression_encodings,
7201                send_compression_encodings: self.send_compression_encodings,
7202                max_decoding_message_size: self.max_decoding_message_size,
7203                max_encoding_message_size: self.max_encoding_message_size,
7204            }
7205        }
7206    }
7207    /// Generated gRPC service name
7208    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7209    impl<T> tonic::server::NamedService for StateServiceServer<T> {
7210        const NAME: &'static str = SERVICE_NAME;
7211    }
7212}
7213/// Request message for SubscriptionService.SubscribeCheckpoints.
7214#[derive(Eq, Hash)]
7215#[non_exhaustive]
7216#[derive(Clone, PartialEq, ::prost::Message)]
7217pub struct SubscribeCheckpointsRequest {
7218    /// Optional. Mask for specifying which parts of the Checkpoint should be
7219    /// returned (e.g. summary, contents, signatures). `cursor` is always
7220    /// populated and is not subject to the mask.
7221    #[prost(message, optional, tag = "1")]
7222    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7223    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
7224    /// matches if any transaction it contains satisfies the filter. If absent,
7225    /// every checkpoint is streamed.
7226    #[prost(message, optional, tag = "2")]
7227    pub filter: ::core::option::Option<TransactionFilter>,
7228}
7229/// Response message for SubscriptionService.SubscribeCheckpoints.
7230///
7231/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
7232/// sequence number stands in for the `Watermark` message the other
7233/// subscription responses carry. Progress-only frames (with `checkpoint`
7234/// unset) occur only on filtered streams: on an unfiltered stream every frame
7235/// carries both fields, in order and without gaps.
7236#[non_exhaustive]
7237#[derive(Clone, PartialEq, ::prost::Message)]
7238pub struct SubscribeCheckpointsResponse {
7239    /// Required. The checkpoint sequence number the stream has fully covered,
7240    /// inclusive: every matching checkpoint from the stream's start position
7241    /// through `cursor` has been delivered. Present on every frame and
7242    /// advances monotonically.
7243    #[prost(uint64, optional, tag = "1")]
7244    pub cursor: ::core::option::Option<u64>,
7245    /// The matching checkpoint. Unset when this frame only advances the
7246    /// cursor past non-matching checkpoints.
7247    #[prost(message, optional, tag = "2")]
7248    pub checkpoint: ::core::option::Option<Checkpoint>,
7249}
7250/// Request message for SubscriptionService.SubscribeTransactions.
7251#[non_exhaustive]
7252#[derive(Clone, PartialEq, ::prost::Message)]
7253pub struct SubscribeTransactionsRequest {
7254    /// Optional. Mask for specifying which parts of the ExecutedTransaction
7255    /// should be returned.
7256    #[prost(message, optional, tag = "1")]
7257    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7258    /// Optional. DNF filter over indexed dimensions. If absent, every
7259    /// transaction is streamed.
7260    #[prost(message, optional, tag = "2")]
7261    pub filter: ::core::option::Option<TransactionFilter>,
7262}
7263/// Response message for SubscriptionService.SubscribeTransactions.
7264///
7265/// Mirrors ListTransactionsResponse, except there is no `end` field: a
7266/// subscription stream has no successful end.
7267#[non_exhaustive]
7268#[derive(Clone, PartialEq, ::prost::Message)]
7269pub struct SubscribeTransactionsResponse {
7270    /// One matching transaction. Its position within the containing checkpoint
7271    /// is reported by `ExecutedTransaction.transaction_index`.
7272    #[prost(message, optional, tag = "1")]
7273    pub transaction: ::core::option::Option<ExecutedTransaction>,
7274    /// Progress watermark as of this frame. Present on every frame.
7275    #[prost(message, optional, tag = "2")]
7276    pub watermark: ::core::option::Option<Watermark>,
7277}
7278/// Request message for SubscriptionService.SubscribeEvents.
7279#[non_exhaustive]
7280#[derive(Clone, PartialEq, ::prost::Message)]
7281pub struct SubscribeEventsRequest {
7282    /// Optional. Mask for specifying which parts of the Event should be
7283    /// returned.
7284    #[prost(message, optional, tag = "1")]
7285    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7286    /// Optional. DNF filter over indexed dimensions. If absent, every event is
7287    /// streamed.
7288    #[prost(message, optional, tag = "2")]
7289    pub filter: ::core::option::Option<EventFilter>,
7290}
7291/// Response message for SubscriptionService.SubscribeEvents.
7292///
7293/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
7294/// stream has no successful end.
7295#[non_exhaustive]
7296#[derive(Clone, PartialEq, ::prost::Message)]
7297pub struct SubscribeEventsResponse {
7298    /// One matching event. Its ledger position -- containing checkpoint,
7299    /// emitting transaction digest and offset, and index within that
7300    /// transaction's event list -- is reported by the corresponding fields on
7301    /// `Event`.
7302    #[prost(message, optional, tag = "1")]
7303    pub event: ::core::option::Option<Event>,
7304    /// Progress watermark as of this frame. Present on every frame.
7305    #[prost(message, optional, tag = "2")]
7306    pub watermark: ::core::option::Option<Watermark>,
7307}
7308/// Generated client implementations.
7309pub mod subscription_service_client {
7310    #![allow(
7311        unused_variables,
7312        dead_code,
7313        missing_docs,
7314        clippy::wildcard_imports,
7315        clippy::let_unit_value,
7316    )]
7317    use tonic::codegen::*;
7318    use tonic::codegen::http::Uri;
7319    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7320    /// transactions, and events.
7321    ///
7322    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7323    /// requests take the same filter message, and responses carry the same item
7324    /// and watermark shapes with identical cursor semantics.
7325    ///
7326    /// Subscriptions do not support resumption. A new subscription always begins
7327    /// at the current tip of the chain as seen by the server (the latest executed
7328    /// checkpoint). To recover data missed between subscriptions, replay the gap
7329    /// with the paired List API: pass the last received `Watermark.cursor` as
7330    /// `options.after` on the List request (for checkpoints, pass the last
7331    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7332    /// indexed tip, which may trail the subscription's start position; repeat the
7333    /// List call as the index advances until the replay reaches the position
7334    /// established by the subscription's first frame.
7335    ///
7336    /// A subscription behaves like an unbounded ascending scan: every frame
7337    /// carries the subscriber's resume point, and progress advances as
7338    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7339    /// filters live: the first frame on a filtered subscription is a
7340    /// progress-only frame establishing the stream's start position, and
7341    /// progress continues to advance with bounded staleness even when no item
7342    /// matches.
7343    ///
7344    /// Subscription streams have no successful end: they run until cancelled by
7345    /// the client or terminated by the server with a gRPC status.
7346    #[derive(Debug, Clone)]
7347    pub struct SubscriptionServiceClient<T> {
7348        inner: tonic::client::Grpc<T>,
7349    }
7350    impl SubscriptionServiceClient<tonic::transport::Channel> {
7351        /// Attempt to create a new client by connecting to a given endpoint.
7352        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7353        where
7354            D: TryInto<tonic::transport::Endpoint>,
7355            D::Error: Into<StdError>,
7356        {
7357            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7358            Ok(Self::new(conn))
7359        }
7360    }
7361    impl<T> SubscriptionServiceClient<T>
7362    where
7363        T: tonic::client::GrpcService<tonic::body::Body>,
7364        T::Error: Into<StdError>,
7365        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7366        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7367    {
7368        pub fn new(inner: T) -> Self {
7369            let inner = tonic::client::Grpc::new(inner);
7370            Self { inner }
7371        }
7372        pub fn with_origin(inner: T, origin: Uri) -> Self {
7373            let inner = tonic::client::Grpc::with_origin(inner, origin);
7374            Self { inner }
7375        }
7376        pub fn with_interceptor<F>(
7377            inner: T,
7378            interceptor: F,
7379        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7380        where
7381            F: tonic::service::Interceptor,
7382            T::ResponseBody: Default,
7383            T: tonic::codegen::Service<
7384                http::Request<tonic::body::Body>,
7385                Response = http::Response<
7386                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7387                >,
7388            >,
7389            <T as tonic::codegen::Service<
7390                http::Request<tonic::body::Body>,
7391            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7392        {
7393            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7394        }
7395        /// Compress requests with the given encoding.
7396        ///
7397        /// This requires the server to support it otherwise it might respond with an
7398        /// error.
7399        #[must_use]
7400        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7401            self.inner = self.inner.send_compressed(encoding);
7402            self
7403        }
7404        /// Enable decompressing responses.
7405        #[must_use]
7406        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7407            self.inner = self.inner.accept_compressed(encoding);
7408            self
7409        }
7410        /// Limits the maximum size of a decoded message.
7411        ///
7412        /// Default: `4MB`
7413        #[must_use]
7414        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7415            self.inner = self.inner.max_decoding_message_size(limit);
7416            self
7417        }
7418        /// Limits the maximum size of an encoded message.
7419        ///
7420        /// Default: `usize::MAX`
7421        #[must_use]
7422        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7423            self.inner = self.inner.max_encoding_message_size(limit);
7424            self
7425        }
7426        /// Subscribe to the stream of checkpoints.
7427        ///
7428        /// The stream begins at the latest executed checkpoint as seen by the
7429        /// server and yields checkpoints matching the filter as they are executed.
7430        /// A checkpoint matches if any transaction it contains satisfies the
7431        /// filter.
7432        pub async fn subscribe_checkpoints(
7433            &mut self,
7434            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7435        ) -> std::result::Result<
7436            tonic::Response<
7437                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7438            >,
7439            tonic::Status,
7440        > {
7441            self.inner
7442                .ready()
7443                .await
7444                .map_err(|e| {
7445                    tonic::Status::unknown(
7446                        format!("Service was not ready: {}", e.into()),
7447                    )
7448                })?;
7449            let codec = tonic_prost::ProstCodec::default();
7450            let path = http::uri::PathAndQuery::from_static(
7451                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7452            );
7453            let mut req = request.into_request();
7454            req.extensions_mut()
7455                .insert(
7456                    GrpcMethod::new(
7457                        "sui.rpc.v2.SubscriptionService",
7458                        "SubscribeCheckpoints",
7459                    ),
7460                );
7461            self.inner.server_streaming(req, path, codec).await
7462        }
7463        /// Subscribe to the stream of transactions.
7464        ///
7465        /// The stream begins at the latest executed checkpoint as seen by the
7466        /// server and yields transactions matching the filter as they are executed.
7467        pub async fn subscribe_transactions(
7468            &mut self,
7469            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7470        ) -> std::result::Result<
7471            tonic::Response<
7472                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7473            >,
7474            tonic::Status,
7475        > {
7476            self.inner
7477                .ready()
7478                .await
7479                .map_err(|e| {
7480                    tonic::Status::unknown(
7481                        format!("Service was not ready: {}", e.into()),
7482                    )
7483                })?;
7484            let codec = tonic_prost::ProstCodec::default();
7485            let path = http::uri::PathAndQuery::from_static(
7486                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7487            );
7488            let mut req = request.into_request();
7489            req.extensions_mut()
7490                .insert(
7491                    GrpcMethod::new(
7492                        "sui.rpc.v2.SubscriptionService",
7493                        "SubscribeTransactions",
7494                    ),
7495                );
7496            self.inner.server_streaming(req, path, codec).await
7497        }
7498        /// Subscribe to the stream of events.
7499        ///
7500        /// The stream begins at the latest executed checkpoint as seen by the
7501        /// server and yields events matching the filter as they are emitted.
7502        pub async fn subscribe_events(
7503            &mut self,
7504            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7505        ) -> std::result::Result<
7506            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7507            tonic::Status,
7508        > {
7509            self.inner
7510                .ready()
7511                .await
7512                .map_err(|e| {
7513                    tonic::Status::unknown(
7514                        format!("Service was not ready: {}", e.into()),
7515                    )
7516                })?;
7517            let codec = tonic_prost::ProstCodec::default();
7518            let path = http::uri::PathAndQuery::from_static(
7519                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7520            );
7521            let mut req = request.into_request();
7522            req.extensions_mut()
7523                .insert(
7524                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7525                );
7526            self.inner.server_streaming(req, path, codec).await
7527        }
7528    }
7529}
7530/// Generated server implementations.
7531pub mod subscription_service_server {
7532    #![allow(
7533        unused_variables,
7534        dead_code,
7535        missing_docs,
7536        clippy::wildcard_imports,
7537        clippy::let_unit_value,
7538    )]
7539    use tonic::codegen::*;
7540    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
7541    #[async_trait]
7542    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7543        /// Subscribe to the stream of checkpoints.
7544        ///
7545        /// The stream begins at the latest executed checkpoint as seen by the
7546        /// server and yields checkpoints matching the filter as they are executed.
7547        /// A checkpoint matches if any transaction it contains satisfies the
7548        /// filter.
7549        async fn subscribe_checkpoints(
7550            &self,
7551            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7552        ) -> std::result::Result<
7553            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7554            tonic::Status,
7555        > {
7556            Err(tonic::Status::unimplemented("Not yet implemented"))
7557        }
7558        /// Subscribe to the stream of transactions.
7559        ///
7560        /// The stream begins at the latest executed checkpoint as seen by the
7561        /// server and yields transactions matching the filter as they are executed.
7562        async fn subscribe_transactions(
7563            &self,
7564            request: tonic::Request<super::SubscribeTransactionsRequest>,
7565        ) -> std::result::Result<
7566            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7567            tonic::Status,
7568        > {
7569            Err(tonic::Status::unimplemented("Not yet implemented"))
7570        }
7571        /// Subscribe to the stream of events.
7572        ///
7573        /// The stream begins at the latest executed checkpoint as seen by the
7574        /// server and yields events matching the filter as they are emitted.
7575        async fn subscribe_events(
7576            &self,
7577            request: tonic::Request<super::SubscribeEventsRequest>,
7578        ) -> std::result::Result<
7579            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7580            tonic::Status,
7581        > {
7582            Err(tonic::Status::unimplemented("Not yet implemented"))
7583        }
7584    }
7585    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7586    /// transactions, and events.
7587    ///
7588    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7589    /// requests take the same filter message, and responses carry the same item
7590    /// and watermark shapes with identical cursor semantics.
7591    ///
7592    /// Subscriptions do not support resumption. A new subscription always begins
7593    /// at the current tip of the chain as seen by the server (the latest executed
7594    /// checkpoint). To recover data missed between subscriptions, replay the gap
7595    /// with the paired List API: pass the last received `Watermark.cursor` as
7596    /// `options.after` on the List request (for checkpoints, pass the last
7597    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7598    /// indexed tip, which may trail the subscription's start position; repeat the
7599    /// List call as the index advances until the replay reaches the position
7600    /// established by the subscription's first frame.
7601    ///
7602    /// A subscription behaves like an unbounded ascending scan: every frame
7603    /// carries the subscriber's resume point, and progress advances as
7604    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7605    /// filters live: the first frame on a filtered subscription is a
7606    /// progress-only frame establishing the stream's start position, and
7607    /// progress continues to advance with bounded staleness even when no item
7608    /// matches.
7609    ///
7610    /// Subscription streams have no successful end: they run until cancelled by
7611    /// the client or terminated by the server with a gRPC status.
7612    #[derive(Debug)]
7613    pub struct SubscriptionServiceServer<T> {
7614        inner: Arc<T>,
7615        accept_compression_encodings: EnabledCompressionEncodings,
7616        send_compression_encodings: EnabledCompressionEncodings,
7617        max_decoding_message_size: Option<usize>,
7618        max_encoding_message_size: Option<usize>,
7619    }
7620    impl<T> SubscriptionServiceServer<T> {
7621        pub fn new(inner: T) -> Self {
7622            Self::from_arc(Arc::new(inner))
7623        }
7624        pub fn from_arc(inner: Arc<T>) -> Self {
7625            Self {
7626                inner,
7627                accept_compression_encodings: Default::default(),
7628                send_compression_encodings: Default::default(),
7629                max_decoding_message_size: None,
7630                max_encoding_message_size: None,
7631            }
7632        }
7633        pub fn with_interceptor<F>(
7634            inner: T,
7635            interceptor: F,
7636        ) -> InterceptedService<Self, F>
7637        where
7638            F: tonic::service::Interceptor,
7639        {
7640            InterceptedService::new(Self::new(inner), interceptor)
7641        }
7642        /// Enable decompressing requests with the given encoding.
7643        #[must_use]
7644        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7645            self.accept_compression_encodings.enable(encoding);
7646            self
7647        }
7648        /// Compress responses with the given encoding, if the client supports it.
7649        #[must_use]
7650        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7651            self.send_compression_encodings.enable(encoding);
7652            self
7653        }
7654        /// Limits the maximum size of a decoded message.
7655        ///
7656        /// Default: `4MB`
7657        #[must_use]
7658        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7659            self.max_decoding_message_size = Some(limit);
7660            self
7661        }
7662        /// Limits the maximum size of an encoded message.
7663        ///
7664        /// Default: `usize::MAX`
7665        #[must_use]
7666        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7667            self.max_encoding_message_size = Some(limit);
7668            self
7669        }
7670    }
7671    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7672    where
7673        T: SubscriptionService,
7674        B: Body + std::marker::Send + 'static,
7675        B::Error: Into<StdError> + std::marker::Send + 'static,
7676    {
7677        type Response = http::Response<tonic::body::Body>;
7678        type Error = std::convert::Infallible;
7679        type Future = BoxFuture<Self::Response, Self::Error>;
7680        fn poll_ready(
7681            &mut self,
7682            _cx: &mut Context<'_>,
7683        ) -> Poll<std::result::Result<(), Self::Error>> {
7684            Poll::Ready(Ok(()))
7685        }
7686        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7687            match req.uri().path() {
7688                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7689                    #[allow(non_camel_case_types)]
7690                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7691                    impl<
7692                        T: SubscriptionService,
7693                    > tonic::server::ServerStreamingService<
7694                        super::SubscribeCheckpointsRequest,
7695                    > for SubscribeCheckpointsSvc<T> {
7696                        type Response = super::SubscribeCheckpointsResponse;
7697                        type ResponseStream = BoxStream<
7698                            super::SubscribeCheckpointsResponse,
7699                        >;
7700                        type Future = BoxFuture<
7701                            tonic::Response<Self::ResponseStream>,
7702                            tonic::Status,
7703                        >;
7704                        fn call(
7705                            &mut self,
7706                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7707                        ) -> Self::Future {
7708                            let inner = Arc::clone(&self.0);
7709                            let fut = async move {
7710                                <T as SubscriptionService>::subscribe_checkpoints(
7711                                        &inner,
7712                                        request,
7713                                    )
7714                                    .await
7715                            };
7716                            Box::pin(fut)
7717                        }
7718                    }
7719                    let accept_compression_encodings = self.accept_compression_encodings;
7720                    let send_compression_encodings = self.send_compression_encodings;
7721                    let max_decoding_message_size = self.max_decoding_message_size;
7722                    let max_encoding_message_size = self.max_encoding_message_size;
7723                    let inner = self.inner.clone();
7724                    let fut = async move {
7725                        let method = SubscribeCheckpointsSvc(inner);
7726                        let codec = tonic_prost::ProstCodec::default();
7727                        let mut grpc = tonic::server::Grpc::new(codec)
7728                            .apply_compression_config(
7729                                accept_compression_encodings,
7730                                send_compression_encodings,
7731                            )
7732                            .apply_max_message_size_config(
7733                                max_decoding_message_size,
7734                                max_encoding_message_size,
7735                            );
7736                        let res = grpc.server_streaming(method, req).await;
7737                        Ok(res)
7738                    };
7739                    Box::pin(fut)
7740                }
7741                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7742                    #[allow(non_camel_case_types)]
7743                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7744                    impl<
7745                        T: SubscriptionService,
7746                    > tonic::server::ServerStreamingService<
7747                        super::SubscribeTransactionsRequest,
7748                    > for SubscribeTransactionsSvc<T> {
7749                        type Response = super::SubscribeTransactionsResponse;
7750                        type ResponseStream = BoxStream<
7751                            super::SubscribeTransactionsResponse,
7752                        >;
7753                        type Future = BoxFuture<
7754                            tonic::Response<Self::ResponseStream>,
7755                            tonic::Status,
7756                        >;
7757                        fn call(
7758                            &mut self,
7759                            request: tonic::Request<super::SubscribeTransactionsRequest>,
7760                        ) -> Self::Future {
7761                            let inner = Arc::clone(&self.0);
7762                            let fut = async move {
7763                                <T as SubscriptionService>::subscribe_transactions(
7764                                        &inner,
7765                                        request,
7766                                    )
7767                                    .await
7768                            };
7769                            Box::pin(fut)
7770                        }
7771                    }
7772                    let accept_compression_encodings = self.accept_compression_encodings;
7773                    let send_compression_encodings = self.send_compression_encodings;
7774                    let max_decoding_message_size = self.max_decoding_message_size;
7775                    let max_encoding_message_size = self.max_encoding_message_size;
7776                    let inner = self.inner.clone();
7777                    let fut = async move {
7778                        let method = SubscribeTransactionsSvc(inner);
7779                        let codec = tonic_prost::ProstCodec::default();
7780                        let mut grpc = tonic::server::Grpc::new(codec)
7781                            .apply_compression_config(
7782                                accept_compression_encodings,
7783                                send_compression_encodings,
7784                            )
7785                            .apply_max_message_size_config(
7786                                max_decoding_message_size,
7787                                max_encoding_message_size,
7788                            );
7789                        let res = grpc.server_streaming(method, req).await;
7790                        Ok(res)
7791                    };
7792                    Box::pin(fut)
7793                }
7794                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7795                    #[allow(non_camel_case_types)]
7796                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7797                    impl<
7798                        T: SubscriptionService,
7799                    > tonic::server::ServerStreamingService<
7800                        super::SubscribeEventsRequest,
7801                    > for SubscribeEventsSvc<T> {
7802                        type Response = super::SubscribeEventsResponse;
7803                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7804                        type Future = BoxFuture<
7805                            tonic::Response<Self::ResponseStream>,
7806                            tonic::Status,
7807                        >;
7808                        fn call(
7809                            &mut self,
7810                            request: tonic::Request<super::SubscribeEventsRequest>,
7811                        ) -> Self::Future {
7812                            let inner = Arc::clone(&self.0);
7813                            let fut = async move {
7814                                <T as SubscriptionService>::subscribe_events(
7815                                        &inner,
7816                                        request,
7817                                    )
7818                                    .await
7819                            };
7820                            Box::pin(fut)
7821                        }
7822                    }
7823                    let accept_compression_encodings = self.accept_compression_encodings;
7824                    let send_compression_encodings = self.send_compression_encodings;
7825                    let max_decoding_message_size = self.max_decoding_message_size;
7826                    let max_encoding_message_size = self.max_encoding_message_size;
7827                    let inner = self.inner.clone();
7828                    let fut = async move {
7829                        let method = SubscribeEventsSvc(inner);
7830                        let codec = tonic_prost::ProstCodec::default();
7831                        let mut grpc = tonic::server::Grpc::new(codec)
7832                            .apply_compression_config(
7833                                accept_compression_encodings,
7834                                send_compression_encodings,
7835                            )
7836                            .apply_max_message_size_config(
7837                                max_decoding_message_size,
7838                                max_encoding_message_size,
7839                            );
7840                        let res = grpc.server_streaming(method, req).await;
7841                        Ok(res)
7842                    };
7843                    Box::pin(fut)
7844                }
7845                _ => {
7846                    Box::pin(async move {
7847                        let mut response = http::Response::new(
7848                            tonic::body::Body::default(),
7849                        );
7850                        let headers = response.headers_mut();
7851                        headers
7852                            .insert(
7853                                tonic::Status::GRPC_STATUS,
7854                                (tonic::Code::Unimplemented as i32).into(),
7855                            );
7856                        headers
7857                            .insert(
7858                                http::header::CONTENT_TYPE,
7859                                tonic::metadata::GRPC_CONTENT_TYPE,
7860                            );
7861                        Ok(response)
7862                    })
7863                }
7864            }
7865        }
7866    }
7867    impl<T> Clone for SubscriptionServiceServer<T> {
7868        fn clone(&self) -> Self {
7869            let inner = self.inner.clone();
7870            Self {
7871                inner,
7872                accept_compression_encodings: self.accept_compression_encodings,
7873                send_compression_encodings: self.send_compression_encodings,
7874                max_decoding_message_size: self.max_decoding_message_size,
7875                max_encoding_message_size: self.max_encoding_message_size,
7876            }
7877        }
7878    }
7879    /// Generated gRPC service name
7880    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7881    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7882        const NAME: &'static str = SERVICE_NAME;
7883    }
7884}
7885#[non_exhaustive]
7886#[derive(Clone, PartialEq, ::prost::Message)]
7887pub struct SystemState {
7888    /// The version of the system state data structure type.
7889    #[prost(uint64, optional, tag = "1")]
7890    pub version: ::core::option::Option<u64>,
7891    /// The epoch id
7892    #[prost(uint64, optional, tag = "2")]
7893    pub epoch: ::core::option::Option<u64>,
7894    /// The protocol version
7895    #[prost(uint64, optional, tag = "3")]
7896    pub protocol_version: ::core::option::Option<u64>,
7897    /// Information about the validators
7898    #[prost(message, optional, tag = "4")]
7899    pub validators: ::core::option::Option<ValidatorSet>,
7900    /// Storage Fund info
7901    #[prost(message, optional, tag = "5")]
7902    pub storage_fund: ::core::option::Option<StorageFund>,
7903    /// Set of system config parameters
7904    #[prost(message, optional, tag = "6")]
7905    pub parameters: ::core::option::Option<SystemParameters>,
7906    /// The reference gas price for this epoch
7907    #[prost(uint64, optional, tag = "7")]
7908    pub reference_gas_price: ::core::option::Option<u64>,
7909    /// A list of the records of validator reporting each other.
7910    ///
7911    /// There is an entry in this list for each validator that has been reported
7912    /// at least once. Each record contains all the validators that reported
7913    /// them. If a validator has never been reported they don't have a record in this list.
7914    /// This lists persists across epoch: a peer continues being in a reported state until the
7915    /// reporter doesn't explicitly remove their report.
7916    #[prost(message, repeated, tag = "8")]
7917    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7918    /// Schedule of stake subsidies given out each epoch.
7919    #[prost(message, optional, tag = "9")]
7920    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7921    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
7922    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
7923    /// It can be reset once we are able to successfully execute advance_epoch.
7924    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
7925    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
7926    /// are out of safe mode.
7927    #[prost(bool, optional, tag = "10")]
7928    pub safe_mode: ::core::option::Option<bool>,
7929    /// Storage rewards accumulated during safe_mode
7930    #[prost(uint64, optional, tag = "11")]
7931    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7932    /// Computation rewards accumulated during safe_mode
7933    #[prost(uint64, optional, tag = "12")]
7934    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7935    /// Storage rebates paid out during safe_mode
7936    #[prost(uint64, optional, tag = "13")]
7937    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7938    /// Nonrefundable storage fees accumulated during safe_mode
7939    #[prost(uint64, optional, tag = "14")]
7940    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7941    /// Unix timestamp of when this this epoch started
7942    #[prost(uint64, optional, tag = "15")]
7943    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7944    /// Any extra fields that's not defined statically.
7945    #[prost(message, optional, tag = "16")]
7946    pub extra_fields: ::core::option::Option<MoveTable>,
7947}
7948#[non_exhaustive]
7949#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7950pub struct ValidatorReportRecord {
7951    /// The address of the validator being reported
7952    #[prost(string, optional, tag = "1")]
7953    pub reported: ::core::option::Option<::prost::alloc::string::String>,
7954    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
7955    #[prost(string, repeated, tag = "2")]
7956    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7957}
7958#[non_exhaustive]
7959#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7960pub struct SystemParameters {
7961    /// The duration of an epoch, in milliseconds.
7962    #[prost(uint64, optional, tag = "1")]
7963    pub epoch_duration_ms: ::core::option::Option<u64>,
7964    /// The starting epoch in which stake subsidies start being paid out
7965    #[prost(uint64, optional, tag = "2")]
7966    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7967    /// Minimum number of active validators at any moment.
7968    #[prost(uint64, optional, tag = "3")]
7969    pub min_validator_count: ::core::option::Option<u64>,
7970    /// Maximum number of active validators at any moment.
7971    /// We do not allow the number of validators in any epoch to go above this.
7972    #[prost(uint64, optional, tag = "4")]
7973    pub max_validator_count: ::core::option::Option<u64>,
7974    /// Deprecated.
7975    /// Lower-bound on the amount of stake required to become a validator.
7976    #[prost(uint64, optional, tag = "5")]
7977    pub min_validator_joining_stake: ::core::option::Option<u64>,
7978    /// Deprecated.
7979    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
7980    /// have low stake and will be escorted out of the validator set after being below this
7981    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
7982    #[prost(uint64, optional, tag = "6")]
7983    pub validator_low_stake_threshold: ::core::option::Option<u64>,
7984    /// Deprecated.
7985    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
7986    /// immediately at epoch change, no grace period.
7987    #[prost(uint64, optional, tag = "7")]
7988    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7989    /// A validator can have stake below `validator_low_stake_threshold`
7990    /// for this many epochs before being kicked out.
7991    #[prost(uint64, optional, tag = "8")]
7992    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7993    /// Any extra fields that are not defined statically.
7994    #[prost(message, optional, tag = "9")]
7995    pub extra_fields: ::core::option::Option<MoveTable>,
7996}
7997/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
7998#[non_exhaustive]
7999#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8000pub struct MoveTable {
8001    /// The UID of the table or bag
8002    #[prost(string, optional, tag = "1")]
8003    pub id: ::core::option::Option<::prost::alloc::string::String>,
8004    /// The size or number of key-value pairs in the table or bag
8005    #[prost(uint64, optional, tag = "2")]
8006    pub size: ::core::option::Option<u64>,
8007}
8008#[non_exhaustive]
8009#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8010pub struct StakeSubsidy {
8011    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
8012    #[prost(uint64, optional, tag = "1")]
8013    pub balance: ::core::option::Option<u64>,
8014    /// Count of the number of times stake subsidies have been distributed.
8015    #[prost(uint64, optional, tag = "2")]
8016    pub distribution_counter: ::core::option::Option<u64>,
8017    /// The amount of stake subsidy to be drawn down per distribution.
8018    /// This amount decays and decreases over time.
8019    #[prost(uint64, optional, tag = "3")]
8020    pub current_distribution_amount: ::core::option::Option<u64>,
8021    /// Number of distributions to occur before the distribution amount decays.
8022    #[prost(uint64, optional, tag = "4")]
8023    pub stake_subsidy_period_length: ::core::option::Option<u64>,
8024    /// The rate at which the distribution amount decays at the end of each
8025    /// period. Expressed in basis points.
8026    #[prost(uint32, optional, tag = "5")]
8027    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
8028    /// Any extra fields that's not defined statically.
8029    #[prost(message, optional, tag = "6")]
8030    pub extra_fields: ::core::option::Option<MoveTable>,
8031}
8032/// Struct representing the onchain storage fund.
8033#[non_exhaustive]
8034#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8035pub struct StorageFund {
8036    /// This is the sum of `storage_rebate` of
8037    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
8038    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
8039    /// of transactions, including both the portion refunded to the transaction senders as well as
8040    /// the non-refundable portion taken out and put into `non_refundable_balance`.
8041    #[prost(uint64, optional, tag = "1")]
8042    pub total_object_storage_rebates: ::core::option::Option<u64>,
8043    /// Represents any remaining inflow of the storage fund that should not
8044    /// be taken out of the fund.
8045    #[prost(uint64, optional, tag = "2")]
8046    pub non_refundable_balance: ::core::option::Option<u64>,
8047}
8048#[non_exhaustive]
8049#[derive(Clone, PartialEq, ::prost::Message)]
8050pub struct ValidatorSet {
8051    /// Total amount of stake from all active validators at the beginning of the epoch.
8052    /// Written only once per epoch, in `advance_epoch` function.
8053    #[prost(uint64, optional, tag = "1")]
8054    pub total_stake: ::core::option::Option<u64>,
8055    /// The current list of active validators.
8056    #[prost(message, repeated, tag = "2")]
8057    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8058    /// List of new validator candidates added during the current epoch.
8059    /// They will be processed at the end of the epoch.
8060    ///
8061    /// key: u64 (index), value: 0x3::validator::Validator
8062    #[prost(message, optional, tag = "3")]
8063    pub pending_active_validators: ::core::option::Option<MoveTable>,
8064    /// Removal requests from the validators. Each element is an index
8065    /// pointing to `active_validators`.
8066    #[prost(uint64, repeated, tag = "4")]
8067    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8068    /// Mappings from staking pool's ID to the sui address of a validator.
8069    ///
8070    /// key: address (staking pool Id), value: address (sui address of the validator)
8071    #[prost(message, optional, tag = "5")]
8072    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8073    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
8074    /// When a validator is deactivated the validator is removed from `active_validators` it
8075    /// is added to this table so that stakers can continue to withdraw their stake from it.
8076    ///
8077    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
8078    #[prost(message, optional, tag = "6")]
8079    pub inactive_validators: ::core::option::Option<MoveTable>,
8080    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
8081    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
8082    /// validator.
8083    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
8084    /// officially add them to the active validator set `active_validators` next epoch.
8085    ///
8086    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
8087    #[prost(message, optional, tag = "7")]
8088    pub validator_candidates: ::core::option::Option<MoveTable>,
8089    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
8090    #[prost(btree_map = "string, uint64", tag = "8")]
8091    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8092        ::prost::alloc::string::String,
8093        u64,
8094    >,
8095    /// Any extra fields that's not defined statically.
8096    #[prost(message, optional, tag = "9")]
8097    pub extra_fields: ::core::option::Option<MoveTable>,
8098}
8099/// Definition of a Validator in the system contracts
8100///
8101/// Note: fields of ValidatorMetadata are flattened into this type
8102#[non_exhaustive]
8103#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8104pub struct Validator {
8105    /// A unique human-readable name of this validator.
8106    #[prost(string, optional, tag = "1")]
8107    pub name: ::core::option::Option<::prost::alloc::string::String>,
8108    /// The Sui Address of the validator. This is the sender that created the Validator object,
8109    /// and also the address to send validator/coins to during withdraws.
8110    #[prost(string, optional, tag = "2")]
8111    pub address: ::core::option::Option<::prost::alloc::string::String>,
8112    #[prost(string, optional, tag = "3")]
8113    pub description: ::core::option::Option<::prost::alloc::string::String>,
8114    #[prost(string, optional, tag = "4")]
8115    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8116    #[prost(string, optional, tag = "5")]
8117    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8118    /// The public key bytes corresponding to the private key that the validator
8119    /// holds to sign transactions. For now, this is the same as AuthorityName.
8120    #[prost(bytes = "bytes", optional, tag = "7")]
8121    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8122    /// This is a proof that the validator has ownership of the protocol private key
8123    #[prost(bytes = "bytes", optional, tag = "8")]
8124    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8125    /// The public key bytes corresponding to the private key that the validator
8126    /// uses to establish TLS connections
8127    #[prost(bytes = "bytes", optional, tag = "10")]
8128    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8129    /// The public key bytes corresponding to the Narwhal Worker
8130    #[prost(bytes = "bytes", optional, tag = "12")]
8131    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8132    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
8133    #[prost(string, optional, tag = "13")]
8134    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8135    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
8136    #[prost(string, optional, tag = "14")]
8137    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8138    /// The address of the narwhal primary
8139    #[prost(string, optional, tag = "15")]
8140    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8141    /// The address of the narwhal worker
8142    #[prost(string, optional, tag = "16")]
8143    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8144    #[prost(bytes = "bytes", optional, tag = "18")]
8145    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8146    #[prost(bytes = "bytes", optional, tag = "19")]
8147    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8148    #[prost(bytes = "bytes", optional, tag = "21")]
8149    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8150    #[prost(bytes = "bytes", optional, tag = "23")]
8151    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8152    #[prost(string, optional, tag = "24")]
8153    pub next_epoch_network_address: ::core::option::Option<
8154        ::prost::alloc::string::String,
8155    >,
8156    #[prost(string, optional, tag = "25")]
8157    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8158    #[prost(string, optional, tag = "26")]
8159    pub next_epoch_primary_address: ::core::option::Option<
8160        ::prost::alloc::string::String,
8161    >,
8162    #[prost(string, optional, tag = "27")]
8163    pub next_epoch_worker_address: ::core::option::Option<
8164        ::prost::alloc::string::String,
8165    >,
8166    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
8167    #[prost(message, optional, tag = "28")]
8168    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8169    /// The voting power of this validator, which might be different from its
8170    /// stake amount.
8171    #[prost(uint64, optional, tag = "29")]
8172    pub voting_power: ::core::option::Option<u64>,
8173    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
8174    #[prost(string, optional, tag = "30")]
8175    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8176    /// Gas price quote, updated only at end of epoch.
8177    #[prost(uint64, optional, tag = "31")]
8178    pub gas_price: ::core::option::Option<u64>,
8179    /// Staking pool for this validator.
8180    #[prost(message, optional, tag = "32")]
8181    pub staking_pool: ::core::option::Option<StakingPool>,
8182    /// Commission rate of the validator, in basis point.
8183    #[prost(uint64, optional, tag = "33")]
8184    pub commission_rate: ::core::option::Option<u64>,
8185    /// Total amount of stake that would be active in the next epoch.
8186    #[prost(uint64, optional, tag = "34")]
8187    pub next_epoch_stake: ::core::option::Option<u64>,
8188    /// This validator's gas price quote for the next epoch.
8189    #[prost(uint64, optional, tag = "35")]
8190    pub next_epoch_gas_price: ::core::option::Option<u64>,
8191    /// The commission rate of the validator starting the next epoch, in basis point.
8192    #[prost(uint64, optional, tag = "36")]
8193    pub next_epoch_commission_rate: ::core::option::Option<u64>,
8194    /// Any extra fields that's not defined statically.
8195    #[prost(message, optional, tag = "37")]
8196    pub extra_fields: ::core::option::Option<MoveTable>,
8197}
8198/// A staking pool embedded in each validator struct in the system state object.
8199#[non_exhaustive]
8200#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8201pub struct StakingPool {
8202    /// UID of the StakingPool object
8203    #[prost(string, optional, tag = "1")]
8204    pub id: ::core::option::Option<::prost::alloc::string::String>,
8205    /// The epoch at which this pool became active.
8206    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
8207    #[prost(uint64, optional, tag = "2")]
8208    pub activation_epoch: ::core::option::Option<u64>,
8209    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
8210    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
8211    #[prost(uint64, optional, tag = "3")]
8212    pub deactivation_epoch: ::core::option::Option<u64>,
8213    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
8214    /// in the `StakedSui` object, updated at epoch boundaries.
8215    #[prost(uint64, optional, tag = "4")]
8216    pub sui_balance: ::core::option::Option<u64>,
8217    /// The epoch stake rewards will be added here at the end of each epoch.
8218    #[prost(uint64, optional, tag = "5")]
8219    pub rewards_pool: ::core::option::Option<u64>,
8220    /// Total number of pool tokens issued by the pool.
8221    #[prost(uint64, optional, tag = "6")]
8222    pub pool_token_balance: ::core::option::Option<u64>,
8223    /// Exchange rate history of previous epochs.
8224    ///
8225    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
8226    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
8227    ///
8228    /// key: u64 (epoch number), value: PoolTokenExchangeRate
8229    #[prost(message, optional, tag = "7")]
8230    pub exchange_rates: ::core::option::Option<MoveTable>,
8231    /// Pending stake amount for this epoch, emptied at epoch boundaries.
8232    #[prost(uint64, optional, tag = "8")]
8233    pub pending_stake: ::core::option::Option<u64>,
8234    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
8235    /// This includes both the principal and rewards SUI withdrawn.
8236    #[prost(uint64, optional, tag = "9")]
8237    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8238    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
8239    #[prost(uint64, optional, tag = "10")]
8240    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8241    /// Any extra fields that's not defined statically.
8242    #[prost(message, optional, tag = "11")]
8243    pub extra_fields: ::core::option::Option<MoveTable>,
8244}
8245/// A transaction.
8246#[non_exhaustive]
8247#[derive(Clone, PartialEq, ::prost::Message)]
8248pub struct Transaction {
8249    /// This Transaction serialized as BCS.
8250    #[prost(message, optional, tag = "1")]
8251    pub bcs: ::core::option::Option<Bcs>,
8252    /// The digest of this Transaction.
8253    #[prost(string, optional, tag = "2")]
8254    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8255    /// Version of this Transaction.
8256    #[prost(int32, optional, tag = "3")]
8257    pub version: ::core::option::Option<i32>,
8258    #[prost(message, optional, tag = "4")]
8259    pub kind: ::core::option::Option<TransactionKind>,
8260    #[prost(string, optional, tag = "5")]
8261    pub sender: ::core::option::Option<::prost::alloc::string::String>,
8262    #[prost(message, optional, tag = "6")]
8263    pub gas_payment: ::core::option::Option<GasPayment>,
8264    #[prost(message, optional, tag = "7")]
8265    pub expiration: ::core::option::Option<TransactionExpiration>,
8266}
8267/// Payment information for executing a transaction.
8268#[non_exhaustive]
8269#[derive(Clone, PartialEq, ::prost::Message)]
8270pub struct GasPayment {
8271    /// Set of gas objects to use for payment.
8272    #[prost(message, repeated, tag = "1")]
8273    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8274    /// Owner of the gas objects, either the transaction sender or a sponsor.
8275    #[prost(string, optional, tag = "2")]
8276    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8277    /// Gas unit price to use when charging for computation.
8278    ///
8279    /// Must be greater than or equal to the network's current RGP (reference gas price).
8280    #[prost(uint64, optional, tag = "3")]
8281    pub price: ::core::option::Option<u64>,
8282    /// Total budget willing to spend for the execution of a transaction.
8283    #[prost(uint64, optional, tag = "4")]
8284    pub budget: ::core::option::Option<u64>,
8285}
8286/// A TTL for a transaction.
8287#[non_exhaustive]
8288#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8289pub struct TransactionExpiration {
8290    #[prost(
8291        enumeration = "transaction_expiration::TransactionExpirationKind",
8292        optional,
8293        tag = "1"
8294    )]
8295    pub kind: ::core::option::Option<i32>,
8296    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
8297    /// must be greater than or equal to the current epoch for a transaction to execute.
8298    #[prost(uint64, optional, tag = "2")]
8299    pub epoch: ::core::option::Option<u64>,
8300    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
8301    /// must be less than or equal to the current epoch for a transaction to execute.
8302    #[prost(uint64, optional, tag = "3")]
8303    pub min_epoch: ::core::option::Option<u64>,
8304    /// Minimal UNIX timestamp in which a transaction can be executed. The
8305    /// provided minimal timestamp must be less than or equal to the current
8306    /// clock.
8307    #[prost(message, optional, tag = "4")]
8308    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8309    /// Maximum UNIX timestamp in which a transaction can be executed. The
8310    /// provided maximal timestamp must be greater than or equal to the current
8311    /// clock.
8312    #[prost(message, optional, tag = "5")]
8313    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8314    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
8315    #[prost(string, optional, tag = "6")]
8316    pub chain: ::core::option::Option<::prost::alloc::string::String>,
8317    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
8318    #[prost(uint32, optional, tag = "7")]
8319    pub nonce: ::core::option::Option<u32>,
8320    /// The validators allowed to propose this transaction in consensus. Only set when `kind`
8321    /// is `VALIDITY`. Leave unset to let any validator propose the transaction.
8322    #[prost(message, optional, tag = "8")]
8323    pub allowed_proposers: ::core::option::Option<AllowedProposers>,
8324}
8325/// Nested message and enum types in `TransactionExpiration`.
8326pub mod transaction_expiration {
8327    #[non_exhaustive]
8328    #[derive(
8329        Clone,
8330        Copy,
8331        Debug,
8332        PartialEq,
8333        Eq,
8334        Hash,
8335        PartialOrd,
8336        Ord,
8337        ::prost::Enumeration
8338    )]
8339    #[repr(i32)]
8340    pub enum TransactionExpirationKind {
8341        Unknown = 0,
8342        /// The transaction has no expiration.
8343        None = 1,
8344        /// Validators won't sign and execute transaction unless the expiration epoch
8345        /// is greater than or equal to the current epoch.
8346        Epoch = 2,
8347        /// This variant enables gas payments from address balances.
8348        ///
8349        /// When transactions use address balances for gas payment instead of explicit gas coins,
8350        /// we lose the natural transaction uniqueness and replay prevention that comes from
8351        /// mutation of gas coin objects.
8352        ///
8353        /// By bounding expiration and providing a nonce, validators must only retain
8354        /// executed digests for the maximum possible expiry range to differentiate
8355        /// retries from unique transactions with otherwise identical inputs.
8356        ValidDuring = 3,
8357        /// Everything in VALID_DURING, plus a restriction on which validators may
8358        /// propose the transaction in consensus.
8359        Validity = 4,
8360    }
8361    impl TransactionExpirationKind {
8362        /// String value of the enum field names used in the ProtoBuf definition.
8363        ///
8364        /// The values are not transformed in any way and thus are considered stable
8365        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8366        pub fn as_str_name(&self) -> &'static str {
8367            match self {
8368                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8369                Self::None => "NONE",
8370                Self::Epoch => "EPOCH",
8371                Self::ValidDuring => "VALID_DURING",
8372                Self::Validity => "VALIDITY",
8373            }
8374        }
8375        /// Creates an enum from field names used in the ProtoBuf definition.
8376        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8377            match value {
8378                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8379                "NONE" => Some(Self::None),
8380                "EPOCH" => Some(Self::Epoch),
8381                "VALID_DURING" => Some(Self::ValidDuring),
8382                "VALIDITY" => Some(Self::Validity),
8383                _ => None,
8384            }
8385        }
8386    }
8387}
8388/// The validators allowed to propose a transaction in consensus.
8389///
8390/// Proposal by any other validator is byzantine behavior and invalidates the whole block.
8391#[non_exhaustive]
8392#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8393pub struct AllowedProposers {
8394    /// The epoch whose committee `proposers` indexes into.
8395    ///
8396    /// Committee indices are only meaningful against one committee, so a set recorded for any
8397    /// other epoch is ignored and the transaction is treated as naming no proposers.
8398    #[prost(uint64, optional, tag = "1")]
8399    pub epoch: ::core::option::Option<u64>,
8400    /// Committee indices of the allowed proposers, strictly increasing and non-empty.
8401    ///
8402    /// An empty list names no validator and is rejected; omit `allowed_proposers` entirely to
8403    /// let any validator propose the transaction.
8404    #[prost(uint32, repeated, tag = "2")]
8405    pub proposers: ::prost::alloc::vec::Vec<u32>,
8406}
8407/// Transaction type.
8408#[non_exhaustive]
8409#[derive(Clone, PartialEq, ::prost::Message)]
8410pub struct TransactionKind {
8411    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8412    pub kind: ::core::option::Option<i32>,
8413    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8414    pub data: ::core::option::Option<transaction_kind::Data>,
8415}
8416/// Nested message and enum types in `TransactionKind`.
8417pub mod transaction_kind {
8418    #[non_exhaustive]
8419    #[derive(
8420        Clone,
8421        Copy,
8422        Debug,
8423        PartialEq,
8424        Eq,
8425        Hash,
8426        PartialOrd,
8427        Ord,
8428        ::prost::Enumeration
8429    )]
8430    #[repr(i32)]
8431    pub enum Kind {
8432        Unknown = 0,
8433        /// A user transaction comprised of a list of native commands and Move calls.
8434        ProgrammableTransaction = 1,
8435        /// System transaction used to end an epoch.
8436        ///
8437        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8438        /// `EndOfEpochTransaction`).
8439        ChangeEpoch = 2,
8440        /// Transaction used to initialize the chain state.
8441        ///
8442        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8443        /// executed on the chain.
8444        Genesis = 3,
8445        /// V1 consensus commit update.
8446        ConsensusCommitPrologueV1 = 4,
8447        /// Update set of valid JWKs used for zklogin.
8448        AuthenticatorStateUpdate = 5,
8449        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8450        /// the next one.
8451        EndOfEpoch = 6,
8452        /// Randomness update.
8453        RandomnessStateUpdate = 7,
8454        /// V2 consensus commit update.
8455        ConsensusCommitPrologueV2 = 8,
8456        /// V3 consensus commit update.
8457        ConsensusCommitPrologueV3 = 9,
8458        /// V4 consensus commit update.
8459        ConsensusCommitPrologueV4 = 10,
8460        /// A system transaction comprised of a list of native commands and Move calls.
8461        ProgrammableSystemTransaction = 11,
8462    }
8463    impl Kind {
8464        /// String value of the enum field names used in the ProtoBuf definition.
8465        ///
8466        /// The values are not transformed in any way and thus are considered stable
8467        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8468        pub fn as_str_name(&self) -> &'static str {
8469            match self {
8470                Self::Unknown => "KIND_UNKNOWN",
8471                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8472                Self::ChangeEpoch => "CHANGE_EPOCH",
8473                Self::Genesis => "GENESIS",
8474                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8475                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8476                Self::EndOfEpoch => "END_OF_EPOCH",
8477                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8478                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8479                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8480                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8481                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8482            }
8483        }
8484        /// Creates an enum from field names used in the ProtoBuf definition.
8485        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8486            match value {
8487                "KIND_UNKNOWN" => Some(Self::Unknown),
8488                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8489                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8490                "GENESIS" => Some(Self::Genesis),
8491                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8492                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8493                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8494                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8495                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8496                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8497                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8498                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8499                    Some(Self::ProgrammableSystemTransaction)
8500                }
8501                _ => None,
8502            }
8503        }
8504    }
8505    #[non_exhaustive]
8506    #[derive(Clone, PartialEq, ::prost::Oneof)]
8507    pub enum Data {
8508        /// A transaction comprised of a list of native commands and Move calls.
8509        #[prost(message, tag = "2")]
8510        ProgrammableTransaction(super::ProgrammableTransaction),
8511        /// System transaction used to end an epoch.
8512        ///
8513        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8514        /// `EndOfEpochTransaction`).
8515        #[prost(message, tag = "3")]
8516        ChangeEpoch(super::ChangeEpoch),
8517        /// Transaction used to initialize the chain state.
8518        ///
8519        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8520        /// executed on the chain.
8521        #[prost(message, tag = "4")]
8522        Genesis(super::GenesisTransaction),
8523        /// consensus commit update info
8524        #[prost(message, tag = "5")]
8525        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8526        /// Update set of valid JWKs used for zklogin.
8527        #[prost(message, tag = "6")]
8528        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8529        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8530        /// the next one.
8531        #[prost(message, tag = "7")]
8532        EndOfEpoch(super::EndOfEpochTransaction),
8533        /// Randomness update.
8534        #[prost(message, tag = "8")]
8535        RandomnessStateUpdate(super::RandomnessStateUpdate),
8536    }
8537}
8538/// A user transaction.
8539///
8540/// Contains a series of native commands and Move calls where the results of one command can be
8541/// used in future commands.
8542#[non_exhaustive]
8543#[derive(Clone, PartialEq, ::prost::Message)]
8544pub struct ProgrammableTransaction {
8545    /// Input objects or primitive values.
8546    #[prost(message, repeated, tag = "1")]
8547    pub inputs: ::prost::alloc::vec::Vec<Input>,
8548    /// The commands to be executed sequentially. A failure in any command
8549    /// results in the failure of the entire transaction.
8550    #[prost(message, repeated, tag = "2")]
8551    pub commands: ::prost::alloc::vec::Vec<Command>,
8552}
8553/// A single command in a programmable transaction.
8554#[non_exhaustive]
8555#[derive(Clone, PartialEq, ::prost::Message)]
8556pub struct Command {
8557    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8558    pub command: ::core::option::Option<command::Command>,
8559}
8560/// Nested message and enum types in `Command`.
8561pub mod command {
8562    #[non_exhaustive]
8563    #[derive(Clone, PartialEq, ::prost::Oneof)]
8564    pub enum Command {
8565        /// A call to either an entry or a public Move function.
8566        #[prost(message, tag = "1")]
8567        MoveCall(super::MoveCall),
8568        /// `(Vec<forall T:key+store. T>, address)`
8569        /// It sends n-objects to the specified address. These objects must have store
8570        /// (public transfer) and either the previous owner must be an address or the object must
8571        /// be newly created.
8572        #[prost(message, tag = "2")]
8573        TransferObjects(super::TransferObjects),
8574        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
8575        /// It splits off some amounts into new coins with those amounts.
8576        #[prost(message, tag = "3")]
8577        SplitCoins(super::SplitCoins),
8578        /// `(&mut Coin<T>, Vec<Coin<T>>)`
8579        /// It merges n-coins into the first coin.
8580        #[prost(message, tag = "4")]
8581        MergeCoins(super::MergeCoins),
8582        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
8583        /// dependencies to link against on chain.
8584        #[prost(message, tag = "5")]
8585        Publish(super::Publish),
8586        /// `forall T: Vec<T> -> vector<T>`
8587        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
8588        /// the type tag must be specified.
8589        #[prost(message, tag = "6")]
8590        MakeMoveVector(super::MakeMoveVector),
8591        /// Upgrades a Move package.
8592        /// Takes (in order):
8593        ///
8594        /// 1. A vector of serialized modules for the package.
8595        /// 1. A vector of object ids for the transitive dependencies of the new package.
8596        /// 1. The object ID of the package being upgraded.
8597        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
8598        ///    programmable transaction.
8599        #[prost(message, tag = "7")]
8600        Upgrade(super::Upgrade),
8601    }
8602}
8603/// Command to call a Move function.
8604///
8605/// Functions that can be called by a `MoveCall` command are those that have a function signature
8606/// that is either `entry` or `public` (which don't have a reference return type).
8607#[non_exhaustive]
8608#[derive(Clone, PartialEq, ::prost::Message)]
8609pub struct MoveCall {
8610    /// The package containing the module and function.
8611    #[prost(string, optional, tag = "1")]
8612    pub package: ::core::option::Option<::prost::alloc::string::String>,
8613    /// The specific module in the package containing the function.
8614    #[prost(string, optional, tag = "2")]
8615    pub module: ::core::option::Option<::prost::alloc::string::String>,
8616    /// The function to be called.
8617    #[prost(string, optional, tag = "3")]
8618    pub function: ::core::option::Option<::prost::alloc::string::String>,
8619    /// The type arguments to the function.
8620    #[prost(string, repeated, tag = "4")]
8621    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8622    /// The arguments to the function.
8623    #[prost(message, repeated, tag = "5")]
8624    pub arguments: ::prost::alloc::vec::Vec<Argument>,
8625}
8626/// Command to transfer ownership of a set of objects to an address.
8627#[non_exhaustive]
8628#[derive(Clone, PartialEq, ::prost::Message)]
8629pub struct TransferObjects {
8630    /// Set of objects to transfer.
8631    #[prost(message, repeated, tag = "1")]
8632    pub objects: ::prost::alloc::vec::Vec<Argument>,
8633    /// The address to transfer ownership to.
8634    #[prost(message, optional, tag = "2")]
8635    pub address: ::core::option::Option<Argument>,
8636}
8637/// Command to split a single coin object into multiple coins.
8638#[non_exhaustive]
8639#[derive(Clone, PartialEq, ::prost::Message)]
8640pub struct SplitCoins {
8641    /// The coin to split.
8642    #[prost(message, optional, tag = "1")]
8643    pub coin: ::core::option::Option<Argument>,
8644    /// The amounts to split off.
8645    #[prost(message, repeated, tag = "2")]
8646    pub amounts: ::prost::alloc::vec::Vec<Argument>,
8647}
8648/// Command to merge multiple coins of the same type into a single coin.
8649#[non_exhaustive]
8650#[derive(Clone, PartialEq, ::prost::Message)]
8651pub struct MergeCoins {
8652    /// Coin to merge coins into.
8653    #[prost(message, optional, tag = "1")]
8654    pub coin: ::core::option::Option<Argument>,
8655    /// Set of coins to merge into `coin`.
8656    ///
8657    /// All listed coins must be of the same type and be the same type as `coin`
8658    #[prost(message, repeated, tag = "2")]
8659    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8660}
8661/// Command to publish a new Move package.
8662#[non_exhaustive]
8663#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8664pub struct Publish {
8665    /// The serialized Move modules.
8666    #[prost(bytes = "bytes", repeated, tag = "1")]
8667    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8668    /// Set of packages that the to-be published package depends on.
8669    #[prost(string, repeated, tag = "2")]
8670    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8671}
8672/// Command to build a Move vector out of a set of individual elements.
8673#[non_exhaustive]
8674#[derive(Clone, PartialEq, ::prost::Message)]
8675pub struct MakeMoveVector {
8676    /// Type of the individual elements.
8677    ///
8678    /// This is required to be set when the type can't be inferred, for example when the set of
8679    /// provided arguments are all pure input values.
8680    #[prost(string, optional, tag = "1")]
8681    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8682    /// The set individual elements to build the vector with.
8683    #[prost(message, repeated, tag = "2")]
8684    pub elements: ::prost::alloc::vec::Vec<Argument>,
8685}
8686/// Command to upgrade an already published package.
8687#[non_exhaustive]
8688#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8689pub struct Upgrade {
8690    /// The serialized Move modules.
8691    #[prost(bytes = "bytes", repeated, tag = "1")]
8692    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8693    /// Set of packages that the to-be published package depends on.
8694    #[prost(string, repeated, tag = "2")]
8695    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8696    /// Package ID of the package to upgrade.
8697    #[prost(string, optional, tag = "3")]
8698    pub package: ::core::option::Option<::prost::alloc::string::String>,
8699    /// Ticket authorizing the upgrade.
8700    #[prost(message, optional, tag = "4")]
8701    pub ticket: ::core::option::Option<Argument>,
8702}
8703/// Randomness update.
8704#[non_exhaustive]
8705#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8706pub struct RandomnessStateUpdate {
8707    /// Epoch of the randomness state update transaction.
8708    #[prost(uint64, optional, tag = "1")]
8709    pub epoch: ::core::option::Option<u64>,
8710    /// Randomness round of the update.
8711    #[prost(uint64, optional, tag = "2")]
8712    pub randomness_round: ::core::option::Option<u64>,
8713    /// Updated random bytes.
8714    #[prost(bytes = "bytes", optional, tag = "3")]
8715    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8716    /// The initial version of the randomness object that it was shared at.
8717    #[prost(uint64, optional, tag = "4")]
8718    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8719}
8720/// System transaction used to change the epoch.
8721#[non_exhaustive]
8722#[derive(Clone, PartialEq, ::prost::Message)]
8723pub struct ChangeEpoch {
8724    /// The next (to become) epoch ID.
8725    #[prost(uint64, optional, tag = "1")]
8726    pub epoch: ::core::option::Option<u64>,
8727    /// The protocol version in effect in the new epoch.
8728    #[prost(uint64, optional, tag = "2")]
8729    pub protocol_version: ::core::option::Option<u64>,
8730    /// The total amount of gas charged for storage during the epoch.
8731    #[prost(uint64, optional, tag = "3")]
8732    pub storage_charge: ::core::option::Option<u64>,
8733    /// The total amount of gas charged for computation during the epoch.
8734    #[prost(uint64, optional, tag = "4")]
8735    pub computation_charge: ::core::option::Option<u64>,
8736    /// The amount of storage rebate refunded to the txn senders.
8737    #[prost(uint64, optional, tag = "5")]
8738    pub storage_rebate: ::core::option::Option<u64>,
8739    /// The non-refundable storage fee.
8740    #[prost(uint64, optional, tag = "6")]
8741    pub non_refundable_storage_fee: ::core::option::Option<u64>,
8742    /// Unix timestamp when epoch started.
8743    #[prost(message, optional, tag = "7")]
8744    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8745    /// System packages (specifically framework and Move stdlib) that are written before the new
8746    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
8747    /// the validator must write out the following modules.  Modules are provided with the version they
8748    /// will be upgraded to, their modules in serialized form (which include their package ID), and
8749    /// a list of their transitive dependencies.
8750    #[prost(message, repeated, tag = "8")]
8751    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8752}
8753/// System package.
8754#[non_exhaustive]
8755#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8756pub struct SystemPackage {
8757    /// Version of the package.
8758    #[prost(uint64, optional, tag = "1")]
8759    pub version: ::core::option::Option<u64>,
8760    /// Move modules.
8761    #[prost(bytes = "bytes", repeated, tag = "2")]
8762    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8763    /// Package dependencies.
8764    #[prost(string, repeated, tag = "3")]
8765    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8766}
8767/// The genesis transaction.
8768#[non_exhaustive]
8769#[derive(Clone, PartialEq, ::prost::Message)]
8770pub struct GenesisTransaction {
8771    /// Set of genesis objects.
8772    #[prost(message, repeated, tag = "1")]
8773    pub objects: ::prost::alloc::vec::Vec<Object>,
8774}
8775/// Consensus commit prologue system transaction.
8776///
8777/// This message can represent V1, V2, and V3 prologue types.
8778#[non_exhaustive]
8779#[derive(Clone, PartialEq, ::prost::Message)]
8780pub struct ConsensusCommitPrologue {
8781    /// Epoch of the commit prologue transaction.
8782    ///
8783    /// Present in V1, V2, V3, V4.
8784    #[prost(uint64, optional, tag = "1")]
8785    pub epoch: ::core::option::Option<u64>,
8786    /// Consensus round of the commit.
8787    ///
8788    /// Present in V1, V2, V3, V4.
8789    #[prost(uint64, optional, tag = "2")]
8790    pub round: ::core::option::Option<u64>,
8791    /// Unix timestamp from consensus.
8792    ///
8793    /// Present in V1, V2, V3, V4.
8794    #[prost(message, optional, tag = "3")]
8795    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8796    /// Digest of consensus output.
8797    ///
8798    /// Present in V2, V3, V4.
8799    #[prost(string, optional, tag = "4")]
8800    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8801    /// The sub DAG index of the consensus commit. This field is populated if there
8802    /// are multiple consensus commits per round.
8803    ///
8804    /// Present in V3, V4.
8805    #[prost(uint64, optional, tag = "5")]
8806    pub sub_dag_index: ::core::option::Option<u64>,
8807    /// Stores consensus handler determined consensus object version assignments.
8808    ///
8809    /// Present in V3, V4.
8810    #[prost(message, optional, tag = "6")]
8811    pub consensus_determined_version_assignments: ::core::option::Option<
8812        ConsensusDeterminedVersionAssignments,
8813    >,
8814    /// Digest of any additional state computed by the consensus handler.
8815    /// Used to detect forking bugs as early as possible.
8816    ///
8817    /// Present in V4.
8818    #[prost(string, optional, tag = "7")]
8819    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8820}
8821/// Object version assignment from consensus.
8822#[non_exhaustive]
8823#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8824pub struct VersionAssignment {
8825    /// `ObjectId` of the object.
8826    #[prost(string, optional, tag = "1")]
8827    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8828    /// start version of the consensus stream for this object
8829    #[prost(uint64, optional, tag = "2")]
8830    pub start_version: ::core::option::Option<u64>,
8831    /// Assigned version.
8832    #[prost(uint64, optional, tag = "3")]
8833    pub version: ::core::option::Option<u64>,
8834}
8835/// A transaction that was canceled.
8836#[non_exhaustive]
8837#[derive(Clone, PartialEq, ::prost::Message)]
8838pub struct CanceledTransaction {
8839    /// Digest of the canceled transaction.
8840    #[prost(string, optional, tag = "1")]
8841    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8842    /// List of object version assignments.
8843    #[prost(message, repeated, tag = "2")]
8844    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8845}
8846/// Version assignments performed by consensus.
8847#[non_exhaustive]
8848#[derive(Clone, PartialEq, ::prost::Message)]
8849pub struct ConsensusDeterminedVersionAssignments {
8850    /// Version of this message
8851    #[prost(int32, optional, tag = "1")]
8852    pub version: ::core::option::Option<i32>,
8853    /// Canceled transaction version assignment.
8854    #[prost(message, repeated, tag = "3")]
8855    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8856}
8857/// Update the set of valid JWKs.
8858#[non_exhaustive]
8859#[derive(Clone, PartialEq, ::prost::Message)]
8860pub struct AuthenticatorStateUpdate {
8861    /// Epoch of the authenticator state update transaction.
8862    #[prost(uint64, optional, tag = "1")]
8863    pub epoch: ::core::option::Option<u64>,
8864    /// Consensus round of the authenticator state update.
8865    #[prost(uint64, optional, tag = "2")]
8866    pub round: ::core::option::Option<u64>,
8867    /// Newly active JWKs.
8868    #[prost(message, repeated, tag = "3")]
8869    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8870    /// The initial version of the authenticator object that it was shared at.
8871    #[prost(uint64, optional, tag = "4")]
8872    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8873}
8874/// A new JWK.
8875#[non_exhaustive]
8876#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8877pub struct ActiveJwk {
8878    /// Identifier used to uniquely identify a JWK.
8879    #[prost(message, optional, tag = "1")]
8880    pub id: ::core::option::Option<JwkId>,
8881    /// The JWK.
8882    #[prost(message, optional, tag = "2")]
8883    pub jwk: ::core::option::Option<Jwk>,
8884    /// Most recent epoch in which the JWK was validated.
8885    #[prost(uint64, optional, tag = "3")]
8886    pub epoch: ::core::option::Option<u64>,
8887}
8888/// Set of operations run at the end of the epoch to close out the current epoch
8889/// and start the next one.
8890#[non_exhaustive]
8891#[derive(Clone, PartialEq, ::prost::Message)]
8892pub struct EndOfEpochTransaction {
8893    #[prost(message, repeated, tag = "1")]
8894    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8895}
8896/// Operation run at the end of an epoch.
8897#[non_exhaustive]
8898#[derive(Clone, PartialEq, ::prost::Message)]
8899pub struct EndOfEpochTransactionKind {
8900    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8901    pub kind: ::core::option::Option<i32>,
8902    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8903    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8904}
8905/// Nested message and enum types in `EndOfEpochTransactionKind`.
8906pub mod end_of_epoch_transaction_kind {
8907    #[non_exhaustive]
8908    #[derive(
8909        Clone,
8910        Copy,
8911        Debug,
8912        PartialEq,
8913        Eq,
8914        Hash,
8915        PartialOrd,
8916        Ord,
8917        ::prost::Enumeration
8918    )]
8919    #[repr(i32)]
8920    pub enum Kind {
8921        Unknown = 0,
8922        /// End the epoch and start the next one.
8923        ChangeEpoch = 1,
8924        /// Create and initialize the authenticator object used for zklogin.
8925        AuthenticatorStateCreate = 2,
8926        /// Expire JWKs used for zklogin.
8927        AuthenticatorStateExpire = 3,
8928        /// Create and initialize the randomness object.
8929        RandomnessStateCreate = 4,
8930        /// Create and initialize the deny list object.
8931        DenyListStateCreate = 5,
8932        /// Create and initialize the bridge object.
8933        BridgeStateCreate = 6,
8934        /// Initialize the bridge committee.
8935        BridgeCommitteeInit = 7,
8936        /// Execution time observations from the committee to preserve cross epoch
8937        StoreExecutionTimeObservations = 8,
8938        /// Create the accumulator root object.
8939        AccumulatorRootCreate = 9,
8940        /// Create and initialize the Coin Registry object.
8941        CoinRegistryCreate = 10,
8942        /// Create and initialize the Display Registry object.
8943        DisplayRegistryCreate = 11,
8944        /// Create and initialize the Address Alias State object.
8945        AddressAliasStateCreate = 12,
8946        /// Write the end-of-epoch-computed storage cost for accumulator objects.
8947        WriteAccumulatorStorageCost = 13,
8948        /// Create and initialize the Forwarding Address Registry object.
8949        ForwardingAddressRegistryCreate = 14,
8950    }
8951    impl Kind {
8952        /// String value of the enum field names used in the ProtoBuf definition.
8953        ///
8954        /// The values are not transformed in any way and thus are considered stable
8955        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8956        pub fn as_str_name(&self) -> &'static str {
8957            match self {
8958                Self::Unknown => "KIND_UNKNOWN",
8959                Self::ChangeEpoch => "CHANGE_EPOCH",
8960                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8961                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8962                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8963                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8964                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8965                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8966                Self::StoreExecutionTimeObservations => {
8967                    "STORE_EXECUTION_TIME_OBSERVATIONS"
8968                }
8969                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8970                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8971                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8972                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8973                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8974                Self::ForwardingAddressRegistryCreate => {
8975                    "FORWARDING_ADDRESS_REGISTRY_CREATE"
8976                }
8977            }
8978        }
8979        /// Creates an enum from field names used in the ProtoBuf definition.
8980        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8981            match value {
8982                "KIND_UNKNOWN" => Some(Self::Unknown),
8983                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8984                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8985                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8986                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8987                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8988                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8989                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8990                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8991                    Some(Self::StoreExecutionTimeObservations)
8992                }
8993                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8994                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8995                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8996                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8997                "WRITE_ACCUMULATOR_STORAGE_COST" => {
8998                    Some(Self::WriteAccumulatorStorageCost)
8999                }
9000                "FORWARDING_ADDRESS_REGISTRY_CREATE" => {
9001                    Some(Self::ForwardingAddressRegistryCreate)
9002                }
9003                _ => None,
9004            }
9005        }
9006    }
9007    #[non_exhaustive]
9008    #[derive(Clone, PartialEq, ::prost::Oneof)]
9009    pub enum Data {
9010        /// End the epoch and start the next one.
9011        #[prost(message, tag = "2")]
9012        ChangeEpoch(super::ChangeEpoch),
9013        /// Expire JWKs used for zklogin.
9014        #[prost(message, tag = "3")]
9015        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
9016        /// Execution time observations from the committee to preserve cross epoch
9017        #[prost(message, tag = "4")]
9018        ExecutionTimeObservations(super::ExecutionTimeObservations),
9019        /// ChainId used when initializing the bridge
9020        #[prost(string, tag = "5")]
9021        BridgeChainId(::prost::alloc::string::String),
9022        /// Start version of the Bridge object
9023        #[prost(uint64, tag = "6")]
9024        BridgeObjectVersion(u64),
9025        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
9026        #[prost(uint64, tag = "7")]
9027        StorageCost(u64),
9028    }
9029}
9030/// Expire old JWKs.
9031#[non_exhaustive]
9032#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
9033pub struct AuthenticatorStateExpire {
9034    /// Expire JWKs that have a lower epoch than this.
9035    #[prost(uint64, optional, tag = "1")]
9036    pub min_epoch: ::core::option::Option<u64>,
9037    /// The initial version of the authenticator object that it was shared at.
9038    #[prost(uint64, optional, tag = "2")]
9039    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
9040}
9041#[non_exhaustive]
9042#[derive(Clone, PartialEq, ::prost::Message)]
9043pub struct ExecutionTimeObservations {
9044    /// Version of this ExecutionTimeObservations
9045    #[prost(int32, optional, tag = "1")]
9046    pub version: ::core::option::Option<i32>,
9047    #[prost(message, repeated, tag = "2")]
9048    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
9049}
9050#[non_exhaustive]
9051#[derive(Clone, PartialEq, ::prost::Message)]
9052pub struct ExecutionTimeObservation {
9053    #[prost(
9054        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
9055        optional,
9056        tag = "1"
9057    )]
9058    pub kind: ::core::option::Option<i32>,
9059    #[prost(message, optional, tag = "2")]
9060    pub move_entry_point: ::core::option::Option<MoveCall>,
9061    #[prost(message, repeated, tag = "3")]
9062    pub validator_observations: ::prost::alloc::vec::Vec<
9063        ValidatorExecutionTimeObservation,
9064    >,
9065}
9066/// Nested message and enum types in `ExecutionTimeObservation`.
9067pub mod execution_time_observation {
9068    #[non_exhaustive]
9069    #[derive(
9070        Clone,
9071        Copy,
9072        Debug,
9073        PartialEq,
9074        Eq,
9075        Hash,
9076        PartialOrd,
9077        Ord,
9078        ::prost::Enumeration
9079    )]
9080    #[repr(i32)]
9081    pub enum ExecutionTimeObservationKind {
9082        Unknown = 0,
9083        MoveEntryPoint = 1,
9084        TransferObjects = 2,
9085        SplitCoins = 3,
9086        MergeCoins = 4,
9087        Publish = 5,
9088        MakeMoveVector = 6,
9089        Upgrade = 7,
9090    }
9091    impl ExecutionTimeObservationKind {
9092        /// String value of the enum field names used in the ProtoBuf definition.
9093        ///
9094        /// The values are not transformed in any way and thus are considered stable
9095        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9096        pub fn as_str_name(&self) -> &'static str {
9097            match self {
9098                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9099                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9100                Self::TransferObjects => "TRANSFER_OBJECTS",
9101                Self::SplitCoins => "SPLIT_COINS",
9102                Self::MergeCoins => "MERGE_COINS",
9103                Self::Publish => "PUBLISH",
9104                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9105                Self::Upgrade => "UPGRADE",
9106            }
9107        }
9108        /// Creates an enum from field names used in the ProtoBuf definition.
9109        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9110            match value {
9111                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9112                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9113                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9114                "SPLIT_COINS" => Some(Self::SplitCoins),
9115                "MERGE_COINS" => Some(Self::MergeCoins),
9116                "PUBLISH" => Some(Self::Publish),
9117                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9118                "UPGRADE" => Some(Self::Upgrade),
9119                _ => None,
9120            }
9121        }
9122    }
9123}
9124#[non_exhaustive]
9125#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9126pub struct ValidatorExecutionTimeObservation {
9127    /// Bls12381 public key of the validator
9128    #[prost(bytes = "bytes", optional, tag = "1")]
9129    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9130    /// Duration of an execution observation
9131    #[prost(message, optional, tag = "2")]
9132    pub duration: ::core::option::Option<::prost_types::Duration>,
9133}
9134#[non_exhaustive]
9135#[derive(Clone, PartialEq, ::prost::Message)]
9136pub struct ExecuteTransactionRequest {
9137    /// The transaction to execute.
9138    #[prost(message, optional, tag = "1")]
9139    pub transaction: ::core::option::Option<Transaction>,
9140    /// Set of `UserSignature`s authorizing the execution of the provided
9141    /// transaction.
9142    #[prost(message, repeated, tag = "2")]
9143    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9144    /// Mask specifying which fields to read.
9145    /// If no mask is specified, defaults to `effects.status,checkpoint`.
9146    #[prost(message, optional, tag = "3")]
9147    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9148}
9149/// Response message for `NodeService.ExecuteTransaction`.
9150#[non_exhaustive]
9151#[derive(Clone, PartialEq, ::prost::Message)]
9152pub struct ExecuteTransactionResponse {
9153    #[prost(message, optional, tag = "1")]
9154    pub transaction: ::core::option::Option<ExecutedTransaction>,
9155}
9156#[non_exhaustive]
9157#[derive(Clone, PartialEq, ::prost::Message)]
9158pub struct SimulateTransactionRequest {
9159    #[prost(message, optional, tag = "1")]
9160    pub transaction: ::core::option::Option<Transaction>,
9161    /// Mask specifying which fields to read.
9162    #[prost(message, optional, tag = "2")]
9163    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9164    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
9165    #[prost(
9166        enumeration = "simulate_transaction_request::TransactionChecks",
9167        optional,
9168        tag = "3"
9169    )]
9170    pub checks: ::core::option::Option<i32>,
9171    /// Perform gas selection based on a budget estimation and include the
9172    /// selected gas payment and budget in the response.
9173    ///
9174    /// This option will be ignored if `checks` is `DISABLED`.
9175    #[prost(bool, optional, tag = "4")]
9176    pub do_gas_selection: ::core::option::Option<bool>,
9177}
9178/// Nested message and enum types in `SimulateTransactionRequest`.
9179pub mod simulate_transaction_request {
9180    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
9181    #[non_exhaustive]
9182    #[derive(
9183        Clone,
9184        Copy,
9185        Debug,
9186        PartialEq,
9187        Eq,
9188        Hash,
9189        PartialOrd,
9190        Ord,
9191        ::prost::Enumeration
9192    )]
9193    #[repr(i32)]
9194    pub enum TransactionChecks {
9195        Enabled = 0,
9196        Disabled = 1,
9197    }
9198    impl TransactionChecks {
9199        /// String value of the enum field names used in the ProtoBuf definition.
9200        ///
9201        /// The values are not transformed in any way and thus are considered stable
9202        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9203        pub fn as_str_name(&self) -> &'static str {
9204            match self {
9205                Self::Enabled => "ENABLED",
9206                Self::Disabled => "DISABLED",
9207            }
9208        }
9209        /// Creates an enum from field names used in the ProtoBuf definition.
9210        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9211            match value {
9212                "ENABLED" => Some(Self::Enabled),
9213                "DISABLED" => Some(Self::Disabled),
9214                _ => None,
9215            }
9216        }
9217    }
9218}
9219#[non_exhaustive]
9220#[derive(Clone, PartialEq, ::prost::Message)]
9221pub struct SimulateTransactionResponse {
9222    #[prost(message, optional, tag = "1")]
9223    pub transaction: ::core::option::Option<ExecutedTransaction>,
9224    #[prost(message, repeated, tag = "2")]
9225    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9226    /// A suggested gas price to use, that is above RGP, in order to provide a
9227    /// better chance of the transaction being included in the presence of
9228    /// congested objects.
9229    #[prost(uint64, optional, tag = "3")]
9230    pub suggested_gas_price: ::core::option::Option<u64>,
9231}
9232/// An intermediate result/output from the execution of a single command
9233#[non_exhaustive]
9234#[derive(Clone, PartialEq, ::prost::Message)]
9235pub struct CommandResult {
9236    #[prost(message, repeated, tag = "1")]
9237    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9238    #[prost(message, repeated, tag = "2")]
9239    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9240}
9241#[non_exhaustive]
9242#[derive(Clone, PartialEq, ::prost::Message)]
9243pub struct CommandOutput {
9244    #[prost(message, optional, tag = "1")]
9245    pub argument: ::core::option::Option<Argument>,
9246    #[prost(message, optional, tag = "2")]
9247    pub value: ::core::option::Option<Bcs>,
9248    /// JSON rendering of the output.
9249    #[prost(message, optional, boxed, tag = "3")]
9250    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9251}
9252/// Generated client implementations.
9253pub mod transaction_execution_service_client {
9254    #![allow(
9255        unused_variables,
9256        dead_code,
9257        missing_docs,
9258        clippy::wildcard_imports,
9259        clippy::let_unit_value,
9260    )]
9261    use tonic::codegen::*;
9262    use tonic::codegen::http::Uri;
9263    #[derive(Debug, Clone)]
9264    pub struct TransactionExecutionServiceClient<T> {
9265        inner: tonic::client::Grpc<T>,
9266    }
9267    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9268        /// Attempt to create a new client by connecting to a given endpoint.
9269        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9270        where
9271            D: TryInto<tonic::transport::Endpoint>,
9272            D::Error: Into<StdError>,
9273        {
9274            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9275            Ok(Self::new(conn))
9276        }
9277    }
9278    impl<T> TransactionExecutionServiceClient<T>
9279    where
9280        T: tonic::client::GrpcService<tonic::body::Body>,
9281        T::Error: Into<StdError>,
9282        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9283        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9284    {
9285        pub fn new(inner: T) -> Self {
9286            let inner = tonic::client::Grpc::new(inner);
9287            Self { inner }
9288        }
9289        pub fn with_origin(inner: T, origin: Uri) -> Self {
9290            let inner = tonic::client::Grpc::with_origin(inner, origin);
9291            Self { inner }
9292        }
9293        pub fn with_interceptor<F>(
9294            inner: T,
9295            interceptor: F,
9296        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9297        where
9298            F: tonic::service::Interceptor,
9299            T::ResponseBody: Default,
9300            T: tonic::codegen::Service<
9301                http::Request<tonic::body::Body>,
9302                Response = http::Response<
9303                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9304                >,
9305            >,
9306            <T as tonic::codegen::Service<
9307                http::Request<tonic::body::Body>,
9308            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9309        {
9310            TransactionExecutionServiceClient::new(
9311                InterceptedService::new(inner, interceptor),
9312            )
9313        }
9314        /// Compress requests with the given encoding.
9315        ///
9316        /// This requires the server to support it otherwise it might respond with an
9317        /// error.
9318        #[must_use]
9319        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9320            self.inner = self.inner.send_compressed(encoding);
9321            self
9322        }
9323        /// Enable decompressing responses.
9324        #[must_use]
9325        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9326            self.inner = self.inner.accept_compressed(encoding);
9327            self
9328        }
9329        /// Limits the maximum size of a decoded message.
9330        ///
9331        /// Default: `4MB`
9332        #[must_use]
9333        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9334            self.inner = self.inner.max_decoding_message_size(limit);
9335            self
9336        }
9337        /// Limits the maximum size of an encoded message.
9338        ///
9339        /// Default: `usize::MAX`
9340        #[must_use]
9341        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9342            self.inner = self.inner.max_encoding_message_size(limit);
9343            self
9344        }
9345        pub async fn execute_transaction(
9346            &mut self,
9347            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9348        ) -> std::result::Result<
9349            tonic::Response<super::ExecuteTransactionResponse>,
9350            tonic::Status,
9351        > {
9352            self.inner
9353                .ready()
9354                .await
9355                .map_err(|e| {
9356                    tonic::Status::unknown(
9357                        format!("Service was not ready: {}", e.into()),
9358                    )
9359                })?;
9360            let codec = tonic_prost::ProstCodec::default();
9361            let path = http::uri::PathAndQuery::from_static(
9362                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9363            );
9364            let mut req = request.into_request();
9365            req.extensions_mut()
9366                .insert(
9367                    GrpcMethod::new(
9368                        "sui.rpc.v2.TransactionExecutionService",
9369                        "ExecuteTransaction",
9370                    ),
9371                );
9372            self.inner.unary(req, path, codec).await
9373        }
9374        pub async fn simulate_transaction(
9375            &mut self,
9376            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9377        ) -> std::result::Result<
9378            tonic::Response<super::SimulateTransactionResponse>,
9379            tonic::Status,
9380        > {
9381            self.inner
9382                .ready()
9383                .await
9384                .map_err(|e| {
9385                    tonic::Status::unknown(
9386                        format!("Service was not ready: {}", e.into()),
9387                    )
9388                })?;
9389            let codec = tonic_prost::ProstCodec::default();
9390            let path = http::uri::PathAndQuery::from_static(
9391                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9392            );
9393            let mut req = request.into_request();
9394            req.extensions_mut()
9395                .insert(
9396                    GrpcMethod::new(
9397                        "sui.rpc.v2.TransactionExecutionService",
9398                        "SimulateTransaction",
9399                    ),
9400                );
9401            self.inner.unary(req, path, codec).await
9402        }
9403    }
9404}
9405/// Generated server implementations.
9406pub mod transaction_execution_service_server {
9407    #![allow(
9408        unused_variables,
9409        dead_code,
9410        missing_docs,
9411        clippy::wildcard_imports,
9412        clippy::let_unit_value,
9413    )]
9414    use tonic::codegen::*;
9415    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
9416    #[async_trait]
9417    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9418        async fn execute_transaction(
9419            &self,
9420            request: tonic::Request<super::ExecuteTransactionRequest>,
9421        ) -> std::result::Result<
9422            tonic::Response<super::ExecuteTransactionResponse>,
9423            tonic::Status,
9424        > {
9425            Err(tonic::Status::unimplemented("Not yet implemented"))
9426        }
9427        async fn simulate_transaction(
9428            &self,
9429            request: tonic::Request<super::SimulateTransactionRequest>,
9430        ) -> std::result::Result<
9431            tonic::Response<super::SimulateTransactionResponse>,
9432            tonic::Status,
9433        > {
9434            Err(tonic::Status::unimplemented("Not yet implemented"))
9435        }
9436    }
9437    #[derive(Debug)]
9438    pub struct TransactionExecutionServiceServer<T> {
9439        inner: Arc<T>,
9440        accept_compression_encodings: EnabledCompressionEncodings,
9441        send_compression_encodings: EnabledCompressionEncodings,
9442        max_decoding_message_size: Option<usize>,
9443        max_encoding_message_size: Option<usize>,
9444    }
9445    impl<T> TransactionExecutionServiceServer<T> {
9446        pub fn new(inner: T) -> Self {
9447            Self::from_arc(Arc::new(inner))
9448        }
9449        pub fn from_arc(inner: Arc<T>) -> Self {
9450            Self {
9451                inner,
9452                accept_compression_encodings: Default::default(),
9453                send_compression_encodings: Default::default(),
9454                max_decoding_message_size: None,
9455                max_encoding_message_size: None,
9456            }
9457        }
9458        pub fn with_interceptor<F>(
9459            inner: T,
9460            interceptor: F,
9461        ) -> InterceptedService<Self, F>
9462        where
9463            F: tonic::service::Interceptor,
9464        {
9465            InterceptedService::new(Self::new(inner), interceptor)
9466        }
9467        /// Enable decompressing requests with the given encoding.
9468        #[must_use]
9469        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9470            self.accept_compression_encodings.enable(encoding);
9471            self
9472        }
9473        /// Compress responses with the given encoding, if the client supports it.
9474        #[must_use]
9475        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9476            self.send_compression_encodings.enable(encoding);
9477            self
9478        }
9479        /// Limits the maximum size of a decoded message.
9480        ///
9481        /// Default: `4MB`
9482        #[must_use]
9483        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9484            self.max_decoding_message_size = Some(limit);
9485            self
9486        }
9487        /// Limits the maximum size of an encoded message.
9488        ///
9489        /// Default: `usize::MAX`
9490        #[must_use]
9491        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9492            self.max_encoding_message_size = Some(limit);
9493            self
9494        }
9495    }
9496    impl<T, B> tonic::codegen::Service<http::Request<B>>
9497    for TransactionExecutionServiceServer<T>
9498    where
9499        T: TransactionExecutionService,
9500        B: Body + std::marker::Send + 'static,
9501        B::Error: Into<StdError> + std::marker::Send + 'static,
9502    {
9503        type Response = http::Response<tonic::body::Body>;
9504        type Error = std::convert::Infallible;
9505        type Future = BoxFuture<Self::Response, Self::Error>;
9506        fn poll_ready(
9507            &mut self,
9508            _cx: &mut Context<'_>,
9509        ) -> Poll<std::result::Result<(), Self::Error>> {
9510            Poll::Ready(Ok(()))
9511        }
9512        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9513            match req.uri().path() {
9514                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9515                    #[allow(non_camel_case_types)]
9516                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9517                        pub Arc<T>,
9518                    );
9519                    impl<
9520                        T: TransactionExecutionService,
9521                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9522                    for ExecuteTransactionSvc<T> {
9523                        type Response = super::ExecuteTransactionResponse;
9524                        type Future = BoxFuture<
9525                            tonic::Response<Self::Response>,
9526                            tonic::Status,
9527                        >;
9528                        fn call(
9529                            &mut self,
9530                            request: tonic::Request<super::ExecuteTransactionRequest>,
9531                        ) -> Self::Future {
9532                            let inner = Arc::clone(&self.0);
9533                            let fut = async move {
9534                                <T as TransactionExecutionService>::execute_transaction(
9535                                        &inner,
9536                                        request,
9537                                    )
9538                                    .await
9539                            };
9540                            Box::pin(fut)
9541                        }
9542                    }
9543                    let accept_compression_encodings = self.accept_compression_encodings;
9544                    let send_compression_encodings = self.send_compression_encodings;
9545                    let max_decoding_message_size = self.max_decoding_message_size;
9546                    let max_encoding_message_size = self.max_encoding_message_size;
9547                    let inner = self.inner.clone();
9548                    let fut = async move {
9549                        let method = ExecuteTransactionSvc(inner);
9550                        let codec = tonic_prost::ProstCodec::default();
9551                        let mut grpc = tonic::server::Grpc::new(codec)
9552                            .apply_compression_config(
9553                                accept_compression_encodings,
9554                                send_compression_encodings,
9555                            )
9556                            .apply_max_message_size_config(
9557                                max_decoding_message_size,
9558                                max_encoding_message_size,
9559                            );
9560                        let res = grpc.unary(method, req).await;
9561                        Ok(res)
9562                    };
9563                    Box::pin(fut)
9564                }
9565                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9566                    #[allow(non_camel_case_types)]
9567                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
9568                        pub Arc<T>,
9569                    );
9570                    impl<
9571                        T: TransactionExecutionService,
9572                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
9573                    for SimulateTransactionSvc<T> {
9574                        type Response = super::SimulateTransactionResponse;
9575                        type Future = BoxFuture<
9576                            tonic::Response<Self::Response>,
9577                            tonic::Status,
9578                        >;
9579                        fn call(
9580                            &mut self,
9581                            request: tonic::Request<super::SimulateTransactionRequest>,
9582                        ) -> Self::Future {
9583                            let inner = Arc::clone(&self.0);
9584                            let fut = async move {
9585                                <T as TransactionExecutionService>::simulate_transaction(
9586                                        &inner,
9587                                        request,
9588                                    )
9589                                    .await
9590                            };
9591                            Box::pin(fut)
9592                        }
9593                    }
9594                    let accept_compression_encodings = self.accept_compression_encodings;
9595                    let send_compression_encodings = self.send_compression_encodings;
9596                    let max_decoding_message_size = self.max_decoding_message_size;
9597                    let max_encoding_message_size = self.max_encoding_message_size;
9598                    let inner = self.inner.clone();
9599                    let fut = async move {
9600                        let method = SimulateTransactionSvc(inner);
9601                        let codec = tonic_prost::ProstCodec::default();
9602                        let mut grpc = tonic::server::Grpc::new(codec)
9603                            .apply_compression_config(
9604                                accept_compression_encodings,
9605                                send_compression_encodings,
9606                            )
9607                            .apply_max_message_size_config(
9608                                max_decoding_message_size,
9609                                max_encoding_message_size,
9610                            );
9611                        let res = grpc.unary(method, req).await;
9612                        Ok(res)
9613                    };
9614                    Box::pin(fut)
9615                }
9616                _ => {
9617                    Box::pin(async move {
9618                        let mut response = http::Response::new(
9619                            tonic::body::Body::default(),
9620                        );
9621                        let headers = response.headers_mut();
9622                        headers
9623                            .insert(
9624                                tonic::Status::GRPC_STATUS,
9625                                (tonic::Code::Unimplemented as i32).into(),
9626                            );
9627                        headers
9628                            .insert(
9629                                http::header::CONTENT_TYPE,
9630                                tonic::metadata::GRPC_CONTENT_TYPE,
9631                            );
9632                        Ok(response)
9633                    })
9634                }
9635            }
9636        }
9637    }
9638    impl<T> Clone for TransactionExecutionServiceServer<T> {
9639        fn clone(&self) -> Self {
9640            let inner = self.inner.clone();
9641            Self {
9642                inner,
9643                accept_compression_encodings: self.accept_compression_encodings,
9644                send_compression_encodings: self.send_compression_encodings,
9645                max_decoding_message_size: self.max_decoding_message_size,
9646                max_encoding_message_size: self.max_encoding_message_size,
9647            }
9648        }
9649    }
9650    /// Generated gRPC service name
9651    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9652    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9653        const NAME: &'static str = SERVICE_NAME;
9654    }
9655}