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    }
1403    impl CommandArgumentErrorKind {
1404        /// String value of the enum field names used in the ProtoBuf definition.
1405        ///
1406        /// The values are not transformed in any way and thus are considered stable
1407        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1408        pub fn as_str_name(&self) -> &'static str {
1409            match self {
1410                Self::Unknown => "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN",
1411                Self::TypeMismatch => "TYPE_MISMATCH",
1412                Self::InvalidBcsBytes => "INVALID_BCS_BYTES",
1413                Self::InvalidUsageOfPureArgument => "INVALID_USAGE_OF_PURE_ARGUMENT",
1414                Self::InvalidArgumentToPrivateEntryFunction => {
1415                    "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION"
1416                }
1417                Self::IndexOutOfBounds => "INDEX_OUT_OF_BOUNDS",
1418                Self::SecondaryIndexOutOfBounds => "SECONDARY_INDEX_OUT_OF_BOUNDS",
1419                Self::InvalidResultArity => "INVALID_RESULT_ARITY",
1420                Self::InvalidGasCoinUsage => "INVALID_GAS_COIN_USAGE",
1421                Self::InvalidValueUsage => "INVALID_VALUE_USAGE",
1422                Self::InvalidObjectByValue => "INVALID_OBJECT_BY_VALUE",
1423                Self::InvalidObjectByMutRef => "INVALID_OBJECT_BY_MUT_REF",
1424                Self::ConsensusObjectOperationNotAllowed => {
1425                    "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED"
1426                }
1427                Self::InvalidArgumentArity => "INVALID_ARGUMENT_ARITY",
1428                Self::InvalidTransferObject => "INVALID_TRANSFER_OBJECT",
1429                Self::InvalidMakeMoveVecNonObjectArgument => {
1430                    "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT"
1431                }
1432                Self::ArgumentWithoutValue => "ARGUMENT_WITHOUT_VALUE",
1433                Self::CannotMoveBorrowedValue => "CANNOT_MOVE_BORROWED_VALUE",
1434                Self::CannotWriteToExtendedReference => {
1435                    "CANNOT_WRITE_TO_EXTENDED_REFERENCE"
1436                }
1437                Self::InvalidReferenceArgument => "INVALID_REFERENCE_ARGUMENT",
1438            }
1439        }
1440        /// Creates an enum from field names used in the ProtoBuf definition.
1441        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1442            match value {
1443                "COMMAND_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1444                "TYPE_MISMATCH" => Some(Self::TypeMismatch),
1445                "INVALID_BCS_BYTES" => Some(Self::InvalidBcsBytes),
1446                "INVALID_USAGE_OF_PURE_ARGUMENT" => {
1447                    Some(Self::InvalidUsageOfPureArgument)
1448                }
1449                "INVALID_ARGUMENT_TO_PRIVATE_ENTRY_FUNCTION" => {
1450                    Some(Self::InvalidArgumentToPrivateEntryFunction)
1451                }
1452                "INDEX_OUT_OF_BOUNDS" => Some(Self::IndexOutOfBounds),
1453                "SECONDARY_INDEX_OUT_OF_BOUNDS" => Some(Self::SecondaryIndexOutOfBounds),
1454                "INVALID_RESULT_ARITY" => Some(Self::InvalidResultArity),
1455                "INVALID_GAS_COIN_USAGE" => Some(Self::InvalidGasCoinUsage),
1456                "INVALID_VALUE_USAGE" => Some(Self::InvalidValueUsage),
1457                "INVALID_OBJECT_BY_VALUE" => Some(Self::InvalidObjectByValue),
1458                "INVALID_OBJECT_BY_MUT_REF" => Some(Self::InvalidObjectByMutRef),
1459                "CONSENSUS_OBJECT_OPERATION_NOT_ALLOWED" => {
1460                    Some(Self::ConsensusObjectOperationNotAllowed)
1461                }
1462                "INVALID_ARGUMENT_ARITY" => Some(Self::InvalidArgumentArity),
1463                "INVALID_TRANSFER_OBJECT" => Some(Self::InvalidTransferObject),
1464                "INVALID_MAKE_MOVE_VEC_NON_OBJECT_ARGUMENT" => {
1465                    Some(Self::InvalidMakeMoveVecNonObjectArgument)
1466                }
1467                "ARGUMENT_WITHOUT_VALUE" => Some(Self::ArgumentWithoutValue),
1468                "CANNOT_MOVE_BORROWED_VALUE" => Some(Self::CannotMoveBorrowedValue),
1469                "CANNOT_WRITE_TO_EXTENDED_REFERENCE" => {
1470                    Some(Self::CannotWriteToExtendedReference)
1471                }
1472                "INVALID_REFERENCE_ARGUMENT" => Some(Self::InvalidReferenceArgument),
1473                _ => None,
1474            }
1475        }
1476    }
1477}
1478/// An error with upgrading a package.
1479#[non_exhaustive]
1480#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1481pub struct PackageUpgradeError {
1482    #[prost(
1483        enumeration = "package_upgrade_error::PackageUpgradeErrorKind",
1484        optional,
1485        tag = "1"
1486    )]
1487    pub kind: ::core::option::Option<i32>,
1488    /// The Package Id.
1489    #[prost(string, optional, tag = "2")]
1490    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
1491    /// A digest.
1492    #[prost(string, optional, tag = "3")]
1493    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1494    /// The policy.
1495    #[prost(uint32, optional, tag = "4")]
1496    pub policy: ::core::option::Option<u32>,
1497    /// The ticket Id.
1498    #[prost(string, optional, tag = "5")]
1499    pub ticket_id: ::core::option::Option<::prost::alloc::string::String>,
1500}
1501/// Nested message and enum types in `PackageUpgradeError`.
1502pub mod package_upgrade_error {
1503    #[non_exhaustive]
1504    #[derive(
1505        Clone,
1506        Copy,
1507        Debug,
1508        PartialEq,
1509        Eq,
1510        Hash,
1511        PartialOrd,
1512        Ord,
1513        ::prost::Enumeration
1514    )]
1515    #[repr(i32)]
1516    pub enum PackageUpgradeErrorKind {
1517        Unknown = 0,
1518        /// Unable to fetch package.
1519        UnableToFetchPackage = 1,
1520        /// Object is not a package.
1521        NotAPackage = 2,
1522        /// Package upgrade is incompatible with previous version.
1523        IncompatibleUpgrade = 3,
1524        /// Digest in upgrade ticket and computed digest differ.
1525        DigestDoesNotMatch = 4,
1526        /// Upgrade policy is not valid.
1527        UnknownUpgradePolicy = 5,
1528        /// Package ID does not match `PackageId` in upgrade ticket.
1529        PackageIdDoesNotMatch = 6,
1530    }
1531    impl PackageUpgradeErrorKind {
1532        /// String value of the enum field names used in the ProtoBuf definition.
1533        ///
1534        /// The values are not transformed in any way and thus are considered stable
1535        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1536        pub fn as_str_name(&self) -> &'static str {
1537            match self {
1538                Self::Unknown => "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN",
1539                Self::UnableToFetchPackage => "UNABLE_TO_FETCH_PACKAGE",
1540                Self::NotAPackage => "NOT_A_PACKAGE",
1541                Self::IncompatibleUpgrade => "INCOMPATIBLE_UPGRADE",
1542                Self::DigestDoesNotMatch => "DIGEST_DOES_NOT_MATCH",
1543                Self::UnknownUpgradePolicy => "UNKNOWN_UPGRADE_POLICY",
1544                Self::PackageIdDoesNotMatch => "PACKAGE_ID_DOES_NOT_MATCH",
1545            }
1546        }
1547        /// Creates an enum from field names used in the ProtoBuf definition.
1548        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1549            match value {
1550                "PACKAGE_UPGRADE_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1551                "UNABLE_TO_FETCH_PACKAGE" => Some(Self::UnableToFetchPackage),
1552                "NOT_A_PACKAGE" => Some(Self::NotAPackage),
1553                "INCOMPATIBLE_UPGRADE" => Some(Self::IncompatibleUpgrade),
1554                "DIGEST_DOES_NOT_MATCH" => Some(Self::DigestDoesNotMatch),
1555                "UNKNOWN_UPGRADE_POLICY" => Some(Self::UnknownUpgradePolicy),
1556                "PACKAGE_ID_DOES_NOT_MATCH" => Some(Self::PackageIdDoesNotMatch),
1557                _ => None,
1558            }
1559        }
1560    }
1561}
1562/// Type argument error.
1563#[non_exhaustive]
1564#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1565pub struct TypeArgumentError {
1566    /// Index of the problematic type argument.
1567    #[prost(uint32, optional, tag = "1")]
1568    pub type_argument: ::core::option::Option<u32>,
1569    #[prost(
1570        enumeration = "type_argument_error::TypeArgumentErrorKind",
1571        optional,
1572        tag = "2"
1573    )]
1574    pub kind: ::core::option::Option<i32>,
1575}
1576/// Nested message and enum types in `TypeArgumentError`.
1577pub mod type_argument_error {
1578    #[non_exhaustive]
1579    #[derive(
1580        Clone,
1581        Copy,
1582        Debug,
1583        PartialEq,
1584        Eq,
1585        Hash,
1586        PartialOrd,
1587        Ord,
1588        ::prost::Enumeration
1589    )]
1590    #[repr(i32)]
1591    pub enum TypeArgumentErrorKind {
1592        Unknown = 0,
1593        /// A type was not found in the module specified.
1594        TypeNotFound = 1,
1595        /// A type provided did not match the specified constraint.
1596        ConstraintNotSatisfied = 2,
1597    }
1598    impl TypeArgumentErrorKind {
1599        /// String value of the enum field names used in the ProtoBuf definition.
1600        ///
1601        /// The values are not transformed in any way and thus are considered stable
1602        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1603        pub fn as_str_name(&self) -> &'static str {
1604            match self {
1605                Self::Unknown => "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN",
1606                Self::TypeNotFound => "TYPE_NOT_FOUND",
1607                Self::ConstraintNotSatisfied => "CONSTRAINT_NOT_SATISFIED",
1608            }
1609        }
1610        /// Creates an enum from field names used in the ProtoBuf definition.
1611        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1612            match value {
1613                "TYPE_ARGUMENT_ERROR_KIND_UNKNOWN" => Some(Self::Unknown),
1614                "TYPE_NOT_FOUND" => Some(Self::TypeNotFound),
1615                "CONSTRAINT_NOT_SATISFIED" => Some(Self::ConstraintNotSatisfied),
1616                _ => None,
1617            }
1618        }
1619    }
1620}
1621/// DNF filter for transactions: any term may match, and each term is an AND
1622/// of signed literals.
1623/// An absent filter matches everything. A present filter must have at least one
1624/// term.
1625#[derive(Eq, Hash)]
1626#[non_exhaustive]
1627#[derive(Clone, PartialEq, ::prost::Message)]
1628pub struct TransactionFilter {
1629    /// Terms are ORed together.
1630    #[prost(message, repeated, tag = "1")]
1631    pub terms: ::prost::alloc::vec::Vec<TransactionTerm>,
1632}
1633/// One conjunction in a transaction DNF filter.
1634#[derive(Eq, Hash)]
1635#[non_exhaustive]
1636#[derive(Clone, PartialEq, ::prost::Message)]
1637pub struct TransactionTerm {
1638    /// Literals are ANDed together.
1639    #[prost(message, repeated, tag = "1")]
1640    pub literals: ::prost::alloc::vec::Vec<TransactionLiteral>,
1641}
1642/// One signed transaction predicate literal: a predicate, optionally negated.
1643#[non_exhaustive]
1644#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1645pub struct TransactionLiteral {
1646    /// When true, the literal matches transactions that the predicate does *not*
1647    /// match.
1648    #[prost(bool, tag = "1")]
1649    pub negated: bool,
1650    /// The transaction-index predicate to match.
1651    #[prost(oneof = "transaction_literal::Predicate", tags = "2, 3, 4, 5, 6, 7, 8, 9")]
1652    pub predicate: ::core::option::Option<transaction_literal::Predicate>,
1653}
1654/// Nested message and enum types in `TransactionLiteral`.
1655pub mod transaction_literal {
1656    /// The transaction-index predicate to match.
1657    #[non_exhaustive]
1658    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1659    pub enum Predicate {
1660        /// Match transactions sent by the specified address.
1661        #[prost(message, tag = "2")]
1662        Sender(super::SenderFilter),
1663        /// Match transactions where the specified address's state moved as a side
1664        /// effect: it owns an object after the txn, owned an object before the
1665        /// txn that was mutated/transferred away/deleted/wrapped, or its
1666        /// address-balance changed via an accumulator event.
1667        #[prost(message, tag = "3")]
1668        AffectedAddress(super::AffectedAddressFilter),
1669        /// Match transactions whose effects include a change for the specified
1670        /// object.
1671        #[prost(message, tag = "4")]
1672        AffectedObject(super::AffectedObjectFilter),
1673        /// Match transactions that made a Move call matching the specified filter.
1674        #[prost(message, tag = "5")]
1675        MoveCall(super::MoveCallFilter),
1676        /// Match transactions that emitted an event whose package/module fields
1677        /// match the specified filter.
1678        #[prost(message, tag = "6")]
1679        EmitModule(super::EmitModuleFilter),
1680        /// Match transactions that emitted an event with a type matching the
1681        /// specified filter.
1682        #[prost(message, tag = "7")]
1683        EventType(super::EventTypeFilter),
1684        /// Match transactions that wrote to the specified authenticated event
1685        /// stream head.
1686        #[prost(message, tag = "8")]
1687        EventStreamHead(super::EventStreamHeadFilter),
1688        /// Match transactions that wrote a Move package — a first publish or an
1689        /// upgrade, of any package.
1690        #[prost(message, tag = "9")]
1691        PackageWrite(super::PackageWriteFilter),
1692    }
1693}
1694/// DNF filter for events: any term may match, and each term is an AND of
1695/// signed literals. Sender predicates match all events from matching
1696/// transactions; emit-module, event-type, and event-stream-head predicates match
1697/// individual event-space dimensions. An absent filter matches everything. A
1698/// present filter must have at least one term.
1699#[non_exhaustive]
1700#[derive(Clone, PartialEq, ::prost::Message)]
1701pub struct EventFilter {
1702    /// Terms are ORed together.
1703    #[prost(message, repeated, tag = "1")]
1704    pub terms: ::prost::alloc::vec::Vec<EventTerm>,
1705}
1706/// One conjunction in an event DNF filter.
1707#[non_exhaustive]
1708#[derive(Clone, PartialEq, ::prost::Message)]
1709pub struct EventTerm {
1710    /// Literals are ANDed together.
1711    #[prost(message, repeated, tag = "1")]
1712    pub literals: ::prost::alloc::vec::Vec<EventLiteral>,
1713}
1714/// One signed event predicate literal: a predicate, optionally negated.
1715#[non_exhaustive]
1716#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1717pub struct EventLiteral {
1718    /// When true, the literal matches events that the predicate does *not* match.
1719    #[prost(bool, tag = "1")]
1720    pub negated: bool,
1721    /// The event-index predicate to match.
1722    #[prost(oneof = "event_literal::Predicate", tags = "2, 3, 4, 5")]
1723    pub predicate: ::core::option::Option<event_literal::Predicate>,
1724}
1725/// Nested message and enum types in `EventLiteral`.
1726pub mod event_literal {
1727    /// The event-index predicate to match.
1728    #[non_exhaustive]
1729    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
1730    pub enum Predicate {
1731        /// Match events from transactions sent by the specified address.
1732        #[prost(message, tag = "2")]
1733        Sender(super::SenderFilter),
1734        /// Match events whose package/module fields match the specified filter.
1735        #[prost(message, tag = "3")]
1736        EmitModule(super::EmitModuleFilter),
1737        /// Match events whose type matches the specified filter.
1738        #[prost(message, tag = "4")]
1739        EventType(super::EventTypeFilter),
1740        /// Match events committed to the specified authenticated event stream head.
1741        #[prost(message, tag = "5")]
1742        EventStreamHead(super::EventStreamHeadFilter),
1743    }
1744}
1745/// Match by transaction sender address.
1746#[non_exhaustive]
1747#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1748pub struct SenderFilter {
1749    /// The sender address (hex-encoded).
1750    #[prost(string, optional, tag = "1")]
1751    pub address: ::core::option::Option<::prost::alloc::string::String>,
1752}
1753/// Match by any address whose state moved as a side effect of the
1754/// transaction: object ownership changes (in either direction), prior
1755/// owners of removed/wrapped objects, and address-balance changes via
1756/// accumulator events.
1757#[non_exhaustive]
1758#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1759pub struct AffectedAddressFilter {
1760    /// The affected address (hex-encoded).
1761    #[prost(string, optional, tag = "1")]
1762    pub address: ::core::option::Option<::prost::alloc::string::String>,
1763}
1764/// Match by changed object ID.
1765#[non_exhaustive]
1766#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1767pub struct AffectedObjectFilter {
1768    /// The changed object ID (hex-encoded).
1769    #[prost(string, optional, tag = "1")]
1770    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1771}
1772/// Match by Move function call, specified as a `::`-delimited Move path.
1773///
1774/// Specificity levels:
1775/// "0xpkg"                        -> matches any call in the package
1776/// "0xpkg::module"                -> matches any call in the module
1777/// "0xpkg::module::function"      -> matches calls to the exact function
1778#[non_exhaustive]
1779#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1780pub struct MoveCallFilter {
1781    /// Required. Move path of the form `package\[::module[::function]\]`.
1782    #[prost(string, optional, tag = "1")]
1783    pub function: ::core::option::Option<::prost::alloc::string::String>,
1784}
1785/// Match by an event's package/module fields, specified as a `::`-delimited
1786/// Move path. These identify the top-level Move call that triggered the event.
1787///
1788/// Specificity levels:
1789/// "0xpkg"               -> matches events with this package_id
1790/// "0xpkg::module"       -> matches events with this package_id and module
1791#[non_exhaustive]
1792#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1793pub struct EmitModuleFilter {
1794    /// Required. Move path of the form `package\[::module\]`.
1795    #[prost(string, optional, tag = "1")]
1796    pub module: ::core::option::Option<::prost::alloc::string::String>,
1797}
1798/// Match by event struct type, specified as a Move type string.
1799///
1800/// Specificity levels:
1801/// "0xaddr"                              -> matches events whose type is defined at this address
1802/// "0xaddr::module"                      -> matches events whose type is in this module
1803/// "0xaddr::module::Name"                -> matches events with this type name (any instantiation)
1804/// "0xaddr::module::Name\<T1, T2>"        -> matches events with this exact generic instantiation
1805#[non_exhaustive]
1806#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1807pub struct EventTypeFilter {
1808    /// Required. Move type string of the form
1809    /// `address\[::module[::Name[<type_params>]\]]`.
1810    #[prost(string, optional, tag = "1")]
1811    pub event_type: ::core::option::Option<::prost::alloc::string::String>,
1812}
1813/// Match by authenticated event stream head.
1814#[non_exhaustive]
1815#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1816pub struct EventStreamHeadFilter {
1817    /// The stream id address (hex-encoded).
1818    #[prost(string, optional, tag = "1")]
1819    pub stream_id: ::core::option::Option<::prost::alloc::string::String>,
1820}
1821/// Match transactions that wrote a Move package.
1822#[non_exhaustive]
1823#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1824pub struct PackageWriteFilter {}
1825/// Summary of gas charges.
1826#[non_exhaustive]
1827#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
1828pub struct GasCostSummary {
1829    /// Cost of computation/execution.
1830    #[prost(uint64, optional, tag = "1")]
1831    pub computation_cost: ::core::option::Option<u64>,
1832    /// Storage cost, it's the sum of all storage cost for all objects created or mutated.
1833    #[prost(uint64, optional, tag = "2")]
1834    pub storage_cost: ::core::option::Option<u64>,
1835    /// The amount of storage cost refunded to the user for all objects deleted or mutated in the
1836    /// transaction.
1837    #[prost(uint64, optional, tag = "3")]
1838    pub storage_rebate: ::core::option::Option<u64>,
1839    /// The fee for the rebate. The portion of the storage rebate kept by the system.
1840    #[prost(uint64, optional, tag = "4")]
1841    pub non_refundable_storage_fee: ::core::option::Option<u64>,
1842}
1843/// An input to a user transaction.
1844#[non_exhaustive]
1845#[derive(Clone, PartialEq, ::prost::Message)]
1846pub struct Input {
1847    #[prost(enumeration = "input::InputKind", optional, tag = "1")]
1848    pub kind: ::core::option::Option<i32>,
1849    /// A move value serialized as BCS.
1850    ///
1851    /// For normal operations this is required to be a move primitive type and not contain structs
1852    /// or objects.
1853    #[prost(bytes = "bytes", optional, tag = "2")]
1854    pub pure: ::core::option::Option<::prost::bytes::Bytes>,
1855    /// `ObjectId` of the object input.
1856    #[prost(string, optional, tag = "3")]
1857    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
1858    /// Requested version of the input object when `kind` is `IMMUTABLE_OR_OWNED`
1859    /// or `RECEIVING` or if `kind` is `SHARED` this is the initial version of the
1860    /// object when it was shared
1861    #[prost(uint64, optional, tag = "4")]
1862    pub version: ::core::option::Option<u64>,
1863    /// The digest of this object.
1864    #[prost(string, optional, tag = "5")]
1865    pub digest: ::core::option::Option<::prost::alloc::string::String>,
1866    /// Controls whether the caller asks for a mutable reference to the shared
1867    /// object.
1868    #[prost(bool, optional, tag = "6")]
1869    pub mutable: ::core::option::Option<bool>,
1870    /// NOTE: For backwards compatibility purposes the addition of the new
1871    /// `NON_EXCLUSIVE_WRITE` mutability variant requires providing a new field.
1872    /// The old `mutable` field will continue to be populated and respected as an
1873    /// input for the time being.
1874    #[prost(enumeration = "input::Mutability", optional, tag = "7")]
1875    pub mutability: ::core::option::Option<i32>,
1876    /// Fund Reservation information if `kind` is `FUNDS_WITHDRAWAL`.
1877    #[prost(message, optional, tag = "8")]
1878    pub funds_withdrawal: ::core::option::Option<FundsWithdrawal>,
1879    /// A literal value
1880    ///
1881    /// INPUT ONLY
1882    #[prost(message, optional, boxed, tag = "1000")]
1883    pub literal: ::core::option::Option<
1884        ::prost::alloc::boxed::Box<::prost_types::Value>,
1885    >,
1886}
1887/// Nested message and enum types in `Input`.
1888pub mod input {
1889    #[non_exhaustive]
1890    #[derive(
1891        Clone,
1892        Copy,
1893        Debug,
1894        PartialEq,
1895        Eq,
1896        Hash,
1897        PartialOrd,
1898        Ord,
1899        ::prost::Enumeration
1900    )]
1901    #[repr(i32)]
1902    pub enum InputKind {
1903        Unknown = 0,
1904        /// A move value serialized as BCS.
1905        Pure = 1,
1906        /// A Move object that is either immutable or address owned.
1907        ImmutableOrOwned = 2,
1908        /// A Move object whose owner is "Shared".
1909        Shared = 3,
1910        /// A Move object that is attempted to be received in this transaction.
1911        Receiving = 4,
1912        /// Reservation to withdraw balance from a funds accumulator
1913        FundsWithdrawal = 5,
1914    }
1915    impl InputKind {
1916        /// String value of the enum field names used in the ProtoBuf definition.
1917        ///
1918        /// The values are not transformed in any way and thus are considered stable
1919        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1920        pub fn as_str_name(&self) -> &'static str {
1921            match self {
1922                Self::Unknown => "INPUT_KIND_UNKNOWN",
1923                Self::Pure => "PURE",
1924                Self::ImmutableOrOwned => "IMMUTABLE_OR_OWNED",
1925                Self::Shared => "SHARED",
1926                Self::Receiving => "RECEIVING",
1927                Self::FundsWithdrawal => "FUNDS_WITHDRAWAL",
1928            }
1929        }
1930        /// Creates an enum from field names used in the ProtoBuf definition.
1931        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1932            match value {
1933                "INPUT_KIND_UNKNOWN" => Some(Self::Unknown),
1934                "PURE" => Some(Self::Pure),
1935                "IMMUTABLE_OR_OWNED" => Some(Self::ImmutableOrOwned),
1936                "SHARED" => Some(Self::Shared),
1937                "RECEIVING" => Some(Self::Receiving),
1938                "FUNDS_WITHDRAWAL" => Some(Self::FundsWithdrawal),
1939                _ => None,
1940            }
1941        }
1942    }
1943    #[non_exhaustive]
1944    #[derive(
1945        Clone,
1946        Copy,
1947        Debug,
1948        PartialEq,
1949        Eq,
1950        Hash,
1951        PartialOrd,
1952        Ord,
1953        ::prost::Enumeration
1954    )]
1955    #[repr(i32)]
1956    pub enum Mutability {
1957        Unknown = 0,
1958        Immutable = 1,
1959        Mutable = 2,
1960        /// Non-exclusive write is used to allow multiple transactions to
1961        /// simultaneously add disjoint dynamic fields to an object.
1962        /// (Currently only used by settlement transactions).
1963        NonExclusiveWrite = 3,
1964    }
1965    impl Mutability {
1966        /// String value of the enum field names used in the ProtoBuf definition.
1967        ///
1968        /// The values are not transformed in any way and thus are considered stable
1969        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1970        pub fn as_str_name(&self) -> &'static str {
1971            match self {
1972                Self::Unknown => "MUTABILITY_UNKNOWN",
1973                Self::Immutable => "IMMUTABLE",
1974                Self::Mutable => "MUTABLE",
1975                Self::NonExclusiveWrite => "NON_EXCLUSIVE_WRITE",
1976            }
1977        }
1978        /// Creates an enum from field names used in the ProtoBuf definition.
1979        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1980            match value {
1981                "MUTABILITY_UNKNOWN" => Some(Self::Unknown),
1982                "IMMUTABLE" => Some(Self::Immutable),
1983                "MUTABLE" => Some(Self::Mutable),
1984                "NON_EXCLUSIVE_WRITE" => Some(Self::NonExclusiveWrite),
1985                _ => None,
1986            }
1987        }
1988    }
1989}
1990#[non_exhaustive]
1991#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
1992pub struct FundsWithdrawal {
1993    #[prost(uint64, optional, tag = "1")]
1994    pub amount: ::core::option::Option<u64>,
1995    #[prost(string, optional, tag = "2")]
1996    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
1997    #[prost(enumeration = "funds_withdrawal::Source", optional, tag = "3")]
1998    pub source: ::core::option::Option<i32>,
1999}
2000/// Nested message and enum types in `FundsWithdrawal`.
2001pub mod funds_withdrawal {
2002    #[non_exhaustive]
2003    #[derive(
2004        Clone,
2005        Copy,
2006        Debug,
2007        PartialEq,
2008        Eq,
2009        Hash,
2010        PartialOrd,
2011        Ord,
2012        ::prost::Enumeration
2013    )]
2014    #[repr(i32)]
2015    pub enum Source {
2016        Unknown = 0,
2017        Sender = 1,
2018        Sponsor = 2,
2019    }
2020    impl Source {
2021        /// String value of the enum field names used in the ProtoBuf definition.
2022        ///
2023        /// The values are not transformed in any way and thus are considered stable
2024        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2025        pub fn as_str_name(&self) -> &'static str {
2026            match self {
2027                Self::Unknown => "SOURCE_UNKNOWN",
2028                Self::Sender => "SENDER",
2029                Self::Sponsor => "SPONSOR",
2030            }
2031        }
2032        /// Creates an enum from field names used in the ProtoBuf definition.
2033        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2034            match value {
2035                "SOURCE_UNKNOWN" => Some(Self::Unknown),
2036                "SENDER" => Some(Self::Sender),
2037                "SPONSOR" => Some(Self::Sponsor),
2038                _ => None,
2039            }
2040        }
2041    }
2042}
2043/// Key to uniquely identify a JWK.
2044#[non_exhaustive]
2045#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2046pub struct JwkId {
2047    /// The issuer or identity of the OIDC provider.
2048    #[prost(string, optional, tag = "1")]
2049    pub iss: ::core::option::Option<::prost::alloc::string::String>,
2050    /// A key ID used to uniquely identify a key from an OIDC provider.
2051    #[prost(string, optional, tag = "2")]
2052    pub kid: ::core::option::Option<::prost::alloc::string::String>,
2053}
2054/// A JSON web key.
2055///
2056/// Struct that contains info for a JWK. A list of them for different kinds can
2057/// be retrieved from the JWK endpoint (for example, <<https://www.googleapis.com/oauth2/v3/certs>>).
2058/// The JWK is used to verify the JWT token.
2059#[non_exhaustive]
2060#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2061pub struct Jwk {
2062    /// Key type parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.1.>
2063    #[prost(string, optional, tag = "1")]
2064    pub kty: ::core::option::Option<::prost::alloc::string::String>,
2065    /// RSA public exponent, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2066    #[prost(string, optional, tag = "2")]
2067    pub e: ::core::option::Option<::prost::alloc::string::String>,
2068    /// RSA modulus, <https://datatracker.ietf.org/doc/html/rfc7517#section-9.3.>
2069    #[prost(string, optional, tag = "3")]
2070    pub n: ::core::option::Option<::prost::alloc::string::String>,
2071    /// Algorithm parameter, <https://datatracker.ietf.org/doc/html/rfc7517#section-4.4.>
2072    #[prost(string, optional, tag = "4")]
2073    pub alg: ::core::option::Option<::prost::alloc::string::String>,
2074}
2075#[non_exhaustive]
2076#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
2077pub struct GetServiceInfoRequest {}
2078#[non_exhaustive]
2079#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2080pub struct GetServiceInfoResponse {
2081    /// The chain identifier of the chain that this node is on.
2082    ///
2083    /// The chain identifier is the digest of the genesis checkpoint, the
2084    /// checkpoint with sequence number 0.
2085    #[prost(string, optional, tag = "1")]
2086    pub chain_id: ::core::option::Option<::prost::alloc::string::String>,
2087    /// Human-readable name of the chain that this node is on.
2088    ///
2089    /// This is intended to be a human-readable name like `mainnet`, `testnet`, and so on.
2090    #[prost(string, optional, tag = "2")]
2091    pub chain: ::core::option::Option<::prost::alloc::string::String>,
2092    /// Current epoch of the node based on its highest executed checkpoint.
2093    #[prost(uint64, optional, tag = "3")]
2094    pub epoch: ::core::option::Option<u64>,
2095    /// Checkpoint height of the most recently executed checkpoint.
2096    #[prost(uint64, optional, tag = "4")]
2097    pub checkpoint_height: ::core::option::Option<u64>,
2098    /// Unix timestamp of the most recently executed checkpoint.
2099    #[prost(message, optional, tag = "5")]
2100    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
2101    /// The lowest checkpoint for which checkpoints and transaction data are available.
2102    #[prost(uint64, optional, tag = "6")]
2103    pub lowest_available_checkpoint: ::core::option::Option<u64>,
2104    /// The lowest checkpoint for which object data is available.
2105    #[prost(uint64, optional, tag = "7")]
2106    pub lowest_available_checkpoint_objects: ::core::option::Option<u64>,
2107    /// Software version of the service. Similar to the `server` http header.
2108    #[prost(string, optional, tag = "8")]
2109    pub server: ::core::option::Option<::prost::alloc::string::String>,
2110}
2111#[non_exhaustive]
2112#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2113pub struct GetObjectRequest {
2114    /// Required. The `ObjectId` of the requested object.
2115    #[prost(string, optional, tag = "1")]
2116    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
2117    /// Request a specific version of the object.
2118    /// If no version is specified, and the object is live, then the latest
2119    /// version of the object is returned.
2120    #[prost(uint64, optional, tag = "2")]
2121    pub version: ::core::option::Option<u64>,
2122    /// Mask specifying which fields to read.
2123    /// If no mask is specified, defaults to `object_id,version,digest`.
2124    #[prost(message, optional, tag = "3")]
2125    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2126}
2127#[non_exhaustive]
2128#[derive(Clone, PartialEq, ::prost::Message)]
2129pub struct GetObjectResponse {
2130    #[prost(message, optional, tag = "1")]
2131    pub object: ::core::option::Option<Object>,
2132}
2133#[non_exhaustive]
2134#[derive(Clone, PartialEq, ::prost::Message)]
2135pub struct BatchGetObjectsRequest {
2136    #[prost(message, repeated, tag = "1")]
2137    pub requests: ::prost::alloc::vec::Vec<GetObjectRequest>,
2138    /// Mask specifying which fields to read.
2139    /// If no mask is specified, defaults to `object_id,version,digest`.
2140    #[prost(message, optional, tag = "2")]
2141    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2142}
2143#[non_exhaustive]
2144#[derive(Clone, PartialEq, ::prost::Message)]
2145pub struct BatchGetObjectsResponse {
2146    #[prost(message, repeated, tag = "1")]
2147    pub objects: ::prost::alloc::vec::Vec<GetObjectResult>,
2148}
2149#[non_exhaustive]
2150#[derive(Clone, PartialEq, ::prost::Message)]
2151pub struct GetObjectResult {
2152    #[prost(oneof = "get_object_result::Result", tags = "1, 2")]
2153    pub result: ::core::option::Option<get_object_result::Result>,
2154}
2155/// Nested message and enum types in `GetObjectResult`.
2156pub mod get_object_result {
2157    #[non_exhaustive]
2158    #[derive(Clone, PartialEq, ::prost::Oneof)]
2159    pub enum Result {
2160        #[prost(message, tag = "1")]
2161        Object(super::Object),
2162        #[prost(message, tag = "2")]
2163        Error(super::super::super::super::google::rpc::Status),
2164    }
2165}
2166#[non_exhaustive]
2167#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2168pub struct GetTransactionRequest {
2169    /// Required. The digest of the requested transaction.
2170    #[prost(string, optional, tag = "1")]
2171    pub digest: ::core::option::Option<::prost::alloc::string::String>,
2172    /// Mask specifying which fields to read.
2173    /// If no mask is specified, defaults to `digest`.
2174    #[prost(message, optional, tag = "2")]
2175    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2176}
2177#[non_exhaustive]
2178#[derive(Clone, PartialEq, ::prost::Message)]
2179pub struct GetTransactionResponse {
2180    #[prost(message, optional, tag = "1")]
2181    pub transaction: ::core::option::Option<ExecutedTransaction>,
2182}
2183#[non_exhaustive]
2184#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2185pub struct BatchGetTransactionsRequest {
2186    /// Required. The digests of the requested transactions.
2187    #[prost(string, repeated, tag = "1")]
2188    pub digests: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2189    /// Mask specifying which fields to read.
2190    /// If no mask is specified, defaults to `digest`.
2191    #[prost(message, optional, tag = "2")]
2192    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2193}
2194#[non_exhaustive]
2195#[derive(Clone, PartialEq, ::prost::Message)]
2196pub struct BatchGetTransactionsResponse {
2197    #[prost(message, repeated, tag = "1")]
2198    pub transactions: ::prost::alloc::vec::Vec<GetTransactionResult>,
2199}
2200#[non_exhaustive]
2201#[derive(Clone, PartialEq, ::prost::Message)]
2202pub struct GetTransactionResult {
2203    #[prost(oneof = "get_transaction_result::Result", tags = "1, 2")]
2204    pub result: ::core::option::Option<get_transaction_result::Result>,
2205}
2206/// Nested message and enum types in `GetTransactionResult`.
2207pub mod get_transaction_result {
2208    #[non_exhaustive]
2209    #[derive(Clone, PartialEq, ::prost::Oneof)]
2210    pub enum Result {
2211        #[prost(message, tag = "1")]
2212        Transaction(super::ExecutedTransaction),
2213        #[prost(message, tag = "2")]
2214        Error(super::super::super::super::google::rpc::Status),
2215    }
2216}
2217#[non_exhaustive]
2218#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2219pub struct GetCheckpointRequest {
2220    /// Mask specifying which fields to read.
2221    /// If no mask is specified, defaults to `sequence_number,digest`.
2222    #[prost(message, optional, tag = "3")]
2223    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2224    /// If neither is provided, return the latest
2225    #[prost(oneof = "get_checkpoint_request::CheckpointId", tags = "1, 2")]
2226    pub checkpoint_id: ::core::option::Option<get_checkpoint_request::CheckpointId>,
2227}
2228/// Nested message and enum types in `GetCheckpointRequest`.
2229pub mod get_checkpoint_request {
2230    /// If neither is provided, return the latest
2231    #[non_exhaustive]
2232    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
2233    pub enum CheckpointId {
2234        /// The sequence number of the requested checkpoint.
2235        #[prost(uint64, tag = "1")]
2236        SequenceNumber(u64),
2237        /// The digest of the requested checkpoint.
2238        #[prost(string, tag = "2")]
2239        Digest(::prost::alloc::string::String),
2240    }
2241}
2242#[non_exhaustive]
2243#[derive(Clone, PartialEq, ::prost::Message)]
2244pub struct GetCheckpointResponse {
2245    #[prost(message, optional, tag = "1")]
2246    pub checkpoint: ::core::option::Option<Checkpoint>,
2247}
2248#[non_exhaustive]
2249#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
2250pub struct GetEpochRequest {
2251    /// The requested epoch.
2252    /// If no epoch is provided the current epoch will be returned.
2253    #[prost(uint64, optional, tag = "1")]
2254    pub epoch: ::core::option::Option<u64>,
2255    /// Mask specifying which fields to read.
2256    /// If no mask is specified, defaults to `epoch`.
2257    #[prost(message, optional, tag = "2")]
2258    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2259}
2260#[non_exhaustive]
2261#[derive(Clone, PartialEq, ::prost::Message)]
2262pub struct GetEpochResponse {
2263    #[prost(message, optional, tag = "1")]
2264    pub epoch: ::core::option::Option<Epoch>,
2265}
2266/// Request message for LedgerService.ListCheckpoints.
2267#[non_exhaustive]
2268#[derive(Clone, PartialEq, ::prost::Message)]
2269pub struct ListCheckpointsRequest {
2270    /// Optional. Mask for specifying which parts of the Checkpoint should be
2271    /// returned (e.g. summary, contents, signatures).
2272    #[prost(message, optional, tag = "1")]
2273    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2274    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2275    /// genesis.
2276    #[prost(uint64, optional, tag = "2")]
2277    pub start_checkpoint: ::core::option::Option<u64>,
2278    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2279    /// current indexed ledger tip.
2280    #[prost(uint64, optional, tag = "3")]
2281    pub end_checkpoint: ::core::option::Option<u64>,
2282    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
2283    /// matches if any transaction it contains satisfies the filter. If absent,
2284    /// all checkpoints in the range are returned.
2285    #[prost(message, optional, tag = "4")]
2286    pub filter: ::core::option::Option<TransactionFilter>,
2287    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2288    /// order with the default item limit. The server enforces a maximum item
2289    /// limit and silently coerces larger values down to it. To paginate, pass
2290    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2291    /// `options.before` (descending) on the next request.
2292    #[prost(message, optional, tag = "5")]
2293    pub options: ::core::option::Option<QueryOptions>,
2294}
2295/// Response message for LedgerService.ListCheckpoints.
2296///
2297/// Every frame carries a `watermark` with a safe resume cursor. A frame
2298/// with `checkpoint` set delivers one matching item; a frame without it reports
2299/// scan progress or terminal completion. Watermarks never regress in the
2300/// requested ordering but may repeat.
2301///
2302/// `end` is set exactly once, on the final frame of a successful stream. For
2303/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2304/// every other end reason, the final frame has no `checkpoint` payload.
2305#[non_exhaustive]
2306#[derive(Clone, PartialEq, ::prost::Message)]
2307pub struct ListCheckpointsResponse {
2308    /// One matching checkpoint.
2309    #[prost(message, optional, tag = "1")]
2310    pub checkpoint: ::core::option::Option<Checkpoint>,
2311    /// Progress watermark as of this frame. Present on every frame. A
2312    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2313    /// its authoritative scan frontier was already emitted.
2314    #[prost(message, optional, tag = "2")]
2315    pub watermark: ::core::option::Option<Watermark>,
2316    /// Set exactly once, on the final frame of a successful query stream.
2317    #[prost(message, optional, tag = "3")]
2318    pub end: ::core::option::Option<QueryEnd>,
2319}
2320/// Request message for LedgerService.ListTransactions.
2321#[non_exhaustive]
2322#[derive(Clone, PartialEq, ::prost::Message)]
2323pub struct ListTransactionsRequest {
2324    /// Optional. Mask for specifying which parts of the ExecutedTransaction
2325    /// should be returned.
2326    #[prost(message, optional, tag = "1")]
2327    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2328    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2329    /// genesis.
2330    #[prost(uint64, optional, tag = "2")]
2331    pub start_checkpoint: ::core::option::Option<u64>,
2332    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2333    /// current indexed ledger tip.
2334    #[prost(uint64, optional, tag = "3")]
2335    pub end_checkpoint: ::core::option::Option<u64>,
2336    /// Optional. DNF filter over indexed dimensions.
2337    /// If absent, all transactions in the range are returned.
2338    #[prost(message, optional, tag = "4")]
2339    pub filter: ::core::option::Option<TransactionFilter>,
2340    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2341    /// order with the default item limit. The server enforces a maximum item
2342    /// limit and silently coerces larger values down to it. To paginate, pass
2343    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2344    /// `options.before` (descending) on the next request.
2345    #[prost(message, optional, tag = "5")]
2346    pub options: ::core::option::Option<QueryOptions>,
2347}
2348/// Response message for LedgerService.ListTransactions.
2349///
2350/// Every frame carries a `watermark` with a safe resume cursor. A frame
2351/// with `transaction` set delivers one matching item; a frame without it reports
2352/// scan progress or terminal completion. Watermarks never regress in the
2353/// requested ordering but may repeat.
2354///
2355/// `end` is set exactly once, on the final frame of a successful stream. For
2356/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2357/// every other end reason, the final frame has no `transaction` payload.
2358#[non_exhaustive]
2359#[derive(Clone, PartialEq, ::prost::Message)]
2360pub struct ListTransactionsResponse {
2361    /// One matching transaction. Its position within the containing checkpoint
2362    /// is reported by `ExecutedTransaction.transaction_index`.
2363    #[prost(message, optional, tag = "1")]
2364    pub transaction: ::core::option::Option<ExecutedTransaction>,
2365    /// Progress watermark as of this frame. Present on every frame. A
2366    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2367    /// its authoritative scan frontier was already emitted.
2368    #[prost(message, optional, tag = "2")]
2369    pub watermark: ::core::option::Option<Watermark>,
2370    /// Set exactly once, on the final frame of a successful query stream.
2371    #[prost(message, optional, tag = "3")]
2372    pub end: ::core::option::Option<QueryEnd>,
2373}
2374/// Request message for LedgerService.ListEvents.
2375#[non_exhaustive]
2376#[derive(Clone, PartialEq, ::prost::Message)]
2377pub struct ListEventsRequest {
2378    /// Optional. Mask for specifying which parts of the Event should be returned.
2379    #[prost(message, optional, tag = "1")]
2380    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
2381    /// Optional. Start of the checkpoint range to query (inclusive). Defaults to
2382    /// genesis.
2383    #[prost(uint64, optional, tag = "2")]
2384    pub start_checkpoint: ::core::option::Option<u64>,
2385    /// Optional. End of the checkpoint range to query (exclusive). Defaults to the
2386    /// current indexed ledger tip.
2387    #[prost(uint64, optional, tag = "3")]
2388    pub end_checkpoint: ::core::option::Option<u64>,
2389    /// Optional. DNF filter over indexed dimensions.
2390    /// If absent, all events in the range are returned.
2391    #[prost(message, optional, tag = "4")]
2392    pub filter: ::core::option::Option<EventFilter>,
2393    /// Optional cursor-bounded query options. If unspecified, reads in ascending
2394    /// order with the default item limit. The server enforces a maximum item
2395    /// limit and silently coerces larger values down to it. To paginate, pass
2396    /// the last received `Watermark.cursor` as `options.after` (ascending) or
2397    /// `options.before` (descending) on the next request.
2398    #[prost(message, optional, tag = "5")]
2399    pub options: ::core::option::Option<QueryOptions>,
2400}
2401/// Response message for LedgerService.ListEvents.
2402///
2403/// Every frame carries a `watermark` with a safe resume cursor. A frame
2404/// with `event` set delivers one matching item; a frame without it reports scan
2405/// progress or terminal completion. Watermarks never regress in the requested
2406/// ordering but may repeat.
2407///
2408/// `end` is set exactly once, on the final frame of a successful stream. For
2409/// `QUERY_END_REASON_ITEM_LIMIT`, that frame also carries the final item. For
2410/// every other end reason, the final frame has no `event` payload.
2411#[non_exhaustive]
2412#[derive(Clone, PartialEq, ::prost::Message)]
2413pub struct ListEventsResponse {
2414    /// One matching event. Its ledger position -- containing checkpoint,
2415    /// emitting transaction digest and offset, and index within that
2416    /// transaction's event list -- is reported by the corresponding fields on
2417    /// `Event`.
2418    #[prost(message, optional, tag = "1")]
2419    pub event: ::core::option::Option<Event>,
2420    /// Progress watermark as of this frame. Present on every frame. A
2421    /// ScanLimit terminal watermark may repeat the previous frame's cursor when
2422    /// its authoritative scan frontier was already emitted.
2423    #[prost(message, optional, tag = "2")]
2424    pub watermark: ::core::option::Option<Watermark>,
2425    /// Set exactly once, on the final frame of a successful query stream.
2426    #[prost(message, optional, tag = "3")]
2427    pub end: ::core::option::Option<QueryEnd>,
2428}
2429/// Generated client implementations.
2430pub mod ledger_service_client {
2431    #![allow(
2432        unused_variables,
2433        dead_code,
2434        missing_docs,
2435        clippy::wildcard_imports,
2436        clippy::let_unit_value,
2437    )]
2438    use tonic::codegen::*;
2439    use tonic::codegen::http::Uri;
2440    #[derive(Debug, Clone)]
2441    pub struct LedgerServiceClient<T> {
2442        inner: tonic::client::Grpc<T>,
2443    }
2444    impl LedgerServiceClient<tonic::transport::Channel> {
2445        /// Attempt to create a new client by connecting to a given endpoint.
2446        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
2447        where
2448            D: TryInto<tonic::transport::Endpoint>,
2449            D::Error: Into<StdError>,
2450        {
2451            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
2452            Ok(Self::new(conn))
2453        }
2454    }
2455    impl<T> LedgerServiceClient<T>
2456    where
2457        T: tonic::client::GrpcService<tonic::body::Body>,
2458        T::Error: Into<StdError>,
2459        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
2460        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
2461    {
2462        pub fn new(inner: T) -> Self {
2463            let inner = tonic::client::Grpc::new(inner);
2464            Self { inner }
2465        }
2466        pub fn with_origin(inner: T, origin: Uri) -> Self {
2467            let inner = tonic::client::Grpc::with_origin(inner, origin);
2468            Self { inner }
2469        }
2470        pub fn with_interceptor<F>(
2471            inner: T,
2472            interceptor: F,
2473        ) -> LedgerServiceClient<InterceptedService<T, F>>
2474        where
2475            F: tonic::service::Interceptor,
2476            T::ResponseBody: Default,
2477            T: tonic::codegen::Service<
2478                http::Request<tonic::body::Body>,
2479                Response = http::Response<
2480                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
2481                >,
2482            >,
2483            <T as tonic::codegen::Service<
2484                http::Request<tonic::body::Body>,
2485            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
2486        {
2487            LedgerServiceClient::new(InterceptedService::new(inner, interceptor))
2488        }
2489        /// Compress requests with the given encoding.
2490        ///
2491        /// This requires the server to support it otherwise it might respond with an
2492        /// error.
2493        #[must_use]
2494        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2495            self.inner = self.inner.send_compressed(encoding);
2496            self
2497        }
2498        /// Enable decompressing responses.
2499        #[must_use]
2500        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2501            self.inner = self.inner.accept_compressed(encoding);
2502            self
2503        }
2504        /// Limits the maximum size of a decoded message.
2505        ///
2506        /// Default: `4MB`
2507        #[must_use]
2508        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2509            self.inner = self.inner.max_decoding_message_size(limit);
2510            self
2511        }
2512        /// Limits the maximum size of an encoded message.
2513        ///
2514        /// Default: `usize::MAX`
2515        #[must_use]
2516        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2517            self.inner = self.inner.max_encoding_message_size(limit);
2518            self
2519        }
2520        /// Query the service for general information about its current state.
2521        pub async fn get_service_info(
2522            &mut self,
2523            request: impl tonic::IntoRequest<super::GetServiceInfoRequest>,
2524        ) -> std::result::Result<
2525            tonic::Response<super::GetServiceInfoResponse>,
2526            tonic::Status,
2527        > {
2528            self.inner
2529                .ready()
2530                .await
2531                .map_err(|e| {
2532                    tonic::Status::unknown(
2533                        format!("Service was not ready: {}", e.into()),
2534                    )
2535                })?;
2536            let codec = tonic_prost::ProstCodec::default();
2537            let path = http::uri::PathAndQuery::from_static(
2538                "/sui.rpc.v2.LedgerService/GetServiceInfo",
2539            );
2540            let mut req = request.into_request();
2541            req.extensions_mut()
2542                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetServiceInfo"));
2543            self.inner.unary(req, path, codec).await
2544        }
2545        pub async fn get_object(
2546            &mut self,
2547            request: impl tonic::IntoRequest<super::GetObjectRequest>,
2548        ) -> std::result::Result<
2549            tonic::Response<super::GetObjectResponse>,
2550            tonic::Status,
2551        > {
2552            self.inner
2553                .ready()
2554                .await
2555                .map_err(|e| {
2556                    tonic::Status::unknown(
2557                        format!("Service was not ready: {}", e.into()),
2558                    )
2559                })?;
2560            let codec = tonic_prost::ProstCodec::default();
2561            let path = http::uri::PathAndQuery::from_static(
2562                "/sui.rpc.v2.LedgerService/GetObject",
2563            );
2564            let mut req = request.into_request();
2565            req.extensions_mut()
2566                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetObject"));
2567            self.inner.unary(req, path, codec).await
2568        }
2569        pub async fn batch_get_objects(
2570            &mut self,
2571            request: impl tonic::IntoRequest<super::BatchGetObjectsRequest>,
2572        ) -> std::result::Result<
2573            tonic::Response<super::BatchGetObjectsResponse>,
2574            tonic::Status,
2575        > {
2576            self.inner
2577                .ready()
2578                .await
2579                .map_err(|e| {
2580                    tonic::Status::unknown(
2581                        format!("Service was not ready: {}", e.into()),
2582                    )
2583                })?;
2584            let codec = tonic_prost::ProstCodec::default();
2585            let path = http::uri::PathAndQuery::from_static(
2586                "/sui.rpc.v2.LedgerService/BatchGetObjects",
2587            );
2588            let mut req = request.into_request();
2589            req.extensions_mut()
2590                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetObjects"));
2591            self.inner.unary(req, path, codec).await
2592        }
2593        pub async fn get_transaction(
2594            &mut self,
2595            request: impl tonic::IntoRequest<super::GetTransactionRequest>,
2596        ) -> std::result::Result<
2597            tonic::Response<super::GetTransactionResponse>,
2598            tonic::Status,
2599        > {
2600            self.inner
2601                .ready()
2602                .await
2603                .map_err(|e| {
2604                    tonic::Status::unknown(
2605                        format!("Service was not ready: {}", e.into()),
2606                    )
2607                })?;
2608            let codec = tonic_prost::ProstCodec::default();
2609            let path = http::uri::PathAndQuery::from_static(
2610                "/sui.rpc.v2.LedgerService/GetTransaction",
2611            );
2612            let mut req = request.into_request();
2613            req.extensions_mut()
2614                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetTransaction"));
2615            self.inner.unary(req, path, codec).await
2616        }
2617        pub async fn batch_get_transactions(
2618            &mut self,
2619            request: impl tonic::IntoRequest<super::BatchGetTransactionsRequest>,
2620        ) -> std::result::Result<
2621            tonic::Response<super::BatchGetTransactionsResponse>,
2622            tonic::Status,
2623        > {
2624            self.inner
2625                .ready()
2626                .await
2627                .map_err(|e| {
2628                    tonic::Status::unknown(
2629                        format!("Service was not ready: {}", e.into()),
2630                    )
2631                })?;
2632            let codec = tonic_prost::ProstCodec::default();
2633            let path = http::uri::PathAndQuery::from_static(
2634                "/sui.rpc.v2.LedgerService/BatchGetTransactions",
2635            );
2636            let mut req = request.into_request();
2637            req.extensions_mut()
2638                .insert(
2639                    GrpcMethod::new("sui.rpc.v2.LedgerService", "BatchGetTransactions"),
2640                );
2641            self.inner.unary(req, path, codec).await
2642        }
2643        pub async fn get_checkpoint(
2644            &mut self,
2645            request: impl tonic::IntoRequest<super::GetCheckpointRequest>,
2646        ) -> std::result::Result<
2647            tonic::Response<super::GetCheckpointResponse>,
2648            tonic::Status,
2649        > {
2650            self.inner
2651                .ready()
2652                .await
2653                .map_err(|e| {
2654                    tonic::Status::unknown(
2655                        format!("Service was not ready: {}", e.into()),
2656                    )
2657                })?;
2658            let codec = tonic_prost::ProstCodec::default();
2659            let path = http::uri::PathAndQuery::from_static(
2660                "/sui.rpc.v2.LedgerService/GetCheckpoint",
2661            );
2662            let mut req = request.into_request();
2663            req.extensions_mut()
2664                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetCheckpoint"));
2665            self.inner.unary(req, path, codec).await
2666        }
2667        pub async fn get_epoch(
2668            &mut self,
2669            request: impl tonic::IntoRequest<super::GetEpochRequest>,
2670        ) -> std::result::Result<
2671            tonic::Response<super::GetEpochResponse>,
2672            tonic::Status,
2673        > {
2674            self.inner
2675                .ready()
2676                .await
2677                .map_err(|e| {
2678                    tonic::Status::unknown(
2679                        format!("Service was not ready: {}", e.into()),
2680                    )
2681                })?;
2682            let codec = tonic_prost::ProstCodec::default();
2683            let path = http::uri::PathAndQuery::from_static(
2684                "/sui.rpc.v2.LedgerService/GetEpoch",
2685            );
2686            let mut req = request.into_request();
2687            req.extensions_mut()
2688                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "GetEpoch"));
2689            self.inner.unary(req, path, codec).await
2690        }
2691        /// List checkpoints matching the provided filters.
2692        ///
2693        /// Checkpoints are returned in ascending or descending checkpoint sequence
2694        /// number order according to the query options ordering.
2695        /// A checkpoint matches if any transaction it contains satisfies the filter.
2696        pub async fn list_checkpoints(
2697            &mut self,
2698            request: impl tonic::IntoRequest<super::ListCheckpointsRequest>,
2699        ) -> std::result::Result<
2700            tonic::Response<tonic::codec::Streaming<super::ListCheckpointsResponse>>,
2701            tonic::Status,
2702        > {
2703            self.inner
2704                .ready()
2705                .await
2706                .map_err(|e| {
2707                    tonic::Status::unknown(
2708                        format!("Service was not ready: {}", e.into()),
2709                    )
2710                })?;
2711            let codec = tonic_prost::ProstCodec::default();
2712            let path = http::uri::PathAndQuery::from_static(
2713                "/sui.rpc.v2.LedgerService/ListCheckpoints",
2714            );
2715            let mut req = request.into_request();
2716            req.extensions_mut()
2717                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListCheckpoints"));
2718            self.inner.server_streaming(req, path, codec).await
2719        }
2720        /// List transactions matching the provided filters.
2721        ///
2722        /// Transactions are returned in ascending or descending transaction sequence
2723        /// order according to the query options ordering.
2724        pub async fn list_transactions(
2725            &mut self,
2726            request: impl tonic::IntoRequest<super::ListTransactionsRequest>,
2727        ) -> std::result::Result<
2728            tonic::Response<tonic::codec::Streaming<super::ListTransactionsResponse>>,
2729            tonic::Status,
2730        > {
2731            self.inner
2732                .ready()
2733                .await
2734                .map_err(|e| {
2735                    tonic::Status::unknown(
2736                        format!("Service was not ready: {}", e.into()),
2737                    )
2738                })?;
2739            let codec = tonic_prost::ProstCodec::default();
2740            let path = http::uri::PathAndQuery::from_static(
2741                "/sui.rpc.v2.LedgerService/ListTransactions",
2742            );
2743            let mut req = request.into_request();
2744            req.extensions_mut()
2745                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListTransactions"));
2746            self.inner.server_streaming(req, path, codec).await
2747        }
2748        /// List events matching the provided filters.
2749        ///
2750        /// Events are returned in ascending or descending packed event sequence order
2751        /// according to the query options ordering.
2752        pub async fn list_events(
2753            &mut self,
2754            request: impl tonic::IntoRequest<super::ListEventsRequest>,
2755        ) -> std::result::Result<
2756            tonic::Response<tonic::codec::Streaming<super::ListEventsResponse>>,
2757            tonic::Status,
2758        > {
2759            self.inner
2760                .ready()
2761                .await
2762                .map_err(|e| {
2763                    tonic::Status::unknown(
2764                        format!("Service was not ready: {}", e.into()),
2765                    )
2766                })?;
2767            let codec = tonic_prost::ProstCodec::default();
2768            let path = http::uri::PathAndQuery::from_static(
2769                "/sui.rpc.v2.LedgerService/ListEvents",
2770            );
2771            let mut req = request.into_request();
2772            req.extensions_mut()
2773                .insert(GrpcMethod::new("sui.rpc.v2.LedgerService", "ListEvents"));
2774            self.inner.server_streaming(req, path, codec).await
2775        }
2776    }
2777}
2778/// Generated server implementations.
2779pub mod ledger_service_server {
2780    #![allow(
2781        unused_variables,
2782        dead_code,
2783        missing_docs,
2784        clippy::wildcard_imports,
2785        clippy::let_unit_value,
2786    )]
2787    use tonic::codegen::*;
2788    /// Generated trait containing gRPC methods that should be implemented for use with LedgerServiceServer.
2789    #[async_trait]
2790    pub trait LedgerService: std::marker::Send + std::marker::Sync + 'static {
2791        /// Query the service for general information about its current state.
2792        async fn get_service_info(
2793            &self,
2794            request: tonic::Request<super::GetServiceInfoRequest>,
2795        ) -> std::result::Result<
2796            tonic::Response<super::GetServiceInfoResponse>,
2797            tonic::Status,
2798        > {
2799            Err(tonic::Status::unimplemented("Not yet implemented"))
2800        }
2801        async fn get_object(
2802            &self,
2803            request: tonic::Request<super::GetObjectRequest>,
2804        ) -> std::result::Result<
2805            tonic::Response<super::GetObjectResponse>,
2806            tonic::Status,
2807        > {
2808            Err(tonic::Status::unimplemented("Not yet implemented"))
2809        }
2810        async fn batch_get_objects(
2811            &self,
2812            request: tonic::Request<super::BatchGetObjectsRequest>,
2813        ) -> std::result::Result<
2814            tonic::Response<super::BatchGetObjectsResponse>,
2815            tonic::Status,
2816        > {
2817            Err(tonic::Status::unimplemented("Not yet implemented"))
2818        }
2819        async fn get_transaction(
2820            &self,
2821            request: tonic::Request<super::GetTransactionRequest>,
2822        ) -> std::result::Result<
2823            tonic::Response<super::GetTransactionResponse>,
2824            tonic::Status,
2825        > {
2826            Err(tonic::Status::unimplemented("Not yet implemented"))
2827        }
2828        async fn batch_get_transactions(
2829            &self,
2830            request: tonic::Request<super::BatchGetTransactionsRequest>,
2831        ) -> std::result::Result<
2832            tonic::Response<super::BatchGetTransactionsResponse>,
2833            tonic::Status,
2834        > {
2835            Err(tonic::Status::unimplemented("Not yet implemented"))
2836        }
2837        async fn get_checkpoint(
2838            &self,
2839            request: tonic::Request<super::GetCheckpointRequest>,
2840        ) -> std::result::Result<
2841            tonic::Response<super::GetCheckpointResponse>,
2842            tonic::Status,
2843        > {
2844            Err(tonic::Status::unimplemented("Not yet implemented"))
2845        }
2846        async fn get_epoch(
2847            &self,
2848            request: tonic::Request<super::GetEpochRequest>,
2849        ) -> std::result::Result<
2850            tonic::Response<super::GetEpochResponse>,
2851            tonic::Status,
2852        > {
2853            Err(tonic::Status::unimplemented("Not yet implemented"))
2854        }
2855        /// List checkpoints matching the provided filters.
2856        ///
2857        /// Checkpoints are returned in ascending or descending checkpoint sequence
2858        /// number order according to the query options ordering.
2859        /// A checkpoint matches if any transaction it contains satisfies the filter.
2860        async fn list_checkpoints(
2861            &self,
2862            request: tonic::Request<super::ListCheckpointsRequest>,
2863        ) -> std::result::Result<
2864            tonic::Response<BoxStream<super::ListCheckpointsResponse>>,
2865            tonic::Status,
2866        > {
2867            Err(tonic::Status::unimplemented("Not yet implemented"))
2868        }
2869        /// List transactions matching the provided filters.
2870        ///
2871        /// Transactions are returned in ascending or descending transaction sequence
2872        /// order according to the query options ordering.
2873        async fn list_transactions(
2874            &self,
2875            request: tonic::Request<super::ListTransactionsRequest>,
2876        ) -> std::result::Result<
2877            tonic::Response<BoxStream<super::ListTransactionsResponse>>,
2878            tonic::Status,
2879        > {
2880            Err(tonic::Status::unimplemented("Not yet implemented"))
2881        }
2882        /// List events matching the provided filters.
2883        ///
2884        /// Events are returned in ascending or descending packed event sequence order
2885        /// according to the query options ordering.
2886        async fn list_events(
2887            &self,
2888            request: tonic::Request<super::ListEventsRequest>,
2889        ) -> std::result::Result<
2890            tonic::Response<BoxStream<super::ListEventsResponse>>,
2891            tonic::Status,
2892        > {
2893            Err(tonic::Status::unimplemented("Not yet implemented"))
2894        }
2895    }
2896    #[derive(Debug)]
2897    pub struct LedgerServiceServer<T> {
2898        inner: Arc<T>,
2899        accept_compression_encodings: EnabledCompressionEncodings,
2900        send_compression_encodings: EnabledCompressionEncodings,
2901        max_decoding_message_size: Option<usize>,
2902        max_encoding_message_size: Option<usize>,
2903    }
2904    impl<T> LedgerServiceServer<T> {
2905        pub fn new(inner: T) -> Self {
2906            Self::from_arc(Arc::new(inner))
2907        }
2908        pub fn from_arc(inner: Arc<T>) -> Self {
2909            Self {
2910                inner,
2911                accept_compression_encodings: Default::default(),
2912                send_compression_encodings: Default::default(),
2913                max_decoding_message_size: None,
2914                max_encoding_message_size: None,
2915            }
2916        }
2917        pub fn with_interceptor<F>(
2918            inner: T,
2919            interceptor: F,
2920        ) -> InterceptedService<Self, F>
2921        where
2922            F: tonic::service::Interceptor,
2923        {
2924            InterceptedService::new(Self::new(inner), interceptor)
2925        }
2926        /// Enable decompressing requests with the given encoding.
2927        #[must_use]
2928        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
2929            self.accept_compression_encodings.enable(encoding);
2930            self
2931        }
2932        /// Compress responses with the given encoding, if the client supports it.
2933        #[must_use]
2934        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
2935            self.send_compression_encodings.enable(encoding);
2936            self
2937        }
2938        /// Limits the maximum size of a decoded message.
2939        ///
2940        /// Default: `4MB`
2941        #[must_use]
2942        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
2943            self.max_decoding_message_size = Some(limit);
2944            self
2945        }
2946        /// Limits the maximum size of an encoded message.
2947        ///
2948        /// Default: `usize::MAX`
2949        #[must_use]
2950        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
2951            self.max_encoding_message_size = Some(limit);
2952            self
2953        }
2954    }
2955    impl<T, B> tonic::codegen::Service<http::Request<B>> for LedgerServiceServer<T>
2956    where
2957        T: LedgerService,
2958        B: Body + std::marker::Send + 'static,
2959        B::Error: Into<StdError> + std::marker::Send + 'static,
2960    {
2961        type Response = http::Response<tonic::body::Body>;
2962        type Error = std::convert::Infallible;
2963        type Future = BoxFuture<Self::Response, Self::Error>;
2964        fn poll_ready(
2965            &mut self,
2966            _cx: &mut Context<'_>,
2967        ) -> Poll<std::result::Result<(), Self::Error>> {
2968            Poll::Ready(Ok(()))
2969        }
2970        fn call(&mut self, req: http::Request<B>) -> Self::Future {
2971            match req.uri().path() {
2972                "/sui.rpc.v2.LedgerService/GetServiceInfo" => {
2973                    #[allow(non_camel_case_types)]
2974                    struct GetServiceInfoSvc<T: LedgerService>(pub Arc<T>);
2975                    impl<
2976                        T: LedgerService,
2977                    > tonic::server::UnaryService<super::GetServiceInfoRequest>
2978                    for GetServiceInfoSvc<T> {
2979                        type Response = super::GetServiceInfoResponse;
2980                        type Future = BoxFuture<
2981                            tonic::Response<Self::Response>,
2982                            tonic::Status,
2983                        >;
2984                        fn call(
2985                            &mut self,
2986                            request: tonic::Request<super::GetServiceInfoRequest>,
2987                        ) -> Self::Future {
2988                            let inner = Arc::clone(&self.0);
2989                            let fut = async move {
2990                                <T as LedgerService>::get_service_info(&inner, request)
2991                                    .await
2992                            };
2993                            Box::pin(fut)
2994                        }
2995                    }
2996                    let accept_compression_encodings = self.accept_compression_encodings;
2997                    let send_compression_encodings = self.send_compression_encodings;
2998                    let max_decoding_message_size = self.max_decoding_message_size;
2999                    let max_encoding_message_size = self.max_encoding_message_size;
3000                    let inner = self.inner.clone();
3001                    let fut = async move {
3002                        let method = GetServiceInfoSvc(inner);
3003                        let codec = tonic_prost::ProstCodec::default();
3004                        let mut grpc = tonic::server::Grpc::new(codec)
3005                            .apply_compression_config(
3006                                accept_compression_encodings,
3007                                send_compression_encodings,
3008                            )
3009                            .apply_max_message_size_config(
3010                                max_decoding_message_size,
3011                                max_encoding_message_size,
3012                            );
3013                        let res = grpc.unary(method, req).await;
3014                        Ok(res)
3015                    };
3016                    Box::pin(fut)
3017                }
3018                "/sui.rpc.v2.LedgerService/GetObject" => {
3019                    #[allow(non_camel_case_types)]
3020                    struct GetObjectSvc<T: LedgerService>(pub Arc<T>);
3021                    impl<
3022                        T: LedgerService,
3023                    > tonic::server::UnaryService<super::GetObjectRequest>
3024                    for GetObjectSvc<T> {
3025                        type Response = super::GetObjectResponse;
3026                        type Future = BoxFuture<
3027                            tonic::Response<Self::Response>,
3028                            tonic::Status,
3029                        >;
3030                        fn call(
3031                            &mut self,
3032                            request: tonic::Request<super::GetObjectRequest>,
3033                        ) -> Self::Future {
3034                            let inner = Arc::clone(&self.0);
3035                            let fut = async move {
3036                                <T as LedgerService>::get_object(&inner, request).await
3037                            };
3038                            Box::pin(fut)
3039                        }
3040                    }
3041                    let accept_compression_encodings = self.accept_compression_encodings;
3042                    let send_compression_encodings = self.send_compression_encodings;
3043                    let max_decoding_message_size = self.max_decoding_message_size;
3044                    let max_encoding_message_size = self.max_encoding_message_size;
3045                    let inner = self.inner.clone();
3046                    let fut = async move {
3047                        let method = GetObjectSvc(inner);
3048                        let codec = tonic_prost::ProstCodec::default();
3049                        let mut grpc = tonic::server::Grpc::new(codec)
3050                            .apply_compression_config(
3051                                accept_compression_encodings,
3052                                send_compression_encodings,
3053                            )
3054                            .apply_max_message_size_config(
3055                                max_decoding_message_size,
3056                                max_encoding_message_size,
3057                            );
3058                        let res = grpc.unary(method, req).await;
3059                        Ok(res)
3060                    };
3061                    Box::pin(fut)
3062                }
3063                "/sui.rpc.v2.LedgerService/BatchGetObjects" => {
3064                    #[allow(non_camel_case_types)]
3065                    struct BatchGetObjectsSvc<T: LedgerService>(pub Arc<T>);
3066                    impl<
3067                        T: LedgerService,
3068                    > tonic::server::UnaryService<super::BatchGetObjectsRequest>
3069                    for BatchGetObjectsSvc<T> {
3070                        type Response = super::BatchGetObjectsResponse;
3071                        type Future = BoxFuture<
3072                            tonic::Response<Self::Response>,
3073                            tonic::Status,
3074                        >;
3075                        fn call(
3076                            &mut self,
3077                            request: tonic::Request<super::BatchGetObjectsRequest>,
3078                        ) -> Self::Future {
3079                            let inner = Arc::clone(&self.0);
3080                            let fut = async move {
3081                                <T as LedgerService>::batch_get_objects(&inner, request)
3082                                    .await
3083                            };
3084                            Box::pin(fut)
3085                        }
3086                    }
3087                    let accept_compression_encodings = self.accept_compression_encodings;
3088                    let send_compression_encodings = self.send_compression_encodings;
3089                    let max_decoding_message_size = self.max_decoding_message_size;
3090                    let max_encoding_message_size = self.max_encoding_message_size;
3091                    let inner = self.inner.clone();
3092                    let fut = async move {
3093                        let method = BatchGetObjectsSvc(inner);
3094                        let codec = tonic_prost::ProstCodec::default();
3095                        let mut grpc = tonic::server::Grpc::new(codec)
3096                            .apply_compression_config(
3097                                accept_compression_encodings,
3098                                send_compression_encodings,
3099                            )
3100                            .apply_max_message_size_config(
3101                                max_decoding_message_size,
3102                                max_encoding_message_size,
3103                            );
3104                        let res = grpc.unary(method, req).await;
3105                        Ok(res)
3106                    };
3107                    Box::pin(fut)
3108                }
3109                "/sui.rpc.v2.LedgerService/GetTransaction" => {
3110                    #[allow(non_camel_case_types)]
3111                    struct GetTransactionSvc<T: LedgerService>(pub Arc<T>);
3112                    impl<
3113                        T: LedgerService,
3114                    > tonic::server::UnaryService<super::GetTransactionRequest>
3115                    for GetTransactionSvc<T> {
3116                        type Response = super::GetTransactionResponse;
3117                        type Future = BoxFuture<
3118                            tonic::Response<Self::Response>,
3119                            tonic::Status,
3120                        >;
3121                        fn call(
3122                            &mut self,
3123                            request: tonic::Request<super::GetTransactionRequest>,
3124                        ) -> Self::Future {
3125                            let inner = Arc::clone(&self.0);
3126                            let fut = async move {
3127                                <T as LedgerService>::get_transaction(&inner, request).await
3128                            };
3129                            Box::pin(fut)
3130                        }
3131                    }
3132                    let accept_compression_encodings = self.accept_compression_encodings;
3133                    let send_compression_encodings = self.send_compression_encodings;
3134                    let max_decoding_message_size = self.max_decoding_message_size;
3135                    let max_encoding_message_size = self.max_encoding_message_size;
3136                    let inner = self.inner.clone();
3137                    let fut = async move {
3138                        let method = GetTransactionSvc(inner);
3139                        let codec = tonic_prost::ProstCodec::default();
3140                        let mut grpc = tonic::server::Grpc::new(codec)
3141                            .apply_compression_config(
3142                                accept_compression_encodings,
3143                                send_compression_encodings,
3144                            )
3145                            .apply_max_message_size_config(
3146                                max_decoding_message_size,
3147                                max_encoding_message_size,
3148                            );
3149                        let res = grpc.unary(method, req).await;
3150                        Ok(res)
3151                    };
3152                    Box::pin(fut)
3153                }
3154                "/sui.rpc.v2.LedgerService/BatchGetTransactions" => {
3155                    #[allow(non_camel_case_types)]
3156                    struct BatchGetTransactionsSvc<T: LedgerService>(pub Arc<T>);
3157                    impl<
3158                        T: LedgerService,
3159                    > tonic::server::UnaryService<super::BatchGetTransactionsRequest>
3160                    for BatchGetTransactionsSvc<T> {
3161                        type Response = super::BatchGetTransactionsResponse;
3162                        type Future = BoxFuture<
3163                            tonic::Response<Self::Response>,
3164                            tonic::Status,
3165                        >;
3166                        fn call(
3167                            &mut self,
3168                            request: tonic::Request<super::BatchGetTransactionsRequest>,
3169                        ) -> Self::Future {
3170                            let inner = Arc::clone(&self.0);
3171                            let fut = async move {
3172                                <T as LedgerService>::batch_get_transactions(
3173                                        &inner,
3174                                        request,
3175                                    )
3176                                    .await
3177                            };
3178                            Box::pin(fut)
3179                        }
3180                    }
3181                    let accept_compression_encodings = self.accept_compression_encodings;
3182                    let send_compression_encodings = self.send_compression_encodings;
3183                    let max_decoding_message_size = self.max_decoding_message_size;
3184                    let max_encoding_message_size = self.max_encoding_message_size;
3185                    let inner = self.inner.clone();
3186                    let fut = async move {
3187                        let method = BatchGetTransactionsSvc(inner);
3188                        let codec = tonic_prost::ProstCodec::default();
3189                        let mut grpc = tonic::server::Grpc::new(codec)
3190                            .apply_compression_config(
3191                                accept_compression_encodings,
3192                                send_compression_encodings,
3193                            )
3194                            .apply_max_message_size_config(
3195                                max_decoding_message_size,
3196                                max_encoding_message_size,
3197                            );
3198                        let res = grpc.unary(method, req).await;
3199                        Ok(res)
3200                    };
3201                    Box::pin(fut)
3202                }
3203                "/sui.rpc.v2.LedgerService/GetCheckpoint" => {
3204                    #[allow(non_camel_case_types)]
3205                    struct GetCheckpointSvc<T: LedgerService>(pub Arc<T>);
3206                    impl<
3207                        T: LedgerService,
3208                    > tonic::server::UnaryService<super::GetCheckpointRequest>
3209                    for GetCheckpointSvc<T> {
3210                        type Response = super::GetCheckpointResponse;
3211                        type Future = BoxFuture<
3212                            tonic::Response<Self::Response>,
3213                            tonic::Status,
3214                        >;
3215                        fn call(
3216                            &mut self,
3217                            request: tonic::Request<super::GetCheckpointRequest>,
3218                        ) -> Self::Future {
3219                            let inner = Arc::clone(&self.0);
3220                            let fut = async move {
3221                                <T as LedgerService>::get_checkpoint(&inner, request).await
3222                            };
3223                            Box::pin(fut)
3224                        }
3225                    }
3226                    let accept_compression_encodings = self.accept_compression_encodings;
3227                    let send_compression_encodings = self.send_compression_encodings;
3228                    let max_decoding_message_size = self.max_decoding_message_size;
3229                    let max_encoding_message_size = self.max_encoding_message_size;
3230                    let inner = self.inner.clone();
3231                    let fut = async move {
3232                        let method = GetCheckpointSvc(inner);
3233                        let codec = tonic_prost::ProstCodec::default();
3234                        let mut grpc = tonic::server::Grpc::new(codec)
3235                            .apply_compression_config(
3236                                accept_compression_encodings,
3237                                send_compression_encodings,
3238                            )
3239                            .apply_max_message_size_config(
3240                                max_decoding_message_size,
3241                                max_encoding_message_size,
3242                            );
3243                        let res = grpc.unary(method, req).await;
3244                        Ok(res)
3245                    };
3246                    Box::pin(fut)
3247                }
3248                "/sui.rpc.v2.LedgerService/GetEpoch" => {
3249                    #[allow(non_camel_case_types)]
3250                    struct GetEpochSvc<T: LedgerService>(pub Arc<T>);
3251                    impl<
3252                        T: LedgerService,
3253                    > tonic::server::UnaryService<super::GetEpochRequest>
3254                    for GetEpochSvc<T> {
3255                        type Response = super::GetEpochResponse;
3256                        type Future = BoxFuture<
3257                            tonic::Response<Self::Response>,
3258                            tonic::Status,
3259                        >;
3260                        fn call(
3261                            &mut self,
3262                            request: tonic::Request<super::GetEpochRequest>,
3263                        ) -> Self::Future {
3264                            let inner = Arc::clone(&self.0);
3265                            let fut = async move {
3266                                <T as LedgerService>::get_epoch(&inner, request).await
3267                            };
3268                            Box::pin(fut)
3269                        }
3270                    }
3271                    let accept_compression_encodings = self.accept_compression_encodings;
3272                    let send_compression_encodings = self.send_compression_encodings;
3273                    let max_decoding_message_size = self.max_decoding_message_size;
3274                    let max_encoding_message_size = self.max_encoding_message_size;
3275                    let inner = self.inner.clone();
3276                    let fut = async move {
3277                        let method = GetEpochSvc(inner);
3278                        let codec = tonic_prost::ProstCodec::default();
3279                        let mut grpc = tonic::server::Grpc::new(codec)
3280                            .apply_compression_config(
3281                                accept_compression_encodings,
3282                                send_compression_encodings,
3283                            )
3284                            .apply_max_message_size_config(
3285                                max_decoding_message_size,
3286                                max_encoding_message_size,
3287                            );
3288                        let res = grpc.unary(method, req).await;
3289                        Ok(res)
3290                    };
3291                    Box::pin(fut)
3292                }
3293                "/sui.rpc.v2.LedgerService/ListCheckpoints" => {
3294                    #[allow(non_camel_case_types)]
3295                    struct ListCheckpointsSvc<T: LedgerService>(pub Arc<T>);
3296                    impl<
3297                        T: LedgerService,
3298                    > tonic::server::ServerStreamingService<
3299                        super::ListCheckpointsRequest,
3300                    > for ListCheckpointsSvc<T> {
3301                        type Response = super::ListCheckpointsResponse;
3302                        type ResponseStream = BoxStream<super::ListCheckpointsResponse>;
3303                        type Future = BoxFuture<
3304                            tonic::Response<Self::ResponseStream>,
3305                            tonic::Status,
3306                        >;
3307                        fn call(
3308                            &mut self,
3309                            request: tonic::Request<super::ListCheckpointsRequest>,
3310                        ) -> Self::Future {
3311                            let inner = Arc::clone(&self.0);
3312                            let fut = async move {
3313                                <T as LedgerService>::list_checkpoints(&inner, request)
3314                                    .await
3315                            };
3316                            Box::pin(fut)
3317                        }
3318                    }
3319                    let accept_compression_encodings = self.accept_compression_encodings;
3320                    let send_compression_encodings = self.send_compression_encodings;
3321                    let max_decoding_message_size = self.max_decoding_message_size;
3322                    let max_encoding_message_size = self.max_encoding_message_size;
3323                    let inner = self.inner.clone();
3324                    let fut = async move {
3325                        let method = ListCheckpointsSvc(inner);
3326                        let codec = tonic_prost::ProstCodec::default();
3327                        let mut grpc = tonic::server::Grpc::new(codec)
3328                            .apply_compression_config(
3329                                accept_compression_encodings,
3330                                send_compression_encodings,
3331                            )
3332                            .apply_max_message_size_config(
3333                                max_decoding_message_size,
3334                                max_encoding_message_size,
3335                            );
3336                        let res = grpc.server_streaming(method, req).await;
3337                        Ok(res)
3338                    };
3339                    Box::pin(fut)
3340                }
3341                "/sui.rpc.v2.LedgerService/ListTransactions" => {
3342                    #[allow(non_camel_case_types)]
3343                    struct ListTransactionsSvc<T: LedgerService>(pub Arc<T>);
3344                    impl<
3345                        T: LedgerService,
3346                    > tonic::server::ServerStreamingService<
3347                        super::ListTransactionsRequest,
3348                    > for ListTransactionsSvc<T> {
3349                        type Response = super::ListTransactionsResponse;
3350                        type ResponseStream = BoxStream<super::ListTransactionsResponse>;
3351                        type Future = BoxFuture<
3352                            tonic::Response<Self::ResponseStream>,
3353                            tonic::Status,
3354                        >;
3355                        fn call(
3356                            &mut self,
3357                            request: tonic::Request<super::ListTransactionsRequest>,
3358                        ) -> Self::Future {
3359                            let inner = Arc::clone(&self.0);
3360                            let fut = async move {
3361                                <T as LedgerService>::list_transactions(&inner, request)
3362                                    .await
3363                            };
3364                            Box::pin(fut)
3365                        }
3366                    }
3367                    let accept_compression_encodings = self.accept_compression_encodings;
3368                    let send_compression_encodings = self.send_compression_encodings;
3369                    let max_decoding_message_size = self.max_decoding_message_size;
3370                    let max_encoding_message_size = self.max_encoding_message_size;
3371                    let inner = self.inner.clone();
3372                    let fut = async move {
3373                        let method = ListTransactionsSvc(inner);
3374                        let codec = tonic_prost::ProstCodec::default();
3375                        let mut grpc = tonic::server::Grpc::new(codec)
3376                            .apply_compression_config(
3377                                accept_compression_encodings,
3378                                send_compression_encodings,
3379                            )
3380                            .apply_max_message_size_config(
3381                                max_decoding_message_size,
3382                                max_encoding_message_size,
3383                            );
3384                        let res = grpc.server_streaming(method, req).await;
3385                        Ok(res)
3386                    };
3387                    Box::pin(fut)
3388                }
3389                "/sui.rpc.v2.LedgerService/ListEvents" => {
3390                    #[allow(non_camel_case_types)]
3391                    struct ListEventsSvc<T: LedgerService>(pub Arc<T>);
3392                    impl<
3393                        T: LedgerService,
3394                    > tonic::server::ServerStreamingService<super::ListEventsRequest>
3395                    for ListEventsSvc<T> {
3396                        type Response = super::ListEventsResponse;
3397                        type ResponseStream = BoxStream<super::ListEventsResponse>;
3398                        type Future = BoxFuture<
3399                            tonic::Response<Self::ResponseStream>,
3400                            tonic::Status,
3401                        >;
3402                        fn call(
3403                            &mut self,
3404                            request: tonic::Request<super::ListEventsRequest>,
3405                        ) -> Self::Future {
3406                            let inner = Arc::clone(&self.0);
3407                            let fut = async move {
3408                                <T as LedgerService>::list_events(&inner, request).await
3409                            };
3410                            Box::pin(fut)
3411                        }
3412                    }
3413                    let accept_compression_encodings = self.accept_compression_encodings;
3414                    let send_compression_encodings = self.send_compression_encodings;
3415                    let max_decoding_message_size = self.max_decoding_message_size;
3416                    let max_encoding_message_size = self.max_encoding_message_size;
3417                    let inner = self.inner.clone();
3418                    let fut = async move {
3419                        let method = ListEventsSvc(inner);
3420                        let codec = tonic_prost::ProstCodec::default();
3421                        let mut grpc = tonic::server::Grpc::new(codec)
3422                            .apply_compression_config(
3423                                accept_compression_encodings,
3424                                send_compression_encodings,
3425                            )
3426                            .apply_max_message_size_config(
3427                                max_decoding_message_size,
3428                                max_encoding_message_size,
3429                            );
3430                        let res = grpc.server_streaming(method, req).await;
3431                        Ok(res)
3432                    };
3433                    Box::pin(fut)
3434                }
3435                _ => {
3436                    Box::pin(async move {
3437                        let mut response = http::Response::new(
3438                            tonic::body::Body::default(),
3439                        );
3440                        let headers = response.headers_mut();
3441                        headers
3442                            .insert(
3443                                tonic::Status::GRPC_STATUS,
3444                                (tonic::Code::Unimplemented as i32).into(),
3445                            );
3446                        headers
3447                            .insert(
3448                                http::header::CONTENT_TYPE,
3449                                tonic::metadata::GRPC_CONTENT_TYPE,
3450                            );
3451                        Ok(response)
3452                    })
3453                }
3454            }
3455        }
3456    }
3457    impl<T> Clone for LedgerServiceServer<T> {
3458        fn clone(&self) -> Self {
3459            let inner = self.inner.clone();
3460            Self {
3461                inner,
3462                accept_compression_encodings: self.accept_compression_encodings,
3463                send_compression_encodings: self.send_compression_encodings,
3464                max_decoding_message_size: self.max_decoding_message_size,
3465                max_encoding_message_size: self.max_encoding_message_size,
3466            }
3467        }
3468    }
3469    /// Generated gRPC service name
3470    pub const SERVICE_NAME: &str = "sui.rpc.v2.LedgerService";
3471    impl<T> tonic::server::NamedService for LedgerServiceServer<T> {
3472        const NAME: &'static str = SERVICE_NAME;
3473    }
3474}
3475/// A Move Package
3476#[non_exhaustive]
3477#[derive(Clone, PartialEq, ::prost::Message)]
3478pub struct Package {
3479    /// The PackageId of this package
3480    ///
3481    /// A package's `storage_id` is the Sui ObjectId of the package on-chain.
3482    /// Outside of system packages the `storage_id` for every package version is
3483    /// different.
3484    #[prost(string, optional, tag = "1")]
3485    pub storage_id: ::core::option::Option<::prost::alloc::string::String>,
3486    /// The PackageId of the first published version of this package.
3487    ///
3488    /// A package's `original_id` (sometimes also called its `runtime_id`) is the
3489    /// `storage_id` of the first version of this package that has been published.
3490    /// The `original_id`/`runtime_id` is stable across all versions of the
3491    /// package and does not ever change.
3492    #[prost(string, optional, tag = "2")]
3493    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3494    /// The version of this package
3495    #[prost(uint64, optional, tag = "3")]
3496    pub version: ::core::option::Option<u64>,
3497    /// The modules defined by this package
3498    #[prost(message, repeated, tag = "4")]
3499    pub modules: ::prost::alloc::vec::Vec<Module>,
3500    /// List of datatype origins for mapping datatypes to a package version where
3501    /// it was first defined
3502    #[prost(message, repeated, tag = "5")]
3503    pub type_origins: ::prost::alloc::vec::Vec<TypeOrigin>,
3504    /// The package's transitive dependencies as a mapping from the package's
3505    /// runtime Id (the Id it is referred to by in other packages) to its
3506    /// storage Id (the Id it is loaded from on chain).
3507    #[prost(message, repeated, tag = "6")]
3508    pub linkage: ::prost::alloc::vec::Vec<Linkage>,
3509}
3510/// A Move Module.
3511#[non_exhaustive]
3512#[derive(Clone, PartialEq, ::prost::Message)]
3513pub struct Module {
3514    /// Name of this module.
3515    #[prost(string, optional, tag = "1")]
3516    pub name: ::core::option::Option<::prost::alloc::string::String>,
3517    /// Serialized bytecode of the module.
3518    #[prost(bytes = "bytes", optional, tag = "2")]
3519    pub contents: ::core::option::Option<::prost::bytes::Bytes>,
3520    /// List of DataTypes defined by this module.
3521    #[prost(message, repeated, tag = "3")]
3522    pub datatypes: ::prost::alloc::vec::Vec<DatatypeDescriptor>,
3523    /// List of Functions defined by this module.
3524    #[prost(message, repeated, tag = "4")]
3525    pub functions: ::prost::alloc::vec::Vec<FunctionDescriptor>,
3526}
3527/// Describes a Move Datatype.
3528#[non_exhaustive]
3529#[derive(Clone, PartialEq, ::prost::Message)]
3530pub struct DatatypeDescriptor {
3531    /// Fully qualified name of this Datatype.
3532    ///
3533    /// This is `<defining_id>::<module>::<name>`
3534    #[prost(string, optional, tag = "1")]
3535    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3536    /// PackageId of the package where this Datatype is defined.
3537    ///
3538    /// A type's `defining_id` is the `storage_id` of the package version that first introduced or added that type.
3539    #[prost(string, optional, tag = "2")]
3540    pub defining_id: ::core::option::Option<::prost::alloc::string::String>,
3541    /// Name of the module where this Datatype is defined
3542    #[prost(string, optional, tag = "3")]
3543    pub module: ::core::option::Option<::prost::alloc::string::String>,
3544    /// Name of this Datatype
3545    #[prost(string, optional, tag = "4")]
3546    pub name: ::core::option::Option<::prost::alloc::string::String>,
3547    /// This type's abilities
3548    #[prost(enumeration = "Ability", repeated, tag = "5")]
3549    pub abilities: ::prost::alloc::vec::Vec<i32>,
3550    /// Ability constraints and phantom status for this type's generic type parameters
3551    #[prost(message, repeated, tag = "6")]
3552    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3553    /// Indicates whether this datatype is a 'STRUCT' or an 'ENUM'
3554    #[prost(enumeration = "datatype_descriptor::DatatypeKind", optional, tag = "7")]
3555    pub kind: ::core::option::Option<i32>,
3556    /// Set of fields if this Datatype is a struct.
3557    ///
3558    /// The order of the entries is the order of how the fields are defined.
3559    #[prost(message, repeated, tag = "8")]
3560    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3561    /// Set of variants if this Datatype is an enum.
3562    ///
3563    /// The order of the entries is the order of how the variants are defined.
3564    #[prost(message, repeated, tag = "9")]
3565    pub variants: ::prost::alloc::vec::Vec<VariantDescriptor>,
3566}
3567/// Nested message and enum types in `DatatypeDescriptor`.
3568pub mod datatype_descriptor {
3569    #[non_exhaustive]
3570    #[derive(
3571        Clone,
3572        Copy,
3573        Debug,
3574        PartialEq,
3575        Eq,
3576        Hash,
3577        PartialOrd,
3578        Ord,
3579        ::prost::Enumeration
3580    )]
3581    #[repr(i32)]
3582    pub enum DatatypeKind {
3583        Unknown = 0,
3584        Struct = 1,
3585        Enum = 2,
3586    }
3587    impl DatatypeKind {
3588        /// String value of the enum field names used in the ProtoBuf definition.
3589        ///
3590        /// The values are not transformed in any way and thus are considered stable
3591        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3592        pub fn as_str_name(&self) -> &'static str {
3593            match self {
3594                Self::Unknown => "DATATYPE_KIND_UNKNOWN",
3595                Self::Struct => "STRUCT",
3596                Self::Enum => "ENUM",
3597            }
3598        }
3599        /// Creates an enum from field names used in the ProtoBuf definition.
3600        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3601            match value {
3602                "DATATYPE_KIND_UNKNOWN" => Some(Self::Unknown),
3603                "STRUCT" => Some(Self::Struct),
3604                "ENUM" => Some(Self::Enum),
3605                _ => None,
3606            }
3607        }
3608    }
3609}
3610/// A generic type parameter used in the declaration of a struct or enum.
3611#[non_exhaustive]
3612#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3613pub struct TypeParameter {
3614    /// The type parameter constraints
3615    #[prost(enumeration = "Ability", repeated, tag = "1")]
3616    pub constraints: ::prost::alloc::vec::Vec<i32>,
3617    /// Whether the parameter is declared as phantom
3618    #[prost(bool, optional, tag = "2")]
3619    pub is_phantom: ::core::option::Option<bool>,
3620}
3621/// Descriptor of a field that belongs to a struct or enum variant
3622#[non_exhaustive]
3623#[derive(Clone, PartialEq, ::prost::Message)]
3624pub struct FieldDescriptor {
3625    /// Name of the field
3626    #[prost(string, optional, tag = "1")]
3627    pub name: ::core::option::Option<::prost::alloc::string::String>,
3628    /// Order or position of the field in the struct or enum variant definition.
3629    #[prost(uint32, optional, tag = "2")]
3630    pub position: ::core::option::Option<u32>,
3631    /// The type of the field
3632    #[prost(message, optional, tag = "3")]
3633    pub r#type: ::core::option::Option<OpenSignatureBody>,
3634}
3635/// Descriptor of an enum variant
3636#[non_exhaustive]
3637#[derive(Clone, PartialEq, ::prost::Message)]
3638pub struct VariantDescriptor {
3639    /// Name of the variant
3640    #[prost(string, optional, tag = "1")]
3641    pub name: ::core::option::Option<::prost::alloc::string::String>,
3642    /// Order or position of the variant in the enum definition.
3643    #[prost(uint32, optional, tag = "2")]
3644    pub position: ::core::option::Option<u32>,
3645    /// Set of fields defined by this variant.
3646    #[prost(message, repeated, tag = "3")]
3647    pub fields: ::prost::alloc::vec::Vec<FieldDescriptor>,
3648}
3649/// Representation of a type signature that could appear as a field type for a struct or enum
3650#[non_exhaustive]
3651#[derive(Clone, PartialEq, ::prost::Message)]
3652pub struct OpenSignatureBody {
3653    /// Type of this signature
3654    #[prost(enumeration = "open_signature_body::Type", optional, tag = "1")]
3655    pub r#type: ::core::option::Option<i32>,
3656    /// Fully qualified name of the datatype when `type` is `DATATYPE`
3657    #[prost(string, optional, tag = "2")]
3658    pub type_name: ::core::option::Option<::prost::alloc::string::String>,
3659    /// Set when `type` is `VECTOR` or `DATATYPE`
3660    #[prost(message, repeated, tag = "3")]
3661    pub type_parameter_instantiation: ::prost::alloc::vec::Vec<OpenSignatureBody>,
3662    /// Position of the type parameter as defined in the containing data type descriptor when `type` is `TYPE_PARAMETER`
3663    #[prost(uint32, optional, tag = "4")]
3664    pub type_parameter: ::core::option::Option<u32>,
3665}
3666/// Nested message and enum types in `OpenSignatureBody`.
3667pub mod open_signature_body {
3668    #[non_exhaustive]
3669    #[derive(
3670        Clone,
3671        Copy,
3672        Debug,
3673        PartialEq,
3674        Eq,
3675        Hash,
3676        PartialOrd,
3677        Ord,
3678        ::prost::Enumeration
3679    )]
3680    #[repr(i32)]
3681    pub enum Type {
3682        Unknown = 0,
3683        Address = 1,
3684        Bool = 2,
3685        U8 = 3,
3686        U16 = 4,
3687        U32 = 5,
3688        U64 = 6,
3689        U128 = 7,
3690        U256 = 8,
3691        Vector = 9,
3692        Datatype = 10,
3693        Parameter = 11,
3694    }
3695    impl Type {
3696        /// String value of the enum field names used in the ProtoBuf definition.
3697        ///
3698        /// The values are not transformed in any way and thus are considered stable
3699        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3700        pub fn as_str_name(&self) -> &'static str {
3701            match self {
3702                Self::Unknown => "TYPE_UNKNOWN",
3703                Self::Address => "ADDRESS",
3704                Self::Bool => "BOOL",
3705                Self::U8 => "U8",
3706                Self::U16 => "U16",
3707                Self::U32 => "U32",
3708                Self::U64 => "U64",
3709                Self::U128 => "U128",
3710                Self::U256 => "U256",
3711                Self::Vector => "VECTOR",
3712                Self::Datatype => "DATATYPE",
3713                Self::Parameter => "TYPE_PARAMETER",
3714            }
3715        }
3716        /// Creates an enum from field names used in the ProtoBuf definition.
3717        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3718            match value {
3719                "TYPE_UNKNOWN" => Some(Self::Unknown),
3720                "ADDRESS" => Some(Self::Address),
3721                "BOOL" => Some(Self::Bool),
3722                "U8" => Some(Self::U8),
3723                "U16" => Some(Self::U16),
3724                "U32" => Some(Self::U32),
3725                "U64" => Some(Self::U64),
3726                "U128" => Some(Self::U128),
3727                "U256" => Some(Self::U256),
3728                "VECTOR" => Some(Self::Vector),
3729                "DATATYPE" => Some(Self::Datatype),
3730                "TYPE_PARAMETER" => Some(Self::Parameter),
3731                _ => None,
3732            }
3733        }
3734    }
3735}
3736/// Descriptor of a Move function
3737#[non_exhaustive]
3738#[derive(Clone, PartialEq, ::prost::Message)]
3739pub struct FunctionDescriptor {
3740    /// Name of the function
3741    #[prost(string, optional, tag = "1")]
3742    pub name: ::core::option::Option<::prost::alloc::string::String>,
3743    /// Whether the function is `public`, `private` or `public(friend)`
3744    #[prost(enumeration = "function_descriptor::Visibility", optional, tag = "5")]
3745    pub visibility: ::core::option::Option<i32>,
3746    /// Whether the function is marked `entry` or not.
3747    #[prost(bool, optional, tag = "6")]
3748    pub is_entry: ::core::option::Option<bool>,
3749    /// Ability constraints for type parameters
3750    #[prost(message, repeated, tag = "7")]
3751    pub type_parameters: ::prost::alloc::vec::Vec<TypeParameter>,
3752    /// Formal parameter types.
3753    #[prost(message, repeated, tag = "8")]
3754    pub parameters: ::prost::alloc::vec::Vec<OpenSignature>,
3755    /// Return types.
3756    #[prost(message, repeated, tag = "9")]
3757    pub returns: ::prost::alloc::vec::Vec<OpenSignature>,
3758}
3759/// Nested message and enum types in `FunctionDescriptor`.
3760pub mod function_descriptor {
3761    #[non_exhaustive]
3762    #[derive(
3763        Clone,
3764        Copy,
3765        Debug,
3766        PartialEq,
3767        Eq,
3768        Hash,
3769        PartialOrd,
3770        Ord,
3771        ::prost::Enumeration
3772    )]
3773    #[repr(i32)]
3774    pub enum Visibility {
3775        Unknown = 0,
3776        Private = 1,
3777        Public = 2,
3778        Friend = 3,
3779    }
3780    impl Visibility {
3781        /// String value of the enum field names used in the ProtoBuf definition.
3782        ///
3783        /// The values are not transformed in any way and thus are considered stable
3784        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3785        pub fn as_str_name(&self) -> &'static str {
3786            match self {
3787                Self::Unknown => "VISIBILITY_UNKNOWN",
3788                Self::Private => "PRIVATE",
3789                Self::Public => "PUBLIC",
3790                Self::Friend => "FRIEND",
3791            }
3792        }
3793        /// Creates an enum from field names used in the ProtoBuf definition.
3794        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3795            match value {
3796                "VISIBILITY_UNKNOWN" => Some(Self::Unknown),
3797                "PRIVATE" => Some(Self::Private),
3798                "PUBLIC" => Some(Self::Public),
3799                "FRIEND" => Some(Self::Friend),
3800                _ => None,
3801            }
3802        }
3803    }
3804}
3805/// Representation of a type signature that could appear as a function parameter or return value.
3806#[non_exhaustive]
3807#[derive(Clone, PartialEq, ::prost::Message)]
3808pub struct OpenSignature {
3809    #[prost(enumeration = "open_signature::Reference", optional, tag = "1")]
3810    pub reference: ::core::option::Option<i32>,
3811    #[prost(message, optional, tag = "2")]
3812    pub body: ::core::option::Option<OpenSignatureBody>,
3813}
3814/// Nested message and enum types in `OpenSignature`.
3815pub mod open_signature {
3816    #[non_exhaustive]
3817    #[derive(
3818        Clone,
3819        Copy,
3820        Debug,
3821        PartialEq,
3822        Eq,
3823        Hash,
3824        PartialOrd,
3825        Ord,
3826        ::prost::Enumeration
3827    )]
3828    #[repr(i32)]
3829    pub enum Reference {
3830        Unknown = 0,
3831        Immutable = 1,
3832        Mutable = 2,
3833    }
3834    impl Reference {
3835        /// String value of the enum field names used in the ProtoBuf definition.
3836        ///
3837        /// The values are not transformed in any way and thus are considered stable
3838        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3839        pub fn as_str_name(&self) -> &'static str {
3840            match self {
3841                Self::Unknown => "REFERENCE_UNKNOWN",
3842                Self::Immutable => "IMMUTABLE",
3843                Self::Mutable => "MUTABLE",
3844            }
3845        }
3846        /// Creates an enum from field names used in the ProtoBuf definition.
3847        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3848            match value {
3849                "REFERENCE_UNKNOWN" => Some(Self::Unknown),
3850                "IMMUTABLE" => Some(Self::Immutable),
3851                "MUTABLE" => Some(Self::Mutable),
3852                _ => None,
3853            }
3854        }
3855    }
3856}
3857/// Identifies a struct and the module it was defined in.
3858#[non_exhaustive]
3859#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3860pub struct TypeOrigin {
3861    #[prost(string, optional, tag = "1")]
3862    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3863    #[prost(string, optional, tag = "2")]
3864    pub datatype_name: ::core::option::Option<::prost::alloc::string::String>,
3865    #[prost(string, optional, tag = "3")]
3866    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3867}
3868/// Upgraded package info for the linkage table.
3869#[non_exhaustive]
3870#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3871pub struct Linkage {
3872    /// Id of the original package.
3873    #[prost(string, optional, tag = "1")]
3874    pub original_id: ::core::option::Option<::prost::alloc::string::String>,
3875    /// Id of the upgraded package.
3876    #[prost(string, optional, tag = "2")]
3877    pub upgraded_id: ::core::option::Option<::prost::alloc::string::String>,
3878    /// Version of the upgraded package.
3879    #[prost(uint64, optional, tag = "3")]
3880    pub upgraded_version: ::core::option::Option<u64>,
3881}
3882/// An `Ability` classifies what operations are permitted for a given type
3883#[non_exhaustive]
3884#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
3885#[repr(i32)]
3886pub enum Ability {
3887    Unknown = 0,
3888    /// Allows values of types with this ability to be copied
3889    Copy = 1,
3890    /// Allows values of types with this ability to be dropped.
3891    Drop = 2,
3892    /// Allows values of types with this ability to exist inside a struct in global storage
3893    Store = 3,
3894    /// Allows the type to serve as a key for global storage operations
3895    Key = 4,
3896}
3897impl Ability {
3898    /// String value of the enum field names used in the ProtoBuf definition.
3899    ///
3900    /// The values are not transformed in any way and thus are considered stable
3901    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
3902    pub fn as_str_name(&self) -> &'static str {
3903        match self {
3904            Self::Unknown => "ABILITY_UNKNOWN",
3905            Self::Copy => "COPY",
3906            Self::Drop => "DROP",
3907            Self::Store => "STORE",
3908            Self::Key => "KEY",
3909        }
3910    }
3911    /// Creates an enum from field names used in the ProtoBuf definition.
3912    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
3913        match value {
3914            "ABILITY_UNKNOWN" => Some(Self::Unknown),
3915            "COPY" => Some(Self::Copy),
3916            "DROP" => Some(Self::Drop),
3917            "STORE" => Some(Self::Store),
3918            "KEY" => Some(Self::Key),
3919            _ => None,
3920        }
3921    }
3922}
3923#[non_exhaustive]
3924#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3925pub struct GetPackageRequest {
3926    /// Required. The `storage_id` of the requested package.
3927    #[prost(string, optional, tag = "1")]
3928    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3929}
3930#[non_exhaustive]
3931#[derive(Clone, PartialEq, ::prost::Message)]
3932pub struct GetPackageResponse {
3933    /// The package.
3934    #[prost(message, optional, tag = "1")]
3935    pub package: ::core::option::Option<Package>,
3936}
3937#[non_exhaustive]
3938#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3939pub struct GetDatatypeRequest {
3940    /// Required. The `storage_id` of the requested package.
3941    #[prost(string, optional, tag = "1")]
3942    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3943    /// Required. The name of the requested module.
3944    #[prost(string, optional, tag = "2")]
3945    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3946    /// Required. The name of the requested datatype.
3947    #[prost(string, optional, tag = "3")]
3948    pub name: ::core::option::Option<::prost::alloc::string::String>,
3949}
3950#[non_exhaustive]
3951#[derive(Clone, PartialEq, ::prost::Message)]
3952pub struct GetDatatypeResponse {
3953    /// The datatype.
3954    #[prost(message, optional, tag = "1")]
3955    pub datatype: ::core::option::Option<DatatypeDescriptor>,
3956}
3957#[non_exhaustive]
3958#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3959pub struct GetFunctionRequest {
3960    /// Required. The `storage_id` of the requested package.
3961    #[prost(string, optional, tag = "1")]
3962    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3963    /// Required. The name of the requested module.
3964    #[prost(string, optional, tag = "2")]
3965    pub module_name: ::core::option::Option<::prost::alloc::string::String>,
3966    /// Required. The name of the requested function.
3967    #[prost(string, optional, tag = "3")]
3968    pub name: ::core::option::Option<::prost::alloc::string::String>,
3969}
3970#[non_exhaustive]
3971#[derive(Clone, PartialEq, ::prost::Message)]
3972pub struct GetFunctionResponse {
3973    /// The function.
3974    #[prost(message, optional, tag = "1")]
3975    pub function: ::core::option::Option<FunctionDescriptor>,
3976}
3977#[non_exhaustive]
3978#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
3979pub struct ListPackageVersionsRequest {
3980    /// Required. The `storage_id` of any version of the package.
3981    #[prost(string, optional, tag = "1")]
3982    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
3983    /// The maximum number of versions to return. The service may return fewer than this value.
3984    /// If unspecified, at most `1000` entries will be returned.
3985    /// The maximum value is `10000`; values above `10000` will be coerced to `10000`.
3986    #[prost(uint32, optional, tag = "2")]
3987    pub page_size: ::core::option::Option<u32>,
3988    /// A page token, received from a previous `ListPackageVersions` call.
3989    /// Provide this to retrieve the subsequent page.
3990    ///
3991    /// When paginating, all other parameters provided to `ListPackageVersions` must
3992    /// match the call that provided the page token.
3993    #[prost(bytes = "bytes", optional, tag = "3")]
3994    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
3995}
3996#[non_exhaustive]
3997#[derive(Clone, PartialEq, ::prost::Message)]
3998pub struct ListPackageVersionsResponse {
3999    /// List of all package versions, ordered by version.
4000    #[prost(message, repeated, tag = "1")]
4001    pub versions: ::prost::alloc::vec::Vec<PackageVersion>,
4002    /// A token, which can be sent as `page_token` to retrieve the next page.
4003    /// If this field is omitted, there are no subsequent pages.
4004    #[prost(bytes = "bytes", optional, tag = "2")]
4005    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
4006}
4007/// A simplified representation of a package version
4008#[non_exhaustive]
4009#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4010pub struct PackageVersion {
4011    /// The storage ID of this package version
4012    #[prost(string, optional, tag = "1")]
4013    pub package_id: ::core::option::Option<::prost::alloc::string::String>,
4014    /// The version number
4015    #[prost(uint64, optional, tag = "2")]
4016    pub version: ::core::option::Option<u64>,
4017}
4018/// Generated client implementations.
4019pub mod move_package_service_client {
4020    #![allow(
4021        unused_variables,
4022        dead_code,
4023        missing_docs,
4024        clippy::wildcard_imports,
4025        clippy::let_unit_value,
4026    )]
4027    use tonic::codegen::*;
4028    use tonic::codegen::http::Uri;
4029    #[derive(Debug, Clone)]
4030    pub struct MovePackageServiceClient<T> {
4031        inner: tonic::client::Grpc<T>,
4032    }
4033    impl MovePackageServiceClient<tonic::transport::Channel> {
4034        /// Attempt to create a new client by connecting to a given endpoint.
4035        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4036        where
4037            D: TryInto<tonic::transport::Endpoint>,
4038            D::Error: Into<StdError>,
4039        {
4040            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4041            Ok(Self::new(conn))
4042        }
4043    }
4044    impl<T> MovePackageServiceClient<T>
4045    where
4046        T: tonic::client::GrpcService<tonic::body::Body>,
4047        T::Error: Into<StdError>,
4048        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4049        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4050    {
4051        pub fn new(inner: T) -> Self {
4052            let inner = tonic::client::Grpc::new(inner);
4053            Self { inner }
4054        }
4055        pub fn with_origin(inner: T, origin: Uri) -> Self {
4056            let inner = tonic::client::Grpc::with_origin(inner, origin);
4057            Self { inner }
4058        }
4059        pub fn with_interceptor<F>(
4060            inner: T,
4061            interceptor: F,
4062        ) -> MovePackageServiceClient<InterceptedService<T, F>>
4063        where
4064            F: tonic::service::Interceptor,
4065            T::ResponseBody: Default,
4066            T: tonic::codegen::Service<
4067                http::Request<tonic::body::Body>,
4068                Response = http::Response<
4069                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4070                >,
4071            >,
4072            <T as tonic::codegen::Service<
4073                http::Request<tonic::body::Body>,
4074            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4075        {
4076            MovePackageServiceClient::new(InterceptedService::new(inner, interceptor))
4077        }
4078        /// Compress requests with the given encoding.
4079        ///
4080        /// This requires the server to support it otherwise it might respond with an
4081        /// error.
4082        #[must_use]
4083        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4084            self.inner = self.inner.send_compressed(encoding);
4085            self
4086        }
4087        /// Enable decompressing responses.
4088        #[must_use]
4089        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4090            self.inner = self.inner.accept_compressed(encoding);
4091            self
4092        }
4093        /// Limits the maximum size of a decoded message.
4094        ///
4095        /// Default: `4MB`
4096        #[must_use]
4097        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4098            self.inner = self.inner.max_decoding_message_size(limit);
4099            self
4100        }
4101        /// Limits the maximum size of an encoded message.
4102        ///
4103        /// Default: `usize::MAX`
4104        #[must_use]
4105        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4106            self.inner = self.inner.max_encoding_message_size(limit);
4107            self
4108        }
4109        pub async fn get_package(
4110            &mut self,
4111            request: impl tonic::IntoRequest<super::GetPackageRequest>,
4112        ) -> std::result::Result<
4113            tonic::Response<super::GetPackageResponse>,
4114            tonic::Status,
4115        > {
4116            self.inner
4117                .ready()
4118                .await
4119                .map_err(|e| {
4120                    tonic::Status::unknown(
4121                        format!("Service was not ready: {}", e.into()),
4122                    )
4123                })?;
4124            let codec = tonic_prost::ProstCodec::default();
4125            let path = http::uri::PathAndQuery::from_static(
4126                "/sui.rpc.v2.MovePackageService/GetPackage",
4127            );
4128            let mut req = request.into_request();
4129            req.extensions_mut()
4130                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetPackage"));
4131            self.inner.unary(req, path, codec).await
4132        }
4133        pub async fn get_datatype(
4134            &mut self,
4135            request: impl tonic::IntoRequest<super::GetDatatypeRequest>,
4136        ) -> std::result::Result<
4137            tonic::Response<super::GetDatatypeResponse>,
4138            tonic::Status,
4139        > {
4140            self.inner
4141                .ready()
4142                .await
4143                .map_err(|e| {
4144                    tonic::Status::unknown(
4145                        format!("Service was not ready: {}", e.into()),
4146                    )
4147                })?;
4148            let codec = tonic_prost::ProstCodec::default();
4149            let path = http::uri::PathAndQuery::from_static(
4150                "/sui.rpc.v2.MovePackageService/GetDatatype",
4151            );
4152            let mut req = request.into_request();
4153            req.extensions_mut()
4154                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetDatatype"));
4155            self.inner.unary(req, path, codec).await
4156        }
4157        pub async fn get_function(
4158            &mut self,
4159            request: impl tonic::IntoRequest<super::GetFunctionRequest>,
4160        ) -> std::result::Result<
4161            tonic::Response<super::GetFunctionResponse>,
4162            tonic::Status,
4163        > {
4164            self.inner
4165                .ready()
4166                .await
4167                .map_err(|e| {
4168                    tonic::Status::unknown(
4169                        format!("Service was not ready: {}", e.into()),
4170                    )
4171                })?;
4172            let codec = tonic_prost::ProstCodec::default();
4173            let path = http::uri::PathAndQuery::from_static(
4174                "/sui.rpc.v2.MovePackageService/GetFunction",
4175            );
4176            let mut req = request.into_request();
4177            req.extensions_mut()
4178                .insert(GrpcMethod::new("sui.rpc.v2.MovePackageService", "GetFunction"));
4179            self.inner.unary(req, path, codec).await
4180        }
4181        pub async fn list_package_versions(
4182            &mut self,
4183            request: impl tonic::IntoRequest<super::ListPackageVersionsRequest>,
4184        ) -> std::result::Result<
4185            tonic::Response<super::ListPackageVersionsResponse>,
4186            tonic::Status,
4187        > {
4188            self.inner
4189                .ready()
4190                .await
4191                .map_err(|e| {
4192                    tonic::Status::unknown(
4193                        format!("Service was not ready: {}", e.into()),
4194                    )
4195                })?;
4196            let codec = tonic_prost::ProstCodec::default();
4197            let path = http::uri::PathAndQuery::from_static(
4198                "/sui.rpc.v2.MovePackageService/ListPackageVersions",
4199            );
4200            let mut req = request.into_request();
4201            req.extensions_mut()
4202                .insert(
4203                    GrpcMethod::new(
4204                        "sui.rpc.v2.MovePackageService",
4205                        "ListPackageVersions",
4206                    ),
4207                );
4208            self.inner.unary(req, path, codec).await
4209        }
4210    }
4211}
4212/// Generated server implementations.
4213pub mod move_package_service_server {
4214    #![allow(
4215        unused_variables,
4216        dead_code,
4217        missing_docs,
4218        clippy::wildcard_imports,
4219        clippy::let_unit_value,
4220    )]
4221    use tonic::codegen::*;
4222    /// Generated trait containing gRPC methods that should be implemented for use with MovePackageServiceServer.
4223    #[async_trait]
4224    pub trait MovePackageService: std::marker::Send + std::marker::Sync + 'static {
4225        async fn get_package(
4226            &self,
4227            request: tonic::Request<super::GetPackageRequest>,
4228        ) -> std::result::Result<
4229            tonic::Response<super::GetPackageResponse>,
4230            tonic::Status,
4231        > {
4232            Err(tonic::Status::unimplemented("Not yet implemented"))
4233        }
4234        async fn get_datatype(
4235            &self,
4236            request: tonic::Request<super::GetDatatypeRequest>,
4237        ) -> std::result::Result<
4238            tonic::Response<super::GetDatatypeResponse>,
4239            tonic::Status,
4240        > {
4241            Err(tonic::Status::unimplemented("Not yet implemented"))
4242        }
4243        async fn get_function(
4244            &self,
4245            request: tonic::Request<super::GetFunctionRequest>,
4246        ) -> std::result::Result<
4247            tonic::Response<super::GetFunctionResponse>,
4248            tonic::Status,
4249        > {
4250            Err(tonic::Status::unimplemented("Not yet implemented"))
4251        }
4252        async fn list_package_versions(
4253            &self,
4254            request: tonic::Request<super::ListPackageVersionsRequest>,
4255        ) -> std::result::Result<
4256            tonic::Response<super::ListPackageVersionsResponse>,
4257            tonic::Status,
4258        > {
4259            Err(tonic::Status::unimplemented("Not yet implemented"))
4260        }
4261    }
4262    #[derive(Debug)]
4263    pub struct MovePackageServiceServer<T> {
4264        inner: Arc<T>,
4265        accept_compression_encodings: EnabledCompressionEncodings,
4266        send_compression_encodings: EnabledCompressionEncodings,
4267        max_decoding_message_size: Option<usize>,
4268        max_encoding_message_size: Option<usize>,
4269    }
4270    impl<T> MovePackageServiceServer<T> {
4271        pub fn new(inner: T) -> Self {
4272            Self::from_arc(Arc::new(inner))
4273        }
4274        pub fn from_arc(inner: Arc<T>) -> Self {
4275            Self {
4276                inner,
4277                accept_compression_encodings: Default::default(),
4278                send_compression_encodings: Default::default(),
4279                max_decoding_message_size: None,
4280                max_encoding_message_size: None,
4281            }
4282        }
4283        pub fn with_interceptor<F>(
4284            inner: T,
4285            interceptor: F,
4286        ) -> InterceptedService<Self, F>
4287        where
4288            F: tonic::service::Interceptor,
4289        {
4290            InterceptedService::new(Self::new(inner), interceptor)
4291        }
4292        /// Enable decompressing requests with the given encoding.
4293        #[must_use]
4294        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4295            self.accept_compression_encodings.enable(encoding);
4296            self
4297        }
4298        /// Compress responses with the given encoding, if the client supports it.
4299        #[must_use]
4300        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4301            self.send_compression_encodings.enable(encoding);
4302            self
4303        }
4304        /// Limits the maximum size of a decoded message.
4305        ///
4306        /// Default: `4MB`
4307        #[must_use]
4308        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4309            self.max_decoding_message_size = Some(limit);
4310            self
4311        }
4312        /// Limits the maximum size of an encoded message.
4313        ///
4314        /// Default: `usize::MAX`
4315        #[must_use]
4316        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4317            self.max_encoding_message_size = Some(limit);
4318            self
4319        }
4320    }
4321    impl<T, B> tonic::codegen::Service<http::Request<B>> for MovePackageServiceServer<T>
4322    where
4323        T: MovePackageService,
4324        B: Body + std::marker::Send + 'static,
4325        B::Error: Into<StdError> + std::marker::Send + 'static,
4326    {
4327        type Response = http::Response<tonic::body::Body>;
4328        type Error = std::convert::Infallible;
4329        type Future = BoxFuture<Self::Response, Self::Error>;
4330        fn poll_ready(
4331            &mut self,
4332            _cx: &mut Context<'_>,
4333        ) -> Poll<std::result::Result<(), Self::Error>> {
4334            Poll::Ready(Ok(()))
4335        }
4336        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4337            match req.uri().path() {
4338                "/sui.rpc.v2.MovePackageService/GetPackage" => {
4339                    #[allow(non_camel_case_types)]
4340                    struct GetPackageSvc<T: MovePackageService>(pub Arc<T>);
4341                    impl<
4342                        T: MovePackageService,
4343                    > tonic::server::UnaryService<super::GetPackageRequest>
4344                    for GetPackageSvc<T> {
4345                        type Response = super::GetPackageResponse;
4346                        type Future = BoxFuture<
4347                            tonic::Response<Self::Response>,
4348                            tonic::Status,
4349                        >;
4350                        fn call(
4351                            &mut self,
4352                            request: tonic::Request<super::GetPackageRequest>,
4353                        ) -> Self::Future {
4354                            let inner = Arc::clone(&self.0);
4355                            let fut = async move {
4356                                <T as MovePackageService>::get_package(&inner, request)
4357                                    .await
4358                            };
4359                            Box::pin(fut)
4360                        }
4361                    }
4362                    let accept_compression_encodings = self.accept_compression_encodings;
4363                    let send_compression_encodings = self.send_compression_encodings;
4364                    let max_decoding_message_size = self.max_decoding_message_size;
4365                    let max_encoding_message_size = self.max_encoding_message_size;
4366                    let inner = self.inner.clone();
4367                    let fut = async move {
4368                        let method = GetPackageSvc(inner);
4369                        let codec = tonic_prost::ProstCodec::default();
4370                        let mut grpc = tonic::server::Grpc::new(codec)
4371                            .apply_compression_config(
4372                                accept_compression_encodings,
4373                                send_compression_encodings,
4374                            )
4375                            .apply_max_message_size_config(
4376                                max_decoding_message_size,
4377                                max_encoding_message_size,
4378                            );
4379                        let res = grpc.unary(method, req).await;
4380                        Ok(res)
4381                    };
4382                    Box::pin(fut)
4383                }
4384                "/sui.rpc.v2.MovePackageService/GetDatatype" => {
4385                    #[allow(non_camel_case_types)]
4386                    struct GetDatatypeSvc<T: MovePackageService>(pub Arc<T>);
4387                    impl<
4388                        T: MovePackageService,
4389                    > tonic::server::UnaryService<super::GetDatatypeRequest>
4390                    for GetDatatypeSvc<T> {
4391                        type Response = super::GetDatatypeResponse;
4392                        type Future = BoxFuture<
4393                            tonic::Response<Self::Response>,
4394                            tonic::Status,
4395                        >;
4396                        fn call(
4397                            &mut self,
4398                            request: tonic::Request<super::GetDatatypeRequest>,
4399                        ) -> Self::Future {
4400                            let inner = Arc::clone(&self.0);
4401                            let fut = async move {
4402                                <T as MovePackageService>::get_datatype(&inner, request)
4403                                    .await
4404                            };
4405                            Box::pin(fut)
4406                        }
4407                    }
4408                    let accept_compression_encodings = self.accept_compression_encodings;
4409                    let send_compression_encodings = self.send_compression_encodings;
4410                    let max_decoding_message_size = self.max_decoding_message_size;
4411                    let max_encoding_message_size = self.max_encoding_message_size;
4412                    let inner = self.inner.clone();
4413                    let fut = async move {
4414                        let method = GetDatatypeSvc(inner);
4415                        let codec = tonic_prost::ProstCodec::default();
4416                        let mut grpc = tonic::server::Grpc::new(codec)
4417                            .apply_compression_config(
4418                                accept_compression_encodings,
4419                                send_compression_encodings,
4420                            )
4421                            .apply_max_message_size_config(
4422                                max_decoding_message_size,
4423                                max_encoding_message_size,
4424                            );
4425                        let res = grpc.unary(method, req).await;
4426                        Ok(res)
4427                    };
4428                    Box::pin(fut)
4429                }
4430                "/sui.rpc.v2.MovePackageService/GetFunction" => {
4431                    #[allow(non_camel_case_types)]
4432                    struct GetFunctionSvc<T: MovePackageService>(pub Arc<T>);
4433                    impl<
4434                        T: MovePackageService,
4435                    > tonic::server::UnaryService<super::GetFunctionRequest>
4436                    for GetFunctionSvc<T> {
4437                        type Response = super::GetFunctionResponse;
4438                        type Future = BoxFuture<
4439                            tonic::Response<Self::Response>,
4440                            tonic::Status,
4441                        >;
4442                        fn call(
4443                            &mut self,
4444                            request: tonic::Request<super::GetFunctionRequest>,
4445                        ) -> Self::Future {
4446                            let inner = Arc::clone(&self.0);
4447                            let fut = async move {
4448                                <T as MovePackageService>::get_function(&inner, request)
4449                                    .await
4450                            };
4451                            Box::pin(fut)
4452                        }
4453                    }
4454                    let accept_compression_encodings = self.accept_compression_encodings;
4455                    let send_compression_encodings = self.send_compression_encodings;
4456                    let max_decoding_message_size = self.max_decoding_message_size;
4457                    let max_encoding_message_size = self.max_encoding_message_size;
4458                    let inner = self.inner.clone();
4459                    let fut = async move {
4460                        let method = GetFunctionSvc(inner);
4461                        let codec = tonic_prost::ProstCodec::default();
4462                        let mut grpc = tonic::server::Grpc::new(codec)
4463                            .apply_compression_config(
4464                                accept_compression_encodings,
4465                                send_compression_encodings,
4466                            )
4467                            .apply_max_message_size_config(
4468                                max_decoding_message_size,
4469                                max_encoding_message_size,
4470                            );
4471                        let res = grpc.unary(method, req).await;
4472                        Ok(res)
4473                    };
4474                    Box::pin(fut)
4475                }
4476                "/sui.rpc.v2.MovePackageService/ListPackageVersions" => {
4477                    #[allow(non_camel_case_types)]
4478                    struct ListPackageVersionsSvc<T: MovePackageService>(pub Arc<T>);
4479                    impl<
4480                        T: MovePackageService,
4481                    > tonic::server::UnaryService<super::ListPackageVersionsRequest>
4482                    for ListPackageVersionsSvc<T> {
4483                        type Response = super::ListPackageVersionsResponse;
4484                        type Future = BoxFuture<
4485                            tonic::Response<Self::Response>,
4486                            tonic::Status,
4487                        >;
4488                        fn call(
4489                            &mut self,
4490                            request: tonic::Request<super::ListPackageVersionsRequest>,
4491                        ) -> Self::Future {
4492                            let inner = Arc::clone(&self.0);
4493                            let fut = async move {
4494                                <T as MovePackageService>::list_package_versions(
4495                                        &inner,
4496                                        request,
4497                                    )
4498                                    .await
4499                            };
4500                            Box::pin(fut)
4501                        }
4502                    }
4503                    let accept_compression_encodings = self.accept_compression_encodings;
4504                    let send_compression_encodings = self.send_compression_encodings;
4505                    let max_decoding_message_size = self.max_decoding_message_size;
4506                    let max_encoding_message_size = self.max_encoding_message_size;
4507                    let inner = self.inner.clone();
4508                    let fut = async move {
4509                        let method = ListPackageVersionsSvc(inner);
4510                        let codec = tonic_prost::ProstCodec::default();
4511                        let mut grpc = tonic::server::Grpc::new(codec)
4512                            .apply_compression_config(
4513                                accept_compression_encodings,
4514                                send_compression_encodings,
4515                            )
4516                            .apply_max_message_size_config(
4517                                max_decoding_message_size,
4518                                max_encoding_message_size,
4519                            );
4520                        let res = grpc.unary(method, req).await;
4521                        Ok(res)
4522                    };
4523                    Box::pin(fut)
4524                }
4525                _ => {
4526                    Box::pin(async move {
4527                        let mut response = http::Response::new(
4528                            tonic::body::Body::default(),
4529                        );
4530                        let headers = response.headers_mut();
4531                        headers
4532                            .insert(
4533                                tonic::Status::GRPC_STATUS,
4534                                (tonic::Code::Unimplemented as i32).into(),
4535                            );
4536                        headers
4537                            .insert(
4538                                http::header::CONTENT_TYPE,
4539                                tonic::metadata::GRPC_CONTENT_TYPE,
4540                            );
4541                        Ok(response)
4542                    })
4543                }
4544            }
4545        }
4546    }
4547    impl<T> Clone for MovePackageServiceServer<T> {
4548        fn clone(&self) -> Self {
4549            let inner = self.inner.clone();
4550            Self {
4551                inner,
4552                accept_compression_encodings: self.accept_compression_encodings,
4553                send_compression_encodings: self.send_compression_encodings,
4554                max_decoding_message_size: self.max_decoding_message_size,
4555                max_encoding_message_size: self.max_encoding_message_size,
4556            }
4557        }
4558    }
4559    /// Generated gRPC service name
4560    pub const SERVICE_NAME: &str = "sui.rpc.v2.MovePackageService";
4561    impl<T> tonic::server::NamedService for MovePackageServiceServer<T> {
4562        const NAME: &'static str = SERVICE_NAME;
4563    }
4564}
4565#[non_exhaustive]
4566#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4567pub struct LookupNameRequest {
4568    /// Required. The SuiNS name to lookup.
4569    ///
4570    /// Supports both `@name` as well as `name.sui` formats.
4571    #[prost(string, optional, tag = "1")]
4572    pub name: ::core::option::Option<::prost::alloc::string::String>,
4573}
4574#[non_exhaustive]
4575#[derive(Clone, PartialEq, ::prost::Message)]
4576pub struct LookupNameResponse {
4577    /// The record for the requested name
4578    #[prost(message, optional, tag = "1")]
4579    pub record: ::core::option::Option<NameRecord>,
4580}
4581#[non_exhaustive]
4582#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4583pub struct ReverseLookupNameRequest {
4584    /// Required. The address to perform a reverse lookup for.
4585    #[prost(string, optional, tag = "1")]
4586    pub address: ::core::option::Option<::prost::alloc::string::String>,
4587}
4588#[non_exhaustive]
4589#[derive(Clone, PartialEq, ::prost::Message)]
4590pub struct ReverseLookupNameResponse {
4591    /// The record for the SuiNS name linked to the requested address
4592    #[prost(message, optional, tag = "1")]
4593    pub record: ::core::option::Option<NameRecord>,
4594}
4595#[non_exhaustive]
4596#[derive(Clone, PartialEq, ::prost::Message)]
4597pub struct NameRecord {
4598    /// Id of this record.
4599    ///
4600    /// Note that records are stored on chain as dynamic fields of the type
4601    /// `Field<Domain,NameRecord>`.
4602    #[prost(string, optional, tag = "1")]
4603    pub id: ::core::option::Option<::prost::alloc::string::String>,
4604    /// The SuiNS name of this record
4605    #[prost(string, optional, tag = "2")]
4606    pub name: ::core::option::Option<::prost::alloc::string::String>,
4607    /// The ID of the `RegistrationNFT` assigned to this record.
4608    ///
4609    /// The owner of the corresponding `RegistrationNFT` has the rights to
4610    /// be able to change and adjust the `target_address` of this domain.
4611    ///
4612    /// It is possible that the ID changes if the record expires and is
4613    /// purchased by someone else.
4614    #[prost(string, optional, tag = "3")]
4615    pub registration_nft_id: ::core::option::Option<::prost::alloc::string::String>,
4616    /// Timestamp when the record expires.
4617    ///
4618    /// This is either the expiration of the record itself or the expiration of
4619    /// this record's parent if this is a leaf record.
4620    #[prost(message, optional, tag = "4")]
4621    pub expiration_timestamp: ::core::option::Option<::prost_types::Timestamp>,
4622    /// The target address that this name points to
4623    #[prost(string, optional, tag = "5")]
4624    pub target_address: ::core::option::Option<::prost::alloc::string::String>,
4625    /// Additional data which may be stored in a record
4626    #[prost(btree_map = "string, string", tag = "6")]
4627    pub data: ::prost::alloc::collections::BTreeMap<
4628        ::prost::alloc::string::String,
4629        ::prost::alloc::string::String,
4630    >,
4631}
4632/// Generated client implementations.
4633pub mod name_service_client {
4634    #![allow(
4635        unused_variables,
4636        dead_code,
4637        missing_docs,
4638        clippy::wildcard_imports,
4639        clippy::let_unit_value,
4640    )]
4641    use tonic::codegen::*;
4642    use tonic::codegen::http::Uri;
4643    #[derive(Debug, Clone)]
4644    pub struct NameServiceClient<T> {
4645        inner: tonic::client::Grpc<T>,
4646    }
4647    impl NameServiceClient<tonic::transport::Channel> {
4648        /// Attempt to create a new client by connecting to a given endpoint.
4649        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
4650        where
4651            D: TryInto<tonic::transport::Endpoint>,
4652            D::Error: Into<StdError>,
4653        {
4654            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
4655            Ok(Self::new(conn))
4656        }
4657    }
4658    impl<T> NameServiceClient<T>
4659    where
4660        T: tonic::client::GrpcService<tonic::body::Body>,
4661        T::Error: Into<StdError>,
4662        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
4663        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
4664    {
4665        pub fn new(inner: T) -> Self {
4666            let inner = tonic::client::Grpc::new(inner);
4667            Self { inner }
4668        }
4669        pub fn with_origin(inner: T, origin: Uri) -> Self {
4670            let inner = tonic::client::Grpc::with_origin(inner, origin);
4671            Self { inner }
4672        }
4673        pub fn with_interceptor<F>(
4674            inner: T,
4675            interceptor: F,
4676        ) -> NameServiceClient<InterceptedService<T, F>>
4677        where
4678            F: tonic::service::Interceptor,
4679            T::ResponseBody: Default,
4680            T: tonic::codegen::Service<
4681                http::Request<tonic::body::Body>,
4682                Response = http::Response<
4683                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
4684                >,
4685            >,
4686            <T as tonic::codegen::Service<
4687                http::Request<tonic::body::Body>,
4688            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
4689        {
4690            NameServiceClient::new(InterceptedService::new(inner, interceptor))
4691        }
4692        /// Compress requests with the given encoding.
4693        ///
4694        /// This requires the server to support it otherwise it might respond with an
4695        /// error.
4696        #[must_use]
4697        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4698            self.inner = self.inner.send_compressed(encoding);
4699            self
4700        }
4701        /// Enable decompressing responses.
4702        #[must_use]
4703        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4704            self.inner = self.inner.accept_compressed(encoding);
4705            self
4706        }
4707        /// Limits the maximum size of a decoded message.
4708        ///
4709        /// Default: `4MB`
4710        #[must_use]
4711        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4712            self.inner = self.inner.max_decoding_message_size(limit);
4713            self
4714        }
4715        /// Limits the maximum size of an encoded message.
4716        ///
4717        /// Default: `usize::MAX`
4718        #[must_use]
4719        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4720            self.inner = self.inner.max_encoding_message_size(limit);
4721            self
4722        }
4723        pub async fn lookup_name(
4724            &mut self,
4725            request: impl tonic::IntoRequest<super::LookupNameRequest>,
4726        ) -> std::result::Result<
4727            tonic::Response<super::LookupNameResponse>,
4728            tonic::Status,
4729        > {
4730            self.inner
4731                .ready()
4732                .await
4733                .map_err(|e| {
4734                    tonic::Status::unknown(
4735                        format!("Service was not ready: {}", e.into()),
4736                    )
4737                })?;
4738            let codec = tonic_prost::ProstCodec::default();
4739            let path = http::uri::PathAndQuery::from_static(
4740                "/sui.rpc.v2.NameService/LookupName",
4741            );
4742            let mut req = request.into_request();
4743            req.extensions_mut()
4744                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "LookupName"));
4745            self.inner.unary(req, path, codec).await
4746        }
4747        pub async fn reverse_lookup_name(
4748            &mut self,
4749            request: impl tonic::IntoRequest<super::ReverseLookupNameRequest>,
4750        ) -> std::result::Result<
4751            tonic::Response<super::ReverseLookupNameResponse>,
4752            tonic::Status,
4753        > {
4754            self.inner
4755                .ready()
4756                .await
4757                .map_err(|e| {
4758                    tonic::Status::unknown(
4759                        format!("Service was not ready: {}", e.into()),
4760                    )
4761                })?;
4762            let codec = tonic_prost::ProstCodec::default();
4763            let path = http::uri::PathAndQuery::from_static(
4764                "/sui.rpc.v2.NameService/ReverseLookupName",
4765            );
4766            let mut req = request.into_request();
4767            req.extensions_mut()
4768                .insert(GrpcMethod::new("sui.rpc.v2.NameService", "ReverseLookupName"));
4769            self.inner.unary(req, path, codec).await
4770        }
4771    }
4772}
4773/// Generated server implementations.
4774pub mod name_service_server {
4775    #![allow(
4776        unused_variables,
4777        dead_code,
4778        missing_docs,
4779        clippy::wildcard_imports,
4780        clippy::let_unit_value,
4781    )]
4782    use tonic::codegen::*;
4783    /// Generated trait containing gRPC methods that should be implemented for use with NameServiceServer.
4784    #[async_trait]
4785    pub trait NameService: std::marker::Send + std::marker::Sync + 'static {
4786        async fn lookup_name(
4787            &self,
4788            request: tonic::Request<super::LookupNameRequest>,
4789        ) -> std::result::Result<
4790            tonic::Response<super::LookupNameResponse>,
4791            tonic::Status,
4792        > {
4793            Err(tonic::Status::unimplemented("Not yet implemented"))
4794        }
4795        async fn reverse_lookup_name(
4796            &self,
4797            request: tonic::Request<super::ReverseLookupNameRequest>,
4798        ) -> std::result::Result<
4799            tonic::Response<super::ReverseLookupNameResponse>,
4800            tonic::Status,
4801        > {
4802            Err(tonic::Status::unimplemented("Not yet implemented"))
4803        }
4804    }
4805    #[derive(Debug)]
4806    pub struct NameServiceServer<T> {
4807        inner: Arc<T>,
4808        accept_compression_encodings: EnabledCompressionEncodings,
4809        send_compression_encodings: EnabledCompressionEncodings,
4810        max_decoding_message_size: Option<usize>,
4811        max_encoding_message_size: Option<usize>,
4812    }
4813    impl<T> NameServiceServer<T> {
4814        pub fn new(inner: T) -> Self {
4815            Self::from_arc(Arc::new(inner))
4816        }
4817        pub fn from_arc(inner: Arc<T>) -> Self {
4818            Self {
4819                inner,
4820                accept_compression_encodings: Default::default(),
4821                send_compression_encodings: Default::default(),
4822                max_decoding_message_size: None,
4823                max_encoding_message_size: None,
4824            }
4825        }
4826        pub fn with_interceptor<F>(
4827            inner: T,
4828            interceptor: F,
4829        ) -> InterceptedService<Self, F>
4830        where
4831            F: tonic::service::Interceptor,
4832        {
4833            InterceptedService::new(Self::new(inner), interceptor)
4834        }
4835        /// Enable decompressing requests with the given encoding.
4836        #[must_use]
4837        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
4838            self.accept_compression_encodings.enable(encoding);
4839            self
4840        }
4841        /// Compress responses with the given encoding, if the client supports it.
4842        #[must_use]
4843        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
4844            self.send_compression_encodings.enable(encoding);
4845            self
4846        }
4847        /// Limits the maximum size of a decoded message.
4848        ///
4849        /// Default: `4MB`
4850        #[must_use]
4851        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
4852            self.max_decoding_message_size = Some(limit);
4853            self
4854        }
4855        /// Limits the maximum size of an encoded message.
4856        ///
4857        /// Default: `usize::MAX`
4858        #[must_use]
4859        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
4860            self.max_encoding_message_size = Some(limit);
4861            self
4862        }
4863    }
4864    impl<T, B> tonic::codegen::Service<http::Request<B>> for NameServiceServer<T>
4865    where
4866        T: NameService,
4867        B: Body + std::marker::Send + 'static,
4868        B::Error: Into<StdError> + std::marker::Send + 'static,
4869    {
4870        type Response = http::Response<tonic::body::Body>;
4871        type Error = std::convert::Infallible;
4872        type Future = BoxFuture<Self::Response, Self::Error>;
4873        fn poll_ready(
4874            &mut self,
4875            _cx: &mut Context<'_>,
4876        ) -> Poll<std::result::Result<(), Self::Error>> {
4877            Poll::Ready(Ok(()))
4878        }
4879        fn call(&mut self, req: http::Request<B>) -> Self::Future {
4880            match req.uri().path() {
4881                "/sui.rpc.v2.NameService/LookupName" => {
4882                    #[allow(non_camel_case_types)]
4883                    struct LookupNameSvc<T: NameService>(pub Arc<T>);
4884                    impl<
4885                        T: NameService,
4886                    > tonic::server::UnaryService<super::LookupNameRequest>
4887                    for LookupNameSvc<T> {
4888                        type Response = super::LookupNameResponse;
4889                        type Future = BoxFuture<
4890                            tonic::Response<Self::Response>,
4891                            tonic::Status,
4892                        >;
4893                        fn call(
4894                            &mut self,
4895                            request: tonic::Request<super::LookupNameRequest>,
4896                        ) -> Self::Future {
4897                            let inner = Arc::clone(&self.0);
4898                            let fut = async move {
4899                                <T as NameService>::lookup_name(&inner, request).await
4900                            };
4901                            Box::pin(fut)
4902                        }
4903                    }
4904                    let accept_compression_encodings = self.accept_compression_encodings;
4905                    let send_compression_encodings = self.send_compression_encodings;
4906                    let max_decoding_message_size = self.max_decoding_message_size;
4907                    let max_encoding_message_size = self.max_encoding_message_size;
4908                    let inner = self.inner.clone();
4909                    let fut = async move {
4910                        let method = LookupNameSvc(inner);
4911                        let codec = tonic_prost::ProstCodec::default();
4912                        let mut grpc = tonic::server::Grpc::new(codec)
4913                            .apply_compression_config(
4914                                accept_compression_encodings,
4915                                send_compression_encodings,
4916                            )
4917                            .apply_max_message_size_config(
4918                                max_decoding_message_size,
4919                                max_encoding_message_size,
4920                            );
4921                        let res = grpc.unary(method, req).await;
4922                        Ok(res)
4923                    };
4924                    Box::pin(fut)
4925                }
4926                "/sui.rpc.v2.NameService/ReverseLookupName" => {
4927                    #[allow(non_camel_case_types)]
4928                    struct ReverseLookupNameSvc<T: NameService>(pub Arc<T>);
4929                    impl<
4930                        T: NameService,
4931                    > tonic::server::UnaryService<super::ReverseLookupNameRequest>
4932                    for ReverseLookupNameSvc<T> {
4933                        type Response = super::ReverseLookupNameResponse;
4934                        type Future = BoxFuture<
4935                            tonic::Response<Self::Response>,
4936                            tonic::Status,
4937                        >;
4938                        fn call(
4939                            &mut self,
4940                            request: tonic::Request<super::ReverseLookupNameRequest>,
4941                        ) -> Self::Future {
4942                            let inner = Arc::clone(&self.0);
4943                            let fut = async move {
4944                                <T as NameService>::reverse_lookup_name(&inner, request)
4945                                    .await
4946                            };
4947                            Box::pin(fut)
4948                        }
4949                    }
4950                    let accept_compression_encodings = self.accept_compression_encodings;
4951                    let send_compression_encodings = self.send_compression_encodings;
4952                    let max_decoding_message_size = self.max_decoding_message_size;
4953                    let max_encoding_message_size = self.max_encoding_message_size;
4954                    let inner = self.inner.clone();
4955                    let fut = async move {
4956                        let method = ReverseLookupNameSvc(inner);
4957                        let codec = tonic_prost::ProstCodec::default();
4958                        let mut grpc = tonic::server::Grpc::new(codec)
4959                            .apply_compression_config(
4960                                accept_compression_encodings,
4961                                send_compression_encodings,
4962                            )
4963                            .apply_max_message_size_config(
4964                                max_decoding_message_size,
4965                                max_encoding_message_size,
4966                            );
4967                        let res = grpc.unary(method, req).await;
4968                        Ok(res)
4969                    };
4970                    Box::pin(fut)
4971                }
4972                _ => {
4973                    Box::pin(async move {
4974                        let mut response = http::Response::new(
4975                            tonic::body::Body::default(),
4976                        );
4977                        let headers = response.headers_mut();
4978                        headers
4979                            .insert(
4980                                tonic::Status::GRPC_STATUS,
4981                                (tonic::Code::Unimplemented as i32).into(),
4982                            );
4983                        headers
4984                            .insert(
4985                                http::header::CONTENT_TYPE,
4986                                tonic::metadata::GRPC_CONTENT_TYPE,
4987                            );
4988                        Ok(response)
4989                    })
4990                }
4991            }
4992        }
4993    }
4994    impl<T> Clone for NameServiceServer<T> {
4995        fn clone(&self) -> Self {
4996            let inner = self.inner.clone();
4997            Self {
4998                inner,
4999                accept_compression_encodings: self.accept_compression_encodings,
5000                send_compression_encodings: self.send_compression_encodings,
5001                max_decoding_message_size: self.max_decoding_message_size,
5002                max_encoding_message_size: self.max_encoding_message_size,
5003            }
5004        }
5005    }
5006    /// Generated gRPC service name
5007    pub const SERVICE_NAME: &str = "sui.rpc.v2.NameService";
5008    impl<T> tonic::server::NamedService for NameServiceServer<T> {
5009        const NAME: &'static str = SERVICE_NAME;
5010    }
5011}
5012/// An object on the Sui blockchain.
5013#[non_exhaustive]
5014#[derive(Clone, PartialEq, ::prost::Message)]
5015pub struct Object {
5016    /// This Object serialized as BCS.
5017    #[prost(message, optional, tag = "1")]
5018    pub bcs: ::core::option::Option<Bcs>,
5019    /// `ObjectId` for this object.
5020    #[prost(string, optional, tag = "2")]
5021    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5022    /// Version of the object.
5023    #[prost(uint64, optional, tag = "3")]
5024    pub version: ::core::option::Option<u64>,
5025    /// The digest of this Object.
5026    #[prost(string, optional, tag = "4")]
5027    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5028    /// Owner of the object.
5029    #[prost(message, optional, tag = "5")]
5030    pub owner: ::core::option::Option<Owner>,
5031    /// The type of this object.
5032    ///
5033    /// This will be 'package' for packages and a StructTag for move structs.
5034    #[prost(string, optional, tag = "6")]
5035    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
5036    /// DEPRECATED this field is no longer used to determine whether a tx can transfer this
5037    /// object. Instead, it is always calculated from the objects type when loaded in execution.
5038    ///
5039    /// Only set for Move structs
5040    #[prost(bool, optional, tag = "7")]
5041    pub has_public_transfer: ::core::option::Option<bool>,
5042    /// BCS bytes of a Move struct value.
5043    ///
5044    /// Only set for Move structs
5045    #[prost(message, optional, tag = "8")]
5046    pub contents: ::core::option::Option<Bcs>,
5047    /// Package information for Move Packages
5048    #[prost(message, optional, tag = "9")]
5049    pub package: ::core::option::Option<Package>,
5050    /// The digest of the transaction that created or last mutated this object
5051    #[prost(string, optional, tag = "10")]
5052    pub previous_transaction: ::core::option::Option<::prost::alloc::string::String>,
5053    /// The amount of SUI to rebate if this object gets deleted.
5054    /// This number is re-calculated each time the object is mutated based on
5055    /// the present storage gas price.
5056    #[prost(uint64, optional, tag = "11")]
5057    pub storage_rebate: ::core::option::Option<u64>,
5058    /// JSON rendering of the object.
5059    #[prost(message, optional, boxed, tag = "100")]
5060    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
5061    /// Current balance if this object is a `0x2::coin::Coin<T>`
5062    #[prost(uint64, optional, tag = "101")]
5063    pub balance: ::core::option::Option<u64>,
5064    /// JSON rendering of the object based on an on-chain template.
5065    /// This will not be set if the value's type does not have an associated `Display` template.
5066    #[prost(message, optional, boxed, tag = "102")]
5067    pub display: ::core::option::Option<::prost::alloc::boxed::Box<Display>>,
5068}
5069/// Set of Objects
5070#[non_exhaustive]
5071#[derive(Clone, PartialEq, ::prost::Message)]
5072pub struct ObjectSet {
5073    /// Objects are sorted by the key `(object_id, version)`.
5074    #[prost(message, repeated, tag = "1")]
5075    pub objects: ::prost::alloc::vec::Vec<Object>,
5076}
5077/// A rendered JSON blob based on an on-chain template.
5078#[non_exhaustive]
5079#[derive(Clone, PartialEq, ::prost::Message)]
5080pub struct Display {
5081    /// Output for all successfully substituted display fields. Unsuccessful
5082    /// fields will be `null`, and will be accompanied by a field in `errors`,
5083    /// explaining the error.
5084    #[prost(message, optional, tag = "1")]
5085    pub output: ::core::option::Option<::prost_types::Value>,
5086    /// If any fields failed to render, this will contain a mapping from failed
5087    /// field names to error messages. If all fields succeed, this will either be
5088    /// `null` or not set.
5089    #[prost(message, optional, tag = "2")]
5090    pub errors: ::core::option::Option<::prost_types::Value>,
5091}
5092/// Reference to an object.
5093#[non_exhaustive]
5094#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5095pub struct ObjectReference {
5096    /// The object id of this object.
5097    #[prost(string, optional, tag = "1")]
5098    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
5099    /// The version of this object.
5100    #[prost(uint64, optional, tag = "2")]
5101    pub version: ::core::option::Option<u64>,
5102    /// The digest of this object.
5103    #[prost(string, optional, tag = "3")]
5104    pub digest: ::core::option::Option<::prost::alloc::string::String>,
5105}
5106/// Enum of different types of ownership for an object.
5107#[non_exhaustive]
5108#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5109pub struct Owner {
5110    #[prost(enumeration = "owner::OwnerKind", optional, tag = "1")]
5111    pub kind: ::core::option::Option<i32>,
5112    /// Address or ObjectId of the owner
5113    #[prost(string, optional, tag = "2")]
5114    pub address: ::core::option::Option<::prost::alloc::string::String>,
5115    /// The `initial_shared_version` if kind is `SHARED` or `start_version` if kind `CONSENSUS_ADDRESS`.
5116    #[prost(uint64, optional, tag = "3")]
5117    pub version: ::core::option::Option<u64>,
5118}
5119/// Nested message and enum types in `Owner`.
5120pub mod owner {
5121    #[non_exhaustive]
5122    #[derive(
5123        Clone,
5124        Copy,
5125        Debug,
5126        PartialEq,
5127        Eq,
5128        Hash,
5129        PartialOrd,
5130        Ord,
5131        ::prost::Enumeration
5132    )]
5133    #[repr(i32)]
5134    pub enum OwnerKind {
5135        Unknown = 0,
5136        Address = 1,
5137        Object = 2,
5138        Shared = 3,
5139        Immutable = 4,
5140        ConsensusAddress = 5,
5141    }
5142    impl OwnerKind {
5143        /// String value of the enum field names used in the ProtoBuf definition.
5144        ///
5145        /// The values are not transformed in any way and thus are considered stable
5146        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5147        pub fn as_str_name(&self) -> &'static str {
5148            match self {
5149                Self::Unknown => "OWNER_KIND_UNKNOWN",
5150                Self::Address => "ADDRESS",
5151                Self::Object => "OBJECT",
5152                Self::Shared => "SHARED",
5153                Self::Immutable => "IMMUTABLE",
5154                Self::ConsensusAddress => "CONSENSUS_ADDRESS",
5155            }
5156        }
5157        /// Creates an enum from field names used in the ProtoBuf definition.
5158        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5159            match value {
5160                "OWNER_KIND_UNKNOWN" => Some(Self::Unknown),
5161                "ADDRESS" => Some(Self::Address),
5162                "OBJECT" => Some(Self::Object),
5163                "SHARED" => Some(Self::Shared),
5164                "IMMUTABLE" => Some(Self::Immutable),
5165                "CONSENSUS_ADDRESS" => Some(Self::ConsensusAddress),
5166                _ => None,
5167            }
5168        }
5169    }
5170}
5171#[non_exhaustive]
5172#[derive(Clone, PartialEq, ::prost::Message)]
5173pub struct ProtocolConfig {
5174    #[prost(uint64, optional, tag = "1")]
5175    pub protocol_version: ::core::option::Option<u64>,
5176    /// Deprecated in favor of the lossless `configs` field.
5177    #[prost(btree_map = "string, bool", tag = "2")]
5178    pub feature_flags: ::prost::alloc::collections::BTreeMap<
5179        ::prost::alloc::string::String,
5180        bool,
5181    >,
5182    /// Deprecated in favor of the lossless `configs` field.
5183    #[prost(btree_map = "string, string", tag = "3")]
5184    pub attributes: ::prost::alloc::collections::BTreeMap<
5185        ::prost::alloc::string::String,
5186        ::prost::alloc::string::String,
5187    >,
5188    #[prost(btree_map = "string, message", tag = "4")]
5189    pub configs: ::prost::alloc::collections::BTreeMap<
5190        ::prost::alloc::string::String,
5191        ::prost_types::Value,
5192    >,
5193}
5194/// Cursor-bounded query options.
5195///
5196/// `after` and `before` are canonical ledger-position bounds, not
5197/// ordering-relative cursors. `after` always excludes items at or below that
5198/// cursor, and `before` always excludes items at or above that cursor. Ordering
5199/// only controls the order of returned items within the resulting open interval.
5200///
5201/// When a request also specifies a checkpoint range, cursor bounds and
5202/// checkpoint bounds compose by intersection: results come only from ledger
5203/// positions inside both. Checkpoint bounds are likewise canonical and
5204/// ordering-independent.
5205///
5206/// For example, with `after = A`, `before = B`, `ordering = DESCENDING`, and
5207/// `limit = N`, the response contains up to N matching items in descending
5208/// order from the interval `(A, B)`. If the response ends with
5209/// `QUERY_END_REASON_ITEM_LIMIT`, resume by keeping `after = A` and setting
5210/// `before` to the last `Watermark.cursor` received. That cursor is the
5211/// lowest position reached in ledger order, so it becomes the next exclusive
5212/// upper bound.
5213#[non_exhaustive]
5214#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5215pub struct QueryOptions {
5216    /// The maximum number of items to return. Each method applies its own default
5217    /// and maximum. QueryEnd does not count against this limit.
5218    #[prost(uint32, optional, tag = "1")]
5219    pub limit: ::core::option::Option<u32>,
5220    /// Opaque exclusive lower bound. Results must be strictly after this cursor in
5221    /// canonical ledger order.
5222    #[prost(bytes = "bytes", optional, tag = "2")]
5223    pub after: ::core::option::Option<::prost::bytes::Bytes>,
5224    /// Opaque exclusive upper bound. Results must be strictly before this cursor
5225    /// in canonical ledger order.
5226    #[prost(bytes = "bytes", optional, tag = "3")]
5227    pub before: ::core::option::Option<::prost::bytes::Bytes>,
5228    /// Ordering for returned results. Defaults to ASCENDING.
5229    ///
5230    /// Ordering only controls the order of results within the bounded interval;
5231    /// cursor bounds keep the same meaning for ascending and descending reads.
5232    #[prost(enumeration = "Ordering", optional, tag = "4")]
5233    pub ordering: ::core::option::Option<i32>,
5234}
5235/// Progress marker for a query scan. Carried on every response frame, whether or
5236/// not the frame delivers a matching item. Watermarks never regress in the
5237/// requested ordering, but consecutive frames may carry the same watermark when
5238/// additional work does not advance the safe resume frontier.
5239#[non_exhaustive]
5240#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5241pub struct Watermark {
5242    /// Opaque cursor at this scan position. Set on every watermark. Use as
5243    /// `options.after` (ascending) or `options.before` (descending) on the next
5244    /// request to resume from here. The most recently received cursor is always
5245    /// the safe resume point.
5246    #[prost(bytes = "bytes", optional, tag = "1")]
5247    pub cursor: ::core::option::Option<::prost::bytes::Bytes>,
5248    /// The inclusive boundary checkpoint that the scan has fully covered within
5249    /// the request's effective interval, in the request's ordering direction: an
5250    /// ascending scan has emitted every matching item in the interval at
5251    /// checkpoints `<= checkpoint` (strictly greater ones may still hold
5252    /// matches); a descending scan has emitted every matching item in the
5253    /// interval at checkpoints `>= checkpoint`. This boundary never regresses in
5254    /// the scan direction, but it may repeat while the cursor advances.
5255    ///
5256    /// Unset until the scan's first checkpoint is fully covered. For example, a
5257    /// scan resumed from a cursor that lands mid-checkpoint leaves this unset
5258    /// until the next checkpoint boundary in the scan direction is fully covered.
5259    /// A watermark still has a valid resume cursor while this field is unset.
5260    #[prost(uint64, optional, tag = "2")]
5261    pub checkpoint: ::core::option::Option<u64>,
5262}
5263/// Marker for the final frame of a successful query stream. Every successful
5264/// stream sets `QueryEnd` on exactly one frame, after which no further frames
5265/// are sent. That frame always carries the final watermark. For `ItemLimit`, it
5266/// also carries the final matching item; for every other reason it carries no
5267/// item. A ScanLimit terminal watermark may repeat the previous frame's cursor
5268/// when its authoritative scan frontier was already emitted; this does not
5269/// repeat an item.
5270///
5271/// A stream that fails or is cancelled terminates with a gRPC status and does
5272/// not send `QueryEnd`.
5273#[non_exhaustive]
5274#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
5275pub struct QueryEnd {
5276    /// Reason this response stopped.
5277    #[prost(enumeration = "QueryEndReason", optional, tag = "1")]
5278    pub reason: ::core::option::Option<i32>,
5279}
5280/// Ordering for the returned result set.
5281#[non_exhaustive]
5282#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5283#[repr(i32)]
5284pub enum Ordering {
5285    /// Return results in increasing cursor order.
5286    Ascending = 0,
5287    /// Return results in decreasing cursor order.
5288    Descending = 1,
5289}
5290impl Ordering {
5291    /// String value of the enum field names used in the ProtoBuf definition.
5292    ///
5293    /// The values are not transformed in any way and thus are considered stable
5294    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5295    pub fn as_str_name(&self) -> &'static str {
5296        match self {
5297            Self::Ascending => "ORDERING_ASCENDING",
5298            Self::Descending => "ORDERING_DESCENDING",
5299        }
5300    }
5301    /// Creates an enum from field names used in the ProtoBuf definition.
5302    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5303        match value {
5304            "ORDERING_ASCENDING" => Some(Self::Ascending),
5305            "ORDERING_DESCENDING" => Some(Self::Descending),
5306            _ => None,
5307        }
5308    }
5309}
5310/// Reason the server stopped this query response.
5311#[non_exhaustive]
5312#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5313#[repr(i32)]
5314pub enum QueryEndReason {
5315    /// The stop reason was not specified.
5316    Unknown = 0,
5317    /// The response reached the requested item limit. The final matching item's
5318    /// frame carries `QueryEnd` and the final watermark. Resume from that frame's
5319    /// `Watermark.cursor` to continue reading the same effective interval.
5320    ItemLimit = 1,
5321    /// The response reached the server's per-request bucket-fetch budget for
5322    /// filtered scans before reaching the effective interval bound. The terminal
5323    /// frame carries no item. Its watermark cursor is the authoritative scan
5324    /// frontier from which to resume.
5325    ScanLimit = 2,
5326    /// The scan reached a requested checkpoint range bound. The terminal frame
5327    /// carries no item.
5328    CheckpointBound = 3,
5329    /// The scan reached an exclusive cursor bound. The terminal frame carries no
5330    /// item. Its watermark cursor represents that resolved bound without claiming
5331    /// that its containing checkpoint was fully covered.
5332    CursorBound = 4,
5333    /// The scan reached the currently indexed ledger tip. The terminal frame
5334    /// carries no item.
5335    LedgerTip = 5,
5336}
5337impl QueryEndReason {
5338    /// String value of the enum field names used in the ProtoBuf definition.
5339    ///
5340    /// The values are not transformed in any way and thus are considered stable
5341    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5342    pub fn as_str_name(&self) -> &'static str {
5343        match self {
5344            Self::Unknown => "QUERY_END_REASON_UNKNOWN",
5345            Self::ItemLimit => "QUERY_END_REASON_ITEM_LIMIT",
5346            Self::ScanLimit => "QUERY_END_REASON_SCAN_LIMIT",
5347            Self::CheckpointBound => "QUERY_END_REASON_CHECKPOINT_BOUND",
5348            Self::CursorBound => "QUERY_END_REASON_CURSOR_BOUND",
5349            Self::LedgerTip => "QUERY_END_REASON_LEDGER_TIP",
5350        }
5351    }
5352    /// Creates an enum from field names used in the ProtoBuf definition.
5353    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5354        match value {
5355            "QUERY_END_REASON_UNKNOWN" => Some(Self::Unknown),
5356            "QUERY_END_REASON_ITEM_LIMIT" => Some(Self::ItemLimit),
5357            "QUERY_END_REASON_SCAN_LIMIT" => Some(Self::ScanLimit),
5358            "QUERY_END_REASON_CHECKPOINT_BOUND" => Some(Self::CheckpointBound),
5359            "QUERY_END_REASON_CURSOR_BOUND" => Some(Self::CursorBound),
5360            "QUERY_END_REASON_LEDGER_TIP" => Some(Self::LedgerTip),
5361            _ => None,
5362        }
5363    }
5364}
5365/// A signature from a user.
5366#[non_exhaustive]
5367#[derive(Clone, PartialEq, ::prost::Message)]
5368pub struct UserSignature {
5369    /// This signature serialized as as BCS.
5370    ///
5371    /// When provided as input this will support both the form that is length
5372    /// prefixed as well as not length prefixed.
5373    #[prost(message, optional, tag = "1")]
5374    pub bcs: ::core::option::Option<Bcs>,
5375    /// The signature scheme of this signature.
5376    #[prost(enumeration = "SignatureScheme", optional, tag = "2")]
5377    pub scheme: ::core::option::Option<i32>,
5378    #[prost(oneof = "user_signature::Signature", tags = "3, 4, 5, 6")]
5379    pub signature: ::core::option::Option<user_signature::Signature>,
5380}
5381/// Nested message and enum types in `UserSignature`.
5382pub mod user_signature {
5383    #[non_exhaustive]
5384    #[derive(Clone, PartialEq, ::prost::Oneof)]
5385    pub enum Signature {
5386        /// Simple signature if scheme is ed25519 | secp256k1 | secp256r1.
5387        #[prost(message, tag = "3")]
5388        Simple(super::SimpleSignature),
5389        /// The multisig aggregated signature if scheme is `MULTISIG`.
5390        #[prost(message, tag = "4")]
5391        Multisig(super::MultisigAggregatedSignature),
5392        /// The zklogin authenticator if scheme is `ZKLOGIN`.
5393        #[prost(message, tag = "5")]
5394        Zklogin(super::ZkLoginAuthenticator),
5395        /// The passkey authenticator if scheme is `PASSKEY`.
5396        #[prost(message, tag = "6")]
5397        Passkey(super::PasskeyAuthenticator),
5398    }
5399}
5400/// Either an ed25519, secp256k1 or secp256r1 signature
5401#[non_exhaustive]
5402#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5403pub struct SimpleSignature {
5404    /// The signature scheme of this signature.
5405    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5406    pub scheme: ::core::option::Option<i32>,
5407    /// Signature bytes
5408    #[prost(bytes = "bytes", optional, tag = "2")]
5409    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5410    /// Public key bytes
5411    #[prost(bytes = "bytes", optional, tag = "3")]
5412    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5413}
5414/// Public key equivalent for zklogin authenticators.
5415#[non_exhaustive]
5416#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5417pub struct ZkLoginPublicIdentifier {
5418    #[prost(string, optional, tag = "1")]
5419    pub iss: ::core::option::Option<::prost::alloc::string::String>,
5420    /// base10 encoded Bn254FieldElement
5421    #[prost(string, optional, tag = "2")]
5422    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5423}
5424/// Set of valid public keys for multisig committee members.
5425#[non_exhaustive]
5426#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5427pub struct MultisigMemberPublicKey {
5428    /// The signature scheme of this public key.
5429    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5430    pub scheme: ::core::option::Option<i32>,
5431    /// Public key bytes if scheme is ed25519 | secp256k1 | secp256r1 | passkey.
5432    #[prost(bytes = "bytes", optional, tag = "2")]
5433    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5434    /// A zklogin public identifier if scheme is zklogin.
5435    #[prost(message, optional, tag = "3")]
5436    pub zklogin: ::core::option::Option<ZkLoginPublicIdentifier>,
5437}
5438/// A member in a multisig committee.
5439#[non_exhaustive]
5440#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5441pub struct MultisigMember {
5442    /// The public key of the committee member.
5443    #[prost(message, optional, tag = "1")]
5444    pub public_key: ::core::option::Option<MultisigMemberPublicKey>,
5445    /// The weight of this member's signature.
5446    #[prost(uint32, optional, tag = "2")]
5447    pub weight: ::core::option::Option<u32>,
5448}
5449/// A multisig committee.
5450#[non_exhaustive]
5451#[derive(Clone, PartialEq, ::prost::Message)]
5452pub struct MultisigCommittee {
5453    /// A list of committee members and their corresponding weight.
5454    #[prost(message, repeated, tag = "1")]
5455    pub members: ::prost::alloc::vec::Vec<MultisigMember>,
5456    /// The threshold of signatures needed to validate a signature from
5457    /// this committee.
5458    #[prost(uint32, optional, tag = "2")]
5459    pub threshold: ::core::option::Option<u32>,
5460}
5461/// Aggregated signature from members of a multisig committee.
5462#[non_exhaustive]
5463#[derive(Clone, PartialEq, ::prost::Message)]
5464pub struct MultisigAggregatedSignature {
5465    /// The plain signatures encoded with signature scheme.
5466    ///
5467    /// The signatures must be in the same order as they are listed in the committee.
5468    #[prost(message, repeated, tag = "1")]
5469    pub signatures: ::prost::alloc::vec::Vec<MultisigMemberSignature>,
5470    /// Bitmap indicating which committee members contributed to the
5471    /// signature.
5472    #[prost(uint32, optional, tag = "2")]
5473    pub bitmap: ::core::option::Option<u32>,
5474    /// If present, means this signature's on-chain format uses the old
5475    /// legacy multisig format.
5476    #[prost(bytes = "bytes", optional, tag = "3")]
5477    pub legacy_bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5478    /// The committee to use to validate this signature.
5479    #[prost(message, optional, tag = "4")]
5480    pub committee: ::core::option::Option<MultisigCommittee>,
5481}
5482/// A signature from a member of a multisig committee.
5483#[non_exhaustive]
5484#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5485pub struct MultisigMemberSignature {
5486    /// The signature scheme of this signature.
5487    #[prost(enumeration = "SignatureScheme", optional, tag = "1")]
5488    pub scheme: ::core::option::Option<i32>,
5489    /// Signature bytes if scheme is ed25519 | secp256k1 | secp256r1.
5490    #[prost(bytes = "bytes", optional, tag = "2")]
5491    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5492    /// The zklogin authenticator if scheme is `ZKLOGIN`.
5493    #[prost(message, optional, tag = "3")]
5494    pub zklogin: ::core::option::Option<ZkLoginAuthenticator>,
5495    /// The passkey authenticator if scheme is `PASSKEY`.
5496    #[prost(message, optional, tag = "4")]
5497    pub passkey: ::core::option::Option<PasskeyAuthenticator>,
5498}
5499/// A zklogin authenticator.
5500#[non_exhaustive]
5501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5502pub struct ZkLoginAuthenticator {
5503    /// Zklogin proof and inputs required to perform proof verification.
5504    #[prost(message, optional, tag = "1")]
5505    pub inputs: ::core::option::Option<ZkLoginInputs>,
5506    /// Maximum epoch for which the proof is valid.
5507    #[prost(uint64, optional, tag = "2")]
5508    pub max_epoch: ::core::option::Option<u64>,
5509    /// User signature with the public key attested to by the provided proof.
5510    #[prost(message, optional, tag = "3")]
5511    pub signature: ::core::option::Option<SimpleSignature>,
5512    /// The public identifier (similar to a public key) for this zklogin authenticator
5513    #[prost(message, optional, tag = "4")]
5514    pub public_identifier: ::core::option::Option<ZkLoginPublicIdentifier>,
5515    /// The id of the JWK used to authorize this zklogin authenticator
5516    #[prost(message, optional, tag = "5")]
5517    pub jwk_id: ::core::option::Option<JwkId>,
5518}
5519/// A zklogin groth16 proof and the required inputs to perform proof verification.
5520#[non_exhaustive]
5521#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5522pub struct ZkLoginInputs {
5523    #[prost(message, optional, tag = "1")]
5524    pub proof_points: ::core::option::Option<ZkLoginProof>,
5525    #[prost(message, optional, tag = "2")]
5526    pub iss_base64_details: ::core::option::Option<ZkLoginClaim>,
5527    #[prost(string, optional, tag = "3")]
5528    pub header_base64: ::core::option::Option<::prost::alloc::string::String>,
5529    /// base10 encoded Bn254FieldElement
5530    #[prost(string, optional, tag = "4")]
5531    pub address_seed: ::core::option::Option<::prost::alloc::string::String>,
5532}
5533/// A zklogin groth16 proof.
5534#[non_exhaustive]
5535#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5536pub struct ZkLoginProof {
5537    #[prost(message, optional, tag = "1")]
5538    pub a: ::core::option::Option<CircomG1>,
5539    #[prost(message, optional, tag = "2")]
5540    pub b: ::core::option::Option<CircomG2>,
5541    #[prost(message, optional, tag = "3")]
5542    pub c: ::core::option::Option<CircomG1>,
5543}
5544/// A claim of the iss in a zklogin proof.
5545#[non_exhaustive]
5546#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5547pub struct ZkLoginClaim {
5548    #[prost(string, optional, tag = "1")]
5549    pub value: ::core::option::Option<::prost::alloc::string::String>,
5550    #[prost(uint32, optional, tag = "2")]
5551    pub index_mod_4: ::core::option::Option<u32>,
5552}
5553/// A G1 point.
5554#[non_exhaustive]
5555#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5556pub struct CircomG1 {
5557    /// base10 encoded Bn254FieldElement
5558    #[prost(string, optional, tag = "1")]
5559    pub e0: ::core::option::Option<::prost::alloc::string::String>,
5560    /// base10 encoded Bn254FieldElement
5561    #[prost(string, optional, tag = "2")]
5562    pub e1: ::core::option::Option<::prost::alloc::string::String>,
5563    /// base10 encoded Bn254FieldElement
5564    #[prost(string, optional, tag = "3")]
5565    pub e2: ::core::option::Option<::prost::alloc::string::String>,
5566}
5567/// A G2 point.
5568#[non_exhaustive]
5569#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5570pub struct CircomG2 {
5571    /// base10 encoded Bn254FieldElement
5572    #[prost(string, optional, tag = "1")]
5573    pub e00: ::core::option::Option<::prost::alloc::string::String>,
5574    /// base10 encoded Bn254FieldElement
5575    #[prost(string, optional, tag = "2")]
5576    pub e01: ::core::option::Option<::prost::alloc::string::String>,
5577    /// base10 encoded Bn254FieldElement
5578    #[prost(string, optional, tag = "3")]
5579    pub e10: ::core::option::Option<::prost::alloc::string::String>,
5580    /// base10 encoded Bn254FieldElement
5581    #[prost(string, optional, tag = "4")]
5582    pub e11: ::core::option::Option<::prost::alloc::string::String>,
5583    /// base10 encoded Bn254FieldElement
5584    #[prost(string, optional, tag = "5")]
5585    pub e20: ::core::option::Option<::prost::alloc::string::String>,
5586    /// base10 encoded Bn254FieldElement
5587    #[prost(string, optional, tag = "6")]
5588    pub e21: ::core::option::Option<::prost::alloc::string::String>,
5589}
5590/// A passkey authenticator.
5591///
5592/// See
5593/// [struct.PasskeyAuthenticator](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/struct.PasskeyAuthenticator.html#bcs>)
5594/// for more information on the requirements on the shape of the
5595/// `client_data_json` field.
5596#[non_exhaustive]
5597#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5598pub struct PasskeyAuthenticator {
5599    /// Opaque authenticator data for this passkey signature.
5600    ///
5601    /// See [Authenticator Data](<https://www.w3.org/TR/webauthn-2/#sctn-authenticator-data>) for
5602    /// more information on this field.
5603    #[prost(bytes = "bytes", optional, tag = "1")]
5604    pub authenticator_data: ::core::option::Option<::prost::bytes::Bytes>,
5605    /// Structured, unparsed, JSON for this passkey signature.
5606    ///
5607    /// See [CollectedClientData](<https://www.w3.org/TR/webauthn-2/#dictdef-collectedclientdata>)
5608    /// for more information on this field.
5609    #[prost(string, optional, tag = "2")]
5610    pub client_data_json: ::core::option::Option<::prost::alloc::string::String>,
5611    /// A secp256r1 signature.
5612    #[prost(message, optional, tag = "3")]
5613    pub signature: ::core::option::Option<SimpleSignature>,
5614}
5615/// The validator set for a particular epoch.
5616#[non_exhaustive]
5617#[derive(Clone, PartialEq, ::prost::Message)]
5618pub struct ValidatorCommittee {
5619    /// The epoch where this committee governs.
5620    #[prost(uint64, optional, tag = "1")]
5621    pub epoch: ::core::option::Option<u64>,
5622    /// The committee members.
5623    #[prost(message, repeated, tag = "2")]
5624    pub members: ::prost::alloc::vec::Vec<ValidatorCommitteeMember>,
5625}
5626/// A member of a validator committee.
5627#[non_exhaustive]
5628#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5629pub struct ValidatorCommitteeMember {
5630    /// The 96-byte Bls12381 public key for this validator.
5631    #[prost(bytes = "bytes", optional, tag = "1")]
5632    pub public_key: ::core::option::Option<::prost::bytes::Bytes>,
5633    /// voting weight this validator possesses.
5634    #[prost(uint64, optional, tag = "2")]
5635    pub weight: ::core::option::Option<u64>,
5636}
5637/// / An aggregated signature from multiple validators.
5638#[non_exhaustive]
5639#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5640pub struct ValidatorAggregatedSignature {
5641    /// The epoch when this signature was produced.
5642    ///
5643    /// This can be used to lookup the `ValidatorCommittee` from this epoch
5644    /// to verify this signature.
5645    #[prost(uint64, optional, tag = "1")]
5646    pub epoch: ::core::option::Option<u64>,
5647    /// The 48-byte Bls12381 aggregated signature.
5648    #[prost(bytes = "bytes", optional, tag = "2")]
5649    pub signature: ::core::option::Option<::prost::bytes::Bytes>,
5650    /// Bitmap indicating which members of the committee contributed to
5651    /// this signature.
5652    #[prost(bytes = "bytes", optional, tag = "3")]
5653    pub bitmap: ::core::option::Option<::prost::bytes::Bytes>,
5654}
5655/// Flag use to disambiguate the signature schemes supported by Sui.
5656///
5657/// Note: the enum values defined by this proto message exactly match their
5658/// expected BCS serialized values when serialized as a u8. See
5659/// [enum.SignatureScheme](<https://mystenlabs.github.io/sui-rust-sdk/sui_sdk_types/enum.SignatureScheme.html>)
5660/// for more information about signature schemes.
5661#[non_exhaustive]
5662#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
5663#[repr(i32)]
5664pub enum SignatureScheme {
5665    Ed25519 = 0,
5666    Secp256k1 = 1,
5667    Secp256r1 = 2,
5668    Multisig = 3,
5669    Bls12381 = 4,
5670    Zklogin = 5,
5671    Passkey = 6,
5672}
5673impl SignatureScheme {
5674    /// String value of the enum field names used in the ProtoBuf definition.
5675    ///
5676    /// The values are not transformed in any way and thus are considered stable
5677    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
5678    pub fn as_str_name(&self) -> &'static str {
5679        match self {
5680            Self::Ed25519 => "ED25519",
5681            Self::Secp256k1 => "SECP256K1",
5682            Self::Secp256r1 => "SECP256R1",
5683            Self::Multisig => "MULTISIG",
5684            Self::Bls12381 => "BLS12381",
5685            Self::Zklogin => "ZKLOGIN",
5686            Self::Passkey => "PASSKEY",
5687        }
5688    }
5689    /// Creates an enum from field names used in the ProtoBuf definition.
5690    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
5691        match value {
5692            "ED25519" => Some(Self::Ed25519),
5693            "SECP256K1" => Some(Self::Secp256k1),
5694            "SECP256R1" => Some(Self::Secp256r1),
5695            "MULTISIG" => Some(Self::Multisig),
5696            "BLS12381" => Some(Self::Bls12381),
5697            "ZKLOGIN" => Some(Self::Zklogin),
5698            "PASSKEY" => Some(Self::Passkey),
5699            _ => None,
5700        }
5701    }
5702}
5703#[non_exhaustive]
5704#[derive(Clone, PartialEq, ::prost::Message)]
5705pub struct VerifySignatureRequest {
5706    /// The message to verify against.
5707    ///
5708    /// Today the only supported message types are `PersonalMessage` and
5709    /// `TransactionData` and the `Bcs.name` must be set to indicate which type of
5710    /// message is being verified.
5711    #[prost(message, optional, tag = "1")]
5712    pub message: ::core::option::Option<Bcs>,
5713    /// The signature to verify.
5714    #[prost(message, optional, tag = "2")]
5715    pub signature: ::core::option::Option<UserSignature>,
5716    /// Optional. Address to validate against the provided signature.
5717    ///
5718    /// If provided, this address will be compared against the the address derived
5719    /// from the provide signature and a successful response will only be returned
5720    /// if they match.
5721    #[prost(string, optional, tag = "3")]
5722    pub address: ::core::option::Option<::prost::alloc::string::String>,
5723    /// The set of JWKs to use when verifying Zklogin signatures.
5724    /// If this is empty the current set of valid JWKs stored onchain will be used
5725    #[prost(message, repeated, tag = "4")]
5726    pub jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
5727}
5728#[non_exhaustive]
5729#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
5730pub struct VerifySignatureResponse {
5731    /// Indicates if the provided signature was valid given the requested parameters.
5732    #[prost(bool, optional, tag = "1")]
5733    pub is_valid: ::core::option::Option<bool>,
5734    /// If `is_valid` is `false`, this is the reason for why the signature verification failed.
5735    #[prost(string, optional, tag = "2")]
5736    pub reason: ::core::option::Option<::prost::alloc::string::String>,
5737}
5738/// Generated client implementations.
5739pub mod signature_verification_service_client {
5740    #![allow(
5741        unused_variables,
5742        dead_code,
5743        missing_docs,
5744        clippy::wildcard_imports,
5745        clippy::let_unit_value,
5746    )]
5747    use tonic::codegen::*;
5748    use tonic::codegen::http::Uri;
5749    #[derive(Debug, Clone)]
5750    pub struct SignatureVerificationServiceClient<T> {
5751        inner: tonic::client::Grpc<T>,
5752    }
5753    impl SignatureVerificationServiceClient<tonic::transport::Channel> {
5754        /// Attempt to create a new client by connecting to a given endpoint.
5755        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
5756        where
5757            D: TryInto<tonic::transport::Endpoint>,
5758            D::Error: Into<StdError>,
5759        {
5760            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
5761            Ok(Self::new(conn))
5762        }
5763    }
5764    impl<T> SignatureVerificationServiceClient<T>
5765    where
5766        T: tonic::client::GrpcService<tonic::body::Body>,
5767        T::Error: Into<StdError>,
5768        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
5769        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
5770    {
5771        pub fn new(inner: T) -> Self {
5772            let inner = tonic::client::Grpc::new(inner);
5773            Self { inner }
5774        }
5775        pub fn with_origin(inner: T, origin: Uri) -> Self {
5776            let inner = tonic::client::Grpc::with_origin(inner, origin);
5777            Self { inner }
5778        }
5779        pub fn with_interceptor<F>(
5780            inner: T,
5781            interceptor: F,
5782        ) -> SignatureVerificationServiceClient<InterceptedService<T, F>>
5783        where
5784            F: tonic::service::Interceptor,
5785            T::ResponseBody: Default,
5786            T: tonic::codegen::Service<
5787                http::Request<tonic::body::Body>,
5788                Response = http::Response<
5789                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
5790                >,
5791            >,
5792            <T as tonic::codegen::Service<
5793                http::Request<tonic::body::Body>,
5794            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
5795        {
5796            SignatureVerificationServiceClient::new(
5797                InterceptedService::new(inner, interceptor),
5798            )
5799        }
5800        /// Compress requests with the given encoding.
5801        ///
5802        /// This requires the server to support it otherwise it might respond with an
5803        /// error.
5804        #[must_use]
5805        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5806            self.inner = self.inner.send_compressed(encoding);
5807            self
5808        }
5809        /// Enable decompressing responses.
5810        #[must_use]
5811        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5812            self.inner = self.inner.accept_compressed(encoding);
5813            self
5814        }
5815        /// Limits the maximum size of a decoded message.
5816        ///
5817        /// Default: `4MB`
5818        #[must_use]
5819        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5820            self.inner = self.inner.max_decoding_message_size(limit);
5821            self
5822        }
5823        /// Limits the maximum size of an encoded message.
5824        ///
5825        /// Default: `usize::MAX`
5826        #[must_use]
5827        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5828            self.inner = self.inner.max_encoding_message_size(limit);
5829            self
5830        }
5831        /// Perform signature verification of a UserSignature against the provided message.
5832        pub async fn verify_signature(
5833            &mut self,
5834            request: impl tonic::IntoRequest<super::VerifySignatureRequest>,
5835        ) -> std::result::Result<
5836            tonic::Response<super::VerifySignatureResponse>,
5837            tonic::Status,
5838        > {
5839            self.inner
5840                .ready()
5841                .await
5842                .map_err(|e| {
5843                    tonic::Status::unknown(
5844                        format!("Service was not ready: {}", e.into()),
5845                    )
5846                })?;
5847            let codec = tonic_prost::ProstCodec::default();
5848            let path = http::uri::PathAndQuery::from_static(
5849                "/sui.rpc.v2.SignatureVerificationService/VerifySignature",
5850            );
5851            let mut req = request.into_request();
5852            req.extensions_mut()
5853                .insert(
5854                    GrpcMethod::new(
5855                        "sui.rpc.v2.SignatureVerificationService",
5856                        "VerifySignature",
5857                    ),
5858                );
5859            self.inner.unary(req, path, codec).await
5860        }
5861    }
5862}
5863/// Generated server implementations.
5864pub mod signature_verification_service_server {
5865    #![allow(
5866        unused_variables,
5867        dead_code,
5868        missing_docs,
5869        clippy::wildcard_imports,
5870        clippy::let_unit_value,
5871    )]
5872    use tonic::codegen::*;
5873    /// Generated trait containing gRPC methods that should be implemented for use with SignatureVerificationServiceServer.
5874    #[async_trait]
5875    pub trait SignatureVerificationService: std::marker::Send + std::marker::Sync + 'static {
5876        /// Perform signature verification of a UserSignature against the provided message.
5877        async fn verify_signature(
5878            &self,
5879            request: tonic::Request<super::VerifySignatureRequest>,
5880        ) -> std::result::Result<
5881            tonic::Response<super::VerifySignatureResponse>,
5882            tonic::Status,
5883        > {
5884            Err(tonic::Status::unimplemented("Not yet implemented"))
5885        }
5886    }
5887    #[derive(Debug)]
5888    pub struct SignatureVerificationServiceServer<T> {
5889        inner: Arc<T>,
5890        accept_compression_encodings: EnabledCompressionEncodings,
5891        send_compression_encodings: EnabledCompressionEncodings,
5892        max_decoding_message_size: Option<usize>,
5893        max_encoding_message_size: Option<usize>,
5894    }
5895    impl<T> SignatureVerificationServiceServer<T> {
5896        pub fn new(inner: T) -> Self {
5897            Self::from_arc(Arc::new(inner))
5898        }
5899        pub fn from_arc(inner: Arc<T>) -> Self {
5900            Self {
5901                inner,
5902                accept_compression_encodings: Default::default(),
5903                send_compression_encodings: Default::default(),
5904                max_decoding_message_size: None,
5905                max_encoding_message_size: None,
5906            }
5907        }
5908        pub fn with_interceptor<F>(
5909            inner: T,
5910            interceptor: F,
5911        ) -> InterceptedService<Self, F>
5912        where
5913            F: tonic::service::Interceptor,
5914        {
5915            InterceptedService::new(Self::new(inner), interceptor)
5916        }
5917        /// Enable decompressing requests with the given encoding.
5918        #[must_use]
5919        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
5920            self.accept_compression_encodings.enable(encoding);
5921            self
5922        }
5923        /// Compress responses with the given encoding, if the client supports it.
5924        #[must_use]
5925        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
5926            self.send_compression_encodings.enable(encoding);
5927            self
5928        }
5929        /// Limits the maximum size of a decoded message.
5930        ///
5931        /// Default: `4MB`
5932        #[must_use]
5933        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
5934            self.max_decoding_message_size = Some(limit);
5935            self
5936        }
5937        /// Limits the maximum size of an encoded message.
5938        ///
5939        /// Default: `usize::MAX`
5940        #[must_use]
5941        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
5942            self.max_encoding_message_size = Some(limit);
5943            self
5944        }
5945    }
5946    impl<T, B> tonic::codegen::Service<http::Request<B>>
5947    for SignatureVerificationServiceServer<T>
5948    where
5949        T: SignatureVerificationService,
5950        B: Body + std::marker::Send + 'static,
5951        B::Error: Into<StdError> + std::marker::Send + 'static,
5952    {
5953        type Response = http::Response<tonic::body::Body>;
5954        type Error = std::convert::Infallible;
5955        type Future = BoxFuture<Self::Response, Self::Error>;
5956        fn poll_ready(
5957            &mut self,
5958            _cx: &mut Context<'_>,
5959        ) -> Poll<std::result::Result<(), Self::Error>> {
5960            Poll::Ready(Ok(()))
5961        }
5962        fn call(&mut self, req: http::Request<B>) -> Self::Future {
5963            match req.uri().path() {
5964                "/sui.rpc.v2.SignatureVerificationService/VerifySignature" => {
5965                    #[allow(non_camel_case_types)]
5966                    struct VerifySignatureSvc<T: SignatureVerificationService>(
5967                        pub Arc<T>,
5968                    );
5969                    impl<
5970                        T: SignatureVerificationService,
5971                    > tonic::server::UnaryService<super::VerifySignatureRequest>
5972                    for VerifySignatureSvc<T> {
5973                        type Response = super::VerifySignatureResponse;
5974                        type Future = BoxFuture<
5975                            tonic::Response<Self::Response>,
5976                            tonic::Status,
5977                        >;
5978                        fn call(
5979                            &mut self,
5980                            request: tonic::Request<super::VerifySignatureRequest>,
5981                        ) -> Self::Future {
5982                            let inner = Arc::clone(&self.0);
5983                            let fut = async move {
5984                                <T as SignatureVerificationService>::verify_signature(
5985                                        &inner,
5986                                        request,
5987                                    )
5988                                    .await
5989                            };
5990                            Box::pin(fut)
5991                        }
5992                    }
5993                    let accept_compression_encodings = self.accept_compression_encodings;
5994                    let send_compression_encodings = self.send_compression_encodings;
5995                    let max_decoding_message_size = self.max_decoding_message_size;
5996                    let max_encoding_message_size = self.max_encoding_message_size;
5997                    let inner = self.inner.clone();
5998                    let fut = async move {
5999                        let method = VerifySignatureSvc(inner);
6000                        let codec = tonic_prost::ProstCodec::default();
6001                        let mut grpc = tonic::server::Grpc::new(codec)
6002                            .apply_compression_config(
6003                                accept_compression_encodings,
6004                                send_compression_encodings,
6005                            )
6006                            .apply_max_message_size_config(
6007                                max_decoding_message_size,
6008                                max_encoding_message_size,
6009                            );
6010                        let res = grpc.unary(method, req).await;
6011                        Ok(res)
6012                    };
6013                    Box::pin(fut)
6014                }
6015                _ => {
6016                    Box::pin(async move {
6017                        let mut response = http::Response::new(
6018                            tonic::body::Body::default(),
6019                        );
6020                        let headers = response.headers_mut();
6021                        headers
6022                            .insert(
6023                                tonic::Status::GRPC_STATUS,
6024                                (tonic::Code::Unimplemented as i32).into(),
6025                            );
6026                        headers
6027                            .insert(
6028                                http::header::CONTENT_TYPE,
6029                                tonic::metadata::GRPC_CONTENT_TYPE,
6030                            );
6031                        Ok(response)
6032                    })
6033                }
6034            }
6035        }
6036    }
6037    impl<T> Clone for SignatureVerificationServiceServer<T> {
6038        fn clone(&self) -> Self {
6039            let inner = self.inner.clone();
6040            Self {
6041                inner,
6042                accept_compression_encodings: self.accept_compression_encodings,
6043                send_compression_encodings: self.send_compression_encodings,
6044                max_decoding_message_size: self.max_decoding_message_size,
6045                max_encoding_message_size: self.max_encoding_message_size,
6046            }
6047        }
6048    }
6049    /// Generated gRPC service name
6050    pub const SERVICE_NAME: &str = "sui.rpc.v2.SignatureVerificationService";
6051    impl<T> tonic::server::NamedService for SignatureVerificationServiceServer<T> {
6052        const NAME: &'static str = SERVICE_NAME;
6053    }
6054}
6055/// Request message for `NodeService.GetCoinInfo`.
6056#[non_exhaustive]
6057#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6058pub struct GetCoinInfoRequest {
6059    /// The coin type to request information about
6060    #[prost(string, optional, tag = "1")]
6061    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6062}
6063/// Response message for `NodeService.GetCoinInfo`.
6064#[non_exhaustive]
6065#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6066pub struct GetCoinInfoResponse {
6067    /// Required. The coin type.
6068    #[prost(string, optional, tag = "1")]
6069    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6070    /// This field will be populated with information about this coin
6071    /// type's `0x2::coin::CoinMetadata` if it exists and has not been wrapped.
6072    #[prost(message, optional, tag = "2")]
6073    pub metadata: ::core::option::Option<CoinMetadata>,
6074    /// This field will be populated with information about this coin
6075    /// type's `0x2::coin::TreasuryCap` if it exists and has not been wrapped.
6076    #[prost(message, optional, tag = "3")]
6077    pub treasury: ::core::option::Option<CoinTreasury>,
6078    /// If this coin type is a regulated coin, this field will be
6079    /// populated with information either from its Currency object
6080    /// in the CoinRegistry, or from its `0x2::coin::RegulatedCoinMetadata`
6081    /// object for coins that have not been migrated to the CoinRegistry
6082    ///
6083    /// If this coin is not known to be regulated, only the
6084    /// coin_regulated_state field will be populated.
6085    #[prost(message, optional, tag = "4")]
6086    pub regulated_metadata: ::core::option::Option<RegulatedCoinMetadata>,
6087}
6088/// Metadata for a coin type
6089#[non_exhaustive]
6090#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6091pub struct CoinMetadata {
6092    /// ObjectId of the `0x2::coin::CoinMetadata` object or
6093    /// 0x2::sui::coin_registry::Currency object (when registered with CoinRegistry).
6094    #[prost(string, optional, tag = "1")]
6095    pub id: ::core::option::Option<::prost::alloc::string::String>,
6096    /// Number of decimal places to coin uses.
6097    #[prost(uint32, optional, tag = "2")]
6098    pub decimals: ::core::option::Option<u32>,
6099    /// Name for the token
6100    #[prost(string, optional, tag = "3")]
6101    pub name: ::core::option::Option<::prost::alloc::string::String>,
6102    /// Symbol for the token
6103    #[prost(string, optional, tag = "4")]
6104    pub symbol: ::core::option::Option<::prost::alloc::string::String>,
6105    /// Description of the token
6106    #[prost(string, optional, tag = "5")]
6107    pub description: ::core::option::Option<::prost::alloc::string::String>,
6108    /// URL for the token logo
6109    #[prost(string, optional, tag = "6")]
6110    pub icon_url: ::core::option::Option<::prost::alloc::string::String>,
6111    /// The MetadataCap ID if it has been claimed for this coin type.
6112    /// This capability allows updating the coin's metadata fields.
6113    /// Only populated when metadata is from CoinRegistry.
6114    #[prost(string, optional, tag = "7")]
6115    pub metadata_cap_id: ::core::option::Option<::prost::alloc::string::String>,
6116    /// State of the MetadataCap for this coin type.
6117    #[prost(enumeration = "coin_metadata::MetadataCapState", optional, tag = "8")]
6118    pub metadata_cap_state: ::core::option::Option<i32>,
6119}
6120/// Nested message and enum types in `CoinMetadata`.
6121pub mod coin_metadata {
6122    /// Information about the state of the coin's MetadataCap
6123    #[non_exhaustive]
6124    #[derive(
6125        Clone,
6126        Copy,
6127        Debug,
6128        PartialEq,
6129        Eq,
6130        Hash,
6131        PartialOrd,
6132        Ord,
6133        ::prost::Enumeration
6134    )]
6135    #[repr(i32)]
6136    pub enum MetadataCapState {
6137        /// Indicates the state of the MetadataCap is unknown.
6138        /// Set when the coin has not been migrated to the CoinRegistry.
6139        Unknown = 0,
6140        /// Indicates the MetadataCap has been claimed.
6141        Claimed = 1,
6142        /// Indicates the MetadataCap has not been claimed.
6143        Unclaimed = 2,
6144        /// Indicates the MetadataCap has been deleted.
6145        Deleted = 3,
6146    }
6147    impl MetadataCapState {
6148        /// String value of the enum field names used in the ProtoBuf definition.
6149        ///
6150        /// The values are not transformed in any way and thus are considered stable
6151        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6152        pub fn as_str_name(&self) -> &'static str {
6153            match self {
6154                Self::Unknown => "METADATA_CAP_STATE_UNKNOWN",
6155                Self::Claimed => "CLAIMED",
6156                Self::Unclaimed => "UNCLAIMED",
6157                Self::Deleted => "DELETED",
6158            }
6159        }
6160        /// Creates an enum from field names used in the ProtoBuf definition.
6161        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6162            match value {
6163                "METADATA_CAP_STATE_UNKNOWN" => Some(Self::Unknown),
6164                "CLAIMED" => Some(Self::Claimed),
6165                "UNCLAIMED" => Some(Self::Unclaimed),
6166                "DELETED" => Some(Self::Deleted),
6167                _ => None,
6168            }
6169        }
6170    }
6171}
6172/// Information about a coin type's `0x2::coin::TreasuryCap` and its total available supply
6173#[non_exhaustive]
6174#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6175pub struct CoinTreasury {
6176    /// ObjectId of the `0x2::coin::TreasuryCap` object.
6177    #[prost(string, optional, tag = "1")]
6178    pub id: ::core::option::Option<::prost::alloc::string::String>,
6179    /// Total available supply for this coin type.
6180    #[prost(uint64, optional, tag = "2")]
6181    pub total_supply: ::core::option::Option<u64>,
6182    /// Supply state indicating if the supply is fixed or can still be minted
6183    #[prost(enumeration = "coin_treasury::SupplyState", optional, tag = "3")]
6184    pub supply_state: ::core::option::Option<i32>,
6185}
6186/// Nested message and enum types in `CoinTreasury`.
6187pub mod coin_treasury {
6188    /// Supply state of a coin, matching the Move SupplyState enum
6189    #[non_exhaustive]
6190    #[derive(
6191        Clone,
6192        Copy,
6193        Debug,
6194        PartialEq,
6195        Eq,
6196        Hash,
6197        PartialOrd,
6198        Ord,
6199        ::prost::Enumeration
6200    )]
6201    #[repr(i32)]
6202    pub enum SupplyState {
6203        /// Supply is unknown or TreasuryCap still exists (minting still possible)
6204        Unknown = 0,
6205        /// Supply is fixed (TreasuryCap consumed, no more minting possible)
6206        Fixed = 1,
6207        /// Supply can only decrease (burning allowed, minting not allowed)
6208        BurnOnly = 2,
6209    }
6210    impl SupplyState {
6211        /// String value of the enum field names used in the ProtoBuf definition.
6212        ///
6213        /// The values are not transformed in any way and thus are considered stable
6214        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6215        pub fn as_str_name(&self) -> &'static str {
6216            match self {
6217                Self::Unknown => "SUPPLY_STATE_UNKNOWN",
6218                Self::Fixed => "FIXED",
6219                Self::BurnOnly => "BURN_ONLY",
6220            }
6221        }
6222        /// Creates an enum from field names used in the ProtoBuf definition.
6223        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6224            match value {
6225                "SUPPLY_STATE_UNKNOWN" => Some(Self::Unknown),
6226                "FIXED" => Some(Self::Fixed),
6227                "BURN_ONLY" => Some(Self::BurnOnly),
6228                _ => None,
6229            }
6230        }
6231    }
6232}
6233/// Information about a regulated coin, which indicates that it makes use of the transfer deny list.
6234#[non_exhaustive]
6235#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6236pub struct RegulatedCoinMetadata {
6237    /// ObjectId of the `0x2::coin::RegulatedCoinMetadata` object.
6238    /// Only present for coins that have not been migrated to CoinRegistry.
6239    #[prost(string, optional, tag = "1")]
6240    pub id: ::core::option::Option<::prost::alloc::string::String>,
6241    /// The ID of the coin's `CoinMetadata` or `CoinData` object.
6242    #[prost(string, optional, tag = "2")]
6243    pub coin_metadata_object: ::core::option::Option<::prost::alloc::string::String>,
6244    /// The ID of the coin's `DenyCap` object.
6245    #[prost(string, optional, tag = "3")]
6246    pub deny_cap_object: ::core::option::Option<::prost::alloc::string::String>,
6247    /// Whether the coin can be globally paused
6248    #[prost(bool, optional, tag = "4")]
6249    pub allow_global_pause: ::core::option::Option<bool>,
6250    /// Variant of the regulated coin metadata
6251    #[prost(uint32, optional, tag = "5")]
6252    pub variant: ::core::option::Option<u32>,
6253    /// Indicates the coin's regulated state.
6254    #[prost(
6255        enumeration = "regulated_coin_metadata::CoinRegulatedState",
6256        optional,
6257        tag = "6"
6258    )]
6259    pub coin_regulated_state: ::core::option::Option<i32>,
6260}
6261/// Nested message and enum types in `RegulatedCoinMetadata`.
6262pub mod regulated_coin_metadata {
6263    /// Indicates the state of the regulation of the coin.
6264    #[non_exhaustive]
6265    #[derive(
6266        Clone,
6267        Copy,
6268        Debug,
6269        PartialEq,
6270        Eq,
6271        Hash,
6272        PartialOrd,
6273        Ord,
6274        ::prost::Enumeration
6275    )]
6276    #[repr(i32)]
6277    pub enum CoinRegulatedState {
6278        /// Indicates the regulation state of the coin is unknown.
6279        /// This is set when a coin has not been migrated to the
6280        /// coin registry and has no `0x2::coin::RegulatedCoinMetadata`
6281        /// object.
6282        Unknown = 0,
6283        /// Indicates a coin is regulated. RegulatedCoinMetadata will be populated.
6284        Regulated = 1,
6285        /// Indicates a coin is unregulated.
6286        Unregulated = 2,
6287    }
6288    impl CoinRegulatedState {
6289        /// String value of the enum field names used in the ProtoBuf definition.
6290        ///
6291        /// The values are not transformed in any way and thus are considered stable
6292        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6293        pub fn as_str_name(&self) -> &'static str {
6294            match self {
6295                Self::Unknown => "COIN_REGULATED_STATE_UNKNOWN",
6296                Self::Regulated => "REGULATED",
6297                Self::Unregulated => "UNREGULATED",
6298            }
6299        }
6300        /// Creates an enum from field names used in the ProtoBuf definition.
6301        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6302            match value {
6303                "COIN_REGULATED_STATE_UNKNOWN" => Some(Self::Unknown),
6304                "REGULATED" => Some(Self::Regulated),
6305                "UNREGULATED" => Some(Self::Unregulated),
6306                _ => None,
6307            }
6308        }
6309    }
6310}
6311/// Request message for `LiveDataService.GetBalance`.
6312#[non_exhaustive]
6313#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6314pub struct GetBalanceRequest {
6315    /// Required. The owner's Sui address.
6316    #[prost(string, optional, tag = "1")]
6317    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6318    /// Required. The type names for the coin (e.g., 0x2::sui::SUI).
6319    #[prost(string, optional, tag = "2")]
6320    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6321}
6322/// Response message for `LiveDataService.GetBalance`.
6323/// Return the total coin balance for one coin type, owned by the address owner.
6324#[non_exhaustive]
6325#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6326pub struct GetBalanceResponse {
6327    /// The balance information for the requested coin type.
6328    #[prost(message, optional, tag = "1")]
6329    pub balance: ::core::option::Option<Balance>,
6330}
6331/// Request message for `LiveDataService.ListBalances`.
6332#[non_exhaustive]
6333#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6334pub struct ListBalancesRequest {
6335    /// Required. The owner's Sui address.
6336    #[prost(string, optional, tag = "1")]
6337    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6338    /// The maximum number of balance entries to return. The service may return fewer than this value.
6339    /// If unspecified, at most `50` entries will be returned.
6340    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6341    #[prost(uint32, optional, tag = "2")]
6342    pub page_size: ::core::option::Option<u32>,
6343    /// A page token, received from a previous `ListBalances` call.
6344    /// Provide this to retrieve the subsequent page.
6345    ///
6346    /// When paginating, all other parameters provided to `ListBalances` must
6347    /// match the call that provided the page token.
6348    #[prost(bytes = "bytes", optional, tag = "3")]
6349    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6350}
6351/// Response message for `LiveDataService.ListBalances`.
6352/// Return the total coin balance for all coin types, owned by the address owner.
6353#[non_exhaustive]
6354#[derive(Clone, PartialEq, ::prost::Message)]
6355pub struct ListBalancesResponse {
6356    /// The list of coin types and their respective balances.
6357    #[prost(message, repeated, tag = "1")]
6358    pub balances: ::prost::alloc::vec::Vec<Balance>,
6359    /// A token, which can be sent as `page_token` to retrieve the next page.
6360    /// If this field is omitted, there are no subsequent pages.
6361    #[prost(bytes = "bytes", optional, tag = "2")]
6362    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6363}
6364/// Balance information for a specific coin type.
6365#[non_exhaustive]
6366#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6367pub struct Balance {
6368    /// The type of the coin (e.g., 0x2::sui::SUI).
6369    #[prost(string, optional, tag = "1")]
6370    pub coin_type: ::core::option::Option<::prost::alloc::string::String>,
6371    /// The total balance of `coin_type` in its smallest unit.
6372    /// This is the sum of all spendable amounts of `coin_type` (`address_balance`
6373    /// and `coin_balance`).
6374    #[prost(uint64, optional, tag = "3")]
6375    pub balance: ::core::option::Option<u64>,
6376    /// The balance of `Balance<T>` in this address's Address Balance.
6377    #[prost(uint64, optional, tag = "4")]
6378    pub address_balance: ::core::option::Option<u64>,
6379    /// The balance of all `Coin<T>` objects owned by this address.
6380    #[prost(uint64, optional, tag = "5")]
6381    pub coin_balance: ::core::option::Option<u64>,
6382}
6383/// Request message for `NodeService.ListDynamicFields`
6384#[non_exhaustive]
6385#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6386pub struct ListDynamicFieldsRequest {
6387    /// Required. The `UID` of the parent, which owns the collections of dynamic fields.
6388    #[prost(string, optional, tag = "1")]
6389    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6390    /// The maximum number of dynamic fields to return. The service may return fewer than this value.
6391    /// If unspecified, at most `50` entries will be returned.
6392    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6393    #[prost(uint32, optional, tag = "2")]
6394    pub page_size: ::core::option::Option<u32>,
6395    /// A page token, received from a previous `ListDynamicFields` call.
6396    /// Provide this to retrieve the subsequent page.
6397    ///
6398    /// When paginating, all other parameters provided to `ListDynamicFields` must
6399    /// match the call that provided the page token.
6400    #[prost(bytes = "bytes", optional, tag = "3")]
6401    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6402    /// Mask specifying which fields to read.
6403    /// If no mask is specified, defaults to `parent,field_id`.
6404    #[prost(message, optional, tag = "4")]
6405    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6406}
6407/// Response message for `NodeService.ListDynamicFields`
6408#[non_exhaustive]
6409#[derive(Clone, PartialEq, ::prost::Message)]
6410pub struct ListDynamicFieldsResponse {
6411    /// Page of dynamic fields owned by the specified parent.
6412    #[prost(message, repeated, tag = "1")]
6413    pub dynamic_fields: ::prost::alloc::vec::Vec<DynamicField>,
6414    /// A token, which can be sent as `page_token` to retrieve the next page.
6415    /// If this field is omitted, there are no subsequent pages.
6416    #[prost(bytes = "bytes", optional, tag = "2")]
6417    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6418}
6419#[non_exhaustive]
6420#[derive(Clone, PartialEq, ::prost::Message)]
6421pub struct DynamicField {
6422    #[prost(enumeration = "dynamic_field::DynamicFieldKind", optional, tag = "1")]
6423    pub kind: ::core::option::Option<i32>,
6424    /// ObjectId of this dynamic field's parent.
6425    #[prost(string, optional, tag = "2")]
6426    pub parent: ::core::option::Option<::prost::alloc::string::String>,
6427    /// ObjectId of this dynamic field.
6428    #[prost(string, optional, tag = "3")]
6429    pub field_id: ::core::option::Option<::prost::alloc::string::String>,
6430    /// The field object itself
6431    #[prost(message, optional, tag = "4")]
6432    pub field_object: ::core::option::Option<Object>,
6433    /// The dynamic field's "name"
6434    #[prost(message, optional, tag = "5")]
6435    pub name: ::core::option::Option<Bcs>,
6436    /// The dynamic field's "value"
6437    #[prost(message, optional, tag = "6")]
6438    pub value: ::core::option::Option<Bcs>,
6439    /// The type of the dynamic field "value".
6440    ///
6441    /// If this is a dynamic object field then this is the type of the object
6442    /// itself (which is a child of this field), otherwise this is the type of the
6443    /// value of this field.
6444    #[prost(string, optional, tag = "7")]
6445    pub value_type: ::core::option::Option<::prost::alloc::string::String>,
6446    /// The ObjectId of the child object when a child is a dynamic
6447    /// object field.
6448    ///
6449    /// The presence or absence of this field can be used to determine if a child
6450    /// is a dynamic field or a dynamic child object
6451    #[prost(string, optional, tag = "8")]
6452    pub child_id: ::core::option::Option<::prost::alloc::string::String>,
6453    /// The object itself when a child is a dynamic object field.
6454    #[prost(message, optional, tag = "9")]
6455    pub child_object: ::core::option::Option<Object>,
6456}
6457/// Nested message and enum types in `DynamicField`.
6458pub mod dynamic_field {
6459    #[non_exhaustive]
6460    #[derive(
6461        Clone,
6462        Copy,
6463        Debug,
6464        PartialEq,
6465        Eq,
6466        Hash,
6467        PartialOrd,
6468        Ord,
6469        ::prost::Enumeration
6470    )]
6471    #[repr(i32)]
6472    pub enum DynamicFieldKind {
6473        Unknown = 0,
6474        Field = 1,
6475        Object = 2,
6476    }
6477    impl DynamicFieldKind {
6478        /// String value of the enum field names used in the ProtoBuf definition.
6479        ///
6480        /// The values are not transformed in any way and thus are considered stable
6481        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
6482        pub fn as_str_name(&self) -> &'static str {
6483            match self {
6484                Self::Unknown => "DYNAMIC_FIELD_KIND_UNKNOWN",
6485                Self::Field => "FIELD",
6486                Self::Object => "OBJECT",
6487            }
6488        }
6489        /// Creates an enum from field names used in the ProtoBuf definition.
6490        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
6491            match value {
6492                "DYNAMIC_FIELD_KIND_UNKNOWN" => Some(Self::Unknown),
6493                "FIELD" => Some(Self::Field),
6494                "OBJECT" => Some(Self::Object),
6495                _ => None,
6496            }
6497        }
6498    }
6499}
6500#[non_exhaustive]
6501#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
6502pub struct ListOwnedObjectsRequest {
6503    /// Required. The address of the account that owns the objects.
6504    #[prost(string, optional, tag = "1")]
6505    pub owner: ::core::option::Option<::prost::alloc::string::String>,
6506    /// The maximum number of entries return. The service may return fewer than this value.
6507    /// If unspecified, at most `50` entries will be returned.
6508    /// The maximum value is `1000`; values above `1000` will be coerced to `1000`.
6509    #[prost(uint32, optional, tag = "2")]
6510    pub page_size: ::core::option::Option<u32>,
6511    /// A page token, received from a previous `ListOwnedObjects` call.
6512    /// Provide this to retrieve the subsequent page.
6513    ///
6514    /// When paginating, all other parameters provided to `ListOwnedObjects` must
6515    /// match the call that provided the page token.
6516    #[prost(bytes = "bytes", optional, tag = "3")]
6517    pub page_token: ::core::option::Option<::prost::bytes::Bytes>,
6518    /// Mask specifying which fields to read.
6519    /// If no mask is specified, defaults to `object_id,version,object_type`.
6520    #[prost(message, optional, tag = "4")]
6521    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
6522    /// Optional type filter to limit the types of objects listed.
6523    ///
6524    /// Providing an object type with no type params will return objects of that
6525    /// type with any type parameter, e.g. `0x2::coin::Coin` will return all
6526    /// `Coin<T>` objects regardless of the type parameter `T`. Providing a type
6527    /// with a type param will restrict the returned objects to only those objects
6528    /// that match the provided type parameters, e.g.
6529    /// `0x2::coin::Coin<0x2::sui::SUI>` will only return `Coin<SUI>` objects.
6530    #[prost(string, optional, tag = "5")]
6531    pub object_type: ::core::option::Option<::prost::alloc::string::String>,
6532}
6533#[non_exhaustive]
6534#[derive(Clone, PartialEq, ::prost::Message)]
6535pub struct ListOwnedObjectsResponse {
6536    /// Page of dynamic fields owned by the specified parent.
6537    #[prost(message, repeated, tag = "1")]
6538    pub objects: ::prost::alloc::vec::Vec<Object>,
6539    /// A token, which can be sent as `page_token` to retrieve the next page.
6540    /// If this field is omitted, there are no subsequent pages.
6541    #[prost(bytes = "bytes", optional, tag = "2")]
6542    pub next_page_token: ::core::option::Option<::prost::bytes::Bytes>,
6543}
6544/// Generated client implementations.
6545pub mod state_service_client {
6546    #![allow(
6547        unused_variables,
6548        dead_code,
6549        missing_docs,
6550        clippy::wildcard_imports,
6551        clippy::let_unit_value,
6552    )]
6553    use tonic::codegen::*;
6554    use tonic::codegen::http::Uri;
6555    #[derive(Debug, Clone)]
6556    pub struct StateServiceClient<T> {
6557        inner: tonic::client::Grpc<T>,
6558    }
6559    impl StateServiceClient<tonic::transport::Channel> {
6560        /// Attempt to create a new client by connecting to a given endpoint.
6561        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
6562        where
6563            D: TryInto<tonic::transport::Endpoint>,
6564            D::Error: Into<StdError>,
6565        {
6566            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
6567            Ok(Self::new(conn))
6568        }
6569    }
6570    impl<T> StateServiceClient<T>
6571    where
6572        T: tonic::client::GrpcService<tonic::body::Body>,
6573        T::Error: Into<StdError>,
6574        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
6575        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
6576    {
6577        pub fn new(inner: T) -> Self {
6578            let inner = tonic::client::Grpc::new(inner);
6579            Self { inner }
6580        }
6581        pub fn with_origin(inner: T, origin: Uri) -> Self {
6582            let inner = tonic::client::Grpc::with_origin(inner, origin);
6583            Self { inner }
6584        }
6585        pub fn with_interceptor<F>(
6586            inner: T,
6587            interceptor: F,
6588        ) -> StateServiceClient<InterceptedService<T, F>>
6589        where
6590            F: tonic::service::Interceptor,
6591            T::ResponseBody: Default,
6592            T: tonic::codegen::Service<
6593                http::Request<tonic::body::Body>,
6594                Response = http::Response<
6595                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
6596                >,
6597            >,
6598            <T as tonic::codegen::Service<
6599                http::Request<tonic::body::Body>,
6600            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
6601        {
6602            StateServiceClient::new(InterceptedService::new(inner, interceptor))
6603        }
6604        /// Compress requests with the given encoding.
6605        ///
6606        /// This requires the server to support it otherwise it might respond with an
6607        /// error.
6608        #[must_use]
6609        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6610            self.inner = self.inner.send_compressed(encoding);
6611            self
6612        }
6613        /// Enable decompressing responses.
6614        #[must_use]
6615        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6616            self.inner = self.inner.accept_compressed(encoding);
6617            self
6618        }
6619        /// Limits the maximum size of a decoded message.
6620        ///
6621        /// Default: `4MB`
6622        #[must_use]
6623        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6624            self.inner = self.inner.max_decoding_message_size(limit);
6625            self
6626        }
6627        /// Limits the maximum size of an encoded message.
6628        ///
6629        /// Default: `usize::MAX`
6630        #[must_use]
6631        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6632            self.inner = self.inner.max_encoding_message_size(limit);
6633            self
6634        }
6635        pub async fn list_dynamic_fields(
6636            &mut self,
6637            request: impl tonic::IntoRequest<super::ListDynamicFieldsRequest>,
6638        ) -> std::result::Result<
6639            tonic::Response<super::ListDynamicFieldsResponse>,
6640            tonic::Status,
6641        > {
6642            self.inner
6643                .ready()
6644                .await
6645                .map_err(|e| {
6646                    tonic::Status::unknown(
6647                        format!("Service was not ready: {}", e.into()),
6648                    )
6649                })?;
6650            let codec = tonic_prost::ProstCodec::default();
6651            let path = http::uri::PathAndQuery::from_static(
6652                "/sui.rpc.v2.StateService/ListDynamicFields",
6653            );
6654            let mut req = request.into_request();
6655            req.extensions_mut()
6656                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListDynamicFields"));
6657            self.inner.unary(req, path, codec).await
6658        }
6659        pub async fn list_owned_objects(
6660            &mut self,
6661            request: impl tonic::IntoRequest<super::ListOwnedObjectsRequest>,
6662        ) -> std::result::Result<
6663            tonic::Response<super::ListOwnedObjectsResponse>,
6664            tonic::Status,
6665        > {
6666            self.inner
6667                .ready()
6668                .await
6669                .map_err(|e| {
6670                    tonic::Status::unknown(
6671                        format!("Service was not ready: {}", e.into()),
6672                    )
6673                })?;
6674            let codec = tonic_prost::ProstCodec::default();
6675            let path = http::uri::PathAndQuery::from_static(
6676                "/sui.rpc.v2.StateService/ListOwnedObjects",
6677            );
6678            let mut req = request.into_request();
6679            req.extensions_mut()
6680                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListOwnedObjects"));
6681            self.inner.unary(req, path, codec).await
6682        }
6683        pub async fn get_coin_info(
6684            &mut self,
6685            request: impl tonic::IntoRequest<super::GetCoinInfoRequest>,
6686        ) -> std::result::Result<
6687            tonic::Response<super::GetCoinInfoResponse>,
6688            tonic::Status,
6689        > {
6690            self.inner
6691                .ready()
6692                .await
6693                .map_err(|e| {
6694                    tonic::Status::unknown(
6695                        format!("Service was not ready: {}", e.into()),
6696                    )
6697                })?;
6698            let codec = tonic_prost::ProstCodec::default();
6699            let path = http::uri::PathAndQuery::from_static(
6700                "/sui.rpc.v2.StateService/GetCoinInfo",
6701            );
6702            let mut req = request.into_request();
6703            req.extensions_mut()
6704                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetCoinInfo"));
6705            self.inner.unary(req, path, codec).await
6706        }
6707        pub async fn get_balance(
6708            &mut self,
6709            request: impl tonic::IntoRequest<super::GetBalanceRequest>,
6710        ) -> std::result::Result<
6711            tonic::Response<super::GetBalanceResponse>,
6712            tonic::Status,
6713        > {
6714            self.inner
6715                .ready()
6716                .await
6717                .map_err(|e| {
6718                    tonic::Status::unknown(
6719                        format!("Service was not ready: {}", e.into()),
6720                    )
6721                })?;
6722            let codec = tonic_prost::ProstCodec::default();
6723            let path = http::uri::PathAndQuery::from_static(
6724                "/sui.rpc.v2.StateService/GetBalance",
6725            );
6726            let mut req = request.into_request();
6727            req.extensions_mut()
6728                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "GetBalance"));
6729            self.inner.unary(req, path, codec).await
6730        }
6731        pub async fn list_balances(
6732            &mut self,
6733            request: impl tonic::IntoRequest<super::ListBalancesRequest>,
6734        ) -> std::result::Result<
6735            tonic::Response<super::ListBalancesResponse>,
6736            tonic::Status,
6737        > {
6738            self.inner
6739                .ready()
6740                .await
6741                .map_err(|e| {
6742                    tonic::Status::unknown(
6743                        format!("Service was not ready: {}", e.into()),
6744                    )
6745                })?;
6746            let codec = tonic_prost::ProstCodec::default();
6747            let path = http::uri::PathAndQuery::from_static(
6748                "/sui.rpc.v2.StateService/ListBalances",
6749            );
6750            let mut req = request.into_request();
6751            req.extensions_mut()
6752                .insert(GrpcMethod::new("sui.rpc.v2.StateService", "ListBalances"));
6753            self.inner.unary(req, path, codec).await
6754        }
6755    }
6756}
6757/// Generated server implementations.
6758pub mod state_service_server {
6759    #![allow(
6760        unused_variables,
6761        dead_code,
6762        missing_docs,
6763        clippy::wildcard_imports,
6764        clippy::let_unit_value,
6765    )]
6766    use tonic::codegen::*;
6767    /// Generated trait containing gRPC methods that should be implemented for use with StateServiceServer.
6768    #[async_trait]
6769    pub trait StateService: std::marker::Send + std::marker::Sync + 'static {
6770        async fn list_dynamic_fields(
6771            &self,
6772            request: tonic::Request<super::ListDynamicFieldsRequest>,
6773        ) -> std::result::Result<
6774            tonic::Response<super::ListDynamicFieldsResponse>,
6775            tonic::Status,
6776        > {
6777            Err(tonic::Status::unimplemented("Not yet implemented"))
6778        }
6779        async fn list_owned_objects(
6780            &self,
6781            request: tonic::Request<super::ListOwnedObjectsRequest>,
6782        ) -> std::result::Result<
6783            tonic::Response<super::ListOwnedObjectsResponse>,
6784            tonic::Status,
6785        > {
6786            Err(tonic::Status::unimplemented("Not yet implemented"))
6787        }
6788        async fn get_coin_info(
6789            &self,
6790            request: tonic::Request<super::GetCoinInfoRequest>,
6791        ) -> std::result::Result<
6792            tonic::Response<super::GetCoinInfoResponse>,
6793            tonic::Status,
6794        > {
6795            Err(tonic::Status::unimplemented("Not yet implemented"))
6796        }
6797        async fn get_balance(
6798            &self,
6799            request: tonic::Request<super::GetBalanceRequest>,
6800        ) -> std::result::Result<
6801            tonic::Response<super::GetBalanceResponse>,
6802            tonic::Status,
6803        > {
6804            Err(tonic::Status::unimplemented("Not yet implemented"))
6805        }
6806        async fn list_balances(
6807            &self,
6808            request: tonic::Request<super::ListBalancesRequest>,
6809        ) -> std::result::Result<
6810            tonic::Response<super::ListBalancesResponse>,
6811            tonic::Status,
6812        > {
6813            Err(tonic::Status::unimplemented("Not yet implemented"))
6814        }
6815    }
6816    #[derive(Debug)]
6817    pub struct StateServiceServer<T> {
6818        inner: Arc<T>,
6819        accept_compression_encodings: EnabledCompressionEncodings,
6820        send_compression_encodings: EnabledCompressionEncodings,
6821        max_decoding_message_size: Option<usize>,
6822        max_encoding_message_size: Option<usize>,
6823    }
6824    impl<T> StateServiceServer<T> {
6825        pub fn new(inner: T) -> Self {
6826            Self::from_arc(Arc::new(inner))
6827        }
6828        pub fn from_arc(inner: Arc<T>) -> Self {
6829            Self {
6830                inner,
6831                accept_compression_encodings: Default::default(),
6832                send_compression_encodings: Default::default(),
6833                max_decoding_message_size: None,
6834                max_encoding_message_size: None,
6835            }
6836        }
6837        pub fn with_interceptor<F>(
6838            inner: T,
6839            interceptor: F,
6840        ) -> InterceptedService<Self, F>
6841        where
6842            F: tonic::service::Interceptor,
6843        {
6844            InterceptedService::new(Self::new(inner), interceptor)
6845        }
6846        /// Enable decompressing requests with the given encoding.
6847        #[must_use]
6848        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
6849            self.accept_compression_encodings.enable(encoding);
6850            self
6851        }
6852        /// Compress responses with the given encoding, if the client supports it.
6853        #[must_use]
6854        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
6855            self.send_compression_encodings.enable(encoding);
6856            self
6857        }
6858        /// Limits the maximum size of a decoded message.
6859        ///
6860        /// Default: `4MB`
6861        #[must_use]
6862        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
6863            self.max_decoding_message_size = Some(limit);
6864            self
6865        }
6866        /// Limits the maximum size of an encoded message.
6867        ///
6868        /// Default: `usize::MAX`
6869        #[must_use]
6870        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
6871            self.max_encoding_message_size = Some(limit);
6872            self
6873        }
6874    }
6875    impl<T, B> tonic::codegen::Service<http::Request<B>> for StateServiceServer<T>
6876    where
6877        T: StateService,
6878        B: Body + std::marker::Send + 'static,
6879        B::Error: Into<StdError> + std::marker::Send + 'static,
6880    {
6881        type Response = http::Response<tonic::body::Body>;
6882        type Error = std::convert::Infallible;
6883        type Future = BoxFuture<Self::Response, Self::Error>;
6884        fn poll_ready(
6885            &mut self,
6886            _cx: &mut Context<'_>,
6887        ) -> Poll<std::result::Result<(), Self::Error>> {
6888            Poll::Ready(Ok(()))
6889        }
6890        fn call(&mut self, req: http::Request<B>) -> Self::Future {
6891            match req.uri().path() {
6892                "/sui.rpc.v2.StateService/ListDynamicFields" => {
6893                    #[allow(non_camel_case_types)]
6894                    struct ListDynamicFieldsSvc<T: StateService>(pub Arc<T>);
6895                    impl<
6896                        T: StateService,
6897                    > tonic::server::UnaryService<super::ListDynamicFieldsRequest>
6898                    for ListDynamicFieldsSvc<T> {
6899                        type Response = super::ListDynamicFieldsResponse;
6900                        type Future = BoxFuture<
6901                            tonic::Response<Self::Response>,
6902                            tonic::Status,
6903                        >;
6904                        fn call(
6905                            &mut self,
6906                            request: tonic::Request<super::ListDynamicFieldsRequest>,
6907                        ) -> Self::Future {
6908                            let inner = Arc::clone(&self.0);
6909                            let fut = async move {
6910                                <T as StateService>::list_dynamic_fields(&inner, request)
6911                                    .await
6912                            };
6913                            Box::pin(fut)
6914                        }
6915                    }
6916                    let accept_compression_encodings = self.accept_compression_encodings;
6917                    let send_compression_encodings = self.send_compression_encodings;
6918                    let max_decoding_message_size = self.max_decoding_message_size;
6919                    let max_encoding_message_size = self.max_encoding_message_size;
6920                    let inner = self.inner.clone();
6921                    let fut = async move {
6922                        let method = ListDynamicFieldsSvc(inner);
6923                        let codec = tonic_prost::ProstCodec::default();
6924                        let mut grpc = tonic::server::Grpc::new(codec)
6925                            .apply_compression_config(
6926                                accept_compression_encodings,
6927                                send_compression_encodings,
6928                            )
6929                            .apply_max_message_size_config(
6930                                max_decoding_message_size,
6931                                max_encoding_message_size,
6932                            );
6933                        let res = grpc.unary(method, req).await;
6934                        Ok(res)
6935                    };
6936                    Box::pin(fut)
6937                }
6938                "/sui.rpc.v2.StateService/ListOwnedObjects" => {
6939                    #[allow(non_camel_case_types)]
6940                    struct ListOwnedObjectsSvc<T: StateService>(pub Arc<T>);
6941                    impl<
6942                        T: StateService,
6943                    > tonic::server::UnaryService<super::ListOwnedObjectsRequest>
6944                    for ListOwnedObjectsSvc<T> {
6945                        type Response = super::ListOwnedObjectsResponse;
6946                        type Future = BoxFuture<
6947                            tonic::Response<Self::Response>,
6948                            tonic::Status,
6949                        >;
6950                        fn call(
6951                            &mut self,
6952                            request: tonic::Request<super::ListOwnedObjectsRequest>,
6953                        ) -> Self::Future {
6954                            let inner = Arc::clone(&self.0);
6955                            let fut = async move {
6956                                <T as StateService>::list_owned_objects(&inner, request)
6957                                    .await
6958                            };
6959                            Box::pin(fut)
6960                        }
6961                    }
6962                    let accept_compression_encodings = self.accept_compression_encodings;
6963                    let send_compression_encodings = self.send_compression_encodings;
6964                    let max_decoding_message_size = self.max_decoding_message_size;
6965                    let max_encoding_message_size = self.max_encoding_message_size;
6966                    let inner = self.inner.clone();
6967                    let fut = async move {
6968                        let method = ListOwnedObjectsSvc(inner);
6969                        let codec = tonic_prost::ProstCodec::default();
6970                        let mut grpc = tonic::server::Grpc::new(codec)
6971                            .apply_compression_config(
6972                                accept_compression_encodings,
6973                                send_compression_encodings,
6974                            )
6975                            .apply_max_message_size_config(
6976                                max_decoding_message_size,
6977                                max_encoding_message_size,
6978                            );
6979                        let res = grpc.unary(method, req).await;
6980                        Ok(res)
6981                    };
6982                    Box::pin(fut)
6983                }
6984                "/sui.rpc.v2.StateService/GetCoinInfo" => {
6985                    #[allow(non_camel_case_types)]
6986                    struct GetCoinInfoSvc<T: StateService>(pub Arc<T>);
6987                    impl<
6988                        T: StateService,
6989                    > tonic::server::UnaryService<super::GetCoinInfoRequest>
6990                    for GetCoinInfoSvc<T> {
6991                        type Response = super::GetCoinInfoResponse;
6992                        type Future = BoxFuture<
6993                            tonic::Response<Self::Response>,
6994                            tonic::Status,
6995                        >;
6996                        fn call(
6997                            &mut self,
6998                            request: tonic::Request<super::GetCoinInfoRequest>,
6999                        ) -> Self::Future {
7000                            let inner = Arc::clone(&self.0);
7001                            let fut = async move {
7002                                <T as StateService>::get_coin_info(&inner, request).await
7003                            };
7004                            Box::pin(fut)
7005                        }
7006                    }
7007                    let accept_compression_encodings = self.accept_compression_encodings;
7008                    let send_compression_encodings = self.send_compression_encodings;
7009                    let max_decoding_message_size = self.max_decoding_message_size;
7010                    let max_encoding_message_size = self.max_encoding_message_size;
7011                    let inner = self.inner.clone();
7012                    let fut = async move {
7013                        let method = GetCoinInfoSvc(inner);
7014                        let codec = tonic_prost::ProstCodec::default();
7015                        let mut grpc = tonic::server::Grpc::new(codec)
7016                            .apply_compression_config(
7017                                accept_compression_encodings,
7018                                send_compression_encodings,
7019                            )
7020                            .apply_max_message_size_config(
7021                                max_decoding_message_size,
7022                                max_encoding_message_size,
7023                            );
7024                        let res = grpc.unary(method, req).await;
7025                        Ok(res)
7026                    };
7027                    Box::pin(fut)
7028                }
7029                "/sui.rpc.v2.StateService/GetBalance" => {
7030                    #[allow(non_camel_case_types)]
7031                    struct GetBalanceSvc<T: StateService>(pub Arc<T>);
7032                    impl<
7033                        T: StateService,
7034                    > tonic::server::UnaryService<super::GetBalanceRequest>
7035                    for GetBalanceSvc<T> {
7036                        type Response = super::GetBalanceResponse;
7037                        type Future = BoxFuture<
7038                            tonic::Response<Self::Response>,
7039                            tonic::Status,
7040                        >;
7041                        fn call(
7042                            &mut self,
7043                            request: tonic::Request<super::GetBalanceRequest>,
7044                        ) -> Self::Future {
7045                            let inner = Arc::clone(&self.0);
7046                            let fut = async move {
7047                                <T as StateService>::get_balance(&inner, request).await
7048                            };
7049                            Box::pin(fut)
7050                        }
7051                    }
7052                    let accept_compression_encodings = self.accept_compression_encodings;
7053                    let send_compression_encodings = self.send_compression_encodings;
7054                    let max_decoding_message_size = self.max_decoding_message_size;
7055                    let max_encoding_message_size = self.max_encoding_message_size;
7056                    let inner = self.inner.clone();
7057                    let fut = async move {
7058                        let method = GetBalanceSvc(inner);
7059                        let codec = tonic_prost::ProstCodec::default();
7060                        let mut grpc = tonic::server::Grpc::new(codec)
7061                            .apply_compression_config(
7062                                accept_compression_encodings,
7063                                send_compression_encodings,
7064                            )
7065                            .apply_max_message_size_config(
7066                                max_decoding_message_size,
7067                                max_encoding_message_size,
7068                            );
7069                        let res = grpc.unary(method, req).await;
7070                        Ok(res)
7071                    };
7072                    Box::pin(fut)
7073                }
7074                "/sui.rpc.v2.StateService/ListBalances" => {
7075                    #[allow(non_camel_case_types)]
7076                    struct ListBalancesSvc<T: StateService>(pub Arc<T>);
7077                    impl<
7078                        T: StateService,
7079                    > tonic::server::UnaryService<super::ListBalancesRequest>
7080                    for ListBalancesSvc<T> {
7081                        type Response = super::ListBalancesResponse;
7082                        type Future = BoxFuture<
7083                            tonic::Response<Self::Response>,
7084                            tonic::Status,
7085                        >;
7086                        fn call(
7087                            &mut self,
7088                            request: tonic::Request<super::ListBalancesRequest>,
7089                        ) -> Self::Future {
7090                            let inner = Arc::clone(&self.0);
7091                            let fut = async move {
7092                                <T as StateService>::list_balances(&inner, request).await
7093                            };
7094                            Box::pin(fut)
7095                        }
7096                    }
7097                    let accept_compression_encodings = self.accept_compression_encodings;
7098                    let send_compression_encodings = self.send_compression_encodings;
7099                    let max_decoding_message_size = self.max_decoding_message_size;
7100                    let max_encoding_message_size = self.max_encoding_message_size;
7101                    let inner = self.inner.clone();
7102                    let fut = async move {
7103                        let method = ListBalancesSvc(inner);
7104                        let codec = tonic_prost::ProstCodec::default();
7105                        let mut grpc = tonic::server::Grpc::new(codec)
7106                            .apply_compression_config(
7107                                accept_compression_encodings,
7108                                send_compression_encodings,
7109                            )
7110                            .apply_max_message_size_config(
7111                                max_decoding_message_size,
7112                                max_encoding_message_size,
7113                            );
7114                        let res = grpc.unary(method, req).await;
7115                        Ok(res)
7116                    };
7117                    Box::pin(fut)
7118                }
7119                _ => {
7120                    Box::pin(async move {
7121                        let mut response = http::Response::new(
7122                            tonic::body::Body::default(),
7123                        );
7124                        let headers = response.headers_mut();
7125                        headers
7126                            .insert(
7127                                tonic::Status::GRPC_STATUS,
7128                                (tonic::Code::Unimplemented as i32).into(),
7129                            );
7130                        headers
7131                            .insert(
7132                                http::header::CONTENT_TYPE,
7133                                tonic::metadata::GRPC_CONTENT_TYPE,
7134                            );
7135                        Ok(response)
7136                    })
7137                }
7138            }
7139        }
7140    }
7141    impl<T> Clone for StateServiceServer<T> {
7142        fn clone(&self) -> Self {
7143            let inner = self.inner.clone();
7144            Self {
7145                inner,
7146                accept_compression_encodings: self.accept_compression_encodings,
7147                send_compression_encodings: self.send_compression_encodings,
7148                max_decoding_message_size: self.max_decoding_message_size,
7149                max_encoding_message_size: self.max_encoding_message_size,
7150            }
7151        }
7152    }
7153    /// Generated gRPC service name
7154    pub const SERVICE_NAME: &str = "sui.rpc.v2.StateService";
7155    impl<T> tonic::server::NamedService for StateServiceServer<T> {
7156        const NAME: &'static str = SERVICE_NAME;
7157    }
7158}
7159/// Request message for SubscriptionService.SubscribeCheckpoints.
7160#[derive(Eq, Hash)]
7161#[non_exhaustive]
7162#[derive(Clone, PartialEq, ::prost::Message)]
7163pub struct SubscribeCheckpointsRequest {
7164    /// Optional. Mask for specifying which parts of the Checkpoint should be
7165    /// returned (e.g. summary, contents, signatures). `cursor` is always
7166    /// populated and is not subject to the mask.
7167    #[prost(message, optional, tag = "1")]
7168    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7169    /// Optional. DNF filter over indexed transaction dimensions. A checkpoint
7170    /// matches if any transaction it contains satisfies the filter. If absent,
7171    /// every checkpoint is streamed.
7172    #[prost(message, optional, tag = "2")]
7173    pub filter: ::core::option::Option<TransactionFilter>,
7174}
7175/// Response message for SubscriptionService.SubscribeCheckpoints.
7176///
7177/// A checkpoint stream's position is checkpoint-granular, so the `cursor`
7178/// sequence number stands in for the `Watermark` message the other
7179/// subscription responses carry. Progress-only frames (with `checkpoint`
7180/// unset) occur only on filtered streams: on an unfiltered stream every frame
7181/// carries both fields, in order and without gaps.
7182#[non_exhaustive]
7183#[derive(Clone, PartialEq, ::prost::Message)]
7184pub struct SubscribeCheckpointsResponse {
7185    /// Required. The checkpoint sequence number the stream has fully covered,
7186    /// inclusive: every matching checkpoint from the stream's start position
7187    /// through `cursor` has been delivered. Present on every frame and
7188    /// advances monotonically.
7189    #[prost(uint64, optional, tag = "1")]
7190    pub cursor: ::core::option::Option<u64>,
7191    /// The matching checkpoint. Unset when this frame only advances the
7192    /// cursor past non-matching checkpoints.
7193    #[prost(message, optional, tag = "2")]
7194    pub checkpoint: ::core::option::Option<Checkpoint>,
7195}
7196/// Request message for SubscriptionService.SubscribeTransactions.
7197#[non_exhaustive]
7198#[derive(Clone, PartialEq, ::prost::Message)]
7199pub struct SubscribeTransactionsRequest {
7200    /// Optional. Mask for specifying which parts of the ExecutedTransaction
7201    /// should be returned.
7202    #[prost(message, optional, tag = "1")]
7203    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7204    /// Optional. DNF filter over indexed dimensions. If absent, every
7205    /// transaction is streamed.
7206    #[prost(message, optional, tag = "2")]
7207    pub filter: ::core::option::Option<TransactionFilter>,
7208}
7209/// Response message for SubscriptionService.SubscribeTransactions.
7210///
7211/// Mirrors ListTransactionsResponse, except there is no `end` field: a
7212/// subscription stream has no successful end.
7213#[non_exhaustive]
7214#[derive(Clone, PartialEq, ::prost::Message)]
7215pub struct SubscribeTransactionsResponse {
7216    /// One matching transaction. Its position within the containing checkpoint
7217    /// is reported by `ExecutedTransaction.transaction_index`.
7218    #[prost(message, optional, tag = "1")]
7219    pub transaction: ::core::option::Option<ExecutedTransaction>,
7220    /// Progress watermark as of this frame. Present on every frame.
7221    #[prost(message, optional, tag = "2")]
7222    pub watermark: ::core::option::Option<Watermark>,
7223}
7224/// Request message for SubscriptionService.SubscribeEvents.
7225#[non_exhaustive]
7226#[derive(Clone, PartialEq, ::prost::Message)]
7227pub struct SubscribeEventsRequest {
7228    /// Optional. Mask for specifying which parts of the Event should be
7229    /// returned.
7230    #[prost(message, optional, tag = "1")]
7231    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
7232    /// Optional. DNF filter over indexed dimensions. If absent, every event is
7233    /// streamed.
7234    #[prost(message, optional, tag = "2")]
7235    pub filter: ::core::option::Option<EventFilter>,
7236}
7237/// Response message for SubscriptionService.SubscribeEvents.
7238///
7239/// Mirrors ListEventsResponse, except there is no `end` field: a subscription
7240/// stream has no successful end.
7241#[non_exhaustive]
7242#[derive(Clone, PartialEq, ::prost::Message)]
7243pub struct SubscribeEventsResponse {
7244    /// One matching event. Its ledger position -- containing checkpoint,
7245    /// emitting transaction digest and offset, and index within that
7246    /// transaction's event list -- is reported by the corresponding fields on
7247    /// `Event`.
7248    #[prost(message, optional, tag = "1")]
7249    pub event: ::core::option::Option<Event>,
7250    /// Progress watermark as of this frame. Present on every frame.
7251    #[prost(message, optional, tag = "2")]
7252    pub watermark: ::core::option::Option<Watermark>,
7253}
7254/// Generated client implementations.
7255pub mod subscription_service_client {
7256    #![allow(
7257        unused_variables,
7258        dead_code,
7259        missing_docs,
7260        clippy::wildcard_imports,
7261        clippy::let_unit_value,
7262    )]
7263    use tonic::codegen::*;
7264    use tonic::codegen::http::Uri;
7265    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7266    /// transactions, and events.
7267    ///
7268    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7269    /// requests take the same filter message, and responses carry the same item
7270    /// and watermark shapes with identical cursor semantics.
7271    ///
7272    /// Subscriptions do not support resumption. A new subscription always begins
7273    /// at the current tip of the chain as seen by the server (the latest executed
7274    /// checkpoint). To recover data missed between subscriptions, replay the gap
7275    /// with the paired List API: pass the last received `Watermark.cursor` as
7276    /// `options.after` on the List request (for checkpoints, pass the last
7277    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7278    /// indexed tip, which may trail the subscription's start position; repeat the
7279    /// List call as the index advances until the replay reaches the position
7280    /// established by the subscription's first frame.
7281    ///
7282    /// A subscription behaves like an unbounded ascending scan: every frame
7283    /// carries the subscriber's resume point, and progress advances as
7284    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7285    /// filters live: the first frame on a filtered subscription is a
7286    /// progress-only frame establishing the stream's start position, and
7287    /// progress continues to advance with bounded staleness even when no item
7288    /// matches.
7289    ///
7290    /// Subscription streams have no successful end: they run until cancelled by
7291    /// the client or terminated by the server with a gRPC status.
7292    #[derive(Debug, Clone)]
7293    pub struct SubscriptionServiceClient<T> {
7294        inner: tonic::client::Grpc<T>,
7295    }
7296    impl SubscriptionServiceClient<tonic::transport::Channel> {
7297        /// Attempt to create a new client by connecting to a given endpoint.
7298        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
7299        where
7300            D: TryInto<tonic::transport::Endpoint>,
7301            D::Error: Into<StdError>,
7302        {
7303            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
7304            Ok(Self::new(conn))
7305        }
7306    }
7307    impl<T> SubscriptionServiceClient<T>
7308    where
7309        T: tonic::client::GrpcService<tonic::body::Body>,
7310        T::Error: Into<StdError>,
7311        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
7312        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
7313    {
7314        pub fn new(inner: T) -> Self {
7315            let inner = tonic::client::Grpc::new(inner);
7316            Self { inner }
7317        }
7318        pub fn with_origin(inner: T, origin: Uri) -> Self {
7319            let inner = tonic::client::Grpc::with_origin(inner, origin);
7320            Self { inner }
7321        }
7322        pub fn with_interceptor<F>(
7323            inner: T,
7324            interceptor: F,
7325        ) -> SubscriptionServiceClient<InterceptedService<T, F>>
7326        where
7327            F: tonic::service::Interceptor,
7328            T::ResponseBody: Default,
7329            T: tonic::codegen::Service<
7330                http::Request<tonic::body::Body>,
7331                Response = http::Response<
7332                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
7333                >,
7334            >,
7335            <T as tonic::codegen::Service<
7336                http::Request<tonic::body::Body>,
7337            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
7338        {
7339            SubscriptionServiceClient::new(InterceptedService::new(inner, interceptor))
7340        }
7341        /// Compress requests with the given encoding.
7342        ///
7343        /// This requires the server to support it otherwise it might respond with an
7344        /// error.
7345        #[must_use]
7346        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7347            self.inner = self.inner.send_compressed(encoding);
7348            self
7349        }
7350        /// Enable decompressing responses.
7351        #[must_use]
7352        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7353            self.inner = self.inner.accept_compressed(encoding);
7354            self
7355        }
7356        /// Limits the maximum size of a decoded message.
7357        ///
7358        /// Default: `4MB`
7359        #[must_use]
7360        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7361            self.inner = self.inner.max_decoding_message_size(limit);
7362            self
7363        }
7364        /// Limits the maximum size of an encoded message.
7365        ///
7366        /// Default: `usize::MAX`
7367        #[must_use]
7368        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7369            self.inner = self.inner.max_encoding_message_size(limit);
7370            self
7371        }
7372        /// Subscribe to the stream of checkpoints.
7373        ///
7374        /// The stream begins at the latest executed checkpoint as seen by the
7375        /// server and yields checkpoints matching the filter as they are executed.
7376        /// A checkpoint matches if any transaction it contains satisfies the
7377        /// filter.
7378        pub async fn subscribe_checkpoints(
7379            &mut self,
7380            request: impl tonic::IntoRequest<super::SubscribeCheckpointsRequest>,
7381        ) -> std::result::Result<
7382            tonic::Response<
7383                tonic::codec::Streaming<super::SubscribeCheckpointsResponse>,
7384            >,
7385            tonic::Status,
7386        > {
7387            self.inner
7388                .ready()
7389                .await
7390                .map_err(|e| {
7391                    tonic::Status::unknown(
7392                        format!("Service was not ready: {}", e.into()),
7393                    )
7394                })?;
7395            let codec = tonic_prost::ProstCodec::default();
7396            let path = http::uri::PathAndQuery::from_static(
7397                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints",
7398            );
7399            let mut req = request.into_request();
7400            req.extensions_mut()
7401                .insert(
7402                    GrpcMethod::new(
7403                        "sui.rpc.v2.SubscriptionService",
7404                        "SubscribeCheckpoints",
7405                    ),
7406                );
7407            self.inner.server_streaming(req, path, codec).await
7408        }
7409        /// Subscribe to the stream of transactions.
7410        ///
7411        /// The stream begins at the latest executed checkpoint as seen by the
7412        /// server and yields transactions matching the filter as they are executed.
7413        pub async fn subscribe_transactions(
7414            &mut self,
7415            request: impl tonic::IntoRequest<super::SubscribeTransactionsRequest>,
7416        ) -> std::result::Result<
7417            tonic::Response<
7418                tonic::codec::Streaming<super::SubscribeTransactionsResponse>,
7419            >,
7420            tonic::Status,
7421        > {
7422            self.inner
7423                .ready()
7424                .await
7425                .map_err(|e| {
7426                    tonic::Status::unknown(
7427                        format!("Service was not ready: {}", e.into()),
7428                    )
7429                })?;
7430            let codec = tonic_prost::ProstCodec::default();
7431            let path = http::uri::PathAndQuery::from_static(
7432                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions",
7433            );
7434            let mut req = request.into_request();
7435            req.extensions_mut()
7436                .insert(
7437                    GrpcMethod::new(
7438                        "sui.rpc.v2.SubscriptionService",
7439                        "SubscribeTransactions",
7440                    ),
7441                );
7442            self.inner.server_streaming(req, path, codec).await
7443        }
7444        /// Subscribe to the stream of events.
7445        ///
7446        /// The stream begins at the latest executed checkpoint as seen by the
7447        /// server and yields events matching the filter as they are emitted.
7448        pub async fn subscribe_events(
7449            &mut self,
7450            request: impl tonic::IntoRequest<super::SubscribeEventsRequest>,
7451        ) -> std::result::Result<
7452            tonic::Response<tonic::codec::Streaming<super::SubscribeEventsResponse>>,
7453            tonic::Status,
7454        > {
7455            self.inner
7456                .ready()
7457                .await
7458                .map_err(|e| {
7459                    tonic::Status::unknown(
7460                        format!("Service was not ready: {}", e.into()),
7461                    )
7462                })?;
7463            let codec = tonic_prost::ProstCodec::default();
7464            let path = http::uri::PathAndQuery::from_static(
7465                "/sui.rpc.v2.SubscriptionService/SubscribeEvents",
7466            );
7467            let mut req = request.into_request();
7468            req.extensions_mut()
7469                .insert(
7470                    GrpcMethod::new("sui.rpc.v2.SubscriptionService", "SubscribeEvents"),
7471                );
7472            self.inner.server_streaming(req, path, codec).await
7473        }
7474    }
7475}
7476/// Generated server implementations.
7477pub mod subscription_service_server {
7478    #![allow(
7479        unused_variables,
7480        dead_code,
7481        missing_docs,
7482        clippy::wildcard_imports,
7483        clippy::let_unit_value,
7484    )]
7485    use tonic::codegen::*;
7486    /// Generated trait containing gRPC methods that should be implemented for use with SubscriptionServiceServer.
7487    #[async_trait]
7488    pub trait SubscriptionService: std::marker::Send + std::marker::Sync + 'static {
7489        /// Subscribe to the stream of checkpoints.
7490        ///
7491        /// The stream begins at the latest executed checkpoint as seen by the
7492        /// server and yields checkpoints matching the filter as they are executed.
7493        /// A checkpoint matches if any transaction it contains satisfies the
7494        /// filter.
7495        async fn subscribe_checkpoints(
7496            &self,
7497            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7498        ) -> std::result::Result<
7499            tonic::Response<BoxStream<super::SubscribeCheckpointsResponse>>,
7500            tonic::Status,
7501        > {
7502            Err(tonic::Status::unimplemented("Not yet implemented"))
7503        }
7504        /// Subscribe to the stream of transactions.
7505        ///
7506        /// The stream begins at the latest executed checkpoint as seen by the
7507        /// server and yields transactions matching the filter as they are executed.
7508        async fn subscribe_transactions(
7509            &self,
7510            request: tonic::Request<super::SubscribeTransactionsRequest>,
7511        ) -> std::result::Result<
7512            tonic::Response<BoxStream<super::SubscribeTransactionsResponse>>,
7513            tonic::Status,
7514        > {
7515            Err(tonic::Status::unimplemented("Not yet implemented"))
7516        }
7517        /// Subscribe to the stream of events.
7518        ///
7519        /// The stream begins at the latest executed checkpoint as seen by the
7520        /// server and yields events matching the filter as they are emitted.
7521        async fn subscribe_events(
7522            &self,
7523            request: tonic::Request<super::SubscribeEventsRequest>,
7524        ) -> std::result::Result<
7525            tonic::Response<BoxStream<super::SubscribeEventsResponse>>,
7526            tonic::Status,
7527        > {
7528            Err(tonic::Status::unimplemented("Not yet implemented"))
7529        }
7530    }
7531    /// SubscriptionService provides filtered, real-time streams of checkpoints,
7532    /// transactions, and events.
7533    ///
7534    /// Each Subscribe API pairs with the LedgerService List API of the same name:
7535    /// requests take the same filter message, and responses carry the same item
7536    /// and watermark shapes with identical cursor semantics.
7537    ///
7538    /// Subscriptions do not support resumption. A new subscription always begins
7539    /// at the current tip of the chain as seen by the server (the latest executed
7540    /// checkpoint). To recover data missed between subscriptions, replay the gap
7541    /// with the paired List API: pass the last received `Watermark.cursor` as
7542    /// `options.after` on the List request (for checkpoints, pass the last
7543    /// received `cursor + 1` as `start_checkpoint`). The List scan reads from the
7544    /// indexed tip, which may trail the subscription's start position; repeat the
7545    /// List call as the index advances until the replay reaches the position
7546    /// established by the subscription's first frame.
7547    ///
7548    /// A subscription behaves like an unbounded ascending scan: every frame
7549    /// carries the subscriber's resume point, and progress advances as
7550    /// checkpoints are fully covered. Two delivery guarantees keep sparse
7551    /// filters live: the first frame on a filtered subscription is a
7552    /// progress-only frame establishing the stream's start position, and
7553    /// progress continues to advance with bounded staleness even when no item
7554    /// matches.
7555    ///
7556    /// Subscription streams have no successful end: they run until cancelled by
7557    /// the client or terminated by the server with a gRPC status.
7558    #[derive(Debug)]
7559    pub struct SubscriptionServiceServer<T> {
7560        inner: Arc<T>,
7561        accept_compression_encodings: EnabledCompressionEncodings,
7562        send_compression_encodings: EnabledCompressionEncodings,
7563        max_decoding_message_size: Option<usize>,
7564        max_encoding_message_size: Option<usize>,
7565    }
7566    impl<T> SubscriptionServiceServer<T> {
7567        pub fn new(inner: T) -> Self {
7568            Self::from_arc(Arc::new(inner))
7569        }
7570        pub fn from_arc(inner: Arc<T>) -> Self {
7571            Self {
7572                inner,
7573                accept_compression_encodings: Default::default(),
7574                send_compression_encodings: Default::default(),
7575                max_decoding_message_size: None,
7576                max_encoding_message_size: None,
7577            }
7578        }
7579        pub fn with_interceptor<F>(
7580            inner: T,
7581            interceptor: F,
7582        ) -> InterceptedService<Self, F>
7583        where
7584            F: tonic::service::Interceptor,
7585        {
7586            InterceptedService::new(Self::new(inner), interceptor)
7587        }
7588        /// Enable decompressing requests with the given encoding.
7589        #[must_use]
7590        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
7591            self.accept_compression_encodings.enable(encoding);
7592            self
7593        }
7594        /// Compress responses with the given encoding, if the client supports it.
7595        #[must_use]
7596        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
7597            self.send_compression_encodings.enable(encoding);
7598            self
7599        }
7600        /// Limits the maximum size of a decoded message.
7601        ///
7602        /// Default: `4MB`
7603        #[must_use]
7604        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
7605            self.max_decoding_message_size = Some(limit);
7606            self
7607        }
7608        /// Limits the maximum size of an encoded message.
7609        ///
7610        /// Default: `usize::MAX`
7611        #[must_use]
7612        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
7613            self.max_encoding_message_size = Some(limit);
7614            self
7615        }
7616    }
7617    impl<T, B> tonic::codegen::Service<http::Request<B>> for SubscriptionServiceServer<T>
7618    where
7619        T: SubscriptionService,
7620        B: Body + std::marker::Send + 'static,
7621        B::Error: Into<StdError> + std::marker::Send + 'static,
7622    {
7623        type Response = http::Response<tonic::body::Body>;
7624        type Error = std::convert::Infallible;
7625        type Future = BoxFuture<Self::Response, Self::Error>;
7626        fn poll_ready(
7627            &mut self,
7628            _cx: &mut Context<'_>,
7629        ) -> Poll<std::result::Result<(), Self::Error>> {
7630            Poll::Ready(Ok(()))
7631        }
7632        fn call(&mut self, req: http::Request<B>) -> Self::Future {
7633            match req.uri().path() {
7634                "/sui.rpc.v2.SubscriptionService/SubscribeCheckpoints" => {
7635                    #[allow(non_camel_case_types)]
7636                    struct SubscribeCheckpointsSvc<T: SubscriptionService>(pub Arc<T>);
7637                    impl<
7638                        T: SubscriptionService,
7639                    > tonic::server::ServerStreamingService<
7640                        super::SubscribeCheckpointsRequest,
7641                    > for SubscribeCheckpointsSvc<T> {
7642                        type Response = super::SubscribeCheckpointsResponse;
7643                        type ResponseStream = BoxStream<
7644                            super::SubscribeCheckpointsResponse,
7645                        >;
7646                        type Future = BoxFuture<
7647                            tonic::Response<Self::ResponseStream>,
7648                            tonic::Status,
7649                        >;
7650                        fn call(
7651                            &mut self,
7652                            request: tonic::Request<super::SubscribeCheckpointsRequest>,
7653                        ) -> Self::Future {
7654                            let inner = Arc::clone(&self.0);
7655                            let fut = async move {
7656                                <T as SubscriptionService>::subscribe_checkpoints(
7657                                        &inner,
7658                                        request,
7659                                    )
7660                                    .await
7661                            };
7662                            Box::pin(fut)
7663                        }
7664                    }
7665                    let accept_compression_encodings = self.accept_compression_encodings;
7666                    let send_compression_encodings = self.send_compression_encodings;
7667                    let max_decoding_message_size = self.max_decoding_message_size;
7668                    let max_encoding_message_size = self.max_encoding_message_size;
7669                    let inner = self.inner.clone();
7670                    let fut = async move {
7671                        let method = SubscribeCheckpointsSvc(inner);
7672                        let codec = tonic_prost::ProstCodec::default();
7673                        let mut grpc = tonic::server::Grpc::new(codec)
7674                            .apply_compression_config(
7675                                accept_compression_encodings,
7676                                send_compression_encodings,
7677                            )
7678                            .apply_max_message_size_config(
7679                                max_decoding_message_size,
7680                                max_encoding_message_size,
7681                            );
7682                        let res = grpc.server_streaming(method, req).await;
7683                        Ok(res)
7684                    };
7685                    Box::pin(fut)
7686                }
7687                "/sui.rpc.v2.SubscriptionService/SubscribeTransactions" => {
7688                    #[allow(non_camel_case_types)]
7689                    struct SubscribeTransactionsSvc<T: SubscriptionService>(pub Arc<T>);
7690                    impl<
7691                        T: SubscriptionService,
7692                    > tonic::server::ServerStreamingService<
7693                        super::SubscribeTransactionsRequest,
7694                    > for SubscribeTransactionsSvc<T> {
7695                        type Response = super::SubscribeTransactionsResponse;
7696                        type ResponseStream = BoxStream<
7697                            super::SubscribeTransactionsResponse,
7698                        >;
7699                        type Future = BoxFuture<
7700                            tonic::Response<Self::ResponseStream>,
7701                            tonic::Status,
7702                        >;
7703                        fn call(
7704                            &mut self,
7705                            request: tonic::Request<super::SubscribeTransactionsRequest>,
7706                        ) -> Self::Future {
7707                            let inner = Arc::clone(&self.0);
7708                            let fut = async move {
7709                                <T as SubscriptionService>::subscribe_transactions(
7710                                        &inner,
7711                                        request,
7712                                    )
7713                                    .await
7714                            };
7715                            Box::pin(fut)
7716                        }
7717                    }
7718                    let accept_compression_encodings = self.accept_compression_encodings;
7719                    let send_compression_encodings = self.send_compression_encodings;
7720                    let max_decoding_message_size = self.max_decoding_message_size;
7721                    let max_encoding_message_size = self.max_encoding_message_size;
7722                    let inner = self.inner.clone();
7723                    let fut = async move {
7724                        let method = SubscribeTransactionsSvc(inner);
7725                        let codec = tonic_prost::ProstCodec::default();
7726                        let mut grpc = tonic::server::Grpc::new(codec)
7727                            .apply_compression_config(
7728                                accept_compression_encodings,
7729                                send_compression_encodings,
7730                            )
7731                            .apply_max_message_size_config(
7732                                max_decoding_message_size,
7733                                max_encoding_message_size,
7734                            );
7735                        let res = grpc.server_streaming(method, req).await;
7736                        Ok(res)
7737                    };
7738                    Box::pin(fut)
7739                }
7740                "/sui.rpc.v2.SubscriptionService/SubscribeEvents" => {
7741                    #[allow(non_camel_case_types)]
7742                    struct SubscribeEventsSvc<T: SubscriptionService>(pub Arc<T>);
7743                    impl<
7744                        T: SubscriptionService,
7745                    > tonic::server::ServerStreamingService<
7746                        super::SubscribeEventsRequest,
7747                    > for SubscribeEventsSvc<T> {
7748                        type Response = super::SubscribeEventsResponse;
7749                        type ResponseStream = BoxStream<super::SubscribeEventsResponse>;
7750                        type Future = BoxFuture<
7751                            tonic::Response<Self::ResponseStream>,
7752                            tonic::Status,
7753                        >;
7754                        fn call(
7755                            &mut self,
7756                            request: tonic::Request<super::SubscribeEventsRequest>,
7757                        ) -> Self::Future {
7758                            let inner = Arc::clone(&self.0);
7759                            let fut = async move {
7760                                <T as SubscriptionService>::subscribe_events(
7761                                        &inner,
7762                                        request,
7763                                    )
7764                                    .await
7765                            };
7766                            Box::pin(fut)
7767                        }
7768                    }
7769                    let accept_compression_encodings = self.accept_compression_encodings;
7770                    let send_compression_encodings = self.send_compression_encodings;
7771                    let max_decoding_message_size = self.max_decoding_message_size;
7772                    let max_encoding_message_size = self.max_encoding_message_size;
7773                    let inner = self.inner.clone();
7774                    let fut = async move {
7775                        let method = SubscribeEventsSvc(inner);
7776                        let codec = tonic_prost::ProstCodec::default();
7777                        let mut grpc = tonic::server::Grpc::new(codec)
7778                            .apply_compression_config(
7779                                accept_compression_encodings,
7780                                send_compression_encodings,
7781                            )
7782                            .apply_max_message_size_config(
7783                                max_decoding_message_size,
7784                                max_encoding_message_size,
7785                            );
7786                        let res = grpc.server_streaming(method, req).await;
7787                        Ok(res)
7788                    };
7789                    Box::pin(fut)
7790                }
7791                _ => {
7792                    Box::pin(async move {
7793                        let mut response = http::Response::new(
7794                            tonic::body::Body::default(),
7795                        );
7796                        let headers = response.headers_mut();
7797                        headers
7798                            .insert(
7799                                tonic::Status::GRPC_STATUS,
7800                                (tonic::Code::Unimplemented as i32).into(),
7801                            );
7802                        headers
7803                            .insert(
7804                                http::header::CONTENT_TYPE,
7805                                tonic::metadata::GRPC_CONTENT_TYPE,
7806                            );
7807                        Ok(response)
7808                    })
7809                }
7810            }
7811        }
7812    }
7813    impl<T> Clone for SubscriptionServiceServer<T> {
7814        fn clone(&self) -> Self {
7815            let inner = self.inner.clone();
7816            Self {
7817                inner,
7818                accept_compression_encodings: self.accept_compression_encodings,
7819                send_compression_encodings: self.send_compression_encodings,
7820                max_decoding_message_size: self.max_decoding_message_size,
7821                max_encoding_message_size: self.max_encoding_message_size,
7822            }
7823        }
7824    }
7825    /// Generated gRPC service name
7826    pub const SERVICE_NAME: &str = "sui.rpc.v2.SubscriptionService";
7827    impl<T> tonic::server::NamedService for SubscriptionServiceServer<T> {
7828        const NAME: &'static str = SERVICE_NAME;
7829    }
7830}
7831#[non_exhaustive]
7832#[derive(Clone, PartialEq, ::prost::Message)]
7833pub struct SystemState {
7834    /// The version of the system state data structure type.
7835    #[prost(uint64, optional, tag = "1")]
7836    pub version: ::core::option::Option<u64>,
7837    /// The epoch id
7838    #[prost(uint64, optional, tag = "2")]
7839    pub epoch: ::core::option::Option<u64>,
7840    /// The protocol version
7841    #[prost(uint64, optional, tag = "3")]
7842    pub protocol_version: ::core::option::Option<u64>,
7843    /// Information about the validators
7844    #[prost(message, optional, tag = "4")]
7845    pub validators: ::core::option::Option<ValidatorSet>,
7846    /// Storage Fund info
7847    #[prost(message, optional, tag = "5")]
7848    pub storage_fund: ::core::option::Option<StorageFund>,
7849    /// Set of system config parameters
7850    #[prost(message, optional, tag = "6")]
7851    pub parameters: ::core::option::Option<SystemParameters>,
7852    /// The reference gas price for this epoch
7853    #[prost(uint64, optional, tag = "7")]
7854    pub reference_gas_price: ::core::option::Option<u64>,
7855    /// A list of the records of validator reporting each other.
7856    ///
7857    /// There is an entry in this list for each validator that has been reported
7858    /// at least once. Each record contains all the validators that reported
7859    /// them. If a validator has never been reported they don't have a record in this list.
7860    /// This lists persists across epoch: a peer continues being in a reported state until the
7861    /// reporter doesn't explicitly remove their report.
7862    #[prost(message, repeated, tag = "8")]
7863    pub validator_report_records: ::prost::alloc::vec::Vec<ValidatorReportRecord>,
7864    /// Schedule of stake subsidies given out each epoch.
7865    #[prost(message, optional, tag = "9")]
7866    pub stake_subsidy: ::core::option::Option<StakeSubsidy>,
7867    /// Whether the system is running in a downgraded safe mode due to a non-recoverable bug.
7868    /// This is set whenever we failed to execute advance_epoch, and ended up executing advance_epoch_safe_mode.
7869    /// It can be reset once we are able to successfully execute advance_epoch.
7870    /// The rest of the fields starting with `safe_mode_` are accumulated during safe mode
7871    /// when advance_epoch_safe_mode is executed. They will eventually be processed once we
7872    /// are out of safe mode.
7873    #[prost(bool, optional, tag = "10")]
7874    pub safe_mode: ::core::option::Option<bool>,
7875    /// Storage rewards accumulated during safe_mode
7876    #[prost(uint64, optional, tag = "11")]
7877    pub safe_mode_storage_rewards: ::core::option::Option<u64>,
7878    /// Computation rewards accumulated during safe_mode
7879    #[prost(uint64, optional, tag = "12")]
7880    pub safe_mode_computation_rewards: ::core::option::Option<u64>,
7881    /// Storage rebates paid out during safe_mode
7882    #[prost(uint64, optional, tag = "13")]
7883    pub safe_mode_storage_rebates: ::core::option::Option<u64>,
7884    /// Nonrefundable storage fees accumulated during safe_mode
7885    #[prost(uint64, optional, tag = "14")]
7886    pub safe_mode_non_refundable_storage_fee: ::core::option::Option<u64>,
7887    /// Unix timestamp of when this this epoch started
7888    #[prost(uint64, optional, tag = "15")]
7889    pub epoch_start_timestamp_ms: ::core::option::Option<u64>,
7890    /// Any extra fields that's not defined statically.
7891    #[prost(message, optional, tag = "16")]
7892    pub extra_fields: ::core::option::Option<MoveTable>,
7893}
7894#[non_exhaustive]
7895#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7896pub struct ValidatorReportRecord {
7897    /// The address of the validator being reported
7898    #[prost(string, optional, tag = "1")]
7899    pub reported: ::core::option::Option<::prost::alloc::string::String>,
7900    /// The list of validator (addresses) that are reporting on the validator specified by `reported`
7901    #[prost(string, repeated, tag = "2")]
7902    pub reporters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
7903}
7904#[non_exhaustive]
7905#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7906pub struct SystemParameters {
7907    /// The duration of an epoch, in milliseconds.
7908    #[prost(uint64, optional, tag = "1")]
7909    pub epoch_duration_ms: ::core::option::Option<u64>,
7910    /// The starting epoch in which stake subsidies start being paid out
7911    #[prost(uint64, optional, tag = "2")]
7912    pub stake_subsidy_start_epoch: ::core::option::Option<u64>,
7913    /// Minimum number of active validators at any moment.
7914    #[prost(uint64, optional, tag = "3")]
7915    pub min_validator_count: ::core::option::Option<u64>,
7916    /// Maximum number of active validators at any moment.
7917    /// We do not allow the number of validators in any epoch to go above this.
7918    #[prost(uint64, optional, tag = "4")]
7919    pub max_validator_count: ::core::option::Option<u64>,
7920    /// Deprecated.
7921    /// Lower-bound on the amount of stake required to become a validator.
7922    #[prost(uint64, optional, tag = "5")]
7923    pub min_validator_joining_stake: ::core::option::Option<u64>,
7924    /// Deprecated.
7925    /// Validators with stake amount below `validator_low_stake_threshold` are considered to
7926    /// have low stake and will be escorted out of the validator set after being below this
7927    /// threshold for more than `validator_low_stake_grace_period` number of epochs.
7928    #[prost(uint64, optional, tag = "6")]
7929    pub validator_low_stake_threshold: ::core::option::Option<u64>,
7930    /// Deprecated.
7931    /// Validators with stake below `validator_very_low_stake_threshold` will be removed
7932    /// immediately at epoch change, no grace period.
7933    #[prost(uint64, optional, tag = "7")]
7934    pub validator_very_low_stake_threshold: ::core::option::Option<u64>,
7935    /// A validator can have stake below `validator_low_stake_threshold`
7936    /// for this many epochs before being kicked out.
7937    #[prost(uint64, optional, tag = "8")]
7938    pub validator_low_stake_grace_period: ::core::option::Option<u64>,
7939    /// Any extra fields that are not defined statically.
7940    #[prost(message, optional, tag = "9")]
7941    pub extra_fields: ::core::option::Option<MoveTable>,
7942}
7943/// A message that represents a Move `0x2::table::Table` or `0x2::bag::Bag`
7944#[non_exhaustive]
7945#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7946pub struct MoveTable {
7947    /// The UID of the table or bag
7948    #[prost(string, optional, tag = "1")]
7949    pub id: ::core::option::Option<::prost::alloc::string::String>,
7950    /// The size or number of key-value pairs in the table or bag
7951    #[prost(uint64, optional, tag = "2")]
7952    pub size: ::core::option::Option<u64>,
7953}
7954#[non_exhaustive]
7955#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
7956pub struct StakeSubsidy {
7957    /// Balance of SUI set aside for stake subsidies that will be drawn down over time.
7958    #[prost(uint64, optional, tag = "1")]
7959    pub balance: ::core::option::Option<u64>,
7960    /// Count of the number of times stake subsidies have been distributed.
7961    #[prost(uint64, optional, tag = "2")]
7962    pub distribution_counter: ::core::option::Option<u64>,
7963    /// The amount of stake subsidy to be drawn down per distribution.
7964    /// This amount decays and decreases over time.
7965    #[prost(uint64, optional, tag = "3")]
7966    pub current_distribution_amount: ::core::option::Option<u64>,
7967    /// Number of distributions to occur before the distribution amount decays.
7968    #[prost(uint64, optional, tag = "4")]
7969    pub stake_subsidy_period_length: ::core::option::Option<u64>,
7970    /// The rate at which the distribution amount decays at the end of each
7971    /// period. Expressed in basis points.
7972    #[prost(uint32, optional, tag = "5")]
7973    pub stake_subsidy_decrease_rate: ::core::option::Option<u32>,
7974    /// Any extra fields that's not defined statically.
7975    #[prost(message, optional, tag = "6")]
7976    pub extra_fields: ::core::option::Option<MoveTable>,
7977}
7978/// Struct representing the onchain storage fund.
7979#[non_exhaustive]
7980#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
7981pub struct StorageFund {
7982    /// This is the sum of `storage_rebate` of
7983    /// all objects currently stored on-chain. To maintain this invariant, the only inflow of this
7984    /// balance is storage charges collected from transactions, and the only outflow is storage rebates
7985    /// of transactions, including both the portion refunded to the transaction senders as well as
7986    /// the non-refundable portion taken out and put into `non_refundable_balance`.
7987    #[prost(uint64, optional, tag = "1")]
7988    pub total_object_storage_rebates: ::core::option::Option<u64>,
7989    /// Represents any remaining inflow of the storage fund that should not
7990    /// be taken out of the fund.
7991    #[prost(uint64, optional, tag = "2")]
7992    pub non_refundable_balance: ::core::option::Option<u64>,
7993}
7994#[non_exhaustive]
7995#[derive(Clone, PartialEq, ::prost::Message)]
7996pub struct ValidatorSet {
7997    /// Total amount of stake from all active validators at the beginning of the epoch.
7998    /// Written only once per epoch, in `advance_epoch` function.
7999    #[prost(uint64, optional, tag = "1")]
8000    pub total_stake: ::core::option::Option<u64>,
8001    /// The current list of active validators.
8002    #[prost(message, repeated, tag = "2")]
8003    pub active_validators: ::prost::alloc::vec::Vec<Validator>,
8004    /// List of new validator candidates added during the current epoch.
8005    /// They will be processed at the end of the epoch.
8006    ///
8007    /// key: u64 (index), value: 0x3::validator::Validator
8008    #[prost(message, optional, tag = "3")]
8009    pub pending_active_validators: ::core::option::Option<MoveTable>,
8010    /// Removal requests from the validators. Each element is an index
8011    /// pointing to `active_validators`.
8012    #[prost(uint64, repeated, tag = "4")]
8013    pub pending_removals: ::prost::alloc::vec::Vec<u64>,
8014    /// Mappings from staking pool's ID to the sui address of a validator.
8015    ///
8016    /// key: address (staking pool Id), value: address (sui address of the validator)
8017    #[prost(message, optional, tag = "5")]
8018    pub staking_pool_mappings: ::core::option::Option<MoveTable>,
8019    /// Mapping from a staking pool ID to the inactive validator that has that pool as its staking pool.
8020    /// When a validator is deactivated the validator is removed from `active_validators` it
8021    /// is added to this table so that stakers can continue to withdraw their stake from it.
8022    ///
8023    /// key: address (staking pool Id), value: 0x3::validator_wrapper::ValidatorWrapper
8024    #[prost(message, optional, tag = "6")]
8025    pub inactive_validators: ::core::option::Option<MoveTable>,
8026    /// Table storing preactive/candidate validators, mapping their addresses to their `Validator ` structs.
8027    /// When an address calls `request_add_validator_candidate`, they get added to this table and become a preactive
8028    /// validator.
8029    /// When the candidate has met the min stake requirement, they can call `request_add_validator` to
8030    /// officially add them to the active validator set `active_validators` next epoch.
8031    ///
8032    /// key: address (sui address of the validator), value: 0x3::validator_wrapper::ValidatorWrapper
8033    #[prost(message, optional, tag = "7")]
8034    pub validator_candidates: ::core::option::Option<MoveTable>,
8035    /// Table storing the number of epochs during which a validator's stake has been below the low stake threshold.
8036    #[prost(btree_map = "string, uint64", tag = "8")]
8037    pub at_risk_validators: ::prost::alloc::collections::BTreeMap<
8038        ::prost::alloc::string::String,
8039        u64,
8040    >,
8041    /// Any extra fields that's not defined statically.
8042    #[prost(message, optional, tag = "9")]
8043    pub extra_fields: ::core::option::Option<MoveTable>,
8044}
8045/// Definition of a Validator in the system contracts
8046///
8047/// Note: fields of ValidatorMetadata are flattened into this type
8048#[non_exhaustive]
8049#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8050pub struct Validator {
8051    /// A unique human-readable name of this validator.
8052    #[prost(string, optional, tag = "1")]
8053    pub name: ::core::option::Option<::prost::alloc::string::String>,
8054    /// The Sui Address of the validator. This is the sender that created the Validator object,
8055    /// and also the address to send validator/coins to during withdraws.
8056    #[prost(string, optional, tag = "2")]
8057    pub address: ::core::option::Option<::prost::alloc::string::String>,
8058    #[prost(string, optional, tag = "3")]
8059    pub description: ::core::option::Option<::prost::alloc::string::String>,
8060    #[prost(string, optional, tag = "4")]
8061    pub image_url: ::core::option::Option<::prost::alloc::string::String>,
8062    #[prost(string, optional, tag = "5")]
8063    pub project_url: ::core::option::Option<::prost::alloc::string::String>,
8064    /// The public key bytes corresponding to the private key that the validator
8065    /// holds to sign transactions. For now, this is the same as AuthorityName.
8066    #[prost(bytes = "bytes", optional, tag = "7")]
8067    pub protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8068    /// This is a proof that the validator has ownership of the protocol private key
8069    #[prost(bytes = "bytes", optional, tag = "8")]
8070    pub proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8071    /// The public key bytes corresponding to the private key that the validator
8072    /// uses to establish TLS connections
8073    #[prost(bytes = "bytes", optional, tag = "10")]
8074    pub network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8075    /// The public key bytes corresponding to the Narwhal Worker
8076    #[prost(bytes = "bytes", optional, tag = "12")]
8077    pub worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8078    /// The network address of the validator (could also contain extra info such as port, DNS and etc.).
8079    #[prost(string, optional, tag = "13")]
8080    pub network_address: ::core::option::Option<::prost::alloc::string::String>,
8081    /// The address of the validator used for p2p activities such as state sync (could also contain extra info such as port, DNS and etc.).
8082    #[prost(string, optional, tag = "14")]
8083    pub p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8084    /// The address of the narwhal primary
8085    #[prost(string, optional, tag = "15")]
8086    pub primary_address: ::core::option::Option<::prost::alloc::string::String>,
8087    /// The address of the narwhal worker
8088    #[prost(string, optional, tag = "16")]
8089    pub worker_address: ::core::option::Option<::prost::alloc::string::String>,
8090    #[prost(bytes = "bytes", optional, tag = "18")]
8091    pub next_epoch_protocol_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8092    #[prost(bytes = "bytes", optional, tag = "19")]
8093    pub next_epoch_proof_of_possession: ::core::option::Option<::prost::bytes::Bytes>,
8094    #[prost(bytes = "bytes", optional, tag = "21")]
8095    pub next_epoch_network_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8096    #[prost(bytes = "bytes", optional, tag = "23")]
8097    pub next_epoch_worker_public_key: ::core::option::Option<::prost::bytes::Bytes>,
8098    #[prost(string, optional, tag = "24")]
8099    pub next_epoch_network_address: ::core::option::Option<
8100        ::prost::alloc::string::String,
8101    >,
8102    #[prost(string, optional, tag = "25")]
8103    pub next_epoch_p2p_address: ::core::option::Option<::prost::alloc::string::String>,
8104    #[prost(string, optional, tag = "26")]
8105    pub next_epoch_primary_address: ::core::option::Option<
8106        ::prost::alloc::string::String,
8107    >,
8108    #[prost(string, optional, tag = "27")]
8109    pub next_epoch_worker_address: ::core::option::Option<
8110        ::prost::alloc::string::String,
8111    >,
8112    /// Any extra fields that's not defined statically in the `ValidatorMetadata` struct
8113    #[prost(message, optional, tag = "28")]
8114    pub metadata_extra_fields: ::core::option::Option<MoveTable>,
8115    /// The voting power of this validator, which might be different from its
8116    /// stake amount.
8117    #[prost(uint64, optional, tag = "29")]
8118    pub voting_power: ::core::option::Option<u64>,
8119    /// The ID of this validator's current valid `UnverifiedValidatorOperationCap`
8120    #[prost(string, optional, tag = "30")]
8121    pub operation_cap_id: ::core::option::Option<::prost::alloc::string::String>,
8122    /// Gas price quote, updated only at end of epoch.
8123    #[prost(uint64, optional, tag = "31")]
8124    pub gas_price: ::core::option::Option<u64>,
8125    /// Staking pool for this validator.
8126    #[prost(message, optional, tag = "32")]
8127    pub staking_pool: ::core::option::Option<StakingPool>,
8128    /// Commission rate of the validator, in basis point.
8129    #[prost(uint64, optional, tag = "33")]
8130    pub commission_rate: ::core::option::Option<u64>,
8131    /// Total amount of stake that would be active in the next epoch.
8132    #[prost(uint64, optional, tag = "34")]
8133    pub next_epoch_stake: ::core::option::Option<u64>,
8134    /// This validator's gas price quote for the next epoch.
8135    #[prost(uint64, optional, tag = "35")]
8136    pub next_epoch_gas_price: ::core::option::Option<u64>,
8137    /// The commission rate of the validator starting the next epoch, in basis point.
8138    #[prost(uint64, optional, tag = "36")]
8139    pub next_epoch_commission_rate: ::core::option::Option<u64>,
8140    /// Any extra fields that's not defined statically.
8141    #[prost(message, optional, tag = "37")]
8142    pub extra_fields: ::core::option::Option<MoveTable>,
8143}
8144/// A staking pool embedded in each validator struct in the system state object.
8145#[non_exhaustive]
8146#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8147pub struct StakingPool {
8148    /// UID of the StakingPool object
8149    #[prost(string, optional, tag = "1")]
8150    pub id: ::core::option::Option<::prost::alloc::string::String>,
8151    /// The epoch at which this pool became active.
8152    /// The value is `None` if the pool is pre-active and `Some(<epoch_number>)` if active or inactive.
8153    #[prost(uint64, optional, tag = "2")]
8154    pub activation_epoch: ::core::option::Option<u64>,
8155    /// The epoch at which this staking pool ceased to be active. `None` = {pre-active, active},
8156    /// `Some(<epoch_number>)` if in-active, and it was de-activated at epoch `<epoch_number>`.
8157    #[prost(uint64, optional, tag = "3")]
8158    pub deactivation_epoch: ::core::option::Option<u64>,
8159    /// The total number of SUI tokens in this pool, including the SUI in the rewards_pool, as well as in all the principal
8160    /// in the `StakedSui` object, updated at epoch boundaries.
8161    #[prost(uint64, optional, tag = "4")]
8162    pub sui_balance: ::core::option::Option<u64>,
8163    /// The epoch stake rewards will be added here at the end of each epoch.
8164    #[prost(uint64, optional, tag = "5")]
8165    pub rewards_pool: ::core::option::Option<u64>,
8166    /// Total number of pool tokens issued by the pool.
8167    #[prost(uint64, optional, tag = "6")]
8168    pub pool_token_balance: ::core::option::Option<u64>,
8169    /// Exchange rate history of previous epochs.
8170    ///
8171    /// The entries start from the `activation_epoch` of this pool and contains exchange rates at the beginning of each epoch,
8172    /// i.e., right after the rewards for the previous epoch have been deposited into the pool.
8173    ///
8174    /// key: u64 (epoch number), value: PoolTokenExchangeRate
8175    #[prost(message, optional, tag = "7")]
8176    pub exchange_rates: ::core::option::Option<MoveTable>,
8177    /// Pending stake amount for this epoch, emptied at epoch boundaries.
8178    #[prost(uint64, optional, tag = "8")]
8179    pub pending_stake: ::core::option::Option<u64>,
8180    /// Pending stake withdrawn during the current epoch, emptied at epoch boundaries.
8181    /// This includes both the principal and rewards SUI withdrawn.
8182    #[prost(uint64, optional, tag = "9")]
8183    pub pending_total_sui_withdraw: ::core::option::Option<u64>,
8184    /// Pending pool token withdrawn during the current epoch, emptied at epoch boundaries.
8185    #[prost(uint64, optional, tag = "10")]
8186    pub pending_pool_token_withdraw: ::core::option::Option<u64>,
8187    /// Any extra fields that's not defined statically.
8188    #[prost(message, optional, tag = "11")]
8189    pub extra_fields: ::core::option::Option<MoveTable>,
8190}
8191/// A transaction.
8192#[non_exhaustive]
8193#[derive(Clone, PartialEq, ::prost::Message)]
8194pub struct Transaction {
8195    /// This Transaction serialized as BCS.
8196    #[prost(message, optional, tag = "1")]
8197    pub bcs: ::core::option::Option<Bcs>,
8198    /// The digest of this Transaction.
8199    #[prost(string, optional, tag = "2")]
8200    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8201    /// Version of this Transaction.
8202    #[prost(int32, optional, tag = "3")]
8203    pub version: ::core::option::Option<i32>,
8204    #[prost(message, optional, tag = "4")]
8205    pub kind: ::core::option::Option<TransactionKind>,
8206    #[prost(string, optional, tag = "5")]
8207    pub sender: ::core::option::Option<::prost::alloc::string::String>,
8208    #[prost(message, optional, tag = "6")]
8209    pub gas_payment: ::core::option::Option<GasPayment>,
8210    #[prost(message, optional, tag = "7")]
8211    pub expiration: ::core::option::Option<TransactionExpiration>,
8212}
8213/// Payment information for executing a transaction.
8214#[non_exhaustive]
8215#[derive(Clone, PartialEq, ::prost::Message)]
8216pub struct GasPayment {
8217    /// Set of gas objects to use for payment.
8218    #[prost(message, repeated, tag = "1")]
8219    pub objects: ::prost::alloc::vec::Vec<ObjectReference>,
8220    /// Owner of the gas objects, either the transaction sender or a sponsor.
8221    #[prost(string, optional, tag = "2")]
8222    pub owner: ::core::option::Option<::prost::alloc::string::String>,
8223    /// Gas unit price to use when charging for computation.
8224    ///
8225    /// Must be greater than or equal to the network's current RGP (reference gas price).
8226    #[prost(uint64, optional, tag = "3")]
8227    pub price: ::core::option::Option<u64>,
8228    /// Total budget willing to spend for the execution of a transaction.
8229    #[prost(uint64, optional, tag = "4")]
8230    pub budget: ::core::option::Option<u64>,
8231}
8232/// A TTL for a transaction.
8233#[non_exhaustive]
8234#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8235pub struct TransactionExpiration {
8236    #[prost(
8237        enumeration = "transaction_expiration::TransactionExpirationKind",
8238        optional,
8239        tag = "1"
8240    )]
8241    pub kind: ::core::option::Option<i32>,
8242    /// Maximum epoch in which a transaction can be executed. The provided maximal epoch
8243    /// must be greater than or equal to the current epoch for a transaction to execute.
8244    #[prost(uint64, optional, tag = "2")]
8245    pub epoch: ::core::option::Option<u64>,
8246    /// Minimal epoch in which a transaction can be executed. The provided minimal epoch
8247    /// must be less than or equal to the current epoch for a transaction to execute.
8248    #[prost(uint64, optional, tag = "3")]
8249    pub min_epoch: ::core::option::Option<u64>,
8250    /// Minimal UNIX timestamp in which a transaction can be executed. The
8251    /// provided minimal timestamp must be less than or equal to the current
8252    /// clock.
8253    #[prost(message, optional, tag = "4")]
8254    pub min_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8255    /// Maximum UNIX timestamp in which a transaction can be executed. The
8256    /// provided maximal timestamp must be greater than or equal to the current
8257    /// clock.
8258    #[prost(message, optional, tag = "5")]
8259    pub max_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8260    /// ChainId of the network this transaction is intended for in order to prevent cross-chain replay
8261    #[prost(string, optional, tag = "6")]
8262    pub chain: ::core::option::Option<::prost::alloc::string::String>,
8263    /// User-provided uniqueness identifier to differentiate otherwise identical transactions
8264    #[prost(uint32, optional, tag = "7")]
8265    pub nonce: ::core::option::Option<u32>,
8266}
8267/// Nested message and enum types in `TransactionExpiration`.
8268pub mod transaction_expiration {
8269    #[non_exhaustive]
8270    #[derive(
8271        Clone,
8272        Copy,
8273        Debug,
8274        PartialEq,
8275        Eq,
8276        Hash,
8277        PartialOrd,
8278        Ord,
8279        ::prost::Enumeration
8280    )]
8281    #[repr(i32)]
8282    pub enum TransactionExpirationKind {
8283        Unknown = 0,
8284        /// The transaction has no expiration.
8285        None = 1,
8286        /// Validators won't sign and execute transaction unless the expiration epoch
8287        /// is greater than or equal to the current epoch.
8288        Epoch = 2,
8289        /// This variant enables gas payments from address balances.
8290        ///
8291        /// When transactions use address balances for gas payment instead of explicit gas coins,
8292        /// we lose the natural transaction uniqueness and replay prevention that comes from
8293        /// mutation of gas coin objects.
8294        ///
8295        /// By bounding expiration and providing a nonce, validators must only retain
8296        /// executed digests for the maximum possible expiry range to differentiate
8297        /// retries from unique transactions with otherwise identical inputs.
8298        ValidDuring = 3,
8299    }
8300    impl TransactionExpirationKind {
8301        /// String value of the enum field names used in the ProtoBuf definition.
8302        ///
8303        /// The values are not transformed in any way and thus are considered stable
8304        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8305        pub fn as_str_name(&self) -> &'static str {
8306            match self {
8307                Self::Unknown => "TRANSACTION_EXPIRATION_KIND_UNKNOWN",
8308                Self::None => "NONE",
8309                Self::Epoch => "EPOCH",
8310                Self::ValidDuring => "VALID_DURING",
8311            }
8312        }
8313        /// Creates an enum from field names used in the ProtoBuf definition.
8314        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8315            match value {
8316                "TRANSACTION_EXPIRATION_KIND_UNKNOWN" => Some(Self::Unknown),
8317                "NONE" => Some(Self::None),
8318                "EPOCH" => Some(Self::Epoch),
8319                "VALID_DURING" => Some(Self::ValidDuring),
8320                _ => None,
8321            }
8322        }
8323    }
8324}
8325/// Transaction type.
8326#[non_exhaustive]
8327#[derive(Clone, PartialEq, ::prost::Message)]
8328pub struct TransactionKind {
8329    #[prost(enumeration = "transaction_kind::Kind", optional, tag = "1")]
8330    pub kind: ::core::option::Option<i32>,
8331    #[prost(oneof = "transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7, 8")]
8332    pub data: ::core::option::Option<transaction_kind::Data>,
8333}
8334/// Nested message and enum types in `TransactionKind`.
8335pub mod transaction_kind {
8336    #[non_exhaustive]
8337    #[derive(
8338        Clone,
8339        Copy,
8340        Debug,
8341        PartialEq,
8342        Eq,
8343        Hash,
8344        PartialOrd,
8345        Ord,
8346        ::prost::Enumeration
8347    )]
8348    #[repr(i32)]
8349    pub enum Kind {
8350        Unknown = 0,
8351        /// A user transaction comprised of a list of native commands and Move calls.
8352        ProgrammableTransaction = 1,
8353        /// System transaction used to end an epoch.
8354        ///
8355        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8356        /// `EndOfEpochTransaction`).
8357        ChangeEpoch = 2,
8358        /// Transaction used to initialize the chain state.
8359        ///
8360        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8361        /// executed on the chain.
8362        Genesis = 3,
8363        /// V1 consensus commit update.
8364        ConsensusCommitPrologueV1 = 4,
8365        /// Update set of valid JWKs used for zklogin.
8366        AuthenticatorStateUpdate = 5,
8367        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8368        /// the next one.
8369        EndOfEpoch = 6,
8370        /// Randomness update.
8371        RandomnessStateUpdate = 7,
8372        /// V2 consensus commit update.
8373        ConsensusCommitPrologueV2 = 8,
8374        /// V3 consensus commit update.
8375        ConsensusCommitPrologueV3 = 9,
8376        /// V4 consensus commit update.
8377        ConsensusCommitPrologueV4 = 10,
8378        /// A system transaction comprised of a list of native commands and Move calls.
8379        ProgrammableSystemTransaction = 11,
8380    }
8381    impl Kind {
8382        /// String value of the enum field names used in the ProtoBuf definition.
8383        ///
8384        /// The values are not transformed in any way and thus are considered stable
8385        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8386        pub fn as_str_name(&self) -> &'static str {
8387            match self {
8388                Self::Unknown => "KIND_UNKNOWN",
8389                Self::ProgrammableTransaction => "PROGRAMMABLE_TRANSACTION",
8390                Self::ChangeEpoch => "CHANGE_EPOCH",
8391                Self::Genesis => "GENESIS",
8392                Self::ConsensusCommitPrologueV1 => "CONSENSUS_COMMIT_PROLOGUE_V1",
8393                Self::AuthenticatorStateUpdate => "AUTHENTICATOR_STATE_UPDATE",
8394                Self::EndOfEpoch => "END_OF_EPOCH",
8395                Self::RandomnessStateUpdate => "RANDOMNESS_STATE_UPDATE",
8396                Self::ConsensusCommitPrologueV2 => "CONSENSUS_COMMIT_PROLOGUE_V2",
8397                Self::ConsensusCommitPrologueV3 => "CONSENSUS_COMMIT_PROLOGUE_V3",
8398                Self::ConsensusCommitPrologueV4 => "CONSENSUS_COMMIT_PROLOGUE_V4",
8399                Self::ProgrammableSystemTransaction => "PROGRAMMABLE_SYSTEM_TRANSACTION",
8400            }
8401        }
8402        /// Creates an enum from field names used in the ProtoBuf definition.
8403        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8404            match value {
8405                "KIND_UNKNOWN" => Some(Self::Unknown),
8406                "PROGRAMMABLE_TRANSACTION" => Some(Self::ProgrammableTransaction),
8407                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8408                "GENESIS" => Some(Self::Genesis),
8409                "CONSENSUS_COMMIT_PROLOGUE_V1" => Some(Self::ConsensusCommitPrologueV1),
8410                "AUTHENTICATOR_STATE_UPDATE" => Some(Self::AuthenticatorStateUpdate),
8411                "END_OF_EPOCH" => Some(Self::EndOfEpoch),
8412                "RANDOMNESS_STATE_UPDATE" => Some(Self::RandomnessStateUpdate),
8413                "CONSENSUS_COMMIT_PROLOGUE_V2" => Some(Self::ConsensusCommitPrologueV2),
8414                "CONSENSUS_COMMIT_PROLOGUE_V3" => Some(Self::ConsensusCommitPrologueV3),
8415                "CONSENSUS_COMMIT_PROLOGUE_V4" => Some(Self::ConsensusCommitPrologueV4),
8416                "PROGRAMMABLE_SYSTEM_TRANSACTION" => {
8417                    Some(Self::ProgrammableSystemTransaction)
8418                }
8419                _ => None,
8420            }
8421        }
8422    }
8423    #[non_exhaustive]
8424    #[derive(Clone, PartialEq, ::prost::Oneof)]
8425    pub enum Data {
8426        /// A transaction comprised of a list of native commands and Move calls.
8427        #[prost(message, tag = "2")]
8428        ProgrammableTransaction(super::ProgrammableTransaction),
8429        /// System transaction used to end an epoch.
8430        ///
8431        /// The `ChangeEpoch` variant is now deprecated (but the `ChangeEpoch` struct is still used by
8432        /// `EndOfEpochTransaction`).
8433        #[prost(message, tag = "3")]
8434        ChangeEpoch(super::ChangeEpoch),
8435        /// Transaction used to initialize the chain state.
8436        ///
8437        /// Only valid if in the genesis checkpoint (0) and if this is the very first transaction ever
8438        /// executed on the chain.
8439        #[prost(message, tag = "4")]
8440        Genesis(super::GenesisTransaction),
8441        /// consensus commit update info
8442        #[prost(message, tag = "5")]
8443        ConsensusCommitPrologue(super::ConsensusCommitPrologue),
8444        /// Update set of valid JWKs used for zklogin.
8445        #[prost(message, tag = "6")]
8446        AuthenticatorStateUpdate(super::AuthenticatorStateUpdate),
8447        /// Set of operations to run at the end of the epoch to close out the current epoch and start
8448        /// the next one.
8449        #[prost(message, tag = "7")]
8450        EndOfEpoch(super::EndOfEpochTransaction),
8451        /// Randomness update.
8452        #[prost(message, tag = "8")]
8453        RandomnessStateUpdate(super::RandomnessStateUpdate),
8454    }
8455}
8456/// A user transaction.
8457///
8458/// Contains a series of native commands and Move calls where the results of one command can be
8459/// used in future commands.
8460#[non_exhaustive]
8461#[derive(Clone, PartialEq, ::prost::Message)]
8462pub struct ProgrammableTransaction {
8463    /// Input objects or primitive values.
8464    #[prost(message, repeated, tag = "1")]
8465    pub inputs: ::prost::alloc::vec::Vec<Input>,
8466    /// The commands to be executed sequentially. A failure in any command
8467    /// results in the failure of the entire transaction.
8468    #[prost(message, repeated, tag = "2")]
8469    pub commands: ::prost::alloc::vec::Vec<Command>,
8470}
8471/// A single command in a programmable transaction.
8472#[non_exhaustive]
8473#[derive(Clone, PartialEq, ::prost::Message)]
8474pub struct Command {
8475    #[prost(oneof = "command::Command", tags = "1, 2, 3, 4, 5, 6, 7")]
8476    pub command: ::core::option::Option<command::Command>,
8477}
8478/// Nested message and enum types in `Command`.
8479pub mod command {
8480    #[non_exhaustive]
8481    #[derive(Clone, PartialEq, ::prost::Oneof)]
8482    pub enum Command {
8483        /// A call to either an entry or a public Move function.
8484        #[prost(message, tag = "1")]
8485        MoveCall(super::MoveCall),
8486        /// `(Vec<forall T:key+store. T>, address)`
8487        /// It sends n-objects to the specified address. These objects must have store
8488        /// (public transfer) and either the previous owner must be an address or the object must
8489        /// be newly created.
8490        #[prost(message, tag = "2")]
8491        TransferObjects(super::TransferObjects),
8492        /// `(&mut Coin<T>, Vec<u64>)` -> `Vec<Coin<T>>`
8493        /// It splits off some amounts into new coins with those amounts.
8494        #[prost(message, tag = "3")]
8495        SplitCoins(super::SplitCoins),
8496        /// `(&mut Coin<T>, Vec<Coin<T>>)`
8497        /// It merges n-coins into the first coin.
8498        #[prost(message, tag = "4")]
8499        MergeCoins(super::MergeCoins),
8500        /// Publishes a Move package. It takes the package bytes and a list of the package's transitive
8501        /// dependencies to link against on chain.
8502        #[prost(message, tag = "5")]
8503        Publish(super::Publish),
8504        /// `forall T: Vec<T> -> vector<T>`
8505        /// Given n-values of the same type, it constructs a vector. For non-objects or an empty vector,
8506        /// the type tag must be specified.
8507        #[prost(message, tag = "6")]
8508        MakeMoveVector(super::MakeMoveVector),
8509        /// Upgrades a Move package.
8510        /// Takes (in order):
8511        ///
8512        /// 1. A vector of serialized modules for the package.
8513        /// 1. A vector of object ids for the transitive dependencies of the new package.
8514        /// 1. The object ID of the package being upgraded.
8515        /// 1. An argument holding the `UpgradeTicket` that must have been produced from an earlier command in the same
8516        ///    programmable transaction.
8517        #[prost(message, tag = "7")]
8518        Upgrade(super::Upgrade),
8519    }
8520}
8521/// Command to call a Move function.
8522///
8523/// Functions that can be called by a `MoveCall` command are those that have a function signature
8524/// that is either `entry` or `public` (which don't have a reference return type).
8525#[non_exhaustive]
8526#[derive(Clone, PartialEq, ::prost::Message)]
8527pub struct MoveCall {
8528    /// The package containing the module and function.
8529    #[prost(string, optional, tag = "1")]
8530    pub package: ::core::option::Option<::prost::alloc::string::String>,
8531    /// The specific module in the package containing the function.
8532    #[prost(string, optional, tag = "2")]
8533    pub module: ::core::option::Option<::prost::alloc::string::String>,
8534    /// The function to be called.
8535    #[prost(string, optional, tag = "3")]
8536    pub function: ::core::option::Option<::prost::alloc::string::String>,
8537    /// The type arguments to the function.
8538    #[prost(string, repeated, tag = "4")]
8539    pub type_arguments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8540    /// The arguments to the function.
8541    #[prost(message, repeated, tag = "5")]
8542    pub arguments: ::prost::alloc::vec::Vec<Argument>,
8543}
8544/// Command to transfer ownership of a set of objects to an address.
8545#[non_exhaustive]
8546#[derive(Clone, PartialEq, ::prost::Message)]
8547pub struct TransferObjects {
8548    /// Set of objects to transfer.
8549    #[prost(message, repeated, tag = "1")]
8550    pub objects: ::prost::alloc::vec::Vec<Argument>,
8551    /// The address to transfer ownership to.
8552    #[prost(message, optional, tag = "2")]
8553    pub address: ::core::option::Option<Argument>,
8554}
8555/// Command to split a single coin object into multiple coins.
8556#[non_exhaustive]
8557#[derive(Clone, PartialEq, ::prost::Message)]
8558pub struct SplitCoins {
8559    /// The coin to split.
8560    #[prost(message, optional, tag = "1")]
8561    pub coin: ::core::option::Option<Argument>,
8562    /// The amounts to split off.
8563    #[prost(message, repeated, tag = "2")]
8564    pub amounts: ::prost::alloc::vec::Vec<Argument>,
8565}
8566/// Command to merge multiple coins of the same type into a single coin.
8567#[non_exhaustive]
8568#[derive(Clone, PartialEq, ::prost::Message)]
8569pub struct MergeCoins {
8570    /// Coin to merge coins into.
8571    #[prost(message, optional, tag = "1")]
8572    pub coin: ::core::option::Option<Argument>,
8573    /// Set of coins to merge into `coin`.
8574    ///
8575    /// All listed coins must be of the same type and be the same type as `coin`
8576    #[prost(message, repeated, tag = "2")]
8577    pub coins_to_merge: ::prost::alloc::vec::Vec<Argument>,
8578}
8579/// Command to publish a new Move package.
8580#[non_exhaustive]
8581#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8582pub struct Publish {
8583    /// The serialized Move modules.
8584    #[prost(bytes = "bytes", repeated, tag = "1")]
8585    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8586    /// Set of packages that the to-be published package depends on.
8587    #[prost(string, repeated, tag = "2")]
8588    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8589}
8590/// Command to build a Move vector out of a set of individual elements.
8591#[non_exhaustive]
8592#[derive(Clone, PartialEq, ::prost::Message)]
8593pub struct MakeMoveVector {
8594    /// Type of the individual elements.
8595    ///
8596    /// This is required to be set when the type can't be inferred, for example when the set of
8597    /// provided arguments are all pure input values.
8598    #[prost(string, optional, tag = "1")]
8599    pub element_type: ::core::option::Option<::prost::alloc::string::String>,
8600    /// The set individual elements to build the vector with.
8601    #[prost(message, repeated, tag = "2")]
8602    pub elements: ::prost::alloc::vec::Vec<Argument>,
8603}
8604/// Command to upgrade an already published package.
8605#[non_exhaustive]
8606#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8607pub struct Upgrade {
8608    /// The serialized Move modules.
8609    #[prost(bytes = "bytes", repeated, tag = "1")]
8610    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8611    /// Set of packages that the to-be published package depends on.
8612    #[prost(string, repeated, tag = "2")]
8613    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8614    /// Package ID of the package to upgrade.
8615    #[prost(string, optional, tag = "3")]
8616    pub package: ::core::option::Option<::prost::alloc::string::String>,
8617    /// Ticket authorizing the upgrade.
8618    #[prost(message, optional, tag = "4")]
8619    pub ticket: ::core::option::Option<Argument>,
8620}
8621/// Randomness update.
8622#[non_exhaustive]
8623#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8624pub struct RandomnessStateUpdate {
8625    /// Epoch of the randomness state update transaction.
8626    #[prost(uint64, optional, tag = "1")]
8627    pub epoch: ::core::option::Option<u64>,
8628    /// Randomness round of the update.
8629    #[prost(uint64, optional, tag = "2")]
8630    pub randomness_round: ::core::option::Option<u64>,
8631    /// Updated random bytes.
8632    #[prost(bytes = "bytes", optional, tag = "3")]
8633    pub random_bytes: ::core::option::Option<::prost::bytes::Bytes>,
8634    /// The initial version of the randomness object that it was shared at.
8635    #[prost(uint64, optional, tag = "4")]
8636    pub randomness_object_initial_shared_version: ::core::option::Option<u64>,
8637}
8638/// System transaction used to change the epoch.
8639#[non_exhaustive]
8640#[derive(Clone, PartialEq, ::prost::Message)]
8641pub struct ChangeEpoch {
8642    /// The next (to become) epoch ID.
8643    #[prost(uint64, optional, tag = "1")]
8644    pub epoch: ::core::option::Option<u64>,
8645    /// The protocol version in effect in the new epoch.
8646    #[prost(uint64, optional, tag = "2")]
8647    pub protocol_version: ::core::option::Option<u64>,
8648    /// The total amount of gas charged for storage during the epoch.
8649    #[prost(uint64, optional, tag = "3")]
8650    pub storage_charge: ::core::option::Option<u64>,
8651    /// The total amount of gas charged for computation during the epoch.
8652    #[prost(uint64, optional, tag = "4")]
8653    pub computation_charge: ::core::option::Option<u64>,
8654    /// The amount of storage rebate refunded to the txn senders.
8655    #[prost(uint64, optional, tag = "5")]
8656    pub storage_rebate: ::core::option::Option<u64>,
8657    /// The non-refundable storage fee.
8658    #[prost(uint64, optional, tag = "6")]
8659    pub non_refundable_storage_fee: ::core::option::Option<u64>,
8660    /// Unix timestamp when epoch started.
8661    #[prost(message, optional, tag = "7")]
8662    pub epoch_start_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8663    /// System packages (specifically framework and Move stdlib) that are written before the new
8664    /// epoch starts. This tracks framework upgrades on chain. When executing the `ChangeEpoch` txn,
8665    /// the validator must write out the following modules.  Modules are provided with the version they
8666    /// will be upgraded to, their modules in serialized form (which include their package ID), and
8667    /// a list of their transitive dependencies.
8668    #[prost(message, repeated, tag = "8")]
8669    pub system_packages: ::prost::alloc::vec::Vec<SystemPackage>,
8670}
8671/// System package.
8672#[non_exhaustive]
8673#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8674pub struct SystemPackage {
8675    /// Version of the package.
8676    #[prost(uint64, optional, tag = "1")]
8677    pub version: ::core::option::Option<u64>,
8678    /// Move modules.
8679    #[prost(bytes = "bytes", repeated, tag = "2")]
8680    pub modules: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>,
8681    /// Package dependencies.
8682    #[prost(string, repeated, tag = "3")]
8683    pub dependencies: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
8684}
8685/// The genesis transaction.
8686#[non_exhaustive]
8687#[derive(Clone, PartialEq, ::prost::Message)]
8688pub struct GenesisTransaction {
8689    /// Set of genesis objects.
8690    #[prost(message, repeated, tag = "1")]
8691    pub objects: ::prost::alloc::vec::Vec<Object>,
8692}
8693/// Consensus commit prologue system transaction.
8694///
8695/// This message can represent V1, V2, and V3 prologue types.
8696#[non_exhaustive]
8697#[derive(Clone, PartialEq, ::prost::Message)]
8698pub struct ConsensusCommitPrologue {
8699    /// Epoch of the commit prologue transaction.
8700    ///
8701    /// Present in V1, V2, V3, V4.
8702    #[prost(uint64, optional, tag = "1")]
8703    pub epoch: ::core::option::Option<u64>,
8704    /// Consensus round of the commit.
8705    ///
8706    /// Present in V1, V2, V3, V4.
8707    #[prost(uint64, optional, tag = "2")]
8708    pub round: ::core::option::Option<u64>,
8709    /// Unix timestamp from consensus.
8710    ///
8711    /// Present in V1, V2, V3, V4.
8712    #[prost(message, optional, tag = "3")]
8713    pub commit_timestamp: ::core::option::Option<::prost_types::Timestamp>,
8714    /// Digest of consensus output.
8715    ///
8716    /// Present in V2, V3, V4.
8717    #[prost(string, optional, tag = "4")]
8718    pub consensus_commit_digest: ::core::option::Option<::prost::alloc::string::String>,
8719    /// The sub DAG index of the consensus commit. This field is populated if there
8720    /// are multiple consensus commits per round.
8721    ///
8722    /// Present in V3, V4.
8723    #[prost(uint64, optional, tag = "5")]
8724    pub sub_dag_index: ::core::option::Option<u64>,
8725    /// Stores consensus handler determined consensus object version assignments.
8726    ///
8727    /// Present in V3, V4.
8728    #[prost(message, optional, tag = "6")]
8729    pub consensus_determined_version_assignments: ::core::option::Option<
8730        ConsensusDeterminedVersionAssignments,
8731    >,
8732    /// Digest of any additional state computed by the consensus handler.
8733    /// Used to detect forking bugs as early as possible.
8734    ///
8735    /// Present in V4.
8736    #[prost(string, optional, tag = "7")]
8737    pub additional_state_digest: ::core::option::Option<::prost::alloc::string::String>,
8738}
8739/// Object version assignment from consensus.
8740#[non_exhaustive]
8741#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8742pub struct VersionAssignment {
8743    /// `ObjectId` of the object.
8744    #[prost(string, optional, tag = "1")]
8745    pub object_id: ::core::option::Option<::prost::alloc::string::String>,
8746    /// start version of the consensus stream for this object
8747    #[prost(uint64, optional, tag = "2")]
8748    pub start_version: ::core::option::Option<u64>,
8749    /// Assigned version.
8750    #[prost(uint64, optional, tag = "3")]
8751    pub version: ::core::option::Option<u64>,
8752}
8753/// A transaction that was canceled.
8754#[non_exhaustive]
8755#[derive(Clone, PartialEq, ::prost::Message)]
8756pub struct CanceledTransaction {
8757    /// Digest of the canceled transaction.
8758    #[prost(string, optional, tag = "1")]
8759    pub digest: ::core::option::Option<::prost::alloc::string::String>,
8760    /// List of object version assignments.
8761    #[prost(message, repeated, tag = "2")]
8762    pub version_assignments: ::prost::alloc::vec::Vec<VersionAssignment>,
8763}
8764/// Version assignments performed by consensus.
8765#[non_exhaustive]
8766#[derive(Clone, PartialEq, ::prost::Message)]
8767pub struct ConsensusDeterminedVersionAssignments {
8768    /// Version of this message
8769    #[prost(int32, optional, tag = "1")]
8770    pub version: ::core::option::Option<i32>,
8771    /// Canceled transaction version assignment.
8772    #[prost(message, repeated, tag = "3")]
8773    pub canceled_transactions: ::prost::alloc::vec::Vec<CanceledTransaction>,
8774}
8775/// Update the set of valid JWKs.
8776#[non_exhaustive]
8777#[derive(Clone, PartialEq, ::prost::Message)]
8778pub struct AuthenticatorStateUpdate {
8779    /// Epoch of the authenticator state update transaction.
8780    #[prost(uint64, optional, tag = "1")]
8781    pub epoch: ::core::option::Option<u64>,
8782    /// Consensus round of the authenticator state update.
8783    #[prost(uint64, optional, tag = "2")]
8784    pub round: ::core::option::Option<u64>,
8785    /// Newly active JWKs.
8786    #[prost(message, repeated, tag = "3")]
8787    pub new_active_jwks: ::prost::alloc::vec::Vec<ActiveJwk>,
8788    /// The initial version of the authenticator object that it was shared at.
8789    #[prost(uint64, optional, tag = "4")]
8790    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8791}
8792/// A new JWK.
8793#[non_exhaustive]
8794#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
8795pub struct ActiveJwk {
8796    /// Identifier used to uniquely identify a JWK.
8797    #[prost(message, optional, tag = "1")]
8798    pub id: ::core::option::Option<JwkId>,
8799    /// The JWK.
8800    #[prost(message, optional, tag = "2")]
8801    pub jwk: ::core::option::Option<Jwk>,
8802    /// Most recent epoch in which the JWK was validated.
8803    #[prost(uint64, optional, tag = "3")]
8804    pub epoch: ::core::option::Option<u64>,
8805}
8806/// Set of operations run at the end of the epoch to close out the current epoch
8807/// and start the next one.
8808#[non_exhaustive]
8809#[derive(Clone, PartialEq, ::prost::Message)]
8810pub struct EndOfEpochTransaction {
8811    #[prost(message, repeated, tag = "1")]
8812    pub transactions: ::prost::alloc::vec::Vec<EndOfEpochTransactionKind>,
8813}
8814/// Operation run at the end of an epoch.
8815#[non_exhaustive]
8816#[derive(Clone, PartialEq, ::prost::Message)]
8817pub struct EndOfEpochTransactionKind {
8818    #[prost(enumeration = "end_of_epoch_transaction_kind::Kind", optional, tag = "1")]
8819    pub kind: ::core::option::Option<i32>,
8820    #[prost(oneof = "end_of_epoch_transaction_kind::Data", tags = "2, 3, 4, 5, 6, 7")]
8821    pub data: ::core::option::Option<end_of_epoch_transaction_kind::Data>,
8822}
8823/// Nested message and enum types in `EndOfEpochTransactionKind`.
8824pub mod end_of_epoch_transaction_kind {
8825    #[non_exhaustive]
8826    #[derive(
8827        Clone,
8828        Copy,
8829        Debug,
8830        PartialEq,
8831        Eq,
8832        Hash,
8833        PartialOrd,
8834        Ord,
8835        ::prost::Enumeration
8836    )]
8837    #[repr(i32)]
8838    pub enum Kind {
8839        Unknown = 0,
8840        /// End the epoch and start the next one.
8841        ChangeEpoch = 1,
8842        /// Create and initialize the authenticator object used for zklogin.
8843        AuthenticatorStateCreate = 2,
8844        /// Expire JWKs used for zklogin.
8845        AuthenticatorStateExpire = 3,
8846        /// Create and initialize the randomness object.
8847        RandomnessStateCreate = 4,
8848        /// Create and initialize the deny list object.
8849        DenyListStateCreate = 5,
8850        /// Create and initialize the bridge object.
8851        BridgeStateCreate = 6,
8852        /// Initialize the bridge committee.
8853        BridgeCommitteeInit = 7,
8854        /// Execution time observations from the committee to preserve cross epoch
8855        StoreExecutionTimeObservations = 8,
8856        /// Create the accumulator root object.
8857        AccumulatorRootCreate = 9,
8858        /// Create and initialize the Coin Registry object.
8859        CoinRegistryCreate = 10,
8860        /// Create and initialize the Display Registry object.
8861        DisplayRegistryCreate = 11,
8862        /// Create and initialize the Address Alias State object.
8863        AddressAliasStateCreate = 12,
8864        /// Write the end-of-epoch-computed storage cost for accumulator objects.
8865        WriteAccumulatorStorageCost = 13,
8866    }
8867    impl Kind {
8868        /// String value of the enum field names used in the ProtoBuf definition.
8869        ///
8870        /// The values are not transformed in any way and thus are considered stable
8871        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
8872        pub fn as_str_name(&self) -> &'static str {
8873            match self {
8874                Self::Unknown => "KIND_UNKNOWN",
8875                Self::ChangeEpoch => "CHANGE_EPOCH",
8876                Self::AuthenticatorStateCreate => "AUTHENTICATOR_STATE_CREATE",
8877                Self::AuthenticatorStateExpire => "AUTHENTICATOR_STATE_EXPIRE",
8878                Self::RandomnessStateCreate => "RANDOMNESS_STATE_CREATE",
8879                Self::DenyListStateCreate => "DENY_LIST_STATE_CREATE",
8880                Self::BridgeStateCreate => "BRIDGE_STATE_CREATE",
8881                Self::BridgeCommitteeInit => "BRIDGE_COMMITTEE_INIT",
8882                Self::StoreExecutionTimeObservations => {
8883                    "STORE_EXECUTION_TIME_OBSERVATIONS"
8884                }
8885                Self::AccumulatorRootCreate => "ACCUMULATOR_ROOT_CREATE",
8886                Self::CoinRegistryCreate => "COIN_REGISTRY_CREATE",
8887                Self::DisplayRegistryCreate => "DISPLAY_REGISTRY_CREATE",
8888                Self::AddressAliasStateCreate => "ADDRESS_ALIAS_STATE_CREATE",
8889                Self::WriteAccumulatorStorageCost => "WRITE_ACCUMULATOR_STORAGE_COST",
8890            }
8891        }
8892        /// Creates an enum from field names used in the ProtoBuf definition.
8893        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
8894            match value {
8895                "KIND_UNKNOWN" => Some(Self::Unknown),
8896                "CHANGE_EPOCH" => Some(Self::ChangeEpoch),
8897                "AUTHENTICATOR_STATE_CREATE" => Some(Self::AuthenticatorStateCreate),
8898                "AUTHENTICATOR_STATE_EXPIRE" => Some(Self::AuthenticatorStateExpire),
8899                "RANDOMNESS_STATE_CREATE" => Some(Self::RandomnessStateCreate),
8900                "DENY_LIST_STATE_CREATE" => Some(Self::DenyListStateCreate),
8901                "BRIDGE_STATE_CREATE" => Some(Self::BridgeStateCreate),
8902                "BRIDGE_COMMITTEE_INIT" => Some(Self::BridgeCommitteeInit),
8903                "STORE_EXECUTION_TIME_OBSERVATIONS" => {
8904                    Some(Self::StoreExecutionTimeObservations)
8905                }
8906                "ACCUMULATOR_ROOT_CREATE" => Some(Self::AccumulatorRootCreate),
8907                "COIN_REGISTRY_CREATE" => Some(Self::CoinRegistryCreate),
8908                "DISPLAY_REGISTRY_CREATE" => Some(Self::DisplayRegistryCreate),
8909                "ADDRESS_ALIAS_STATE_CREATE" => Some(Self::AddressAliasStateCreate),
8910                "WRITE_ACCUMULATOR_STORAGE_COST" => {
8911                    Some(Self::WriteAccumulatorStorageCost)
8912                }
8913                _ => None,
8914            }
8915        }
8916    }
8917    #[non_exhaustive]
8918    #[derive(Clone, PartialEq, ::prost::Oneof)]
8919    pub enum Data {
8920        /// End the epoch and start the next one.
8921        #[prost(message, tag = "2")]
8922        ChangeEpoch(super::ChangeEpoch),
8923        /// Expire JWKs used for zklogin.
8924        #[prost(message, tag = "3")]
8925        AuthenticatorStateExpire(super::AuthenticatorStateExpire),
8926        /// Execution time observations from the committee to preserve cross epoch
8927        #[prost(message, tag = "4")]
8928        ExecutionTimeObservations(super::ExecutionTimeObservations),
8929        /// ChainId used when initializing the bridge
8930        #[prost(string, tag = "5")]
8931        BridgeChainId(::prost::alloc::string::String),
8932        /// Start version of the Bridge object
8933        #[prost(uint64, tag = "6")]
8934        BridgeObjectVersion(u64),
8935        /// Contains the end-of-epoch-computed storage cost for accumulator objects.
8936        #[prost(uint64, tag = "7")]
8937        StorageCost(u64),
8938    }
8939}
8940/// Expire old JWKs.
8941#[non_exhaustive]
8942#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
8943pub struct AuthenticatorStateExpire {
8944    /// Expire JWKs that have a lower epoch than this.
8945    #[prost(uint64, optional, tag = "1")]
8946    pub min_epoch: ::core::option::Option<u64>,
8947    /// The initial version of the authenticator object that it was shared at.
8948    #[prost(uint64, optional, tag = "2")]
8949    pub authenticator_object_initial_shared_version: ::core::option::Option<u64>,
8950}
8951#[non_exhaustive]
8952#[derive(Clone, PartialEq, ::prost::Message)]
8953pub struct ExecutionTimeObservations {
8954    /// Version of this ExecutionTimeObservations
8955    #[prost(int32, optional, tag = "1")]
8956    pub version: ::core::option::Option<i32>,
8957    #[prost(message, repeated, tag = "2")]
8958    pub observations: ::prost::alloc::vec::Vec<ExecutionTimeObservation>,
8959}
8960#[non_exhaustive]
8961#[derive(Clone, PartialEq, ::prost::Message)]
8962pub struct ExecutionTimeObservation {
8963    #[prost(
8964        enumeration = "execution_time_observation::ExecutionTimeObservationKind",
8965        optional,
8966        tag = "1"
8967    )]
8968    pub kind: ::core::option::Option<i32>,
8969    #[prost(message, optional, tag = "2")]
8970    pub move_entry_point: ::core::option::Option<MoveCall>,
8971    #[prost(message, repeated, tag = "3")]
8972    pub validator_observations: ::prost::alloc::vec::Vec<
8973        ValidatorExecutionTimeObservation,
8974    >,
8975}
8976/// Nested message and enum types in `ExecutionTimeObservation`.
8977pub mod execution_time_observation {
8978    #[non_exhaustive]
8979    #[derive(
8980        Clone,
8981        Copy,
8982        Debug,
8983        PartialEq,
8984        Eq,
8985        Hash,
8986        PartialOrd,
8987        Ord,
8988        ::prost::Enumeration
8989    )]
8990    #[repr(i32)]
8991    pub enum ExecutionTimeObservationKind {
8992        Unknown = 0,
8993        MoveEntryPoint = 1,
8994        TransferObjects = 2,
8995        SplitCoins = 3,
8996        MergeCoins = 4,
8997        Publish = 5,
8998        MakeMoveVector = 6,
8999        Upgrade = 7,
9000    }
9001    impl ExecutionTimeObservationKind {
9002        /// String value of the enum field names used in the ProtoBuf definition.
9003        ///
9004        /// The values are not transformed in any way and thus are considered stable
9005        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9006        pub fn as_str_name(&self) -> &'static str {
9007            match self {
9008                Self::Unknown => "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN",
9009                Self::MoveEntryPoint => "MOVE_ENTRY_POINT",
9010                Self::TransferObjects => "TRANSFER_OBJECTS",
9011                Self::SplitCoins => "SPLIT_COINS",
9012                Self::MergeCoins => "MERGE_COINS",
9013                Self::Publish => "PUBLISH",
9014                Self::MakeMoveVector => "MAKE_MOVE_VECTOR",
9015                Self::Upgrade => "UPGRADE",
9016            }
9017        }
9018        /// Creates an enum from field names used in the ProtoBuf definition.
9019        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9020            match value {
9021                "EXECUTION_TIME_OBSERVATION_KIND_UNKNOWN" => Some(Self::Unknown),
9022                "MOVE_ENTRY_POINT" => Some(Self::MoveEntryPoint),
9023                "TRANSFER_OBJECTS" => Some(Self::TransferObjects),
9024                "SPLIT_COINS" => Some(Self::SplitCoins),
9025                "MERGE_COINS" => Some(Self::MergeCoins),
9026                "PUBLISH" => Some(Self::Publish),
9027                "MAKE_MOVE_VECTOR" => Some(Self::MakeMoveVector),
9028                "UPGRADE" => Some(Self::Upgrade),
9029                _ => None,
9030            }
9031        }
9032    }
9033}
9034#[non_exhaustive]
9035#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
9036pub struct ValidatorExecutionTimeObservation {
9037    /// Bls12381 public key of the validator
9038    #[prost(bytes = "bytes", optional, tag = "1")]
9039    pub validator: ::core::option::Option<::prost::bytes::Bytes>,
9040    /// Duration of an execution observation
9041    #[prost(message, optional, tag = "2")]
9042    pub duration: ::core::option::Option<::prost_types::Duration>,
9043}
9044#[non_exhaustive]
9045#[derive(Clone, PartialEq, ::prost::Message)]
9046pub struct ExecuteTransactionRequest {
9047    /// The transaction to execute.
9048    #[prost(message, optional, tag = "1")]
9049    pub transaction: ::core::option::Option<Transaction>,
9050    /// Set of `UserSignature`s authorizing the execution of the provided
9051    /// transaction.
9052    #[prost(message, repeated, tag = "2")]
9053    pub signatures: ::prost::alloc::vec::Vec<UserSignature>,
9054    /// Mask specifying which fields to read.
9055    /// If no mask is specified, defaults to `effects.status,checkpoint`.
9056    #[prost(message, optional, tag = "3")]
9057    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9058}
9059/// Response message for `NodeService.ExecuteTransaction`.
9060#[non_exhaustive]
9061#[derive(Clone, PartialEq, ::prost::Message)]
9062pub struct ExecuteTransactionResponse {
9063    #[prost(message, optional, tag = "1")]
9064    pub transaction: ::core::option::Option<ExecutedTransaction>,
9065}
9066#[non_exhaustive]
9067#[derive(Clone, PartialEq, ::prost::Message)]
9068pub struct SimulateTransactionRequest {
9069    #[prost(message, optional, tag = "1")]
9070    pub transaction: ::core::option::Option<Transaction>,
9071    /// Mask specifying which fields to read.
9072    #[prost(message, optional, tag = "2")]
9073    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
9074    /// Specify whether checks should be ENABLED (default) or DISABLED while executing the transaction
9075    #[prost(
9076        enumeration = "simulate_transaction_request::TransactionChecks",
9077        optional,
9078        tag = "3"
9079    )]
9080    pub checks: ::core::option::Option<i32>,
9081    /// Perform gas selection based on a budget estimation and include the
9082    /// selected gas payment and budget in the response.
9083    ///
9084    /// This option will be ignored if `checks` is `DISABLED`.
9085    #[prost(bool, optional, tag = "4")]
9086    pub do_gas_selection: ::core::option::Option<bool>,
9087}
9088/// Nested message and enum types in `SimulateTransactionRequest`.
9089pub mod simulate_transaction_request {
9090    /// buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
9091    #[non_exhaustive]
9092    #[derive(
9093        Clone,
9094        Copy,
9095        Debug,
9096        PartialEq,
9097        Eq,
9098        Hash,
9099        PartialOrd,
9100        Ord,
9101        ::prost::Enumeration
9102    )]
9103    #[repr(i32)]
9104    pub enum TransactionChecks {
9105        Enabled = 0,
9106        Disabled = 1,
9107    }
9108    impl TransactionChecks {
9109        /// String value of the enum field names used in the ProtoBuf definition.
9110        ///
9111        /// The values are not transformed in any way and thus are considered stable
9112        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
9113        pub fn as_str_name(&self) -> &'static str {
9114            match self {
9115                Self::Enabled => "ENABLED",
9116                Self::Disabled => "DISABLED",
9117            }
9118        }
9119        /// Creates an enum from field names used in the ProtoBuf definition.
9120        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
9121            match value {
9122                "ENABLED" => Some(Self::Enabled),
9123                "DISABLED" => Some(Self::Disabled),
9124                _ => None,
9125            }
9126        }
9127    }
9128}
9129#[non_exhaustive]
9130#[derive(Clone, PartialEq, ::prost::Message)]
9131pub struct SimulateTransactionResponse {
9132    #[prost(message, optional, tag = "1")]
9133    pub transaction: ::core::option::Option<ExecutedTransaction>,
9134    #[prost(message, repeated, tag = "2")]
9135    pub command_outputs: ::prost::alloc::vec::Vec<CommandResult>,
9136    /// A suggested gas price to use, that is above RGP, in order to provide a
9137    /// better chance of the transaction being included in the presence of
9138    /// congested objects.
9139    #[prost(uint64, optional, tag = "3")]
9140    pub suggested_gas_price: ::core::option::Option<u64>,
9141}
9142/// An intermediate result/output from the execution of a single command
9143#[non_exhaustive]
9144#[derive(Clone, PartialEq, ::prost::Message)]
9145pub struct CommandResult {
9146    #[prost(message, repeated, tag = "1")]
9147    pub return_values: ::prost::alloc::vec::Vec<CommandOutput>,
9148    #[prost(message, repeated, tag = "2")]
9149    pub mutated_by_ref: ::prost::alloc::vec::Vec<CommandOutput>,
9150}
9151#[non_exhaustive]
9152#[derive(Clone, PartialEq, ::prost::Message)]
9153pub struct CommandOutput {
9154    #[prost(message, optional, tag = "1")]
9155    pub argument: ::core::option::Option<Argument>,
9156    #[prost(message, optional, tag = "2")]
9157    pub value: ::core::option::Option<Bcs>,
9158    /// JSON rendering of the output.
9159    #[prost(message, optional, boxed, tag = "3")]
9160    pub json: ::core::option::Option<::prost::alloc::boxed::Box<::prost_types::Value>>,
9161}
9162/// Generated client implementations.
9163pub mod transaction_execution_service_client {
9164    #![allow(
9165        unused_variables,
9166        dead_code,
9167        missing_docs,
9168        clippy::wildcard_imports,
9169        clippy::let_unit_value,
9170    )]
9171    use tonic::codegen::*;
9172    use tonic::codegen::http::Uri;
9173    #[derive(Debug, Clone)]
9174    pub struct TransactionExecutionServiceClient<T> {
9175        inner: tonic::client::Grpc<T>,
9176    }
9177    impl TransactionExecutionServiceClient<tonic::transport::Channel> {
9178        /// Attempt to create a new client by connecting to a given endpoint.
9179        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
9180        where
9181            D: TryInto<tonic::transport::Endpoint>,
9182            D::Error: Into<StdError>,
9183        {
9184            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
9185            Ok(Self::new(conn))
9186        }
9187    }
9188    impl<T> TransactionExecutionServiceClient<T>
9189    where
9190        T: tonic::client::GrpcService<tonic::body::Body>,
9191        T::Error: Into<StdError>,
9192        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
9193        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
9194    {
9195        pub fn new(inner: T) -> Self {
9196            let inner = tonic::client::Grpc::new(inner);
9197            Self { inner }
9198        }
9199        pub fn with_origin(inner: T, origin: Uri) -> Self {
9200            let inner = tonic::client::Grpc::with_origin(inner, origin);
9201            Self { inner }
9202        }
9203        pub fn with_interceptor<F>(
9204            inner: T,
9205            interceptor: F,
9206        ) -> TransactionExecutionServiceClient<InterceptedService<T, F>>
9207        where
9208            F: tonic::service::Interceptor,
9209            T::ResponseBody: Default,
9210            T: tonic::codegen::Service<
9211                http::Request<tonic::body::Body>,
9212                Response = http::Response<
9213                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
9214                >,
9215            >,
9216            <T as tonic::codegen::Service<
9217                http::Request<tonic::body::Body>,
9218            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
9219        {
9220            TransactionExecutionServiceClient::new(
9221                InterceptedService::new(inner, interceptor),
9222            )
9223        }
9224        /// Compress requests with the given encoding.
9225        ///
9226        /// This requires the server to support it otherwise it might respond with an
9227        /// error.
9228        #[must_use]
9229        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9230            self.inner = self.inner.send_compressed(encoding);
9231            self
9232        }
9233        /// Enable decompressing responses.
9234        #[must_use]
9235        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9236            self.inner = self.inner.accept_compressed(encoding);
9237            self
9238        }
9239        /// Limits the maximum size of a decoded message.
9240        ///
9241        /// Default: `4MB`
9242        #[must_use]
9243        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9244            self.inner = self.inner.max_decoding_message_size(limit);
9245            self
9246        }
9247        /// Limits the maximum size of an encoded message.
9248        ///
9249        /// Default: `usize::MAX`
9250        #[must_use]
9251        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9252            self.inner = self.inner.max_encoding_message_size(limit);
9253            self
9254        }
9255        pub async fn execute_transaction(
9256            &mut self,
9257            request: impl tonic::IntoRequest<super::ExecuteTransactionRequest>,
9258        ) -> std::result::Result<
9259            tonic::Response<super::ExecuteTransactionResponse>,
9260            tonic::Status,
9261        > {
9262            self.inner
9263                .ready()
9264                .await
9265                .map_err(|e| {
9266                    tonic::Status::unknown(
9267                        format!("Service was not ready: {}", e.into()),
9268                    )
9269                })?;
9270            let codec = tonic_prost::ProstCodec::default();
9271            let path = http::uri::PathAndQuery::from_static(
9272                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction",
9273            );
9274            let mut req = request.into_request();
9275            req.extensions_mut()
9276                .insert(
9277                    GrpcMethod::new(
9278                        "sui.rpc.v2.TransactionExecutionService",
9279                        "ExecuteTransaction",
9280                    ),
9281                );
9282            self.inner.unary(req, path, codec).await
9283        }
9284        pub async fn simulate_transaction(
9285            &mut self,
9286            request: impl tonic::IntoRequest<super::SimulateTransactionRequest>,
9287        ) -> std::result::Result<
9288            tonic::Response<super::SimulateTransactionResponse>,
9289            tonic::Status,
9290        > {
9291            self.inner
9292                .ready()
9293                .await
9294                .map_err(|e| {
9295                    tonic::Status::unknown(
9296                        format!("Service was not ready: {}", e.into()),
9297                    )
9298                })?;
9299            let codec = tonic_prost::ProstCodec::default();
9300            let path = http::uri::PathAndQuery::from_static(
9301                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction",
9302            );
9303            let mut req = request.into_request();
9304            req.extensions_mut()
9305                .insert(
9306                    GrpcMethod::new(
9307                        "sui.rpc.v2.TransactionExecutionService",
9308                        "SimulateTransaction",
9309                    ),
9310                );
9311            self.inner.unary(req, path, codec).await
9312        }
9313    }
9314}
9315/// Generated server implementations.
9316pub mod transaction_execution_service_server {
9317    #![allow(
9318        unused_variables,
9319        dead_code,
9320        missing_docs,
9321        clippy::wildcard_imports,
9322        clippy::let_unit_value,
9323    )]
9324    use tonic::codegen::*;
9325    /// Generated trait containing gRPC methods that should be implemented for use with TransactionExecutionServiceServer.
9326    #[async_trait]
9327    pub trait TransactionExecutionService: std::marker::Send + std::marker::Sync + 'static {
9328        async fn execute_transaction(
9329            &self,
9330            request: tonic::Request<super::ExecuteTransactionRequest>,
9331        ) -> std::result::Result<
9332            tonic::Response<super::ExecuteTransactionResponse>,
9333            tonic::Status,
9334        > {
9335            Err(tonic::Status::unimplemented("Not yet implemented"))
9336        }
9337        async fn simulate_transaction(
9338            &self,
9339            request: tonic::Request<super::SimulateTransactionRequest>,
9340        ) -> std::result::Result<
9341            tonic::Response<super::SimulateTransactionResponse>,
9342            tonic::Status,
9343        > {
9344            Err(tonic::Status::unimplemented("Not yet implemented"))
9345        }
9346    }
9347    #[derive(Debug)]
9348    pub struct TransactionExecutionServiceServer<T> {
9349        inner: Arc<T>,
9350        accept_compression_encodings: EnabledCompressionEncodings,
9351        send_compression_encodings: EnabledCompressionEncodings,
9352        max_decoding_message_size: Option<usize>,
9353        max_encoding_message_size: Option<usize>,
9354    }
9355    impl<T> TransactionExecutionServiceServer<T> {
9356        pub fn new(inner: T) -> Self {
9357            Self::from_arc(Arc::new(inner))
9358        }
9359        pub fn from_arc(inner: Arc<T>) -> Self {
9360            Self {
9361                inner,
9362                accept_compression_encodings: Default::default(),
9363                send_compression_encodings: Default::default(),
9364                max_decoding_message_size: None,
9365                max_encoding_message_size: None,
9366            }
9367        }
9368        pub fn with_interceptor<F>(
9369            inner: T,
9370            interceptor: F,
9371        ) -> InterceptedService<Self, F>
9372        where
9373            F: tonic::service::Interceptor,
9374        {
9375            InterceptedService::new(Self::new(inner), interceptor)
9376        }
9377        /// Enable decompressing requests with the given encoding.
9378        #[must_use]
9379        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
9380            self.accept_compression_encodings.enable(encoding);
9381            self
9382        }
9383        /// Compress responses with the given encoding, if the client supports it.
9384        #[must_use]
9385        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
9386            self.send_compression_encodings.enable(encoding);
9387            self
9388        }
9389        /// Limits the maximum size of a decoded message.
9390        ///
9391        /// Default: `4MB`
9392        #[must_use]
9393        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
9394            self.max_decoding_message_size = Some(limit);
9395            self
9396        }
9397        /// Limits the maximum size of an encoded message.
9398        ///
9399        /// Default: `usize::MAX`
9400        #[must_use]
9401        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
9402            self.max_encoding_message_size = Some(limit);
9403            self
9404        }
9405    }
9406    impl<T, B> tonic::codegen::Service<http::Request<B>>
9407    for TransactionExecutionServiceServer<T>
9408    where
9409        T: TransactionExecutionService,
9410        B: Body + std::marker::Send + 'static,
9411        B::Error: Into<StdError> + std::marker::Send + 'static,
9412    {
9413        type Response = http::Response<tonic::body::Body>;
9414        type Error = std::convert::Infallible;
9415        type Future = BoxFuture<Self::Response, Self::Error>;
9416        fn poll_ready(
9417            &mut self,
9418            _cx: &mut Context<'_>,
9419        ) -> Poll<std::result::Result<(), Self::Error>> {
9420            Poll::Ready(Ok(()))
9421        }
9422        fn call(&mut self, req: http::Request<B>) -> Self::Future {
9423            match req.uri().path() {
9424                "/sui.rpc.v2.TransactionExecutionService/ExecuteTransaction" => {
9425                    #[allow(non_camel_case_types)]
9426                    struct ExecuteTransactionSvc<T: TransactionExecutionService>(
9427                        pub Arc<T>,
9428                    );
9429                    impl<
9430                        T: TransactionExecutionService,
9431                    > tonic::server::UnaryService<super::ExecuteTransactionRequest>
9432                    for ExecuteTransactionSvc<T> {
9433                        type Response = super::ExecuteTransactionResponse;
9434                        type Future = BoxFuture<
9435                            tonic::Response<Self::Response>,
9436                            tonic::Status,
9437                        >;
9438                        fn call(
9439                            &mut self,
9440                            request: tonic::Request<super::ExecuteTransactionRequest>,
9441                        ) -> Self::Future {
9442                            let inner = Arc::clone(&self.0);
9443                            let fut = async move {
9444                                <T as TransactionExecutionService>::execute_transaction(
9445                                        &inner,
9446                                        request,
9447                                    )
9448                                    .await
9449                            };
9450                            Box::pin(fut)
9451                        }
9452                    }
9453                    let accept_compression_encodings = self.accept_compression_encodings;
9454                    let send_compression_encodings = self.send_compression_encodings;
9455                    let max_decoding_message_size = self.max_decoding_message_size;
9456                    let max_encoding_message_size = self.max_encoding_message_size;
9457                    let inner = self.inner.clone();
9458                    let fut = async move {
9459                        let method = ExecuteTransactionSvc(inner);
9460                        let codec = tonic_prost::ProstCodec::default();
9461                        let mut grpc = tonic::server::Grpc::new(codec)
9462                            .apply_compression_config(
9463                                accept_compression_encodings,
9464                                send_compression_encodings,
9465                            )
9466                            .apply_max_message_size_config(
9467                                max_decoding_message_size,
9468                                max_encoding_message_size,
9469                            );
9470                        let res = grpc.unary(method, req).await;
9471                        Ok(res)
9472                    };
9473                    Box::pin(fut)
9474                }
9475                "/sui.rpc.v2.TransactionExecutionService/SimulateTransaction" => {
9476                    #[allow(non_camel_case_types)]
9477                    struct SimulateTransactionSvc<T: TransactionExecutionService>(
9478                        pub Arc<T>,
9479                    );
9480                    impl<
9481                        T: TransactionExecutionService,
9482                    > tonic::server::UnaryService<super::SimulateTransactionRequest>
9483                    for SimulateTransactionSvc<T> {
9484                        type Response = super::SimulateTransactionResponse;
9485                        type Future = BoxFuture<
9486                            tonic::Response<Self::Response>,
9487                            tonic::Status,
9488                        >;
9489                        fn call(
9490                            &mut self,
9491                            request: tonic::Request<super::SimulateTransactionRequest>,
9492                        ) -> Self::Future {
9493                            let inner = Arc::clone(&self.0);
9494                            let fut = async move {
9495                                <T as TransactionExecutionService>::simulate_transaction(
9496                                        &inner,
9497                                        request,
9498                                    )
9499                                    .await
9500                            };
9501                            Box::pin(fut)
9502                        }
9503                    }
9504                    let accept_compression_encodings = self.accept_compression_encodings;
9505                    let send_compression_encodings = self.send_compression_encodings;
9506                    let max_decoding_message_size = self.max_decoding_message_size;
9507                    let max_encoding_message_size = self.max_encoding_message_size;
9508                    let inner = self.inner.clone();
9509                    let fut = async move {
9510                        let method = SimulateTransactionSvc(inner);
9511                        let codec = tonic_prost::ProstCodec::default();
9512                        let mut grpc = tonic::server::Grpc::new(codec)
9513                            .apply_compression_config(
9514                                accept_compression_encodings,
9515                                send_compression_encodings,
9516                            )
9517                            .apply_max_message_size_config(
9518                                max_decoding_message_size,
9519                                max_encoding_message_size,
9520                            );
9521                        let res = grpc.unary(method, req).await;
9522                        Ok(res)
9523                    };
9524                    Box::pin(fut)
9525                }
9526                _ => {
9527                    Box::pin(async move {
9528                        let mut response = http::Response::new(
9529                            tonic::body::Body::default(),
9530                        );
9531                        let headers = response.headers_mut();
9532                        headers
9533                            .insert(
9534                                tonic::Status::GRPC_STATUS,
9535                                (tonic::Code::Unimplemented as i32).into(),
9536                            );
9537                        headers
9538                            .insert(
9539                                http::header::CONTENT_TYPE,
9540                                tonic::metadata::GRPC_CONTENT_TYPE,
9541                            );
9542                        Ok(response)
9543                    })
9544                }
9545            }
9546        }
9547    }
9548    impl<T> Clone for TransactionExecutionServiceServer<T> {
9549        fn clone(&self) -> Self {
9550            let inner = self.inner.clone();
9551            Self {
9552                inner,
9553                accept_compression_encodings: self.accept_compression_encodings,
9554                send_compression_encodings: self.send_compression_encodings,
9555                max_decoding_message_size: self.max_decoding_message_size,
9556                max_encoding_message_size: self.max_encoding_message_size,
9557            }
9558        }
9559    }
9560    /// Generated gRPC service name
9561    pub const SERVICE_NAME: &str = "sui.rpc.v2.TransactionExecutionService";
9562    impl<T> tonic::server::NamedService for TransactionExecutionServiceServer<T> {
9563        const NAME: &'static str = SERVICE_NAME;
9564    }
9565}